clade-mcp 0.1.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.
- clade_mcp-0.1.0/.gitignore +9 -0
- clade_mcp-0.1.0/PKG-INFO +134 -0
- clade_mcp-0.1.0/README.md +110 -0
- clade_mcp-0.1.0/pyproject.toml +44 -0
- clade_mcp-0.1.0/server.json +22 -0
- clade_mcp-0.1.0/skills/audit/SKILL.md +6 -0
- clade_mcp-0.1.0/skills/audit/prompt.md +129 -0
- clade_mcp-0.1.0/skills/batch-tasks/SKILL.md +55 -0
- clade_mcp-0.1.0/skills/batch-tasks/prompt.md +417 -0
- clade_mcp-0.1.0/skills/brief/SKILL.md +20 -0
- clade_mcp-0.1.0/skills/brief/prompt.md +30 -0
- clade_mcp-0.1.0/skills/commit/SKILL.md +28 -0
- clade_mcp-0.1.0/skills/commit/prompt.md +277 -0
- clade_mcp-0.1.0/skills/cso/SKILL.md +7 -0
- clade_mcp-0.1.0/skills/cso/prompt.md +197 -0
- clade_mcp-0.1.0/skills/document-release/SKILL.md +7 -0
- clade_mcp-0.1.0/skills/document-release/prompt.md +165 -0
- clade_mcp-0.1.0/skills/frontend-design/SKILL.md +18 -0
- clade_mcp-0.1.0/skills/frontend-design/prompt.md +109 -0
- clade_mcp-0.1.0/skills/handoff/SKILL.md +81 -0
- clade_mcp-0.1.0/skills/handoff/prompt.md +114 -0
- clade_mcp-0.1.0/skills/incident/SKILL.md +7 -0
- clade_mcp-0.1.0/skills/incident/prompt.md +106 -0
- clade_mcp-0.1.0/skills/investigate/SKILL.md +7 -0
- clade_mcp-0.1.0/skills/investigate/prompt.md +171 -0
- clade_mcp-0.1.0/skills/loop/SKILL.md +72 -0
- clade_mcp-0.1.0/skills/loop/prompt.md +281 -0
- clade_mcp-0.1.0/skills/map/SKILL.md +6 -0
- clade_mcp-0.1.0/skills/map/prompt.md +118 -0
- clade_mcp-0.1.0/skills/merge-pr/SKILL.md +19 -0
- clade_mcp-0.1.0/skills/merge-pr/prompt.md +74 -0
- clade_mcp-0.1.0/skills/minimax-usage/SKILL.md +24 -0
- clade_mcp-0.1.0/skills/minimax-usage/prompt.md +23 -0
- clade_mcp-0.1.0/skills/model-research/SKILL.md +25 -0
- clade_mcp-0.1.0/skills/model-research/prompt.md +165 -0
- clade_mcp-0.1.0/skills/next/SKILL.md +6 -0
- clade_mcp-0.1.0/skills/next/prompt.md +186 -0
- clade_mcp-0.1.0/skills/orchestrate/SKILL.md +18 -0
- clade_mcp-0.1.0/skills/orchestrate/prompt.md +252 -0
- clade_mcp-0.1.0/skills/pickup/SKILL.md +6 -0
- clade_mcp-0.1.0/skills/pickup/prompt.md +70 -0
- clade_mcp-0.1.0/skills/pipeline/SKILL.md +26 -0
- clade_mcp-0.1.0/skills/pipeline/prompt.md +133 -0
- clade_mcp-0.1.0/skills/provider/SKILL.md +7 -0
- clade_mcp-0.1.0/skills/provider/prompt.md +81 -0
- clade_mcp-0.1.0/skills/research/SKILL.md +6 -0
- clade_mcp-0.1.0/skills/research/prompt.md +43 -0
- clade_mcp-0.1.0/skills/retro/SKILL.md +7 -0
- clade_mcp-0.1.0/skills/retro/prompt.md +216 -0
- clade_mcp-0.1.0/skills/review/SKILL.md +12 -0
- clade_mcp-0.1.0/skills/review/prompt.md +214 -0
- clade_mcp-0.1.0/skills/review-pr/SKILL.md +19 -0
- clade_mcp-0.1.0/skills/review-pr/prompt.md +89 -0
- clade_mcp-0.1.0/skills/slt/SKILL.md +24 -0
- clade_mcp-0.1.0/skills/slt/prompt.md +24 -0
- clade_mcp-0.1.0/skills/start/SKILL.md +41 -0
- clade_mcp-0.1.0/skills/start/morning-brief.md +33 -0
- clade_mcp-0.1.0/skills/start/prompt.md +63 -0
- clade_mcp-0.1.0/skills/sync/SKILL.md +25 -0
- clade_mcp-0.1.0/skills/sync/prompt.md +150 -0
- clade_mcp-0.1.0/skills/verify/SKILL.md +10 -0
- clade_mcp-0.1.0/skills/verify/prompt.md +254 -0
- clade_mcp-0.1.0/skills/worktree/SKILL.md +42 -0
- clade_mcp-0.1.0/skills/worktree/prompt.md +190 -0
- clade_mcp-0.1.0/src/clade_mcp/__init__.py +14 -0
- clade_mcp-0.1.0/src/clade_mcp/__main__.py +5 -0
- clade_mcp-0.1.0/src/clade_mcp/server.py +332 -0
clade_mcp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: clade-mcp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: MCP server exposing 29 AI coding skills — autonomous commits, loops, reviews, incident response, and more
|
|
5
|
+
Project-URL: Homepage, https://github.com/shenxingy/clade
|
|
6
|
+
Project-URL: Repository, https://github.com/shenxingy/clade
|
|
7
|
+
Project-URL: Issues, https://github.com/shenxingy/clade/issues
|
|
8
|
+
Author-email: Xingy Shen <shenxingy@users.noreply.github.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Keywords: ai,automation,claude,claude-code,coding,mcp,skills
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
20
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Requires-Dist: mcp>=1.0.0
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# clade-mcp
|
|
26
|
+
|
|
27
|
+
MCP server that exposes **29 AI coding skills** as callable tools — autonomous commits, goal-driven loops, code reviews, incident response, security audits, and more.
|
|
28
|
+
|
|
29
|
+
Part of the [Clade](https://github.com/shenxingy/clade) autonomous coding framework.
|
|
30
|
+
|
|
31
|
+
## Quick Start
|
|
32
|
+
|
|
33
|
+
### With Claude Desktop / Claude Code
|
|
34
|
+
|
|
35
|
+
Add to your MCP configuration:
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"clade": {
|
|
41
|
+
"command": "uvx",
|
|
42
|
+
"args": ["clade-mcp"]
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### With Cursor / Windsurf / other MCP clients
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
{
|
|
52
|
+
"mcpServers": {
|
|
53
|
+
"clade": {
|
|
54
|
+
"command": "clade-mcp"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Install manually
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install clade-mcp
|
|
64
|
+
clade-mcp # starts the MCP server (stdio transport)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Prerequisites
|
|
68
|
+
|
|
69
|
+
- **Python 3.10+**
|
|
70
|
+
- **Claude Code CLI** installed and in PATH ([install guide](https://docs.anthropic.com/en/docs/claude-code))
|
|
71
|
+
- Skills execute via `claude -p`, so the CLI must be available
|
|
72
|
+
|
|
73
|
+
## Available Skills (29)
|
|
74
|
+
|
|
75
|
+
| Skill | Description |
|
|
76
|
+
|-------|-------------|
|
|
77
|
+
| **commit** | Analyze changes, split into logical commits by module, push |
|
|
78
|
+
| **loop** | Goal-driven autonomous improvement loop (Blueprint architecture) |
|
|
79
|
+
| **review** | Coverage-driven review — test all VERIFY.md checkpoints |
|
|
80
|
+
| **review-pr** | AI-powered PR code review with structured feedback |
|
|
81
|
+
| **investigate** | Root cause analysis — no fix without confirmed hypothesis |
|
|
82
|
+
| **incident** | Incident response — diagnose, postmortem, follow-up tasks |
|
|
83
|
+
| **cso** | Security audit (OWASP + STRIDE) |
|
|
84
|
+
| **map** | Generate ARCHITECTURE.md with Mermaid diagrams |
|
|
85
|
+
| **research** | Deep research on a topic with web search |
|
|
86
|
+
| **batch-tasks** | Execute TODO steps via unattended sessions |
|
|
87
|
+
| **handoff** | Save session state for context relay between agents |
|
|
88
|
+
| **pickup** | Resume from a previous handoff |
|
|
89
|
+
| **start** | Autonomous session launcher |
|
|
90
|
+
| **verify** | Verify project behavior anchors (compile, test, lint) |
|
|
91
|
+
| **sync** | End-of-session doc sync (TODO.md, PROGRESS.md) |
|
|
92
|
+
| **document-release** | Post-ship documentation sync |
|
|
93
|
+
| **brief** | Morning briefing — overnight activity, costs, next steps |
|
|
94
|
+
| **retro** | Engineering retrospective from git history |
|
|
95
|
+
| **next** | Multi-angle "what's next?" priority session |
|
|
96
|
+
| **orchestrate** | Decompose goals into tasks for worker execution |
|
|
97
|
+
| **frontend-design** | Create production-grade frontend interfaces |
|
|
98
|
+
| **audit** | Audit correction rules for promotion/cleanup |
|
|
99
|
+
| **merge-pr** | Squash-merge PR and clean up branch |
|
|
100
|
+
| **worktree** | Create git worktrees for parallel sessions |
|
|
101
|
+
| **pipeline** | Check health of background pipelines |
|
|
102
|
+
| **provider** | Switch LLM provider |
|
|
103
|
+
| **slt** | Toggle statusline display mode |
|
|
104
|
+
| **model-research** | Research latest Claude models |
|
|
105
|
+
| **minimax-usage** | Check API usage quota |
|
|
106
|
+
|
|
107
|
+
## How It Works
|
|
108
|
+
|
|
109
|
+
1. On startup, the server loads all bundled skill definitions
|
|
110
|
+
2. Each skill is registered as an MCP tool with auto-generated JSON Schema
|
|
111
|
+
3. When a tool is called, the skill prompt is executed via `claude -p` in your project directory
|
|
112
|
+
4. Results are returned through the MCP protocol
|
|
113
|
+
|
|
114
|
+
Skills from `~/.claude/skills/` (installed via Clade's `install.sh`) are also loaded and merged.
|
|
115
|
+
|
|
116
|
+
## Full Clade Framework
|
|
117
|
+
|
|
118
|
+
This MCP server is one part of Clade. The full framework includes:
|
|
119
|
+
|
|
120
|
+
- **22 hooks** — safety guardian, correction learning, type-checking, session context
|
|
121
|
+
- **30 scripts** — committer, loop-runner, parallel task execution, health scanning
|
|
122
|
+
- **5 agents** — code-reviewer, test-runner, type-checker, paper-reviewer, verify-app
|
|
123
|
+
- **Orchestrator** — FastAPI web UI with task queue, worker pool, GitHub sync
|
|
124
|
+
|
|
125
|
+
Install the full framework:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
git clone https://github.com/shenxingy/clade.git
|
|
129
|
+
cd clade && ./install.sh
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# clade-mcp
|
|
2
|
+
|
|
3
|
+
MCP server that exposes **29 AI coding skills** as callable tools — autonomous commits, goal-driven loops, code reviews, incident response, security audits, and more.
|
|
4
|
+
|
|
5
|
+
Part of the [Clade](https://github.com/shenxingy/clade) autonomous coding framework.
|
|
6
|
+
|
|
7
|
+
## Quick Start
|
|
8
|
+
|
|
9
|
+
### With Claude Desktop / Claude Code
|
|
10
|
+
|
|
11
|
+
Add to your MCP configuration:
|
|
12
|
+
|
|
13
|
+
```json
|
|
14
|
+
{
|
|
15
|
+
"mcpServers": {
|
|
16
|
+
"clade": {
|
|
17
|
+
"command": "uvx",
|
|
18
|
+
"args": ["clade-mcp"]
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### With Cursor / Windsurf / other MCP clients
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcpServers": {
|
|
29
|
+
"clade": {
|
|
30
|
+
"command": "clade-mcp"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Install manually
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pip install clade-mcp
|
|
40
|
+
clade-mcp # starts the MCP server (stdio transport)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Prerequisites
|
|
44
|
+
|
|
45
|
+
- **Python 3.10+**
|
|
46
|
+
- **Claude Code CLI** installed and in PATH ([install guide](https://docs.anthropic.com/en/docs/claude-code))
|
|
47
|
+
- Skills execute via `claude -p`, so the CLI must be available
|
|
48
|
+
|
|
49
|
+
## Available Skills (29)
|
|
50
|
+
|
|
51
|
+
| Skill | Description |
|
|
52
|
+
|-------|-------------|
|
|
53
|
+
| **commit** | Analyze changes, split into logical commits by module, push |
|
|
54
|
+
| **loop** | Goal-driven autonomous improvement loop (Blueprint architecture) |
|
|
55
|
+
| **review** | Coverage-driven review — test all VERIFY.md checkpoints |
|
|
56
|
+
| **review-pr** | AI-powered PR code review with structured feedback |
|
|
57
|
+
| **investigate** | Root cause analysis — no fix without confirmed hypothesis |
|
|
58
|
+
| **incident** | Incident response — diagnose, postmortem, follow-up tasks |
|
|
59
|
+
| **cso** | Security audit (OWASP + STRIDE) |
|
|
60
|
+
| **map** | Generate ARCHITECTURE.md with Mermaid diagrams |
|
|
61
|
+
| **research** | Deep research on a topic with web search |
|
|
62
|
+
| **batch-tasks** | Execute TODO steps via unattended sessions |
|
|
63
|
+
| **handoff** | Save session state for context relay between agents |
|
|
64
|
+
| **pickup** | Resume from a previous handoff |
|
|
65
|
+
| **start** | Autonomous session launcher |
|
|
66
|
+
| **verify** | Verify project behavior anchors (compile, test, lint) |
|
|
67
|
+
| **sync** | End-of-session doc sync (TODO.md, PROGRESS.md) |
|
|
68
|
+
| **document-release** | Post-ship documentation sync |
|
|
69
|
+
| **brief** | Morning briefing — overnight activity, costs, next steps |
|
|
70
|
+
| **retro** | Engineering retrospective from git history |
|
|
71
|
+
| **next** | Multi-angle "what's next?" priority session |
|
|
72
|
+
| **orchestrate** | Decompose goals into tasks for worker execution |
|
|
73
|
+
| **frontend-design** | Create production-grade frontend interfaces |
|
|
74
|
+
| **audit** | Audit correction rules for promotion/cleanup |
|
|
75
|
+
| **merge-pr** | Squash-merge PR and clean up branch |
|
|
76
|
+
| **worktree** | Create git worktrees for parallel sessions |
|
|
77
|
+
| **pipeline** | Check health of background pipelines |
|
|
78
|
+
| **provider** | Switch LLM provider |
|
|
79
|
+
| **slt** | Toggle statusline display mode |
|
|
80
|
+
| **model-research** | Research latest Claude models |
|
|
81
|
+
| **minimax-usage** | Check API usage quota |
|
|
82
|
+
|
|
83
|
+
## How It Works
|
|
84
|
+
|
|
85
|
+
1. On startup, the server loads all bundled skill definitions
|
|
86
|
+
2. Each skill is registered as an MCP tool with auto-generated JSON Schema
|
|
87
|
+
3. When a tool is called, the skill prompt is executed via `claude -p` in your project directory
|
|
88
|
+
4. Results are returned through the MCP protocol
|
|
89
|
+
|
|
90
|
+
Skills from `~/.claude/skills/` (installed via Clade's `install.sh`) are also loaded and merged.
|
|
91
|
+
|
|
92
|
+
## Full Clade Framework
|
|
93
|
+
|
|
94
|
+
This MCP server is one part of Clade. The full framework includes:
|
|
95
|
+
|
|
96
|
+
- **22 hooks** — safety guardian, correction learning, type-checking, session context
|
|
97
|
+
- **30 scripts** — committer, loop-runner, parallel task execution, health scanning
|
|
98
|
+
- **5 agents** — code-reviewer, test-runner, type-checker, paper-reviewer, verify-app
|
|
99
|
+
- **Orchestrator** — FastAPI web UI with task queue, worker pool, GitHub sync
|
|
100
|
+
|
|
101
|
+
Install the full framework:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
git clone https://github.com/shenxingy/clade.git
|
|
105
|
+
cd clade && ./install.sh
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## License
|
|
109
|
+
|
|
110
|
+
MIT
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "clade-mcp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "MCP server exposing 29 AI coding skills — autonomous commits, loops, reviews, incident response, and more"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Xingy Shen", email = "shenxingy@users.noreply.github.com" },
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "claude", "ai", "coding", "skills", "automation", "claude-code"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
26
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
27
|
+
]
|
|
28
|
+
dependencies = [
|
|
29
|
+
"mcp>=1.0.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.urls]
|
|
33
|
+
Homepage = "https://github.com/shenxingy/clade"
|
|
34
|
+
Repository = "https://github.com/shenxingy/clade"
|
|
35
|
+
Issues = "https://github.com/shenxingy/clade/issues"
|
|
36
|
+
|
|
37
|
+
[project.scripts]
|
|
38
|
+
clade-mcp = "clade_mcp:main"
|
|
39
|
+
|
|
40
|
+
[tool.hatch.build.targets.wheel]
|
|
41
|
+
packages = ["src/clade_mcp"]
|
|
42
|
+
|
|
43
|
+
[tool.hatch.build.targets.wheel.force-include]
|
|
44
|
+
"skills" = "clade_mcp/skills"
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.shenxingy/clade",
|
|
4
|
+
"description": "29 AI coding skills as MCP tools — autonomous commits, goal-driven loops, code reviews, incident response, security audits, architecture mapping, and more. Part of the Clade autonomous coding framework.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"url": "https://github.com/shenxingy/clade",
|
|
7
|
+
"source": "github"
|
|
8
|
+
},
|
|
9
|
+
"version": "0.1.0",
|
|
10
|
+
"packages": [
|
|
11
|
+
{
|
|
12
|
+
"registryType": "pypi",
|
|
13
|
+
"identifier": "clade-mcp",
|
|
14
|
+
"version": "0.1.0",
|
|
15
|
+
"transport": {
|
|
16
|
+
"type": "stdio"
|
|
17
|
+
},
|
|
18
|
+
"runtime": "python",
|
|
19
|
+
"runtimeArgs": ["-m", "clade_mcp"]
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: audit
|
|
3
|
+
description: Audit corrections/rules.md — find rules that should be promoted to CLAUDE.md/hooks, redundant rules, or contradictions. Run periodically to keep the learning system clean.
|
|
4
|
+
when_to_use: "audit corrections, review rules, promote rules, correction rules"
|
|
5
|
+
user_invocable: true
|
|
6
|
+
---
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
You are the Audit skill. You review the corrections/rules.md learning system, show improvement trends, and auto-promote mature rules.
|
|
2
|
+
|
|
3
|
+
## Scope Detection
|
|
4
|
+
|
|
5
|
+
First, determine the audit scope:
|
|
6
|
+
|
|
7
|
+
- **Project mode** (default): If `.claude/corrections/rules.md` exists in the current project directory, use it. Promote mature rules to the project's `CLAUDE.md`.
|
|
8
|
+
- **Global mode**: If the user passed `global` as an argument, OR if no project-local rules.md exists, use `~/.claude/corrections/rules.md` and promote to `~/.claude/CLAUDE.md`.
|
|
9
|
+
|
|
10
|
+
All path references below use `RULES_FILE` and `CLAUDE_TARGET` as placeholders for the resolved paths.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
### Step 0: Show improvement trends
|
|
15
|
+
|
|
16
|
+
Read `~/.claude/corrections/scorecards.jsonl` (if it exists). Compute weekly averages for the last 4 weeks:
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
Weekly Trend:
|
|
20
|
+
Corrections/session: 2.1 → 1.8 → 1.5 → 1.2 ↓ improving
|
|
21
|
+
Score: 0.72 → 0.75 → 0.80 → 0.83 ↑ improving
|
|
22
|
+
Sessions tracked: 12
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
If scorecards.jsonl doesn't exist or has <4 entries, show "Not enough data for trends yet." and continue.
|
|
26
|
+
|
|
27
|
+
### Step 1: Read context
|
|
28
|
+
|
|
29
|
+
1. Read `RULES_FILE` — the learned rules for this scope
|
|
30
|
+
2. Read `CLAUDE_TARGET` — the config that rules will be promoted into
|
|
31
|
+
3. Read `~/.claude/hooks/` script names and their purposes (from comments)
|
|
32
|
+
|
|
33
|
+
### Step 2: Cluster similar rules
|
|
34
|
+
|
|
35
|
+
Before classifying, group rules by domain. If 3+ rules share the same domain tag (e.g., `css`, `shell`, `async`), suggest a generalized principle that replaces the individual rules.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
Cluster: "css" (3 rules)
|
|
39
|
+
Suggested generalization: "CSS overflow properties clip absolutely-positioned children.
|
|
40
|
+
Never use overflow-hidden/auto on containers with popovers, dropdowns, or portals."
|
|
41
|
+
→ Replaces rules from [2026-02-25] css, [2026-02-25] overflow-portal, [2026-02-25] ui-visibility
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Step 3: Classify each rule
|
|
45
|
+
|
|
46
|
+
For each rule in RULES_FILE:
|
|
47
|
+
|
|
48
|
+
#### PROMOTE — Rule is stable and should become a permanent config
|
|
49
|
+
- The rule has been in rules.md for 14+ days without being contradicted
|
|
50
|
+
- It describes a general pattern (not a one-off fix)
|
|
51
|
+
- If a cluster generalization exists, promote the generalization instead of individual rules
|
|
52
|
+
|
|
53
|
+
#### REDUNDANT — Rule duplicates existing config
|
|
54
|
+
- The rule says the same thing as something already in CLAUDE_TARGET or a hook
|
|
55
|
+
|
|
56
|
+
#### CONTRADICT — Rule conflicts with existing config
|
|
57
|
+
- The rule says to do X, but CLAUDE_TARGET or a hook says to do Y
|
|
58
|
+
- Action: Flag for human decision
|
|
59
|
+
|
|
60
|
+
#### KEEP — Rule is still relevant and not yet ready to promote
|
|
61
|
+
- Recent rule (< 14 days) or context-specific
|
|
62
|
+
|
|
63
|
+
### Step 4: Execute promotions
|
|
64
|
+
|
|
65
|
+
For PROMOTE rules, **automatically**:
|
|
66
|
+
1. Append the rule text to the appropriate section in `CLAUDE_TARGET`, tagged with `[auto-promoted YYYY-MM-DD]`
|
|
67
|
+
- CSS/UI rules → under "# Coding Standards" or "# Full Stack Specific"
|
|
68
|
+
- Shell/deploy rules → under "# Agent Ground Rules"
|
|
69
|
+
- Workflow rules → under "# Workflow Preferences"
|
|
70
|
+
2. Remove the promoted rule(s) from `RULES_FILE`
|
|
71
|
+
|
|
72
|
+
For REDUNDANT rules, **automatically**:
|
|
73
|
+
1. Remove from `RULES_FILE`
|
|
74
|
+
|
|
75
|
+
For CONTRADICT rules:
|
|
76
|
+
1. Show both the rule and the conflicting config
|
|
77
|
+
2. Ask the user which to keep
|
|
78
|
+
|
|
79
|
+
### Step 5: Update audit timestamp
|
|
80
|
+
|
|
81
|
+
Touch the `.last-audit` file in the same directory as `RULES_FILE`. For example, if `RULES_FILE` is `.claude/corrections/rules.md`, run:
|
|
82
|
+
```bash
|
|
83
|
+
touch .claude/corrections/.last-audit
|
|
84
|
+
```
|
|
85
|
+
If `RULES_FILE` is `~/.claude/corrections/rules.md`, run:
|
|
86
|
+
```bash
|
|
87
|
+
touch ~/.claude/corrections/.last-audit
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### Step 6: Show summary
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
Audit Results [scope: project | global]:
|
|
94
|
+
Trends: Score 0.72 → 0.83 over 4 weeks (↑ improving)
|
|
95
|
+
|
|
96
|
+
PROMOTE (2):
|
|
97
|
+
- [2026-02-10] shell: Cross-platform stat → Added to CLAUDE.md "Agent Ground Rules"
|
|
98
|
+
- Cluster "css" (3 rules) → Generalized and added to "Full Stack Specific"
|
|
99
|
+
|
|
100
|
+
REDUNDANT (1):
|
|
101
|
+
- [2026-02-15] git: Use committer script → Already in CLAUDE.md
|
|
102
|
+
|
|
103
|
+
CONTRADICT (0): (none)
|
|
104
|
+
|
|
105
|
+
KEEP (3):
|
|
106
|
+
- [2026-02-22] frontend: Prefer server components → Too recent
|
|
107
|
+
|
|
108
|
+
Rules: 10 → 6 (promoted 2, removed 1 redundant, 1 cluster generalized)
|
|
109
|
+
Next audit nudge: 7 days from now
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Rules
|
|
113
|
+
|
|
114
|
+
- Always execute promotions and removals automatically — don't just suggest
|
|
115
|
+
- If CLAUDE_TARGET doesn't have a matching section, append to the end under a new `## Auto-Promoted Rules` section
|
|
116
|
+
- Project-mode rules.md: keep under 100 lines; global rules.md: keep under 50 lines — if over, remove oldest KEEP rules first
|
|
117
|
+
- Touch .last-audit even if no changes were made
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Completion Status
|
|
123
|
+
|
|
124
|
+
- ✅ **DONE** — task completed successfully
|
|
125
|
+
- ⚠ **DONE_WITH_CONCERNS** — completed but with caveats to note
|
|
126
|
+
- ❌ **BLOCKED** — cannot proceed; write details to `.claude/blockers.md`
|
|
127
|
+
- ❓ **NEEDS_CONTEXT** — missing information; use AskUserQuestion
|
|
128
|
+
|
|
129
|
+
**3-strike rule:** If the same approach fails 3 times, switch to BLOCKED — do not retry indefinitely.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: batch-tasks
|
|
3
|
+
description: Execute TODO.md steps via unattended Claude Code sessions
|
|
4
|
+
when_to_use: "run tasks, execute TODO, batch execute, 批量执行, run steps"
|
|
5
|
+
argument-hint: '[step2 step4 ...] | "task1" "task2" ... | --run [file] | --dry-run [file] | --parallel [file]'
|
|
6
|
+
user_invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Batch Tasks Skill
|
|
10
|
+
|
|
11
|
+
Read steps from TODO.md, auto-plan implementation details, and run them sequentially (or in parallel) via `claude -p`. Each task runs in a fresh Claude Code session with pre-generated plans.
|
|
12
|
+
|
|
13
|
+
## Key features
|
|
14
|
+
|
|
15
|
+
- **TODO.md integration** — Reads project TODO.md, parses steps and unchecked items. Default: first uncompleted step. Specify steps: `/batch-tasks step2 step4`.
|
|
16
|
+
- **Auto-planning** — Before writing tasks, the skill researches relevant files in the current session (which has codebase context) and generates detailed implementation plans with file paths, line numbers, and patterns to follow. This dramatically reduces token waste from redundant exploration in `claude -p` sessions.
|
|
17
|
+
- **Scout scoring** — Each task is scored (0-100) before execution. Tasks scoring <50 are skipped and a GitHub Issue is created instead. Tasks 50-79 are flagged as risky.
|
|
18
|
+
- **Per-task model assignment** — Each task is automatically assigned `haiku` (simple deletions, <20 lines), `sonnet` (standard features, 2-4 files), or `opus` (architectural, 5+ files) based on complexity.
|
|
19
|
+
- **Per-task timeout & retries** — Each task has a configurable timeout (default 10 min) and retry count (default 2). Timed-out or failed tasks are rolled back via git and retried automatically.
|
|
20
|
+
- **Failure resilience** — Failed tasks don't kill the batch. After all retries are exhausted, failures are logged to PROGRESS.md and a GitHub Issue is created automatically.
|
|
21
|
+
- **Parallel execution** — `--parallel` flag runs independent tasks concurrently using git worktrees, with automatic conflict detection and merge.
|
|
22
|
+
- **Background execution** with live progress monitoring
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Execute TODO steps (primary usage)
|
|
27
|
+
```
|
|
28
|
+
/batch-tasks # First uncompleted step from TODO.md
|
|
29
|
+
/batch-tasks step2 # Execute Step 2
|
|
30
|
+
/batch-tasks step2 step4 # Execute Steps 2 and 4
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Run from quoted task descriptions
|
|
34
|
+
```
|
|
35
|
+
/batch-tasks "Fix sidebar padding" "Add loading skeleton to /projects"
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Run / preview an existing task file
|
|
39
|
+
```
|
|
40
|
+
/batch-tasks --run # Serial execution
|
|
41
|
+
/batch-tasks --parallel # Parallel execution (git worktrees)
|
|
42
|
+
/batch-tasks --dry-run
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## How it works
|
|
46
|
+
|
|
47
|
+
1. **Parse TODO.md** — Finds the target step(s), extracts unchecked `- [ ]` items
|
|
48
|
+
2. **Planning phase** — For each item, searches the codebase (Glob/Grep), reads relevant files, and generates a detailed plan with exact file paths, line numbers, and implementation steps
|
|
49
|
+
3. **Scout scoring** — Each task is scored on readiness (target files found, patterns clear, no blocking deps). Tasks scoring <50 are skipped.
|
|
50
|
+
4. **Model assignment** — Each task gets assigned `haiku`, `sonnet`, or `opus` based on complexity
|
|
51
|
+
5. Tasks are written to `tasks.txt` in delimited block format
|
|
52
|
+
6. `~/.claude/scripts/run-tasks.sh` (serial) or `~/.claude/scripts/run-tasks-parallel.sh` (parallel) executes tasks
|
|
53
|
+
7. Each task runs with a timeout; on failure, working tree is rolled back and the task is retried
|
|
54
|
+
8. Logs go to `logs/claude-tasks/` with timestamps (per attempt)
|
|
55
|
+
9. After all tasks complete: success/failure summary, failures logged to PROGRESS.md + GitHub Issue
|