tackle-harness 0.0.2
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.
- package/LICENSE +21 -0
- package/README.en.md +259 -0
- package/README.md +261 -0
- package/bin/tackle.js +150 -0
- package/package.json +29 -0
- package/plugins/contracts/plugin-interface.js +244 -0
- package/plugins/core/hook-skill-gate/index.js +437 -0
- package/plugins/core/hook-skill-gate/plugin.json +12 -0
- package/plugins/core/provider-memory-store/index.js +403 -0
- package/plugins/core/provider-memory-store/plugin.json +9 -0
- package/plugins/core/provider-role-registry/index.js +477 -0
- package/plugins/core/provider-role-registry/plugin.json +9 -0
- package/plugins/core/provider-state-store/index.js +244 -0
- package/plugins/core/provider-state-store/plugin.json +9 -0
- package/plugins/core/skill-agent-dispatcher/plugin.json +13 -0
- package/plugins/core/skill-agent-dispatcher/skill.md +912 -0
- package/plugins/core/skill-batch-task-creator/plugin.json +13 -0
- package/plugins/core/skill-batch-task-creator/skill.md +616 -0
- package/plugins/core/skill-checklist/plugin.json +10 -0
- package/plugins/core/skill-checklist/skill.md +115 -0
- package/plugins/core/skill-completion-report/plugin.json +10 -0
- package/plugins/core/skill-completion-report/skill.md +331 -0
- package/plugins/core/skill-experience-logger/plugin.json +10 -0
- package/plugins/core/skill-experience-logger/skill.md +235 -0
- package/plugins/core/skill-human-checkpoint/plugin.json +10 -0
- package/plugins/core/skill-human-checkpoint/skill.md +194 -0
- package/plugins/core/skill-progress-tracker/plugin.json +10 -0
- package/plugins/core/skill-progress-tracker/skill.md +204 -0
- package/plugins/core/skill-role-manager/plugin.json +10 -0
- package/plugins/core/skill-role-manager/skill.md +252 -0
- package/plugins/core/skill-split-work-package/plugin.json +13 -0
- package/plugins/core/skill-split-work-package/skill.md +446 -0
- package/plugins/core/skill-task-creator/plugin.json +13 -0
- package/plugins/core/skill-task-creator/skill.md +744 -0
- package/plugins/core/skill-team-cleanup/plugin.json +10 -0
- package/plugins/core/skill-team-cleanup/skill.md +266 -0
- package/plugins/core/skill-workflow-orchestrator/plugin.json +13 -0
- package/plugins/core/skill-workflow-orchestrator/skill.md +274 -0
- package/plugins/core/validator-doc-sync/index.js +248 -0
- package/plugins/core/validator-doc-sync/plugin.json +9 -0
- package/plugins/core/validator-work-package/index.js +300 -0
- package/plugins/core/validator-work-package/plugin.json +9 -0
- package/plugins/plugin-registry.json +118 -0
- package/plugins/runtime/config-manager.js +306 -0
- package/plugins/runtime/event-bus.js +187 -0
- package/plugins/runtime/harness-build.js +1019 -0
- package/plugins/runtime/logger.js +174 -0
- package/plugins/runtime/plugin-loader.js +339 -0
- package/plugins/runtime/state-store.js +277 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tackle contributors
|
|
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.
|
package/README.en.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
# Tackle Harness
|
|
2
|
+
|
|
3
|
+
> A plugin-based AI Agent workflow framework that provides task management, workflow orchestration, and role management for Claude Code
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/ph419/tackle)
|
|
7
|
+
|
|
8
|
+
**[中文文档](README.md)**
|
|
9
|
+
|
|
10
|
+
## Why Tackle Harness
|
|
11
|
+
|
|
12
|
+
You describe what you need; Tackle Harness manages the entire process:
|
|
13
|
+
|
|
14
|
+
- **Plan first, human approval required** — AI outputs implementation plans and work package breakdowns, then waits for your confirmation before writing any code. No more "AI went rogue and changed a bunch of things."
|
|
15
|
+
- **Complex requirements, parallel delivery** — Large requirements are automatically split into independent modules, with multiple agents working simultaneously. Frontend, backend, and database changes progress in parallel — no serial waiting.
|
|
16
|
+
- **Experience accumulation, gets better over time** — After each task, lessons learned are automatically extracted. Next time a similar issue arises, agents reference historical experience for better decisions.
|
|
17
|
+
|
|
18
|
+
### End-to-End Data Flow
|
|
19
|
+
|
|
20
|
+
User requirements pass through five stages from planning to delivery:
|
|
21
|
+
|
|
22
|
+
```mermaid
|
|
23
|
+
flowchart LR
|
|
24
|
+
REQ["User Requirement<br/>(Natural Language)"]
|
|
25
|
+
P0["P0: Plan<br/>task-creator / split-wp"]
|
|
26
|
+
P1["P1: Review<br/>human-checkpoint"]
|
|
27
|
+
P2["P2: Execute<br/>agent-dispatcher"]
|
|
28
|
+
P3["P3: Verify<br/>checklist / experience-logger"]
|
|
29
|
+
P4["P4: Report<br/>completion-report"]
|
|
30
|
+
|
|
31
|
+
O1["docs/wp/*.md<br/>task.md updated"]
|
|
32
|
+
O2["User Approval<br/>(Human Intervention)"]
|
|
33
|
+
O3["Agent Teams<br/>(Multi-agent Parallel)"]
|
|
34
|
+
O4["Completion Report<br/>Experience Logged"]
|
|
35
|
+
|
|
36
|
+
REQ --> P0 --> P1 --> P2 --> P3 --> P4
|
|
37
|
+
|
|
38
|
+
P0 -.-> O1
|
|
39
|
+
P1 -.-> O2
|
|
40
|
+
P2 -.-> O3
|
|
41
|
+
P3 -.-> O4
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Installation
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm install tackle-harness
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Navigate to your project directory
|
|
54
|
+
cd your-project
|
|
55
|
+
|
|
56
|
+
# One-command initialization (build skills + register hooks + create config directories)
|
|
57
|
+
npx tackle-harness init
|
|
58
|
+
|
|
59
|
+
# Or step by step
|
|
60
|
+
npx tackle-harness build # Build skills to .claude/skills/, merge hooks into settings.json
|
|
61
|
+
npx tackle-harness validate # Validate plugin integrity
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Use Cases
|
|
65
|
+
|
|
66
|
+
### Case 1: New Feature Development
|
|
67
|
+
|
|
68
|
+
**Your situation**: Adding a "Team Collaboration" module to a SaaS product, involving frontend UI, backend API, and database changes.
|
|
69
|
+
|
|
70
|
+
**Just say**:
|
|
71
|
+
```
|
|
72
|
+
Start workflow, implement team collaboration module, including:
|
|
73
|
+
- Team creation and management pages
|
|
74
|
+
- Member invitation and permission APIs
|
|
75
|
+
- Database table design
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**What Tackle Harness does**:
|
|
79
|
+
1. Analyzes requirement complexity, splits into 4 work packages (frontend, backend, database, integration testing)
|
|
80
|
+
2. Outputs implementation plans for each work package, pauses for your review
|
|
81
|
+
3. After your approval, dispatches multiple agents to develop modules in parallel
|
|
82
|
+
4. Automatically runs code checks and test verification
|
|
83
|
+
5. Generates a completion report and asks for next steps
|
|
84
|
+
|
|
85
|
+
**Skills involved**: workflow-orchestrator → split-work-package → human-checkpoint → agent-dispatcher → checklist → completion-report
|
|
86
|
+
|
|
87
|
+
### Case 2: Batch Bug Fixes
|
|
88
|
+
|
|
89
|
+
**Your situation**: A backlog of 5 bugs before the sprint ends, want to handle them in parallel and wrap up quickly.
|
|
90
|
+
|
|
91
|
+
**Just say**:
|
|
92
|
+
```
|
|
93
|
+
Batch execute WP-015 through WP-019, fix these 5 bugs in parallel
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**What Tackle Harness does**:
|
|
97
|
+
1. Analyzes dependencies between the 5 bugs (check for overlapping file changes)
|
|
98
|
+
2. Assigns conflict-free bugs to different agents for simultaneous fixes
|
|
99
|
+
3. Queues dependent bugs sequentially, auto-starting the next after each completes
|
|
100
|
+
4. Runs a checklist after all fixes to confirm no new issues introduced
|
|
101
|
+
|
|
102
|
+
**Skills involved**: agent-dispatcher → checklist → completion-report
|
|
103
|
+
|
|
104
|
+
### Case 3: System Refactoring
|
|
105
|
+
|
|
106
|
+
**Your situation**: Need to refactor a monolithic application into microservices, involving coordinated changes across multiple modules, worried about breaking things.
|
|
107
|
+
|
|
108
|
+
**Just say**:
|
|
109
|
+
```
|
|
110
|
+
Split work package, extract the user module from the monolith into an independent service
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**What Tackle Harness does**:
|
|
114
|
+
1. Deep analysis of code structure, identifies all modules and dependencies that need changes
|
|
115
|
+
2. Generates a detailed refactoring plan (interface extraction, data migration, routing adjustments, etc.)
|
|
116
|
+
3. Pauses for your review of the architecture proposal (critical decision point)
|
|
117
|
+
4. Executes refactoring in dependency-ordered batches, auto-verifying after each batch
|
|
118
|
+
5. Records refactoring experience for future similar extraction tasks
|
|
119
|
+
|
|
120
|
+
**Skills involved**: split-work-package → human-checkpoint → agent-dispatcher → checklist → experience-logger → completion-report
|
|
121
|
+
|
|
122
|
+
## Command Reference
|
|
123
|
+
|
|
124
|
+
| Command | Description |
|
|
125
|
+
|---------|-------------|
|
|
126
|
+
| `npx tackle-harness` | Default: runs build |
|
|
127
|
+
| `npx tackle-harness build` | Build all skills, update .claude/settings.json |
|
|
128
|
+
| `npx tackle-harness validate` | Validate plugin format |
|
|
129
|
+
| `npx tackle-harness init` | First-time setup: build + create .claude/ directories |
|
|
130
|
+
| `npx tackle-harness --root <path>` | Specify target project path (default: current directory) |
|
|
131
|
+
| `npx tackle-harness --help` | Show help |
|
|
132
|
+
|
|
133
|
+
## Skills Reference
|
|
134
|
+
|
|
135
|
+
| Skill | Trigger (CN / EN) | Function |
|
|
136
|
+
|-------|---------|----------|
|
|
137
|
+
| task-creator | "创建任务" / "create task" | Create a single task in the task list |
|
|
138
|
+
| batch-task-creator | "批量创建任务" / "batch create tasks" | Batch create multiple tasks |
|
|
139
|
+
| split-work-package | "拆分工作包" / "split work package" | Split requirements into executable work packages |
|
|
140
|
+
| progress-tracker | "记录进度" / "record progress" | Track and report work progress |
|
|
141
|
+
| team-cleanup | "清理团队" / "cleanup team" | Release residual team resources |
|
|
142
|
+
| human-checkpoint | "等待审核" / "wait for review" | Pause and request human confirmation |
|
|
143
|
+
| role-manager | "查看角色" / "view roles" | Manage project role definitions |
|
|
144
|
+
| checklist | "运行检查" / "run checklist" | Execute checklists |
|
|
145
|
+
| completion-report | "完成报告" / "completion report" | Generate completion report |
|
|
146
|
+
| experience-logger | "总结经验" / "log experience" | Record project lessons learned |
|
|
147
|
+
| agent-dispatcher | "批量执行" / "dispatch agents" | Dispatch multiple sub-agents in parallel |
|
|
148
|
+
| workflow-orchestrator | "开始工作流" / "start workflow" | Orchestrate complete workflows |
|
|
149
|
+
|
|
150
|
+
## Workflow Overview
|
|
151
|
+
|
|
152
|
+
User requirements pass through 5 stages from planning to delivery:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
Requirement → Plan(P0) → Review(P1) → Execute(P2) → Verify(P3) → Report(P4) → Delivery
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
| Stage | What Happens | Key Skills |
|
|
159
|
+
|-------|-------------|------------|
|
|
160
|
+
| **P0 Plan** | Parse requirements, split into work packages, write docs | task-creator, split-work-package |
|
|
161
|
+
| **P1 Review** | Pause for your plan approval (mandatory human intervention) | human-checkpoint |
|
|
162
|
+
| **P2 Execute** | Multi-agent parallel development, scheduled by dependencies | agent-dispatcher |
|
|
163
|
+
| **P3 Verify** | Code/test/doc quality verification, extract experience | checklist, experience-logger |
|
|
164
|
+
| **P4 Report** | Generate completion report, ask for next steps | completion-report |
|
|
165
|
+
|
|
166
|
+
> For the full data flow diagram and stage details, see [docs/ai_workflow.md](docs/ai_workflow.md)
|
|
167
|
+
|
|
168
|
+
## Plugin Architecture
|
|
169
|
+
|
|
170
|
+
Tackle Harness contains 4 plugin types, 18 plugins total:
|
|
171
|
+
|
|
172
|
+
| Type | Count | Purpose |
|
|
173
|
+
|------|-------|---------|
|
|
174
|
+
| Skill | 12 | Executable skills, directly callable by Claude Code |
|
|
175
|
+
| Provider | 3 | State store, role registry, memory store |
|
|
176
|
+
| Hook | 1 | Skill gate, intercepts edit operations and skill calls |
|
|
177
|
+
| Validator | 2 | Document sync validation, work package validation |
|
|
178
|
+
|
|
179
|
+
> For plugin dependency graph and development guide, see [docs/plugin-development.md](docs/plugin-development.md)
|
|
180
|
+
|
|
181
|
+
## Build Output Structure
|
|
182
|
+
|
|
183
|
+
After running `tackle-harness build`, the following is generated in your project:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
your-project/
|
|
187
|
+
.claude/
|
|
188
|
+
skills/ # 12 skills
|
|
189
|
+
skill-task-creator/skill.md
|
|
190
|
+
skill-batch-task-creator/skill.md
|
|
191
|
+
skill-split-work-package/skill.md
|
|
192
|
+
skill-progress-tracker/skill.md
|
|
193
|
+
skill-team-cleanup/skill.md
|
|
194
|
+
skill-human-checkpoint/skill.md
|
|
195
|
+
skill-role-manager/skill.md
|
|
196
|
+
skill-checklist/skill.md
|
|
197
|
+
skill-completion-report/skill.md
|
|
198
|
+
skill-experience-logger/skill.md
|
|
199
|
+
skill-agent-dispatcher/skill.md
|
|
200
|
+
skill-workflow-orchestrator/skill.md
|
|
201
|
+
settings.json # Auto-registered hooks
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
## FAQ
|
|
205
|
+
|
|
206
|
+
### Skills not working after installation?
|
|
207
|
+
|
|
208
|
+
Make sure you ran `npx tackle-harness build` in your project root, and that `.claude/skills/` contains 12 skill folders.
|
|
209
|
+
|
|
210
|
+
### Can multiple projects share an installation?
|
|
211
|
+
|
|
212
|
+
Each project installs and builds independently. Different projects can use different versions.
|
|
213
|
+
|
|
214
|
+
### Global installation
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npm install -g tackle-harness
|
|
218
|
+
tackle-harness build
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
After global installation, use the `tackle-harness` command directly without `npx`.
|
|
222
|
+
|
|
223
|
+
### How to uninstall?
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
npm uninstall tackle-harness
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Skill files remain in `.claude/skills/`. Delete manually if needed.
|
|
230
|
+
|
|
231
|
+
### What are the hooks in settings.json?
|
|
232
|
+
|
|
233
|
+
`tackle-harness build` automatically injects two hooks into `.claude/settings.json`:
|
|
234
|
+
- `PreToolUse(Edit|Write)` — Blocks file edits under certain states
|
|
235
|
+
- `PostToolUse(Skill)` — Updates state after skill calls
|
|
236
|
+
|
|
237
|
+
These hooks point to scripts in `node_modules/tackle-harness/` and won't affect other configurations in your project. Existing settings.json content is preserved; only tackle-harness-related hooks are appended.
|
|
238
|
+
|
|
239
|
+
## Documentation
|
|
240
|
+
|
|
241
|
+
- [Configuration Reference](docs/config-reference.md) - Complete configuration file documentation
|
|
242
|
+
- [Best Practices](docs/best-practices.md) - Usage tips and optimization techniques
|
|
243
|
+
- [Plugin Development](docs/plugin-development.md) - Plugin architecture and development guide
|
|
244
|
+
- [Workflow Details](docs/ai_workflow.md) - Full workflow data flow and stage descriptions
|
|
245
|
+
|
|
246
|
+
## Contributing
|
|
247
|
+
|
|
248
|
+
Contributions welcome! We accept bug reports, feature suggestions, code submissions, and documentation improvements. See [Contributing Guide](CONTRIBUTING.md).
|
|
249
|
+
|
|
250
|
+
Quick start: Fork → Create branch → Make changes → Submit PR. Follow [Conventional Commits](https://www.conventionalcommits.org/) format.
|
|
251
|
+
|
|
252
|
+
## License
|
|
253
|
+
|
|
254
|
+
MIT License - See [LICENSE](LICENSE) file
|
|
255
|
+
|
|
256
|
+
## Acknowledgments
|
|
257
|
+
|
|
258
|
+
This project draws on excellent designs from the following open-source projects:
|
|
259
|
+
- DeerFlow - Memory extraction and middleware architecture
|
package/README.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# Tackle Harness
|
|
2
|
+
|
|
3
|
+
> 基于插件的 AI Agent 工作流框架,为 Claude Code 提供任务管理、工作流编排、角色管理等能力
|
|
4
|
+
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/ph419/tackle)
|
|
7
|
+
|
|
8
|
+
**[English](README.en.md)**
|
|
9
|
+
|
|
10
|
+
## 为什么选择 Tackle Harness
|
|
11
|
+
|
|
12
|
+
你告诉 AI 需求,Tackle Harness 帮你管好整个流程:
|
|
13
|
+
|
|
14
|
+
- **方案先行,人工把关** — AI 先输出实施方案和工作包拆分,等你确认后才动手写代码。不会出现「AI 自作主张改了一堆东西」的情况。
|
|
15
|
+
- **复杂需求,并行交付** — 大需求自动拆成多个独立模块,调度多个 Agent 同时工作。前后端、数据库变更同步推进,不用串行等待。
|
|
16
|
+
- **经验沉淀,越用越好** — 每次任务完成后自动提炼经验教训。下次遇到类似问题时,Agent 会参考历史经验做出更好的决策。
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### 端到端数据流
|
|
21
|
+
|
|
22
|
+
用户需求经五个阶段完成从规划到交付的完整生命周期:
|
|
23
|
+
|
|
24
|
+
```mermaid
|
|
25
|
+
flowchart LR
|
|
26
|
+
REQ["用户需求<br/>(自然语言)"]
|
|
27
|
+
P0["P0: 规划<br/>task-creator / split-wp"]
|
|
28
|
+
P1["P1: 审核<br/>human-checkpoint"]
|
|
29
|
+
P2["P2: 执行<br/>agent-dispatcher"]
|
|
30
|
+
P3["P3: 检查<br/>checklist / experience-logger"]
|
|
31
|
+
P4["P4: 汇报<br/>completion-report"]
|
|
32
|
+
|
|
33
|
+
O1["docs/wp/*.md<br/>task.md 更新"]
|
|
34
|
+
O2["用户确认/修改<br/>(人工介入)"]
|
|
35
|
+
O3["Agent Teams<br/>(多代理并行)"]
|
|
36
|
+
O4["完成报告<br/>经验沉淀"]
|
|
37
|
+
|
|
38
|
+
REQ --> P0 --> P1 --> P2 --> P3 --> P4
|
|
39
|
+
|
|
40
|
+
P0 -.-> O1
|
|
41
|
+
P1 -.-> O2
|
|
42
|
+
P2 -.-> O3
|
|
43
|
+
P3 -.-> O4
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 安装
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install tackle-harness
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 快速开始
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# 进入你的项目目录
|
|
56
|
+
cd your-project
|
|
57
|
+
|
|
58
|
+
# 一键初始化(构建技能 + 注册钩子 + 创建配置目录)
|
|
59
|
+
npx tackle-harness init
|
|
60
|
+
|
|
61
|
+
# 或者分步执行
|
|
62
|
+
npx tackle-harness build # 构建技能到 .claude/skills/,合并 hooks 到 settings.json
|
|
63
|
+
npx tackle-harness validate # 验证插件完整性
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 使用场景
|
|
67
|
+
|
|
68
|
+
### 场景一:新功能开发
|
|
69
|
+
|
|
70
|
+
**你的情况**:需要为 SaaS 产品添加「团队协作」模块,涉及前端界面、后端 API 和数据库变更。
|
|
71
|
+
|
|
72
|
+
**你只需要说**:
|
|
73
|
+
```
|
|
74
|
+
开始工作流,实现团队协作模块,包括:
|
|
75
|
+
- 团队创建和管理页面
|
|
76
|
+
- 成员邀请和权限 API
|
|
77
|
+
- 数据库表设计
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
**Tackle Harness 会做什么**:
|
|
81
|
+
1. 分析需求复杂度,拆分为 4 个工作包(前端、后端、数据库、集成测试)
|
|
82
|
+
2. 输出每个工作包的实施方案,暂停等你审核
|
|
83
|
+
3. 你确认后,调度多个 Agent 并行开发各模块
|
|
84
|
+
4. 自动执行代码检查和测试验证
|
|
85
|
+
5. 生成完成报告,询问你下一步
|
|
86
|
+
|
|
87
|
+
**涉及技能**:workflow-orchestrator → split-work-package → human-checkpoint → agent-dispatcher → checklist → completion-report
|
|
88
|
+
|
|
89
|
+
### 场景二:Bug 批量修复
|
|
90
|
+
|
|
91
|
+
**你的情况**:Sprint 结束前积压了 5 个 Bug,希望能并行处理尽快收尾。
|
|
92
|
+
|
|
93
|
+
**你只需要说**:
|
|
94
|
+
```
|
|
95
|
+
批量执行 WP-015 到 WP-019,并行修复这 5 个 Bug
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Tackle Harness 会做什么**:
|
|
99
|
+
1. 分析 5 个 Bug 之间的依赖关系(有没有改动同一文件)
|
|
100
|
+
2. 无冲突的 Bug 分配给不同 Agent 同时修复
|
|
101
|
+
3. 有依赖的 Bug 按顺序排队,前一个完成后自动启动下一个
|
|
102
|
+
4. 全部修复后运行检查清单,确认没有引入新问题
|
|
103
|
+
|
|
104
|
+
**涉及技能**:agent-dispatcher → checklist → completion-report
|
|
105
|
+
|
|
106
|
+
### 场景三:系统重构
|
|
107
|
+
|
|
108
|
+
**你的情况**:需要将单体应用拆分为微服务架构,涉及多个模块的协调改动,担心改出问题。
|
|
109
|
+
|
|
110
|
+
**你只需要说**:
|
|
111
|
+
```
|
|
112
|
+
拆分工作包,将用户模块从单体应用中拆分为独立服务
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Tackle Harness 会做什么**:
|
|
116
|
+
1. 深入分析代码结构,识别所有需要改动的模块和依赖关系
|
|
117
|
+
2. 生成详细的重构计划(接口抽取、数据迁移、路由调整等)
|
|
118
|
+
3. 暂停等你审核架构方案(这是关键决策点)
|
|
119
|
+
4. 按依赖顺序分批执行重构,每批完成后自动验证
|
|
120
|
+
5. 记录重构经验,下次类似的拆分任务可以直接参考
|
|
121
|
+
|
|
122
|
+
**涉及技能**:split-work-package → human-checkpoint → agent-dispatcher → checklist → experience-logger → completion-report
|
|
123
|
+
|
|
124
|
+
## 命令一览
|
|
125
|
+
|
|
126
|
+
| 命令 | 说明 |
|
|
127
|
+
|------|------|
|
|
128
|
+
| `npx tackle-harness` | 默认执行 build |
|
|
129
|
+
| `npx tackle-harness build` | 构建所有技能,更新 .claude/settings.json |
|
|
130
|
+
| `npx tackle-harness validate` | 验证插件格式是否正确 |
|
|
131
|
+
| `npx tackle-harness init` | 首次安装:build + 创建 .claude/ 目录 |
|
|
132
|
+
| `npx tackle-harness --root <path>` | 指定目标项目路径(默认为当前目录) |
|
|
133
|
+
| `npx tackle-harness --help` | 查看帮助信息 |
|
|
134
|
+
|
|
135
|
+
## 技能清单
|
|
136
|
+
|
|
137
|
+
| 技能 | 触发方式 | 功能 |
|
|
138
|
+
|------|----------|------|
|
|
139
|
+
| task-creator | "创建任务" / "create task" | 创建单个任务到任务列表 |
|
|
140
|
+
| batch-task-creator | "批量创建任务" / "batch create tasks" | 批量创建多个任务 |
|
|
141
|
+
| split-work-package | "拆分工作包" / "split work package" | 将需求拆分为可执行的工作包 |
|
|
142
|
+
| progress-tracker | "记录进度" / "record progress" | 追踪和汇报工作进度 |
|
|
143
|
+
| team-cleanup | "清理团队" / "cleanup team" | 释放残留的团队资源 |
|
|
144
|
+
| human-checkpoint | "等待审核" / "wait for review" | 暂停并请求人工确认 |
|
|
145
|
+
| role-manager | "查看角色" / "view roles" | 管理项目角色定义 |
|
|
146
|
+
| checklist | "运行检查" / "run checklist" | 执行检查清单 |
|
|
147
|
+
| completion-report | "完成报告" / "completion report" | 生成完成报告 |
|
|
148
|
+
| experience-logger | "总结经验" / "log experience" | 记录项目经验教训 |
|
|
149
|
+
| agent-dispatcher | "批量执行" / "dispatch agents" | 调度多个子代理并行工作 |
|
|
150
|
+
| workflow-orchestrator | "开始工作流" / "start workflow" | 编排完整工作流 |
|
|
151
|
+
|
|
152
|
+
## 工作流概览
|
|
153
|
+
|
|
154
|
+
用户需求经过 5 个阶段完成从规划到交付:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
需求 → 规划(P0) → 审核(P1) → 执行(P2) → 检查(P3) → 汇报(P4) → 交付
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
| 阶段 | 做什么 | 关键技能 |
|
|
161
|
+
|------|--------|----------|
|
|
162
|
+
| **P0 规划** | 解析需求,拆分为工作包,写入文档 | task-creator, split-work-package |
|
|
163
|
+
| **P1 审核** | 暂停等待你确认方案(强制人工介入) | human-checkpoint |
|
|
164
|
+
| **P2 执行** | 多 Agent 并行开发,按依赖调度 | agent-dispatcher |
|
|
165
|
+
| **P3 检查** | 代码/测试/文档质量验证,提炼经验 | checklist, experience-logger |
|
|
166
|
+
| **P4 汇报** | 生成完成报告,询问下一步 | completion-report |
|
|
167
|
+
|
|
168
|
+
> 完整的数据流图和阶段细节请参阅 [docs/ai_workflow.md](docs/ai_workflow.md)
|
|
169
|
+
|
|
170
|
+
## 插件架构
|
|
171
|
+
|
|
172
|
+
Tackle Harness 包含四类插件,共 18 个:
|
|
173
|
+
|
|
174
|
+
| 类型 | 数量 | 作用 |
|
|
175
|
+
|------|------|------|
|
|
176
|
+
| Skill | 12 | 可执行技能,Claude Code 直接调用 |
|
|
177
|
+
| Provider | 3 | 状态存储、角色注册、记忆存储 |
|
|
178
|
+
| Hook | 1 | 技能门控,拦截编辑操作和技能调用 |
|
|
179
|
+
| Validator | 2 | 文档同步验证、工作包验证 |
|
|
180
|
+
|
|
181
|
+
> 插件依赖关系和开发指南请参阅 [docs/plugin-development.md](docs/plugin-development.md)
|
|
182
|
+
|
|
183
|
+
## 构建后的项目结构
|
|
184
|
+
|
|
185
|
+
执行 `tackle-harness build` 后,你的项目中会生成以下内容:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
your-project/
|
|
189
|
+
.claude/
|
|
190
|
+
skills/ # 12 个技能
|
|
191
|
+
skill-task-creator/skill.md
|
|
192
|
+
skill-batch-task-creator/skill.md
|
|
193
|
+
skill-split-work-package/skill.md
|
|
194
|
+
skill-progress-tracker/skill.md
|
|
195
|
+
skill-team-cleanup/skill.md
|
|
196
|
+
skill-human-checkpoint/skill.md
|
|
197
|
+
skill-role-manager/skill.md
|
|
198
|
+
skill-checklist/skill.md
|
|
199
|
+
skill-completion-report/skill.md
|
|
200
|
+
skill-experience-logger/skill.md
|
|
201
|
+
skill-agent-dispatcher/skill.md
|
|
202
|
+
skill-workflow-orchestrator/skill.md
|
|
203
|
+
settings.json # 自动注册的 hooks
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
## 常见问题
|
|
207
|
+
|
|
208
|
+
### 安装后技能没有生效?
|
|
209
|
+
|
|
210
|
+
确保在项目根目录执行了 `npx tackle-harness build`,并且 `.claude/skills/` 目录下有 12 个技能文件夹。
|
|
211
|
+
|
|
212
|
+
### 多个项目能否共用?
|
|
213
|
+
|
|
214
|
+
每个项目独立安装、独立构建。不同项目可以安装不同版本。
|
|
215
|
+
|
|
216
|
+
### 全局安装
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
npm install -g tackle-harness
|
|
220
|
+
tackle-harness build
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
全局安装后直接使用 `tackle-harness` 命令,无需 `npx`。
|
|
224
|
+
|
|
225
|
+
### 如何卸载?
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
npm uninstall tackle-harness
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
技能文件会保留在 `.claude/skills/` 中,如需清理请手动删除。
|
|
232
|
+
|
|
233
|
+
### settings.json 中的 hooks 是什么?
|
|
234
|
+
|
|
235
|
+
`tackle-harness build` 会自动向 `.claude/settings.json` 注入两个 hook:
|
|
236
|
+
- `PreToolUse(Edit|Write)` — 在特定状态下阻止文件编辑
|
|
237
|
+
- `PostToolUse(Skill)` — 技能调用后更新状态
|
|
238
|
+
|
|
239
|
+
这些 hook 指向 `node_modules/tackle-harness/` 中的脚本,不会影响你项目中的其他配置。已有的 settings.json 内容会被保留,仅追加 tackle-harness 相关的 hooks。
|
|
240
|
+
|
|
241
|
+
## 文档
|
|
242
|
+
|
|
243
|
+
- [配置参考](docs/config-reference.md) - 完整的配置文件说明
|
|
244
|
+
- [最佳实践](docs/best-practices.md) - 使用建议和优化技巧
|
|
245
|
+
- [插件开发](docs/plugin-development.md) - 插件架构和开发指南
|
|
246
|
+
- [工作流详解](docs/ai_workflow.md) - 完整的工作流数据流和阶段说明
|
|
247
|
+
|
|
248
|
+
## 贡献
|
|
249
|
+
|
|
250
|
+
欢迎贡献!我们接受 Bug 报告、功能建议、代码提交和文档改进。详见 [贡献指南](CONTRIBUTING.md)。
|
|
251
|
+
|
|
252
|
+
快速上手:Fork → 创建分支 → 修改 → 提交 PR。Commit 遵循 [Conventional Commits](https://www.conventionalcommits.org/) 格式。
|
|
253
|
+
|
|
254
|
+
## 许可证
|
|
255
|
+
|
|
256
|
+
MIT License - 详见 [LICENSE](LICENSE) 文件
|
|
257
|
+
|
|
258
|
+
## 致谢
|
|
259
|
+
|
|
260
|
+
本项目借鉴了以下开源项目的优秀设计:
|
|
261
|
+
- DeerFlow - 记忆提取和中间件架构
|
package/bin/tackle.js
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* tackle-harness - CLI entry point for the AI Agent Harness framework
|
|
4
|
+
*
|
|
5
|
+
* Usage:
|
|
6
|
+
* tackle-harness Build all plugins into .claude/skills/ and update settings.json
|
|
7
|
+
* tackle-harness build Same as above (default command)
|
|
8
|
+
* tackle-harness validate Validate plugin.json files without building
|
|
9
|
+
* tackle-harness init First-time setup: build + generate default config
|
|
10
|
+
* tackle-harness --help Show usage info
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
'use strict';
|
|
14
|
+
|
|
15
|
+
var path = require('path');
|
|
16
|
+
var fs = require('fs');
|
|
17
|
+
var HarnessBuild = require('../plugins/runtime/harness-build');
|
|
18
|
+
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
// Path resolution
|
|
21
|
+
// ---------------------------------------------------------------------------
|
|
22
|
+
|
|
23
|
+
/** Root directory of this npm package (where plugins/ lives) */
|
|
24
|
+
var packageRoot = path.resolve(__dirname, '..');
|
|
25
|
+
|
|
26
|
+
/** Target project root directory (where output goes) */
|
|
27
|
+
var targetRoot = process.cwd();
|
|
28
|
+
|
|
29
|
+
// ---------------------------------------------------------------------------
|
|
30
|
+
// CLI arg parsing
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
var args = process.argv.slice(2);
|
|
34
|
+
var command = args[0] || 'build';
|
|
35
|
+
var flags = {
|
|
36
|
+
root: null,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
for (var i = 0; i < args.length; i++) {
|
|
40
|
+
if (args[i] === '--root' && args[i + 1]) {
|
|
41
|
+
flags.root = args[++i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Override target root if --root flag provided
|
|
46
|
+
if (flags.root) {
|
|
47
|
+
targetRoot = path.resolve(flags.root);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Subcommand aliases
|
|
51
|
+
if (command === '--validate') command = 'validate';
|
|
52
|
+
if (command === '--help' || command === '-h') command = 'help';
|
|
53
|
+
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
// Helper: create builder instance with correct paths
|
|
56
|
+
// ---------------------------------------------------------------------------
|
|
57
|
+
|
|
58
|
+
function createBuilder() {
|
|
59
|
+
return new HarnessBuild({
|
|
60
|
+
rootDir: targetRoot,
|
|
61
|
+
registryPath: path.join(packageRoot, 'plugins', 'plugin-registry.json'),
|
|
62
|
+
pluginsDir: path.join(packageRoot, 'plugins', 'core'),
|
|
63
|
+
outputSkillsDir: path.join(targetRoot, '.claude', 'skills'),
|
|
64
|
+
outputHooksDir: path.join(targetRoot, '.claude', 'hooks'),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
// Commands
|
|
70
|
+
// ---------------------------------------------------------------------------
|
|
71
|
+
|
|
72
|
+
function cmdBuild() {
|
|
73
|
+
var builder = createBuilder();
|
|
74
|
+
var result = builder.build();
|
|
75
|
+
|
|
76
|
+
if (result.success) {
|
|
77
|
+
builder.updateSettings(targetRoot, packageRoot);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
console.log(result.summary);
|
|
81
|
+
|
|
82
|
+
if (result.success) {
|
|
83
|
+
console.log('[tackle-harness] Settings updated: .claude/settings.json');
|
|
84
|
+
console.log('[tackle-harness] Done! Skills are ready to use.');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
process.exit(result.success ? 0 : 1);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function cmdValidate() {
|
|
91
|
+
var builder = createBuilder();
|
|
92
|
+
var result = builder.validate();
|
|
93
|
+
console.log(result.summary);
|
|
94
|
+
process.exit(result.valid ? 0 : 1);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function cmdInit() {
|
|
98
|
+
console.log('[tackle-harness] Initializing...');
|
|
99
|
+
console.log('[tackle-harness] Target project: ' + targetRoot);
|
|
100
|
+
console.log('[tackle-harness] Package root: ' + packageRoot);
|
|
101
|
+
console.log('');
|
|
102
|
+
|
|
103
|
+
// 1. Ensure .claude/ directory exists
|
|
104
|
+
var claudeDir = path.join(targetRoot, '.claude');
|
|
105
|
+
if (!fs.existsSync(claudeDir)) {
|
|
106
|
+
fs.mkdirSync(claudeDir, { recursive: true });
|
|
107
|
+
console.log('[tackle-harness] Created .claude/ directory');
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// 2. Run build
|
|
111
|
+
cmdBuild();
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function cmdHelp() {
|
|
115
|
+
console.log('tackle-harness - Plugin-based AI Agent Harness for Claude Code');
|
|
116
|
+
console.log('');
|
|
117
|
+
console.log('Usage:');
|
|
118
|
+
console.log(' tackle-harness Build all plugins (default)');
|
|
119
|
+
console.log(' tackle-harness build Build all plugins');
|
|
120
|
+
console.log(' tackle-harness validate Validate plugin.json files');
|
|
121
|
+
console.log(' tackle-harness init First-time setup (build + config)');
|
|
122
|
+
console.log('');
|
|
123
|
+
console.log('Options:');
|
|
124
|
+
console.log(' --root <path> Specify target project root (default: cwd)');
|
|
125
|
+
console.log(' --help, -h Show this help message');
|
|
126
|
+
console.log('');
|
|
127
|
+
console.log('After running tackle-harness build, skills are available in .claude/skills/');
|
|
128
|
+
console.log('and hooks are registered in .claude/settings.json');
|
|
129
|
+
process.exit(0);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// Dispatch
|
|
134
|
+
// ---------------------------------------------------------------------------
|
|
135
|
+
|
|
136
|
+
switch (command) {
|
|
137
|
+
case 'build':
|
|
138
|
+
cmdBuild();
|
|
139
|
+
break;
|
|
140
|
+
case 'validate':
|
|
141
|
+
cmdValidate();
|
|
142
|
+
break;
|
|
143
|
+
case 'init':
|
|
144
|
+
cmdInit();
|
|
145
|
+
break;
|
|
146
|
+
case 'help':
|
|
147
|
+
default:
|
|
148
|
+
cmdHelp();
|
|
149
|
+
break;
|
|
150
|
+
}
|