Skip to content

Commit 0e51dd5

Browse files
derek-palmerclaude
andauthored
feat: multi-agent skill packaging — 30+ agent CLIs via caveman installer pattern (#18)
* feat: multi-agent skill packaging — 12 slash commands + install.sh/ps1 Each forerunner task becomes a native slash command for Claude Code, Codex, and Gemini CLI. Authentication flows through the user's existing agent subscription; no API key required. New skills (skills/ → plugins/codeforerunner/skills/): /forerunner-scan /forerunner-readme /forerunner-api-docs /forerunner-audit /forerunner-changelog /forerunner-check /forerunner-diagrams /forerunner-flows /forerunner-init /forerunner-review /forerunner-stack-docs /forerunner-version-audit New files: install.sh / install.ps1 — detect claude/codex/gemini, install all skills; --dry-run, --only, --list, --uninstall GEMINI.md — Gemini CLI autodiscovery + task table .codex/config.toml — Codex skills integration flag .claude-plugin/marketplace.json — Claude Code marketplace entry installer.py: TASK_SKILL_SLUGS tuple, resolve_skill_target(), install_all_skills(), --all flag on `forerunner install` README: restructured around two modes (agent skill vs direct API), slash-command table, install one-liners, curl|bash instructions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: rewrite installers to match caveman's full agent-matrix pattern Replace the hand-rolled bash/PowerShell installers with a thin Node.js shim model: install.sh and install.ps1 now just exec `node bin/install.js` locally (or `npx github:<repo>` for curl|bash). The real installer lives in bin/install.js and supports 33 agent CLIs with the same detection probes and install mechanisms as caveman: - Full PROVIDERS matrix (33 agents, 4 soft): claude, gemini, opencode, codex, cursor, windsurf, cline, continue, kilo, roo, augment, copilot, aider-desk, amp, bob, crush, devin, droid, forgecode, goose, iflow, kiro, mistral, openhands, qwen, rovodev, tabnine, trae, warp, replit, junie, qoder, antigravity - Detection probes: command:, dir:, file:, macapp:, vscode-ext:, cursor-ext:, jetbrains-plugin: (||‑delimited, bash-3.2 safe) - Install mechanisms: `claude plugin install`, `gemini extensions install`, `npx skills add <repo> -a <profile> --yes --all` - Flags: --dry-run, --force, --only (repeatable), --all, --minimal, --list, --no-color, --skip-skills, --uninstall, -h/--help - Colored summary matching caveman's ✓/–/✗ format - skills-lock.json with SHA-256 hashes for all 13 skill files - bin/package.json { "type": "commonjs" } Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d5cd12c commit 0e51dd5

34 files changed

Lines changed: 1660 additions & 78 deletions

File tree

‎.claude-plugin/marketplace.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3+
"name": "codeforerunner",
4+
"description": "Repo documentation tooling for Claude Code. Adds /forerunner-scan, /forerunner-readme, /forerunner-check, and 9 other documentation slash commands.",
5+
"owner": {
6+
"name": "Derek Palmer",
7+
"url": "https://github.com/derek-palmer"
8+
},
9+
"plugins": [
10+
{
11+
"name": "codeforerunner",
12+
"description": "Model-agnostic repo documentation prompts. Slash commands for scan, readme, api-docs, diagrams, flows, stack-docs, version-audit, check, review, audit, changelog, and agent onboarding.",
13+
"source": "./",
14+
"category": "productivity"
15+
}
16+
]
17+
}

‎.codex/config.toml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# codeforerunner Codex integration
2+
# Skills installed here are available as Codex slash commands.
3+
4+
[features]
5+
skills = true

‎GEMINI.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# codeforerunner — Gemini CLI context
2+
3+
Model-agnostic repository documentation tooling. Ships prompt packs for codebase analysis, doc generation, drift detection, and agent onboarding. Python CLI + MCP server + agent skills.
4+
5+
## Available tasks
6+
7+
Run any task via `forerunner doc <task>`, or use the installed Gemini extension skills:
8+
9+
| Slash command | Task | Description |
10+
|---|---|---|
11+
| `/forerunner-scan` | `scan` | Scan repo; always run first |
12+
| `/forerunner-readme` | `readme` | Generate or refresh README.md |
13+
| `/forerunner-api-docs` | `api-docs` | Generate API reference |
14+
| `/forerunner-diagrams` | `diagrams` | Generate Mermaid architecture diagrams |
15+
| `/forerunner-flows` | `flows` | Document system flows |
16+
| `/forerunner-stack-docs` | `stack-docs` | Stack-specific developer docs |
17+
| `/forerunner-version-audit` | `version-audit` | Audit pinned versions vs EOL |
18+
| `/forerunner-check` | `check` | Check docs for staleness |
19+
| `/forerunner-review` | `review` | Doc-impact summary for PR review |
20+
| `/forerunner-audit` | `audit` | Security and dependency audit |
21+
| `/forerunner-changelog` | `changelog` | Generate changelog entry from git log |
22+
| `/forerunner-init` | `init-agent-onboarding` | Bootstrap or refresh AGENTS.md |
23+
24+
## Workflow
25+
26+
1. Start with `/forerunner-scan` to collect repo evidence.
27+
2. Run the documentation task you need.
28+
3. Use `/forerunner-check` before commits to detect drift.
29+
30+
## CLI quick reference
31+
32+
```bash
33+
forerunner doc <task> # Get composed prompt for a task
34+
forerunner generate <task> # Call configured provider directly
35+
forerunner check # Run drift-detection rules
36+
forerunner doctor # Health report
37+
forerunner install gemini # Install skills to Gemini config dir
38+
```
39+
40+
## Config
41+
42+
Drop a `forerunner.config.yaml` at repo root to enable drift rules. Run `forerunner doctor --fix` to generate a starter config.
43+
44+
## Sources
45+
46+
- Prompts: `src/codeforerunner/prompts/tasks/`
47+
- Skills: `skills/` (source) → `plugins/codeforerunner/skills/` (distribution)
48+
- Repo: https://github.com/derek-palmer/codeforerunner

‎README.md‎

Lines changed: 112 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -2,115 +2,160 @@
22

33
# codeForerunner
44

5-
Model-agnostic repository documentation tooling. Ships a prompt pack for codebase analysis and doc generation, a thin Python CLI, an MCP server, a Codex marketplace plugin, and drift-detection rules that keep docs honest.
5+
Model-agnostic repository documentation tooling. Ships a prompt pack for codebase analysis and doc generation, a thin Python CLI, an MCP server, drift-detection rules that keep docs honest — and native slash-command skills for Claude Code, Codex, Gemini CLI, and other agent CLIs.
66

7-
## Install
7+
## Two modes
8+
9+
### Mode A — Agent skill (recommended, no API key required)
10+
11+
Install forerunner's prompt pack as skills into your agent CLI. Each documentation task becomes a slash command (`/forerunner-readme`, `/forerunner-check`, etc.) available inside Claude Code, Codex, Gemini CLI, and other agents. Authentication is handled by your existing agent subscription — no separate API key needed.
12+
13+
```bash
14+
# From a cloned repo
15+
./install.sh
16+
17+
# One-liner (auto-detects Claude Code, Codex, Gemini CLI)
18+
curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash
19+
20+
# Windows
21+
irm https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.ps1 | iex
22+
23+
# Via forerunner CLI (after pip install)
24+
forerunner install --all claude
25+
forerunner install --all codex
26+
```
27+
28+
Then in your agent:
29+
30+
```
31+
/forerunner-scan ← scan the repo first
32+
/forerunner-readme ← generate README
33+
/forerunner-check ← detect doc drift
34+
```
35+
36+
### Mode B — Direct API (needs API key or Ollama)
37+
38+
Install the Python CLI and call your provider directly. Works without any agent CLI installed.
839

940
```bash
10-
pipx install codeforerunner # recommended — isolated environment
41+
pipx install codeforerunner # recommended
1142
pip install codeforerunner # alternative
1243
```
1344

14-
From source:
45+
Configure a provider (or start Ollama for keyless local generation):
1546

1647
```bash
17-
git clone https://github.com/derek-palmer/codeforerunner
18-
cd codeforerunner
19-
python -m pip install -e .
48+
export ANTHROPIC_API_KEY=sk-...
49+
forerunner generate readme --stream
2050
```
2151

22-
Verify: `forerunner --help`
52+
If no API key and no `--provider` flag, forerunner auto-detects Ollama at `localhost:11434` and falls back to local mode.
53+
54+
## Slash commands
55+
56+
| Command | Task | Purpose |
57+
|---------|------|---------|
58+
| `/forerunner-scan` | `scan` | Collect repo evidence (run first) |
59+
| `/forerunner-readme` | `readme` | Generate or refresh README.md |
60+
| `/forerunner-api-docs` | `api-docs` | Generate API reference docs |
61+
| `/forerunner-diagrams` | `diagrams` | Generate Mermaid architecture diagrams |
62+
| `/forerunner-flows` | `flows` | Document system flows |
63+
| `/forerunner-stack-docs` | `stack-docs` | Stack-specific developer docs |
64+
| `/forerunner-version-audit` | `version-audit` | Audit pinned versions vs EOL |
65+
| `/forerunner-check` | `check` | Check docs for staleness |
66+
| `/forerunner-review` | `review` | Doc-impact summary for PR review |
67+
| `/forerunner-audit` | `audit` | Security and dependency audit |
68+
| `/forerunner-changelog` | `changelog` | Generate changelog from git log |
69+
| `/forerunner-init` | `init-agent-onboarding` | Bootstrap or refresh AGENTS.md |
70+
71+
Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all 12 commands after install.
72+
73+
## Skill install options
74+
75+
| Flag | Effect |
76+
|------|--------|
77+
| `./install.sh` | Auto-detect all agents, install all skills |
78+
| `./install.sh --only claude` | Claude Code only |
79+
| `./install.sh --only codex` | Codex only |
80+
| `./install.sh --only gemini` | Gemini CLI only |
81+
| `./install.sh --dry-run` | Preview, write nothing |
82+
| `./install.sh --list` | Show detected agents + skill list |
83+
| `./install.sh --uninstall` | Remove all installed skills |
2384

2485
## CLI
2586

87+
```bash
88+
pip install codeforerunner
89+
```
90+
2691
| Command | Purpose |
2792
|---------|---------|
28-
| `forerunner init` | Resolve agent-onboarding bundle to stdout (`--full` prepends scan; `--agents-only` is the default scope). |
93+
| `forerunner init` | Resolve agent-onboarding bundle to stdout. |
2994
| `forerunner scan` | Resolve scan bundle to stdout. |
3095
| `forerunner doc <task>` | Resolve `base + partials + task` bundle to stdout. |
31-
| `forerunner check` | Run drift-detection rules; silent no-op without `forerunner.config.yaml`. |
32-
| `forerunner generate <task>` | Resolve bundle for `<task>` and call the configured provider. Add `--stream` to stream output token-by-token. |
33-
| `forerunner doctor` | Single-screen health report: skill parity, marketplace validation, installed destinations, config, provider key. Add `--fix` to write a starter `forerunner.config.yaml` if absent. |
96+
| `forerunner check` | Run drift-detection rules; no-op without `forerunner.config.yaml`. |
97+
| `forerunner generate <task>` | Call configured provider directly. Add `--stream` for token-by-token output. Falls back to Ollama automatically when no API key is configured. |
98+
| `forerunner doctor` | Health report: skill parity, config, provider key, local-mode status. Add `--fix` to write a starter config. |
3499
| `forerunner mcp-server` | Serve prompt bundles as MCP tools over stdio (JSON-RPC 2.0). |
35-
| `forerunner install <agent>` | Idempotently write the canonical skill into agent-specific directories. |
100+
| `forerunner install <agent>` | Install canonical skill into agent-specific directory. Add `--all` for all per-task skills. |
36101

37-
## Prompt Pack
102+
## Prompt pack
38103

39104
Prompts are bundled inside the package at `src/codeforerunner/prompts/`.
40105

41106
```text
42107
prompts/
43-
├── system/
44-
│ └── base.md
108+
├── system/base.md
45109
├── partials/
46110
│ ├── context-format.md
47111
│ ├── output-rules.md
48112
│ └── stack-hints.md
49113
└── tasks/
50-
├── scan.md
51-
├── init-agent-onboarding.md
52-
├── readme.md
53-
├── api-docs.md
54-
├── stack-docs.md
55-
├── diagrams.md
56-
├── flows.md
57-
├── version-audit.md
58-
├── check.md
59-
├── review.md
60-
├── audit.md
61-
└── changelog.md
114+
├── scan.md api-docs.md audit.md
115+
├── readme.md diagrams.md changelog.md
116+
├── check.md flows.md version-audit.md
117+
├── review.md stack-docs.md
118+
└── init-agent-onboarding.md
62119
```
63120

64-
| Task | Purpose |
65-
|------|---------|
66-
| `scan` | Structured repo scan used by downstream tasks. |
67-
| `init-agent-onboarding` | Generates or updates `AGENTS.md` from repo evidence. |
68-
| `readme` | Generates or rewrites a top-level README. |
69-
| `api-docs` | Documents public APIs. |
70-
| `stack-docs` | Documents stack-specific areas. |
71-
| `diagrams` | Generates Mermaid architecture or flow diagrams. |
72-
| `flows` | Documents user, request, job, or data flows. |
73-
| `version-audit` | Audits pinned versions from manifests, lockfiles, workflows, IaC. |
74-
| `check` | Checks existing docs for staleness against a fresh scan. |
75-
| `review` | Summarizes documentation impact for review. |
76-
| `audit` | Security and dependency audit report. |
77-
| `changelog` | Generates a Keep-a-Changelog entry from git log. |
78-
79-
## Quick Start
121+
## Quick start (agent skill mode)
80122

81123
```bash
82-
# 1. Point your agent at the scan prompt
83-
forerunner scan
124+
# Install skills into Claude Code
125+
curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash
84126

85-
# 2. Generate or update docs for a task
86-
export FORERUNNER_SCAN_DONE=1
87-
forerunner doc readme
88-
89-
# 3. Direct model call (needs provider config)
90-
forerunner generate readme --stream
127+
# In Claude Code:
128+
# /forerunner-scan → scans your repo
129+
# /forerunner-readme → generates README.md
130+
# /forerunner-check → checks for doc drift
91131
```
92132

93-
## GitHub Action
133+
## Quick start (direct API mode)
94134

95-
Use forerunner check as a reusable action in any workflow:
135+
```bash
136+
# 1. Install and configure
137+
pip install codeforerunner
138+
export ANTHROPIC_API_KEY=sk-...
96139

97-
```yaml
98-
- uses: derek-palmer/codeforerunner@v0.3.2
140+
# 2. Run a task
141+
forerunner generate readme --stream
142+
143+
# 3. Enable drift detection
144+
forerunner doctor --fix # writes forerunner.config.yaml
145+
forerunner check # run any time or as pre-commit hook
99146
```
100147

101-
With a pinned version:
148+
## GitHub Action
102149

103150
```yaml
104151
- uses: derek-palmer/codeforerunner@v0.3.2
105-
with:
106-
version: '0.3.2'
107152
```
108153
109154
No-op when `forerunner.config.yaml` is absent.
110155

111156
## Configuration
112157

113-
Copy `forerunner.config.yaml.example` to `forerunner.config.yaml` to opt in. Without that file, `forerunner check` is a silent no-op. Generate a starter config with:
158+
Copy `forerunner.config.yaml.example` to `forerunner.config.yaml` to opt in to drift rules. Generate a starter config with:
114159

115160
```bash
116161
forerunner doctor --fix
@@ -122,7 +167,7 @@ forerunner doctor --fix
122167
provider: anthropic # anthropic | openai | google | ollama
123168
model: claude-opus-4-7
124169
api_key_env:
125-
anthropic: ANTHROPIC_API_KEY # override per-provider env var name
170+
anthropic: ANTHROPIC_API_KEY
126171
127172
tasks:
128173
check:
@@ -134,10 +179,10 @@ tasks:
134179
- R5-no-python-package
135180
- R7-no-mcp
136181
- R8-no-marketplace
137-
- RI1-missing-cli # inverse: doc claims CLI but file absent
182+
- RI1-missing-cli
138183
- RI5-missing-python-package
139184
- RI7-missing-mcp
140-
- RV1-version-drift # pinned version in docs ≠ pyproject.toml
185+
- RV1-version-drift
141186
ignore_paths:
142187
- docs/legacy/**/*.md
143188
```
@@ -159,15 +204,15 @@ tasks:
159204
| `RI7-missing-mcp` | Doc references `forerunner mcp-server` but `mcp_server.py` absent |
160205
| `RV1-version-drift` | Doc pins `codeforerunner==X.Y.Z` differing from current version |
161206

162-
### MCP Server
207+
## MCP Server
163208

164209
`forerunner mcp-server` speaks JSON-RPC 2.0 over stdio and exposes one tool per `prompts/tasks/*.md`. A scan-first gate enforces SPEC V2: any tool except `scan` or `init-agent-onboarding` returns an error until `scan` has been called in the same session.
165210

166211
See `examples/mcp/` for Claude Desktop and mcp-cli wiring examples.
167212

168213
## Providers
169214

170-
`forerunner generate` supports four providers. Set the appropriate env var before calling:
215+
`forerunner generate` supports four providers. When no provider is explicitly configured and no API key is found, forerunner probes `localhost:11434` and falls back to Ollama automatically.
171216

172217
| Provider | Env var | Default model |
173218
|----------|---------|---------------|
@@ -176,20 +221,11 @@ See `examples/mcp/` for Claude Desktop and mcp-cli wiring examples.
176221
| `google` | `GOOGLE_API_KEY` | `gemini-2.5-pro` |
177222
| `ollama` | `OLLAMA_HOST` (optional) | `llama3` |
178223

179-
## Codex Plugin
180-
181-
```bash
182-
forerunner install codex --marketplace
183-
```
184-
185-
Installs the Codex marketplace entry and skill. Or install manually:
186-
`forerunner install <agent>` copies the canonical skill into the agent-specific directory.
187-
188-
## Docs and Spec
224+
## Docs and spec
189225

190226
- `SPEC.md` — canonical phase/task tracker
191227
- `docs/getting-started.md` — manual prompt use
192228
- `docs/prompt-guide.md` — how system, partial, and task prompts compose
193229
- `docs/editor-agent-setup.md` — adapting prompts to local agents
194230
- `docs/roadmap.md` — human-readable roadmap
195-
- `docs/agent-distribution-design.md` — design backing Codex/Claude packages
231+
- `docs/agent-distribution-design.md` — packaging and installer design

0 commit comments

Comments
 (0)