opencodekit 0.21.10 → 0.23.0
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.
- package/README.md +1 -1
- package/dist/index.js +4 -25
- package/dist/template/.opencode/.template-manifest.json +115 -188
- package/dist/template/.opencode/AGENTS.md +127 -484
- package/dist/template/.opencode/README.md +2 -2
- package/dist/template/.opencode/agent/build.md +158 -356
- package/dist/template/.opencode/agent/explore.md +0 -1
- package/dist/template/.opencode/agent/plan.md +7 -16
- package/dist/template/.opencode/agent/review.md +0 -1
- package/dist/template/.opencode/agent/scout.md +2 -3
- package/dist/template/.opencode/agent/vision.md +0 -1
- package/dist/template/.opencode/artifacts/.active +1 -0
- package/dist/template/.opencode/artifacts/example/plan.md +12 -0
- package/dist/template/.opencode/artifacts/example/progress.md +4 -0
- package/dist/template/.opencode/artifacts/example/research.md +4 -0
- package/dist/template/.opencode/artifacts/example/spec.md +16 -0
- package/dist/template/.opencode/artifacts/todo.md +5 -0
- package/dist/template/.opencode/artifacts/verify.log +4 -0
- package/dist/template/.opencode/command/clarify.md +46 -0
- package/dist/template/.opencode/command/commit.md +53 -0
- package/dist/template/.opencode/command/create.md +29 -71
- package/dist/template/.opencode/command/design.md +1 -2
- package/dist/template/.opencode/command/explore.md +3 -4
- package/dist/template/.opencode/command/fix.md +55 -0
- package/dist/template/.opencode/command/improve-architecture.md +55 -0
- package/dist/template/.opencode/command/init.md +86 -69
- package/dist/template/.opencode/command/plan.md +30 -60
- package/dist/template/.opencode/command/pr.md +10 -28
- package/dist/template/.opencode/command/refactor.md +65 -0
- package/dist/template/.opencode/command/research.md +7 -29
- package/dist/template/.opencode/command/review-codebase.md +6 -13
- package/dist/template/.opencode/command/ship.md +136 -78
- package/dist/template/.opencode/command/test.md +66 -0
- package/dist/template/.opencode/command/ui-review.md +2 -4
- package/dist/template/.opencode/command/verify.md +15 -23
- package/dist/template/.opencode/dcp.jsonc +96 -85
- package/dist/template/.opencode/memory/README.md +4 -6
- package/dist/template/.opencode/memory/_templates/adr.md +45 -0
- package/dist/template/.opencode/memory/_templates/prd.md +1 -1
- package/dist/template/.opencode/memory/_templates/roadmap.md +1 -1
- package/dist/template/.opencode/memory/_templates/state.md +1 -1
- package/dist/template/.opencode/memory/project/gotchas.md +4 -4
- package/dist/template/.opencode/memory/project/project.md +2 -2
- package/dist/template/.opencode/memory/project/roadmap.md +1 -1
- package/dist/template/.opencode/memory/project/state.md +2 -2
- package/dist/template/.opencode/memory/project/tech-stack.md +2 -2
- package/dist/template/.opencode/memory/session-context.md +1 -1
- package/dist/template/.opencode/opencode.json +14 -152
- package/dist/template/.opencode/plugin/README.md +2 -2
- package/dist/template/.opencode/plugin/guard.ts +62 -0
- package/dist/template/.opencode/plugin/{lib/memory-admin-tools.ts → memory/admin.ts} +4 -4
- package/dist/template/.opencode/plugin/{lib → memory}/capture.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/compile.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/context.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/curator.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/observations.ts +102 -3
- package/dist/template/.opencode/plugin/{lib → memory}/db/schema.ts +43 -1
- package/dist/template/.opencode/plugin/{lib → memory}/db/types.ts +22 -0
- package/dist/template/.opencode/plugin/{lib/memory-db.ts → memory/db.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/distill.ts +1 -1
- package/dist/template/.opencode/plugin/{lib/memory-helpers.ts → memory/helpers.ts} +5 -1
- package/dist/template/.opencode/plugin/{lib/memory-hooks.ts → memory/hooks.ts} +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/index-generator.ts +2 -2
- package/dist/template/.opencode/plugin/{lib → memory}/inject.ts +1 -1
- package/dist/template/.opencode/plugin/{lib → memory}/lint.ts +2 -2
- package/dist/template/.opencode/plugin/memory/tools.ts +322 -0
- package/dist/template/.opencode/plugin/{lib → memory}/validate.ts +2 -2
- package/dist/template/.opencode/plugin/memory.ts +7 -17
- package/dist/template/.opencode/plugin/srcwalk.ts +721 -0
- package/dist/template/.opencode/skill/agent-code-quality-gate/SKILL.md +98 -0
- package/dist/template/.opencode/skill/behavioral-kernel/SKILL.md +52 -0
- package/dist/template/.opencode/skill/brainstorming/SKILL.md +1 -1
- package/dist/template/.opencode/skill/browser-testing-with-devtools/SKILL.md +85 -0
- package/dist/template/.opencode/skill/code-cleanup/SKILL.md +114 -0
- package/dist/template/.opencode/skill/code-navigation/SKILL.md +142 -0
- package/dist/template/.opencode/skill/code-review-and-quality/SKILL.md +131 -0
- package/dist/template/.opencode/skill/context-engineering/SKILL.md +1 -1
- package/dist/template/.opencode/skill/debugging-and-error-recovery/SKILL.md +109 -0
- package/dist/template/.opencode/skill/deep-module-design/SKILL.md +207 -0
- package/dist/template/.opencode/skill/development-lifecycle/SKILL.md +26 -45
- package/dist/template/.opencode/skill/gemini-large-context/SKILL.md +4 -4
- package/dist/template/.opencode/skill/git-workflow-and-versioning/SKILL.md +77 -0
- package/dist/template/.opencode/skill/grill-me/SKILL.md +140 -0
- package/dist/template/.opencode/skill/memory-system/SKILL.md +9 -10
- package/dist/template/.opencode/skill/opensrc/references/example-workflow.md +1 -1
- package/dist/template/.opencode/skill/planning-and-task-breakdown/SKILL.md +116 -0
- package/dist/template/.opencode/skill/shipping-and-launch/SKILL.md +95 -0
- package/dist/template/.opencode/skill/source-driven-development/SKILL.md +103 -0
- package/dist/template/.opencode/skill/spec-driven-development/SKILL.md +121 -0
- package/dist/template/.opencode/skill/srcwalk/SKILL.md +161 -0
- package/dist/template/.opencode/skill/subagent-driven-development/SKILL.md +1 -1
- package/dist/template/.opencode/skill/ubiquitous-language/SKILL.md +184 -0
- package/dist/template/.opencode/skill/using-git-worktrees/SKILL.md +6 -6
- package/dist/template/.opencode/skill/verification-before-completion/SKILL.md +6 -6
- package/dist/template/.opencode/skill/verification-before-completion/references/VERIFICATION_PROTOCOL.md +5 -5
- package/package.json +76 -76
- package/dist/template/.opencode/AGENT_ALIGNMENT.md +0 -564
- package/dist/template/.opencode/agent/painter.md +0 -83
- package/dist/template/.opencode/command/compound.md +0 -240
- package/dist/template/.opencode/command/curate.md +0 -299
- package/dist/template/.opencode/command/handoff.md +0 -149
- package/dist/template/.opencode/command/health.md +0 -356
- package/dist/template/.opencode/command/init-context.md +0 -297
- package/dist/template/.opencode/command/init-user.md +0 -125
- package/dist/template/.opencode/command/iterate.md +0 -200
- package/dist/template/.opencode/command/lfg.md +0 -173
- package/dist/template/.opencode/command/resume.md +0 -78
- package/dist/template/.opencode/command/status.md +0 -126
- package/dist/template/.opencode/command/ui-slop-check.md +0 -169
- package/dist/template/.opencode/plans/1768385996691-silent-wizard.md +0 -247
- package/dist/template/.opencode/plans/1770006237537-mighty-otter.md +0 -418
- package/dist/template/.opencode/plans/1770006913647-glowing-forest.md +0 -170
- package/dist/template/.opencode/plans/1770013678126-witty-planet.md +0 -278
- package/dist/template/.opencode/plans/1770112267595-shiny-rocket.md +0 -258
- package/dist/template/.opencode/plans/swarm-protocol.md +0 -123
- package/dist/template/.opencode/plugin/lib/memory-tools.ts +0 -535
- package/dist/template/.opencode/skill/agent-evals/SKILL.md +0 -208
- package/dist/template/.opencode/skill/anti-ai-slop/SKILL.md +0 -76
- package/dist/template/.opencode/skill/augment-context-engine/SKILL.md +0 -122
- package/dist/template/.opencode/skill/augment-context-engine/mcp.json +0 -6
- package/dist/template/.opencode/skill/beads/SKILL.md +0 -182
- package/dist/template/.opencode/skill/beads/references/BEST_PRACTICES.md +0 -27
- package/dist/template/.opencode/skill/beads/references/BOUNDARIES.md +0 -219
- package/dist/template/.opencode/skill/beads/references/DEPENDENCIES.md +0 -124
- package/dist/template/.opencode/skill/beads/references/EXAMPLES.md +0 -45
- package/dist/template/.opencode/skill/beads/references/FILE_CLAIMING.md +0 -101
- package/dist/template/.opencode/skill/beads/references/GIT_SYNC.md +0 -25
- package/dist/template/.opencode/skill/beads/references/HIERARCHY.md +0 -71
- package/dist/template/.opencode/skill/beads/references/MULTI_AGENT.md +0 -40
- package/dist/template/.opencode/skill/beads/references/RESUMABILITY.md +0 -177
- package/dist/template/.opencode/skill/beads/references/SESSION_PROTOCOL.md +0 -61
- package/dist/template/.opencode/skill/beads/references/TASK_CREATION.md +0 -38
- package/dist/template/.opencode/skill/beads/references/TROUBLESHOOTING.md +0 -38
- package/dist/template/.opencode/skill/beads/references/WORKFLOWS.md +0 -226
- package/dist/template/.opencode/skill/brand-asset-protocol/SKILL.md +0 -222
- package/dist/template/.opencode/skill/code-search-patterns/SKILL.md +0 -224
- package/dist/template/.opencode/skill/code-simplification/SKILL.md +0 -211
- package/dist/template/.opencode/skill/context-condensation/SKILL.md +0 -149
- package/dist/template/.opencode/skill/context-initialization/SKILL.md +0 -69
- package/dist/template/.opencode/skill/context-management/SKILL.md +0 -390
- package/dist/template/.opencode/skill/deep-research/SKILL.md +0 -384
- package/dist/template/.opencode/skill/design-direction-advisor/SKILL.md +0 -139
- package/dist/template/.opencode/skill/dispatching-parallel-agents/SKILL.md +0 -191
- package/dist/template/.opencode/skill/executing-plans/SKILL.md +0 -247
- package/dist/template/.opencode/skill/figma-go/SKILL.md +0 -65
- package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +0 -357
- package/dist/template/.opencode/skill/full-output-enforcement/SKILL.md +0 -62
- package/dist/template/.opencode/skill/gh-address-comments/SKILL.md +0 -29
- package/dist/template/.opencode/skill/gh-address-comments/scripts/fetch_comments.py +0 -237
- package/dist/template/.opencode/skill/gh-fix-ci/SKILL.md +0 -38
- package/dist/template/.opencode/skill/gh-fix-ci/scripts/inspect_pr_checks.py +0 -509
- package/dist/template/.opencode/skill/hi-fi-prototype-html/SKILL.md +0 -253
- package/dist/template/.opencode/skill/html-deck-export/SKILL.md +0 -189
- package/dist/template/.opencode/skill/index-knowledge/SKILL.md +0 -413
- package/dist/template/.opencode/skill/memory-grounding/SKILL.md +0 -68
- package/dist/template/.opencode/skill/playwriter/SKILL.md +0 -158
- package/dist/template/.opencode/skill/portless/SKILL.md +0 -109
- package/dist/template/.opencode/skill/prd/SKILL.md +0 -146
- package/dist/template/.opencode/skill/prd-task/SKILL.md +0 -182
- package/dist/template/.opencode/skill/prd-task/references/prd-schema.json +0 -124
- package/dist/template/.opencode/skill/prompt-leverage/SKILL.md +0 -90
- package/dist/template/.opencode/skill/prompt-leverage/references/framework.md +0 -91
- package/dist/template/.opencode/skill/prompt-leverage/scripts/augment_prompt.py +0 -157
- package/dist/template/.opencode/skill/receiving-code-review/SKILL.md +0 -263
- package/dist/template/.opencode/skill/reconcile/SKILL.md +0 -183
- package/dist/template/.opencode/skill/reflection-checkpoints/SKILL.md +0 -183
- package/dist/template/.opencode/skill/requesting-code-review/SKILL.md +0 -443
- package/dist/template/.opencode/skill/requesting-code-review/references/specialist-profiles.md +0 -108
- package/dist/template/.opencode/skill/requesting-code-review/review.md +0 -160
- package/dist/template/.opencode/skill/rtk-command-compression/SKILL.md +0 -134
- package/dist/template/.opencode/skill/screenshot/SKILL.md +0 -48
- package/dist/template/.opencode/skill/screenshot/scripts/ensure_macos_permissions.sh +0 -54
- package/dist/template/.opencode/skill/screenshot/scripts/macos_display_info.swift +0 -22
- package/dist/template/.opencode/skill/screenshot/scripts/macos_permissions.swift +0 -40
- package/dist/template/.opencode/skill/screenshot/scripts/macos_window_info.swift +0 -126
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.ps1 +0 -163
- package/dist/template/.opencode/skill/screenshot/scripts/take_screenshot.py +0 -585
- package/dist/template/.opencode/skill/security-threat-model/SKILL.md +0 -36
- package/dist/template/.opencode/skill/security-threat-model/references/prompt-template.md +0 -255
- package/dist/template/.opencode/skill/security-threat-model/references/security-controls-and-assets.md +0 -32
- package/dist/template/.opencode/skill/sharing-skills/SKILL.md +0 -214
- package/dist/template/.opencode/skill/skill-creator/SKILL.md +0 -181
- package/dist/template/.opencode/skill/skill-installer/SKILL.md +0 -58
- package/dist/template/.opencode/skill/skill-installer/scripts/github_utils.py +0 -21
- package/dist/template/.opencode/skill/skill-installer/scripts/install-skill-from-github.py +0 -313
- package/dist/template/.opencode/skill/skill-installer/scripts/list-skills.py +0 -106
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +0 -244
- package/dist/template/.opencode/skill/swarm-coordination/references/architecture.md +0 -39
- package/dist/template/.opencode/skill/swarm-coordination/references/delegation-worker-protocol.md +0 -145
- package/dist/template/.opencode/skill/swarm-coordination/references/dependency-graph.md +0 -50
- package/dist/template/.opencode/skill/swarm-coordination/references/drift-check.md +0 -90
- package/dist/template/.opencode/skill/swarm-coordination/references/integration-beads.md +0 -20
- package/dist/template/.opencode/skill/swarm-coordination/references/launch-flow.md +0 -186
- package/dist/template/.opencode/skill/swarm-coordination/references/reconciler.md +0 -172
- package/dist/template/.opencode/skill/swarm-coordination/references/tier-enforcement.md +0 -78
- package/dist/template/.opencode/skill/swarm-coordination/references/tmux-integration.md +0 -134
- package/dist/template/.opencode/skill/systematic-debugging/SKILL.md +0 -402
- package/dist/template/.opencode/skill/terse-output-mode/SKILL.md +0 -95
- package/dist/template/.opencode/skill/think-in-code/SKILL.md +0 -136
- package/dist/template/.opencode/skill/ux-quality-gates/SKILL.md +0 -137
- package/dist/template/.opencode/skill/v1-run/SKILL.md +0 -175
- package/dist/template/.opencode/skill/v1-run/mcp.json +0 -6
- package/dist/template/.opencode/skill/verification-gates/SKILL.md +0 -63
- package/dist/template/.opencode/skill/visual-analysis/SKILL.md +0 -154
- package/dist/template/.opencode/skill/web-design-guidelines/SKILL.md +0 -46
- package/dist/template/.opencode/skill/workspace-setup/SKILL.md +0 -76
- package/dist/template/.opencode/skill/writing-plans/SKILL.md +0 -320
- /package/dist/template/.opencode/plugin/{lib → memory}/compact.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/graph.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/maintenance.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/db/pipeline.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/notify.ts +0 -0
- /package/dist/template/.opencode/plugin/{lib → memory}/operation-log.ts +0 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debugging-and-error-recovery
|
|
3
|
+
description: Guides root-cause debugging and safe recovery from failures. Use when tests fail, builds break, behavior is unexpected, or multiple fix attempts have not worked.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [debugging, workflow, verification]
|
|
6
|
+
dependencies: [test-driven-development, verification-before-completion]
|
|
7
|
+
agent_types: [worker, reviewer]
|
|
8
|
+
tools: [bash, srcwalk_search, srcwalk_deps]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Debugging & Error Recovery
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Random fixes create new bugs. Debugging must move from symptom to root cause to guarded fix.
|
|
16
|
+
|
|
17
|
+
Core principle: reproduce, localize, reduce, fix, and guard before claiming resolution.
|
|
18
|
+
|
|
19
|
+
## When to Use
|
|
20
|
+
|
|
21
|
+
- Test, lint, typecheck, build, or runtime failure.
|
|
22
|
+
- User reports a bug or unexpected behavior.
|
|
23
|
+
- A previous fix failed.
|
|
24
|
+
- Error crosses multiple layers or components.
|
|
25
|
+
|
|
26
|
+
## When NOT to Use
|
|
27
|
+
|
|
28
|
+
- Feature work with no failure signal; use `incremental-implementation`.
|
|
29
|
+
- Pure research; use `source-driven-development`.
|
|
30
|
+
|
|
31
|
+
## Workflow
|
|
32
|
+
|
|
33
|
+
1. Read the full error and relevant logs.
|
|
34
|
+
2. Reproduce the failure or state why it cannot be reproduced.
|
|
35
|
+
3. Localize the failing layer: input, boundary, business logic, integration, environment.
|
|
36
|
+
4. Reduce to the smallest failing case.
|
|
37
|
+
5. Form one hypothesis and test it with one change or one diagnostic.
|
|
38
|
+
6. Write a failing regression test when behavior can be tested.
|
|
39
|
+
7. Fix the root cause, not only the symptom.
|
|
40
|
+
8. Run the original reproduction and relevant regression checks.
|
|
41
|
+
9. If three fix attempts fail, stop and escalate architecture/assumption risk.
|
|
42
|
+
|
|
43
|
+
## Evidence Log
|
|
44
|
+
|
|
45
|
+
For complex bugs, maintain a short log in the response or a debug artifact:
|
|
46
|
+
|
|
47
|
+
```markdown
|
|
48
|
+
## Symptoms
|
|
49
|
+
- ...
|
|
50
|
+
## Reproduction
|
|
51
|
+
- ...
|
|
52
|
+
## Hypotheses Eliminated
|
|
53
|
+
- ...
|
|
54
|
+
## Root Cause
|
|
55
|
+
- ...
|
|
56
|
+
## Fix and Guard
|
|
57
|
+
- ...
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Common Rationalizations
|
|
61
|
+
|
|
62
|
+
| Rationalization | Rebuttal |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| "This is probably the issue" | Probably is a hypothesis, not evidence. Test it minimally. |
|
|
65
|
+
| "I'll patch the symptom now" | Symptom patches hide root causes and regress later. |
|
|
66
|
+
| "Multiple fixes will save time" | You will not know which change mattered. |
|
|
67
|
+
| "The test failure is unrelated" | Prove it with isolation before ignoring it. |
|
|
68
|
+
| "One more attempt" | After three failed fixes, the model is wrong. Stop and rethink. |
|
|
69
|
+
|
|
70
|
+
## Red Flags
|
|
71
|
+
|
|
72
|
+
- Code changes before reproduction.
|
|
73
|
+
- Fix proposed before reading the full error.
|
|
74
|
+
- Same failure persists after two attempts.
|
|
75
|
+
- New failures appear in different layers.
|
|
76
|
+
- Regression test is skipped for a reproducible bug.
|
|
77
|
+
- Success claimed without re-running the original failing scenario.
|
|
78
|
+
|
|
79
|
+
## Verification
|
|
80
|
+
|
|
81
|
+
- Original failure is reproduced or documented as non-reproducible.
|
|
82
|
+
- Root cause is stated with evidence.
|
|
83
|
+
- Regression test or guard exists when feasible.
|
|
84
|
+
- Original scenario now passes.
|
|
85
|
+
- Related tests/checks pass.
|
|
86
|
+
|
|
87
|
+
## Skill Result Contract
|
|
88
|
+
|
|
89
|
+
```xml
|
|
90
|
+
<skill_result>
|
|
91
|
+
<skill>debugging-and-error-recovery</skill>
|
|
92
|
+
<status>success|partial|blocked|failure</status>
|
|
93
|
+
<evidence>Reproduction, root cause, fix, and verification commands</evidence>
|
|
94
|
+
<artifacts>Changed files, tests, debug notes</artifacts>
|
|
95
|
+
<risks>Non-reproducible behavior, missing regression test, or none</risks>
|
|
96
|
+
</skill_result>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## Consolidated Debugging Workflow
|
|
101
|
+
|
|
102
|
+
This is the canonical active debugging skill. It absorbs systematic-debugging while preserving root-cause discipline. Use root-cause-tracing as an advanced companion when the failure is deep in execution.
|
|
103
|
+
|
|
104
|
+
Required posture:
|
|
105
|
+
- reproduce or observe the failure before fixing;
|
|
106
|
+
- state the hypothesis and evidence;
|
|
107
|
+
- change one causal layer at a time;
|
|
108
|
+
- verify the failure mode is gone;
|
|
109
|
+
- record recovery actions and residual risk.
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deep-module-design
|
|
3
|
+
description: Applies Ousterhout's deep module principles to code design — small interfaces, information hiding, pull complexity downward. Use when designing modules, refactoring shallow structures, or reviewing AI-generated code for structural quality.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [architecture, code-quality, ousterhout]
|
|
6
|
+
dependencies: []
|
|
7
|
+
agent_types: [planner, worker, reviewer]
|
|
8
|
+
tools: [srcwalk_search, srcwalk_deps]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Deep Module Design
|
|
12
|
+
|
|
13
|
+
> Based on John Ousterhout's *A Philosophy of Software Design*
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
A deep module has a **small interface relative to its implementation**. It provides significant functionality through a compact abstraction, hiding complexity from its callers. A shallow module has an **interface as complex as its implementation** — it wraps one small thing with ceremony, adding overhead without hiding anything.
|
|
18
|
+
|
|
19
|
+
**Why this matters for AI agents:** AI coding tools generate code faster than humans can review. Shallow modules compound this problem — every AI pass can produce more tiny, shallow abstractions that increase cognitive load without reducing complexity. Deep modules constrain the AI: a small, stable interface limits the blast radius of AI-generated changes and makes verification tractable.
|
|
20
|
+
|
|
21
|
+
> *"The most important technique for achieving deep modules is information hiding."* — Ousterhout
|
|
22
|
+
|
|
23
|
+
## When to Use
|
|
24
|
+
|
|
25
|
+
- Designing a new module, class, or API boundary
|
|
26
|
+
- Reviewing code for structural quality (beyond just correctness)
|
|
27
|
+
- Refactoring a codebase where changes are too expensive because interfaces are too complex
|
|
28
|
+
- Working with AI agents that need tight, stable interfaces to produce reliable code
|
|
29
|
+
- Any time you find yourself writing a class/method that just calls another class/method
|
|
30
|
+
|
|
31
|
+
## When NOT to Use
|
|
32
|
+
|
|
33
|
+
- Prototyping where the abstraction will change completely (use after stabilization)
|
|
34
|
+
- Tiny utility functions that are inherently single-purpose and shallow by nature
|
|
35
|
+
- Code that will be replaced within the sprint
|
|
36
|
+
|
|
37
|
+
## Core Concept: Deep vs Shallow
|
|
38
|
+
|
|
39
|
+
### Deep Module
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
┌─────────────────────────────────────┐
|
|
43
|
+
│ COMPLEX IMPLEMENTATION │
|
|
44
|
+
│ (caching, retries, batching, │
|
|
45
|
+
│ connection pooling, fallbacks) │
|
|
46
|
+
│ │
|
|
47
|
+
│ ┌─────────────────────────────┐ │
|
|
48
|
+
│ │ SMALL INTERFACE │ │
|
|
49
|
+
│ │ get(key), set(key, val) │ │
|
|
50
|
+
│ └─────────────────────────────┘ │
|
|
51
|
+
└─────────────────────────────────────┘
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Example: Unix I/O (`open`, `read`, `write`, `close`). Five system calls hide filesystems, device drivers, disk scheduling, buffering, permissions, and network mounts. The interface has not changed in decades.
|
|
55
|
+
|
|
56
|
+
### Shallow Module
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
┌─────────────────────┐
|
|
60
|
+
│ SMALL IMPLEMENT. │
|
|
61
|
+
│ (just wraps one │
|
|
62
|
+
│ function call) │
|
|
63
|
+
│ │
|
|
64
|
+
│ ┌───────────────┐ │
|
|
65
|
+
│ │ COMPLEX IFACE │ │
|
|
66
|
+
│ │ many methods, │ │
|
|
67
|
+
│ │ many config │ │
|
|
68
|
+
│ │ options │ │
|
|
69
|
+
│ └───────────────┘ │
|
|
70
|
+
└─────────────────────┘
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Example: A "ParserFactory" that has one method `createParser(type)` which does a switch statement. The factory adds a class, an interface, and a registration mechanism — more surface area than the problem requires. Better to just call the parser directly or use a simple config object.
|
|
74
|
+
|
|
75
|
+
### Self-Test
|
|
76
|
+
|
|
77
|
+
Ask about ANY module you design or review:
|
|
78
|
+
|
|
79
|
+
> "Can I understand this module's interface in 30 seconds?"
|
|
80
|
+
> "Does the caller need to know implementation details to use it?"
|
|
81
|
+
> "Is this module's API surface area proportional to the complexity it hides?"
|
|
82
|
+
|
|
83
|
+
If the interface takes longer to learn than the implementation, the module is shallow — either deepen it or eliminate it.
|
|
84
|
+
|
|
85
|
+
## Design Principles
|
|
86
|
+
|
|
87
|
+
### 1. Information Hiding
|
|
88
|
+
|
|
89
|
+
The most important technique for achieving deep modules. Every implementation detail that callers don't need to know about should be private, internal, or abstracted away.
|
|
90
|
+
|
|
91
|
+
**Signs of information leakage:**
|
|
92
|
+
- Configuration that callers must set but relates to internal behavior (buffer sizes, retry counts, thread pool sizes)
|
|
93
|
+
- Methods that expose internal types (returning database rows, internal DTOs)
|
|
94
|
+
- Callers constructing complex intermediate objects before calling your API
|
|
95
|
+
|
|
96
|
+
**Fix:** Move the complexity inside. Default everything. Accept simple inputs.
|
|
97
|
+
|
|
98
|
+
### 2. Pull Complexity Downward
|
|
99
|
+
|
|
100
|
+
If a feature introduces complexity, handle it inside the module rather than pushing it to callers.
|
|
101
|
+
|
|
102
|
+
| ❌ Pushed to caller | ✅ Pulled downward |
|
|
103
|
+
|---|---|
|
|
104
|
+
| Caller must handle retries, timeouts, and fallbacks | Module handles them internally |
|
|
105
|
+
| Caller must format data correctly before passing | Module accepts raw data and transforms it |
|
|
106
|
+
| Caller must manage connection lifecycle | Module manages pools transparently |
|
|
107
|
+
|
|
108
|
+
> *"It is more important for a module to have a simple interface than a simple implementation."* — Ousterhout
|
|
109
|
+
|
|
110
|
+
### 3. General-Purpose vs Special-Purpose
|
|
111
|
+
|
|
112
|
+
General-purpose modules tend to be **deeper** because they solve a class of problems, not just one specific case. Special-purpose modules tend to be **shallower** because they're closely coupled to one use case.
|
|
113
|
+
|
|
114
|
+
**Rule of thumb:** Design modules to solve general problems. A "UserRepository" is deep (CRUD + queries for any user need). A "GetUserForLoginHandler" is shallow (only handles one specific query) — better to have a general `getUser` method and let callers filter as needed.
|
|
115
|
+
|
|
116
|
+
**Exception:** If the general-purpose interface would be significantly harder to understand, keep it special-purpose. Depth wins over generality.
|
|
117
|
+
|
|
118
|
+
### 4. Different Layer, Different Abstraction
|
|
119
|
+
|
|
120
|
+
Each layer of a system should provide a **different abstraction**. If two layers provide the same abstraction, one of them is redundant.
|
|
121
|
+
|
|
122
|
+
**Red flag — pass-through methods:**
|
|
123
|
+
```typescript
|
|
124
|
+
// Layer 2: Service layer
|
|
125
|
+
class UserService {
|
|
126
|
+
constructor(private repo: UserRepository) {}
|
|
127
|
+
|
|
128
|
+
// This is a pass-through — it adds nothing
|
|
129
|
+
getUser(id: string) {
|
|
130
|
+
return this.repo.findById(id);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
If a method does nothing except delegate with the exact same signature, it's a **pass-through method** — a sign the layer boundary is wrong. Either make the layer do something meaningful, or remove it.
|
|
136
|
+
|
|
137
|
+
**Red flag — pass-through variables:**
|
|
138
|
+
```typescript
|
|
139
|
+
// Top-level handler
|
|
140
|
+
function handleRequest(req, config) {
|
|
141
|
+
return processRequest(req, config);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Middle layer
|
|
145
|
+
function processRequest(req, config) {
|
|
146
|
+
return executeQuery(req, config);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
// Bottom layer
|
|
150
|
+
function executeQuery(req, config) {
|
|
151
|
+
return db.query(req, config);
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
When the same variable (`config`) passes through multiple layers without being used by the middle layers, it's a **pass-through variable**. This couples all layers to the config shape. Fix: put config in a global context, or restructure so the middle layers don't need it.
|
|
156
|
+
|
|
157
|
+
## Red Flag Catalog
|
|
158
|
+
|
|
159
|
+
| Red Flag | What it looks like | Fix |
|
|
160
|
+
|---|---|---|
|
|
161
|
+
| **Shallow module** | Interface as complex as its implementation | Eliminate or merge into caller |
|
|
162
|
+
| **Information leakage** | One module exposes types another module depends on | Move the types to a shared neutral location or hide them |
|
|
163
|
+
| **Pass-through method** | Method just delegates with same signature | Remove the middle layer or make it add value |
|
|
164
|
+
| **Pass-through variable** | Same data flows through many layers unused | Use a context object or restructure |
|
|
165
|
+
| **Replicated code smell** | Same pattern appears across modules instead of once | Extract a deeper module that encapsulates the pattern |
|
|
166
|
+
| **Configuration pollution** | Callers must configure internal behavior (buffer sizes, timeouts) | Auto-detect or default everything |
|
|
167
|
+
| **Returning internal state** | API exposes DB rows, internal DTOs, or raw storage types | Map to public types at the boundary |
|
|
168
|
+
| **Temporal coupling** | Methods must be called in a specific order not enforced by types | Design so invalid states are unrepresentable |
|
|
169
|
+
|
|
170
|
+
## AI-Specific Applications
|
|
171
|
+
|
|
172
|
+
Deep modules are especially valuable for AI-generated code:
|
|
173
|
+
|
|
174
|
+
| Problem | Deep module solution |
|
|
175
|
+
|---|---|
|
|
176
|
+
| AI creates shallow wrappers every time it refactors | Eliminate or merge them — keep the abstraction layer count minimal |
|
|
177
|
+
| AI introduces pass-through methods when adding layers | Spot them in review and remove — they add surface area without depth |
|
|
178
|
+
| AI makes cascading changes because interfaces are too wide | Narrow interfaces — a small, stable surface limits blast radius |
|
|
179
|
+
| AI generates inconsistent implementations across similar operations | Create one deep general-purpose module the AI can reuse instead of reimplementing |
|
|
180
|
+
| AI hallucinates configuration options the module doesn't need | Remove configurability — deep modules default aggressively |
|
|
181
|
+
|
|
182
|
+
## Verification
|
|
183
|
+
|
|
184
|
+
- [ ] Every module's interface is easier to understand than its implementation
|
|
185
|
+
- [ ] No pass-through methods (methods that just delegate with same signature)
|
|
186
|
+
- [ ] No information leakage (callers don't depend on internal types)
|
|
187
|
+
- [ ] No configuration that should be internalized
|
|
188
|
+
- [ ] Different layers provide different abstractions
|
|
189
|
+
- [ ] AI agents could safely use this module without reading its implementation
|
|
190
|
+
|
|
191
|
+
## See Also
|
|
192
|
+
|
|
193
|
+
- **code-review-and-quality** — Assess for shallow modules and information leakage during review
|
|
194
|
+
- **api-and-interface-design** — Deep module principles applied to REST/API design
|
|
195
|
+
- **code-cleanup** — Consolidate shallow modules during cleanup passes
|
|
196
|
+
|
|
197
|
+
## Skill Result Contract
|
|
198
|
+
|
|
199
|
+
```xml
|
|
200
|
+
<skill_result>
|
|
201
|
+
<skill>deep-module-design</skill>
|
|
202
|
+
<status>success|partial|blocked|failure</status>
|
|
203
|
+
<evidence>Modules assessed, red flags found or cleared, depth ratio evaluated</evidence>
|
|
204
|
+
<artifacts>Files or modules reviewed/designed</artifacts>
|
|
205
|
+
<risks>Known shallow modules deferred, or none</risks>
|
|
206
|
+
</skill_result>
|
|
207
|
+
```
|
|
@@ -57,7 +57,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
57
57
|
└─────────────┘
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
-
**Note:** Research (`/research <
|
|
60
|
+
**Note:** Research (`/research <plan-id>`) can happen at any phase when you need external information or deeper codebase understanding. It's not a sequential step but a parallel activity.
|
|
61
61
|
|
|
62
62
|
## Phase 1: Ideation (brainstorming)
|
|
63
63
|
|
|
@@ -65,7 +65,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
65
65
|
|
|
66
66
|
- [ ] Load `brainstorming`
|
|
67
67
|
- [ ] Validate design with user
|
|
68
|
-
- [ ] Write `.
|
|
68
|
+
- [ ] Write `.opencode/artifacts/<slug>/design.md`
|
|
69
69
|
|
|
70
70
|
**When:** You have a rough idea but need to explore and refine it.
|
|
71
71
|
|
|
@@ -81,7 +81,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
81
81
|
**Exit criteria:**
|
|
82
82
|
|
|
83
83
|
- Design validated by user
|
|
84
|
-
- Output: `.
|
|
84
|
+
- Output: `.opencode/artifacts/<slug>/design.md`
|
|
85
85
|
|
|
86
86
|
**Template:** `.opencode/memory/_templates/design.md`
|
|
87
87
|
|
|
@@ -91,9 +91,9 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
91
91
|
|
|
92
92
|
### Phase 2 Checklist
|
|
93
93
|
|
|
94
|
-
- [ ] Confirm or create
|
|
94
|
+
- [ ] Confirm or create plan context
|
|
95
95
|
- [ ] Ask clarifying questions
|
|
96
|
-
- [ ] Write `.
|
|
96
|
+
- [ ] Write `.opencode/artifacts/<slug>/spec.md`
|
|
97
97
|
|
|
98
98
|
**When:** Design is validated, need formal requirements and task breakdown.
|
|
99
99
|
|
|
@@ -101,7 +101,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
101
101
|
|
|
102
102
|
**Process:**
|
|
103
103
|
|
|
104
|
-
1. Confirm
|
|
104
|
+
1. Confirm or create plan context
|
|
105
105
|
2. Ask clarifying questions (5-7 max)
|
|
106
106
|
3. Explore codebase patterns and constraints
|
|
107
107
|
4. Write PRD with machine-convertible Tasks section
|
|
@@ -109,7 +109,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
109
109
|
**Exit criteria:**
|
|
110
110
|
|
|
111
111
|
- PRD with all sections completed
|
|
112
|
-
- Output: `.
|
|
112
|
+
- Output: `.opencode/artifacts/<slug>/spec.md`
|
|
113
113
|
|
|
114
114
|
**Template:** `.opencode/memory/_templates/prd.md`
|
|
115
115
|
|
|
@@ -119,25 +119,25 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
119
119
|
|
|
120
120
|
### Phase 3 Checklist
|
|
121
121
|
|
|
122
|
-
- [ ] Read PRD from `.
|
|
123
|
-
- [ ] Generate `.
|
|
124
|
-
- [ ] Ensure
|
|
122
|
+
- [ ] Read PRD from `.opencode/artifacts/<slug>/spec.md`
|
|
123
|
+
- [ ] Generate `.opencode/artifacts/tasks.json`
|
|
124
|
+
- [ ] Ensure `.opencode/artifacts/progress.txt` exists
|
|
125
125
|
|
|
126
126
|
**When:** PRD is complete, need executable task list.
|
|
127
127
|
|
|
128
|
-
**Entry criteria:** PRD exists at `.
|
|
128
|
+
**Entry criteria:** PRD exists at `.opencode/artifacts/<slug>/spec.md`.
|
|
129
129
|
|
|
130
130
|
**Process:**
|
|
131
131
|
|
|
132
132
|
1. Read PRD and extract ## Tasks section
|
|
133
133
|
2. Convert to JSON format with dependencies
|
|
134
|
-
3. Create progress.txt for cross-iteration memory
|
|
134
|
+
3. Create `.opencode/artifacts/progress.txt` for cross-iteration memory
|
|
135
135
|
|
|
136
136
|
**Exit criteria:**
|
|
137
137
|
|
|
138
138
|
- JSON task file created
|
|
139
139
|
- Progress file initialized
|
|
140
|
-
- Output: `.
|
|
140
|
+
- Output: `.opencode/artifacts/tasks.json`, `.opencode/artifacts/progress.txt`
|
|
141
141
|
|
|
142
142
|
---
|
|
143
143
|
|
|
@@ -147,11 +147,11 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
147
147
|
|
|
148
148
|
- [ ] Create bite-sized tasks with exact file paths
|
|
149
149
|
- [ ] Include TDD steps and verification commands
|
|
150
|
-
- [ ] Write `.
|
|
150
|
+
- [ ] Write `.opencode/artifacts/<slug>/plan.md`
|
|
151
151
|
|
|
152
152
|
**When:** Tasks defined, need detailed implementation instructions.
|
|
153
153
|
|
|
154
|
-
**Entry criteria:** Task list exists (
|
|
154
|
+
**Entry criteria:** Task list exists (tasks.json or tasks.md).
|
|
155
155
|
|
|
156
156
|
**Process:**
|
|
157
157
|
|
|
@@ -163,7 +163,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
163
163
|
**Exit criteria:**
|
|
164
164
|
|
|
165
165
|
- Detailed plan ready for execution
|
|
166
|
-
- Output: `.
|
|
166
|
+
- Output: `.opencode/artifacts/<slug>/plan.md`
|
|
167
167
|
|
|
168
168
|
**Template:** `.opencode/memory/_templates/tasks.md` (for task structure reference)
|
|
169
169
|
|
|
@@ -179,7 +179,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
179
179
|
|
|
180
180
|
**When:** Plan is ready, time to build.
|
|
181
181
|
|
|
182
|
-
**Entry criteria:** Plan exists at `.
|
|
182
|
+
**Entry criteria:** Plan exists at `.opencode/artifacts/<slug>/plan.md`.
|
|
183
183
|
|
|
184
184
|
**Process:**
|
|
185
185
|
|
|
@@ -202,7 +202,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
202
202
|
|
|
203
203
|
- [ ] Identify verification commands
|
|
204
204
|
- [ ] Run full verification suite
|
|
205
|
-
- [ ] Only then claim completion
|
|
205
|
+
- [ ] Only then claim completion
|
|
206
206
|
|
|
207
207
|
**When:** Implementation complete, before claiming done.
|
|
208
208
|
|
|
@@ -219,7 +219,7 @@ This skill orchestrates the complete feature development workflow, guiding you t
|
|
|
219
219
|
**Exit criteria:**
|
|
220
220
|
|
|
221
221
|
- All verification commands pass with evidence
|
|
222
|
-
-
|
|
222
|
+
- All tasks verified complete
|
|
223
223
|
|
|
224
224
|
---
|
|
225
225
|
|
|
@@ -246,28 +246,9 @@ For small changes, you can skip early phases:
|
|
|
246
246
|
|
|
247
247
|
---
|
|
248
248
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
Every phase should operate within a bead context:
|
|
252
|
-
|
|
253
|
-
```bash
|
|
254
|
-
# Create bead for new feature
|
|
255
|
-
br create "Feature Name"
|
|
256
|
-
|
|
257
|
-
# Check current bead status
|
|
258
|
-
br show <bead-id>
|
|
259
|
-
|
|
260
|
-
# Update status as you progress
|
|
261
|
-
br update <bead-id> --status in_progress
|
|
262
|
-
|
|
263
|
-
# Close when complete
|
|
264
|
-
br close <bead-id> --reason "All verification passed"
|
|
249
|
+
---
|
|
265
250
|
|
|
266
|
-
# Sync changes
|
|
267
|
-
br sync --flush-only
|
|
268
|
-
```
|
|
269
251
|
|
|
270
|
-
---
|
|
271
252
|
|
|
272
253
|
## Example Full Workflow
|
|
273
254
|
|
|
@@ -278,23 +259,23 @@ User: "I want to add a dark mode toggle"
|
|
|
278
259
|
→ skill({ name: "brainstorming" })
|
|
279
260
|
→ Questions about scope, triggers, persistence
|
|
280
261
|
→ Design decisions documented
|
|
281
|
-
→ Output: .
|
|
262
|
+
→ Output: .opencode/artifacts/<slug>/design.md
|
|
282
263
|
|
|
283
264
|
2. SPECIFICATION
|
|
284
265
|
→ skill({ name: "prd" })
|
|
285
266
|
→ Full PRD with requirements
|
|
286
267
|
→ Tasks section for conversion
|
|
287
|
-
→ Output: .
|
|
268
|
+
→ Output: .opencode/artifacts/<slug>/spec.md
|
|
288
269
|
|
|
289
270
|
3. TASK CONVERSION
|
|
290
271
|
→ skill({ name: "prd-task" })
|
|
291
272
|
→ JSON task list with dependencies
|
|
292
|
-
→ Output: .
|
|
273
|
+
→ Output: .opencode/artifacts/tasks.json
|
|
293
274
|
|
|
294
275
|
4. PLANNING
|
|
295
276
|
→ skill({ name: "writing-plans" })
|
|
296
277
|
→ Bite-sized implementation steps
|
|
297
|
-
→ Output: .
|
|
278
|
+
→ Output: .opencode/artifacts/<slug>/plan.md
|
|
298
279
|
|
|
299
280
|
5. IMPLEMENTATION
|
|
300
281
|
→ skill({ name: "executing-plans" })
|
|
@@ -306,7 +287,7 @@ User: "I want to add a dark mode toggle"
|
|
|
306
287
|
→ Tests pass: ✓
|
|
307
288
|
→ Lint clean: ✓
|
|
308
289
|
→ Build succeeds: ✓
|
|
309
|
-
|
|
290
|
+
→ All gates pass: ✓
|
|
310
291
|
```
|
|
311
292
|
|
|
312
293
|
---
|
|
@@ -316,5 +297,5 @@ User: "I want to add a dark mode toggle"
|
|
|
316
297
|
1. **Phase-appropriate skills:** Load the right skill for each phase
|
|
317
298
|
2. **Evidence at every gate:** No phase transition without verification
|
|
318
299
|
3. **Templates guide structure:** Use templates for consistent output
|
|
319
|
-
4. **
|
|
300
|
+
4. **Plans track progress:** Every feature gets a plan
|
|
320
301
|
5. **Skip only when appropriate:** Small changes can skip early phases
|
|
@@ -130,12 +130,12 @@ Assess test coverage:
|
|
|
130
130
|
When researching within task boundaries:
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
# 1. Include
|
|
134
|
-
gemini -p "@src/ @.
|
|
133
|
+
# 1. Include plan spec in context
|
|
134
|
+
gemini -p "@src/ @.opencode/artifacts/$(cat .opencode/artifacts/.active)/spec.md
|
|
135
135
|
Research implementations matching spec constraints"
|
|
136
136
|
|
|
137
|
-
# 2. Save findings to
|
|
138
|
-
# Write to .
|
|
137
|
+
# 2. Save findings to plan files
|
|
138
|
+
# Write to .opencode/artifacts/$(cat .opencode/artifacts/.active)/research.md
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
### Delegating Large Research to Gemini
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: git-workflow-and-versioning
|
|
3
|
+
description: Use when making code changes that need safe git hygiene, atomic commits, branch strategy, versioning, changelog entries, or release preparation. Covers trunk-based development, commit-as-save-point discipline, and avoiding accidental unrelated changes.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [git, workflow, shipping]
|
|
6
|
+
dependencies: []
|
|
7
|
+
agent_types: [planner, worker, reviewer]
|
|
8
|
+
tools: [bash]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Git Workflow and Versioning
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
Git workflow keeps changes reviewable, reversible, and shippable. Treat commits as verified save points, not dumping grounds.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- Any meaningful code change that may be committed, reviewed, or shipped.
|
|
20
|
+
- Creating or finishing a feature branch.
|
|
21
|
+
- Preparing release notes, version bumps, or changelog entries.
|
|
22
|
+
- Splitting a large diff into safe review units.
|
|
23
|
+
- Working in a dirty worktree where unrelated user changes may exist.
|
|
24
|
+
|
|
25
|
+
## When NOT to Use
|
|
26
|
+
|
|
27
|
+
- Read-only investigation with no file changes.
|
|
28
|
+
- Throwaway local experiments that will be discarded before reporting.
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
1. Inspect worktree state before editing: `git status --short`.
|
|
33
|
+
2. Identify unrelated changes and leave them untouched.
|
|
34
|
+
3. Keep each change atomic: one intent, one reviewable diff, one verification story.
|
|
35
|
+
4. Prefer trunk-based flow: short-lived branches, small PRs, frequent integration.
|
|
36
|
+
5. Use commits as save points only after verification passes or after clearly labeling partial work.
|
|
37
|
+
6. Scope staging to your files only; never use `git add .` in a mixed worktree.
|
|
38
|
+
7. For versioning, update the smallest required surface: package version, changelog, migration note, release tag, or docs.
|
|
39
|
+
8. Before shipping, confirm status, diff summary, verification evidence, and rollback path.
|
|
40
|
+
|
|
41
|
+
## Common Rationalizations
|
|
42
|
+
|
|
43
|
+
| Rationalization | Rebuttal |
|
|
44
|
+
| --- | --- |
|
|
45
|
+
| "I'll clean up the commit later." | Later cleanup often loses intent. Keep the diff clean while it is fresh. |
|
|
46
|
+
| "This unrelated formatting is harmless." | It increases review noise and can hide real regressions. |
|
|
47
|
+
| "One big commit is faster." | Small verified commits are easier to review, revert, bisect, and ship. |
|
|
48
|
+
| "The worktree was already dirty." | Dirty worktrees require more discipline, not less. |
|
|
49
|
+
|
|
50
|
+
## Red Flags
|
|
51
|
+
|
|
52
|
+
- Staging broad paths without reviewing the diff.
|
|
53
|
+
- Mixing feature work, refactors, formatting, and dependency updates.
|
|
54
|
+
- Committing generated or cache files unintentionally.
|
|
55
|
+
- Version bump without changelog or release rationale.
|
|
56
|
+
- Claiming clean worktree without checking status.
|
|
57
|
+
|
|
58
|
+
## Verification
|
|
59
|
+
|
|
60
|
+
Before declaring git workflow complete, provide:
|
|
61
|
+
|
|
62
|
+
- `git status --short` summary.
|
|
63
|
+
- Diff or staged-file summary for touched files.
|
|
64
|
+
- Verification commands and outcomes.
|
|
65
|
+
- Commit/version/changelog action taken, or explicit reason none was needed.
|
|
66
|
+
|
|
67
|
+
## Skill Result Contract
|
|
68
|
+
|
|
69
|
+
```xml
|
|
70
|
+
<skill_result>
|
|
71
|
+
<skill>git-workflow-and-versioning</skill>
|
|
72
|
+
<status>completed|blocked|skipped</status>
|
|
73
|
+
<artifacts>Branch, commit, changelog, version file, or none</artifacts>
|
|
74
|
+
<evidence>git status/diff summary and verification commands</evidence>
|
|
75
|
+
<risks>Unrelated worktree changes, uncommitted files, release risk, or none</risks>
|
|
76
|
+
</skill_result>
|
|
77
|
+
```
|