|
| 1 | +# Agent Skills |
| 2 | + |
| 3 | +opendataloader-pdf ships built-in agent skills that help AI coding assistants use this project effectively. Skills follow the [agentskills.io](https://agentskills.io) specification and work with Claude Code, Codex, Gemini CLI, Cursor, VS Code, and 26+ platforms. |
| 4 | + |
| 5 | +## Directory Structure |
| 6 | + |
| 7 | +``` |
| 8 | +skills/ |
| 9 | +├── README.md ← You are here |
| 10 | +└── odl-pdf/ ← One skill per directory |
| 11 | + ├── SKILL.md ← Main skill file (loaded when activated) |
| 12 | + ├── references/ ← Deep-dive docs (loaded on demand) |
| 13 | + │ ├── options-matrix.md |
| 14 | + │ ├── hybrid-guide.md |
| 15 | + │ ├── format-guide.md |
| 16 | + │ ├── installation-matrix.md |
| 17 | + │ └── eval-metrics.md |
| 18 | + ├── scripts/ ← Executable helpers |
| 19 | + │ ├── detect-env.sh |
| 20 | + │ ├── hybrid-health.sh |
| 21 | + │ ├── quick-eval.py |
| 22 | + │ └── sync-skill-refs.py |
| 23 | + └── evals/ ← Quality test cases |
| 24 | + └── evals.json |
| 25 | +``` |
| 26 | + |
| 27 | +## How Skills Work |
| 28 | + |
| 29 | +### Progressive Disclosure (3 Levels) |
| 30 | + |
| 31 | +| Level | Content | When Loaded | |
| 32 | +|-------|---------|-------------| |
| 33 | +| **L1** | `description` field in SKILL.md frontmatter (~100 words) | Always visible to skill router | |
| 34 | +| **L2** | SKILL.md body (~400 lines) — persona, workflows, decision trees, gotchas | When skill is activated | |
| 35 | +| **L3** | `references/*` files — detailed option matrices, guides, metrics | When the user enters that topic | |
| 36 | + |
| 37 | +This design minimizes token usage. The AI agent only loads what it needs for the current task. |
| 38 | + |
| 39 | +### Dual-Path Option Reference |
| 40 | + |
| 41 | +Skills must work for **both** source-code users and pip-install users: |
| 42 | + |
| 43 | +- **Built-in summaries** (`references/options-matrix.md`): Always available, even without source code |
| 44 | +- **Dynamic reference** (`options.json`): Authoritative source when the source repo is available |
| 45 | + |
| 46 | +SKILL.md instructs the AI: "If `options.json` exists in this project, it is the source of truth. Options in `options.json` not found in `options-matrix.md` are newly added." |
| 47 | + |
| 48 | +## Creating a New Skill |
| 49 | + |
| 50 | +### 1. Create the Directory |
| 51 | + |
| 52 | +``` |
| 53 | +skills/my-skill/ |
| 54 | +├── SKILL.md |
| 55 | +├── references/ (optional) |
| 56 | +├── scripts/ (optional) |
| 57 | +└── evals/ (optional) |
| 58 | +``` |
| 59 | + |
| 60 | +### 2. Write SKILL.md |
| 61 | + |
| 62 | +The SKILL.md file has two parts: |
| 63 | + |
| 64 | +**Frontmatter** (YAML between `---` markers): |
| 65 | + |
| 66 | +```yaml |
| 67 | +--- |
| 68 | +name: my-skill |
| 69 | +description: > |
| 70 | + One paragraph (~100 words) explaining what this skill does. |
| 71 | + Include trigger keywords so the skill router knows when to activate. |
| 72 | + Include "Do NOT use for:" to prevent false activations. |
| 73 | +--- |
| 74 | +``` |
| 75 | + |
| 76 | +**Body** (Markdown): |
| 77 | + |
| 78 | +- Define a persona (who the AI becomes when this skill is active) |
| 79 | +- Define a workflow (numbered phases the AI follows) |
| 80 | +- Include decision trees for common choices |
| 81 | +- List critical gotchas the AI must always warn about |
| 82 | +- Reference deeper docs with: "See `references/filename.md` for details" |
| 83 | + |
| 84 | +### 3. Write Evals |
| 85 | + |
| 86 | +Create `evals/evals.json` with test scenarios: |
| 87 | + |
| 88 | +```json |
| 89 | +{ |
| 90 | + "version": "1.0", |
| 91 | + "skill": "my-skill", |
| 92 | + "evals": [ |
| 93 | + { |
| 94 | + "id": "eval-001", |
| 95 | + "scenario": "Description of the user's situation", |
| 96 | + "user_input": "What the user says", |
| 97 | + "expected_recommendations": ["What the AI should recommend"], |
| 98 | + "must_mention": ["Required terms in the response"], |
| 99 | + "must_not_mention": ["Forbidden terms"] |
| 100 | + } |
| 101 | + ] |
| 102 | +} |
| 103 | +``` |
| 104 | + |
| 105 | +### 4. Register in marketplace.json |
| 106 | + |
| 107 | +Add your skill to `.claude-plugin/marketplace.json`: |
| 108 | + |
| 109 | +```json |
| 110 | +{ |
| 111 | + "plugins": [{ |
| 112 | + "skills": ["./skills/odl-pdf", "./skills/my-skill"] |
| 113 | + }] |
| 114 | +} |
| 115 | +``` |
| 116 | + |
| 117 | +### 5. Test |
| 118 | + |
| 119 | +Test by spawning an AI agent that knows nothing about the project, loading only your SKILL.md, and asking it the eval scenarios. All `must_mention` terms should appear; no `must_not_mention` terms should appear. |
| 120 | + |
| 121 | +## Modifying the Existing Skill |
| 122 | + |
| 123 | +### When CLI Options Change |
| 124 | + |
| 125 | +1. Run `npm run sync` (regenerates `options.json`) |
| 126 | +2. Update `skills/odl-pdf/references/options-matrix.md` — add the new option to the appropriate category |
| 127 | +3. If the option has interaction rules, document them in the "Interaction Rules" section |
| 128 | +4. CI (`skill-drift-check.yml`) will catch any mismatch you miss |
| 129 | + |
| 130 | +### When Adding a New Hybrid Backend |
| 131 | + |
| 132 | +1. Update `skills/odl-pdf/references/hybrid-guide.md` — add to the Backend Registry table |
| 133 | +2. SKILL.md's decision tree says "check `options.json` for allowed hybrid values" — new backends are auto-discovered |
| 134 | + |
| 135 | +### When Adding a New Output Format |
| 136 | + |
| 137 | +1. Update `skills/odl-pdf/references/format-guide.md` — add to the format table with downstream use mapping |
| 138 | +2. The format list in `options.json` is auto-discovered by the skill |
| 139 | + |
| 140 | +## CI Integration |
| 141 | + |
| 142 | +### Drift Check (`skill-drift-check.yml`) |
| 143 | + |
| 144 | +Runs automatically when `options.json` changes. Compares option names in `options.json` against `options-matrix.md` and fails if they diverge. |
| 145 | + |
| 146 | +Run manually: |
| 147 | + |
| 148 | +```bash |
| 149 | +python skills/odl-pdf/scripts/sync-skill-refs.py |
| 150 | +``` |
| 151 | + |
| 152 | +## Writing Guidelines |
| 153 | + |
| 154 | +- **Language**: English only (external open-source users) |
| 155 | +- **No internal terminology**: No company names, team names, or internal tool references |
| 156 | +- **Tone**: Senior engineer pair-programming — diagnose first, prescribe later |
| 157 | +- **Java guidance**: Always mention Java 11+ requirement. Never recommend specific JDK distributions or download links. |
| 158 | +- **Gotchas**: Only include gotchas that affect external users. Internal development gotchas belong in CLAUDE.md. |
| 159 | + |
| 160 | +## References |
| 161 | + |
| 162 | +- [agentskills.io specification](https://agentskills.io) — Multi-agent skill format standard |
| 163 | +- [Claude Code Skills](https://docs.anthropic.com/en/docs/claude-code) — Claude Code skill documentation |
| 164 | +- `.claude-plugin/marketplace.json` — Plugin registration for this project |
| 165 | +- `CLAUDE.md` — Internal development notes (not for the skill) |
| 166 | +- `CONTRIBUTING.md` — Contributor guidelines including skill maintenance |
0 commit comments