Context Engineering
Guidelines for structuring code and projects to maximize GitHub Copilot effectiveness through better context management
MCP get_skill({ skillId: "context-engineering-8b360a59" })Use this skill with your agent
Create a free account and connect via MCP
# Context Engineering Principles for helping GitHub Copilot understand your codebase and provide better suggestions. ## Project Structure - **Use descriptive file paths**: `src/auth/middleware.ts` > `src/utils/m.ts`. Copilot uses paths to infer intent. - **Colocate related code**: Keep components, tests, types, and hooks together. One search pattern should find everything related. - **Export public APIs from index files**: What's exported is the contract; what's not is internal. This helps Copilot understand boundaries. ## Code Patterns - **Prefer explicit types over inference**: Type annotations are context. `function getUser(id: string): Promise<User>` tells Copilot more than `function getUser(id)`. - **Use semantic names**: `activeAdultUsers` > `x`. Self-documenting code is AI-readable code. - **Define constants**: `MAX_RETRY_ATTEMPTS = 3` > magic number `3`. Named values carry meaning. ## Working with Copilot - **Keep relevant files open in tabs**: Copilot uses open tabs as context signals. Working on auth? Open auth-related files. - **Position cursor intentionally**: Copilot prioritizes code near your cursor. Put cursor where context matters. - **Use Copilot Chat for complex tasks**: Inline completions have minimal context. Chat mode sees more files. ## Context Hints - **Add a COPILOT.md file**: Document architecture decisions, patterns, and conventions Copilot should follow. - **Use strategic comments**: At the top of complex modules, briefly describe the flow or purpose. - **Reference patterns explicitly**: "Follow the same pattern as `src/api/users.ts`" gives Copilot a concrete example. ## Multi-File Changes - **Describe scope first**: Tell Copilot all files involved before asking for changes. "I need to update the User model, API endpoint, and tests." - **Work incrementally**: One file at a time, verifying each change. Don't ask for everything at once. - **Check understanding**: Ask "What files would you need to see?" before complex refactors. ## When Copilot Struggles - **Missing context**: Open the relevant files in tabs, or explicitly paste code snippets. - **Stale suggestions**: Copilot may not see recent changes. Re-open files or restart the session. - **Generic answers**: Be more specific. Add constraints, mention frameworks, reference existing code.
Related Skills
More skills in Software Engineering
Accessibility Standards
Comprehensive web accessibility standards based on WCAG 2.2 AA, with 38+ anti-patterns, legal enforcement context (EAA, ADA Title II), WAI-ARIA patterns, and framework-specific fixes for modern web frameworks and libraries.
Accord
Authoring unified specification packages across Business/Development/Design teams via staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria). No code. Use when authoring cross-team specs, building L0-L3 packages, or aligning Biz/Dev/Design on a single source of truth.
Acquire Codebase Knowledge
Use this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.
Acreadiness Assess
Run the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc readiness` and hands off rendering to the @ai-readiness-reporter custom agent. Supports policies (--policy) for org-specific scoring. Use when asked to assess, audit, or score the AI readiness of a repo.
Acreadiness Generate Instructions
Generate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS Code) plus optional per-area .instructions.md files with applyTo globs for monorepos. Use after running /acreadiness-assess to close gaps in the AI Tooling pillar.
Acreadiness Policy
Help the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks, overriding impact/level, setting pass-rate thresholds, or chaining org baselines with team overrides. Use when the user asks about strict mode, AI-only scoring, custom weights, CI gating, or wants org-wide standardisation.
Explore Other Categories
Skills from other categories with shared topics
Arduino Azure IoT Edge Integration
Design and implement Arduino integration with Azure IoT Hub and IoT Edge, including secure provisioning, resilient telemetry, command handling, and production guardrails.
Arm Migration Agent
Arm Cloud Migration Assistant accelerates moving x86 workloads to Arm infrastructure. It scans the repository for architecture assumptions, portability issues, container base image and dependency incompatibilities, and recommends Arm-optimized changes. It can drive multi-arch container builds, validate performance, and guide optimization, enabling smooth cross-platform deployment directly inside GitHub.
AWS AppSync Event API Instructions
Production-grade guidance for AWS AppSync Event API handlers using APPSYNC_JS runtime restrictions, utilities, modules, and datasource patterns