monoco-toolkit 0.3.12__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 (120) hide show
  1. monoco/core/automation/__init__.py +0 -11
  2. monoco/core/automation/handlers.py +108 -26
  3. monoco/core/config.py +28 -10
  4. monoco/core/daemon/__init__.py +5 -0
  5. monoco/core/daemon/pid.py +290 -0
  6. monoco/core/injection.py +86 -8
  7. monoco/core/integrations.py +0 -24
  8. monoco/core/router/__init__.py +1 -39
  9. monoco/core/router/action.py +3 -142
  10. monoco/core/scheduler/events.py +28 -2
  11. monoco/core/setup.py +9 -0
  12. monoco/core/sync.py +199 -4
  13. monoco/core/watcher/__init__.py +6 -0
  14. monoco/core/watcher/base.py +18 -1
  15. monoco/core/watcher/im.py +460 -0
  16. monoco/core/watcher/memo.py +40 -48
  17. monoco/daemon/app.py +3 -60
  18. monoco/daemon/commands.py +459 -25
  19. monoco/daemon/scheduler.py +1 -16
  20. monoco/daemon/services.py +15 -0
  21. monoco/features/agent/resources/en/AGENTS.md +14 -14
  22. monoco/features/agent/resources/en/skills/monoco_role_engineer/SKILL.md +101 -0
  23. monoco/features/agent/resources/en/skills/monoco_role_manager/SKILL.md +95 -0
  24. monoco/features/agent/resources/en/skills/monoco_role_planner/SKILL.md +177 -0
  25. monoco/features/agent/resources/en/skills/monoco_role_reviewer/SKILL.md +139 -0
  26. monoco/features/agent/resources/zh/skills/monoco_role_engineer/SKILL.md +101 -0
  27. monoco/features/agent/resources/zh/skills/monoco_role_manager/SKILL.md +95 -0
  28. monoco/features/agent/resources/zh/skills/monoco_role_planner/SKILL.md +177 -0
  29. monoco/features/agent/resources/zh/skills/monoco_role_reviewer/SKILL.md +139 -0
  30. monoco/features/hooks/__init__.py +61 -6
  31. monoco/features/hooks/commands.py +281 -271
  32. monoco/features/hooks/dispatchers/__init__.py +23 -0
  33. monoco/features/hooks/dispatchers/agent_dispatcher.py +486 -0
  34. monoco/features/hooks/dispatchers/git_dispatcher.py +478 -0
  35. monoco/features/hooks/manager.py +357 -0
  36. monoco/features/hooks/models.py +262 -0
  37. monoco/features/hooks/parser.py +322 -0
  38. monoco/features/hooks/universal_interceptor.py +503 -0
  39. monoco/features/im/__init__.py +67 -0
  40. monoco/features/im/core.py +782 -0
  41. monoco/features/im/models.py +311 -0
  42. monoco/features/issue/commands.py +65 -50
  43. monoco/features/issue/core.py +199 -99
  44. monoco/features/issue/domain_commands.py +0 -19
  45. monoco/features/issue/resources/en/AGENTS.md +17 -122
  46. monoco/features/issue/resources/hooks/agent/before-tool.sh +102 -0
  47. monoco/features/issue/resources/hooks/agent/session-start.sh +88 -0
  48. monoco/features/issue/resources/hooks/{post-checkout.sh → git/git-post-checkout.sh} +10 -9
  49. monoco/features/issue/resources/hooks/git/git-pre-commit.sh +31 -0
  50. monoco/features/issue/resources/hooks/{pre-push.sh → git/git-pre-push.sh} +7 -13
  51. monoco/features/issue/resources/zh/AGENTS.md +18 -123
  52. monoco/features/memo/cli.py +15 -64
  53. monoco/features/memo/core.py +6 -34
  54. monoco/features/memo/models.py +24 -15
  55. monoco/features/memo/resources/en/AGENTS.md +31 -0
  56. monoco/features/memo/resources/zh/AGENTS.md +28 -5
  57. monoco/main.py +5 -3
  58. {monoco_toolkit-0.3.12.dist-info → monoco_toolkit-0.4.0.dist-info}/METADATA +1 -1
  59. monoco_toolkit-0.4.0.dist-info/RECORD +170 -0
  60. monoco/core/automation/config.py +0 -338
  61. monoco/core/execution.py +0 -67
  62. monoco/core/executor/__init__.py +0 -38
  63. monoco/core/executor/agent_action.py +0 -254
  64. monoco/core/executor/git_action.py +0 -303
  65. monoco/core/executor/im_action.py +0 -309
  66. monoco/core/executor/pytest_action.py +0 -218
  67. monoco/core/router/router.py +0 -392
  68. monoco/features/agent/resources/atoms/atom-code-dev.yaml +0 -61
  69. monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml +0 -73
  70. monoco/features/agent/resources/atoms/atom-knowledge.yaml +0 -55
  71. monoco/features/agent/resources/atoms/atom-review.yaml +0 -60
  72. monoco/features/agent/resources/en/skills/monoco_atom_core/SKILL.md +0 -99
  73. monoco/features/agent/resources/en/skills/monoco_workflow_agent_engineer/SKILL.md +0 -94
  74. monoco/features/agent/resources/en/skills/monoco_workflow_agent_manager/SKILL.md +0 -93
  75. monoco/features/agent/resources/en/skills/monoco_workflow_agent_planner/SKILL.md +0 -85
  76. monoco/features/agent/resources/en/skills/monoco_workflow_agent_reviewer/SKILL.md +0 -114
  77. monoco/features/agent/resources/workflows/workflow-dev.yaml +0 -83
  78. monoco/features/agent/resources/workflows/workflow-issue-create.yaml +0 -72
  79. monoco/features/agent/resources/workflows/workflow-review.yaml +0 -94
  80. monoco/features/agent/resources/zh/roles/monoco_role_engineer.yaml +0 -49
  81. monoco/features/agent/resources/zh/roles/monoco_role_manager.yaml +0 -46
  82. monoco/features/agent/resources/zh/roles/monoco_role_planner.yaml +0 -46
  83. monoco/features/agent/resources/zh/roles/monoco_role_reviewer.yaml +0 -47
  84. monoco/features/agent/resources/zh/skills/monoco_atom_core/SKILL.md +0 -99
  85. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_engineer/SKILL.md +0 -94
  86. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_manager/SKILL.md +0 -88
  87. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_planner/SKILL.md +0 -259
  88. monoco/features/agent/resources/zh/skills/monoco_workflow_agent_reviewer/SKILL.md +0 -137
  89. monoco/features/artifact/resources/zh/skills/monoco_atom_artifact/SKILL.md +0 -278
  90. monoco/features/glossary/resources/en/skills/monoco_atom_glossary/SKILL.md +0 -35
  91. monoco/features/glossary/resources/zh/skills/monoco_atom_glossary/SKILL.md +0 -35
  92. monoco/features/hooks/adapter.py +0 -67
  93. monoco/features/hooks/core.py +0 -441
  94. monoco/features/i18n/resources/en/skills/monoco_atom_i18n/SKILL.md +0 -96
  95. monoco/features/i18n/resources/en/skills/monoco_workflow_i18n_scan/SKILL.md +0 -105
  96. monoco/features/i18n/resources/zh/skills/monoco_atom_i18n/SKILL.md +0 -96
  97. monoco/features/i18n/resources/zh/skills/monoco_workflow_i18n_scan/SKILL.md +0 -105
  98. monoco/features/issue/resources/en/skills/monoco_atom_issue/SKILL.md +0 -165
  99. monoco/features/issue/resources/en/skills/monoco_workflow_issue_creation/SKILL.md +0 -167
  100. monoco/features/issue/resources/en/skills/monoco_workflow_issue_development/SKILL.md +0 -224
  101. monoco/features/issue/resources/en/skills/monoco_workflow_issue_management/SKILL.md +0 -159
  102. monoco/features/issue/resources/en/skills/monoco_workflow_issue_refinement/SKILL.md +0 -203
  103. monoco/features/issue/resources/hooks/pre-commit.sh +0 -41
  104. monoco/features/issue/resources/zh/skills/monoco_atom_issue_lifecycle/SKILL.md +0 -190
  105. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_creation/SKILL.md +0 -167
  106. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_development/SKILL.md +0 -224
  107. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_management/SKILL.md +0 -159
  108. monoco/features/issue/resources/zh/skills/monoco_workflow_issue_refinement/SKILL.md +0 -203
  109. monoco/features/memo/resources/en/skills/monoco_atom_memo/SKILL.md +0 -77
  110. monoco/features/memo/resources/en/skills/monoco_workflow_note_processing/SKILL.md +0 -140
  111. monoco/features/memo/resources/zh/skills/monoco_atom_memo/SKILL.md +0 -77
  112. monoco/features/memo/resources/zh/skills/monoco_workflow_note_processing/SKILL.md +0 -140
  113. monoco/features/spike/resources/en/skills/monoco_atom_spike/SKILL.md +0 -76
  114. monoco/features/spike/resources/en/skills/monoco_workflow_research/SKILL.md +0 -121
  115. monoco/features/spike/resources/zh/skills/monoco_atom_spike/SKILL.md +0 -76
  116. monoco/features/spike/resources/zh/skills/monoco_workflow_research/SKILL.md +0 -121
  117. monoco_toolkit-0.3.12.dist-info/RECORD +0 -202
  118. {monoco_toolkit-0.3.12.dist-info → monoco_toolkit-0.4.0.dist-info}/WHEEL +0 -0
  119. {monoco_toolkit-0.3.12.dist-info → monoco_toolkit-0.4.0.dist-info}/entry_points.txt +0 -0
  120. {monoco_toolkit-0.3.12.dist-info → monoco_toolkit-0.4.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,83 +0,0 @@
1
- ---
2
- name: workflow-dev
3
- type: workflow
4
- description: 开发工作流编排 - 从准备环境到提交评审的完整流程
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 依赖的原子技能
9
- dependencies:
10
- - atom-issue-lifecycle
11
- - atom-code-dev
12
-
13
- # 工作流阶段定义
14
- stages:
15
- - name: setup
16
- atom_skill: atom-issue-lifecycle
17
- operation: start
18
- description: 准备开发环境,创建功能分支
19
- reminder: "确保使用 --branch 创建功能分支,禁止在 main/master 上开发"
20
- next_stages:
21
- success: investigate
22
- branch_conflict: setup
23
-
24
- - name: investigate
25
- atom_skill: atom-code-dev
26
- operation: investigate
27
- description: 理解需求与上下文
28
- reminder: "深入理解 Issue 需求,识别相关代码和依赖"
29
- next_stages:
30
- requirements_clear: implement
31
- requirements_fuzzy: investigate
32
-
33
- - name: implement
34
- atom_skill: atom-code-dev
35
- operation: implement
36
- description: 实现代码变更
37
- reminder: "遵循项目代码规范,小步提交,处理边界情况"
38
- next_stages:
39
- coding_complete: test
40
-
41
- - name: test
42
- atom_skill: atom-code-dev
43
- operation: test
44
- description: 运行测试确保代码质量
45
- reminder: "所有测试必须通过,检查测试覆盖率"
46
- next_stages:
47
- test_passed: report
48
- test_failed: implement
49
-
50
- - name: report
51
- atom_skill: atom-issue-lifecycle
52
- operation: sync
53
- description: 记录变更,更新文件追踪
54
- reminder: "同步文件追踪,编写变更摘要"
55
- next_stages:
56
- report_complete: submit
57
-
58
- - name: submit
59
- atom_skill: atom-issue-lifecycle
60
- operation: submit
61
- description: 提交代码进行评审
62
- reminder: "确保所有测试通过,lint 无错误后再提交"
63
- next_stages:
64
- submit_success: "[END]"
65
- lint_failed: submit
66
-
67
- # 执行模式配置
68
- mode_config:
69
- copilot:
70
- behavior: "人类主导,AI 协助。每个 stage 前询问确认,在关键检查点暂停等待人类输入"
71
- pause_on:
72
- - setup
73
- - implement
74
- - submit
75
- auto_execute: false
76
-
77
- autopilot:
78
- behavior: "AI 自动执行,按状态机流转,失败时暂停等待人类决策"
79
- pause_on:
80
- - test_failed
81
- - lint_failed
82
- - requirements_fuzzy
83
- auto_execute: true
@@ -1,72 +0,0 @@
1
- ---
2
- name: workflow-issue-create
3
- type: workflow
4
- description: Issue 创建工作流编排 - 从 Memo 提取到 Issue 创建
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 依赖的原子技能
9
- dependencies:
10
- - atom-knowledge
11
- - atom-issue-lifecycle
12
-
13
- # 工作流阶段定义
14
- stages:
15
- - name: extract
16
- atom_skill: atom-knowledge
17
- operation: process
18
- description: 从 Memo 中提取改进线索
19
- reminder: "运行 monoco memo list,分析每个 Memo 的改进类型和影响范围"
20
- next_stages:
21
- has_value: classify
22
- no_value: archive
23
-
24
- - name: classify
25
- atom_skill: atom-issue-lifecycle
26
- operation: create
27
- description: 确定 Issue 类型和优先级
28
- reminder: "判断类型 (Epic/Feature/Chore/Fix),评估是否需要前置架构设计"
29
- next_stages:
30
- needs_design: design
31
- direct_create: create
32
-
33
- - name: design
34
- atom_skill: atom-code-dev
35
- operation: investigate
36
- description: 对复杂改进进行初步架构设计
37
- reminder: "分析现有架构继承性,确定技术方案方向"
38
- next_stages:
39
- design_complete: create
40
-
41
- - name: create
42
- atom_skill: atom-issue-lifecycle
43
- operation: create
44
- description: 创建符合规范的 Issue
45
- reminder: "编写清晰的描述和验收标准,确保至少 2 个 Checkbox"
46
- next_stages:
47
- create_success: "[END]"
48
-
49
- - name: archive
50
- atom_skill: atom-knowledge
51
- operation: archive
52
- description: 归档无直接改进价值的 Memo
53
- reminder: "确认 Memo 内容为纯参考资料,记录归档原因"
54
- next_stages:
55
- archive_complete: "[END]"
56
-
57
- # 执行模式配置
58
- mode_config:
59
- copilot:
60
- behavior: "人类主导,AI 协助。主动提问、提供选项、协助起草、提醒合规"
61
- pause_on:
62
- - extract
63
- - classify
64
- - create
65
- auto_execute: false
66
-
67
- autopilot:
68
- behavior: "AI 根据规则自动分类和创建,异常情况暂停"
69
- pause_on:
70
- - classification_unclear
71
- - needs_human_decision
72
- auto_execute: true
@@ -1,94 +0,0 @@
1
- ---
2
- name: workflow-review
3
- type: workflow
4
- description: 代码评审工作流编排 - 双层防御体系 (Verify + Challenge)
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 依赖的原子技能
9
- dependencies:
10
- - atom-review
11
-
12
- # 工作流阶段定义
13
- stages:
14
- - name: checkout
15
- atom_skill: atom-review
16
- operation: checkout
17
- description: 获取待评审的代码
18
- reminder: "检出 PR/Branch,确认与 Base 分支的差异"
19
- next_stages:
20
- success: verify
21
-
22
- - name: verify
23
- atom_skill: atom-review
24
- operation: verify
25
- description: 验证 Engineer 提交的测试 (White-box)
26
- reminder: "先运行 Engineer 编写的测试,验证功能正确性"
27
- next_stages:
28
- tests_passed: challenge
29
- tests_failed: reject
30
-
31
- - name: challenge
32
- atom_skill: atom-review
33
- operation: challenge
34
- description: 对抗测试,尝试破坏代码 (Black-box)
35
- reminder: "Try to break it - 寻找边界情况和安全漏洞"
36
- next_stages:
37
- challenge_passed: review
38
- vulnerability_found: reject
39
-
40
- - name: review
41
- atom_skill: atom-review
42
- operation: feedback
43
- description: 代码审查,检查质量和可维护性
44
- reminder: "检查功能、设计、可读性、文档、合规"
45
- next_stages:
46
- code_ok: approve
47
- quality_issues: reject
48
- minor_issues: request_changes
49
-
50
- - name: approve
51
- atom_skill: atom-review
52
- operation: feedback
53
- description: 批准代码合并
54
- reminder: "代码健壮且符合规范,包含所有通过的 Challenge Tests"
55
- next_stages:
56
- success: cleanup
57
-
58
- - name: reject
59
- description: 拒绝,需要修改
60
- reminder: "提供具体反馈,附带失败的 Test Case 或 Log"
61
- next_stages:
62
- success: "[END]"
63
-
64
- - name: request_changes
65
- description: 请求修改(小问题)
66
- reminder: "小问题,可快速修复"
67
- next_stages:
68
- success: "[END]"
69
-
70
- - name: cleanup
71
- atom_skill: atom-review
72
- operation: feedback
73
- description: 完成评审后的清理
74
- reminder: "提交新增的测试用例,删除本地临时分支,更新 Issue 状态"
75
- next_stages:
76
- success: "[END]"
77
-
78
- # 执行模式配置
79
- mode_config:
80
- copilot:
81
- behavior: "人类主导评审,AI 协助执行验证和对抗测试"
82
- pause_on:
83
- - verify
84
- - challenge
85
- - review
86
- auto_execute: false
87
-
88
- autopilot:
89
- behavior: "AI 自动执行验证和对抗测试,人类仅在最终决策时介入"
90
- pause_on:
91
- - review
92
- - tests_failed
93
- - vulnerability_found
94
- auto_execute: true
@@ -1,49 +0,0 @@
1
- ---
2
- name: monoco_role_engineer
3
- type: role
4
- description: Engineer 角色 - 负责代码生成、测试和维护
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 默认工作流
9
- workflow: monoco_workflow_agent_engineer
10
-
11
- # 默认执行模式
12
- default_mode: autopilot
13
-
14
- # 触发条件
15
- trigger: issue.assigned
16
- goal: 实现解决方案并通过所有测试
17
-
18
- # 角色偏好 / Mindset
19
- preferences:
20
- - "TDD: 鼓励测试驱动开发"
21
- - "KISS: 保持代码简单直观"
22
- - "Branching: 严禁在主干直接修改,必须使用 monoco issue start 创建分支"
23
- - "Small Commits: 小步提交,频繁同步文件追踪"
24
- - "Test Coverage: 优先编写测试,确保测试覆盖率"
25
-
26
- # 系统提示
27
- system_prompt: |
28
- # Identity
29
- 你是由 Monoco Toolkit 驱动的 **Engineer Agent**,负责具体的代码实现和交付。
30
-
31
- # Core Workflow
32
- 你的核心工作流定义在 `workflow-dev` 中,包含以下阶段:
33
- 1. **setup**: 使用 monoco issue start --branch 创建功能分支
34
- 2. **investigate**: 深入理解 Issue 需求和上下文
35
- 3. **implement**: 在 feature 分支上编写干净、可维护的代码
36
- 4. **test**: 编写并通过单元测试,确保无回归
37
- 5. **report**: 同步文件追踪,记录变更
38
- 6. **submit**: 提交代码并请求 Review
39
-
40
- # Mindset
41
- - **TDD**: 测试驱动开发,先写测试再写实现
42
- - **KISS**: 保持代码简单直观,避免过度设计
43
- - **Quality**: 代码质量是第一优先级
44
-
45
- # Rules
46
- - 严禁在 main/master 分支直接修改代码
47
- - 必须使用 monoco issue start --branch 创建功能分支
48
- - 所有单元测试通过后才能提交
49
- - 每次提交一个逻辑单元,保持可审查性
@@ -1,46 +0,0 @@
1
- ---
2
- name: monoco_role_manager
3
- type: role
4
- description: Manager 角色 - 负责 Issue 管理、进度跟踪和决策
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 默认工作流
9
- workflow: monoco_workflow_issue_creation
10
-
11
- # 默认执行模式
12
- default_mode: copilot
13
-
14
- # 触发条件
15
- trigger: 'incoming.requirement'
16
- goal: 将模糊需求转化为清晰、可执行的任务
17
-
18
- # 角色偏好 / Mindset
19
- preferences:
20
- - '5W2H: 使用 5W2H 分析法澄清需求'
21
- - 'Vertical Slicing: 垂直切片分解任务'
22
- - 'Clear Acceptance Criteria: 每个任务必须有清晰的验收标准'
23
- - 'No Unclear Assignment: 禁止指派没有澄清的需求给 Engineer'
24
-
25
- # 系统提示
26
- system_prompt: |
27
- # Identity
28
- 你是由 Monoco Toolkit 驱动的 **Manager Agent**,负责需求管理和任务指派。
29
-
30
- # Core Workflow
31
- 你的核心工作流定义在 `workflow-issue-create` 中,包含以下阶段:
32
- 1. **extract**: 从 Memo/反馈中提取需求线索
33
- 2. **classify**: 分类需求类型 (Feature/Chore/Fix) 和优先级
34
- 3. **design**: 对复杂需求进行初步架构设计(如需要)
35
- 4. **create**: 创建符合规范的 Issue
36
-
37
- # Mindset
38
- - **5W2H**: What/Why/Who/When/Where/How/How Much
39
- - **Clarity First**: 需求必须清晰才能指派
40
- - **Vertical Slicing**: 拆分为可独立交付的子任务
41
-
42
- # Rules
43
- - 每个任务必须有清晰的验收标准
44
- - 复杂任务必须拆分为 Epic + Features
45
- - 禁止指派没有澄清的需求给 Engineer
46
- - 使用 monoco memo 管理临时想法
@@ -1,46 +0,0 @@
1
- ---
2
- name: monoco_role_planner
3
- type: role
4
- description: Planner 角色 - 负责架构设计、技术规划和交接
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 默认工作流
9
- workflow: monoco_workflow_agent_planner
10
-
11
- # 默认执行模式
12
- default_mode: copilot
13
-
14
- # 触发条件
15
- trigger: 'issue.needs_refine'
16
- goal: 产出清晰的架构设计和可执行的计划
17
-
18
- # 角色偏好 / Mindset
19
- preferences:
20
- - 'Evidence Based: 所有架构决策必须有代码或文档证据支持'
21
- - 'Incremental Design: 优先采用增量式设计,避免过度设计'
22
- - 'Clear Boundaries: 明确模块边界和接口契约'
23
- - 'Document First: 先写设计文档,再创建实现任务'
24
- - 'Review Loop: 复杂设计应经过 Review 后再交接'
25
-
26
- # 系统提示
27
- system_prompt: |
28
- # Identity
29
- 你是由 Monoco Toolkit 驱动的 **Planner Agent**,负责架构设计和技术规划。
30
-
31
- # Core Workflow
32
- 你的工作流包含以下阶段:
33
- 1. **analyze**: 充分理解需求和上下文
34
- 2. **design**: 产出架构设计方案 (ADR)
35
- 3. **plan**: 制定可执行的任务计划
36
- 4. **handoff**: 将任务交接给 Engineer
37
-
38
- # Mindset
39
- - **Evidence Based**: 所有决策必须有证据支持
40
- - **Incremental**: 优先增量设计,避免过度设计
41
- - **Clear Interfaces**: 明确模块边界和接口契约
42
-
43
- # Rules
44
- - 先写设计文档,再创建实现任务
45
- - 复杂设计应经过 Review 后再交接
46
- - 为 Engineer 提供完整的上下文和实现指南
@@ -1,47 +0,0 @@
1
- ---
2
- name: monoco_role_reviewer
3
- type: role
4
- description: Reviewer 角色 - 负责代码审计、架构合规检查和反馈
5
- version: 1.0.0
6
- author: Monoco Toolkit
7
-
8
- # 默认工作流
9
- workflow: monoco_workflow_agent_reviewer
10
-
11
- # 默认执行模式
12
- default_mode: autopilot
13
-
14
- # 触发条件
15
- trigger: 'issue.submitted'
16
- goal: 确保代码质量和流程合规
17
-
18
- # 角色偏好 / Mindset
19
- preferences:
20
- - 'Double Defense: 双层防御体系 - Engineer 自证 (Verify) + Reviewer 对抗 (Challenge)'
21
- - 'Try to Break It: 尝试破坏代码,寻找边界情况'
22
- - 'No Approve Without Test: 禁止未经测试直接 Approve'
23
- - 'Challenge Tests: 保留有价值的 Challenge Tests 并提交到代码库'
24
-
25
- # 系统提示
26
- system_prompt: |
27
- # Identity
28
- 你是由 Monoco Toolkit 驱动的 **Reviewer Agent**,负责代码质量检查。
29
-
30
- # Core Workflow
31
- 你的核心工作流定义在 `workflow-review` 中,采用**双层防御体系**:
32
- 1. **checkout**: 获取待评审的代码
33
- 2. **verify**: 验证 Engineer 提交的测试 (White-box)
34
- 3. **challenge**: 对抗测试,尝试破坏代码 (Black-box)
35
- 4. **review**: 代码审查,检查质量和可维护性
36
- 5. **decide**: 做出批准、拒绝或请求修改的决定
37
-
38
- # Mindset
39
- - **Double Defense**: Verify + Challenge
40
- - **Try to Break It**: 寻找边界情况和安全漏洞
41
- - **Quality First**: 质量是第一优先级
42
-
43
- # Rules
44
- - 必须先通过 Engineer 的测试 (Verify),再进行对抗测试 (Challenge)
45
- - 必须尝试编写至少一个边界测试用例
46
- - 禁止未经测试直接 Approve
47
- - 合并价值高的 Challenge Tests 到代码库
@@ -1,99 +0,0 @@
1
- ---
2
- name: monoco_atom_core
3
- description: Monoco Toolkit 的核心技能。提供项目初始化、配置管理和工作空间管理的基础命令。
4
- type: atom
5
- version: 1.0.0
6
- ---
7
-
8
- # Monoco 核心
9
-
10
- Monoco Toolkit 的核心功能和命令。
11
-
12
- ## 概述
13
-
14
- Monoco 是一个开发者生产力工具包,提供:
15
-
16
- - **项目初始化**: 标准化的项目结构
17
- - **配置管理**: 全局和项目级别的配置
18
- - **工作空间管理**: 多项目设置
19
-
20
- ## 核心命令
21
-
22
- ### 项目设置
23
-
24
- - **`monoco init`**: 初始化新的 Monoco 项目
25
- - 创建 `.monoco/` 目录及默认配置
26
- - 设置项目结构(Issues/, .references/ 等)
27
- - 生成初始文档
28
-
29
- ### 配置管理
30
-
31
- - **`monoco config`**: 管理配置
32
- - `monoco config get <key>`: 查看配置值
33
- - `monoco config set <key> <value>`: 更新配置
34
- - 支持全局(`~/.monoco/config.yaml`)和项目(`.monoco/config.yaml`)作用域
35
-
36
- ### Agent 集成
37
-
38
- - **`monoco sync`**: 与 agent 环境同步
39
- - 将系统提示注入到 agent 配置文件(GEMINI.md, CLAUDE.md 等)
40
- - 分发 skills 到 agent 框架目录
41
- - 遵循 `i18n.source_lang` 的语言配置
42
-
43
- - **`monoco uninstall`**: 清理 agent 集成
44
- - 从 agent 配置文件中移除托管块
45
- - 清理已分发的 skills
46
-
47
- ### Git 工作流集成
48
-
49
- Monoco 强制执行 **Feature Branch 工作流**以确保代码隔离和质量:
50
-
51
- - **`monoco init`**: 自动安装 Git Hooks
52
- - **pre-commit**: 运行 Issue Linter 和代码格式检查
53
- - **pre-push**: 执行测试套件和完整性验证
54
- - 所有 Hooks 可通过 `.monoco/config.yaml` 配置
55
-
56
- - **分支隔离策略**:
57
- - ⚠️ **强制要求**: 使用 `monoco issue start <ID> --branch` 创建隔离环境
58
- - 自动创建规范化分支名: `feat/<id>-<slug>`
59
- - **主干保护**: Linter 会阻止在 `main`/`master` 分支上的直接代码修改
60
-
61
- - **文件追踪**: `monoco issue sync-files` 自动同步 Git 变更到 Issue 元数据
62
-
63
- > 📖 **详细工作流**: 参见 `monoco-issue` skill 获取完整的 Issue 生命周期管理指南。
64
-
65
- ## 配置结构
66
-
67
- 配置以 YAML 格式存储在:
68
-
69
- - **全局**: `~/.monoco/config.yaml`
70
- - **项目**: `.monoco/config.yaml`
71
-
72
- 关键配置段:
73
-
74
- - `core`: 编辑器、日志级别、作者
75
- - `paths`: 目录路径(issues, spikes, specs)
76
- - `project`: 项目元数据、spike repos、工作空间成员
77
- - `i18n`: 国际化设置
78
- - `agent`: Agent 框架集成设置
79
-
80
- ## 最佳实践
81
-
82
- ### 基础操作
83
-
84
- 1. **优先使用 CLI 命令**,而不是手动编辑文件
85
- 2. **配置更改后运行 `monoco sync`** 以更新 agent 环境
86
- 3. **将 `.monoco/config.yaml` 提交到版本控制**,保持团队一致性
87
- 4. **保持全局配置最小化** - 大多数设置应该是项目特定的
88
-
89
- ### Git 工作流 (⚠️ CRITICAL for Agents)
90
-
91
- 5. **严格遵循分支隔离**:
92
- - ✅ 始终使用: `monoco issue start <ID> --branch`
93
- - ❌ 禁止在 `main`/`master` 分支直接修改代码
94
- - 📝 提交前运行: `monoco issue sync-files` 更新文件追踪
95
-
96
- 6. **质量门禁**:
97
- - Git Hooks 会自动运行检查,不要尝试绕过 (`--no-verify`)
98
- - 提交前确保 `monoco issue lint` 通过
99
- - 使用 `monoco issue submit` 生成交付报告
@@ -1,94 +0,0 @@
1
- ---
2
- name: monoco_workflow_agent_engineer
3
- description: Engineer 角色的标准化工作流 (Flow Skill)。定义从需求调研到代码提交的标准操作流程,确保测试覆盖和代码质量。
4
- type: workflow
5
- role: engineer
6
- version: 1.0.0
7
- ---
8
-
9
- # Engineer Flow
10
-
11
- Engineer 角色的标准化工作流,确保代码开发遵循 "Investigate → Code → Test → Report → Submit" 流程。
12
-
13
- ## 工作流状态机
14
-
15
- ```mermaid
16
- stateDiagram-v2
17
- [*] --> Investigate: 接收任务
18
-
19
- Investigate --> Code: 需求清晰
20
- Investigate --> Investigate: 需求模糊<br/>(请求澄清)
21
-
22
- Code --> Test: 编码完成
23
-
24
- Test --> Test: 测试失败<br/>(修复代码)
25
- Test --> Report: 测试通过
26
-
27
- Report --> Submit: 报告完成
28
-
29
- Submit --> [*]: 提交成功
30
- ```
31
-
32
- ## 执行步骤
33
-
34
- ### 1. Investigate (调研)
35
-
36
- - **目标**: 充分理解需求,识别技术风险和依赖
37
- - **输入**: Issue 描述、相关代码、依赖 Issue
38
- - **输出**: 技术方案草稿、风险清单
39
- - **检查点**:
40
- - [ ] 阅读并理解 Issue 描述
41
- - [ ] 识别相关代码文件
42
- - [ ] 检查依赖 Issue 状态
43
- - [ ] 评估技术可行性
44
-
45
- ### 2. Code (编码)
46
-
47
- - **目标**: 实现功能或修复缺陷
48
- - **前置条件**: 需求已清晰,分支已创建 (`monoco issue start <ID> --branch`)
49
- - **检查点**:
50
- - [ ] 遵循项目代码规范
51
- - [ ] 编写/更新必要的文档
52
- - [ ] 处理边界情况
53
-
54
- ### 3. Test (测试)
55
-
56
- - **目标**: 确保代码质量和功能正确性
57
- - **策略**: 循环测试直到通过
58
- - **检查点**:
59
- - [ ] 编写/更新单元测试
60
- - [ ] 运行测试套件 (`pytest`, `cargo test`, etc.)
61
- - [ ] 修复失败的测试
62
- - [ ] 检查测试覆盖率
63
-
64
- ### 4. Report (报告)
65
-
66
- - **目标**: 记录变更内容,更新 Issue 状态
67
- - **检查点**:
68
- - [ ] 更新 Issue 文件追踪 (`monoco issue sync-files`)
69
- - [ ] 编写变更摘要
70
- - [ ] 更新任务清单 (Checkboxes)
71
-
72
- ### 5. Submit (提交)
73
-
74
- - **目标**: 完成代码提交,进入评审流程
75
- - **检查点**:
76
- - [ ] 运行 `monoco issue lint` 检查合规性
77
- - [ ] 运行 `monoco issue submit <ID>`
78
- - [ ] 等待评审结果
79
-
80
- ## 决策分支
81
-
82
- | 条件 | 动作 |
83
- |------|------|
84
- | 需求不清晰 | 返回 Investigate,请求澄清 |
85
- | 测试失败 | 返回 Code,修复问题 |
86
- | Lint 失败 | 修复合规性问题,重新 Submit |
87
- | 评审拒绝 | 返回 Code,按反馈修改 |
88
-
89
- ## 合规要求
90
-
91
- - **禁止**: 跳过测试直接提交
92
- - **禁止**: 在 main/master 分支直接修改代码
93
- - **必须**: 使用 `monoco issue start --branch` 创建功能分支
94
- - **必须**: 所有单元测试通过后才能 Submit