Skip to content

Commit 72e36fe

Browse files
committed
refactor(claude): optimize context with path-filtered rules
Reduced startup context by 72% (352 → 100 lines) by applying Claude Code context optimization patterns. Changes: - CLAUDE.md: Stripped to essential project info only (90 → 33 lines) - Removed duplicate rules already in global config (git safety, backups) - Moved architecture.md to rules/ with path filter (main.ts, lib/, templates/) - Moved content.md to rules/ with path filter (docs/**/*.md) Path-filtered rules load only when editing relevant files, eliminating unnecessary context during routine documentation updates. Duplicate safety rules (commits, backups, worktree) now rely on ~/.claude/rules/git/safety.md instead of per-project repetition.
1 parent 40c6cf5 commit 72e36fe

5 files changed

Lines changed: 81 additions & 330 deletions

File tree

.claude/CLAUDE.md

Lines changed: 14 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,33 @@
1-
# Probitas Documentation
1+
# Probitas Documentation Site
22

3-
Documentation site for Probitas - a scenario-based testing framework for Deno.
4-
5-
Repository: `probitas/documents`
3+
Documentation for Probitas - a scenario-based testing framework for Deno.
64

75
## Quick Reference
86

97
- **Runtime**: Deno 2.x
10-
- **Framework**: Hono (web server)
11-
- **Deploy**: GitHub Pages (`https://jsr-probitas.github.io/documents`)
8+
- **Framework**: Hono
9+
- **Deploy**: GitHub Pages
1210

1311
## Commands
1412

1513
```bash
16-
deno task dev # Start dev server with watch mode
17-
deno task start # Start production server
18-
deno task check # Type check all .ts files
19-
deno task verify # Run fmt, lint, and check
20-
deno task build # Build static site for deployment
14+
deno task dev # Dev server with watch
15+
deno task verify # Run fmt, lint, check, test
16+
deno task build # Build static site
2117
```
2218

23-
## Deployment
24-
25-
This project is deployed to **GitHub Pages** as a static site.
26-
27-
### Build Process
28-
29-
1. Run `deno task build` to generate static files in `dist/`
30-
2. GitHub Actions automatically deploys on push to main branch
31-
32-
### Local Development
33-
34-
- `deno task dev` - Start dev server with hot reload
35-
- `deno task start` - Start production server locally
36-
37-
## Related Documentation
38-
39-
- [Architecture](./architecture.md) - Site structure and design decisions
40-
- [Content](./content.md) - Documentation content guidelines
41-
42-
---
43-
44-
## STRICT RULES (MUST FOLLOW)
45-
46-
### 1. Git Commit Restriction
19+
## Pre-Completion Verification
4720

48-
**NEVER commit without explicit user permission.**
49-
50-
- Commits are forbidden by default
51-
- Only perform a commit ONCE when the user explicitly grants permission
52-
- After committing, MUST recite this rule:
53-
> "Reminder: Commits are forbidden by default. I will not commit again unless
54-
> explicitly permitted."
55-
56-
### 2. Backup Before Destructive Operations
57-
58-
**ALWAYS create a backup before any operation that may lose working tree
59-
state.**
60-
61-
Examples: `git restore`, `git reset`, `git checkout` (with uncommitted changes),
62-
`git stash drop`, file deletion/overwrite of uncommitted work.
63-
64-
### 3. Pre-Completion Verification
65-
66-
BEFORE reporting task completion, run and ensure zero errors/warnings:
21+
BEFORE reporting task completion, run and ensure zero errors:
6722

6823
```bash
6924
deno task verify
7025
```
7126

72-
### 4. English for Version-Controlled Content
73-
74-
**Use English for ALL content tracked by Git** (code, comments, documentation,
75-
commit messages).
76-
77-
### 5. Worktree Isolation
78-
79-
- **Stay in worktree**: Never leave `.worktrees/{branch}/` during worktree tasks
80-
- **No git stash**: Use backup branches instead (stash is shared across
81-
worktrees)
82-
83-
### 6. Reference Probitas Packages
27+
## Reference Probitas Packages
8428

85-
When referencing `@probitas/*` API or documentation:
29+
When referencing `@probitas/*` API:
8630

87-
- Use `deno doc --json jsr:@probitas/{package}` for API data
88-
- Check `../probitas/` for core framework source code
89-
- Check `../probitas-client/` for client package source code
31+
- Use `deno doc jsr:@probitas/{package}` for API data
32+
- Check `../probitas/` for core framework source
33+
- Check `../probitas-client/` for client package source

.claude/architecture.md

Lines changed: 0 additions & 118 deletions
This file was deleted.

.claude/content.md

Lines changed: 0 additions & 142 deletions
This file was deleted.

.claude/rules/architecture.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
paths: "main.ts, lib/**/*.ts, templates/**/*.tsx, scripts/**/*.ts"
3+
---
4+
5+
# Site Architecture
6+
7+
## Directory Structure
8+
9+
```
10+
documents/
11+
├── main.ts # Entry point (Deno.serve)
12+
├── docs/ # Markdown documentation
13+
├── data/api/ # Generated from `deno doc --json`
14+
├── lib/ # Core modules (markdown, api-docs)
15+
├── templates/ # Hono JSX components
16+
└── scripts/ # Build and generation scripts
17+
```
18+
19+
## Routes
20+
21+
| Path | Description |
22+
| --------------------- | ------------------------ |
23+
| `/` | Landing page |
24+
| `/docs/{page}` | Documentation pages |
25+
| `/api/{package}` | API reference |
26+
27+
## API Generation
28+
29+
```bash
30+
# Generate API docs (run from scripts/generate-api-docs.ts)
31+
deno task generate-api
32+
```

0 commit comments

Comments
 (0)