Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,22 @@ aidocs export-pdf docs/page.md
# Watch mode (auto-sync on file changes)
aidocs watch # Watch docs/ and auto-chunk on changes
aidocs watch --with-vectors # Also generate embeddings

# Documentation coverage analysis
aidocs coverage # Show coverage report
aidocs coverage --format json # Machine-readable output
aidocs coverage --ci # Exit code 1 if below 80%
```

## Architecture

```
src/aidocs_cli/
├── __init__.py # Version and entry point
├── cli.py # Typer CLI commands (init, check, serve, rag-*, export-pdf, watch)
├── cli.py # Typer CLI commands (init, check, serve, rag-*, export-pdf, watch, coverage)
├── installer.py # Copies templates to target project (.claude/commands/, .claude/workflows/)
├── chunker.py # Splits markdown at ## headings for RAG
├── coverage.py # Documentation coverage analysis (routes, components, models detection)
├── embeddings.py # OpenAI embeddings + SQL generation for pgvector
├── server.py # MkDocs config generation and nav discovery
├── pdf_exporter.py # Markdown→HTML→PDF with Chrome/Playwright
Expand All @@ -59,6 +65,7 @@ src/aidocs_cli/
- **CLI (cli.py)**: Uses Typer with Rich for terminal UI. Entry point is `app()`.
- **Installer**: Copies command/workflow templates to target project's `.claude/` directory (or `.cursor/` for Cursor).
- **Chunker**: Creates `.chunks.json` files alongside markdown, tracks changes via `docs/.chunks/manifest.json`.
- **Coverage**: Analyzes codebase for routes/components/models, matches against docs, reports coverage with visual progress bars.
- **Embeddings**: Calls OpenAI API (text-embedding-3-small, 1536 dimensions), outputs `docs/.chunks/sync.sql` for pgvector import.
- **Server**: Auto-discovers nav structure from folder hierarchy, generates ephemeral `mkdocs.yml`.

Expand Down
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,69 @@ aidocs serve
# Edit docs in your editor - changes auto-sync!
```

### `aidocs coverage`

Analyze documentation coverage for your codebase. Scans for routes, components, and models, then checks which items are mentioned in your documentation.

```bash
aidocs coverage # Show coverage summary
aidocs coverage --format json # Machine-readable output
aidocs coverage --format csv # CSV export
aidocs coverage --ci # Exit code 1 if below 80%
aidocs coverage --threshold 70 # Custom threshold
aidocs coverage -c ./src # Specify codebase path
aidocs coverage --all # Show all items
```

**Options:**
| Option | Description |
|--------|-------------|
| `--codebase, -c` | Path to codebase root (default: parent of docs dir) |
| `--format, -f` | Output format: `summary`, `json`, or `csv` |
| `--threshold, -t` | Minimum coverage percentage (exit 1 if below) |
| `--ci` | CI mode: exit 1 if coverage below 80% |
| `--save/--no-save` | Save report to `.chunks/coverage.json` (default: save) |
| `--all, -a` | Show all items (documented and undocumented) |

**Example output:**
```
╭───────────────────────────────────────────────╮
│ Documentation Coverage Report │
│ ───────────────────────────────────────────── │
│ │
│ Routes: 12/15 ( 80%) █████████░░░ │
│ Components: 8/20 ( 40%) ████░░░░░░░░ │
│ Models: 5/5 (100%) ████████████ │
│ │
│ Overall: 25/40 (63%) ███████░░░░░ │
╰───────────────────────────────────────────────╯

Missing documentation:
Routes:
✗ POST /api/webhooks/stripe
src/app/api/webhooks/stripe/route.ts:1
Components:
✗ PaymentForm
src/components/PaymentForm.tsx:1
```

**Supported frameworks:**
- **Next.js** - App Router routes and pages
- **React** - Function and class components
- **Vue/Svelte** - Single-file components
- **Express** - Route handlers
- **FastAPI/Flask** - Python API routes
- **Laravel** - PHP routes
- **Prisma** - Database models
- **TypeScript** - Interfaces and types
Comment on lines +597 to +605
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove only this part or all the changes in readme.md ?


**CI/CD integration:**
```yaml
# GitHub Actions example
- name: Check documentation coverage
run: aidocs coverage --ci
```

## Slash Commands

After running `aidocs init`, these commands are available in Claude Code:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "aidocs"
version = "0.17.0"
version = "0.18.0"
description = "AI-powered documentation generator for web applications. Install docs commands into your Claude Code project."
readme = "README.md"
license = { text = "MIT" }
Expand Down
Loading