generate-task
npx skills add https://github.com/jgamaraalv/ts-dev-kit --skill generate-task
Agent 安装分布
Skill 文档
<phase_1_read_prd> Read the PRD document fully. Extract and organize:
- Functional requirements â numbered, atomic conditions
- Acceptance criteria â how feature completion is verified
- Non-functional requirements â performance, security, accessibility, scalability targets
- Scope â what is included and what is explicitly excluded
- User journeys â key flows and their steps
- Success metrics and KPIs </phase_1_read_prd>
<phase_2_analyze_codebase> Before decomposing tasks, understand the target project:
- Read CLAUDE.md and root package.json â project structure, package manager, tech stack, key directories.
- Identify where implementation units live â backend routes, frontend pages, shared types, database schemas, tests.
- Search for patterns similar to the feature being built â use Grep/Glob to find related files and establish co-location conventions.
- List the domain areas the feature touches â database, API, shared, frontend, tests, config. </phase_2_analyze_codebase>
<phase_3_identify_implementation_units> 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.
For each unit, identify:
- File path (exact, following codebase conventions)
- Action: create or modify
- Domain: database | api | shared | frontend | test | config | docs
- Dependencies: which other units must exist first
Standard dependency ordering (lower layers before higher):
- Shared types, constants, i18n keys, env variables
- Database migrations and schema updates
- API routes, handlers, validation schemas
- Shared hooks, utilities, helper functions
- UI components (atoms â molecules â organisms)
- Pages and routes composing components
- Tests (unit, integration, E2E)
- Config and infrastructure changes
- Documentation updates
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:
- 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)
- New database column + migration that adds it â same task
- New shared type + every immediate consumer â same task
- New component + the page that renders it â same task (unless page is intentionally deferred to a later task) </phase_3_identify_implementation_units>
<phase_4_group_into_tasks> Group implementation units into tasks. Apply these rules in order:
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).
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.
Rule 3 â Forward dependency only: if TASK_N requires output from TASK_M, then M < N. No task may depend on a later task.
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.
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.
Recommended grouping (adapt per feature):
- Foundation â shared types, constants, i18n keys, env variables
- Data layer â database schema, migrations, ORM models
- API layer â routes, handlers, validation schemas, error codes
- Core UI â reusable components, hooks, state management
- Feature pages â pages and routes composing the core UI
- Tests & polish â comprehensive test suites, accessibility audit, performance tuning
- Documentation â CLAUDE.md updates, API docs, migration guides
Split tasks at domain boundaries when a group would exceed 30 files. </phase_4_group_into_tasks>
<phase_5_define_verification_criteria> For each task, derive its verification criteria from the PRD. These become binding requirements embedded in the task document and executed by /execute-task.
Success criteria â select PRD acceptance criteria that apply to this task’s scope. Write them as testable assertions:
- “POST /api/resource returns 201 with the created resource payload” (not “API works”)
- “Page renders the empty state at 1440px without console errors” (not “page looks right”)
- “Migration runs cleanly on an empty database” (not “migration works”)
Baseline checks â what to capture BEFORE making changes:
- Standard quality gates: tsc, lint, test, build (pass/fail and counts)
- Domain-specific: API endpoints (HTTP status + timing), pages (screenshot + LCP), schema state (table columns and types)
Post-change checks â what to verify AFTER changes, mapped 1:1 to each success criterion.
Performance benchmarks â from PRD NFRs or domain defaults:
- API endpoints: p95 response time target
- Frontend pages: LCP target, bundle size delta
- Database queries: execution time target
Non-functional requirements â scope PRD NFRs to this task’s domain:
- Database task â data integrity, migration rollback safety, index strategy
- API task â input validation coverage, auth guard presence, rate limiting
- Frontend task â WCAG compliance level, responsive breakpoints, keyboard navigation </phase_5_define_verification_criteria>
<phase_6_generate_task_documents> Generate a document for each task using the template from template.md.
Before saving, validate each document:
- File count ⤠30
- No file path appears in more than one task
- Every success criterion is testable (specific, measurable outcome)
- Every “create” file has its consumer in the same or a later task
- Task N’s dependencies all have numbers < N
- Baseline checks include at minimum: tsc, lint, test, build
Fix any violation before saving. </phase_6_generate_task_documents>
After saving all tasks, print a summary table:
| Task | Title | Files | Depends on | Key deliverable |
|---|---|---|---|---|
| TASK_01 | … | N files | none | … |
| TASK_02 | … | N files | TASK_01 | … |