Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

codeforerunner

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

codeforerunner

Model-agnostic repository documentation tooling — installs /forerunner-* slash commands into 30+ agent CLIs

Source
npmnpm
Version
0.4.3
Version published
Weekly downloads
405
Maintainers
1
Weekly downloads
 
Created
Source

codeForerunner — your codebase gets a Forerunner; your docs finally see the light

codeForerunner

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.

Two modes

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.

# From a cloned repo
./install.sh

# One-liner (auto-detects Claude Code, Codex, Gemini CLI)
curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash

# Windows
irm https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.ps1 | iex

# Via forerunner CLI (after pip install)
forerunner install --all claude
forerunner install --all codex

Then in your agent:

/forerunner-scan        ← scan the repo first
/forerunner-readme      ← generate README
/forerunner-check       ← detect doc drift

Mode B — Direct API (needs API key or Ollama)

Install the Python CLI and call your provider directly. Works without any agent CLI installed.

pipx install codeforerunner   # recommended
pip install codeforerunner    # alternative

Configure a provider (or start Ollama for keyless local generation):

export ANTHROPIC_API_KEY=sk-...
forerunner generate readme --stream

If no API key and no --provider flag, forerunner auto-detects Ollama at localhost:11434 and falls back to local mode.

Slash commands

CommandTaskPurpose
/forerunner-scanscanCollect repo evidence (run first)
/forerunner-readmereadmeGenerate or refresh README.md
/forerunner-api-docsapi-docsGenerate API reference docs
/forerunner-diagramsdiagramsGenerate Mermaid architecture diagrams
/forerunner-flowsflowsDocument system flows
/forerunner-stack-docsstack-docsStack-specific developer docs
/forerunner-version-auditversion-auditAudit pinned versions vs EOL
/forerunner-checkcheckCheck docs for staleness
/forerunner-reviewreviewDoc-impact summary for PR review
/forerunner-auditauditSecurity and dependency audit
/forerunner-changelogchangelogGenerate changelog from git log
/forerunner-initinit-agent-onboardingBootstrap or refresh AGENTS.md

Slash command availability depends on the agent CLI. Claude Code, Codex, and Gemini CLI support all 12 commands after install.

Skill install options

FlagEffect
./install.shAuto-detect all agents, install all skills
./install.sh --only claudeClaude Code only
./install.sh --only codexCodex only
./install.sh --only geminiGemini CLI only
./install.sh --dry-runPreview, write nothing
./install.sh --listShow detected agents + skill list
./install.sh --uninstallRemove all installed skills

CLI

pip install codeforerunner
CommandPurpose
forerunner initResolve agent-onboarding bundle to stdout.
forerunner scanResolve scan bundle to stdout.
forerunner doc <task>Resolve base + partials + task bundle to stdout.
forerunner checkRun drift-detection rules; no-op without forerunner.config.yaml.
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.
forerunner doctorHealth report: skill parity, config, provider key, local-mode status. Add --fix to write a starter config.
forerunner mcp-serverServe prompt bundles as MCP tools over stdio (JSON-RPC 2.0).
forerunner install <agent>Install canonical skill into agent-specific directory. Add --all for all per-task skills.

Prompt pack

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

prompts/
├── system/base.md
├── partials/
│   ├── context-format.md
│   ├── output-rules.md
│   └── stack-hints.md
└── tasks/
    ├── scan.md          api-docs.md    audit.md
    ├── readme.md        diagrams.md    changelog.md
    ├── check.md         flows.md       version-audit.md
    ├── review.md        stack-docs.md
    └── init-agent-onboarding.md

Quick start (agent skill mode)

# Install skills into Claude Code
curl -fsSL https://raw.githubusercontent.com/derek-palmer/codeforerunner/main/install.sh | bash

# In Claude Code:
# /forerunner-scan    → scans your repo
# /forerunner-readme  → generates README.md
# /forerunner-check   → checks for doc drift

Quick start (direct API mode)

# 1. Install and configure
pip install codeforerunner
export ANTHROPIC_API_KEY=sk-...

# 2. Run a task
forerunner generate readme --stream

# 3. Enable drift detection
forerunner doctor --fix        # writes forerunner.config.yaml
forerunner check               # run any time or as pre-commit hook

GitHub Action

- uses: derek-palmer/codeforerunner@v0.4.2

No-op when forerunner.config.yaml is absent.

Configuration

Copy forerunner.config.yaml.example to forerunner.config.yaml to opt in to drift rules. Generate a starter config with:

forerunner doctor --fix

Config fields

provider: anthropic          # anthropic | openai | google | ollama
model: claude-opus-4-7
api_key_env:
  anthropic: ANTHROPIC_API_KEY

tasks:
  check:
    enabled_rules:
      - R1-no-cli
      - R2-no-pre-commit
      - R3-no-ci
      - R4-no-installer
      - R5-no-python-package
      - R7-no-mcp
      - R8-no-marketplace
      - RI1-missing-cli
      - RI5-missing-python-package
      - RI7-missing-mcp
      - RV1-version-drift
    ignore_paths:
      - docs/legacy/**/*.md

Drift rules

RuleFires when
R1-no-cliDoc denies having a CLI, but cli.py is present
R2-no-pre-commitDoc denies having pre-commit hooks, but .pre-commit-hooks.yaml present
R3-no-ciDoc denies having CI, but .github/workflows/*.yml present
R4-no-installerDoc denies having an installer, but installer.py present
R5-no-python-packageDoc denies having a Python package, but pyproject.toml present
R6-no-dockerDoc denies having Docker, but Dockerfile/compose.yml present
R7-no-mcpDoc denies having an MCP server, but mcp_server.py present
R8-no-marketplaceDoc denies having a marketplace, but marketplace.json present
RI1-missing-cliDoc references forerunner subcommands but cli.py absent
RI5-missing-python-packageDoc shows pip install codeforerunner but pyproject.toml absent
RI7-missing-mcpDoc references forerunner mcp-server but mcp_server.py absent
RV1-version-driftDoc pins codeforerunner==X.Y.Z differing from current version

MCP Server

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.

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

Providers

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.

ProviderEnv varDefault model
anthropicANTHROPIC_API_KEYclaude-opus-4-7
openaiOPENAI_API_KEYgpt-4o
googleGOOGLE_API_KEYgemini-2.5-pro
ollamaOLLAMA_HOST (optional)llama3

Docs and spec

  • SPEC.md — canonical phase/task tracker
  • docs/getting-started.md — manual prompt use
  • docs/prompt-guide.md — how system, partial, and task prompts compose
  • docs/editor-agent-setup.md — adapting prompts to local agents
  • docs/roadmap.md — human-readable roadmap
  • docs/agent-distribution-design.md — packaging and installer design

Keywords

codeforerunner

FAQs

Package last updated on 26 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts