Loading...
Loading...
Execute development tasks with skeleton-first approach and layered TDD. Includes optional adversarial verification (code quality + test completeness review). Use when users start working on a task (T-XX), need development guidance, or implement features/bugfixes. Triggers on keywords like "execute task", "start T-XX", "implement", "develop", "开发任务", "执行任务", "对抗式验证", "--review".
npx skill4agent add ab300819/skills devdocs-dev-workflowdocs/devdocs/04-dev-tasks.md1. Read Task Definition
├── Retrieve task details from 04-dev-tasks.md
├── Confirm associated F-XXX, AC-XXX
└── Confirm associated test cases UT/IT/E2E-XXX
│
▼
2. Generate Skeleton Code (Top-Down)
├── Interface skeleton + @requirement/@satisfies annotations
└── Test skeleton + @verifies/@testcase annotations
│
▼
3. Execute Development (Layered TDD)
├── Core Logic 🔴: Test-first
├── Interface Layer 🟡: Recommended test-first
├── UI Layer 🟢: Tests can be added after implementation
└── Infrastructure ⚪: Verified via integration tests
│
▼
4. Completion Check
├── Basic Check (Always Executed)
│ ├── All acceptance criteria are satisfied
│ ├── Tests pass
│ └── Self-check of review points
│
└── Adversarial Verification (🔴 Auto-triggered / Manual trigger via --review for other layers)
├── 🔍 Code Quality Review (from /code-quality perspective)
├── 🧪 Test Completeness Review (from /testing-guide perspective)
└── 📋 Comprehensive Review Report
│
▼
4.5 Update Self-description (Run /code-self-describe --update)
│
▼
5. Submit Code (Follow /commit-convention)
│
▼
6. Update Traceability (Run /devdocs-sync --trace)Achieve two-way traceability between documents and code; AI automatically adds annotations when generating code.
| Annotation | Purpose | Location |
|---|---|---|
| Associate with feature points | Interface/Class/Module |
| Meets acceptance criteria | Interface/Method |
| Verifies acceptance criteria | Test Case |
| Test ID | Test Case |
/**
* Create User
* @requirement F-001 - User Registration
* @satisfies AC-001 - Email Format Validation
* @satisfies AC-002 - Password Strength Validation
*/
export async function createUser(dto: CreateUserDTO): Promise<User> {
// Implementation code
}
/**
* @verifies AC-001 - Email Format Validation
* @testcase UT-001
*/
test('createUser should reject invalid email formats', () => {
// Test code
});| Level | Annotation Location | Mandatory |
|---|---|---|
| Public Interface | Service/API entry method | Required |
| Test Files | Each test case | Required |
| Internal Implementation | Complex logic | Optional |
Define the skeleton first, then fill in the details. Ensure the traceability chain is established during code generation.
Step 1: Generate Interface Skeleton
├── Method signature (from 02-system-design.md)
├── Add @requirement/@satisfies annotations
└── Method body: throw new Error('Not implemented')
│
▼
Step 2: Generate Test Skeleton
├── Test structure (from 03-test-cases.md)
├── Add @verifies/@testcase annotations
└── Test body: test.skip() or test.todo()
│
▼
Step 3: Implement Interface Details (Follow /code-quality)
│
▼
Step 4: Improve Tests (Follow /testing-guide)
│
▼
Step 5: Run /devdocs-sync --trace to update traceability matrix| Layer | TDD Mode | Description |
|---|---|---|
| Core Logic (Service/Domain) | 🔴 Mandatory | Test-first |
| Interface Layer (Controller/API) | 🟡 Recommended | Recommended to use test-first |
| UI Layer (Component/View) | 🟢 Optional | Tests can be added after implementation |
| Infrastructure (DB/Config) | ⚪ Not Applicable | Verified via integration tests |
┌─────┐ ┌─────┐ ┌─────┐
│ Red │ → │ Green│ → │Refactor│ ──┐
│Write Test│ │Write Code│ │Optimize│ │
│(Fails)│ │(Passes)│ │Code │ │
└─────┘ └─────┘ └─────┘ │
↑ │
└───────────────────────────┘| Phase | Collaborating Skill | Description |
|---|---|---|
| Writing business code | | MTE principles, dependency injection, avoid over-engineering |
| Writing test code | | Assertion quality, mutation testing, coverage |
| UI implementation | | Accessibility, animations, layout constraints |
| Completion verification | | Adversarial verification: multi-perspective review |
| Completion check | | Update module self-description (--update) |
| Code submission | | Use git mv/rm for file operations |
| Commit message | | Follow project commit conventions |
| Task completion | | Follow-up: Update traceability matrix (--trace) |
Review code from different role perspectives, simulating the multi-person collaboration mode of "Development → Review → Testing". Core logic tasks (🔴) trigger automatically; other layers are triggered manually via.--review
Layer Determination: Task layer markers (🔴🟡🟢⚪) come from task definitions in, assigned by04-dev-tasks.mdduring task splitting according to task layering rules./devdocs-dev-tasks
| Task Layer | Default Behavior | Manual Control |
|---|---|---|
| 🔴 Core Logic | Automatically triggered | |
| 🟡 Interface Layer | Not triggered | |
| 🟢 UI Layer | Not triggered | |
| ⚪ Infrastructure | Not triggered | |
Basic Completion Check (Always Executed)
│
├── All AC satisfied ✅
├── All tests pass ✅
├── Code annotations complete ✅
│
▼ (When adversarial verification is triggered)
Phase 1: Code Quality Review 🔍
├── Switch to /code-quality perspective
├── MTE principle check (function length/parameters/nesting/responsibilities)
├── Dependency direction check
├── Security check
└── Output: Issue list (Blocker/Suggestion)
│
▼
Phase 2: Test Completeness Review 🧪
├── Switch to /testing-guide perspective
├── Assertion quality check (forbid weak assertions)
├── Coverage check (line/branch ≥80%)
├── Requirement traceability check (full AC coverage)
├── [Optional] Code branch coverage analysis
└── Output: Issue list (Blocker/Suggestion)
│
▼
Phase 3: Comprehensive Review Report 📋
├── Summarize all issues
├── 🚫 Blocker → Must fix before re-verification
└── 💡 Suggestion → Ask user if they want to fix| Level | Marker | Handling |
|---|---|---|
| 🚫 Blocker | Must fix | Blocks submission; re-verify after fixing |
| 💡 Suggestion | Recommended to fix | Ask user; can choose to ignore |
See verification-flow.md for detailed review checklist and report template
/commit-convention<type>(T-XX): <Task Name>
- <Completed Item 1>
- <Completed Item 2>
Related: F-XXX, AC-XXX
Tests: UT-XXX, IT-XXX Passed