Context Engineering enhances coding agents like Claude Code and GitHub Copilot by providing precise context. It benefits developers and operations teams by improving code accuracy and reducing debugging time. Integrates with IDEs and version control systems.
git clone https://github.com/wmeints/context-engineering.gitContext Engineering enhances coding agents like Claude Code and GitHub Copilot by providing precise context. It benefits developers and operations teams by improving code accuracy and reducing debugging time. Integrates with IDEs and version control systems.
1. **Identify Context Sources:** Gather files, logs, and config paths relevant to your task (e.g., `src/`, `logs/`, `.env`). Use `git log --oneline -n 10` to find recent commits. 2. **Structure the Prompt:** Fill the template with placeholders like `[TASK]`, `[FILES_OR_MODULES]`, and `[KEYWORD]`. For example: `[TASK] = "Debug memory leak in API gateway"`, `[FILES_OR_MODULES] = "src/gateway/handler.py"`. 3. **Use IDE Shortcuts:** In VS Code, highlight code snippets and use `Ctrl+Shift+P` > "Claude: Add Context" to auto-populate the prompt. For GitHub Copilot, prefix comments with `# Context:` to trigger context injection. 4. **Iterate with Feedback:** After the AI generates a response, review its output and refine the context. For instance, if the AI misses a dependency, add it to `[CONFIG_FILE]` and regenerate. 5. **Automate Context Collection:** Use scripts like `find . -name "*.py" -exec grep -l "oauth2" {} \;` to dynamically populate `[FILES_OR_MODULES]` before pasting into the prompt.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/wmeints/context-engineeringCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Generate precise context for [TASK] in [PROJECT_NAME]. Include: 1) Relevant code snippets from [FILES_OR_MODULES], 2) Recent commit messages or PR descriptions related to [KEYWORD], 3) Error logs or test failures from [TEST_SUITE], and 4) Dependencies or environment variables from [CONFIG_FILE]. Format as a structured context brief for [AI_CODING_TOOL].
### Context Brief for Implementing OAuth2 in `auth-service`
**1. Code Snippets:**
From `src/auth/oauth2.py` (v1.2.3):
```python
class OAuth2Client:
def __init__(self, client_id, client_secret):
self.token_url = "https://auth.example.com/oauth/token"
self.scope = ["read:user", "write:repo"]
```
**2. Recent Commits:**
- `feat: add refresh token support` (PR #45, 2024-05-12)
- `fix: validate token expiry before use` (Commit 7a8b9c1, 2024-05-10)
**3. Error Logs:**
```
ERROR: OAuth2Client - Token refresh failed: 401 Unauthorized
Request: POST https://auth.example.com/oauth/token
Headers: {'Content-Type': 'application/x-www-form-urlencoded'}
Body: client_id=...&client_secret=...&grant_type=refresh_token
```
**4. Dependencies:**
- `requests>=2.31.0` (from `requirements.txt`)
- `python-dotenv>=1.0.0` (for `.env` file parsing)
**Task:** Implement a retry mechanism for token refresh failures with exponential backoff. Prioritize handling 401 errors first.Let’s build from here, together
AI assistant built for thoughtful, nuanced conversation
Cloud ETL platform for non-technical data integration
Get more done every day with Microsoft Teams – powered by AI
Customer feedback management made simple
Design, document, and generate code for APIs with interactive tools for developers.
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan