Distill books, documents, folders, or URLs into compact, practical Agent Skills. Use when source material should become either one reusable skill package or a split set of focused skills, each with a concise SKILL.md plus detailed references and examples.
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Fix and improve this skill with Tessl
tessl review fix ./skills/aif-distillation/SKILL.mdBefore mode routing or work, read existing files relative to the current project root in this order (reuse them if already loaded):
.ai-factory/skill-context/global-skill-context.md — all bundled skills..ai-factory/skill-context/aif-distillation/SKILL.md — this skill.Missing files are skipped; an existing unreadable file stops dependent work with its path.
Precedence: individual > build (when applicable) > global > skill defaults; retain non-conflicting instructions and check all outputs against the effective rules.
These layers customize workflow; they do not replace the project's rules/architecture hierarchy or relax explicit requirements, ownership, scope, safety/privacy, validation, or approval boundaries. Report conflicts with those boundaries instead of overriding them.
global is a project-local layer, not home-directory configuration. Custom/extension skills do not automatically use it.
Turn source material into a useful skill. The output is not a summary dump: it is an operational skill that captures the best practices, decision rules, workflows, checks, and examples from the material.
FIRST: Read .ai-factory/config.yaml if it exists to resolve:
language.ui for prompts, questions, progress updates, and final summarieslanguage.artifacts for generated skill package content (SKILL.md, references/, examples/)language.technical_terms for translated artifacts; default to keep when absentIf config.yaml doesn't exist, use defaults:
language.ui: enlanguage.artifacts: same as language.uilanguage.technical_terms: keepRead .ai-factory/skill-context/aif-distillation/SKILL.md - MANDATORY if the file exists.
Treat skill-context rules as project-level overrides for this skill. They apply to all generated skill files, references, examples, source-map policy, and final reports.
Accept $ARGUMENTS as one or more:
--name <skill-name>--path <directory> to save generated skill package directories under a custom output root instead of {{skills_dir}}--update to improve an existing skill instead of creating a duplicate--redact-source-map to skip generated source-map files and sections entirely, so exact source titles, URLs, local paths, repository paths, and link reference definitions are not written to output--split to create several focused skills from one material set--split-by <strategy> to choose the split strategy:
auto (default): infer skill boundaries from user goals, triggers, workflows, source topics, and use casesgoal: split by user goals or jobs-to-be-done, regardless of domaintopic: split by major source topics or chaptersworkflow: split by recurring actions an agent performsaudience: split by distinct user roles or implementation contextsIf the target skill name is missing, derive a concise, general, lowercase-hyphenated name from the material topic or user goal, such as clean-code-style, api-design-rules, decision-making, writing-feedback, or meeting-facilitation.
Before any write, validate the final target skill name:
^[a-z0-9]+(?:-[a-z0-9]+)*$.., .., dots, path separators (/ or \), absolute paths, Windows drive paths, and hidden names.aif-* names unless the user explicitly says they are developing AI Factory itself.--path <directory> when present, otherwise {{skills_dir}}.--path values as relative to the current working directory. Create the output root if it does not exist; reject it if it resolves to an existing file.Default destination for single-skill mode: <output-root>/<skill-name>/, where <output-root> is {{skills_dir}} unless --path is present.
Default destination for split mode: <output-root>/<prefix>-<child-scope>/ for each generated child skill. Every split child name must share one namespace prefix to prevent collisions with existing skills. Use --name as the preferred prefix when present; otherwise derive a concise prefix from the book title or primary material title. If --redact-source-map is present and the exact source title should not be exposed, use --name as the public namespace or derive a neutral topic prefix.
Do not save distilled skills into the package skills/ directory unless the user is explicitly developing AI Factory itself.
Prepare sources.
references/SOURCE-USE.md. Keep known, unknown, not-applicable, and redacted distinct; record conflicting terms without deciding permission.{{skills_dir}}/aif-distillation/scripts/material-prep.py only when a working Python 3 interpreter is available. Detect it with python3 --version, python --version, py -3 --version, then py --version; use the first command that exits successfully and reports Python major version 3.python3 ...material-prep.py or py -3 ...material-prep.py. Do not run arbitrary Python payloads; the pre-approved tool contract only covers version probes and material-prep.py execution.Read/Glob/Grep/find/wc sampling for accessible text files, ask the user for a text/markdown export for PDFs or very large sources, and clearly report any reduced coverage.Distill, do not copy.
Choose single-skill or split-skill design.
--split or --split-by is present.--name when present; otherwise use a normalized book/material title. Every proposed child name must start with <prefix>-.refactoring-review, test-design, or framework-fit-review; for writing this may be argument-edit or style-review; for operations this may be incident-triage or runbook-review; for management this may be decision-brief or stakeholder-analysis; for learning this may be concept-coach or practice-drill.framework-evolution, principles, philosophy, chapter-4, mindset, or overview unless that exact name is the user's requested public taxonomy.--redact-source-map is absent, include its own source map; if present, do not create references/SOURCE-MAP.md or a source-map section.Design the target skill package.
SKILL.md focused on purpose, triggers, and workflow.SKILL.md, answer in plain language: what this skill does, when to use it, and what output it should produce. A user should not need to inspect the source material to understand why the skill exists.references/.examples/.<output-root> from --path or {{skills_dir}} before writing. Treat --path as a parent directory for generated skill packages, not as the skill package name.<output-root>/<skill-name>/ using the chosen concise name.<output-root>/<prefix>-<child-scope>/. Do not drop the shared prefix even when the child scope is clear on its own.--redact-source-map is present, do not create references/SOURCE-MAP.md, do not create a "Source Map" section in any generated file, and remove any empty SOURCE-MAP.md accidentally created during drafting. In --update mode, leave an existing non-empty SOURCE-MAP.md unchanged unless the user explicitly asks to remove or rewrite it.language.artifacts for generated skill content unless the source material or user explicitly requires another language.Check existing content before writing.
<output-root> for matching triggers. Update a matching skill with --update instead of creating a new near-duplicate child.Validate usefulness.
references/SOURCE-USE.md, including revision invalidation on source/terms changes, split children, and redacted output. Missing terms do not block local distillation or imply redistribution permission.--redact-source-map is absent, record this in the source map; when present, validate coverage internally without writing source-map files or sections.aif-gate-result contract from /aif-verify references.If the user wants to evaluate a distilled practice in a specific project,
suggest /aif-explore to formulate a source-linked hypothesis. Preserve source
conditions and carry forward disclosure restrictions, including
--redact-source-map; do not reintroduce restricted identifiers in the handoff.
Carry the current source-use metadata revision, relevant notices, export
restrictions, conflicts, and unresolved owner decisions into any downstream
handoff. Redacted handoffs must explicitly retain reduced public traceability.
Distillation still writes only the selected skill outputs, does not write
RESEARCH/PLAN/RULES/config, and does not authorize a separate installation or
experiment run.
Publication is a separate explicit opt-in by the source/package owner. Local distillation does not automatically publish sources or skills, install a skill separately, train a model, or copy full books. No registry, network license lookup, or new mandatory legal-approval gate is required; unresolved reuse decisions stay with the owner.
Read these before generating or updating a distilled skill:
references/DISTILLATION-PROTOCOL.mdreferences/SOURCE-USE.mdreferences/OUTPUT-STRUCTURE.mdreferences/LARGE-MATERIALS.mdUse examples/REQUESTS.md for invocation patterns.
<output-root>/<skill-name>/, or multiple direct child skill packages under <output-root>/<prefix>-<child-scope>/ in split mode. <output-root> is {{skills_dir}} unless the user passes --path <directory>..ai-factory/config.yaml, existing AI Factory context artifacts, and existing skill files except the selected target skill in update mode.language.ui, language.artifacts, and language.technical_terms only. Do not write config.yaml.lee-to/ai-factory
9771b77
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.