Siempre intentando aprender. Amante de los gatos, las buenas conversaciones y los pequeños detalles.
Organizing your SKILL.md files in folders
Nowadays, using skill files (SKILL.md) is a common way to provide context and knowledge (or new capabilities and expertise, as the official skills specification website describes) to an LLM or agent.
From an infrastructure point of view, a skill is a folder containing a SKILL.md file and all the necessary files for it to work: scripts, references, etc. This folder must be in .agents/skills (or .claude/skills, or whatever name your agent tool uses).
skill-name/
├── SKILL.md # Required: metadata + instructions
├── scripts/ # Optional: executable code
├── references/ # Optional: documentation
├── assets/ # Optional: templates, resources
└── ... # Any additional files or directories
The tools only read directories at the first level of the .agents/skills folder, not subfolders, so as you create or download more and more skills, the skills folder becomes something like this:
.agents/skills/
├── api-testing-helper/
├── astro-content-auditor/
├── changelog-writer/
├── cli-release-checklist/
├── commit-message-linter/
├── css-animation-recipes/
├── design-token-curator/
├── docker-debug-playbook/
├── docs-style-enforcer/
├── feature-flag-rollout-guide/
├── frontend-performance-reviewer/
├── markdown-link-fixer/
├── newsletter-copy-editor/
├── seo-meta-validator/
├── shell-script-safety-checker/
├── sitemap-consistency-check/
├── slide-deck-outline-helper/
├── social-card-generator/
├── static-site-migration-guide/
├── storybook-docs-curator/
├── tailwind-class-auditor/
├── test-flake-investigator/
├── translation-qa-assistant/
├── typescript-error-explainer/
├── ui-copy-tone-reviewer/
├── ux-research-note-summarizer/
├── visual-regression-triager/
├── vite-config-tuner/
├── webhook-payload-inspector/
├── workflow-automation-designer/
├── writing-style-harmonizer/
├── yaml-frontmatter-repair/
├── youtube-embed-optimizer/
├── zod-schema-scaffolder/
This makes it almost impossible to organize the skills however you want, for example, by keeping your own skills and third-party skills in separate folders, or by topic: coding skills, text skills, etc.
This is especially problematic when you have a lot of skills, or multiple skill sources. For example, you may have some skills you created, some downloaded from the community, and some provided by your company. If your company provides shared skills in a repo, you cannot just clone that repo into a folder in the skills directory. You need to copy or create a symlink for each skill folder into the skills directory, mixing them with any other skill and making it hard to know which are yours and which are from the company or third parties.
## A simple solution: organizing skills in folders
To solve the organization issue, I thought that having a multilevel subfolder structure in the skills directory would be a nice and simple solution, but as I mentioned before, the tools only read directories at the first level, so that is not possible.
Well, it is not possible directly, but we can use a simple and smart solution:
### 1. Create an organized skills folder
Use a different folder to store the organized skills, for example, organized-skills.
Here we can create as many folders and subfolders as we want. For example:
organized-skills/
├── generic
├── starter
├── my-skills/
│ ├── coding-skills/
│ │ ├── astro-performance-auditor/
│ │ └── typescript-error-explainer/
│ ├── text-skills/
│ │ ├── newsletter-copy-editor/
│ │ └── writing-style-harmonizer/
│ └── personal-workflows/
│ └── weekly-review-assistant/
├── company-skills/
│ ├── coding-skills/
│ │ ├── internal-api-checklist/
│ │ └── release-train-coordinator/
│ ├── compliance/
│ │ └── pii-review-helper/
│ └── onboarding/
│ └── engineering-ramp-up-guide/
├── community-skills/
│ ├── frontend/
│ │ ├── design-token-curator/
│ │ └── visual-regression-triager/
│ └── content/
│ └── markdown-link-fixer/
└── experimental/
└── research/
└── prompt-pattern-lab/
### 2. Keep the sync
Create a Bash script to create symlinks for each skill in the organized-skills folder, flattened into the .agents/skills folder.
For example, organized-skills/my-skills/coding-skills/astro-performance-auditor will be symlinked to .agents/skills/my-skills-coding-skills-astro-performance-auditor.
Resulting in something like this:
.agents/skills/
├── my-skills--coding--skills--astro-performance-auditor/
├── my-skills--coding--skills--typescript-error-explainer/
├── my-skills--text--skills--newsletter-copy-editor/
├── my-skills--text--skills--writing-style-harmonizer/
├── my-skills--personal--workflows--weekly-review-assistant/
├── company-skills--coding--skills--internal-api-checklist/
├── company-skills--coding--skills--release-train-coordinator/
├── company-skills--compliance--pii-review-helper/
├── company-skills--onboarding--engineering-ramp-up-guide/
├── community-skills--frontend--design-token-curator/
├── community-skills--frontend--visual-regression-triager/
├── community-skills--content--markdown-link-fixer/
├── experimental--research--prompt-pattern-lab/
├── IMPORTANT.md # to notice this is a generated folder with symlinks and not the real skills
This way, we can have the skills organized in folders however we want (in the .agents/organized-skills folder), and the tools can still read the skills from the flattened symlinks in the .agents/skills folder.
The script creates symlinks for the skills in the organized-skills folder into the skills folder, and it also removes any stale symlinks that are no longer in organized-skills. At the same time, it keeps any "non-managed" folder in the skills folder, allowing you and any tools to add skills directly to the skills folder without having them removed by the script.
### 3. Watch file changes (optional)
With the previous script, you need to run it every time you create, delete, or move a skill in the organized-skills folder. But we can automate this using polling or, even better, inotify-watcher on Linux and a service. This will detect any change in the folder and run the script to keep the symlinks in sync.
I left all the scripts, the organized skills folder, and an example of a systemd service in a GitHub repo. Feel free to check it out and adapt it to your needs.
Check the sync scripts at GitHub: https://github.com/sergiocarracedo/skills-in-folders-sync
I hope you find this useful or interesting, and that it helps you or your company keep your skills organized and easy to manage.
Comments
No comments yet. Be the first to comment!