Testing & Verification
Skrypt includes three levels of quality assurance: code testing (runtime verification), QA checks (static analysis), and self-healing (automated fixes).
Test code examples
The test command extracts every code block from your documentation, executes it, and reports failures:
skrypt test ./content/docs
Filter by language
skrypt test ./content/docs --language typescript
skrypt test ./content/docs --language python
Auto-fix failures
Feed failing code examples back to the LLM for automatic repair:
skrypt test ./content/docs --fix
Verify output
Compare runtime output against // Output: comments in code blocks:
skrypt test ./content/docs --verify-output
For a code block like:
```typescript
console.log(add(2, 3))
// Output: 5
```
Skrypt will run the code and assert that stdout matches 5.
Docker environments
Run code verification in isolated Docker containers:
skrypt test ./content/docs --environments node-20,python-3.12
This ensures code examples work in clean environments without local dependencies.
Timeout control
Adjust the per-block execution timeout:
skrypt test ./content/docs --timeout 30000
QA checks
The qa command performs static analysis on your documentation:
skrypt qa ./content/docs
Checks include:
- Missing frontmatter or titles
- Broken internal links
- Empty or stub pages
- Unclosed code blocks
- Missing language specifiers on code blocks
- Inconsistent heading hierarchy
- Duplicate content
Auto-fix mode
skrypt qa ./content/docs --fix
Automatically fixes: missing frontmatter, unclosed code blocks, missing language specifiers, and common MDX syntax issues.
Strict mode
Fail on warnings (not just errors) — useful for CI:
skrypt qa ./content/docs --strict
Audit coverage
Compare your documentation against your source code to find gaps:
skrypt audit ./src --docs ./content/docs
This reports:
- Undocumented: public APIs with no corresponding doc page
- Stale: doc pages where the source code has changed since generation
- Orphaned: doc pages with no corresponding source code
JSON output
skrypt audit ./src --docs ./content/docs --format json
Self-healing (Pro)
The heal command runs a 3-phase autonomous fix cycle:
skrypt heal ./content/docs --deep
Phase 1 — QA fixes: Runs all QA checks and auto-fixes issues.
Phase 2 — Code fixes: Extracts failing code examples, feeds compiler errors to the LLM, regenerates until they pass.
Phase 3 — Screenshots: Launches a headless browser, captures screenshots from <Screenshot> directives, and saves them to public/screenshots/.
Run individual phases
skrypt heal ./content/docs --qa-only
skrypt heal ./content/docs --code-only
skrypt heal ./content/docs --screenshots --base-url http://localhost:3000
Dark mode screenshots
skrypt heal ./content/docs --screenshots --dark
CI integration
Generate a GitHub Actions workflow:
skrypt gh-action
This creates a workflow that runs skrypt test and skrypt qa --strict on every pull request, with skrypt heal as an optional auto-fix step.
Typical QA workflow
# Run tests with auto-fix
skrypt test ./content/docs --fix --verbose
# Run QA with auto-fix
skrypt qa ./content/docs --fix
# Check documentation coverage
skrypt audit ./src --docs ./content/docs --public-only
# Full self-healing cycle
skrypt heal ./content/docs --deep