This repository contains the documentation website for Behavioral Contracts, built with Docusaurus.
docs/
├── docs/ # Documentation pages (markdown)
├── blog/ # Blog posts (markdown)
├── src/ # React components and pages
├── static/ # Static assets (images, etc.)
├── scripts/ # Auto-generation scripts
└── docusaurus.config.ts # Docusaurus configuration
The following documentation pages are automatically generated from source:
- CLI Reference - Generated from
verify-cli --helpoutput - Schema Reference - Generated from
corpus/schema/contract.schema.json - Package Pages - Generated from
corpus/packages/*/contract.yaml
IMPORTANT: Do NOT edit auto-generated files by hand. Run npm run docs:generate to regenerate them.
npm installnpm startThis starts a local development server and opens a browser window. Most changes are reflected live without restarting the server.
npm run buildThis command generates static content into the build directory and can be served using any static hosting service.
Before building, regenerate auto-generated docs:
npm run docs:generateThis runs all generation scripts:
docs:generate-cli- Regenerate CLI reference from verify-clidocs:generate-schema- Regenerate schema reference from corpusdocs:generate-packages- Regenerate package pages from contracts
Before committing, validate all examples:
npm run validateThis ensures:
- All TypeScript code examples compile
- All CLI commands actually work
- All contract examples are valid YAML
- All internal links are not broken
Edit these files directly:
docs/introduction/*.md- Conceptual explanationsdocs/getting-started/*.md- Tutorialsdocs/ai-integration/*.md- AI usage guidesdocs/benchmarking/*.md- Benchmarking guidesdocs/contributing/*.md- Contribution guidesdocs/reference/*.md- FAQ, glossary, etc.
Do NOT edit these files:
docs/cli-reference/*.md(except ci-cd-integration.md)docs/contract-schema/schema-reference.mddocs/supported-packages/*.md(except overview.md intro)
Run npm run docs:generate to regenerate them.
When adding code examples, use markers to enable validation:
```typescript expectsViolation // This should trigger a violation await axios.get('/api/users'); // Missing try-catch ```
```typescript expectsClean // This should NOT trigger violations try { await axios.get('/api/users'); } catch (error) { // Handle error } ```
The validation script will compile these examples and run verify-cli against them.
Deployment is handled automatically via GitHub Actions:
- Push to
mainbranch - CI runs validation (
npm run validate) - CI generates docs (
npm run docs:generate) - CI builds site (
npm run build) - CI deploys to Vercel/Netlify
See .github/workflows/deploy.yml for details.
See CONTRIBUTING.md for the full contribution guide.
- ✅ DO edit conceptual documentation directly
- ✅ DO add blog posts for case studies and announcements
- ✅ DO run
npm run validatebefore committing - ❌ DON'T edit auto-generated files
- ❌ DON'T add code examples without validation markers
- ❌ DON'T commit broken links or invalid examples
Documentation content is licensed under CC BY 4.0.