Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Annotates agent prompts with structural XML tags for comprehension, gap detection, and skill extraction. Use when analyzing agent prompt structure, comparing agents across projects, or identifying reusable vs workflow-bound content in prompts.
.claude/skills/majiayu000-prompt-annotation/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 584% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 199% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 286% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 119% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 111% | 0% |
Annotations create a comprehension and authoring layer for agent prompts. They are NOT for runtime composition—they enable:
| Tag | Purpose | Example Content | |-----|---------|-----------------| | <agent-identity> | Who this agent is, one-sentence mission | "You are PAW-01A Specification Agent..." | | <core-principles> | Container for guardrails, decision frameworks | Behavioral constraints section | | <guardrail> | Rule that ALWAYS applies, constrains behavior | "Never include implementation details" | | <decision-framework> | Logic for making choices | "When to skip research vs request it" | | <workflow> | Container for sequenced steps | Main procedure section | | <workflow-step> | One action in a sequence | "Step 3: Draft user stories" | | <artifact-format> | Template/structure for outputs | Specification template, PR format | | <quality-gate> | Criteria for "done" or "good enough" | Acceptance criteria checklist | | <handoff-instruction> | What happens when agent completes | "Hand off to PAW-02A..." | | <communication-pattern> | How to interact with user/other agents | "Use incremental writing pattern" | | <example> | Concrete illustration of a concept | Sample output, good/bad comparison | | <classification-logic> | Decision tree or categorization rules | "If X then Y, else Z" | | <context-requirement> | What the agent needs to function | "Requires research artifact" |
<agent-identity>
<mission-statement>
<core-principles>
<guardrail>
<example>
<decision-framework>
<classification-logic>
<workflow>
<workflow-step>
<classification-logic>
<example>
<artifact-format>
<quality-gate>
<handoff-instruction>
<artifact-format>Critical addition: Mark content as workflow-bound or reusable using the scope attribute.
| | Phase-Specific | Phase-Agnostic | |---|---|---| | Workflow-Controlling | Phase transitions, handoffs, stage gates | Mode selection, error recovery | | Capability/Skill | Phase artifacts (Spec.md format) | General skills (review, summarize) |
| Value | Meaning | Example | |-------|---------|---------| | scope="reusable" | Can be extracted and used in any agent | Deep review pattern, quality checks | | scope="phase-bound" | Tied to this workflow phase | Spec template, handoff to PAW-02A | | scope="workflow" | Controls workflow orchestration | Phase transition logic | | (omitted) | Default, not yet classified | Most content initially |
markdown> `<communication-pattern scope="reusable">` **Deep Review Pattern**: When reviewing complex content, break into passes... > `</communication-pattern>`
markdown> `<handoff-instruction scope="phase-bound">` Hand off to PAW-02A Code Researcher with the specification artifact. > `</handoff-instruction>`
markdown> `<guardrail scope="reusable">` Never fabricate information. If uncertain, say so explicitly. > `</guardrail>`
Before annotating, understand the agent's:
Use plain > prefix for all tags (nesting script adds depth markers):
markdown> `<guardrail>` Content here... > `</guardrail>`
For each annotation, ask:
scope="reusable"scope="phase-bound"scope="workflow"If unsure, leave scope unspecified. Classification can be refined later.
bashpython fix_xml_nesting.py <file.md>
Run the visualization script to generate structural views:
bash# Print all visualizations to stdout python generate_viz.py <file.md> # Write to output directory python generate_viz.py <file.md> --output viz/ # Generate specific visualization only python generate_viz.py <file.md> --mindmap # Mermaid mindmap python generate_viz.py <file.md> --markmap # Interactive markmap python generate_viz.py <file.md> --flow python generate_viz.py <file.md> --summary
Viewing Markmap output (interactive with collapsible nodes):
markmap.markmap-vscode extension, open .mm.md filenpx markmap-cli <file>.mm.md -o <file>.htmlThe script generates skeletons. You must refine:
Shows annotation hierarchy as topic decomposition:
mermaidmindmap root((Agent Name)) agent-identity mission-statement core-principles guardrail: no fabrication [reusable] guardrail: spec completeness [phase-bound] workflow workflow-step: intake workflow-step: draft handoff-instruction
Use for: "What topics does this agent cover?"
Shows workflow steps and handoffs:
mermaidflowchart TD step1["Intake requirements"] --> step2["Draft specification"] step2 --> step3["Quality check"] step3 --> handoff1(["Hand off to PAW-02A"]) classDef phasebound fill:#f9f,stroke:#333 classDef handoff fill:#bbf,stroke:#333
Agent must add:
Use for: "How do topics sequence into action?"
Shows which guardrails apply to which workflow elements:
mermaidflowchart LR subgraph Global g1[No fabrication] g2[Acknowledge uncertainty] end subgraph Phase-Specific g3[Spec completeness] g4[Testable requirements] end g1 --> step1[All steps] g3 --> step2[Draft step] g3 --> step3[Quality check]
Cannot be scripted — requires understanding which constraints affect which areas.
Use for: "What rules constrain this action?"
YAML output with counts and gap detection:
yamlcounts: guardrails: 5 workflow_steps: 4 handoffs: 2 scope_breakdown: reusable: 3 phase_bound: 4 unspecified: 2 potential_gaps: - NOTE: No quality gates found
Use for: Quick structural overview, comparing agents.
markdown> `<core-principles>` ## Core Principles >- `<guardrail scope="reusable">` **User value focus**: Describe WHAT & WHY, never implementation details (no tech stack, file paths, library names, code snippets). >- `</guardrail>` >- `<guardrail scope="phase-bound">` **Spec completeness**: Every requirement must be testable. Include acceptance criteria for each user story. >- `</guardrail>` >- `<decision-framework scope="reusable">` ### When to Ask Clarifying Questions - Ambiguous requirements → Ask - Missing context that blocks progress → Ask - Stylistic preferences → Make reasonable choice, note it >- `</decision-framework>` > `</core-principles>`
Don't tag every sentence. Tag meaningful sections:
Don't force content into a tag that doesn't fit:
<guardrail> because it mentions "should"<guidance> or leaving untagged if ambiguousDon't guess at scope if you're unsure:
scope="reusable" on everything that seems generalDon't annotate mechanically:
The visualization script (generate_viz.py) produces these outputs automatically:
-mindmap.mmd): Topic hierarchy from annotation nesting-by-section.mm.md): Interactive mindmap organized by document sections—preserves document structure-by-tag.mm.md): Interactive mindmap organized by tag type—shows fragmentation with ⚠️ warnings when same tag types appear in multiple sections-flow.mmd): Workflow steps + handoffs (refine with decisions)-summary.yaml): Counts, scope breakdown, fragmentation analysis, section overview, gap warningsMarkmap is recommended for navigation—click nodes to collapse/expand branches, zoom and pan.
The summary includes a Fragmentation Analysis section that identifies when annotations of the same type (e.g., <guardrail>) are scattered across multiple document sections. This helps detect:
Example fragmentation warning:
yamlfragmented_tags: guardrail: # appears in 5 sections - "Core Principles & Guardrails" (10x) - "Guardrails (Enforced)" (10x) - "Error / Edge Handling" (1x) - "High-Level Responsibilities" (1x) - "Hand-off Checklist" (1x)
Agent-generated outputs:
Is it about WHO the agent is?
→ <agent-identity>
Is it a rule that ALWAYS applies?
→ <guardrail>
Is it logic for making a CHOICE?
→ <decision-framework> or <classification-logic>
Is it a STEP in a sequence?
→ <workflow-step>
Is it a TEMPLATE for output?
→ <artifact-format>
Is it about COMMUNICATION style?
→ <communication-pattern>
Is it a CHECKLIST for completion?
→ <quality-gate>
Is it about WHAT HAPPENS NEXT?
→ <handoff-instruction>
Is it a CONCRETE EXAMPLE?
→ <example>Could ANY agent use this?
YES → scope="reusable"
Is this about THIS PHASE's specific outputs/transitions?
YES → scope="phase-bound"
Does this control WORKFLOW orchestration?
YES → scope="workflow"
Uncertain?
→ Leave scope unspecified| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 11,877 | 31,612 | +166% | 1 | 1 | 0% | 1,162 | 7,951 | +584% | 0 | 0 | — |
case-02 | fail→pass | 22,161 | 27,468 | +24% | 1 | 1 | 0% | 2,906 | 8,683 | +199% | 0 | 0 | — |
case-03 | fail→pass | 10,880 | 10,021 | -8% | 1 | 1 | 0% | 1,020 | 3,940 | +286% | 0 | 0 | — |
case-04 | fail→pass | 11,206 | 3,691 | -67% | 1 | 1 | 0% | 1,745 | 3,827 | +119% | 0 | 0 | — |
case-05 | fail→pass | 12,590 | 6,594 | -48% | 1 | 1 | 0% | 2,108 | 4,452 | +111% | 0 | 0 | — |
case-06 | fail→pass | 13,466 | 11,199 | -17% | 1 | 1 | 0% | 1,420 | 4,100 | +189% | 0 | 0 | — |
case-07 | fail→fail | 12,972 | 3,774 | -71% | 1 | 1 | 0% | 1,570 | 3,904 | +149% | 0 | 0 | — |
case-08 | fail→pass | 12,486 | 25,043 | +101% | 1 | 1 | 0% | 1,176 | 5,092 | +333% | 0 | 0 | — |
case-09 | fail→pass | 7,037 | 10,765 | +53% | 1 | 1 | 0% | 1,156 | 4,179 | +262% | 0 | 0 | — |
case-10 | fail→pass | 10,448 | 12,224 | +17% | 1 | 1 | 0% | 1,816 | 4,257 | +134% | 0 | 0 | — |
case-15 | pass→pass | 17,124 | 14,979 | -13% | 1 | 1 | 0% | 2,175 | 4,124 | +90% | 0 | 0 | — |
case-11 | pass→pass | 16,763 | 6,864 | -59% | 1 | 1 | 0% | 1,944 | 3,491 | +80% | 0 | 0 | — |
case-12 | pass→pass | 20,360 | 7,812 | -62% | 1 | 1 | 0% | 2,216 | 3,646 | +65% | 0 | 0 | — |
case-13 | fail→pass | 16,210 | 7,153 | -56% | 1 | 1 | 0% | 1,965 | 3,463 | +76% | 0 | 0 | — |
case-14 | pass→pass | 13,824 | 9,302 | -33% | 1 | 1 | 0% | 1,276 | 3,873 | +204% | 0 | 0 | — |
case-16 | pass→pass | 15,979 | 10,136 | -37% | 1 | 1 | 0% | 1,986 | 4,092 | +106% | 0 | 0 | — |
case-17 | pass→fail | 15,557 | 9,914 | -36% | 1 | 1 | 0% | 1,882 | 4,139 | +120% | 0 | 0 | — |
case-18 | pass→pass | 11,865 | 16,280 | +37% | 1 | 1 | 0% | 1,911 | 4,793 | +151% | 0 | 0 | — |
case-19 | fail→pass | 11,590 | 9,435 | -19% | 1 | 1 | 0% | 1,649 | 3,835 | +133% | 0 | 0 | — |
case-20 | fail→pass | 7,683 | 10,311 | +34% | 1 | 1 | 0% | 1,280 | 3,975 | +211% | 0 | 0 | — |
case-21 | fail→fail | 10,742 | 11,754 | +9% | 1 | 1 | 0% | 1,835 | 4,352 | +137% | 0 | 0 | — |
case-22 | pass→pass | 11,162 | 9,986 | -11% | 1 | 1 | 0% | 2,029 | 4,891 | +141% | 0 | 0 | — |
case-23 | pass→pass | 16,478 | 20,784 | +26% | 1 | 1 | 0% | 3,015 | 6,232 | +107% | 0 | 0 | — |
case-24 | pass→pass | 11,170 | 16,817 | +51% | 1 | 1 | 0% | 2,118 | 5,480 | +159% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +46 percentage points is the difference between those two pass rates over the 24 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.