domains / agent-tooling / system-prompt-optimization / ai-md
The first copy (sickn33) is a high-level wrapper that delegates the actual procedure to an external file (`references/detailed-guide.md`) and provides only usage triggers and limitations. The second copy (LeoYeAI) contains the complete, self-contained methodology, including the specific mechanisms (Attention Splitting, Zero-Inference Labels, Semantic Anchoring) and the step-by-step conversion process (Understand, Decompose, etc.). Because the first copy lacks the actual steps and the second copy contains the full procedure, crowning the second as 'authentic' would ignore the first's specific framing and delegation structure, while crowning the first would hide the actual method. They overlap in purpose but differ significantly in content depth and structure.
| Repository | Path |
|---|---|
| sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/ai-md/SKILL.md |
| LeoYeAI/openclaw-master-skills | skills/ai-md/SKILL.md |
| Role | Repository | Path |
|---|---|---|
| peer | sickn33/agentic-awesome-skills | plugins/agentic-awesome-skills-claude/skills/ai-md/SKILL.md |
| peer | LeoYeAI/openclaw-master-skills | skills/ai-md/SKILL.md |
| adapter | sickn33/agentic-awesome-skills | skills/ai-md/SKILL.md |
--- name: ai-md description: "Convert human-written CLAUDE.md into AI-native structured-label format. Battle-tested across 4 models. Same rules, fewer tokens, higher compliance." --- # AI.MD v4 — The Complete AI-Native Conversion System ## When to Use This Skill - Use when your CLAUDE.md is long but AI still ignores your rules. - Use when token usage is too high from verbose system instructions. - Use when you want to optimize any LLM system prompt for compliance. - Use when migrating rules between AI tools (Claude, Codex, Gemini, Grok). ## Limitations - Use this skill only when the task clearly matches the scope described above. - Do not treat the output as a substitute for environment-specific validation, testing, or expert review. - Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing. ## Methodology: How LLMs Process Instructions LLMs don't "read" — they **attend**. Understanding this changes everything. ### Mechanism 1: Attention Splitting When multiple rules share one line, the model's attention distributes across all tokens equally. Each rule gets a fraction of the attention weight. Some rules get lost. When each rule has its own line, the model processes it as a distinct unit with full attention weight. ### Mechanism 2: Zero-Inference Labels Natural language forces the model to INFER meaning from context. Labels DECLARE meaning explicitly. No inference needed = no misinterpretation. Labels like `trigger:`, `action:`, `exception:` work across ALL languages. ### Mechanism 3: Semantic Anchoring Labeled sub-items create **matchable tags**. When a user's input contains a keyword, the model matches it directly to the corresponding label — like a hash table lookup instead of a full-text search. ## The Conversion Process ### Phase 1: UNDERSTAND — Read Like a Compiler, Not a Human Read the CLAUDE.md **as if I'm building a state machine**, not reading a document. For each sentence, ask: 1. **Is this a TRIGGER?** (What input activates this behavior?) 2. **Is this an ACTION?** (What should the AI do?) 3. **Is this a CONSTRAINT?** (What should the AI NOT do?) 4. **Is this METADATA?** (Priority, timing, persistence, exceptions?) 5. **Is this a HUMAN EXPLANATION?** (Why the rule exists — delete this) ### Phase 2: DECOMPOSE — Break Every `|` and `()` Into Atomic Rules The #1 source of compliance failure is **compound rules**. A single line with 3 rules separated by `|` looks like 1 instruction to AI. It needs to be 3 separate instructions. **The splitter test:** If you can put "AND" between two parts of a sentence, they are separate rules and MUST be on separate lines. ### Phase 3: LABEL — Apply Zero-Inference Structure Convert the atomic rules into structured labels. Use consistent keys like `trigger:`, `action:`, `exception:`, `persist:`, `yields-to:`. ### Phase 4: ANCHOR — Create Semantic Tags Ensure key concepts have unique, matchable labels that correspond to likely user inputs. ## Example Conversion **Input (Human Prose):** `收到任務→先用一句話複述(防搞混)(長對話中每個新任務都重新觸發) | 例外: signals命中「處理一下」=直接執行` **Output (AI.MD Structured):** ``` GATE-1 複述: trigger: new-task action: first-sentence="你要我做的是___" persist: 長對話中每個新任務都重新觸發 exception: signal=處理一下 → skip yields-to: GATE-3 ```