AgentSkillsCN

plan

审查内存银行状态并创建/更新实施计划

SKILL.md
--- frontmatter
name: plan
description: Review memory bank state and create/update an implementation plan

Plan

Review the current state from the memory bank and create/update an implementation plan.

Usage

/plan # Full plan creation/update /plan next # Focus on immediate next steps only /plan status # Show plan progress (read-only)

Argument provided: "$ARGUMENTS"


Step 0: Parse Arguments

Parse $ARGUMENTS to determine mode:

  • Empty or full → Full plan mode
  • next → Next steps mode
  • status → Status mode (read-only)

Step 1: Read Current State

Read all memory bank files:

  1. .claude/memorybank/overview.md - Project identity, architecture, work areas
  2. .claude/memorybank/progress.md - What's been completed, decisions made
  3. .claude/memorybank/session.md - Current focus, recent work, blockers

Also check: 4. logs/log_index.yaml - Active session status 5. Current git status - Uncommitted work


Step 2: Analyze State

Identify from progress.md:

  • Completed milestones
  • Decisions that constrain future work
  • Patterns discovered
  • Previous blockers (resolved or ongoing)

Identify from session.md:

  • Current focus area
  • In-progress work
  • Stated next steps (may be outdated)
  • Active blockers

Identify from overview.md:

  • Work areas and their status (active/paused/complete)
  • Project constraints
  • Evaluation criteria (definition of done)

Mode: Status (/plan status)

Read-only - Does not modify any files.

Output Format

code
## Plan Status

### Current Focus
[From session.md]

### Progress Summary

| Work Area | Status | Progress | Notes |
|-----------|--------|----------|-------|
| [area] | active | [░░░░░░░░░░] 0% | [brief note] |
| [area] | active | [████░░░░░░] 40% | [brief note] |
| [area] | paused | [██████░░░░] 60% | [reason paused] |
| [area] | complete | [██████████] 100% | ✓ Done |

### Active Tasks
From session.md "Next Steps":
- [ ] Task 1
- [x] Task 2 (completed)
- [ ] Task 3

### Blockers
[Any blockers from session.md or progress.md]

### Time Investment
[From logs/ if available: total duration, current session]

After status output: Suggest /plan to update or /plan next for quick planning.


Mode: Next Steps (/plan next)

Lightweight planning focused on immediate actions.

Process

  1. Read session.md for current context
  2. Identify 3-5 immediate next actions
  3. Update session.md "Next Steps" section only
  4. Optionally populate TodoWrite

Output Format

code
## Next Steps

Based on current progress, here are the immediate next actions:

### Immediate (do now)
1. **[Task]** - [why it's next]
2. **[Task]** - [why it's next]

### After That
3. **[Task]** - [dependency or sequence reason]
4. **[Task]** - [dependency or sequence reason]

### Blocked (needs resolution)
- **[Task]** - blocked by: [blocker]

---
Updated session.md with next steps.

TodoWrite Integration

After presenting next steps, populate TodoWrite:

code
Use TodoWrite to track:
- Task 1 (status: pending)
- Task 2 (status: pending)
- Task 3 (status: pending)

Mode: Full Plan (/plan)

Comprehensive planning with phases and dependencies.

Process

  1. Read all memory bank files
  2. Analyze what's complete vs remaining
  3. Identify dependencies between tasks
  4. Create phased plan with milestones
  5. Update session.md with plan summary
  6. Populate TodoWrite with immediate tasks

Handling Existing Plans

If session.md already has a plan:

  1. Compare planned vs actual progress
  2. Note deviations and reasons
  3. Ask: "Update existing plan or create fresh plan?"
  4. If updating: preserve completed items, adjust remaining

Full Plan Output Format

code
## Implementation Plan

**Project**: [from overview.md]
**Focus Area**: [current focus]
**Generated**: [timestamp]

---

### Progress Snapshot

**Completed**: [X] items across [Y] work areas
**In Progress**: [Z] items
**Remaining**: [N] items estimated

---

### Phase 1: [Phase Name]
*Goal: [What this phase achieves]*

| # | Task | Depends On | Complexity | Status |
|---|------|------------|------------|--------|
| 1.1 | [Task description] | - | Low | ○ pending |
| 1.2 | [Task description] | 1.1 | Medium | ○ pending |
| 1.3 | [Task description] | 1.1, 1.2 | High | ○ pending |

**Phase Milestone**: [What's true when phase is complete]

---

### Phase 2: [Phase Name]
*Goal: [What this phase achieves]*

| # | Task | Depends On | Complexity | Status |
|---|------|------------|------------|--------|
| 2.1 | [Task description] | Phase 1 | Medium | ○ pending |
| 2.2 | [Task description] | 2.1 | Low | ○ pending |

**Phase Milestone**: [What's true when phase is complete]

---

### Phase 3: [Phase Name] (if needed)
...

---

### Dependencies Graph

Phase 1: [1.1] ─► [1.2] ─► [1.3] │ ▼ Phase 2: [2.1] ─► [2.2]

code

---

### Risk & Blockers

| Risk/Blocker | Impact | Mitigation |
|--------------|--------|------------|
| [Identified risk] | [High/Med/Low] | [How to address] |

---

### Immediate Next Steps

1. **[First task]** - [brief rationale]
2. **[Second task]** - [brief rationale]
3. **[Third task]** - [brief rationale]

---

### Success Criteria

From overview.md "Evaluation Criteria":
- [ ] [Criterion 1]
- [ ] [Criterion 2]
- [ ] [Criterion 3]

Status Indicators

Use consistent indicators across the plan:

IndicatorMeaning
Pending (not started)
In progress
Complete
Blocked
Deferred

Progress bars (10 chars):

  • [░░░░░░░░░░] 0%
  • [██░░░░░░░░] 20%
  • [████░░░░░░] 40%
  • [██████░░░░] 60%
  • [████████░░] 80%
  • [██████████] 100%

Complexity Indicators

LevelMeaningTypical Scope
LowStraightforwardSingle file, clear implementation
MediumSome complexityMultiple files, some decisions
HighSignificant effortCross-cutting, architectural impact

TodoWrite Integration

After creating/updating a plan, sync with TodoWrite:

For Full Plan

Populate TodoWrite with Phase 1 tasks:

code
todos:
  - content: "[Task 1.1]"
    status: pending
    activeForm: "[Task 1.1 -ing form]"
  - content: "[Task 1.2]"
    status: pending
    activeForm: "[Task 1.2 -ing form]"

For Next Steps

Populate TodoWrite with immediate tasks only.

Sync Rules

  • Only add pending tasks (not completed)
  • Don't duplicate existing todos
  • Clear stale todos that are no longer in plan

Memory Bank Updates

Always Update session.md

Update the "Next Steps" section:

markdown
## Next Steps
- [ ] [Task from plan]
- [ ] [Task from plan]
- [ ] [Task from plan]

## Current Plan
[Brief plan summary or link to full plan]

---
*Plan updated: [timestamp]*

Update progress.md If Plan Changed Significantly

Add entry under current session:

markdown
### Planning
- Revised implementation plan
- [Key change 1]
- [Key change 2]

Skill Chaining

After planning, suggest next actions:

SituationSuggestion
No active work session"Run /logwork start to begin tracking time"
Blockers identified"Consider /clarify [blocker] to resolve"
Plan complete, ready to work"Ready to implement. Start with [first task]"
Significant replanning"Run /document to record planning decisions"

Examples

Example 1: Fresh Project

code
User: /plan

Claude:
1. Reads memory bank (just initialized)
2. Finds: overview.md has work areas, but no progress yet
3. Creates Phase 1 plan based on work areas
4. Outputs full plan with all tasks as pending
5. Updates session.md with next steps
6. Populates TodoWrite
7. Suggests: "Run /logwork start to begin"

Example 2: Mid-Project

code
User: /plan

Claude:
1. Reads memory bank
2. Finds: 40% complete, current focus on "auth module"
3. Compares to previous plan in session.md
4. Notes: "Task 1.2 took longer than expected"
5. Adjusts remaining estimates
6. Outputs updated plan with progress
7. Suggests: "Continue with [next task]"

Example 3: Quick Check

code
User: /plan status

Claude:
1. Reads memory bank (read-only)
2. Calculates progress percentages
3. Shows status table
4. Lists active tasks and blockers
5. Does NOT modify any files
6. Suggests: "/plan to update" or "/plan next for quick planning"

Error Handling

No Memory Bank

If .claude/memorybank/ doesn't exist:

code
## Planning Error

Memory bank not found at `.claude/memorybank/`.

Run `/onboard-claude` to initialize the memory bank first.

Partial Memory Bank

If some files are missing:

code
## Incomplete Memory Bank

Some memory bank files are missing:
- [x] overview.md - Found
- [ ] progress.md - Missing
- [x] session.md - Found

Cannot create comprehensive plan without complete memory bank.

Run `/onboard-claude` to reinitialize if needed.

Checklist

  • Checked for memory bank existence
  • Parsed arguments to determine mode
  • Read all memory bank files
  • Analyzed completed vs remaining work
  • Identified dependencies between tasks
  • Created/updated plan with phases (if full mode)
  • Used consistent status indicators
  • Updated session.md with next steps
  • Populated TodoWrite with immediate tasks
  • Suggested appropriate next skill