Generate Skills from Knowledge Documents
Purpose
Convert existing knowledge docs (one or many) into discoverable, reusable Agent Skills that follow a consistent, lintable structure and progressive disclosure.
The generate-skills-from-knowledge skill is provider-agnostic: the output is plain folders + SKILL.md files and can be consumed by any agent runtime that discovers skills from the filesystem.
When to use
Use the generate-skills-from-knowledge skill when you have:
- A set of Markdown/text docs that describe how work should be done, and you want to convert them into skills.
- Legacy "how-to" docs that are too long or too project-specific and need to become portable skills.
- Multiple docs with overlapping guidance and you want to split/merge them into capability-oriented skills.
Do not use the skill when:
- The source material is confidential and cannot be copied into a work area.
- You only need a quick summary; you do not need reusable procedures.
Inputs
You MUST provide:
- Source documents: one or more file paths (prefer Markdown). If not Markdown, provide a plain-text export.
- Output target:
skills_root (directory where the generated skills will be written), OR
- a writable working directory to create a standalone skills bundle.
- Portability constraints:
- whether to remove provider-specific terms,
- whether project paths/scripts should be generalized,
- any allowed exceptions (for example, "dev-docs may keep repo-specific layout").
You SHOULD provide:
- Desired taxonomy (optional): up to two tiers (e.g.,
backend/common, frontend/components, workflows/common).
- Existing naming conventions for skill names (kebab-case verb + domain).
Outputs
The expected outputs are:
- A set of skill directories, each containing:
SKILL.md (required)
reference.md (optional, for deep details)
examples/ (optional, scenario-specific examples)
templates/ (optional, reusable snippets/skeletons)
- A
CONVERSION_REPORT.md summarizing:
- source documents
- created/updated skills
- split/merge operations
- known limitations / follow-ups
- A lint report (stdout) from
python3 ./scripts/skillgen.py lint ... (recommended)
Command working directory
All relative paths in commands (for example ./scripts/skillgen.py and ./templates/...) are relative to:
.ai/skills/workflows/skill-operation/generate-skills-from-knowledge/
Steps
Scenario A: Convert docs into a skills bundle (recommended default)
- Inventory the source docs (file list) and decide what is IN/OUT of scope.
- Derive candidate skills:
- one skill should map to one capability (not one file),
- split long docs into multiple skills by trigger/intent,
- merge overlapping docs when they solve the same intent.
- Create a conversion plan using
./templates/conversion-plan.schema.json:
- define the skills to create,
- map each skill to its source docs,
- define which examples/templates to extract.
- Review the plan and obtain approval before writing files:
- confirm the skill taxonomy and naming
- confirm portability constraints (remove provider/project specifics)
- confirm what will be created vs updated
- Run:
python3 ./scripts/skillgen.py apply --plan <plan.json> to scaffold the skill directories.
- For each generated skill:
- rewrite
SKILL.md to be high-signal and short,
- move large examples into
examples/,
- move reusable snippets into
templates/,
- put deep rationale into
reference.md,
- remove cross-skill links ("See also", "Related docs").
- Run:
python3 ./scripts/skillgen.py lint --skills-root <skills_root> and fix issues until clean.
- Package the bundle (optional):
python3 ./scripts/skillgen.py package --skills-root <skills_root> --out <bundle.zip>
Scenario B: Convert docs directly into a repository skills root
Follow Scenario A, but set skills_root to the repository's skills SSOT directory.
If your repo has additional syncing rules (provider stubs, monorepo layouts), treat those as outside the scope; the skill only produces the SSOT-format skills.
Boundaries
- You MUST NOT include secrets, credentials, or internal-only URLs in generated skills.
- You MUST NOT copy large logs or whole source documents verbatim into
SKILL.md.
- You SHOULD avoid hard-coded repository paths unless the target is explicitly "dev-docs" with a known layout.
- You MUST keep each
SKILL.md <= 500 lines by moving detail into reference.md, examples/, and templates/.
Verification
Run the linter and confirm:
- the conversion plan was reviewed and approved before applying
- every skill directory contains
SKILL.md with valid YAML frontmatter
name matches the directory name
- no
resources/ directories exist
SKILL.md line count is within limits
- examples/templates live under
examples/ and templates/ rather than bloating SKILL.md
- cross-skill relative links (e.g.,
../<other-skill>) are absent
Included assets
./scripts/skillgen.py: plan/apply/lint/package helper
./scripts/init_skill.py: optional helper to scaffold a new skill directory
./templates/conversion-plan.schema.json: JSON Schema for a conversion plan
./templates/conversion-plan.example.json: example plan
./templates/skill-skeleton/SKILL.md: copy/pasteable skeleton for manual skill authoring
./examples/quickstart.md: end-to-end usage example
./examples/plan-writing-guide.md: how to write a good plan for an LLM
1---2name: generate-skills-from-knowledge3description: Turn one or more knowledge documents into a provider-agnostic Agent Skills bundle (SKILL.md + examples/templates), using a plan -> apply -> lint workflow.4---56# Generate Skills from Knowledge Documents78## Purpose9Convert existing knowledge docs (one or many) into **discoverable, reusable Agent Skills** that follow a consistent, lintable structure and **progressive disclosure**.1011The generate-skills-from-knowledge skill is provider-agnostic: the output is plain folders + `SKILL.md` files and can be consumed by any agent runtime that discovers skills from the filesystem.1213## When to use14Use the generate-skills-from-knowledge skill when you have:15- A set of Markdown/text docs that describe **how work should be done**, and you want to convert them into skills.16- Legacy "how-to" docs that are too long or too project-specific and need to become **portable** skills.17- Multiple docs with overlapping guidance and you want to **split/merge** them into capability-oriented skills.1819Do not use the skill when:20- The source material is confidential and cannot be copied into a work area.21- You only need a quick summary; you do not need reusable procedures.2223## Inputs24You MUST provide:25- **Source documents**: one or more file paths (prefer Markdown). If not Markdown, provide a plain-text export.26- **Output target**:27 - `skills_root` (directory where the generated skills will be written), OR28 - a writable working directory to create a standalone skills bundle.29- **Portability constraints**:30 - whether to remove provider-specific terms,31 - whether project paths/scripts should be generalized,32 - any allowed exceptions (for example, "dev-docs may keep repo-specific layout").3334You SHOULD provide:35- Desired **taxonomy** (optional): up to two tiers (e.g., `backend/common`, `frontend/components`, `workflows/common`).36- Existing naming conventions for skill names (kebab-case verb + domain).3738## Outputs39The expected outputs are:40- A set of skill directories, each containing:41 - `SKILL.md` (required)42 - `reference.md` (optional, for deep details)43 - `examples/` (optional, scenario-specific examples)44 - `templates/` (optional, reusable snippets/skeletons)45- A `CONVERSION_REPORT.md` summarizing:46 - source documents47 - created/updated skills48 - split/merge operations49 - known limitations / follow-ups50- A lint report (stdout) from `python3 ./scripts/skillgen.py lint ...` (recommended)5152## Command working directory53All relative paths in commands (for example `./scripts/skillgen.py` and `./templates/...`) are relative to:54- `.ai/skills/workflows/skill-operation/generate-skills-from-knowledge/`5556## Steps57### Scenario A: Convert docs into a skills bundle (recommended default)581. **Inventory** the source docs (file list) and decide what is IN/OUT of scope.592. **Derive candidate skills**:60 - one skill should map to one capability (not one file),61 - split long docs into multiple skills by trigger/intent,62 - merge overlapping docs when they solve the same intent.633. Create a **conversion plan** using `./templates/conversion-plan.schema.json`:64 - define the skills to create,65 - map each skill to its source docs,66 - define which examples/templates to extract.674. Review the plan and obtain approval before writing files:68 - confirm the skill taxonomy and naming69 - confirm portability constraints (remove provider/project specifics)70 - confirm what will be created vs updated715. Run:72 - `python3 ./scripts/skillgen.py apply --plan <plan.json>` to scaffold the skill directories.736. For each generated skill:74 - rewrite `SKILL.md` to be **high-signal and short**,75 - move large examples into `examples/`,76 - move reusable snippets into `templates/`,77 - put deep rationale into `reference.md`,78 - remove cross-skill links ("See also", "Related docs").797. Run:80 - `python3 ./scripts/skillgen.py lint --skills-root <skills_root>` and fix issues until clean.818. Package the bundle (optional):82 - `python3 ./scripts/skillgen.py package --skills-root <skills_root> --out <bundle.zip>`8384### Scenario B: Convert docs directly into a repository skills root85Follow Scenario A, but set `skills_root` to the repository's skills SSOT directory.8687If your repo has additional syncing rules (provider stubs, monorepo layouts), treat those as **outside** the scope; the skill only produces the SSOT-format skills.8889## Boundaries90- You MUST NOT include secrets, credentials, or internal-only URLs in generated skills.91- You MUST NOT copy large logs or whole source documents verbatim into `SKILL.md`.92- You SHOULD avoid hard-coded repository paths unless the target is explicitly "dev-docs" with a known layout.93- You MUST keep each `SKILL.md` <= 500 lines by moving detail into `reference.md`, `examples/`, and `templates/`.9495## Verification96Run the linter and confirm:97- the conversion plan was reviewed and approved before applying98- every skill directory contains `SKILL.md` with valid YAML frontmatter99- `name` matches the directory name100- no `resources/` directories exist101- `SKILL.md` line count is within limits102- examples/templates live under `examples/` and `templates/` rather than bloating `SKILL.md`103- cross-skill relative links (e.g., `../<other-skill>`) are absent104105## Included assets106- `./scripts/skillgen.py`: plan/apply/lint/package helper107- `./scripts/init_skill.py`: optional helper to scaffold a new skill directory108- `./templates/conversion-plan.schema.json`: JSON Schema for a conversion plan109- `./templates/conversion-plan.example.json`: example plan110- `./templates/skill-skeleton/SKILL.md`: copy/pasteable skeleton for manual skill authoring111- `./examples/quickstart.md`: end-to-end usage example112- `./examples/plan-writing-guide.md`: how to write a good plan for an LLM