monoco-toolkit 0.3.9__py3-none-any.whl → 0.3.11__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/__main__.py +8 -0
- monoco/core/artifacts/__init__.py +16 -0
- monoco/core/artifacts/manager.py +575 -0
- monoco/core/artifacts/models.py +161 -0
- monoco/core/config.py +38 -4
- monoco/core/git.py +23 -0
- monoco/core/hooks/builtin/git_cleanup.py +1 -1
- monoco/core/ingestion/__init__.py +20 -0
- monoco/core/ingestion/discovery.py +248 -0
- monoco/core/ingestion/watcher.py +343 -0
- monoco/core/ingestion/worker.py +436 -0
- monoco/core/injection.py +63 -29
- monoco/core/integrations.py +2 -2
- monoco/core/loader.py +633 -0
- monoco/core/output.py +5 -5
- monoco/core/registry.py +34 -19
- 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/skill_framework.py +292 -0
- monoco/core/skills.py +524 -385
- monoco/core/sync.py +73 -1
- monoco/core/workflow_converter.py +420 -0
- monoco/daemon/app.py +77 -1
- monoco/daemon/commands.py +10 -0
- monoco/daemon/mailroom_service.py +196 -0
- monoco/daemon/models.py +1 -0
- monoco/daemon/scheduler.py +236 -0
- monoco/daemon/services.py +185 -0
- monoco/daemon/triggers.py +55 -0
- monoco/features/agent/__init__.py +2 -2
- monoco/features/agent/adapter.py +41 -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 +47 -6
- 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/{core/resources/en → features/agent/resources/en/skills/monoco_atom_core}/SKILL.md +3 -1
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_engineer/SKILL.md +94 -0
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_manager/SKILL.md +93 -0
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_planner/SKILL.md +85 -0
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_reviewer/SKILL.md +114 -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/roles/monoco_role_engineer.yaml +49 -0
- monoco/features/agent/resources/zh/roles/monoco_role_manager.yaml +46 -0
- monoco/features/agent/resources/zh/roles/monoco_role_planner.yaml +46 -0
- monoco/features/agent/resources/zh/roles/monoco_role_reviewer.yaml +47 -0
- monoco/{core/resources/zh → features/agent/resources/zh/skills/monoco_atom_core}/SKILL.md +3 -1
- monoco/features/agent/resources/{skills/flow_engineer → zh/skills/monoco_workflow_agent_engineer}/SKILL.md +2 -2
- monoco/features/agent/resources/{skills/flow_manager → zh/skills/monoco_workflow_agent_manager}/SKILL.md +2 -2
- monoco/features/agent/resources/zh/skills/monoco_workflow_agent_planner/SKILL.md +259 -0
- monoco/features/agent/resources/zh/skills/monoco_workflow_agent_reviewer/SKILL.md +137 -0
- monoco/features/agent/session.py +59 -11
- monoco/features/agent/worker.py +38 -2
- monoco/features/artifact/__init__.py +0 -0
- monoco/features/artifact/adapter.py +33 -0
- monoco/features/artifact/resources/zh/AGENTS.md +14 -0
- monoco/features/artifact/resources/zh/skills/monoco_atom_artifact/SKILL.md +278 -0
- monoco/features/glossary/__init__.py +0 -0
- monoco/features/glossary/adapter.py +42 -0
- monoco/features/glossary/config.py +5 -0
- monoco/features/glossary/resources/en/AGENTS.md +29 -0
- monoco/features/glossary/resources/en/skills/monoco_atom_glossary/SKILL.md +35 -0
- monoco/features/glossary/resources/zh/AGENTS.md +29 -0
- monoco/features/glossary/resources/zh/skills/monoco_atom_glossary/SKILL.md +35 -0
- monoco/features/hooks/__init__.py +11 -0
- monoco/features/hooks/adapter.py +67 -0
- monoco/features/hooks/commands.py +309 -0
- monoco/features/hooks/core.py +441 -0
- monoco/features/hooks/resources/ADDING_HOOKS.md +234 -0
- monoco/features/i18n/adapter.py +18 -5
- monoco/features/i18n/core.py +482 -17
- monoco/features/i18n/resources/en/{SKILL.md → skills/monoco_atom_i18n/SKILL.md} +3 -1
- monoco/features/i18n/resources/en/skills/monoco_workflow_i18n_scan/SKILL.md +105 -0
- monoco/features/i18n/resources/zh/{SKILL.md → skills/monoco_atom_i18n/SKILL.md} +3 -1
- monoco/features/i18n/resources/{skills/i18n_scan_workflow → zh/skills/monoco_workflow_i18n_scan}/SKILL.md +2 -2
- monoco/features/issue/adapter.py +19 -6
- monoco/features/issue/commands.py +281 -7
- monoco/features/issue/core.py +272 -19
- monoco/features/issue/engine/machine.py +118 -5
- monoco/features/issue/linter.py +60 -5
- monoco/features/issue/models.py +3 -2
- monoco/features/issue/resources/en/AGENTS.md +109 -0
- monoco/features/issue/resources/en/{SKILL.md → skills/monoco_atom_issue/SKILL.md} +3 -1
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_creation/SKILL.md +167 -0
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_development/SKILL.md +224 -0
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_management/SKILL.md +159 -0
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_refinement/SKILL.md +203 -0
- monoco/features/issue/resources/hooks/post-checkout.sh +39 -0
- monoco/features/issue/resources/hooks/pre-commit.sh +41 -0
- monoco/features/issue/resources/hooks/pre-push.sh +35 -0
- monoco/features/issue/resources/zh/AGENTS.md +109 -0
- monoco/features/issue/resources/zh/{SKILL.md → skills/monoco_atom_issue_lifecycle/SKILL.md} +3 -1
- monoco/features/issue/resources/zh/skills/monoco_workflow_issue_creation/SKILL.md +167 -0
- monoco/features/issue/resources/zh/skills/monoco_workflow_issue_development/SKILL.md +224 -0
- monoco/features/issue/resources/{skills/issue_lifecycle_workflow → zh/skills/monoco_workflow_issue_management}/SKILL.md +2 -2
- monoco/features/issue/resources/zh/skills/monoco_workflow_issue_refinement/SKILL.md +203 -0
- monoco/features/issue/validator.py +101 -1
- monoco/features/memo/adapter.py +21 -8
- monoco/features/memo/cli.py +103 -10
- monoco/features/memo/core.py +178 -92
- monoco/features/memo/models.py +53 -0
- monoco/features/memo/resources/en/skills/monoco_atom_memo/SKILL.md +77 -0
- monoco/features/memo/resources/en/skills/monoco_workflow_note_processing/SKILL.md +140 -0
- monoco/features/memo/resources/zh/{SKILL.md → skills/monoco_atom_memo/SKILL.md} +3 -1
- monoco/features/memo/resources/{skills/note_processing_workflow → zh/skills/monoco_workflow_note_processing}/SKILL.md +2 -2
- monoco/features/spike/adapter.py +18 -5
- monoco/features/spike/resources/en/{SKILL.md → skills/monoco_atom_spike/SKILL.md} +3 -1
- monoco/features/spike/resources/en/skills/monoco_workflow_research/SKILL.md +121 -0
- monoco/features/spike/resources/zh/{SKILL.md → skills/monoco_atom_spike/SKILL.md} +3 -1
- monoco/features/spike/resources/{skills/research_workflow → zh/skills/monoco_workflow_research}/SKILL.md +2 -2
- monoco/main.py +38 -1
- monoco_toolkit-0.3.11.dist-info/METADATA +130 -0
- monoco_toolkit-0.3.11.dist-info/RECORD +181 -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/{core → features/agent}/resources/en/AGENTS.md +0 -0
- /monoco/{core → features/agent}/resources/zh/AGENTS.md +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/WHEEL +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/entry_points.txt +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monoco_workflow_issue_management
|
|
3
|
+
description: Issue Lifecycle Workflow (Flow Skill). Defines the complete Issue management process from creation to closure, ensuring task tracking and process compliance.
|
|
4
|
+
type: workflow
|
|
5
|
+
domain: issue
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Issue Lifecycle Workflow
|
|
10
|
+
|
|
11
|
+
Standardized workflow for Issue lifecycle, ensuring "Open → Start → Develop → Submit → Review → Close" process.
|
|
12
|
+
|
|
13
|
+
## Workflow State Machine
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
stateDiagram-v2
|
|
17
|
+
[*] --> Open: Create Issue
|
|
18
|
+
|
|
19
|
+
Open --> Start: Prepare Development
|
|
20
|
+
Open --> Open: Requirements Unclear<br/>(Wait for Clarification)
|
|
21
|
+
|
|
22
|
+
Start --> Develop: Branch Created
|
|
23
|
+
Start --> Start: Branch Conflict<br/>(Resolve Conflict)
|
|
24
|
+
|
|
25
|
+
Develop --> Submit: Development Complete
|
|
26
|
+
Develop --> Develop: Tests Fail<br/>(Fix Code)
|
|
27
|
+
|
|
28
|
+
state "Oracle Loop" as ReviewLoop {
|
|
29
|
+
Submit --> Review: Submit for Review
|
|
30
|
+
Review --> Fix: Rejected
|
|
31
|
+
Fix --> Submit: Resubmit
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
Review --> Close: Approved for Merge
|
|
35
|
+
|
|
36
|
+
Close --> [*]: Cleanup Complete
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Execution Steps
|
|
40
|
+
|
|
41
|
+
### 1. Open
|
|
42
|
+
|
|
43
|
+
- **Goal**: Create clear, actionable Issue
|
|
44
|
+
- **Input**: Requirement description, type, priority
|
|
45
|
+
- **Output**: Issue Ticket file
|
|
46
|
+
- **Checkpoints**:
|
|
47
|
+
- [ ] Use `monoco issue create <type> -t "Title"`
|
|
48
|
+
- [ ] Select appropriate type (epic/feature/chore/fix)
|
|
49
|
+
- [ ] Write clear description and acceptance criteria
|
|
50
|
+
- [ ] Set dependency relationships (if needed)
|
|
51
|
+
- [ ] Ensure at least 2 Checkboxes
|
|
52
|
+
|
|
53
|
+
### 2. Start
|
|
54
|
+
|
|
55
|
+
- **Goal**: Prepare development environment, create feature branch
|
|
56
|
+
- **Checkpoints**:
|
|
57
|
+
- [ ] Run `monoco issue start <ID> --branch`
|
|
58
|
+
- [ ] Confirm branch is created and switched
|
|
59
|
+
- [ ] Verify not currently on main/master branch
|
|
60
|
+
- [ ] Check if dependency Issues are completed
|
|
61
|
+
|
|
62
|
+
### 3. Develop
|
|
63
|
+
|
|
64
|
+
- **Goal**: Implement feature or fix bug
|
|
65
|
+
- **Strategy**: Iterative development, continuous testing
|
|
66
|
+
- **Checkpoints**:
|
|
67
|
+
- [ ] Follow project code standards
|
|
68
|
+
- [ ] Write/update unit tests
|
|
69
|
+
- [ ] Run test suite, ensure it passes
|
|
70
|
+
- [ ] Commit code regularly (small commits)
|
|
71
|
+
- [ ] Update file tracking (`monoco issue sync-files`)
|
|
72
|
+
|
|
73
|
+
### 4. Submit
|
|
74
|
+
|
|
75
|
+
- **Goal**: Prepare for code review
|
|
76
|
+
- **Checkpoints**:
|
|
77
|
+
- [ ] Run `monoco issue lint` to check compliance
|
|
78
|
+
- [ ] Fix all Lint errors
|
|
79
|
+
- [ ] Update task list status
|
|
80
|
+
- [ ] Run `monoco issue submit <ID>`
|
|
81
|
+
- [ ] Write change summary
|
|
82
|
+
|
|
83
|
+
### 5. Review
|
|
84
|
+
|
|
85
|
+
- **Goal**: Code quality and process compliance check
|
|
86
|
+
- **Checkpoints**:
|
|
87
|
+
- [ ] Is functionality correctly implemented
|
|
88
|
+
- [ ] Does code meet design specifications
|
|
89
|
+
- [ ] Are tests sufficient
|
|
90
|
+
- [ ] Is documentation updated
|
|
91
|
+
- [ ] Does it follow project standards
|
|
92
|
+
|
|
93
|
+
### 6. Close
|
|
94
|
+
|
|
95
|
+
- **Goal**: Complete Issue, cleanup environment
|
|
96
|
+
- **Checkpoints**:
|
|
97
|
+
- [ ] Code is merged to main branch
|
|
98
|
+
- [ ] Run `monoco issue close <ID> --solution completed --prune`
|
|
99
|
+
- [ ] Verify branch is cleaned up
|
|
100
|
+
- [ ] Update Review Comments (if needed)
|
|
101
|
+
|
|
102
|
+
## Decision Branches
|
|
103
|
+
|
|
104
|
+
| Condition | Action |
|
|
105
|
+
|-----------|--------|
|
|
106
|
+
| Requirements unclear | Return to Open, request clarification |
|
|
107
|
+
| Branch creation fails | Check Git status, resolve conflicts |
|
|
108
|
+
| Tests fail | Return to Develop, fix code |
|
|
109
|
+
| Lint fails | Fix compliance issues, resubmit |
|
|
110
|
+
| Review rejected | Return to Develop, modify per feedback |
|
|
111
|
+
| Review passed | Enter Close, merge and cleanup |
|
|
112
|
+
|
|
113
|
+
## Compliance Requirements
|
|
114
|
+
|
|
115
|
+
- **Prohibited**: Directly modify code on main/master branch
|
|
116
|
+
- **Required**: Use `monoco issue start --branch` to create feature branch
|
|
117
|
+
- **Required**: All unit tests must pass before Submit
|
|
118
|
+
- **Required**: Each Issue must have at least 2 Checkboxes
|
|
119
|
+
- **Required**: Review/Done phase must include Review Comments
|
|
120
|
+
- **Recommended**: Small commits, frequently sync file tracking
|
|
121
|
+
|
|
122
|
+
## Related Commands
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Create Issue
|
|
126
|
+
monoco issue create feature -t "Title"
|
|
127
|
+
|
|
128
|
+
# Start development
|
|
129
|
+
monoco issue start FEAT-0001 --branch
|
|
130
|
+
|
|
131
|
+
# Sync file tracking
|
|
132
|
+
monoco issue sync-files
|
|
133
|
+
|
|
134
|
+
# Check compliance
|
|
135
|
+
monoco issue lint
|
|
136
|
+
|
|
137
|
+
# Submit for review
|
|
138
|
+
monoco issue submit FEAT-0001
|
|
139
|
+
|
|
140
|
+
# Close Issue
|
|
141
|
+
monoco issue close FEAT-0001 --solution completed --prune
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Issue Type Guide
|
|
145
|
+
|
|
146
|
+
| Type | Purpose | Prefix | Mindset |
|
|
147
|
+
|------|---------|--------|---------|
|
|
148
|
+
| Epic | Grand goals, vision container | EPIC- | Architect |
|
|
149
|
+
| Feature | User value increment | FEAT- | Product Owner |
|
|
150
|
+
| Chore | Engineering tasks | CHORE- | Builder |
|
|
151
|
+
| Fix | Bug fixes | FIX- | Debugger |
|
|
152
|
+
|
|
153
|
+
## Relationship with flow_engineer
|
|
154
|
+
|
|
155
|
+
This workflow complements `flow_engineer`:
|
|
156
|
+
- `issue-lifecycle-workflow`: Focuses on Issue management process
|
|
157
|
+
- `flow_engineer`: Focuses on code implementation process
|
|
158
|
+
|
|
159
|
+
Engineers should follow `flow_engineer`'s Investigate → Code → Test → Report → Submit process during the Develop phase.
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monoco_workflow_issue_refinement
|
|
3
|
+
description: Investigate and refine Issue, supplement technical details and implementation plan (Copilot Mode)
|
|
4
|
+
type: workflow
|
|
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,39 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Issue Feature Post-Checkout Hook
|
|
3
|
+
# Automatically syncs issue status when switching branches
|
|
4
|
+
|
|
5
|
+
echo "[Monoco] Syncing issue status after branch checkout..."
|
|
6
|
+
|
|
7
|
+
# Get the previous and current HEAD
|
|
8
|
+
PREVIOUS_HEAD="$1"
|
|
9
|
+
NEW_HEAD="$2"
|
|
10
|
+
BRANCH_SWITCH="$3" # 1 if branch switch, 0 if file checkout
|
|
11
|
+
|
|
12
|
+
# Only sync on actual branch switches, not file checkouts
|
|
13
|
+
if [ "$BRANCH_SWITCH" != "1" ]; then
|
|
14
|
+
echo "[Monoco] File checkout detected, skipping issue sync."
|
|
15
|
+
exit 0
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# Get current branch name
|
|
19
|
+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "HEAD")
|
|
20
|
+
|
|
21
|
+
echo "[Monoco] Switched to branch: $CURRENT_BRANCH"
|
|
22
|
+
|
|
23
|
+
# Try to extract issue ID from branch name
|
|
24
|
+
# Common patterns: FEAT-123, feat/FEAT-123, feature/FEAT-123, fix/FEAT-123
|
|
25
|
+
ISSUE_ID=$(echo "$CURRENT_BRANCH" | grep -oE '[A-Z]+-[0-9]+' | head -1)
|
|
26
|
+
|
|
27
|
+
if [ -n "$ISSUE_ID" ]; then
|
|
28
|
+
echo "[Monoco] Detected issue ID from branch: $ISSUE_ID"
|
|
29
|
+
|
|
30
|
+
# Check if issue exists and update its isolation ref if needed
|
|
31
|
+
$MONOCO_CMD issue sync-isolation "$ISSUE_ID" --branch "$CURRENT_BRANCH" 2>/dev/null || true
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
# Run general sync to ensure files field is up to date
|
|
35
|
+
echo "[Monoco] Running issue file sync..."
|
|
36
|
+
$MONOCO_CMD issue sync-files 2>/dev/null || true
|
|
37
|
+
|
|
38
|
+
echo "[Monoco] Issue sync complete."
|
|
39
|
+
exit 0
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Issue Feature Pre-Commit Hook
|
|
3
|
+
# Runs monoco issue lint on staged Issue files
|
|
4
|
+
|
|
5
|
+
echo "[Monoco] Checking Issue integrity..."
|
|
6
|
+
|
|
7
|
+
# Get the list of staged Issue files
|
|
8
|
+
STAGED_ISSUES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '^Issues/.*\.md$' || true)
|
|
9
|
+
|
|
10
|
+
if [ -z "$STAGED_ISSUES" ]; then
|
|
11
|
+
echo "[Monoco] No Issue files staged. Skipping lint."
|
|
12
|
+
exit 0
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
# Run lint on staged Issue files
|
|
16
|
+
echo "[Monoco] Running lint on staged Issue files..."
|
|
17
|
+
|
|
18
|
+
# Build file list for monoco command
|
|
19
|
+
FILE_ARGS=""
|
|
20
|
+
for file in $STAGED_ISSUES; do
|
|
21
|
+
FILE_ARGS="$FILE_ARGS $file"
|
|
22
|
+
done
|
|
23
|
+
|
|
24
|
+
# Execute lint on each file
|
|
25
|
+
LINT_EXIT=0
|
|
26
|
+
for file in $STAGED_ISSUES; do
|
|
27
|
+
$MONOCO_CMD issue lint "$file"
|
|
28
|
+
if [ $? -ne 0 ]; then
|
|
29
|
+
LINT_EXIT=1
|
|
30
|
+
fi
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
if [ $LINT_EXIT -ne 0 ]; then
|
|
34
|
+
echo ""
|
|
35
|
+
echo "[Monoco] Issue lint failed. Please fix the errors above."
|
|
36
|
+
echo "[Monoco] You can run 'monoco issue lint --fix' to attempt automatic fixes."
|
|
37
|
+
exit $LINT_EXIT
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
echo "[Monoco] Issue lint passed."
|
|
41
|
+
exit 0
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Issue Feature Pre-Push Hook
|
|
3
|
+
# Checks for incomplete critical issues before pushing
|
|
4
|
+
|
|
5
|
+
echo "[Monoco] Checking critical issues before push..."
|
|
6
|
+
|
|
7
|
+
# Get the list of commits being pushed
|
|
8
|
+
# $1 = remote name, $2 = remote url (if available)
|
|
9
|
+
REMOTE="$1"
|
|
10
|
+
URL="$2"
|
|
11
|
+
|
|
12
|
+
# Check for high/critical issues that are not closed
|
|
13
|
+
# This uses monoco issue query to find open issues with high/critical criticality
|
|
14
|
+
echo "[Monoco] Scanning for incomplete critical issues..."
|
|
15
|
+
|
|
16
|
+
# Run the check using monoco command
|
|
17
|
+
$MONOCO_CMD issue check-critical --fail-on-warning
|
|
18
|
+
CHECK_EXIT=$?
|
|
19
|
+
|
|
20
|
+
if [ $CHECK_EXIT -eq 2 ]; then
|
|
21
|
+
echo ""
|
|
22
|
+
echo "[Monoco] ❌ Critical issues found! Push blocked."
|
|
23
|
+
echo "[Monoco] Please close or resolve the critical issues above before pushing."
|
|
24
|
+
exit 1
|
|
25
|
+
elif [ $CHECK_EXIT -eq 1 ]; then
|
|
26
|
+
echo ""
|
|
27
|
+
echo "[Monoco] ⚠️ High priority issues found."
|
|
28
|
+
echo "[Monoco] Use --force-push to bypass this warning (not recommended)."
|
|
29
|
+
# For now, we allow the push but warn
|
|
30
|
+
# To block, change the exit code to 1
|
|
31
|
+
exit 0
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
echo "[Monoco] ✓ No blocking critical issues found."
|
|
35
|
+
exit 0
|
|
@@ -20,3 +20,112 @@
|
|
|
20
20
|
- 🛑 **禁止**直接在 `main`/`master` 分支修改代码 (Linter 会报错)。
|
|
21
21
|
- **清理时机**: 环境清理仅应在 `close` 时执行。**禁止**在 `submit` 阶段清理环境。
|
|
22
22
|
- 修改代码后**必须**更新 `files` 字段(通过 `sync-files` 或手动)。
|
|
23
|
+
|
|
24
|
+
## Git 合并策略 (Merge Strategy)
|
|
25
|
+
|
|
26
|
+
### 核心原则
|
|
27
|
+
|
|
28
|
+
为确保 Feature 分支安全合并到主线,避免"旧状态污染主线"问题,必须遵循以下合并策略:
|
|
29
|
+
|
|
30
|
+
#### 1. 禁止手动 Merge
|
|
31
|
+
|
|
32
|
+
- **🛑 严禁** Agent 手动执行 `git merge` 合并 Feature 分支
|
|
33
|
+
- **🛑 严禁** 使用 `git pull origin main` 后直接提交
|
|
34
|
+
- **✅ 唯一权威途径**: 必须使用 `monoco issue close` 进行闭环
|
|
35
|
+
|
|
36
|
+
#### 2. 安全合并流程 (Safe Merge Flow)
|
|
37
|
+
|
|
38
|
+
正确的 Issue 关闭流程如下:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# 1. 确保当前在 main/master 分支,且代码已合并
|
|
42
|
+
$ git checkout main
|
|
43
|
+
$ git pull origin main
|
|
44
|
+
|
|
45
|
+
# 2. 确认 Feature 分支的变更已合并到主线
|
|
46
|
+
# (通过 PR/MR 或其他代码审查流程)
|
|
47
|
+
|
|
48
|
+
# 3. 使用 monoco issue close 关闭 Issue (默认执行 prune)
|
|
49
|
+
$ monoco issue close FEAT-XXXX --solution implemented
|
|
50
|
+
|
|
51
|
+
# 4. 如需保留分支,使用 --no-prune
|
|
52
|
+
$ monoco issue close FEAT-XXXX --solution implemented --no-prune
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### 3. 冲突处理原则
|
|
56
|
+
|
|
57
|
+
当 Feature 分支与主线产生冲突时:
|
|
58
|
+
|
|
59
|
+
1. **自动合并停止**: 如果 `touched files` (Issue `files` 字段) 与主线产生冲突,自动化工具**必须立即停止合并**,并抛出明确错误。
|
|
60
|
+
|
|
61
|
+
2. **手动 Cherry-Pick 模式**:
|
|
62
|
+
- 错误信息会指示 Agent 转入手动 Cherry-Pick 模式
|
|
63
|
+
- **核心原则**: 仅挑选属于本 Feature 的有效变更,严禁覆盖主线上无关 Issue 的更新
|
|
64
|
+
- 使用 `git cherry-pick <commit>` 逐个应用有效提交
|
|
65
|
+
|
|
66
|
+
3. **Fallback 策略**:
|
|
67
|
+
```bash
|
|
68
|
+
# 1. 创建临时分支用于解决冲突
|
|
69
|
+
$ git checkout main
|
|
70
|
+
$ git checkout -b temp/FEAT-XXXX-resolve
|
|
71
|
+
|
|
72
|
+
# 2. 逐个 Cherry-Pick 有效提交
|
|
73
|
+
$ git cherry-pick <commit-hash-1>
|
|
74
|
+
$ git cherry-pick <commit-hash-2>
|
|
75
|
+
|
|
76
|
+
# 3. 如有冲突,仅保留本 Feature 的变更
|
|
77
|
+
# 放弃任何会覆盖主线上其他 Issue 更新的修改
|
|
78
|
+
|
|
79
|
+
# 4. 完成后合并临时分支
|
|
80
|
+
$ git checkout main
|
|
81
|
+
$ git merge temp/FEAT-XXXX-resolve
|
|
82
|
+
|
|
83
|
+
# 5. 关闭 Issue
|
|
84
|
+
$ monoco issue close FEAT-XXXX --solution implemented
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### 4. 基于 files 字段的智能合并 (Smart Atomic Merge)
|
|
88
|
+
|
|
89
|
+
Issue 的 `files` 字段记录了 Feature 分支的真实影响范围 (Actual Impact Scope):
|
|
90
|
+
|
|
91
|
+
- **生成方式**: `monoco issue sync-files` 使用 `git diff --name-only base...target` 逻辑
|
|
92
|
+
- **作用**: 作为合并白名单,仅合并列表中的文件,过滤因"旧版本基线"导致的隐性覆盖
|
|
93
|
+
- **限制**: 无法防御显式的误操作修改(如无意中格式化其他 Issue 文件)
|
|
94
|
+
|
|
95
|
+
**未来增强**: 基于 `files` 列表实现选择性合并逻辑:
|
|
96
|
+
```bash
|
|
97
|
+
# 选择性合并(规划中)
|
|
98
|
+
$ git checkout main
|
|
99
|
+
$ git checkout feature/FEAT-XXXX -- <files...>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### 5. 清理策略
|
|
103
|
+
|
|
104
|
+
- **默认清理**: `monoco issue close` 默认执行 `--prune`,删除 Feature 分支/Worktree
|
|
105
|
+
- **保留分支**: 如需保留分支,显式使用 `--no-prune`
|
|
106
|
+
- **强制清理**: 使用 `--force` 强制删除未完全合并的分支(谨慎使用)
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# 默认清理分支
|
|
110
|
+
$ monoco issue close FEAT-XXXX --solution implemented
|
|
111
|
+
# ✔ Cleaned up: branch:feat/feat-XXXX-xxx
|
|
112
|
+
|
|
113
|
+
# 保留分支
|
|
114
|
+
$ monoco issue close FEAT-XXXX --solution implemented --no-prune
|
|
115
|
+
|
|
116
|
+
# 强制清理(谨慎)
|
|
117
|
+
$ monoco issue close FEAT-XXXX --solution implemented --force
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 总结
|
|
121
|
+
|
|
122
|
+
| 操作 | 命令 | 说明 |
|
|
123
|
+
|------|------|------|
|
|
124
|
+
| 创建 Issue | `monoco issue create feature -t "标题"` | 先创建 Issue 再开发 |
|
|
125
|
+
| 启动开发 | `monoco issue start FEAT-XXXX --branch` | 创建 Feature 分支 |
|
|
126
|
+
| 同步文件 | `monoco issue sync-files` | 更新 files 字段 |
|
|
127
|
+
| 提交评审 | `monoco issue submit FEAT-XXXX` | 进入 Review 阶段 |
|
|
128
|
+
| 关闭 Issue | `monoco issue close FEAT-XXXX --solution implemented` | 唯一合并途径 |
|
|
129
|
+
| 保留分支 | `monoco issue close ... --no-prune` | 关闭但不删除分支 |
|
|
130
|
+
|
|
131
|
+
> ⚠️ **警告**: 任何绕过 `monoco issue close` 的手动合并操作都可能导致主线状态污染,违反工作流合规要求。
|