ma-agents 1.2.0 → 1.4.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.
- package/DEVELOPMENT.md +173 -0
- package/README.md +201 -309
- package/SKILLS_STRUCTURE.md +392 -0
- package/bin/cli.js +135 -28
- package/index.js +8 -6
- package/lib/agents.js +26 -8
- package/lib/installer.js +312 -45
- package/package.json +1 -1
- package/skills/code-review/SKILL.md +39 -0
- package/skills/commit-message/SKILL.md +75 -0
- package/skills/create-hardened-docker-skill/SKILL.md +0 -5
- package/skills/git-workflow-skill/SKILL.md +0 -5
- package/skills/js-ts-security-skill/SKILL.md +0 -4
- package/skills/skill-creator/SKILL.md +211 -0
- package/skills/skill-creator/claude-code.md +6 -8
- package/skills/skill-creator/generic.md +0 -5
- package/skills/test-generator/SKILL.md +61 -0
- package/skills/vercel-react-best-practices/SKILL.md +105 -0
- package/skills/verify-hardened-docker-skill/SKILL.md +0 -5
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
# Skills Structure
|
|
2
|
+
|
|
3
|
+
How skills are organized in this package and how the installer translates a unified generic structure into agent-specific formats for each supported coding assistant.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Generic Skill Folder Structure
|
|
8
|
+
|
|
9
|
+
Every skill in this package follows a single unified structure. This is the **authoring format** — what you create when adding a new skill to `skills/`.
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
skills/<skill-name>/
|
|
13
|
+
├── skill.json # Metadata (required)
|
|
14
|
+
├── SKILL.md # Main instructions (required)
|
|
15
|
+
├── template.md # Output template for the agent to fill in (optional)
|
|
16
|
+
├── examples/ # Example outputs showing expected format (optional)
|
|
17
|
+
│ └── sample.md
|
|
18
|
+
├── scripts/ # Executable scripts the agent can run (optional)
|
|
19
|
+
│ └── validate.sh
|
|
20
|
+
├── references/ # Static documentation and context (optional)
|
|
21
|
+
│ └── api-docs.md
|
|
22
|
+
├── hooks/ # Git hooks or other hook scripts (optional)
|
|
23
|
+
│ └── pre-commit
|
|
24
|
+
└── assets/ # Templates, configs, and other resources (optional)
|
|
25
|
+
└── config.yaml
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Required Files
|
|
29
|
+
|
|
30
|
+
#### `skill.json` (Single Source of Truth)
|
|
31
|
+
|
|
32
|
+
All skill metadata lives here. The installer uses it for listing, and **automatically injects** YAML frontmatter into the installed `.md` file at install time. You never write frontmatter manually.
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"name": "My Skill",
|
|
37
|
+
"description": "What this skill does in one sentence",
|
|
38
|
+
"version": "1.0.0",
|
|
39
|
+
"author": "Your Name",
|
|
40
|
+
"tags": ["category", "keywords"]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Field | Required | Description |
|
|
45
|
+
|---------------|----------|--------------------------------------------|
|
|
46
|
+
| `name` | Yes | Human-readable display name |
|
|
47
|
+
| `description` | Yes | Brief description shown in the installer |
|
|
48
|
+
| `version` | Yes | Semver version string |
|
|
49
|
+
| `author` | No | Author name or organization |
|
|
50
|
+
| `tags` | No | Array of keywords for categorization |
|
|
51
|
+
|
|
52
|
+
#### `SKILL.md`
|
|
53
|
+
|
|
54
|
+
The main instruction file. Write **pure Markdown instructions only** — no YAML frontmatter. The installer injects frontmatter from `skill.json` at install time so the target agent receives a properly formatted file.
|
|
55
|
+
|
|
56
|
+
```markdown
|
|
57
|
+
# My Skill
|
|
58
|
+
|
|
59
|
+
## Purpose
|
|
60
|
+
What problem this skill solves.
|
|
61
|
+
|
|
62
|
+
## Instructions
|
|
63
|
+
Step-by-step instructions for the agent.
|
|
64
|
+
|
|
65
|
+
## Rules
|
|
66
|
+
Constraints and requirements the agent must follow.
|
|
67
|
+
|
|
68
|
+
## Output Format
|
|
69
|
+
What the agent should produce.
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
> **Why no frontmatter in source files?** Many agents (Claude Code, Gemini, Copilot) expect YAML frontmatter with `name` and `description`. Rather than duplicating this across `skill.json` and every `.md` file, `skill.json` is the single source of truth. The installer reads it and injects the correct frontmatter during installation. If a source file already contains frontmatter, it is stripped and replaced.
|
|
73
|
+
|
|
74
|
+
### Optional Files and Directories
|
|
75
|
+
|
|
76
|
+
| Path | Purpose |
|
|
77
|
+
|-----------------|----------------------------------------------------------|
|
|
78
|
+
| `template.md` | A fill-in-the-blank template the agent uses for output |
|
|
79
|
+
| `examples/` | Sample outputs demonstrating the expected result format |
|
|
80
|
+
| `scripts/` | Shell scripts, Python scripts, or other executables |
|
|
81
|
+
| `references/` | Background documentation the agent can consult |
|
|
82
|
+
| `assets/` | Config files, templates, images, or other static resources |
|
|
83
|
+
| `hooks/` | Git hooks or other hook scripts |
|
|
84
|
+
|
|
85
|
+
### Naming Conventions
|
|
86
|
+
|
|
87
|
+
- Skill folder: lowercase with hyphens (`code-review`, `git-workflow-skill`)
|
|
88
|
+
- SKILL.md: keep under 500 lines; move detailed content to `references/`
|
|
89
|
+
- Scripts: use descriptive names (`validate.sh`, `init_skill.py`)
|
|
90
|
+
- One skill per folder
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## How the Installer Translates Skills
|
|
95
|
+
|
|
96
|
+
When a user runs `npx ma-agents install`, they select skills and target agents. The installer maps the generic structure to each agent's native format.
|
|
97
|
+
|
|
98
|
+
### Translation Flow
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Generic Structure (this repo) Installed Output
|
|
102
|
+
───────────────────────────── ────────────────
|
|
103
|
+
skills/<skill-name>/
|
|
104
|
+
├── skill.json ──────────► Injected as YAML frontmatter into SKILL.md
|
|
105
|
+
├── SKILL.md ──────────► <agent-skills-dir>/<skill-name>/SKILL.md
|
|
106
|
+
├── template.md ──────────► <agent-skills-dir>/<skill-name>/template.md
|
|
107
|
+
├── examples/ ──────────► <agent-skills-dir>/<skill-name>/examples/
|
|
108
|
+
├── scripts/ ──────────► <agent-skills-dir>/<skill-name>/scripts/
|
|
109
|
+
├── references/ ──────────► <agent-skills-dir>/<skill-name>/references/
|
|
110
|
+
└── assets/ ──────────► <agent-skills-dir>/<skill-name>/assets/
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The installed `SKILL.md` always gets YAML frontmatter injected from `skill.json`:
|
|
114
|
+
```yaml
|
|
115
|
+
---
|
|
116
|
+
name: My Skill
|
|
117
|
+
description: What this skill does in one sentence
|
|
118
|
+
---
|
|
119
|
+
# ... original Markdown content follows ...
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
The installer resolves the instruction file in this priority order:
|
|
123
|
+
|
|
124
|
+
1. **Agent-specific template** — `<agent-template>.md` (e.g., `claude-code.md`, `cline.md`)
|
|
125
|
+
2. **Generic template** — `generic.md`
|
|
126
|
+
3. **Fallback** — `SKILL.md`
|
|
127
|
+
|
|
128
|
+
This means you can optionally create agent-tailored versions of your instructions. If you only create `SKILL.md`, all agents get the same content.
|
|
129
|
+
|
|
130
|
+
### Template Priority Example
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
skills/code-review/
|
|
134
|
+
├── skill.json
|
|
135
|
+
├── SKILL.md ← Fallback for any agent without a specific template
|
|
136
|
+
├── generic.md ← Used by Gemini, Copilot, Cursor, Kilocode
|
|
137
|
+
├── claude-code.md ← Used only by Claude Code
|
|
138
|
+
└── cline.md ← Used only by Cline
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Agent-Specific Output Formats
|
|
144
|
+
|
|
145
|
+
Each agent has its own expected directory structure. The installer handles this translation automatically.
|
|
146
|
+
|
|
147
|
+
### Claude Code
|
|
148
|
+
|
|
149
|
+
**Install path:** `.claude/skills/<skill-name>/`
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
.claude/skills/
|
|
153
|
+
└── my-skill/
|
|
154
|
+
├── SKILL.md ← Instructions with injected frontmatter
|
|
155
|
+
├── template.md ← Output template (if exists)
|
|
156
|
+
├── examples/ ← Sample outputs (if exists)
|
|
157
|
+
├── scripts/ ← Executable scripts (if exists)
|
|
158
|
+
├── references/ ← Static documentation (if exists)
|
|
159
|
+
└── assets/ ← Other resources (if exists)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Claude Code loads skills from `.claude/skills/` as subdirectories containing a `SKILL.md` with YAML frontmatter. Supports `template.md`, `examples/`, and `scripts/` natively.
|
|
163
|
+
|
|
164
|
+
### Google Gemini
|
|
165
|
+
|
|
166
|
+
**Install path:** `.gemini/skills/<skill-name>/`
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
.gemini/skills/
|
|
170
|
+
└── my-skill/
|
|
171
|
+
├── SKILL.md ← Instructions with injected frontmatter
|
|
172
|
+
├── scripts/ ← Executable scripts (if exists)
|
|
173
|
+
├── references/ ← Static documentation (if exists)
|
|
174
|
+
└── assets/ ← Templates and resources (if exists)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Gemini CLI follows the same SKILL.md specification as Claude Code. Skills are placed in `.gemini/skills/` as subdirectories with `SKILL.md` inside.
|
|
178
|
+
|
|
179
|
+
### GitHub Copilot
|
|
180
|
+
|
|
181
|
+
**Install path:** `.github/copilot/skills/<skill-name>/`
|
|
182
|
+
|
|
183
|
+
```
|
|
184
|
+
.github/copilot/skills/
|
|
185
|
+
└── my-skill/
|
|
186
|
+
├── SKILL.md ← Instructions with injected frontmatter
|
|
187
|
+
├── scripts/ ← Executable scripts (if exists)
|
|
188
|
+
├── references/ ← Static documentation (if exists)
|
|
189
|
+
└── examples/ ← Sample outputs (if exists)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Copilot uses the same SKILL.md specification (YAML frontmatter + Markdown). Copilot also supports path-scoped instructions via `.github/instructions/*.instructions.md` files with `applyTo` glob patterns.
|
|
193
|
+
|
|
194
|
+
### Cursor
|
|
195
|
+
|
|
196
|
+
**Install path:** `.cursor/skills/<skill-name>/`
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
.cursor/skills/
|
|
200
|
+
└── my-skill/
|
|
201
|
+
├── SKILL.md ← Instructions with injected frontmatter
|
|
202
|
+
├── scripts/ ← Executable scripts (if exists)
|
|
203
|
+
└── references/ ← Static documentation (if exists)
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Cursor natively uses `.mdc` (Markdown Component) files in `.cursor/rules/` with frontmatter fields like `description`, `globs`, and `alwaysApply`. The installer places skills in `.cursor/skills/` using the standard folder structure. For deeper Cursor integration, users can manually convert to `.mdc` format in `.cursor/rules/`.
|
|
207
|
+
|
|
208
|
+
**Cursor native `.mdc` format (for reference):**
|
|
209
|
+
```yaml
|
|
210
|
+
---
|
|
211
|
+
description: What this rule does
|
|
212
|
+
globs: "src/**/*.ts"
|
|
213
|
+
alwaysApply: false
|
|
214
|
+
---
|
|
215
|
+
# Rule body in Markdown
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Cline
|
|
219
|
+
|
|
220
|
+
**Install path:** `.cline/skills/<skill-name>/`
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
.cline/skills/
|
|
224
|
+
└── my-skill/
|
|
225
|
+
├── SKILL.md ← Instructions with injected frontmatter
|
|
226
|
+
├── docs/ ← Additional documentation (if exists)
|
|
227
|
+
├── templates/ ← Config/boilerplate files (if exists)
|
|
228
|
+
└── scripts/ ← Utility scripts (if exists)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Cline loads skills from `.cline/skills/` using a progressive three-level system: metadata (name + description from frontmatter) loads at startup, full instructions load when triggered, and bundled files (`docs/`, `templates/`, `scripts/`) load on-demand. The `name` in frontmatter must match the directory name (kebab-case). Description should be under 1024 characters and specify trigger phrases.
|
|
232
|
+
|
|
233
|
+
**Resource directory mapping:** The installer maps `references/` → `docs/` and `assets/` → `templates/` for Cline, matching its native structure.
|
|
234
|
+
|
|
235
|
+
### Kilocode
|
|
236
|
+
|
|
237
|
+
**Install path:** `.kilocode/skills/<skill-name>/`
|
|
238
|
+
|
|
239
|
+
```
|
|
240
|
+
.kilocode/skills/
|
|
241
|
+
└── my-skill/
|
|
242
|
+
├── SKILL.md ← Instructions with injected frontmatter
|
|
243
|
+
├── scripts/ ← Executable scripts (if exists)
|
|
244
|
+
└── references/ ← Static documentation (if exists)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
Kilocode natively uses `.kilocode/rules/` for generic rules and `.kilocode/rules-<mode>/` for mode-specific rules. The installer places skills in `.kilocode/skills/` using the standard folder structure. Kilocode also reads `.clinerules` as a fallback.
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Creating a New Skill
|
|
252
|
+
|
|
253
|
+
### Step 1: Create the Skill Folder
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
mkdir -p skills/my-new-skill
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Step 2: Create `skill.json`
|
|
260
|
+
|
|
261
|
+
```json
|
|
262
|
+
{
|
|
263
|
+
"name": "My New Skill",
|
|
264
|
+
"description": "Brief description of what this skill does",
|
|
265
|
+
"version": "1.0.0",
|
|
266
|
+
"author": "Your Name",
|
|
267
|
+
"tags": ["relevant", "tags"]
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Step 3: Create `SKILL.md`
|
|
272
|
+
|
|
273
|
+
Write pure Markdown instructions. Do **not** add YAML frontmatter — the installer injects it from `skill.json` automatically.
|
|
274
|
+
|
|
275
|
+
```markdown
|
|
276
|
+
# My New Skill
|
|
277
|
+
|
|
278
|
+
## Purpose
|
|
279
|
+
Explain what problem this skill solves.
|
|
280
|
+
|
|
281
|
+
## When to Use
|
|
282
|
+
Describe the scenarios where this skill applies.
|
|
283
|
+
|
|
284
|
+
## Instructions
|
|
285
|
+
1. Step-by-step instructions for the agent
|
|
286
|
+
2. Be specific and actionable
|
|
287
|
+
3. Include examples where helpful
|
|
288
|
+
|
|
289
|
+
## Rules
|
|
290
|
+
- Constraints the agent must follow
|
|
291
|
+
- Quality standards to enforce
|
|
292
|
+
- Things to avoid
|
|
293
|
+
|
|
294
|
+
## Output Format
|
|
295
|
+
Describe the expected output format with examples.
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Step 4: Add Optional Resources
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# Add scripts the agent can execute
|
|
302
|
+
mkdir -p skills/my-new-skill/scripts
|
|
303
|
+
# scripts/validate.sh, scripts/setup.py, etc.
|
|
304
|
+
|
|
305
|
+
# Add reference documentation
|
|
306
|
+
mkdir -p skills/my-new-skill/references
|
|
307
|
+
# references/api-docs.md, references/standards.md, etc.
|
|
308
|
+
|
|
309
|
+
# Add templates
|
|
310
|
+
# template.md — output template for the agent
|
|
311
|
+
|
|
312
|
+
# Add examples
|
|
313
|
+
mkdir -p skills/my-new-skill/examples
|
|
314
|
+
# examples/sample-output.md, etc.
|
|
315
|
+
|
|
316
|
+
# Add other assets
|
|
317
|
+
mkdir -p skills/my-new-skill/assets
|
|
318
|
+
# assets/config.yaml, assets/boilerplate.json, etc.
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Step 5: (Optional) Create Agent-Specific Templates
|
|
322
|
+
|
|
323
|
+
If a skill needs different instructions for different agents:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
# Claude Code specific (uses 'claude-code' template)
|
|
327
|
+
skills/my-new-skill/claude-code.md
|
|
328
|
+
|
|
329
|
+
# Cline specific (uses 'cline' template)
|
|
330
|
+
skills/my-new-skill/cline.md
|
|
331
|
+
|
|
332
|
+
# All other agents use generic.md or SKILL.md
|
|
333
|
+
skills/my-new-skill/generic.md
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Step 6: Test
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
# Verify the skill appears in the list
|
|
340
|
+
npx ma-agents list
|
|
341
|
+
|
|
342
|
+
# Test installation
|
|
343
|
+
npx ma-agents install my-new-skill claude-code
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Template ID Mapping
|
|
349
|
+
|
|
350
|
+
Each agent has a `template` ID that determines which instruction file the installer looks for first.
|
|
351
|
+
|
|
352
|
+
| Agent | Template ID | Looks for (in order) |
|
|
353
|
+
|----------------|----------------|-----------------------------------------------|
|
|
354
|
+
| Claude Code | `claude-code` | `claude-code.md` → `generic.md` → `SKILL.md` |
|
|
355
|
+
| Google Gemini | `generic` | `generic.md` → `SKILL.md` |
|
|
356
|
+
| GitHub Copilot | `generic` | `generic.md` → `SKILL.md` |
|
|
357
|
+
| Cursor | `generic` | `generic.md` → `SKILL.md` |
|
|
358
|
+
| Cline | `cline` | `cline.md` → `generic.md` → `SKILL.md` |
|
|
359
|
+
| Kilocode | `generic` | `generic.md` → `SKILL.md` |
|
|
360
|
+
|
|
361
|
+
---
|
|
362
|
+
|
|
363
|
+
## Installation Paths Summary
|
|
364
|
+
|
|
365
|
+
Default installation is **project-level** (relative to where `npx ma-agents` is run).
|
|
366
|
+
|
|
367
|
+
| Agent | Project Path | Global Path |
|
|
368
|
+
|----------------|---------------------------------------|----------------------------------------------------------|
|
|
369
|
+
| Claude Code | `.claude/skills/` | `~/AppData/Roaming/Claude/skills/` (Win) |
|
|
370
|
+
| Google Gemini | `.gemini/skills/` | `~/AppData/Roaming/Gemini/skills/` (Win) |
|
|
371
|
+
| GitHub Copilot | `.github/copilot/skills/` | `~/AppData/Roaming/GitHub Copilot/skills/` (Win) |
|
|
372
|
+
| Cursor | `.cursor/skills/` | `~/AppData/Roaming/Cursor/User/skills/` (Win) |
|
|
373
|
+
| Cline | `.cline/skills/` | `~/AppData/.../saoudrizwan.claude-dev/skills/` (Win) |
|
|
374
|
+
| Kilocode | `.kilocode/skills/` | `~/AppData/Roaming/Kilocode/skills/` (Win) |
|
|
375
|
+
|
|
376
|
+
Use `--global` flag to install to user-level paths instead:
|
|
377
|
+
```bash
|
|
378
|
+
npx ma-agents install my-skill claude-code --global
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
---
|
|
382
|
+
|
|
383
|
+
## Checklist for New Skills
|
|
384
|
+
|
|
385
|
+
- [ ] `skill.json` exists with `name`, `description`, `version`
|
|
386
|
+
- [ ] `SKILL.md` exists with pure Markdown (no YAML frontmatter — injected at install time)
|
|
387
|
+
- [ ] Instructions are clear, specific, and actionable
|
|
388
|
+
- [ ] Scripts are executable and have shebangs (`#!/bin/bash`, `#!/usr/bin/env python3`)
|
|
389
|
+
- [ ] Skill appears in `npx ma-agents list`
|
|
390
|
+
- [ ] Test install works for at least one agent
|
|
391
|
+
- [ ] (Optional) Agent-specific templates created where needed
|
|
392
|
+
- [ ] (Optional) References moved out of SKILL.md to keep it under 500 lines
|