@jgamaraalv/ts-dev-kit 2.3.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: generate-task
3
+ description: "Breaks a PRD into ordered, production-ready engineering tasks ready for execution by /execute-task. Use when: (1) converting a PRD document into executable engineering tasks, (2) planning feature delivery as a sequence of mergeable, self-contained pull requests, (3) the user says 'generate tasks', 'break down this PRD', 'create tasks from PRD', 'plan the implementation tasks', or 'task breakdown'. Each generated task document embeds its own success criteria, baseline checks, post-change tests, performance benchmarks, and non-functional requirements — making it directly executable by /execute-task."
4
+ argument-hint: "[prd-file-path | task-without-context | epic-task | big-task]"
5
+ ---
6
+
7
+ <prd>
8
+ $ARGUMENTS
9
+ </prd>
10
+
11
+ <workflow>
12
+ Follow each phase in order.
13
+
14
+ <phase_1_read_prd>
15
+ Read the PRD document fully. Extract and organize:
16
+ - Functional requirements — numbered, atomic conditions
17
+ - Acceptance criteria — how feature completion is verified
18
+ - Non-functional requirements — performance, security, accessibility, scalability targets
19
+ - Scope — what is included and what is explicitly excluded
20
+ - User journeys — key flows and their steps
21
+ - Success metrics and KPIs
22
+ </phase_1_read_prd>
23
+
24
+ <phase_2_analyze_codebase>
25
+ Before decomposing tasks, understand the target project:
26
+ 1. Read CLAUDE.md and root package.json — project structure, package manager, tech stack, key directories.
27
+ 2. Identify where implementation units live — backend routes, frontend pages, shared types, database schemas, tests.
28
+ 3. Search for patterns similar to the feature being built — use Grep/Glob to find related files and establish co-location conventions.
29
+ 4. List the domain areas the feature touches — database, API, shared, frontend, tests, config.
30
+ </phase_2_analyze_codebase>
31
+
32
+ <phase_3_identify_implementation_units>
33
+ Map every PRD requirement to concrete implementation units. An implementation unit is any atomic change: a new schema, a route, a component, a migration, a shared type, a test file, a config entry, an i18n key.
34
+
35
+ For each unit, identify:
36
+ - **File path** (exact, following codebase conventions)
37
+ - **Action**: create or modify
38
+ - **Domain**: database | api | shared | frontend | test | config | docs
39
+ - **Dependencies**: which other units must exist first
40
+
41
+ **Standard dependency ordering** (lower layers before higher):
42
+ 1. Shared types, constants, i18n keys, env variables
43
+ 2. Database migrations and schema updates
44
+ 3. API routes, handlers, validation schemas
45
+ 4. Shared hooks, utilities, helper functions
46
+ 5. UI components (atoms → molecules → organisms)
47
+ 6. Pages and routes composing components
48
+ 7. Tests (unit, integration, E2E)
49
+ 8. Config and infrastructure changes
50
+ 9. Documentation updates
51
+
52
+ **Orphan-free rule** — every consumer of a resource must be in the same task as its producer OR in a later task that explicitly depends on the producer's task:
53
+ - New i18n key + every component using that key → same task (or key in TASK_N, component in TASK_M where M > N and TASK_M depends on TASK_N)
54
+ - New database column + migration that adds it → same task
55
+ - New shared type + every immediate consumer → same task
56
+ - New component + the page that renders it → same task (unless page is intentionally deferred to a later task)
57
+ </phase_3_identify_implementation_units>
58
+
59
+ <phase_4_group_into_tasks>
60
+ Group implementation units into tasks. Apply these rules in order:
61
+
62
+ **Rule 1 — 30-file limit**: a task may create or modify at most 30 files. If a natural group exceeds this, split on domain boundaries (data layer, API layer, UI layer, test layer).
63
+
64
+ **Rule 2 — Production-ready delivery**: every task, when merged in order, must leave the application in a runnable state — no broken imports, unresolved references, orphaned i18n keys, or missing migrations.
65
+
66
+ **Rule 3 — Forward dependency only**: if TASK_N requires output from TASK_M, then M < N. No task may depend on a later task.
67
+
68
+ **Rule 4 — Mergeable without breaking**: use feature flags, graceful degradation, or empty-state handling so earlier tasks don't expose incomplete UX to end users.
69
+
70
+ **Rule 5 — Clear value delivery**: each task must deliver a demonstrable increment — a working endpoint, a rendered component, a passing test suite. Avoid tasks with no visible or testable outcome.
71
+
72
+ **Recommended grouping** (adapt per feature):
73
+ 1. **Foundation** — shared types, constants, i18n keys, env variables
74
+ 2. **Data layer** — database schema, migrations, ORM models
75
+ 3. **API layer** — routes, handlers, validation schemas, error codes
76
+ 4. **Core UI** — reusable components, hooks, state management
77
+ 5. **Feature pages** — pages and routes composing the core UI
78
+ 6. **Tests & polish** — comprehensive test suites, accessibility audit, performance tuning
79
+ 7. **Documentation** — CLAUDE.md updates, API docs, migration guides
80
+
81
+ Split tasks at domain boundaries when a group would exceed 30 files.
82
+ </phase_4_group_into_tasks>
83
+
84
+ <phase_5_define_verification_criteria>
85
+ For each task, derive its verification criteria from the PRD. These become binding requirements embedded in the task document and executed by /execute-task.
86
+
87
+ **Success criteria** — select PRD acceptance criteria that apply to this task's scope. Write them as testable assertions:
88
+ - "POST /api/resource returns 201 with the created resource payload" (not "API works")
89
+ - "Page renders the empty state at 1440px without console errors" (not "page looks right")
90
+ - "Migration runs cleanly on an empty database" (not "migration works")
91
+
92
+ **Baseline checks** — what to capture BEFORE making changes:
93
+ - Standard quality gates: tsc, lint, test, build (pass/fail and counts)
94
+ - Domain-specific: API endpoints (HTTP status + timing), pages (screenshot + LCP), schema state (table columns and types)
95
+
96
+ **Post-change checks** — what to verify AFTER changes, mapped 1:1 to each success criterion.
97
+
98
+ **Performance benchmarks** — from PRD NFRs or domain defaults:
99
+ - API endpoints: p95 response time target
100
+ - Frontend pages: LCP target, bundle size delta
101
+ - Database queries: execution time target
102
+
103
+ **Non-functional requirements** — scope PRD NFRs to this task's domain:
104
+ - Database task → data integrity, migration rollback safety, index strategy
105
+ - API task → input validation coverage, auth guard presence, rate limiting
106
+ - Frontend task → WCAG compliance level, responsive breakpoints, keyboard navigation
107
+ </phase_5_define_verification_criteria>
108
+
109
+ <phase_6_generate_task_documents>
110
+ Generate a document for each task using the template from [template.md](template.md).
111
+
112
+ Before saving, validate each document:
113
+ - [ ] File count ≤ 30
114
+ - [ ] No file path appears in more than one task
115
+ - [ ] Every success criterion is testable (specific, measurable outcome)
116
+ - [ ] Every "create" file has its consumer in the same or a later task
117
+ - [ ] Task N's dependencies all have numbers < N
118
+ - [ ] Baseline checks include at minimum: tsc, lint, test, build
119
+
120
+ Fix any violation before saving.
121
+ </phase_6_generate_task_documents>
122
+ </workflow>
123
+
124
+ <output>
125
+ Save each task document to:
126
+ ```
127
+ [project-root]/docs/features/[FEATURE_NAME]/TASK_[TASK_NUMBER].md
128
+ ```
129
+
130
+ After saving all tasks, print a summary table:
131
+
132
+ | Task | Title | Files | Depends on | Key deliverable |
133
+ |------|-------|-------|------------|-----------------|
134
+ | TASK_01 | ... | N files | none | ... |
135
+ | TASK_02 | ... | N files | TASK_01 | ... |
136
+ </output>
@@ -0,0 +1,71 @@
1
+ # TASK_[N]: [Title]
2
+
3
+ ## Overview
4
+ [2-3 sentences describing what this task delivers and why it is a cohesive unit
5
+ of work. State the concrete value delivered when this task is merged.]
6
+
7
+ ## Dependencies
8
+ - Requires merged: [list of TASK_X titles, or "none"]
9
+
10
+ ## Scope — Files (max 30)
11
+
12
+ | File | Action | Purpose |
13
+ |------|--------|---------|
14
+ | `path/to/file.ts` | create | What this file contains |
15
+ | `path/to/other.ts` | modify | What changes and why |
16
+
17
+ **Total: N files**
18
+
19
+ ## Success Criteria
20
+
21
+ - [ ] 1. [Testable, specific condition — maps to a PRD acceptance criterion]
22
+ - [ ] 2. [...]
23
+
24
+ ## Non-functional Requirements
25
+
26
+ - **Performance**: [specific targets, e.g., "p95 API response < 200ms", "LCP < 2.5s"]
27
+ - **Security**: [e.g., "all inputs validated with zod schema", "auth guard on all routes"]
28
+ - **Accessibility**: [for frontend tasks: WCAG level and specific requirements]
29
+ - **Scalability**: [relevant requirements, or "n/a for this task"]
30
+
31
+ ## Verification Plan
32
+
33
+ ### Baseline Checks (run before making changes)
34
+
35
+ **Quality gates:**
36
+ - `tsc` — record pass/fail
37
+ - `lint` — record pass/fail
38
+ - `test` — record pass/fail + test count
39
+ - `build` — record pass/fail + bundle size (if frontend)
40
+
41
+ **Domain-specific baseline:**
42
+ - [Example — API: `GET /api/resource` — record HTTP status and response time]
43
+ - [Example — Frontend: navigate to `/feature-page` — capture screenshot and LCP]
44
+ - [Example — Database: record current schema of table `users` (columns + types)]
45
+
46
+ ### Post-change Checks
47
+
48
+ **Quality gates:** [same commands as baseline — all must pass]
49
+
50
+ **Feature verification:**
51
+ - [ ] [Check mapped 1:1 to success criterion 1 — describe exact verification steps]
52
+ - [ ] [Check mapped 1:1 to success criterion 2]
53
+
54
+ **Performance benchmarks:**
55
+ - [metric]: target [value], acceptable range [range]
56
+
57
+ ### MCP Checks
58
+
59
+ **If browser MCPs available (playwright / chrome-devtools):**
60
+ - [Specific pages to navigate and screenshot]
61
+ - [Specific user interactions to exercise]
62
+ - [Specific performance traces to capture]
63
+
64
+ **If no browser MCPs available (shell-only fallback):**
65
+ - [What to verify via build output, curl, or CLI commands]
66
+
67
+ ## Implementation Notes
68
+
69
+ [Optional: key constraints, patterns to follow, architectural decisions the
70
+ executing agent should know. Reference specific file paths or conventions
71
+ discovered from the codebase analysis.]
@@ -86,13 +86,4 @@ Use these severity levels when reporting findings:
86
86
 
87
87
  ## Output format
88
88
 
89
- When reporting security findings, use this structure:
90
-
91
- ```
92
- ### [SEVERITY] A0X: Category Name — Brief title
93
-
94
- **Location**: `file:line`
95
- **Risk**: What can go wrong and the impact.
96
- **Finding**: What the code does wrong.
97
- **Fix**: Specific remediation with code example.
98
- ```
89
+ When reporting security findings, use the template in [template.md](template.md) for each finding.
@@ -0,0 +1,6 @@
1
+ ### [SEVERITY] A0X: Category Name — Brief title
2
+
3
+ **Location**: `file:line`
4
+ **Risk**: What can go wrong and the impact.
5
+ **Finding**: What the code does wrong.
6
+ **Fix**: Specific remediation with code example.
@@ -76,23 +76,7 @@ Dispatch hub for UI/UX rules. Load the relevant reference file for full details.
76
76
 
77
77
  Group findings by file. Use `file:line` format (VS Code clickable). Be terse -- state issue and location. Skip explanation unless fix is non-obvious.
78
78
 
79
- ```text
80
- ## src/Button.tsx
81
-
82
- src/Button.tsx:42 - icon button missing aria-label
83
- src/Button.tsx:18 - input lacks label
84
- src/Button.tsx:55 - animation missing prefers-reduced-motion
85
- src/Button.tsx:67 - transition: all -> list properties explicitly
86
-
87
- ## src/Modal.tsx
88
-
89
- src/Modal.tsx:12 - missing overscroll-behavior: contain
90
- src/Modal.tsx:34 - "..." -> "..."
91
-
92
- ## src/Card.tsx
93
-
94
- pass
95
- ```
79
+ See [template.md](template.md) for the expected output format.
96
80
 
97
81
  ---
98
82
 
@@ -0,0 +1,15 @@
1
+ ## src/Button.tsx
2
+
3
+ src/Button.tsx:42 - icon button missing aria-label
4
+ src/Button.tsx:18 - input lacks label
5
+ src/Button.tsx:55 - animation missing prefers-reduced-motion
6
+ src/Button.tsx:67 - transition: all -> list properties explicitly
7
+
8
+ ## src/Modal.tsx
9
+
10
+ src/Modal.tsx:12 - missing overscroll-behavior: contain
11
+ src/Modal.tsx:34 - "Close" -> "Close dialog"
12
+
13
+ ## src/Card.tsx
14
+
15
+ pass