From ailang
Create AILANG design documents in the correct format and location. Use when user asks to create a design doc, plan a feature, or document a design. Handles both planned/ and implemented/ docs with proper structure.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ailang:design-doc-creatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Create well-structured design documents for AILANG features following the project's conventions.
Create well-structured design documents for AILANG features following the project's conventions.
Use the data above first. Only re-run these commands manually if the injected context is empty or you need to refresh after making changes.
Most common usage:
# User says: "Create a design doc for better error messages"
# This skill will:
# 1. AUTO-SEARCH for related design docs (Ollama neural embeddings)
# 2. Show matches from implemented/ and planned/ directories
# 3. Auto-populate "Related Documents" section in template
# 4. Proceed automatically (no confirmation needed)
# 5. Create design_docs/planned/better-error-messages.md
# 6. Fill template with proper structure
Automatic Related Doc Search (v0.6.3+):
When you run the create script, it automatically:
m-dx2-better-errors → "better errors")$ .claude/skills/design-doc-creator/scripts/create_planned_doc.sh m-semantic-caching
🔍 Searching for related design docs...
Implemented docs matching "semantic caching":
[SimHash - instant]
1. design_docs/implemented/v0_4_0/monomorphization.md (1.00)
2. design_docs/implemented/v0_3_18/M-DX4-SPRINT-PLAN.md (0.95)
[Neural - semantic matching]
1. design_docs/implemented/v0_6_0/m-doc-sem-lazy-embeddings.md (0.45)
2. design_docs/implemented/v0_6_0/semantic-caching-complete.md (0.42)
Planned docs matching "semantic caching":
[SimHash - instant]
1. design_docs/planned/v0_7_0/M-REPL1_persistent_bindings.md (1.00)
[Neural - semantic matching]
1. design_docs/planned/v0_7_0/semantic-caching-future.md (0.50)
ℹ Related docs found above - review them after creation if needed.
Why dual search? SimHash is instant but keyword-dependent. Neural finds semantically related docs even when keywords don't match. You see both so you can judge which results are more relevant.
Invoke this skill when:
When invoked by the AILANG Coordinator (detected by GitHub issue reference in the prompt), you MUST output this marker at the end of your response:
DESIGN_DOC_PATH: design_docs/planned/vX_Y/design-doc-name.md
Why? The coordinator uses this marker to:
Example completion:
## Design Document Created
I've created the design document...
**DESIGN_DOC_PATH**: `design_docs/planned/v0_6_3/m-feature-design.md`
scripts/create_planned_doc.sh <doc-name> [version]Create a new design document in design_docs/planned/.
Version Auto-Detection:
The script automatically detects the current AILANG version from CHANGELOG.md and suggests the next version folder. This prevents accidentally placing docs in wrong version folders.
Usage:
# See current version and suggested target
.claude/skills/design-doc-creator/scripts/create_planned_doc.sh
# Output: Current AILANG version: v0.5.6
# Suggested next version: v0_5_7
# Create doc in planned/ root (no version)
.claude/skills/design-doc-creator/scripts/create_planned_doc.sh m-dx2-better-errors
# Create doc in next version folder (recommended)
.claude/skills/design-doc-creator/scripts/create_planned_doc.sh reflection-system v0_5_7
What it does:
ailang docs search --neural (Ollama embeddings)implemented/ and planned/scripts/move_to_implemented.sh <doc-name> <version>Move a design document from planned/ to implemented/ after completion.
Usage:
.claude/skills/design-doc-creator/scripts/move_to_implemented.sh m-dx1-developer-experience v0_3_10
What it does:
1. Gather Requirements
Ask user:
⚠️ CRITICAL: Audit for Systemic Issues FIRST
Before writing a design doc for a bug fix, ALWAYS ask: "Is this part of a larger pattern?"
The Anti-Pattern (incremental special-casing):
v1: Add feature for case A
v2: Bug! Add special case for B
v3: Bug! Add special case for C
v4: Bug! Add special case for D
...forever patching
The Pattern to Follow (unified solutions):
v1: Bug report for case B
BEFORE writing design doc:
1. Search for similar code paths
2. Check if A, C, D have same gap
3. Design ONE fix covering ALL cases
v2: Unified fix - no future bugs in this area
Concrete Example (M-CODEGEN-UNIFIED-SLICE-CONVERTERS, Dec 2025):
Bug reported: [SolarPlanet] return type panics
❌ Quick fix design doc: Add ConvertToSolarPlanetSlice
(Will need ConvertToAnotherRecordSlice later...)
✅ Systemic design doc: Audit ALL slice types
Found: []float64 ALSO broken!
Found: []*ADTType partially broken!
One unified fix covers all 3 gaps.
Analysis Checklist (do BEFORE writing design doc):
ailang check (HARD GATE — see below)⚠️ CRITICAL: Verify Every Language Claim Before Asserting It (HARD GATE)
Any statement of the form "AILANG does / does not support X" MUST be verified with a live
ailang check before it goes in the doc. This is not optional. A design doc that
mischaracterizes the language sends the implementer to build something that already exists,
reject something that's fine, or fix a non-problem.
The check takes 10 seconds:
tmp=$(mktemp -d)
cat > $tmp/claim.ail <<'EOF'
module test/claim
-- the exact construct you're claiming is (un)supported
import std/list as L
export func main() -> () ! {} = ()
EOF
ailang check $tmp/claim.ail # COMPILES = supported; PAR_/type error = not
rm -rf $tmp
Required in the doc: every "supported"/"unsupported" claim must carry either
(a) an ailang check result/transcript, or (b) a citation to a reference page or implemented
design doc. Unverified assertions are treated as unproven and the doc cannot proceed to sprint.
Also verify the FREQUENCY claim if the doc cites eval data ("fails in N models", "X% of
failures"): segment by recent date (not all-time aggregate — old baselines mix in pre-fix
runs), and confirm the cited construct is the ACTUAL cause of the failure, not a co-occurring
line. A regex that flags as <word> in an import is NOT proof the import is the cause.
Case study (2026-06-03, this exact failure): Two hand-written eval-gap docs asserted
language limitations without running ailang check:
m-type-constraints claimed "AILANG has no typeclasses, use explicit comparators." FALSE —
AILANG infers Ord/Num via dictionary passing; mymax[a](x:a,y:a)=if x>y then x else y runs on
int AND string. The doc would have built an unnecessary feature.m-import-alias claimed "AILANG has no import aliases, implement them." FALSE — import M as L
and import M (f as g) both compile. The cited "6% of failures" was a detection-heuristic
false positive: 0 of 16 flagged failures actually failed on an alias. Doc was REJECTED.Both errors were a 10-second ailang check away from being caught. The neural related-doc
search (below) is passive context; THIS gate is the active check. Do not skip it by
hand-writing content over the scaffold — fill the scaffold, and verify as you fill.
⚠️ CRITICAL: Conflict Surface Analysis (REQUIRED for parser/typechecker/codegen changes)
If the design touches internal/parser/, internal/lexer/, internal/ast/, internal/types/, internal/elaborate/, internal/iface/, internal/codegen/, internal/eval/, internal/vm/, internal/effects/, or cmd/ailang/exec.go:
The design doc MUST include a Conflict Surface section (see resources/design_doc_structure.md) enumerating:
Why this is required: most language regressions come from "I didn't realize X also uses this position." The author is the only one who can credibly enumerate the conflict surface. Reviewers can sanity-check but can't generate the list.
Concrete case study: M-TAINT-TYPES (v0.14.3) added T{not LABEL} refinement syntax without enumerating that func ... -> bool { not f(x) } already used the same { not <ident> prefix in function bodies. The 2-token-lookahead disambiguation was insufficient. The motoko_agent fork (still on v0.13.0) hit ~14 mis-parses when migrating to v0.15.x. Caught months after release. See M-PARSER-REFINEMENT-LOOKAHEAD changelog entry for the fix.
The honest answer is almost never "no conflicts": if the section says that for a parser/typechecker change, the author hasn't looked hard enough.
Check existing work: The create script auto-searches for related docs using both SimHash and neural embeddings. Review the results before filling in the template.
Warning signs of fragmented design (expand scope if you see these):
|| specialCase conditionsAxiom Compliance: Every feature must score against all 12 axioms. Hard violations on A1/A3/A4/A7 = automatic rejection, net score must be ≥ +2. See resources/design_doc_structure.md for full scoring matrix and examples.
2. Choose Document Name
Naming conventions:
feature-name.mdm-XXX-feature-name.md (e.g., m-dx2-better-errors.md)improvements.md3. Run Create Script
# If version is known (most cases)
.claude/skills/design-doc-creator/scripts/create_planned_doc.sh feature-name v0_4_0
# If version not decided yet
.claude/skills/design-doc-creator/scripts/create_planned_doc.sh feature-name
4. Duplicate / Coverage Gate (MANDATORY — do this before creating the file)
Before creating any doc, read the top matches from the search and apply this gate:
| Similarity score | Action |
|---|---|
| ≥ 0.75 (neural) on a planned doc | REJECT — the topic is already queued. Reply with the path and explain what's already covered. Do NOT create a new doc. |
| ≥ 0.65 (neural) on an implemented doc | REJECT — already shipped. Reply with the path + version it shipped in. Do NOT create a new doc. |
| 0.45–0.65 on any doc | Warn — read the doc, confirm your topic is genuinely distinct before proceeding. Note the distinction explicitly in the "Related Documents" section. |
| < 0.45 | Proceed normally. |
Rejection reply format (use this when rejecting):
⛔ Duplicate / Already Covered
This topic is already addressed in:
[doc title](path/to/doc.md) — [planned v0.X.Y / implemented in vX.Y.Z]
Key overlap: <one sentence on what the existing doc covers that would duplicate this request>
If your request is genuinely distinct, please clarify how it differs from the above.
Read related docs found by search before proceeding (non-rejected cases):
What to look for in related docs:
5. Customize the Template
The script creates a comprehensive template. Fill in:
Header section:
[Feature Name])Problem Statement:
Goals:
Solution Design:
Examples:
Success Criteria:
Timeline:
6. Review and Commit
git add design_docs/planned/feature-name.md
git commit -m "Add design doc for feature-name"
When to move:
1. Run Move Script
.claude/skills/design-doc-creator/scripts/move_to_implemented.sh feature-name v0_3_14
2. Add Implementation Report
The script provides a template. Add:
What Was Built:
Code Locations:
Test Coverage:
Metrics:
Known Limitations:
3. Update design_docs/README.md
Add entry under appropriate version:
### v0.3.14 - Feature Name (October 2024)
- Brief description of what shipped
- Key improvements
- [CHANGELOG](../CHANGELOG.md#v0314)
4. Commit Changes
git add design_docs/implemented/v0_3_14/feature-name.md design_docs/README.md
git commit -m "Move feature-name design doc to implemented (v0.3.14)"
git rm design_docs/planned/feature-name.md
git commit -m "Remove feature-name from planned (moved to implemented)"
See resources/design_doc_structure.md for:
npx claudepluginhub sunholo-data/ailang_bootstrap --plugin sprint-executorProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.