mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-06 16:31:12 +08:00
feat: Add coordinator commands and role specifications for UI design team
- Implemented the 'monitor' command for coordinator role to handle monitoring events, task completion, and pipeline management. - Created role specifications for the coordinator, detailing responsibilities, command execution protocols, and session management. - Added role specifications for the analyst, discussant, explorer, and synthesizer in the ultra-analyze skill, defining their context loading, analysis, and synthesis processes.
This commit is contained in:
@@ -384,7 +384,9 @@ AskUserQuestion({
|
||||
| +-- <hash>.md # Cached exploration results
|
||||
+-- wisdom/
|
||||
| +-- patterns.md # Discovered patterns and conventions
|
||||
| +-- shared-memory.json # Cross-role structured data
|
||||
+-- .msg/
|
||||
| +-- messages.jsonl # Message bus log
|
||||
| +-- meta.json # Session state + cross-role state
|
||||
+-- discussions/
|
||||
| +-- DISCUSS-REFACTOR.md # Refactoring design discussion record
|
||||
| +-- DISCUSS-REVIEW.md # Review discussion record
|
||||
@@ -468,7 +470,7 @@ Coordinator supports `--resume` / `--continue` for interrupted sessions:
|
||||
| Review-fix cycle exceeds 3 iterations | Escalate to user with summary of remaining issues (per-branch/pipeline scope) |
|
||||
| One branch REFACTOR fails | Mark that branch failed, other branches continue to completion |
|
||||
| Branch scope overlap detected | Designer constrains non-overlapping target files; REFACTOR logs warning on detection |
|
||||
| Shared-memory concurrent writes | Each worker writes only its own namespace key (e.g., `refactorer.B01`) |
|
||||
| Meta.json concurrent writes | Each worker writes only its own namespace key (e.g., `refactorer.B01`) |
|
||||
| Branch fix cycle >= 3 | Escalate only that branch to user, other branches continue independently |
|
||||
| max_branches exceeded | Coordinator truncates to top N refactorings by priority at CP-2.5 |
|
||||
| Independent pipeline partial failure | Failed pipeline marked, others continue; aggregate reports partial results |
|
||||
|
||||
@@ -17,7 +17,7 @@ Analyze codebase architecture to identify structural issues: dependency cycles,
|
||||
|-------|--------|----------|
|
||||
| Task description | From task subject/description | Yes |
|
||||
| Session path | Extracted from task description | Yes |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | No |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | No |
|
||||
|
||||
1. Extract session path and target scope from task description
|
||||
2. Detect project type by scanning for framework markers:
|
||||
@@ -76,5 +76,5 @@ Execute analysis based on detected project type:
|
||||
- Evidence summary per issue
|
||||
- Detected project type and analysis methods used
|
||||
|
||||
3. Update `<session>/wisdom/shared-memory.json` under `analyzer` namespace:
|
||||
3. Update `<session>/wisdom/.msg/meta.json` under `analyzer` namespace:
|
||||
- Read existing -> merge `{ "analyzer": { project_type, issue_count, top_issue, scope, categories } }` -> write back
|
||||
|
||||
@@ -18,13 +18,13 @@ Analyze architecture reports and baseline metrics to design a prioritized refact
|
||||
|-------|--------|----------|
|
||||
| Architecture report | <session>/artifacts/architecture-report.md | Yes |
|
||||
| Architecture baseline | <session>/artifacts/architecture-baseline.json | Yes |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
| Wisdom files | <session>/wisdom/patterns.md | No |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. Read architecture report -- extract ranked issue list with severities and categories
|
||||
3. Read architecture baseline -- extract current structural metrics
|
||||
4. Load shared-memory.json for analyzer findings (project_type, scope)
|
||||
4. Load .msg/meta.json for analyzer findings (project_type, scope)
|
||||
5. Assess overall refactoring complexity:
|
||||
|
||||
| Issue Count | Severity Mix | Complexity |
|
||||
@@ -91,7 +91,7 @@ Define measurable success criteria per refactoring (target metric improvement or
|
||||
- Each refactoring must be **non-overlapping** in target files (no two REFACTOR-IDs modify the same file unless explicitly noted with conflict resolution)
|
||||
- Implementation guidance must be self-contained -- a branch refactorer should be able to work from a single REFACTOR block without reading others
|
||||
|
||||
2. Update `<session>/wisdom/shared-memory.json` under `designer` namespace:
|
||||
2. Update `<session>/wisdom/.msg/meta.json` under `designer` namespace:
|
||||
- Read existing -> merge -> write back:
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ Implement architecture refactoring changes following the design plan. For FIX ta
|
||||
| Branch refactoring detail | <session>/artifacts/branches/B{NN}/refactoring-detail.md | Yes (REFACTOR with branch) |
|
||||
| Pipeline refactoring plan | <session>/artifacts/pipelines/{P}/refactoring-plan.md | Yes (REFACTOR with pipeline) |
|
||||
| Review/validation feedback | From task description | Yes (FIX) |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
| Wisdom files | <session>/wisdom/patterns.md | No |
|
||||
| Context accumulator | From prior REFACTOR/FIX tasks | Yes (inner loop) |
|
||||
|
||||
@@ -50,7 +50,7 @@ Implement architecture refactoring changes following the design plan. For FIX ta
|
||||
5. Use `explore` subagent to load implementation context for target files
|
||||
6. For inner loop (single mode only): load context_accumulator from prior REFACTOR/FIX tasks
|
||||
|
||||
**Shared-memory namespace**:
|
||||
**Meta.json namespace**:
|
||||
- Single: write to `refactorer` namespace
|
||||
- Fan-out: write to `refactorer.B{NN}` namespace
|
||||
- Independent: write to `refactorer.{P}` namespace
|
||||
|
||||
@@ -21,7 +21,7 @@ Review refactoring code changes for correctness, pattern consistency, completene
|
||||
| Refactoring code changes | From REFACTOR task artifacts / git diff | Yes |
|
||||
| Refactoring plan / detail | Varies by mode (see below) | Yes |
|
||||
| Validation results | Varies by mode (see below) | No |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. **Detect branch/pipeline context** from task description:
|
||||
@@ -37,7 +37,7 @@ Review refactoring code changes for correctness, pattern consistency, completene
|
||||
- Fan-out branch: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md`
|
||||
- Independent: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md`
|
||||
|
||||
4. Load shared-memory.json for scoped refactorer namespace:
|
||||
4. Load .msg/meta.json for scoped refactorer namespace:
|
||||
- Single: `refactorer` namespace
|
||||
- Fan-out: `refactorer.B{NN}` namespace
|
||||
- Independent: `refactorer.{P}` namespace
|
||||
@@ -108,7 +108,7 @@ Classify overall verdict based on findings:
|
||||
- Independent: `<session>/artifacts/pipelines/{P}/review-report.md`
|
||||
- Content: Per-dimension findings with severity, file:line, description; Overall verdict with rationale; Specific fix instructions for REVISE/REJECT verdicts
|
||||
|
||||
2. Update `<session>/wisdom/shared-memory.json` under scoped namespace:
|
||||
2. Update `<session>/wisdom/.msg/meta.json` under scoped namespace:
|
||||
- Single: merge `{ "reviewer": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
||||
- Fan-out: merge `{ "reviewer.B{NN}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
||||
- Independent: merge `{ "reviewer.{P}": { verdict, finding_count, critical_count, dimensions_reviewed } }`
|
||||
|
||||
@@ -17,7 +17,7 @@ Validate refactoring changes by running build checks, test suites, dependency me
|
||||
|-------|--------|----------|
|
||||
| Architecture baseline | <session>/artifacts/architecture-baseline.json (shared) | Yes |
|
||||
| Refactoring plan / detail | Varies by mode (see below) | Yes |
|
||||
| shared-memory.json | <session>/wisdom/shared-memory.json | Yes |
|
||||
| .msg/meta.json | <session>/wisdom/.msg/meta.json | Yes |
|
||||
|
||||
1. Extract session path from task description
|
||||
2. **Detect branch/pipeline context** from task description:
|
||||
@@ -37,7 +37,7 @@ Validate refactoring changes by running build checks, test suites, dependency me
|
||||
- Fan-out branch: Read `<session>/artifacts/branches/B{NN}/refactoring-detail.md` -- only this branch's criteria
|
||||
- Independent: Read `<session>/artifacts/pipelines/{P}/refactoring-plan.md`
|
||||
|
||||
5. Load shared-memory.json for project type and refactoring scope
|
||||
5. Load .msg/meta.json for project type and refactoring scope
|
||||
6. Detect available validation tools from project:
|
||||
|
||||
| Signal | Validation Tool | Method |
|
||||
@@ -50,7 +50,7 @@ Validate refactoring changes by running build checks, test suites, dependency me
|
||||
| Makefile with test target | Custom tests | make test |
|
||||
| No tooling detected | Manual validation | File existence + import grep checks |
|
||||
|
||||
7. Get changed files scope from shared-memory:
|
||||
7. Get changed files scope from .msg/meta.json:
|
||||
- Single: `refactorer` namespace
|
||||
- Fan-out: `refactorer.B{NN}` namespace
|
||||
- Independent: `refactorer.{P}` namespace
|
||||
@@ -108,7 +108,7 @@ Compare against baseline and plan criteria:
|
||||
- Independent: `<session>/artifacts/pipelines/{P}/validation-results.json`
|
||||
- Content: Per-dimension: name, baseline value, current value, improvement/regression, verdict; Overall verdict: PASS / WARN / FAIL; Failure details (if any)
|
||||
|
||||
2. Update `<session>/wisdom/shared-memory.json` under scoped namespace:
|
||||
2. Update `<session>/wisdom/.msg/meta.json` under scoped namespace:
|
||||
- Single: merge `{ "validator": { verdict, improvements, regressions, build_pass, test_pass } }`
|
||||
- Fan-out: merge `{ "validator.B{NN}": { verdict, improvements, regressions, build_pass, test_pass } }`
|
||||
- Independent: merge `{ "validator.{P}": { verdict, improvements, regressions, build_pass, test_pass } }`
|
||||
|
||||
@@ -38,7 +38,7 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: <branch-id or 'none'>
|
||||
- Upstream artifacts: <artifact-1>, <artifact-2>
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <deliverable path> + <quality criteria>
|
||||
CONSTRAINTS: <scope limits, focus areas>
|
||||
---
|
||||
@@ -77,7 +77,7 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/architecture-baseline.json + <session>/artifacts/architecture-report.md | Quantified metrics with evidence
|
||||
CONSTRAINTS: Focus on <refactoring-scope> | Analyze before any changes
|
||||
---
|
||||
@@ -101,7 +101,7 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: architecture-baseline.json, architecture-report.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/refactoring-plan.md | Priority-ordered with structural improvement targets, discrete REFACTOR-IDs
|
||||
CONSTRAINTS: Focus on highest-impact refactorings | Risk assessment required | Non-overlapping file targets per REFACTOR-ID
|
||||
---
|
||||
@@ -126,7 +126,7 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: refactoring-plan.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: Modified source files + validation passing | Refactorings applied without regressions
|
||||
CONSTRAINTS: Preserve existing behavior | Update all references | Follow code conventions
|
||||
---
|
||||
@@ -152,7 +152,7 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: architecture-baseline.json, refactoring-plan.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/validation-results.json | Per-dimension validation with verdicts
|
||||
CONSTRAINTS: Must compare against baseline | Flag any regressions or broken imports
|
||||
---
|
||||
@@ -176,7 +176,7 @@ CONTEXT:
|
||||
- Scope: <refactoring-scope>
|
||||
- Branch: none
|
||||
- Upstream artifacts: refactoring-plan.md, validation-results.json (if available)
|
||||
- Shared memory: <session>/wisdom/shared-memory.json
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json
|
||||
EXPECTED: <session>/artifacts/review-report.md | Per-dimension findings with severity
|
||||
CONSTRAINTS: Focus on refactoring changes only | Provide specific file:line references
|
||||
---
|
||||
@@ -220,7 +220,7 @@ TaskCreate({ subject: "REVIEW-<P>01", ... }) // blockedBy: ["REFACTOR-<P>
|
||||
Task descriptions follow same template as single mode, with additions:
|
||||
- `Pipeline: <P>` in CONTEXT
|
||||
- Artifact paths use `<session>/artifacts/pipelines/<P>/` instead of `<session>/artifacts/`
|
||||
- Shared-memory namespace uses `<role>.<P>` (e.g., `analyzer.A`, `refactorer.B`)
|
||||
- Meta.json namespace uses `<role>.<P>` (e.g., `analyzer.A`, `refactorer.B`)
|
||||
- Each pipeline's scope is its specific target from `independent_targets[i]`
|
||||
|
||||
Example for pipeline A with target "refactor auth module":
|
||||
@@ -236,7 +236,7 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Scope: refactor auth module
|
||||
- Pipeline: A
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: analyzer.A)
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: analyzer.A)
|
||||
EXPECTED: <session>/artifacts/pipelines/A/architecture-baseline.json + architecture-report.md
|
||||
CONSTRAINTS: Focus on auth module scope
|
||||
---
|
||||
@@ -255,7 +255,7 @@ PipelineId: A",
|
||||
**Procedure**:
|
||||
|
||||
1. Read `<session>/artifacts/refactoring-plan.md` to count REFACTOR-IDs
|
||||
2. Read `shared-memory.json` -> `designer.refactoring_count`
|
||||
2. Read `.msg/meta.json` -> `designer.refactoring_count`
|
||||
3. **Auto mode decision**:
|
||||
|
||||
| Refactoring Count | Decision |
|
||||
@@ -293,7 +293,7 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: branches/B{NN}/refactoring-detail.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: refactorer.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: refactorer.B{NN})
|
||||
EXPECTED: Modified source files for REFACTOR-{NNN} only
|
||||
CONSTRAINTS: Only implement this branch's refactoring | Do not touch files outside REFACTOR-{NNN} scope
|
||||
---
|
||||
@@ -314,7 +314,7 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: architecture-baseline.json, branches/B{NN}/refactoring-detail.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: validator.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: validator.B{NN})
|
||||
EXPECTED: <session>/artifacts/branches/B{NN}/validation-results.json
|
||||
CONSTRAINTS: Only validate this branch's changes
|
||||
---
|
||||
@@ -328,14 +328,14 @@ TaskCreate({
|
||||
subject: "REVIEW-B{NN}",
|
||||
description: "PURPOSE: Review branch B{NN} refactoring code | Success: Code quality verified for REFACTOR-{NNN}
|
||||
TASK:
|
||||
- Load modified files from refactorer.B{NN} shared-memory namespace
|
||||
- Load modified files from refactorer.B{NN} namespace in .msg/meta.json
|
||||
- Review across 5 dimensions for this branch's changes only
|
||||
- Issue verdict: APPROVE, REVISE, or REJECT
|
||||
CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: branches/B{NN}/refactoring-detail.md
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: reviewer.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: reviewer.B{NN})
|
||||
EXPECTED: <session>/artifacts/branches/B{NN}/review-report.md
|
||||
CONSTRAINTS: Only review this branch's changes
|
||||
---
|
||||
|
||||
@@ -104,8 +104,8 @@ Execute built-in Phase 1 -> role-spec Phase 2-4 -> built-in Phase 5.`
|
||||
|
||||
When both VALIDATE-001 and REVIEW-001 are completed:
|
||||
|
||||
1. Read validation verdict from shared-memory (validator namespace)
|
||||
2. Read review verdict from shared-memory (reviewer namespace)
|
||||
1. Read validation verdict from .msg/meta.json (validator namespace)
|
||||
2. Read review verdict from .msg/meta.json (reviewer namespace)
|
||||
|
||||
| Validate Verdict | Review Verdict | Action |
|
||||
|-----------------|----------------|--------|
|
||||
@@ -166,7 +166,7 @@ CONTEXT:
|
||||
- Session: <session-folder>
|
||||
- Branch: B{NN}
|
||||
- Upstream artifacts: branches/B{NN}/review-report.md, branches/B{NN}/validation-results.json
|
||||
- Shared memory: <session>/wisdom/shared-memory.json (namespace: refactorer.B{NN})
|
||||
- Shared memory: <session>/wisdom/.msg/meta.json (namespace: refactorer.B{NN})
|
||||
EXPECTED: Fixed source files for B{NN} only
|
||||
CONSTRAINTS: Targeted fixes only | Do not touch other branches
|
||||
---
|
||||
|
||||
@@ -69,7 +69,7 @@ For callback/check/resume/complete: load `commands/monitor.md` and execute match
|
||||
### Router Implementation
|
||||
|
||||
1. **Load session context** (if exists):
|
||||
- Scan `.workflow/.team/ARCH-OPT-*/team-session.json` for active/paused sessions
|
||||
- Scan `.workflow/.team/ARCH-OPT-*/.msg/meta.json` for active/paused sessions
|
||||
- If found, extract session folder path, status, and `parallel_mode`
|
||||
|
||||
2. **Parse $ARGUMENTS** for detection keywords:
|
||||
@@ -186,10 +186,10 @@ Bash("mkdir -p .workflow/<session-id>/artifacts/pipelines/A .workflow/<session-i
|
||||
- `independent_targets`: populated for independent mode (e.g., ["refactor auth", "refactor API"])
|
||||
- `fix_cycles`: populated per-branch/pipeline as fix cycles occur
|
||||
|
||||
3. Initialize shared-memory.json:
|
||||
3. Initialize .msg/meta.json:
|
||||
|
||||
```
|
||||
Write("<session>/wisdom/shared-memory.json", { "session_id": "<session-id>", "requirement": "<requirement>", "parallel_mode": "<mode>" })
|
||||
Write("<session>/wisdom/.msg/meta.json", { "session_id": "<session-id>", "requirement": "<requirement>", "parallel_mode": "<mode>" })
|
||||
```
|
||||
|
||||
4. Create team:
|
||||
|
||||
Reference in New Issue
Block a user