Skip to content

Commit 121d38d

Browse files
committed
fix(docs): fix incorrect documentation and clarify skill sync workflow
- Fix scripts/meta.ts: rename `sources` to `submodules` in Type 1 comment - Fix scripts/meta.ts: clarify Type 3 skill copy destination in comment - Fix docs/skills-generator.md: "two types" → "three types" (Type 1/2/3) - Fix docs/skills-generator.md: Type 3 destination is plugins/{plugin}/skills/, not the intermediate skills/ directory - Fix docs/skills-generator.md: update repo structure diagram comment for Type 3 - Fix docs/skills-generator.md: standardize sync command to `bun run skills:sync` - Fix .claude/commands/generate-skill.md: clarify sync only handles Type 2/3, add manual cp step for Type 1 generated skills - Add safety comment to exec()/execSafe() warning against user-provided input - Add trailing newline to docs/STANDARDS.md
1 parent 7f8ad60 commit 121d38d

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

.claude/commands/generate-skill.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ Follow the guidelines in `docs/skills-generator.md` to generate Type 1 skills.
1616
- `SKILL.md` — index with frontmatter (`name`, `description`, `metadata`) and a table of all references
1717
- `GENERATION.md` — tracking metadata (source path, git SHA, generation date)
1818
- `references/*.md` — one file per concept (prefixed by category, e.g. `core-syntax.md`, `features-plugins.md`)
19-
5. **Run** the sync script to copy the generated skills into the plugin:
19+
5. **Copy** the generated skills into the plugin directory:
2020
```bash
21-
bun scripts/cli.ts sync
21+
cp -r skills/$ARGUMENTS/ plugins/$ARGUMENTS/skills/$ARGUMENTS/
2222
```
23+
> Note: `bun run skills:sync` only handles Type 2 (vendor) and Type 3 (manual) skills.
24+
> Type 1 (generated) skills must be copied manually to the plugin directory.
2325
6. **Commit** the generated skills:
2426
```bash
25-
git add skills/$ARGUMENTS/ plugins/$ARGUMENTS/skills/
27+
git add skills/$ARGUMENTS/ plugins/$ARGUMENTS/skills/$ARGUMENTS/
2628
git commit -m "feat($ARGUMENTS): generate skills from official documentation"
2729
```
2830

docs/STANDARDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ Stop and revert immediately when you observe any of these signals:
9999
- Don’t introduce unjustified optimization or abstraction.
100100
- Don’t overuse broad exceptions.
101101
- Don’t refactor unrelated code — noisy diffs make reviews harder.
102-
- Don’t make silent assumptions — state them explicitly or ask.
102+
- Don’t make silent assumptions — state them explicitly or ask.

docs/skills-generator.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PLEASE STRICTLY FOLLOW THE BEST PRACTICES FOR SKILL: https://platform.claude.com
1111

1212
## Skill Source Types
1313

14-
There are two types of skill sources. The project lists are defined in `scripts/meta.ts`:
14+
There are three types of skill sources. The project lists are defined in `scripts/meta.ts`:
1515

1616
### Type 1: Generated Skills (`sources/`)
1717

@@ -35,7 +35,7 @@ For projects that **already maintain their own skills**. We clone their repo as
3535

3636
Skills sourced from `vendor/antfu-skills/skills/` — written by Anthony Fu with his preferences, experience, tastes and best practices.
3737

38-
These are **read-only**. Do not modify them here; contribute changes upstream to [antfu/skills](https://github.com/antfu/skills). They are automatically copied to `skills/` by the sync script.
38+
These are **read-only**. Do not modify them here; contribute changes upstream to [antfu/skills](https://github.com/antfu/skills). They are automatically copied directly to `plugins/{plugin}/skills/` by the sync script (not via the intermediate `skills/` directory).
3939

4040
## Repository Structure
4141

@@ -67,7 +67,7 @@ These are **read-only**. Do not modify them here; contribute changes upstream to
6767
6868
└── plugins/ # Plugin directories
6969
└── {plugin}/
70-
└── skills/ # Synced from skills/ by cli.ts sync
70+
└── skills/ # Synced directly from vendor/ by cli.ts sync
7171
└── {skill-name}/
7272
```
7373

@@ -144,7 +144,8 @@ These are **read-only**. Do not modify them here; contribute changes upstream to
144144
After generating or updating skills, sync them to the plugin directories:
145145

146146
```bash
147-
bun scripts/cli.ts sync
147+
bun run skills:sync
148+
# or directly: bun scripts/cli.ts sync
148149
```
149150

150151
This copies `skills/``plugins/*/skills/` according to the mapping in `scripts/meta.ts`.

scripts/cli.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ const SKILL_TO_PLUGIN: Record<string, string> = {
4646
// ---------------------------------------------------------------------------
4747
// Helpers
4848
// ---------------------------------------------------------------------------
49+
// NOTE: exec/execSafe use shell execution. Do NOT call with user-provided or
50+
// external input — use execFile/execFileSafe instead (they bypass the shell).
4951
function exec(cmd: string, cwd = ROOT): string {
5052
return execSync(cmd, { cwd, encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim()
5153
}

scripts/meta.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Mirrors the structure of vendor/antfu-skills/meta.ts but managed in this repo.
44
*
55
* To add a new source (Type 1):
6-
* 1. Add an entry to `sources` below
6+
* 1. Add an entry to `submodules` below
77
* 2. Run: bun scripts/cli.ts init
88
* 3. Generate skills: /generate-skill <name>
99
* 4. Add skill → plugin mapping to SKILL_TO_PLUGIN in scripts/cli.ts
@@ -87,6 +87,6 @@ export const vendors: Record<string, VendorMeta> = {
8787

8888
/**
8989
* Type 3: Hand-written skills by Anthony Fu.
90-
* These live in vendor/antfu-skills/skills/ and are read directly.
90+
* These live in vendor/antfu-skills/skills/ and are copied directly to plugins/{plugin}/skills/ by the sync script.
9191
*/
9292
export const manual: string[] = ["antfu"]

0 commit comments

Comments
 (0)