This repo defines the AISD (AI Small Docs) standard.
Docs here are meta: they teach AI how to read and write AISD-style documentation so AI can reason about real codebases with less noise and fewer tokens.
Status: Early stage, no empirical evidence. Core idea: AISD is intermediate representation between human intent and generated code.
Repository structure:
README.md- Overview, philosophy, when to usestyle-guide.md- Writing principles, validationbest-practices.md- File organization, context loadingTODO.md- Task tracking, future worktemplates/- Templates (TODO - to be created)
- Audience: senior engineers and AI agents.
- Voice: clear, direct, low-fluff. No hype, no marketing tone.
- Goal: increase signal density and structural clarity, not word count.
- Prefer:
- lists over paragraphs
- schemas and examples over abstract prose
- explicit constraints over vague “best practices”
- When editing:
- Preserve existing structure and headings where possible.
- Tighten and clarify; avoid rewriting everything unless necessary.
- If something is ambiguous, propose 2–3 concrete options instead of inventing new concepts silently.
All commit messages must be English, single line, and follow:
<type>[<area>]: <short-message>
type∈spec,docs,chore,refactor,testspec– changes to AISD spec / formatsdocs– guides, examples, explanationschore– repo hygiene, tooling, configrefactor– structural changes without behavior changetest– test cases, validation docs, fixtures
area∈core,examples,prompts,guides,metacore– core AISD concepts and specexamples– example docs, reference casesprompts– prompt templates and patternsguides– how-to, usage guides, workflowsmeta– README, contribution notes, project meta
<short-message>:- plain English phrase
- max 20 words
- imperative
- lowercase
- words separated by spaces
- no trailing period
Examples
spec[core]: tighten aisd file schemadocs[guides]: add cursor integration sectiondocs[examples]: add refund rule case studychore[meta]: update repo structure notesrefactor[prompts]: normalize agent instruction formattest[core]: add schema validation cases
When changing any AISD-related doc:
- Make the intent, constraints, and contracts more explicit.
- Prefer:
- "AI can assume X" over "usually X"
- "Never do Y" over "avoid Y where possible"
- Protect the 3,000-line abstraction idea:
- Avoid adding low-signal commentary.
- Move long narrative examples into dedicated example files if needed.
- Keep examples realistic:
- Use scenarios like refunds, fraud detection, email notifications, etc.
- Show how AISD helps AI consume a large codebase through a small, structured surface.
AISD principles (apply to all AISD docs):
- Language: MUST/REQUIRED/FORBIDDEN (never should/might/could/typically/usually)
- Explicit constraints: "1-200 chars" not "short"
- Format: Tables/lists/code blocks (not prose)
- File size: Index <100 lines, Spec 200-500 lines, target 40 chars/line (non-empty)
- Structure: One concept per file, H1 → H2 → H3 (never skip levels), relative paths only
README.md- Explains why AISD exists and when to use it.
- Keep it focused on philosophy and problem framing.
- Spec files (AISD formats, schemas)
- Treat them as source of truth.
- Update spec first, then examples, then guides.
- Example / guide files
- Show end-to-end flows:
- analysis → planning → implementation → review
- Highlight how AISD replaces “load 30 files” with “load 1–3 AISD docs”.
- Show end-to-end flows:
- Default to shorter, sharper, more explicit.
- If a change doesn't help an AI agent answer, plan, or implement better, don't add it.
Forbidden words:
grep -rn "should\|might\|could\|typically\|usually" . --include="*.md"Line counts:
wc -l *.md | awk '$1 > 500 {print $2 ": " $1}'Avg line length:
for file in *.md; do
non_empty=$(grep -c '[^[:space:]]' "$file")
chars=$(wc -c < "$file")
avg=$(( chars / non_empty ))
[ $avg -gt 40 ] && echo "$file: $avg chars/line"
donePrimary use: AI-authored specs from human requirements.
| Human Input | AI Generates | Purpose |
|---|---|---|
| Policy requirements | Business rules | Code generation |
| Design discussion | Architecture ADRs | Implementation guidance |
| Feature request | Behavioral spec | Test + code generation |
Use cases:
- Business rules, ADRs, integration patterns, behavioral specs
- Token-efficient summaries (only when benefit is clear, source formats remain authoritative)
Not AISD: Tutorials, marketing, onboarding (human-targeted content)
Add template:
- Create in
templates/ - Use tables, MUST/REQUIRED, conciseness
- Keep under 500 lines
- Mark "Core" (proven) or "Experimental" (unproven)
- Add to
templates/index.md
Update core docs:
- Edit
README.md,style-guide.md,best-practices.md - Use tables, explicit constraints, no prose
- Add ❌ bad and ✅ good examples
- Validate (line length, forbidden words)
Update TODO:
- Edit
TODO.md - Follow todo-md format (checkboxes, priorities, metadata)
- Use hierarchical structure (Critical → High → Medium → Low → Research)
- Add time estimates where helpful (~2h, ~4h, etc)
For meta-docs (this file, README, etc.):
- Use "Consider", "Target", "Example"
- Not "MUST", "Standard", "Enforce"
- Acknowledge uncertainty
- Invite community validation
For AISD docs (style-guide, best-practices, etc.):
- Use MUST/REQUIRED/FORBIDDEN per AISD principles
- AI-authored - Docs generated by AI, reviewed by humans
- Intermediate representation - Bridge between human intent and code
- Self-compliance - Follow own rules
- Honest - Acknowledge uncertainty
- Focused - Business rules/ADRs (not replacing OpenAPI/DDL)
- Git-reviewed - Humans approve AI-generated diffs
- Context optimized - File sizes for AI loading
Critical gaps (no evidence yet):
- No before/after AI tests
- No token efficiency data
- No proof 40 chars/line or 200-500 lines matter
- No multi-model testing