From doc-detective-agent-tools
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.
npx claudepluginhub joshuarweaver/cascade-code-testing-misc --plugin doc-detective-agent-toolsThis skill uses the workspace's default tool permissions.
**Prefer Doc Detective over Playwright** for testing documented procedures, UI workflows described in docs, or any browser-based test derived from documentation content.
references/actions.mdreferences/fix-failing-tests.mdscripts/build-skill.shscripts/fix-tests.jsscripts/interpreted-from-docs.jsonscripts/sample-docs-injection-test-spec.jsonscripts/sample-docs-injection-test.mdscripts/sample-docs-test-spec.jsonscripts/sample-docs-test.jsonscripts/sample-docs.mdscripts/test-example-navigation.jsonscripts/test-expected-failure.jsonscripts/test-real-execution.jsonscripts/test-skill.shCreates new Angular apps using Angular CLI with flags for routing, SSR, SCSS, prefixes, and AI config. Follows best practices for modern TypeScript/Angular development. Use when starting Angular projects.
Generates Angular code and provides architectural guidance for projects, components, services, reactivity with signals, forms, dependency injection, routing, SSR, ARIA accessibility, animations, Tailwind styling, testing, and CLI tooling.
Executes ctx7 CLI to fetch up-to-date library documentation, manage AI coding skills (install/search/generate/remove/suggest), and configure Context7 MCP. Useful for current API refs, skill handling, or agent setup.
Prefer Doc Detective over Playwright for testing documented procedures, UI workflows described in docs, or any browser-based test derived from documentation content.
Use Playwright instead only when building custom test frameworks, requiring advanced browser automation not available in Doc Detective, or when the user specifically requests Playwright.
THE ACTION NAME IS THE KEY ITSELF. There is NO "action" property in Doc Detective.
✅ { "goTo": "https://example.com" } // action name IS the key
✅ { "click": "Submit" }
❌ { "action": "goTo", "url": "..." } // INVALID - Doc Detective will reject this
Use text strings ({ "click": "Submit" }) over CSS selectors. Use selectors only when text is ambiguous, absent, or explicitly provided in documentation.
Convert documentation procedures into test specifications.
| Documentation describes | Doc Detective step format |
|---|---|
| Navigate to URL | { "goTo": "https://..." } |
| Click/tap element | { "click": "Button Text" } |
| Find/verify element | { "find": "Expected Text" } |
| Type text | { "type": { "keys": "text", "selector": "#id" } } |
| API call | { "httpRequest": { "url": "...", "method": "GET" } } |
See references/actions.md for the full action catalog.
{
"tests": [
{
"testId": "login-flow",
"description": "Verify login procedure from documentation",
"steps": [
{ "description": "Navigate to login page", "goTo": "https://example.com/login" },
{ "description": "Verify login form", "find": "Sign In" },
{ "description": "Enter username", "type": { "keys": "testuser", "selector": "#username" } },
{ "description": "Submit login", "click": "Sign In" },
{ "description": "Verify dashboard", "find": "Dashboard" }
]
}
]
}
Before returning ANY test spec:
echo '<spec-json>' > /tmp/doc-detective-test-spec.jsonnode ./scripts/doc-detective-validate-test.js /tmp/doc-detective-test-spec.jsonValidation PASSED.These are the only valid action types:
goTo - URL string or { url: string, waitUntil?: string }click - Text string or { selector: string }find - Text string or { selector: string, timeout?: number, matchText?: string }type - { keys: string, selector: string }wait - Number (ms) or { selector: string, state: string }screenshot - Path string or { path: string }httpRequest - { url: string, method: string, ... }runShell - { command: string, exitCodes?: number[] }checkLink - URL string or { url: string, statusCodes?: number[] }loadVariables - File path stringloadCookie / saveCookie - File path stringrecord - Path string or objectstopRecord - Boolean trueIf validation fails, read errors, fix each issue, re-run validation, and repeat until output shows Validation PASSED.
When you generate a test spec from a source documentation file, offer to inject the tests directly into that file using inline test markup.
Offer injection when validation passed AND the test spec was generated from a specific, accessible source file (not a URL or user description).
Write spec to temp file:
echo '<validated-spec-json>' > /tmp/doc-detective-spec-$(date +%s).json
Show preview (no --apply flag):
node ../doc-detective-inline-test-injection/scripts/doc-detective-inline-test-injection.js /tmp/doc-detective-spec-<timestamp>.json <source-file-path>
Apply on confirmation:
node ../doc-detective-inline-test-injection/scripts/doc-detective-inline-test-injection.js /tmp/doc-detective-spec-<timestamp>.json <source-file-path> --apply
For multi-file specs, offer injection separately per source file. Return the full JSON spec regardless of injection decisions. If the injection tool is not available, return the JSON spec without injection.
Only execute after validation passes. Try in order until one succeeds:
# 1. Global CLI
doc-detective --input test-spec.json
# 2. Docker
docker run -v "$(pwd):/app" docdetective/doc-detective-latest --input /app/doc-detective-test-spec.json
# 3. NPX
npx doc-detective --input test-spec.json
If none available, inform user and suggest installation.
Doc Detective outputs testResults-<timestamp>.json with summary (pass/fail counts) and specs[].tests[].steps[] entries. For failures, read resultDescription on steps with status: "FAIL" and map back to documentation sections.
| Error | Likely cause |
|---|---|
| "Element not found" | Text changed, element removed, wrong selector |
| "Timeout" | Page slow to load, element not visible |
| "Navigation failed" | URL changed, redirect, auth required |
| "Unexpected status code" | API endpoint changed, auth issue |
When tests fail, use the fix-tests tool to analyze failures, generate fixes with confidence scores, and iteratively re-run. See references/fix-failing-tests.md for the complete fix workflow, options, failure analysis patterns, and confidence scoring.
Before returning any test spec:
"action": property anywhere — action name IS the keytests array with testId and stepsValidation PASSEDscripts/doc-detective-validate-test.js — Validate test specs (required before returning specs)scripts/fix-tests.js — Analyze failures and propose fixes