monoco-toolkit 0.3.9__py3-none-any.whl → 0.3.10__py3-none-any.whl
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.
- monoco/core/config.py +7 -0
- monoco/core/hooks/builtin/git_cleanup.py +1 -1
- monoco/core/injection.py +63 -29
- monoco/core/integrations.py +2 -2
- monoco/core/output.py +5 -5
- monoco/core/registry.py +7 -1
- monoco/core/resource/__init__.py +5 -0
- monoco/core/resource/finder.py +98 -0
- monoco/core/resource/manager.py +91 -0
- monoco/core/resource/models.py +35 -0
- monoco/core/resources/en/{SKILL.md → skills/monoco_core/SKILL.md} +2 -0
- monoco/core/resources/zh/{SKILL.md → skills/monoco_core/SKILL.md} +2 -0
- monoco/core/skill_framework.py +292 -0
- monoco/core/skills.py +471 -371
- monoco/core/sync.py +73 -1
- monoco/core/workflow_converter.py +420 -0
- monoco/features/agent/__init__.py +2 -2
- monoco/features/agent/adapter.py +31 -0
- monoco/features/agent/apoptosis.py +44 -0
- monoco/features/agent/cli.py +101 -144
- monoco/features/agent/config.py +35 -21
- monoco/features/agent/defaults.py +6 -49
- monoco/features/agent/engines.py +32 -6
- monoco/features/agent/manager.py +6 -1
- monoco/features/agent/models.py +2 -2
- monoco/features/agent/resources/atoms/atom-code-dev.yaml +61 -0
- monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml +73 -0
- monoco/features/agent/resources/atoms/atom-knowledge.yaml +55 -0
- monoco/features/agent/resources/atoms/atom-review.yaml +60 -0
- monoco/features/agent/resources/en/skills/flow_engineer/SKILL.md +94 -0
- monoco/features/agent/resources/en/skills/flow_manager/SKILL.md +93 -0
- monoco/features/agent/resources/en/skills/flow_planner/SKILL.md +85 -0
- monoco/features/agent/resources/en/skills/flow_reviewer/SKILL.md +114 -0
- monoco/features/agent/resources/roles/role-engineer.yaml +49 -0
- monoco/features/agent/resources/roles/role-manager.yaml +46 -0
- monoco/features/agent/resources/roles/role-planner.yaml +46 -0
- monoco/features/agent/resources/roles/role-reviewer.yaml +47 -0
- monoco/features/agent/resources/workflows/workflow-dev.yaml +83 -0
- monoco/features/agent/resources/workflows/workflow-issue-create.yaml +72 -0
- monoco/features/agent/resources/workflows/workflow-review.yaml +94 -0
- monoco/features/agent/resources/zh/skills/flow_planner/SKILL.md +259 -0
- monoco/features/agent/resources/zh/skills/flow_reviewer/SKILL.md +137 -0
- monoco/features/agent/worker.py +38 -2
- monoco/features/glossary/__init__.py +0 -0
- monoco/features/glossary/adapter.py +31 -0
- monoco/features/glossary/config.py +5 -0
- monoco/features/glossary/resources/en/AGENTS.md +29 -0
- monoco/features/glossary/resources/en/skills/monoco_glossary/SKILL.md +35 -0
- monoco/features/glossary/resources/zh/AGENTS.md +29 -0
- monoco/features/glossary/resources/zh/skills/monoco_glossary/SKILL.md +35 -0
- monoco/features/i18n/resources/en/skills/i18n_scan_workflow/SKILL.md +105 -0
- monoco/features/i18n/resources/en/{SKILL.md → skills/monoco_i18n/SKILL.md} +2 -0
- monoco/features/i18n/resources/zh/{SKILL.md → skills/monoco_i18n/SKILL.md} +2 -0
- monoco/features/issue/core.py +45 -6
- monoco/features/issue/engine/machine.py +5 -2
- monoco/features/issue/models.py +1 -0
- monoco/features/issue/resources/en/skills/issue_create_workflow/SKILL.md +167 -0
- monoco/features/issue/resources/en/skills/issue_develop_workflow/SKILL.md +224 -0
- monoco/features/issue/resources/en/skills/issue_lifecycle_workflow/SKILL.md +159 -0
- monoco/features/issue/resources/en/skills/issue_refine_workflow/SKILL.md +203 -0
- monoco/features/issue/resources/en/{SKILL.md → skills/monoco_issue/SKILL.md} +2 -0
- monoco/features/issue/resources/zh/skills/issue_create_workflow/SKILL.md +167 -0
- monoco/features/issue/resources/zh/skills/issue_develop_workflow/SKILL.md +224 -0
- monoco/features/issue/resources/zh/skills/issue_refine_workflow/SKILL.md +203 -0
- monoco/features/issue/resources/zh/{SKILL.md → skills/monoco_issue/SKILL.md} +2 -0
- monoco/features/memo/resources/en/skills/monoco_memo/SKILL.md +77 -0
- monoco/features/memo/resources/en/skills/note_processing_workflow/SKILL.md +140 -0
- monoco/features/memo/resources/zh/{SKILL.md → skills/monoco_memo/SKILL.md} +2 -0
- monoco/features/spike/resources/en/{SKILL.md → skills/monoco_spike/SKILL.md} +2 -0
- monoco/features/spike/resources/en/skills/research_workflow/SKILL.md +121 -0
- monoco/features/spike/resources/zh/{SKILL.md → skills/monoco_spike/SKILL.md} +2 -0
- monoco_toolkit-0.3.10.dist-info/METADATA +124 -0
- monoco_toolkit-0.3.10.dist-info/RECORD +156 -0
- monoco/features/agent/reliability.py +0 -106
- monoco/features/agent/resources/skills/flow_reviewer/SKILL.md +0 -114
- monoco_toolkit-0.3.9.dist-info/METADATA +0 -127
- monoco_toolkit-0.3.9.dist-info/RECORD +0 -115
- /monoco/features/agent/resources/{skills → zh/skills}/flow_engineer/SKILL.md +0 -0
- /monoco/features/agent/resources/{skills → zh/skills}/flow_manager/SKILL.md +0 -0
- /monoco/features/i18n/resources/{skills → zh/skills}/i18n_scan_workflow/SKILL.md +0 -0
- /monoco/features/issue/resources/{skills → zh/skills}/issue_lifecycle_workflow/SKILL.md +0 -0
- /monoco/features/memo/resources/{skills → zh/skills}/note_processing_workflow/SKILL.md +0 -0
- /monoco/features/spike/resources/{skills → zh/skills}/research_workflow/SKILL.md +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.10.dist-info}/WHEEL +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.10.dist-info}/entry_points.txt +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.10.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-refine-workflow
|
|
3
|
+
description: Investigate and refine Issue, supplement technical details and implementation plan (Copilot Mode)
|
|
4
|
+
type: flow
|
|
5
|
+
domain: issue
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Issue Refine Workflow
|
|
10
|
+
|
|
11
|
+
Standardized workflow for technical investigation, architecture analysis and solution design for newly created or pending refinement Issues.
|
|
12
|
+
|
|
13
|
+
**Applicable Scenario**: Copilot Mode (Human-led, AI-assisted)
|
|
14
|
+
**Target Users**: Developers who need to deeply understand problems and formulate implementation plans
|
|
15
|
+
|
|
16
|
+
## Workflow State Machine
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
stateDiagram-v2
|
|
20
|
+
[*] --> Investigate: Start Refinement
|
|
21
|
+
|
|
22
|
+
Investigate --> Analyze: Gather Information
|
|
23
|
+
Investigate --> Investigate: Insufficient Information<br/>(Continue Investigation)
|
|
24
|
+
|
|
25
|
+
Analyze --> Architect: Architecture Design Required
|
|
26
|
+
Analyze --> Document: Direct Documentation
|
|
27
|
+
|
|
28
|
+
Architect --> Document: Design Complete
|
|
29
|
+
|
|
30
|
+
Document --> [*]: Issue Refinement Complete
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Execution Steps
|
|
34
|
+
|
|
35
|
+
### 1. Investigate
|
|
36
|
+
|
|
37
|
+
- **Goal**: Comprehensively gather information related to the Issue
|
|
38
|
+
- **Input**: Issue Ticket, related code, documentation
|
|
39
|
+
- **Output**: Information gathering report
|
|
40
|
+
- **Checkpoints**:
|
|
41
|
+
- [ ] Read Issue description, understand core problem
|
|
42
|
+
- [ ] Identify related code modules and files
|
|
43
|
+
- [ ] Review related Issue/PR history
|
|
44
|
+
- [ ] Check external dependencies and constraints
|
|
45
|
+
- [ ] Collect similar implementation references (Spike)
|
|
46
|
+
|
|
47
|
+
**Investigation Dimensions**:
|
|
48
|
+
| Dimension | Investigation Content |
|
|
49
|
+
|-----------|----------------------|
|
|
50
|
+
| Code | Current implementation of related modules |
|
|
51
|
+
| History | Related Issues, PRs, design documents |
|
|
52
|
+
| Dependencies | External libraries, APIs, service dependencies |
|
|
53
|
+
| Constraints | Performance requirements, security requirements, compatibility |
|
|
54
|
+
| References | Best practices for similar features |
|
|
55
|
+
|
|
56
|
+
### 2. Analyze
|
|
57
|
+
|
|
58
|
+
- **Goal**: Analyze gathered information, identify key problems and solution options
|
|
59
|
+
- **Checkpoints**:
|
|
60
|
+
- [ ] Analyze architecture inheritance (how to fit into existing architecture)
|
|
61
|
+
- [ ] Assess security impact
|
|
62
|
+
- [ ] Assess performance impact
|
|
63
|
+
- [ ] Assess maintainability
|
|
64
|
+
- [ ] Identify potential risks and mitigation measures
|
|
65
|
+
|
|
66
|
+
**Analysis Framework**:
|
|
67
|
+
|
|
68
|
+
#### Architecture Inheritance
|
|
69
|
+
- Are existing architecture patterns applicable?
|
|
70
|
+
- Is a new abstraction layer needed?
|
|
71
|
+
- Impact on coupling with existing modules?
|
|
72
|
+
|
|
73
|
+
#### Security Assessment
|
|
74
|
+
- Input validation requirements
|
|
75
|
+
- Access control requirements
|
|
76
|
+
- Data protection requirements
|
|
77
|
+
- Potential attack surface analysis
|
|
78
|
+
|
|
79
|
+
#### Performance Assessment
|
|
80
|
+
- Time complexity impact
|
|
81
|
+
- Space complexity impact
|
|
82
|
+
- Concurrency/parallelism requirements
|
|
83
|
+
- Resource usage estimation
|
|
84
|
+
|
|
85
|
+
#### Maintainability Assessment
|
|
86
|
+
- Code complexity changes
|
|
87
|
+
- Test coverage requirements
|
|
88
|
+
- Documentation update requirements
|
|
89
|
+
- Future extensibility
|
|
90
|
+
|
|
91
|
+
### 3. Architect (Optional)
|
|
92
|
+
|
|
93
|
+
- **Goal**: Architecture design for complex Issues
|
|
94
|
+
- **Applicable**: Issues involving architecture changes or large features
|
|
95
|
+
- **Checkpoints**:
|
|
96
|
+
- [ ] Determine technical solution selection
|
|
97
|
+
- [ ] Design interfaces and interaction protocols
|
|
98
|
+
- [ ] Plan data model changes
|
|
99
|
+
- [ ] Define implementation milestones
|
|
100
|
+
|
|
101
|
+
**Outputs**:
|
|
102
|
+
- Architecture Decision Record (ADR)
|
|
103
|
+
- Interface design document
|
|
104
|
+
- Data model changes
|
|
105
|
+
- Milestone plan
|
|
106
|
+
|
|
107
|
+
### 4. Document
|
|
108
|
+
|
|
109
|
+
- **Goal**: Update analysis results to Issue
|
|
110
|
+
- **Checkpoints**:
|
|
111
|
+
- [ ] Update technical task list
|
|
112
|
+
- [ ] Add architecture decision explanation
|
|
113
|
+
- [ ] Supplement risks and mitigation measures
|
|
114
|
+
- [ ] Update acceptance criteria (if needed)
|
|
115
|
+
- [ ] Add reference links and dependency descriptions
|
|
116
|
+
- [ ] Run `monoco issue lint` to verify compliance
|
|
117
|
+
|
|
118
|
+
**Refined Issue Structure**:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
## Objective
|
|
122
|
+
[Original Content]
|
|
123
|
+
|
|
124
|
+
## Acceptance Criteria
|
|
125
|
+
- [ ] Acceptance criterion 1
|
|
126
|
+
- [ ] Acceptance criterion 2
|
|
127
|
+
|
|
128
|
+
## Technical Analysis
|
|
129
|
+
|
|
130
|
+
### Current State Analysis
|
|
131
|
+
Describe current code state and related implementation.
|
|
132
|
+
|
|
133
|
+
### Solution Selection
|
|
134
|
+
| Solution | Pros | Cons | Decision |
|
|
135
|
+
|----------|------|------|----------|
|
|
136
|
+
| A | ... | ... | Adopted/Alternative |
|
|
137
|
+
| B | ... | ... | Alternative/Abandoned |
|
|
138
|
+
|
|
139
|
+
### Risk Assessment
|
|
140
|
+
| Risk | Impact | Mitigation |
|
|
141
|
+
|------|--------|------------|
|
|
142
|
+
| Risk1 | High/Medium/Low | Measure... |
|
|
143
|
+
|
|
144
|
+
## Technical Tasks
|
|
145
|
+
- [ ] Task 1
|
|
146
|
+
- [ ] Task 2
|
|
147
|
+
|
|
148
|
+
## References
|
|
149
|
+
- Related Issue: #XXX
|
|
150
|
+
- Reference Implementation: [Link]
|
|
151
|
+
- ADR: [Link]
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Decision Branches
|
|
155
|
+
|
|
156
|
+
| Condition | Action |
|
|
157
|
+
|-----------|--------|
|
|
158
|
+
| Insufficient information | Return to Investigate, continue gathering |
|
|
159
|
+
| Architecture design needed | Enter Architect phase |
|
|
160
|
+
| Solution is clear | Directly enter Document phase |
|
|
161
|
+
| Blocking dependency found | Create dependency Issue, mark current Issue |
|
|
162
|
+
| Problem too complex | Suggest splitting into multiple Issues |
|
|
163
|
+
|
|
164
|
+
## Refinement Level Guide
|
|
165
|
+
|
|
166
|
+
| Issue Type | Refinement Requirements |
|
|
167
|
+
|------------|------------------------|
|
|
168
|
+
| Epic | Must include architecture design, milestones, subtask decomposition |
|
|
169
|
+
| Feature | Must include technical solution, risk assessment, task decomposition |
|
|
170
|
+
| Chore | Must include implementation steps, impact scope |
|
|
171
|
+
| Fix | Must include root cause analysis, fix solution, test cases |
|
|
172
|
+
|
|
173
|
+
## Related Commands
|
|
174
|
+
|
|
175
|
+
```bash
|
|
176
|
+
# View Issue details
|
|
177
|
+
monoco issue show <ID>
|
|
178
|
+
|
|
179
|
+
# Check compliance
|
|
180
|
+
monoco issue lint
|
|
181
|
+
|
|
182
|
+
# Sync file tracking
|
|
183
|
+
monoco issue sync-files
|
|
184
|
+
|
|
185
|
+
# View related Spike
|
|
186
|
+
monoco spike list
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Relationship with flow_engineer
|
|
190
|
+
|
|
191
|
+
This workflow complements `flow_engineer`:
|
|
192
|
+
- `issue-refine-workflow`: Focuses on Issue refinement phase, completing technical investigation before development
|
|
193
|
+
- `flow_engineer`: Focuses on code implementation phase, executing Investigate → Code → Test → Report → Submit
|
|
194
|
+
|
|
195
|
+
Information gathered during refinement phase will provide important input for the Engineer phase's Investigate.
|
|
196
|
+
|
|
197
|
+
## Copilot Mode Tips
|
|
198
|
+
|
|
199
|
+
As an AI Copilot, you should:
|
|
200
|
+
1. **Explore proactively**: Help developers discover potential issues and edge cases
|
|
201
|
+
2. **Provide comparisons**: Give multiple technical solutions, analyze pros and cons
|
|
202
|
+
3. **Assist evaluation**: Help with security, performance impact assessment
|
|
203
|
+
4. **Remind omissions**: Check for missing key information or risk points
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-create-workflow
|
|
3
|
+
description: 从 Memo 提取改进线索,分类并创建 Issue Ticket (Copilot 模式)
|
|
4
|
+
type: flow
|
|
5
|
+
domain: issue
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Issue Create Workflow
|
|
10
|
+
|
|
11
|
+
从 Memo 中提取改进线索,分析并创建结构化 Issue Ticket 的标准化工作流。
|
|
12
|
+
|
|
13
|
+
**适用场景**: Copilot 模式(人类主导,AI 辅助)
|
|
14
|
+
**目标用户**: 需要快速将想法/笔记转化为可执行任务的开发者
|
|
15
|
+
|
|
16
|
+
## 工作流状态机
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
stateDiagram-v2
|
|
20
|
+
[*] --> Extract: 读取 Memo
|
|
21
|
+
|
|
22
|
+
Extract --> Classify: 识别类型
|
|
23
|
+
Extract --> Archive: 无价值
|
|
24
|
+
|
|
25
|
+
Classify --> Design: 需要架构设计
|
|
26
|
+
Classify --> Direct: 直接创建
|
|
27
|
+
|
|
28
|
+
Design --> Create: 设计完成
|
|
29
|
+
Direct --> Create: 直接创建
|
|
30
|
+
|
|
31
|
+
Archive --> [*]: 归档 Memo
|
|
32
|
+
Create --> [*]: Issue 创建完成
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 执行步骤
|
|
36
|
+
|
|
37
|
+
### 1. Extract (提取)
|
|
38
|
+
|
|
39
|
+
- **目标**: 从 Memo 中提取关键改进线索
|
|
40
|
+
- **输入**: Memo 文件或临时笔记
|
|
41
|
+
- **输出**: 结构化的改进线索列表
|
|
42
|
+
- **检查点**:
|
|
43
|
+
- [ ] 运行 `monoco memo list` 查看待处理 Memo
|
|
44
|
+
- [ ] 分析每个 Memo 的改进类型和影响范围
|
|
45
|
+
- [ ] 识别可执行的改进点(非纯参考资料)
|
|
46
|
+
- [ ] 记录改进的动机和预期效果
|
|
47
|
+
|
|
48
|
+
**分析维度**:
|
|
49
|
+
| 维度 | 问题 |
|
|
50
|
+
|------|------|
|
|
51
|
+
| 价值 | 这个改进解决什么问题? |
|
|
52
|
+
| 范围 | 影响哪些模块/功能? |
|
|
53
|
+
| 紧急 | 是现在做还是以后做? |
|
|
54
|
+
| 可行 | 是否有足够信息开始? |
|
|
55
|
+
|
|
56
|
+
### 2. Classify (分类)
|
|
57
|
+
|
|
58
|
+
- **目标**: 确定 Issue 类型和优先级
|
|
59
|
+
- **检查点**:
|
|
60
|
+
- [ ] 判断是否为架构级改进(→ Epic)
|
|
61
|
+
- [ ] 判断是否为用户价值增量(→ Feature)
|
|
62
|
+
- [ ] 判断是否为工程债务(→ Chore)
|
|
63
|
+
- [ ] 判断是否为缺陷修复(→ Fix)
|
|
64
|
+
- [ ] 评估是否需要前置架构设计
|
|
65
|
+
|
|
66
|
+
**决策分支**:
|
|
67
|
+
|
|
68
|
+
| 条件 | 类型 | 下一步 |
|
|
69
|
+
|------|------|--------|
|
|
70
|
+
| 架构愿景级改进,需要分解为多个 Feature | Epic | → Design |
|
|
71
|
+
| 用户可交付价值,有明确验收标准 | Feature | → Direct |
|
|
72
|
+
| 工程维护任务,技术债务清理 | Chore | → Direct |
|
|
73
|
+
| 缺陷修复,有明确复现步骤 | Fix | → Direct |
|
|
74
|
+
| 纯参考资料,无直接改进价值 | - | → Archive |
|
|
75
|
+
| 需要架构设计才能估算工作量 | - | → Design |
|
|
76
|
+
|
|
77
|
+
### 3. Design (设计) - 可选
|
|
78
|
+
|
|
79
|
+
- **目标**: 对复杂改进进行初步架构设计
|
|
80
|
+
- **适用**: Epic 或大型 Feature
|
|
81
|
+
- **检查点**:
|
|
82
|
+
- [ ] 分析现有架构继承性
|
|
83
|
+
- [ ] 确定技术方案方向
|
|
84
|
+
- [ ] 识别依赖关系和风险点
|
|
85
|
+
- [ ] 估算工作量和里程碑
|
|
86
|
+
|
|
87
|
+
**输出物**:
|
|
88
|
+
- 架构决策记录 (ADR) 草稿
|
|
89
|
+
- 子任务分解建议
|
|
90
|
+
- 依赖 Issue 列表
|
|
91
|
+
|
|
92
|
+
### 4. Create (创建)
|
|
93
|
+
|
|
94
|
+
- **目标**: 创建符合规范的 Issue
|
|
95
|
+
- **检查点**:
|
|
96
|
+
- [ ] 运行 `monoco issue create <type> -t "标题"`
|
|
97
|
+
- [ ] 编写清晰的描述和背景
|
|
98
|
+
- [ ] 定义可验证的验收标准(至少 2 个 Checkbox)
|
|
99
|
+
- [ ] 设置依赖关系(如需要)
|
|
100
|
+
- [ ] 关联相关 Memo(如适用)
|
|
101
|
+
- [ ] 运行 `monoco issue lint` 验证合规性
|
|
102
|
+
|
|
103
|
+
**Issue 内容模板**:
|
|
104
|
+
|
|
105
|
+
```markdown
|
|
106
|
+
## Objective
|
|
107
|
+
清晰描述这个 Issue 的目标和预期结果。
|
|
108
|
+
|
|
109
|
+
## Acceptance Criteria
|
|
110
|
+
- [ ] 验收标准 1
|
|
111
|
+
- [ ] 验收标准 2
|
|
112
|
+
|
|
113
|
+
## Technical Tasks
|
|
114
|
+
- [ ] 技术任务 1
|
|
115
|
+
- [ ] 技术任务 2
|
|
116
|
+
|
|
117
|
+
## Related
|
|
118
|
+
- Parent: EPIC-XXXX (如适用)
|
|
119
|
+
- Related Memo: MEMO-XXXX (如适用)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 5. Archive (归档) - 可选
|
|
123
|
+
|
|
124
|
+
- **目标**: 对无直接改进价值的 Memo 进行归档
|
|
125
|
+
- **检查点**:
|
|
126
|
+
- [ ] 确认 Memo 内容为纯参考资料
|
|
127
|
+
- [ ] 记录归档原因
|
|
128
|
+
- [ ] 更新 Memo 状态(如系统支持)
|
|
129
|
+
|
|
130
|
+
## Issue 类型指南
|
|
131
|
+
|
|
132
|
+
| 类型 | 用途 | 前缀 | Mindset | 示例 |
|
|
133
|
+
|------|------|------|---------|------|
|
|
134
|
+
| Epic | 宏大目标、愿景容器 | EPIC- | Architect | 重构核心架构 |
|
|
135
|
+
| Feature | 用户价值增量 | FEAT- | Product Owner | 添加导出功能 |
|
|
136
|
+
| Chore | 工程性事务 | CHORE- | Builder | 升级依赖版本 |
|
|
137
|
+
| Fix | 缺陷修复 | FIX- | Debugger | 修复内存泄漏 |
|
|
138
|
+
|
|
139
|
+
## 相关命令
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# 查看待处理 Memo
|
|
143
|
+
monoco memo list
|
|
144
|
+
|
|
145
|
+
# 创建 Issue
|
|
146
|
+
monoco issue create feature -t "标题"
|
|
147
|
+
monoco issue create chore -t "标题"
|
|
148
|
+
monoco issue create fix -t "标题"
|
|
149
|
+
monoco issue create epic -t "标题"
|
|
150
|
+
|
|
151
|
+
# 验证 Issue 合规性
|
|
152
|
+
monoco issue lint
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## 与 flow_engineer 的关系
|
|
156
|
+
|
|
157
|
+
此工作流与 `flow_engineer` 互补:
|
|
158
|
+
- `issue-create-workflow`: 关注 Issue 创建阶段,将想法转化为可执行任务
|
|
159
|
+
- `flow_engineer`: 关注代码实现阶段,执行 Investigate → Code → Test → Report → Submit
|
|
160
|
+
|
|
161
|
+
## Copilot 模式提示
|
|
162
|
+
|
|
163
|
+
作为 AI Copilot,你应该:
|
|
164
|
+
1. **主动提问**: 当 Memo 内容不清晰时,询问人类开发者意图
|
|
165
|
+
2. **提供选项**: 给出多个分类建议,说明理由
|
|
166
|
+
3. **协助起草**: 帮助编写 Issue 描述和验收标准
|
|
167
|
+
4. **提醒合规**: 确保创建的 Issue 符合项目规范
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: issue-develop-workflow
|
|
3
|
+
description: 执行 Issue 开发、测试、提交和评审的完整工作流 (Copilot 模式)
|
|
4
|
+
type: flow
|
|
5
|
+
domain: issue
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Issue Develop Workflow
|
|
10
|
+
|
|
11
|
+
执行 Issue 开发、测试、提交、评审和合并的完整标准化工作流。
|
|
12
|
+
|
|
13
|
+
**适用场景**: Copilot 模式(人类主导,AI 辅助)
|
|
14
|
+
**目标用户**: 负责实现功能或修复缺陷的开发者
|
|
15
|
+
|
|
16
|
+
## 工作流状态机
|
|
17
|
+
|
|
18
|
+
```mermaid
|
|
19
|
+
stateDiagram-v2
|
|
20
|
+
[*] --> Setup: 开始开发
|
|
21
|
+
|
|
22
|
+
Setup --> Develop: 环境就绪
|
|
23
|
+
Setup --> Setup: 依赖未满足<br/>(等待解决)
|
|
24
|
+
|
|
25
|
+
Develop --> Test: 编码完成
|
|
26
|
+
Develop --> Develop: 需要迭代<br/>(继续开发)
|
|
27
|
+
|
|
28
|
+
Test --> Submit: 测试通过
|
|
29
|
+
Test --> Develop: 测试失败<br/>(修复代码)
|
|
30
|
+
|
|
31
|
+
state "Review Loop" as ReviewLoop {
|
|
32
|
+
Submit --> Review: 提交评审
|
|
33
|
+
Review --> Fix: 需要修改
|
|
34
|
+
Fix --> Submit: 重新提交
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Review --> Merge: 评审通过
|
|
38
|
+
|
|
39
|
+
Merge --> [*]: 合并完成
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 执行步骤
|
|
43
|
+
|
|
44
|
+
### 1. Setup (准备)
|
|
45
|
+
|
|
46
|
+
- **目标**: 准备开发环境,确保可以开始编码
|
|
47
|
+
- **检查点**:
|
|
48
|
+
- [ ] 运行 `monoco issue start <ID> --branch` 创建功能分支
|
|
49
|
+
- [ ] 确认分支已创建并切换
|
|
50
|
+
- [ ] 验证当前不在 main/master 分支
|
|
51
|
+
- [ ] 检查依赖 Issue 是否已完成
|
|
52
|
+
- [ ] 确认 Issue 已细化(有技术任务清单)
|
|
53
|
+
|
|
54
|
+
**环境检查清单**:
|
|
55
|
+
| 检查项 | 命令/方法 |
|
|
56
|
+
|--------|-----------|
|
|
57
|
+
| 当前分支 | `git branch --show-current` |
|
|
58
|
+
| 分支状态 | `git status` |
|
|
59
|
+
| 依赖 Issue | `monoco issue show <ID>` |
|
|
60
|
+
| 代码规范 | 检查项目 lint 配置 |
|
|
61
|
+
|
|
62
|
+
### 2. Develop (开发)
|
|
63
|
+
|
|
64
|
+
- **目标**: 实现功能或修复缺陷
|
|
65
|
+
- **策略**: 迭代开发,小步提交
|
|
66
|
+
- **检查点**:
|
|
67
|
+
- [ ] 遵循项目代码规范
|
|
68
|
+
- [ ] 编写/更新单元测试
|
|
69
|
+
- [ ] 定期提交代码(小步提交)
|
|
70
|
+
- [ ] 更新文件追踪(`monoco issue sync-files`)
|
|
71
|
+
- [ ] 保持代码可审查性(单次提交 < 400 行)
|
|
72
|
+
|
|
73
|
+
**开发原则**:
|
|
74
|
+
| 原则 | 说明 |
|
|
75
|
+
|------|------|
|
|
76
|
+
| 小步提交 | 每次提交一个逻辑单元 |
|
|
77
|
+
| 测试先行 | 优先编写测试用例 |
|
|
78
|
+
| 持续同步 | 及时更新文件追踪 |
|
|
79
|
+
| 保持专注 | 避免无关修改 |
|
|
80
|
+
|
|
81
|
+
### 3. Test (测试)
|
|
82
|
+
|
|
83
|
+
- **目标**: 确保代码质量和功能正确性
|
|
84
|
+
- **检查点**:
|
|
85
|
+
- [ ] 运行单元测试,确保通过
|
|
86
|
+
- [ ] 运行集成测试(如适用)
|
|
87
|
+
- [ ] 运行代码规范检查(lint)
|
|
88
|
+
- [ ] 手动验证功能(如需要)
|
|
89
|
+
- [ ] 检查测试覆盖率
|
|
90
|
+
|
|
91
|
+
**测试层次**:
|
|
92
|
+
```
|
|
93
|
+
单元测试 → 集成测试 → 端到端测试 → 手动验证
|
|
94
|
+
↑ ↑ ↑ ↑
|
|
95
|
+
必须 推荐 按需 按需
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### 4. Submit (提交)
|
|
99
|
+
|
|
100
|
+
- **目标**: 准备代码评审
|
|
101
|
+
- **检查点**:
|
|
102
|
+
- [ ] 运行 `monoco issue lint` 检查合规性
|
|
103
|
+
- [ ] 修复所有 Lint 错误
|
|
104
|
+
- [ ] 更新任务清单状态(标记完成项)
|
|
105
|
+
- [ ] 编写清晰的提交信息
|
|
106
|
+
- [ ] 运行 `monoco issue submit <ID>`
|
|
107
|
+
|
|
108
|
+
**提交信息规范**:
|
|
109
|
+
```
|
|
110
|
+
<type>(<scope>): <subject>
|
|
111
|
+
|
|
112
|
+
<body>
|
|
113
|
+
|
|
114
|
+
Refs: <ISSUE-ID>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
| 类型 | 用途 |
|
|
118
|
+
|------|------|
|
|
119
|
+
| feat | 新功能 |
|
|
120
|
+
| fix | 缺陷修复 |
|
|
121
|
+
| docs | 文档更新 |
|
|
122
|
+
| style | 代码格式 |
|
|
123
|
+
| refactor | 重构 |
|
|
124
|
+
| test | 测试相关 |
|
|
125
|
+
| chore | 构建/工具 |
|
|
126
|
+
|
|
127
|
+
### 5. Review (评审)
|
|
128
|
+
|
|
129
|
+
- **目标**: 代码质量和流程合规检查
|
|
130
|
+
- **检查点**:
|
|
131
|
+
- [ ] 功能是否正确实现
|
|
132
|
+
- [ ] 代码是否符合设计规范
|
|
133
|
+
- [ ] 测试是否充分
|
|
134
|
+
- [ ] 文档是否同步更新
|
|
135
|
+
- [ ] 是否遵循项目规范
|
|
136
|
+
|
|
137
|
+
**评审维度**:
|
|
138
|
+
| 维度 | 检查内容 |
|
|
139
|
+
|------|----------|
|
|
140
|
+
| 正确性 | 功能是否按预期工作 |
|
|
141
|
+
| 设计 | 是否符合架构设计 |
|
|
142
|
+
| 测试 | 测试覆盖是否充分 |
|
|
143
|
+
| 规范 | 是否遵循代码规范 |
|
|
144
|
+
| 文档 | 文档是否同步更新 |
|
|
145
|
+
| 性能 | 是否有明显性能问题 |
|
|
146
|
+
| 安全 | 是否有安全隐患 |
|
|
147
|
+
|
|
148
|
+
### 6. Merge (合并)
|
|
149
|
+
|
|
150
|
+
- **目标**: 完成 Issue,合并代码
|
|
151
|
+
- **检查点**:
|
|
152
|
+
- [ ] 代码已通过评审
|
|
153
|
+
- [ ] 所有 CI 检查通过
|
|
154
|
+
- [ ] 代码已合并到主分支
|
|
155
|
+
- [ ] 运行 `monoco issue close <ID> --solution completed --prune`
|
|
156
|
+
- [ ] 验证分支已清理
|
|
157
|
+
- [ ] 更新 Review Comments(记录评审反馈)
|
|
158
|
+
|
|
159
|
+
## 决策分支
|
|
160
|
+
|
|
161
|
+
| 条件 | 动作 |
|
|
162
|
+
|------|------|
|
|
163
|
+
| 依赖 Issue 未完成 | 返回 Setup,等待依赖 |
|
|
164
|
+
| 测试失败 | 返回 Develop,修复代码 |
|
|
165
|
+
| Lint 失败 | 修复合规性问题,重新 Submit |
|
|
166
|
+
| 评审需要修改 | 返回 Fix,按反馈修改 |
|
|
167
|
+
| 评审通过 | 进入 Merge,合并并清理 |
|
|
168
|
+
|
|
169
|
+
## 合规要求
|
|
170
|
+
|
|
171
|
+
- **禁止**: 在 main/master 分支直接修改代码
|
|
172
|
+
- **必须**: 使用 `monoco issue start --branch` 创建功能分支
|
|
173
|
+
- **必须**: 所有单元测试通过后才能 Submit
|
|
174
|
+
- **必须**: 每个 Issue 至少 2 个 Checkbox
|
|
175
|
+
- **必须**: Review/Done 阶段必须包含 Review Comments
|
|
176
|
+
- **建议**: 小步提交,频繁同步文件追踪
|
|
177
|
+
|
|
178
|
+
## 相关命令
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# 启动开发
|
|
182
|
+
monoco issue start FEAT-0001 --branch
|
|
183
|
+
|
|
184
|
+
# 同步文件追踪
|
|
185
|
+
monoco issue sync-files
|
|
186
|
+
|
|
187
|
+
# 检查合规性
|
|
188
|
+
monoco issue lint
|
|
189
|
+
|
|
190
|
+
# 提交评审
|
|
191
|
+
monoco issue submit FEAT-0001
|
|
192
|
+
|
|
193
|
+
# 关闭 Issue
|
|
194
|
+
monoco issue close FEAT-0001 --solution completed --prune
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## 与 flow_engineer 的关系
|
|
198
|
+
|
|
199
|
+
此工作流与 `flow_engineer` 的关系:
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
issue-develop-workflow flow_engineer
|
|
203
|
+
│ │
|
|
204
|
+
├── Setup ─────────────────────┤
|
|
205
|
+
├── Develop ←──────────────────┤ Investigate → Code → Test
|
|
206
|
+
├── Test ──────────────────────┤
|
|
207
|
+
├── Submit ────────────────────┤ Report → Submit
|
|
208
|
+
├── Review ────────────────────┤
|
|
209
|
+
└── Merge ─────────────────────┤
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
- `issue-develop-workflow`: 关注 Issue 级别的流程管理
|
|
213
|
+
- `flow_engineer`: 关注代码实现的具体技术流程
|
|
214
|
+
|
|
215
|
+
在 Develop 阶段,开发者应遵循 `flow_engineer` 的 Investigate → Code → Test → Report → Submit 流程。
|
|
216
|
+
|
|
217
|
+
## Copilot 模式提示
|
|
218
|
+
|
|
219
|
+
作为 AI Copilot,你应该:
|
|
220
|
+
1. **协助编码**: 帮助实现功能、修复缺陷
|
|
221
|
+
2. **代码审查**: 在提交前进行预审查,发现潜在问题
|
|
222
|
+
3. **测试协助**: 帮助编写测试用例,确保覆盖
|
|
223
|
+
4. **合规检查**: 提醒开发者遵循项目规范
|
|
224
|
+
5. **文档同步**: 协助更新相关文档
|