dino-spec 18.4.0 → 18.5.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/.claude/skills/dino.analyze-codebase/SKILL.md +166 -0
- package/.claude/skills/dino.refactor/SKILL.md +367 -0
- package/.claude/skills/dino.team/SKILL.md +398 -0
- package/.claude/skills/dino.verify/SKILL.md +195 -0
- package/dist/commands/hooks/registry.d.ts.map +1 -1
- package/dist/commands/hooks/registry.js +43 -0
- package/dist/commands/hooks/registry.js.map +1 -1
- package/dist/commands/hooks/types.d.ts +1 -1
- package/dist/commands/hooks/types.d.ts.map +1 -1
- package/dist/commands/hooks/utils.d.ts +4 -0
- package/dist/commands/hooks/utils.d.ts.map +1 -1
- package/dist/commands/hooks/utils.js +4 -0
- package/dist/commands/hooks/utils.js.map +1 -1
- package/dist/core/memory/agents/memory-retrieval-agent.d.ts +6 -5
- package/dist/core/memory/agents/memory-retrieval-agent.d.ts.map +1 -1
- package/dist/core/memory/agents/memory-retrieval-agent.js +59 -174
- package/dist/core/memory/agents/memory-retrieval-agent.js.map +1 -1
- package/dist/core/memory/capture-agent.d.ts +47 -0
- package/dist/core/memory/capture-agent.d.ts.map +1 -0
- package/dist/core/memory/capture-agent.js +170 -0
- package/dist/core/memory/capture-agent.js.map +1 -0
- package/dist/hooks/memory-capture-hooks.d.ts +38 -0
- package/dist/hooks/memory-capture-hooks.d.ts.map +1 -0
- package/dist/hooks/memory-capture-hooks.js +198 -0
- package/dist/hooks/memory-capture-hooks.js.map +1 -0
- package/dist/hooks/memory-capture.d.ts +21 -4
- package/dist/hooks/memory-capture.d.ts.map +1 -1
- package/dist/hooks/memory-capture.js +151 -11
- package/dist/hooks/memory-capture.js.map +1 -1
- package/dist/services/memory/sqlite.d.ts +21 -0
- package/dist/services/memory/sqlite.d.ts.map +1 -1
- package/dist/services/memory/sqlite.js +194 -17
- package/dist/services/memory/sqlite.js.map +1 -1
- package/package.json +1 -1
- package/.claude/skills/dino.aging/SKILL.md +0 -64
- package/.claude/skills/dino.discover/SKILL.md +0 -45
- package/.claude/skills/dino.hatch/SKILL.md +0 -38
- package/.claude/skills/dino.nest/SKILL.md +0 -64
- package/.claude/skills/dino.sniff/SKILL.md +0 -38
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Analyze codebase and update documentation (README, ARCHITECTURE, CLAUDE, CHANGELOG)
|
|
3
|
+
metadata:
|
|
4
|
+
model: opus
|
|
5
|
+
context: fork
|
|
6
|
+
effort: high
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Grep
|
|
10
|
+
- Glob
|
|
11
|
+
- Task
|
|
12
|
+
- Bash
|
|
13
|
+
- Edit
|
|
14
|
+
- Write
|
|
15
|
+
- TaskCreate
|
|
16
|
+
- TaskUpdate
|
|
17
|
+
- TaskList
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Codebase Analyzer
|
|
21
|
+
|
|
22
|
+
Analyze project structure using parallel subagents and update documentation files for users and AI assistants.
|
|
23
|
+
|
|
24
|
+
## STEP 0: DETECT CONTEXT (CRITICAL - DO THIS FIRST)
|
|
25
|
+
|
|
26
|
+
**The fork loses context. You MUST reconstruct work context from files.**
|
|
27
|
+
|
|
28
|
+
**Read these IN ORDER:**
|
|
29
|
+
|
|
30
|
+
1. **Check ARGUMENTS**: If `$ARGUMENTS` is provided and non-empty, use it as analysis scope/flags.
|
|
31
|
+
- `--docs-only` - Only update docs, skip analysis
|
|
32
|
+
- `--stats-only` - Only show statistics
|
|
33
|
+
- `--changelog` - Only update CHANGELOG
|
|
34
|
+
|
|
35
|
+
2. **Check session.md for project context**: Read `.dino/session.md`
|
|
36
|
+
- Get current Focus area to prioritize analysis there
|
|
37
|
+
- Note Phase to understand workflow stage
|
|
38
|
+
- Check Recent Changes for what needs documenting
|
|
39
|
+
|
|
40
|
+
3. **Check handoff notes**: Read `.dino/handoff/latest.md` if exists
|
|
41
|
+
- Get context from previous session
|
|
42
|
+
|
|
43
|
+
4. **If analyzing dino-spec itself**: Read `CLAUDE.md` and `.claude/rules/dino/` for existing architecture
|
|
44
|
+
|
|
45
|
+
**CRITICAL**: Do NOT start analysis without understanding project structure first.
|
|
46
|
+
|
|
47
|
+
## Purpose
|
|
48
|
+
|
|
49
|
+
Deploy multiple specialized agents to explore different parts of the codebase, then synthesize findings to update:
|
|
50
|
+
|
|
51
|
+
- **README.md** - User instructions (setup, testing, deployment, glossary)
|
|
52
|
+
- **ARCHITECTURE.md** - System architecture and technical details
|
|
53
|
+
- **CLAUDE.md** - Instructions for Claude Code AI assistant
|
|
54
|
+
- **CHANGELOG.md** - Version history and release tracking
|
|
55
|
+
|
|
56
|
+
## Workflow
|
|
57
|
+
|
|
58
|
+
### Phase 1: Deploy Analysis Agents (Parallel)
|
|
59
|
+
|
|
60
|
+
Launch 5 specialized subagents concurrently:
|
|
61
|
+
|
|
62
|
+
1. **Backend API Agent** (Explore)
|
|
63
|
+
- Analyze Controllers, Services, Models, DTOs
|
|
64
|
+
- Document API patterns, middleware, background jobs
|
|
65
|
+
- Count files and identify key components
|
|
66
|
+
|
|
67
|
+
2. **Frontend React Agent** (Explore)
|
|
68
|
+
- Analyze Components, Pages, Hooks, Services
|
|
69
|
+
- Document state management, build tooling
|
|
70
|
+
- Identify UI patterns and dependencies
|
|
71
|
+
|
|
72
|
+
3. **Testing Infrastructure Agent** (Explore)
|
|
73
|
+
- Analyze unit tests, integration tests, E2E tests
|
|
74
|
+
- Document test patterns, frameworks, coverage
|
|
75
|
+
- Identify test utilities and mocking strategies
|
|
76
|
+
|
|
77
|
+
4. **Git History Agent** (Bash)
|
|
78
|
+
- Analyze commit history for CHANGELOG
|
|
79
|
+
- Identify features, fixes, breaking changes
|
|
80
|
+
- Group by version/sprint/date
|
|
81
|
+
|
|
82
|
+
5. **Configuration Agent** (Explore)
|
|
83
|
+
- Analyze appsettings, environment variables
|
|
84
|
+
- Document deployment requirements
|
|
85
|
+
- Identify external service dependencies
|
|
86
|
+
|
|
87
|
+
### Phase 2: Synthesize Results
|
|
88
|
+
|
|
89
|
+
Wait for all agents to complete, then:
|
|
90
|
+
|
|
91
|
+
1. Aggregate statistics (file counts, LOC)
|
|
92
|
+
2. Identify key patterns and conventions
|
|
93
|
+
3. Extract version history from commits
|
|
94
|
+
|
|
95
|
+
### Phase 3: Update Documentation
|
|
96
|
+
|
|
97
|
+
Update each file with analysis results:
|
|
98
|
+
|
|
99
|
+
#### README.md Updates
|
|
100
|
+
|
|
101
|
+
- Add beginner-friendly explanations
|
|
102
|
+
- Step-by-step setup guide
|
|
103
|
+
- Troubleshooting section
|
|
104
|
+
- Glossary for technical terms
|
|
105
|
+
- Production deployment guide
|
|
106
|
+
|
|
107
|
+
#### ARCHITECTURE.md Updates
|
|
108
|
+
|
|
109
|
+
- Codebase statistics table
|
|
110
|
+
- API endpoints overview
|
|
111
|
+
- Database schema summary
|
|
112
|
+
- Component relationship diagrams
|
|
113
|
+
|
|
114
|
+
#### CLAUDE.md Updates
|
|
115
|
+
|
|
116
|
+
- File counts in architecture section
|
|
117
|
+
- Key services and controllers tables
|
|
118
|
+
- Updated command references
|
|
119
|
+
|
|
120
|
+
#### CHANGELOG.md Creation/Update
|
|
121
|
+
|
|
122
|
+
- Follow Keep a Changelog format
|
|
123
|
+
- Group by version or sprint
|
|
124
|
+
- Categories: Added, Changed, Fixed, Security
|
|
125
|
+
|
|
126
|
+
## Output
|
|
127
|
+
|
|
128
|
+
Documentation files updated with:
|
|
129
|
+
|
|
130
|
+
- Current codebase statistics
|
|
131
|
+
- Accurate file counts
|
|
132
|
+
- User-friendly explanations
|
|
133
|
+
- Technical reference for AI assistants
|
|
134
|
+
- Complete version history
|
|
135
|
+
|
|
136
|
+
## Usage
|
|
137
|
+
|
|
138
|
+
```
|
|
139
|
+
/analyze-codebase
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Or with specific focus:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
/analyze-codebase --docs-only # Only update docs, skip analysis
|
|
146
|
+
/analyze-codebase --stats-only # Only show statistics
|
|
147
|
+
/analyze-codebase --changelog # Only update CHANGELOG
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Agent Configuration
|
|
151
|
+
|
|
152
|
+
| Agent | Type | Purpose |
|
|
153
|
+
| ------------- | ------- | ----------------------------- |
|
|
154
|
+
| Backend API | Explore | Controllers, Services, Models |
|
|
155
|
+
| Frontend | Explore | Components, Pages, Hooks |
|
|
156
|
+
| Testing | Explore | Unit, Integration, E2E tests |
|
|
157
|
+
| Git History | Bash | Commits, tags, releases |
|
|
158
|
+
| Configuration | Explore | Settings, deployment |
|
|
159
|
+
|
|
160
|
+
## Notes
|
|
161
|
+
|
|
162
|
+
- Uses Task tool with `run_in_background: true` for parallel execution
|
|
163
|
+
- Waits for all agents before synthesizing results
|
|
164
|
+
- Creates CHANGELOG.md if it doesn't exist
|
|
165
|
+
- Preserves existing documentation structure where possible
|
|
166
|
+
- Designed for non-technical users joining the project
|
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Enterprise-grade refactor agent - customer review then engineer planning
|
|
3
|
+
metadata:
|
|
4
|
+
model: opus
|
|
5
|
+
context: fork
|
|
6
|
+
effort: high
|
|
7
|
+
allowed-tools:
|
|
8
|
+
- Read
|
|
9
|
+
- Glob
|
|
10
|
+
- Grep
|
|
11
|
+
- Task
|
|
12
|
+
- AskUserQuestion
|
|
13
|
+
- Write
|
|
14
|
+
- TaskCreate
|
|
15
|
+
- TaskList
|
|
16
|
+
- TaskUpdate
|
|
17
|
+
- TaskGet
|
|
18
|
+
- WebSearch
|
|
19
|
+
auto-approve: false
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Enterprise Refactor Agent
|
|
23
|
+
|
|
24
|
+
A two-phase agent that first reviews your project as a **demanding enterprise customer**, then transitions to an **engineer role** to plan and clarify before implementation.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## STEP 0: DETECT CONTEXT (CRITICAL - DO THIS FIRST)
|
|
29
|
+
|
|
30
|
+
**The fork loses context. You MUST reconstruct work context from files.**
|
|
31
|
+
|
|
32
|
+
**Read these IN ORDER (stop at first match with relevant context):**
|
|
33
|
+
|
|
34
|
+
**Error Handling**: If any file read fails (file not found), skip to next source. Do NOT error out.
|
|
35
|
+
|
|
36
|
+
1. **Check ARGUMENTS**: If `$ARGUMENTS` is provided and non-empty, use it as the refactor scope.
|
|
37
|
+
- Found: Use as scope, proceed to Step 0.5
|
|
38
|
+
- Empty/missing: Continue to step 2
|
|
39
|
+
|
|
40
|
+
2. **Check session.md for recent Discovery**: Read `.dino/session.md`
|
|
41
|
+
- Find `### Discovery:` sections in `## Notes`
|
|
42
|
+
- Use the MOST RECENT discovery (by date)
|
|
43
|
+
- Extract any requirements or scope constraints
|
|
44
|
+
- Found discovery: Use as scope, proceed to Step 0.5
|
|
45
|
+
- File missing or no discovery: Continue to step 3
|
|
46
|
+
|
|
47
|
+
3. **Check handoff context**: Read `.dino/handoff/latest.md`
|
|
48
|
+
- Look for refactor-related scope or constraints
|
|
49
|
+
- Check for partial progress from previous session
|
|
50
|
+
- Found relevant handoff: Use as scope, proceed to Step 0.5
|
|
51
|
+
- File missing or not refactor-related: Continue to step 4
|
|
52
|
+
|
|
53
|
+
4. **Check existing refactor plans**: Read `.dino/plans/refactor-customer-review.md`
|
|
54
|
+
- If shows incomplete review (missing sections), CONTINUE from where it left off
|
|
55
|
+
- If shows complete review, skip to Phase 2
|
|
56
|
+
- Found: Resume from state, proceed accordingly
|
|
57
|
+
- File missing: Continue to step 5
|
|
58
|
+
|
|
59
|
+
5. **If NONE found**: Use `AskUserQuestion` with proper format:
|
|
60
|
+
```
|
|
61
|
+
AskUserQuestion({
|
|
62
|
+
questions: [{
|
|
63
|
+
question: "What area of the codebase should I review?",
|
|
64
|
+
header: "Scope",
|
|
65
|
+
options: [
|
|
66
|
+
{label: "Full project", description: "Review entire codebase"},
|
|
67
|
+
{label: "Security only", description: "Focus on security audit"},
|
|
68
|
+
{label: "Performance only", description: "Focus on performance issues"},
|
|
69
|
+
{label: "Specific directory", description: "You'll specify the path"}
|
|
70
|
+
],
|
|
71
|
+
multiSelect: false
|
|
72
|
+
}]
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**CRITICAL**: Do NOT ask user if context exists in any of the above files.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## STEP 0.5: PRE-FLIGHT CHECKS
|
|
81
|
+
|
|
82
|
+
Before proceeding, verify readiness:
|
|
83
|
+
|
|
84
|
+
1. **Check test/build status**: Read `.dino/session.md` for `## Test Status` and `## Build Status`
|
|
85
|
+
- If tests failing or build broken, WARN user: "Codebase has existing failures. Review may be incomplete."
|
|
86
|
+
- Recommend fixing critical failures first
|
|
87
|
+
|
|
88
|
+
2. **Check complexity**: Evaluate if `/dino.ralph-gate` is more appropriate
|
|
89
|
+
|
|
90
|
+
**Complexity Score Calculation:**
|
|
91
|
+
| Factor | Points |
|
|
92
|
+
|--------|--------|
|
|
93
|
+
| Files in scope > 10 | +30 |
|
|
94
|
+
| Multiple directories | +20 |
|
|
95
|
+
| Breaking changes expected | +20 |
|
|
96
|
+
| Database migrations needed | +15 |
|
|
97
|
+
| API contract changes | +15 |
|
|
98
|
+
| Security-critical changes | +10 |
|
|
99
|
+
|
|
100
|
+
If total > 70 points, recommend `/dino.ralph-gate` instead:
|
|
101
|
+
```
|
|
102
|
+
AskUserQuestion({
|
|
103
|
+
questions: [{
|
|
104
|
+
question: "This refactor appears complex (score: [N]). Use Ralph Gate for better tracking?",
|
|
105
|
+
header: "Workflow",
|
|
106
|
+
options: [
|
|
107
|
+
{label: "Use Ralph Gate (Recommended)", description: "Three-agent system with checkpoints"},
|
|
108
|
+
{label: "Continue with Refactor", description: "Standard two-phase review"}
|
|
109
|
+
],
|
|
110
|
+
multiSelect: false
|
|
111
|
+
}]
|
|
112
|
+
})
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
3. **Check confidence**: Read `.dino/session.md` for confidence score
|
|
116
|
+
- If confidence < 80% and scope is unclear, run `/dino.spec` first
|
|
117
|
+
|
|
118
|
+
4. **Update session state**:
|
|
119
|
+
```
|
|
120
|
+
Write to .dino/session.md under ## Phase:
|
|
121
|
+
Phase: refactor-review
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Proceed only when scope is clear and pre-flight checks pass.**
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## PHASE 1: CUSTOMER REVIEW MODE
|
|
129
|
+
|
|
130
|
+
**Persona**: You are a senior enterprise customer with 20+ years in technology leadership. You have seen countless failed projects and know exactly what separates production-ready systems from prototypes. You are paying significant money and expect enterprise-grade quality.
|
|
131
|
+
|
|
132
|
+
### Step 1.0: Detect Project Type
|
|
133
|
+
|
|
134
|
+
Before applying checklists, detect project type by scanning codebase:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
Glob for indicators:
|
|
138
|
+
- package.json scripts.start -> Web app / API
|
|
139
|
+
- bin/ or CLI in name -> CLI tool
|
|
140
|
+
- src/components/ or .tsx files -> Frontend
|
|
141
|
+
- prisma/ or migrations/ -> Has database
|
|
142
|
+
- Dockerfile or k8s/ -> Containerized
|
|
143
|
+
- openapi.yaml or swagger -> Has API
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Project Type Classification:**
|
|
147
|
+
|
|
148
|
+
| Type | Indicators | Skip Domains |
|
|
149
|
+
|------|------------|--------------|
|
|
150
|
+
| **CLI Tool** | bin/, no src/components/, commander/yargs deps | UX/Accessibility, Frontend, Database (if no DB) |
|
|
151
|
+
| **Backend API** | express/fastify/hono, no .tsx | Frontend, UX/Accessibility (except API errors) |
|
|
152
|
+
| **Frontend SPA** | react/vue/svelte, no server | Database, API Design (if no backend) |
|
|
153
|
+
| **Full-Stack** | Both frontend and backend indicators | None |
|
|
154
|
+
| **Library/SDK** | main/module in package.json, no app code | UX/Accessibility, Database |
|
|
155
|
+
|
|
156
|
+
Record detected type in session.md:
|
|
157
|
+
```markdown
|
|
158
|
+
## Project Type
|
|
159
|
+
[type] - [key indicators found]
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Session Update**: Before starting, update `.dino/session.md`:
|
|
163
|
+
```markdown
|
|
164
|
+
## Phase
|
|
165
|
+
refactor-review (customer audit in progress)
|
|
166
|
+
|
|
167
|
+
## Focus
|
|
168
|
+
[scope from Step 0]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Step 1.1: Full Codebase Audit
|
|
172
|
+
|
|
173
|
+
Launch parallel sub-agents to comprehensively review the entire project.
|
|
174
|
+
|
|
175
|
+
**Sub-Agent Launch Pattern:**
|
|
176
|
+
```
|
|
177
|
+
Task({
|
|
178
|
+
subagent_type: "Explore",
|
|
179
|
+
description: "[Domain] audit",
|
|
180
|
+
prompt: "Perform a VERY THOROUGH exploration of the codebase focusing on [domain].
|
|
181
|
+
Find ALL issues, not just obvious ones. Include file:line references.
|
|
182
|
+
Return findings as structured list with severity (critical/high/medium/low)."
|
|
183
|
+
})
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Domains to Review (launch in parallel where applicable):**
|
|
187
|
+
|
|
188
|
+
| # | Domain | Skip When |
|
|
189
|
+
|---|--------|-----------|
|
|
190
|
+
| 1 | Architecture & Structure | Never |
|
|
191
|
+
| 2 | Security & Vulnerability | Never |
|
|
192
|
+
| 3 | Performance & Scalability | Never |
|
|
193
|
+
| 4 | Code Quality & Maintainability | Never |
|
|
194
|
+
| 5 | API Design & Contract | No API endpoints |
|
|
195
|
+
| 6 | Frontend UX & Accessibility | CLI/backend-only |
|
|
196
|
+
| 7 | Database Design & Data Integrity | No database |
|
|
197
|
+
| 8 | Error Handling & Resilience | Never |
|
|
198
|
+
| 9 | Testing Coverage & Quality | Never |
|
|
199
|
+
| 10 | Documentation & Onboarding | Never |
|
|
200
|
+
|
|
201
|
+
**Cost Warning**: Launching 10 parallel agents is expensive. For budget-constrained reviews, batch into 2-3 sequential rounds.
|
|
202
|
+
|
|
203
|
+
### Step 1.1.1: Validate Sub-Agent Results
|
|
204
|
+
|
|
205
|
+
After all sub-agents complete:
|
|
206
|
+
|
|
207
|
+
1. **Check completion**: Verify each agent returned results (not empty/error)
|
|
208
|
+
2. **Merge findings**: Combine results, deduplicate overlapping issues
|
|
209
|
+
3. **Flag gaps**: If any agent failed, note which domain was not reviewed
|
|
210
|
+
4. **Severity count**: Tally critical/high/medium/low findings
|
|
211
|
+
|
|
212
|
+
```markdown
|
|
213
|
+
## Sub-Agent Results Summary
|
|
214
|
+
- Agents launched: [N]
|
|
215
|
+
- Agents completed: [N]
|
|
216
|
+
- Agents failed: [list or "none"]
|
|
217
|
+
- Total findings: [N] (critical: X, high: Y, medium: Z, low: W)
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
If any critical domain (Security, Architecture) failed, RE-LAUNCH that agent before proceeding.
|
|
221
|
+
|
|
222
|
+
### Step 1.1.2: Handle Phase 1 Failure
|
|
223
|
+
|
|
224
|
+
If Phase 1 cannot complete (multiple agent failures, timeout, or user cancellation):
|
|
225
|
+
|
|
226
|
+
1. **Save partial state** to `.dino/handoff/latest.md`
|
|
227
|
+
2. **Notify user** with AskUserQuestion
|
|
228
|
+
3. **If "Abort and save"**: Write handoff and exit cleanly
|
|
229
|
+
|
|
230
|
+
### Step 1.2: Customer Demands Checklist
|
|
231
|
+
|
|
232
|
+
Review findings against ENTERPRISE-GRADE expectations.
|
|
233
|
+
|
|
234
|
+
**IMPORTANT**: Skip sections marked with project type restrictions based on Step 1.0 detection.
|
|
235
|
+
|
|
236
|
+
#### Security Demands (CRITICAL) [ALL PROJECT TYPES]
|
|
237
|
+
- No hardcoded secrets, API keys, or credentials
|
|
238
|
+
- Input validation on ALL user inputs
|
|
239
|
+
- Authentication & authorization on all sensitive endpoints
|
|
240
|
+
- HTTPS enforced, secure headers configured
|
|
241
|
+
- Rate limiting implemented
|
|
242
|
+
- Audit logging for sensitive operations
|
|
243
|
+
- Dependency vulnerabilities scanned
|
|
244
|
+
- CORS properly configured
|
|
245
|
+
|
|
246
|
+
#### Performance Demands [ALL PROJECT TYPES]
|
|
247
|
+
- Database queries optimized (no N+1, proper indexing)
|
|
248
|
+
- Pagination on all list endpoints
|
|
249
|
+
- Caching strategy for frequently accessed data
|
|
250
|
+
- Async operations where appropriate
|
|
251
|
+
- Bundle size optimized
|
|
252
|
+
- Connection pooling configured
|
|
253
|
+
|
|
254
|
+
#### Architecture Demands [ALL PROJECT TYPES]
|
|
255
|
+
- Clear separation of concerns
|
|
256
|
+
- Dependency injection used properly
|
|
257
|
+
- Configuration externalized
|
|
258
|
+
- Logging structured and consistent
|
|
259
|
+
- Error handling centralized
|
|
260
|
+
- API versioning strategy
|
|
261
|
+
|
|
262
|
+
### Step 1.3: Generate Customer Feedback Report
|
|
263
|
+
|
|
264
|
+
Write findings to `.dino/plans/refactor-customer-review.md`
|
|
265
|
+
|
|
266
|
+
### Step 1.4: Capture Review Learnings
|
|
267
|
+
|
|
268
|
+
**Auto-Memory Capture**: After writing customer-review.md, capture key findings for future sessions.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## PHASE 2: ENGINEER PLANNING MODE
|
|
273
|
+
|
|
274
|
+
**Persona**: You are now a senior software engineer who has received the customer review. You must create a realistic implementation plan and ask clarifying questions before any implementation begins.
|
|
275
|
+
|
|
276
|
+
### Step 2.1: Prioritize and Categorize
|
|
277
|
+
|
|
278
|
+
Group issues into implementation batches:
|
|
279
|
+
|
|
280
|
+
| Priority | Criteria | Action |
|
|
281
|
+
|----------|----------|--------|
|
|
282
|
+
| P0 - Critical | Security vulnerabilities, data loss risks | Fix before any deployment |
|
|
283
|
+
| P1 - High | Performance blockers, major bugs | Fix before feature work |
|
|
284
|
+
| P2 - Medium | Technical debt, code quality | Address when touching area |
|
|
285
|
+
| P3 - Low | Nice-to-have improvements | Backlog |
|
|
286
|
+
|
|
287
|
+
### Step 2.2: Ask Clarifying Questions
|
|
288
|
+
|
|
289
|
+
**MANDATORY**: Before creating any implementation plan, use `AskUserQuestion` with proper format.
|
|
290
|
+
|
|
291
|
+
### Step 2.3: Create Engineering Plan
|
|
292
|
+
|
|
293
|
+
After clarification, write plan to `.dino/plans/refactor-engineering-plan.md`
|
|
294
|
+
|
|
295
|
+
### Step 2.4: Create Task List
|
|
296
|
+
|
|
297
|
+
Use `TaskCreate` to create atomic, verifiable tasks.
|
|
298
|
+
|
|
299
|
+
### Step 2.5: Request Final Approval
|
|
300
|
+
|
|
301
|
+
Present summary to user with options: Approve -> /dino.hunt, Revise plan, Save for later.
|
|
302
|
+
|
|
303
|
+
### Step 2.6: Capture Planning Decisions
|
|
304
|
+
|
|
305
|
+
**Auto-Memory Capture**: After user approves, capture planning decisions for future sessions.
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## WORKFLOW SUMMARY
|
|
310
|
+
|
|
311
|
+
```
|
|
312
|
+
Step 0: Context Recovery -> Step 0.5: Pre-flight -> Phase 1: Customer Review -> Phase 2: Engineer Planning -> User Decision
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## OUTPUT FILES
|
|
318
|
+
|
|
319
|
+
| File | Purpose |
|
|
320
|
+
|------|---------|
|
|
321
|
+
| `.dino/plans/refactor-customer-review.md` | Customer findings and demands |
|
|
322
|
+
| `.dino/plans/refactor-engineering-plan.md` | Implementation plan |
|
|
323
|
+
| `.dino/session.md` | Phase and progress tracking |
|
|
324
|
+
| `.dino/handoff/latest.md` | Handoff state (if interrupted) |
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## RELATED SKILLS
|
|
329
|
+
|
|
330
|
+
| Skill | When to Use |
|
|
331
|
+
|-------|-------------|
|
|
332
|
+
| `/spec` | Run before refactor if scope unclear (confidence < 80%) |
|
|
333
|
+
| `/ralph-gate` | Use instead of refactor if complexity > 70 |
|
|
334
|
+
| `/hunt` | Execute tasks after refactor plan approved |
|
|
335
|
+
| `/scout` | Research specific patterns before planning |
|
|
336
|
+
| `/handoff` | Resume interrupted refactor from handoff |
|
|
337
|
+
| `/verify` | Verify implementation after /hunt |
|
|
338
|
+
| `/fossil` | Archive completed refactor work |
|
|
339
|
+
|
|
340
|
+
---
|
|
341
|
+
|
|
342
|
+
## CRITICAL RULES (ENFORCED)
|
|
343
|
+
|
|
344
|
+
| Rule | Enforcement Point | Block Condition |
|
|
345
|
+
|------|-------------------|-----------------|
|
|
346
|
+
| 1. NO IMPLEMENTATION until approved | Step 2.5 | Edit/Write tool called before approval |
|
|
347
|
+
| 2. ALWAYS ask clarifying questions | Step 2.2 | No AskUserQuestion called in Phase 2 |
|
|
348
|
+
| 3. ALWAYS provide file:line references | Step 1.3 | Findings without :line pattern |
|
|
349
|
+
| 4. ALWAYS estimate impact and risk | Step 2.3 | Batch missing Risks/Rollback sections |
|
|
350
|
+
| 5. NEVER skip security review | Step 1.1.1 | Security domain not in completed list |
|
|
351
|
+
| 6. PRIORITIZE by business impact | Step 2.1 | P0 issues not listed first |
|
|
352
|
+
| 7. DOCUMENT everything | Step 2.3 | Plan file < 500 characters |
|
|
353
|
+
|
|
354
|
+
---
|
|
355
|
+
|
|
356
|
+
## STARTING THE REVIEW
|
|
357
|
+
|
|
358
|
+
**Execution Order:**
|
|
359
|
+
1. Execute Step 0 (Context Recovery) - DO NOT skip
|
|
360
|
+
2. Execute Step 0.5 (Pre-flight Checks)
|
|
361
|
+
3. Execute Step 1.0 (Project Type Detection)
|
|
362
|
+
4. Execute Steps 1.1+ (Customer Review)
|
|
363
|
+
5. Execute Phase 2 (Engineering)
|
|
364
|
+
|
|
365
|
+
**Trigger**: This skill activates on `/dino.refactor` or "enterprise refactor review"
|
|
366
|
+
|
|
367
|
+
**SKILL COMPLETE** marker: Skill ends when user approves plan (Step 2.5) or saves handoff.
|