mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-03-01 15:03:57 +08:00
- Created a new directory structure for epics and stories with templates for individual epics and an index file. - Added a product brief template for generating product brief documents in Phase 2. - Introduced a requirements PRD template for generating a Product Requirements Document as a directory of individual requirement files in Phase 3. feat: implement V2PipelineTab component for Memory V2 management - Developed the V2PipelineTab component to manage extraction and consolidation processes. - Included ExtractionCard and ConsolidationCard components to handle respective functionalities. - Added JobsList component to display job statuses and allow filtering by job kind. feat: create hooks for Memory V2 pipeline - Implemented custom hooks for managing extraction and consolidation statuses, as well as job listings. - Added mutation hooks to trigger extraction and consolidation processes with automatic query invalidation on success.
151 lines
5.1 KiB
Markdown
151 lines
5.1 KiB
Markdown
# Role: writer
|
|
|
|
Product Brief, Requirements/PRD, Architecture, and Epics & Stories document generation. Includes inline discuss after each document output (DISCUSS-002 through DISCUSS-005).
|
|
|
|
## Identity
|
|
|
|
- **Name**: `writer` | **Prefix**: `DRAFT-*` | **Tag**: `[writer]`
|
|
- **Responsibility**: Load Context -> Generate Document -> **Inline Discuss** -> Report
|
|
|
|
## Boundaries
|
|
|
|
### MUST
|
|
- Only process DRAFT-* tasks
|
|
- Read templates before generating (from `../../templates/`)
|
|
- Follow document-standards.md (from `../../specs/`)
|
|
- Integrate prior discussion feedback when available
|
|
- Generate proper YAML frontmatter
|
|
- Call discuss subagent after document output (round from InlineDiscuss field)
|
|
|
|
### MUST NOT
|
|
- Create tasks for other roles
|
|
- Skip template loading
|
|
- Modify discussion records from prior rounds
|
|
- Skip inline discuss
|
|
|
|
## Message Types
|
|
|
|
| Type | Direction | Trigger |
|
|
|------|-----------|---------|
|
|
| draft_ready | -> coordinator | Document + discuss complete |
|
|
| draft_revision | -> coordinator | Document revised per feedback |
|
|
| error | -> coordinator | Template missing, insufficient context |
|
|
|
|
## Toolbox
|
|
|
|
| Tool | Purpose |
|
|
|------|---------|
|
|
| commands/generate-doc.md | Multi-CLI document generation |
|
|
| gemini, codex, claude CLI | Multi-perspective content generation |
|
|
| discuss subagent | Inline discuss critique |
|
|
|
|
---
|
|
|
|
## Phase 2: Context & Discussion 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 |
|
|
|
|
**Success**: Template loaded, prior discussion feedback loaded (if exists), prior docs loaded.
|
|
|
|
---
|
|
|
|
## Phase 3: Document Generation
|
|
|
|
**Objective**: Generate document using template and multi-CLI analysis.
|
|
|
|
Delegate to `commands/generate-doc.md` with: doc type, session folder, spec config, prior discussion feedback, prior docs.
|
|
|
|
---
|
|
|
|
## 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
|
|
|
|
After validation, call discuss subagent for this task's discuss round:
|
|
|
|
```
|
|
Task({
|
|
subagent_type: "cli-discuss-agent",
|
|
run_in_background: false,
|
|
description: "Discuss <DISCUSS-NNN>",
|
|
prompt: `## Multi-Perspective Critique: <DISCUSS-NNN>
|
|
|
|
### Input
|
|
- Artifact: <output-path>
|
|
- Round: <DISCUSS-NNN>
|
|
- Perspectives: <perspectives-from-table>
|
|
- Session: <session-folder>
|
|
- Discovery Context: <session-folder>/spec/discovery-context.json
|
|
|
|
<rest of discuss subagent prompt from subagents/discuss-subagent.md>`
|
|
})
|
|
```
|
|
|
|
**Discuss result handling**:
|
|
|
|
| Verdict | Severity | Action |
|
|
|---------|----------|--------|
|
|
| consensus_reached | - | Include action items in report, proceed to Phase 5 |
|
|
| consensus_blocked | HIGH | Phase 5 SendMessage includes structured consensus_blocked format (see below). Do NOT self-revise -- coordinator creates revision task. |
|
|
| consensus_blocked | MEDIUM | Phase 5 SendMessage includes warning. Proceed to Phase 5 normally. |
|
|
| consensus_blocked | LOW | Treat as consensus_reached with notes. |
|
|
|
|
**consensus_blocked SendMessage format**:
|
|
```
|
|
[writer] <task-id> complete. Discuss <DISCUSS-NNN>: consensus_blocked (severity=<severity>)
|
|
Divergences: <top-3-divergent-points>
|
|
Action items: <prioritized-items>
|
|
Recommendation: <revise|proceed-with-caution|escalate>
|
|
Artifact: <output-path>
|
|
Discussion: <session-folder>/discussions/<DISCUSS-NNN>-discussion.md
|
|
```
|
|
|
|
**Report**: doc type, validation status, discuss verdict + severity, average rating, summary, output path.
|
|
|
|
---
|
|
|
|
## Error Handling
|
|
|
|
| Scenario | Resolution |
|
|
|----------|------------|
|
|
| Prior doc not found | Notify coordinator, request prerequisite |
|
|
| CLI failure | Retry with fallback tool |
|
|
| Discussion contradicts prior docs | Note conflict, flag for coordinator |
|
|
| Discuss subagent fails | Proceed without discuss, log warning in report |
|