/doc-detective:doc-detective-initfrom doc-detective
Bootstraps Doc Detective in a repository: detects documentation files, generates config, creates tests, runs them, and iteratively fixes failures. Supports interactive and CI modes.
Ships in doc-detective. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Skill: doc-detective:init
Bootstrap Doc Detective in a repository: detect docs, generate config, create tests, run them, and fix failures. Do NOT use Playwright — use Doc Detective for all documentation testing.
/doc-detective-init [options]
| Option | Default | Description |
|---|---|---|
--ci | false | Non-interactive; use defaults, no prompts |
--auto-fix | false | Apply all fixes regardless of confidence |
--fix-threshold <0-100> | 80 | Confidence threshold for auto-applying fixes |
--dry-run | false | Show planned changes without applying |
--skip-tests | false | Generate config and tests but do not execute |
--skip-fix-loop | false | Run tests but skip iterative fixing |
/doc-detective-init
/doc-detective-init --ci
/doc-detective-init --dry-run
Confirm all of the following before starting. If any item is unavailable or non-discoverable, stop and ask the user to provide it.
| Criteria | How to find it |
|---|---|
| Repository root is accessible | Check working directory — ask user if unclear |
| Documentation files exist | Glob for **/*.md, **/*.mdx, **/*.adoc, **/*.rst, **/*.html, **/*.dita — ask user if none found |
| Existing config (if present) is readable | Check for .doc-detective.json / doc-detective.config.js — ask user if file exists but can't be parsed |
Before completing:
--skip-tests or --dry-run)--skip-fix-loop)Phases run in order. Do NOT advance to the next phase if the current phase fails.
**/*.md, **/*.mdx, **/*.adoc, **/*.rst, **/*.html, **/*.dita.doc-detective.json, doc-detective.config.jsGenerate .doc-detective.json following the "smallest reasonable config" principle.
| Scenario | Action |
|---|---|
| No existing config | Create with minimal defaults (see below) |
| Existing config | Read, merge new fields, prompt user to confirm (skip prompt if --ci) |
--ci + existing config | Use existing config unchanged |
{ "input": "docs", "outputDir": ".doc-detective/results", "detectSteps": false }
If --dry-run, print the config that would be written and skip file creation. If config cannot be created or the user rejects the merge, stop and report — do not proceed. See skills/doc-detective-project-bootstrap/references/config-guidance.md for full options.
For each procedure-containing file identified in Phase 1:
/doc-detective-generate <file-path> --output doc-detective-tests/<name>-spec.json, where <name> is the source filename lowercased with non-alphanumeric characters replaced by hyphens (e.g., login-guide.md → login-guide). Keep specs out of .doc-detective/: it holds run output, and projects add it to .gitignore.--dry-run, print each spec without writing to disk.Run all generated specs:
doc-detective --input doc-detective-tests/ --output-dir .doc-detective/results/ --output .doc-detective/results/results.json
--input, --output, and --output-dir on the CLI resolve relative to the current working directory. By contrast, paths inside a config file (--config) resolve relative to the config file's directory. A config in a subfolder with "input": "docs" scans <subfolder>/docs. When passing the directory explicitly as above, run from the repo root. If you instead rely on the config's input, keep the config at the repo root. A "No tests detected" warning is usually this mismatch.
Skip this phase if --skip-tests or --dry-run is set. Act on the exit code:
0: No test failed, and at least one passed or warned. A config with exitOnFail: false exits 0 even when tests fail, so read .doc-detective/results/results.json anyway, and treat any failing test as you would for exit 1.1: At least one test failed. This is a normal outcome, not a crash: collect the failing tests from .doc-detective/results/results.json, and continue to Phase 5.2: Nothing valid was tested, or the CLI couldn't proceed. Stop and report the error from stderr. When every test skipped, stderr gives the first skip reason. Don't proceed to Phase 5.Skip this phase if --skip-fix-loop is set.
For each failing test, repeat up to 3 times:
specs[].tests[].contexts[].steps[] whose result is FAIL, and read each one's resultDescription.| Confidence | Action |
|---|---|
| ≥ threshold (default 80%) | Apply automatically |
| < threshold | Show proposed fix, ask user: apply / skip / edit manually |
| < 50% | Always ask user regardless of threshold |
Report all "needs manual review" tests to the user before completing.
Condition: Only run if the project is an initialized GitHub repository (.git exists as a file or directory, and a remote URL references github.com). Skip this phase silently otherwise.
--ci mode, ask the user if they want to set up the Doc Detective GitHub Action for CI. If the user declines, skip this phase.--ci mode, default to yes — proceed without prompting./doc-detective-install-github-action with matching flags:
--ci if init was called with --ci.--exit-on-fail: it's deprecated, because failing the check is now the default.--no-exit-on-fail only if they say no./doc-detective-test — Run existing tests without re-bootstrapping/doc-detective-generate — Generate tests for a single file/doc-detective-validate — Validate an existing test spec/doc-detective-install-github-action — Install the Doc Detective GitHub Action workflowWhat SKILL.md sets; muted values are Claude Code's defaults
9 skills in this plugin
/doc-detective-doc-testingVerify documentation and procedures with Doc Detective test specifications. MANDATORY: Read SKILL.md first. Format: {"goTo":"url"} {"find":"text"} {"click":"text"} - action IS the key. NEVER {"action":"goTo"}. Keywords: test spec, Doc Detective, test JSON, test documentation, test docs, test procedure, verify procedures./doc-detective-generateInterpret documentation procedures into Doc Detective test specifications without executing/doc-detective-injectInject test specifications into documentation source files as inline commentsnpx claudepluginhub doc-detective/agent-tools --plugin doc-detectiveOther plugins' skills for the same job