
plan-authoring-cycle
by Rwb3n
SKILL.md
name: plan-authoring-cycle description: HAIOS Plan Authoring Cycle for structured plan population. Use when filling in implementation plan sections. Guides AMBIGUITY->ANALYZE->AUTHOR->VALIDATE workflow. recipes:
- plan generated: 2025-12-25 last_updated: '2026-01-19T17:31:15'
Plan Authoring Cycle
This skill defines the AMBIGUITY-ANALYZE-AUTHOR-VALIDATE cycle for populating implementation plan sections after scaffolding. It ensures operator decisions are surfaced before plan authoring, and that plans have complete Goal, Design, and Tests sections before entering the DO phase.
When to Use
Manual invocation: Skill(skill="plan-authoring-cycle") when a plan has placeholder content.
Called from: implementation-cycle PLAN phase when plan needs population.
The Cycle
AMBIGUITY --> ANALYZE --> AUTHOR --> VALIDATE --> CHAIN
| |
| plan-validation-cycle
+-- BLOCK if unresolved operator decisions
0. AMBIGUITY Phase (Gate 3)
Goal: Surface and resolve operator decisions BEFORE plan authoring begins.
INV-058: This is Gate 3 of the Ambiguity Gating defense-in-depth strategy.
- Gate 1 (E2-272):
operator_decisionsfield in work_item.md template- Gate 2 (E2-273): "Open Decisions" section in implementation_plan.md template
- Gate 3 (E2-274): AMBIGUITY phase in plan-authoring-cycle (this phase)
- Gate 4 (E2-275): Decision check in plan-validation-cycle
Actions:
- Read the work item:
docs/work/active/{backlog_id}/WORK.md - Parse frontmatter for
operator_decisionsfield:# Structure of operator_decisions field: operator_decisions: - question: "Implement modules or remove references?" options: ["implement", "remove"] resolved: false # MUST be true before proceeding chosen: null # Filled when operator decides - Check for unresolved decisions (
resolved: falseor missingchosen): - IF any unresolved decisions exist:
- BLOCK with message: "Unresolved operator decisions in work item."
- Present
AskUserQuestionwith options from the work item:AskUserQuestion(questions=[{ "question": "<question from operator_decisions>", "header": "Decision", "options": [{"label": opt, "description": ""} for opt in options], "multiSelect": false }]) - Wait for operator response
- Update work item WORK.md with
resolved: trueandchosen: <value>
- IF all decisions resolved (or
operator_decisionsis empty/missing):- Proceed to ANALYZE phase
- If any resolved decisions exist, populate "Open Decisions" section in plan:
- Copy resolved decisions from work item to plan's "Open Decisions" table
- Format:
| {question} | [{options}] | {chosen} | {rationale from operator} |
Exit Criteria:
- Work item WORK.md read
-
operator_decisionsfield checked - All decisions resolved (or none exist)
- Open Decisions section populated in plan (if any decisions existed)
Tools: Read, AskUserQuestion, Edit
1. ANALYZE Phase
Goal: Read plan and identify sections needing population.
Actions:
- Read the plan file:
docs/work/active/{backlog_id}/plans/PLAN.md(or legacydocs/plans/PLAN-{backlog_id}-*.md) - Check each section for placeholder text:
- Goal:
[One sentence: ...] - Effort Estimation:
[N]placeholders - Current/Desired State:
[What the system...] - Tests First:
test_[descriptive_name] - Detailed Design:
[path/to/file.py]
- Goal:
- Create checklist of sections to populate
Exit Criteria:
- Plan file read
- Empty sections identified
- Checklist created
Tools: Read
2. AUTHOR Phase
Goal: Systematically populate each section with real content.
Guardrails (MUST follow):
- MUST read all source specifications - Parse References section, read each linked doc
- Goal section MUST be one sentence - Clear, measurable outcome
- Effort Estimation MUST reference real files - Glob for file counts, wc for lines
- Current/Desired State MUST show actual code - Read files, copy snippets
- Tests MUST be written before design - TDD mindset
- Detailed Design MUST match source spec interface - Verify against spec, not assumptions
MUST Gate: Read Source Specifications (E2-254 Learning) Before writing ANY design content:
- Parse the plan's
## Referencessection - MUST read each referenced specification document
- Extract interface definitions, required functions, data structures from spec
- Detailed Design MUST implement the spec's interface, not a different one
- If spec doesn't exist or is unclear, create investigation first
Anti-pattern prevented: "Assume over verify (L1)" - designing from assumptions without reading the actual specification leads to implementations that don't match requirements.
MUST Gate: Read Sibling Module Patterns (E2-255 Learning) When designing a module that imports from sibling modules:
- Identify which sibling modules the new code will import from
- MUST read at least one sibling module to verify:
- Import pattern (relative vs absolute vs try/except conditional)
- Error handling patterns (exception types, logging)
- Path manipulation patterns (sys.path, Path usage)
- Detailed Design MUST use the same patterns as existing siblings
Example: If designing cycle_runner.py that imports from governance_layer.py:
# Check work_engine.py lines 45-50 for import pattern:
try:
from .governance_layer import GovernanceLayer
except ImportError:
from governance_layer import GovernanceLayer
Anti-pattern prevented: "Assume over verify (L2)" - designing implementation patterns from assumptions without reading existing sibling code leads to import failures and inconsistent patterns.
Section Order:
- Goal - What capability will exist?
- Effort Estimation - Count files, estimate time
- Current State - What exists now?
- Desired State - What should exist? (MUST match spec interface)
- Tests First - What tests verify success?
- Detailed Design - How to implement? (MUST match spec)
- Key Design Decisions - Document WHY each choice was made (see guidance below)
- Implementation Steps - Ordered checklist
- Risks & Mitigations - What could go wrong? (see guidance below)
Actions:
- MUST: Read all referenced specifications first
- MUST: Query memory for prior patterns and learnings (see Memory Query below)
- For each empty section:
- Read relevant source files
- Write concrete content (not placeholders)
- Verify content aligns with source spec
- Populate Key Design Decisions table (see guidance below)
- Populate Risks & Mitigations table (see guidance below)
- Update plan status to
approvedwhen complete
MUST Gate: Query Memory for Prior Work Before designing, MUST query memory:
mcp__haios-memory__memory_search_with_experience(
query="patterns learnings {work_item_topic} {spec_name}",
mode="knowledge_lookup"
)
- Look for prior implementations of similar modules
- Look for learnings about the spec domain
- Look for anti-patterns to avoid
- Document what memory returned (even if nothing relevant)
Anti-pattern prevented: "Reinvent the wheel" - designing without checking if similar work exists leads to inconsistent patterns and repeated mistakes.
Key Design Decisions Guidance: For each significant choice in Detailed Design, document in the table:
| Decision | Choice | Rationale |
|---|---|---|
| [What decision was made] | [Which option was chosen] | [WHY - include tradeoffs considered] |
MUST document:
- Any deviation from spec (with explicit rationale)
- Alternative approaches considered and why rejected
- Tradeoffs accepted (e.g., "simpler but less flexible")
- Dependencies chosen and why
Risks & Mitigations Guidance: MUST identify at least these risk categories:
| Risk Category | Questions to Ask |
|---|---|
| Spec misalignment | "Could I be misinterpreting the spec?" |
| Integration | "What could break when this connects to other modules?" |
| Regression | "What existing functionality could this affect?" |
| Scope creep | "Am I adding things not in the spec?" |
| Knowledge gaps | "What don't I understand that could cause problems?" |
For each identified risk, document mitigation:
| Risk | Impact | Mitigation |
|---|---|---|
| [Specific risk] | [High/Med/Low] | [Concrete action to reduce risk] |
Exit Criteria:
- MUST: All referenced specifications read
- MUST: Memory queried for prior patterns (document results)
- MUST: Detailed Design matches spec interface (not assumptions)
- MUST: If importing from siblings, sibling module patterns verified (E2-255)
- MUST: Key Design Decisions table populated with rationale
- MUST: Risks & Mitigations table populated
- Goal is one clear sentence
- Effort Estimation has real numbers from file analysis
- Current/Desired State shows actual code
- Tests section has concrete test definitions
- Design section has implementation details
- Steps section has actionable checklist
Tools: Read, Glob, Grep, Edit, memory_search_with_experience
3. VALIDATE Phase
Goal: Verify plan is ready for implementation.
Actions:
- Re-read plan file
- Check no placeholder text remains (
[...]patterns) - Verify section completeness:
- Goal: >20 characters, no placeholders
- Effort: All metrics have values
- Design: Has file paths and code snippets
- Tests: Has at least one concrete test
- Update plan status:
approved
Exit Criteria:
- No placeholder text remains
- All required sections populated
- Plan status is
approved
Tools: Read, Edit
4. CHAIN Phase (Post-VALIDATE)
Goal: Checkpoint context then chain to plan-validation-cycle.
After VALIDATE phase completes (plan status is approved):
4a. Checkpoint (MUST - E2-287)
MUST invoke checkpoint-cycle to preserve context before context limit hit:
Skill(skill="checkpoint-cycle")
Rationale: Work complexity within hardened gating system makes context limits per work item likely. Checkpointing after plan authoring ensures continuity if context exhausts during validation or implementation.
4b. Chain to Validation
After checkpoint completes, MUST invoke plan-validation-cycle:
Skill(skill="plan-validation-cycle")
This provides independent validation before implementation-cycle can begin.
Exit Criteria:
- MUST: checkpoint-cycle invoked (E2-287)
- plan-validation-cycle invoked
- Plan passes validation gate
Tools: Skill (checkpoint-cycle, plan-validation-cycle)
Composition Map
| Phase | Primary Tool | Memory Integration |
|---|---|---|
| AMBIGUITY | Read, AskUserQuestion, Edit | - |
| ANALYZE | Read | - |
| AUTHOR | Read, Edit, Glob | Query for prior patterns |
| VALIDATE | Read, Edit | - |
| CHAIN | Skill (checkpoint-cycle, plan-validation-cycle) | Context preservation (E2-287) |
Quick Reference
| Phase | Question to Ask | If NO |
|---|---|---|
| AMBIGUITY | Is WORK.md read? | Read work item first |
| AMBIGUITY | Any unresolved operator_decisions? | BLOCK + AskUserQuestion |
| ANALYZE | Is plan read? | Read plan file |
| ANALYZE | Are empty sections identified? | Scan for placeholders |
| AUTHOR | Is Goal complete? | Write one-sentence goal |
| AUTHOR | Is Effort estimated? | Count files, estimate time |
| AUTHOR | Is Design complete? | Write implementation details |
| VALIDATE | Are all sections complete? | Return to AUTHOR |
| VALIDATE | Is status approved? | Update frontmatter |
Key Design Decisions
| Decision | Choice | Rationale |
|---|---|---|
| AMBIGUITY phase (E2-274) | Added as phase 0 before ANALYZE | Gate 3 of INV-058 defense-in-depth; prevents plan authoring on ambiguous work |
| Four phases | AMBIGUITY -> ANALYZE -> AUTHOR -> VALIDATE | AMBIGUITY catches decisions before plan effort begins |
| Optional skill | Not required by implementation-cycle | Some plans may come pre-filled |
| Section order | Goal -> Effort -> State -> Tests -> Design | Logical progression abstract to concrete |
| TDD before Design | Tests defined before implementation details | Enforces test-first thinking |
Related
- work-creation-cycle skill: Parallel workflow for work items
- close-work-cycle skill: Parallel workflow for closure
- implementation-cycle skill: Uses this skill during PLAN phase
- Implementation plan template:
.claude/templates/implementation_plan.md - /new-plan command: Creates plan files
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です