{"kind":"AgentDefinition","metadata":{"namespace":"community","name":"context-engineering","version":"0.1.0"},"spec":{"agents_md":"---\ndescription: 'Guidelines for structuring code and projects to maximize GitHub Copilot effectiveness through better context management'\napplyTo: '**'\n---\n\n# Context Engineering\n\nPrinciples for helping GitHub Copilot understand your codebase and provide better suggestions.\n\n## Project Structure\n\n- **Use descriptive file paths**: `src/auth/middleware.ts` \u003e `src/utils/m.ts`. Copilot uses paths to infer intent.\n- **Colocate related code**: Keep components, tests, types, and hooks together. One search pattern should find everything related.\n- **Export public APIs from index files**: What's exported is the contract; what's not is internal. This helps Copilot understand boundaries.\n\n## Code Patterns\n\n- **Prefer explicit types over inference**: Type annotations are context. `function getUser(id: string): Promise\u003cUser\u003e` tells Copilot more than `function getUser(id)`.\n- **Use semantic names**: `activeAdultUsers` \u003e `x`. Self-documenting code is AI-readable code.\n- **Define constants**: `MAX_RETRY_ATTEMPTS = 3` \u003e magic number `3`. Named values carry meaning.\n\n## Working with Copilot\n\n- **Keep relevant files open in tabs**: Copilot uses open tabs as context signals. Working on auth? Open auth-related files.\n- **Position cursor intentionally**: Copilot prioritizes code near your cursor. Put cursor where context matters.\n- **Use Copilot Chat for complex tasks**: Inline completions have minimal context. Chat mode sees more files.\n\n## Context Hints\n\n- **Add a COPILOT.md file**: Document architecture decisions, patterns, and conventions Copilot should follow.\n- **Use strategic comments**: At the top of complex modules, briefly describe the flow or purpose.\n- **Reference patterns explicitly**: \"Follow the same pattern as `src/api/users.ts`\" gives Copilot a concrete example.\n\n## Multi-File Changes\n\n- **Describe scope first**: Tell Copilot all files involved before asking for changes. \"I need to update the User model, API endpoint, and tests.\"\n- **Work incrementally**: One file at a time, verifying each change. Don't ask for everything at once.\n- **Check understanding**: Ask \"What files would you need to see?\" before complex refactors.\n\n## When Copilot Struggles\n\n- **Missing context**: Open the relevant files in tabs, or explicitly paste code snippets.\n- **Stale suggestions**: Copilot may not see recent changes. Re-open files or restart the session.\n- **Generic answers**: Be more specific. Add constraints, mention frameworks, reference existing code.\n","description":"Guidelines for structuring code and projects to maximize GitHub Copilot effectiveness through better context management","import":{"commit_sha":"541b7819d8c3545c6df122491af4fa1eae415779","imported_at":"2026-05-18T20:05:35Z","license_text":"MIT License\n\nCopyright GitHub, Inc.\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.","owner":"github","repo":"github/awesome-copilot","source_url":"https://github.com/github/awesome-copilot/blob/541b7819d8c3545c6df122491af4fa1eae415779/instructions/context-engineering.instructions.md"},"manifest":{}},"content_hash":[47,234,55,49,46,119,236,178,32,25,142,164,112,146,208,218,137,145,16,218,32,119,81,218,193,197,66,203,104,179,13,44],"trust_level":"unsigned","yanked":false}
