Meta-plugin for GitHub Copilot CLI that watches workflows and auto-generates reusable agent skills. - postToolUse hook: fingerprints and logs tool calls per session - sessionEnd hook: sliding-window pattern detection across sessions - sessionStart hook: injects context about proposed skills - /skill-factory slash command for reviewing/managing skills - 13 passing tests validating observer, analyzer, and edge cases Inspired by hermes-skill-factory (Romanescu11/hermes-skill-factory)
3.8 KiB
Executable File
name, description, argument-hint
| name | description | argument-hint |
|---|---|---|
| skill-factory | Meta-skill for managing automatically detected workflows. Review proposed skills, inspect detected patterns, and turn your repeated tool-call sequences into reusable Copilot CLI agent skills. Use /skill-factory review to see what's ready. | [review|propose|list|status|save <name>|dismiss <name>|clear] |
🏭 Skill Factory
The meta-skill that creates skills. Automatically watches your workflows and turns them into reusable agent skills.
Commands
When the user types /skill-factory (with or without arguments), follow this guide:
/skill-factory review
Show all proposed skills ready for review. For each one:
- Read the
SKILL.mdin~/.copilot/skills/skill-factory/proposed/<name>/SKILL.md - Read the
.proposal.jsonfor metadata (session count, occurrences) - Present a summary to the user and ask if they want to:
- Accept — move to
~/.copilot/skills/<name>/(makes it active) - Edit — open the SKILL.md for editing first
- Dismiss — archive to
~/.copilot/skills/skill-factory/dismissed/ - Skip — leave as-is for later
- Accept — move to
/skill-factory propose
Force analysis of current session patterns. Read the pattern database:
~/.copilot/skills/skill-factory/.data/pattern-db.json(or in the plugin's data directory)- Show the top 5 most frequent patterns (by session count)
- For each, describe the tool-call sequence and ask if the user wants to generate a skill
/skill-factory list
List all skills generated by Skill Factory (both proposed and accepted):
~/.copilot/skills/skill-factory/proposed/— proposed~/.copilot/skills/<name>/— accepted (look for.factory.jsonmarker)
/skill-factory status
Show Skill Factory statistics:
- Number of sessions tracked
- Number of patterns detected
- Number of proposed/accepted/dismissed skills
- Read from
~/.copilot/skills/skill-factory/.data/pattern-db.json
/skill-factory save <name>
Save the last proposal with a custom name. Used when the user wants to rename a proposed skill.
/skill-factory dismiss <name>
Dismiss a proposed skill. Moves it to ~/.copilot/skills/skill-factory/dismissed/.
/skill-factory clear
Clear the pattern database and all proposed skills. Asks for confirmation first.
Data Locations
| Data | Path |
|---|---|
| Pattern database | ~/.copilot/skills/skill-factory/.data/pattern-db.json |
| Proposed skills | ~/.copilot/skills/skill-factory/proposed/<name>/ |
| Accepted skills | ~/.copilot/skills/<name>/ (with .factory.json marker) |
| Dismissed skills | ~/.copilot/skills/skill-factory/dismissed/<name>/ |
| Session logs | ~/.copilot/skills/skill-factory/.data/sessions/<id>.jsonl |
Accepting a Skill
When the user accepts a proposed skill:
- Read the
SKILL.mdfromproposed/<name>/ - Create
~/.copilot/skills/<name>/SKILL.mdwith the content - Create
~/.copilot/skills/<name>/.factory.jsonwith:{ "generatedBy": "skill-factory", "generatedAt": "<ISO timestamp>", "patternKey": "<key>" } - Remove from
proposed/<name>/ - Tell the user the skill is now active and can be invoked with
/<name>
Dismissing a Skill
When the user dismisses a proposed skill:
- Move
proposed/<name>/todismissed/<name>/ - Update the pattern in the DB to mark it as dismissed
Important Notes
- The plugin (
copilot-skill-factory) handles automatic pattern detection via hooks. - This skill handles user interaction — reviewing, accepting, editing, dismissing.
- Always confirm before deleting or moving files.
- If the data directory doesn't exist yet, tell the user the plugin needs to run for at least one session first.
- Proposed skills are suggestions — they may need editing before they're useful.
- Encourage the user to customize accepted skills with specific instructions, pitfalls, and examples.