intent-plan
npx skills add https://github.com/arcblock/idd --skill intent-plan
Agent 安装分布
Skill 文档
Intent Plan
Transform an approved Intent into a structured, executable development plan with strict TDD discipline.
Output is TaskSwarm-compatible: The generated plan.md can be directly executed by /swarm run.
Core Principles
- Test First, Always: Every implementation step starts with writing tests
- Phased Execution: Break work into phases with clear deliverables (0-indexed)
- Verification Gates: Each phase ends with e2e validation
- Automation Priority: Prefer CLI/script testing over manual/browser testing
- Checkbox Tracking: All tests use
- [ ]format for progress tracking
Plan Structure
## Phase 0: [Phase Name]
âââ ### Description
âââ ### Tests
â âââ #### Happy Path
â â âââ - [ ] test case 1
â âââ #### Bad Path (详尽å举)
â â âââ - [ ] error case 1
â âââ #### Edge Cases
â â âââ - [ ] boundary case 1
â âââ #### Security
â â âââ - [ ] vulnerability test 1
â âââ #### Data Leak
â â âââ - [ ] leak prevention test 1
â âââ #### Data Damage
â âââ - [ ] integrity test 1
âââ ### E2E Gate
â âââ CLI/Script éªè¯å½ä»¤
âââ ### Acceptance Criteria
âââ - [ ] criterion 1
## Phase 1: [Phase Name]
âââ ...
Test Categories (6 Required)
Every phase MUST include tests from ALL 6 categories:
| Category | Description | Examples |
|---|---|---|
| Happy Path | Normal expected usage | Valid inputs, correct sequences |
| Bad Path | Invalid inputs, error conditions | Wrong types, missing required fields, invalid states |
| Edge Cases | Boundary conditions | Empty inputs, max values, concurrent access |
| Security | Vulnerability prevention | Injection attacks, auth bypass, privilege escalation |
| Data Leak | Information exposure | Sensitive data in logs, error messages, API responses |
| Data Damage | Data integrity protection | Partial writes, corruption, race conditions |
Bad cases must be detailed and comprehensive. A good test suite has more failure tests than success tests.
Test Writing Discipline
- Tests First: Write ALL tests before any implementation
- Red-Green-Refactor: Run tests expecting failure, implement, verify pass
- No Skip: Every category must have at least one test case
Phase Gates: E2E Verification (Required)
Each phase MUST end with E2E verification. This is the gate that proves the phase is truly complete.
E2E Gate Requirements
- Automatable: Must be runnable via CLI/script, no manual steps
- Independent: Can run without human intervention
- Reproducible: Same inputs produce same outputs
- Fast Feedback: Fails quickly when something is wrong
Preferred: CLI/Script Testing
# Example: API verification
curl -X POST http://localhost:3000/api/resource \
-H "Content-Type: application/json" \
-d '{"field": "value"}' | jq .
# Example: Database state check
psql -c "SELECT * FROM table WHERE condition"
# Example: File system verification
diff expected_output.json actual_output.json
# Example: Unit test suite
pnpm test -- --coverage
For Web Projects: Automation-Friendly Design
DO:
- Provide health check endpoints
- Return machine-parseable responses (JSON)
- Include test mode / seed data endpoints
- Design idempotent operations
DON'T:
- Require browser interaction for verification
- Depend on visual inspection
- Need manual clicking through UI
When Browser Testing is Unavoidable
If browser/headless testing is truly necessary:
- Use Playwright/Puppeteer with script automation
- Create dedicated test endpoints
- Prefer API calls over UI interaction
Pre-Plan Gates (Mandatory)
Before generating any plan, ALL gates must pass. No exceptions.
/intent-plan
â
âââââââââââââââââââââââââââââââââââââââ
â Gate 1: Interview Check â
â â â "å
è· /intent-interview" â
âââââââââââââââââââââââââââââââââââââââ
â
âââââââââââââââââââââââââââââââââââââââ
â Gate 2: Critique Check â
â â â "å
è· /intent-critique" â
âââââââââââââââââââââââââââââââââââââââ
â
âââââââââââââââââââââââââââââââââââââââ
â Gate 3: Dependency Check â
â â â "åç½®ä»»å¡æªå®æï¼æ æ³ plan" â
âââââââââââââââââââââââââââââââââââââââ
â
â All gates passed â Generate plan.md
Gate 1: Interview Check
Verify the Intent has been properly interviewed:
| Check | How to Verify | If Failed |
|---|---|---|
| INTENT.md exists | File exists in intent directory | Run /intent-interview |
| Anchor exists | First blockquote after title starts with > |
Add anchor statement |
| Within budget | wc -l INTENT.md ⤠500 (warning at 300) |
Run /intent-critique to reduce if > 500 |
| Structure complete | Has Responsibilities, Structure, API sections | Run /intent-interview |
| Not a stub | Content is substantial, not placeholder text | Run /intent-interview |
Output if failed:
â Gate 1 Failed: Interview Incomplete
INTENT.md is missing or incomplete:
- [ ] Responsibilities section missing
- [ ] Structure diagram missing
Action required: Run /intent-interview first.
Gate 2: Critique Check
Verify the Intent has been critiqued for over-engineering:
| Check | How to Verify | If Failed |
|---|---|---|
| Critique done | Look for critique markers or changelog | Run /intent-critique |
| Post-modification | If INTENT.md modified after last critique | Run /intent-critique again |
| AI assessment | Ask AI if another critique round is needed | Run /intent-critique if yes |
Critique markers to look for:
<!-- critique: {date} -->comment in INTENT.mdcritique.mdorCRITIQUE.mdin same directory- Changelog entry mentioning critique
Post-modification detection:
- Compare INTENT.md mtime with critique marker date
- If INTENT.md is newer AND has substantial changes â re-critique required
AI Assessment prompt:
“Based on this Intent, is there any sign of over-engineering, premature abstraction, or YAGNI violation that warrants another critique round?”
Output if failed:
â Gate 2 Failed: Critique Required
Intent has not been critiqued, or was modified after critique:
- Last critique: 2026-01-15
- INTENT.md modified: 2026-01-20 (substantial changes detected)
Action required: Run /intent-critique to review for over-engineering.
Gate 3: Dependency Check
Verify all prerequisites are satisfied:
| Check | How to Verify | If Failed |
|---|---|---|
| Internal deps | Referenced intents have status: done in TASK.yaml |
List blocking intents |
| External deps | Required packages/services exist | List missing dependencies |
| Environment | Required env vars, credentials, access | List missing setup |
How to find dependencies:
- Parse
## Prerequisitesor## Dependenciesin INTENT.md - Look for
depends_on:in TASK.yaml (if exists) - Scan for references like
intent/other-feature/or@package/name
Dependency states:
intent/auth/ â TASK.yaml status: done â OK
intent/database/ â TASK.yaml status: review â Blocked (not done)
intent/api/ â No TASK.yaml ? Assume not started
@aigne/afs â Check packages/ or deps â/â
Output if failed:
â Gate 3 Failed: Dependencies Not Ready
This Intent cannot be planned because prerequisites are incomplete:
Blocking Intents:
- intent/auth-module/ â status: in_progress (need: done)
- intent/database-setup/ â status: ready (need: done)
Missing External Dependencies:
- @aigne/session-protocol â not found in packages/
Action required: Complete blocking tasks first, or remove dependencies from INTENT.md if not actually needed.
Gate Pass Output
When all gates pass:
â Gate 1: Interview complete
â Gate 2: Critique done (2026-01-20), no re-critique needed
â Gate 3: All 2 dependencies satisfied
Proceeding to generate plan...
Workflow
/intent-plan
â
Gate 1: Interview Check âââ â â Stop, require /intent-interview
â â
Gate 2: Critique Check ââââ â â Stop, require /intent-critique
â â
Gate 3: Dependency Check ââ â â Stop, list blockers
â â
Read Intent file
â
Analyze scope and complexity
â
Identify logical phases (0-indexed)
â
For each phase, define:
- Description
- Tests (6 categories)
- E2E Gate
- Acceptance Criteria
â
Present plan for approval
â
User confirms or adjusts
â
Save to plan.md (same directory as INTENT.md)
â
Create TASK.yaml (status: ready)
Output Files
1. plan.md (Required)
# Execution Plan: {task_name}
## Overview
ç®è¦è¯´æè¿ä¸ªä»»å¡è¦åä»ä¹ã
## Prerequisites
- åç½®æ¡ä»¶
- ä¾èµçå
¶ä»ä»»å¡
- éè¦çæéæèµæº
## Phase 0: {Phase Name}
### Description
è¿ä¸ªé¶æ®µè¦å®æä»ä¹ï¼äº¤ä»ä»ä¹ã
### Tests
#### Happy Path
- [ ] æµè¯æ£å¸¸æµç¨ 1: {å
·ä½æè¿°}
- [ ] æµè¯æ£å¸¸æµç¨ 2: {å
·ä½æè¿°}
#### Bad Path
- [ ] æ æè¾å
¥: {å
·ä½åºæ¯}
- [ ] 缺失å¿
å¡«åæ®µ: {å
·ä½åºæ¯}
- [ ] éè¯¯ç¶æ: {å
·ä½åºæ¯}
- [ ] ç±»åé误: {å
·ä½åºæ¯}
#### Edge Cases
- [ ] 空è¾å
¥å¤ç
- [ ] æå¤§å¼è¾¹ç
- [ ] å¹¶å访é®
#### Security
- [ ] 注å
¥æ»å»é²æ¤: {å
·ä½åºæ¯}
- [ ] æéç»è¿é²æ¤: {å
·ä½åºæ¯}
- [ ] è¾å
¥éªè¯: {å
·ä½åºæ¯}
#### Data Leak
- [ ] é误信æ¯ä¸æ³é²æææ°æ®
- [ ] æ¥å¿ä¸å
嫿æä¿¡æ¯
- [ ] API ååºä¸è¿åº¦æ´é²
#### Data Damage
- [ ] é¨ååå
¥æ¢å¤
- [ ] ç«ææ¡ä»¶å¤ç
- [ ] äºå¡å®æ´æ§
### E2E Gate
```bash
# Phase 宿éªè¯èæ¬
{CLI commands to verify phase completion}
Acceptance Criteria
- ææ 6 ç±»æµè¯éè¿
- E2E Gate éªè¯éè¿
- 代ç å·²æäº¤å¹¶ push
Phase 1: {Phase Name}
Description
ä¸ä¸é¶æ®µè¦å®æä»ä¹ã
Tests
Happy Path
- æµè¯æ£å¸¸æµç¨
Bad Path
- æµè¯é误å¤ç 1
- æµè¯é误å¤ç 2
Edge Cases
- è¾¹çæ¡ä»¶å¤ç
Security
- å®å ¨æµè¯
Data Leak
- æ³é²é²æ¤æµè¯
Data Damage
- æ°æ®å®æ´æ§æµè¯
E2E Gate
# Phase 1 éªè¯èæ¬
Acceptance Criteria
- æææµè¯éè¿
- E2E Gate éªè¯éè¿
Final E2E Verification
# å
¨ç³»ç»ç«¯å°ç«¯éªè¯èæ¬
# éªè¯ææ Phase çåè½ååå·¥ä½
Risk Mitigation
| Risk | Mitigation | Contingency |
|---|---|---|
| [é£é© 1] | [é¢é²æªæ½] | [åçæ¶çåºå¯¹] |
References
- ç¸å ³ Intent
- 详ç»è§æ ¼ (妿åå¨)
- è®¾è®¡ææ¡£ (妿åå¨)
### 2. TASK.yaml (Required)
```yaml
status: ready
owner: null
assignee: null
phase: 0/{total_phases}
updated: {UTC_ISO_TIMESTAMP}
heartbeat: null
Important: {total_phases} is the number of phases in plan.md (0-indexed counting).
Integration with IDD & TaskSwarm
IDD Flow:
/intent-interview # Create Intent (Gate 1 requirement)
â
/intent-critique # Review for over-engineering (Gate 2 requirement)
â
/intent-review # Approve Intent (optional but recommended)
â
/intent-plan # Gate checks â Generate plan.md + TASK.yaml (THIS SKILL)
â
TaskSwarm Flow:
/swarm run # Execute plan (TDD cycles)
â
/swarm approve # Human review
â
/intent-sync # Write back confirmed details
Gate enforcement ensures quality:
- No plan without proper interview â avoids vague/incomplete specs
- No plan without critique â avoids over-engineered designs
- No plan with missing deps â avoids unexecutable plans
Tips for Good Plans
Format (TaskSwarm Compatible)
- 0-indexed phases: Phase 0, Phase 1, Phase 2…
- Checkbox format: All tests use
- [ ]for progress tracking - E2E Gate per phase: Each phase must have runnable verification
Test Quality
- All 6 categories required: Happy/Bad/Edge/Security/Data Leak/Data Damage
- Bad Path > Happy Path: More failure tests than success tests
- Specific test cases: “Test error handling” â â “returns 404 when resource not found” â
- Security by default: Include even if not explicitly requested
Phase Design
- Right-size phases: Each phase completable in 1-3 days
- Clear dependencies: Note when phases depend on previous phases
- Automatable gates: E2E Gate must be runnable via CLI, no manual steps
Example: Complete Output
For an Intent at intent/session-protocol/INTENT.md:
Creates: intent/session-protocol/plan.md
# Execution Plan: session-protocol
## Overview
å®ç° Session Protocol ç Frame ç¼è§£ç åè½ã
## Prerequisites
- @aigne/afs å
å·²åå¨
- TypeScript ç¯å¢é
ç½®å®æ
## Phase 0: Frame Encoding
### Description
å®ç° Frame çç¼ç 彿°ï¼å°ç»æåæ°æ®è½¬æ¢ä¸ºäºè¿å¶æ ¼å¼ã
### Tests
#### Happy Path
- [ ] encodes empty frame correctly
- [ ] encodes frame with JSON payload
- [ ] encodes frame with binary payload
- [ ] preserves ReqId across encode/decode
#### Bad Path
- [ ] throws on invalid frame type
- [ ] throws on payload exceeding max size
- [ ] throws on null payload when required
- [ ] throws on negative ReqId
- [ ] throws on non-integer frame type
#### Edge Cases
- [ ] handles empty string payload
- [ ] handles maximum allowed payload size (64KB)
- [ ] handles unicode in JSON payload
- [ ] handles zero-length binary payload
#### Security
- [ ] rejects frames with potential injection patterns
- [ ] validates frame type bounds (0-255)
- [ ] sanitizes string inputs before encoding
#### Data Leak
- [ ] error messages don't expose internal structure
- [ ] stack traces not included in thrown errors
#### Data Damage
- [ ] atomic write: partial encode doesn't corrupt buffer
- [ ] buffer overflow protection
### E2E Gate
```bash
# Verify encoding works end-to-end
pnpm test -- --grep "Frame Encoding"
pnpm test:e2e -- --grep "encode"
Acceptance Criteria
- ææ 6 ç±»æµè¯éè¿
- E2E Gate éªè¯éè¿
- 100% 忝è¦çç
- 代ç å·²æäº¤
Phase 1: Frame Decoding
Description
å®ç° Frame çè§£ç 彿°ï¼å°äºè¿å¶æ°æ®è§£æä¸ºç»æå对象ã
Tests
Happy Path
- decodes valid frame correctly
- handles streaming decode
- decodes all frame types
Bad Path
- throws on truncated frame
- throws on corrupted header
- throws on invalid magic bytes
- throws on unsupported version
Edge Cases
- handles minimum valid frame
- handles maximum valid frame
- handles back-to-back frames in stream
Security
- validates frame length before allocation
- rejects oversized frames (DoS protection)
Data Leak
- doesn’t expose raw bytes in error messages
Data Damage
- partial decode doesn’t advance stream position
- corrupted frame doesn’t affect subsequent frames
E2E Gate
# Verify full roundtrip
pnpm test -- --grep "Frame"
echo '{"test":1}' | node scripts/encode-decode-test.js
Acceptance Criteria
- æææµè¯éè¿
- E2E roundtrip éªè¯éè¿
- 代ç å·²æäº¤
Final E2E Verification
# Full integration test
pnpm test
pnpm test:e2e
References
**Creates**: `intent/session-protocol/TASK.yaml`
```yaml
status: ready
owner: null
assignee: null
phase: 0/2
updated: 2026-01-27T10:00:00Z
heartbeat: null