codeforerunner 0.4.2__tar.gz → 0.4.4__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.
- {codeforerunner-0.4.2/src/codeforerunner.egg-info → codeforerunner-0.4.4}/PKG-INFO +57 -77
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/README.md +56 -76
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/pyproject.toml +7 -1
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/__init__.py +3 -1
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/bundle.py +1 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/check.py +9 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/cli.py +20 -91
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/config.py +22 -40
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/doctor.py +14 -95
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/installer.py +14 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/mcp_server.py +8 -1
- codeforerunner-0.4.4/src/codeforerunner/prompts/tasks/refresh.md +23 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4/src/codeforerunner.egg-info}/PKG-INFO +57 -77
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner.egg-info/SOURCES.txt +2 -7
- codeforerunner-0.4.4/tests/test_bundle.py +64 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_check.py +63 -0
- codeforerunner-0.4.4/tests/test_cli.py +249 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_config.py +38 -28
- codeforerunner-0.4.4/tests/test_doctor.py +286 -0
- codeforerunner-0.4.4/tests/test_installer.py +564 -0
- codeforerunner-0.4.4/tests/test_mcp_server.py +431 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_workflows_yaml.py +44 -0
- codeforerunner-0.4.2/src/codeforerunner/providers/__init__.py +0 -37
- codeforerunner-0.4.2/src/codeforerunner/providers/anthropic.py +0 -118
- codeforerunner-0.4.2/src/codeforerunner/providers/base.py +0 -39
- codeforerunner-0.4.2/src/codeforerunner/providers/google.py +0 -114
- codeforerunner-0.4.2/src/codeforerunner/providers/ollama.py +0 -135
- codeforerunner-0.4.2/src/codeforerunner/providers/openai.py +0 -113
- codeforerunner-0.4.2/tests/test_cli.py +0 -528
- codeforerunner-0.4.2/tests/test_doctor.py +0 -219
- codeforerunner-0.4.2/tests/test_installer.py +0 -229
- codeforerunner-0.4.2/tests/test_mcp_server.py +0 -220
- codeforerunner-0.4.2/tests/test_providers.py +0 -530
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/LICENSE.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/setup.cfg +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/partials/context-format.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/partials/output-rules.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/partials/stack-hints.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/system/base.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/api-docs.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/audit.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/changelog.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/check.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/diagrams.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/flows.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/init-agent-onboarding.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/readme.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/review.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/scan.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/stack-docs.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner/prompts/tasks/version-audit.md +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner.egg-info/dependency_links.txt +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner.egg-info/entry_points.txt +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner.egg-info/requires.txt +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/src/codeforerunner.egg-info/top_level.txt +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_check_config_integration.py +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_examples.py +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_hooks_manifest.py +0 -0
- {codeforerunner-0.4.2 → codeforerunner-0.4.4}/tests/test_validate_codex_marketplace.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeforerunner
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.4
|
|
4
4
|
Summary: Model-agnostic repository documentation tooling (prompt-first; thin CLI).
|
|
5
5
|
Author: Derek Palmer
|
|
6
6
|
License-Expression: LicenseRef-Codeforerunner-SAL-0.1
|
|
@@ -29,11 +29,11 @@ Dynamic: license-file
|
|
|
29
29
|
|
|
30
30
|
# codeForerunner
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
[](https://badge.socket.dev/npm/package/codeforerunner/0.4.3)
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
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.
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
## Install
|
|
37
37
|
|
|
38
38
|
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.
|
|
39
39
|
|
|
@@ -58,26 +58,9 @@ Then in your agent:
|
|
|
58
58
|
/forerunner-scan ← scan the repo first
|
|
59
59
|
/forerunner-readme ← generate README
|
|
60
60
|
/forerunner-check ← detect doc drift
|
|
61
|
+
/forerunner-refresh ← scan + update all stale docs
|
|
61
62
|
```
|
|
62
63
|
|
|
63
|
-
### Mode B — Direct API (needs API key or Ollama)
|
|
64
|
-
|
|
65
|
-
Install the Python CLI and call your provider directly. Works without any agent CLI installed.
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
pipx install codeforerunner # recommended
|
|
69
|
-
pip install codeforerunner # alternative
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Configure a provider (or start Ollama for keyless local generation):
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
export ANTHROPIC_API_KEY=sk-...
|
|
76
|
-
forerunner generate readme --stream
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
If no API key and no `--provider` flag, forerunner auto-detects Ollama at `localhost:11434` and falls back to local mode.
|
|
80
|
-
|
|
81
64
|
## Slash commands
|
|
82
65
|
|
|
83
66
|
| Command | Task | Purpose |
|
|
@@ -94,14 +77,17 @@ If no API key and no `--provider` flag, forerunner auto-detects Ollama at `local
|
|
|
94
77
|
| `/forerunner-audit` | `audit` | Security and dependency audit |
|
|
95
78
|
| `/forerunner-changelog` | `changelog` | Generate changelog from git log |
|
|
96
79
|
| `/forerunner-init` | `init-agent-onboarding` | Bootstrap or refresh AGENTS.md |
|
|
80
|
+
| `/forerunner-refresh` | `refresh` | Scan + check + update all stale docs in one pass |
|
|
97
81
|
|
|
98
|
-
Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all
|
|
82
|
+
Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all commands after install.
|
|
99
83
|
|
|
100
84
|
## Skill install options
|
|
101
85
|
|
|
102
86
|
| Flag | Effect |
|
|
103
87
|
|------|--------|
|
|
104
|
-
| `./install.sh` | Auto-detect all agents, install all skills |
|
|
88
|
+
| `./install.sh` | Auto-detect all agents, prompt global vs local, install all skills |
|
|
89
|
+
| `./install.sh --global` | Skip prompt, install to global agent dirs (all projects) |
|
|
90
|
+
| `./install.sh --local` | Skip prompt, install to `.claude/skills/` and `.agents/skills/` in cwd |
|
|
105
91
|
| `./install.sh --only claude` | Claude Code only |
|
|
106
92
|
| `./install.sh --only codex` | Codex only |
|
|
107
93
|
| `./install.sh --only gemini` | Gemini CLI only |
|
|
@@ -120,65 +106,54 @@ pip install codeforerunner
|
|
|
120
106
|
| `forerunner init` | Resolve agent-onboarding bundle to stdout. |
|
|
121
107
|
| `forerunner scan` | Resolve scan bundle to stdout. |
|
|
122
108
|
| `forerunner doc <task>` | Resolve `base + partials + task` bundle to stdout. |
|
|
109
|
+
| `forerunner refresh` | Output scan + check + all doc-task bundles in sequence for a full doc refresh. |
|
|
123
110
|
| `forerunner check` | Run drift-detection rules; no-op without `forerunner.config.yaml`. |
|
|
124
|
-
| `forerunner
|
|
125
|
-
| `forerunner doctor` | Health report: skill parity, config, provider key, local-mode status. Add `--fix` to write a starter config. |
|
|
111
|
+
| `forerunner doctor` | Health report: skill parity, config. Add `--fix` to write a starter config. |
|
|
126
112
|
| `forerunner mcp-server` | Serve prompt bundles as MCP tools over stdio (JSON-RPC 2.0). |
|
|
127
113
|
| `forerunner install <agent>` | Install canonical skill into agent-specific directory. Add `--all` for all per-task skills. |
|
|
128
114
|
|
|
129
|
-
##
|
|
130
|
-
|
|
131
|
-
Prompts are bundled inside the package at `src/codeforerunner/prompts/`.
|
|
132
|
-
|
|
133
|
-
```text
|
|
134
|
-
prompts/
|
|
135
|
-
├── system/base.md
|
|
136
|
-
├── partials/
|
|
137
|
-
│ ├── context-format.md
|
|
138
|
-
│ ├── output-rules.md
|
|
139
|
-
│ └── stack-hints.md
|
|
140
|
-
└── tasks/
|
|
141
|
-
├── scan.md api-docs.md audit.md
|
|
142
|
-
├── readme.md diagrams.md changelog.md
|
|
143
|
-
├── check.md flows.md version-audit.md
|
|
144
|
-
├── review.md stack-docs.md
|
|
145
|
-
└── init-agent-onboarding.md
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Quick start (agent skill mode)
|
|
115
|
+
## Quick start
|
|
149
116
|
|
|
150
117
|
```bash
|
|
151
118
|
# Install skills into Claude Code
|
|
152
119
|
curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash
|
|
153
120
|
|
|
154
121
|
# In Claude Code:
|
|
155
|
-
# /forerunner-scan
|
|
156
|
-
# /forerunner-readme
|
|
157
|
-
# /forerunner-
|
|
122
|
+
# /forerunner-scan → scans your repo
|
|
123
|
+
# /forerunner-readme → generates README.md
|
|
124
|
+
# /forerunner-refresh → updates all stale docs
|
|
125
|
+
# /forerunner-check → checks for doc drift
|
|
158
126
|
```
|
|
159
127
|
|
|
160
|
-
##
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# 1. Install and configure
|
|
164
|
-
pip install codeforerunner
|
|
165
|
-
export ANTHROPIC_API_KEY=sk-...
|
|
128
|
+
## GitHub Action
|
|
166
129
|
|
|
167
|
-
|
|
168
|
-
forerunner generate readme --stream
|
|
130
|
+
Add doc-drift detection to any repo's CI — fails the PR if docs contradict repo state.
|
|
169
131
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
132
|
+
```yaml
|
|
133
|
+
# .github/workflows/doc-check.yml
|
|
134
|
+
name: Doc Check
|
|
135
|
+
on: [push, pull_request]
|
|
136
|
+
|
|
137
|
+
jobs:
|
|
138
|
+
doc-check:
|
|
139
|
+
runs-on: ubuntu-latest
|
|
140
|
+
steps:
|
|
141
|
+
- uses: actions/checkout@v6.0.2
|
|
142
|
+
- uses: derek-palmer/codeforerunner@v0.4.3
|
|
143
|
+
with:
|
|
144
|
+
fail-on-drift: "true" # set "false" to warn-only
|
|
173
145
|
```
|
|
174
146
|
|
|
175
|
-
|
|
147
|
+
No-op when `forerunner.config.yaml` is absent — safe to add before configuring rules.
|
|
176
148
|
|
|
177
|
-
|
|
178
|
-
- uses: derek-palmer/codeforerunner@v0.4.2
|
|
179
|
-
```
|
|
149
|
+
**Inputs**
|
|
180
150
|
|
|
181
|
-
|
|
151
|
+
| Input | Default | Description |
|
|
152
|
+
|-------|---------|-------------|
|
|
153
|
+
| `version` | `latest` | `codeforerunner` version to install |
|
|
154
|
+
| `python-version` | `3.11` | Python version |
|
|
155
|
+
| `repo` | workspace root | Path to check |
|
|
156
|
+
| `fail-on-drift` | `true` | Exit non-zero on drift |
|
|
182
157
|
|
|
183
158
|
## Configuration
|
|
184
159
|
|
|
@@ -191,10 +166,7 @@ forerunner doctor --fix
|
|
|
191
166
|
### Config fields
|
|
192
167
|
|
|
193
168
|
```yaml
|
|
194
|
-
|
|
195
|
-
model: claude-opus-4-7
|
|
196
|
-
api_key_env:
|
|
197
|
-
anthropic: ANTHROPIC_API_KEY
|
|
169
|
+
approaching_eol_threshold_months: 6
|
|
198
170
|
|
|
199
171
|
tasks:
|
|
200
172
|
check:
|
|
@@ -237,16 +209,24 @@ tasks:
|
|
|
237
209
|
|
|
238
210
|
See `examples/mcp/` for Claude Desktop and mcp-cli wiring examples.
|
|
239
211
|
|
|
240
|
-
##
|
|
212
|
+
## Prompt pack
|
|
241
213
|
|
|
242
|
-
|
|
214
|
+
Prompts are bundled inside the package at `src/codeforerunner/prompts/`.
|
|
243
215
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
216
|
+
```text
|
|
217
|
+
prompts/
|
|
218
|
+
├── system/base.md
|
|
219
|
+
├── partials/
|
|
220
|
+
│ ├── context-format.md
|
|
221
|
+
│ ├── output-rules.md
|
|
222
|
+
│ └── stack-hints.md
|
|
223
|
+
└── tasks/
|
|
224
|
+
├── scan.md api-docs.md audit.md
|
|
225
|
+
├── readme.md diagrams.md changelog.md
|
|
226
|
+
├── check.md flows.md version-audit.md
|
|
227
|
+
├── review.md stack-docs.md refresh.md
|
|
228
|
+
└── init-agent-onboarding.md
|
|
229
|
+
```
|
|
250
230
|
|
|
251
231
|
## Docs and spec
|
|
252
232
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# codeForerunner
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://badge.socket.dev/npm/package/codeforerunner/0.4.3)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
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.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
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
12
|
|
|
@@ -31,26 +31,9 @@ Then in your agent:
|
|
|
31
31
|
/forerunner-scan ← scan the repo first
|
|
32
32
|
/forerunner-readme ← generate README
|
|
33
33
|
/forerunner-check ← detect doc drift
|
|
34
|
+
/forerunner-refresh ← scan + update all stale docs
|
|
34
35
|
```
|
|
35
36
|
|
|
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.
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
pipx install codeforerunner # recommended
|
|
42
|
-
pip install codeforerunner # alternative
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
Configure a provider (or start Ollama for keyless local generation):
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
export ANTHROPIC_API_KEY=sk-...
|
|
49
|
-
forerunner generate readme --stream
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
If no API key and no `--provider` flag, forerunner auto-detects Ollama at `localhost:11434` and falls back to local mode.
|
|
53
|
-
|
|
54
37
|
## Slash commands
|
|
55
38
|
|
|
56
39
|
| Command | Task | Purpose |
|
|
@@ -67,14 +50,17 @@ If no API key and no `--provider` flag, forerunner auto-detects Ollama at `local
|
|
|
67
50
|
| `/forerunner-audit` | `audit` | Security and dependency audit |
|
|
68
51
|
| `/forerunner-changelog` | `changelog` | Generate changelog from git log |
|
|
69
52
|
| `/forerunner-init` | `init-agent-onboarding` | Bootstrap or refresh AGENTS.md |
|
|
53
|
+
| `/forerunner-refresh` | `refresh` | Scan + check + update all stale docs in one pass |
|
|
70
54
|
|
|
71
|
-
Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all
|
|
55
|
+
Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all commands after install.
|
|
72
56
|
|
|
73
57
|
## Skill install options
|
|
74
58
|
|
|
75
59
|
| Flag | Effect |
|
|
76
60
|
|------|--------|
|
|
77
|
-
| `./install.sh` | Auto-detect all agents, install all skills |
|
|
61
|
+
| `./install.sh` | Auto-detect all agents, prompt global vs local, install all skills |
|
|
62
|
+
| `./install.sh --global` | Skip prompt, install to global agent dirs (all projects) |
|
|
63
|
+
| `./install.sh --local` | Skip prompt, install to `.claude/skills/` and `.agents/skills/` in cwd |
|
|
78
64
|
| `./install.sh --only claude` | Claude Code only |
|
|
79
65
|
| `./install.sh --only codex` | Codex only |
|
|
80
66
|
| `./install.sh --only gemini` | Gemini CLI only |
|
|
@@ -93,65 +79,54 @@ pip install codeforerunner
|
|
|
93
79
|
| `forerunner init` | Resolve agent-onboarding bundle to stdout. |
|
|
94
80
|
| `forerunner scan` | Resolve scan bundle to stdout. |
|
|
95
81
|
| `forerunner doc <task>` | Resolve `base + partials + task` bundle to stdout. |
|
|
82
|
+
| `forerunner refresh` | Output scan + check + all doc-task bundles in sequence for a full doc refresh. |
|
|
96
83
|
| `forerunner check` | Run drift-detection rules; no-op without `forerunner.config.yaml`. |
|
|
97
|
-
| `forerunner
|
|
98
|
-
| `forerunner doctor` | Health report: skill parity, config, provider key, local-mode status. Add `--fix` to write a starter config. |
|
|
84
|
+
| `forerunner doctor` | Health report: skill parity, config. Add `--fix` to write a starter config. |
|
|
99
85
|
| `forerunner mcp-server` | Serve prompt bundles as MCP tools over stdio (JSON-RPC 2.0). |
|
|
100
86
|
| `forerunner install <agent>` | Install canonical skill into agent-specific directory. Add `--all` for all per-task skills. |
|
|
101
87
|
|
|
102
|
-
##
|
|
103
|
-
|
|
104
|
-
Prompts are bundled inside the package at `src/codeforerunner/prompts/`.
|
|
105
|
-
|
|
106
|
-
```text
|
|
107
|
-
prompts/
|
|
108
|
-
├── system/base.md
|
|
109
|
-
├── partials/
|
|
110
|
-
│ ├── context-format.md
|
|
111
|
-
│ ├── output-rules.md
|
|
112
|
-
│ └── stack-hints.md
|
|
113
|
-
└── tasks/
|
|
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
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
## Quick start (agent skill mode)
|
|
88
|
+
## Quick start
|
|
122
89
|
|
|
123
90
|
```bash
|
|
124
91
|
# Install skills into Claude Code
|
|
125
92
|
curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash
|
|
126
93
|
|
|
127
94
|
# In Claude Code:
|
|
128
|
-
# /forerunner-scan
|
|
129
|
-
# /forerunner-readme
|
|
130
|
-
# /forerunner-
|
|
95
|
+
# /forerunner-scan → scans your repo
|
|
96
|
+
# /forerunner-readme → generates README.md
|
|
97
|
+
# /forerunner-refresh → updates all stale docs
|
|
98
|
+
# /forerunner-check → checks for doc drift
|
|
131
99
|
```
|
|
132
100
|
|
|
133
|
-
##
|
|
134
|
-
|
|
135
|
-
```bash
|
|
136
|
-
# 1. Install and configure
|
|
137
|
-
pip install codeforerunner
|
|
138
|
-
export ANTHROPIC_API_KEY=sk-...
|
|
101
|
+
## GitHub Action
|
|
139
102
|
|
|
140
|
-
|
|
141
|
-
forerunner generate readme --stream
|
|
103
|
+
Add doc-drift detection to any repo's CI — fails the PR if docs contradict repo state.
|
|
142
104
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
105
|
+
```yaml
|
|
106
|
+
# .github/workflows/doc-check.yml
|
|
107
|
+
name: Doc Check
|
|
108
|
+
on: [push, pull_request]
|
|
109
|
+
|
|
110
|
+
jobs:
|
|
111
|
+
doc-check:
|
|
112
|
+
runs-on: ubuntu-latest
|
|
113
|
+
steps:
|
|
114
|
+
- uses: actions/checkout@v6.0.2
|
|
115
|
+
- uses: derek-palmer/codeforerunner@v0.4.3
|
|
116
|
+
with:
|
|
117
|
+
fail-on-drift: "true" # set "false" to warn-only
|
|
146
118
|
```
|
|
147
119
|
|
|
148
|
-
|
|
120
|
+
No-op when `forerunner.config.yaml` is absent — safe to add before configuring rules.
|
|
149
121
|
|
|
150
|
-
|
|
151
|
-
- uses: derek-palmer/codeforerunner@v0.4.2
|
|
152
|
-
```
|
|
122
|
+
**Inputs**
|
|
153
123
|
|
|
154
|
-
|
|
124
|
+
| Input | Default | Description |
|
|
125
|
+
|-------|---------|-------------|
|
|
126
|
+
| `version` | `latest` | `codeforerunner` version to install |
|
|
127
|
+
| `python-version` | `3.11` | Python version |
|
|
128
|
+
| `repo` | workspace root | Path to check |
|
|
129
|
+
| `fail-on-drift` | `true` | Exit non-zero on drift |
|
|
155
130
|
|
|
156
131
|
## Configuration
|
|
157
132
|
|
|
@@ -164,10 +139,7 @@ forerunner doctor --fix
|
|
|
164
139
|
### Config fields
|
|
165
140
|
|
|
166
141
|
```yaml
|
|
167
|
-
|
|
168
|
-
model: claude-opus-4-7
|
|
169
|
-
api_key_env:
|
|
170
|
-
anthropic: ANTHROPIC_API_KEY
|
|
142
|
+
approaching_eol_threshold_months: 6
|
|
171
143
|
|
|
172
144
|
tasks:
|
|
173
145
|
check:
|
|
@@ -210,16 +182,24 @@ tasks:
|
|
|
210
182
|
|
|
211
183
|
See `examples/mcp/` for Claude Desktop and mcp-cli wiring examples.
|
|
212
184
|
|
|
213
|
-
##
|
|
185
|
+
## Prompt pack
|
|
214
186
|
|
|
215
|
-
|
|
187
|
+
Prompts are bundled inside the package at `src/codeforerunner/prompts/`.
|
|
216
188
|
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
189
|
+
```text
|
|
190
|
+
prompts/
|
|
191
|
+
├── system/base.md
|
|
192
|
+
├── partials/
|
|
193
|
+
│ ├── context-format.md
|
|
194
|
+
│ ├── output-rules.md
|
|
195
|
+
│ └── stack-hints.md
|
|
196
|
+
└── tasks/
|
|
197
|
+
├── scan.md api-docs.md audit.md
|
|
198
|
+
├── readme.md diagrams.md changelog.md
|
|
199
|
+
├── check.md flows.md version-audit.md
|
|
200
|
+
├── review.md stack-docs.md refresh.md
|
|
201
|
+
└── init-agent-onboarding.md
|
|
202
|
+
```
|
|
223
203
|
|
|
224
204
|
## Docs and spec
|
|
225
205
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "codeforerunner"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.4"
|
|
8
8
|
description = "Model-agnostic repository documentation tooling (prompt-first; thin CLI)."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
@@ -54,3 +54,9 @@ codeforerunner = ["py.typed", "prompts/**/*.md"]
|
|
|
54
54
|
|
|
55
55
|
[tool.pytest.ini_options]
|
|
56
56
|
testpaths = ["tests"]
|
|
57
|
+
|
|
58
|
+
[dependency-groups]
|
|
59
|
+
dev = [
|
|
60
|
+
"pydocstyle>=6.3.0",
|
|
61
|
+
"pytest-cov>=7.1.0",
|
|
62
|
+
]
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
"""codeforerunner — prompt-first repo documentation tooling."""
|
|
2
|
+
|
|
1
3
|
from importlib.metadata import PackageNotFoundError, version
|
|
2
4
|
|
|
3
5
|
try:
|
|
4
6
|
__version__ = version("codeforerunner")
|
|
5
|
-
except PackageNotFoundError:
|
|
7
|
+
except PackageNotFoundError: # pragma: no cover
|
|
6
8
|
__version__ = "0.0.0" # running from source without install
|
|
@@ -11,6 +11,8 @@ from codeforerunner.config import CheckConfig
|
|
|
11
11
|
|
|
12
12
|
@dataclass(frozen=True)
|
|
13
13
|
class Violation:
|
|
14
|
+
"""Single rule match: which doc, which line, which rule, and what it means."""
|
|
15
|
+
|
|
14
16
|
path: Path
|
|
15
17
|
line: int
|
|
16
18
|
rule_id: str
|
|
@@ -19,6 +21,8 @@ class Violation:
|
|
|
19
21
|
|
|
20
22
|
@dataclass(frozen=True)
|
|
21
23
|
class _Rule:
|
|
24
|
+
"""Drift detection rule: pattern to match, trigger files, and violation message."""
|
|
25
|
+
|
|
22
26
|
id: str
|
|
23
27
|
pattern: re.Pattern
|
|
24
28
|
triggers: tuple[str, ...]
|
|
@@ -122,6 +126,7 @@ _CHANGELOG_FILENAME = "CHANGELOG.md"
|
|
|
122
126
|
|
|
123
127
|
|
|
124
128
|
def _trigger_exists(repo: Path, patterns: tuple[str, ...]) -> bool:
|
|
129
|
+
"""Return True if any pattern matches an existing file in repo."""
|
|
125
130
|
for pat in patterns:
|
|
126
131
|
if "*" in pat:
|
|
127
132
|
parent = repo / Path(pat).parent
|
|
@@ -135,6 +140,7 @@ def _trigger_exists(repo: Path, patterns: tuple[str, ...]) -> bool:
|
|
|
135
140
|
|
|
136
141
|
|
|
137
142
|
def _scanned_docs(repo: Path) -> list[Path]:
|
|
143
|
+
"""Collect README.md and all *.md files under docs/ from repo."""
|
|
138
144
|
docs: list[Path] = []
|
|
139
145
|
readme = repo / "README.md"
|
|
140
146
|
if readme.is_file():
|
|
@@ -146,6 +152,7 @@ def _scanned_docs(repo: Path) -> list[Path]:
|
|
|
146
152
|
|
|
147
153
|
|
|
148
154
|
def _path_ignored(repo: Path, doc: Path, ignore_patterns: tuple[str, ...]) -> bool:
|
|
155
|
+
"""Return True if doc's repo-relative path matches any ignore pattern."""
|
|
149
156
|
if not ignore_patterns:
|
|
150
157
|
return False
|
|
151
158
|
try:
|
|
@@ -156,6 +163,7 @@ def _path_ignored(repo: Path, doc: Path, ignore_patterns: tuple[str, ...]) -> bo
|
|
|
156
163
|
|
|
157
164
|
|
|
158
165
|
def _current_version(repo: Path) -> str | None:
|
|
166
|
+
"""Extract the package version from pyproject.toml, or None if absent/unparseable."""
|
|
159
167
|
pyproject = repo / "pyproject.toml"
|
|
160
168
|
if not pyproject.is_file():
|
|
161
169
|
return None
|
|
@@ -173,6 +181,7 @@ def _check_version_drift(
|
|
|
173
181
|
ignore_patterns: tuple[str, ...],
|
|
174
182
|
enabled: set[str] | None,
|
|
175
183
|
) -> list[Violation]:
|
|
184
|
+
"""Scan docs for pinned version strings that don't match pyproject.toml."""
|
|
176
185
|
if enabled is not None and "RV1-version-drift" not in enabled:
|
|
177
186
|
return []
|
|
178
187
|
current = _current_version(repo)
|