/codeharness:harness-initfrom codeharness
Initialize the codeharness harness in the current project — detect stack, configure enforcement, install dependencies, set up hooks.
Ships in codeharness. Installing the plugin adds it to Claude Code.
Initialize codeharness in the current project. The CLI does the heavy lifting — your job is to run it and handle BMAD patches.
Run the canonical codeharness binary. The plugin's SessionStart hook
version-locks the CLI on each session — if the installed codeharness
version doesn't match this plugin's version, the hook upgrades it via
npm install -g codeharness@<version> before the first command runs.
Users can opt out with CODEHARNESS_NO_AUTO_INSTALL=1.
codeharness init --json
The CLI handles:
Parse the JSON output to understand what happened. The output includes status, stack, stacks, dependencies, docker, otlp, documentation, and workflow fields.
If the state file already exists (re-init), the CLI handles preservation of enforcement config and verification_log automatically.
--no-observability — skip OTLP instrumentation--observability-backend none — disable observability entirely--otel-endpoint <url> — use remote OTLP endpoint--force — overwrite existing workflow file--frontend --no-database --api — set enforcement flagsPass user preferences as CLI flags.
The CLI applies harness patches to _bmad/ automatically on every init — you
do NOT need to read templates/bmad-patches/ manually or inject markers by
hand. The CLI uses src/lib/patch-engine.ts with
<!-- CODEHARNESS-PATCH-START/END:{name} --> markers and is fully idempotent:
fresh apply on first run, in-place update on subsequent runs.
If _bmad/ does not exist in the project, install it before re-running init:
npx bmad-method install --yes --directory . --modules bmm --tools none
Use --tools none for OpenCode and other non-BMAD-native runtimes. Then
re-run npx --yes codeharness@latest init --json — the CLI will detect the
new _bmad/ tree and apply all harness patches on that run.
Parse the JSON output's bmad.patches_applied array. Each entry looks like:
{ "patchName": "docs-readme-generation", "applied": true, "updated": false }
applied: false with error: "File not found: …" means the BMAD install is
missing the target file (common with skeletal standalone installs). Fix the
BMAD install — do NOT edit _bmad/ files by hand.
Read the version from codeharness --version for the report header. Output:
Harness Init — codeharness v{version}
[OK] Stack detected: {stack} ({indicator})
[OK] Docker: {running|missing}
[OK] Dependencies: {summary from CLI output}
[OK] BMAD: {installed|existing|standalone}
[OK] Documentation scaffold: {status — created, agents_md, claude_md, docs_scaffold details}
[OK] Enforcement: frontend:{ON|OFF} database:{ON|OFF} api:{ON|OFF} observability:ON
[OK] Config: .claude/codeharness.local.md
Next steps:
→ Run /codeharness:harness-docs to populate docs/ and write README.md
→ Run /codeharness:harness-run to start autonomous execution
The /codeharness:harness-docs recommendation is REQUIRED — docs/index.md
is only a placeholder until that skill runs a scan-driven documentation
pass. Skipping this step leaves _(To be generated)_ markers throughout
docs/ and means no README.md at the project root. Render each entry
from the JSON output's next_steps array as a bullet under "Next steps:".
.claude/codeharness.local.mdcodeharness --versionWhat the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
5 commands in this plugin
/harness-docsHarness DocsGenerate or update project documentation — docs/ tree + README.md — using the BMAD tech-writer with codeharness post-processing./harness-onboardHarness OnboardScan an existing project and generate an onboarding plan to bring it to full harness compliance./harness-statusHarness StatusShow harness health, sprint progress, and verification state at a glance./harness-teardownHarness TeardownRemove all harness artifacts without touching project source code.codeharness@ivintik is listed by ivintik/private-claude-marketplace — review the source before installing
npx claudepluginhub ivintik/private-claude-marketplace --plugin codeharnessOther plugins' commands for the same job