Skip to content

Commit 4c7b045

Browse files
locus313Copilot
andauthored
feat: add Copilot skills and path-scoped instructions (#11)
Skills (.github/skills/): - ai-ready — analyze repo and generate AI-ready config files - commit-message-storyteller — narrative conventional commit messages - conventional-branch — branch naming per Conventional Branch spec - create-agentsmd — generate AGENTS.md for a repository - create-implementation-plan — create implementation plan documents - documentation-writer — Diátaxis-based technical documentation - github-actions-runtime-upgrade-conventions — upgrade Actions runtimes - github-copilot-starter — set up Copilot config for new projects - harness-engineering — turn agent failures into durable instructions - refactor — surgical code refactoring skill Instructions (.github/instructions/): - context-engineering — structure code to maximize Copilot context - hooks — authoring safe and portable lifecycle hooks - makefile — GNU Make best practices - qa-engineering-best-practices — test strategy, naming, assertions - self-explanatory-code-commenting — comment only when necessary Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent c5716e9 commit 4c7b045

20 files changed

Lines changed: 4290 additions & 0 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
description: 'Guidelines for structuring code and projects to maximize GitHub Copilot effectiveness through better context management'
3+
applyTo: '**'
4+
---
5+
6+
# Context Engineering
7+
8+
Principles for helping GitHub Copilot understand your codebase and provide better suggestions.
9+
10+
## Project Structure
11+
12+
- **Use descriptive file paths**: `src/auth/middleware.ts` > `src/utils/m.ts`. Copilot uses paths to infer intent.
13+
- **Colocate related code**: Keep components, tests, types, and hooks together. One search pattern should find everything related.
14+
- **Export public APIs from index files**: What's exported is the contract; what's not is internal. This helps Copilot understand boundaries.
15+
16+
## Code Patterns
17+
18+
- **Prefer explicit types over inference**: Type annotations are context. `function getUser(id: string): Promise<User>` tells Copilot more than `function getUser(id)`.
19+
- **Use semantic names**: `activeAdultUsers` > `x`. Self-documenting code is AI-readable code.
20+
- **Define constants**: `MAX_RETRY_ATTEMPTS = 3` > magic number `3`. Named values carry meaning.
21+
22+
## Working with Copilot
23+
24+
- **Keep relevant files open in tabs**: Copilot uses open tabs as context signals. Working on auth? Open auth-related files.
25+
- **Position cursor intentionally**: Copilot prioritizes code near your cursor. Put cursor where context matters.
26+
- **Use Copilot Chat for complex tasks**: Inline completions have minimal context. Chat mode sees more files.
27+
28+
## Context Hints
29+
30+
- **Add a COPILOT.md file**: Document architecture decisions, patterns, and conventions Copilot should follow.
31+
- **Use strategic comments**: At the top of complex modules, briefly describe the flow or purpose.
32+
- **Reference patterns explicitly**: "Follow the same pattern as `src/api/users.ts`" gives Copilot a concrete example.
33+
34+
## Multi-File Changes
35+
36+
- **Describe scope first**: Tell Copilot all files involved before asking for changes. "I need to update the User model, API endpoint, and tests."
37+
- **Work incrementally**: One file at a time, verifying each change. Don't ask for everything at once.
38+
- **Check understanding**: Ask "What files would you need to see?" before complex refactors.
39+
40+
## When Copilot Struggles
41+
42+
- **Missing context**: Open the relevant files in tabs, or explicitly paste code snippets.
43+
- **Stale suggestions**: Copilot may not see recent changes. Re-open files or restart the session.
44+
- **Generic answers**: Be more specific. Add constraints, mention frameworks, reference existing code.

0 commit comments

Comments
 (0)