cc-devflow 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/agents/architecture-designer.md +7 -7
- package/.claude/agents/bug-analyzer.md +7 -7
- package/.claude/agents/code-reviewer.md +5 -5
- package/.claude/agents/compatibility-checker.md +7 -7
- package/.claude/agents/consistency-checker.md +6 -6
- package/.claude/agents/impact-analyzer.md +7 -7
- package/.claude/agents/planner.md +7 -7
- package/.claude/agents/prd-writer.md +15 -15
- package/.claude/agents/project-guidelines-generator.md +13 -13
- package/.claude/agents/qa-tester.md +11 -11
- package/.claude/agents/release-manager.md +14 -14
- package/.claude/agents/security-reviewer.md +12 -12
- package/.claude/agents/style-guide-generator.md +1 -1
- package/.claude/agents/tech-architect.md +10 -10
- package/.claude/agents/ui-designer.md +12 -12
- package/.claude/commands/flow-constitution.md +1 -1
- package/.claude/docs/SPEC_KIT_CONSTITUTION_ANALYSIS.md +1 -1
- package/.claude/docs/templates/EPIC_TEMPLATE.md +3 -3
- package/.claude/docs/templates/PRD_TEMPLATE.md +1 -1
- package/.claude/docs/templates/TASKS_TEMPLATE.md +4 -4
- package/.claude/guides/workflow-guides/flow-orchestrator.md +10 -10
- package/.claude/scripts/check-task-status.sh +33 -9
- package/.claude/scripts/manage-constitution.sh +2 -2
- package/.claude/scripts/validate-constitution.sh +1 -1
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +1 -1
- package/.claude/skills/constitution-guardian/SKILL.md +3 -3
- package/.claude/skills/devflow-constitution-quick-ref/SKILL.md +11 -11
- package/.claude/skills/skill-rules.json +1 -1
- package/.claude/tests/constitution/test_agent_assignment.sh +1 -1
- package/.claude/tests/constitution/test_article_coverage.sh +1 -1
- package/.claude/tests/constitution/test_template_completeness.sh +4 -4
- package/.claude/tests/constitution/test_version_consistency.sh +3 -3
- package/.claude/tsc-cache/777aa1de-497e-411b-a40f-13b74efcec58/affected-repos.txt +1 -0
- package/.claude/tsc-cache/777aa1de-497e-411b-a40f-13b74efcec58/edited-files.log +2 -0
- package/README.md +27 -6
- package/README.zh-CN.md +27 -6
- package/package.json +2 -2
|
@@ -17,43 +17,43 @@ Your role:
|
|
|
17
17
|
## Rules Integration
|
|
18
18
|
You MUST follow these rules during release management:
|
|
19
19
|
|
|
20
|
-
1. **Standard Patterns
|
|
20
|
+
1. **Standard Patterns**:
|
|
21
21
|
- Apply Fail Fast principle: validate all quality gates before merge
|
|
22
22
|
- Use Clear Errors when release criteria are not met
|
|
23
23
|
- Maintain Minimal Output with focused release documentation
|
|
24
24
|
- Follow Trust System principle for automated quality gate verification
|
|
25
25
|
|
|
26
|
-
2. **Agent Coordination
|
|
26
|
+
2. **Agent Coordination**:
|
|
27
27
|
- Update status in LOG.md when release process begins and completes
|
|
28
28
|
- Implement proper error propagation for failed quality gates
|
|
29
29
|
- Coordinate with flow-orchestrator for final release approval
|
|
30
30
|
- Use file locks to prevent concurrent release operations
|
|
31
31
|
|
|
32
|
-
3. **Branch Operations** (
|
|
32
|
+
3. **Branch Operations** (${DEVFLOW_CLAUDE_DIR:-.claude}/guides/technical-guides/git-github-guide.md):
|
|
33
33
|
- Verify clean working directory before creating pull requests
|
|
34
34
|
- Use conventional commit messages with proper Co-authored-by attribution
|
|
35
35
|
- Apply squash merge strategy for clean commit history
|
|
36
36
|
- Clean up feature branches after successful merge
|
|
37
37
|
|
|
38
|
-
4. **GitHub Operations** (
|
|
38
|
+
4. **GitHub Operations** (${DEVFLOW_CLAUDE_DIR:-.claude}/guides/technical-guides/git-github-guide.md):
|
|
39
39
|
- Check GitHub authentication status before PR operations
|
|
40
40
|
- Verify repository permissions before merge operations
|
|
41
41
|
- Use structured PR descriptions with links to documentation
|
|
42
42
|
- Handle permission errors and authentication failures gracefully
|
|
43
43
|
|
|
44
|
-
5. **DateTime Handling
|
|
44
|
+
5. **DateTime Handling**:
|
|
45
45
|
- Include ISO 8601 UTC timestamps in release documentation
|
|
46
46
|
- Use real system time for release timestamps and changelog entries
|
|
47
47
|
- Handle timezone-aware release scheduling correctly
|
|
48
48
|
- Support cross-platform datetime operations in release tooling
|
|
49
49
|
|
|
50
|
-
6. **DevFlow Patterns** (
|
|
50
|
+
6. **DevFlow Patterns** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/devflow-conventions.md):
|
|
51
51
|
- Enforce REQ-ID format in PR titles and commit messages
|
|
52
52
|
- Use standardized PR templates and release documentation
|
|
53
53
|
- Apply consistent branch naming and cleanup procedures
|
|
54
54
|
- Maintain complete traceability from requirements to release
|
|
55
55
|
|
|
56
|
-
7. **Constitution** (
|
|
56
|
+
7. **Constitution** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md):
|
|
57
57
|
- Verify all Constitution checks passed before release
|
|
58
58
|
- Ensure quality gates enforced (NO PARTIAL IMPLEMENTATION)
|
|
59
59
|
- Validate security requirements met (NO HARDCODED SECRETS)
|
|
@@ -65,7 +65,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
65
65
|
1. **Get Requirement Paths**: Use `check-prerequisites.sh` to retrieve paths
|
|
66
66
|
```bash
|
|
67
67
|
# Get all paths and available documents
|
|
68
|
-
|
|
68
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --include-tasks
|
|
69
69
|
|
|
70
70
|
# Expected output includes REQ_ID, REQ_DIR, and all documents
|
|
71
71
|
```
|
|
@@ -73,7 +73,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
73
73
|
2. **Check Task Status**: Use `check-task-status.sh` to verify completion
|
|
74
74
|
```bash
|
|
75
75
|
# Get task completion status
|
|
76
|
-
|
|
76
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-task-status.sh --json
|
|
77
77
|
|
|
78
78
|
# Example output: {"total_tasks":20,"completed":20,"remaining":0,"percentage":100}
|
|
79
79
|
```
|
|
@@ -81,7 +81,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
81
81
|
3. **Validate Constitution**: Use `validate-constitution.sh` for final checks
|
|
82
82
|
```bash
|
|
83
83
|
# Run comprehensive Constitution validation
|
|
84
|
-
|
|
84
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/validate-constitution.sh --type all --severity error --json
|
|
85
85
|
|
|
86
86
|
# Must return 0 errors before release can proceed
|
|
87
87
|
```
|
|
@@ -89,7 +89,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
89
89
|
4. **Log Events**: Use common.sh logging for release milestones
|
|
90
90
|
```bash
|
|
91
91
|
# Log release events
|
|
92
|
-
source
|
|
92
|
+
source ${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/common.sh
|
|
93
93
|
log_event "$REQ_ID" "Release readiness assessment started"
|
|
94
94
|
log_event "$REQ_ID" "Release plan generated - READY FOR MERGE"
|
|
95
95
|
```
|
|
@@ -115,11 +115,11 @@ When called by main agent, you will receive:
|
|
|
115
115
|
- Expected to output: `devflow/bugs/${bugId}/RELEASE_PLAN.md`
|
|
116
116
|
|
|
117
117
|
Release analysis process:
|
|
118
|
-
1. **Run Prerequisites Check**:
|
|
119
|
-
2. **Check Task Completion**:
|
|
118
|
+
1. **Run Prerequisites Check**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --include-tasks`
|
|
119
|
+
2. **Check Task Completion**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-task-status.sh --json`
|
|
120
120
|
- Verify 100% task completion (remaining: 0)
|
|
121
121
|
- Ensure all Phase 2 (Tests First) and Phase 3 (Implementation) tasks completed
|
|
122
|
-
3. **Validate Constitution**:
|
|
122
|
+
3. **Validate Constitution**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/validate-constitution.sh --type all --severity error --json`
|
|
123
123
|
- Must return {"errors": 0} to proceed
|
|
124
124
|
- Verify NO PARTIAL IMPLEMENTATION, NO HARDCODED SECRETS, etc.
|
|
125
125
|
4. **Verify Quality Gates**: Check all quality gate documents exist and passed:
|
|
@@ -33,31 +33,31 @@ Called by main agent AFTER code implementation with prompt containing "security
|
|
|
33
33
|
## Rules Integration
|
|
34
34
|
You MUST follow these rules during security review:
|
|
35
35
|
|
|
36
|
-
1. **Standard Patterns
|
|
36
|
+
1. **Standard Patterns**:
|
|
37
37
|
- Apply Fail Fast principle: validate security requirements before review
|
|
38
38
|
- Use Clear Errors when security vulnerabilities are identified
|
|
39
39
|
- Maintain Minimal Output with focused security patches and findings
|
|
40
40
|
- Follow Trust System principle for established security tools and processes
|
|
41
41
|
|
|
42
|
-
2. **Agent Coordination
|
|
42
|
+
2. **Agent Coordination**:
|
|
43
43
|
- Update status in LOG.md when security review begins and completes
|
|
44
44
|
- Implement proper error propagation back to main agent
|
|
45
45
|
- Coordinate with flow-orchestrator for security gate enforcement
|
|
46
46
|
- Use file locks to prevent concurrent security analysis conflicts
|
|
47
47
|
|
|
48
|
-
3. **DateTime Handling
|
|
48
|
+
3. **DateTime Handling**:
|
|
49
49
|
- Include ISO 8601 UTC timestamps in security reports and logs
|
|
50
50
|
- Use real system time for vulnerability assessment timestamps
|
|
51
51
|
- Handle timezone-aware security monitoring correctly
|
|
52
52
|
- Support cross-platform datetime operations in security tooling
|
|
53
53
|
|
|
54
|
-
4. **DevFlow Patterns** (
|
|
54
|
+
4. **DevFlow Patterns** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/devflow-conventions.md):
|
|
55
55
|
- Enforce REQ-ID format in security documentation and reports
|
|
56
56
|
- Use standardized security review templates and checklists
|
|
57
57
|
- Apply consistent vulnerability classification and remediation tracking
|
|
58
58
|
- Maintain traceability from security findings back to implementation changes
|
|
59
59
|
|
|
60
|
-
5. **Constitution** (
|
|
60
|
+
5. **Constitution** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md):
|
|
61
61
|
- **NO HARDCODED SECRETS**: Critical security principle - MUST detect and flag
|
|
62
62
|
- **Security First**: Security is non-negotiable, blocks release if violated
|
|
63
63
|
- **Input Validation**: All external inputs must be validated
|
|
@@ -69,7 +69,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
69
69
|
1. **Get Requirement Paths**: Use `check-prerequisites.sh` to retrieve paths
|
|
70
70
|
```bash
|
|
71
71
|
# Get paths in JSON format
|
|
72
|
-
|
|
72
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --require-epic --require-tasks
|
|
73
73
|
|
|
74
74
|
# Expected output includes REQ_ID, REQ_DIR, and all available documents
|
|
75
75
|
```
|
|
@@ -77,7 +77,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
77
77
|
2. **Validate Prerequisites**: Check available context before security planning
|
|
78
78
|
```bash
|
|
79
79
|
# Check what documents are available
|
|
80
|
-
|
|
80
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --include-tasks
|
|
81
81
|
|
|
82
82
|
# Verify PRD, EPIC, and TASKS exist before creating security plan
|
|
83
83
|
```
|
|
@@ -85,7 +85,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
85
85
|
3. **Run Constitution Check**: Use validate-constitution.sh for automated checks
|
|
86
86
|
```bash
|
|
87
87
|
# Check for hardcoded secrets and other violations
|
|
88
|
-
|
|
88
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/validate-constitution.sh --type code --severity error
|
|
89
89
|
|
|
90
90
|
# This provides automated baseline security validation
|
|
91
91
|
```
|
|
@@ -93,7 +93,7 @@ You MUST use the unified script infrastructure for all operations:
|
|
|
93
93
|
4. **Log Events**: Use common.sh logging for all significant actions
|
|
94
94
|
```bash
|
|
95
95
|
# Log security review events
|
|
96
|
-
source
|
|
96
|
+
source ${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/common.sh
|
|
97
97
|
log_event "$REQ_ID" "Security plan generation started"
|
|
98
98
|
log_event "$REQ_ID" "Security analysis completed - CRITICAL findings"
|
|
99
99
|
```
|
|
@@ -127,7 +127,7 @@ When called by main agent with "security report" in prompt, you will receive:
|
|
|
127
127
|
- **MUST OUTPUT**: `devflow/bugs/${bugId}/SECURITY_REPORT.md`
|
|
128
128
|
|
|
129
129
|
## Phase 1: Security Planning Process (Pre-Implementation)
|
|
130
|
-
1. **Run Prerequisites Check**:
|
|
130
|
+
1. **Run Prerequisites Check**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --require-epic --require-tasks`
|
|
131
131
|
2. **Read Documents**: Load PRD.md, EPIC.md, and TASKS.md from requirement directory
|
|
132
132
|
3. **Constitution Check**: Verify PRD includes NO HARDCODED SECRETS requirement
|
|
133
133
|
4. **Identify Attack Surface**: Analyze requirements for security-sensitive areas:
|
|
@@ -147,8 +147,8 @@ When called by main agent with "security report" in prompt, you will receive:
|
|
|
147
147
|
9. **Log Event**: `log_event "$REQ_ID" "Security plan generation completed"`
|
|
148
148
|
|
|
149
149
|
## Phase 2: Security Analysis Process (Post-Implementation)
|
|
150
|
-
1. **Run Prerequisites Check**:
|
|
151
|
-
2. **Run Automated Constitution Check**:
|
|
150
|
+
1. **Run Prerequisites Check**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json`
|
|
151
|
+
2. **Run Automated Constitution Check**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/validate-constitution.sh --type code --severity error --json`
|
|
152
152
|
- This provides baseline security validation (hardcoded secrets, etc.)
|
|
153
153
|
3. **Read Implementation**: Analyze all implemented code files provided
|
|
154
154
|
4. **Identify Attack Surface**: Understand actual implementation and entry points
|
|
@@ -242,7 +242,7 @@ STYLE.md 是项目的**设计真理源(SSOT)**,所有 UI 相关工作必
|
|
|
242
242
|
### Phase 3: 文档生成与优化
|
|
243
243
|
```
|
|
244
244
|
1. 使用模板生成 STYLE.md
|
|
245
|
-
→ 读取
|
|
245
|
+
→ 读取 ${DEVFLOW_CLAUDE_DIR:-.claude}/docs/templates/STYLE_TEMPLATE.md
|
|
246
246
|
→ 填充所有部分(Overview, Color Palette, Typography, ...)
|
|
247
247
|
→ 确保每个部分都有详细说明和示例代码
|
|
248
248
|
|
|
@@ -36,27 +36,27 @@ Your role is to design **complete, executable technical solutions** that ensure
|
|
|
36
36
|
## Rules Integration
|
|
37
37
|
You MUST follow these rules during technical design:
|
|
38
38
|
|
|
39
|
-
1. **Standard Patterns
|
|
39
|
+
1. **Standard Patterns**:
|
|
40
40
|
- Apply Fail Fast principle: validate PRD completeness before design
|
|
41
41
|
- Use Clear Errors when technical requirements are ambiguous
|
|
42
42
|
- Maintain Minimal Output with focused, actionable design details
|
|
43
43
|
- Follow Structured Output format for consistent documentation
|
|
44
44
|
|
|
45
|
-
2. **Agent Coordination
|
|
45
|
+
2. **Agent Coordination**:
|
|
46
46
|
- Update status in LOG.md when design begins and completes
|
|
47
47
|
- Implement proper error handling for incomplete PRD
|
|
48
48
|
- Coordinate with flow-orchestrator for requirement validation
|
|
49
49
|
- Use file locks to prevent concurrent design modifications
|
|
50
50
|
|
|
51
|
-
3. **DateTime Handling
|
|
51
|
+
3. **DateTime Handling**:
|
|
52
52
|
- Include ISO 8601 UTC timestamps in YAML frontmatter
|
|
53
53
|
- Use real system time for created/updated metadata
|
|
54
54
|
- Handle timezone-aware deadline specifications correctly
|
|
55
55
|
- Support cross-platform datetime operations
|
|
56
56
|
|
|
57
|
-
4. **DevFlow Patterns** (
|
|
57
|
+
4. **DevFlow Patterns** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/devflow-conventions.md):
|
|
58
58
|
- Enforce REQ-ID format validation in metadata (REQ-\\d+)
|
|
59
|
-
- Use standardized TECH_DESIGN template from
|
|
59
|
+
- Use standardized TECH_DESIGN template from ${DEVFLOW_CLAUDE_DIR:-.claude}/docs/templates/
|
|
60
60
|
- Apply consistent naming for technical components
|
|
61
61
|
- Maintain traceability links to PRD and existing codebase
|
|
62
62
|
|
|
@@ -65,7 +65,7 @@ You MUST use the unified script infrastructure:
|
|
|
65
65
|
|
|
66
66
|
1. **Get Requirement Paths**: Use `check-prerequisites.sh`
|
|
67
67
|
```bash
|
|
68
|
-
|
|
68
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --paths-only
|
|
69
69
|
# Returns: {"REQ_ID":"REQ-123","REQ_DIR":"/path/to/req","PRD_FILE":"/path/to/PRD.md"}
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -78,13 +78,13 @@ You MUST use the unified script infrastructure:
|
|
|
78
78
|
|
|
79
79
|
3. **Log Events**: Use common.sh logging
|
|
80
80
|
```bash
|
|
81
|
-
source
|
|
81
|
+
source ${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/common.sh
|
|
82
82
|
log_event "$REQ_ID" "Technical design started"
|
|
83
83
|
log_event "$REQ_ID" "Technical design completed"
|
|
84
84
|
```
|
|
85
85
|
|
|
86
86
|
## Template Usage
|
|
87
|
-
MUST use the **self-executable TECH_DESIGN_TEMPLATE.md** from
|
|
87
|
+
MUST use the **self-executable TECH_DESIGN_TEMPLATE.md** from `${DEVFLOW_CLAUDE_DIR:-.claude}/docs/templates/`:
|
|
88
88
|
|
|
89
89
|
1. **Load Template**: Read TECH_DESIGN_TEMPLATE.md to understand Execution Flow
|
|
90
90
|
|
|
@@ -139,7 +139,7 @@ devflow/requirements/${reqId}/
|
|
|
139
139
|
|
|
140
140
|
## Process
|
|
141
141
|
|
|
142
|
-
1. **Run Prerequisites Check**:
|
|
142
|
+
1. **Run Prerequisites Check**: `${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --paths-only`
|
|
143
143
|
2. **Load Tech Stack Baseline (ANTI-TECH-CREEP)**: Read CLAUDE.md to extract approved tech stack
|
|
144
144
|
- **Purpose**: Prevent technology sprawl and unnecessary refactoring
|
|
145
145
|
- **Baseline Source**: CLAUDE.md → "## Technical Architecture" section
|
|
@@ -163,7 +163,7 @@ devflow/requirements/${reqId}/
|
|
|
163
163
|
- API patterns (routes/, controllers/, handlers/)
|
|
164
164
|
- Security implementations (auth/, middleware/)
|
|
165
165
|
- Database connections (database/, db/, config/)
|
|
166
|
-
4. **Load Template**: Read
|
|
166
|
+
4. **Load Template**: Read `${DEVFLOW_CLAUDE_DIR:-.claude}/docs/templates/TECH_DESIGN_TEMPLATE.md`
|
|
167
167
|
5. **Follow Execution Flow**: Execute template's step-by-step flow
|
|
168
168
|
6. **Design Architecture**:
|
|
169
169
|
- System architecture diagram (text-based)
|
|
@@ -25,26 +25,26 @@ model: inherit
|
|
|
25
25
|
## Rules Integration
|
|
26
26
|
你MUST遵循这些规则:
|
|
27
27
|
|
|
28
|
-
1. **Standard Patterns
|
|
28
|
+
1. **Standard Patterns**:
|
|
29
29
|
- Apply Fail Fast: 验证PRD存在且包含UI需求
|
|
30
30
|
- Use Clear Errors: 明确指出缺失的UI需求信息
|
|
31
31
|
- Maintain Minimal Output: 生成单一完整的HTML文件
|
|
32
32
|
- Follow Structured Output: 使用标准化的HTML5结构
|
|
33
33
|
|
|
34
|
-
2. **Agent Coordination
|
|
34
|
+
2. **Agent Coordination**:
|
|
35
35
|
- Update orchestration_status.json 状态为 "ui_prototype_complete"
|
|
36
36
|
- 输出到标准路径: devflow/requirements/${reqId}/UI_PROTOTYPE.html
|
|
37
37
|
- Log events: "UI prototype generation started/completed"
|
|
38
38
|
|
|
39
|
-
3. **DateTime Handling
|
|
39
|
+
3. **DateTime Handling**:
|
|
40
40
|
- HTML注释中包含ISO 8601时间戳
|
|
41
41
|
- 元数据中记录生成时间
|
|
42
42
|
|
|
43
|
-
4. **DevFlow Patterns** (
|
|
43
|
+
4. **DevFlow Patterns** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/devflow-conventions.md):
|
|
44
44
|
- 使用 UI_PROTOTYPE_TEMPLATE.md 作为生成指南
|
|
45
45
|
- 在HTML注释中引用REQ-ID和PRD章节
|
|
46
46
|
|
|
47
|
-
5. **Constitution** (
|
|
47
|
+
5. **Constitution** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md):
|
|
48
48
|
- **Quality First**: 完整的HTML/CSS/JS实现,无部分占位符
|
|
49
49
|
- **Security First**: 无硬编码API密钥,使用环境变量示例
|
|
50
50
|
- **Architectural Consistency**: 遵循项目现有的设计系统(如有)
|
|
@@ -54,7 +54,7 @@ model: inherit
|
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
# 1. 获取需求路径
|
|
57
|
-
|
|
57
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --paths-only
|
|
58
58
|
|
|
59
59
|
# 2. 加载PRD文档
|
|
60
60
|
# PRD_FILE="devflow/requirements/${REQ_ID}/PRD.md"
|
|
@@ -63,13 +63,13 @@ model: inherit
|
|
|
63
63
|
# 分析PRD中的"用户界面"/"交互设计"章节
|
|
64
64
|
|
|
65
65
|
# 4. 记录事件
|
|
66
|
-
source
|
|
66
|
+
source ${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/common.sh
|
|
67
67
|
log_event "$REQ_ID" "UI prototype generation started"
|
|
68
68
|
log_event "$REQ_ID" "UI prototype generation completed"
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
## Template Usage
|
|
72
|
-
MUST使用自执行模板
|
|
72
|
+
MUST使用自执行模板 `${DEVFLOW_CLAUDE_DIR:-.claude}/docs/templates/UI_PROTOTYPE_TEMPLATE.md`:
|
|
73
73
|
|
|
74
74
|
1. **Load Template**: 读取模板理解Execution Flow
|
|
75
75
|
2. **Follow Execution Flow**: 执行模板的10步生成流程:
|
|
@@ -149,7 +149,7 @@ Dieter Rams(Braun), Jony Ive(Apple), Naoto Fukasawa(无印良品), Jasper Morris
|
|
|
149
149
|
|
|
150
150
|
1. **Run Prerequisites Check**:
|
|
151
151
|
```bash
|
|
152
|
-
|
|
152
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/check-prerequisites.sh --json --paths-only
|
|
153
153
|
```
|
|
154
154
|
|
|
155
155
|
2. **Load PRD Document**:
|
|
@@ -165,7 +165,7 @@ Dieter Rams(Braun), Jony Ive(Apple), Naoto Fukasawa(无印良品), Jasper Morris
|
|
|
165
165
|
|
|
166
166
|
4. **Load Template**:
|
|
167
167
|
```bash
|
|
168
|
-
TEMPLATE="
|
|
168
|
+
TEMPLATE="${DEVFLOW_CLAUDE_DIR:-.claude}/docs/templates/UI_PROTOTYPE_TEMPLATE.md"
|
|
169
169
|
```
|
|
170
170
|
|
|
171
171
|
5. **Execute Design Phases**:
|
|
@@ -182,7 +182,7 @@ Dieter Rams(Braun), Jony Ive(Apple), Naoto Fukasawa(无印良品), Jasper Morris
|
|
|
182
182
|
|
|
183
183
|
6. **Constitution Check**:
|
|
184
184
|
```bash
|
|
185
|
-
|
|
185
|
+
${DEVFLOW_CLAUDE_DIR:-.claude}/scripts/validate-constitution.sh --type ui --severity warning
|
|
186
186
|
```
|
|
187
187
|
|
|
188
188
|
7. **Write Complete HTML**:
|
|
@@ -221,7 +221,7 @@ Dieter Rams(Braun), Jony Ive(Apple), Naoto Fukasawa(无印良品), Jasper Morris
|
|
|
221
221
|
|
|
222
222
|
### Constitution Compliance
|
|
223
223
|
|
|
224
|
-
**Reference**:
|
|
224
|
+
**Reference**: `${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md` (v2.0.0)
|
|
225
225
|
|
|
226
226
|
- [ ] **Article I - Quality First**: HTML完整无占位符,所有交互可用
|
|
227
227
|
- [ ] **Article III - Security First**: 无硬编码API密钥,使用示例环境变量
|
|
@@ -61,7 +61,7 @@ $ARGUMENTS = "[--article I] [--verify] [--impact-report] [--amend --proposal pat
|
|
|
61
61
|
### 5. Apply
|
|
62
62
|
```
|
|
63
63
|
→ {SCRIPT:manage} apply <TYPE>
|
|
64
|
-
→ 更新 .claude/
|
|
64
|
+
→ 更新 .claude/rules/project-constitution.md 版本号
|
|
65
65
|
→ 触发模板/代理/脚本同步
|
|
66
66
|
→ 生成 Sync Report
|
|
67
67
|
```
|
|
@@ -150,7 +150,7 @@ consistency, simplicity, and quality.
|
|
|
150
150
|
|
|
151
151
|
**prd-writer 示例**:
|
|
152
152
|
```markdown
|
|
153
|
-
6. **Constitution** (.claude/constitution
|
|
153
|
+
6. **Constitution** (.claude/rules/project-constitution.md):
|
|
154
154
|
- **Quality First**: Ensure PRD completeness, no partial requirements
|
|
155
155
|
- **Security First**: Identify and document security requirements
|
|
156
156
|
- **Architecture Consistency**: Align with existing system architecture
|
|
@@ -544,7 +544,7 @@ User ─(1:N)─ Post ─(1:N)─ Comment
|
|
|
544
544
|
|
|
545
545
|
**Critical**: 这些闸门必须在架构设计之前通过,防止过度设计和复杂性蔓延
|
|
546
546
|
|
|
547
|
-
**Reference**: `.claude/
|
|
547
|
+
**Reference**: `.claude/rules/project-constitution.md` (v2.0.0)
|
|
548
548
|
|
|
549
549
|
### Gate 1: Simplicity Gate (Article VII)
|
|
550
550
|
**原则**: ≤3 Projects/Modules, No Future-Proofing
|
|
@@ -603,7 +603,7 @@ User ─(1:N)─ Post ─(1:N)─ Comment
|
|
|
603
603
|
|
|
604
604
|
*GATE: 必须在任务生成前通过*
|
|
605
605
|
|
|
606
|
-
**Reference**: `.claude/
|
|
606
|
+
**Reference**: `.claude/rules/project-constitution.md` (v2.0.0)
|
|
607
607
|
|
|
608
608
|
### Article I: Quality First (质量至上)
|
|
609
609
|
- [ ] **I.1 - NO PARTIAL IMPLEMENTATION**: Epic 范围完整且明确?无占位符?
|
|
@@ -802,4 +802,4 @@ User ─(1:N)─ Post ─(1:N)─ Comment
|
|
|
802
802
|
- [ ] 实施阶段清晰
|
|
803
803
|
- [ ] 依赖已识别
|
|
804
804
|
- [ ] 资源需求明确
|
|
805
|
-
- [ ] 时间估算合理
|
|
805
|
+
- [ ] 时间估算合理
|
|
@@ -315,7 +315,7 @@ AC1: Given {{PRECONDITION}}
|
|
|
315
315
|
|
|
316
316
|
*GATE: 必须在 Epic 规划前通过*
|
|
317
317
|
|
|
318
|
-
**Reference**: `.claude/
|
|
318
|
+
**Reference**: `.claude/rules/project-constitution.md` (v2.0.0)
|
|
319
319
|
|
|
320
320
|
### Article I: Quality First (质量至上)
|
|
321
321
|
- [ ] **I.1 - NO PARTIAL IMPLEMENTATION**: 需求定义完整且明确?无占位符和模糊表述?
|
|
@@ -459,7 +459,7 @@ With multiple developers:
|
|
|
459
459
|
|
|
460
460
|
### Constitution Alignment (宪法符合性)
|
|
461
461
|
|
|
462
|
-
**Reference**: `.claude/
|
|
462
|
+
**Reference**: `.claude/rules/project-constitution.md` (v2.0.0)
|
|
463
463
|
|
|
464
464
|
- [ ] **Article I - Quality First**: 没有违反 NO PARTIAL IMPLEMENTATION,所有任务完整定义
|
|
465
465
|
- [ ] **Article II - Architectural Consistency**: 没有违反 NO CODE DUPLICATION,复用现有组件
|
|
@@ -495,7 +495,7 @@ With multiple developers:
|
|
|
495
495
|
|
|
496
496
|
### Constitution Compliance
|
|
497
497
|
|
|
498
|
-
**Reference**: `.claude/
|
|
498
|
+
**Reference**: `.claude/rules/project-constitution.md` (v2.0.0)
|
|
499
499
|
|
|
500
500
|
- [ ] **Initial Check**: All 10 Articles validated at planning stage
|
|
501
501
|
- [ ] **Article I-V**: Core principles checked (Quality, Architecture, Security, Performance, Maintainability)
|
|
@@ -510,7 +510,7 @@ With multiple developers:
|
|
|
510
510
|
|
|
511
511
|
**Generated by**: planner agent
|
|
512
512
|
**Based on**: PRD.md, EPIC.md
|
|
513
|
-
**Constitution**: `.claude/
|
|
513
|
+
**Constitution**: `.claude/rules/project-constitution.md` v2.0.0
|
|
514
514
|
**Template Version**: 3.0.0 (Spec-Kit inspired - User Story Centric + Article-based Constitution)
|
|
515
515
|
|
|
516
516
|
---
|
|
@@ -519,5 +519,5 @@ With multiple developers:
|
|
|
519
519
|
|
|
520
520
|
- **PRD**: `devflow/requirements/{{REQ_ID}}/PRD.md`
|
|
521
521
|
- **EPIC**: `devflow/requirements/{{REQ_ID}}/EPIC.md`
|
|
522
|
-
- **Constitution**: `.claude/
|
|
522
|
+
- **Constitution**: `.claude/rules/project-constitution.md`
|
|
523
523
|
- **Execution Log**: `devflow/requirements/{{REQ_ID}}/EXECUTION_LOG.md`
|
|
@@ -30,55 +30,55 @@ type: workflow-guide
|
|
|
30
30
|
## Rules Integration
|
|
31
31
|
You MUST follow these rules during orchestration:
|
|
32
32
|
|
|
33
|
-
0. **Constitution** (
|
|
33
|
+
0. **Constitution** (${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md):
|
|
34
34
|
- **Project Constitution**: Follow all constitutional principles without exception
|
|
35
35
|
- **Quality Gates**: Enforce all quality gate requirements
|
|
36
36
|
- **Architecture Constraints**: Adhere to architectural consistency rules
|
|
37
37
|
- **Security Principles**: Apply security-first approach to all operations
|
|
38
38
|
|
|
39
|
-
1. **Standard Patterns
|
|
39
|
+
1. **Standard Patterns**:
|
|
40
40
|
- Apply Fail Fast principle: validate inputs immediately
|
|
41
41
|
- Use Clear Errors with structured error messages
|
|
42
42
|
- Maintain Minimal Output approach in user communication
|
|
43
43
|
- Follow Trust System principle for sub-agent delegation
|
|
44
44
|
|
|
45
|
-
2. **DevFlow Patterns
|
|
45
|
+
2. **DevFlow Patterns**:
|
|
46
46
|
- Enforce REQ-ID format validation: REQ-\d+
|
|
47
47
|
- Use standard branch naming: feature/${reqId}-${slug(title)}
|
|
48
48
|
- Apply commit message format: feat(${reqId}): ${taskTitle}
|
|
49
49
|
- Maintain complete document chain: PRD → EPIC → TASKS
|
|
50
50
|
|
|
51
|
-
3. **Agent Coordination
|
|
51
|
+
3. **Agent Coordination**:
|
|
52
52
|
- Use file locks for concurrent access prevention
|
|
53
53
|
- Update status in LOG.md after each sub-agent call
|
|
54
54
|
- Implement proper error propagation between agents
|
|
55
55
|
- Follow the defined sub-agent call sequence
|
|
56
56
|
|
|
57
|
-
4. **Branch Operations** (
|
|
57
|
+
4. **Branch Operations** (${DEVFLOW_CLAUDE_DIR:-.claude}/guides/technical-guides/git-github-guide.md):
|
|
58
58
|
- Verify clean working directory before branch creation
|
|
59
59
|
- Use conventional commit messages with Co-authored-by
|
|
60
60
|
- Enforce quality gates before any push operations
|
|
61
61
|
- Clean up branches after successful merge
|
|
62
62
|
|
|
63
|
-
5. **GitHub Operations** (
|
|
63
|
+
5. **GitHub Operations** (${DEVFLOW_CLAUDE_DIR:-.claude}/guides/technical-guides/git-github-guide.md):
|
|
64
64
|
- Check authentication status before PR operations
|
|
65
65
|
- Verify repository is not a template before modifications
|
|
66
66
|
- Use structured PR descriptions with links to documentation
|
|
67
67
|
- Handle permission errors gracefully
|
|
68
68
|
|
|
69
|
-
6. **Test Execution
|
|
69
|
+
6. **Test Execution**:
|
|
70
70
|
- Delegate all testing to qa-tester sub-agent
|
|
71
71
|
- Capture verbose test output for audit trail
|
|
72
72
|
- Enforce minimum coverage thresholds
|
|
73
73
|
- Never mock external services in tests
|
|
74
74
|
|
|
75
|
-
7. **DateTime Handling
|
|
75
|
+
7. **DateTime Handling**:
|
|
76
76
|
- Use real system time in ISO 8601 UTC format
|
|
77
77
|
- Include timestamps in all YAML frontmatter
|
|
78
78
|
- Handle timezone-aware operations correctly
|
|
79
79
|
- Support cross-platform datetime operations
|
|
80
80
|
|
|
81
|
-
8. **MCP Integration
|
|
81
|
+
8. **MCP Integration**:
|
|
82
82
|
- Use WebFetch tool for all external content retrieval
|
|
83
83
|
- Apply URL validation rules for security
|
|
84
84
|
- Implement retry logic with exponential backoff
|
|
@@ -86,7 +86,7 @@ You MUST follow these rules during orchestration:
|
|
|
86
86
|
|
|
87
87
|
Steps:
|
|
88
88
|
0) Constitutional Validation
|
|
89
|
-
- Read and internalize
|
|
89
|
+
- Read and internalize ${DEVFLOW_CLAUDE_DIR:-.claude}/rules/project-constitution.md requirements
|
|
90
90
|
- Validate all inputs against constitutional principles
|
|
91
91
|
- Ensure current environment meets constitutional standards
|
|
92
92
|
- Apply constitutional constraints to the entire workflow
|
|
@@ -28,6 +28,30 @@ TASK_ID=""
|
|
|
28
28
|
JSON_MODE=false
|
|
29
29
|
VERBOSE=false
|
|
30
30
|
|
|
31
|
+
count_matches() {
|
|
32
|
+
local pattern="$1"
|
|
33
|
+
local file="$2"
|
|
34
|
+
local count
|
|
35
|
+
count=$(grep -c "$pattern" "$file" 2>/dev/null || true)
|
|
36
|
+
count=${count//[[:space:]]/}
|
|
37
|
+
printf '%s' "${count:-0}"
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
count_phase_tasks() {
|
|
41
|
+
local header="$1"
|
|
42
|
+
local mode="$2"
|
|
43
|
+
local file="$3"
|
|
44
|
+
awk -v header="$header" -v mode="$mode" '
|
|
45
|
+
$0 ~ header {in_section=1; next}
|
|
46
|
+
in_section && /^## / {exit}
|
|
47
|
+
in_section {
|
|
48
|
+
if (mode == "all" && $0 ~ /^- \[/) {count++}
|
|
49
|
+
if (mode == "complete" && $0 ~ /^- \[x\]/) {count++}
|
|
50
|
+
}
|
|
51
|
+
END {print count+0}
|
|
52
|
+
' "$file"
|
|
53
|
+
}
|
|
54
|
+
|
|
31
55
|
while [[ $# -gt 0 ]]; do
|
|
32
56
|
case "$1" in
|
|
33
57
|
--json)
|
|
@@ -132,8 +156,8 @@ if [[ ! -f "$TASKS_FILE" ]]; then
|
|
|
132
156
|
fi
|
|
133
157
|
|
|
134
158
|
# Count tasks
|
|
135
|
-
TOTAL_INCOMPLETE=$(
|
|
136
|
-
TOTAL_COMPLETE=$(
|
|
159
|
+
TOTAL_INCOMPLETE=$(count_matches "^\- \[ \]" "$TASKS_FILE")
|
|
160
|
+
TOTAL_COMPLETE=$(count_matches "^\- \[x\]" "$TASKS_FILE")
|
|
137
161
|
TOTAL_TASKS=$((TOTAL_INCOMPLETE + TOTAL_COMPLETE))
|
|
138
162
|
|
|
139
163
|
# Calculate percentage
|
|
@@ -189,24 +213,24 @@ fi
|
|
|
189
213
|
|
|
190
214
|
# Get phase breakdown - ensure all values are clean integers
|
|
191
215
|
if grep -q "^## Phase 1:" "$TASKS_FILE" 2>/dev/null; then
|
|
192
|
-
PHASE_1_TOTAL=$(
|
|
193
|
-
PHASE_1_COMPLETE=$(
|
|
216
|
+
PHASE_1_TOTAL=$(count_phase_tasks "^## Phase 1:" "all" "$TASKS_FILE")
|
|
217
|
+
PHASE_1_COMPLETE=$(count_phase_tasks "^## Phase 1:" "complete" "$TASKS_FILE")
|
|
194
218
|
else
|
|
195
219
|
PHASE_1_TOTAL=0
|
|
196
220
|
PHASE_1_COMPLETE=0
|
|
197
221
|
fi
|
|
198
222
|
|
|
199
223
|
if grep -q "^## Phase 2:" "$TASKS_FILE" 2>/dev/null; then
|
|
200
|
-
PHASE_2_TOTAL=$(
|
|
201
|
-
PHASE_2_COMPLETE=$(
|
|
224
|
+
PHASE_2_TOTAL=$(count_phase_tasks "^## Phase 2:" "all" "$TASKS_FILE")
|
|
225
|
+
PHASE_2_COMPLETE=$(count_phase_tasks "^## Phase 2:" "complete" "$TASKS_FILE")
|
|
202
226
|
else
|
|
203
227
|
PHASE_2_TOTAL=0
|
|
204
228
|
PHASE_2_COMPLETE=0
|
|
205
229
|
fi
|
|
206
230
|
|
|
207
231
|
if grep -q "^## Phase 3:" "$TASKS_FILE" 2>/dev/null; then
|
|
208
|
-
PHASE_3_TOTAL=$(
|
|
209
|
-
PHASE_3_COMPLETE=$(
|
|
232
|
+
PHASE_3_TOTAL=$(count_phase_tasks "^## Phase 3:" "all" "$TASKS_FILE")
|
|
233
|
+
PHASE_3_COMPLETE=$(count_phase_tasks "^## Phase 3:" "complete" "$TASKS_FILE")
|
|
210
234
|
else
|
|
211
235
|
PHASE_3_TOTAL=0
|
|
212
236
|
PHASE_3_COMPLETE=0
|
|
@@ -261,4 +285,4 @@ else
|
|
|
261
285
|
echo "────────────────────────────────────────"
|
|
262
286
|
grep "^\- \[" "$TASKS_FILE"
|
|
263
287
|
fi
|
|
264
|
-
fi
|
|
288
|
+
fi
|
|
@@ -26,8 +26,8 @@ set -euo pipefail
|
|
|
26
26
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
27
27
|
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
|
28
28
|
source "$SCRIPT_DIR/common.sh"
|
|
29
|
-
CONSTITUTION_FILE="$REPO_ROOT/.claude/
|
|
30
|
-
AMENDMENT_DIR="$REPO_ROOT/.claude/
|
|
29
|
+
CONSTITUTION_FILE="$REPO_ROOT/.claude/rules/project-constitution.md"
|
|
30
|
+
AMENDMENT_DIR="$REPO_ROOT/.claude/rules/amendments"
|
|
31
31
|
|
|
32
32
|
# 需要更新版本号的文件模式
|
|
33
33
|
declare -a FILES_TO_UPDATE=(
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
# Validates all 10 Constitutional Articles (Article I-X).
|
|
7
7
|
# Inspired by spec-kit's quality gate philosophy.
|
|
8
8
|
#
|
|
9
|
-
# Constitution Reference: .claude/
|
|
9
|
+
# Constitution Reference: .claude/rules/project-constitution.md
|
|
10
10
|
# Article I: Quality First
|
|
11
11
|
# Article II: Architectural Consistency
|
|
12
12
|
# Article III: Security First
|
|
@@ -181,7 +181,7 @@ status: "released"
|
|
|
181
181
|
### Constitution violation?
|
|
182
182
|
- **Real-time check**: constitution-guardian guardrail (PreToolUse hook)
|
|
183
183
|
- **Batch validation**: Run `.claude/scripts/validate-constitution.sh`
|
|
184
|
-
- **Reference**: See
|
|
184
|
+
- **Reference**: See `.claude/rules/project-constitution.md` v2.0.0
|
|
185
185
|
|
|
186
186
|
### TDD order violated?
|
|
187
187
|
- **Real-time check**: devflow-tdd-enforcer guardrail (PreToolUse hook)
|