monoco-toolkit 0.3.9__py3-none-any.whl → 0.3.11__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- monoco/__main__.py +8 -0
- monoco/core/artifacts/__init__.py +16 -0
- monoco/core/artifacts/manager.py +575 -0
- monoco/core/artifacts/models.py +161 -0
- monoco/core/config.py +38 -4
- monoco/core/git.py +23 -0
- monoco/core/hooks/builtin/git_cleanup.py +1 -1
- monoco/core/ingestion/__init__.py +20 -0
- monoco/core/ingestion/discovery.py +248 -0
- monoco/core/ingestion/watcher.py +343 -0
- monoco/core/ingestion/worker.py +436 -0
- monoco/core/injection.py +63 -29
- monoco/core/integrations.py +2 -2
- monoco/core/loader.py +633 -0
- monoco/core/output.py +5 -5
- monoco/core/registry.py +34 -19
- monoco/core/resource/__init__.py +5 -0
- monoco/core/resource/finder.py +98 -0
- monoco/core/resource/manager.py +91 -0
- monoco/core/resource/models.py +35 -0
- monoco/core/skill_framework.py +292 -0
- monoco/core/skills.py +524 -385
- monoco/core/sync.py +73 -1
- monoco/core/workflow_converter.py +420 -0
- monoco/daemon/app.py +77 -1
- monoco/daemon/commands.py +10 -0
- monoco/daemon/mailroom_service.py +196 -0
- monoco/daemon/models.py +1 -0
- monoco/daemon/scheduler.py +236 -0
- monoco/daemon/services.py +185 -0
- monoco/daemon/triggers.py +55 -0
- monoco/features/agent/__init__.py +2 -2
- monoco/features/agent/adapter.py +41 -0
- monoco/features/agent/apoptosis.py +44 -0
- monoco/features/agent/cli.py +101 -144
- monoco/features/agent/config.py +35 -21
- monoco/features/agent/defaults.py +6 -49
- monoco/features/agent/engines.py +32 -6
- monoco/features/agent/manager.py +47 -6
- monoco/features/agent/models.py +2 -2
- monoco/features/agent/resources/atoms/atom-code-dev.yaml +61 -0
- monoco/features/agent/resources/atoms/atom-issue-lifecycle.yaml +73 -0
- monoco/features/agent/resources/atoms/atom-knowledge.yaml +55 -0
- monoco/features/agent/resources/atoms/atom-review.yaml +60 -0
- monoco/{core/resources/en → features/agent/resources/en/skills/monoco_atom_core}/SKILL.md +3 -1
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_engineer/SKILL.md +94 -0
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_manager/SKILL.md +93 -0
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_planner/SKILL.md +85 -0
- monoco/features/agent/resources/en/skills/monoco_workflow_agent_reviewer/SKILL.md +114 -0
- monoco/features/agent/resources/workflows/workflow-dev.yaml +83 -0
- monoco/features/agent/resources/workflows/workflow-issue-create.yaml +72 -0
- monoco/features/agent/resources/workflows/workflow-review.yaml +94 -0
- monoco/features/agent/resources/zh/roles/monoco_role_engineer.yaml +49 -0
- monoco/features/agent/resources/zh/roles/monoco_role_manager.yaml +46 -0
- monoco/features/agent/resources/zh/roles/monoco_role_planner.yaml +46 -0
- monoco/features/agent/resources/zh/roles/monoco_role_reviewer.yaml +47 -0
- monoco/{core/resources/zh → features/agent/resources/zh/skills/monoco_atom_core}/SKILL.md +3 -1
- monoco/features/agent/resources/{skills/flow_engineer → zh/skills/monoco_workflow_agent_engineer}/SKILL.md +2 -2
- monoco/features/agent/resources/{skills/flow_manager → zh/skills/monoco_workflow_agent_manager}/SKILL.md +2 -2
- monoco/features/agent/resources/zh/skills/monoco_workflow_agent_planner/SKILL.md +259 -0
- monoco/features/agent/resources/zh/skills/monoco_workflow_agent_reviewer/SKILL.md +137 -0
- monoco/features/agent/session.py +59 -11
- monoco/features/agent/worker.py +38 -2
- monoco/features/artifact/__init__.py +0 -0
- monoco/features/artifact/adapter.py +33 -0
- monoco/features/artifact/resources/zh/AGENTS.md +14 -0
- monoco/features/artifact/resources/zh/skills/monoco_atom_artifact/SKILL.md +278 -0
- monoco/features/glossary/__init__.py +0 -0
- monoco/features/glossary/adapter.py +42 -0
- monoco/features/glossary/config.py +5 -0
- monoco/features/glossary/resources/en/AGENTS.md +29 -0
- monoco/features/glossary/resources/en/skills/monoco_atom_glossary/SKILL.md +35 -0
- monoco/features/glossary/resources/zh/AGENTS.md +29 -0
- monoco/features/glossary/resources/zh/skills/monoco_atom_glossary/SKILL.md +35 -0
- monoco/features/hooks/__init__.py +11 -0
- monoco/features/hooks/adapter.py +67 -0
- monoco/features/hooks/commands.py +309 -0
- monoco/features/hooks/core.py +441 -0
- monoco/features/hooks/resources/ADDING_HOOKS.md +234 -0
- monoco/features/i18n/adapter.py +18 -5
- monoco/features/i18n/core.py +482 -17
- monoco/features/i18n/resources/en/{SKILL.md → skills/monoco_atom_i18n/SKILL.md} +3 -1
- monoco/features/i18n/resources/en/skills/monoco_workflow_i18n_scan/SKILL.md +105 -0
- monoco/features/i18n/resources/zh/{SKILL.md → skills/monoco_atom_i18n/SKILL.md} +3 -1
- monoco/features/i18n/resources/{skills/i18n_scan_workflow → zh/skills/monoco_workflow_i18n_scan}/SKILL.md +2 -2
- monoco/features/issue/adapter.py +19 -6
- monoco/features/issue/commands.py +281 -7
- monoco/features/issue/core.py +272 -19
- monoco/features/issue/engine/machine.py +118 -5
- monoco/features/issue/linter.py +60 -5
- monoco/features/issue/models.py +3 -2
- monoco/features/issue/resources/en/AGENTS.md +109 -0
- monoco/features/issue/resources/en/{SKILL.md → skills/monoco_atom_issue/SKILL.md} +3 -1
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_creation/SKILL.md +167 -0
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_development/SKILL.md +224 -0
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_management/SKILL.md +159 -0
- monoco/features/issue/resources/en/skills/monoco_workflow_issue_refinement/SKILL.md +203 -0
- monoco/features/issue/resources/hooks/post-checkout.sh +39 -0
- monoco/features/issue/resources/hooks/pre-commit.sh +41 -0
- monoco/features/issue/resources/hooks/pre-push.sh +35 -0
- monoco/features/issue/resources/zh/AGENTS.md +109 -0
- monoco/features/issue/resources/zh/{SKILL.md → skills/monoco_atom_issue_lifecycle/SKILL.md} +3 -1
- monoco/features/issue/resources/zh/skills/monoco_workflow_issue_creation/SKILL.md +167 -0
- monoco/features/issue/resources/zh/skills/monoco_workflow_issue_development/SKILL.md +224 -0
- monoco/features/issue/resources/{skills/issue_lifecycle_workflow → zh/skills/monoco_workflow_issue_management}/SKILL.md +2 -2
- monoco/features/issue/resources/zh/skills/monoco_workflow_issue_refinement/SKILL.md +203 -0
- monoco/features/issue/validator.py +101 -1
- monoco/features/memo/adapter.py +21 -8
- monoco/features/memo/cli.py +103 -10
- monoco/features/memo/core.py +178 -92
- monoco/features/memo/models.py +53 -0
- monoco/features/memo/resources/en/skills/monoco_atom_memo/SKILL.md +77 -0
- monoco/features/memo/resources/en/skills/monoco_workflow_note_processing/SKILL.md +140 -0
- monoco/features/memo/resources/zh/{SKILL.md → skills/monoco_atom_memo/SKILL.md} +3 -1
- monoco/features/memo/resources/{skills/note_processing_workflow → zh/skills/monoco_workflow_note_processing}/SKILL.md +2 -2
- monoco/features/spike/adapter.py +18 -5
- monoco/features/spike/resources/en/{SKILL.md → skills/monoco_atom_spike/SKILL.md} +3 -1
- monoco/features/spike/resources/en/skills/monoco_workflow_research/SKILL.md +121 -0
- monoco/features/spike/resources/zh/{SKILL.md → skills/monoco_atom_spike/SKILL.md} +3 -1
- monoco/features/spike/resources/{skills/research_workflow → zh/skills/monoco_workflow_research}/SKILL.md +2 -2
- monoco/main.py +38 -1
- monoco_toolkit-0.3.11.dist-info/METADATA +130 -0
- monoco_toolkit-0.3.11.dist-info/RECORD +181 -0
- monoco/features/agent/reliability.py +0 -106
- monoco/features/agent/resources/skills/flow_reviewer/SKILL.md +0 -114
- monoco_toolkit-0.3.9.dist-info/METADATA +0 -127
- monoco_toolkit-0.3.9.dist-info/RECORD +0 -115
- /monoco/{core → features/agent}/resources/en/AGENTS.md +0 -0
- /monoco/{core → features/agent}/resources/zh/AGENTS.md +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/WHEEL +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/entry_points.txt +0 -0
- {monoco_toolkit-0.3.9.dist-info → monoco_toolkit-0.3.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional, Literal
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
class Memo(BaseModel):
|
|
6
|
+
uid: str
|
|
7
|
+
content: str
|
|
8
|
+
timestamp: datetime = Field(default_factory=datetime.now)
|
|
9
|
+
|
|
10
|
+
# Optional Context
|
|
11
|
+
context: Optional[str] = None
|
|
12
|
+
|
|
13
|
+
# New Metadata Fields
|
|
14
|
+
author: str = "User" # User, Assistant, or specific Agent Name
|
|
15
|
+
source: str = "cli" # cli, agent, mailroom, etc.
|
|
16
|
+
status: Literal["pending", "tracked", "resolved", "dismissed"] = "pending"
|
|
17
|
+
ref: Optional[str] = None # Linked Issue ID or other reference
|
|
18
|
+
type: Literal["insight", "bug", "feature", "task"] = "insight"
|
|
19
|
+
|
|
20
|
+
def to_markdown(self) -> str:
|
|
21
|
+
"""
|
|
22
|
+
Render the memo to Markdown format.
|
|
23
|
+
"""
|
|
24
|
+
ts_str = self.timestamp.strftime("%Y-%m-%d %H:%M:%S")
|
|
25
|
+
header = f"## [{self.uid}] {ts_str}"
|
|
26
|
+
|
|
27
|
+
# Metadata block
|
|
28
|
+
meta = []
|
|
29
|
+
if self.author != "User":
|
|
30
|
+
meta.append(f"- **From**: {self.author}")
|
|
31
|
+
if self.source != "cli":
|
|
32
|
+
meta.append(f"- **Source**: {self.source}")
|
|
33
|
+
if self.type != "insight":
|
|
34
|
+
meta.append(f"- **Type**: {self.type}")
|
|
35
|
+
|
|
36
|
+
# Status line with checkbox simulation
|
|
37
|
+
status_map = {
|
|
38
|
+
"pending": "[ ] Pending",
|
|
39
|
+
"tracked": "[x] Tracked",
|
|
40
|
+
"resolved": "[x] Resolved",
|
|
41
|
+
"dismissed": "[-] Dismissed"
|
|
42
|
+
}
|
|
43
|
+
meta.append(f"- **Status**: {status_map.get(self.status, '[ ] Pending')}")
|
|
44
|
+
|
|
45
|
+
if self.ref:
|
|
46
|
+
meta.append(f"- **Ref**: {self.ref}")
|
|
47
|
+
|
|
48
|
+
if self.context:
|
|
49
|
+
meta.append(f"- **Context**: `{self.context}`")
|
|
50
|
+
|
|
51
|
+
meta_block = "\n".join(meta)
|
|
52
|
+
|
|
53
|
+
return f"\n{header}\n{meta_block}\n\n{self.content.strip()}\n"
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monoco_atom_memo
|
|
3
|
+
description: Lightweight memo system for quickly recording ideas, inspirations, and temporary notes. Distinguished from the formal Issue system.
|
|
4
|
+
type: atom
|
|
5
|
+
version: 1.0.0
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Monoco Memo
|
|
9
|
+
|
|
10
|
+
Use this skill to quickly capture fleeting notes (fleeting ideas) without creating a formal Issue.
|
|
11
|
+
|
|
12
|
+
## When to Use Memo vs Issue
|
|
13
|
+
|
|
14
|
+
| Scenario | Use | Reason |
|
|
15
|
+
|----------|-----|--------|
|
|
16
|
+
| Temporary ideas, inspirations | **Memo** | No tracking needed, no completion status required |
|
|
17
|
+
| Code snippets, link bookmarks | **Memo** | Quick record, organize later |
|
|
18
|
+
| Meeting notes | **Memo** | Record first, then extract tasks |
|
|
19
|
+
| Actionable work unit | **Issue** | Requires tracking, acceptance criteria, lifecycle |
|
|
20
|
+
| Bug fix | **Issue** | Needs to record reproduction steps, verification results |
|
|
21
|
+
| Feature development | **Issue** | Needs design, decomposition, delivery |
|
|
22
|
+
|
|
23
|
+
> **Core Principle**: Memos record **ideas**; Issues handle **actionable tasks**.
|
|
24
|
+
|
|
25
|
+
## Commands
|
|
26
|
+
|
|
27
|
+
### Add Memo
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
monoco memo add "Your memo content"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Optional parameters:
|
|
34
|
+
- `-c, --context`: Add context reference (e.g., `file:line`)
|
|
35
|
+
|
|
36
|
+
Examples:
|
|
37
|
+
```bash
|
|
38
|
+
# Simple record
|
|
39
|
+
monoco memo add "Consider using Redis cache for user sessions"
|
|
40
|
+
|
|
41
|
+
# Record with context
|
|
42
|
+
monoco memo add "Recursion here may cause stack overflow" -c "src/utils.py:42"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### View Memo List
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
monoco memo list
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Displays all unarchived memos.
|
|
52
|
+
|
|
53
|
+
### Open Memo File
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
monoco memo open
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Opens the memo file in the default editor for organizing or batch editing.
|
|
60
|
+
|
|
61
|
+
## Workflow
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
Idea flashes → monoco memo add "..." → Regular organization → Extract into Issue or archive
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
1. **Capture**: Use `monoco memo add` immediately when you have an idea
|
|
68
|
+
2. **Organize**: Regularly (e.g., daily/weekly) run `monoco memo list` to review
|
|
69
|
+
3. **Convert**: Transform valuable memos into formal Issues
|
|
70
|
+
4. **Archive**: Remove from memos after processing
|
|
71
|
+
|
|
72
|
+
## Best Practices
|
|
73
|
+
|
|
74
|
+
1. **Keep concise**: Memos are quick notes, no detailed description needed
|
|
75
|
+
2. **Convert timely**: Valuable ideas should be converted to Issue as soon as possible to avoid forgetting
|
|
76
|
+
3. **Clean up regularly**: Memos are temporary, don't let them accumulate indefinitely
|
|
77
|
+
4. **Use context**: When recording code-related ideas, use `-c` parameter to mark the location
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monoco_workflow_note_processing
|
|
3
|
+
description: Memo Note Processing Workflow (Flow Skill). Defines the standard operational process from capturing fleeting notes to organizing and archiving, ensuring effective management of ideas.
|
|
4
|
+
type: workflow
|
|
5
|
+
domain: memo
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Note Processing Workflow
|
|
10
|
+
|
|
11
|
+
Standardized workflow for Memo note processing, ensuring the "Capture → Process → Organize → Archive/Convert" process.
|
|
12
|
+
|
|
13
|
+
## Workflow State Machine
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
stateDiagram-v2
|
|
17
|
+
[*] --> Capture: Idea flashes
|
|
18
|
+
|
|
19
|
+
Capture --> Process: Regular organization
|
|
20
|
+
Capture --> Capture: Continue recording
|
|
21
|
+
|
|
22
|
+
Process --> Organize: Classification completed
|
|
23
|
+
Process --> Archive: No value<br/>(archive directly)
|
|
24
|
+
|
|
25
|
+
Organize --> Convert: Actionable
|
|
26
|
+
Organize --> Organize: Needs supplement<br/>(complete information)
|
|
27
|
+
Organize --> Archive: Pure reference<br/>(archive for storage)
|
|
28
|
+
|
|
29
|
+
Convert --> [*]: Converted to Issue
|
|
30
|
+
|
|
31
|
+
Archive --> [*]: Archiving completed
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Execution Steps
|
|
35
|
+
|
|
36
|
+
### 1. Capture (Capture)
|
|
37
|
+
|
|
38
|
+
- **Goal**: Quickly record fleeting ideas without interrupting current work
|
|
39
|
+
- **Input**: Ideas, inspirations, code snippets, links
|
|
40
|
+
- **Output**: Memo record
|
|
41
|
+
- **Checkpoints**:
|
|
42
|
+
- [ ] Use `monoco memo add "content"`
|
|
43
|
+
- [ ] Keep it concise, no detailed description needed
|
|
44
|
+
- [ ] Add context (`-c file:line` if applicable)
|
|
45
|
+
- [ ] Do not interrupt current task flow
|
|
46
|
+
|
|
47
|
+
### 2. Process (Processing)
|
|
48
|
+
|
|
49
|
+
- **Goal**: Regularly review and classify Memos
|
|
50
|
+
- **Strategy**: Regular organization (daily/weekly)
|
|
51
|
+
- **Checkpoints**:
|
|
52
|
+
- [ ] Run `monoco memo list` to view all Memos
|
|
53
|
+
- [ ] Evaluate value of each Memo
|
|
54
|
+
- [ ] Classify: Actionable / Pure reference / No value
|
|
55
|
+
- [ ] Supplement missing information
|
|
56
|
+
|
|
57
|
+
### 3. Organize (Organization)
|
|
58
|
+
|
|
59
|
+
- **Goal**: Structured organization of valuable Memos
|
|
60
|
+
- **Strategy**: Choose processing method based on type
|
|
61
|
+
- **Checkpoints**:
|
|
62
|
+
- [ ] Add tags or categories to related Memos
|
|
63
|
+
- [ ] Merge similar Memos
|
|
64
|
+
- [ ] Complete vague records
|
|
65
|
+
- [ ] Set priority (if applicable)
|
|
66
|
+
|
|
67
|
+
### 4. Archive/Convert (Archive or Convert)
|
|
68
|
+
|
|
69
|
+
- **Goal**: Archive processed Memos or convert to Issue
|
|
70
|
+
- **Checkpoints**:
|
|
71
|
+
- [ ] **Convert**: Convert actionable ideas to Issue
|
|
72
|
+
- Use `monoco issue create feature/chore/fix -t "title"`
|
|
73
|
+
- Reference original Memo in the Issue
|
|
74
|
+
- [ ] **Archive**: Archive pure reference content
|
|
75
|
+
- Move to knowledge base or documentation
|
|
76
|
+
- Remove from Memo list
|
|
77
|
+
- [ ] **Delete**: Delete Memos with no value directly
|
|
78
|
+
|
|
79
|
+
## Decision Branches
|
|
80
|
+
|
|
81
|
+
| Condition | Action |
|
|
82
|
+
|-----------|--------|
|
|
83
|
+
| Idea is actionable | Convert, create Issue |
|
|
84
|
+
| Pure reference material | Archive, save to knowledge base |
|
|
85
|
+
| No value/outdated | Delete, remove directly |
|
|
86
|
+
| Information incomplete | Return to Organize, supplement information |
|
|
87
|
+
|
|
88
|
+
## Compliance Requirements
|
|
89
|
+
|
|
90
|
+
- **Required**: Memos are temporary, should not accumulate indefinitely
|
|
91
|
+
- **Required**: Actionable ideas must be converted to Issue for tracking
|
|
92
|
+
- **Recommended**: Process regularly (recommended weekly)
|
|
93
|
+
- **Recommended**: Keep Memos concise, avoid lengthy discussions
|
|
94
|
+
|
|
95
|
+
## Related Commands
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Add Memo
|
|
99
|
+
monoco memo add "Consider using Redis cache for user sessions"
|
|
100
|
+
|
|
101
|
+
# Memo with context
|
|
102
|
+
monoco memo add "Recursion may cause stack overflow" -c "src/utils.py:42"
|
|
103
|
+
|
|
104
|
+
# View all Memos
|
|
105
|
+
monoco memo list
|
|
106
|
+
|
|
107
|
+
# Edit Memo
|
|
108
|
+
monoco memo open
|
|
109
|
+
|
|
110
|
+
# Create Issue (convert Memo)
|
|
111
|
+
monoco issue create feature -t "Implement Redis cache"
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
## Usage Scenarios
|
|
115
|
+
|
|
116
|
+
| Scenario | Use Memo | Follow-up Processing |
|
|
117
|
+
|----------|----------|---------------------|
|
|
118
|
+
| Improvement suggestion during code review | `memo add "Refactoring suggestion: ..."` | Process → Convert to Issue |
|
|
119
|
+
| Temporary idea during meeting | `memo add "Idea: ..."` | Process → Organize → Convert |
|
|
120
|
+
| Useful code snippet | `memo add "Snippet: ..."` | Process → Archive to knowledge base |
|
|
121
|
+
| Technical article link | `memo add "Read: https://..."` | Process → Archive |
|
|
122
|
+
| Bug clue | `memo add "Possible Bug: ..."` | Process → Convert to Fix Issue |
|
|
123
|
+
|
|
124
|
+
## Difference from Issue
|
|
125
|
+
|
|
126
|
+
| Dimension | Memo | Issue |
|
|
127
|
+
|-----------|------|-------|
|
|
128
|
+
| Purpose | Record ideas | Track tasks |
|
|
129
|
+
| Lifecycle | Temporary, needs regular cleanup | Formal, complete lifecycle |
|
|
130
|
+
| Completion Criteria | Archived or converted | Acceptance criteria passed |
|
|
131
|
+
| Complexity | Simple, one sentence | Detailed, with AC and Tasks |
|
|
132
|
+
| Tracking | None | Complete tracking |
|
|
133
|
+
|
|
134
|
+
## Best Practices
|
|
135
|
+
|
|
136
|
+
1. **Record promptly**: Record immediately when ideas flash, avoid forgetting
|
|
137
|
+
2. **Organize regularly**: Process Memo list at least once a week
|
|
138
|
+
3. **Convert quickly**: Convert valuable ideas to Issue as soon as possible
|
|
139
|
+
4. **Delete decisively**: Delete outdated or valueless Memos decisively
|
|
140
|
+
5. **Keep concise**: Memos are quick notes, no detailed description needed
|
monoco/features/spike/adapter.py
CHANGED
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
from pathlib import Path
|
|
2
2
|
from typing import Dict
|
|
3
|
-
from monoco.core.
|
|
3
|
+
from monoco.core.loader import FeatureModule, FeatureMetadata
|
|
4
|
+
from monoco.core.feature import IntegrationData
|
|
4
5
|
from monoco.features.spike import core
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
class SpikeFeature(
|
|
8
|
+
class SpikeFeature(FeatureModule):
|
|
9
|
+
"""Spike (research) feature module with unified lifecycle support."""
|
|
10
|
+
|
|
8
11
|
@property
|
|
9
|
-
def
|
|
10
|
-
return
|
|
12
|
+
def metadata(self) -> FeatureMetadata:
|
|
13
|
+
return FeatureMetadata(
|
|
14
|
+
name="spike",
|
|
15
|
+
version="1.0.0",
|
|
16
|
+
description="Research spike management for external references",
|
|
17
|
+
dependencies=["core"],
|
|
18
|
+
priority=30,
|
|
19
|
+
)
|
|
11
20
|
|
|
12
|
-
def
|
|
21
|
+
def _on_mount(self, context: "FeatureContext") -> None: # type: ignore
|
|
22
|
+
"""Initialize spike feature with workspace context."""
|
|
23
|
+
root = context.root
|
|
24
|
+
config = context.config
|
|
13
25
|
spikes_name = config.get("paths", {}).get("spikes", ".references")
|
|
14
26
|
core.init(root, spikes_name)
|
|
15
27
|
|
|
16
28
|
def integrate(self, root: Path, config: Dict) -> IntegrationData:
|
|
29
|
+
"""Provide integration data for agent environment."""
|
|
17
30
|
# Determine language from config, default to 'en'
|
|
18
31
|
lang = config.get("i18n", {}).get("source_lang", "en")
|
|
19
32
|
base_dir = Path(__file__).parent / "resources"
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: monoco_workflow_research
|
|
3
|
+
description: Spike Research Workflow (Flow Skill). Defines the standard operational process from adding external repositories to knowledge extraction and archiving, ensuring effective management of external knowledge.
|
|
4
|
+
type: workflow
|
|
5
|
+
domain: spike
|
|
6
|
+
version: 1.0.0
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Research Workflow
|
|
10
|
+
|
|
11
|
+
Standardized workflow for Spike research, ensuring the "Add → Sync → Analyze → Extract → Archive" process.
|
|
12
|
+
|
|
13
|
+
## Workflow State Machine
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
stateDiagram-v2
|
|
17
|
+
[*] --> Add: Discover reference repository
|
|
18
|
+
|
|
19
|
+
Add --> Sync: Configuration added
|
|
20
|
+
Add --> Add: Invalid URL<br/>(re-enter)
|
|
21
|
+
|
|
22
|
+
Sync --> Analyze: Sync completed
|
|
23
|
+
Sync --> Sync: Sync failed<br/>(network/permission)
|
|
24
|
+
|
|
25
|
+
Analyze --> Extract: Analysis completed
|
|
26
|
+
Analyze --> Analyze: Content mismatch<br/>(re-evaluate)
|
|
27
|
+
|
|
28
|
+
Extract --> Archive: Knowledge extraction completed
|
|
29
|
+
|
|
30
|
+
Archive --> [*]: Archiving completed
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Execution Steps
|
|
34
|
+
|
|
35
|
+
### 1. Add (Add Repository)
|
|
36
|
+
|
|
37
|
+
- **Goal**: Add external repository as reference
|
|
38
|
+
- **Input**: Repository URL, reference purpose
|
|
39
|
+
- **Output**: Configuration updated
|
|
40
|
+
- **Checkpoints**:
|
|
41
|
+
- [ ] Verify repository URL is accessible
|
|
42
|
+
- [ ] Confirm repository is relevant to current project
|
|
43
|
+
- [ ] Run `monoco spike add <url>`
|
|
44
|
+
- [ ] Check `.monoco/config.yaml` is updated
|
|
45
|
+
|
|
46
|
+
### 2. Sync (Synchronize)
|
|
47
|
+
|
|
48
|
+
- **Goal**: Download or update reference repository content
|
|
49
|
+
- **Checkpoints**:
|
|
50
|
+
- [ ] Run `monoco spike sync`
|
|
51
|
+
- [ ] Verify repository is cloned to `.references/<name>/`
|
|
52
|
+
- [ ] Check sync logs for errors
|
|
53
|
+
- [ ] Verify file permissions are correct (read-only)
|
|
54
|
+
|
|
55
|
+
### 3. Analyze (Analysis)
|
|
56
|
+
|
|
57
|
+
- **Goal**: Research the structure and content of reference repository
|
|
58
|
+
- **Strategy**: Systematic browsing and marking
|
|
59
|
+
- **Checkpoints**:
|
|
60
|
+
- [ ] Browse overall repository structure
|
|
61
|
+
- [ ] Identify modules relevant to current project
|
|
62
|
+
- [ ] Mark valuable code patterns
|
|
63
|
+
- [ ] Record architectural design highlights
|
|
64
|
+
|
|
65
|
+
### 4. Extract (Knowledge Extraction)
|
|
66
|
+
|
|
67
|
+
- **Goal**: Extract usable knowledge from reference repository
|
|
68
|
+
- **Strategy**: Document valuable findings
|
|
69
|
+
- **Checkpoints**:
|
|
70
|
+
- [ ] Extract key code snippets (without modifying original files)
|
|
71
|
+
- [ ] Record design patterns and best practices
|
|
72
|
+
- [ ] Create learning notes (using Memo or Issue)
|
|
73
|
+
- [ ] Annotate knowledge source (repository URL + Commit)
|
|
74
|
+
|
|
75
|
+
### 5. Archive (Archiving)
|
|
76
|
+
|
|
77
|
+
- **Goal**: Organize and archive research results
|
|
78
|
+
- **Checkpoints**:
|
|
79
|
+
- [ ] Update project documentation, referencing the repository
|
|
80
|
+
- [ ] Create knowledge index (if needed)
|
|
81
|
+
- [ ] Run `monoco spike list` to verify status
|
|
82
|
+
- [ ] Periodically clean up references no longer needed
|
|
83
|
+
|
|
84
|
+
## Decision Branches
|
|
85
|
+
|
|
86
|
+
| Condition | Action |
|
|
87
|
+
|-----------|--------|
|
|
88
|
+
| Invalid URL | Return to Add, check URL format |
|
|
89
|
+
| Sync failed | Check network, permissions, retry or skip |
|
|
90
|
+
| Content not relevant | Remove from configuration, reselect |
|
|
91
|
+
| Important pattern discovered | Create Issue, plan to introduce to project |
|
|
92
|
+
|
|
93
|
+
## Compliance Requirements
|
|
94
|
+
|
|
95
|
+
- **Prohibited**: Editing any files in `.references/`
|
|
96
|
+
- **Required**: All external knowledge must be annotated with source
|
|
97
|
+
- **Required**: Regular synchronization to get updates
|
|
98
|
+
- **Recommended**: Only add high-quality, relevant repositories
|
|
99
|
+
|
|
100
|
+
## Related Commands
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Add reference repository
|
|
104
|
+
monoco spike add <url>
|
|
105
|
+
|
|
106
|
+
# Sync all repositories
|
|
107
|
+
monoco spike sync
|
|
108
|
+
|
|
109
|
+
# List configured repositories
|
|
110
|
+
monoco spike list
|
|
111
|
+
|
|
112
|
+
# Record research findings
|
|
113
|
+
monoco memo add "Discovery: {insight}" -c "spike:{repo_name}"
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Best Practices
|
|
117
|
+
|
|
118
|
+
1. **Selective Choice**: Only add repositories highly relevant to the project
|
|
119
|
+
2. **Read-only Access**: Treat `.references/` as external knowledge base, never modify
|
|
120
|
+
3. **Regular Sync**: Run `monoco spike sync` monthly to get updates
|
|
121
|
+
4. **Knowledge Transformation**: Transform learned patterns into actual project improvements
|
monoco/main.py
CHANGED
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import typer
|
|
3
3
|
from typing import Optional
|
|
4
|
+
from pathlib import Path
|
|
4
5
|
from monoco.core.output import print_output
|
|
6
|
+
from monoco.core.loader import FeatureLoader, FeatureContext
|
|
7
|
+
|
|
8
|
+
# Global feature loader for CLI lifecycle management
|
|
9
|
+
_feature_loader: Optional[FeatureLoader] = None
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def get_feature_loader() -> FeatureLoader:
|
|
13
|
+
"""Get or initialize the global feature loader."""
|
|
14
|
+
global _feature_loader
|
|
15
|
+
if _feature_loader is None:
|
|
16
|
+
_feature_loader = FeatureLoader()
|
|
17
|
+
# Discover features but defer loading until needed
|
|
18
|
+
_feature_loader.discover()
|
|
19
|
+
return _feature_loader
|
|
20
|
+
|
|
5
21
|
|
|
6
22
|
app = typer.Typer(
|
|
7
23
|
name="monoco",
|
|
@@ -89,7 +105,26 @@ def main(
|
|
|
89
105
|
if (discovered / ".monoco").exists():
|
|
90
106
|
config_root = str(discovered)
|
|
91
107
|
|
|
92
|
-
get_config(project_root=config_root, require_project=require_workspace)
|
|
108
|
+
config = get_config(project_root=config_root, require_project=require_workspace)
|
|
109
|
+
|
|
110
|
+
# Initialize FeatureLoader and mount features when workspace is available
|
|
111
|
+
if require_workspace and config_root:
|
|
112
|
+
loader = get_feature_loader()
|
|
113
|
+
# Load all features (with lazy loading for non-critical features)
|
|
114
|
+
loader.load_all(lazy=True)
|
|
115
|
+
# Create feature context and mount all features
|
|
116
|
+
feature_context = FeatureContext(
|
|
117
|
+
root=Path(config_root),
|
|
118
|
+
config=config.model_dump(),
|
|
119
|
+
registry=loader.registry,
|
|
120
|
+
)
|
|
121
|
+
errors = loader.mount_all(feature_context)
|
|
122
|
+
if errors:
|
|
123
|
+
from rich.console import Console
|
|
124
|
+
console = Console()
|
|
125
|
+
for name, error in errors.items():
|
|
126
|
+
console.print(f"[yellow]Warning: Failed to mount feature '{name}': {error}[/yellow]")
|
|
127
|
+
|
|
93
128
|
except FileNotFoundError as e:
|
|
94
129
|
# Graceful exit for workspace errors
|
|
95
130
|
from rich.console import Console
|
|
@@ -156,6 +191,7 @@ from monoco.features.issue import commands as issue_cmd
|
|
|
156
191
|
from monoco.features.spike import commands as spike_cmd
|
|
157
192
|
from monoco.features.i18n import commands as i18n_cmd
|
|
158
193
|
from monoco.features.config import commands as config_cmd
|
|
194
|
+
from monoco.features.hooks import commands as hooks_cmd
|
|
159
195
|
from monoco.cli import project as project_cmd
|
|
160
196
|
from monoco.cli import workspace as workspace_cmd
|
|
161
197
|
|
|
@@ -163,6 +199,7 @@ app.add_typer(issue_cmd.app, name="issue", help="Manage development issues")
|
|
|
163
199
|
app.add_typer(spike_cmd.app, name="spike", help="Manage research spikes")
|
|
164
200
|
app.add_typer(i18n_cmd.app, name="i18n", help="Manage documentation i18n")
|
|
165
201
|
app.add_typer(config_cmd.app, name="config", help="Manage configuration")
|
|
202
|
+
app.add_typer(hooks_cmd.app, name="hooks", help="Manage git hooks for development workflow")
|
|
166
203
|
app.add_typer(project_cmd.app, name="project", help="Manage projects")
|
|
167
204
|
app.add_typer(workspace_cmd.app, name="workspace", help="Manage workspace")
|
|
168
205
|
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: monoco-toolkit
|
|
3
|
+
Version: 0.3.11
|
|
4
|
+
Summary: Agent Native Toolkit for Monoco - Task Management & Kanban for AI Agents
|
|
5
|
+
Project-URL: Homepage, https://monoco.io
|
|
6
|
+
Project-URL: Repository, https://github.com/IndenScale/Monoco
|
|
7
|
+
Project-URL: Documentation, https://monoco.io/docs
|
|
8
|
+
Project-URL: Issues, https://github.com/IndenScale/Monoco/issues
|
|
9
|
+
Author-email: Monoco Team <dev@monoco.io>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: agent-native,ai-agents,cli,kanban,monoco,task-management,workflow
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Office/Business :: Groupware
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: fastapi>=0.100.0
|
|
25
|
+
Requires-Dist: httpx>=0.28.1
|
|
26
|
+
Requires-Dist: prompt-toolkit>=3.0.0
|
|
27
|
+
Requires-Dist: pydantic>=2.0.0
|
|
28
|
+
Requires-Dist: pyyaml>=6.0
|
|
29
|
+
Requires-Dist: rich>=13.0.0
|
|
30
|
+
Requires-Dist: sse-starlette>=1.6.0
|
|
31
|
+
Requires-Dist: typer[all]>=0.9.0
|
|
32
|
+
Requires-Dist: uvicorn[standard]>=0.20.0
|
|
33
|
+
Requires-Dist: watchdog>=6.0.0
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# Monoco Distro
|
|
37
|
+
|
|
38
|
+
[](https://pypi.org/project/monoco-toolkit/)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
|
|
41
|
+
> **The Headless Operating System for Agentic Engineering.**
|
|
42
|
+
>
|
|
43
|
+
> Monoco is a **Linux-like Distribution** for AI Agents.
|
|
44
|
+
> It provides the **Package Manager**, **Init System**, and **Policy Kit** that turns a raw LLM Kernel into a production-ready engineering workforce.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 🐧 The "Distro" Metaphor
|
|
49
|
+
|
|
50
|
+
Monoco is built on a clear separation of concerns, inspired by the Linux ecosystem:
|
|
51
|
+
|
|
52
|
+
| Component | In Linux | In Monoco | Responsibility |
|
|
53
|
+
| :---------- | :------------ | :-------------------- | :------------------------------------------------------------------------------------------------------------------------- |
|
|
54
|
+
| **Kernel** | Linux Kernel | **Kimi CLI / Kosong** | The raw execution engine. Handles LLM prompts, tool execution, and process isolation. |
|
|
55
|
+
| **Distro** | Ubuntu / Arch | **Monoco** | The system manager. Orchestrates workflows, enforces policies, manages state (Issues), and installs capabilities (Skills). |
|
|
56
|
+
| **Desktop** | GNOME / KDE | **VSCode / Zed** | The user interface. Connects to Monoco via standard protocols (LSP, ACP) to provide a visual experience. |
|
|
57
|
+
|
|
58
|
+
## 🌟 Core Philosophy
|
|
59
|
+
|
|
60
|
+
### 1. Headless & Protocol-First
|
|
61
|
+
|
|
62
|
+
Monoco is designed to run silently in the background. It doesn't fight for your attention with a chat window. Instead, it exposes its state via **LSP (Language Server Protocol)** and **ACP (Agent Client Protocol)**, allowing your favorite IDEs to become "Agent-Native".
|
|
63
|
+
|
|
64
|
+
### 2. Issue is the Unit of Work
|
|
65
|
+
|
|
66
|
+
Just as `systemd` manages Units, Monoco manages **Issues**.
|
|
67
|
+
An Issue is not just a text file; it is a stateful object that defines the lifecycle of a task. The Agent cannot "freelance"—it must be assigned to an active Issue.
|
|
68
|
+
|
|
69
|
+
### 3. Governance as Code
|
|
70
|
+
|
|
71
|
+
Monoco acts as the "Policy Kit" for your AI workforce.
|
|
72
|
+
|
|
73
|
+
- **Guardrails**: Prevent destructive actions.
|
|
74
|
+
- **Verification**: Enforce linting and tests before submission.
|
|
75
|
+
- **Audit**: Log every decision and tool call.
|
|
76
|
+
|
|
77
|
+
## 🚀 Quick Start
|
|
78
|
+
|
|
79
|
+
### 1. Installation
|
|
80
|
+
|
|
81
|
+
Install the Monoco Distro via pip:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pip install monoco-toolkit
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 2. Initialize System
|
|
88
|
+
|
|
89
|
+
Turn your project into a Monoco-managed workspace:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
monoco init
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 3. Sync Kernel
|
|
96
|
+
|
|
97
|
+
Inject Monoco's policies into your Agent Kernel (e.g., Kimi CLI configuration):
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
monoco sync
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 4. Start a Session
|
|
104
|
+
|
|
105
|
+
Launch the Monoco Daemon to begin orchestrating work:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
monoco session start
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 🛠️ Tech Stack & Architecture
|
|
112
|
+
|
|
113
|
+
- **Kernel Interface**: Python (Interfacing with Kimi/Kosong)
|
|
114
|
+
- **Distro Logic**: Python (State Management, Issue Tracking)
|
|
115
|
+
- **Protocols**: LSP / ACP (for IDE integration)
|
|
116
|
+
- **Storage**: Local Filesystem (Markdown/YAML)
|
|
117
|
+
|
|
118
|
+
## 📁 Project Structure
|
|
119
|
+
|
|
120
|
+
Monoco follows a "Distro" architecture that separates **State** (`Issues/`), **Config** (`.monoco/`), and **Logic** (`monoco/`).
|
|
121
|
+
|
|
122
|
+
For a detailed breakdown of the directory structure, see **[TREE.md](./TREE.md)**.
|
|
123
|
+
|
|
124
|
+
## 🤝 Contributing
|
|
125
|
+
|
|
126
|
+
Monoco is open-source. We are building the standard distribution for the Agentic era.
|
|
127
|
+
|
|
128
|
+
## 📄 License
|
|
129
|
+
|
|
130
|
+
MIT © [IndenScale](https://github.com/IndenScale)
|