@m2015agg/git-skill 0.5.8 → 0.5.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,7 +6,7 @@ import { installHook } from "../util/hooks.js";
6
6
  import { isGitRepo } from "../util/git.js";
7
7
  import { upsertSection } from "../util/claude-md.js";
8
8
  import { getSkillDoc } from "./docs.js";
9
- import { WALKTHROUGH, REVIEW_COMMAND, PLAN_COMMAND, IMPLEMENT_COMMAND, FINALIZE_COMMAND } from "../templates/walkthrough.js";
9
+ import { WALKTHROUGH, REVIEW_COMMAND, PLAN_COMMAND, IMPLEMENT_COMMAND, FINALIZE_COMMAND, TRACE_COMMAND, HISTORICAL_CONTEXT_SKILL } from "../templates/walkthrough.js";
10
10
  import { runContextUpdate } from "./context-update.js";
11
11
  function write(msg) { process.stdout.write(msg); }
12
12
  export function initCommand() {
@@ -98,6 +98,27 @@ export function initCommand() {
98
98
  else {
99
99
  write(" /finalize — already exists (not overwritten)\n");
100
100
  }
101
+ // Install trace command
102
+ const tracePath = join(walkthroughDir, "trace.md");
103
+ if (!existsSync(tracePath)) {
104
+ writeFileSync(tracePath, TRACE_COMMAND);
105
+ write(" /trace — debug via git history (Missing Guard, Parallel Evolution, Stale Side Effect) (NEW)\n");
106
+ }
107
+ else {
108
+ write(" /trace — already exists (not overwritten)\n");
109
+ }
110
+ // Install historical-context-debugging skill
111
+ write(" Installing skills...\n");
112
+ const skillDir = join(cwd, ".claude", "skills", "historical-context-debugging");
113
+ const skillPath = join(skillDir, "SKILL.md");
114
+ if (!existsSync(skillPath)) {
115
+ mkdirSync(skillDir, { recursive: true });
116
+ writeFileSync(skillPath, HISTORICAL_CONTEXT_SKILL);
117
+ write(" historical-context-debugging — auto-triggered when code looks correct but behaves wrong (NEW)\n");
118
+ }
119
+ else {
120
+ write(" historical-context-debugging — already exists (not overwritten)\n");
121
+ }
101
122
  // 6. Run snapshot
102
123
  if (!opts.skipSnapshot) {
103
124
  write("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ACP,KAAK,CAAC,mEAAmE,CAAC,CAAC;YAC7E,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACnC,CAAC;QAED,iBAAiB;QACjB,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAClD,IAAI,CAAC;YACH,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACnC,YAAY,CAAC,MAAM,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC3E,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,CAAC,iEAAiE,CAAC,CAAC;QAC3E,CAAC;QAED,2CAA2C;QAC3C,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACzD,IAAI,CAAC;YACH,gBAAgB,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAChC,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACvD,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,CAAC,2FAA2F,CAAC,CAAC;QACrG,CAAC;QAED,qBAAqB;QACrB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,KAAK,CAAC,2BAA2B,CAAC,CAAC;QACrC,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,qBAAqB,CAAC,CAAC;QAC/B,CAAC;QAED,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,5 +1,7 @@
1
1
  export declare const WALKTHROUGH = "---\ndescription: Interactive walkthrough of git history \u2014 hotspots, decisions, expertise, health trends via git-skill CLI\nallowed-tools: Read, Bash(git-skill:*)\n---\n\n# /git-history \u2014 Codebase History Walkthrough\n\nWhen the user invokes this command, guide them through their codebase history interactively.\n\n## Steps\n\n1. **Check setup health**\n Run: `git-skill doctor`\n Confirm the database is fresh and hook is installed. Note commit count and snapshot age.\n\n2. **Show what's churning**\n Run: `git-skill hotspots --limit 10`\n Explain which files have the most churn. Flag any that are suspicious (high edit count in a short period = instability).\n\n3. **Show recent decisions**\n Run: `git-skill decisions --limit 10`\n Walk through the major decision points \u2014 reverts, big refactors, architecture changes. Explain the impact of each.\n\n4. **Health trends**\n Run: `git-skill trends`\n Summarize the metric trends: is revert rate going up or down? Is scope creep improving? Are commits getting smaller or larger?\n\n5. **Explore a specific area**\n Ask the user which file or directory they want to investigate, or pick the top hotspot.\n Run: `git-skill timeline <path>`\n Show the full evolution \u2014 every commit, who made it, what changed.\n\n6. **Who knows what**\n Run: `git-skill experts <path>` (using the path from step 5)\n Show who has the most context on that area of the codebase.\n\n7. **Check for co-change patterns**\n Run: `git-skill coupling <path>`\n Reveal files that always change together \u2014 hidden dependencies the team should know about.\n\n8. **Open Q&A**\n Say: \"Ask me anything about your codebase history \u2014 I can search commits, trace file evolution, find decision points, or check what was tried before.\"\n\n## Tips\n- Use `git-skill search \"<query>\"` for free-text search across all commits and file paths\n- Use `git-skill why <hash>` to understand the intent behind any commit (requires enrichment)\n- Use `git-skill verify` before committing to check if staged changes repeat past mistakes\n- Use `git-skill diff-summary v1.0..v1.1` for a release-level summary between two refs\n- Use `git-skill regression` to detect change-point shifts in metrics\n";
2
2
  export declare const PLAN_COMMAND = "---\ndescription: \"Plan a feature with git history awareness \u2014 checks what was tried before\"\n---\n\n# Planning Phase\n\nPlan implementation for the requested feature.\n\n**PROCESS:**\n\n1. **Gather Context**:\n - `git-skill search \"<feature>\"` \u2014 check if this was attempted before\n - `git-skill timeline <file>` \u2014 review history of files you plan to change\n - `git-skill hotspots` \u2014 identify unstable files to approach carefully\n - `git-skill coupling <file>` \u2014 what co-changes with target files\n\n2. **Check Git History**: Before designing changes, verify nothing was tried and reverted:\n ```bash\n git-skill search \"<feature keywords>\"\n git-skill decisions --type revert\n ```\n If a similar approach was tried and reverted, note it in the plan and explain why this attempt is different.\n\n3. **Ask Questions**: Clarify requirements (max 5-7 questions)\n\n4. **Write Plan**: Create plan at `docs/plans/YYYY-MM-DD-[feature-name].md`\n\n**PLAN STRUCTURE:**\n```markdown\n# Feature Name\n\n## TLDR\n2-3 sentence summary\n\n## Context from Git History\n- Prior attempts: [what git-skill found]\n- Hotspot files: [files to be careful with]\n- Related decisions: [reverts, refactors that matter]\n\n## Requirements\n- Bullet points\n\n## Implementation Steps\n1. Step 1\n2. Step 2\n\n## Files to Modify/Create\n- `path/to/file` \u2014 description\n\n## Testing\n- How to verify this works\n```\n\n5. **Create GitHub Issue**: `gh issue create --title \"feat: ...\" --body \"See docs/plans/...\"`\n\n6. **STOP**: Wait for approval \u2014 DO NOT start implementation\n\n**CRITICAL:**\n- Check git history FIRST \u2014 don't re-try reverted approaches\n- Plans live in git (`docs/plans/`), not external tools\n- Be concise \u2014 the plan is for implementation, not documentation\n";
3
- export declare const IMPLEMENT_COMMAND = "---\ndescription: \"Implement a planned feature with TDD and frequent commits\"\n---\n\n# Implementation Phase\n\nImplement feature according to the plan file.\n\n**PROCESS:**\n\n1. **Read Plan**: Read the plan file carefully\n2. **Create Branch**:\n ```bash\n git checkout -b [feature-name]\n git push -u origin [feature-name]\n ```\n3. **Create Draft PR**:\n ```bash\n gh pr create --draft --title \"WIP: [Feature Name]\" --body \"See docs/plans/...\"\n ```\n4. **Follow TDD** (Red \u2192 Green \u2192 Refactor):\n - Write test that fails\n - Implement minimal code to pass\n - Refactor while keeping tests green\n\n5. **For Each Task**:\n - Make changes following existing patterns in the codebase\n - Run tests after each change\n - Before committing, verify against history:\n ```bash\n git add .\n git-skill verify\n ```\n If BLOCK: stop and discuss. If WARN: note it and proceed carefully.\n - Push commits frequently (backup points):\n ```bash\n git commit -m \"wip: [task]\" && git push\n ```\n\n6. **STOP**: Notify completion \u2014 DO NOT finalize or merge\n\n**IMPORTANT:**\n- Follow plan exactly \u2014 don't deviate without asking\n- Push commits often (rollback points)\n- Keep user updated every 3-4 tasks\n- DO NOT finalize \u2014 just implement\n";
3
+ export declare const IMPLEMENT_COMMAND = "---\ndescription: \"Implement a planned feature with TDD and frequent commits\"\n---\n\n# Implementation Phase\n\nImplement feature according to the plan file.\n\n**PROCESS:**\n\n1. **Read Plan**: Read the plan file carefully\n2. **Create Branch**:\n ```bash\n git checkout -b [feature-name]\n git push -u origin [feature-name]\n ```\n3. **Create Draft PR**:\n ```bash\n gh pr create --draft --title \"WIP: [Feature Name]\" --body \"See docs/plans/...\"\n ```\n4. **Follow TDD** (Red \u2192 Green \u2192 Refactor):\n - Write test that fails\n - Implement minimal code to pass\n - Refactor while keeping tests green\n\n5. **For Each Task**:\n - Make changes following existing patterns in the codebase\n - Run tests after each change\n - Commit and push frequently (backup points):\n ```bash\n git add . && git commit -m \"wip: [task]\" && git push\n ```\n\n6. **STOP**: Notify completion \u2014 DO NOT finalize or merge\n\n**IMPORTANT:**\n- Follow plan exactly \u2014 don't deviate without asking\n- Push commits often (rollback points)\n- Keep user updated every 3-4 tasks\n- DO NOT finalize \u2014 just implement\n- The /review phase will soft-reset the last commit to run verify on staged changes\n";
4
4
  export declare const FINALIZE_COMMAND = "---\ndescription: \"Finalize a feature \u2014 tests, lint, commit, PR ready\"\n---\n\n# Finalization Phase\n\nFinalize the implemented feature.\n\n**PROCESS:**\n\n1. **Verify Tests Pass**:\n ```bash\n # Run your project's test suite\n npm test # Node.js\n # pytest tests/ # Python\n # cargo test # Rust\n ```\n If tests fail, STOP and return to implementation.\n\n2. **Run git-skill verify**:\n ```bash\n git-skill verify\n ```\n Address any WARN or BLOCK findings before proceeding.\n\n3. **Update Documentation**: Add/update docs if needed\n\n4. **Create Final Commit**:\n ```bash\n git add .\n git commit -m \"feat: [description]\n\n Closes #[issue-number]\"\n git push\n ```\n\n5. **Convert PR to Ready**:\n ```bash\n gh pr ready\n ```\n\n6. **Run Final Verification**:\n ```bash\n git-skill doctor\n git-skill hotspots --limit 3\n ```\n Show output \u2014 never claim completion without proof.\n\n7. **STOP**: Report completion with PR link and verification output\n\n**CHECKLIST:**\n- [ ] All tests passing\n- [ ] `git-skill verify` \u2014 no BLOCK findings\n- [ ] Documentation updated\n- [ ] Commit message follows conventions\n- [ ] PR converted to ready\n- [ ] Verification output shown\n\n**IMPORTANT:**\n- NEVER skip verification\n- NEVER merge PR \u2014 user reviews and merges\n- If anything fails, return to implementation\n";
5
- export declare const REVIEW_COMMAND = "---\ndescription: \"Code review with git history verification \u2014 checks for repeated mistakes before merge\"\n---\n\n# Code Review with History Verification\n\nReview the current branch changes before merging.\n\n**PROCESS:**\n\n1. **Run tests**:\n ```bash\n # Run the project's test suite (adjust command for your project)\n npm test # Node.js\n # pytest # Python\n # cargo test # Rust\n ```\n\n2. **Git History Verification** (prevent re-trying failed approaches):\n ```bash\n git-skill verify\n ```\n If `git-skill verify` returns WARN or BLOCK:\n - **BLOCK**: STOP. This change re-introduces something that was explicitly reverted. Ask the user before proceeding.\n - **WARN**: Note the warning. Check if the current approach addresses the previous failure. Proceed with caution.\n - **PASS**: No concerns from history.\n\n3. **Review scope and codebase health**:\n ```bash\n git-skill diff-summary HEAD~5..HEAD # summarize what changed in this branch\n git-skill hotspots --limit 5 # flag churning files\n ```\n Flag any files being modified that appear in the hotspots list.\n\n4. **Review against criteria**:\n - **Critical** (must fix): Security vulnerabilities, data loss risks, breaking changes, tests failing\n - **Major** (should fix): Missing error handling, pattern violations, missing tests\n - **Minor** (optional): Style, docs, optimization\n\n5. **Auto-fix critical/major issues**:\n - Fix issues following established patterns\n - Run tests after each fix\n - Commit fixes separately\n\n6. **Report findings**:\n - List issues found and fixed\n - List any WARN/BLOCK from git-skill verify\n - Provide verification commands\n - Recommend proceeding or returning to implementation\n\n**IMPORTANT:**\n- `git-skill verify` is authoritative \u2014 if it says something was reverted before, take it seriously\n- Auto-fix critical/major issues, don't just report them\n- Always run tests after fixes\n";
5
+ export declare const REVIEW_COMMAND = "---\ndescription: \"Code review with git history verification \u2014 checks for repeated mistakes before merge\"\n---\n\n# Code Review with History Verification\n\nReview branch changes before merging. Soft-resets last commit to run verify on staged changes.\n\n**PROCESS:**\n\n1. **Soft-reset to get staged changes for verify**:\n ```bash\n git reset --soft HEAD~1\n ```\n This unstages the last commit but keeps all changes staged \u2014 exactly what `git-skill verify` needs.\n\n2. **Run tests**:\n ```bash\n # Run the project's test suite (adjust command for your project)\n npm test # Node.js\n # pytest # Python\n # cargo test # Rust\n ```\n\n3. **Git History Verification** (prevent re-trying failed approaches):\n ```bash\n git-skill verify\n ```\n If `git-skill verify` returns WARN or BLOCK:\n - **BLOCK**: STOP. This change re-introduces something that was explicitly reverted. Ask the user before proceeding.\n - **WARN**: Note the warning. Check if the current approach addresses the previous failure. Proceed with caution.\n - **PASS**: No concerns from history.\n\n4. **Review scope and codebase health**:\n ```bash\n git-skill diff-summary HEAD~5..HEAD # summarize recent branch changes\n git-skill hotspots --limit 5 # flag churning files\n ```\n Flag any modified files that appear in the hotspots list.\n\n5. **Review against criteria**:\n - **Critical** (must fix): Security vulnerabilities, data loss risks, breaking changes, tests failing\n - **Major** (should fix): Missing error handling, pattern violations, missing tests\n - **Minor** (optional): Style, docs, optimization\n\n6. **Auto-fix critical/major issues**:\n - Fix issues following established patterns\n - Run tests after each fix\n - Re-stage fixed files: `git add <fixed-files>`\n\n7. **Re-commit after review passes**:\n ```bash\n git commit -m \"feat: [description]\"\n git push\n ```\n\n8. **Report findings**:\n - List issues found and fixed\n - List any WARN/BLOCK from git-skill verify\n - Provide verification commands\n - Recommend proceeding to /finalize or returning to /implement\n\n**IMPORTANT:**\n- Step 1 soft-resets the WIP commit so verify can inspect staged changes\n- `git-skill verify` only works on STAGED changes \u2014 this is why we reset first\n- `git-skill verify` is authoritative \u2014 if it says something was reverted before, take it seriously\n- Auto-fix critical/major issues, don't just report them\n- Always run tests after fixes\n- Re-commit with a clean message after review passes\n";
6
+ export declare const TRACE_COMMAND = "---\ndescription: \"Debug unexpected behavior by tracing broken assumptions across git history\"\nallowed-tools: Read, Bash(git-skill:*)\n---\n\n# Historical Context Debugging\n\nTrace broken assumptions in code using git-skill history. Use when behavior is wrong but code looks correct in isolation.\n\n**PROCESS:**\n\n1. **Name the symptom precisely** (not \"it's slow\" \u2014 say what specifically is wrong)\n2. **Follow the investigation workflow**:\n - `git-skill search \"<feature keyword>\"` \u2014 find related commits\n - `git-skill why <hash>` \u2014 understand original intent and assumptions\n - `git-skill timeline <file>` \u2014 see all changes chronologically\n - `git-skill search \"<later feature>\"` \u2014 find changes that might conflict\n - `git-skill why <later_hash>` \u2014 did the later change consider the original?\n3. **Identify the fault type**: Missing Guard, Parallel Evolution, or Stale Side Effect\n4. **Fix** and `git-skill verify` before committing\n\n**EXAMPLE:**\n```\n/trace Follow-up messages are triggering fresh RAG even when router says conversational\n```\n";
7
+ export declare const HISTORICAL_CONTEXT_SKILL = "---\nname: historical-context-debugging\ndescription: Use when debugging unexpected behavior where the code looks correct in isolation \u2014 traces broken assumptions across commits using git-skill to find where later changes invalidated earlier logic\n---\n\n# Historical Context Debugging\n\n## Overview\n\nBugs often aren't in the code you're looking at \u2014 they're in the **gap between two changes made months apart**. Feature A was built with assumption X. Feature B was added later and silently violated assumption X. Both look correct in isolation. The bug is invisible without the git history.\n\nThis skill uses `git-skill` to reconstruct the causal chain: why was the original code written, what assumptions did it make, and which later change broke those assumptions?\n\n## When to Use\n\n- Code looks correct but behaves wrong\n- A feature \"used to work\" but stopped\n- You find a guard/flag for one case but not a similar case\n- Two subsystems that should be connected aren't\n- Cache/config is stale despite code being updated\n- You're about to change code but aren't sure why it was written that way\n\n## When NOT to Use\n\n- Bug is clearly a typo or syntax error\n- Code was written in the current session\n- The issue is in a dependency, not your code\n\n## Quick Reference\n\n| Step | Command | What You Learn |\n|------|---------|----------------|\n| Find commits | `git-skill search \"feature keyword\"` | Who touched this area and when |\n| Understand intent | `git-skill why <hash>` | Why the original code was written, what assumptions it made |\n| See evolution | `git-skill timeline <file>` | All changes to a file in chronological order |\n| Find related | `git-skill search \"related feature\"` | Later changes that might affect the same logic |\n| Check for reverts | `git-skill decisions` | Was this approach tried and rolled back before? |\n| Validate fix | `git-skill verify` | Does your staged fix repeat a known mistake? |\n\n## The Three Fault Types\n\n### 1. Missing Guard (most common)\n\nFeature A adds a guard for case X. Feature B adds a new case Y that needs the same guard but nobody adds it.\n\n**Signal:** You find a flag/guard for one field but not a similar field.\n\n**Investigation:**\n```\ngit-skill search \"original_guard\" \u2192 find when guard was added\ngit-skill why <hash> \u2192 understand why it was needed\ngit-skill search \"new_feature\" \u2192 find when new feature was added\ngit-skill why <hash> \u2192 did that commit mention the guard? No.\n```\n\n### 2. Parallel Evolution\n\nTwo systems are built independently that should share logic. They diverge because neither knows about the other.\n\n**Signal:** Two different implementations of the same concept, or a new system never wired into existing code paths.\n\n**Investigation:**\n```\ngit-skill search \"system A\" \u2192 find when A was built\ngit-skill search \"system B\" \u2192 find when B was built\ngit-skill timeline <shared_file> \u2192 was B ever connected to A? No.\n```\n\n### 3. Stale Side Effect\n\nCode change is applied but a side effect (cache, config, external state) isn't updated.\n\n**Signal:** DB/code shows correct value but runtime behavior is wrong.\n\n**Investigation:**\n```\ngit-skill search \"the change\" \u2192 find the update commit\ngit-skill why <hash> \u2192 was cache/config invalidation mentioned?\n# Then check: is the runtime state matching the code state?\n```\n\n## Investigation Workflow\n\n### Step 1: Name the symptom precisely\nBad: \"Chat is slow\"\nGood: \"Follow-up messages trigger fresh RAG even when router says conversational\"\n\n### Step 2: Find the feature that should prevent this\n```bash\ngit-skill search \"relevant feature\"\n```\n\n### Step 3: Understand the original intent\n```bash\ngit-skill why <original_commit>\n```\nRead the enrichment carefully. What **assumptions** did the author make? Write them down.\n\n### Step 4: Find what changed between then and now\n```bash\ngit-skill timeline <affected_file> --since <original_date>\ngit-skill search \"feature that might conflict\"\n```\n\n### Step 5: Check each later change against the assumptions\n```bash\ngit-skill why <later_commit>\n```\nAsk: \"Did this change consider assumption X?\" If not, that's your likely fault.\n\n### Step 6: Fix and verify\n```bash\ngit add <files>\ngit-skill verify\n```\n\n## Common Mistakes\n\n| Mistake | Better |\n|---------|--------|\n| Grep the code and guess | Use `git-skill why` to understand intent first |\n| Fix the symptom without tracing the cause | Trace the full causal chain |\n| Assume the original code is wrong | Often a later change broke its assumption |\n| Skip checking for reverts | `git-skill decisions` \u2014 someone may have tried your fix and rolled it back |\n| Fix one instance of a pattern | Search for ALL instances of the same pattern |\n";
@@ -138,15 +138,9 @@ Implement feature according to the plan file.
138
138
  5. **For Each Task**:
139
139
  - Make changes following existing patterns in the codebase
140
140
  - Run tests after each change
141
- - Before committing, verify against history:
141
+ - Commit and push frequently (backup points):
142
142
  \`\`\`bash
143
- git add .
144
- git-skill verify
145
- \`\`\`
146
- If BLOCK: stop and discuss. If WARN: note it and proceed carefully.
147
- - Push commits frequently (backup points):
148
- \`\`\`bash
149
- git commit -m "wip: [task]" && git push
143
+ git add . && git commit -m "wip: [task]" && git push
150
144
  \`\`\`
151
145
 
152
146
  6. **STOP**: Notify completion — DO NOT finalize or merge
@@ -156,6 +150,7 @@ Implement feature according to the plan file.
156
150
  - Push commits often (rollback points)
157
151
  - Keep user updated every 3-4 tasks
158
152
  - DO NOT finalize — just implement
153
+ - The /review phase will soft-reset the last commit to run verify on staged changes
159
154
  `;
160
155
  export const FINALIZE_COMMAND = `---
161
156
  description: "Finalize a feature — tests, lint, commit, PR ready"
@@ -226,11 +221,17 @@ description: "Code review with git history verification — checks for repeated
226
221
 
227
222
  # Code Review with History Verification
228
223
 
229
- Review the current branch changes before merging.
224
+ Review branch changes before merging. Soft-resets last commit to run verify on staged changes.
230
225
 
231
226
  **PROCESS:**
232
227
 
233
- 1. **Run tests**:
228
+ 1. **Soft-reset to get staged changes for verify**:
229
+ \`\`\`bash
230
+ git reset --soft HEAD~1
231
+ \`\`\`
232
+ This unstages the last commit but keeps all changes staged — exactly what \`git-skill verify\` needs.
233
+
234
+ 2. **Run tests**:
234
235
  \`\`\`bash
235
236
  # Run the project's test suite (adjust command for your project)
236
237
  npm test # Node.js
@@ -238,7 +239,7 @@ Review the current branch changes before merging.
238
239
  # cargo test # Rust
239
240
  \`\`\`
240
241
 
241
- 2. **Git History Verification** (prevent re-trying failed approaches):
242
+ 3. **Git History Verification** (prevent re-trying failed approaches):
242
243
  \`\`\`bash
243
244
  git-skill verify
244
245
  \`\`\`
@@ -247,32 +248,193 @@ Review the current branch changes before merging.
247
248
  - **WARN**: Note the warning. Check if the current approach addresses the previous failure. Proceed with caution.
248
249
  - **PASS**: No concerns from history.
249
250
 
250
- 3. **Review scope and codebase health**:
251
+ 4. **Review scope and codebase health**:
251
252
  \`\`\`bash
252
- git-skill diff-summary HEAD~5..HEAD # summarize what changed in this branch
253
+ git-skill diff-summary HEAD~5..HEAD # summarize recent branch changes
253
254
  git-skill hotspots --limit 5 # flag churning files
254
255
  \`\`\`
255
- Flag any files being modified that appear in the hotspots list.
256
+ Flag any modified files that appear in the hotspots list.
256
257
 
257
- 4. **Review against criteria**:
258
+ 5. **Review against criteria**:
258
259
  - **Critical** (must fix): Security vulnerabilities, data loss risks, breaking changes, tests failing
259
260
  - **Major** (should fix): Missing error handling, pattern violations, missing tests
260
261
  - **Minor** (optional): Style, docs, optimization
261
262
 
262
- 5. **Auto-fix critical/major issues**:
263
+ 6. **Auto-fix critical/major issues**:
263
264
  - Fix issues following established patterns
264
265
  - Run tests after each fix
265
- - Commit fixes separately
266
+ - Re-stage fixed files: \`git add <fixed-files>\`
267
+
268
+ 7. **Re-commit after review passes**:
269
+ \`\`\`bash
270
+ git commit -m "feat: [description]"
271
+ git push
272
+ \`\`\`
266
273
 
267
- 6. **Report findings**:
274
+ 8. **Report findings**:
268
275
  - List issues found and fixed
269
276
  - List any WARN/BLOCK from git-skill verify
270
277
  - Provide verification commands
271
- - Recommend proceeding or returning to implementation
278
+ - Recommend proceeding to /finalize or returning to /implement
272
279
 
273
280
  **IMPORTANT:**
281
+ - Step 1 soft-resets the WIP commit so verify can inspect staged changes
282
+ - \`git-skill verify\` only works on STAGED changes — this is why we reset first
274
283
  - \`git-skill verify\` is authoritative — if it says something was reverted before, take it seriously
275
284
  - Auto-fix critical/major issues, don't just report them
276
285
  - Always run tests after fixes
286
+ - Re-commit with a clean message after review passes
287
+ `;
288
+ export const TRACE_COMMAND = `---
289
+ description: "Debug unexpected behavior by tracing broken assumptions across git history"
290
+ allowed-tools: Read, Bash(git-skill:*)
291
+ ---
292
+
293
+ # Historical Context Debugging
294
+
295
+ Trace broken assumptions in code using git-skill history. Use when behavior is wrong but code looks correct in isolation.
296
+
297
+ **PROCESS:**
298
+
299
+ 1. **Name the symptom precisely** (not "it's slow" — say what specifically is wrong)
300
+ 2. **Follow the investigation workflow**:
301
+ - \`git-skill search "<feature keyword>"\` — find related commits
302
+ - \`git-skill why <hash>\` — understand original intent and assumptions
303
+ - \`git-skill timeline <file>\` — see all changes chronologically
304
+ - \`git-skill search "<later feature>"\` — find changes that might conflict
305
+ - \`git-skill why <later_hash>\` — did the later change consider the original?
306
+ 3. **Identify the fault type**: Missing Guard, Parallel Evolution, or Stale Side Effect
307
+ 4. **Fix** and \`git-skill verify\` before committing
308
+
309
+ **EXAMPLE:**
310
+ \`\`\`
311
+ /trace Follow-up messages are triggering fresh RAG even when router says conversational
312
+ \`\`\`
313
+ `;
314
+ export const HISTORICAL_CONTEXT_SKILL = `---
315
+ name: historical-context-debugging
316
+ description: Use when debugging unexpected behavior where the code looks correct in isolation — traces broken assumptions across commits using git-skill to find where later changes invalidated earlier logic
317
+ ---
318
+
319
+ # Historical Context Debugging
320
+
321
+ ## Overview
322
+
323
+ Bugs often aren't in the code you're looking at — they're in the **gap between two changes made months apart**. Feature A was built with assumption X. Feature B was added later and silently violated assumption X. Both look correct in isolation. The bug is invisible without the git history.
324
+
325
+ This skill uses \`git-skill\` to reconstruct the causal chain: why was the original code written, what assumptions did it make, and which later change broke those assumptions?
326
+
327
+ ## When to Use
328
+
329
+ - Code looks correct but behaves wrong
330
+ - A feature "used to work" but stopped
331
+ - You find a guard/flag for one case but not a similar case
332
+ - Two subsystems that should be connected aren't
333
+ - Cache/config is stale despite code being updated
334
+ - You're about to change code but aren't sure why it was written that way
335
+
336
+ ## When NOT to Use
337
+
338
+ - Bug is clearly a typo or syntax error
339
+ - Code was written in the current session
340
+ - The issue is in a dependency, not your code
341
+
342
+ ## Quick Reference
343
+
344
+ | Step | Command | What You Learn |
345
+ |------|---------|----------------|
346
+ | Find commits | \`git-skill search "feature keyword"\` | Who touched this area and when |
347
+ | Understand intent | \`git-skill why <hash>\` | Why the original code was written, what assumptions it made |
348
+ | See evolution | \`git-skill timeline <file>\` | All changes to a file in chronological order |
349
+ | Find related | \`git-skill search "related feature"\` | Later changes that might affect the same logic |
350
+ | Check for reverts | \`git-skill decisions\` | Was this approach tried and rolled back before? |
351
+ | Validate fix | \`git-skill verify\` | Does your staged fix repeat a known mistake? |
352
+
353
+ ## The Three Fault Types
354
+
355
+ ### 1. Missing Guard (most common)
356
+
357
+ Feature A adds a guard for case X. Feature B adds a new case Y that needs the same guard but nobody adds it.
358
+
359
+ **Signal:** You find a flag/guard for one field but not a similar field.
360
+
361
+ **Investigation:**
362
+ \`\`\`
363
+ git-skill search "original_guard" → find when guard was added
364
+ git-skill why <hash> → understand why it was needed
365
+ git-skill search "new_feature" → find when new feature was added
366
+ git-skill why <hash> → did that commit mention the guard? No.
367
+ \`\`\`
368
+
369
+ ### 2. Parallel Evolution
370
+
371
+ Two systems are built independently that should share logic. They diverge because neither knows about the other.
372
+
373
+ **Signal:** Two different implementations of the same concept, or a new system never wired into existing code paths.
374
+
375
+ **Investigation:**
376
+ \`\`\`
377
+ git-skill search "system A" → find when A was built
378
+ git-skill search "system B" → find when B was built
379
+ git-skill timeline <shared_file> → was B ever connected to A? No.
380
+ \`\`\`
381
+
382
+ ### 3. Stale Side Effect
383
+
384
+ Code change is applied but a side effect (cache, config, external state) isn't updated.
385
+
386
+ **Signal:** DB/code shows correct value but runtime behavior is wrong.
387
+
388
+ **Investigation:**
389
+ \`\`\`
390
+ git-skill search "the change" → find the update commit
391
+ git-skill why <hash> → was cache/config invalidation mentioned?
392
+ # Then check: is the runtime state matching the code state?
393
+ \`\`\`
394
+
395
+ ## Investigation Workflow
396
+
397
+ ### Step 1: Name the symptom precisely
398
+ Bad: "Chat is slow"
399
+ Good: "Follow-up messages trigger fresh RAG even when router says conversational"
400
+
401
+ ### Step 2: Find the feature that should prevent this
402
+ \`\`\`bash
403
+ git-skill search "relevant feature"
404
+ \`\`\`
405
+
406
+ ### Step 3: Understand the original intent
407
+ \`\`\`bash
408
+ git-skill why <original_commit>
409
+ \`\`\`
410
+ Read the enrichment carefully. What **assumptions** did the author make? Write them down.
411
+
412
+ ### Step 4: Find what changed between then and now
413
+ \`\`\`bash
414
+ git-skill timeline <affected_file> --since <original_date>
415
+ git-skill search "feature that might conflict"
416
+ \`\`\`
417
+
418
+ ### Step 5: Check each later change against the assumptions
419
+ \`\`\`bash
420
+ git-skill why <later_commit>
421
+ \`\`\`
422
+ Ask: "Did this change consider assumption X?" If not, that's your likely fault.
423
+
424
+ ### Step 6: Fix and verify
425
+ \`\`\`bash
426
+ git add <files>
427
+ git-skill verify
428
+ \`\`\`
429
+
430
+ ## Common Mistakes
431
+
432
+ | Mistake | Better |
433
+ |---------|--------|
434
+ | Grep the code and guess | Use \`git-skill why\` to understand intent first |
435
+ | Fix the symptom without tracing the cause | Trace the full causal chain |
436
+ | Assume the original code is wrong | Often a later change broke its assumption |
437
+ | Skip checking for reverts | \`git-skill decisions\` — someone may have tried your fix and rolled it back |
438
+ | Fix one instance of a pattern | Search for ALL instances of the same pattern |
277
439
  `;
278
440
  //# sourceMappingURL=walkthrough.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"walkthrough.js","sourceRoot":"","sources":["../../src/templates/walkthrough.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiD1B,CAAC;AAGF,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6HvC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m2015agg/git-skill",
3
- "version": "0.5.8",
3
+ "version": "0.5.10",
4
4
  "description": "Git history intelligence for LLMs — institutional memory over codebase evolution",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",