@jgamaraalv/ts-dev-kit 2.0.0 → 2.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
CHANGED
|
@@ -100,6 +100,42 @@ claude --plugin-dir ./ts-dev-kit
|
|
|
100
100
|
|
|
101
101
|
---
|
|
102
102
|
|
|
103
|
+
## Recommended MCP Servers
|
|
104
|
+
|
|
105
|
+
Some agents and skills reference external MCP tools for documentation lookup, browser debugging, E2E testing, and web fetching. These are **optional** — skills degrade gracefully without them — but installing them unlocks the full experience.
|
|
106
|
+
|
|
107
|
+
| MCP Server | Used By | Purpose |
|
|
108
|
+
| ------------- | ---------------------------------------- | ------------------------------------ |
|
|
109
|
+
| context7 | Most skills (doc lookup) | Query up-to-date library docs |
|
|
110
|
+
| playwright | playwright-expert, debugger, test-generator | Browser automation and E2E testing |
|
|
111
|
+
| chrome-devtools | debugger | Frontend debugging, screenshots |
|
|
112
|
+
| firecrawl | task skill | Web fetching and scraping |
|
|
113
|
+
|
|
114
|
+
### Installing as Claude Code plugins
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
claude plugin add context7
|
|
118
|
+
claude plugin add playwright
|
|
119
|
+
claude plugin add firecrawl
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Installing as standalone MCP servers
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# context7 — no API key required
|
|
126
|
+
claude mcp add context7 -- npx -y @upstash/context7-mcp@latest
|
|
127
|
+
|
|
128
|
+
# playwright — no API key required
|
|
129
|
+
claude mcp add playwright -- npx -y @playwright/mcp@latest
|
|
130
|
+
|
|
131
|
+
# firecrawl — requires FIRECRAWL_API_KEY
|
|
132
|
+
claude mcp add firecrawl --env FIRECRAWL_API_KEY=your-key -- npx -y firecrawl-mcp
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
> **chrome-devtools** requires Chrome running with remote debugging enabled (`--remote-debugging-port=9222`). Refer to the [Chrome DevTools MCP docs](https://github.com/anthropics/mcp-chrome-devtools) for setup instructions.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
103
139
|
## Customizing for Your Project
|
|
104
140
|
|
|
105
141
|
This kit ships with a project orchestration template at `docs/rules/orchestration.md.template`. It defines quality gates, workspace commands, and dependency ordering that you can adapt to your own monorepo or project.
|
package/package.json
CHANGED
package/skills/task/SKILL.md
CHANGED
|
@@ -108,8 +108,7 @@ Match skills to the sub-area identified in domain_areas:
|
|
|
108
108
|
**Cross-cutting** → combine skills from each sub-area involved.
|
|
109
109
|
</skill_map>
|
|
110
110
|
|
|
111
|
-
In
|
|
112
|
-
In MULTI-ROLE mode: include explicit Skill() call instructions in each subagent prompt (see references/agent-dispatch.md).
|
|
111
|
+
In ALL execution modes: include explicit Skill() call instructions in each subagent prompt (see references/agent-dispatch.md). The orchestrator does not need to load skills itself — agents load them before writing code.
|
|
113
112
|
</required_skills>
|
|
114
113
|
|
|
115
114
|
<available_mcps>
|
|
@@ -235,24 +234,28 @@ Constraints:
|
|
|
235
234
|
<execution_mode_decision>
|
|
236
235
|
At the end of phase 2, make an explicit execution mode decision and state it to the user:
|
|
237
236
|
|
|
238
|
-
> **EXECUTION MODE: SINGLE-ROLE** — I will
|
|
237
|
+
> **EXECUTION MODE: SINGLE-ROLE** — Single domain. I will dispatch 1-2 focused agents for implementation.
|
|
239
238
|
|
|
240
239
|
OR
|
|
241
240
|
|
|
242
|
-
> **EXECUTION MODE: MULTI-ROLE** — I will
|
|
241
|
+
> **EXECUTION MODE: MULTI-ROLE** — Multiple domains. I will dispatch specialized agents across domains via the Task tool.
|
|
243
242
|
|
|
244
243
|
OR
|
|
245
244
|
|
|
246
245
|
> **EXECUTION MODE: PLAN** — The task is highly complex. I will enter plan mode to design a structured implementation plan before executing.
|
|
247
246
|
|
|
247
|
+
**CRITICAL: In ALL execution modes, the orchestrator (main session) NEVER writes application code directly.** All implementation — components, hooks, pages, routes, services, tests — is delegated to agents via the Task tool. The orchestrator's role is: context gathering, agent dispatch, output review, integration glue (under 15 lines), and quality gates.
|
|
248
|
+
|
|
249
|
+
The difference between SINGLE-ROLE and MULTI-ROLE is decomposition complexity, NOT whether agents are used:
|
|
250
|
+
- **SINGLE-ROLE**: simpler decomposition (1-2 agents, same domain). Use when the task is contained within one package or domain.
|
|
251
|
+
- **MULTI-ROLE**: complex decomposition (3+ agents, multiple domains). Use when the task spans packages or skill sets.
|
|
252
|
+
|
|
248
253
|
Use PLAN mode when:
|
|
249
254
|
- The task has 4+ distinct roles or implementation phases.
|
|
250
255
|
- The scope is large enough that context window management becomes a concern.
|
|
251
256
|
- The task benefits from upfront architectural planning before any code is written.
|
|
252
257
|
|
|
253
|
-
In PLAN mode: use EnterPlanMode to design the full plan. Once the user approves it, exit plan mode and execute phases sequentially as
|
|
254
|
-
|
|
255
|
-
Follow this decision in phase 4. In MULTI-ROLE and PLAN modes, delegate application code to agents — your job is dispatch, review, integration, and quality gates.
|
|
258
|
+
In PLAN mode: use EnterPlanMode to design the full plan. Once the user approves it, exit plan mode and execute phases sequentially as orchestrator, with context cleanup between major phases when needed.
|
|
256
259
|
</execution_mode_decision>
|
|
257
260
|
</phase_2b_multi_role_decomposition>
|
|
258
261
|
|
|
@@ -278,51 +281,74 @@ Follow this decision in phase 4. In MULTI-ROLE and PLAN modes, delegate applicat
|
|
|
278
281
|
4. For questions about project libraries, use Context7 (`mcp__context7__resolve-library-id` → `mcp__context7__query-docs`) to query up-to-date documentation. If anything is ambiguous, ask the user before proceeding.
|
|
279
282
|
5. Check for helpful MCPs — does the task involve browser testing, external docs?
|
|
280
283
|
6. Plan the implementation order — determine which changes must happen first (e.g., types before lib before hooks before components before pages).
|
|
284
|
+
7. Generate the verification plan — build a before/after test plan combining task-defined criteria with automatic checks based on domain and available MCPs. See references/verification-protocol.md for the full protocol.
|
|
285
|
+
- Detect available testing MCPs (playwright, chrome-devtools, or none).
|
|
286
|
+
- Map the task domain to checks: frontend → visual + performance, backend → API responses, database → schema state.
|
|
287
|
+
- Always include standard quality gates (lint, build, test) as baseline.
|
|
288
|
+
- Present the plan:
|
|
289
|
+
> **Verification plan:**
|
|
290
|
+
> - Baseline checks: [list]
|
|
291
|
+
> - MCPs for verification: [list or "none available — shell-only checks"]
|
|
292
|
+
> - Post-change checks: [list]
|
|
281
293
|
</phase_3_task_analysis>
|
|
282
294
|
|
|
283
|
-
<
|
|
284
|
-
|
|
295
|
+
<phase_3b_baseline_capture>
|
|
296
|
+
**MANDATORY.** Run the verification plan before writing any code to establish the baseline for comparison. Do NOT skip this phase.
|
|
297
|
+
|
|
298
|
+
**Step 1: Standard quality gates** — run and record results (pass/fail, counts, bundle sizes).
|
|
299
|
+
|
|
300
|
+
**Step 2: MCP-based checks** — follow this decision tree in order:
|
|
301
|
+
|
|
302
|
+
1. Use ToolSearch to confirm which browser MCPs are available (playwright, chrome-devtools, or neither).
|
|
303
|
+
2. **If browser MCPs are available AND the task touches frontend pages:**
|
|
304
|
+
a. Check if the dev server is running (attempt to navigate to `localhost` or the configured URL).
|
|
305
|
+
b. **If dev server is accessible:** navigate to each affected page, capture screenshots of key states, and measure performance (LCP, load time). Use Chrome DevTools traces or Playwright screenshots as appropriate.
|
|
306
|
+
c. **If dev server is NOT accessible:** ask the user whether to start it or skip visual checks. Do NOT silently skip — the user must confirm.
|
|
307
|
+
3. **If no browser MCPs are available:** note it explicitly and proceed with shell-only checks (build output, bundle sizes).
|
|
308
|
+
4. **Backend tasks:** execute requests to affected endpoints (via curl or available API MCPs) and record response status, payload shape, and timing.
|
|
309
|
+
5. **Database tasks:** record current schema state for affected tables.
|
|
310
|
+
|
|
311
|
+
**Step 3: Store baseline** — all values captured here are compared against post-change results in phase 5b.
|
|
285
312
|
|
|
286
|
-
|
|
287
|
-
**
|
|
313
|
+
When visual/performance checks are skipped, state the reason:
|
|
314
|
+
> **Baseline captured.** MCP-based visual checks skipped — [reason: no browser MCPs available | dev server not running (user confirmed skip) | no frontend pages affected].
|
|
288
315
|
|
|
289
|
-
|
|
290
|
-
|
|
316
|
+
The orchestrator ALWAYS runs baseline capture before dispatching any agents, regardless of execution mode.
|
|
317
|
+
</phase_3b_baseline_capture>
|
|
291
318
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
319
|
+
<phase_4_execution>
|
|
320
|
+
**CRITICAL: The orchestrator (main session) NEVER writes application code.** All implementation is dispatched to agents via the Task tool. The orchestrator may only write trivial glue (under 15 lines total): barrel file exports, small wiring imports, or config one-liners.
|
|
321
|
+
|
|
322
|
+
Before dispatching, check the execution mode decision from phase 2 to determine decomposition complexity.
|
|
296
323
|
|
|
297
|
-
|
|
324
|
+
<agent_dispatch_protocol>
|
|
325
|
+
This protocol applies to ALL execution modes (SINGLE-ROLE, MULTI-ROLE, and PLAN).
|
|
298
326
|
|
|
299
|
-
|
|
300
|
-
|
|
327
|
+
As orchestrator, your responsibilities are: context gathering, agent dispatch, output review, integration glue, and quality gates. You do NOT write application code (components, hooks, pages, routes, services, tests).
|
|
328
|
+
|
|
329
|
+
**Dispatch steps:**
|
|
330
|
+
1. Create TaskCreate entries for each role to track progress.
|
|
301
331
|
2. For each role, dispatch a specialized agent via the Task tool with a self-contained prompt. Set the `model` parameter according to rule_4_model_selection.
|
|
302
332
|
3. Launch independent agents in parallel. Launch dependent agents sequentially.
|
|
303
333
|
4. Each agent runs its own quality gates before reporting completion. Review the agent's output and gate results before dispatching dependents.
|
|
304
334
|
5. After all agents complete, proceed to phase 5 for the final cross-package quality gates.
|
|
305
335
|
|
|
306
|
-
|
|
307
|
-
</multi_role_orchestration>
|
|
336
|
+
For the agent prompt template and dispatch details, see references/agent-dispatch.md.
|
|
308
337
|
|
|
309
|
-
|
|
310
|
-
|
|
338
|
+
**Self-check:** If you find yourself creating application files (routes, components, services, hooks, tests, pages), STOP and delegate to an agent instead.
|
|
339
|
+
</agent_dispatch_protocol>
|
|
311
340
|
|
|
312
341
|
<build_order>
|
|
313
|
-
|
|
314
|
-
1. Shared code first — new constants, types, schemas, or enums needed by multiple packages go in the shared/common package
|
|
342
|
+
Instruct agents to work from micro to macro — build dependencies before dependents:
|
|
343
|
+
1. Shared code first — new constants, types, schemas, or enums needed by multiple packages go in the shared/common package.
|
|
315
344
|
2. Check for reuse — before creating a helper, hook, component, or utility, search the codebase for existing code that can be used or extended.
|
|
316
345
|
3. Implement the core change — build the feature/fix in the target package.
|
|
317
346
|
4. Wire it together — connect the pieces across packages if needed.
|
|
318
347
|
|
|
319
|
-
Decision tree:
|
|
348
|
+
Decision tree (include in agent prompts when relevant):
|
|
320
349
|
- Is this code used by multiple modules? YES → Create in the shared/common package.
|
|
321
350
|
- Is this code used by multiple modules? NO → Is this component multi-file? YES → Create folder with index.tsx + related files. NO → Single file, co-located with usage.
|
|
322
351
|
</build_order>
|
|
323
|
-
|
|
324
|
-
If you created any temporary files or scripts for iteration, remove them at the end.
|
|
325
|
-
</single_role_implementation>
|
|
326
352
|
</phase_4_execution>
|
|
327
353
|
|
|
328
354
|
<phase_5_quality_gates>
|
|
@@ -345,6 +371,20 @@ If a gate fails:
|
|
|
345
371
|
- Repeat until all gates pass cleanly.
|
|
346
372
|
</phase_5_quality_gates>
|
|
347
373
|
|
|
374
|
+
<phase_5b_post_change_verification>
|
|
375
|
+
After all quality gates pass, re-run the verification plan from phase 3b and compare against baseline.
|
|
376
|
+
|
|
377
|
+
1. Re-run every check from phase 3b with identical parameters.
|
|
378
|
+
2. Compare each result against baseline:
|
|
379
|
+
- **Quality gates**: must remain passing. New failures = regression.
|
|
380
|
+
- **Visual checks** (if MCPs available): compare screenshots for unintended changes.
|
|
381
|
+
- **Performance** (if MCPs available): compare metrics. Regressions > 10% must be investigated.
|
|
382
|
+
- **API responses**: compare status codes and payload shapes. Breaking changes = regression.
|
|
383
|
+
3. Build the comparison table (see references/output-templates.md for format).
|
|
384
|
+
|
|
385
|
+
If any regression is found, fix it, re-run phase 5 quality gates, then re-run this phase. Repeat until clean.
|
|
386
|
+
</phase_5b_post_change_verification>
|
|
387
|
+
|
|
348
388
|
<phase_6_documentation>
|
|
349
389
|
After all quality gates pass, review whether the changes require documentation updates:
|
|
350
390
|
|
|
@@ -356,7 +396,9 @@ Only update documentation directly affected by the changes. Do not create new do
|
|
|
356
396
|
</workflow>
|
|
357
397
|
|
|
358
398
|
<output>
|
|
359
|
-
When complete, produce the completion report. See references/output-templates.md for the exact format.
|
|
399
|
+
When complete, produce the completion report including the baseline vs post-change comparison table. See references/output-templates.md for the exact format.
|
|
400
|
+
|
|
401
|
+
If the task document specifies a results file path, also create the comparison report at that path.
|
|
360
402
|
|
|
361
403
|
Do not add explanations, caveats, or follow-up suggestions unless the user explicitly asks. The report is the final output.
|
|
362
404
|
</output>
|
|
@@ -35,13 +35,15 @@ List every file created/modified/deleted across all roles.
|
|
|
35
35
|
- test: pass/fail (count)
|
|
36
36
|
- build: pass/fail (per package)
|
|
37
37
|
|
|
38
|
-
###
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| [
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
### Verification results (baseline vs post-change)
|
|
39
|
+
| Check | Baseline (before) | Result (after) | Delta | Status |
|
|
40
|
+
|-------|-------------------|----------------|-------|--------|
|
|
41
|
+
| lint | [pass/fail] | [pass/fail] | — | [ok/regression] |
|
|
42
|
+
| build | [pass/fail (size)] | [pass/fail (size)] | [delta] | [ok/improved/regression] |
|
|
43
|
+
| tests | [count] | [count] | [delta] | [ok/improved/regression] |
|
|
44
|
+
| [domain-specific check] | [baseline value] | [post-change value] | [delta] | [ok/improved/regression] |
|
|
45
|
+
|
|
46
|
+
Include every check from the verification plan. This section is always present.
|
|
45
47
|
|
|
46
48
|
### Skills loaded
|
|
47
49
|
List every skill called across all roles.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Verification Protocol
|
|
2
|
+
|
|
3
|
+
Every task runs a before/after verification cycle: capture baseline → make changes → verify no regressions and improvements achieved.
|
|
4
|
+
|
|
5
|
+
## MCP detection
|
|
6
|
+
|
|
7
|
+
At the start of verification planning, detect which testing MCPs are available by checking for their tool prefixes:
|
|
8
|
+
|
|
9
|
+
| MCP | Tool prefix | Use for |
|
|
10
|
+
|-----|-------------|---------|
|
|
11
|
+
| Playwright | `mcp__plugin_playwright_playwright__*` | Visual verification, interaction testing, screenshots |
|
|
12
|
+
| Chrome DevTools | `mcp__chrome-devtools__*` | Performance traces, network analysis, console checks |
|
|
13
|
+
| Neither | — | Shell-only checks (curl, CLI commands, build output) |
|
|
14
|
+
|
|
15
|
+
Use ToolSearch to confirm availability before including MCP-based checks in the plan.
|
|
16
|
+
|
|
17
|
+
## Domain-specific test catalog
|
|
18
|
+
|
|
19
|
+
### Frontend tasks
|
|
20
|
+
|
|
21
|
+
**With browser MCPs (playwright or chrome-devtools):**
|
|
22
|
+
1. Navigate to each affected page/route.
|
|
23
|
+
2. Capture screenshots of key states (idle, loading, error, success).
|
|
24
|
+
3. Measure performance:
|
|
25
|
+
- Chrome DevTools: `performance_start_trace` → interact → `performance_stop_trace` → `performance_analyze_insight`.
|
|
26
|
+
- Playwright: `browser_navigate` with timing, `browser_take_screenshot`.
|
|
27
|
+
4. Verify interactive elements: click buttons, fill forms, check navigation flows.
|
|
28
|
+
5. Check browser console for errors or warnings.
|
|
29
|
+
|
|
30
|
+
**Without browser MCPs:**
|
|
31
|
+
1. Run build and record bundle size (`ls -la` on build output).
|
|
32
|
+
2. Run lint and type checking.
|
|
33
|
+
3. Run existing test suite and record pass/fail counts.
|
|
34
|
+
|
|
35
|
+
### Backend tasks
|
|
36
|
+
|
|
37
|
+
**API endpoint testing:**
|
|
38
|
+
1. Identify affected endpoints from the task scope.
|
|
39
|
+
2. Record baseline responses via curl:
|
|
40
|
+
```bash
|
|
41
|
+
curl -s -w "\nHTTP %{http_code} | %{time_total}s" <endpoint>
|
|
42
|
+
```
|
|
43
|
+
3. After changes, re-run identical requests and compare status codes, response shapes, and timing.
|
|
44
|
+
|
|
45
|
+
**With Postman/API MCPs (if available):**
|
|
46
|
+
- Use the MCP to send structured requests and validate response schemas.
|
|
47
|
+
|
|
48
|
+
### Database tasks
|
|
49
|
+
|
|
50
|
+
1. Record current schema state for affected tables (e.g., `\d+ table_name` in psql).
|
|
51
|
+
2. After migration, verify schema matches expectations.
|
|
52
|
+
3. Run sample queries to verify data integrity.
|
|
53
|
+
|
|
54
|
+
### Shared/library tasks
|
|
55
|
+
|
|
56
|
+
1. Run type checking across all dependent packages.
|
|
57
|
+
2. Run tests in all packages that import the changed code.
|
|
58
|
+
3. Verify no new type errors introduced downstream.
|
|
59
|
+
|
|
60
|
+
## Baseline capture protocol
|
|
61
|
+
|
|
62
|
+
1. Run standard quality gates first: lint, build, test — record pass/fail and counts.
|
|
63
|
+
2. Run domain-specific checks from the catalog above.
|
|
64
|
+
3. Store results in a structured format for comparison:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
Baseline:
|
|
68
|
+
- lint: pass
|
|
69
|
+
- build: pass (bundle: 245KB)
|
|
70
|
+
- tests: 42 passed, 0 failed
|
|
71
|
+
- page /receive: screenshot captured, LCP 1.2s
|
|
72
|
+
- GET /api/resource: 200, 45ms
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Post-change verification protocol
|
|
76
|
+
|
|
77
|
+
1. Re-run every baseline check with identical parameters.
|
|
78
|
+
2. Build the comparison table:
|
|
79
|
+
|
|
80
|
+
| Check | Baseline | After | Delta | Status |
|
|
81
|
+
|-------|----------|-------|-------|--------|
|
|
82
|
+
| lint | pass | pass | — | ok |
|
|
83
|
+
| build | pass (245KB) | pass (238KB) | -7KB | improved |
|
|
84
|
+
| tests | 42 pass | 45 pass | +3 | improved |
|
|
85
|
+
| LCP /receive | 1.2s | 0.9s | -0.3s | improved |
|
|
86
|
+
| GET /api/resource | 200, 45ms | 200, 42ms | -3ms | ok |
|
|
87
|
+
|
|
88
|
+
3. Status classification:
|
|
89
|
+
- **ok**: no change or negligible change.
|
|
90
|
+
- **improved**: measurable improvement.
|
|
91
|
+
- **regression**: measurable degradation — must be fixed before task completion.
|
|
92
|
+
|
|
93
|
+
4. If regressions exist, fix and re-verify until clean.
|
|
94
|
+
|
|
95
|
+
## Results file
|
|
96
|
+
|
|
97
|
+
When the task document specifies a results file path, create a markdown file at that path containing:
|
|
98
|
+
1. Summary of changes made.
|
|
99
|
+
2. Full comparison table.
|
|
100
|
+
3. Key improvements highlighted.
|
|
101
|
+
4. Any regressions that were found and how they were resolved.
|