mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-05 16:13:08 +08:00
- Enhanced multi-perspective discussion capabilities in discuss-subagent for architecture optimization, integrating CLI tools for structured analysis and recommendations. - Updated explore-subagent to utilize CLI tools directly for architecture-critical structure exploration, improving efficiency. - Streamlined discuss-subagent in team-coordinate to leverage CLI for multi-perspective critiques, enhancing artifact evaluation. - Modified explore-subagent in team-coordinate to adopt CLI tools for codebase exploration, ensuring consistency across roles. - Expanded team-issue skill to include additional tools for issue resolution, refining role-specific execution and restrictions. - Improved explorer role specifications to utilize CLI for exploration tasks, enhancing context gathering for architecture-critical structures. - Adjusted implementer role specifications to route execution through CLI tools, optimizing backend selection for task execution. - Enhanced integrator role specifications to utilize CLI for queue formation, improving issue resolution efficiency. - Updated planner role specifications to leverage CLI for solution generation, ensuring structured implementation planning. - Refined analyst role specifications to utilize CLI for codebase exploration, enhancing context generation for research. - Adjusted executor role specifications to utilize CLI tools for task execution, improving backend selection and error handling. - Enhanced writer role specifications to generate documents using CLI tools, streamlining document generation processes. - Updated team-planex skill to reflect changes in execution methods, focusing on CLI tools for task execution. - Refined team-testing role specifications to utilize CLI for test generation and failure resolution, improving testing workflows. - Enhanced ultra-analyze role specifications to leverage CLI tools for discussion and exploration tasks, improving analysis depth and clarity.
108 lines
4.1 KiB
Markdown
108 lines
4.1 KiB
Markdown
---
|
|
role: writer
|
|
prefix: DRAFT
|
|
inner_loop: true
|
|
discuss_rounds: [DISCUSS-002, DISCUSS-003, DISCUSS-004, DISCUSS-005]
|
|
subagents: [discuss]
|
|
message_types:
|
|
success: draft_ready
|
|
revision: draft_revision
|
|
error: error
|
|
---
|
|
|
|
# Writer — Phase 2-4
|
|
|
|
## Phase 2: Context Loading
|
|
|
|
**Objective**: Load all required inputs for document generation.
|
|
|
|
### Document type routing
|
|
|
|
| Task Subject Contains | Doc Type | Template | Prior Discussion Input |
|
|
|----------------------|----------|----------|----------------------|
|
|
| Product Brief | product-brief | templates/product-brief.md | discussions/DISCUSS-001-discussion.md |
|
|
| Requirements / PRD | requirements | templates/requirements-prd.md | discussions/DISCUSS-002-discussion.md |
|
|
| Architecture | architecture | templates/architecture-doc.md | discussions/DISCUSS-003-discussion.md |
|
|
| Epics | epics | templates/epics-template.md | discussions/DISCUSS-004-discussion.md |
|
|
|
|
### Inline discuss mapping
|
|
|
|
| Doc Type | Inline Discuss Round | Perspectives |
|
|
|----------|---------------------|-------------|
|
|
| product-brief | DISCUSS-002 | product, technical, quality, coverage |
|
|
| requirements | DISCUSS-003 | quality, product, coverage |
|
|
| architecture | DISCUSS-004 | technical, risk |
|
|
| epics | DISCUSS-005 | product, technical, quality, coverage |
|
|
|
|
### Progressive dependency loading
|
|
|
|
| Doc Type | Requires |
|
|
|----------|----------|
|
|
| product-brief | discovery-context.json |
|
|
| requirements | + product-brief.md |
|
|
| architecture | + requirements/_index.md |
|
|
| epics | + architecture/_index.md |
|
|
|
|
**Prior decisions from accumulator**: Pass context_accumulator summaries as "Prior Decisions" to subagent.
|
|
|
|
| Input | Source | Required |
|
|
|-------|--------|----------|
|
|
| Document standards | `../../specs/document-standards.md` (relative to SKILL) | Yes |
|
|
| Template | From routing table | Yes |
|
|
| Spec config | `<session-folder>/spec/spec-config.json` | Yes |
|
|
| Discovery context | `<session-folder>/spec/discovery-context.json` | Yes |
|
|
| Discussion feedback | `<session-folder>/discussions/<discuss-file>` | If exists |
|
|
| Prior decisions | context_accumulator (in-memory) | If prior tasks exist |
|
|
|
|
## Phase 3: Subagent Document Generation
|
|
|
|
**Objective**: Generate document using CLI tool.
|
|
|
|
Use Gemini CLI for document generation:
|
|
|
|
```
|
|
Bash({
|
|
command: `ccw cli -p "PURPOSE: Generate <doc-type> document following template and standards
|
|
TASK: • Load template from <template-path> • Apply spec config and discovery context • Integrate prior discussion feedback • Generate all required sections
|
|
MODE: write
|
|
CONTEXT: @<session-folder>/spec/*.json @<template-path> | Memory: Prior decisions: <context_accumulator summary>
|
|
EXPECTED: Document at <output-path> with: YAML frontmatter, all template sections, cross-references, session_id
|
|
CONSTRAINTS: Follow document-standards.md" --tool gemini --mode write --rule development-implement-feature --cd <session-folder>`,
|
|
run_in_background: false
|
|
})
|
|
```
|
|
|
|
Parse CLI output for artifact path and summary. Document is written to disk by CLI.
|
|
|
|
## Phase 4: Self-Validation + Inline Discuss
|
|
|
|
### 4a: Self-Validation
|
|
|
|
| Check | What to Verify |
|
|
|-------|---------------|
|
|
| has_frontmatter | Starts with YAML frontmatter |
|
|
| sections_complete | All template sections present |
|
|
| cross_references | session_id included |
|
|
| discussion_integrated | Reflects prior round feedback (if exists) |
|
|
|
|
### 4b: Inline Discuss
|
|
|
|
Call discuss subagent for this task's discuss round:
|
|
- Artifact: `<output-path>` (the generated document)
|
|
- Round: `<DISCUSS-NNN>` from mapping table
|
|
- Perspectives: from mapping table
|
|
|
|
Handle discuss verdict per team-worker consensus handling protocol.
|
|
|
|
**Report**: doc type, validation status, discuss verdict + severity, average rating, summary, output path.
|
|
|
|
## Error Handling
|
|
|
|
| Scenario | Resolution |
|
|
|----------|------------|
|
|
| CLI failure | Retry once with alternative tool. Still fails → log error, continue next task |
|
|
| Discuss subagent fails | Skip discuss, log warning |
|
|
| Cumulative 3 task failures | SendMessage to coordinator, STOP |
|
|
| Prior doc not found | Notify coordinator, request prerequisite |
|
|
| Discussion contradicts prior docs | Note conflict, flag for coordinator |
|