用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/kofj/rdd --skill rdd-state命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | rdd-state |
| description | RDD state machine reference for tracking user progress and context-aware guidance |
| disable-model-invocation | true |
State machine for tracking user progress and providing context-aware guidance.
The rdd-state skill manages the state machine that tracks user progress through the RDD workflow. It provides context-aware next-step prompts after each command.
Triggers:
| State | Description | Entry Criteria |
|---|---|---|
init | Project just initialized | After /rdd-init or /rdd-migrate |
planning | Roadmap being defined | After init, before first stage |
developing | Active stage execution | Stage started, tests not passed |
reviewing | Code review in progress | Tests passed, review pending |
complete | Stage completed | Gate 5 passed |
init ──────► planning ──────► developing ──────► reviewing ──────► complete
│ │ │ │ │
│ │ │ │ │
└──────────────┴────────────────┴──────────────────┴───────────────┘
(can return to earlier states on failure)
| From | To | Trigger |
|---|---|---|
init | planning | Roadmap created |
planning | developing | Stage started |
developing | reviewing | Tests passed |
reviewing | complete | Review passed |
reviewing | developing | Review failed |
complete | planning | Next stage started |
State is stored in .rdd/state.yml:
current_state: developing
previous_state: planning
last_command: /rdd-stage-auto
last_updated: 2026-03-13T10:30:00Z
current_stage: 19
current_gate: 3
history:
- state: init
timestamp: 2026-03-13T09:00:00Z
command: /rdd-init
- state: planning
timestamp: 2026-03-13T09:15:00Z
command: /rdd-roadmap
- state: developing
timestamp: 2026-03-13T10:00:00Z
command: /rdd-stage-auto
next_steps:
- "Run tests to verify implementation"
- "Write additional tests if coverage < 95%"
- "Proceed to Gate 4 when tests pass"
After each command, generate context-aware next steps:
def get_next_steps(state, last_command):
rules = {
("init", "/rdd-init"): [
"Run 'task doctor' to verify setup",
"Edit docs/01-charter.md with your project vision",
"Create roadmap with '/rdd-roadmap add'"
],
("planning", "/rdd-roadmap"): [
"Start first stage with '/rdd-stage-auto 0'",
"Review stage document before starting"
],
("developing", "/rdd-stage-auto"): [
"Run tests to verify implementation",
"Check coverage with 'task test:coverage'",
"Proceed to Gate 4 when tests pass"
],
("reviewing", None): [
"Review code changes",
"Address any findings",
"Run '/rdd-stage-auto --resume' to continue"
],
("complete", "/rdd-stage-auto"): [
"Start next stage with '/rdd-stage-auto'",
"Update roadmap with '/rdd-roadmap complete'",
"Generate handoff with '/rdd-knowledge handoff'"
]
}
return rules.get((state, last_command), ["Check '/rdd-help' for guidance"])
After each command, display:
📍 Current State: <state>
📍 Current Stage: <stage> | Gate: <gate>
✅ Completed: <last_command>
⏭️ Next Steps:
1. <next_step_1>
2. <next_step_2>
3. <next_step_3>
💡 Tip: <contextual_tip>
After /rdd-init:
📍 Current State: init
📍 Current Stage: - | Gate: -
✅ Completed: /rdd-init my-project
⏭️ Next Steps:
1. Run 'task doctor' to verify setup
2. Edit docs/01-charter.md with your project vision
3. Create roadmap with '/rdd-roadmap add --title "First Stage"'
💡 Tip: A clear charter helps agents understand your project goals.
def detect_transition(command, result):
if command == "/rdd-init":
return "init"
elif command == "/rdd-roadmap" and result.has_roadmap:
return "planning"
elif command == "/rdd-stage-auto" and result.stage_started:
return "developing"
elif result.tests_passed:
return "reviewing"
elif result.gate_5_passed:
return "complete"
/rdd-state set <state> # Force state transition
/rdd-state reset # Reset to init
Each RDD command should call state update:
# After command execution
rdd-state update --command "/rdd-init" --result "success"
State is included in handoff documents:
# Handoff includes:
current_state: developing
current_stage: 19
current_gate: 3
next_steps: [...]
rdd-state get
# Output: developing
rdd-state next-steps
# Output:
# 1. Run tests to verify implementation
# 2. Check coverage with 'task test:coverage'
# 3. Proceed to Gate 4 when tests pass
rdd-state update --command "/rdd-stage-auto" --result "success"
rdd-state reset
# Resets to init state
tests/unit/state/test_state_machine.bats
tests/unit/state/test_transitions.bats
tests/unit/state/test_next_steps.bats
tests/e2e/test_state_tracking.bats
tests/e2e/test_next_step_prompts.bats
For more information:
rdd-workflow skill - Uses state for workflow stepsrdd-knowledge skill - Includes state in handoffCLAUDE.md - State documentation