get-shit-done-cc 1.9.13 → 1.10.0-experimental.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 +8 -0
- package/agents/design-specialist.md +222 -0
- package/agents/gsd-executor.md +37 -375
- package/agents/gsd-planner.md +15 -108
- package/bin/install.js +92 -5
- package/commands/gsd/autopilot.md +518 -0
- package/commands/gsd/checkpoints.md +229 -0
- package/commands/gsd/design-system.md +70 -0
- package/commands/gsd/discuss-design.md +77 -0
- package/commands/gsd/extend.md +80 -0
- package/commands/gsd/help.md +43 -0
- package/commands/gsd/new-project.md +94 -8
- package/commands/gsd/plan-phase.md +35 -5
- package/get-shit-done/references/ccr-integration.md +468 -0
- package/get-shit-done/references/checkpoint-execution.md +369 -0
- package/get-shit-done/references/checkpoint-types.md +728 -0
- package/get-shit-done/references/deviation-rules.md +215 -0
- package/get-shit-done/references/framework-patterns.md +543 -0
- package/get-shit-done/references/ui-principles.md +258 -0
- package/get-shit-done/references/verification-patterns.md +1 -1
- package/get-shit-done/skills/gsd-extend/SKILL.md +154 -0
- package/get-shit-done/skills/gsd-extend/references/agent-structure.md +305 -0
- package/get-shit-done/skills/gsd-extend/references/extension-anatomy.md +123 -0
- package/get-shit-done/skills/gsd-extend/references/reference-structure.md +408 -0
- package/get-shit-done/skills/gsd-extend/references/template-structure.md +370 -0
- package/get-shit-done/skills/gsd-extend/references/validation-rules.md +140 -0
- package/get-shit-done/skills/gsd-extend/references/workflow-structure.md +253 -0
- package/get-shit-done/skills/gsd-extend/templates/agent-template.md +234 -0
- package/get-shit-done/skills/gsd-extend/templates/reference-template.md +239 -0
- package/get-shit-done/skills/gsd-extend/templates/workflow-template.md +169 -0
- package/get-shit-done/skills/gsd-extend/workflows/create-approach.md +332 -0
- package/get-shit-done/skills/gsd-extend/workflows/list-extensions.md +133 -0
- package/get-shit-done/skills/gsd-extend/workflows/remove-extension.md +93 -0
- package/get-shit-done/skills/gsd-extend/workflows/validate-extension.md +184 -0
- package/get-shit-done/templates/autopilot-script-simple.sh +181 -0
- package/get-shit-done/templates/autopilot-script.sh +1142 -0
- package/get-shit-done/templates/autopilot-script.sh.backup +1142 -0
- package/get-shit-done/templates/design-system.md +238 -0
- package/get-shit-done/templates/phase-design.md +205 -0
- package/get-shit-done/templates/phase-models-template.json +71 -0
- package/get-shit-done/templates/phase-prompt.md +4 -4
- package/get-shit-done/templates/state.md +37 -0
- package/get-shit-done/tui/App.tsx +169 -0
- package/get-shit-done/tui/README.md +107 -0
- package/get-shit-done/tui/build.js +37 -0
- package/get-shit-done/tui/components/ActivityFeed.tsx +126 -0
- package/get-shit-done/tui/components/PhaseCard.tsx +86 -0
- package/get-shit-done/tui/components/StatsBar.tsx +147 -0
- package/get-shit-done/tui/dist/index.js +387 -0
- package/get-shit-done/tui/index.tsx +12 -0
- package/get-shit-done/tui/package-lock.json +1074 -0
- package/get-shit-done/tui/package.json +22 -0
- package/get-shit-done/tui/utils/pipeReader.ts +129 -0
- package/get-shit-done/workflows/design-system.md +245 -0
- package/get-shit-done/workflows/discuss-design.md +330 -0
- package/get-shit-done/workflows/execute-phase.md +44 -1
- package/get-shit-done/workflows/execute-plan-auth.md +122 -0
- package/get-shit-done/workflows/execute-plan-checkpoints.md +541 -0
- package/get-shit-done/workflows/execute-plan.md +34 -856
- package/package.json +8 -3
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
<workflow_structure>
|
|
2
|
+
|
|
3
|
+
## Workflow Extensions
|
|
4
|
+
|
|
5
|
+
Workflows define execution patterns - sequences of steps that GSD follows to accomplish tasks like planning, execution, or verification.
|
|
6
|
+
|
|
7
|
+
## Required Frontmatter
|
|
8
|
+
|
|
9
|
+
```yaml
|
|
10
|
+
---
|
|
11
|
+
name: workflow-name
|
|
12
|
+
description: What this workflow accomplishes
|
|
13
|
+
triggers:
|
|
14
|
+
- plan-phase # Triggered by /gsd:plan-phase
|
|
15
|
+
- execute-plan # Triggered during plan execution
|
|
16
|
+
- execute-phase # Triggered by /gsd:execute-phase
|
|
17
|
+
- verify-phase # Triggered by verification
|
|
18
|
+
- custom # Custom trigger (called explicitly)
|
|
19
|
+
replaces: built-in-name # Optional: replace a built-in workflow
|
|
20
|
+
requires: [reference-names] # Optional: auto-load these references
|
|
21
|
+
---
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Workflow Body Structure
|
|
25
|
+
|
|
26
|
+
```xml
|
|
27
|
+
<purpose>
|
|
28
|
+
What this workflow accomplishes.
|
|
29
|
+
</purpose>
|
|
30
|
+
|
|
31
|
+
<when_to_use>
|
|
32
|
+
Conditions that trigger this workflow.
|
|
33
|
+
</when_to_use>
|
|
34
|
+
|
|
35
|
+
<required_reading>
|
|
36
|
+
@~/.claude/get-shit-done/references/some-reference.md
|
|
37
|
+
@.planning/extensions/references/custom-reference.md
|
|
38
|
+
</required_reading>
|
|
39
|
+
|
|
40
|
+
<process>
|
|
41
|
+
|
|
42
|
+
<step name="step_one" priority="first">
|
|
43
|
+
First step description.
|
|
44
|
+
|
|
45
|
+
Code examples:
|
|
46
|
+
```bash
|
|
47
|
+
command --here
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Conditional logic:
|
|
51
|
+
<if condition="some condition">
|
|
52
|
+
What to do when condition is true.
|
|
53
|
+
</if>
|
|
54
|
+
</step>
|
|
55
|
+
|
|
56
|
+
<step name="step_two">
|
|
57
|
+
Second step description.
|
|
58
|
+
</step>
|
|
59
|
+
|
|
60
|
+
<step name="step_three">
|
|
61
|
+
Third step description.
|
|
62
|
+
</step>
|
|
63
|
+
|
|
64
|
+
</process>
|
|
65
|
+
|
|
66
|
+
<success_criteria>
|
|
67
|
+
- [ ] Criterion one
|
|
68
|
+
- [ ] Criterion two
|
|
69
|
+
- [ ] Criterion three
|
|
70
|
+
</success_criteria>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Step Attributes
|
|
74
|
+
|
|
75
|
+
| Attribute | Values | Purpose |
|
|
76
|
+
|-----------|--------|---------|
|
|
77
|
+
| `name` | snake_case | Identifier for the step |
|
|
78
|
+
| `priority` | first, second, last | Execution order hints |
|
|
79
|
+
| `conditional` | if/when expression | Only run if condition met |
|
|
80
|
+
| `parallel` | true/false | Can run with other parallel steps |
|
|
81
|
+
|
|
82
|
+
## Conditional Logic
|
|
83
|
+
|
|
84
|
+
Workflows can include conditional sections:
|
|
85
|
+
|
|
86
|
+
```xml
|
|
87
|
+
<if mode="yolo">
|
|
88
|
+
Auto-approve behavior
|
|
89
|
+
</if>
|
|
90
|
+
|
|
91
|
+
<if mode="interactive">
|
|
92
|
+
Confirmation-required behavior
|
|
93
|
+
</if>
|
|
94
|
+
|
|
95
|
+
<if exists=".planning/DISCOVERY.md">
|
|
96
|
+
Behavior when discovery exists
|
|
97
|
+
</if>
|
|
98
|
+
|
|
99
|
+
<if config="workflow.research">
|
|
100
|
+
Behavior when research is enabled in config
|
|
101
|
+
</if>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Context Loading
|
|
105
|
+
|
|
106
|
+
Workflows specify what context to load:
|
|
107
|
+
|
|
108
|
+
```xml
|
|
109
|
+
<required_reading>
|
|
110
|
+
@~/.claude/get-shit-done/references/deviation-rules.md
|
|
111
|
+
</required_reading>
|
|
112
|
+
|
|
113
|
+
<conditional_loading>
|
|
114
|
+
**If plan has checkpoints:**
|
|
115
|
+
@~/.claude/get-shit-done/workflows/execute-plan-checkpoints.md
|
|
116
|
+
|
|
117
|
+
**If authentication error:**
|
|
118
|
+
@~/.claude/get-shit-done/workflows/execute-plan-auth.md
|
|
119
|
+
</conditional_loading>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Output Specification
|
|
123
|
+
|
|
124
|
+
Workflows should specify expected outputs:
|
|
125
|
+
|
|
126
|
+
```xml
|
|
127
|
+
<output>
|
|
128
|
+
After completion, create:
|
|
129
|
+
- `.planning/phases/XX-name/{phase}-{plan}-SUMMARY.md`
|
|
130
|
+
|
|
131
|
+
Use template:
|
|
132
|
+
@~/.claude/get-shit-done/templates/summary.md
|
|
133
|
+
</output>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Integration with GSD Commands
|
|
137
|
+
|
|
138
|
+
To use a custom workflow from a GSD command:
|
|
139
|
+
|
|
140
|
+
**Option 1: Replace built-in**
|
|
141
|
+
Name your workflow same as built-in (e.g., `execute-plan.md`). GSD automatically uses yours.
|
|
142
|
+
|
|
143
|
+
**Option 2: Explicit reference**
|
|
144
|
+
In your command or another workflow:
|
|
145
|
+
```xml
|
|
146
|
+
<execution_context>
|
|
147
|
+
@.planning/extensions/workflows/my-workflow.md
|
|
148
|
+
</execution_context>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Option 3: Spawn pattern**
|
|
152
|
+
If workflow runs as subagent:
|
|
153
|
+
```
|
|
154
|
+
Task(prompt="Follow workflow: @~/.claude/gsd-extensions/workflows/my-workflow.md", ...)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Example: Custom Planning Workflow
|
|
158
|
+
|
|
159
|
+
```yaml
|
|
160
|
+
---
|
|
161
|
+
name: spike-first-planning
|
|
162
|
+
description: Plan by spiking first, then formalizing
|
|
163
|
+
triggers: [plan-phase]
|
|
164
|
+
replaces: null # Alternative to default, not replacement
|
|
165
|
+
---
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```xml
|
|
169
|
+
<purpose>
|
|
170
|
+
Alternative planning workflow that creates a spike implementation first,
|
|
171
|
+
then derives formal plans from what worked.
|
|
172
|
+
</purpose>
|
|
173
|
+
|
|
174
|
+
<when_to_use>
|
|
175
|
+
- Domain is unfamiliar
|
|
176
|
+
- Requirements are fuzzy
|
|
177
|
+
- You want to discover approach through doing
|
|
178
|
+
</when_to_use>
|
|
179
|
+
|
|
180
|
+
<process>
|
|
181
|
+
|
|
182
|
+
<step name="create_spike_plan">
|
|
183
|
+
Create a minimal spike plan:
|
|
184
|
+
- Single task: "Spike: {phase goal}"
|
|
185
|
+
- No formal structure
|
|
186
|
+
- Goal is learning, not delivery
|
|
187
|
+
</step>
|
|
188
|
+
|
|
189
|
+
<step name="execute_spike">
|
|
190
|
+
Execute the spike:
|
|
191
|
+
- Time-boxed (1-2 hours)
|
|
192
|
+
- Document discoveries
|
|
193
|
+
- Note what worked and what didn't
|
|
194
|
+
</step>
|
|
195
|
+
|
|
196
|
+
<step name="derive_formal_plans">
|
|
197
|
+
From spike learnings:
|
|
198
|
+
- Extract the approach that worked
|
|
199
|
+
- Formalize into proper PLAN.md files
|
|
200
|
+
- Add verification and success criteria
|
|
201
|
+
</step>
|
|
202
|
+
|
|
203
|
+
<step name="cleanup_spike">
|
|
204
|
+
- Archive spike artifacts
|
|
205
|
+
- Proceed with formal execution
|
|
206
|
+
</step>
|
|
207
|
+
|
|
208
|
+
</process>
|
|
209
|
+
|
|
210
|
+
<success_criteria>
|
|
211
|
+
- [ ] Spike completed and learnings documented
|
|
212
|
+
- [ ] Formal plans derived from spike
|
|
213
|
+
- [ ] Ready for normal execution
|
|
214
|
+
</success_criteria>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
## Common Workflow Patterns
|
|
218
|
+
|
|
219
|
+
**Sequential execution:**
|
|
220
|
+
```xml
|
|
221
|
+
<step name="a">...</step>
|
|
222
|
+
<step name="b">Depends on step a results...</step>
|
|
223
|
+
<step name="c">Depends on step b results...</step>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Parallel steps:**
|
|
227
|
+
```xml
|
|
228
|
+
<step name="research_a" parallel="true">...</step>
|
|
229
|
+
<step name="research_b" parallel="true">...</step>
|
|
230
|
+
<step name="synthesize">Combines a and b...</step>
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
**Loop pattern:**
|
|
234
|
+
```xml
|
|
235
|
+
<step name="iterate">
|
|
236
|
+
For each {item}:
|
|
237
|
+
1. Process item
|
|
238
|
+
2. Check result
|
|
239
|
+
3. Continue or break
|
|
240
|
+
|
|
241
|
+
Loop until condition met.
|
|
242
|
+
</step>
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Decision gate:**
|
|
246
|
+
```xml
|
|
247
|
+
<step name="decision_gate">
|
|
248
|
+
Present options via AskUserQuestion.
|
|
249
|
+
Route to appropriate next step based on choice.
|
|
250
|
+
</step>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
</workflow_structure>
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-template
|
|
3
|
+
description: Template for creating custom agent extensions
|
|
4
|
+
used_by:
|
|
5
|
+
- create-agent
|
|
6
|
+
placeholders:
|
|
7
|
+
- name
|
|
8
|
+
- description
|
|
9
|
+
- tools
|
|
10
|
+
- color
|
|
11
|
+
- spawn_from
|
|
12
|
+
- role
|
|
13
|
+
- expertise
|
|
14
|
+
- execution_flow
|
|
15
|
+
- output_format
|
|
16
|
+
- success_criteria
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
---
|
|
23
|
+
name: {name}
|
|
24
|
+
description: {description}
|
|
25
|
+
tools: [{tools}]
|
|
26
|
+
color: {color}
|
|
27
|
+
spawn_from: [{spawn_from}]
|
|
28
|
+
---
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
```xml
|
|
32
|
+
<role>
|
|
33
|
+
{role}
|
|
34
|
+
</role>
|
|
35
|
+
|
|
36
|
+
<expertise>
|
|
37
|
+
{expertise}
|
|
38
|
+
</expertise>
|
|
39
|
+
|
|
40
|
+
<execution_flow>
|
|
41
|
+
|
|
42
|
+
{execution_flow}
|
|
43
|
+
|
|
44
|
+
</execution_flow>
|
|
45
|
+
|
|
46
|
+
<output_format>
|
|
47
|
+
{output_format}
|
|
48
|
+
</output_format>
|
|
49
|
+
|
|
50
|
+
<success_criteria>
|
|
51
|
+
{success_criteria}
|
|
52
|
+
</success_criteria>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<guidelines>
|
|
58
|
+
|
|
59
|
+
## How to Fill This Template
|
|
60
|
+
|
|
61
|
+
**{name}:** kebab-case identifier, role-based (e.g., `security-auditor`, `api-documenter`)
|
|
62
|
+
|
|
63
|
+
**{description}:** One sentence describing what this agent does and when to spawn it
|
|
64
|
+
|
|
65
|
+
**{tools}:** Array of tools this agent needs. Choose minimum necessary:
|
|
66
|
+
- Read-only: `[Read, Grep, Glob]`
|
|
67
|
+
- Code modification: `[Read, Write, Edit, Bash, Grep, Glob]`
|
|
68
|
+
- Research: `[Read, Grep, Glob, WebFetch, WebSearch]`
|
|
69
|
+
- Docs lookup: `[Read, mcp__context7__*]`
|
|
70
|
+
|
|
71
|
+
**{color}:** Terminal output color: green, yellow, red, blue, cyan, magenta
|
|
72
|
+
|
|
73
|
+
**{spawn_from}:** Array of operations that can spawn this agent:
|
|
74
|
+
- `plan-phase`, `execute-plan`, `execute-phase`, `verify-phase`, `custom`
|
|
75
|
+
|
|
76
|
+
**{role}:** 3-5 sentences defining:
|
|
77
|
+
- What the agent is ("You are a...")
|
|
78
|
+
- What it does
|
|
79
|
+
- What triggers it
|
|
80
|
+
- Its primary responsibility
|
|
81
|
+
|
|
82
|
+
**{expertise}:** Domain knowledge the agent needs:
|
|
83
|
+
- Key concepts
|
|
84
|
+
- Patterns to look for
|
|
85
|
+
- Best practices
|
|
86
|
+
- Common issues
|
|
87
|
+
|
|
88
|
+
**{execution_flow}:** Series of `<step>` elements defining how the agent works:
|
|
89
|
+
- understand_context: Parse input
|
|
90
|
+
- perform_task: Core work
|
|
91
|
+
- produce_output: Generate results
|
|
92
|
+
|
|
93
|
+
**{output_format}:** Structured format for agent's return value
|
|
94
|
+
|
|
95
|
+
**{success_criteria}:** Markdown checklist of completion criteria
|
|
96
|
+
|
|
97
|
+
</guidelines>
|
|
98
|
+
|
|
99
|
+
<examples>
|
|
100
|
+
|
|
101
|
+
## Good Example
|
|
102
|
+
|
|
103
|
+
```yaml
|
|
104
|
+
---
|
|
105
|
+
name: performance-profiler
|
|
106
|
+
description: Analyzes code for performance bottlenecks and optimization opportunities
|
|
107
|
+
tools: [Read, Grep, Glob, Bash]
|
|
108
|
+
color: yellow
|
|
109
|
+
spawn_from: [verify-phase, custom]
|
|
110
|
+
---
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
```xml
|
|
114
|
+
<role>
|
|
115
|
+
You are a performance profiler. You analyze code for performance bottlenecks
|
|
116
|
+
and optimization opportunities.
|
|
117
|
+
|
|
118
|
+
You are spawned during verification or on-demand to review code efficiency.
|
|
119
|
+
|
|
120
|
+
Your job: Identify slow patterns, memory leaks, unnecessary computations, and
|
|
121
|
+
provide actionable optimization recommendations.
|
|
122
|
+
</role>
|
|
123
|
+
|
|
124
|
+
<expertise>
|
|
125
|
+
## Performance Analysis
|
|
126
|
+
|
|
127
|
+
**Database queries:**
|
|
128
|
+
- N+1 queries (use includes/joins)
|
|
129
|
+
- Missing indexes on queried columns
|
|
130
|
+
- Over-fetching (select only needed columns)
|
|
131
|
+
|
|
132
|
+
**Memory:**
|
|
133
|
+
- Large objects in memory
|
|
134
|
+
- Memory leaks in closures
|
|
135
|
+
- Unbounded arrays/caches
|
|
136
|
+
|
|
137
|
+
**Computation:**
|
|
138
|
+
- Redundant calculations
|
|
139
|
+
- Missing memoization
|
|
140
|
+
- Blocking operations in hot paths
|
|
141
|
+
|
|
142
|
+
**Patterns to grep:**
|
|
143
|
+
```bash
|
|
144
|
+
# N+1 pattern
|
|
145
|
+
grep -n "for.*await.*find" $FILE
|
|
146
|
+
|
|
147
|
+
# Memory accumulation
|
|
148
|
+
grep -n "push.*loop\|concat.*map" $FILE
|
|
149
|
+
```
|
|
150
|
+
</expertise>
|
|
151
|
+
|
|
152
|
+
<execution_flow>
|
|
153
|
+
|
|
154
|
+
<step name="identify_hot_paths">
|
|
155
|
+
Find performance-critical code:
|
|
156
|
+
- API route handlers
|
|
157
|
+
- Data processing functions
|
|
158
|
+
- Rendering logic
|
|
159
|
+
- Frequently called utilities
|
|
160
|
+
</step>
|
|
161
|
+
|
|
162
|
+
<step name="analyze_patterns">
|
|
163
|
+
For each hot path:
|
|
164
|
+
1. Check for N+1 queries
|
|
165
|
+
2. Look for redundant computations
|
|
166
|
+
3. Identify memory accumulation
|
|
167
|
+
4. Check async patterns
|
|
168
|
+
</step>
|
|
169
|
+
|
|
170
|
+
<step name="generate_recommendations">
|
|
171
|
+
For each finding:
|
|
172
|
+
- Severity (critical, high, medium, low)
|
|
173
|
+
- Current code snippet
|
|
174
|
+
- Recommended fix
|
|
175
|
+
- Expected improvement
|
|
176
|
+
</step>
|
|
177
|
+
|
|
178
|
+
</execution_flow>
|
|
179
|
+
|
|
180
|
+
<output_format>
|
|
181
|
+
## PERFORMANCE_ANALYSIS
|
|
182
|
+
|
|
183
|
+
**Files analyzed:** {count}
|
|
184
|
+
**Issues found:** {count by severity}
|
|
185
|
+
|
|
186
|
+
### Critical Issues
|
|
187
|
+
|
|
188
|
+
| File | Line | Issue | Recommendation |
|
|
189
|
+
|------|------|-------|----------------|
|
|
190
|
+
| path | N | description | fix |
|
|
191
|
+
|
|
192
|
+
### High Priority
|
|
193
|
+
|
|
194
|
+
...
|
|
195
|
+
|
|
196
|
+
### Optimization Opportunities
|
|
197
|
+
|
|
198
|
+
1. {opportunity with expected impact}
|
|
199
|
+
2. {opportunity}
|
|
200
|
+
|
|
201
|
+
### Summary
|
|
202
|
+
|
|
203
|
+
{Overall assessment and top 3 recommendations}
|
|
204
|
+
</output_format>
|
|
205
|
+
|
|
206
|
+
<success_criteria>
|
|
207
|
+
- [ ] Hot paths identified
|
|
208
|
+
- [ ] Each path analyzed for common issues
|
|
209
|
+
- [ ] Findings categorized by severity
|
|
210
|
+
- [ ] Recommendations are actionable
|
|
211
|
+
- [ ] Expected improvements noted
|
|
212
|
+
</success_criteria>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Bad Example
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
---
|
|
219
|
+
name: helper
|
|
220
|
+
description: Helps with stuff
|
|
221
|
+
tools: [Read, Write, Edit, Bash, Grep, Glob, WebFetch, WebSearch]
|
|
222
|
+
---
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Problems:
|
|
226
|
+
- Name is too generic
|
|
227
|
+
- Description is vague
|
|
228
|
+
- Too many tools (grants everything)
|
|
229
|
+
- No spawn_from defined
|
|
230
|
+
- No role or expertise
|
|
231
|
+
- No execution flow
|
|
232
|
+
- No output format
|
|
233
|
+
|
|
234
|
+
</examples>
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reference-template
|
|
3
|
+
description: Template for creating custom reference extensions
|
|
4
|
+
used_by:
|
|
5
|
+
- create-reference
|
|
6
|
+
placeholders:
|
|
7
|
+
- name
|
|
8
|
+
- description
|
|
9
|
+
- load_when
|
|
10
|
+
- auto_load_for
|
|
11
|
+
- topic
|
|
12
|
+
- overview
|
|
13
|
+
- core_concepts
|
|
14
|
+
- patterns
|
|
15
|
+
- anti_patterns
|
|
16
|
+
- quick_reference
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
|
|
21
|
+
```yaml
|
|
22
|
+
---
|
|
23
|
+
name: {name}
|
|
24
|
+
description: {description}
|
|
25
|
+
load_when:
|
|
26
|
+
- {keywords}
|
|
27
|
+
auto_load_for:
|
|
28
|
+
- {operations}
|
|
29
|
+
---
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```xml
|
|
33
|
+
<{topic}>
|
|
34
|
+
|
|
35
|
+
## Overview
|
|
36
|
+
|
|
37
|
+
{overview}
|
|
38
|
+
|
|
39
|
+
## Core Concepts
|
|
40
|
+
|
|
41
|
+
{core_concepts}
|
|
42
|
+
|
|
43
|
+
## Patterns
|
|
44
|
+
|
|
45
|
+
{patterns}
|
|
46
|
+
|
|
47
|
+
## Anti-Patterns
|
|
48
|
+
|
|
49
|
+
{anti_patterns}
|
|
50
|
+
|
|
51
|
+
## Quick Reference
|
|
52
|
+
|
|
53
|
+
{quick_reference}
|
|
54
|
+
|
|
55
|
+
</{topic}>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<guidelines>
|
|
61
|
+
|
|
62
|
+
## How to Fill This Template
|
|
63
|
+
|
|
64
|
+
**{name}:** kebab-case identifier (e.g., `react-patterns`, `stripe-integration`)
|
|
65
|
+
|
|
66
|
+
**{description}:** One sentence describing what knowledge this provides
|
|
67
|
+
|
|
68
|
+
**{load_when}:** Array of keywords that trigger loading:
|
|
69
|
+
- Technology names: `react`, `prisma`, `stripe`
|
|
70
|
+
- Concepts: `authentication`, `payments`, `api`
|
|
71
|
+
- File patterns: `*.tsx`, `route.ts`
|
|
72
|
+
- `always` for universal loading (use sparingly)
|
|
73
|
+
|
|
74
|
+
**{auto_load_for}:** Array of operations to auto-load for:
|
|
75
|
+
- `plan-phase` - Load during planning
|
|
76
|
+
- `execute-plan` - Load during execution
|
|
77
|
+
- `verify-phase` - Load during verification
|
|
78
|
+
- `[]` for no auto-loading
|
|
79
|
+
|
|
80
|
+
**{topic}:** XML tag name matching the knowledge domain (e.g., `react_patterns`)
|
|
81
|
+
|
|
82
|
+
**{overview}:** 2-3 sentences summarizing this knowledge area
|
|
83
|
+
|
|
84
|
+
**{core_concepts}:** Key concepts explained with:
|
|
85
|
+
- Subsections for each concept
|
|
86
|
+
- Key points as bullets
|
|
87
|
+
- Code examples where helpful
|
|
88
|
+
|
|
89
|
+
**{patterns}:** Recommended approaches with:
|
|
90
|
+
- When to use each pattern
|
|
91
|
+
- Implementation examples
|
|
92
|
+
- Common mistakes to avoid
|
|
93
|
+
|
|
94
|
+
**{anti_patterns}:** What NOT to do with:
|
|
95
|
+
- Problem description
|
|
96
|
+
- Why it happens
|
|
97
|
+
- Better approach
|
|
98
|
+
|
|
99
|
+
**{quick_reference}:** Cheat sheet table of terms and definitions
|
|
100
|
+
|
|
101
|
+
</guidelines>
|
|
102
|
+
|
|
103
|
+
<examples>
|
|
104
|
+
|
|
105
|
+
## Good Example
|
|
106
|
+
|
|
107
|
+
```yaml
|
|
108
|
+
---
|
|
109
|
+
name: prisma-patterns
|
|
110
|
+
description: Prisma ORM patterns and best practices for this project
|
|
111
|
+
load_when:
|
|
112
|
+
- prisma
|
|
113
|
+
- database
|
|
114
|
+
- schema
|
|
115
|
+
- model
|
|
116
|
+
- db
|
|
117
|
+
auto_load_for: []
|
|
118
|
+
---
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
```xml
|
|
122
|
+
<prisma_patterns>
|
|
123
|
+
|
|
124
|
+
## Overview
|
|
125
|
+
|
|
126
|
+
This project uses Prisma as the ORM. All database access goes through Prisma
|
|
127
|
+
Client. Schema is in `prisma/schema.prisma`.
|
|
128
|
+
|
|
129
|
+
## Core Concepts
|
|
130
|
+
|
|
131
|
+
### Schema Organization
|
|
132
|
+
|
|
133
|
+
Models are grouped by domain in schema.prisma:
|
|
134
|
+
- User and auth models together
|
|
135
|
+
- Content models together
|
|
136
|
+
- System/config models at the end
|
|
137
|
+
|
|
138
|
+
**Naming:**
|
|
139
|
+
- Models: PascalCase singular (User, not Users)
|
|
140
|
+
- Fields: camelCase
|
|
141
|
+
- Relations: named descriptively (author, posts)
|
|
142
|
+
|
|
143
|
+
### Migrations
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Development: push without migration
|
|
147
|
+
npx prisma db push
|
|
148
|
+
|
|
149
|
+
# Production: create migration
|
|
150
|
+
npx prisma migrate dev --name description
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Patterns
|
|
154
|
+
|
|
155
|
+
### Eager Loading
|
|
156
|
+
|
|
157
|
+
**When to use:** Need related data in same request
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
const user = await prisma.user.findUnique({
|
|
161
|
+
where: { id },
|
|
162
|
+
include: {
|
|
163
|
+
posts: true,
|
|
164
|
+
profile: true,
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Transaction
|
|
170
|
+
|
|
171
|
+
**When to use:** Multiple writes that must succeed together
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
await prisma.$transaction([
|
|
175
|
+
prisma.user.update({ ... }),
|
|
176
|
+
prisma.audit.create({ ... }),
|
|
177
|
+
]);
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## Anti-Patterns
|
|
181
|
+
|
|
182
|
+
### N+1 Queries
|
|
183
|
+
|
|
184
|
+
**Problem:** Fetching related data in a loop
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
// BAD
|
|
188
|
+
const users = await prisma.user.findMany();
|
|
189
|
+
for (const user of users) {
|
|
190
|
+
const posts = await prisma.post.findMany({ where: { authorId: user.id } });
|
|
191
|
+
}
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
**Better:**
|
|
195
|
+
```typescript
|
|
196
|
+
const users = await prisma.user.findMany({
|
|
197
|
+
include: { posts: true },
|
|
198
|
+
});
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Raw Queries for Simple Operations
|
|
202
|
+
|
|
203
|
+
**Problem:** Using $queryRaw when Prisma methods work
|
|
204
|
+
|
|
205
|
+
**Better:** Use Prisma Client methods. They're type-safe and handle escaping.
|
|
206
|
+
|
|
207
|
+
## Quick Reference
|
|
208
|
+
|
|
209
|
+
| Operation | Method |
|
|
210
|
+
|-----------|--------|
|
|
211
|
+
| Find one | `findUnique`, `findFirst` |
|
|
212
|
+
| Find many | `findMany` |
|
|
213
|
+
| Create | `create`, `createMany` |
|
|
214
|
+
| Update | `update`, `updateMany` |
|
|
215
|
+
| Delete | `delete`, `deleteMany` |
|
|
216
|
+
| Count | `count` |
|
|
217
|
+
|
|
218
|
+
</prisma_patterns>
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Bad Example
|
|
222
|
+
|
|
223
|
+
```yaml
|
|
224
|
+
---
|
|
225
|
+
name: database
|
|
226
|
+
description: Database stuff
|
|
227
|
+
load_when:
|
|
228
|
+
- always
|
|
229
|
+
---
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
Problems:
|
|
233
|
+
- Name too generic
|
|
234
|
+
- Description vague
|
|
235
|
+
- `always` load is wasteful
|
|
236
|
+
- No actual content
|
|
237
|
+
- No patterns or examples
|
|
238
|
+
|
|
239
|
+
</examples>
|