Skip to content

Commit d747b14

Browse files
committed
feat: make keywords a JSON array and remove category
- Output keywords as a JSON array instead of a comma-separated string - Remove category field from templates, CLI, types, and scripts - Update replaceInFile to handle JSON array placeholder substitution - Update tests and documentation
1 parent a237786 commit d747b14

12 files changed

Lines changed: 52 additions & 53 deletions

File tree

AGENTS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,15 @@ Write code that is **accessible, performant, type-safe, and maintainable**. Focu
3535
- `async/await` over promise chains; always `await` promises in async functions
3636
- Throw `Error` objects with descriptive messages, not strings
3737

38+
## Development
39+
40+
- **Always use conventional commit prefixes** (e.g. `feat:`). Release-please relies on these to generate changelogs and trigger releases, commits without one will be silently ignored.
41+
- **Never force push, amend, or rewrite history** unless the user explicitly requests it and confirms. Force pushes can break release tracking and cause data loss.
42+
- **Never push to `main` directly** unless the user explicitly asks. Default to creating a feature branch and opening a PR.
43+
- **Run `pnpm build && pnpm test && pnpm check` before committing** to catch build, test, and lint failures early.
44+
3845
## Resources
3946

4047
[ARCHITECTURE.md](./ARCHITECTURE.md): Detailed Project Architecture
41-
[CONTRIBUTING.md](./CONTRIBUTING.md): Project Contribution Guidelines
48+
[CONTRIBUTING.md](.github/CONTRIBUTING.md): Project Contribution Guidelines
4249
[Agent Skills Specification](https://agentskills.io/specification.md): Latest Agent Skills Specification

ARCHITECTURE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ Template files use `{Key}` placeholders that map to the `TemplateValues` interfa
8888
| `{Skill_License}` | `MIT` |
8989
| `{Skill_Homepage}` | `https://acme.example.com` |
9090
| `{Skill_Repository}` | `acme-corp/agent-skills` |
91-
| `{Skill_Category}` | `productivity` |
92-
| `{Skill_Keywords}` | `data, csv, json` |
91+
| `{Skill_Keywords}` | `["data", "csv", "json"]` |
9392

9493
## Generated Repository Automation
9594

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ npx build-skill --name my-skill --description "Helps with X tasks" --quiet
5151
| `--license <license>` | `-l` | License for the skill | `MIT` |
5252
| `--website <url>` | `-w` | Website/docs URL | `https://example.com` |
5353
| `--repository <repo>` | `-r` | GitHub repository (owner/repo) | `<brand>/agent-skills` |
54-
| `--category <category>` | `-c` | Skill category | `general` |
5554
| `--keywords <keywords>` | `-k` | Comma-separated keywords | `ai, agent, skill` |
5655
| `--output <dir>` | `-o` | Output directory | `.` |
5756
| `--quiet` | `-q` | Suppress prompts and visual output | `false` |
@@ -76,7 +75,6 @@ npx build-skill \
7675
--license Apache-2.0 \
7776
--website https://acme.example.com/docs \
7877
--repository acme-corp/agent-skills \
79-
--category productivity \
8078
--keywords "data, csv, json, processing" \
8179
--quiet
8280

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ async function main() {
3737
.option("-l, --license <license>", "License for the skill")
3838
.option("-w, --website <url>", "Website URL (e.g. docs) for the skill")
3939
.option("-r, --repository <repo>", "GitHub repository (owner/repo)")
40-
.option("-c, --category <category>", "Skill category")
4140
.option("-k, --keywords <keywords>", "Comma-separated keywords")
4241
.option("-o, --output <dir>", "Output directory", ".")
4342
.option("-q, --quiet", "Suppress interactive prompts and visual output")
@@ -81,8 +80,9 @@ async function main() {
8180
Skill_License: options.license || "MIT",
8281
Skill_Homepage: options.website || "https://example.com",
8382
Skill_Repository: options.repository || `${brandName}/agent-skills`,
84-
Skill_Category: options.category || "general",
85-
Skill_Keywords: options.keywords || "ai, agent, skill",
83+
Skill_Keywords: JSON.stringify(
84+
(options.keywords || "ai, agent, skill").split(",").map((k) => k.trim())
85+
),
8686
};
8787

8888
await createSkillRepository(

src/scaffold.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ export async function replaceInFile(
4848

4949
for (const [key, value] of Object.entries(values)) {
5050
const placeholder = `{${key}}`;
51+
52+
// When the value is a JSON array, replace the quoted placeholder
53+
// (e.g. "{Skill_Keywords}") with the raw array so the output is valid JSON
54+
if (value.startsWith("[")) {
55+
content = content.replaceAll(`"${placeholder}"`, value);
56+
}
57+
5158
content = content.replaceAll(placeholder, value);
5259
}
5360

src/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export interface CliOptions {
55
license?: string;
66
website?: string;
77
repository?: string;
8-
category?: string;
98
keywords?: string;
109
output?: string;
1110
quiet?: boolean;
@@ -21,7 +20,6 @@ export interface TemplateValues {
2120
Skill_License: string;
2221
Skill_Homepage: string;
2322
Skill_Repository: string;
24-
Skill_Category: string;
2523
Skill_Keywords: string;
2624
}
2725

template/.claude-plugin/marketplace.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
"homepage": "{Skill_Homepage}",
2323
"repository": "https://github.com/{Skill_Repository}",
2424
"license": "{Skill_License}",
25-
"category": "{Skill_Category}",
2625
"keywords": "{Skill_Keywords}"
2726
}
2827
]

template/scripts/add-skill.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ function generatePluginJson(skillName, description, marketplace) {
9898
license: existingPlugin.license || "MIT",
9999
homepage: existingPlugin.homepage || "https://example.com",
100100
repository: existingPlugin.repository || "",
101-
keywords: existingPlugin.keywords || "ai, agent, skill",
102-
category: existingPlugin.category || "general",
101+
keywords: existingPlugin.keywords || [],
103102
},
104103
null,
105104
2

template/scripts/sync-skills.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ async function discoverSkills() {
123123
author: pluginJson.author || {},
124124
homepage: pluginJson.homepage || "",
125125
repository: pluginJson.repository || "",
126-
category: pluginJson.category || "general",
127-
keywords: pluginJson.keywords || "",
126+
keywords: pluginJson.keywords || [],
128127
});
129128
} catch (error) {
130129
console.warn(
@@ -204,7 +203,6 @@ async function updateMarketplace(skills) {
204203
homepage: skill.homepage,
205204
repository: skill.repository,
206205
license: skill.license,
207-
category: skill.category,
208206
keywords: skill.keywords,
209207
}));
210208

template/skills/{Skill_Name}/.claude-plugin/plugin.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
"license": "{Skill_License}",
1010
"homepage": "{Skill_Homepage}",
1111
"repository": "https://github.com/{Skill_Repository}",
12-
"keywords": "{Skill_Keywords}",
13-
"category": "{Skill_Category}"
12+
"keywords": "{Skill_Keywords}"
1413
}

0 commit comments

Comments
 (0)