codingbuddy-rules 4.5.0 → 5.0.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/.ai-rules/adapters/antigravity.md +6 -6
- package/.ai-rules/adapters/claude-code.md +68 -4
- package/.ai-rules/adapters/codex.md +5 -5
- package/.ai-rules/adapters/cursor.md +2 -2
- package/.ai-rules/adapters/kiro.md +8 -8
- package/.ai-rules/adapters/opencode.md +7 -7
- package/.ai-rules/adapters/q.md +2 -2
- package/.ai-rules/agents/README.md +66 -16
- package/.ai-rules/agents/accessibility-specialist.json +2 -1
- package/.ai-rules/agents/act-mode.json +2 -1
- package/.ai-rules/agents/agent-architect.json +8 -7
- package/.ai-rules/agents/ai-ml-engineer.json +1 -0
- package/.ai-rules/agents/architecture-specialist.json +1 -0
- package/.ai-rules/agents/auto-mode.json +4 -2
- package/.ai-rules/agents/backend-developer.json +1 -0
- package/.ai-rules/agents/code-quality-specialist.json +1 -0
- package/.ai-rules/agents/code-reviewer.json +65 -64
- package/.ai-rules/agents/data-engineer.json +8 -7
- package/.ai-rules/agents/data-scientist.json +10 -9
- package/.ai-rules/agents/devops-engineer.json +1 -0
- package/.ai-rules/agents/documentation-specialist.json +1 -0
- package/.ai-rules/agents/eval-mode.json +20 -19
- package/.ai-rules/agents/event-architecture-specialist.json +1 -0
- package/.ai-rules/agents/frontend-developer.json +1 -0
- package/.ai-rules/agents/i18n-specialist.json +2 -1
- package/.ai-rules/agents/integration-specialist.json +1 -0
- package/.ai-rules/agents/migration-specialist.json +1 -0
- package/.ai-rules/agents/mobile-developer.json +8 -7
- package/.ai-rules/agents/observability-specialist.json +1 -0
- package/.ai-rules/agents/parallel-orchestrator.json +346 -0
- package/.ai-rules/agents/performance-specialist.json +1 -0
- package/.ai-rules/agents/plan-mode.json +3 -1
- package/.ai-rules/agents/plan-reviewer.json +208 -0
- package/.ai-rules/agents/platform-engineer.json +1 -0
- package/.ai-rules/agents/security-engineer.json +9 -8
- package/.ai-rules/agents/security-specialist.json +2 -1
- package/.ai-rules/agents/seo-specialist.json +1 -0
- package/.ai-rules/agents/software-engineer.json +1 -0
- package/.ai-rules/agents/solution-architect.json +11 -10
- package/.ai-rules/agents/systems-developer.json +9 -8
- package/.ai-rules/agents/technical-planner.json +11 -10
- package/.ai-rules/agents/test-engineer.json +7 -6
- package/.ai-rules/agents/test-strategy-specialist.json +1 -0
- package/.ai-rules/agents/tooling-engineer.json +4 -3
- package/.ai-rules/agents/ui-ux-designer.json +1 -0
- package/.ai-rules/keyword-modes.json +4 -4
- package/.ai-rules/rules/clarification-guide.md +14 -14
- package/.ai-rules/rules/core.md +73 -0
- package/.ai-rules/rules/parallel-execution.md +217 -0
- package/.ai-rules/skills/README.md +23 -1
- package/.ai-rules/skills/agent-design/SKILL.md +5 -0
- package/.ai-rules/skills/agent-design/examples/agent-template.json +58 -0
- package/.ai-rules/skills/agent-design/references/expertise-guidelines.md +112 -0
- package/.ai-rules/skills/agent-discussion/SKILL.md +199 -0
- package/.ai-rules/skills/agent-discussion-panel/SKILL.md +448 -0
- package/.ai-rules/skills/api-design/SKILL.md +5 -0
- package/.ai-rules/skills/api-design/examples/error-response.json +159 -0
- package/.ai-rules/skills/api-design/examples/openapi-template.yaml +393 -0
- package/.ai-rules/skills/build-fix/SKILL.md +234 -0
- package/.ai-rules/skills/code-explanation/SKILL.md +4 -0
- package/.ai-rules/skills/context-management/SKILL.md +1 -0
- package/.ai-rules/skills/cost-budget/SKILL.md +348 -0
- package/.ai-rules/skills/cross-repo-issues/SKILL.md +257 -0
- package/.ai-rules/skills/database-migration/SKILL.md +1 -0
- package/.ai-rules/skills/deepsearch/SKILL.md +214 -0
- package/.ai-rules/skills/deployment-checklist/SKILL.md +1 -0
- package/.ai-rules/skills/error-analysis/SKILL.md +1 -0
- package/.ai-rules/skills/finishing-a-development-branch/SKILL.md +281 -0
- package/.ai-rules/skills/frontend-design/SKILL.md +5 -0
- package/.ai-rules/skills/frontend-design/examples/component-template.tsx +203 -0
- package/.ai-rules/skills/frontend-design/references/css-patterns.md +243 -0
- package/.ai-rules/skills/git-master/SKILL.md +358 -0
- package/.ai-rules/skills/incident-response/SKILL.md +1 -0
- package/.ai-rules/skills/legacy-modernization/SKILL.md +1 -0
- package/.ai-rules/skills/mcp-builder/SKILL.md +7 -0
- package/.ai-rules/skills/mcp-builder/examples/resource-example.ts +233 -0
- package/.ai-rules/skills/mcp-builder/examples/tool-example.ts +203 -0
- package/.ai-rules/skills/mcp-builder/references/protocol-spec.md +215 -0
- package/.ai-rules/skills/performance-optimization/SKILL.md +3 -0
- package/.ai-rules/skills/plan-and-review/SKILL.md +115 -0
- package/.ai-rules/skills/pr-all-in-one/SKILL.md +15 -13
- package/.ai-rules/skills/pr-all-in-one/configuration-guide.md +7 -7
- package/.ai-rules/skills/pr-all-in-one/pr-templates.md +10 -10
- package/.ai-rules/skills/pr-review/SKILL.md +4 -0
- package/.ai-rules/skills/receiving-code-review/SKILL.md +347 -0
- package/.ai-rules/skills/refactoring/SKILL.md +1 -0
- package/.ai-rules/skills/requesting-code-review/SKILL.md +348 -0
- package/.ai-rules/skills/rule-authoring/SKILL.md +5 -0
- package/.ai-rules/skills/rule-authoring/examples/rule-template.md +142 -0
- package/.ai-rules/skills/rule-authoring/examples/trigger-patterns.md +126 -0
- package/.ai-rules/skills/security-audit/SKILL.md +4 -0
- package/.ai-rules/skills/skill-creator/SKILL.md +461 -0
- package/.ai-rules/skills/skill-creator/agents/analyzer.md +206 -0
- package/.ai-rules/skills/skill-creator/agents/comparator.md +167 -0
- package/.ai-rules/skills/skill-creator/agents/grader.md +152 -0
- package/.ai-rules/skills/skill-creator/assets/eval_review.html +289 -0
- package/.ai-rules/skills/skill-creator/assets/skill-template.md +43 -0
- package/.ai-rules/skills/skill-creator/eval-viewer/generate_review.py +496 -0
- package/.ai-rules/skills/skill-creator/references/frontmatter-guide.md +632 -0
- package/.ai-rules/skills/skill-creator/references/multi-tool-compat.md +480 -0
- package/.ai-rules/skills/skill-creator/references/schemas.md +784 -0
- package/.ai-rules/skills/skill-creator/scripts/aggregate_benchmark.py +302 -0
- package/.ai-rules/skills/skill-creator/scripts/init_skill.sh +196 -0
- package/.ai-rules/skills/skill-creator/scripts/run_loop.py +327 -0
- package/.ai-rules/skills/systematic-debugging/SKILL.md +1 -0
- package/.ai-rules/skills/tech-debt/SKILL.md +1 -0
- package/.ai-rules/skills/test-coverage-gate/SKILL.md +303 -0
- package/.ai-rules/skills/tmux-master/SKILL.md +491 -0
- package/.ai-rules/skills/using-git-worktrees/SKILL.md +368 -0
- package/.ai-rules/skills/verification-before-completion/SKILL.md +234 -0
- package/.ai-rules/skills/widget-slot-architecture/SKILL.md +6 -0
- package/.ai-rules/skills/widget-slot-architecture/examples/parallel-route-setup.tsx +206 -0
- package/.ai-rules/skills/widget-slot-architecture/examples/widget-component.tsx +250 -0
- package/.ai-rules/skills/writing-plans/SKILL.md +78 -0
- package/bin/cli.js +178 -0
- package/lib/init/detect-stack.js +148 -0
- package/lib/init/generate-config.js +31 -0
- package/lib/init/index.js +86 -0
- package/lib/init/prompt.js +60 -0
- package/lib/init/scaffold.js +67 -0
- package/lib/init/suggest-agent.js +46 -0
- package/package.json +10 -2
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: deepsearch
|
|
3
|
+
description: Use when simple grep/glob is insufficient and you need comprehensive, multi-pass codebase understanding
|
|
4
|
+
user-invocable: false
|
|
5
|
+
allowed-tools: Read, Grep, Glob, Bash
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Deep Search
|
|
9
|
+
|
|
10
|
+
## Overview
|
|
11
|
+
|
|
12
|
+
Single-pass searches miss connections. Grep finds strings, not understanding.
|
|
13
|
+
|
|
14
|
+
**Core principle:** ALWAYS search in multiple passes with increasing precision. A single query never gives the full picture.
|
|
15
|
+
|
|
16
|
+
**Violating the letter of this process is violating the spirit of thorough search.**
|
|
17
|
+
|
|
18
|
+
## The Iron Law
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
NO CONCLUSIONS WITHOUT CROSS-REFERENCED EVIDENCE FROM MULTIPLE PASSES
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
If you haven't completed at least Phases 1-3, your understanding is incomplete.
|
|
25
|
+
|
|
26
|
+
## When to Use
|
|
27
|
+
|
|
28
|
+
Use when simple grep/glob is **insufficient**:
|
|
29
|
+
- Understanding how a feature works end-to-end
|
|
30
|
+
- Tracing data flow across multiple files/modules
|
|
31
|
+
- Finding all usages and side effects before refactoring
|
|
32
|
+
- Detecting dead code or unused exports
|
|
33
|
+
- Mapping dependency chains
|
|
34
|
+
- Understanding implicit relationships (event emitters, dynamic imports, reflection)
|
|
35
|
+
- Auditing a pattern's usage across the codebase
|
|
36
|
+
|
|
37
|
+
**Use this ESPECIALLY when:**
|
|
38
|
+
- Initial search returns too many or too few results
|
|
39
|
+
- You need to understand "everything that touches X"
|
|
40
|
+
- The codebase uses indirection (dependency injection, plugins, event systems)
|
|
41
|
+
- You're about to make a breaking change
|
|
42
|
+
- You need confidence that nothing was missed
|
|
43
|
+
|
|
44
|
+
**Don't use when:**
|
|
45
|
+
- You know the exact file and symbol (use direct read)
|
|
46
|
+
- A single grep gives you the complete answer
|
|
47
|
+
- You're looking up a specific API signature
|
|
48
|
+
|
|
49
|
+
## The Four Phases
|
|
50
|
+
|
|
51
|
+
You MUST complete each phase before drawing conclusions.
|
|
52
|
+
|
|
53
|
+
### Phase 1: Broad Search — Cast a Wide Net
|
|
54
|
+
|
|
55
|
+
**Goal:** Discover all potentially relevant files and symbols.
|
|
56
|
+
|
|
57
|
+
1. **Start with Multiple Search Strategies**
|
|
58
|
+
- Search by name: function names, class names, variable names
|
|
59
|
+
- Search by pattern: string literals, error messages, log statements
|
|
60
|
+
- Search by structure: file naming conventions, directory patterns
|
|
61
|
+
- Search by type: imports, exports, type definitions
|
|
62
|
+
|
|
63
|
+
2. **Use Varied Query Terms**
|
|
64
|
+
- Don't stop at the first query term
|
|
65
|
+
- Try synonyms, abbreviations, related concepts
|
|
66
|
+
- Search for both the interface and the implementation
|
|
67
|
+
- Include test files — they reveal intended usage
|
|
68
|
+
|
|
69
|
+
3. **Record Everything**
|
|
70
|
+
- Note every file that appears relevant
|
|
71
|
+
- Note unexpected hits — they often reveal hidden connections
|
|
72
|
+
- Note files that *should* have matched but didn't
|
|
73
|
+
|
|
74
|
+
**Output:** A list of all candidate files and symbols to investigate.
|
|
75
|
+
|
|
76
|
+
### Phase 2: Narrow Focus — Understand Each Hit
|
|
77
|
+
|
|
78
|
+
**Goal:** Read and understand each candidate in context.
|
|
79
|
+
|
|
80
|
+
1. **Classify Each Result**
|
|
81
|
+
- Definition vs. usage vs. re-export
|
|
82
|
+
- Direct dependency vs. indirect dependency
|
|
83
|
+
- Active code vs. dead code vs. test code
|
|
84
|
+
|
|
85
|
+
2. **Read Surrounding Context**
|
|
86
|
+
- Don't just read the matching line — read the function/class
|
|
87
|
+
- Check imports at the top of the file
|
|
88
|
+
- Check exports at the bottom
|
|
89
|
+
- Read adjacent functions for related logic
|
|
90
|
+
|
|
91
|
+
3. **Build a Symbol Map**
|
|
92
|
+
- Where is it defined?
|
|
93
|
+
- Where is it imported?
|
|
94
|
+
- Where is it called/used?
|
|
95
|
+
- What calls it? (reverse dependency)
|
|
96
|
+
|
|
97
|
+
4. **Identify Indirection**
|
|
98
|
+
- Dynamic imports (`import()`, `require()`)
|
|
99
|
+
- String-based lookups (registries, plugin systems)
|
|
100
|
+
- Event-driven connections (emit/on patterns)
|
|
101
|
+
- Dependency injection (constructor injection, providers)
|
|
102
|
+
- Configuration-driven behavior (feature flags, env vars)
|
|
103
|
+
|
|
104
|
+
### Phase 3: Cross-Reference — Connect the Dots
|
|
105
|
+
|
|
106
|
+
**Goal:** Map relationships between all discovered symbols and files.
|
|
107
|
+
|
|
108
|
+
1. **Trace Data Flow**
|
|
109
|
+
- Follow data from source to sink
|
|
110
|
+
- Input → transform → output for each function in the chain
|
|
111
|
+
- Note where data shape changes (serialization, mapping)
|
|
112
|
+
|
|
113
|
+
2. **Trace Control Flow**
|
|
114
|
+
- What triggers this code path?
|
|
115
|
+
- What conditions must be true?
|
|
116
|
+
- What error paths exist?
|
|
117
|
+
- What happens on failure?
|
|
118
|
+
|
|
119
|
+
3. **Identify Dependency Chains**
|
|
120
|
+
- A imports B imports C — trace the full chain
|
|
121
|
+
- Circular dependencies — note them explicitly
|
|
122
|
+
- Shared dependencies — what else depends on the same module?
|
|
123
|
+
|
|
124
|
+
4. **Check for Side Effects**
|
|
125
|
+
- Global state mutations
|
|
126
|
+
- File system operations
|
|
127
|
+
- Database writes
|
|
128
|
+
- External API calls
|
|
129
|
+
- Cache invalidation
|
|
130
|
+
|
|
131
|
+
5. **Verify Completeness**
|
|
132
|
+
- For every "used by" reference, verify the reverse "depends on"
|
|
133
|
+
- Look for orphaned code that nothing references
|
|
134
|
+
- Check for dynamic/runtime references that static search misses
|
|
135
|
+
|
|
136
|
+
### Phase 4: Validate — Confirm Your Understanding
|
|
137
|
+
|
|
138
|
+
**Goal:** Prove your mental model is correct.
|
|
139
|
+
|
|
140
|
+
1. **Test Your Hypothesis**
|
|
141
|
+
- "If I change X, these files should be affected: [list]"
|
|
142
|
+
- "This function is called in these scenarios: [list]"
|
|
143
|
+
- "This code path is triggered by: [list]"
|
|
144
|
+
- Verify each claim with evidence from the code
|
|
145
|
+
|
|
146
|
+
2. **Check for Gaps**
|
|
147
|
+
- Are there files you expected to find but didn't?
|
|
148
|
+
- Are there connections that seem missing?
|
|
149
|
+
- Does the architecture diagram match the actual code?
|
|
150
|
+
|
|
151
|
+
3. **Look for Dead Code**
|
|
152
|
+
- Exported but never imported
|
|
153
|
+
- Defined but never called
|
|
154
|
+
- Imported but never used
|
|
155
|
+
- Behind feature flags that are always off
|
|
156
|
+
|
|
157
|
+
4. **Verify with Tests**
|
|
158
|
+
- Do existing tests confirm your understanding?
|
|
159
|
+
- Do test descriptions match your mental model?
|
|
160
|
+
- Are there test cases for edge cases you identified?
|
|
161
|
+
|
|
162
|
+
5. **Summarize Findings**
|
|
163
|
+
- List all files involved and their roles
|
|
164
|
+
- Draw the dependency graph (text or description)
|
|
165
|
+
- Note any risks, dead code, or inconsistencies found
|
|
166
|
+
- Provide confidence level: high / medium / low
|
|
167
|
+
|
|
168
|
+
## Red Flags — STOP and Search Deeper
|
|
169
|
+
|
|
170
|
+
If you catch yourself thinking:
|
|
171
|
+
- "This is probably the only place it's used"
|
|
172
|
+
- "I found one result, that must be it"
|
|
173
|
+
- "The naming convention tells me everything"
|
|
174
|
+
- "I don't need to check test files"
|
|
175
|
+
- "Dynamic imports won't matter here"
|
|
176
|
+
- "This module is self-contained"
|
|
177
|
+
- "I can skip Phase 3, the connections are obvious"
|
|
178
|
+
|
|
179
|
+
**ALL of these mean: STOP. You're making assumptions. Return to Phase 1.**
|
|
180
|
+
|
|
181
|
+
## Common Rationalizations
|
|
182
|
+
|
|
183
|
+
| Excuse | Reality |
|
|
184
|
+
|--------|---------|
|
|
185
|
+
| "Grep found it, I'm done" | Grep finds strings, not relationships. Continue to Phase 2. |
|
|
186
|
+
| "Only one file imports this" | Check for dynamic imports, re-exports, and test files. |
|
|
187
|
+
| "The naming is clear enough" | Names lie. Read the implementation. |
|
|
188
|
+
| "Tests aren't relevant" | Tests reveal intended behavior and edge cases. Always check. |
|
|
189
|
+
| "This is a small codebase" | Small codebases have hidden complexity too. Follow the process. |
|
|
190
|
+
| "I'll trace the rest later" | Incomplete understanding leads to broken refactors. Trace now. |
|
|
191
|
+
|
|
192
|
+
## Quick Reference
|
|
193
|
+
|
|
194
|
+
| Phase | Key Activities | Success Criteria |
|
|
195
|
+
|-------|---------------|------------------|
|
|
196
|
+
| **1. Broad Search** | Multiple strategies, varied terms, record all | Complete candidate list |
|
|
197
|
+
| **2. Narrow Focus** | Classify, read context, build symbol map | Understand each hit |
|
|
198
|
+
| **3. Cross-Reference** | Trace data/control flow, find dependencies | Map all relationships |
|
|
199
|
+
| **4. Validate** | Test hypothesis, check gaps, verify with tests | Confirmed mental model |
|
|
200
|
+
|
|
201
|
+
## Search Strategy Checklist
|
|
202
|
+
|
|
203
|
+
Use this checklist to ensure thorough coverage:
|
|
204
|
+
|
|
205
|
+
- [ ] Searched by symbol name (exact and substring)
|
|
206
|
+
- [ ] Searched by string literals and error messages
|
|
207
|
+
- [ ] Searched by file/directory naming patterns
|
|
208
|
+
- [ ] Checked imports and exports
|
|
209
|
+
- [ ] Checked test files for usage examples
|
|
210
|
+
- [ ] Checked configuration files
|
|
211
|
+
- [ ] Traced dynamic/runtime references
|
|
212
|
+
- [ ] Verified reverse dependencies
|
|
213
|
+
- [ ] Looked for event-driven connections
|
|
214
|
+
- [ ] Checked for dead/unused code
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: deployment-checklist
|
|
3
3
|
description: Use before deploying to staging or production. Covers pre-deploy validation, environment verification, rollback planning, health checks, and post-deploy monitoring.
|
|
4
|
+
disable-model-invocation: true
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Deployment Checklist
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: error-analysis
|
|
3
3
|
description: Use when encountering error messages, stack traces, or unexpected application behavior. Provides structured analysis to understand root cause before attempting any fix.
|
|
4
|
+
allowed-tools: Read, Grep, Glob, Bash(git:*)
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Error Analysis
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: finishing-a-development-branch
|
|
3
|
+
description: Use when implementation is complete and you need to decide how to integrate the work - merge, PR, or cleanup
|
|
4
|
+
disable-model-invocation: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Finishing a Development Branch
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Guide the completion of development work on a branch — decide how to integrate, verify readiness, execute the choice, and clean up.
|
|
12
|
+
|
|
13
|
+
**Core principle:** Verify before you ship. Present options, don't assume. Clean up after yourself.
|
|
14
|
+
|
|
15
|
+
## The Iron Law
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
NO MERGE WITHOUT GREEN TESTS AND CLEAN STATUS
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If tests fail or uncommitted changes exist, STOP. Fix first. No exceptions.
|
|
22
|
+
|
|
23
|
+
**Corollary:** Never push directly to main/master. Always use a PR for protected branches.
|
|
24
|
+
|
|
25
|
+
## When to Use
|
|
26
|
+
|
|
27
|
+
- Implementation is complete on a feature branch
|
|
28
|
+
- All planned tasks are done (or intentionally deferred)
|
|
29
|
+
- Ready to integrate work back to base branch
|
|
30
|
+
- Need to decide: merge, PR, or abandon
|
|
31
|
+
- End of an executing-plans or subagent-driven-development session
|
|
32
|
+
- Wrapping up work in a git worktree
|
|
33
|
+
|
|
34
|
+
## When NOT to Use
|
|
35
|
+
|
|
36
|
+
- Work is still in progress (keep working)
|
|
37
|
+
- You haven't run tests yet (run them first)
|
|
38
|
+
- You're on the main/master branch (nothing to finish)
|
|
39
|
+
|
|
40
|
+
## Phase 1: Pre-Completion Checklist
|
|
41
|
+
|
|
42
|
+
**MANDATORY. Complete every item before proceeding.**
|
|
43
|
+
|
|
44
|
+
### Must Pass (blocking)
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
# 1. All tests pass
|
|
48
|
+
npm test # or: yarn test, pytest, go test ./...
|
|
49
|
+
|
|
50
|
+
# 2. No type errors
|
|
51
|
+
npx tsc --noEmit # or equivalent for your language
|
|
52
|
+
|
|
53
|
+
# 3. No uncommitted changes
|
|
54
|
+
git status # must be clean
|
|
55
|
+
|
|
56
|
+
# 4. Branch is up to date with base
|
|
57
|
+
git fetch origin
|
|
58
|
+
git merge-base --is-ancestor origin/<base> HEAD # exit 0 = up to date
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- [ ] All tests pass (zero failures)
|
|
62
|
+
- [ ] No type errors (`tsc --noEmit` or equivalent)
|
|
63
|
+
- [ ] Working directory clean (`git status` shows nothing)
|
|
64
|
+
- [ ] No untracked files that should be committed
|
|
65
|
+
- [ ] Branch is up to date with base branch
|
|
66
|
+
|
|
67
|
+
### Should Check (non-blocking)
|
|
68
|
+
|
|
69
|
+
- [ ] Linting passes (eslint/prettier or equivalent)
|
|
70
|
+
- [ ] No TODO/FIXME left in new code
|
|
71
|
+
- [ ] Commits are logically grouped (not a mess of WIP)
|
|
72
|
+
- [ ] Commit messages follow project conventions
|
|
73
|
+
|
|
74
|
+
### Context-Dependent
|
|
75
|
+
|
|
76
|
+
- [ ] If in worktree: confirmed correct worktree
|
|
77
|
+
- [ ] If linked to issue: issue number in branch name or commits
|
|
78
|
+
- [ ] If PR already exists: PR is up to date with latest commits
|
|
79
|
+
|
|
80
|
+
**Any blocking item fails? STOP. Fix it. Re-run the checklist.**
|
|
81
|
+
|
|
82
|
+
## Phase 2: Decision Tree
|
|
83
|
+
|
|
84
|
+
```dot
|
|
85
|
+
digraph decision {
|
|
86
|
+
rankdir=TB;
|
|
87
|
+
node [shape=diamond, style=filled, fillcolor="#ffffcc"];
|
|
88
|
+
|
|
89
|
+
start [label="Pre-completion\nchecklist passed?", shape=diamond];
|
|
90
|
+
keep [label="Work worth\nkeeping?"];
|
|
91
|
+
protected [label="Target branch\nprotected?"];
|
|
92
|
+
review [label="Changes need\nreview?"];
|
|
93
|
+
simple [label="Single commit,\npersonal branch?"];
|
|
94
|
+
|
|
95
|
+
stop [label="STOP\nFix issues first", fillcolor="#ffcccc", shape=box];
|
|
96
|
+
abandon [label="PATH C\nCleanup / Abandon", fillcolor="#ffcccc", shape=box];
|
|
97
|
+
pr [label="PATH B\nCreate PR", fillcolor="#ccffcc", shape=box];
|
|
98
|
+
merge [label="PATH A\nMerge Directly", fillcolor="#ccccff", shape=box];
|
|
99
|
+
|
|
100
|
+
start -> keep [label="yes"];
|
|
101
|
+
start -> stop [label="no"];
|
|
102
|
+
keep -> abandon [label="no"];
|
|
103
|
+
keep -> protected [label="yes"];
|
|
104
|
+
protected -> pr [label="yes"];
|
|
105
|
+
protected -> review [label="no"];
|
|
106
|
+
review -> pr [label="yes"];
|
|
107
|
+
review -> simple [label="no"];
|
|
108
|
+
simple -> merge [label="yes"];
|
|
109
|
+
simple -> pr [label="no"];
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Quick Reference
|
|
114
|
+
|
|
115
|
+
| Condition | Path |
|
|
116
|
+
|-----------|------|
|
|
117
|
+
| Checklist fails | **STOP** — fix first |
|
|
118
|
+
| Work not worth keeping | **PATH C** — Cleanup/Abandon |
|
|
119
|
+
| Target branch is protected | **PATH B** — Create PR |
|
|
120
|
+
| Changes need review | **PATH B** — Create PR |
|
|
121
|
+
| Simple change, personal branch | **PATH A** — Merge Directly |
|
|
122
|
+
| Unsure which path | **PATH B** — Create PR (safe default) |
|
|
123
|
+
|
|
124
|
+
## Phase 3: Execute Choice
|
|
125
|
+
|
|
126
|
+
### PATH A: Merge Directly
|
|
127
|
+
|
|
128
|
+
For simple, single-commit changes on unprotected personal branches.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
# 1. Update base branch
|
|
132
|
+
git checkout <base>
|
|
133
|
+
git pull origin <base>
|
|
134
|
+
|
|
135
|
+
# 2. Merge feature branch
|
|
136
|
+
git merge <feature-branch>
|
|
137
|
+
|
|
138
|
+
# 3. Push
|
|
139
|
+
git push origin <base>
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**WARNING:** Never use PATH A if `<base>` is main/master or any protected branch. Use PATH B instead.
|
|
143
|
+
|
|
144
|
+
**When to use:** Solo work, unprotected branch, trivial change, no review needed.
|
|
145
|
+
|
|
146
|
+
**If merge conflicts arise:** Resolve conflicts, run tests again, then commit. If conflicts are complex, abort with `git merge --abort` and switch to PATH B.
|
|
147
|
+
|
|
148
|
+
### PATH B: Create PR (Recommended Default)
|
|
149
|
+
|
|
150
|
+
The safe default for most workflows. Use the `pr-all-in-one` skill if available.
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
# 1. Push feature branch
|
|
154
|
+
git push -u origin <feature-branch>
|
|
155
|
+
|
|
156
|
+
# 2. Create PR (adjust title and body as needed)
|
|
157
|
+
gh pr create \
|
|
158
|
+
--title "feat: description of change" \
|
|
159
|
+
--body "## Summary
|
|
160
|
+
- What changed and why
|
|
161
|
+
|
|
162
|
+
## Test plan
|
|
163
|
+
- [ ] Tests pass
|
|
164
|
+
- [ ] Manual verification done
|
|
165
|
+
|
|
166
|
+
Closes #<issue-number>"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
**Squash before PR (if commits are messy):**
|
|
170
|
+
```bash
|
|
171
|
+
# Clean up commits (use interactive rebase for manual control,
|
|
172
|
+
# or --autosquash for automated fixup commits)
|
|
173
|
+
git rebase -i origin/<base>
|
|
174
|
+
# Then force-push (ALWAYS use --force-with-lease, NEVER --force)
|
|
175
|
+
git push --force-with-lease
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**When to use:** Team projects, protected branches, changes needing review, anything non-trivial.
|
|
179
|
+
|
|
180
|
+
### PATH C: Cleanup / Abandon
|
|
181
|
+
|
|
182
|
+
For experimental, superseded, or failed work.
|
|
183
|
+
|
|
184
|
+
**Before abandoning, check for salvageable work:**
|
|
185
|
+
```bash
|
|
186
|
+
# Review what would be lost
|
|
187
|
+
git log origin/<base>..HEAD --oneline
|
|
188
|
+
git diff origin/<base>..HEAD --stat
|
|
189
|
+
|
|
190
|
+
# Cherry-pick specific commits if needed
|
|
191
|
+
git checkout <base>
|
|
192
|
+
git cherry-pick <commit-hash>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Then proceed to Phase 4 cleanup.
|
|
196
|
+
|
|
197
|
+
## Phase 4: Post-Completion Cleanup
|
|
198
|
+
|
|
199
|
+
### After Merge or PR Creation
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# 1. Switch to base branch
|
|
203
|
+
git checkout <base>
|
|
204
|
+
git pull origin <base>
|
|
205
|
+
|
|
206
|
+
# 2. Delete local branch (-d is safe; use -D only if unmerged and intentional)
|
|
207
|
+
git branch -d <feature-branch>
|
|
208
|
+
|
|
209
|
+
# 3. Delete remote branch (if merged or abandoned)
|
|
210
|
+
git push origin --delete <feature-branch>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### If in a Git Worktree
|
|
214
|
+
|
|
215
|
+
**IMPORTANT: Remove worktree BEFORE deleting the branch.**
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
# 1. Leave the worktree directory
|
|
219
|
+
cd <main-repo-path>
|
|
220
|
+
|
|
221
|
+
# 2. Remove the worktree
|
|
222
|
+
git worktree remove <worktree-path>
|
|
223
|
+
|
|
224
|
+
# 3. Prune stale worktree references
|
|
225
|
+
git worktree prune
|
|
226
|
+
|
|
227
|
+
# 4. NOW delete the branch (-d is safe; use -D only if unmerged and intentional)
|
|
228
|
+
git branch -d <feature-branch>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
**Why this order matters:** You cannot delete a branch that is checked out in a worktree. Attempting to do so will fail. Always remove the worktree first.
|
|
232
|
+
|
|
233
|
+
### Verification
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# Confirm cleanup
|
|
237
|
+
git branch # feature branch should be gone
|
|
238
|
+
git branch -r # remote branch should be gone
|
|
239
|
+
git worktree list # no stale worktrees
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Common Rationalizations
|
|
243
|
+
|
|
244
|
+
| Excuse | Reality |
|
|
245
|
+
|--------|---------|
|
|
246
|
+
| "Tests mostly pass" | Mostly ≠ all. Fix the failures. |
|
|
247
|
+
| "I'll clean up commits later" | Later never comes. Squash now. |
|
|
248
|
+
| "Direct push is faster" | Fast now, broken later. Use a PR. |
|
|
249
|
+
| "It's just a small change" | Small changes break things too. Follow the checklist. |
|
|
250
|
+
| "I'll delete the branch later" | Stale branches accumulate. Clean up now. |
|
|
251
|
+
| "The worktree is fine to leave" | Orphaned worktrees waste disk and cause confusion. Remove it. |
|
|
252
|
+
| "Force push is fine here" | Use `--force-with-lease`. Always. No exceptions. |
|
|
253
|
+
| "No one reviews my PRs anyway" | The PR is the review record. Create it anyway. |
|
|
254
|
+
| "I'll rebase after merge" | Rebase before. Conflicts after merge are worse. |
|
|
255
|
+
|
|
256
|
+
## Red Flags — STOP
|
|
257
|
+
|
|
258
|
+
- Tests failing or skipped
|
|
259
|
+
- Uncommitted changes in working directory
|
|
260
|
+
- Pushing directly to main/master
|
|
261
|
+
- Using `git push --force` (use `--force-with-lease`)
|
|
262
|
+
- Deleting a branch before removing its worktree
|
|
263
|
+
- Merging without updating base branch first
|
|
264
|
+
- Skipping the pre-completion checklist
|
|
265
|
+
- "Just this once" thinking
|
|
266
|
+
|
|
267
|
+
**Any red flag means: STOP. Go back to Phase 1.**
|
|
268
|
+
|
|
269
|
+
## Verification Checklist
|
|
270
|
+
|
|
271
|
+
Before marking branch work as complete:
|
|
272
|
+
|
|
273
|
+
- [ ] Pre-completion checklist passed (Phase 1)
|
|
274
|
+
- [ ] Decision made and executed (Phase 2 + 3)
|
|
275
|
+
- [ ] Local branch deleted
|
|
276
|
+
- [ ] Remote branch deleted (if applicable)
|
|
277
|
+
- [ ] Worktree removed (if applicable)
|
|
278
|
+
- [ ] On base branch with latest changes
|
|
279
|
+
- [ ] No stale worktree references
|
|
280
|
+
|
|
281
|
+
Can't check all boxes? You're not done yet.
|
|
@@ -40,3 +40,8 @@ Interpret creatively and make unexpected choices that feel genuinely designed fo
|
|
|
40
40
|
**IMPORTANT**: Match implementation complexity to the aesthetic vision. Maximalist designs need elaborate code with extensive animations and effects. Minimalist or refined designs need restraint, precision, and careful attention to spacing, typography, and subtle details. Elegance comes from executing the vision well.
|
|
41
41
|
|
|
42
42
|
Remember: Claude is capable of extraordinary creative work. Don't hold back, show what can truly be created when thinking outside the box and committing fully to a distinctive vision.
|
|
43
|
+
|
|
44
|
+
## Additional resources
|
|
45
|
+
|
|
46
|
+
- [CSS design patterns](references/css-patterns.md) — Typography systems, color tokens, layout patterns, animations, and texture techniques
|
|
47
|
+
- [Component template](examples/component-template.tsx) — Production-grade React component with staggered animations, CSS variables, and accessibility
|