Skip to content

Testing & Verification

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:

Terminal
skrypt test ./content/docs

Filter by language

Terminal
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:

Terminal
skrypt test ./content/docs --fix

Verify output

Compare runtime output against // Output: comments in code blocks:

Terminal
skrypt test ./content/docs --verify-output

For a code block like:

```typescript
console.log(add(2, 3))
// Output: 5
```
markdown

Skrypt will run the code and assert that stdout matches 5.

Docker environments

Run code verification in isolated Docker containers:

Terminal
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:

Terminal
skrypt test ./content/docs --timeout 30000

QA checks

The qa command performs static analysis on your documentation:

Terminal
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

Terminal
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:

Terminal
skrypt qa ./content/docs --strict

Audit coverage

Compare your documentation against your source code to find gaps:

Terminal
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

Terminal
skrypt audit ./src --docs ./content/docs --format json

Self-healing (Pro)

The heal command runs a 3-phase autonomous fix cycle:

Terminal
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

Terminal
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

Terminal
skrypt heal ./content/docs --screenshots --dark

CI integration

Generate a GitHub Actions workflow:

Terminal
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

Terminal
# 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
Was this helpful?