スキル一覧に戻る
cuioss

phase-3-plan

by cuioss

An orchestration layer for AI coding assistants (currently Claude Code) that enforces consistency, reliability, and more predictable outputs.

0🍴 0📅 2026年1月17日
GitHubで見るManusで実行

SKILL.md


name: phase-3-plan description: Domain-agnostic task planning from deliverables with skill resolution and optimization allowed-tools: Read, Bash

Phase Refine Plan Skill

Role: Domain-agnostic workflow skill for transforming solution outline deliverables into optimized, executable tasks. Loaded by pm-workflow:task-plan-agent.

Key Pattern: Reads deliverables with metadata and profiles list from solution_outline.md, creates one task per profile (1:N mapping), resolves skills from architecture based on module + profile, applies aggregation/split analysis, creates tasks with explicit skill lists.

Contract Compliance

MANDATORY: All tasks MUST follow the structure defined in the central contracts:

ContractLocationPurpose
Task Contractpm-workflow:manage-tasks/standards/task-contract.mdRequired task structure and optimization workflow

CRITICAL - Steps Field:

  • The steps field MUST contain file paths from the deliverable's Affected files section
  • Steps must NOT be descriptive text (e.g., "Update AuthController.java" is INVALID)
  • Validation rejects tasks with non-file-path steps

Input

ParameterTypeRequiredDescription
plan_idstringYesPlan identifier

Output

status: success | error
plan_id: {echo}
optimization_summary:
  deliverables_processed: N
  tasks_created: M
  aggregations: N
  splits: N
  parallelizable_groups: N
tasks_created[M]: {number, title, deliverables, depends_on}
execution_order: {parallel groups}
message: {error message if status=error}

Workflow

Step 1: Load All Deliverables

Read the solution document to get all deliverables with metadata:

python3 .plan/execute-script.py pm-workflow:manage-solution-outline:manage-solution-outline \
  list-deliverables \
  --plan-id {plan_id}

For each deliverable, extract:

  • metadata.change_type, metadata.execution_mode
  • metadata.domain (single value)
  • metadata.module (module name from architecture)
  • metadata.depends
  • profiles (list: implementation, testing)
  • affected_files
  • verification

Step 2: Build Dependency Graph

Parse depends field for each deliverable:

  • Identify independent deliverables (depends: none)
  • Identify dependency chains
  • Detect cycles (INVALID - reject with error)

Step 3: Analyze for Aggregation

For each pair of deliverables, check if they can be aggregated:

  • Same change_type?
  • Same domain?
  • Same profiles list?
  • Same execution_mode (must be automated)?
  • Combined file count < 10?
  • NO dependency between them? (CRITICAL - cannot aggregate if one depends on the other)

Step 4: Analyze for Splits

For each deliverable, check for split requirements:

  • execution_mode: mixed → MUST split
  • File count > 15 → CONSIDER splitting

Note: Multiple profiles in **Profiles:** block naturally create multiple tasks (1:N) - no additional splitting needed for profile differences.

Step 5: Create Tasks from Profiles (1:N Mapping)

For each deliverable, create one task per profile in its profiles list:

For each deliverable D:
  1. Query architecture: module --name {D.module}
  For each profile P in D.profiles:
    2. Extract skills: module.skills_by_profile.{P}
    3. Create task with profile P and resolved skills
    4. If P = testing, add depends on implementation task

Query architecture:

python3 .plan/execute-script.py plan-marshall:analyze-project-architecture:architecture \
  module --name {deliverable.module} \
  --trace-plan-id {plan_id}

1:N Task Creation Flow:

solution_outline.md                        TASK-*.toon (created by task-plan)
┌────────────────────────────┐             ┌────────────────────────────┐
│ **Metadata:**              │             │ TASK-001-IMPL              │
│ - domain: java             │             │ profile: implementation    │
│ - module: auth-service     │  ───────►   │ skills: [java-core,        │
│                            │  (1:N)      │          java-cdi]         │
│ **Profiles:**              │             ├────────────────────────────┤
│ - implementation           │  ───────►   │ TASK-002-TEST              │
│ - module_testing           │             │ profile: module_testing    │
│                            │             │ skills: [java-core,        │
└────────────────────────────┘             │          junit-core]       │
                                           │ depends: TASK-001-IMPL     │
                                           └────────────────────────────┘

Log skill resolution (for each task created):

python3 .plan/execute-script.py plan-marshall:manage-logging:manage-log \
  work {plan_id} INFO "[SKILL] (pm-workflow:phase-3-plan) Resolved skills for TASK-{N} from {module}.{profile}: [{task.skills}]"

Aggregation Rule: When aggregating multiple deliverables, they must have same profiles list. Merge resolved skills arrays (union) per profile.

Step 6: Create Optimized Tasks

For aggregated deliverables or single deliverables, create tasks using heredoc:

python3 .plan/execute-script.py pm-workflow:manage-tasks:manage-tasks add \
  --plan-id {plan_id} <<'EOF'
title: {aggregated title}
deliverables: [{n1}, {n2}, {n3}]
domain: {domain from deliverable}
profile: {profile from deliverable}
phase: execute
description: |
  {combined description}

steps:
  - {file1}
  - {file2}
  - {file3}

depends_on: TASK-1, TASK-2

skills:
  - {skill1 from architecture}
  - {skill2 from architecture}

verification:
  commands:
    - {cmd1}
  criteria: {criteria}
EOF

MANDATORY - Log each task creation:

python3 .plan/execute-script.py plan-marshall:manage-logging:manage-log \
  work {plan_id} INFO "[ARTIFACT] (pm-workflow:phase-3-plan) Created TASK-{N}: {title}"

Key Fields:

  • domain: Single domain from deliverable
  • profile: implementation or testing (determines workflow skill at execution)
  • skills: Domain skills only (system skills loaded by agent)
  • steps: File paths from Affected files (NOT descriptive text)

Step 7: Determine Execution Order

Compute parallel execution groups:

execution_order:
  parallel_group_1: [TASK-1, TASK-3]    # No dependencies
  parallel_group_2: [TASK-2, TASK-4]    # Both depend on group 1
  parallel_group_3: [TASK-5]            # Depends on group 2

Parallelism rules:

  • Tasks with no depends_on go in first group
  • Tasks depending on same prior tasks can run in parallel
  • Sequential dependencies remain sequential

Step 8: Record Issues as Lessons

On ambiguous deliverable or planning issues:

python3 .plan/execute-script.py plan-marshall:manage-lessons:manage-lesson add \
  --component-type skill \
  --component-name task-plan \
  --category observation \
  --title "{issue summary}" \
  --detail "{context and resolution approach}" \
  --trace-plan-id {plan_id}

Step 9: Return Results

Output:

status: success
plan_id: {plan_id}

optimization_summary:
  deliverables_processed: {N}
  tasks_created: {M}
  aggregations: {count of deliverable groups}
  splits: {count of split deliverables}
  parallelizable_groups: {count of independent task groups}

tasks_created[M]{number,title,deliverables,depends_on}:
1,Implement UserService,[1],none
2,Implement UserRepository,[2],none
3,Add integration tests,[3],"TASK-1" "TASK-2"

execution_order:
  parallel_group_1: [TASK-1, TASK-2]
  parallel_group_2: [TASK-3]

lessons_recorded: {count}

Optimization Decision Table

FactorAggregateSplitKeep
Same change_typeYes
Same domainYes
Same profiles listYes
Combined files < 10Yes
Same execution_modeYes
Both depends: noneYes
One depends on otherNever
execution_mode: mixedYes
File count > 15Consider
Large but coherentYes
Single fileYes

Note: Multiple profiles in one deliverable naturally create multiple tasks (1:N). This is not a "split" - it's the standard task creation pattern.

Dependency Rules for Aggregation

D1.dependsD2.dependsCan Aggregate?Reason
nonenoneYesBoth independent
noneD1NoD2 depends on D1
D3D3YesSame dependency, can run together
D3D4YesDifferent deps, no conflict
D2D1NoCreates cycle if aggregated

Skill Resolution Guidelines

Skills are resolved from architecture based on module + profile:

ScenarioBehavior
Single deliverable, single profileQuery architecture.module --name {module}, extract skills_by_profile.{profile}
Single deliverable, multiple profilesCreate one task per profile, each with its own resolved skills
Multiple deliverables (aggregation)Union of resolved skills from all source modules (per profile)
Module not in architectureError - module must exist in project architecture
Profile not in moduleError - profile must exist in module.skills_by_profile

Error Handling

Circular Dependencies

If deliverable dependencies form a cycle:

  • Error: "Circular dependency detected: D1 -> D2 -> D1"
  • Do NOT create tasks

Module Not in Architecture

If deliverable.module is not found in architecture:

  • Error: "Module '{module}' not found in architecture - run architecture discovery"
  • Record as lesson learned

Profile Not in Module

If a profile from deliverable.profiles is not in module.skills_by_profile:

  • Error: "Profile '{profile}' not found in {module}.skills_by_profile"
  • Record as lesson learned

Ambiguous Deliverable

If deliverable metadata incomplete:

  • Generate task with defaults
  • Add lesson-learned for future reference
  • Note ambiguity in task description

Integration

Invoked by: pm-workflow:task-plan-agent (thin agent)

Script Notations (use EXACTLY as shown):

  • pm-workflow:manage-solution-outline:manage-solution-outline - Read deliverables (list-deliverables, read)
  • plan-marshall:analyze-project-architecture:architecture - Resolve skills (module --name {module})
  • pm-workflow:manage-tasks:manage-tasks - Create tasks (add --plan-id X <<'EOF' ... EOF)
  • plan-marshall:manage-lessons:manage-lesson - Record lessons on issues (add)

Consumed By:

  • pm-workflow:task-execute-agent - Reads tasks and executes them

スコア

総合スコア

70/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

+10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です