Commit fe783b7
authored
feat(copilot): canonical copilot-instructions.md + sync script (#115)
## Summary
Ships the canonical \`.github/copilot-instructions.md\` that GitHub
Copilot reads for code review, Chat, and inline generation. Applies to
macbook-dev-setup's own reviews immediately; sibling repos
(mojwang.tech, ihw) sync via the new script and ship separate follow-up
PRs.
## Why canonical + sync (not symlink)
GitHub reads \`.github/copilot-instructions.md\` from each repo's own
blob server-side — symlinks outside the repo don't resolve. Pattern
mirrors existing \`sync-agentic.sh\` (canonical in macbook-dev-setup,
discovery from \`\$SECOND_BRAIN_HOME/repos/personal\`) but copies
instead of symlinking.
## Canonical scope — universal discipline only
After a mid-draft design review, the file deliberately stays out of
project-specific voice. Each repo owns its own tone via its own
\`CLAUDE.md\`. This canonical covers:
- **Review focus:** silent cached failure modes, cache-key consistency,
doc/code drift, defense-in-depth on user-facing paths, duplication and
magic numbers, security + payment-hook adjacency.
- **Universal discipline:** Conventional Commits, <200 LOC/commit, no
\`Co-Authored-By Claude\` tags, PR title/body conventions.
- **Explicit skip list:** AI Gateway migration (Tier 2.1 deferred),
generic "consider adding tests," style-only nits, taste renames.
- **Explicitly out of scope:** project voice — reviewed against each
repo's own stated conventions.
## Sync script
\`scripts/sync-copilot-instructions.sh\`:
- \`set -euo pipefail\`, shellcheck clean
- Auto-discovers sibling repos under
\`\$SECOND_BRAIN_HOME/repos/personal\` that have a \`.github/\`
directory; skips macbook-dev-setup itself
- \`--repo <path>\` arg to target a specific repo
- Idempotent (unchanged-file detection via \`cmp\`)
- Copies, not symlinks — target repos commit their own file
## Pair with a branch ruleset for full auto-assignment
Per the current GitHub docs, auto-requesting Copilot review on every PR
requires a branch ruleset (Settings → Rules → Rulesets → New branch
ruleset → \"Automatically request Copilot code review\"). That's a
GitHub UI step I can't do via PR — enable it alongside merging this.
Together: ruleset = auto-assigned reviewer, this file = house rules
loaded into the review.
## Follow-up PRs (not in this one)
- mojwang.tech — run \`sync-copilot-instructions.sh\`, commit the
resulting \`.github/copilot-instructions.md\`
- ihw — same
Dry-run verified: the script finds both sibling repos and copies
cleanly.1 parent 4ac6296 commit fe783b7
2 files changed
Lines changed: 179 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
0 commit comments