com um clique
doc-detective-init
Initialize Doc Detective in a repository with documentation detection, config generation, test creation, and iterative fix loop
Menu
Initialize Doc Detective in a repository with documentation detection, config generation, test creation, and iterative fix loop
Verify 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.
Verify 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.
Verify 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.
Interpret documentation procedures into Doc Detective test specifications without executing
Interpret documentation procedures into Doc Detective test specifications without executing
Validate Doc Detective test specifications or configuration files
| name | doc-detective-init |
| description | Initialize Doc Detective in a repository with documentation detection, config generation, test creation, and iterative fix loop |
| metadata | {"version":"1.4.0","organization":"Doc Detective","date":"May 2026","abstract":"Initialize Doc Detective in a repository with documentation detection, config generation, test creation, and iterative fix loop. Supports interactive and CI modes.","references":"https://doc-detective.com, https://github.com/doc-detective/doc-detective","user-invocable":"true"} |
| user-invocable | true |
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", "output": ".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/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).--dry-run, print each spec without writing to disk.Run all generated specs:
doc-detective --input .doc-detective/doc-detective-tests/ --output .doc-detective/results/
Skip this phase if --skip-tests or --dry-run is set. If the command fails to execute, stop and report the error — do not proceed to Phase 5. After execution, collect all failing tests from the results output.
Skip this phase if --skip-fix-loop is set.
For each failing test, repeat up to 3 times:
resultDescription to identify the failure.| 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:
--ci mode, pass --exit-on-fail by default./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 workflow