codeforerunner 0.3.2__py3-none-any.whl → 0.4.0__py3-none-any.whl

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/cli.py CHANGED
@@ -111,7 +111,8 @@ def cmd_generate(args: argparse.Namespace) -> int:
111
111
  repo_root = Path(args.repo).resolve() if args.repo else Path.cwd()
112
112
  cfg = load_from_repo(repo_root)
113
113
 
114
- provider_name = args.provider or (cfg.provider if cfg else "anthropic")
114
+ explicit_provider = args.provider or (cfg.provider if cfg else None)
115
+ provider_name = explicit_provider or "anthropic"
115
116
  model = args.model or (cfg.model if cfg else None)
116
117
  provider_cls = _providers.get(provider_name)
117
118
  provider = provider_cls()
@@ -132,8 +133,19 @@ def cmd_generate(args: argparse.Namespace) -> int:
132
133
  env_var = (cfg.api_key_env.get(provider_name) if cfg else None) or provider.default_env_var
133
134
  api_key = os.environ.get(env_var)
134
135
  if api_key is None and provider_name != "ollama":
135
- print(f"error: missing API key; set ${env_var}", file=sys.stderr)
136
- return 3
136
+ if explicit_provider is None and _providers.ollama_available():
137
+ provider_name = "ollama"
138
+ provider_cls = _providers.get("ollama")
139
+ provider = provider_cls()
140
+ if not args.model:
141
+ model = provider.default_model
142
+ print("info: no API key; falling back to Ollama (local mode)", file=sys.stderr)
143
+ else:
144
+ msg = f"error: missing API key; set ${env_var}"
145
+ if explicit_provider is None:
146
+ msg += "\nhint: start Ollama for keyless local generation (https://ollama.com)"
147
+ print(msg, file=sys.stderr)
148
+ return 3
137
149
 
138
150
  if getattr(args, "stream", False):
139
151
  try:
codeforerunner/doctor.py CHANGED
@@ -225,13 +225,23 @@ def _check_config_loadable(repo: Path) -> list[Finding]:
225
225
 
226
226
 
227
227
  def _check_provider_api_key(repo: Path) -> list[Finding]:
228
+ from codeforerunner.providers.ollama import is_available as _ollama_available
229
+
228
230
  cfg_path = repo / CONFIG_FILENAME
229
231
  if not cfg_path.is_file():
232
+ if _ollama_available():
233
+ return [
234
+ Finding(
235
+ "ok",
236
+ "provider-api-key",
237
+ "no config; Ollama running — generate will use local mode automatically",
238
+ )
239
+ ]
230
240
  return [
231
241
  Finding(
232
242
  "ok",
233
243
  "provider-api-key",
234
- f"no {CONFIG_FILENAME}; provider key not checked",
244
+ f"no {CONFIG_FILENAME}; set an API key in config or start Ollama for keyless local generation",
235
245
  )
236
246
  ]
237
247
  try:
@@ -259,7 +269,7 @@ def _check_provider_api_key(repo: Path) -> list[Finding]:
259
269
  Finding(
260
270
  "ok",
261
271
  "provider-api-key",
262
- "ollama needs no API key (OLLAMA_HOST optional)",
272
+ "running in local mode (Ollama; no API key needed)",
263
273
  )
264
274
  ]
265
275
  env_var = cfg.api_key_env.get(provider) or _DEFAULT_PROVIDER_ENV.get(provider, "")
@@ -21,6 +21,23 @@ EXIT_USAGE = 2
21
21
  EXIT_BODY_MISMATCH = 3
22
22
  EXIT_UNMANAGED_DEST = 4
23
23
 
24
+ # Per-task skill slugs (source: skills/<slug>/SKILL.md → plugins/codeforerunner/skills/<slug>/SKILL.md)
25
+ TASK_SKILL_SLUGS: tuple[str, ...] = (
26
+ "codeforerunner",
27
+ "forerunner-scan",
28
+ "forerunner-readme",
29
+ "forerunner-api-docs",
30
+ "forerunner-audit",
31
+ "forerunner-changelog",
32
+ "forerunner-check",
33
+ "forerunner-diagrams",
34
+ "forerunner-flows",
35
+ "forerunner-init",
36
+ "forerunner-review",
37
+ "forerunner-stack-docs",
38
+ "forerunner-version-audit",
39
+ )
40
+
24
41
 
25
42
  @dataclass(frozen=True)
26
43
  class Target:
@@ -44,9 +61,65 @@ def resolve_target(agent: str, override: Path | None) -> Target:
44
61
  return Target(agent, home / ".codex/skills/codeforerunner/SKILL.md")
45
62
  if agent == "claude":
46
63
  return Target(agent, home / ".claude/plugins/codeforerunner/skills/codeforerunner/SKILL.md")
64
+ if agent == "gemini":
65
+ raise ValueError(
66
+ "gemini install is handled via `gemini extensions install`; "
67
+ "run `./install.sh --only gemini` instead"
68
+ )
47
69
  raise ValueError(f"unknown agent '{agent}' (expected: codex, claude, generic)")
48
70
 
49
71
 
72
+ def resolve_skill_target(agent: str, slug: str) -> Target:
73
+ """Return install target for a per-task skill slug."""
74
+ home = _home()
75
+ if agent == "codex":
76
+ return Target(agent, home / f".codex/skills/{slug}/SKILL.md")
77
+ if agent == "claude":
78
+ return Target(agent, home / f".claude/plugins/codeforerunner/skills/{slug}/SKILL.md")
79
+ raise ValueError(f"install_all not supported for agent '{agent}' (expected: codex, claude)")
80
+
81
+
82
+ def install_all_skills(
83
+ *,
84
+ agent: str,
85
+ repo_root: Path,
86
+ check_only: bool,
87
+ out=None,
88
+ err=None,
89
+ ) -> int:
90
+ """Install all per-task skills for the given agent. Returns 0 on full success."""
91
+ out = out or sys.stdout
92
+ err = err or sys.stderr
93
+ any_error = False
94
+ for slug in TASK_SKILL_SLUGS:
95
+ src_path = repo_root / "plugins" / "codeforerunner" / "skills" / slug / "SKILL.md"
96
+ if not src_path.is_file():
97
+ print(f"warning: skill source not found: {src_path}", file=err)
98
+ continue
99
+ try:
100
+ target = resolve_skill_target(agent, slug)
101
+ except ValueError as e:
102
+ print(f"error: {e}", file=err)
103
+ return EXIT_USAGE
104
+ # For per-task skills use simple copy (no body-parity check against canonical)
105
+ dest = target.path
106
+ prefix = "would " if check_only else ""
107
+ if dest.exists():
108
+ src_trimmed = src_path.read_bytes().rstrip()
109
+ dest_trimmed = dest.read_bytes().rstrip()
110
+ if src_trimmed == dest_trimmed:
111
+ print(f"skip: {dest} (up-to-date)", file=out)
112
+ continue
113
+ action = "update"
114
+ else:
115
+ action = "create"
116
+ print(f"{prefix}{action}: {dest}", file=out)
117
+ if not check_only:
118
+ dest.parent.mkdir(parents=True, exist_ok=True)
119
+ dest.write_bytes(src_path.read_bytes())
120
+ return EXIT_OK if not any_error else EXIT_BODY_MISMATCH
121
+
122
+
50
123
  def resolve_marketplace_target(agent: str, override: Path | None) -> Target:
51
124
  if agent == "generic":
52
125
  if override is None:
@@ -277,8 +350,11 @@ def install(
277
350
 
278
351
 
279
352
  def add_subparser(sub: argparse._SubParsersAction) -> None:
280
- p = sub.add_parser("install", help="install skill into agent-specific directory (D.installer)")
281
- p.add_argument("agent", choices=["codex", "claude", "generic"])
353
+ p = sub.add_parser("install", help="install skill(s) into agent-specific directories (D.installer)")
354
+ p.add_argument("agent", choices=["codex", "claude", "generic"], nargs="?",
355
+ help="target agent (omit with --all to install to all detected agents)")
356
+ p.add_argument("--all", action="store_true",
357
+ help="install all per-task skills for the specified agent")
282
358
  p.add_argument("--check", action="store_true", help="dry-run: print plan, write nothing")
283
359
  p.add_argument("--path", type=Path, help="dest path override (required for generic)")
284
360
  p.add_argument("--source", type=Path, help="source skill file (default: agent/codeforerunner.skill.md)")
@@ -292,6 +368,19 @@ def add_subparser(sub: argparse._SubParsersAction) -> None:
292
368
 
293
369
  def _cli_entry(args: argparse.Namespace) -> int:
294
370
  root = Path(args.repo).resolve() if args.repo else Path.cwd()
371
+
372
+ if getattr(args, "all", False):
373
+ agent = args.agent or "claude"
374
+ return install_all_skills(
375
+ agent=agent,
376
+ repo_root=root,
377
+ check_only=args.check,
378
+ )
379
+
380
+ if not args.agent:
381
+ print("error: specify an agent or use --all", file=sys.stderr)
382
+ return EXIT_USAGE
383
+
295
384
  return install(
296
385
  agent=args.agent,
297
386
  repo_root=root,
@@ -5,7 +5,7 @@ from __future__ import annotations
5
5
  from codeforerunner.providers.anthropic import AnthropicProvider
6
6
  from codeforerunner.providers.base import CompletionResult, Provider, ProviderError
7
7
  from codeforerunner.providers.google import GoogleProvider
8
- from codeforerunner.providers.ollama import OllamaProvider
8
+ from codeforerunner.providers.ollama import OllamaProvider, is_available as ollama_available
9
9
  from codeforerunner.providers.openai import OpenAIProvider
10
10
 
11
11
  __all__ = [
@@ -18,6 +18,7 @@ __all__ = [
18
18
  "ProviderError",
19
19
  "REGISTRY",
20
20
  "get",
21
+ "ollama_available",
21
22
  ]
22
23
 
23
24
  REGISTRY: dict[str, type] = {
@@ -13,7 +13,7 @@ from codeforerunner.providers.base import CompletionResult, ProviderError
13
13
  class AnthropicProvider:
14
14
  name = "anthropic"
15
15
  default_env_var = "ANTHROPIC_API_KEY"
16
- default_model = "claude-opus-4-5"
16
+ default_model = "claude-opus-4-7"
17
17
 
18
18
  endpoint = "https://api.anthropic.com/v1/messages"
19
19
 
@@ -13,6 +13,16 @@ from codeforerunner.providers.base import CompletionResult, ProviderError
13
13
  DEFAULT_HOST = "http://localhost:11434"
14
14
 
15
15
 
16
+ def is_available(host: str | None = None) -> bool:
17
+ """Return True if an Ollama instance is reachable at the configured host."""
18
+ base = (host or os.environ.get("OLLAMA_HOST") or DEFAULT_HOST).rstrip("/")
19
+ try:
20
+ urllib.request.urlopen(f"{base}/api/tags", timeout=2)
21
+ return True
22
+ except Exception:
23
+ return False
24
+
25
+
16
26
  class OllamaProvider:
17
27
  name = "ollama"
18
28
  default_env_var = "OLLAMA_HOST"
@@ -0,0 +1,258 @@
1
+ Metadata-Version: 2.4
2
+ Name: codeforerunner
3
+ Version: 0.4.0
4
+ Summary: Model-agnostic repository documentation tooling (prompt-first; thin CLI).
5
+ Author: Derek Palmer
6
+ License-Expression: LicenseRef-Codeforerunner-SAL-0.1
7
+ Project-URL: Repository, https://github.com/derek-palmer/codeforerunner
8
+ Project-URL: Issues, https://github.com/derek-palmer/codeforerunner/issues
9
+ Keywords: repository-documentation,developer-tools,agent-tooling,code-generation,prompt-engineering,mcp,llm,documentation
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Documentation
19
+ Classifier: Topic :: Software Development :: Documentation
20
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
+ Classifier: Topic :: Utilities
22
+ Requires-Python: >=3.11
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE.md
25
+ Requires-Dist: PyYAML>=6.0
26
+ Dynamic: license-file
27
+
28
+ ![codeForerunner — your codebase gets a Forerunner; your docs finally see the light](images/readme_banner.png)
29
+
30
+ # codeForerunner
31
+
32
+ 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.
33
+
34
+ ## Two modes
35
+
36
+ ### Mode A — Agent skill (recommended, no API key required)
37
+
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
+
40
+ ```bash
41
+ # From a cloned repo
42
+ ./install.sh
43
+
44
+ # One-liner (auto-detects Claude Code, Codex, Gemini CLI)
45
+ curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash
46
+
47
+ # Windows
48
+ irm https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.ps1 | iex
49
+
50
+ # Via forerunner CLI (after pip install)
51
+ forerunner install --all claude
52
+ forerunner install --all codex
53
+ ```
54
+
55
+ Then in your agent:
56
+
57
+ ```
58
+ /forerunner-scan ← scan the repo first
59
+ /forerunner-readme ← generate README
60
+ /forerunner-check ← detect doc drift
61
+ ```
62
+
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
+ ## Slash commands
82
+
83
+ | Command | Task | Purpose |
84
+ |---------|------|---------|
85
+ | `/forerunner-scan` | `scan` | Collect repo evidence (run first) |
86
+ | `/forerunner-readme` | `readme` | Generate or refresh README.md |
87
+ | `/forerunner-api-docs` | `api-docs` | Generate API reference docs |
88
+ | `/forerunner-diagrams` | `diagrams` | Generate Mermaid architecture diagrams |
89
+ | `/forerunner-flows` | `flows` | Document system flows |
90
+ | `/forerunner-stack-docs` | `stack-docs` | Stack-specific developer docs |
91
+ | `/forerunner-version-audit` | `version-audit` | Audit pinned versions vs EOL |
92
+ | `/forerunner-check` | `check` | Check docs for staleness |
93
+ | `/forerunner-review` | `review` | Doc-impact summary for PR review |
94
+ | `/forerunner-audit` | `audit` | Security and dependency audit |
95
+ | `/forerunner-changelog` | `changelog` | Generate changelog from git log |
96
+ | `/forerunner-init` | `init-agent-onboarding` | Bootstrap or refresh AGENTS.md |
97
+
98
+ Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all 12 commands after install.
99
+
100
+ ## Skill install options
101
+
102
+ | Flag | Effect |
103
+ |------|--------|
104
+ | `./install.sh` | Auto-detect all agents, install all skills |
105
+ | `./install.sh --only claude` | Claude Code only |
106
+ | `./install.sh --only codex` | Codex only |
107
+ | `./install.sh --only gemini` | Gemini CLI only |
108
+ | `./install.sh --dry-run` | Preview, write nothing |
109
+ | `./install.sh --list` | Show detected agents + skill list |
110
+ | `./install.sh --uninstall` | Remove all installed skills |
111
+
112
+ ## CLI
113
+
114
+ ```bash
115
+ pip install codeforerunner
116
+ ```
117
+
118
+ | Command | Purpose |
119
+ |---------|---------|
120
+ | `forerunner init` | Resolve agent-onboarding bundle to stdout. |
121
+ | `forerunner scan` | Resolve scan bundle to stdout. |
122
+ | `forerunner doc <task>` | Resolve `base + partials + task` bundle to stdout. |
123
+ | `forerunner check` | Run drift-detection rules; no-op without `forerunner.config.yaml`. |
124
+ | `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. |
125
+ | `forerunner doctor` | Health report: skill parity, config, provider key, local-mode status. Add `--fix` to write a starter config. |
126
+ | `forerunner mcp-server` | Serve prompt bundles as MCP tools over stdio (JSON-RPC 2.0). |
127
+ | `forerunner install <agent>` | Install canonical skill into agent-specific directory. Add `--all` for all per-task skills. |
128
+
129
+ ## Prompt pack
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)
149
+
150
+ ```bash
151
+ # Install skills into Claude Code
152
+ curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash
153
+
154
+ # In Claude Code:
155
+ # /forerunner-scan → scans your repo
156
+ # /forerunner-readme → generates README.md
157
+ # /forerunner-check → checks for doc drift
158
+ ```
159
+
160
+ ## Quick start (direct API mode)
161
+
162
+ ```bash
163
+ # 1. Install and configure
164
+ pip install codeforerunner
165
+ export ANTHROPIC_API_KEY=sk-...
166
+
167
+ # 2. Run a task
168
+ forerunner generate readme --stream
169
+
170
+ # 3. Enable drift detection
171
+ forerunner doctor --fix # writes forerunner.config.yaml
172
+ forerunner check # run any time or as pre-commit hook
173
+ ```
174
+
175
+ ## GitHub Action
176
+
177
+ ```yaml
178
+ - uses: derek-palmer/codeforerunner@v0.3.2
179
+ ```
180
+
181
+ No-op when `forerunner.config.yaml` is absent.
182
+
183
+ ## Configuration
184
+
185
+ Copy `forerunner.config.yaml.example` to `forerunner.config.yaml` to opt in to drift rules. Generate a starter config with:
186
+
187
+ ```bash
188
+ forerunner doctor --fix
189
+ ```
190
+
191
+ ### Config fields
192
+
193
+ ```yaml
194
+ provider: anthropic # anthropic | openai | google | ollama
195
+ model: claude-opus-4-7
196
+ api_key_env:
197
+ anthropic: ANTHROPIC_API_KEY
198
+
199
+ tasks:
200
+ check:
201
+ enabled_rules:
202
+ - R1-no-cli
203
+ - R2-no-pre-commit
204
+ - R3-no-ci
205
+ - R4-no-installer
206
+ - R5-no-python-package
207
+ - R7-no-mcp
208
+ - R8-no-marketplace
209
+ - RI1-missing-cli
210
+ - RI5-missing-python-package
211
+ - RI7-missing-mcp
212
+ - RV1-version-drift
213
+ ignore_paths:
214
+ - docs/legacy/**/*.md
215
+ ```
216
+
217
+ ### Drift rules
218
+
219
+ | Rule | Fires when |
220
+ |------|-----------|
221
+ | `R1-no-cli` | Doc denies having a CLI, but `cli.py` is present |
222
+ | `R2-no-pre-commit` | Doc denies having pre-commit hooks, but `.pre-commit-hooks.yaml` present |
223
+ | `R3-no-ci` | Doc denies having CI, but `.github/workflows/*.yml` present |
224
+ | `R4-no-installer` | Doc denies having an installer, but `installer.py` present |
225
+ | `R5-no-python-package` | Doc denies having a Python package, but `pyproject.toml` present |
226
+ | `R6-no-docker` | Doc denies having Docker, but `Dockerfile`/`compose.yml` present |
227
+ | `R7-no-mcp` | Doc denies having an MCP server, but `mcp_server.py` present |
228
+ | `R8-no-marketplace` | Doc denies having a marketplace, but `marketplace.json` present |
229
+ | `RI1-missing-cli` | Doc references `forerunner` subcommands but `cli.py` absent |
230
+ | `RI5-missing-python-package` | Doc shows `pip install codeforerunner` but `pyproject.toml` absent |
231
+ | `RI7-missing-mcp` | Doc references `forerunner mcp-server` but `mcp_server.py` absent |
232
+ | `RV1-version-drift` | Doc pins `codeforerunner==X.Y.Z` differing from current version |
233
+
234
+ ## MCP Server
235
+
236
+ `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.
237
+
238
+ See `examples/mcp/` for Claude Desktop and mcp-cli wiring examples.
239
+
240
+ ## Providers
241
+
242
+ `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.
243
+
244
+ | Provider | Env var | Default model |
245
+ |----------|---------|---------------|
246
+ | `anthropic` | `ANTHROPIC_API_KEY` | `claude-opus-4-7` |
247
+ | `openai` | `OPENAI_API_KEY` | `gpt-4o` |
248
+ | `google` | `GOOGLE_API_KEY` | `gemini-2.5-pro` |
249
+ | `ollama` | `OLLAMA_HOST` (optional) | `llama3` |
250
+
251
+ ## Docs and spec
252
+
253
+ - `SPEC.md` — canonical phase/task tracker
254
+ - `docs/getting-started.md` — manual prompt use
255
+ - `docs/prompt-guide.md` — how system, partial, and task prompts compose
256
+ - `docs/editor-agent-setup.md` — adapting prompts to local agents
257
+ - `docs/roadmap.md` — human-readable roadmap
258
+ - `docs/agent-distribution-design.md` — packaging and installer design
@@ -1,10 +1,10 @@
1
1
  codeforerunner/__init__.py,sha256=4ItVS_FzLddTK77jExpkV3QJ1nHl2Bh-QIujM7Hg_5w,205
2
2
  codeforerunner/bundle.py,sha256=wWlhNaja8HPLzN-9pxiSrFD8X0mGi-c1HM9HRyVhmzk,2020
3
3
  codeforerunner/check.py,sha256=5sJVwMMSvVCrRmwBIunYbn2pINroUjONrVJAs5ov3O4,8188
4
- codeforerunner/cli.py,sha256=Rk6T7G3QC78-HpxvGKONQ9zIauZw5LceBHurFechJuU,9032
4
+ codeforerunner/cli.py,sha256=fBojCOPEEzQdXxYB0Intjhax90l7Rz7sfsgeFpozP58,9633
5
5
  codeforerunner/config.py,sha256=REs4FgmSSn7R2tLIwLJPL8VmSCGkTvw8J2SqBOggzho,6206
6
- codeforerunner/doctor.py,sha256=dsnLfB7ZuYTM7HG9JxzLl63GEmhr_miMRZy9RPq7z_8,10456
7
- codeforerunner/installer.py,sha256=9Ze_hyjvow-if-NMovk9CzVDYVZSR3vyLO6s2vhOs6g,10227
6
+ codeforerunner/doctor.py,sha256=4VE7nCGdJKpzWtqK3ut-SbrOENdfLNLuvA_wxn-5fcM,10859
7
+ codeforerunner/installer.py,sha256=60CMYbV8di-0iLE8jbsLGScdgU5VSJTOO_PhoBtqYYY,13395
8
8
  codeforerunner/mcp_server.py,sha256=oIfuAR7e_rH--B1aLOATVflyWAyGpkyeeXI4SAI4eTg,4657
9
9
  codeforerunner/prompts/partials/context-format.md,sha256=WNfkr4kf2Awj0R8wLOrFotEiYCe6hfKTq5eA3Rt5_Xw,817
10
10
  codeforerunner/prompts/partials/output-rules.md,sha256=vfIAX-ImxCa-MVAeNH896uSIO7-cKbJd0KohkgHIiD8,1731
@@ -22,15 +22,15 @@ codeforerunner/prompts/tasks/review.md,sha256=IRdIXAKvv0JMOE5WtrnlO1Cd4LHXtcJqb1
22
22
  codeforerunner/prompts/tasks/scan.md,sha256=hYXf-IL1kgpBPHJapRrwTu88cLZ7y3bCmAq9HY0yG3U,2300
23
23
  codeforerunner/prompts/tasks/stack-docs.md,sha256=Dy-JSXpSmHSyhR5shQBXKa_F0PqnjPcmtljthYZpaiM,1923
24
24
  codeforerunner/prompts/tasks/version-audit.md,sha256=oK-pcoxt_VcvDOlj1Sz9OlEhXlcViLPn54r-qP5WfiA,5833
25
- codeforerunner/providers/__init__.py,sha256=ttMAbHWJIO8s-8H6Kb_EWf3LN5oMzlmX1D12RyGSmIg,962
26
- codeforerunner/providers/anthropic.py,sha256=oPi4oLHcHEDs8gK-W5Jt06Ef5N23axFTyXhO-2YcCkk,4049
25
+ codeforerunner/providers/__init__.py,sha256=hoLODdqQ-beA7-MVFR6aoE29ZUSzxGVPLhwNXNN1xw4,1020
26
+ codeforerunner/providers/anthropic.py,sha256=kECeFMCeSJHcsUPvF93ECv52wXmLR6H21rFNwPzRhaM,4049
27
27
  codeforerunner/providers/base.py,sha256=MMrOUVOXHWP1td-TndxhLhDyDPJZGExZCeFopZUSRCo,923
28
28
  codeforerunner/providers/google.py,sha256=OWEE0FNupFWmZCeilIrgYUYDHH1iWvIwHEEsHYQoFFY,3979
29
- codeforerunner/providers/ollama.py,sha256=k6keO6eN-iwLFLtYETMMMoAyjxJLO1x16p_rM2TGks0,3524
29
+ codeforerunner/providers/ollama.py,sha256=Q8ACojaeiBgPQgDFxP7KKM5r4Ccu6dDspNFza1vbOzw,3871
30
30
  codeforerunner/providers/openai.py,sha256=999ZzIVh0cqW4xDnzK_NACqfJxNziHwpVjwmw9_jjRw,3825
31
- codeforerunner-0.3.2.dist-info/licenses/LICENSE.md,sha256=iIhmJHib6GbdjcwiDMM-npiNRf3XgASom1WsOJivEdc,2915
32
- codeforerunner-0.3.2.dist-info/METADATA,sha256=vCvhbtoSliPMvDFYubsockBIAMLg6JUVkbqsaMBu2zg,7737
33
- codeforerunner-0.3.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
- codeforerunner-0.3.2.dist-info/entry_points.txt,sha256=3p8BbPlq-wfcXk42tsweKePRaGlZ1WXho1gOkuZGyIQ,55
35
- codeforerunner-0.3.2.dist-info/top_level.txt,sha256=pV1rt0-NIpNEotKXpL_sF2060DHr-_0F86LWhUlvXis,15
36
- codeforerunner-0.3.2.dist-info/RECORD,,
31
+ codeforerunner-0.4.0.dist-info/licenses/LICENSE.md,sha256=iIhmJHib6GbdjcwiDMM-npiNRf3XgASom1WsOJivEdc,2915
32
+ codeforerunner-0.4.0.dist-info/METADATA,sha256=hCzFSOjHkJ6iNZLYkgvHDpgjlM5P_D0OWP9zTW66pLc,9873
33
+ codeforerunner-0.4.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
+ codeforerunner-0.4.0.dist-info/entry_points.txt,sha256=3p8BbPlq-wfcXk42tsweKePRaGlZ1WXho1gOkuZGyIQ,55
35
+ codeforerunner-0.4.0.dist-info/top_level.txt,sha256=pV1rt0-NIpNEotKXpL_sF2060DHr-_0F86LWhUlvXis,15
36
+ codeforerunner-0.4.0.dist-info/RECORD,,
@@ -1,133 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: codeforerunner
3
- Version: 0.3.2
4
- Summary: Model-agnostic repository documentation tooling (prompt-first; thin CLI).
5
- Author: Derek Palmer
6
- License-Expression: LicenseRef-Codeforerunner-SAL-0.1
7
- Project-URL: Repository, https://github.com/derek-palmer/codeforerunner
8
- Project-URL: Issues, https://github.com/derek-palmer/codeforerunner/issues
9
- Keywords: repository-documentation,developer-tools,agent-tooling,code-generation,prompt-engineering,mcp,llm,documentation
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Environment :: Console
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Operating System :: OS Independent
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: Topic :: Documentation
19
- Classifier: Topic :: Software Development :: Documentation
20
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
21
- Classifier: Topic :: Utilities
22
- Requires-Python: >=3.11
23
- Description-Content-Type: text/markdown
24
- License-File: LICENSE.md
25
- Requires-Dist: PyYAML>=6.0
26
- Dynamic: license-file
27
-
28
- ![codeForerunner — your codebase gets a Forerunner; your docs finally see the light](images/readme_banner.png)
29
-
30
- # codeForerunner
31
-
32
- CodeForerunner is a model-agnostic documentation agent that acts as overwatch for your repository, automatically analyzing code and maintaining docs, diagrams, and architecture knowledge as your codebase evolves over time.
33
-
34
- The current repo is the prompt-first foundation for that agent: it ships prompt assets for understanding a codebase and generating developer docs. A thin Python CLI (including `forerunner mcp-server` and a scoped `forerunner init --full / --agents-only`), an idempotent skill installer, pre-commit + CI hooks, and a PyPI publish workflow now wrap those prompts; the first published PyPI release remains pending.
35
-
36
- ## Current State
37
-
38
- - Core product: Markdown prompts in `prompts/`.
39
- - Agent package artifacts: Codex plugin files under `plugins/codeforerunner/` and Claude Code plugin files under `.claude-plugin/` plus `skills/codeforerunner/`.
40
- - Python package: `pyproject.toml` + `src/codeforerunner/` expose a `forerunner` console script. `forerunner doc <task>` resolves the prompt bundle (base + partials + task) to stdout; `forerunner install <agent>` idempotently writes the canonical skill into agent-specific directories; `forerunner init` resolves the agent-onboarding bundle (with `--full` to prepend a scan or `--agents-only` for the default scope); `forerunner scan` resolves the scan bundle; `forerunner mcp-server` serves prompt bundles as MCP tools over stdio.
41
- - Hooks: `.pre-commit-hooks.yaml` exposes a `forerunner-check` hook; `.github/workflows/forerunner-check.yml` mirrors it in CI. Both no-op when `forerunner.config.yaml` is absent.
42
- - Current config: `forerunner.config.yaml.example` documents the schema now parsed by `src/codeforerunner/config.py`; see "Configuration" below.
43
- - Not currently present: Docker image, Makefile, published PyPI release.
44
-
45
- ## Install
46
-
47
- After the first PyPI release:
48
-
49
- ```bash
50
- pipx install codeforerunner # recommended; isolated environment
51
- pip install codeforerunner # alternative
52
- ```
53
-
54
- From source:
55
-
56
- ```bash
57
- git clone https://github.com/derek-palmer/codeForerunner
58
- cd codeForerunner
59
- python -m pip install -e .
60
- ```
61
-
62
- Then `forerunner --help` should print the subcommand list.
63
-
64
- ## Prompt Layout
65
-
66
- ```text
67
- prompts/
68
- ├── system/
69
- │ └── base.md
70
- ├── partials/
71
- │ ├── context-format.md
72
- │ ├── output-rules.md
73
- │ └── stack-hints.md
74
- └── tasks/
75
- ├── scan.md
76
- ├── init-agent-onboarding.md
77
- ├── readme.md
78
- ├── api-docs.md
79
- ├── stack-docs.md
80
- ├── diagrams.md
81
- ├── flows.md
82
- ├── version-audit.md
83
- ├── check.md
84
- └── review.md
85
- ```
86
-
87
- ## Quick Start
88
-
89
- 1. Open `prompts/system/base.md` and use it as the agent system or project instruction.
90
- 2. Assemble repo context using the shape in `prompts/partials/context-format.md`.
91
- 3. For documentation generation, run `prompts/tasks/scan.md` first.
92
- 4. For agent onboarding only, run `prompts/tasks/init-agent-onboarding.md` directly.
93
- 5. Pass the scan result into one downstream documentation prompt, such as `prompts/tasks/readme.md` or `prompts/tasks/stack-docs.md`.
94
- 6. Apply generated docs only after checking that every claim is grounded in provided files.
95
-
96
- ## What The Prompts Do
97
-
98
- | Prompt | Purpose |
99
- | --- | --- |
100
- | `prompts/system/base.md` | Defines the codeforerunner role, quality bar, Markdown rules, and accuracy constraints. |
101
- | `prompts/tasks/scan.md` | Produces the first structured repo scan used by downstream tasks. |
102
- | `prompts/tasks/init-agent-onboarding.md` | Generates or updates `AGENTS.md` from repo evidence plus files such as `CLAUDE.md`, `.cursor/rules/*`, `.cursorrules`, `.github/copilot-instructions.md`, and `opencode.json`. |
103
- | `prompts/tasks/readme.md` | Generates or rewrites a top-level README from scan output and selected files. |
104
- | `prompts/tasks/api-docs.md` | Documents public APIs when endpoints/interfaces are evident. |
105
- | `prompts/tasks/stack-docs.md` | Documents stack-specific areas of a repo. |
106
- | `prompts/tasks/diagrams.md` | Generates Mermaid architecture or flow diagrams. |
107
- | `prompts/tasks/flows.md` | Documents user, request, job, or data flows. |
108
- | `prompts/tasks/version-audit.md` | Audits pinned versions from manifests, lockfiles, Dockerfiles, workflows, or IaC. |
109
- | `prompts/tasks/check.md` | Checks existing docs for staleness against a fresh scan. |
110
- | `prompts/tasks/review.md` | Summarizes documentation impact for review. |
111
-
112
- ## Docs And Spec
113
-
114
- - `SPEC.md` tracks phases, invariants, and tasks so future PRs can make small status updates instead of broad rewrites.
115
- - `docs/getting-started.md` explains manual prompt use.
116
- - `docs/prompt-guide.md` explains how system, partial, and task prompts compose.
117
- - `docs/editor-agent-setup.md` explains how to adapt prompts to local agents.
118
- - `docs/roadmap.md` mirrors the `SPEC.md` phase status in human-readable form.
119
- - `docs/agent-distribution-design.md` records the design that backs the Codex/Claude packages and `forerunner install`.
120
-
121
- ## Configuration
122
-
123
- `forerunner.config.yaml.example` documents the loaded schema. Copy it to `forerunner.config.yaml` to opt in; without that file, `forerunner check` is a silent no-op. The schema has top-level provider/model fields (`provider`, `model`, `api_key_env`, `output_dir`, `context_max_files`, `context_max_lines_per_file`, `approaching_eol_threshold_months`), `ignore_patterns`, `tasks.version_audit`, and `tasks.check`. `forerunner check` honors `tasks.check.enabled_rules` (allowlist of rule IDs, default all) and `tasks.check.ignore_paths` (fnmatch globs applied to scanned docs). Invalid YAML, unknown providers, unknown `api_key_env` providers, or unknown severities surface as a `ConfigError` and exit non-zero.
124
-
125
- ### MCP Server
126
-
127
- `forerunner mcp-server` speaks JSON-RPC 2.0 over stdio and exposes one tool per `prompts/tasks/*.md` (tool name = filename stem). Each `tools/call` returns the resolved `base + partials + task` bundle as text. A scan-first gate enforces SPEC V2: any tool other than `scan` or `init-agent-onboarding` returns an error until `scan` has been called in the same session. Point any MCP-compatible client at `forerunner mcp-server` as a stdio server (running from the target repo so `prompts/tasks/` resolves).
128
-
129
- See `examples/mcp/` for Claude Desktop and mcp-cli wiring examples.
130
-
131
- ## Roadmap
132
-
133
- See `SPEC.md` for the canonical phase/task tracker and `docs/roadmap.md` for the human-readable roadmap.