afx-task
Implementation lifecycle — plan tasks, pick work, implement code, verify, complete, and sync with GitHub
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Implementation lifecycle — plan tasks, pick work, implement code, verify, complete, and sync with GitHub
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Design authoring — generate, validate, review, and approve technical design documents (design.md)
Context-aware guidance — analyzes git state, active tasks, and session history to recommend the best next action
Spec management — validate structure, review quality, manage approval lifecycle for spec.md
Single-document SDD for fast, surgical feature work — carries spec + design + tasks in one file, graduates to 4-file when scope grows
ADR management — create, review, list, and supersede Architecture Decision Records
Quality gates and compliance — trace execution paths, audit annotations, verify cross-references, and run all checks against spec requirements
| name | afx-task |
| description | Implementation lifecycle — plan tasks, pick work, implement code, verify, complete, and sync with GitHub |
| license | MIT |
| metadata | {"afx-owner":"@rix","afx-status":"Living","afx-tags":"workflow,task,implementation,coding,verification,lifecycle","afx-argument-hint":"plan | refine | pick | code | verify | complete | sync | brief | review | validate | status","modeSlugs":["focus-review-tasks","focus-code","code"]} |
Implementation lifecycle engine for tasks.md artifacts and source code. Owns the full journey from task planning through coding to completion.
Read config using two-tier resolution: .afx/.afx.yaml (managed defaults) + .afx.yaml (user overrides).
paths.specs - Where spec files live (default: docs/specs)If neither file exists, use defaults.
# Task Planning (lifecycle-gated)
/afx-task plan <name> # Generate tasks.md from approved design
/afx-task refine <name> # Alias: refine or draft tasks.md from approved design
# Work Management
/afx-task pick <id> # Check out a task as active
/afx-task complete <id> # Mark task done
# Implementation (from afx-dev code)
/afx-task code <id> # Implement task with @see traceability
/afx-task code all <name> # Implement all open tasks in the feature, in tasks.md order
# Verification
/afx-task verify <task-id> # Verify task implementation vs spec
/afx-task verify <spec>#<task-id> # Explicit spec (e.g., user-auth#7.1)
/afx-task verify all <name> # Verify all tasks in a feature
/afx-task brief <task-id> # Get implementation summary
# Quality
/afx-task review <name> # Check for planning gaps
/afx-task validate <name> # Validate tasks.md against template + spec coverage
/afx-task status <name> # Phase completion overview
# GitHub Sync
/afx-task sync [spec] [issue] # Bidirectional GitHub sync
Display Rule: Don't dump full task lists or phase breakdowns into chat unless the user explicitly asks. The user can read
tasks.mddirectly, or use a UI host such as the AgenticFlowX VS Code extension (Tasks Tab, Pipeline Tab) if installed. These subcommands focus on operations that require agent reasoning, not raw display.
Owns the tasks.md artifact AND the implementation engine. Owns coding with traceability, task state management, and GitHub sync. All spec-driven coding is tied to a task ID.
Use these terms consistently across AFX skills, docs, chat actions, and UI surfaces:
/afx-task, this maps to refine (preferred alias), plan (legacy-compatible initial draft), and targeted updates to tasks.md.tasks.md.journal.md / tasks.md.spec.md and design.md are living documents: they represent current product and technical truth.journal.md captures decisions, amendments, production notes, and change rationale.tasks.md captures execution plan, active work, verification history, and work sessions.When task ID alone is provided (e.g., 7.1), resolve spec in this order:
ide_opened_file or ide_selection tags in conversation).[feature] from the active file path (e.g., docs/specs/user-auth/tasks.md → user-auth). If code is selected, use it as additional implementation context./afx-task code user-auth#7.1), use it directly.feat/{feature-name} pattern./afx-task verify user-auth#7.1tasks.md only in docs/specs/**/code subcommand)code subcommand)gh CLI, via sync subcommand)docs/specs/**/journal.md (captures only, via Proactive Capture Protocol)spec.md (owned by /afx-spec)design.md (owned by /afx-design).afx.yaml or .afx/ configurationtasks.md, journal.md, or source code file using a full-file rewrite. Always use targeted line-level replacements or append actions to preserve manually written human content.If out-of-scope work is requested, return:
Out of scope for /afx-task (implementation-lifecycle mode). Use /afx-spec for spec changes, /afx-design for design changes.
The following are Hard Anchors and MUST NOT be modified during /afx-task code without a prior approved Design update:
If a task requires modifying a Hard Anchor, STOP and escalate: /afx-design review {name}.
All timestamps MUST use ISO 8601 with millisecond precision: YYYY-MM-DDTHH:MM:SS.mmmZ (e.g., 2025-12-17T14:30:00.000Z). Never write short formats like 2025-12-17 14:30. To get the current timestamp, run date -u +"%Y-%m-%dT%H:%M:%S.000Z" via the Bash tool — do NOT guess or use midnight (T00:00:00.000Z).
When creating or modifying tasks.md, enforce the canonical AFX frontmatter schema:
---
afx: true
type: TASKS
status: Draft
owner: "@handle"
version: "1.0"
created_at: "YYYY-MM-DDTHH:MM:SS.mmmZ"
updated_at: "YYYY-MM-DDTHH:MM:SS.mmmZ"
tags: ["{feature}"]
spec: spec.md
design: design.md
---
Canonical field order: afx → type → status → owner → version → created_at → updated_at → tags → spec → design. Use double quotes for all string values.
Immutable fields (must NOT be changed during plan/pick/complete): afx, type, owner, created_at.
When this skill detects a high-impact context change, auto-capture to journal.md per the Proactive Capture Protocol.
Triggers for /afx-task:
Prompt-capture triggers (propose + confirm via /afx-session capture): task scope cut, re-plan of tasks.md phases, missed task discovered mid-implementation. After applying the change, run the Significance Check first — skip silently for cosmetic edits (reordering, rewording, typo fixes). Only call /afx-session capture --trigger scope-cut|missed-req --links <task-id> when the change encodes a real scope shift or discovery. See Prompt Capture Triggers.
Discussion Context Triggers (automated journal capture):
User: "should task 3.2 be done before 3.1?"
→ Journal: Task dependency question: 3.2 vs 3.1 sequencing
User: "let's discuss the EC3 API approach"
→ Journal: EC3 API approach discussed — see [DES-API]
User: "verify bottom up"
→ Journal: Bottom-up verify requested — task→spec trace
User: "what about FR-4?"
→ Journal: Question about FR-4 coverage — referenced in 9.1
Output format:
## Session: Discussion (2026-04-09T14:30:00.000Z)
### Context
Triggered by: verify bottom up question
Spec: 39-package-ec3
### Discussion Points
- Task 3.2 vs 3.1 dependency discussed
- Next: verify all tasks before coding
---
CRITICAL: Task planning is gated behind design approval. Task coding is gated behind task planning.
| Action | Precondition | Check |
|---|---|---|
plan | design.md status == Approved | Read design.md frontmatter |
code | tasks.md exists with task {id} | Read tasks.md |
Before planning, the agent MUST:
design.md frontmatter for the target featurestatus fieldstatus is NOT Approved, STOP and output:BLOCKED: Cannot author tasks.md content.
Precondition not met:
design.md status is "{current_status}" (required: "Approved")
Approve the design first:
/afx-design review {name}
/afx-design approve {name}
After completing any action that modifies tasks.md or source code, you MUST:
Verify Implementation vs. Spec: Perform a "Mental Reset"—read the entire spec.md and design.md for the feature and confirm the new code doesn't violate any previously implemented requirements.
Update updated_at: Set to current ISO 8601 timestamp in tasks.md frontmatter.
Verify backlinks: Ensure spec: spec.md and design: design.md are present in tasks.md frontmatter.
Contextual Tagging: If changes introduce new domains or concepts, append to tags array.
Version & State Management: If modifying a tasks.md that is currently status: Living and the change alters task scope (adding/removing phases), bump version.
Format Preservation: Frontmatter fields must remain in canonical order. Use double quotes.
Parser-Compatible Format Check: Verify the generated/modified tasks.md follows the Template Format Rules (CRITICAL) section — phase headers match ## Phase N:, checkboxes at column 0 with no indentation, Cross-Reference Index after all phases, Work Sessions last. Run /afx-task validate <name> if uncertain.
Proactive Prevention Check:
Work Sessions Table (CRITICAL — agents frequently get this wrong):
The ## Work Sessions section MUST be the last section in tasks.md, after all Phase sections and after the Cross-Reference Index. If it has drifted above other sections, move it back to the bottom before appending.
After pick, code, and complete, append a new row to the table. Do NOT replace existing rows.
Use this exact column structure — no variations:
| Date | Task | Action | Files Modified | Agent | Human |
| ---------- | ---- | --------- | -------------------- | ----- | ----- |
| 2026-03-31 | 1.1 | Picked | - | [x] | [] |
| 2026-03-31 | 1.1 | Coded | auth.service.ts, ... | [x] | [] |
| 2026-03-31 | 1.1 | Completed | auth.service.ts, ... | [x] | [] |
Date: YYYY-MM-DD (date only, not full ISO timestamp)
Task: WBS ID (e.g., 1.1, 2.3)
Action: One of Picked, Coded, Completed, Verified, Reviewed
Files Modified: Comma-separated list, or - if no files changed
Agent/Human: [x] for who performed, [] for pending human review
@see Annotations (code subcommand only): Add @see links at the class and function level via JSDoc on exported classes, interfaces, and functions. Line-level annotations ONLY when a specific line implements a non-obvious requirement. CRITICAL ANTI-PATTERN: Do NOT dump blanket @see links at the top of the file. Do NOT annotate every line.
docs/specs/{feature}/design.md, never shorthand like design.md or spec.md[DES-UI], [FR-12], [NFR-1]. Never append subsection numbers (e.g., 3.5.0.1) — the code lens parser cannot parse them@see docs/specs/{feature}/design.md [DES-UI] — path + space + Node ID(s). Multiple Node IDs space-separated: [FR-1] [FR-2]Task Checkbox: After code and complete, mark the relevant task checkbox [x].
[...context])When trailing arguments are passed (either via CLI or IDE context):
/afx-task code 1.2 oauth → implement task 1.2 with a focus on OAuth).1.3 and 1.5), perform the action and update the Work Sessions table for all matching tasks simultaneously.Do not auto-write tasks.md during plan. Before persisting:
journal.md append-only entries may be written without checkpointcode do NOT require a checkpoint (normal development flow)After EVERY /afx-task action, suggest the next command:
| Context | Suggested Next Command |
|---|---|
After plan | /afx-task pick <first-task-id> to start work |
After refine | /afx-task review <name> to validate task plan |
After pick {id} | /afx-task code {id} to implement |
After code {id} | /afx-task verify {id} to check implementation |
After verify ([OK]) | /afx-task complete {id} to mark done |
After verify ([PARTIAL]) | /afx-task code {id} to finish implementation |
After verify ([MISSING]) | /afx-task code {id} to implement |
After complete {id} | /afx-task pick <next-id> for next task |
After brief | /afx-task code {id} or /afx-task pick |
After review (gaps found) | Address gaps in tasks.md |
After validate (passed) | Proceed with implementation or /afx-task refine |
After validate (failed) | Fix format issues in tasks.md |
After status | /afx-task pick <next-id> based on overview |
After sync | /afx-task pick to resume work |
Host Rendering: Emit the plain next-command prose only. Do not emit host-specific JSON or marker blocks; UI hosts may convert the prose into clickable actions when concrete commands are present.
When the agent detects a lifecycle gate is actionable after completing work, use ask_followup_question to present options as clickable buttons instead of text-only suggestions.
Trigger conditions:
| Condition | Question | Options |
|---|---|---|
After plan generates tasks | "Tasks planned. Pick the first task?" | "Pick first task" / "Review tasks" / "Not now" |
After pick checks out a task | "Task checked out. Start implementing?" | "Code task" / "View brief" / "Not now" |
After code completes | "Implementation done. Verify against spec?" | "Verify implementation" / "Continue coding" / "Not now" |
After verify returns [OK] | "Task verified successfully. Mark as complete?" | "Complete task" / "Pick next task" / "Not now" |
After verify returns [PARTIAL] | "Task partially implemented. Continue coding?" | "Continue coding" / "View gaps" / "Not now" |
After verify returns [MISSING] | "Task not yet implemented. Start coding?" | "Code task" / "Pick different task" / "Not now" |
After complete with more tasks remaining in current phase | "Task completed. Pick the next task in this phase?" | "Pick next task" / "Review progress" / "Not now" |
| After all tasks in a phase complete | "Phase {N} complete. Start next phase?" | "Start Phase {N+1}" / "Review progress" / "Not now" |
| After all tasks in ALL phases complete | "All tasks complete. Run final quality check?" | "Run quality check" / "Sync to GitHub" / "Not now" |
After validate passes (all checks ✓) | "Tasks validated. Ready to start implementation?" | "Pick first task" / "Review gaps" / "Not now" |
After validate fails (format or coverage issues) | "Validation found issues in tasks.md. Fix them now?" | "Show issues" / "Not now" |
After review finds coverage gaps | "Requirements without tasks detected. Add missing tasks?" | "Add tasks" / "Review gaps" / "Not now" |
After sync finds discrepancies (task done but issue open, or vice versa) | "GitHub sync found mismatches. Reconcile now?" | "Reconcile" / "View details" / "Not now" |
Code drift detected during code (design mismatch) | "Logic drift detected — implementation conflicts with design. Review the analysis?" | "Review in journal" / "Update design" / "Not now" |
After code modifies a Hard Anchor file (detected via Architectural Core rule) | "Hard Anchor file modified. This requires a design update first." | "Review design" / "Revert changes" / "Not now" |
Task has unmet dependency (detected during pick) | "Task {id} depends on {dep-id} which is not complete yet." | "Pick dependency first" / "Pick anyway" / "Not now" |
Rules:
The AFX tasks.md format is strict by design. Downstream consumers — the CLI, the AgenticFlowX VS Code extension, and any other AFX-aware tool — parse it with strict regex patterns. Deviations cause silent failures in tools that render tasks (e.g., the VS Code extension shows 0 phases and 0 tasks). These rules are non-negotiable.
Required format: ## Phase N: {Phase Name}
## (h2 markdown heading)Phase followed by a space and a digit## Phase 1: Core Types, ## Phase 3: Integration Testing## 1. Core Types, ## Step 1:, ### Phase 1:, # Phase 1:/^##\s+Phase\s+(\d+):?\s+(.*)$/Required format: - [ ] {Task text} or - [x] {Task text} at column 0
- [ ] (incomplete) or - [x] / - [X] (complete)@see links, and acceptance criteria go in HTML comments or indented text BELOW the checkbox - [ ] indented, * [ ] asterisk, - [ ] **1.1** bold-prefixed/^-\s+\[([ xX])\]\s+(.*)$/After frontmatter, the parser expects this order:
# Title## Task Numbering Convention (optional)## Phase 0: through ## Phase N: (phases in order)## Implementation Flow (optional)## Cross-Reference Index## Notes (optional)## Work Sessions — MUST be lastCRITICAL: ## Cross-Reference Index must come AFTER all Phase sections. ## Work Sessions must be the absolute last section — nothing below it.
/^##\s+Work\s+Sessions/i| YYYY-MM-DD | task-id | Action | files | [x]/[] | [x]/[] |/^\|\s*(\d{4}-\d{2}-\d{2}(?:T[\d:.]+Z?)?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|\s*(.+?)\s*\|/Purpose: Preferred alias for plan; refine or draft tasks.md from an approved design.
Behavior: Execute the same core flow as plan <name>. If tasks.md is empty or scaffold-only, generate the implementation plan from the approved design. If tasks.md already has content, perform targeted refinement that preserves task IDs, Work Sessions, and human-authored task notes. Do not modify source code during refine.
Keep plan supported indefinitely for compatibility, but prefer refine in new UI labels, help text, and examples.
Purpose: Generate implementation task breakdown from approved design.
Lifecycle Gate: design.md status MUST be Approved.
Implementation:
Read Approved Spec + Design
spec.md — extract requirements for traceabilitydesign.md — extract components, interfaces, data models, Node IDsjournal.md — extract any task-related decisionsDesign Feedback (advisory — does not block planning)
Scan design.md for gaps that will affect task quality. For each major design section, check if it has substantive content (not just placeholder text). Report findings before generating tasks:
Design Feedback:
⚠ [DES-ERR] Error handling section is empty — tasks will define error cases inline
⚠ [DES-TEST] No integration test strategy specified
✓ [DES-API] API contracts well-defined
✓ [DES-DATA] Data model complete
Recommendation: /afx-design review {name} to address gaps before finalizing tasks
If critical sections are empty ([DES-ARCH], [DES-API], [DES-DATA]), warn the user but continue — do not block.
Generate Task Breakdown using the tasks template (assets/tasks-template.md):
FORMAT ENFORCEMENT — AFX parsers (CLI, the VS Code extension, and any other AFX-aware tool) will silently break if these are violated. See Template Format Rules (CRITICAL) section above for the full regex reference.
## Phase N: {Name} (h2, the word "Phase", a digit, colon, name)- [ ] {text} at column 0 — NO indentation, NO bold task ID prefix- [ ] line = one task when rendered by AFX tools. Do NOT use checkboxes for acceptance criteria sub-itemsTask content requirements:
1.1, 2.3)<!-- files: ... --> comment)@see links using Node ID syntax with full paths (use <!-- @see docs/specs/{feature}/design.md [DES-API] | docs/specs/{feature}/spec.md [FR-1] --> comment)<!-- depends: 1.1 -->. Cross-phase dependencies are implicit (phase N depends on phase N-1).Persistence Checkpoint (MANDATORY) — present to user, wait for confirmation
Write tasks.md — replace scaffold, preserve frontmatter, update updated_at, set backlinks
Update journal.md — append entry recording task planning session
Purpose: Check out a task as active.
Implementation:
Read tasks.md, find task {id}
Verify task is not already marked complete ([x])
Check dependencies: If the task has a <!-- depends: X.Y --> comment, verify that task X.Y is marked complete. If not, warn the user and suggest picking the dependency first.
Locate ## Work Sessions — it must be the last section. If missing, create it at the bottom. If misplaced, move it to the bottom.
Append a row to the Work Sessions table:
| 2026-04-01 | {id} | Picked | - | [x] | [] |
Update updated_at in tasks.md frontmatter
Output task description and acceptance criteria for context
Purpose: The implementation engine. Loads full spec context and writes code with @see traceability.
Absorbed from: afx-dev code
Implementation:
Load Context
spec.md — requirements and acceptance criteriadesign.md — architecture, data models, API contracts, Node IDstasks.md — task definition, acceptance criteria, related tasksImplement
code all <name> variant: Resolve the feature's tasks.md, collect all unchecked task IDs in document order, and run the same code {id} implementation flow for each task one at a time. Stop after the first failed build/test/verification gate and report the next remaining task instead of continuing blindly.
During implementation, if you discover that the requested logic fundamentally conflicts with the codebase, introduces severe edge cases unaccounted for in design.md, or requires >5 lines of unmapped complex logic:
STOP CODING. Do not hack around the design or unilaterally invent new architecture.
Proactive Capture: Log the drift in journal.md detailing the discrepancy, the impact, and your recommended architectural course correction.
Escalate: Stop execution and prompt the user: "I've hit a logic conflict with the design. See journal.md for my analysis. We need to update the design via /afx-design or /afx-spec before I can continue coding this task."
Resume: Once the user updates the source of truth, resume the /afx-task code {id} command.
Add @see Annotations (class and function level):
/**
* User authentication service
*
* @see docs/specs/user-auth/design.md [DES-API]
* @see docs/specs/user-auth/tasks.md [2.1]
*/
export class AuthService {
/**
* @see docs/specs/user-auth/spec.md [FR-1]
* @see docs/specs/user-auth/design.md [DES-SEC]
*/
async login(credentials: LoginInput): Promise<AuthResult> {
// implementation
}
}
Annotation Rules:
@see path/to/file.md [NODE-ID]@see at the top of the fileUpdate tasks.md:
Mark task checkbox [x]
Locate ## Work Sessions at the bottom. Append a Coded row with the files you modified:
| 2026-03-31 | {id} | Coded | auth.service.ts, auth.action.ts | [x] | [] |
Update updated_at
Purpose: Verify task implementation against spec requirements (static verification).
Unlike /afx-check path which verifies runtime execution paths, this verifies if a specific task matches its spec.
Implementation:
@see backlinks — check source code for @see references to this taskTODO, FIXME related to this task## Task 7.1 Verify
**Spec**: user-auth
**Task**: Create supplier constants
**Status**: [OK] Implemented | [PARTIAL] Partial | [MISSING] Missing
### Implementation Evidence
| Check | Status | Details |
| --------------------- | ------ | -------------------------------------- |
| Files exist | [OK] | feature-claim-supplier.constants.ts |
| @see backlinks | [OK] | 2 files reference this task |
| Session log entry | [OK] | 2025-12-13: Created supplier constants |
| No incomplete markers | [OK] | No TODO/FIXME for 7.1 |
| Pattern Consistency | [OK] | Error handling/logging matches project |
| Structural Integrity | [OK] | No unauthorized Hard Anchor changes |
### Verdict
[OK] **Task 7.1 is fully implemented**
Verification Status Definitions:
| Status | Meaning | Criteria |
|---|---|---|
| [OK] Implemented | Task fully complete | Files exist, backlinks present, no TODOs |
| [PARTIAL] Partial | Task started but incomplete | Some files exist, or TODOs remain |
| [MISSING] Missing | Task not started | No files, no session log, no backlinks |
Purpose: Mark task as done.
Implementation:
Read tasks.md, find task {id}
Verify task checkbox is marked [x] (should be done by code)
If not marked, mark it now
Locate ## Work Sessions at the bottom of tasks.md. Append a row:
| 2026-03-31 | {id} | Completed | auth.service.ts, auth.action.ts | [x] | [] |
Update updated_at in tasks.md frontmatter
Output confirmation and suggest next task
Purpose: Atomic human-verification step that closes the Work Sessions loop on a tasks.md. Surfaced by AFX UI hosts (e.g. the AgenticFlowX VS Code extension) as a brass-accented [Sign Off ▾] button, not an LLM round-trip.
Two visibility gates — strict and relaxed:
The strict gate (ready) holds when all four conditions are true:
tasks.md is [x] — the implementation work is finished.Agent: [x] — the agent has verified each completed task.Human: [ ] — there is something to sign off.tasks.md is the active editor (UI hosts only; CLI surfaces resolve the file from arguments).The loose gate (signable) holds whenever condition 3 alone is true. Hosts SHOULD use the loose gate for button visibility so users can tick Human cells mid-flight; the popover MUST surface unmet strict conditions as warnings (e.g. "2 tasks still unchecked", "1 Agent row not yet [x]"). When neither gate holds (no pending Human cells), the affordance MUST NOT render — no greyed-out / disabled state.
Atomic mutation (single transaction; one undo entry):
Agent: [x] and Human: [ ] so its Human cell becomes [x]. Always runs when at least one such row exists, regardless of whether the strict gate held.status to Living — only when the strict gate (ready) held AND the file isn't already Living. Under the relaxed gate the file stays at its current status until body tasks + Agent rows are also clean; users re-run Sign Off later to promote.updated_at to the current ISO 8601 timestamp with millisecond precision. Always runs when step 1 ticked at least one row.The tasks.md lifecycle is Draft → Living — there is no Approved intermediate state for tasks, so when Sign Off DOES promote, the file moves straight to Living regardless of the prior value. UI copy SHOULD say "Promote status to Living" rather than naming a source state.
Why extension-side, not a slash command:
updated_at bump).Cmd/Ctrl+Z reverts everything in one step.Cross-harness contract:
Any AFX UI host (VS Code extension, web UI, CLI prompt) MAY implement this action so users can finalize a tasks.md without leaving the workflow. The conditions and atomic mutations above are the canonical contract — implementations MUST NOT auto-tick a Human cell whose corresponding Agent cell is still [ ].
Reference implementation: afx-vscode apps/vscode/src/services/tasks-signoff.ts (buildTasksSignOffEdit + applyTasksSignOff).
Purpose: Bidirectional GitHub sync.
Implementation:
tasks.md, ensure a corresponding GitHub issue or checklist item existsgh CLI for GitHub operationsPurpose: Generate concise summary of what was built for a task.
Implementation:
@see backlinks)Purpose: Check for planning gaps — advisory, not blocking.
Implementation:
spec.md (FR-xxx, NFR-xxx)tasks.md with their @see referencesGap Analysis: user-authentication
Requirements Coverage: 6/8 (75%)
Requirements WITHOUT Tasks (GAPS):
✗ [FR-4] Password complexity
✗ [NFR-3] Token expiry
Orphaned Tasks (no requirement link):
⚠ Task 1.1: Setup database schema
Recommendations:
1. Add task for [FR-4] (password complexity)
2. Add task for [NFR-3] (token expiry)
3. Link task 1.1 to a requirement or remove if unnecessary
Purpose: Structural AND spec compliance check for tasks.md — validates against the canonical template (assets/tasks-template.md) AND verifies spec requirement coverage.
Template Reference: assets/tasks-template.md
Implementation:
tasks.md exists at docs/specs/<name>/tasks.mdassets/tasks-template.md:
## Phase N:, ## Implementation Flow, ## Cross-Reference Index, ## Work Sessions (last)- [ ] checkboxesN.x format (not FEATURE-N.x)@see links to design/spec@see links)spec.md from same directoryFR-* and NFR-* requirements@see reference to itOutput:
Validation: 39-package-ec3 (tasks.md)
--- Template Alignment ---
Frontmatter: ✓ Matches template
Section Order: ✓ Correct
Task Format: ✓ Uses checkboxes, WBS N.x
--- Content Validation ---
@see Links: ✓ All tasks linked
Orphaned Tasks: ✓ None
Duplicate IDs: ✓ None
--- Spec Compliance ---
FR Coverage: 11/11 (100%)
NFR Coverage: 6/6 (100%)
Status: PASSED
FR/NFR Coverage Logic:
For each requirement in spec.md:
1. Extract pattern: ### FR-{number} or ### NFR-{number}
2. In tasks.md, grep for "@see ... [FR-N]"
3. If found → ✓ covered
4. If not found → ✗ GAP
Coverage = (requirements with tasks) / (total requirements)
Purpose: Quick phase-by-phase task completion overview.
Implementation:
[x]) vs total tasks per phaseOutput:
Status: 39-package-ec3
Phase 1 (Core Types): ████████░░ 80% (4/5 tasks)
Phase 2 (Providers): ██░░░░░░░░ 20% (1/5 tasks)
Phase 3-6: Not started
Phase 7-9 (Backlog): Pending
Blocked: None
Next Action: /afx-task pick 2.2
Purpose: Bottom-up verification — verify ALL tasks against spec coverage.
Implementation:
verify <task-id> logicOutput:
Verify All: 39-package-ec3 (13 tasks)
OK (9): 1.1, 2.1, 2.2, 3.1, 3.2, 3.3, 4.1, 4.2, 5.1
PARTIAL (2): 4.3, 5.2
MISSING (2): 6.1, 7.1
Recommendation: /afx-task code <id> for PARTIAL/MISSING tasks
Design Not Approved (plan)
BLOCKED: Cannot author tasks.md content.
Precondition not met:
design.md status is "Draft" (required: "Approved")
Approve the design first:
/afx-design review {name}
/afx-design approve {name}
Task Not Found
Error: Task 7.5 not found in docs/specs/user-auth/tasks.md
Available tasks in Phase 7: 7.1, 7.2, 7.3, 7.4
Ambiguous Spec
Error: Cannot determine spec context.
Recent activity spans multiple specs: user-auth, users-permissions
Specify explicitly:
/afx-task verify user-auth#7.1
Task Already Complete
Task 2.1 is already marked complete.
To re-open: uncheck the task in tasks.md and run /afx-task pick 2.1
Drift Detected
BLOCKED: Logic drift detected in Task 2.1.
The required implementation deviates from design.md [DES-API] regarding token rotation.
Action Taken:
- Analysis logged to docs/specs/auth/journal.md
- Coding paused to prevent technical debt
Next Step:
- Review analysis in journal.md
- Update design: /afx-design modify auth
/afx-task/afx-design approve → Suggest /afx-task refine <name>/afx-check trace → Suggest /afx-task verify if broken @see links found/afx-next → Suggest /afx-task pick if tasks are pending/afx-task → Other Commands/afx-task refine / /afx-task plan → Suggest /afx-task pick <first-id>/afx-task complete → Suggest /afx-task pick <next-id> or /afx-check path for gate verification/afx-task verify ([OK]) → Suggest /afx-task complete <id>/afx-task review (gaps) → Suggest editing tasks.md to add missing tasks