memory-journal-mcp 7.0.1 → 7.2.0

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 (124) hide show
  1. package/README.md +75 -66
  2. package/dist/{chunk-6J4RPJ4I.js → chunk-GR4T3SRW.js} +146 -105
  3. package/dist/{chunk-ARLH46WS.js → chunk-IWKLHSPU.js} +89 -3
  4. package/dist/{chunk-2BJHLTYP.js → chunk-ORV7ZZOE.js} +1086 -86
  5. package/dist/cli.js +30 -4
  6. package/dist/github-integration-2TFMXHIJ.js +1 -0
  7. package/dist/index.d.ts +6 -2
  8. package/dist/index.js +3 -3
  9. package/dist/{tools-FFFGXIKN.js → tools-CXR2FEB2.js} +2 -2
  10. package/package.json +2 -2
  11. package/skills/README.md +77 -0
  12. package/skills/autonomous-dev/SKILL.md +56 -0
  13. package/skills/bin/sync.js +50 -0
  14. package/skills/bun/SKILL.md +156 -0
  15. package/skills/github-commander/SKILL.md +1 -1
  16. package/skills/github-commander/workflows/code-quality-audit.md +7 -5
  17. package/skills/github-commander/workflows/issue-triage.md +13 -4
  18. package/skills/github-commander/workflows/milestone-sprint.md +9 -1
  19. package/skills/github-commander/workflows/perf-audit.md +2 -0
  20. package/skills/github-commander/workflows/pr-review.md +9 -3
  21. package/skills/github-commander/workflows/roadmap-kickoff.md +79 -0
  22. package/skills/github-commander/workflows/security-audit.md +3 -3
  23. package/skills/github-commander/workflows/update-deps.md +2 -2
  24. package/skills/gitlab/SKILL.md +115 -0
  25. package/skills/gitlab/package-lock.json +392 -0
  26. package/skills/gitlab/package.json +14 -0
  27. package/skills/gitlab/scripts/gitlab-client.ts +125 -0
  28. package/skills/gitlab/scripts/gitlab-helper.ts +80 -0
  29. package/skills/golang/SKILL.md +54 -0
  30. package/skills/mysql/SKILL.md +30 -0
  31. package/skills/package.json +48 -0
  32. package/skills/playwright-standard/SKILL.md +58 -0
  33. package/skills/playwright-standard/examples/fixtures.ts +66 -0
  34. package/skills/playwright-standard/examples/type-stubs.d.ts +10 -0
  35. package/skills/playwright-standard/references/advanced-scenarios.md +59 -0
  36. package/skills/playwright-standard/references/infrastructure.md +43 -0
  37. package/skills/postgres/SKILL.md +33 -0
  38. package/skills/react-best-practices/AGENTS.md +2883 -0
  39. package/skills/react-best-practices/README.md +127 -0
  40. package/skills/react-best-practices/SKILL.md +138 -0
  41. package/skills/react-best-practices/metadata.json +17 -0
  42. package/skills/react-best-practices/rules/_sections.md +46 -0
  43. package/skills/react-best-practices/rules/_template.md +28 -0
  44. package/skills/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
  45. package/skills/react-best-practices/rules/advanced-init-once.md +42 -0
  46. package/skills/react-best-practices/rules/advanced-use-latest.md +39 -0
  47. package/skills/react-best-practices/rules/async-api-routes.md +35 -0
  48. package/skills/react-best-practices/rules/async-defer-await.md +80 -0
  49. package/skills/react-best-practices/rules/async-dependencies.md +48 -0
  50. package/skills/react-best-practices/rules/async-parallel.md +24 -0
  51. package/skills/react-best-practices/rules/async-suspense-boundaries.md +99 -0
  52. package/skills/react-best-practices/rules/bundle-barrel-imports.md +59 -0
  53. package/skills/react-best-practices/rules/bundle-conditional.md +37 -0
  54. package/skills/react-best-practices/rules/bundle-defer-third-party.md +48 -0
  55. package/skills/react-best-practices/rules/bundle-dynamic-imports.md +34 -0
  56. package/skills/react-best-practices/rules/bundle-preload.md +44 -0
  57. package/skills/react-best-practices/rules/client-event-listeners.md +78 -0
  58. package/skills/react-best-practices/rules/client-localstorage-schema.md +74 -0
  59. package/skills/react-best-practices/rules/client-passive-event-listeners.md +48 -0
  60. package/skills/react-best-practices/rules/client-swr-dedup.md +56 -0
  61. package/skills/react-best-practices/rules/js-batch-dom-css.md +110 -0
  62. package/skills/react-best-practices/rules/js-cache-function-results.md +80 -0
  63. package/skills/react-best-practices/rules/js-cache-property-access.md +28 -0
  64. package/skills/react-best-practices/rules/js-cache-storage.md +68 -0
  65. package/skills/react-best-practices/rules/js-combine-iterations.md +32 -0
  66. package/skills/react-best-practices/rules/js-early-exit.md +50 -0
  67. package/skills/react-best-practices/rules/js-hoist-regexp.md +45 -0
  68. package/skills/react-best-practices/rules/js-index-maps.md +37 -0
  69. package/skills/react-best-practices/rules/js-length-check-first.md +50 -0
  70. package/skills/react-best-practices/rules/js-min-max-loop.md +82 -0
  71. package/skills/react-best-practices/rules/js-set-map-lookups.md +24 -0
  72. package/skills/react-best-practices/rules/js-tosorted-immutable.md +57 -0
  73. package/skills/react-best-practices/rules/rendering-activity.md +24 -0
  74. package/skills/react-best-practices/rules/rendering-animate-svg-wrapper.md +38 -0
  75. package/skills/react-best-practices/rules/rendering-conditional-render.md +32 -0
  76. package/skills/react-best-practices/rules/rendering-content-visibility.md +38 -0
  77. package/skills/react-best-practices/rules/rendering-hoist-jsx.md +36 -0
  78. package/skills/react-best-practices/rules/rendering-hydration-no-flicker.md +72 -0
  79. package/skills/react-best-practices/rules/rendering-hydration-suppress-warning.md +26 -0
  80. package/skills/react-best-practices/rules/rendering-svg-precision.md +28 -0
  81. package/skills/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
  82. package/skills/react-best-practices/rules/rerender-defer-reads.md +39 -0
  83. package/skills/react-best-practices/rules/rerender-dependencies.md +45 -0
  84. package/skills/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
  85. package/skills/react-best-practices/rules/rerender-derived-state.md +29 -0
  86. package/skills/react-best-practices/rules/rerender-functional-setstate.md +77 -0
  87. package/skills/react-best-practices/rules/rerender-lazy-state-init.md +56 -0
  88. package/skills/react-best-practices/rules/rerender-memo-with-default-value.md +36 -0
  89. package/skills/react-best-practices/rules/rerender-memo.md +44 -0
  90. package/skills/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
  91. package/skills/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
  92. package/skills/react-best-practices/rules/rerender-transitions.md +40 -0
  93. package/skills/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
  94. package/skills/react-best-practices/rules/server-after-nonblocking.md +73 -0
  95. package/skills/react-best-practices/rules/server-auth-actions.md +96 -0
  96. package/skills/react-best-practices/rules/server-cache-lru.md +41 -0
  97. package/skills/react-best-practices/rules/server-cache-react.md +76 -0
  98. package/skills/react-best-practices/rules/server-dedup-props.md +65 -0
  99. package/skills/react-best-practices/rules/server-parallel-fetching.md +83 -0
  100. package/skills/react-best-practices/rules/server-serialization.md +38 -0
  101. package/skills/rust/SKILL.md +86 -0
  102. package/skills/shadcn-ui/SKILL.md +72 -0
  103. package/skills/skill-builder/SKILL.md +457 -0
  104. package/skills/skill-builder/checklist.md +65 -0
  105. package/skills/sqlite/SKILL.md +38 -0
  106. package/skills/typescript/SKILL.md +453 -0
  107. package/skills/typescript/assets/eslint-template.js +102 -0
  108. package/skills/typescript/assets/tsconfig-template.json +45 -0
  109. package/skills/typescript/references/enterprise-patterns.md +531 -0
  110. package/skills/typescript/references/generics.md +493 -0
  111. package/skills/typescript/references/nestjs-integration.md +579 -0
  112. package/skills/typescript/references/react-integration.md +616 -0
  113. package/skills/typescript/references/toolchain.md +547 -0
  114. package/skills/typescript/references/type-system.md +481 -0
  115. package/skills/vitest-standard/SKILL.md +82 -0
  116. package/skills/vitest-standard/examples/service-mock.ts +60 -0
  117. package/skills/vitest-standard/examples/tdd-calculator.ts +41 -0
  118. package/skills/vitest-standard/examples/type-stubs.d.ts +18 -0
  119. package/skills/vitest-standard/references/async-and-errors.md +58 -0
  120. package/skills/vitest-standard/references/coverage-and-config.md +53 -0
  121. package/skills/vitest-standard/references/mocking.md +61 -0
  122. package/skills/vitest-standard/references/tdd-patterns.md +60 -0
  123. package/dist/github-integration-PDRLXKGM.js +0 -1
  124. package/skills/github-commander/workflows/full-audit.md +0 -134
@@ -0,0 +1,86 @@
1
+ ---
2
+ title: Rust Development
3
+ description: |
4
+ Master Rust development using a layer-based "meta-cognition" framework. Use whenever writing Rust code, resolving borrow checker errors (E0382, E0596), designing ownership patterns (Arc, Mutex), or performing crate selection.
5
+ ---
6
+
7
+ # Rust Development & Meta-Cognition
8
+
9
+ When solving Rust problems, **do not immediately write code.** Trace through the cognitive layers first to understand the data's lifecycle, ownership, and constraints.
10
+
11
+ ## 🧠 1. The Meta-Cognition Framework (Before You Code)
12
+
13
+ ### Layer 1: Domain Constraints (WHY)
14
+
15
+ What is the system trying to achieve?
16
+
17
+ - **Web Service:** Concurrent, async, low-latency (Requires `axum`, `tokio`, `Arc<Mutex<T>>`).
18
+ - **CLI Tool:** Fast startup, zero overhead, clean exit codes (Requires `clap`, `anyhow`, strict error formatting).
19
+ - **Embedded / Systems:** No heap allocation (Requires `no_std`, specific hardware limitations).
20
+
21
+ ### Layer 2: Design Choices & Ownership (WHAT)
22
+
23
+ Ask the core question: **Who should own this data?**
24
+
25
+ - _Single owner, strictly unique_: Direct value or `Box<T>`.
26
+ - _Single thread, multiple owners_: `Rc<T>` (use `RefCell<T>` for mutation).
27
+ - _Multi-thread, multiple owners_: `Arc<T>` (use `Mutex<T>` or `RwLock<T>` for mutation).
28
+
29
+ **Why does it need to mutate?** Avoid slapping `mut` everywhere. Prefer returning new values or using tight, scoped mutability.
30
+
31
+ ### Layer 3: Language Mechanics (HOW)
32
+
33
+ Use the compiler's strictness as a tool, not an obstacle.
34
+
35
+ - Implement standard traits: `Drop`, `Clone`, `Default`, `Display`, `From`, `TryFrom`.
36
+ - Avoid `unwrap()` or `expect()` in production logic. Propagate errors natively via `?` and `Result`.
37
+
38
+ ---
39
+
40
+ ## 🏗️ 2. Core Ecosystem Defaults
41
+
42
+ When selecting crates or recommending tools, stick to these canonical community standards:
43
+
44
+ - **Async Runtime**: `tokio` (I/O bound) or `rayon` (CPU bound data-parallelism)
45
+ - **Web / API Server**: `axum` (built on tokio/hyper)
46
+ - **Serialization/Deserialization**: `serde` and `serde_json`
47
+ - **Error Handling**: `thiserror` (for libraries), `anyhow` or `color-eyre` (for binaries)
48
+ - **Command Line Parsing**: `clap`
49
+ - **Logging & Telemetry**: `tracing` and `tracing-subscriber`
50
+ - **HTTP Client**: `reqwest`
51
+
52
+ ---
53
+
54
+ ## 🛡️ 3. Solving Borrow Checker Errors
55
+
56
+ When debugging compiler errors, trace **up** from the syntax error to the fundamental design choice.
57
+
58
+ - **E0382 (Use of moved value):**
59
+ - _Symptom:_ You are trying to use a value after it was consumed.
60
+ - _Resolve:_ Does the function actually _need_ ownership? Borrow it instead (`&T`), `clone()` it if lightweight, or wrap in `Arc<T>` if access needs to be shared across threads.
61
+ - **E0596 (Cannot borrow as mutable):**
62
+ - _Symptom:_ You are mutating something behind an immutable reference `&T`.
63
+ - _Resolve:_ Change the signature to `&mut T`, or if you must have an immutable interface, use interior mutability (`Cell` or `Mutex`).
64
+ - **E0499 (Cannot borrow multiple times):**
65
+ - _Symptom:_ Alive mutable references colliding.
66
+ - _Resolve:_ Restructure the function to limit the reference's scope `{}`, or avoid holding mutable borrows across `await` points.
67
+
68
+ ---
69
+
70
+ ## ⚡ 4. High-Integrity Code Patterns
71
+
72
+ 1. **Avoid Panic-Driven Development**: `clone()` is an acceptable escape hatch during prototyping, but do not scatter it throughout the code. Revisit the lifetime boundaries as soon as it works.
73
+ 2. **The Newtype Pattern**: Use tuple structs to prevent invalid state. `struct UserId(u64);` avoids mixing it up with `struct OrderId(u64);`.
74
+ 3. **Exhaustive Matching**: Always use `match` over `if let` when handling Enums or State Machines. The compiler will notify you when a new variant is added, preventing silent bugs.
75
+ 4. **Data-Oriented Modeling**: Prefer small, flat structs that compose over deep, object-oriented inheritance hierarchies.
76
+
77
+ ---
78
+
79
+ ## 🛠️ 5. Standard Commands
80
+
81
+ - **Run Application**: `cargo run`
82
+ - **Linting / Idioms**: `cargo clippy -- -D warnings`
83
+ - **Formatting**: `cargo fmt`
84
+ - **Testing**: `cargo test`
85
+
86
+ **Agent Directive:** When writing or editing Rust code, always invoke `cargo clippy` and `cargo test` dynamically to validate your implementations before concluding your task.
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: shadcn-ui
3
+ title: Skills
4
+ description: Give your AI assistant deep knowledge of shadcn/ui components, patterns, and best practices.
5
+ ---
6
+
7
+ Skills give AI assistants like Claude Code project-aware context about shadcn/ui. When installed, your AI assistant knows how to find, install, compose, and customize components using the correct APIs and patterns for your project.
8
+
9
+ For example, you can ask your AI assistant to:
10
+
11
+ - _"Add a login form with email and password fields."_
12
+ - _"Create a settings page with a form for updating profile information."_
13
+ - _"Build a dashboard with a sidebar, stats cards, and a data table."_
14
+ - _"Switch to --preset [CODE]"_
15
+ - _"Can you add a hero from @tailark?"_
16
+
17
+ The skill reads your project's `components.json` and provides the assistant with your framework, aliases, installed components, icon library, and base library so it can generate correct code on the first try.
18
+
19
+ ---
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ npx skills add shadcn/ui
25
+ ```
26
+
27
+ This installs the shadcn skill into your project. Once installed, your AI assistant automatically loads it when working with shadcn/ui components.
28
+
29
+ Learn more about skills at [skills.sh](https://skills.sh).
30
+
31
+ ---
32
+
33
+ ## What's Included
34
+
35
+ The skill provides your AI assistant with the following knowledge:
36
+
37
+ ### Project Context
38
+
39
+ On every interaction, the skill runs `shadcn info --json` to get your project's configuration: framework, Tailwind version, aliases, base library (`radix` or `base`), icon library, installed components, and resolved file paths.
40
+
41
+ ### CLI Commands
42
+
43
+ Full reference for all CLI commands: `init`, `add`, `search`, `view`, `docs`, `diff`, `info`, and `build`. Includes flags, dry-run mode, smart merge workflows, presets, and templates.
44
+
45
+ ### Theming and Customization
46
+
47
+ How CSS variables, OKLCH colors, dark mode, custom colors, border radius, and component variants work. Includes guidance for both Tailwind v3 and v4.
48
+
49
+ ### Registry Authoring
50
+
51
+ How to build and publish custom component registries: `registry.json` format, item types, file objects, dependencies, CSS variables, building, hosting, and user configuration.
52
+
53
+ ### MCP Server
54
+
55
+ Setup and tools for the shadcn MCP server, which lets AI assistants search, browse, and install components from registries.
56
+
57
+ ---
58
+
59
+ ## How It Works
60
+
61
+ 1. **Project detection** — The skill activates when it finds a `components.json` file in your project.
62
+ 2. **Context injection** — It runs `shadcn info --json` to read your project configuration and injects the result into the assistant's context.
63
+ 3. **Pattern enforcement** — The assistant follows shadcn/ui composition rules: using `FieldGroup` for forms, `ToggleGroup` for option sets, semantic colors, and correct base-specific APIs.
64
+ 4. **Component discovery** — The assistant uses `shadcn docs`, `shadcn search`, or MCP tools to find components and their documentation before generating code.
65
+
66
+ ## Learn More
67
+
68
+ - [CLI](/docs/cli) — Full CLI command reference
69
+ - [MCP Server](/docs/mcp) — Connect the MCP server for registry access
70
+ - [Theming](/docs/theming) — CSS variables and customization
71
+ - [Registry](/docs/registry) — Building and publishing custom registries
72
+ - [skills.sh](https://skills.sh) — Learn more about AI skills
@@ -0,0 +1,457 @@
1
+ ---
2
+ name: skill-builder
3
+ description: |
4
+ Guide for creating, evaluating, and refining agent skills (.md files with YAML
5
+ frontmatter). Use this skill whenever you are creating a new skill, improving
6
+ an existing skill, reviewing skill quality, writing skill descriptions, or
7
+ when the user asks about skill structure, progressive disclosure, or best
8
+ practices for agent instructions. Also use when someone says "turn this into
9
+ a skill", "make a skill for X", or "improve this skill".
10
+ ---
11
+
12
+ # Skill Builder
13
+
14
+ A guide for creating high-quality agent skills — the `.md` files with YAML
15
+ frontmatter that extend agent capabilities for specialized tasks.
16
+
17
+ This skill covers the full lifecycle: capturing intent, writing the skill,
18
+ testing it, and iterating based on feedback. The principles here apply regardless
19
+ of which agent platform you're targeting.
20
+
21
+ ## Quick Reference
22
+
23
+ | Phase | What You Do |
24
+ | --------------------------- | ---------------------------------------------------------------- |
25
+ | **1. Capture Intent** | Understand what the skill should do and when it should trigger |
26
+ | **2. Write the Skill** | Create SKILL.md with frontmatter, instructions, and references |
27
+ | **3. Test** | Write realistic prompts and validate the agent follows the skill |
28
+ | **4. Iterate** | Improve based on feedback, keep lean, bundle repeated patterns |
29
+ | **5. Optimize Description** | Tune the frontmatter description for reliable triggering |
30
+
31
+ ---
32
+
33
+ ## Phase 1 — Capture Intent
34
+
35
+ Start by understanding what the user wants. If the conversation already contains
36
+ a workflow worth capturing (e.g., "turn this into a skill"), extract as much as
37
+ you can from the conversation first — tools used, sequence of steps, corrections
38
+ the user made, input/output patterns observed.
39
+
40
+ ### Questions to Answer
41
+
42
+ 1. **What should this skill enable the agent to do?**
43
+ The core capability — be specific about inputs, outputs, and scope.
44
+
45
+ 2. **When should this skill trigger?**
46
+ What user phrases, contexts, or tool patterns should activate it?
47
+ Think broadly — agents tend to _under-trigger_ skills, so include edge cases.
48
+
49
+ 3. **What's the expected output format?**
50
+ Files, structured data, reports, code changes, terminal commands?
51
+
52
+ 4. **What are the edge cases?**
53
+ Missing inputs, conflicting requirements, platform differences?
54
+
55
+ 5. **What prerequisites does the skill assume?**
56
+ Tools, CLIs, API keys, project structure?
57
+
58
+ ---
59
+
60
+ ## Phase 2 — Write the Skill
61
+
62
+ ### Anatomy of a Skill
63
+
64
+ ```
65
+ skill-name/ (kebab-case directory)
66
+ ├── SKILL.md (required — entry point)
67
+ ├── references/ (optional — detailed docs loaded on demand)
68
+ │ ├── api-reference.md
69
+ │ └── troubleshooting.md
70
+ ├── scripts/ (optional — executable helpers)
71
+ ├── examples/ (optional — reference implementations)
72
+ └── checklist.md (optional — quick-reference quality checklist)
73
+ ```
74
+
75
+ ### YAML Frontmatter (Required)
76
+
77
+ ```yaml
78
+ ---
79
+ name: skill-name
80
+ description: |
81
+ What the skill does AND when to use it. This is the primary triggering
82
+ mechanism — include specific contexts, keywords, and phrases that should
83
+ activate it. Be assertive to avoid under-triggering.
84
+ ---
85
+ ```
86
+
87
+ The `description` field is the most important part of the skill because it
88
+ determines whether the agent loads the skill at all. A description that's too
89
+ narrow or passive means the skill sits unused even when it would help.
90
+
91
+ ### Optional Frontmatter Fields
92
+
93
+ ```yaml
94
+ ---
95
+ name: deploy-prod
96
+ description: |
97
+ Deploy to production with validation gates...
98
+ dependencies: node>=18, gh>=2.0 # Required tools/runtimes
99
+ context: fork # Spawn isolated subagent (fresh context)
100
+ disable-model-invocation: true # User-only invoke (prevents auto-trigger)
101
+ user-invocable: false # Agent-only (background knowledge)
102
+ allowed-tools: ['view_file', 'search'] # Restrict tool access during skill activation
103
+ metadata:
104
+ internal: true # Hides from CLI discovery by default
105
+ ---
106
+ ```
107
+
108
+ | Field | When to Use |
109
+ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
110
+ | `dependencies` | Skill requires specific tools or runtimes — prevents cryptic failures |
111
+ | `context: fork` | Task is concrete, self-contained, and resource-heavy (deep file reads, prototyping). Prevents context pollution. **Don't use for guidelines-only skills** — fork returns empty without a concrete task |
112
+ | `disable-model-invocation` | Skill has destructive side effects (deploy, commit, delete). Agent can't auto-trigger |
113
+ | `user-invocable: false` | Background knowledge the agent should absorb, not a user-facing command |
114
+ | `allowed-tools` | Limit an agent's available tools when this skill triggers to enforce security guidelines. |
115
+ | `metadata.internal` | Set to `true` for WIP or CI-only skills. Requires `INSTALL_INTERNAL_SKILLS=1` to install via CLI. |
116
+
117
+ ### Progressive Disclosure (3-Tier)
118
+
119
+ Skills use a three-level loading system to manage token budgets:
120
+
121
+ | Tier | What | Token Cost | When Loaded |
122
+ | ----------------- | ------------------------------------- | ---------------- | -------------------- |
123
+ | **Metadata** | `name` + `description` in frontmatter | ~50-100 tokens | Always in context |
124
+ | **SKILL.md body** | Main instructions | ~500-2000 tokens | When skill triggers |
125
+ | **References** | Detailed docs in `references/` | Unlimited | On demand, as needed |
126
+
127
+ **Guidelines:**
128
+
129
+ - Keep `SKILL.md` body under ~500 lines. If approaching this, add a layer of
130
+ hierarchy with `references/` files and clear pointers about when to read them
131
+ - Reference files can be any length but should include a table of contents if
132
+ over ~300 lines
133
+ - For large reference files, include a summary at the top so the agent can
134
+ decide whether to read the full content
135
+
136
+ ### Domain Organization
137
+
138
+ When a skill supports multiple variants (frameworks, languages, platforms),
139
+ organize by variant in `references/`:
140
+
141
+ ```
142
+ cloud-deploy/
143
+ ├── SKILL.md (workflow + variant selection logic)
144
+ └── references/
145
+ ├── aws.md
146
+ ├── gcp.md
147
+ └── azure.md
148
+ ```
149
+
150
+ The agent reads only the relevant reference file based on context, saving tokens.
151
+
152
+ ### Context Hygiene
153
+
154
+ The description is always loaded (~50-100 tokens per skill). With many skills
155
+ installed, this adds up.
156
+
157
+ - **Challenge every token.** For each line in SKILL.md, ask: "Does this
158
+ instruction justify its token cost in every conversation?"
159
+ - **Prefer pointers to copies.** Instead of embedding large code blocks, link
160
+ to reference files. The agent loads them on demand.
161
+ - **Trust the model.** Instead of prescribing HOW to use a reference file,
162
+ describe WHAT the file is. LLMs navigate references well on their own.
163
+ - **Keep reference depth shallow.** References should be one hop from SKILL.md —
164
+ avoid chains (SKILL → ref-A → ref-B → ref-C).
165
+
166
+ ---
167
+
168
+ ## Phase 3 — Writing Style
169
+
170
+ The quality of a skill's instructions directly determines how well agents follow
171
+ them. These principles come from observing what actually works in practice.
172
+
173
+ ### Explain the Why, Not Just the What
174
+
175
+ Today's LLMs are smart. They have good theory of mind and when given a good
176
+ explanation of _why_ something matters, they go beyond rote instruction-following
177
+ and make better decisions in novel situations.
178
+
179
+ **Instead of:**
180
+
181
+ ```markdown
182
+ ALWAYS use parameterized queries. NEVER interpolate user input into SQL.
183
+ ```
184
+
185
+ **Prefer:**
186
+
187
+ ```markdown
188
+ Use parameterized queries for all user-supplied values. Raw string
189
+ interpolation in SQL creates injection vulnerabilities — an attacker could
190
+ append `; DROP TABLE users` to any input field. Parameterized queries let
191
+ the database engine handle escaping, which is both safer and handles edge
192
+ cases (quotes, unicode) that manual escaping misses.
193
+ ```
194
+
195
+ The second version helps the agent understand _when_ the rule applies and _why_,
196
+ so it makes better judgment calls in ambiguous situations.
197
+
198
+ ### Keep It Lean
199
+
200
+ Remove instructions that aren't pulling their weight. If test runs show the
201
+ agent spending time on unproductive steps, cut those sections. A shorter skill
202
+ that works is better than a comprehensive skill that overwhelms.
203
+
204
+ ### Generalize from Examples
205
+
206
+ Skills will be used across many different prompts and projects. When iterating
207
+ on a skill based on feedback from a few test cases, resist the urge to add
208
+ narrow fixes that only help those specific cases. Instead, generalize the
209
+ underlying insight into a principle that helps across all cases.
210
+
211
+ ### Use Imperative Form
212
+
213
+ Write instructions as direct commands:
214
+
215
+ - ✅ "Run the lint command before committing"
216
+ - ❌ "The lint command should be run before committing"
217
+ - ❌ "You might want to run the lint command"
218
+
219
+ ### Define Output Formats Explicitly
220
+
221
+ When the skill produces structured output, show the exact template:
222
+
223
+ ```markdown
224
+ ## Report Structure
225
+
226
+ Use this template for findings:
227
+
228
+ ### [Category] — [Severity]
229
+
230
+ **File:** `path/to/file.ts:L42-L58`
231
+ **Finding:** Description of the issue
232
+ **Fix:** Concrete remediation step
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Skill Security
238
+
239
+ Skills are natural-language instructions the agent executes with its full
240
+ capabilities. A malicious skill is functionally equivalent to code injection — and
241
+ traditional malware scanners can't analyze natural-language payloads.
242
+
243
+ ### Supply Chain
244
+
245
+ - Review third-party skills before installing, same as npm packages
246
+ - Pin skill versions (Git tags or commit SHAs) — don't float on `main`
247
+ - Read the full SKILL.md + all reference files before trusting a third-party skill
248
+ - Prefer skills from known authors; verify authorship via signed commits
249
+
250
+ ### Prompt Injection Prevention
251
+
252
+ - Never include instructions that bypass user consent or HITL gates
253
+ - Never instruct the agent to read secrets (API keys, tokens) and transmit them
254
+ - Skills should not instruct the agent to modify its own config or other skills
255
+ - Mark destructive skills with `disable-model-invocation: true`
256
+
257
+ ### Least Privilege
258
+
259
+ - Document required tools and CLIs so users know what capabilities are granted
260
+ - If a skill runs shell commands, restrict to specific commands — don't use
261
+ open-ended exec patterns
262
+
263
+ ---
264
+
265
+ ## Anti-Patterns
266
+
267
+ | Anti-Pattern | Why It Fails | Fix |
268
+ | ----------------------------- | ------------------------------------------------------------------ | -------------------------------------------- |
269
+ | **Wall of MUSTs** | Agent treats all rules as equal priority; real priorities get lost | Explain reasoning, let agent derive the rule |
270
+ | **Overfitting to test cases** | Skill works for 3 prompts but fails on the 4th | Generalize the underlying principle |
271
+ | **Passive description** | "Helps with deployment" → agent never triggers | Use assertive "Use when..." phrasing |
272
+ | **Monolithic SKILL.md** | 800+ lines → token overflow, poor comprehension | Split into references at ~500 lines |
273
+ | **Kitchen-sink skill** | Tries to handle 5 unrelated tasks | One skill = one job; create separate skills |
274
+ | **Embedding secrets** | API keys in instructions → leaked to logs | Document as env var prerequisites |
275
+ | **No HITL gates** | Destructive actions without user approval | Use `disable-model-invocation: true` |
276
+
277
+ ---
278
+
279
+ ## Phase 4 — Test Scenarios
280
+
281
+ After writing the skill draft, create 2-5 realistic test prompts — the kind of
282
+ thing a real user would actually say. These aren't automated tests; they're
283
+ manual validation that the agent follows the skill correctly.
284
+
285
+ ### Writing Good Test Scenarios
286
+
287
+ 1. **Be realistic** — use actual user phrasing, not formal specifications
288
+ 2. **Cover the trigger range** — include prompts that should trigger the skill
289
+ and edge cases that are borderline
290
+ 3. **Vary complexity** — include a simple case, a medium case, and a hard case
291
+ 4. **Include context** — specify what files exist, what state the project is in
292
+
293
+ ### Example Test Scenarios
294
+
295
+ ```markdown
296
+ ## Test 1: Simple issue fix
297
+
298
+ "Fix issue #42 — the README has a broken link in the installation section"
299
+ Expected: Agent loads skill, gathers context, fixes link, runs gates, submits PR
300
+
301
+ ## Test 2: Audit request
302
+
303
+ "Run a security audit on this project"
304
+ Expected: Agent loads skill, detects available tools, runs scans, journals findings
305
+
306
+ ## Test 3: Edge case — no GitHub configured
307
+
308
+ "Fix the bug where users can't login"
309
+ Expected: Agent attempts to load skill, handles missing GITHUB_TOKEN gracefully
310
+ ```
311
+
312
+ ### Evaluation Rubric
313
+
314
+ Score each test run on these dimensions:
315
+
316
+ | Dimension | 1 (Poor) | 3 (Good) | 5 (Excellent) |
317
+ | ------------------------- | ----------------------- | -------------------------- | -------------------------------------- |
318
+ | **Trigger accuracy** | Loads <50% of the time | ~80% correct | All intended prompts trigger correctly |
319
+ | **Instruction following** | Skips >2 steps | Minor deviations | All steps followed, branches handled |
320
+ | **Edge case handling** | Crashes or hallucinates | Returns generic error | Structured, actionable error |
321
+ | **Output quality** | Wrong format | Correct format, minor gaps | Exact template match |
322
+ | **Token efficiency** | Loads everything always | Reads some references | Progressive disclosure used correctly |
323
+
324
+ ### Validation
325
+
326
+ For each test scenario, verify:
327
+
328
+ - Did the agent load the skill? (Check if it followed the workflow)
329
+ - Did it follow the steps in order?
330
+ - Did it handle edge cases gracefully?
331
+ - Was the output format correct?
332
+ - Did it ask for human input at the right moments?
333
+
334
+ ### Preventing Regressions
335
+
336
+ After improving a skill, re-run ALL previous test scenarios — not just the one
337
+ that prompted the change. Skills tend to "fix one, break two" when changes are
338
+ made without regression checking.
339
+
340
+ ---
341
+
342
+ ## Phase 5 — Iteration
343
+
344
+ After testing, improve the skill based on what you observed.
345
+
346
+ ### How to Think About Improvements
347
+
348
+ 1. **Generalize from feedback.** If a test case exposed a gap, don't add a
349
+ narrow fix for that specific case. Ask: "What general principle would have
350
+ prevented this?" Add that principle instead.
351
+
352
+ 2. **Keep the skill lean.** Read the agent's execution trace, not just the final
353
+ output. If the skill is making the agent waste time on unproductive steps,
354
+ remove those instructions.
355
+
356
+ 3. **Bundle repeated patterns.** If every test run resulted in the agent writing
357
+ similar helper logic, that's a signal to bundle it. Write it once as a script
358
+ or reference file, and tell the skill to use it.
359
+
360
+ 4. **Avoid overfitting.** If you find yourself adding increasingly specific
361
+ MUSTs and NEVERs, step back. Try explaining the underlying reasoning instead.
362
+
363
+ ### The Iteration Loop
364
+
365
+ 1. Apply improvements to the skill
366
+ 2. Re-run test scenarios mentally or with an agent
367
+ 3. Check: did the changes help across _all_ scenarios, not just the one that
368
+ prompted the change?
369
+ 4. Repeat until satisfied or diminishing returns
370
+
371
+ ### Skill Versioning
372
+
373
+ Treat skills like code — they affect agent behavior in production.
374
+
375
+ - Use Git tags or commit SHAs to pin shared skill versions
376
+ - Document behavior changes in commit messages or a `CHANGELOG.md`
377
+ - Breaking changes (renamed fields, removed steps) deserve explicit migration notes
378
+ - When shipping skills in an npm package, include in the `files` array
379
+
380
+ ---
381
+
382
+ ## Phase 6 — Description Optimization
383
+
384
+ The `description` field in YAML frontmatter is the primary mechanism that
385
+ determines whether an agent invokes a skill. After creating or improving a
386
+ skill, optimize the description for reliable triggering.
387
+
388
+ ### Principles
389
+
390
+ 1. **Be assertive.** Agents tend to under-trigger skills. Include phrases like
391
+ "Use this skill whenever..." and "Also use when..." to push the agent toward
392
+ loading the skill in relevant contexts.
393
+
394
+ 2. **Cover trigger keywords.** List the specific words and phrases users might
395
+ say that should activate this skill. Think beyond the obvious:
396
+ - Primary: "build MCP server", "create tools"
397
+ - Secondary: "MCP integration", "tool design"
398
+ - Tertiary: "connect AI to API", "LLM service integration"
399
+
400
+ 3. **Include both what AND when.** Don't just describe the skill's capabilities —
401
+ describe the contexts where it should be used.
402
+
403
+ 4. **Keep it under ~100 words.** The description is always in context, so it
404
+ costs tokens on every interaction. Be assertive but concise.
405
+
406
+ ### Example — Before vs. After
407
+
408
+ **Before (passive, narrow):**
409
+
410
+ ```yaml
411
+ description: Guide for creating MCP servers using Node/TypeScript.
412
+ ```
413
+
414
+ **After (assertive, broad):**
415
+
416
+ ```yaml
417
+ description: |
418
+ Guide for creating high-quality MCP servers that enable LLMs to interact
419
+ with external services through well-designed tools. Use when building MCP
420
+ servers, designing tool schemas, implementing error handling for agent
421
+ consumption, or when the user asks about tool design, MCP protocol, or
422
+ connecting AI to APIs using Node/TypeScript (MCP SDK).
423
+ ```
424
+
425
+ ---
426
+
427
+ ## Reference: Quality Checklist
428
+
429
+ See [checklist.md](checklist.md) for a quick-reference quality review checklist.
430
+
431
+ ---
432
+
433
+ ## 🛠️ The Skills Ecosystem & CLI
434
+
435
+ The community standard for sharing and installing AI agent skills is the [`skills` CLI](https://skills.sh/). It parses your standard `SKILL.md` repositories and packages them for distribution.
436
+
437
+ ```bash
438
+ # Add a skill from a public repository
439
+ npx skills add vercel-labs/agent-skills
440
+
441
+ # Browse available skills in a repo before installing
442
+ npx skills add my-org/internal-skills --list
443
+
444
+ # Include internal/WIP skills in the discovery payload
445
+ INSTALL_INTERNAL_SKILLS=1 npx skills add my-org/internal-skills
446
+ ```
447
+
448
+ ### Agent Integration & Discovery Paths
449
+
450
+ Almost all leading AI coding assistants (Claude Code, Cursor, OpenHands, Antigravity, Kiro CLI, Amp, Roo Code, GitHub Copilot) comply with the semantic [Agent Skills Specification](https://agentskills.io).
451
+
452
+ Agents will automatically parse and load any `.md` file with conforming YAML frontmatter placed inside standard discovery paths:
453
+
454
+ - Root project directory: `./skills/` or `.agents/skills/`
455
+ - Assistant-specific local scope: `.cursor/skills/`, `.claude/skills/`, `.iflow/skills/`, etc.
456
+
457
+ When publishing a library for distribution using the `skills` CLI, the installer will recursively seek directories (e.g. `skills/`, `skills/.curated/`) and correctly provision them into the endpoint user's recognized location. Alternately, use the Claude `.claude-plugin/marketplace.json` manifest to broadcast capability scopes explicitly to tools.
@@ -0,0 +1,65 @@
1
+ # Skill Quality Checklist
2
+
3
+ Quick-reference checklist for reviewing skill quality. Use after creating or
4
+ iterating on a skill.
5
+
6
+ ## Frontmatter
7
+
8
+ - [ ] `name` is kebab-case and descriptive
9
+ - [ ] `description` is present and assertive (not passive)
10
+ - [ ] `description` covers primary, secondary, and tertiary trigger keywords
11
+ - [ ] `description` includes "Use when..." or "Also use when..." phrasing
12
+ - [ ] `description` is under ~100 words
13
+
14
+ ## Structure
15
+
16
+ - [ ] `SKILL.md` is under ~500 lines
17
+ - [ ] Large reference content is in `references/` with clear pointers from SKILL.md
18
+ - [ ] Directory uses kebab-case naming
19
+ - [ ] Files are organized by functional purpose (not arbitrary splits)
20
+
21
+ ## Writing Quality
22
+
23
+ - [ ] Instructions explain _why_, not just _what_
24
+ - [ ] No excessive MUST/NEVER/ALWAYS in all-caps (use explanatory reasoning instead)
25
+ - [ ] Uses imperative form ("Run the tests" not "You should run the tests")
26
+ - [ ] Output formats are explicitly defined with templates
27
+ - [ ] Edge cases and error handling are addressed
28
+
29
+ ## Triggering
30
+
31
+ - [ ] "When to Load" section covers obvious _and_ non-obvious trigger scenarios
32
+ - [ ] Description is assertive enough to avoid under-triggering
33
+ - [ ] Borderline trigger scenarios are addressed
34
+
35
+ ## Progressive Disclosure
36
+
37
+ - [ ] Metadata (frontmatter) is ~50-100 tokens
38
+ - [ ] SKILL.md body provides enough context to start working
39
+ - [ ] Detailed reference material is deferred to `references/` files
40
+ - [ ] SKILL.md has clear pointers to reference files with guidance on when to read them
41
+
42
+ ## Testing
43
+
44
+ - [ ] 2-5 realistic test scenarios exist (or are documented)
45
+ - [ ] Test scenarios cover simple, medium, and edge cases
46
+ - [ ] Validation criteria are defined for each scenario
47
+ - [ ] Regression: all previous scenarios re-run after changes
48
+
49
+ ## Security
50
+
51
+ - [ ] No instructions to read/transmit secrets
52
+ - [ ] Destructive skills use `disable-model-invocation: true`
53
+ - [ ] Required tools/CLIs are documented (not silently assumed)
54
+ - [ ] Third-party reference files reviewed before inclusion
55
+
56
+ ## Version Control
57
+
58
+ - [ ] Behavior changes documented in commit messages or CHANGELOG.md
59
+ - [ ] Breaking changes have migration notes
60
+
61
+ ## Advanced Features (if applicable)
62
+
63
+ - [ ] `context: fork` used only for concrete, self-contained tasks
64
+ - [ ] `dependencies` field lists required tools/runtimes
65
+ - [ ] `user-invocable: false` used for background knowledge skills