optimise-claude
Originally fromralphcrisostomo/nuxt-development-skills
SKILL.md
Optimise Claude
Use this skill when auditing AI skill files for size, structure, duplication, or bloated AGENTS.md inline blocks.
Scope
All operations are strictly limited to project-level skill directories:
.agents/skills/(relative to project root).claude/skills/(relative to project root)
NEVER touch user-level (home directory) skill locations:
~/.agents/skills/~/.claude/skills/
Never read, write, list, or modify any file outside the current project root ($PWD).
When to Use
- Skill files exceed ~120 lines.
- Frontmatter or section order is non-canonical.
- Multiple skills contain duplicated content.
- An AGENTS.md file has inline instruction blocks >30 lines that should be skills.
Workflow
Run phases sequentially. Skip any phase that does not apply. Only operate on files within the current project repo.
Phase 1 — Inventory & Triage
- List every
SKILL.mdunder the project's.agents/skills/. - For each file, record: name, line count, has frontmatter (y/n), has canonical sections (y/n).
- Flag violations: >120 lines, missing/incorrect frontmatter, wrong section order.
- Output a triage table sorted by line count descending.
| Skill | Lines | FM | Sections | Violations |
|-------|------:|----|----------|------------|
Phase 2 — Reduce Token Usage
For each flagged skill:
- Trim prose to imperative bullets.
- Collapse verbose examples to minimal code fences.
- Remove redundant explanations already covered by parent AGENTS.md.
- Remove blank lines between list items.
- Target <=120 lines. If still over, split into focused sub-skills.
Phase 3 — Fix Structure & Frontmatter
For each skill:
- Ensure YAML frontmatter has
namematching directory anddescriptionstarting with "Use when". - Enforce canonical section order: H1 title, scope line, When to Use, Rules/Instructions, Quick Reference, Validation.
- Remove empty or placeholder sections.
- Use imperative voice throughout.
Phase 4 — Cross-Skill Deduplication
- Identify repeated content blocks across project skills (>5 similar lines).
- Move shared content to the project's root
AGENTS.mdor a dedicated shared skill within.agents/skills/. - Replace duplicates with a one-line pointer: "See
<skill-name>for …". - Reword overlapping
descriptionfields so each skill has a unique trigger.
Phase 5 — Extract Bloated AGENTS.md Blocks
- Scan
AGENTS.mdfiles within the project for inline instruction blocks >30 lines. - For each block, create a new skill at
.agents/skills/<name>/SKILL.mdwithin the project. Never create files outside the project repo. - Replace the original block with a slim pointer + Quick Reference.
- If the project has a skill sync script, run it to sync
.agents/skills/to.claude/skills/within the project.
Output Format
After all phases, produce a summary report:
## Optimisation Report
| Skill | Before | After | Delta |
|-------|-------:|------:|------:|
| ... | 250 | 110 | -140 |
Total skills: N
Total lines saved: N
New skills created: N
Quick Reference
- Only operate on project-level
.agents/skills/and.claude/skills/— never~/.agents/skills/or~/.claude/skills/. - Source of truth: project's
.agents/skills/— never edit.claude/skills/directly. - Canonical section order: H1, scope, When to Use, Rules, Quick Reference, Validation.
- Target: <=120 lines per skill.
- Never read, write, list, or modify files outside the project root.
Validation
wc -l .agents/skills/*/SKILL.md— no file exceeds 120 lines.- Every
SKILL.mdhas valid YAML frontmatter withnameanddescription. - No two skills share >5 identical lines.
- No
AGENTS.mdwithin the project has inline instruction blocks >30 lines without a skill pointer. - No files outside the project root were modified.
- No files under
~/.agents/skills/or~/.claude/skills/were read or modified.
Weekly Installs
4
Repository
ralphcrisostomo…de-skillFirst Seen
9 days ago
Security Audits
Installed on
opencode4
gemini-cli4
github-copilot4
codex4
kimi-cli4
cursor4