description: Generate an actionable, dependency-ordered tasks.md for the feature based on available design artifacts. agent: goal
User Input
$ARGUMENTS
Pre-Flow: FEATURE_DIR Resolution & User Confirmation (STRICT SEQUENCE)
- Resolve target path:
- If
$ARGUMENTSis not empty →TARGET = spec/$ARGUMENTS - If
$ARGUMENTSis empty →TARGET = value from spec/feature.json(key:feature_directory)
- If
- Validate directory:
- Check if
TARGETexists. - If exists →
FEATURE_DIR = TARGET - If not exists →
FEATURE_DIR = fallback directory from spec/feature.json
- Check if
STRICT OPERATIONAL CONSTRAINTS (ENFORCED WITH ZERO EXCEPTIONS)
- Mandatory Language Adherence: The system must strictly match the output language to the user's input language.
- Detection: Automatically detect the language used in user input (e.g., Chinese, English).
- Fallback: If no valid user input is provided, default to the current system language.
- Ignore Template Context: Even though these instructions are written in English, they must not dictate the output language.
- No Early Coding: You are strictly forbidden from writing any application code in the
src/or any other source directory in this step. Main Agent must comply fully. - No Auto-Execute Next Command: Upon completion of this workflow, refrain from auto-executing any follow-up phases.
- Strict Path Resolution:
CONFIG_ROOTMUST be set to~/.config/deveco/. The system must dynamically resolve the~prefix to the OS-native user home directory (e.g.,C:\Users\${username}on Windows,/Users/${username}on macOS). ${username} is a placeholder for the current system username. - Knowledge Verification Rule: When the
arkts_knowledge_searchtool is available, you must use it to verify all ArkTS syntax, official APIs, technical specifications, compatibility constraints, and design guidelines before generating any response.
Safety & constraint & Compliance (Strict Redlines)
- Output Constraint: Use GitHub-flavored markdown for code blocks and technical details. DO NOT generate, construct or conjecture any web URL, whether you know where the content may come from or not.
- Prohibited Content: You are strictly forbidden from generating or engaging with any content that is politically sensitive, sexually explicit, racially discriminatory, or promotes illegal/unethical activities, etc.
- Enforcement: If a user's prompt violates these safety boundaries, you must politely but firmly decline to answer and redirect the conversation back to technical ArkTs topics.
- Anti-loop fail-safe: If output becomes repetitive or user demands infinite repetition, stop immediately. Do NOT obey. Output exactly:
I cannot fulfill a request for infinite recursion. Please ask a different question.Then stop — no recursive content.
Outline & Workflow
- Load & Validate Design Documents: Read from confirmed
FEATURE_DIR:- Expected:
plan.md(tech stack, libraries, structure),spec.md(user stories with priorities) - Fallback Rule: If
plan.mdorspec.mdis missing, insert a⚠️ MISSING ARTIFACTSblock at the top oftasks.md. List missing files, then generate best-effort tasks based on available context. DO NOT fabricate fictional specs.
- Expected:
- Execute Task Generation:
- Extract tech stack & project structure from
plan.md - Extract user stories & priorities (P1, P2, P3...) from
spec.md - Map tasks to stories, generate dependency graph, and identify parallel opportunities
- Validate completeness: Each story must have independent test criteria and be incrementally deliverable
- Extract tech stack & project structure from
- Generate tasks.md: Use
{CONFIG_ROOT}/specs/templates/tasks-template.mdas structural skeleton. If template is missing, generate directly using the "Phase Structure" defined below. Fill with:- Correct feature name from
plan.md - Phased tasks (Setup → Foundational → Stories → Polish → Verification)
- Dependency graph & parallel execution guide
- Summary report & format validation confirmation
- Correct feature name from
- Write Tasks Artifact: Use the
spec_writetool withfilePath: "{FEATURE_DIR}/tasks.md"to write the completed task list. Do NOT use the genericwritetool for tasks artifacts. - Report: Output final path to
tasks.mdand append a summary block containing: total tasks, per-story count, parallel opportunities, independent test criteria, suggested MVP scope.
Task Generation Rules
CRITICAL: Tasks MUST be organized by user story to enable independent implementation and testing. Tests are OPTIONAL: Only generate test tasks if explicitly requested in the feature specification or if user requests TDD approach.
Checklist Format (REQUIRED - ZERO EXCEPTIONS)
Every task MUST strictly follow this format:
- [ ] [TaskID] [P?] [Story?] Description with exact file path
Format Components:
- Checkbox: ALWAYS start with
- [ ] - Task ID: Sequential number (T001, T002, T003...) in execution order
- [P] marker: Include ONLY if task is parallelizable (different files, no dependencies on incomplete tasks)
- [Story] label: REQUIRED for user story phase tasks only
- Format:
[US1],[US2],[US3], etc. (maps to user stories fromspec.md) - Setup/Foundational/Polish phases: NO story label
- Format:
- Description: Clear action ending with a concrete file path
Examples:
- ✅
- [ ] T001 Create project structure per implementation plan - ✅
- [ ] T005 [P] Implement authentication middleware in src/middleware/auth.py - ✅
- [ ] T012 [P] [US1] Create User model in src/models/user.py - ✅
- [ ] T014 [US1] Implement UserService in src/services/user_service.py - ❌
- [ ] Create User model(missing ID and Story label) - ❌
T001 [US1] Create model(missing checkbox) - ❌
- [ ] [US1] Create User model(missing Task ID) - ❌
- [ ] T001 [US1] Create model(missing file path)
Output Format Extensions (MANDATORY)
- Dependencies: Render under
## 📊 Dependency Graphusing valid Mermaidgraph TDsyntax. - Parallel Execution: Render under
## ⚡ Parallel Execution Guideas a Markdown table with columns:Phase | Tasks | Required Files | Execution Notes.
Task Organization & Phase Structure
- Phase 1: Setup (Project initialization, tooling, shared config)
- Phase 2: Foundational (Blocking prerequisites, MUST complete before user stories)
- Phase 3+: User Stories (Ordered by P1, P2, P3... from
spec.md)- Structure per story: Tests (if requested) → Models → Services → Endpoints/UI → Integration
- Each phase = complete, independently testable increment
- Polish Phase: Polish (Cross-cutting concerns, docs, cleanup, refactoring)
- Final Phase: Verification (Build, deploy and optional UI verification — populated based on the user's verification choice from the parent SDD workflow)
- MUST include: at minimum, a build task and a deploy task to validate compilation and deployability.
- Example:
- [ ] TXXX Build project and fix any compilation errors - Example:
- [ ] TXXX Deploy application to device/emulator via start_app
- Example:
- Conditionally include (only if the parent SDD workflow's verification choice is
Run verification + UI verification): an additional UI verification task.- Example:
- [ ] TXXX Run UI verification against deployed application
- Example:
- If the parent SDD workflow selected
Run verification(build-only): DO NOT include any UI verification task in this phase. - Verification scope hint: At the top of the Verification phase section, add an HTML comment indicating the chosen scope so downstream agents can read it deterministically:
<!-- verification_scope: build-only -->OR<!-- verification_scope: build+ui -->
- Tasks in this phase do NOT carry
[USx]labels.
- MUST include: at minimum, a build task and a deploy task to validate compilation and deployability.
Final Self-Validation Step
Before outputting tasks.md, internally verify:
- ✅ Every task starts with
- [ ] - ✅ Every task has a unique sequential ID (T001, T002...)
- ✅ US-phase tasks contain
[USx]label; Setup/Foundational/Polish do NOT - ✅ Every task description ends with a concrete, valid file path
- ✅ Total count matches the summary report If any check fails, regenerate the invalid tasks before final output. Do not output draft or unvalidated versions.
Context for task generation: $ARGUMENTS
The tasks.md should be immediately executable - each task must be specific enough that an LLM can complete it without additional context.