monoco-toolkit 0.3.0__py3-none-any.whl → 0.3.2__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.
@@ -6,3 +6,28 @@ Core toolkit commands for project management.
6
6
  - **Config**: `monoco config get|set <key> [value]` (Manage configuration)
7
7
  - **Sync**: `monoco sync` (Synchronize with agent environments)
8
8
  - **Uninstall**: `monoco uninstall` (Clean up agent integrations)
9
+
10
+ ---
11
+
12
+ ## ⚠️ Agent Must-Read: Git Workflow
13
+
14
+ Before modifying any code, **MUST** follow these steps:
15
+
16
+ ### Standard Process
17
+
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`
25
+ 6. **Close Issue**: `monoco issue close FEAT-XXX --solution implemented`
26
+
27
+ ### Quality Gates
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
32
+
33
+ > 📖 See `monoco-issue` skill for complete workflow documentation.
@@ -34,7 +34,6 @@ Monoco is a developer productivity toolkit that provides:
34
34
  ### Agent Integration
35
35
 
36
36
  - **`monoco sync`**: Synchronize with agent environments
37
-
38
37
  - Injects system prompts into agent configuration files (GEMINI.md, CLAUDE.md, etc.)
39
38
  - Distributes skills to agent framework directories
40
39
  - Respects language configuration from `i18n.source_lang`
@@ -43,6 +42,24 @@ Monoco is a developer productivity toolkit that provides:
43
42
  - Removes managed blocks from agent configuration files
44
43
  - Cleans up distributed skills
45
44
 
45
+ ### Git Workflow Integration
46
+
47
+ Monoco enforces a **Feature Branch Workflow** to ensure code isolation and quality:
48
+
49
+ - **`monoco init`**: Automatically installs Git Hooks
50
+ - **pre-commit**: Runs Issue Linter and code formatting checks
51
+ - **pre-push**: Executes test suite and integrity validation
52
+ - All hooks configurable via `.monoco/config.yaml`
53
+
54
+ - **Branch Isolation Strategy**:
55
+ - ⚠️ **Required**: Use `monoco issue start <ID> --branch` to create isolated environment
56
+ - Auto-generates normalized branch names: `feat/<id>-<slug>`
57
+ - **Main Protection**: Linter blocks direct code modifications on `main`/`master` branches
58
+
59
+ - **File Tracking**: `monoco issue sync-files` auto-syncs Git changes to Issue metadata
60
+
61
+ > 📖 **Detailed Workflow**: See `monoco-issue` skill for complete Issue lifecycle management guide.
62
+
46
63
  ## Configuration Structure
47
64
 
48
65
  Configuration is stored in YAML format at:
@@ -60,7 +77,21 @@ Key configuration sections:
60
77
 
61
78
  ## Best Practices
62
79
 
80
+ ### Basic Operations
81
+
63
82
  1. **Use CLI commands** instead of manual file editing when possible
64
83
  2. **Run `monoco sync`** after configuration changes to update agent environments
65
84
  3. **Commit `.monoco/config.yaml`** to version control for team consistency
66
85
  4. **Keep global config minimal** - most settings should be project-specific
86
+
87
+ ### Git Workflow (⚠️ CRITICAL for Agents)
88
+
89
+ 5. **Strictly follow branch isolation**:
90
+ - ✅ Always use: `monoco issue start <ID> --branch`
91
+ - ❌ Never modify code directly on `main`/`master` branches
92
+ - 📝 Before commit: Run `monoco issue sync-files` to update file tracking
93
+
94
+ 6. **Quality Gates**:
95
+ - Git Hooks will auto-run checks, don't bypass (`--no-verify`)
96
+ - Ensure `monoco issue lint` passes before committing
97
+ - Use `monoco issue submit` to generate delivery reports
@@ -6,3 +6,28 @@
6
6
  - **配置**: `monoco config get|set <key> [value]` (管理配置)
7
7
  - **同步**: `monoco sync` (与 agent 环境同步)
8
8
  - **卸载**: `monoco uninstall` (清理 agent 集成)
9
+
10
+ ---
11
+
12
+ ## ⚠️ Agent 必读: Git 工作流
13
+
14
+ 在修改任何代码前,**必须**遵循以下步骤:
15
+
16
+ ### 标准流程
17
+
18
+ 1. **创建 Issue**: `monoco issue create feature -t "功能标题"`
19
+ 2. **🔒 启动隔离环境**: `monoco issue start FEAT-XXX --branch`
20
+ - ⚠️ **强制要求** `--branch` 参数
21
+ - ❌ 禁止在 `main`/`master` 分支直接修改代码
22
+ 3. **实现功能**: 正常编码和测试
23
+ 4. **同步文件**: `monoco issue sync-files` (提交前必须运行)
24
+ 5. **提交审查**: `monoco issue submit FEAT-XXX`
25
+ 6. **关闭 Issue**: `monoco issue close FEAT-XXX --solution implemented`
26
+
27
+ ### 质量门禁
28
+
29
+ - Git Hooks 会自动运行 `monoco issue lint` 和测试
30
+ - 不要使用 `git commit --no-verify` 绕过检查
31
+ - Linter 会阻止在受保护分支上的直接修改
32
+
33
+ > 📖 详见 `monoco-issue` skill 获取完整工作流文档。
@@ -42,6 +42,24 @@ Monoco 是一个开发者生产力工具包,提供:
42
42
  - 从 agent 配置文件中移除托管块
43
43
  - 清理已分发的 skills
44
44
 
45
+ ### Git 工作流集成
46
+
47
+ Monoco 强制执行 **Feature Branch 工作流**以确保代码隔离和质量:
48
+
49
+ - **`monoco init`**: 自动安装 Git Hooks
50
+ - **pre-commit**: 运行 Issue Linter 和代码格式检查
51
+ - **pre-push**: 执行测试套件和完整性验证
52
+ - 所有 Hooks 可通过 `.monoco/config.yaml` 配置
53
+
54
+ - **分支隔离策略**:
55
+ - ⚠️ **强制要求**: 使用 `monoco issue start <ID> --branch` 创建隔离环境
56
+ - 自动创建规范化分支名: `feat/<id>-<slug>`
57
+ - **主干保护**: Linter 会阻止在 `main`/`master` 分支上的直接代码修改
58
+
59
+ - **文件追踪**: `monoco issue sync-files` 自动同步 Git 变更到 Issue 元数据
60
+
61
+ > 📖 **详细工作流**: 参见 `monoco-issue` skill 获取完整的 Issue 生命周期管理指南。
62
+
45
63
  ## 配置结构
46
64
 
47
65
  配置以 YAML 格式存储在:
@@ -59,7 +77,21 @@ Monoco 是一个开发者生产力工具包,提供:
59
77
 
60
78
  ## 最佳实践
61
79
 
80
+ ### 基础操作
81
+
62
82
  1. **优先使用 CLI 命令**,而不是手动编辑文件
63
83
  2. **配置更改后运行 `monoco sync`** 以更新 agent 环境
64
84
  3. **将 `.monoco/config.yaml` 提交到版本控制**,保持团队一致性
65
85
  4. **保持全局配置最小化** - 大多数设置应该是项目特定的
86
+
87
+ ### Git 工作流 (⚠️ CRITICAL for Agents)
88
+
89
+ 5. **严格遵循分支隔离**:
90
+ - ✅ 始终使用: `monoco issue start <ID> --branch`
91
+ - ❌ 禁止在 `main`/`master` 分支直接修改代码
92
+ - 📝 提交前运行: `monoco issue sync-files` 更新文件追踪
93
+
94
+ 6. **质量门禁**:
95
+ - Git Hooks 会自动运行检查,不要尝试绕过 (`--no-verify`)
96
+ - 提交前确保 `monoco issue lint` 通过
97
+ - 使用 `monoco issue submit` 生成交付报告
@@ -24,6 +24,13 @@ DEFAULT_EXCLUDES = [
24
24
  ".vscode",
25
25
  ".idea",
26
26
  ".fleet",
27
+ ".vscode-test",
28
+ ".cache",
29
+ ".mypy_cache",
30
+ ".pytest_cache",
31
+ ".ruff_cache",
32
+ ".tox",
33
+ ".nox",
27
34
  # System Prompts & Agent Configs
28
35
  "AGENTS.md",
29
36
  "CLAUDE.md",
@@ -55,17 +62,16 @@ def load_gitignore_patterns(root: Path) -> List[str]:
55
62
 
56
63
 
57
64
  def is_excluded(
58
- path: Path, root: Path, patterns: List[str], excludes: Optional[List[str]] = None
65
+ path: Path, root: Path, patterns: List[str], excludes_set: Optional[set] = None
59
66
  ) -> bool:
60
67
  """Check if a path should be excluded based on patterns and defaults."""
61
68
  rel_path = str(path.relative_to(root))
62
69
 
63
- final_excludes = excludes if excludes is not None else DEFAULT_EXCLUDES
64
-
65
70
  # 1. Check default excludes (exact match for any path component, case-insensitive)
66
- for part in path.parts:
67
- if part.lower() in [e.lower() for e in final_excludes]:
68
- return True
71
+ if excludes_set:
72
+ for part in path.parts:
73
+ if part.lower() in excludes_set:
74
+ return True
69
75
 
70
76
  # 2. Check gitignore patterns
71
77
  for pattern in patterns:
@@ -98,11 +104,25 @@ def discover_markdown_files(root: Path, include_issues: bool = False) -> List[Pa
98
104
  if not include_issues:
99
105
  excludes.append("Issues")
100
106
 
101
- # We walk to ensure we can skip directories early if needed,
102
- # but for now rglob + filter is simpler.
103
- for p in root.rglob("*.md"):
104
- if p.is_file() and not is_excluded(p, root, patterns, excludes=excludes):
105
- all_md_files.append(p)
107
+ # Pre-calculate lowercase set for performance
108
+ excludes_set = {e.lower() for e in excludes}
109
+
110
+ # Use walk to skip excluded directories early
111
+ for current_root, dirs, files in root.walk():
112
+ # Filter directories in-place to skip excluded ones
113
+ dirs[:] = [
114
+ d
115
+ for d in dirs
116
+ if not is_excluded(
117
+ current_root / d, root, patterns, excludes_set=excludes_set
118
+ )
119
+ ]
120
+
121
+ for file in files:
122
+ if file.endswith(".md"):
123
+ p = current_root / file
124
+ if not is_excluded(p, root, patterns, excludes_set=excludes_set):
125
+ all_md_files.append(p)
106
126
 
107
127
  return sorted(all_md_files)
108
128
 
@@ -66,7 +66,7 @@ class IssueValidator:
66
66
  diagnostics.extend(self._validate_references(meta, content, all_issue_ids))
67
67
 
68
68
  # 5.5 Domain Integrity
69
- diagnostics.extend(self._validate_domains(meta, content))
69
+ diagnostics.extend(self._validate_domains(meta, content, all_issue_ids))
70
70
 
71
71
  # 6. Time Consistency
72
72
  diagnostics.extend(self._validate_time_consistency(meta, content))
@@ -562,7 +562,9 @@ class IssueValidator:
562
562
 
563
563
  return diagnostics
564
564
 
565
- def _validate_domains(self, meta: IssueMetadata, content: str) -> List[Diagnostic]:
565
+ def _validate_domains(
566
+ self, meta: IssueMetadata, content: str, all_ids: Set[str] = set()
567
+ ) -> List[Diagnostic]:
566
568
  diagnostics = []
567
569
  # Check if 'domains' field exists in frontmatter text
568
570
  # We rely on text parsing because Pydantic defaults 'domains' to [] if missing.
@@ -585,15 +587,25 @@ class IssueValidator:
585
587
  has_domains_field = True
586
588
  break
587
589
 
590
+ # Governance Maturity Check
591
+ # Rule: If Epics > 8 or Issues > 50, enforce Domain usage
592
+ num_issues = len(all_ids)
593
+ num_epics = len(
594
+ [i for i in all_ids if "EPIC-" in i]
595
+ ) # Simple heuristic, ideally check type
596
+
597
+ is_mature = num_issues > 50 or num_epics > 8
598
+
588
599
  if not has_domains_field:
589
- # We report it on line 0 (start of file) or line 1
590
- diagnostics.append(
591
- self._create_diagnostic(
592
- "Structure Error: Missing 'domains' field in frontmatter.",
593
- DiagnosticSeverity.Warning,
594
- line=0,
600
+ if is_mature:
601
+ # We report it on line 0 (start of file) or line 1
602
+ diagnostics.append(
603
+ self._create_diagnostic(
604
+ "Governance Maturity: Project scale (Epics>8 or Issues>50) requires 'domains' field in frontmatter.",
605
+ DiagnosticSeverity.Warning,
606
+ line=0,
607
+ )
595
608
  )
596
- )
597
609
 
598
610
  return diagnostics
599
611
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: monoco-toolkit
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Agent Native Toolkit for Monoco - Task Management & Kanban for AI Agents
5
5
  Project-URL: Homepage, https://monoco.io
6
6
  Project-URL: Repository, https://github.com/IndenScale/Monoco
@@ -24,10 +24,10 @@ monoco/core/agent/action.py,sha256=qkQGJERhL4N5MSuwDivn8NAw4sMhEa346huGtqNyFTM,5
24
24
  monoco/core/agent/adapters.py,sha256=q6obVcXve46mVNBaSCBRFRYs8gImv6Y2gAJVv173Z6w,4376
25
25
  monoco/core/agent/protocol.py,sha256=eB0OiMjDQu1DOoeVqb_PpHsMyPy2LdNenNyt4vJ9qbQ,798
26
26
  monoco/core/agent/state.py,sha256=Z8qqY7loms5nt3524_TrEMmlpnurxf0aHfiCT1FgvDI,3385
27
- monoco/core/resources/en/AGENTS.md,sha256=3TpCLNC1s_lIbDfJJBRmmROMoy9sZXu8BOag8M9NXI0,327
28
- monoco/core/resources/en/SKILL.md,sha256=1PrBqCgjDxT1LMSeu11BzlMhfboo_UlgZxdzBm7Tp9c,2161
29
- monoco/core/resources/zh/AGENTS.md,sha256=pGQOLt8mcRygJotd5oC8l9604hikQoUiS99QsHCe-UM,298
30
- monoco/core/resources/zh/SKILL.md,sha256=8py8tD7s23cw2srKFnTjLO_miyuGXb3NLyEbk5gchqA,1886
27
+ monoco/core/resources/en/AGENTS.md,sha256=vf9z43UU-LPwYKPWCrtw8TpWrmkeZ6zfMyHP4Q9JqdQ,1178
28
+ monoco/core/resources/en/SKILL.md,sha256=wBXNpPqATOxO8TGiOM8S091gMNZ8du_WhQubO6TfNyg,3504
29
+ monoco/core/resources/zh/AGENTS.md,sha256=KBNZSCPBIals6jDdvG5wJgjZuswi_1nKljggJSMtfy8,1156
30
+ monoco/core/resources/zh/SKILL.md,sha256=1D8_FqzDVqowZWk4Qkyx4me53NTd8qihP20gaCH6gJY,3153
31
31
  monoco/daemon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  monoco/daemon/app.py,sha256=tAtLxzw_aRzU0r6Bk9lhshaCyqZRkQKUJmg5FDi7-1c,15431
33
33
  monoco/daemon/commands.py,sha256=2AGsqDZ0edg34KuAGZrTvKlJZ1fhxNXgus7vGn2km4c,1115
@@ -40,7 +40,7 @@ monoco/features/config/commands.py,sha256=i6_fKhSGLeO8RCbWrYKxelFgaHWcPiQERS2uxU
40
40
  monoco/features/i18n/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
41
41
  monoco/features/i18n/adapter.py,sha256=-ifDKQ7UH8tDoOdB_fSKoIrNRJROIPNuzZor2FPJVfo,932
42
42
  monoco/features/i18n/commands.py,sha256=NJ2lZRRjiTW-3UbqxhEKURdWSDxQPkfnBAUgnwoVCL8,8416
43
- monoco/features/i18n/core.py,sha256=MZPn6dJCj9CYy1gihHPOOgLlIlsbqwz97Dl9KpAnX-w,9188
43
+ monoco/features/i18n/core.py,sha256=bnEV9D7KgxbC5I3l-1RN1-H8hek1loDL6KFXzmdq0pQ,9658
44
44
  monoco/features/i18n/resources/en/AGENTS.md,sha256=zzuF7BW6x8Mj6LZZmeM6wTbG5CSCDMShf4rwtN7XITg,197
45
45
  monoco/features/i18n/resources/en/SKILL.md,sha256=Z8fAAqeMvpLDw1D_9AzZIykS5-HLVM9nnlRZLWBTPqM,2203
46
46
  monoco/features/i18n/resources/zh/AGENTS.md,sha256=lKkwLLCADRH7UDq9no4eQY2sRfJrb64JoZ_HNved8vA,175
@@ -52,7 +52,7 @@ monoco/features/issue/linter.py,sha256=DQ3UruGUUMZu63EFn71eczoFDoqj31JxHHaRR3Ej6
52
52
  monoco/features/issue/migration.py,sha256=i0xlxZjrpmuHGHOAIN4iu31EwwVIvZn7yjveS-kU22c,4896
53
53
  monoco/features/issue/models.py,sha256=7oIMxvUEfe00n7wni9bZgKU2e9404flvArixbLQ95Dg,5902
54
54
  monoco/features/issue/monitor.py,sha256=vZN0TbR3V5fHKHRGkIhimO6UwWcwYjDHQs2qzjEG174,3549
55
- monoco/features/issue/validator.py,sha256=LC0biKkCBdeUT9fsST4_25p43xCILItFSdg8wDbz5oM,24261
55
+ monoco/features/issue/validator.py,sha256=Rbn5M_RLEHVPi5n0Y19-VCWZvVlRWcCRFYRbsw-Oc-I,24732
56
56
  monoco/features/issue/domain/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
57
57
  monoco/features/issue/domain/lifecycle.py,sha256=oIuLYTVy1RRHGngAzbNU4kTWOHMBhjuw_TuYCwNqMJw,4991
58
58
  monoco/features/issue/domain/models.py,sha256=eo5Ks7VzWDQsqzuu9gcBuxIafvfqnzUDNDG9wbaghsc,5797
@@ -77,8 +77,8 @@ monoco/features/spike/resources/en/AGENTS.md,sha256=NG3CMnlDk_0J8hnRUcueAM9lgIQr
77
77
  monoco/features/spike/resources/en/SKILL.md,sha256=qKDcVh0D3pDRvfNLh1Bzo4oQU3obpl4tqdlzxeiWYMk,1911
78
78
  monoco/features/spike/resources/zh/AGENTS.md,sha256=5RHNl7fc3RdYYTFH483ojJl_arGPKkyYziOuGgFbqqg,290
79
79
  monoco/features/spike/resources/zh/SKILL.md,sha256=Q82e9lCQOAYIwBs5rGnvlVUDq7bp0pz8yvO10KTWFYQ,1710
80
- monoco_toolkit-0.3.0.dist-info/METADATA,sha256=wlJBNo4dO5EsFridU9MVpUeCxue6Bno-pbfEMWY89hc,4866
81
- monoco_toolkit-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
82
- monoco_toolkit-0.3.0.dist-info/entry_points.txt,sha256=iYj7FWYBdtClU15-Du1skqD0s6SFSIhJvxJ29VWp8ng,43
83
- monoco_toolkit-0.3.0.dist-info/licenses/LICENSE,sha256=ACAGGjV6aod4eIlVUTx1q9PZbnZGN5bBwkSs9RHj83s,1071
84
- monoco_toolkit-0.3.0.dist-info/RECORD,,
80
+ monoco_toolkit-0.3.2.dist-info/METADATA,sha256=9Xyk-ImLkR4WvBAz6eQb8_N-QZiJ7TPu27P3u48Y35c,4866
81
+ monoco_toolkit-0.3.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
82
+ monoco_toolkit-0.3.2.dist-info/entry_points.txt,sha256=iYj7FWYBdtClU15-Du1skqD0s6SFSIhJvxJ29VWp8ng,43
83
+ monoco_toolkit-0.3.2.dist-info/licenses/LICENSE,sha256=ACAGGjV6aod4eIlVUTx1q9PZbnZGN5bBwkSs9RHj83s,1071
84
+ monoco_toolkit-0.3.2.dist-info/RECORD,,