@fernado03/zoo-flow 0.11.1 → 0.11.3

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.
Files changed (69) hide show
  1. package/bin/zoo-flow.js +0 -2
  2. package/package.json +45 -55
  3. package/templates/claude-code/.claude/commands/explore.md +28 -0
  4. package/templates/claude-code/.claude/skills/engineering/commit-and-document/SKILL.md +2 -1
  5. package/templates/claude-code/.claude/skills/engineering/diagnose/SKILL.md +2 -1
  6. package/templates/claude-code/.claude/skills/engineering/explore/SKILL.md +1 -1
  7. package/templates/claude-code/.claude/skills/engineering/feature/SKILL.md +2 -1
  8. package/templates/claude-code/.claude/skills/engineering/fix/SKILL.md +2 -1
  9. package/templates/claude-code/.claude/skills/engineering/grill-with-docs/SKILL.md +2 -1
  10. package/templates/claude-code/.claude/skills/engineering/improve-codebase-architecture/SKILL.md +2 -1
  11. package/templates/claude-code/.claude/skills/engineering/prototype/SKILL.md +2 -1
  12. package/templates/claude-code/.claude/skills/engineering/refactor/SKILL.md +2 -1
  13. package/templates/claude-code/.claude/skills/engineering/review/SKILL.md +2 -1
  14. package/templates/claude-code/.claude/skills/engineering/scaffold-context/SKILL.md +2 -1
  15. package/templates/claude-code/.claude/skills/engineering/setup-matt-pocock-skills/SKILL.md +2 -1
  16. package/templates/claude-code/.claude/skills/engineering/tdd/SKILL.md +2 -1
  17. package/templates/claude-code/.claude/skills/engineering/to-issues/SKILL.md +2 -1
  18. package/templates/claude-code/.claude/skills/engineering/to-prd/SKILL.md +2 -1
  19. package/templates/claude-code/.claude/skills/engineering/triage/SKILL.md +2 -1
  20. package/templates/claude-code/.claude/skills/engineering/tweak/SKILL.md +2 -1
  21. package/templates/claude-code/.claude/skills/engineering/update-docs/SKILL.md +2 -1
  22. package/templates/claude-code/.claude/skills/engineering/verify/SKILL.md +2 -1
  23. package/templates/claude-code/.claude/skills/engineering/zoom-out/SKILL.md +2 -1
  24. package/templates/claude-code/.claude/skills/in-progress/writing-beats/SKILL.md +32 -0
  25. package/templates/claude-code/.claude/skills/in-progress/writing-fragments/SKILL.md +45 -0
  26. package/templates/claude-code/.claude/skills/in-progress/writing-shape/SKILL.md +50 -0
  27. package/templates/claude-code/.claude/skills/misc/git-guardrails-claude-code/SKILL.md +64 -0
  28. package/templates/claude-code/.claude/skills/misc/git-guardrails-claude-code/scripts/block-dangerous-git.sh +25 -0
  29. package/templates/claude-code/.claude/skills/misc/migrate-to-shoehorn/SKILL.md +39 -0
  30. package/templates/claude-code/.claude/skills/misc/scaffold-exercises/SKILL.md +53 -0
  31. package/templates/claude-code/.claude/skills/misc/setup-pre-commit/SKILL.md +62 -0
  32. package/templates/claude-code/.claude/skills/personal/edit-article/SKILL.md +13 -0
  33. package/templates/claude-code/.claude/skills/personal/obsidian-vault/SKILL.md +39 -0
  34. package/templates/claude-code/.claude/skills/productivity/grill-me/SKILL.md +2 -1
  35. package/templates/claude-code/.claude/skills/productivity/handoff/SKILL.md +2 -1
  36. package/templates/claude-code/.claude/skills/productivity/teach/SKILL.md +2 -1
  37. package/templates/claude-code/.claude/skills/productivity/write-a-skill/SKILL.md +2 -1
  38. package/templates/claude-code/CLAUDE.md +23 -0
  39. package/docs/architecture.md +0 -380
  40. package/docs/bloat-control.md +0 -49
  41. package/docs/command-design.md +0 -38
  42. package/docs/command-flow.md +0 -133
  43. package/docs/comparison.md +0 -86
  44. package/docs/context-packs.md +0 -35
  45. package/docs/dogfood/01-small-library.md +0 -28
  46. package/docs/dogfood/02-web-app.md +0 -29
  47. package/docs/dogfood/03-mixed-monorepo.md +0 -29
  48. package/docs/mode-rules.md +0 -86
  49. package/docs/npm-publishing.md +0 -79
  50. package/docs/out-of-scope/mainstream-issue-trackers-only.md +0 -25
  51. package/docs/out-of-scope/question-limits.md +0 -18
  52. package/docs/out-of-scope/setup-skill-verify-mode.md +0 -15
  53. package/docs/overview.md +0 -61
  54. package/docs/philosophy.md +0 -73
  55. package/docs/quality-scorecard.md +0 -23
  56. package/docs/skill-maintenance.md +0 -32
  57. package/docs/skills-index.md +0 -64
  58. package/docs/team-mode.md +0 -46
  59. package/docs/token-budget.md +0 -22
  60. package/docs/troubleshooting.md +0 -288
  61. package/examples/demo-transcripts/01-small-tweak.md +0 -37
  62. package/examples/demo-transcripts/02-unknown-bug-fix.md +0 -37
  63. package/examples/demo-transcripts/03-new-feature.md +0 -37
  64. package/examples/demo-transcripts/04-refactor.md +0 -37
  65. package/examples/demo-transcripts/05-review-and-verify.md +0 -37
  66. package/examples/feature-flow.md +0 -117
  67. package/examples/fix-flow.md +0 -139
  68. package/quality/scorecard.json +0 -88
  69. package/quality/token-budget.exceptions.json +0 -13
package/bin/zoo-flow.js CHANGED
@@ -770,8 +770,6 @@ Next:
770
770
  3. Try a small request, e.g.:
771
771
  change a harmless comment in README
772
772
  4. Or use a slash command like /tweak or /fix
773
-
774
- When workflow choices appear, type the number manually, e.g. 1.
775
773
  `);
776
774
  }
777
775
  }
package/package.json CHANGED
@@ -1,55 +1,45 @@
1
- {
2
- "name": "@fernado03/zoo-flow",
3
- "description": "Workflow control plane for Zoo Code.",
4
- "version": "0.11.1",
5
- "type": "module",
6
- "bin": {
7
- "zoo-flow": "bin/zoo-flow.js"
8
- },
9
- "files": [
10
- "bin",
11
- "scripts",
12
- "templates",
13
- "tests",
14
- "docs",
15
- "examples",
16
- "quality",
17
- "README.md",
18
- "LICENSE"
19
- ],
20
- "license": "MIT",
21
- "repository": {
22
- "type": "git",
23
- "url": "git+https://github.com/Fernado03/zoo-flow.git"
24
- },
25
- "bugs": {
26
- "url": "https://github.com/Fernado03/zoo-flow/issues"
27
- },
28
- "homepage": "https://github.com/Fernado03/zoo-flow#readme",
29
- "keywords": [
30
- "zoo-code",
31
- "zoo",
32
- "ai-agents",
33
- "coding-agents",
34
- "workflow",
35
- "slash-commands",
36
- "custom-modes",
37
- "agent-workflows"
38
- ],
39
- "scripts": {
40
- "check": "node scripts/test-doctor.js && node bin/zoo-flow.js doctor --template-only && node scripts/eval-routing.js && node scripts/check-package-links.js",
41
- "pack:check": "npm pack --dry-run",
42
- "token-budget": "node scripts/token-budget.js",
43
- "package-manifest": "node scripts/check-package-manifest.js",
44
- "golden-transcripts": "node scripts/check-golden-transcripts.js",
45
- "project-shapes": "node scripts/test-project-shapes.js",
46
- "score-quality": "node scripts/score-quality.js",
47
- "release:check": "npm run check && npm run token-budget && npm run package-manifest && npm run golden-transcripts && npm run project-shapes && npm run score-quality && npm run pack:check"
48
- },
49
- "engines": {
50
- "node": ">=18"
51
- },
52
- "publishConfig": {
53
- "access": "public"
54
- }
55
- }
1
+ {
2
+ "name": "@fernado03/zoo-flow",
3
+ "version": "0.11.3",
4
+ "description": "Structured workflow templates for AI coding assistants",
5
+ "type": "module",
6
+ "bin": {
7
+ "zoo-flow": "./bin/zoo-flow.js"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "templates/",
12
+ "scripts/",
13
+ "tests/"
14
+ ],
15
+ "keywords": [
16
+ "ai",
17
+ "coding-assistant",
18
+ "workflow",
19
+ "claude",
20
+ "zoo-code",
21
+ "roo-code"
22
+ ],
23
+ "author": "Fernado",
24
+ "license": "MIT",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/Fernado03/zoo-flow.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/Fernado03/zoo-flow/issues"
31
+ },
32
+ "homepage": "https://github.com/Fernado03/zoo-flow#readme",
33
+ "scripts": {
34
+ "check": "node scripts/test-doctor.js && node bin/zoo-flow.js doctor --template-only && node scripts/eval-routing.js && node scripts/check-package-links.js",
35
+ "token-budget": "node scripts/token-budget.js",
36
+ "package-manifest": "node scripts/check-package-manifest.js",
37
+ "golden-transcripts": "node scripts/check-golden-transcripts.js",
38
+ "project-shapes": "node scripts/test-project-shapes.js",
39
+ "score-quality": "node scripts/score-quality.js",
40
+ "release:check": "npm run check && npm run token-budget && npm run package-manifest && npm run golden-transcripts && npm run project-shapes && npm run score-quality"
41
+ },
42
+ "engines": {
43
+ "node": ">=18"
44
+ }
45
+ }
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: "Explore and understand a codebase area"
3
+ argument-hint: "<what to explore>"
4
+ ---
5
+
6
+ # Explore — Codebase Understanding
7
+
8
+ This command systematically explores a codebase area to build understanding and create documentation.
9
+
10
+ ## Behavioral Context: Architect
11
+
12
+ You are operating in the **Architect profile**:
13
+ - **File access**: Read-only for code, write to `.scratch/` for exploration notes
14
+ - **Scope**: Understand and document code structure
15
+ - **Output**: Exploration report with insights and recommendations
16
+
17
+ ## Procedure
18
+
19
+ Read and follow the skill file: `.claude/skills/engineering/explore/SKILL.md`
20
+
21
+ ## Expected Outcome
22
+
23
+ - Deep understanding of the explored area
24
+ - Documentation of structure and patterns
25
+ - Recommendations for improvements or next steps
26
+ - Exploration report in `.scratch/`
27
+
28
+ $ARGUMENTS
@@ -30,7 +30,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
30
30
 
31
31
  ## Complete
32
32
 
33
- Return completion with:
33
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
34
+
34
35
  - commit hash
35
36
  - files changed
36
37
  - documentation updated
@@ -128,7 +128,8 @@ Write `<session-dir>/root-cause.md`:
128
128
 
129
129
  Write `<session-dir>/diagnosis.md` with full log (hypotheses, instrumentation results, timeline).
130
130
 
131
- Return completion with:
131
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
132
+
132
133
  - `<session-dir>/root-cause.md` path
133
134
  - root cause summary
134
135
  - fix applied
@@ -43,7 +43,7 @@ Look for:
43
43
 
44
44
  ## 4. Report findings
45
45
 
46
- Return completion with:
46
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
47
47
 
48
48
  - modules/components identified
49
49
  - key dependencies and relationships
@@ -50,7 +50,8 @@ Delegate to implementer profile via `Agent` tool. Implementer executes:
50
50
 
51
51
  ## 5. Verify and report
52
52
 
53
- Implementer returns completion with:
53
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
54
+
54
55
  - feature implemented
55
56
  - tests status (all passing)
56
57
  - recommended next command (typically `/verify` then `/review` then `/commit-and-document`)
@@ -41,7 +41,8 @@ Delegate to implementer profile via `Agent` tool. Implementer executes:
41
41
 
42
42
  ## 4. Verify and report
43
43
 
44
- Implementer returns completion with:
44
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
45
+
45
46
  - root cause identified
46
47
  - fix implemented
47
48
  - regression test added
@@ -29,7 +29,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
29
29
 
30
30
  ## Complete
31
31
 
32
- Return completion with:
32
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
33
+
33
34
  - documentation location
34
35
  - key findings and insights
35
36
  - recommended next command (typically `/feature` or `/refactor` if changes needed)
@@ -33,7 +33,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
33
33
 
34
34
  ## Complete
35
35
 
36
- Return completion with:
36
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
37
+
37
38
  - architecture proposal location
38
39
  - key improvements identified
39
40
  - recommended next command (typically `/refactor` to implement changes)
@@ -28,7 +28,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
28
28
 
29
29
  ## Complete
30
30
 
31
- Return completion with:
31
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
32
+
32
33
  - prototype location
33
34
  - findings and insights
34
35
  - recommendations for next steps (proceed with design, explore alternative, or abandon)
@@ -42,7 +42,8 @@ Delegate to implementer profile via `Agent` tool. Implementer executes:
42
42
 
43
43
  ## 4. Verify and report
44
44
 
45
- Implementer returns completion with:
45
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
46
+
46
47
  - what was refactored
47
48
  - structural improvements achieved
48
49
  - tests status (all passing)
@@ -125,7 +125,8 @@ Write `<session-dir>/synthesis.md` with:
125
125
  - Prioritized findings by severity
126
126
  - Result line: `approve` / `approve with nits` / `changes requested` / `blocked`
127
127
 
128
- Return completion with:
128
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
129
+
129
130
  - `<session-dir>/synthesis.md` path
130
131
  - brief result line (approve / approve with nits / changes requested / blocked)
131
132
  - recommended next command
@@ -38,7 +38,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
38
38
 
39
39
  ## Complete
40
40
 
41
- Return a summary with:
41
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
42
+
42
43
  - CONTEXT.md location
43
44
  - sections added/updated
44
45
  - recommended next command (typically `/explore` to deepen understanding, or `/feature`/`/refactor` to start work)
@@ -42,7 +42,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
42
42
 
43
43
  ## Complete
44
44
 
45
- Return a summary with:
45
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
46
+
46
47
  - configuration files updated
47
48
  - conventions document location
48
49
  - recommended next command (typically `/verify` to ensure config is valid)
@@ -54,7 +54,8 @@ After green, suggest `/verify`, then `/review`, then `/commit-and-document` for
54
54
 
55
55
  ## Complete
56
56
 
57
- Return a summary with:
57
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
58
+
58
59
  - what was implemented (behaviours, interfaces)
59
60
  - tests written (count, pass/fail)
60
61
  - status (complete / blocked with reason)
@@ -30,7 +30,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
30
30
 
31
31
  ## Complete
32
32
 
33
- Return completion with:
33
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
34
+
34
35
  - issues directory location
35
36
  - issue count and summary
36
37
  - dependency graph
@@ -33,7 +33,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
33
33
 
34
34
  ## Complete
35
35
 
36
- Return completion with:
36
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
37
+
37
38
  - PRD location
38
39
  - summary of requirements
39
40
  - recommended next command (typically `/to-issues` to break down into tasks)
@@ -30,7 +30,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
30
30
 
31
31
  ## Complete
32
32
 
33
- Return completion with:
33
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
34
+
34
35
  - triage document location
35
36
  - prioritized list summary
36
37
  - recommended next command (typically `/fix` for bugs, `/feature` for features, or `/refactor` for tech debt)
@@ -19,7 +19,8 @@ Use for small known fixes.
19
19
 
20
20
  ## Complete
21
21
 
22
- Return a summary with:
22
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
23
+
23
24
  - what was changed (file paths, line ranges)
24
25
  - status (complete / blocked with reason)
25
26
  - recommended next command
@@ -27,7 +27,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
27
27
 
28
28
  ## Complete
29
29
 
30
- Return completion with:
30
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
31
+
31
32
  - documentation files updated
32
33
  - summary of changes
33
34
  - recommended next command (typically `/verify` to ensure docs are accurate)
@@ -32,7 +32,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
32
32
 
33
33
  ## Complete
34
34
 
35
- Return completion with:
35
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
36
+
36
37
  - verification commands run
37
38
  - pass/fail status for each
38
39
  - recommended next command (typically `/review` if passed, or `/fix` if failed)
@@ -68,7 +68,8 @@ Do not re-read unchanged files; use prior findings unless the file changed.
68
68
 
69
69
  ## Complete
70
70
 
71
- Return completion with:
71
+ **COMPLETION PROTOCOL**: Your final text message is your return value. Output this summary, then STOP — do not call any more tools.
72
+
72
73
  - `<session-dir>/synthesis.md` file path
73
74
  - high-level structure summary
74
75
  - recommended next command (typically `/explore` for deeper dive, or `/feature`/`/refactor` if changes needed)
@@ -0,0 +1,32 @@
1
+ ---
2
+ name: writing-beats
3
+ description: Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.
4
+ ---
5
+
6
+ # Writing Beats
7
+
8
+ ## Setup
9
+
10
+ 1. Use `Read` to read raw markdown fully.
11
+ 2. If article output path missing, ask once.
12
+ 3. Never edit raw material.
13
+ 4. Use `Read` to re-read article before every `Write`.
14
+
15
+ ## Loop
16
+
17
+ 1. Offer 2–3 starting beats from raw material.
18
+ 2. Preview likely next pivots for each.
19
+ 3. User picks.
20
+ 4. Use `Write` to write only selected beat to article.
21
+ 5. Use `Read` to re-read article.
22
+ 6. Offer 2–3 next beats from current ending.
23
+ 7. Loop until natural end.
24
+
25
+ ## Rules
26
+
27
+ - Beat = one move: scene/point/question/aside/twist.
28
+ - Size to need: sentence, paragraph, or short vignette.
29
+ - If needs headings/5 paragraphs, split.
30
+ - Pull/paraphrase/split/merge raw fragments.
31
+ - Leave unused raw material.
32
+ - Rewrite/go back → edit specific beat; preserve rest.
@@ -0,0 +1,45 @@
1
+ ---
2
+ name: writing-fragments
3
+ description: Grilling session that mines the user for fragments — heterogeneous nuggets of writing (claims, vignettes, sharp sentences, half-thoughts) — and appends them to a single document as raw material for a future article. Use when the user wants to develop ideas before imposing structure, or mentions "fragments", "ideate", or "raw material" for writing.
4
+ ---
5
+
6
+ # Writing Fragments
7
+
8
+ ## Setup
9
+
10
+ 1. Capture fragments from initial prompt onward.
11
+ 2. If output path missing, ask once.
12
+ 3. First write: one H1 working title; no metadata/TOC/date.
13
+ 4. Use `Read` to re-read file before every `Write`.
14
+ 5. Use `Write` to append only unless user requests specific edit.
15
+
16
+ ## Fragment forms
17
+
18
+ - Sharp sentence.
19
+ - Claim + one-line reason.
20
+ - Vignette/scenario/analogy/code snippet.
21
+ - Half-thought.
22
+ - Quote/dialogue.
23
+ - Observation cluster.
24
+ - Complaint/confession/punchline.
25
+
26
+ ## File format
27
+
28
+ ```markdown
29
+ # Working title
30
+
31
+ Fragment one.
32
+
33
+ ---
34
+
35
+ Fragment two.
36
+ ```
37
+
38
+ Rules:
39
+ - Separate fragments with `---`.
40
+ - No body headings/tags.
41
+ - Order = capture order.
42
+ - Append silently; mention briefly.
43
+ - Preserve user edits.
44
+ - Support `cut last`, `rewrite`, `merge` immediately.
45
+ - DO NOT impose outline/structure.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: writing-shape
3
+ description: Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.
4
+ ---
5
+
6
+ # Writing Shape
7
+
8
+ ## Setup
9
+
10
+ 1. Use `Read` to read raw markdown fully.
11
+ 2. Treat raw file read-only.
12
+ 3. If article path missing, ask once.
13
+ 4. Use `Read` to re-read article before every `Write`.
14
+
15
+ ## Loop
16
+
17
+ 1. Draft 2–3 openings with different thesis/angle.
18
+ 2. User picks or composes hybrid.
19
+ 3. Opening defines article path.
20
+ 4. Ask what reader needs next.
21
+ 5. Pull from raw material.
22
+ 6. Argue format: prose/list/table/callout/quote/code.
23
+ 7. Use `Write` to append agreed block immediately.
24
+ 8. Repeat until article done.
25
+
26
+ ## Pressure tests
27
+
28
+ - What does this paragraph do that previous didn't?
29
+ - If cut, what breaks?
30
+ - Prose/list/table/callout? Why?
31
+ - Sentence doing two jobs? Split or pick one.
32
+ - Opening promised X; current draft drifted to Y?
33
+
34
+ ## Format rules
35
+
36
+ - Prose carries argument.
37
+ - List only for parallel items.
38
+ - Callout for derailing tips/warnings/asides.
39
+ - Table when same fields repeat 3+ times.
40
+ - Quote when exact wording matters.
41
+ - Code block for multi-line/runnable/illustrative; inline code for single token.
42
+
43
+ ## Rules
44
+
45
+ - Mine pile; do not follow as script.
46
+ - Paraphrase/split/merge fragments.
47
+ - If pile lacks needed example/info, ask user or cut section.
48
+ - Preserve user edits.
49
+ - Edit specific paragraph in place when requested.
50
+ - DO NOT publish or add unsolicited frontmatter.
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: git-guardrails-claude-code
3
+ description: Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.
4
+ ---
5
+
6
+ # Setup Git Guardrails
7
+
8
+ Block patterns: `git push`, `git reset --hard`, `git clean -f`, `git clean -fd`, `git branch -D`, `git checkout .`, `git restore .`, `push --force`, `reset --hard`.
9
+
10
+ ## Process
11
+
12
+ 1. Ask scope: Project `.claude/settings.json` or Global `~/.claude/settings.json`.
13
+ 2. Copy `scripts/block-dangerous-git.sh` to `.claude/hooks/block-dangerous-git.sh` in selected scope.
14
+ 3. Use `Bash` to run `chmod +x {script}`.
15
+ 4. Merge hook into settings; DO NOT overwrite existing settings.
16
+
17
+ Project settings:
18
+
19
+ ```json
20
+ {
21
+ "hooks": {
22
+ "PreToolUse": [
23
+ {
24
+ "matcher": "Bash",
25
+ "hooks": [
26
+ {
27
+ "type": "command",
28
+ "command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/block-dangerous-git.sh"
29
+ }
30
+ ]
31
+ }
32
+ ]
33
+ }
34
+ }
35
+ ```
36
+
37
+ Global settings:
38
+
39
+ ```json
40
+ {
41
+ "hooks": {
42
+ "PreToolUse": [
43
+ {
44
+ "matcher": "Bash",
45
+ "hooks": [
46
+ {
47
+ "type": "command",
48
+ "command": "~/.claude/hooks/block-dangerous-git.sh"
49
+ }
50
+ ]
51
+ }
52
+ ]
53
+ }
54
+ }
55
+ ```
56
+
57
+ 5. Ask pattern customisation.
58
+ 6. Verify:
59
+
60
+ ```bash
61
+ echo '{"tool_input":{"command":"git push origin main"}}' | {path-to-script}
62
+ ```
63
+
64
+ Expected: exit 2 + `BLOCKED` stderr.
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+
3
+ INPUT=$(cat)
4
+ COMMAND=$(echo "$INPUT" | jq -r '.tool_input.command')
5
+
6
+ DANGEROUS_PATTERNS=(
7
+ "git push"
8
+ "git reset --hard"
9
+ "git clean -fd"
10
+ "git clean -f"
11
+ "git branch -D"
12
+ "git checkout \."
13
+ "git restore \."
14
+ "push --force"
15
+ "reset --hard"
16
+ )
17
+
18
+ for pattern in "${DANGEROUS_PATTERNS[@]}"; do
19
+ if echo "$COMMAND" | grep -qE "$pattern"; then
20
+ echo "BLOCKED: '$COMMAND' matches dangerous pattern '$pattern'. The user has prevented you from doing this." >&2
21
+ exit 2
22
+ fi
23
+ done
24
+
25
+ exit 0
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: migrate-to-shoehorn
3
+ description: Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.
4
+ ---
5
+
6
+ # Migrate to Shoehorn
7
+
8
+ RULE: Test code only. Never production.
9
+
10
+ ## Install
11
+
12
+ Use `Bash` to run:
13
+
14
+ ```bash
15
+ npm i @total-typescript/shoehorn
16
+ ```
17
+
18
+ ## Mapping
19
+
20
+ - `as Type` → `fromPartial()`.
21
+ - `as unknown as Type` → `fromAny()`.
22
+ - `fromPartial()` = partial data that should type-check.
23
+ - `fromAny()` = intentionally wrong data.
24
+ - `fromExact()` = full object now, partial later.
25
+
26
+ ## Workflow
27
+
28
+ 1. Ask target test files/use cases if missing.
29
+ 2. Use `Bash` to install dependency.
30
+ 3. Use `Grep` to find assertions:
31
+
32
+ ```bash
33
+ grep -r " as [A-Z]" --include="*.test.ts" --include="*.spec.ts"
34
+ ```
35
+
36
+ 4. Use `Edit` to replace `as Type` with `fromPartial()`.
37
+ 5. Use `Edit` to replace `as unknown as Type` with `fromAny()`.
38
+ 6. Use `Edit` to add imports.
39
+ 7. Use `Bash` to run type check.