metame-cli 1.5.11 → 1.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/index.js +64 -7
  2. package/package.json +3 -2
  3. package/scripts/daemon-agent-commands.js +6 -2
  4. package/scripts/daemon-bridges.js +23 -9
  5. package/scripts/daemon-claude-engine.js +87 -28
  6. package/scripts/daemon-command-router.js +16 -0
  7. package/scripts/daemon-command-session-route.js +3 -1
  8. package/scripts/daemon-engine-runtime.js +1 -5
  9. package/scripts/daemon-message-pipeline.js +113 -44
  10. package/scripts/daemon-reactive-lifecycle.js +405 -9
  11. package/scripts/daemon-session-commands.js +3 -2
  12. package/scripts/daemon-session-store.js +82 -27
  13. package/scripts/daemon-team-dispatch.js +21 -5
  14. package/scripts/daemon-utils.js +3 -1
  15. package/scripts/daemon.js +1 -0
  16. package/scripts/docs/file-transfer.md +1 -0
  17. package/scripts/hooks/intent-file-transfer.js +2 -1
  18. package/scripts/hooks/intent-perpetual.js +109 -0
  19. package/scripts/hooks/intent-research.js +112 -0
  20. package/scripts/intent-registry.js +4 -0
  21. package/scripts/ops-mission-queue.js +258 -0
  22. package/scripts/ops-verifier.js +197 -0
  23. package/skills/agent-browser/SKILL.md +153 -0
  24. package/skills/agent-reach/SKILL.md +66 -0
  25. package/skills/agent-reach/evolution.json +13 -0
  26. package/skills/deep-research/SKILL.md +77 -0
  27. package/skills/find-skills/SKILL.md +133 -0
  28. package/skills/heartbeat-task-manager/SKILL.md +63 -0
  29. package/skills/macos-local-orchestrator/SKILL.md +192 -0
  30. package/skills/macos-local-orchestrator/agents/openai.yaml +4 -0
  31. package/skills/macos-local-orchestrator/references/tooling-landscape.md +70 -0
  32. package/skills/macos-mail-calendar/SKILL.md +394 -0
  33. package/skills/mcp-installer/SKILL.md +138 -0
  34. package/skills/skill-creator/LICENSE.txt +202 -0
  35. package/skills/skill-creator/README.md +72 -0
  36. package/skills/skill-creator/SKILL.md +96 -0
  37. package/skills/skill-creator/evolution.json +6 -0
  38. package/skills/skill-creator/references/creation-guide.md +116 -0
  39. package/skills/skill-creator/references/evolution-guide.md +74 -0
  40. package/skills/skill-creator/references/output-patterns.md +82 -0
  41. package/skills/skill-creator/references/workflows.md +28 -0
  42. package/skills/skill-creator/scripts/align_all.py +32 -0
  43. package/skills/skill-creator/scripts/auto_evolve_hook.js +247 -0
  44. package/skills/skill-creator/scripts/init_skill.py +303 -0
  45. package/skills/skill-creator/scripts/merge_evolution.py +70 -0
  46. package/skills/skill-creator/scripts/package_skill.py +110 -0
  47. package/skills/skill-creator/scripts/quick_validate.py +103 -0
  48. package/skills/skill-creator/scripts/setup.py +141 -0
  49. package/skills/skill-creator/scripts/smart_stitch.py +82 -0
  50. package/skills/skill-manager/SKILL.md +112 -0
  51. package/skills/skill-manager/scripts/delete_skill.py +31 -0
  52. package/skills/skill-manager/scripts/list_skills.py +61 -0
  53. package/skills/skill-manager/scripts/scan_and_check.py +125 -0
  54. package/skills/skill-manager/scripts/sync_index.py +144 -0
  55. package/skills/skill-manager/scripts/update_helper.py +39 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,72 @@
1
+ # MetaMe Skill Creator
2
+
3
+ A complete skill lifecycle management system for [Claude Code](https://claude.ai/code) — create, iterate, evolve, and package skills that extend Claude's capabilities.
4
+
5
+ ## What It Does
6
+
7
+ | Capability | Description |
8
+ |---|---|
9
+ | **Create** | Scaffold new skills with `init_skill.py`, write `SKILL.md`, bundle scripts/references/assets |
10
+ | **Iterate** | Structured workflow for improving skills after real usage |
11
+ | **Evolve** | Auto-captures session experience (bugs, preferences, workarounds) and stitches it into SKILL.md |
12
+ | **Package** | Produces portable `.skill` files for distribution |
13
+
14
+ ## Install
15
+
16
+ Install via [skill-manager](https://github.com/anthropics/claude-code) or manually:
17
+
18
+ ```bash
19
+ # Manual install
20
+ cp -r skill-creator ~/.claude/skills/
21
+
22
+ # One-time setup: enables auto-evolution after every session
23
+ python3 ~/.claude/skills/skill-creator/scripts/setup.py
24
+ ```
25
+
26
+ That's it. Skills now evolve automatically.
27
+
28
+ ## Auto-Evolution
29
+
30
+ After each Claude Code session, a Stop hook:
31
+ 1. Detects which skills were active
32
+ 2. Extracts failures and patterns from the transcript
33
+ 3. If `ANTHROPIC_API_KEY` is set → Haiku analyzes and generates structured insights
34
+ 4. Persists experience into `evolution.json` + stitches it into `SKILL.md`
35
+
36
+ Experience survives skill upgrades — it lives in a dedicated `## User-Learned Best Practices` section that persists through updates.
37
+
38
+ **No `ANTHROPIC_API_KEY`?** Hook runs in rule-based mode, capturing raw tool failures. Full Haiku analysis activates automatically once the key is available.
39
+
40
+ ## Manual Triggers
41
+
42
+ ```bash
43
+ # Evolve a skill from session experience
44
+ /evolve
45
+
46
+ # Or say: "进化技能", "记录这个经验", "skill evolution"
47
+ ```
48
+
49
+ ## Scripts
50
+
51
+ ```
52
+ scripts/
53
+ ├── init_skill.py # Scaffold new skill directory
54
+ ├── package_skill.py # Validate + pack to .skill file
55
+ ├── quick_validate.py # Validate without packaging
56
+ ├── merge_evolution.py # Merge experience into evolution.json
57
+ ├── smart_stitch.py # Write evolution.json → SKILL.md section
58
+ ├── align_all.py # Re-stitch all skills after batch update
59
+ ├── auto_evolve_hook.js # Stop hook (configured by setup.py)
60
+ └── setup.py # One-time hook installer
61
+ ```
62
+
63
+ ## References
64
+
65
+ - `references/creation-guide.md` — Full 7-step skill creation workflow
66
+ - `references/evolution-guide.md` — Evolution workflow and data format
67
+ - `references/workflows.md` — Sequential/conditional workflow design patterns
68
+ - `references/output-patterns.md` — Output quality and template patterns
69
+
70
+ ## License
71
+
72
+ See `LICENSE.txt`
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: skill-creator
3
+ description: Create, iterate, evolve, and package skills that extend Claude's capabilities. Use when: (1) Creating a new skill from scratch, (2) Updating or improving an existing skill's instructions or bundled resources, (3) Evolving a skill based on session experience (bugs, preferences, workarounds) — triggers: "进化技能", "更新 skill", "/evolve", "记录这个经验", "skill evolution", (4) Packaging a skill for distribution to other Claude Code (Codex) users. Do NOT trigger for general programming tasks unrelated to skill authoring.
4
+ license: Complete terms in LICENSE.txt
5
+ ---
6
+
7
+ # Skill Studio
8
+
9
+ ## Auto-Evolve Setup (run once, idempotent)
10
+
11
+ Before starting any task, run setup. The script auto-detects your platform:
12
+
13
+ ```bash
14
+ # Claude Code
15
+ python3 "$(find ~/.claude/skills -path '*/skill-creator/scripts/setup.py' 2>/dev/null | head -1)"
16
+
17
+ # OpenAI Codex CLI
18
+ python3 "$(find ~/.codex/skills -path '*/skill-creator/scripts/setup.py' 2>/dev/null | head -1)"
19
+ ```
20
+
21
+ Safe to run every time — exits immediately if already installed.
22
+
23
+ **CC**: adds a Stop hook to `~/.claude/settings.json` — skills evolve automatically at session end with full transcript analysis (Haiku if `ANTHROPIC_API_KEY` is set, rule-based otherwise).
24
+
25
+ **Codex**: adds a `notify` entry to `~/.codex/config.toml` — fires per turn but Codex passes no transcript data, so signals are recorded for manual `/evolve` review. Full auto-analysis not available on Codex.
26
+
27
+ ---
28
+
29
+ Three paths — pick based on your goal:
30
+
31
+ **🆕 Creating a new skill** → read `references/creation-guide.md`
32
+
33
+ **🔄 Evolving an existing skill** (session experience, bugs, preferences) → read `references/evolution-guide.md`
34
+
35
+ **🎨 Designing workflows or output patterns** → read `references/workflows.md` and/or `references/output-patterns.md`
36
+
37
+ ---
38
+
39
+ ## Core Principles
40
+
41
+ **Context window is a public good.** Default assumption: Claude is smart. Only include what Claude doesn't already have. Challenge every paragraph: "Does this justify its token cost?"
42
+
43
+ **Progressive disclosure** — three loading levels:
44
+ 1. Frontmatter `description` (~100 words) — always in context, determines triggering
45
+ 2. SKILL.md body (<500 lines) — loaded when skill triggers
46
+ 3. `references/` and `scripts/` — loaded only when Claude decides they're needed
47
+
48
+ **Degrees of freedom** — match specificity to fragility:
49
+ - High freedom (text instructions): multiple valid approaches
50
+ - Medium freedom (pseudocode/parameterized scripts): preferred pattern with variation
51
+ - Low freedom (specific scripts): fragile operations needing exact sequence
52
+
53
+ ---
54
+
55
+ ## Anatomy of a Skill
56
+
57
+ ```
58
+ skill-name/
59
+ ├── SKILL.md ← required: frontmatter + body
60
+ ├── scripts/ ← executable code (deterministic, reusable)
61
+ ├── references/ ← docs loaded into context as needed
62
+ └── assets/ ← files used in output (not loaded into context)
63
+ ```
64
+
65
+ **Frontmatter required fields:** `name`, `description` (+ `needs_browser: true` if Playwright MCP needed)
66
+
67
+ **What NOT to include:** README.md, CHANGELOG.md, INSTALLATION_GUIDE.md, or any auxiliary docs.
68
+
69
+ ---
70
+
71
+ ## Scripts Reference
72
+
73
+ | Script | Purpose | Usage |
74
+ |---|---|---|
75
+ | `init_skill.py` | Scaffold new skill | `python scripts/init_skill.py <name> --path <dir>` |
76
+ | `package_skill.py` | Validate + pack to `.skill` file | `python scripts/package_skill.py <skill-dir> [output-dir]` |
77
+ | `quick_validate.py` | Validate without packaging | `python scripts/quick_validate.py <skill-dir>` |
78
+ | `merge_evolution.py` | Persist session experience to evolution.json | `python scripts/merge_evolution.py <skill-dir> '<json>'` |
79
+ | `smart_stitch.py` | Write evolution.json → SKILL.md section | `python scripts/smart_stitch.py <skill-dir>` |
80
+ | `align_all.py` | Re-stitch all skills after batch update | `python scripts/align_all.py <skills-root-dir>` |
81
+ | `auto_evolve_hook.js` | Stop hook — auto-runs after each CC session | configured by `setup.py` |
82
+ | `setup.py` | Install Stop hook into `~/.claude/settings.json` | `python3 scripts/setup.py` |
83
+
84
+ **For Codex/CC users:** `.skill` files are portable zip archives. Host on GitHub → discoverable via `skill-scout`. No hardcoded path assumptions — all scripts accept explicit paths.
85
+
86
+
87
+ <!-- METAME-EVOLUTION:START -->
88
+
89
+ ## User-Learned Best Practices & Constraints
90
+
91
+ > **Auto-Generated Section**: Maintained by skill-evolution-manager. Do not edit manually.
92
+
93
+ ### User Preferences
94
+ - Add template for semantic trigger hooks to prevent accidental skill invocation (Signal 23), and enforce pointer-style one-line descriptions instead of full skill content reads to reduce TOKEN bloat. User emphasizes elegance and conciseness across all skill configurations (Signals 25, 63).
95
+
96
+ <!-- METAME-EVOLUTION:END -->
@@ -0,0 +1,6 @@
1
+ {
2
+ "last_updated": "2026-03-16T12:51:35.102Z",
3
+ "preferences": [
4
+ "Add template for semantic trigger hooks to prevent accidental skill invocation (Signal 23), and enforce pointer-style one-line descriptions instead of full skill content reads to reduce TOKEN bloat. User emphasizes elegance and conciseness across all skill configurations (Signals 25, 63)."
5
+ ]
6
+ }
@@ -0,0 +1,116 @@
1
+ # Skill Creation Guide
2
+
3
+ ## Step 1: Understand the Skill with Concrete Examples
4
+
5
+ Skip only when usage patterns are already clearly understood.
6
+
7
+ To create an effective skill, understand concrete examples of how it will be used. Ask:
8
+ - "What functionality should this skill support?"
9
+ - "Can you give examples of how this skill would be used?"
10
+ - "What would a user say to trigger this skill?"
11
+
12
+ Avoid asking too many questions at once. Conclude when the functionality scope is clear.
13
+
14
+ ## Step 2: Plan Reusable Skill Contents
15
+
16
+ Analyze each example:
17
+ 1. How to execute it from scratch
18
+ 2. What scripts, references, and assets would help when repeating it
19
+
20
+ | Example task | What to bundle |
21
+ |---|---|
22
+ | "Rotate this PDF" | `scripts/rotate_pdf.py` |
23
+ | "Build me a todo app" | `assets/hello-world/` boilerplate |
24
+ | "How many users logged in today?" | `references/schema.md` |
25
+
26
+ ## Step 3: Initialize the Skill
27
+
28
+ For new skills, always run `init_skill.py`:
29
+
30
+ ```bash
31
+ python scripts/init_skill.py <skill-name> --path <output-directory>
32
+ ```
33
+
34
+ Creates: skill directory, SKILL.md template, example `scripts/`, `references/`, `assets/`.
35
+
36
+ Skip if iterating on an existing skill.
37
+
38
+ ## Step 4: Edit the Skill
39
+
40
+ You are writing for another Claude instance. Include non-obvious procedural knowledge.
41
+
42
+ ### Frontmatter
43
+
44
+ Required fields only:
45
+ - `name`: skill name
46
+ - `description`: primary trigger mechanism — include what the skill does AND when to use it. Put ALL "when to use" info here (body is only loaded after triggering). Set `needs_browser: true` if Playwright MCP is required.
47
+
48
+ Do not add other frontmatter fields.
49
+
50
+ ### Body
51
+
52
+ - Use imperative/infinitive form
53
+ - Keep under 500 lines — split larger content into references files
54
+ - Only include info Claude doesn't already have
55
+ - Move detailed reference material to `references/` files, link from SKILL.md
56
+ - See `workflows.md` for sequential/conditional workflow patterns
57
+ - See `output-patterns.md` for template and example patterns
58
+
59
+ ### Resource Guidelines
60
+
61
+ **scripts/** — when the same code is rewritten repeatedly or deterministic reliability is needed. Always test scripts by running them.
62
+
63
+ **references/** — documentation to load as needed. For files >10k words, include grep patterns in SKILL.md. Keep SKILL.md lean; detail lives here.
64
+
65
+ **assets/** — files used in output (templates, images, fonts, boilerplate). Not loaded into context.
66
+
67
+ **Do NOT include:** README.md, INSTALLATION_GUIDE.md, CHANGELOG.md, or any auxiliary docs.
68
+
69
+ ## Step 5: Package the Skill
70
+
71
+ ```bash
72
+ python scripts/package_skill.py <path/to/skill-folder>
73
+ # Optional: specify output dir
74
+ python scripts/package_skill.py <path/to/skill-folder> ./dist
75
+ ```
76
+
77
+ Validates then creates a `.skill` file (zip with .skill extension). Fix any validation errors before packaging.
78
+
79
+ **For Codex/CC users distributing skills:**
80
+ - Package produces a `.skill` file ready for `skill-manager` install
81
+ - Host on GitHub for others to discover via `skill-scout`
82
+ - The `.skill` format is portable — no path assumptions about `~/.claude/skills/`
83
+
84
+ ## Step 6: Iterate
85
+
86
+ After real usage, notice struggles and inefficiencies, then update SKILL.md or bundled resources.
87
+
88
+ ## Step 7: Evaluate & Optimize (Advanced)
89
+
90
+ ### Skill Evals
91
+
92
+ Define test cases in SKILL.md to verify skill effectiveness:
93
+
94
+ ```markdown
95
+ ## Evals
96
+
97
+ | Input | Expected behavior | Success criteria |
98
+ |---|---|---|
99
+ | "Rotate this PDF" | calls rotate_pdf.py | file output succeeds |
100
+ | "Extract page 3 text" | calls extract_text.py | returns text content |
101
+ ```
102
+
103
+ Re-validate after each modification.
104
+
105
+ ### A/B Testing
106
+
107
+ Run two skill versions in parallel. Compare: output quality, token cost, trigger accuracy. Use before/after major changes (rewriting description, restructuring workflow). Keep the better version.
108
+
109
+ ### Trigger Optimization
110
+
111
+ Analyze the `description` field for:
112
+ - **False triggers**: unrelated tasks triggering this skill
113
+ - **Missed triggers**: related tasks not triggering
114
+ - **Ambiguity**: unstable triggering due to vague description
115
+
116
+ Fix by adding concrete trigger examples to description. Explicitly exclude easily-confused scenarios with "Do NOT trigger when...".
@@ -0,0 +1,74 @@
1
+ # Skill Evolution Guide
2
+
3
+ Evolution captures runtime experience (bugs, preferences, workarounds) and stitches it persistently into a skill's SKILL.md — surviving future skill upgrades.
4
+
5
+ ## When to Evolve
6
+
7
+ Trigger: user says `/evolve`, "复盘一下", "记录这个经验", "把这个偏好保存到 Skill", or expresses friction during a skill session.
8
+
9
+ ## Workflow
10
+
11
+ ### 1. Review & Extract
12
+
13
+ Scan the conversation for:
14
+ - Things the user was unhappy with (errors, wrong style, bad params)
15
+ - Things that worked well (effective prompts, useful patterns)
16
+ - Environment-specific quirks (OS differences, path issues)
17
+
18
+ Identify which skill needs evolving.
19
+
20
+ Build a JSON structure in memory:
21
+
22
+ ```json
23
+ {
24
+ "preferences": ["user prefers silent download by default"],
25
+ "fixes": ["on Windows, ffmpeg path needs backslash escaping"],
26
+ "custom_prompts": "always print estimated time before starting"
27
+ }
28
+ ```
29
+
30
+ Fields:
31
+ - `preferences` — user workflow preferences (list, deduplicated)
32
+ - `fixes` — known bugs, workarounds, env-specific patches (list, deduplicated)
33
+ - `custom_prompts` — persistent instruction injection (string, overwrites previous)
34
+
35
+ ### 2. Persist to evolution.json
36
+
37
+ ```bash
38
+ python scripts/merge_evolution.py <skill_dir> '<json_string>'
39
+ ```
40
+
41
+ Merges new data into `<skill_dir>/evolution.json` with deduplication on list fields.
42
+
43
+ ### 3. Stitch into SKILL.md
44
+
45
+ ```bash
46
+ python scripts/smart_stitch.py <skill_dir>
47
+ ```
48
+
49
+ Writes or updates a `## User-Learned Best Practices & Constraints` section at the end of SKILL.md. This section survives skill upgrades because it's in a dedicated marked block.
50
+
51
+ ### 4. Post-Upgrade Realignment
52
+
53
+ After `skill-manager` updates a skill (which replaces SKILL.md), re-stitch all stored experience:
54
+
55
+ ```bash
56
+ python scripts/align_all.py <skills_root_dir>
57
+ ```
58
+
59
+ Traverses all skill folders, re-applies any existing `evolution.json` to the updated SKILL.md. Run this after any batch skill update.
60
+
61
+ **For Codex/CC users:** `<skills_root_dir>` defaults to `~/.claude/skills/` but can be any path — pass the actual location of your skills directory.
62
+
63
+ ## Important Rules
64
+
65
+ - **Never directly edit** the `## User-Learned Best Practices & Constraints` section in SKILL.md — it will be overwritten by `smart_stitch.py`. All changes must go through `evolution.json`.
66
+ - If a conversation touches multiple skills, run the full workflow for each skill separately.
67
+ - The `evolution.json` file is the source of truth; SKILL.md section is derived from it.
68
+
69
+ ## Multi-Skill Session
70
+
71
+ When one session uses several skills, after the session:
72
+ 1. List all skills used
73
+ 2. For each skill, extract relevant experience
74
+ 3. Run `merge_evolution.py` + `smart_stitch.py` per skill
@@ -0,0 +1,82 @@
1
+ # Output Patterns
2
+
3
+ Use these patterns when skills need to produce consistent, high-quality output.
4
+
5
+ ## Template Pattern
6
+
7
+ Provide templates for output format. Match the level of strictness to your needs.
8
+
9
+ **For strict requirements (like API responses or data formats):**
10
+
11
+ ```markdown
12
+ ## Report structure
13
+
14
+ ALWAYS use this exact template structure:
15
+
16
+ # [Analysis Title]
17
+
18
+ ## Executive summary
19
+ [One-paragraph overview of key findings]
20
+
21
+ ## Key findings
22
+ - Finding 1 with supporting data
23
+ - Finding 2 with supporting data
24
+ - Finding 3 with supporting data
25
+
26
+ ## Recommendations
27
+ 1. Specific actionable recommendation
28
+ 2. Specific actionable recommendation
29
+ ```
30
+
31
+ **For flexible guidance (when adaptation is useful):**
32
+
33
+ ```markdown
34
+ ## Report structure
35
+
36
+ Here is a sensible default format, but use your best judgment:
37
+
38
+ # [Analysis Title]
39
+
40
+ ## Executive summary
41
+ [Overview]
42
+
43
+ ## Key findings
44
+ [Adapt sections based on what you discover]
45
+
46
+ ## Recommendations
47
+ [Tailor to the specific context]
48
+
49
+ Adjust sections as needed for the specific analysis type.
50
+ ```
51
+
52
+ ## Examples Pattern
53
+
54
+ For skills where output quality depends on seeing examples, provide input/output pairs:
55
+
56
+ ```markdown
57
+ ## Commit message format
58
+
59
+ Generate commit messages following these examples:
60
+
61
+ **Example 1:**
62
+ Input: Added user authentication with JWT tokens
63
+ Output:
64
+ ```
65
+ feat(auth): implement JWT-based authentication
66
+
67
+ Add login endpoint and token validation middleware
68
+ ```
69
+
70
+ **Example 2:**
71
+ Input: Fixed bug where dates displayed incorrectly in reports
72
+ Output:
73
+ ```
74
+ fix(reports): correct date formatting in timezone conversion
75
+
76
+ Use UTC timestamps consistently across report generation
77
+ ```
78
+
79
+ Follow this style: type(scope): brief description, then detailed explanation.
80
+ ```
81
+
82
+ Examples help Claude understand the desired style and level of detail more clearly than descriptions alone.
@@ -0,0 +1,28 @@
1
+ # Workflow Patterns
2
+
3
+ ## Sequential Workflows
4
+
5
+ For complex tasks, break operations into clear, sequential steps. It is often helpful to give Claude an overview of the process towards the beginning of SKILL.md:
6
+
7
+ ```markdown
8
+ Filling a PDF form involves these steps:
9
+
10
+ 1. Analyze the form (run analyze_form.py)
11
+ 2. Create field mapping (edit fields.json)
12
+ 3. Validate mapping (run validate_fields.py)
13
+ 4. Fill the form (run fill_form.py)
14
+ 5. Verify output (run verify_output.py)
15
+ ```
16
+
17
+ ## Conditional Workflows
18
+
19
+ For tasks with branching logic, guide Claude through decision points:
20
+
21
+ ```markdown
22
+ 1. Determine the modification type:
23
+ **Creating new content?** → Follow "Creation workflow" below
24
+ **Editing existing content?** → Follow "Editing workflow" below
25
+
26
+ 2. Creation workflow: [steps]
27
+ 3. Editing workflow: [steps]
28
+ ```