sdd-task-planner
Scannednpx machina-cli add skill leoheart0125/sdd-skills/sdd-task-planner --openclawSDD Task Planner
This skill transforms specifications into actionable plans, but unlike a simple generator, it learns and enforces rules. It checks the Knowledge Base for similar past features, reads project_rules.md for architectural constraints, and applies clarification when needed.
Core Responsibilities
- Rule-Aware Planning: Read
project_rules.mdfirst — especially Architecture and Coding Standards — before generating any task. - Pattern Matching: Query
sdd-knowledge-basefor tasks similar to the current feature (by tags). - Smart Generation: If a pattern exists, hydrate it. If not, generate new tasks from spec artifacts.
- Path Validation: Every task must include a
target_paththat conforms to the architecture conventions defined inproject_rules.md. - Optimization: Order tasks to minimize context switching.
Commands
/sdd-plan: Generate or update the implementation plan (tasks.json)./sdd-plan-optimize: Re-sort tasks based on dependencies and developer availability.
Planning Logic
When /sdd-plan is called:
Step 1: Read Project Rules (MANDATORY FIRST STEP)
- Load
project_rules.mdfrom.sdd/context/. - Extract architecture conventions from the Architecture section of
project_rules.md(e.g., directory structure patterns, layer ordering). - Extract coding standards and naming conventions.
- These rules constrain all subsequent task generation.
Step 2: Knowledge Lookup (MANDATORY — Index-Based)
- Read
.sdd/knowledge/index.json(the lightweight index). - Filter
patternsentries whosetagsmatch the current feature's domain (e.g.,crud,auth). - Filter
lessonsentries whosetagsmatch OR whosetriggermatches"planning-*"or the current feature's domain. - Load ONLY the matched files (via the
filepath in each index entry). Do NOT scan the fullpatterns/orlessons/directories. - Summarize relevant findings — reuse proven strategies and avoid past mistakes.
- Output the knowledge match results before proceeding:
📚 **Knowledge Loaded** (stage: plan)
| Type | ID | Matched Tags | Summary |
|------|----|-------------|---------|
| <type> | <id> | `<tag1>`, `<tag2>` | <summary> |
> No knowledge matched. (if empty)
Step 3: Analyze Feature Context
- Read
context.json— getcurrent_feature,architecture_style,project_structure_convention. - Read all available spec artifacts from
.sdd/spec/<feature-id>/. The following may exist depending on the feature's design:requirements.json— functional/non-functional requirements and constraints.architecture.json— components, data flow, architectural decisions.object_design.json— design units (classes, modules, components), relationships.data_api.json— DB entity schemas and data-layer definitions (if applicable).openapi.yaml— API contract (if applicable).interface_contract.json— non-HTTP interface definitions (if applicable).
Step 4: Pre-Plan Clarification
Before generating tasks, check for concerns:
- "This feature requires a new DB migration. Which task should handle it?"
- "Found a similar pattern
crud-api(tags: crud, rest). Apply it or customize?" - "Spec item REQ-003 still has open clarifications. Resolve via
/sdd-designfirst?"
Present BLOCKING concerns to user and STOP. Wait for user resolution. Skip if no concerns.
Step 5: Generate Tasks
- If Pattern Match Found:
- Load Pattern Task List.
- Replace placeholders (e.g.,
{{Entity}}→User). - Cross-reference with spec artifacts to ensure all requirements, classes, endpoints, and entities are covered.
- Adjust
target_pathto matchproject_rules.mdconventions. - Output
tasks.json.
- If No Match:
- Parse ALL available spec artifacts.
- Identify the key implementation units from spec artifacts (e.g., components, modules, services, pages, commands — depending on the project type).
- Map each design unit from
object_design.jsonto a task, ensuring names, signatures, and layer placement are preserved in the task description. - Map additional artifacts (
data_api.json,openapi.yaml,interface_contract.json) to relevant tasks if they exist. - Verify every functional requirement in
requirements.jsonis addressed by at least one task. - Generate
target_pathfor each task based on project rules. - Generate fresh
tasks.json.
Step 6: Guardrail Validation
After generating tasks, invoke sdd-guardrails with context "plan":
- Path Convention Check: Verify each task's
target_pathmatches the architecture style.- Validate each task's
target_pathmatches the conventions declared inproject_rules.md.
- Validate each task's
- Rule Compliance: Ensure task descriptions don't contradict
project_rules.md. - If violations found → fix tasks → re-validate.
JSON Writing Rule
When writing tasks.json, you MUST use the file writing tools. All string values MUST have special characters properly escaped (\", \\, \n, \t, control chars). Validate JSON is well-formed before writing to disk. If validation fails, fix escaping issues before saving.
Step 7: Finalize
- Write
tasks.jsonto.sdd/plan/<feature-id>/tasks.json. - Update
context.json.current_stageto"plan-complete".
Output
Generates .sdd/plan/<feature-id>/tasks.json containing:
- Task Groups: Logical grouping of tasks.
- Dependencies: Explicit blocking relationships.
- Target Paths: Expected file paths for each task's output.
- Estimated Effort: Based on historical data from similar patterns.
Post-step: Feedback Capture (MANDATORY)
After presenting the plan to the user, if the user adjusts the generated plan (changes task granularity, reorders tasks, rejects a pattern match):
- Apply the requested changes to
tasks.json. - Immediately write a lesson to
.sdd/knowledge/lessons/capturing:- What was originally planned vs what the user changed.
- Why the adjustment was needed.
- Tags for future retrieval (feature name,
planning-tasks, domain keywords).
This is NOT optional. Every user adjustment to the plan MUST be recorded as a lesson.
Integration
- Input:
context.json,project_rules.md,.sdd/spec/<feature-id>/*(requirements.json,architecture.json,object_design.json,data_api.json,openapi.yaml),sdd-knowledge-base. - Output:
.sdd/plan/<feature-id>/tasks.json(consumed bysdd-implementer). - Invokes:
sdd-guardrails(plan-level checks).
Source
git clone https://github.com/leoheart0125/sdd-skills/blob/main/skills/sdd-task-planner/SKILL.mdView on GitHub Overview
SDD Task Planner translates specifications into actionable tasks while learning from past features and enforcing project rules. It consults the knowledge base for similar patterns and applies constraints from project_rules.md to generate compliant, optimized task sets.
How This Skill Works
When /sdd-plan runs, it first reads project_rules.md to apply architecture and coding standards, then queries the knowledge base for matching patterns by tags. If a match exists, it hydrates the pattern; if not, it creates new tasks from spec artifacts, ensuring every task has a target_path and an optimized sequence to minimize context switching.
When to Use It
- Planning a new feature with a matching pattern in the knowledge base
- Enforcing architecture constraints from project_rules.md before task generation
- Reusing proven design patterns to speed up planning while avoiding past mistakes
- Generating tasks that include a target_path aligned with architecture conventions
- Optimizing task order to minimize context switching and dependencies
Quick Start
- Step 1: Run /sdd-plan to generate or update tasks.json by applying project rules and knowledge base
- Step 2: Review tasks, hydrate placeholders, and verify target_path conformity
- Step 3: Run /sdd-plan-optimize to re-sort tasks for minimal context switching
Best Practices
- Load project_rules.md first and extract Architecture and Coding Standards before generating tasks
- Query sdd-knowledge-base for relevant patterns and lessons before creating new tasks
- Ensure every task includes a target_path that adheres to architecture conventions
- Cross-reference requirements, architecture, and data_api artifacts to cover all aspects
- Use /sdd-plan-optimize after generation to improve task ordering
Example Use Cases
- Plan a new feature by reusing a matching pattern from the knowledge base and hydrating it with current specs
- Generate a fresh set of tasks from spec artifacts when no pattern matches, ensuring architecture alignment
- Add required DB migrations or API endpoints per project_rules.md constraints and validate target_path
- Reorder planned tasks to minimize context switching and dependency conflicts
- Validate each task's target_path against architecture conventions before execution