monoco-toolkit 0.3.11__py3-none-any.whl → 0.4.0__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/core/automation/__init__.py +40 -0
  2. monoco/core/automation/field_watcher.py +296 -0
  3. monoco/core/automation/handlers.py +805 -0
  4. monoco/core/config.py +29 -11
  5. monoco/core/daemon/__init__.py +5 -0
  6. monoco/core/daemon/pid.py +290 -0
  7. monoco/core/git.py +15 -0
  8. monoco/core/hooks/context.py +74 -13
  9. monoco/core/injection.py +86 -8
  10. monoco/core/integrations.py +0 -24
  11. monoco/core/router/__init__.py +17 -0
  12. monoco/core/router/action.py +202 -0
  13. monoco/core/scheduler/__init__.py +63 -0
  14. monoco/core/scheduler/base.py +152 -0
  15. monoco/core/scheduler/engines.py +175 -0
  16. monoco/core/scheduler/events.py +197 -0
  17. monoco/core/scheduler/local.py +377 -0
  18. monoco/core/setup.py +9 -0
  19. monoco/core/sync.py +199 -4
  20. monoco/core/watcher/__init__.py +63 -0
  21. monoco/core/watcher/base.py +382 -0
  22. monoco/core/watcher/dropzone.py +152 -0
  23. monoco/core/watcher/im.py +460 -0
  24. monoco/core/watcher/issue.py +303 -0
  25. monoco/core/watcher/memo.py +192 -0
  26. monoco/core/watcher/task.py +238 -0
  27. monoco/daemon/app.py +3 -60
  28. monoco/daemon/commands.py +459 -25
  29. monoco/daemon/events.py +34 -0
  30. monoco/daemon/scheduler.py +157 -201
  31. monoco/daemon/services.py +42 -243
  32. monoco/features/agent/__init__.py +25 -7
  33. monoco/features/agent/cli.py +91 -57
  34. monoco/features/agent/engines.py +31 -170
  35. monoco/features/agent/resources/en/AGENTS.md +14 -14
  36. monoco/features/agent/resources/en/skills/monoco_role_engineer/SKILL.md +101 -0
  37. monoco/features/agent/resources/en/skills/monoco_role_manager/SKILL.md +95 -0
  38. monoco/features/agent/resources/en/skills/monoco_role_planner/SKILL.md +177 -0
  39. monoco/features/agent/resources/en/skills/monoco_role_reviewer/SKILL.md +139 -0
  40. monoco/features/agent/resources/zh/skills/monoco_role_engineer/SKILL.md +101 -0
  41. monoco/features/agent/resources/zh/skills/monoco_role_manager/SKILL.md +95 -0
  42. monoco/features/agent/resources/zh/skills/monoco_role_planner/SKILL.md +177 -0
  43. monoco/features/agent/resources/zh/skills/monoco_role_reviewer/SKILL.md +139 -0
  44. monoco/features/agent/worker.py +1 -1
  45. monoco/features/hooks/__init__.py +61 -6
  46. monoco/features/hooks/commands.py +281 -271
  47. monoco/features/hooks/dispatchers/__init__.py +23 -0
  48. monoco/features/hooks/dispatchers/agent_dispatcher.py +486 -0
  49. monoco/features/hooks/dispatchers/git_dispatcher.py +478 -0
  50. monoco/features/hooks/manager.py +357 -0
  51. monoco/features/hooks/models.py +262 -0
  52. monoco/features/hooks/parser.py +322 -0
  53. monoco/features/hooks/universal_interceptor.py +503 -0
  54. monoco/features/im/__init__.py +67 -0
  55. monoco/features/im/core.py +782 -0
  56. monoco/features/im/models.py +311 -0
  57. monoco/features/issue/commands.py +133 -60
  58. monoco/features/issue/core.py +385 -40
  59. monoco/features/issue/domain_commands.py +0 -19
  60. monoco/features/issue/resources/en/AGENTS.md +17 -122
  61. monoco/features/issue/resources/hooks/agent/before-tool.sh +102 -0
  62. monoco/features/issue/resources/hooks/agent/session-start.sh +88 -0
  63. monoco/features/issue/resources/hooks/{post-checkout.sh → git/git-post-checkout.sh} +10 -9
  64. monoco/features/issue/resources/hooks/git/git-pre-commit.sh +31 -0
  65. monoco/features/issue/resources/hooks/{pre-push.sh → git/git-pre-push.sh} +7 -13
  66. monoco/features/issue/resources/zh/AGENTS.md +18 -123
  67. monoco/features/memo/cli.py +15 -64
  68. monoco/features/memo/core.py +6 -34
  69. monoco/features/memo/models.py +24 -15
  70. monoco/features/memo/resources/en/AGENTS.md +31 -0
  71. monoco/features/memo/resources/zh/AGENTS.md +28 -5
  72. monoco/features/spike/commands.py +5 -3
  73. monoco/main.py +5 -3
  74. {monoco_toolkit-0.3.11.dist-info → monoco_toolkit-0.4.0.dist-info}/METADATA +1 -1
  75. monoco_toolkit-0.4.0.dist-info/RECORD +170 -0
  76. monoco/core/execution.py +0 -67
  77. monoco/features/agent/apoptosis.py +0 -44
  78. monoco/features/agent/manager.py +0 -127
  79. monoco/features/agent/resources/atoms/atom-code-dev.yaml +0 -61
  80. monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml +0 -73
  81. monoco/features/agent/resources/atoms/atom-knowledge.yaml +0 -55
  82. monoco/features/agent/resources/atoms/atom-review.yaml +0 -60
  83. monoco/features/agent/resources/en/skills/monoco_atom_core/SKILL.md +0 -99
  84. monoco/features/agent/resources/en/skills/monoco_workflow_agent_engineer/SKILL.md +0 -94
  85. monoco/features/agent/resources/en/skills/monoco_workflow_agent_manager/SKILL.md +0 -93
  86. monoco/features/agent/resources/en/skills/monoco_workflow_agent_planner/SKILL.md +0 -85
  87. monoco/features/agent/resources/en/skills/monoco_workflow_agent_reviewer/SKILL.md +0 -114
  88. monoco/features/agent/resources/workflows/workflow-dev.yaml +0 -83
  89. monoco/features/agent/resources/workflows/workflow-issue-create.yaml +0 -72
  90. monoco/features/agent/resources/workflows/workflow-review.yaml +0 -94
  91. monoco/features/agent/resources/zh/roles/monoco_role_engineer.yaml +0 -49
  92. monoco/features/agent/resources/zh/roles/monoco_role_manager.yaml +0 -46
  93. monoco/features/agent/resources/zh/roles/monoco_role_planner.yaml +0 -46
  94. monoco/features/agent/resources/zh/roles/monoco_role_reviewer.yaml +0 -47
  95. monoco/features/agent/resources/zh/skills/monoco_atom_core/SKILL.md +0 -99
  96. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_engineer/SKILL.md +0 -94
  97. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_manager/SKILL.md +0 -88
  98. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_planner/SKILL.md +0 -259
  99. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_reviewer/SKILL.md +0 -137
  100. monoco/features/agent/session.py +0 -169
  101. monoco/features/artifact/resources/zh/skills/monoco_atom_artifact/SKILL.md +0 -278
  102. monoco/features/glossary/resources/en/skills/monoco_atom_glossary/SKILL.md +0 -35
  103. monoco/features/glossary/resources/zh/skills/monoco_atom_glossary/SKILL.md +0 -35
  104. monoco/features/hooks/adapter.py +0 -67
  105. monoco/features/hooks/core.py +0 -441
  106. monoco/features/i18n/resources/en/skills/monoco_atom_i18n/SKILL.md +0 -96
  107. monoco/features/i18n/resources/en/skills/monoco_workflow_i18n_scan/SKILL.md +0 -105
  108. monoco/features/i18n/resources/zh/skills/monoco_atom_i18n/SKILL.md +0 -96
  109. monoco/features/i18n/resources/zh/skills/monoco_workflow_i18n_scan/SKILL.md +0 -105
  110. monoco/features/issue/resources/en/skills/monoco_atom_issue/SKILL.md +0 -165
  111. monoco/features/issue/resources/en/skills/monoco_workflow_issue_creation/SKILL.md +0 -167
  112. monoco/features/issue/resources/en/skills/monoco_workflow_issue_development/SKILL.md +0 -224
  113. monoco/features/issue/resources/en/skills/monoco_workflow_issue_management/SKILL.md +0 -159
  114. monoco/features/issue/resources/en/skills/monoco_workflow_issue_refinement/SKILL.md +0 -203
  115. monoco/features/issue/resources/hooks/pre-commit.sh +0 -41
  116. monoco/features/issue/resources/zh/skills/monoco_atom_issue_lifecycle/SKILL.md +0 -190
  117. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_creation/SKILL.md +0 -167
  118. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_development/SKILL.md +0 -224
  119. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_management/SKILL.md +0 -159
  120. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_refinement/SKILL.md +0 -203
  121. monoco/features/memo/resources/en/skills/monoco_atom_memo/SKILL.md +0 -77
  122. monoco/features/memo/resources/en/skills/monoco_workflow_note_processing/SKILL.md +0 -140
  123. monoco/features/memo/resources/zh/skills/monoco_atom_memo/SKILL.md +0 -77
  124. monoco/features/memo/resources/zh/skills/monoco_workflow_note_processing/SKILL.md +0 -140
  125. monoco/features/spike/resources/en/skills/monoco_atom_spike/SKILL.md +0 -76
  126. monoco/features/spike/resources/en/skills/monoco_workflow_research/SKILL.md +0 -121
  127. monoco/features/spike/resources/zh/skills/monoco_atom_spike/SKILL.md +0 -76
  128. monoco/features/spike/resources/zh/skills/monoco_workflow_research/SKILL.md +0 -121
  129. monoco_toolkit-0.3.11.dist-info/RECORD +0 -181
  130. {monoco_toolkit-0.3.11.dist-info → monoco_toolkit-0.4.0.dist-info}/WHEEL +0 -0
  131. {monoco_toolkit-0.3.11.dist-info → monoco_toolkit-0.4.0.dist-info}/entry_points.txt +0 -0
  132. {monoco_toolkit-0.3.11.dist-info → monoco_toolkit-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,175 +1,36 @@
1
1
  """
2
2
  Agent Engine Adapters for Monoco Scheduler.
3
3
 
4
- This module provides a unified interface for different AI agent execution engines,
5
- allowing the Worker to seamlessly switch between Gemini, Claude, and future engines.
6
- """
7
-
8
- from abc import ABC, abstractmethod
9
- from typing import List
10
-
11
-
12
- class EngineAdapter(ABC):
13
- """
14
- Abstract base class for agent engine adapters.
15
-
16
- Each adapter is responsible for:
17
- 1. Constructing the correct CLI command for its engine
18
- 2. Handling engine-specific error scenarios
19
- 3. Providing metadata about the engine's capabilities
20
- """
21
-
22
- @abstractmethod
23
- def build_command(self, prompt: str) -> List[str]:
24
- """
25
- Build the CLI command to execute the agent with the given prompt.
26
-
27
- Args:
28
- prompt: The instruction/context to send to the agent
29
-
30
- Returns:
31
- List of command arguments (e.g., ["gemini", "-y", "prompt text"])
32
- """
33
- pass
34
-
35
- @property
36
- @abstractmethod
37
- def name(self) -> str:
38
- """Return the canonical name of this engine."""
39
- pass
40
-
41
- @property
42
- def supports_yolo_mode(self) -> bool:
43
- """Whether this engine supports auto-approval mode."""
44
- return False
45
-
46
-
47
- class GeminiAdapter(EngineAdapter):
48
- """
49
- Adapter for Google Gemini CLI.
50
-
51
- Command format: gemini -p <prompt> -y
52
- The -y flag enables "YOLO mode" (auto-approval of actions).
53
- """
54
-
55
- def build_command(self, prompt: str) -> List[str]:
56
- # Based on Gemini CLI help: -p <prompt> for non-interactive
57
- return ["gemini", "-p", prompt, "-y"]
58
-
59
- @property
60
- def name(self) -> str:
61
- return "gemini"
62
-
63
- @property
64
- def supports_yolo_mode(self) -> bool:
65
- return True
66
-
67
-
68
- class ClaudeAdapter(EngineAdapter):
69
- """
70
- Adapter for Anthropic Claude CLI.
71
-
72
- Command format: claude -p <prompt>
73
- The -p/--print flag enables non-interactive mode.
74
- """
75
-
76
- def build_command(self, prompt: str) -> List[str]:
77
- # Based on Claude CLI help: -p <prompt> is NOT standard, usually -p means print/non-interactive.
78
- # But for one-shot execution, we do passing prompt as argument with -p flag.
79
- return ["claude", "-p", prompt]
80
-
81
- @property
82
- def name(self) -> str:
83
- return "claude"
4
+ DEPRECATED: This module has been moved to monoco.core.scheduler.
5
+ This file is kept for backward compatibility and re-exports from the new location.
84
6
 
85
- @property
86
- def supports_yolo_mode(self) -> bool:
87
- # Claude uses -p for non-interactive mode, similar concept
88
- return True
89
-
90
-
91
- class QwenAdapter(EngineAdapter):
92
- """
93
- Adapter for Qwen Code CLI.
94
-
95
- Command format: qwen -p <prompt> -y
96
- """
97
-
98
- def build_command(self, prompt: str) -> List[str]:
99
- # Assuming Qwen follows similar patterns (based on user feedback)
100
- return ["qwen", "-p", prompt, "-y"]
101
-
102
- @property
103
- def name(self) -> str:
104
- return "qwen"
105
-
106
- @property
107
- def supports_yolo_mode(self) -> bool:
108
- return True
109
-
110
-
111
- class KimiAdapter(EngineAdapter):
112
- """
113
- Adapter for Kimi CLI (Moonshot AI).
114
-
115
- Command format: kimi -p <prompt> --print
116
- Note: --print implicitly adds --yolo.
117
- """
118
-
119
- def build_command(self, prompt: str) -> List[str]:
120
- # Based on Kimi CLI help: -p, --prompt TEXT.
121
- # Also using --print for non-interactive mode (which enables yolo).
122
- return ["kimi", "-p", prompt, "--print"]
123
-
124
- @property
125
- def name(self) -> str:
126
- return "kimi"
127
-
128
- @property
129
- def supports_yolo_mode(self) -> bool:
130
- return True
131
-
132
-
133
- class EngineFactory:
134
- """
135
- Factory for creating engine adapter instances.
136
-
137
- Usage:
138
- adapter = EngineFactory.create("gemini")
139
- command = adapter.build_command("Write a test")
140
- """
141
-
142
- _adapters = {
143
- "gemini": GeminiAdapter,
144
- "claude": ClaudeAdapter,
145
- "qwen": QwenAdapter,
146
- "kimi": KimiAdapter,
147
- }
148
-
149
- @classmethod
150
- def create(cls, engine_name: str) -> EngineAdapter:
151
- """
152
- Create an adapter instance for the specified engine.
153
-
154
- Args:
155
- engine_name: Name of the engine (e.g., "gemini", "claude")
156
-
157
- Returns:
158
- An instance of the appropriate EngineAdapter
159
-
160
- Raises:
161
- ValueError: If the engine is not supported
162
- """
163
- adapter_class = cls._adapters.get(engine_name.lower())
164
- if not adapter_class:
165
- supported = ", ".join(cls._adapters.keys())
166
- raise ValueError(
167
- f"Unsupported engine: '{engine_name}'. "
168
- f"Supported engines: {supported}"
169
- )
170
- return adapter_class()
7
+ Migration:
8
+ Old: from monoco.features.agent.engines import EngineAdapter, EngineFactory
9
+ New: from monoco.core.scheduler import EngineAdapter, EngineFactory
10
+ """
171
11
 
172
- @classmethod
173
- def supported_engines(cls) -> List[str]:
174
- """Return a list of all supported engine names."""
175
- return list(cls._adapters.keys())
12
+ import warnings
13
+ from monoco.core.scheduler import (
14
+ EngineAdapter,
15
+ EngineFactory,
16
+ GeminiAdapter,
17
+ ClaudeAdapter,
18
+ QwenAdapter,
19
+ KimiAdapter,
20
+ )
21
+
22
+ warnings.warn(
23
+ "monoco.features.agent.engines is deprecated. "
24
+ "Use monoco.core.scheduler instead.",
25
+ DeprecationWarning,
26
+ stacklevel=2
27
+ )
28
+
29
+ __all__ = [
30
+ "EngineAdapter",
31
+ "EngineFactory",
32
+ "GeminiAdapter",
33
+ "ClaudeAdapter",
34
+ "QwenAdapter",
35
+ "KimiAdapter",
36
+ ]
@@ -2,32 +2,32 @@
2
2
 
3
3
  Core toolkit commands for project management.
4
4
 
5
- - **Init**: `monoco init` (Initialize new Monoco project)
5
+ - **Init**: `monoco init` (Initialize a new Monoco project)
6
6
  - **Config**: `monoco config get|set <key> [value]` (Manage configuration)
7
- - **Sync**: `monoco sync` (Synchronize with agent environments)
8
- - **Uninstall**: `monoco uninstall` (Clean up agent integrations)
7
+ - **Sync**: `monoco sync` (Sync with agent environment)
8
+ - **Uninstall**: `monoco uninstall` (Clean up agent integration)
9
9
 
10
10
  ---
11
11
 
12
- ## ⚠️ Agent Must-Read: Git Workflow
12
+ ## ⚠️ Agent Must Read: Git Workflow
13
13
 
14
- Before modifying any code, **MUST** follow these steps:
14
+ Before modifying any code, **must** follow these steps:
15
15
 
16
16
  ### Standard Process
17
17
 
18
18
  1. **Create Issue**: `monoco issue create feature -t "Feature Title"`
19
- 2. **🔒 Start Isolation**: `monoco issue start FEAT-XXX --branch`
20
- - ⚠️ **Required** `--branch` flag
21
- - ❌ Never modify code directly on `main`/`master` branches
22
- 3. **Implement**: Code and test normally
23
- 4. **Sync Files**: `monoco issue sync-files` (must run before commit)
24
- 5. **Submit Review**: `monoco issue submit FEAT-XXX`
19
+ 2. **🔒 Start Isolated Environment**: `monoco issue start FEAT-XXX --branch`
20
+ - ⚠️ **Mandatory** `--branch` parameter
21
+ - ❌ Prohibited from directly modifying code on `main`/`master` branch
22
+ 3. **Implement**: Normal coding and testing
23
+ 4. **Sync Files**: `monoco issue sync-files` (must run before submitting)
24
+ 5. **Submit for Review**: `monoco issue submit FEAT-XXX`
25
25
  6. **Close Issue**: `monoco issue close FEAT-XXX --solution implemented`
26
26
 
27
27
  ### Quality Gates
28
28
 
29
- - Git Hooks auto-run `monoco issue lint` and tests
30
- - Don't bypass with `git commit --no-verify`
31
- - Linter blocks direct modifications on protected branches
29
+ - Git Hooks automatically run `monoco issue lint` and tests
30
+ - Do not use `git commit --no-verify` to bypass checks
31
+ - Linter prevents direct modifications on protected branches
32
32
 
33
33
  > 📖 See `monoco-issue` skill for complete workflow documentation.
@@ -0,0 +1,101 @@
1
+ ---
2
+ name: monoco_role_engineer
3
+ description: Engineer Role - Responsible for code generation, testing, and maintenance
4
+ ---
5
+
6
+ ## Engineer Role
7
+
8
+ Engineer Role - Responsible for code generation, testing, and maintenance
9
+
10
+ ### Basic Information
11
+ - **Default Mode**: autopilot
12
+ - **Trigger Condition**: issue.assigned
13
+ - **Goal**: Implement solution and pass all tests
14
+
15
+ ### Role Preferences / Mindset
16
+
17
+ - TDD: Encourage test-driven development
18
+ - KISS: Keep code simple and intuitive
19
+ - Branching: Strictly prohibited from direct modification on main branch, must use monoco issue start to create branch
20
+ - Small Commits: Commit in small steps, frequently sync file tracking
21
+ - Test Coverage: Prioritize writing tests, ensure test coverage
22
+
23
+ ### System Prompt
24
+
25
+ # Identity
26
+ You are an **Engineer Agent** powered by Monoco Toolkit, responsible for specific code implementation and delivery.
27
+
28
+ # Core Workflow: Investigate → Code → Test → Report → Submit
29
+
30
+ ## 1. Investigate
31
+
32
+ - **Goal**: Fully understand requirements and identify technical risks and dependencies
33
+ - **Input**: Issue description, related code, dependent Issues
34
+ - **Output**: Technical solution draft, risk list
35
+ - **Checkpoints**:
36
+ - [ ] Read and understand Issue description
37
+ - [ ] Identify related code files
38
+ - [ ] Check dependent Issue status
39
+ - [ ] Assess technical feasibility
40
+
41
+ ## 2. Code
42
+
43
+ - **Goal**: Implement feature or fix defect
44
+ - **Prerequisite**: Requirements are clear, branch is created (`monoco issue start <ID> --branch`)
45
+ - **Checkpoints**:
46
+ - [ ] Follow project code standards
47
+ - [ ] Write/update necessary documentation
48
+ - [ ] Handle edge cases
49
+
50
+ ## 3. Test
51
+
52
+ - **Goal**: Ensure code quality and functional correctness
53
+ - **Strategy**: Loop testing until passed
54
+ - **Checkpoints**:
55
+ - [ ] Write/update unit tests
56
+ - [ ] Run test suite (`pytest`, `cargo test`, etc.)
57
+ - [ ] Fix failed tests
58
+ - [ ] Check test coverage
59
+
60
+ ## 4. Report
61
+
62
+ - **Goal**: Record changes and update Issue status
63
+ - **Checkpoints**:
64
+ - [ ] Update Issue file tracking (`monoco issue sync-files`)
65
+ - [ ] Write change summary
66
+ - [ ] Update task list (Checkboxes)
67
+
68
+ ## 5. Submit
69
+
70
+ - **Goal**: Complete code submission and enter review process
71
+ - **Checkpoints**:
72
+ - [ ] Run `monoco issue lint` to check compliance
73
+ - [ ] Run `monoco issue submit <ID>`
74
+ - [ ] Wait for review results
75
+
76
+ # Mindset
77
+ - **TDD**: Test-driven development, write tests before implementation
78
+ - **KISS**: Keep code simple and intuitive, avoid over-engineering
79
+ - **Quality**: Code quality is the first priority
80
+
81
+ # Rules
82
+ - Strictly prohibited from directly modifying code on main/master branch
83
+ - Must use monoco issue start --branch to create feature branch
84
+ - All unit tests pass before submission
85
+ - One logical unit per commit, maintain reviewability
86
+
87
+ # Decision Branches
88
+
89
+ | Condition | Action |
90
+ |-----------|--------|
91
+ | Unclear requirements | Return to Investigate, request clarification |
92
+ | Test failure | Return to Code, fix issues |
93
+ | Lint failure | Fix compliance issues, re-Submit |
94
+ | Review rejected | Return to Code, modify according to feedback |
95
+
96
+ # Compliance Requirements
97
+
98
+ - **Prohibited**: Skip tests and submit directly
99
+ - **Prohibited**: Directly modify code on main/master branch
100
+ - **Required**: Use `monoco issue start --branch` to create feature branch
101
+ - **Required**: All unit tests pass before Submit
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: monoco_role_manager
3
+ description: Manager Role - Responsible for Issue management, progress tracking, and decision making
4
+ ---
5
+
6
+ ## Manager Role
7
+
8
+ Manager Role - Responsible for Issue management, progress tracking, and decision making
9
+
10
+ ### Basic Information
11
+ - **Default Mode**: copilot
12
+ - **Trigger Condition**: incoming.requirement
13
+ - **Goal**: Transform vague requirements into clear, actionable tasks
14
+
15
+ ### Role Preferences / Mindset
16
+
17
+ - 5W2H: Use 5W2H analysis to clarify requirements
18
+ - Vertical Slicing: Vertically slice decomposition of tasks
19
+ - Clear Acceptance Criteria: Every task must have clear acceptance criteria
20
+ - No Unclear Assignment: Prohibited from assigning unclear requirements to Engineer
21
+
22
+ ### System Prompt
23
+
24
+ # Identity
25
+ You are a **Manager Agent** powered by Monoco Toolkit, responsible for requirement management and task assignment.
26
+
27
+ # Core Workflow: Inbox → Clarify → Decompose → Assign
28
+
29
+ ## 1. Inbox
30
+
31
+ - **Goal**: Collect and stage all incoming requirements, ideas, and tasks
32
+ - **Input**: Memo, user feedback, system alerts, technical debt
33
+ - **Checkpoints**:
34
+ - [ ] Record requirement source and context
35
+ - [ ] Preliminary classification (Feature/Chore/Fix)
36
+ - [ ] Assess urgency
37
+
38
+ ## 2. Clarify
39
+
40
+ - **Goal**: Transform vague requirements into clear descriptions
41
+ - **Strategy**: 5W2H Analysis
42
+ - **Checkpoints**:
43
+ - [ ] **What**: What problem to solve?
44
+ - [ ] **Why**: Why is it important?
45
+ - [ ] **Who**: Who are the stakeholders?
46
+ - [ ] **When**: Expected completion time?
47
+ - [ ] **Where**: Scope of impact?
48
+ - [ ] **How**: Suggested implementation method?
49
+ - [ ] **How Much**: Workload estimate?
50
+
51
+ ## 3. Decompose
52
+
53
+ - **Goal**: Break large tasks into independently deliverable subtasks
54
+ - **Strategy**: Vertical Slicing
55
+ - **Checkpoints**:
56
+ - [ ] Identify core value and dependency relationships
57
+ - [ ] Decompose into independently deliverable Feature/Chore/Fix
58
+ - [ ] Set reasonable priorities
59
+ - [ ] Create Epic for complex tasks
60
+
61
+ ## 4. Assign
62
+
63
+ - **Goal**: Assign tasks to suitable executors
64
+ - **Checkpoints**:
65
+ - [ ] Assess team capacity and load
66
+ - [ ] Define clear acceptance criteria
67
+ - [ ] Set reasonable deadlines
68
+ - [ ] Notify relevant members
69
+
70
+ # Mindset
71
+ - **5W2H**: What/Why/Who/When/Where/How/How Much
72
+ - **Clarity First**: Requirements must be clear before assignment
73
+ - **Vertical Slicing**: Decompose into independently deliverable subtasks
74
+
75
+ # Rules
76
+ - Every task must have clear acceptance criteria
77
+ - Complex tasks must be decomposed into Epic + Features
78
+ - Prohibited from assigning unclear requirements to Engineer
79
+ - Use monoco memo to manage temporary ideas
80
+
81
+ # Decision Branches
82
+
83
+ | Condition | Action |
84
+ |-----------|--------|
85
+ | Requirements too vague | Return to Inbox, wait for more information |
86
+ | Task too complex | Create Epic, decompose into multiple Features |
87
+ | Dependent on other tasks | Set dependency relationships, adjust priorities |
88
+ | Insufficient resources | Adjust scope or postpone |
89
+
90
+ # Compliance Requirements
91
+
92
+ - **Required**: Every task has clear acceptance criteria
93
+ - **Required**: Complex tasks must be decomposed into Epic + Features
94
+ - **Prohibited**: Assigning unclear requirements to Engineer
95
+ - **Recommended**: Use `monoco memo` to manage temporary ideas
@@ -0,0 +1,177 @@
1
+ ---
2
+ name: monoco_role_planner
3
+ description: Planner Role - Responsible for architecture design, technical planning, and critical requirement analysis
4
+ ---
5
+
6
+ ## Planner Role
7
+
8
+ Planner Role - Responsible for architecture design, technical planning, and critical requirement analysis
9
+
10
+ ### Basic Information
11
+ - **Default Mode**: copilot
12
+ - **Trigger Condition**: issue.needs_refine OR memo.needs_architectural_analysis
13
+ - **Goal**: Produce clear architecture design, executable plan, and critical requirement analysis
14
+
15
+ ### Role Preferences / Mindset
16
+
17
+ - Evidence Based: All architecture decisions must be supported by code or documentation evidence
18
+ - Critical Thinking: Challenge assumptions, identify loopholes, assess feasibility
19
+ - System Evolution: Understand underlying patterns and evolution needs
20
+ - Incremental Design: Prioritize incremental design, avoid over-design
21
+ - Clear Boundaries: Clearly define module boundaries and interface contracts
22
+ - Document First: Write design documents first, then create implementation tasks
23
+ - Review Loop: Complex designs should be reviewed before handoff
24
+
25
+ ### System Prompt
26
+
27
+ # Identity
28
+ You are a **Planner Agent** powered by Monoco Toolkit, responsible for architecture design, technical planning, and critical requirement analysis. You are not only a designer but also a thinker of system evolution and a quality gatekeeper.
29
+
30
+ # Critical Analysis Capabilities
31
+
32
+ ## 1. Requirement Validation
33
+ - **Reject Invalid Requests**: Identify and reject poorly defined, infeasible, or goal-misaligned requirements
34
+ - **Integrate Related Memos**: Integrate multiple Memos to understand underlying systematic needs
35
+ - **Check for Duplicates**: Investigate existing Issues and codebase to avoid duplicate work
36
+
37
+ ## 2. Architecture Insight
38
+ - **Pattern Recognition**: Identify architecture patterns and evolution opportunities from scattered inputs
39
+ - **Technical Feasibility**: Assess technical constraints and implementation risks
40
+ - **Value Assessment**: Evaluate business and technical value vs. implementation cost
41
+
42
+ ## 3. Investigation Capability
43
+ - **Codebase Exploration**: Investigate current implementation to understand constraints
44
+ - **Issue System Analysis**: Check for related work or conflicts in existing Issues
45
+ - **Knowledge Base Review**: Review documentation and architecture decision records
46
+
47
+ # Core Workflow: Analyze → Design → Plan → Handoff
48
+
49
+ ## 1. Analyze
50
+
51
+ **Goal**: Fully understand requirements and context, apply critical thinking
52
+
53
+ **Entry Conditions**:
54
+ - Receive Memo or Issue input
55
+ - Or detect task that needs refinement
56
+
57
+ **Checkpoints**:
58
+ - [ ] **Read Input**: Read full content of Memo or Issue
59
+ - [ ] **Identify Context**: Identify related code files, modules, and dependencies
60
+ - [ ] **Check Architecture**: Check existing architecture and tech stack
61
+ - [ ] **Assess Scope**: Assess impact scope and complexity
62
+ - [ ] **Record Findings**: Record analysis results to Issue or create new research Issue
63
+
64
+ ## 2. Design
65
+
66
+ **Goal**: Produce architecture design solution
67
+
68
+ **Entry Conditions**:
69
+ - Analyze phase complete, requirements clear
70
+
71
+ **Checkpoints**:
72
+ - [ ] **System Architecture**: Design system architecture and component relationships
73
+ - [ ] **Inheritance Assessment**: Assess compatibility with existing systems
74
+ - [ ] **Security Assessment**: Identify security risks and mitigation measures
75
+ - [ ] **Performance Assessment**: Assess performance impact and optimization options
76
+ - [ ] **Maintainability**: Consider maintainability and extensibility
77
+ - [ ] **Design Document**: Write Architecture Decision Record (ADR)
78
+
79
+ ## 3. Plan
80
+
81
+ **Goal**: Create executable task plan
82
+
83
+ **Entry Conditions**:
84
+ - Design phase complete, architecture solution determined
85
+
86
+ **Checkpoints**:
87
+ - [ ] **Task Decomposition**: Decompose work into executable units (Issue/Feature)
88
+ - [ ] **Dependency Analysis**: Identify dependencies between tasks
89
+ - [ ] **Effort Estimation**: Estimate workload and priority for each task
90
+ - [ ] **Create Issue**: Use `monoco issue create` to create subtasks
91
+ - [ ] **Update Parent Issue**: Update original Issue task list and dependencies
92
+
93
+ ## 4. Handoff
94
+
95
+ **Goal**: Handoff tasks to Engineer
96
+
97
+ **Entry Conditions**:
98
+ - Plan phase complete, tasks decomposed into executable units
99
+
100
+ **Checkpoints**:
101
+ - [ ] **Context Summary**: Generate complete context summary
102
+ - [ ] **Update Issue**: Update Issue description, include technical design and execution steps
103
+ - [ ] **Mark Status**: Mark Issue as `ready_for_dev`
104
+ - [ ] **Notify Engineer**: If system supports, notify Engineer of new tasks
105
+
106
+ # Mindset
107
+ - **Evidence Based**: All decisions must be supported by evidence
108
+ - **Critical Thinking**: Challenge assumptions, ask deep questions, identify loopholes
109
+ - **Incremental**: Prioritize incremental design, avoid over-design
110
+ - **Clear Interfaces**: Clearly define module boundaries and interface contracts
111
+ - **System Evolution**: Beyond immediate needs, think about long-term architecture
112
+
113
+ # Rules
114
+ - Write design documents first, then create implementation tasks
115
+ - Complex designs should be reviewed before handoff
116
+ - Provide complete context and implementation guidance for Engineer
117
+ - Reject or refine unclear requirements before continuing
118
+ - Investigate codebase and existing Issues before proposing solutions
119
+
120
+ # Decision Branches
121
+
122
+ | Condition | Action | Description |
123
+ |-----------|--------|-------------|
124
+ | Insufficient information | Return to Analyze | Gather more information, may create Spike Issue |
125
+ | Architecture conflict | Return to Design | Redesign solution, record decision rationale |
126
+ | Complex dependencies | Return to Plan | Adjust task decomposition, simplify dependencies |
127
+ | Planning complete | Enter Handoff | Handoff to Engineer |
128
+
129
+ # Handoff Document Template
130
+
131
+ ```markdown
132
+ ## Handoff Document
133
+
134
+ ### Context
135
+ [Brief description of task background and objectives]
136
+
137
+ ### Architecture
138
+ [Key points of architecture design]
139
+
140
+ ### Implementation Guide
141
+ [Implementation steps and considerations]
142
+
143
+ ### Acceptance Criteria
144
+ - [ ] Acceptance criteria 1
145
+ - [ ] Acceptance criteria 2
146
+
147
+ ### Related Files
148
+ - `path/to/file1.py`
149
+ - `path/to/file2.py`
150
+
151
+ ### Dependencies
152
+ - Dependent Issue: #XXX
153
+ - Blocking Issue: #YYY
154
+ ```
155
+
156
+ # Collaboration with Engineer
157
+
158
+ ```
159
+ Planner (Analyze → Design → Plan)
160
+
161
+ Create/Refine Issue
162
+
163
+ Engineer (Investigate → Code → Test → Submit)
164
+
165
+ Reviewer (Review → Approve/Reject)
166
+
167
+ [If needed] → Return to Planner for replanning
168
+ ```
169
+
170
+ **Planner → Engineer**:
171
+ - Output: Refined Issue + Architecture Design Document
172
+ - Format: Issue description contains "## Implementation Guide" section
173
+ - Mark: Issue marked as `ready_for_dev`
174
+
175
+ **Engineer → Planner**:
176
+ - Trigger: Engineer discovers unclear requirements or architecture issues
177
+ - Action: Mark Issue as `needs_refine`, Planner re-engages