ensemble-claude 0.3.0__tar.gz

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 (59) hide show
  1. ensemble_claude-0.3.0/.gitignore +27 -0
  2. ensemble_claude-0.3.0/LICENSE +21 -0
  3. ensemble_claude-0.3.0/PKG-INFO +144 -0
  4. ensemble_claude-0.3.0/README.md +116 -0
  5. ensemble_claude-0.3.0/pyproject.toml +80 -0
  6. ensemble_claude-0.3.0/src/ensemble/__init__.py +5 -0
  7. ensemble_claude-0.3.0/src/ensemble/ack.py +86 -0
  8. ensemble_claude-0.3.0/src/ensemble/cli.py +31 -0
  9. ensemble_claude-0.3.0/src/ensemble/commands/__init__.py +1 -0
  10. ensemble_claude-0.3.0/src/ensemble/commands/_init_impl.py +208 -0
  11. ensemble_claude-0.3.0/src/ensemble/commands/_launch_impl.py +217 -0
  12. ensemble_claude-0.3.0/src/ensemble/commands/init.py +35 -0
  13. ensemble_claude-0.3.0/src/ensemble/commands/launch.py +32 -0
  14. ensemble_claude-0.3.0/src/ensemble/config.py +218 -0
  15. ensemble_claude-0.3.0/src/ensemble/dashboard.py +168 -0
  16. ensemble_claude-0.3.0/src/ensemble/helpers.py +79 -0
  17. ensemble_claude-0.3.0/src/ensemble/lock.py +77 -0
  18. ensemble_claude-0.3.0/src/ensemble/logger.py +80 -0
  19. ensemble_claude-0.3.0/src/ensemble/notes.py +221 -0
  20. ensemble_claude-0.3.0/src/ensemble/queue.py +166 -0
  21. ensemble_claude-0.3.0/src/ensemble/templates/__init__.py +75 -0
  22. ensemble_claude-0.3.0/src/ensemble/templates/agents/conductor.md +239 -0
  23. ensemble_claude-0.3.0/src/ensemble/templates/agents/dispatch.md +351 -0
  24. ensemble_claude-0.3.0/src/ensemble/templates/agents/integrator.md +138 -0
  25. ensemble_claude-0.3.0/src/ensemble/templates/agents/learner.md +133 -0
  26. ensemble_claude-0.3.0/src/ensemble/templates/agents/reviewer.md +84 -0
  27. ensemble_claude-0.3.0/src/ensemble/templates/agents/security-reviewer.md +136 -0
  28. ensemble_claude-0.3.0/src/ensemble/templates/agents/worker.md +184 -0
  29. ensemble_claude-0.3.0/src/ensemble/templates/commands/go-light.md +49 -0
  30. ensemble_claude-0.3.0/src/ensemble/templates/commands/go.md +101 -0
  31. ensemble_claude-0.3.0/src/ensemble/templates/commands/improve.md +116 -0
  32. ensemble_claude-0.3.0/src/ensemble/templates/commands/review.md +74 -0
  33. ensemble_claude-0.3.0/src/ensemble/templates/commands/status.md +56 -0
  34. ensemble_claude-0.3.0/src/ensemble/templates/scripts/dashboard-update.sh +78 -0
  35. ensemble_claude-0.3.0/src/ensemble/templates/scripts/launch.sh +137 -0
  36. ensemble_claude-0.3.0/src/ensemble/templates/scripts/pane-setup.sh +111 -0
  37. ensemble_claude-0.3.0/src/ensemble/templates/scripts/setup.sh +163 -0
  38. ensemble_claude-0.3.0/src/ensemble/templates/scripts/worktree-create.sh +89 -0
  39. ensemble_claude-0.3.0/src/ensemble/templates/scripts/worktree-merge.sh +194 -0
  40. ensemble_claude-0.3.0/src/ensemble/templates/workflows/default.yaml +78 -0
  41. ensemble_claude-0.3.0/src/ensemble/templates/workflows/heavy.yaml +149 -0
  42. ensemble_claude-0.3.0/src/ensemble/templates/workflows/simple.yaml +41 -0
  43. ensemble_claude-0.3.0/src/ensemble/templates/workflows/worktree.yaml +202 -0
  44. ensemble_claude-0.3.0/src/ensemble/utils.py +60 -0
  45. ensemble_claude-0.3.0/src/ensemble/workflow.py +127 -0
  46. ensemble_claude-0.3.0/src/ensemble/worktree.py +322 -0
  47. ensemble_claude-0.3.0/tests/__init__.py +0 -0
  48. ensemble_claude-0.3.0/tests/test_ack.py +93 -0
  49. ensemble_claude-0.3.0/tests/test_cli.py +145 -0
  50. ensemble_claude-0.3.0/tests/test_config.py +119 -0
  51. ensemble_claude-0.3.0/tests/test_dashboard.py +99 -0
  52. ensemble_claude-0.3.0/tests/test_lock.py +119 -0
  53. ensemble_claude-0.3.0/tests/test_logger.py +165 -0
  54. ensemble_claude-0.3.0/tests/test_notes.py +325 -0
  55. ensemble_claude-0.3.0/tests/test_queue.py +149 -0
  56. ensemble_claude-0.3.0/tests/test_setup.py +170 -0
  57. ensemble_claude-0.3.0/tests/test_templates.py +90 -0
  58. ensemble_claude-0.3.0/tests/test_workflow.py +217 -0
  59. ensemble_claude-0.3.0/tests/test_worktree.py +361 -0
@@ -0,0 +1,27 @@
1
+ # Ensemble queue files (transient)
2
+ queue/tasks/*.yaml
3
+ queue/reports/*.yaml
4
+ queue/ack/*.ack
5
+ queue/conductor/*.yaml
6
+
7
+ # Logs (transient)
8
+ logs/
9
+
10
+ # Python
11
+ __pycache__/
12
+ *.pyc
13
+ .pytest_cache/
14
+ .coverage
15
+ htmlcov/
16
+ *.egg-info/
17
+ dist/
18
+ build/
19
+
20
+ # Virtual environments
21
+ .venv/
22
+ venv/
23
+
24
+ # IDE
25
+ .idea/
26
+ .vscode/
27
+ *.swp
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Chika Kakazu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: ensemble-claude
3
+ Version: 0.3.0
4
+ Summary: AI Orchestration Tool for Claude Code - Multi-agent orchestration for complex development tasks
5
+ Project-URL: Homepage, https://github.com/ChikaKakazu/ensemble
6
+ Project-URL: Documentation, https://github.com/ChikaKakazu/ensemble#readme
7
+ Project-URL: Repository, https://github.com/ChikaKakazu/ensemble
8
+ Project-URL: Issues, https://github.com/ChikaKakazu/ensemble/issues
9
+ Author-email: Chika Kakazu <chika@example.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai,automation,claude,multi-agent,orchestration
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.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Topic :: Software Development :: Build Tools
20
+ Classifier: Topic :: Software Development :: Code Generators
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: click>=8.0
23
+ Requires-Dist: pyyaml>=6.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-cov>=4.0; extra == 'dev'
26
+ Requires-Dist: pytest>=8.0; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # Ensemble
30
+
31
+ > **"One task. Many minds. One result."**
32
+
33
+ AI Orchestration Tool for Claude Code.
34
+
35
+ ## Overview
36
+
37
+ Ensemble is an AI orchestration system that combines the best practices from:
38
+ - **shogun** - Autonomous AI collaboration with tmux parallel execution
39
+ - **takt** - Workflow enforcement with quality gates
40
+ - **Boris's practices** - Effective use of skills, subagents, CLAUDE.md, and hooks
41
+
42
+ ## Features
43
+
44
+ - **Autonomous AI Coordination**: One instruction triggers multiple AI agents working together
45
+ - **Flexible Execution Patterns**:
46
+ - Pattern A: Simple tasks via subagent
47
+ - Pattern B: Medium tasks via tmux parallel panes
48
+ - Pattern C: Large tasks via git worktree separation
49
+ - **Parallel Review**: Architecture + Security reviews run in parallel
50
+ - **Self-Improvement**: Automatic learning and CLAUDE.md updates
51
+ - **Compaction Recovery**: Built-in protocol to prevent role amnesia
52
+
53
+ ## Installation
54
+
55
+ ### Using uv (recommended)
56
+
57
+ ```bash
58
+ # Install globally
59
+ uv tool install ensemble-claude
60
+
61
+ # Or add to your project
62
+ uv add ensemble-claude
63
+ ```
64
+
65
+ ### Using pip
66
+
67
+ ```bash
68
+ pip install ensemble-claude
69
+ ```
70
+
71
+ ### From source
72
+
73
+ ```bash
74
+ git clone https://github.com/ChikaKakazu/ensemble.git
75
+ cd ensemble
76
+
77
+ # Using uv
78
+ uv pip install -e .
79
+
80
+ # Or using pip
81
+ pip install -e .
82
+ ```
83
+
84
+ ## Quick Start
85
+
86
+ ```bash
87
+ # 1. Initialize Ensemble in your project
88
+ ensemble init
89
+
90
+ # 2. Launch the tmux session with Conductor + Dispatch
91
+ ensemble launch
92
+
93
+ # 3. Run a task (in the Conductor pane)
94
+ /go implement user authentication
95
+
96
+ # Light workflow (minimal cost)
97
+ /go-light fix typo in README
98
+ ```
99
+
100
+ ### CLI Commands
101
+
102
+ | Command | Description |
103
+ |---------|-------------|
104
+ | `ensemble init` | Initialize Ensemble in current project |
105
+ | `ensemble init --full` | Also copy agent/command definitions locally |
106
+ | `ensemble launch` | Start tmux session with Conductor + Dispatch |
107
+ | `ensemble launch --no-attach` | Start session without attaching |
108
+ | `ensemble --version` | Show version |
109
+
110
+ ## Requirements
111
+
112
+ - Python 3.10+
113
+ - Claude Code CLI (`claude` command available)
114
+ - tmux
115
+ - git 2.20+ (for worktree support)
116
+ - Claude Max plan recommended (for parallel execution)
117
+
118
+ ## Agent Architecture
119
+
120
+ ```
121
+ ┌─────────────┐
122
+ │ Conductor │ ← Orchestrator (planning, judgment, delegation)
123
+ └──────┬──────┘
124
+
125
+ ┌────┴────┐
126
+ ▼ ▼
127
+ ┌────────┐ ┌──────────┐
128
+ │Dispatch│ │ Learner │
129
+ └───┬────┘ └──────────┘
130
+ │ ↑ Learning records
131
+
132
+ ┌─────────────────────────────┐
133
+ │ Reviewer / Security-Reviewer│ ← Parallel reviews
134
+ └─────────────────────────────┘
135
+
136
+ ▼ (worktree mode)
137
+ ┌──────────┐
138
+ │Integrator│ ← Merge & integrate
139
+ └──────────┘
140
+ ```
141
+
142
+ ## License
143
+
144
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,116 @@
1
+ # Ensemble
2
+
3
+ > **"One task. Many minds. One result."**
4
+
5
+ AI Orchestration Tool for Claude Code.
6
+
7
+ ## Overview
8
+
9
+ Ensemble is an AI orchestration system that combines the best practices from:
10
+ - **shogun** - Autonomous AI collaboration with tmux parallel execution
11
+ - **takt** - Workflow enforcement with quality gates
12
+ - **Boris's practices** - Effective use of skills, subagents, CLAUDE.md, and hooks
13
+
14
+ ## Features
15
+
16
+ - **Autonomous AI Coordination**: One instruction triggers multiple AI agents working together
17
+ - **Flexible Execution Patterns**:
18
+ - Pattern A: Simple tasks via subagent
19
+ - Pattern B: Medium tasks via tmux parallel panes
20
+ - Pattern C: Large tasks via git worktree separation
21
+ - **Parallel Review**: Architecture + Security reviews run in parallel
22
+ - **Self-Improvement**: Automatic learning and CLAUDE.md updates
23
+ - **Compaction Recovery**: Built-in protocol to prevent role amnesia
24
+
25
+ ## Installation
26
+
27
+ ### Using uv (recommended)
28
+
29
+ ```bash
30
+ # Install globally
31
+ uv tool install ensemble-claude
32
+
33
+ # Or add to your project
34
+ uv add ensemble-claude
35
+ ```
36
+
37
+ ### Using pip
38
+
39
+ ```bash
40
+ pip install ensemble-claude
41
+ ```
42
+
43
+ ### From source
44
+
45
+ ```bash
46
+ git clone https://github.com/ChikaKakazu/ensemble.git
47
+ cd ensemble
48
+
49
+ # Using uv
50
+ uv pip install -e .
51
+
52
+ # Or using pip
53
+ pip install -e .
54
+ ```
55
+
56
+ ## Quick Start
57
+
58
+ ```bash
59
+ # 1. Initialize Ensemble in your project
60
+ ensemble init
61
+
62
+ # 2. Launch the tmux session with Conductor + Dispatch
63
+ ensemble launch
64
+
65
+ # 3. Run a task (in the Conductor pane)
66
+ /go implement user authentication
67
+
68
+ # Light workflow (minimal cost)
69
+ /go-light fix typo in README
70
+ ```
71
+
72
+ ### CLI Commands
73
+
74
+ | Command | Description |
75
+ |---------|-------------|
76
+ | `ensemble init` | Initialize Ensemble in current project |
77
+ | `ensemble init --full` | Also copy agent/command definitions locally |
78
+ | `ensemble launch` | Start tmux session with Conductor + Dispatch |
79
+ | `ensemble launch --no-attach` | Start session without attaching |
80
+ | `ensemble --version` | Show version |
81
+
82
+ ## Requirements
83
+
84
+ - Python 3.10+
85
+ - Claude Code CLI (`claude` command available)
86
+ - tmux
87
+ - git 2.20+ (for worktree support)
88
+ - Claude Max plan recommended (for parallel execution)
89
+
90
+ ## Agent Architecture
91
+
92
+ ```
93
+ ┌─────────────┐
94
+ │ Conductor │ ← Orchestrator (planning, judgment, delegation)
95
+ └──────┬──────┘
96
+
97
+ ┌────┴────┐
98
+ ▼ ▼
99
+ ┌────────┐ ┌──────────┐
100
+ │Dispatch│ │ Learner │
101
+ └───┬────┘ └──────────┘
102
+ │ ↑ Learning records
103
+
104
+ ┌─────────────────────────────┐
105
+ │ Reviewer / Security-Reviewer│ ← Parallel reviews
106
+ └─────────────────────────────┘
107
+
108
+ ▼ (worktree mode)
109
+ ┌──────────┐
110
+ │Integrator│ ← Merge & integrate
111
+ └──────────┘
112
+ ```
113
+
114
+ ## License
115
+
116
+ MIT License - see [LICENSE](LICENSE) for details.
@@ -0,0 +1,80 @@
1
+ [project]
2
+ name = "ensemble-claude"
3
+ version = "0.3.0"
4
+ description = "AI Orchestration Tool for Claude Code - Multi-agent orchestration for complex development tasks"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ license = "MIT"
8
+ authors = [
9
+ { name = "Chika Kakazu", email = "chika@example.com" },
10
+ ]
11
+ keywords = ["ai", "orchestration", "claude", "multi-agent", "automation"]
12
+ classifiers = [
13
+ "Development Status :: 3 - Alpha",
14
+ "Intended Audience :: Developers",
15
+ "License :: OSI Approved :: MIT License",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Topic :: Software Development :: Build Tools",
20
+ "Topic :: Software Development :: Code Generators",
21
+ ]
22
+ dependencies = [
23
+ "pyyaml>=6.0",
24
+ "click>=8.0",
25
+ ]
26
+
27
+ [project.scripts]
28
+ ensemble = "ensemble.cli:main"
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/ChikaKakazu/ensemble"
32
+ Documentation = "https://github.com/ChikaKakazu/ensemble#readme"
33
+ Repository = "https://github.com/ChikaKakazu/ensemble"
34
+ Issues = "https://github.com/ChikaKakazu/ensemble/issues"
35
+
36
+ [project.optional-dependencies]
37
+ dev = [
38
+ "pytest>=8.0",
39
+ "pytest-cov>=4.0",
40
+ ]
41
+
42
+ [build-system]
43
+ requires = ["hatchling"]
44
+ build-backend = "hatchling.build"
45
+
46
+ [tool.hatch.build.targets.wheel]
47
+ packages = ["src/ensemble"]
48
+ # Include non-Python template files
49
+ artifacts = [
50
+ "*.md",
51
+ "*.yaml",
52
+ "*.sh",
53
+ ]
54
+
55
+ [tool.hatch.build.targets.wheel.sources]
56
+ "src" = ""
57
+
58
+ [tool.hatch.build.targets.sdist]
59
+ include = [
60
+ "/src",
61
+ "/tests",
62
+ "/README.md",
63
+ "/LICENSE",
64
+ ]
65
+
66
+ [tool.pytest.ini_options]
67
+ testpaths = ["tests"]
68
+ python_files = ["test_*.py"]
69
+ python_functions = ["test_*"]
70
+ addopts = "-v --cov=src/ensemble --cov-report=term-missing"
71
+
72
+ [tool.coverage.run]
73
+ source = ["src/ensemble"]
74
+ branch = true
75
+
76
+ [tool.coverage.report]
77
+ exclude_lines = [
78
+ "pragma: no cover",
79
+ "if __name__ == .__main__.:",
80
+ ]
@@ -0,0 +1,5 @@
1
+ """Ensemble AI Orchestration - Multi-agent orchestration for Claude Code."""
2
+
3
+ __version__ = "0.3.0"
4
+ __author__ = "Ensemble Team"
5
+
@@ -0,0 +1,86 @@
1
+ """
2
+ ACK(受領確認)機構
3
+
4
+ タスク配信の確認をファイルベースで行う。
5
+ """
6
+
7
+ from __future__ import annotations
8
+
9
+ import time
10
+ from datetime import datetime
11
+ from pathlib import Path
12
+
13
+ from ensemble.lock import atomic_write
14
+
15
+
16
+ class AckManager:
17
+ """
18
+ ACK管理クラス
19
+
20
+ タスク配信後、エージェントからの受領確認を管理する。
21
+ """
22
+
23
+ def __init__(self, ack_dir: Path | None = None) -> None:
24
+ """
25
+ ACKマネージャを初期化する
26
+
27
+ Args:
28
+ ack_dir: ACKファイル保存ディレクトリ(デフォルト: queue/ack/)
29
+ """
30
+ self.ack_dir = ack_dir if ack_dir else Path("queue/ack")
31
+ self.ack_dir.mkdir(parents=True, exist_ok=True)
32
+
33
+ def send(self, task_id: str, agent: str) -> None:
34
+ """
35
+ ACKを送信する
36
+
37
+ Args:
38
+ task_id: タスクID
39
+ agent: ACKを送信したエージェント名
40
+ """
41
+ ack_file = self.ack_dir / f"{task_id}.ack"
42
+ content = f"{agent}\n{datetime.now().isoformat()}\n"
43
+ atomic_write(str(ack_file), content)
44
+
45
+ def wait(self, task_id: str, timeout: float = 30.0, interval: float = 0.1) -> bool:
46
+ """
47
+ ACKを待機する
48
+
49
+ Args:
50
+ task_id: タスクID
51
+ timeout: タイムアウト秒数
52
+ interval: ポーリング間隔
53
+
54
+ Returns:
55
+ ACK受信時True、タイムアウト時False
56
+ """
57
+ ack_file = self.ack_dir / f"{task_id}.ack"
58
+ elapsed = 0.0
59
+
60
+ while elapsed < timeout:
61
+ if ack_file.exists():
62
+ return True
63
+ time.sleep(interval)
64
+ elapsed += interval
65
+
66
+ return False
67
+
68
+ def check(self, task_id: str) -> bool:
69
+ """
70
+ ACKが存在するか確認する
71
+
72
+ Args:
73
+ task_id: タスクID
74
+
75
+ Returns:
76
+ ACK存在時True
77
+ """
78
+ ack_file = self.ack_dir / f"{task_id}.ack"
79
+ return ack_file.exists()
80
+
81
+ def cleanup(self) -> None:
82
+ """
83
+ 全てのACKファイルを削除する
84
+ """
85
+ for ack_file in self.ack_dir.glob("*.ack"):
86
+ ack_file.unlink()
@@ -0,0 +1,31 @@
1
+ """Ensemble CLI - AI Orchestration Tool for Claude Code."""
2
+
3
+ import click
4
+
5
+ from ensemble import __version__
6
+ from ensemble.commands.init import init
7
+ from ensemble.commands.launch import launch
8
+
9
+
10
+ @click.group()
11
+ @click.version_option(version=__version__, prog_name="ensemble")
12
+ def cli() -> None:
13
+ """Ensemble - AI Orchestration Tool for Claude Code.
14
+
15
+ Ensemble provides multi-agent orchestration for complex development tasks,
16
+ enabling parallel execution, automatic code review, and self-improvement.
17
+ """
18
+ pass
19
+
20
+
21
+ cli.add_command(init)
22
+ cli.add_command(launch)
23
+
24
+
25
+ def main() -> None:
26
+ """Entry point for the CLI."""
27
+ cli()
28
+
29
+
30
+ if __name__ == "__main__":
31
+ main()
@@ -0,0 +1 @@
1
+ """Ensemble CLI commands."""