AgentSkillsCN

arc-planning

当您需要分解规格说明、当存在规格文件或`spec.xml`时,或当您正在规划史诗与功能的结构时,可使用此功能。

SKILL.md
--- frontmatter
name: arc-planning
description: Use when breaking down specifications, when specs/spec.xml exists, or when planning epic and feature structure

Planner

Overview

Convert specs into executable DAG with epic/feature breakdown. Maintain strict 1:1 mapping for traceability.

Trigger

Implicit approval: specs/spec.xml exists → enter Planner.

If specs/spec.xml is missing or specs/details/ is empty, STOP and route back to /arc-refining.

Decision Flow (When to Use)

dot
digraph when_to_use {
    "specs/spec.xml exists?" [shape=diamond];
    "specs/details/ non-empty?" [shape=diamond];
    "Use arc-planning" [shape=box];
    "Use arc-refining" [shape=box];

    "specs/spec.xml exists?" -> "specs/details/ non-empty?" [label="yes"];
    "specs/spec.xml exists?" -> "Use arc-refining" [label="no"];
    "specs/details/ non-empty?" -> "Use arc-planning" [label="yes"];
    "specs/details/ non-empty?" -> "Use arc-refining" [label="no"];
}

Mapping Rules

Spec LevelPlanner LevelRatio
<detail>Epic1:1 (large detail can split)
<requirement>Feature1:1 strict
<dependency ref>depends_onAuto-derive

Output Structure

code
dag.yaml                    # Epic/Feature DAG
epics/
├── epic-auth/
│   ├── epic.md             # Epic overview (context, goals, features list)
│   └── features/
│       ├── auth-login.md
│       └── auth-register.md
└── epic-api/
    └── ...

feature.md minimal example:

markdown
# Feature: auth-login

## Source
- Requirement: FR-AUTH-001
- Detail: authentication.xml

## Dependencies
- auth-schema (must complete first)

## Acceptance Criteria
- [ ] POST /login accepts {email, password}
- [ ] Returns 200 + JWT on valid credentials
- [ ] Returns 401 on invalid credentials

dag.yaml structure:

To view the full schema and example, run:

bash
# View schema with field descriptions
node "${SKILL_ROOT}/scripts/planner.js" schema

# View complete example
node "${SKILL_ROOT}/scripts/planner.js" schema --example

# View as JSON (for programmatic use)
node "${SKILL_ROOT}/scripts/planner.js" schema --json

Example dag.yaml:

yaml
epics:
  - id: "epic-auth"
    name: "Authentication System"
    status: "in_progress"
    spec_path: "epics/epic-auth/epic.md"
    worktree: null
    depends_on: []
    features:
      - id: "auth-login"
        name: "User Login"
        status: "completed"
        source_requirement: "FR-AUTH-001"
        depends_on: []
      - id: "auth-logout"
        name: "User Logout"
        status: "pending"
        depends_on: ["auth-login"]

Self-Validation

Before finalizing:

  • Every detail maps to ≥1 epic
  • Every requirement maps to exactly 1 feature
  • No circular dependencies (fail if found)
  • All depends_on references exist
  • All source_requirement references valid

Commit Requirements

Before handoff:

code
git add dag.yaml epics/
git commit -m "docs: plan epics and features for <topic>"

Circular dependency = STOP, ask user.

Completion Format

✅ Planner complete

  • Epics: 3
  • Features: 12
  • DAG validated: no cycles
  • Ready for: arc-coordinating or arc-implementing

Blocked Format

⚠️ Planner blocked

  • Issue: Circular dependency detected
  • Cycle: FR-AUTH-002 ↔ FR-API-007
  • Action: User must clarify which dependency is optional

Red Flags - STOP

  • "I'll break the cycle arbitrarily"
  • "Let implementer figure it out"
  • "Close enough mapping"

Cycles must be resolved by user, not guessed.