xiaohongshu
xiaohongshu
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.
Full skill instructions
Create well-structured design documents for AILANG features following the project's conventions.
Most common usage:
# User says: "Create a design doc for better error messages"
# This skill will:
# 1. Ask for key details (priority, version target)
# 2. Create design_docs/planned/better-error-messages.md
# 3. Fill template with proper structure
# 4. Guide you through customization
Invoke this skill when:
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:
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):
🔍 Use ailang docs search to Check Existing Work:
Before creating a design doc, search for existing implementations:
# Check if feature already implemented
ailang docs search --stream implemented "feature keywords"
# Check if design doc already planned
ailang docs search --stream planned "feature keywords"
# Use neural search for semantic matching (requires Ollama, slow ~20-30s)
ailang docs search --stream planned --neural "semantic description of feature"
# Search with JSON output for programmatic use
ailang docs search --stream implemented --json "keywords"
Example workflow:
# Before creating "lazy embeddings" design doc:
$ ailang docs search --stream implemented "embedding cache"
🔍 SimHash search: "embedding cache"
Scanned: 42 docs
No matching documents found.
# ✅ Safe to create - not implemented yet
$ ailang docs search --stream planned "lazy embedding"
🔍 SimHash search: "lazy embedding"
Scanned: 28 docs
1. design_docs/planned/v0_5_11/m-doc-sem-lazy-embeddings.md (0.85)
# ⚠️ Already planned - review existing doc first
Key flags:
--stream implemented - Only search implemented/ directory--stream planned - Only search planned/ directory--neural - Use semantic embeddings (finds conceptually similar docs, slow: ~20-30s)--limit N - Return top N results--json - JSON output for scriptingPerformance note: SimHash search (without --neural) is instant. Only use --neural when keyword matching isn't finding what you need.
Warning Signs of Fragmented Design:
adtSliceTypes, recordTypes...)handleX, handleY, handleZ instead of unified handle|| specialCase conditionsWhen these signs appear: Expand scope of design doc to unify the system.
⚠️ IMPORTANT: Keep AILANG's Vision in Mind
AI-first DX = Minimize Syntactic Entropy
The goal of every feature is to make AILANG the most machine-decidable, context-efficient, and deterministic language for AI coders.
Before writing a design doc, verify that the proposed feature strictly improves one or more of the following metrics — and does not degrade any:
| Principle | Definition | Design-time Test |
|---|---|---|
| ✅ Reduce Syntactic Noise | Remove or infer repetitive scaffolding (imports, effect declarations, boilerplate) | "Can an AI express the same intent with fewer tokens or less redundancy?" |
| ✅ Preserve Semantic Clarity | Keep meaning explicit and compositional even when syntax is inferred | "Would another AI (or static checker) interpret this code identically?" |
| ✅ Increase Determinism | Ensure identical inputs produce identical ASTs and effects. Avoid implicit state, random order, or hidden magic. | "Could this feature be fully round-tripped through the compiler?" |
| ✅ Lower Token Cost | Minimize the number of tokens and transformations needed for the AI to express intent and the compiler to verify it | "Does this feature shorten the conversational path from intent → executable?" |
Score the proposed feature across these axes:
| Axis | −1 (hurts) | 0 (neutral) | +1 (helps) |
|---|---|---|---|
| Syntactic Noise | adds boilerplate | — | removes boilerplate |
| Semantic Clarity | adds ambiguity | — | clearer, self-describing |
| Determinism | introduces nondeterminism | — | increases reproducibility |
| Token Cost | increases context size | — | lowers token footprint |
Decision rule:
| Feature | Score | Why |
|---|---|---|
✅ Entry-module Prelude (print) | +3 | Removes boilerplate (+1), Deterministic injection (+1), Token savings (+1) |
✅ Auto-cap inference (!{IO}) | +2 | Syntactic noise ↓ (+1), Semantic clarity maintained (0), Token cost ↓ (+1) |
| ❌ Global mutable state | −2 | Violates determinism (−2) |
| ⚠️ Optional type annotations | ±0 | Only if inference remains stable and predictable |
Think of every feature as a compression algorithm for code intent.
The better the compression, the lower the entropy, and the more efficiently an AI can operate in that linguistic medium.
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. Customize the Template
The script creates a comprehensive template. Fill in:
Header section:
[Feature Name])Problem Statement:
Goals:
Solution Design:
Examples:
Success Criteria:
Timeline:
5. 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:
Good:
**Primary Goal:** Reduce builtin development time from 7.5h to 2.5h (-67%)
Bad:
**Primary Goal:** Make development easier
Good:
**Current State:**
- Development time: 7.5 hours per builtin
- Files to edit: 4
- Type construction: 35 lines
Bad:
**Current State:**
- Development takes a long time
Good:
**Phase 1: Core Registry** (~4 hours)
- [ ] Create BuiltinSpec struct
- [ ] Implement validation
- [ ] Add unit tests
**Phase 2: Type Builder** (~3 hours)
- [ ] Create DSL methods
- [ ] Add fluent API
- [ ] Test with existing builtins
Bad:
**Implementation:**
- Build everything
Good:
See existing M-DX1 implementation:
- design_docs/implemented/v0_3_10/M-DX1_developer_experience.md
- internal/builtins/spec.go
Bad:
Similar to other features
Rule of thumb:
Good:
**Estimated**: 3 days (6h implementation + 4h testing + 2h docs + buffer)
Bad:
**Estimated**: Should be quick, maybe 2 hours
design_docs/
├── planned/ # Future features
│ ├── feature.md # Unversioned (version TBD)
│ └── v0_4_0/ # Targeted for v0.4.0
│ └── feature.md
└── implemented/ # Completed features
├── v0_3_10/ # Shipped in v0.3.10
│ └── feature.md
└── v0_3_14/ # Shipped in v0.3.14
└── feature.md
Version folder naming:
v0_3_14 not v0.3.14This skill loads information progressively:
resources/design_doc_structure.md (detailed guide)xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience