feat: Add Role Analysis Reviewer Agent and validation template

- Introduced Role Analysis Reviewer Agent to validate role analysis outputs against templates and quality standards.
- Created a detailed validation ruleset for the system-architect role, including mandatory and recommended sections.
- Added JSON validation report structure for output.
- Implemented execution command for validation process.

test: Add UX tests for HookCard component

- Created comprehensive tests for HookCard component, focusing on delete confirmation UX pattern.
- Verified confirmation dialog appearance, deletion functionality, and button interactions.
- Ensured proper handling of state updates and visual feedback for enabled/disabled status.

test: Add UX tests for ThemeSelector component

- Developed tests for ThemeSelector component, emphasizing delete confirmation UX pattern.
- Validated confirmation dialog display, deletion actions, and toast notifications for undo functionality.
- Ensured proper management of theme slots and state updates.

feat: Implement useDebounce hook

- Added useDebounce hook to delay expensive computations or API calls, enhancing performance.

feat: Create System Architect Analysis Template

- Developed a comprehensive template for system architect role analysis, covering required sections such as architecture overview, data model, state machine, error handling strategy, observability requirements, configuration model, and boundary scenarios.
- Included examples and templates for each section to guide users in producing SPEC.md-level precision modeling.
This commit is contained in:
catlog22
2026-03-05 19:58:10 +08:00
parent bc7a556985
commit 3fd55ebd4b
55 changed files with 4262 additions and 1138 deletions

View File

@@ -49,6 +49,9 @@ Single Role Mode:
3. **Task Attachment/Collapse**: Sub-tasks attached during phase execution, collapsed after completion
4. **Session Continuity**: All phases share session state via workflow-session.json
5. **Auto-Continue Execution**: Phases chain automatically without user intervention between them
6. **SPEC.md Quality Alignment**: Guidance specification and role analysis follow SPEC.md standards (Concepts & Terminology, Non-Goals, Data Model, State Machine, RFC 2119 constraints)
7. **Template-Driven Analysis**: Role-specific templates (e.g., system-architect) ensure consistent, high-quality outputs
8. **Quality Gates**: Automated validation of guidance specification and role analysis against quality standards
## Auto Mode
@@ -73,13 +76,19 @@ Parse arguments, detect mode from flags/parameters, or ask user via AskUserQuest
### Auto Mode Execution (execution_mode = "auto")
**Phase 1.5: Terminology & Boundary Definition**
- Extract 5-10 core domain terms from user input and Phase 1 context
- Generate terminology table (term, definition, aliases, category)
- Collect Non-Goals via AskUserQuestion (明确排除的范围)
- Store to `session.terminology` and `session.non_goals`
#### Phase 2: Interactive Framework Generation
Ref: phases/02-artifacts.md
Seven-phase interactive workflow: Context collection → Topic analysis → Role selection → Role questions → Conflict resolution → Final check → Generate specification.
**Input**: topic description, --count N, --yes flag
**Output**: guidance-specification.md, workflow-session.json (selected_roles[], session_id)
**Output**: guidance-specification.md (with Concepts & Terminology, Non-Goals, RFC 2119 constraints), workflow-session.json (selected_roles[], session_id)
**TodoWrite**: Attach 7 sub-tasks (Phase 0-5), execute sequentially, collapse on completion.
@@ -95,6 +104,16 @@ Execute role analysis for EACH selected role in parallel.
For ui-designer: append `--style-skill {package}` if provided.
**Template-Driven Analysis**:
- Load role-specific template if exists (e.g., `templates/role-templates/system-architect-template.md`)
- Inject template into agent prompt as required structure
- For system-architect: MUST include Data Model, State Machine, Error Handling, Observability, Configuration Model, Boundary Scenarios
**Quality Validation**:
- After analysis generation, invoke `role-analysis-reviewer-agent` to validate against template
- Check MUST have sections (blocking), SHOULD have sections (warning), quality checks (RFC keywords, valid diagrams)
- Output validation report with score and recommendations
**TodoWrite**: Attach N parallel sub-tasks, execute concurrently, collapse on completion.
#### Phase 4: Synthesis Integration
@@ -327,6 +346,13 @@ Initial → Phase 1 Mode Routing (completed)
├── feature-specs/ # Feature specs (Phase 4, auto mode, feature_mode)
│ ├── F-001-{slug}.md
│ └── F-00N-{slug}.md
├── specs/
│ └── terminology-template.json # Terminology schema
├── templates/
│ └── role-templates/
│ └── system-architect-template.md # System architect analysis template
├── agents/
│ └── role-analysis-reviewer-agent.md # Role analysis validation agent
├── {role}/ # Role analyses (IMMUTABLE after Phase 3)
│ ├── {role}-context.md # Interactive Q&A responses
│ ├── analysis.md # Main/index document