afx-next
Context-aware guidance — analyzes git state, active tasks, and session history to recommend the best next action
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Context-aware guidance — analyzes git state, active tasks, and session history to recommend the best next action
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Design authoring — generate, validate, review, and approve technical design documents (design.md)
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
Implementation lifecycle — plan tasks, pick work, implement code, verify, complete, and sync with GitHub
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-next |
| description | Context-aware guidance — analyzes git state, active tasks, and session history to recommend the best next action |
| license | MIT |
| metadata | {"afx-owner":"@rix","afx-status":"Living","afx-tags":"workflow,context,guidance,golden-thread","modeSlugs":["focus-next","architect"]} |
The "Golden Thread" command. intelligently analyzes your current context (git state, active tasks, session history) and tells you exactly what to do next.
Read config using two-tier resolution: .afx/.afx.yaml (managed defaults) + .afx.yaml (user overrides).
paths.specs - Where spec files live (default: docs/specs)paths.adr - Where global ADR files live (default: docs/adr)If neither file exists, use defaults.
/afx-next
Use these terms consistently across AFX skills, docs, chat actions, and UI surfaces:
spec.md, design.md, tasks.md, or sprint sections).journal.md / tasks.md history.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 and work sessions.If implementation is requested, respond with:
Out of scope for /afx-next (read-only advisor mode). Use the suggested command to proceed.
When writing execution reports or creating journal entries, 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).
Since this is a read-only advisor skill, no files are modified. However, after executing, you MUST:
When this skill detects a high-impact context switch or critical gap, auto-capture to journal.md per the Proactive Capture Protocol.
Triggers for /afx-next: Major context loss detected, multiple incomplete tasks found.
ide_opened_file or ide_selection tags in conversation).docs/specs/user-auth/tasks.md → user-auth, or docs/specs/user-auth/user-auth.md → user-auth for sprint-format). If code is selected, use it as additional input context for the analysis.feat/user-auth → user-auth), then conversation history./afx-next is valid without a feature scope.<feature>.md present with type: SPRINT) or standard 4-file format (spec.md, design.md, tasks.md). Sprint-format features route suggestions through /afx-sprint subcommands; 4-file features use /afx-spec, /afx-design, /afx-task. A feature with neither is untouched — suggest /afx-scaffold spec or /afx-sprint new.[...context]): Treat extra words as focus constraints (e.g., /afx-next user-auth scopes the analysis to that feature only).You must perform a deep context scan to determine the user's state. Follow this priority logic:
Check Plan Mode / Gates:
<system-reminder>Plan mode is active</system-reminder> present?
/afx-task complete <task> "note" (if you are the reviewer) or "Wait for human review."Check Global ADRs (ls docs/adr/*.md):
status: Proposed?
Check Git State (git status --short):
/afx-check path <path> (Verify it works)/afx-task code (Completing the subtask)/afx-session note "findings" (Capture thought)Check Active Task (/afx-next logic):
journal.md or GitHub?
/afx-task code (Start/Resume implementation)Check recent completion:
/afx-task verify <task-id> (Verify against spec)Check Idle State:
/afx-task pick <spec> if an approved feature has pending tasks/afx-sprint new <feature> for a small new feature, bug fix, or change/afx-spec create <feature> for formal or cross-cutting new workCheck Post-Ship Evolution:
/afx-sprint new <feature> for small work or /afx-spec create <feature> for formal work/afx-dev debug <symptom> to reproduce first, then refine docs only if expected behavior or design changesspec.md / design.mdFallbacks:
/afx-help guides (Browse workflows) or /afx-next (Re-orient)## Context: {Brief State Description}
**Detected**: {Uncommitted changes | Active Task X.Y | Idle | Review Pending}
Next (ranked):
1. /afx-command <args> # Context-driven: {why this is best}
2. /afx-alt1 # Context-driven: {reason}
3. /afx-alt2 # Context-driven: {reason}
──
4. /afx-next # Re-orient
5. /afx-session note "<note>" # Capture context
Keep the output host-agnostic: emit the ranked prose only. Do not emit host-specific JSON or marker blocks; UI hosts may convert the ranked prose into clickable actions.
Scenario 1: Mid-Implementation (User has modified files but hasn't run checks)
## Context: Implementation in Progress
**Detected**: 3 uncommitted files (modified), Task 7.4 Active
Next (ranked):
1. /afx-check path apps/webapp/claims # Context-driven: Verify uncommitted changes
2. /afx-task code "continue" # Context-driven: Continue writing code
3. /afx-dev test claims # Context-driven: Run tests before commit
──
4. /afx-next # Re-orient
5. /afx-session note "context" # Capture before switching
Scenario 2: Task Done (User just finished coding, git is clean/committed)
## Context: Implementation Complete?
**Detected**: Git Clean, Task 7.4 marked "Done" in last session log.
Next (ranked):
1. /afx-task verify 7.4 # Context-driven: Validate against spec
2. /afx-task complete 7.4 "done" # Context-driven: Mark task complete
3. /afx-task pick docs/specs/{feature} # Context-driven: Move to next task
──
4. /afx-next # Re-orient
5. /afx-session note "<note>" # Capture learnings
Scenario 3: Proposed ADRs (User created an ADR but hasn't finalized it)
## Context: Architectural Decision Pending
**Detected**: 1 Proposed ADR (docs/adr/ADR-0001-database-choice.md)
Next (ranked):
1. Review docs/adr/ADR-0001-database-choice.md # Context-driven: ADR needs review
2. /afx-research explore "database choice" # Context-driven: Research before deciding
3. /afx-session note "ADR review" # Context-driven: Capture review notes
──
4. /afx-next # Re-orient
5. /afx-help # See all options
Scenario 4: Idle (No active task)
## Context: Ready for Work
**Detected**: No active tasks found.
Next (ranked):
1. /afx-task pick <feature> # Context-driven: Pick next pending task
2. /afx-scaffold spec <name> # Context-driven: Start something new
3. /afx-discover capabilities # Context-driven: Explore project state
──
4. /afx-next # Check full project state
5. /afx-session recap all # Refresh memory from past sessions