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.
Files changed (132) hide show
  1. monoco/__main__.py +8 -0
  2. monoco/core/artifacts/__init__.py +16 -0
  3. monoco/core/artifacts/manager.py +575 -0
  4. monoco/core/artifacts/models.py +161 -0
  5. monoco/core/config.py +38 -4
  6. monoco/core/git.py +23 -0
  7. monoco/core/hooks/builtin/git_cleanup.py +1 -1
  8. monoco/core/ingestion/__init__.py +20 -0
  9. monoco/core/ingestion/discovery.py +248 -0
  10. monoco/core/ingestion/watcher.py +343 -0
  11. monoco/core/ingestion/worker.py +436 -0
  12. monoco/core/injection.py +63 -29
  13. monoco/core/integrations.py +2 -2
  14. monoco/core/loader.py +633 -0
  15. monoco/core/output.py +5 -5
  16. monoco/core/registry.py +34 -19
  17. monoco/core/resource/__init__.py +5 -0
  18. monoco/core/resource/finder.py +98 -0
  19. monoco/core/resource/manager.py +91 -0
  20. monoco/core/resource/models.py +35 -0
  21. monoco/core/skill_framework.py +292 -0
  22. monoco/core/skills.py +524 -385
  23. monoco/core/sync.py +73 -1
  24. monoco/core/workflow_converter.py +420 -0
  25. monoco/daemon/app.py +77 -1
  26. monoco/daemon/commands.py +10 -0
  27. monoco/daemon/mailroom_service.py +196 -0
  28. monoco/daemon/models.py +1 -0
  29. monoco/daemon/scheduler.py +236 -0
  30. monoco/daemon/services.py +185 -0
  31. monoco/daemon/triggers.py +55 -0
  32. monoco/features/agent/__init__.py +2 -2
  33. monoco/features/agent/adapter.py +41 -0
  34. monoco/features/agent/apoptosis.py +44 -0
  35. monoco/features/agent/cli.py +101 -144
  36. monoco/features/agent/config.py +35 -21
  37. monoco/features/agent/defaults.py +6 -49
  38. monoco/features/agent/engines.py +32 -6
  39. monoco/features/agent/manager.py +47 -6
  40. monoco/features/agent/models.py +2 -2
  41. monoco/features/agent/resources/atoms/atom-code-dev.yaml +61 -0
  42. monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml +73 -0
  43. monoco/features/agent/resources/atoms/atom-knowledge.yaml +55 -0
  44. monoco/features/agent/resources/atoms/atom-review.yaml +60 -0
  45. monoco/{core/resources/en → features/agent/resources/en/skills/monoco_atom_core}/SKILL.md +3 -1
  46. monoco/features/agent/resources/en/skills/monoco_workflow_agent_engineer/SKILL.md +94 -0
  47. monoco/features/agent/resources/en/skills/monoco_workflow_agent_manager/SKILL.md +93 -0
  48. monoco/features/agent/resources/en/skills/monoco_workflow_agent_planner/SKILL.md +85 -0
  49. monoco/features/agent/resources/en/skills/monoco_workflow_agent_reviewer/SKILL.md +114 -0
  50. monoco/features/agent/resources/workflows/workflow-dev.yaml +83 -0
  51. monoco/features/agent/resources/workflows/workflow-issue-create.yaml +72 -0
  52. monoco/features/agent/resources/workflows/workflow-review.yaml +94 -0
  53. monoco/features/agent/resources/zh/roles/monoco_role_engineer.yaml +49 -0
  54. monoco/features/agent/resources/zh/roles/monoco_role_manager.yaml +46 -0
  55. monoco/features/agent/resources/zh/roles/monoco_role_planner.yaml +46 -0
  56. monoco/features/agent/resources/zh/roles/monoco_role_reviewer.yaml +47 -0
  57. monoco/{core/resources/zh → features/agent/resources/zh/skills/monoco_atom_core}/SKILL.md +3 -1
  58. monoco/features/agent/resources/{skills/flow_engineer → zh/skills/monoco_workflow_agent_engineer}/SKILL.md +2 -2
  59. monoco/features/agent/resources/{skills/flow_manager → zh/skills/monoco_workflow_agent_manager}/SKILL.md +2 -2
  60. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_planner/SKILL.md +259 -0
  61. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_reviewer/SKILL.md +137 -0
  62. monoco/features/agent/session.py +59 -11
  63. monoco/features/agent/worker.py +38 -2
  64. monoco/features/artifact/__init__.py +0 -0
  65. monoco/features/artifact/adapter.py +33 -0
  66. monoco/features/artifact/resources/zh/AGENTS.md +14 -0
  67. monoco/features/artifact/resources/zh/skills/monoco_atom_artifact/SKILL.md +278 -0
  68. monoco/features/glossary/__init__.py +0 -0
  69. monoco/features/glossary/adapter.py +42 -0
  70. monoco/features/glossary/config.py +5 -0
  71. monoco/features/glossary/resources/en/AGENTS.md +29 -0
  72. monoco/features/glossary/resources/en/skills/monoco_atom_glossary/SKILL.md +35 -0
  73. monoco/features/glossary/resources/zh/AGENTS.md +29 -0
  74. monoco/features/glossary/resources/zh/skills/monoco_atom_glossary/SKILL.md +35 -0
  75. monoco/features/hooks/__init__.py +11 -0
  76. monoco/features/hooks/adapter.py +67 -0
  77. monoco/features/hooks/commands.py +309 -0
  78. monoco/features/hooks/core.py +441 -0
  79. monoco/features/hooks/resources/ADDING_HOOKS.md +234 -0
  80. monoco/features/i18n/adapter.py +18 -5
  81. monoco/features/i18n/core.py +482 -17
  82. monoco/features/i18n/resources/en/{SKILL.md → skills/monoco_atom_i18n/SKILL.md} +3 -1
  83. monoco/features/i18n/resources/en/skills/monoco_workflow_i18n_scan/SKILL.md +105 -0
  84. monoco/features/i18n/resources/zh/{SKILL.md → skills/monoco_atom_i18n/SKILL.md} +3 -1
  85. monoco/features/i18n/resources/{skills/i18n_scan_workflow → zh/skills/monoco_workflow_i18n_scan}/SKILL.md +2 -2
  86. monoco/features/issue/adapter.py +19 -6
  87. monoco/features/issue/commands.py +281 -7
  88. monoco/features/issue/core.py +272 -19
  89. monoco/features/issue/engine/machine.py +118 -5
  90. monoco/features/issue/linter.py +60 -5
  91. monoco/features/issue/models.py +3 -2
  92. monoco/features/issue/resources/en/AGENTS.md +109 -0
  93. monoco/features/issue/resources/en/{SKILL.md → skills/monoco_atom_issue/SKILL.md} +3 -1
  94. monoco/features/issue/resources/en/skills/monoco_workflow_issue_creation/SKILL.md +167 -0
  95. monoco/features/issue/resources/en/skills/monoco_workflow_issue_development/SKILL.md +224 -0
  96. monoco/features/issue/resources/en/skills/monoco_workflow_issue_management/SKILL.md +159 -0
  97. monoco/features/issue/resources/en/skills/monoco_workflow_issue_refinement/SKILL.md +203 -0
  98. monoco/features/issue/resources/hooks/post-checkout.sh +39 -0
  99. monoco/features/issue/resources/hooks/pre-commit.sh +41 -0
  100. monoco/features/issue/resources/hooks/pre-push.sh +35 -0
  101. monoco/features/issue/resources/zh/AGENTS.md +109 -0
  102. monoco/features/issue/resources/zh/{SKILL.md → skills/monoco_atom_issue_lifecycle/SKILL.md} +3 -1
  103. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_creation/SKILL.md +167 -0
  104. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_development/SKILL.md +224 -0
  105. monoco/features/issue/resources/{skills/issue_lifecycle_workflow → zh/skills/monoco_workflow_issue_management}/SKILL.md +2 -2
  106. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_refinement/SKILL.md +203 -0
  107. monoco/features/issue/validator.py +101 -1
  108. monoco/features/memo/adapter.py +21 -8
  109. monoco/features/memo/cli.py +103 -10
  110. monoco/features/memo/core.py +178 -92
  111. monoco/features/memo/models.py +53 -0
  112. monoco/features/memo/resources/en/skills/monoco_atom_memo/SKILL.md +77 -0
  113. monoco/features/memo/resources/en/skills/monoco_workflow_note_processing/SKILL.md +140 -0
  114. monoco/features/memo/resources/zh/{SKILL.md → skills/monoco_atom_memo/SKILL.md} +3 -1
  115. monoco/features/memo/resources/{skills/note_processing_workflow → zh/skills/monoco_workflow_note_processing}/SKILL.md +2 -2
  116. monoco/features/spike/adapter.py +18 -5
  117. monoco/features/spike/resources/en/{SKILL.md → skills/monoco_atom_spike/SKILL.md} +3 -1
  118. monoco/features/spike/resources/en/skills/monoco_workflow_research/SKILL.md +121 -0
  119. monoco/features/spike/resources/zh/{SKILL.md → skills/monoco_atom_spike/SKILL.md} +3 -1
  120. monoco/features/spike/resources/{skills/research_workflow → zh/skills/monoco_workflow_research}/SKILL.md +2 -2
  121. monoco/main.py +38 -1
  122. monoco_toolkit-0.3.11.dist-info/METADATA +130 -0
  123. monoco_toolkit-0.3.11.dist-info/RECORD +181 -0
  124. monoco/features/agent/reliability.py +0 -106
  125. monoco/features/agent/resources/skills/flow_reviewer/SKILL.md +0 -114
  126. monoco_toolkit-0.3.9.dist-info/METADATA +0 -127
  127. monoco_toolkit-0.3.9.dist-info/RECORD +0 -115
  128. /monoco/{core → features/agent}/resources/en/AGENTS.md +0 -0
  129. /monoco/{core → features/agent}/resources/zh/AGENTS.md +0 -0
  130. {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/WHEEL +0 -0
  131. {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/entry_points.txt +0 -0
  132. {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/licenses/LICENSE +0 -0
@@ -29,7 +29,7 @@ def check_integrity(issues_root: Path, recursive: bool = False) -> List[Diagnost
29
29
 
30
30
  # 1. Collection Phase (Build Index)
31
31
  # Helper to collect issues from a project
32
- def collect_project_issues(project_issues_root: Path, project_name: str = "local"):
32
+ def collect_project_issues(project_issues_root: Path, project_name: str = "local", include_archived: bool = False):
33
33
  project_issues = []
34
34
  project_diagnostics = []
35
35
  for subdir in ["Epics", "Features", "Chores", "Fixes", "Domains"]:
@@ -128,10 +128,30 @@ def check_integrity(issues_root: Path, recursive: bool = False) -> List[Diagnost
128
128
  else:
129
129
  # Standard Issues (Epics/Features/etc)
130
130
  files = []
131
- for status in ["open", "closed", "backlog"]:
132
- status_dir = d / status
133
- if status_dir.exists():
134
- files.extend(status_dir.rglob("*.md"))
131
+ # Standard status directories
132
+ status_dirs = ["open", "closed", "backlog"]
133
+ # Include archived if requested (for full validation)
134
+ if include_archived:
135
+ status_dirs.append("archived")
136
+
137
+ for item in d.iterdir():
138
+ if item.is_dir():
139
+ status = item.name.lower()
140
+ if status in status_dirs:
141
+ files.extend(item.rglob("*.md"))
142
+ elif status != "archived": # archived is handled separately if include_archived
143
+ # Report Illegal Directory immediately
144
+ project_diagnostics.append(
145
+ Diagnostic(
146
+ range=Range(
147
+ start=Position(line=0, character=0),
148
+ end=Position(line=0, character=0),
149
+ ),
150
+ message=f"Illegal Directory: Issues should be in 'open/', 'closed/', or 'backlog/' directories, not '{status}/' directory.",
151
+ severity=DiagnosticSeverity.Error,
152
+ source="System",
153
+ )
154
+ )
135
155
 
136
156
  for f in files:
137
157
  try:
@@ -283,12 +303,45 @@ def check_integrity(issues_root: Path, recursive: bool = False) -> List[Diagnost
283
303
 
284
304
  # 2. Validation Phase
285
305
  valid_domains = set()
306
+ # Build list of actual IssueMetadata objects for domain governance checks
307
+ all_issue_metas = []
308
+
286
309
  # Now validate
287
310
  for path, meta, project_name in all_issues:
288
311
  if meta == "DOMAIN":
289
312
  valid_domains.add(
290
313
  project_name
291
314
  ) # Record the domain name (which was stored in project_name slot)
315
+ else:
316
+ all_issue_metas.append(meta)
317
+
318
+ # FEAT-0136: Project-Level Domain Governance Check
319
+ # Calculate scale metrics
320
+ num_issues = len(all_issue_metas)
321
+ num_epics = len([i for i in all_issue_metas if i.type == "epic"])
322
+ is_large_scale = num_issues > 128 or num_epics > 32
323
+
324
+ # Check Domain Coverage for large-scale projects
325
+ if is_large_scale and num_epics > 0:
326
+ epics = [i for i in all_issue_metas if i.type == "epic"]
327
+ untracked_epics = [e for e in epics if not e.domains]
328
+ untracked_ratio = len(untracked_epics) / len(epics)
329
+
330
+ # Rule: Untracked Epics / Total Epics <= 25%
331
+ if untracked_ratio > 0.25:
332
+ # Report this as a project-level diagnostic (attached to first epic or general)
333
+ diagnostics.append(
334
+ Diagnostic(
335
+ range=Range(
336
+ start=Position(line=0, character=0),
337
+ end=Position(line=0, character=0),
338
+ ),
339
+ message=f"Domain Governance: Coverage is too low for a project of this scale ({len(untracked_epics)}/{len(epics)} Epics untracked). "
340
+ f"At least 75% of Epics must have domains assigned.",
341
+ severity=DiagnosticSeverity.Error,
342
+ source="DomainGovernance",
343
+ )
344
+ )
292
345
 
293
346
  for path, meta, project_name in all_issues:
294
347
  if meta == "DOMAIN":
@@ -325,6 +378,7 @@ def check_integrity(issues_root: Path, recursive: bool = False) -> List[Diagnost
325
378
 
326
379
  # A. Run Core Validator
327
380
  # Pass valid_domains kwarg (Validator needs update to accept it)
381
+ # FEAT-0136: Also pass all_issue_metas for domain governance checks
328
382
  file_diagnostics = validator.validate(
329
383
  meta,
330
384
  content,
@@ -332,6 +386,7 @@ def check_integrity(issues_root: Path, recursive: bool = False) -> List[Diagnost
332
386
  current_project=project_name,
333
387
  workspace_root=workspace_root_name,
334
388
  valid_domains=valid_domains,
389
+ all_issues=all_issue_metas,
335
390
  )
336
391
 
337
392
  # Add context to diagnostics (Path)
@@ -67,12 +67,14 @@ class IssueType(str, Enum):
67
67
  FEATURE = "feature"
68
68
  CHORE = "chore"
69
69
  FIX = "fix"
70
+ ARCH = "arch"
70
71
 
71
72
 
72
73
  class IssueStatus(str, Enum):
73
74
  OPEN = "open"
74
75
  CLOSED = "closed"
75
76
  BACKLOG = "backlog"
77
+ ARCHIVED = "archived"
76
78
 
77
79
 
78
80
  class IssueStage(str, Enum):
@@ -222,8 +224,7 @@ class IssueMetadata(BaseModel):
222
224
  # Stage normalization
223
225
  if "stage" in v and isinstance(v["stage"], str):
224
226
  v["stage"] = v["stage"].lower()
225
- if v["stage"] == "todo":
226
- v["stage"] = "draft"
227
+
227
228
  try:
228
229
  v["stage"] = IssueStage(v["stage"])
229
230
  except ValueError:
@@ -20,3 +20,112 @@ System for managing tasks using `monoco issue`.
20
20
  - 🛑 **NO** direct coding on `main`/`master` (Linter will fail).
21
21
  - **Prune Timing**: ONLY prune environment (branch/worktree) during `monoco issue close --prune`. NEVER prune at `submit` stage.
22
22
  - Must update `files` field after coding (via `sync-files` or manual).
23
+
24
+ ## Git Merge Strategy
25
+
26
+ ### Core Principles
27
+
28
+ To ensure safe merging of Feature branches into the mainline and prevent "stale state pollution", the following merge strategy must be followed:
29
+
30
+ #### 1. No Manual Merge
31
+
32
+ - **🛑 STRICTLY FORBIDDEN**: Agents must NOT manually execute `git merge` to merge Feature branches
33
+ - **🛑 STRICTLY FORBIDDEN**: Using `git pull origin main` followed by direct commits
34
+ - **✅ ONLY AUTHORITATIVE PATH**: Must use `monoco issue close` for closing the loop
35
+
36
+ #### 2. Safe Merge Flow
37
+
38
+ The correct Issue closing workflow is as follows:
39
+
40
+ ```bash
41
+ # 1. Ensure you're on main/master branch and code is merged
42
+ $ git checkout main
43
+ $ git pull origin main
44
+
45
+ # 2. Confirm Feature branch changes are merged to mainline
46
+ # (via PR/MR or other code review process)
47
+
48
+ # 3. Use monoco issue close to close Issue (prune by default)
49
+ $ monoco issue close FEAT-XXXX --solution implemented
50
+
51
+ # 4. To keep branch, use --no-prune
52
+ $ monoco issue close FEAT-XXXX --solution implemented --no-prune
53
+ ```
54
+
55
+ #### 3. Conflict Resolution Principles
56
+
57
+ When Feature branch conflicts with mainline:
58
+
59
+ 1. **Auto-merge Stop**: If `touched files` (Issue `files` field) conflict with mainline, automation tools **MUST IMMEDIATELY STOP** merging and throw a clear error.
60
+
61
+ 2. **Manual Cherry-Pick Mode**:
62
+ - Error message will instruct Agent to switch to manual Cherry-Pick mode
63
+ - **Core Principle**: Only pick valid changes belonging to this Feature, STRICTLY FORBIDDEN from overwriting updates to unrelated Issues on mainline
64
+ - Use `git cherry-pick <commit>` to apply valid commits one by one
65
+
66
+ 3. **Fallback Strategy**:
67
+ ```bash
68
+ # 1. Create temporary branch for conflict resolution
69
+ $ git checkout main
70
+ $ git checkout -b temp/FEAT-XXXX-resolve
71
+
72
+ # 2. Cherry-pick valid commits one by one
73
+ $ git cherry-pick <commit-hash-1>
74
+ $ git cherry-pick <commit-hash-2>
75
+
76
+ # 3. If conflicts occur, only keep changes from this Feature
77
+ # Discard any modifications that would overwrite other Issue updates on mainline
78
+
79
+ # 4. Merge temporary branch when done
80
+ $ git checkout main
81
+ $ git merge temp/FEAT-XXXX-resolve
82
+
83
+ # 5. Close Issue
84
+ $ monoco issue close FEAT-XXXX --solution implemented
85
+ ```
86
+
87
+ #### 4. Smart Atomic Merge Based on files Field
88
+
89
+ The Issue's `files` field records the Actual Impact Scope of the Feature branch:
90
+
91
+ - **Generation**: `monoco issue sync-files` uses `git diff --name-only base...target` logic
92
+ - **Purpose**: Serves as a merge whitelist, only merging files in the list, filtering out implicit overwrites caused by "stale baseline"
93
+ - **Limitation**: Cannot defend against explicit accidental modifications (e.g., inadvertently formatting other Issue files)
94
+
95
+ **Future Enhancement**: Implement selective merge logic based on `files` list:
96
+ ```bash
97
+ # Selective merge (planned)
98
+ $ git checkout main
99
+ $ git checkout feature/FEAT-XXXX -- <files...>
100
+ ```
101
+
102
+ #### 5. Cleanup Strategy
103
+
104
+ - **Default Cleanup**: `monoco issue close` executes `--prune` by default, deleting Feature branch/worktree
105
+ - **Keep Branch**: To preserve branch, explicitly use `--no-prune`
106
+ - **Force Cleanup**: Use `--force` to force delete unmerged branches (use with caution)
107
+
108
+ ```bash
109
+ # Default branch cleanup
110
+ $ monoco issue close FEAT-XXXX --solution implemented
111
+ # ✔ Cleaned up: branch:feat/feat-XXXX-xxx
112
+
113
+ # Keep branch
114
+ $ monoco issue close FEAT-XXXX --solution implemented --no-prune
115
+
116
+ # Force cleanup (caution)
117
+ $ monoco issue close FEAT-XXXX --solution implemented --force
118
+ ```
119
+
120
+ ### Summary
121
+
122
+ | Operation | Command | Description |
123
+ |-----------|---------|-------------|
124
+ | Create Issue | `monoco issue create feature -t "Title"` | Create Issue before development |
125
+ | Start Development | `monoco issue start FEAT-XXXX --branch` | Create Feature branch |
126
+ | Sync Files | `monoco issue sync-files` | Update files field |
127
+ | Submit Review | `monoco issue submit FEAT-XXXX` | Enter Review stage |
128
+ | Close Issue | `monoco issue close FEAT-XXXX --solution implemented` | Only merge path |
129
+ | Keep Branch | `monoco issue close ... --no-prune` | Close without deleting branch |
130
+
131
+ > ⚠️ **WARNING**: Any manual merge operation bypassing `monoco issue close` may cause mainline state pollution and violate workflow compliance requirements.
@@ -1,6 +1,8 @@
1
1
  ---
2
- name: monoco-issue
2
+ name: monoco_atom_issue
3
3
  description: Official skill for Monoco Issue System. Treats Issues as Universal Atoms, managing the lifecycle of Epic/Feature/Chore/Fix.
4
+ type: atom
5
+ version: 1.0.0
4
6
  ---
5
7
 
6
8
  # Issue Management
@@ -0,0 +1,167 @@
1
+ ---
2
+ name: monoco_workflow_issue_creation
3
+ description: Extract improvement clues from Memo, classify and create Issue Ticket (Copilot Mode)
4
+ type: workflow
5
+ domain: issue
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Issue Create Workflow
10
+
11
+ Standardized workflow for extracting improvement clues from Memo, analyzing and creating structured Issue Tickets.
12
+
13
+ **Applicable Scenario**: Copilot Mode (Human-led, AI-assisted)
14
+ **Target Users**: Developers who need to quickly transform ideas/notes into actionable tasks
15
+
16
+ ## Workflow State Machine
17
+
18
+ ```mermaid
19
+ stateDiagram-v2
20
+ [*] --> Extract: Read Memo
21
+
22
+ Extract --> Classify: Identify Type
23
+ Extract --> Archive: No Value
24
+
25
+ Classify --> Design: Architecture Design Required
26
+ Classify --> Direct: Create Directly
27
+
28
+ Design --> Create: Design Complete
29
+ Direct --> Create: Create Directly
30
+
31
+ Archive --> [*]: Archive Memo
32
+ Create --> [*]: Issue Creation Complete
33
+ ```
34
+
35
+ ## Execution Steps
36
+
37
+ ### 1. Extract
38
+
39
+ - **Goal**: Extract key improvement clues from Memo
40
+ - **Input**: Memo file or temporary notes
41
+ - **Output**: Structured improvement clue list
42
+ - **Checkpoints**:
43
+ - [ ] Run `monoco memo list` to view pending Memos
44
+ - [ ] Analyze improvement type and impact scope for each Memo
45
+ - [ ] Identify actionable improvements (not pure reference materials)
46
+ - [ ] Record improvement motivation and expected effects
47
+
48
+ **Analysis Dimensions**:
49
+ | Dimension | Question |
50
+ |-----------|----------|
51
+ | Value | What problem does this improvement solve? |
52
+ | Scope | Which modules/features are affected? |
53
+ | Urgency | Do it now or later? |
54
+ | Feasibility | Is there enough information to start? |
55
+
56
+ ### 2. Classify
57
+
58
+ - **Goal**: Determine Issue type and priority
59
+ - **Checkpoints**:
60
+ - [ ] Determine if it's an architecture-level improvement (→ Epic)
61
+ - [ ] Determine if it's user value increment (→ Feature)
62
+ - [ ] Determine if it's engineering debt (→ Chore)
63
+ - [ ] Determine if it's a bug fix (→ Fix)
64
+ - [ ] Assess if pre-architecture design is required
65
+
66
+ **Decision Branches**:
67
+
68
+ | Condition | Type | Next Step |
69
+ |-----------|------|-----------|
70
+ | Architecture vision-level improvement, needs decomposition into multiple Features | Epic | → Design |
71
+ | User deliverable value, with clear acceptance criteria | Feature | → Direct |
72
+ | Engineering maintenance task, technical debt cleanup | Chore | → Direct |
73
+ | Bug fix, with clear reproduction steps | Fix | → Direct |
74
+ | Pure reference material, no direct improvement value | - | → Archive |
75
+ | Requires architecture design to estimate effort | - | → Design |
76
+
77
+ ### 3. Design (Optional)
78
+
79
+ - **Goal**: Preliminary architecture design for complex improvements
80
+ - **Applicable**: Epic or large Feature
81
+ - **Checkpoints**:
82
+ - [ ] Analyze existing architecture inheritance
83
+ - [ ] Determine technical solution direction
84
+ - [ ] Identify dependency relationships and risk points
85
+ - [ ] Estimate effort and milestones
86
+
87
+ **Outputs**:
88
+ - Architecture Decision Record (ADR) draft
89
+ - Subtask decomposition suggestions
90
+ - Dependency Issue list
91
+
92
+ ### 4. Create
93
+
94
+ - **Goal**: Create Issue that meets specifications
95
+ - **Checkpoints**:
96
+ - [ ] Run `monoco issue create <type> -t "Title"`
97
+ - [ ] Write clear description and background
98
+ - [ ] Define verifiable acceptance criteria (at least 2 Checkboxes)
99
+ - [ ] Set dependency relationships (if needed)
100
+ - [ ] Associate related Memo (if applicable)
101
+ - [ ] Run `monoco issue lint` to verify compliance
102
+
103
+ **Issue Content Template**:
104
+
105
+ ```markdown
106
+ ## Objective
107
+ Clearly describe the goal and expected outcome of this Issue.
108
+
109
+ ## Acceptance Criteria
110
+ - [ ] Acceptance criterion 1
111
+ - [ ] Acceptance criterion 2
112
+
113
+ ## Technical Tasks
114
+ - [ ] Technical task 1
115
+ - [ ] Technical task 2
116
+
117
+ ## Related
118
+ - Parent: EPIC-XXXX (if applicable)
119
+ - Related Memo: MEMO-XXXX (if applicable)
120
+ ```
121
+
122
+ ### 5. Archive (Optional)
123
+
124
+ - **Goal**: Archive Memos with no direct improvement value
125
+ - **Checkpoints**:
126
+ - [ ] Confirm Memo content is pure reference material
127
+ - [ ] Record archiving reason
128
+ - [ ] Update Memo status (if system supports)
129
+
130
+ ## Issue Type Guide
131
+
132
+ | Type | Purpose | Prefix | Mindset | Example |
133
+ |------|---------|--------|---------|---------|
134
+ | Epic | Grand goals, vision container | EPIC- | Architect | Refactor core architecture |
135
+ | Feature | User value increment | FEAT- | Product Owner | Add export functionality |
136
+ | Chore | Engineering tasks | CHORE- | Builder | Upgrade dependency versions |
137
+ | Fix | Bug fixes | FIX- | Debugger | Fix memory leak |
138
+
139
+ ## Related Commands
140
+
141
+ ```bash
142
+ # View pending Memos
143
+ monoco memo list
144
+
145
+ # Create Issue
146
+ monoco issue create feature -t "Title"
147
+ monoco issue create chore -t "Title"
148
+ monoco issue create fix -t "Title"
149
+ monoco issue create epic -t "Title"
150
+
151
+ # Verify Issue compliance
152
+ monoco issue lint
153
+ ```
154
+
155
+ ## Relationship with flow_engineer
156
+
157
+ This workflow complements `flow_engineer`:
158
+ - `issue-create-workflow`: Focuses on Issue creation phase, transforming ideas into actionable tasks
159
+ - `flow_engineer`: Focuses on code implementation phase, executing Investigate → Code → Test → Report → Submit
160
+
161
+ ## Copilot Mode Tips
162
+
163
+ As an AI Copilot, you should:
164
+ 1. **Ask proactively**: When Memo content is unclear, ask human developers for intent
165
+ 2. **Provide options**: Give multiple classification suggestions with reasoning
166
+ 3. **Assist drafting**: Help write Issue descriptions and acceptance criteria
167
+ 4. **Remind compliance**: Ensure created Issues meet project specifications
@@ -0,0 +1,224 @@
1
+ ---
2
+ name: monoco_workflow_issue_development
3
+ description: Execute complete workflow for Issue development, testing, submission and review (Copilot Mode)
4
+ type: workflow
5
+ domain: issue
6
+ version: 1.0.0
7
+ ---
8
+
9
+ # Issue Develop Workflow
10
+
11
+ Complete standardized workflow for Issue development, testing, submission, review and merge.
12
+
13
+ **Applicable Scenario**: Copilot Mode (Human-led, AI-assisted)
14
+ **Target Users**: Developers responsible for implementing features or fixing bugs
15
+
16
+ ## Workflow State Machine
17
+
18
+ ```mermaid
19
+ stateDiagram-v2
20
+ [*] --> Setup: Start Development
21
+
22
+ Setup --> Develop: Environment Ready
23
+ Setup --> Setup: Dependencies Not Met<br/>(Wait for Resolution)
24
+
25
+ Develop --> Test: Coding Complete
26
+ Develop --> Develop: Needs Iteration<br/>(Continue Development)
27
+
28
+ Test --> Submit: Tests Pass
29
+ Test --> Develop: Tests Fail<br/>(Fix Code)
30
+
31
+ state "Review Loop" as ReviewLoop {
32
+ Submit --> Review: Submit for Review
33
+ Review --> Fix: Changes Required
34
+ Fix --> Submit: Resubmit
35
+ }
36
+
37
+ Review --> Merge: Review Passed
38
+
39
+ Merge --> [*]: Merge Complete
40
+ ```
41
+
42
+ ## Execution Steps
43
+
44
+ ### 1. Setup
45
+
46
+ - **Goal**: Prepare development environment, ensure ready to code
47
+ - **Checkpoints**:
48
+ - [ ] Run `monoco issue start <ID> --branch` to create feature branch
49
+ - [ ] Confirm branch is created and switched
50
+ - [ ] Verify not currently on main/master branch
51
+ - [ ] Check if dependency Issues are completed
52
+ - [ ] Confirm Issue is refined (has technical task list)
53
+
54
+ **Environment Checklist**:
55
+ | Check Item | Command/Method |
56
+ |------------|----------------|
57
+ | Current Branch | `git branch --show-current` |
58
+ | Branch Status | `git status` |
59
+ | Dependency Issues | `monoco issue show <ID>` |
60
+ | Code Standards | Check project lint configuration |
61
+
62
+ ### 2. Develop
63
+
64
+ - **Goal**: Implement feature or fix bug
65
+ - **Strategy**: Iterative development, small commits
66
+ - **Checkpoints**:
67
+ - [ ] Follow project code standards
68
+ - [ ] Write/update unit tests
69
+ - [ ] Commit code regularly (small commits)
70
+ - [ ] Update file tracking (`monoco issue sync-files`)
71
+ - [ ] Maintain code reviewability (single commit < 400 lines)
72
+
73
+ **Development Principles**:
74
+ | Principle | Description |
75
+ |-----------|-------------|
76
+ | Small Commits | Each commit is a logical unit |
77
+ | Test First | Prioritize writing test cases |
78
+ | Continuous Sync | Update file tracking promptly |
79
+ | Stay Focused | Avoid unrelated changes |
80
+
81
+ ### 3. Test
82
+
83
+ - **Goal**: Ensure code quality and functional correctness
84
+ - **Checkpoints**:
85
+ - [ ] Run unit tests, ensure they pass
86
+ - [ ] Run integration tests (if applicable)
87
+ - [ ] Run code style checks (lint)
88
+ - [ ] Manually verify functionality (if needed)
89
+ - [ ] Check test coverage
90
+
91
+ **Test Levels**:
92
+ ```
93
+ Unit Test → Integration Test → E2E Test → Manual Verification
94
+ ↑ ↑ ↑ ↑
95
+ Required Recommended As Needed As Needed
96
+ ```
97
+
98
+ ### 4. Submit
99
+
100
+ - **Goal**: Prepare for code review
101
+ - **Checkpoints**:
102
+ - [ ] Run `monoco issue lint` to check compliance
103
+ - [ ] Fix all Lint errors
104
+ - [ ] Update task list status (mark completed items)
105
+ - [ ] Write clear commit message
106
+ - [ ] Run `monoco issue submit <ID>`
107
+
108
+ **Commit Message Specification**:
109
+ ```
110
+ <type>(<scope>): <subject>
111
+
112
+ <body>
113
+
114
+ Refs: <ISSUE-ID>
115
+ ```
116
+
117
+ | Type | Purpose |
118
+ |------|---------|
119
+ | feat | New feature |
120
+ | fix | Bug fix |
121
+ | docs | Documentation update |
122
+ | style | Code formatting |
123
+ | refactor | Refactoring |
124
+ | test | Test related |
125
+ | chore | Build/tools |
126
+
127
+ ### 5. Review
128
+
129
+ - **Goal**: Code quality and process compliance check
130
+ - **Checkpoints**:
131
+ - [ ] Is functionality correctly implemented
132
+ - [ ] Does code meet design specifications
133
+ - [ ] Are tests sufficient
134
+ - [ ] Is documentation updated
135
+ - [ ] Does it follow project standards
136
+
137
+ **Review Dimensions**:
138
+ | Dimension | Check Content |
139
+ |-----------|---------------|
140
+ | Correctness | Does functionality work as expected |
141
+ | Design | Does it meet architecture design |
142
+ | Testing | Is test coverage sufficient |
143
+ | Standards | Does it follow code standards |
144
+ | Documentation | Is documentation updated |
145
+ | Performance | Are there obvious performance issues |
146
+ | Security | Are there security risks |
147
+
148
+ ### 6. Merge
149
+
150
+ - **Goal**: Complete Issue, merge code
151
+ - **Checkpoints**:
152
+ - [ ] Code has passed review
153
+ - [ ] All CI checks pass
154
+ - [ ] Code is merged to main branch
155
+ - [ ] Run `monoco issue close <ID> --solution completed --prune`
156
+ - [ ] Verify branch is cleaned up
157
+ - [ ] Update Review Comments (record review feedback)
158
+
159
+ ## Decision Branches
160
+
161
+ | Condition | Action |
162
+ |-----------|--------|
163
+ | Dependency Issues not completed | Return to Setup, wait for dependencies |
164
+ | Tests fail | Return to Develop, fix code |
165
+ | Lint fails | Fix compliance issues, resubmit |
166
+ | Review requires changes | Return to Fix, modify per feedback |
167
+ | Review passed | Enter Merge, merge and cleanup |
168
+
169
+ ## Compliance Requirements
170
+
171
+ - **Prohibited**: Directly modify code on main/master branch
172
+ - **Required**: Use `monoco issue start --branch` to create feature branch
173
+ - **Required**: All unit tests must pass before Submit
174
+ - **Required**: Each Issue must have at least 2 Checkboxes
175
+ - **Required**: Review/Done phase must include Review Comments
176
+ - **Recommended**: Small commits, frequently sync file tracking
177
+
178
+ ## Related Commands
179
+
180
+ ```bash
181
+ # Start development
182
+ monoco issue start FEAT-0001 --branch
183
+
184
+ # Sync file tracking
185
+ monoco issue sync-files
186
+
187
+ # Check compliance
188
+ monoco issue lint
189
+
190
+ # Submit for review
191
+ monoco issue submit FEAT-0001
192
+
193
+ # Close Issue
194
+ monoco issue close FEAT-0001 --solution completed --prune
195
+ ```
196
+
197
+ ## Relationship with flow_engineer
198
+
199
+ The relationship between this workflow and `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`: Focuses on Issue-level process management
213
+ - `flow_engineer`: Focuses on specific technical process for code implementation
214
+
215
+ During the Develop phase, developers should follow `flow_engineer`'s Investigate → Code → Test → Report → Submit process.
216
+
217
+ ## Copilot Mode Tips
218
+
219
+ As an AI Copilot, you should:
220
+ 1. **Assist coding**: Help implement features, fix bugs
221
+ 2. **Code review**: Pre-review before submission to find potential issues
222
+ 3. **Test assistance**: Help write test cases, ensure coverage
223
+ 4. **Compliance check**: Remind developers to follow project standards
224
+ 5. **Documentation sync**: Assist in updating related documentation