@uluops/setup 0.2.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 +178 -0
- package/assets/agents/api-contract-validator-agent.md +960 -0
- package/assets/agents/aristotle-analyst-agent.md +705 -0
- package/assets/agents/aristotle-explorer-agent.md +152 -0
- package/assets/agents/aristotle-forecaster-agent.md +666 -0
- package/assets/agents/aristotle-validator-agent.md +667 -0
- package/assets/agents/assumption-excavator-agent.md +1354 -0
- package/assets/agents/code-auditor-agent.md +1061 -0
- package/assets/agents/code-optimizer-agent.md +876 -0
- package/assets/agents/code-validator-agent.md +846 -0
- package/assets/agents/docs-validator-agent.md +490 -0
- package/assets/agents/frontend-validator-agent.md +844 -0
- package/assets/agents/mcp-validator-agent.md +827 -0
- package/assets/agents/pre-implementation-architect-agent.md +1036 -0
- package/assets/agents/prompt-engineer-agent.md +1158 -0
- package/assets/agents/prompt-pattern-analyzer-agent.md +907 -0
- package/assets/agents/prompt-quality-validator-agent.md +1018 -0
- package/assets/agents/public-interface-validator-agent.md +951 -0
- package/assets/agents/release-readiness-agent.md +482 -0
- package/assets/agents/security-analyst-agent.md +1093 -0
- package/assets/agents/test-architect-agent.md +861 -0
- package/assets/agents/type-safety-validator-agent.md +932 -0
- package/assets/agents/workflow-synthesis-agent.md +836 -0
- package/assets/commands/agents/api-contract.md +135 -0
- package/assets/commands/agents/architect.md +135 -0
- package/assets/commands/agents/aristotle-analyst.md +115 -0
- package/assets/commands/agents/aristotle-explorer.md +92 -0
- package/assets/commands/agents/aristotle-forecaster.md +114 -0
- package/assets/commands/agents/aristotle-validator.md +114 -0
- package/assets/commands/agents/assumption-excavator.md +114 -0
- package/assets/commands/agents/audit.md +136 -0
- package/assets/commands/agents/docs-validate.md +133 -0
- package/assets/commands/agents/frontend.md +135 -0
- package/assets/commands/agents/mcp-validate.md +136 -0
- package/assets/commands/agents/optimize.md +133 -0
- package/assets/commands/agents/pattern-analyzer.md +126 -0
- package/assets/commands/agents/prompt-quality.md +134 -0
- package/assets/commands/agents/prompt-validate.md +135 -0
- package/assets/commands/agents/public-interface.md +134 -0
- package/assets/commands/agents/release.md +135 -0
- package/assets/commands/agents/security.md +137 -0
- package/assets/commands/agents/test-review.md +136 -0
- package/assets/commands/agents/type-safety.md +135 -0
- package/assets/commands/agents/validate.md +134 -0
- package/assets/commands/agents/workflow-synthesis.md +101 -0
- package/assets/commands/workflows/aristotle.md +543 -0
- package/assets/commands/workflows/post-implementation.md +577 -0
- package/assets/commands/workflows/pre-implementation.md +670 -0
- package/assets/commands/workflows/prompt-audit.md +754 -0
- package/assets/commands/workflows/ship.md +721 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +436 -0
- package/dist/lib/config-merger.d.ts +26 -0
- package/dist/lib/config-merger.js +63 -0
- package/dist/lib/file-ops.d.ts +23 -0
- package/dist/lib/file-ops.js +86 -0
- package/dist/lib/hash.d.ts +1 -0
- package/dist/lib/hash.js +4 -0
- package/dist/lib/manifest.d.ts +16 -0
- package/dist/lib/manifest.js +34 -0
- package/dist/lib/paths.d.ts +14 -0
- package/dist/lib/paths.js +49 -0
- package/dist/lib/settings-merger.d.ts +43 -0
- package/dist/lib/settings-merger.js +91 -0
- package/dist/steps/agents.d.ts +8 -0
- package/dist/steps/agents.js +14 -0
- package/dist/steps/auth.d.ts +12 -0
- package/dist/steps/auth.js +80 -0
- package/dist/steps/commands.d.ts +9 -0
- package/dist/steps/commands.js +69 -0
- package/dist/steps/detect.d.ts +9 -0
- package/dist/steps/detect.js +30 -0
- package/dist/steps/mcp.d.ts +6 -0
- package/dist/steps/mcp.js +40 -0
- package/dist/steps/metrics.d.ts +22 -0
- package/dist/steps/metrics.js +176 -0
- package/dist/steps/shell.d.ts +2 -0
- package/dist/steps/shell.js +48 -0
- package/dist/steps/signup.d.ts +13 -0
- package/dist/steps/signup.js +92 -0
- package/dist/steps/verify.d.ts +10 -0
- package/dist/steps/verify.js +184 -0
- package/dist/test/auth.test.d.ts +1 -0
- package/dist/test/auth.test.js +43 -0
- package/dist/test/config-io.test.d.ts +1 -0
- package/dist/test/config-io.test.js +56 -0
- package/dist/test/config-merger.test.d.ts +1 -0
- package/dist/test/config-merger.test.js +94 -0
- package/dist/test/detect.test.d.ts +1 -0
- package/dist/test/detect.test.js +25 -0
- package/dist/test/file-ops.test.d.ts +1 -0
- package/dist/test/file-ops.test.js +100 -0
- package/dist/test/hash.test.d.ts +1 -0
- package/dist/test/hash.test.js +14 -0
- package/dist/test/manifest.test.d.ts +1 -0
- package/dist/test/manifest.test.js +78 -0
- package/dist/test/paths.test.d.ts +1 -0
- package/dist/test/paths.test.js +30 -0
- package/dist/test/settings-merger.test.d.ts +1 -0
- package/dist/test/settings-merger.test.js +167 -0
- package/dist/test/shell-profile.test.d.ts +1 -0
- package/dist/test/shell-profile.test.js +40 -0
- package/dist/test/shell.test.d.ts +1 -0
- package/dist/test/shell.test.js +71 -0
- package/dist/test/signup.test.d.ts +1 -0
- package/dist/test/signup.test.js +83 -0
- package/package.json +36 -0
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: post-implementation
|
|
3
|
+
description: Iterative validation workflow. Run after each implementation phase until all agents pass. Includes code optimization. Use --frontend flag for React/Tailwind projects.
|
|
4
|
+
tools: Read, Grep, Glob, Bash
|
|
5
|
+
model: sonnet
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Post-Implementation
|
|
9
|
+
|
|
10
|
+
Iterative validation workflow. Run after each implementation phase until all agents pass. Includes code optimization. Use --frontend flag for React/Tailwind projects.
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
**Philosophy**: Validate early, validate often. Each implementation phase should pass all gates before proceeding. Catch issues when they're cheap to fix.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Workflow Overview
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
┌─────────────┐
|
|
21
|
+
│ validate │ ◄── Gate (must pass)
|
|
22
|
+
└──────┬──────┘
|
|
23
|
+
│
|
|
24
|
+
┌──────┴──────┬──────────────┬──────────────┐
|
|
25
|
+
▼ ▼ ▼ │
|
|
26
|
+
┌───────────┐ ┌────────────┐ ┌────────────┐ │
|
|
27
|
+
│type-safety│ │mcp-validate│ │test-review │ │
|
|
28
|
+
│(if TS) │ │(if MCP) │ │ │ │
|
|
29
|
+
└─────┬─────┘ └─────┬──────┘ └─────┬──────┘ │
|
|
30
|
+
└─────────────┴──────────────┘ │
|
|
31
|
+
│ │
|
|
32
|
+
┌──────▼──────┐ │
|
|
33
|
+
│ optimizer │ │
|
|
34
|
+
└──────┬──────┘ │
|
|
35
|
+
│ │
|
|
36
|
+
┌────────────┴────────────┐ │
|
|
37
|
+
▼ ▼ │
|
|
38
|
+
┌────────────────┐ ┌──────────────┐ │
|
|
39
|
+
│public-interface│ │ frontend │ │
|
|
40
|
+
│ │ │ (if enabled) │ │
|
|
41
|
+
└────────────────┘ └──────────────┘ │
|
|
42
|
+
│
|
|
43
|
+
══════════════════════════════════════════ │
|
|
44
|
+
PERSIST TO TRACKER (Required) │
|
|
45
|
+
══════════════════════════════════════════ ▼
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
[TS] = Runs if tsconfig.json detected (TypeScript project)
|
|
50
|
+
[MCP] = Runs if MCP server detected (mcp imports, FastMCP, @modelcontextprotocol/sdk)
|
|
51
|
+
|
|
52
|
+
Duration: 6-15 minutes (varies with optional validators)
|
|
53
|
+
**Note:** Conditional validators only run in their groups if detected in pre-flight.
|
|
54
|
+
**Important:** Even in parallel mode, if ANY agent in a group fails with a blocking result, stop the pipeline and report all results collected so far.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Agent Handoff Formats
|
|
59
|
+
|
|
60
|
+
Each agent passes structured data to the next in the pipeline:
|
|
61
|
+
|
|
62
|
+
| From | To | Passes | Expects |
|
|
63
|
+
|------|-----|--------|---------|
|
|
64
|
+
| Code Validator | TypeScript Validator | File list, error baseline, complexity metrics | Type-specific issues beyond basic linting |
|
|
65
|
+
| Code Validator | Test Architect | Test file locations, coverage baseline | Test quality assessment beyond coverage % |
|
|
66
|
+
| TypeScript Validator | MCP Validator | Type-checked file list, public API map | Protocol compliance on type-safe codebase |
|
|
67
|
+
| MCP Validator | Test Architect | Tools/resources list, security flags | Tests for MCP-specific functionality |
|
|
68
|
+
| Test Architect | Optimizer | Test confidence level, coverage gaps | Optimizations that won't break tested behavior |
|
|
69
|
+
| Optimizer | Public Interface | Refactoring summary, API changes | README updates for any interface changes |
|
|
70
|
+
| Public Interface | Frontend Validator | Export list, documentation status | Component quality for documented features |
|
|
71
|
+
|
|
72
|
+
**Handoff Contract:**
|
|
73
|
+
- Each agent accepts predecessor's score and blockers
|
|
74
|
+
- Agents don't re-check validated areas
|
|
75
|
+
- Critical failures propagate as pipeline blockers
|
|
76
|
+
- All findings feed into tracker persistence
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Pre-Flight: Target Detection and Configuration
|
|
81
|
+
|
|
82
|
+
Before running agents, determine the target path and which optional validators should run.
|
|
83
|
+
|
|
84
|
+
### Context Detection
|
|
85
|
+
|
|
86
|
+
**Detection criteria**: A detector returns TRUE if its command exits with code 0.
|
|
87
|
+
|
|
88
|
+
| Detector ID | Description |
|
|
89
|
+
|-------------|-------------|
|
|
90
|
+
| `typescript_detected` | Check if file exists: {{ target }}/tsconfig.json |
|
|
91
|
+
| `mcp_python_detected` | Run command: grep -rqE --include="*.py" --exclude-dir="node_modules" --exclude-dir="dist" --exclude-dir="__pycache__" --exclude-dir=".venv" "from mcp|import mcp|FastMCP|@mcp\." . 2>/dev/null |
|
|
92
|
+
| `mcp_typescript_detected` | Run command: grep -rqE --include="*.ts" --include="*.js" --exclude-dir="node_modules" --exclude-dir="dist" "@modelcontextprotocol/sdk|McpServer" . 2>/dev/null |
|
|
93
|
+
| `mcp_dependency_detected` | Run command: grep -rqE --include="package.json" --include="pyproject.toml" --include="requirements.txt" --exclude-dir="node_modules" --exclude-dir="dist" "@modelcontextprotocol|\"mcp\":" . 2>/dev/null |
|
|
94
|
+
| `frontend_detected` | Run command: test -n "$(find . \( -name "*.tsx" -o -name "*.jsx" \) ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/build/*" ! -path "*/.next/*" ! -path "*/coverage/*" -print -quit 2>/dev/null)" |
|
|
95
|
+
|
|
96
|
+
**typescript_detected**:
|
|
97
|
+
```bash
|
|
98
|
+
test -f "{{ target }}/tsconfig.json" && echo "DETECTED" || echo "NOT DETECTED"
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**mcp_python_detected**:
|
|
102
|
+
```bash
|
|
103
|
+
grep -rqE --include="*.py" --exclude-dir="node_modules" --exclude-dir="dist" --exclude-dir="__pycache__" --exclude-dir=".venv" "from mcp|import mcp|FastMCP|@mcp\." . 2>/dev/null && echo "DETECTED" || echo "NOT DETECTED"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
**mcp_typescript_detected**:
|
|
107
|
+
```bash
|
|
108
|
+
grep -rqE --include="*.ts" --include="*.js" --exclude-dir="node_modules" --exclude-dir="dist" "@modelcontextprotocol/sdk|McpServer" . 2>/dev/null && echo "DETECTED" || echo "NOT DETECTED"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**mcp_dependency_detected**:
|
|
112
|
+
```bash
|
|
113
|
+
grep -rqE --include="package.json" --include="pyproject.toml" --include="requirements.txt" --exclude-dir="node_modules" --exclude-dir="dist" "@modelcontextprotocol|\"mcp\":" . 2>/dev/null && echo "DETECTED" || echo "NOT DETECTED"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**frontend_detected**:
|
|
117
|
+
```bash
|
|
118
|
+
test -n "$(find . \( -name "*.tsx" -o -name "*.jsx" \) ! -path "*/node_modules/*" ! -path "*/dist/*" ! -path "*/build/*" ! -path "*/.next/*" ! -path "*/coverage/*" -print -quit 2>/dev/null)" && echo "DETECTED" || echo "NOT DETECTED"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Arguments
|
|
125
|
+
|
|
126
|
+
### Positional Arguments
|
|
127
|
+
|
|
128
|
+
| Argument | Required | Description |
|
|
129
|
+
|----------|----------|-------------|
|
|
130
|
+
| target | No | Target directory to validate |
|
|
131
|
+
|
|
132
|
+
### Flags
|
|
133
|
+
|
|
134
|
+
| Flag | Short | Description |
|
|
135
|
+
|------|-------|-------------|
|
|
136
|
+
| --frontend | f | Force frontend validation regardless of auto-detection |
|
|
137
|
+
|
|
138
|
+
### Usage Examples
|
|
139
|
+
|
|
140
|
+
| Command | Behavior |
|
|
141
|
+
|---------|----------|
|
|
142
|
+
| `/workflows:post-implementation ./packages/api` | Auto-detects TS, MCP, and frontend |
|
|
143
|
+
| `/workflows:post-implementation ./packages/app --frontend` | Forces frontend validation |
|
|
144
|
+
| `/workflows:post-implementation ./mcp-server` | Auto-detects MCP server, runs MCP Validator |
|
|
145
|
+
| `/workflows:post-implementation ./src` | Skips optional validators if not detected |
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
## Execution Mode Selection
|
|
150
|
+
|
|
151
|
+
**After completing project detection, ask the user to choose execution mode using AskUserQuestion:**
|
|
152
|
+
|
|
153
|
+
| Mode | Description | Best For |
|
|
154
|
+
|------|-------------|----------|
|
|
155
|
+
| Sequential | Run agents one at a time, stop on first failure | Debugging, first runs, when you want early feedback |
|
|
156
|
+
| Parallel | Run independent agents concurrently | Speed, CI/CD, when project is stable |
|
|
157
|
+
|
|
158
|
+
**Parallel execution groups (when parallel mode selected):**
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
Group 1 (gate): validate
|
|
162
|
+
│
|
|
163
|
+
▼
|
|
164
|
+
Group 2 (parallel): type-safety + mcp-validator + test-architect
|
|
165
|
+
│
|
|
166
|
+
▼
|
|
167
|
+
Group 3 (sequential): optimizer
|
|
168
|
+
│
|
|
169
|
+
▼
|
|
170
|
+
Group 4 (parallel): public-interface + frontend
|
|
171
|
+
│
|
|
172
|
+
▼
|
|
173
|
+
Group 5 (always): persist-to-tracker
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Note:** Conditional validators only run in their groups if detected in pre-flight.
|
|
177
|
+
|
|
178
|
+
**Note:** Conditional validators only run in their groups if detected in pre-flight.
|
|
179
|
+
**Important:** Even in parallel mode, if ANY agent in a group fails with a blocking result, stop the pipeline and report all results collected so far.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
## Execution
|
|
184
|
+
|
|
185
|
+
Run each agent in sequence (or parallel groups if selected). Stop and fix if any agent fails. **Collect all recommendations for tracker persistence.**
|
|
186
|
+
|
|
187
|
+
### Phase 1: Code Validation
|
|
188
|
+
**Commands**: validate@1.0.0
|
|
189
|
+
|
|
190
|
+
**Invoke via Task tool:**
|
|
191
|
+
```
|
|
192
|
+
Task(
|
|
193
|
+
subagent_type: "validate",
|
|
194
|
+
prompt: "[validator:validate] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
195
|
+
description: "Code Validator"
|
|
196
|
+
)
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Gate**: threshold >= 70, on fail: stop
|
|
200
|
+
|
|
201
|
+
**Focus**:
|
|
202
|
+
- Correctness and type safety
|
|
203
|
+
- Complexity and best practices
|
|
204
|
+
- Error handling patterns
|
|
205
|
+
|
|
206
|
+
**Capture for tracker**: All findings for tracker, regardless of pass/fail status.
|
|
207
|
+
|
|
208
|
+
**If failing**: Fix code quality issues before proceeding. Do not optimize broken code.
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### Phase 2: TypeScript Validation (Conditional)
|
|
213
|
+
**Runs when**: `context.typescript_detected`
|
|
214
|
+
|
|
215
|
+
**Commands**: type-safety@1.0.0
|
|
216
|
+
|
|
217
|
+
**Invoke via Task tool:**
|
|
218
|
+
```
|
|
219
|
+
Task(
|
|
220
|
+
subagent_type: "type-safety",
|
|
221
|
+
prompt: "[validator:type-safety] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
222
|
+
description: "Type Safety Validator"
|
|
223
|
+
)
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
**Gate**: threshold >= 75, on fail: stop
|
|
227
|
+
|
|
228
|
+
**Focus**:
|
|
229
|
+
- Explicit any usage and type holes
|
|
230
|
+
- Type assertions without runtime guards
|
|
231
|
+
- Strict mode compliance
|
|
232
|
+
- Public API type quality
|
|
233
|
+
|
|
234
|
+
**Capture for tracker**: All type safety issues for tracker, especially those affecting public API.
|
|
235
|
+
|
|
236
|
+
**If failing**: Fix type holes before proceeding. Type safety issues compound—one any infects all downstream code.
|
|
237
|
+
|
|
238
|
+
**Skip conditions**:
|
|
239
|
+
- No tsconfig.json found
|
|
240
|
+
- Pure JavaScript project
|
|
241
|
+
|
|
242
|
+
**Decision criteria**:
|
|
243
|
+
- SAFE (🔒): Score ≥80 AND no any in public API AND no critical assertions
|
|
244
|
+
- REVIEW (🔍): Score 75-79 OR minor any usage with justification
|
|
245
|
+
- UNSAFE (⚠️): Score <75 OR any in public API OR critical type holes
|
|
246
|
+
|
|
247
|
+
**Auto-fail conditions**:
|
|
248
|
+
- any in exported function signatures
|
|
249
|
+
- Double assertions (as unknown as SomeType pattern)
|
|
250
|
+
- strict: false in tsconfig for library code
|
|
251
|
+
|
|
252
|
+
**Depends on**: validate
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
### Phase 3: MCP Protocol Validation (Conditional)
|
|
257
|
+
**Runs when**: `context.mcp_detected`
|
|
258
|
+
|
|
259
|
+
**Commands**: mcp-validate@1.0.0
|
|
260
|
+
|
|
261
|
+
**Invoke via Task tool:**
|
|
262
|
+
```
|
|
263
|
+
Task(
|
|
264
|
+
subagent_type: "mcp-validate",
|
|
265
|
+
prompt: "[validator:mcp-validate] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
266
|
+
description: "MCP Validator"
|
|
267
|
+
)
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**Gate**: threshold >= 80, warn if < 65, on fail: stop
|
|
271
|
+
|
|
272
|
+
**Why this threshold?** MCP protocol violations cause silent failures in AI integrations. Unlike code bugs that throw visible errors, broken MCP servers manifest as 'the AI doesn't respond' from end users.
|
|
273
|
+
|
|
274
|
+
**Focus**:
|
|
275
|
+
- Tools implementation (inputSchema, descriptions, error handling)
|
|
276
|
+
- Resources implementation (valid URIs, MIME types, descriptions)
|
|
277
|
+
- Prompts implementation (arguments documented, proper message structure)
|
|
278
|
+
- Transport and protocol compliance
|
|
279
|
+
- Security best practices (input validation, no command injection)
|
|
280
|
+
|
|
281
|
+
**Capture for tracker**: All MCP compliance issues for tracker, especially auto-fail conditions.
|
|
282
|
+
|
|
283
|
+
**If failing**: Fix protocol compliance issues before proceeding. Broken MCP servers cause silent failures in AI integrations.
|
|
284
|
+
|
|
285
|
+
**Skip conditions**:
|
|
286
|
+
- No MCP imports or SDK usage detected
|
|
287
|
+
- No mcp-related dependencies in package files
|
|
288
|
+
- Pure client-side application
|
|
289
|
+
|
|
290
|
+
**Decision criteria**:
|
|
291
|
+
- COMPLIANT (✅): Score ≥80 AND no auto-fail conditions → Pipeline CONTINUES
|
|
292
|
+
- CONDITIONAL (⚠️): Score 65-79 → Pipeline CONTINUES with warnings
|
|
293
|
+
- NON-COMPLIANT (❌): Score <65 OR auto-fail triggered → Pipeline FAILS
|
|
294
|
+
|
|
295
|
+
**Auto-fail conditions**:
|
|
296
|
+
- Missing JSON-RPC message handling
|
|
297
|
+
- No capability declaration in server initialization
|
|
298
|
+
- Tools without inputSchema definitions
|
|
299
|
+
- Hardcoded secrets in tool implementations
|
|
300
|
+
- No error handling for tool execution failures
|
|
301
|
+
- Direct eval() or exec() of user-provided input
|
|
302
|
+
|
|
303
|
+
**Depends on**: validate
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
### Phase 4: Test Architecture Review
|
|
308
|
+
**Commands**: test-review@1.0.0
|
|
309
|
+
|
|
310
|
+
**Invoke via Task tool:**
|
|
311
|
+
```
|
|
312
|
+
Task(
|
|
313
|
+
subagent_type: "test-review",
|
|
314
|
+
prompt: "[validator:test-review] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
315
|
+
description: "Test Architect"
|
|
316
|
+
)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
**Gate**: threshold >= 70, on fail: warn
|
|
320
|
+
|
|
321
|
+
**Focus**:
|
|
322
|
+
- Test quality, not just coverage
|
|
323
|
+
- False confidence patterns (mocks at wrong level)
|
|
324
|
+
- Critical path coverage
|
|
325
|
+
- Mutation testing readiness
|
|
326
|
+
|
|
327
|
+
**Capture for tracker**: All recommendations for tracker.
|
|
328
|
+
|
|
329
|
+
**If failing**: Improve tests before optimizing. Tests validate that optimizations do not break behavior.
|
|
330
|
+
|
|
331
|
+
**Depends on**: validate
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
### Phase 5: Code Optimization Analysis
|
|
336
|
+
**Commands**: optimize@1.0.0
|
|
337
|
+
|
|
338
|
+
**Invoke via Task tool:**
|
|
339
|
+
```
|
|
340
|
+
Task(
|
|
341
|
+
subagent_type: "optimize",
|
|
342
|
+
prompt: "[validator:optimize] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
343
|
+
description: "Code Optimizer"
|
|
344
|
+
)
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**Gate**: threshold >= 75, on fail: warn
|
|
348
|
+
|
|
349
|
+
**Focus**:
|
|
350
|
+
- Duplication and structure
|
|
351
|
+
- Hot path performance
|
|
352
|
+
- Maintainability
|
|
353
|
+
|
|
354
|
+
**Capture for tracker**: All optimization opportunities for tracker, including deferred items.
|
|
355
|
+
|
|
356
|
+
**If failing**: Address high-impact findings. This agent reports only—apply fixes manually.
|
|
357
|
+
|
|
358
|
+
**Depends on**: test-architect
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
### Phase 6: Public Interface Validation
|
|
363
|
+
**Commands**: public-interface@1.0.0
|
|
364
|
+
|
|
365
|
+
**Invoke via Task tool:**
|
|
366
|
+
```
|
|
367
|
+
Task(
|
|
368
|
+
subagent_type: "public-interface",
|
|
369
|
+
prompt: "[validator:public-interface] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
370
|
+
description: "Public Interface Validator"
|
|
371
|
+
)
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
**Gate**: threshold >= 75, on fail: warn
|
|
375
|
+
|
|
376
|
+
**Focus**:
|
|
377
|
+
- Feature completeness in README
|
|
378
|
+
- Documentation accuracy
|
|
379
|
+
- Code hygiene (unused imports, dead code)
|
|
380
|
+
- Export quality
|
|
381
|
+
|
|
382
|
+
**Capture for tracker**: All documentation gaps and hygiene issues for tracker.
|
|
383
|
+
|
|
384
|
+
**If failing**: Update README, remove dead code, add JSDoc. Consumer-facing polish.
|
|
385
|
+
|
|
386
|
+
**Depends on**: optimizer
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
### Phase 7: Frontend Validation (Conditional)
|
|
391
|
+
**Runs when**: `context.frontend_enabled`
|
|
392
|
+
|
|
393
|
+
**Commands**: frontend-validate@1.0.0
|
|
394
|
+
|
|
395
|
+
**Invoke via Task tool:**
|
|
396
|
+
```
|
|
397
|
+
Task(
|
|
398
|
+
subagent_type: "frontend-validate",
|
|
399
|
+
prompt: "[validator:frontend-validate] Validate {TARGET_DIRECTORY}. Return structured JSON OUTPUT.",
|
|
400
|
+
description: "frontend-validate"
|
|
401
|
+
)
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
**Gate**: threshold >= 75, on fail: warn
|
|
405
|
+
|
|
406
|
+
**Focus**:
|
|
407
|
+
- Component quality (single responsibility, typed props, hooks patterns)
|
|
408
|
+
- Accessibility (semantic HTML, ARIA, keyboard navigation)
|
|
409
|
+
- Theme consistency (no dark: prefixes, conditional className with useTheme())
|
|
410
|
+
- Performance patterns (memoization, keys, lazy loading)
|
|
411
|
+
|
|
412
|
+
**Capture for tracker**: All accessibility issues, theme violations, and component quality findings for tracker.
|
|
413
|
+
|
|
414
|
+
**If failing**: Fix critical accessibility issues first, then theme violations, then component quality.
|
|
415
|
+
|
|
416
|
+
**Skip conditions**:
|
|
417
|
+
- No --frontend flag AND no .tsx/.jsx files detected
|
|
418
|
+
- Backend-only changes
|
|
419
|
+
- Configuration or documentation only changes
|
|
420
|
+
|
|
421
|
+
**Decision criteria**:
|
|
422
|
+
- POLISHED (✅): Score 80+ AND no critical accessibility issues AND theme system used correctly
|
|
423
|
+
- ACCEPTABLE (🟡): Score 70+ AND no critical issues
|
|
424
|
+
- NEEDS WORK (❌): Score below 70 OR critical accessibility OR theme violations
|
|
425
|
+
|
|
426
|
+
**Depends on**: optimizer
|
|
427
|
+
|
|
428
|
+
---
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Summary Report
|
|
434
|
+
|
|
435
|
+
After all phases complete, summarize:
|
|
436
|
+
|
|
437
|
+
```
|
|
438
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
439
|
+
SUMMARY
|
|
440
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
441
|
+
|
|
442
|
+
Target: [path]
|
|
443
|
+
Run: [N]
|
|
444
|
+
|
|
445
|
+
┌─────────────────────┬────────┬────────────┐
|
|
446
|
+
│ Agent │ Score │ Status │
|
|
447
|
+
├─────────────────────┼────────┼────────────┤
|
|
448
|
+
│ ... │ [X]/100│ ✅/❌/⏭️ │
|
|
449
|
+
└─────────────────────┴────────┴────────────┘
|
|
450
|
+
|
|
451
|
+
```
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
### Scoring
|
|
455
|
+
|
|
456
|
+
**Method**: weighted_average
|
|
457
|
+
|
|
458
|
+
| Phase | Weight |
|
|
459
|
+
|-------|--------|
|
|
460
|
+
| validate | 25% |
|
|
461
|
+
| type-safety | 15% |
|
|
462
|
+
| mcp-validator | 10% |
|
|
463
|
+
| test-architect | 15% |
|
|
464
|
+
| optimizer | 10% |
|
|
465
|
+
| public-interface | 15% |
|
|
466
|
+
| frontend | 10% |
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
---
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
---
|
|
476
|
+
|
|
477
|
+
## Iteration Pattern
|
|
478
|
+
|
|
479
|
+
```
|
|
480
|
+
Implementation
|
|
481
|
+
│
|
|
482
|
+
▼
|
|
483
|
+
/workflows:post-implementation
|
|
484
|
+
│
|
|
485
|
+
├── Run all agents
|
|
486
|
+
│
|
|
487
|
+
├── Persist to tracker (ALWAYS)
|
|
488
|
+
│
|
|
489
|
+
├── All pass? ──▶ /workflows:ship ──▶ 🚀
|
|
490
|
+
│
|
|
491
|
+
└── Failures? ──▶ Fix issues (use features list as checklist)
|
|
492
|
+
│
|
|
493
|
+
└──▶ /workflows:post-implementation (repeat)
|
|
494
|
+
│
|
|
495
|
+
└── Updates features list with new run number
|
|
496
|
+
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
**Typical iterations**:
|
|
500
|
+
- Clean implementation: 1-2 runs
|
|
501
|
+
- Complex feature: 2-4 runs
|
|
502
|
+
- Major refactor: 3-5 runs
|
|
503
|
+
|
|
504
|
+
**Report behavior across iterations**:
|
|
505
|
+
- Each run creates a new timestamped file (e.g., api-features-list-2026-01-13T14-30-52.md)
|
|
506
|
+
- Previous runs are preserved for audit trail
|
|
507
|
+
- Resolved items from previous runs will not appear in new runs if agents no longer flag them
|
|
508
|
+
- Consider adding *-features-list-*.md to .gitignore to avoid committing validation artifacts
|
|
509
|
+
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
## Quick Reference
|
|
513
|
+
|
|
514
|
+
| Agent | Threshold | Group |
|
|
515
|
+
|-------|-----------|-------|
|
|
516
|
+
| Code Validation | threshold >= 70, on fail: stop | 1 |
|
|
517
|
+
| TypeScript Validation | threshold >= 75, on fail: stop | 2 |
|
|
518
|
+
| MCP Protocol Validation | threshold >= 80, warn if < 65, on fail: stop | 2 |
|
|
519
|
+
| Test Architecture Review | threshold >= 70, on fail: warn | 2 |
|
|
520
|
+
| Code Optimization Analysis | threshold >= 75, on fail: warn | 3 |
|
|
521
|
+
| Public Interface Validation | threshold >= 75, on fail: warn | 4 |
|
|
522
|
+
| Frontend Validation | threshold >= 75, on fail: warn | 4 |
|
|
523
|
+
|
|
524
|
+
**Conditional Validator Activation**:
|
|
525
|
+
- **TypeScript Validation**: `context.typescript_detected`
|
|
526
|
+
- **MCP Protocol Validation**: `context.mcp_detected`
|
|
527
|
+
- **Frontend Validation**: `context.frontend_enabled`
|
|
528
|
+
|
|
529
|
+
---
|
|
530
|
+
|
|
531
|
+
## Troubleshooting
|
|
532
|
+
|
|
533
|
+
### Optimizer keeps finding issues after I fix them
|
|
534
|
+
|
|
535
|
+
The optimizer may surface new issues as you refactor. This is expected—each fix can reveal deeper patterns. Set a practical limit:
|
|
536
|
+
- 3 iterations max for optimizer
|
|
537
|
+
- After that, remaining issues become tech debt (document in features list under Deferred)
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
### Public Interface says feature undocumented but it is intentionally internal
|
|
541
|
+
|
|
542
|
+
If a feature is intentionally undocumented (internal API, experimental), note it in the features list but categorize as Deferred or add a note explaining it is intentional.
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
### Tests pass but Test Architect scores low
|
|
546
|
+
|
|
547
|
+
Test Architect evaluates *quality*, not pass/fail. Passing tests with mocks at the wrong level provide false confidence. Trust the agent—improve the tests. The features list will track what needs improvement.
|
|
548
|
+
|
|
549
|
+
|
|
550
|
+
### TypeScript Validator keeps flagging my any usage
|
|
551
|
+
|
|
552
|
+
The validator is intentionally strict about any because type holes propagate. One any in your code becomes any in consumer code. If any is genuinely necessary:
|
|
553
|
+
1. Add a SAFETY comment explaining why
|
|
554
|
+
2. Isolate it to a boundary layer (e.g., third-party API adapters)
|
|
555
|
+
3. Consider using unknown with type guards instead
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
### MCP Validator runs but my server is not using standard patterns
|
|
559
|
+
|
|
560
|
+
The MCP Validator looks for common patterns from FastMCP (Python) and @modelcontextprotocol/sdk (TypeScript). If you are using a custom MCP implementation:
|
|
561
|
+
- The validator may miss tool/resource/prompt definitions
|
|
562
|
+
- You may need to manually verify protocol compliance
|
|
563
|
+
- Consider adding standard decorators/handlers for auto-detection
|
|
564
|
+
|
|
565
|
+
|
|
566
|
+
### Frontend Validator keeps flagging dark:prefixes
|
|
567
|
+
|
|
568
|
+
This is intentional. The project uses a custom theme system via useTheme() hook. Replace:
|
|
569
|
+
|
|
570
|
+
className="bg-white dark:bg-gray-900"
|
|
571
|
+
|
|
572
|
+
With:
|
|
573
|
+
|
|
574
|
+
const { resolvedTheme } = useTheme();
|
|
575
|
+
className={resolvedTheme === 'light' ? 'bg-white' : 'bg-gray-900'}
|
|
576
|
+
|
|
577
|
+
|