$npx -y skills add AGI-comming/functional-skill-creator --skill fskill-creatorCreate, maintain, or migrate functional skills; supports creating from a requirement brief and migrating an existing legacy skill directory into a functional skill structure.
| 1 | # fskill-creator |
| 2 | |
| 3 | ## Goal |
| 4 | |
| 5 | Unify the create and migrate lanes to produce a self-contained, reviewable, testable functional agent skill directory. The main skill handles routing, blueprint normalization, shared artifact generation, runtime capability provisioning, file writing, and validation; sub-skills only handle pre-analysis for their respective input forms. |
| 6 | |
| 7 | Use this skill when the user wants to "generate a functional skill", "create a functional skill", "add functions to an existing functional skill", or "migrate an existing legacy skill directory into a functional skill". |
| 8 | |
| 9 | ## Principles |
| 10 | |
| 11 | - The main `SKILL.md` only orchestrates the shared create / migrate / enhance / validate workflow. |
| 12 | - Create and migrate are two pre-lanes; they must first converge into a unified `skill_blueprint`. |
| 13 | - Function-specific behavior lives in `functions/*.md`; create / migrate specific pre-behavior lives in `sub-skills/*/functions/*.md`. |
| 14 | - Shared vocabulary, policies, and schemas live in `references/*.md`. |
| 15 | - Deterministic parsing, formatting, validation, and mechanical transforms live in `scripts/`. |
| 16 | - Report, unit test, viewer, and testcase capabilities are maintained only once in the main skill, and vendored into the target skill by `add_runtime_capabilities`. |
| 17 | - Preserve user-provided domain constraints; the migrate lane must also preserve legacy behavior evidence. |
| 18 | - When the user has not approved direct modification, generated files should be treated as proposals. |
| 19 | |
| 20 | ## Sub-Skills |
| 21 | |
| 22 | | Sub-skill | When | Responsibility | Output | |
| 23 | |---|---|---|---| |
| 24 | | `sub-skills/create` | User provides a new skill brief or wants to enhance an existing functional skill | Normalize requirements, target path, inputs/outputs, constraints, and viewer choices | `create_context` | |
| 25 | | `sub-skills/migrate` | User provides a legacy skill directory, monolithic skill content, or a migration request | Load the legacy skill package, identify behaviors that must be preserved, propose function boundaries and evidence | `migration_context` | |
| 26 | |
| 27 | Sub-skills do not directly write final target skill files. Their output must go through `normalize_skill_blueprint` before entering the shared artifact pipeline. |
| 28 | |
| 29 | ## References |
| 30 | |
| 31 | | Resource | Load Timing | Purpose | |
| 32 | |---|---|---| |
| 33 | | `shared_glossary` | On demand | Stable terminology and cross-lane field semantics. | |
| 34 | | `script_rules` | Before designing or drafting scripts | Rules for deciding whether deterministic work belongs in `scripts/`. | |
| 35 | | `sub-skills/create` | Create lane | Form `create_context` from user brief. | |
| 36 | | `sub-skills/migrate` | Migrate lane | Form `migration_context` from a legacy skill directory. | |
| 37 | |
| 38 | ## External Inputs |
| 39 | |
| 40 | | Field | Source | Description | |
| 41 | |---|---|---| |
| 42 | | `task_mode` | user or derived | `create`, `migrate`, `enhance`, or `validate`; inferred by `resolve_task_mode` when absent. | |
| 43 | | `skill_request` | user | Requirement description for creating or enhancing a skill. | |
| 44 | | `legacy_skill_dir` | user or repository | Path to an existing legacy skill directory containing `SKILL.md` and optional companion files. | |
| 45 | | `legacy_skill_path` | user or repository | Deprecated alias for `legacy_skill_dir`; may also be a direct path to `SKILL.md`, which resolves to its parent directory. | |
| 46 | | `legacy_skill_content` | user | Legacy skill markdown provided when the path is inaccessible. | |
| 47 | | `target_skill_path` | user or derived | Directory where the functional skill should live. | |
| 48 | | `skill_name` | user or derived | Optional target skill name. | |
| 49 | | `existing_skill_files` | repository | Optional existing functional skill files. | |
| 50 | | `migration_constraints` | user | File names, tone, platform rules, or behaviors that must be preserved during migration. | |
| 51 | | `known_testcases` | user or repository | Existing examples, traces, or expected behaviors. | |
| 52 | | `existing_scripts` | repository | Helper scripts associated with the legacy skill. | |
| 53 | | `include_report` | user | Whether to generate report log runtime in the target skill; defaults to `true`. | |
| 54 | | `include_unittest` | user | Whether to generate unittest / testcase runner in the target skill; defaults to `true`. | |
| 55 | | `script_runtime` | environment | Whether this skill's own Node.js scripts can be run. | |
| 56 | | `report_mode` | user | `off`, `local`, or `remote`; defaults to `off`. | |
| 57 | |
| 58 | Viewers are generated following the capability flags: `tools/log_viewer.mjs` when `include_report=true`; `tools/tester_viewer.mjs` when `include_unittest=true`. |
| 59 | |
| 60 | ## Execution Pipeline |
| 61 | |
| 62 | | Step | Function | Purpose | Input | Output | |
| 63 | |---:|---|---|---|---| |
| 64 | | 1 | `resolve_task_mode` | Determine whether this request should go through create, migrate, enhance, or validate. | `task_mode`<br>`skill_request`<br>`legacy_skill_dir`<br>`legacy_skill_path`<br>`legacy_skill_content`<br>`existing_skill_files |