Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
src/
├── cli.ts # CLI entry point with parseArgs
├── config.ts # skills.json config management
├── detect.ts # Project stack detection
├── skills.ts # Skills CLI execution
└── utils/
├── colors.ts # ANSI color codes for terminal output
Expand All @@ -31,6 +32,10 @@ test/index.test.ts # Tests using vitest
- `installSkills(options?)` — Spawns `skills add` for each source with progress logging; options: `{ cwd?, agents?, global?, yes? }`
- `installSkillSource(entry, options)` — Installs a single skill source; options: `{ cwd?, agents?, global?, yes?, prefix? }`

### Detect (src/detect.ts)

- `detectSkills(options?)` — Detects project stack using `skills-detector` and saves to `skills.json`; options: `{ cwd? }`

### CLI Entry (src/cli.ts)

- `main(argv?)` — CLI entry point using Node.js `parseArgs`
Expand Down Expand Up @@ -71,6 +76,7 @@ interface SkillSource {
skillman # Install skills (default)
skillman install, i [--global] [--agent <name>...] # Install skills from skills.json
skillman add <source>... [--agent <name>...] # Add skill source(s) to skills.json
skillman detect # Detect project stack and save to skills.json
```

### Source Format
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,23 @@ This creates a `skills.json` file:
}
```

**Auto detect skills for current project:**

```bash
npx skillman detect
```

<p align="center">
<img src="./assets/detect.svg" alt="Install preview">
</p>

## CLI Usage

```sh
npx skillman # Install skills from skills.json (default)
npx skillman install, i # Same as above
npx skillman add <source>... # Add skill source(s) to skills.json
npx skillman detect # Detect project stack and save to skills.json
```

### Commands
Expand Down Expand Up @@ -75,6 +86,14 @@ npx skillman add <source>... [options]
| `--agent <name>` | Target agent (default: `claude-code`, repeatable) |
| `-h, --help` | Show help |

#### `detect`

Detects project stack (frameworks, languages, tools) and saves the information to `skills.json`. Uses [`skills-detector`](https://github.com/vercel-labs/skills-detector) under the hood.

```sh
npx skillman detect
```

### Source Formats

Sources can be specified in multiple formats:
Expand Down Expand Up @@ -115,6 +134,9 @@ npx skillman install --global

# Install for multiple agents
npx skillman install --agent claude-code --agent cursor

# Detect project stack
npx skillman detect
```

## Development
Expand Down
80 changes: 80 additions & 0 deletions assets/detect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions assets/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ rm -rf "$TMP_DIR" && mkdir -p "$TMP_DIR" && cd "$TMP_DIR"
cleanup() { rm -rf "$TMP_DIR"; }
trap cleanup EXIT

SKILLMAN="node ../../src/cli.ts"

# https://github.com/pamburus/termframe

termframe -o "$SCRIPT_DIR/add.svg" --padding 2 -H auto --title "npx skillman add" -- pnpx skillman add skills.sh/vercel-labs/skills/find-skills anthropics/skills:skill-creator
termframe -o "$SCRIPT_DIR/add.svg" --padding 2 -H auto --title "npx skillman add" -- $SKILLMAN add skills.sh/vercel-labs/skills/find-skills anthropics/skills:skill-creator

termframe -o "$SCRIPT_DIR/install.svg" --padding 2 -H auto --title "npx skillman" -- $SKILLMAN

termframe -o "$SCRIPT_DIR/install.svg" --padding 2 -H auto --title "npx skillman" -- pnpx skillman
termframe -o "$SCRIPT_DIR/detect.svg" --padding 2 -H auto --title "npx skillman detect" -- $SKILLMAN detect

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"typecheck": "tsgo --noEmit --skipLibCheck"
},
"dependencies": {
"skills": "^1.3.1"
"skills": "^1.3.1",
"skills-detector": "link:../skills-detector"
},
"devDependencies": {
"@types/node": "latest",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 22 additions & 1 deletion skills.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,26 @@
"skill-creator"
]
}
]
],
"detected": {
"packageManager": "pnpm",
"frameworks": [],
"languages": [
"typescript",
"javascript"
],
"tools": [],
"testing": [
"vitest",
"pytest",
"minitest"
],
"searchTerms": [
"javascript",
"minitest",
"pytest",
"typescript",
"vitest"
]
}
}
45 changes: 45 additions & 0 deletions skills_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,51 @@
}
}
}
},
"detected": {
"type": "object",
"description": "Auto-detected project environment information",
"properties": {
"packageManager": {
"type": ["string", "null"],
"description": "Detected package manager (npm, yarn, pnpm, bun, deno)"
},
"frameworks": {
"type": "array",
"description": "Detected frameworks (e.g., nextjs, remix, rails, django)",
"items": {
"type": "string"
}
},
"languages": {
"type": "array",
"description": "Detected programming languages (e.g., typescript, python, go)",
"items": {
"type": "string"
}
},
"tools": {
"type": "array",
"description": "Detected tools and libraries (e.g., prisma, tailwind, docker)",
"items": {
"type": "string"
}
},
"testing": {
"type": "array",
"description": "Detected testing frameworks (e.g., vitest, jest, playwright)",
"items": {
"type": "string"
}
},
"searchTerms": {
"type": "array",
"description": "Combined search terms for skill discovery",
"items": {
"type": "string"
}
}
}
}
}
}
19 changes: 19 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { parseArgs } from "node:util";

import { c } from "./utils/colors.ts";
import { addSkill, findSkillsConfig } from "./config.ts";
import { detectSkills } from "./detect.ts";
import { installSkillSource, installSkills } from "./skills.ts";

const name = "skillman";
Expand Down Expand Up @@ -113,6 +114,11 @@ ${c.dim}$${c.reset} npx ${name} add ${c.cyan}vercel-labs/skills${c.reset}
return;
}

if (command === "detect") {
await detectSkills();
return;
}

throw new Error(`Unknown command: ${command}`);
}

Expand Down Expand Up @@ -154,6 +160,18 @@ ${c.bold}Examples:${c.reset}
return;
}

if (command === "detect") {
console.log(`
${c.bold}Usage:${c.reset} ${c.cyan}${name} detect${c.reset}

Detect project stack and save to skills.json.

${c.bold}Examples:${c.reset}
${c.dim}$${c.reset} npx ${name} detect
`);
return;
}

console.log(`
${c.bold}${name}${c.reset} ${c.dim}v${version}${c.reset}

Expand All @@ -164,6 +182,7 @@ ${c.bold}Usage:${c.reset} ${c.cyan}${name}${c.reset} <command> [options]
${c.bold}Commands:${c.reset}
${c.cyan}install, i${c.reset} Install skills from skills.json ${c.dim}(default)${c.reset}
${c.cyan}add${c.reset} Add a skill source to skills.json
${c.cyan}detect${c.reset} Detect project stack and save to skills.json

${c.bold}Options:${c.reset}
${c.cyan}-h, --help${c.reset} Show help for a command
Expand Down
2 changes: 2 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { existsSync } from "node:fs";
import { readFile, writeFile } from "node:fs/promises";
import { dirname, join, resolve } from "node:path";
import type { DetectionResult } from "skills-detector";

Check failure on line 4 in src/config.ts

View workflow job for this annotation

GitHub Actions / checks

Cannot find module 'skills-detector' or its corresponding type declarations.

Check failure on line 4 in src/config.ts

View workflow job for this annotation

GitHub Actions / checks

Cannot find module 'skills-detector' or its corresponding type declarations.

export interface SkillsConfig {
$schema?: string;
detected?: DetectionResult;
skills: SkillSource[];
}

Expand Down
Loading
Loading