@booklib/skills 1.8.0 → 1.10.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/AGENTS.md +111 -53
- package/CONTRIBUTING.md +147 -0
- package/PLAN.md +28 -0
- package/README.md +102 -108
- package/bin/skills.js +218 -20
- package/hooks/hooks.json +12 -0
- package/hooks/suggest.js +153 -0
- package/package.json +1 -1
- package/rules/common/clean-code.md +42 -0
- package/rules/java/effective-java.md +42 -0
- package/rules/kotlin/effective-kotlin.md +37 -0
- package/rules/python/effective-python.md +38 -0
- package/rules/rust/rust.md +37 -0
- package/rules/typescript/effective-typescript.md +42 -0
package/AGENTS.md
CHANGED
|
@@ -1,108 +1,166 @@
|
|
|
1
1
|
# Agent Integration
|
|
2
2
|
|
|
3
|
-
How to install and use booklib
|
|
3
|
+
How to install and use `@booklib/skills` with different AI coding assistants.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What gets installed
|
|
6
|
+
|
|
7
|
+
Each install creates up to three things in your project (or globally with `--global`):
|
|
8
|
+
|
|
9
|
+
| Directory | Contents | Purpose |
|
|
10
|
+
|-----------|----------|---------|
|
|
11
|
+
| `.claude/skills/` | 22 book-grounded skills | Auto-triggered by context |
|
|
12
|
+
| `.claude/commands/` | 22 slash commands | Explicit invocation (`/effective-python`) |
|
|
13
|
+
| `.claude/agents/` | 8 reviewer agents | Autonomous end-to-end reviews |
|
|
6
14
|
|
|
7
|
-
|
|
15
|
+
The fastest way to install is by **profile** — one command installs the right skills, commands, and agent for your language or domain:
|
|
8
16
|
|
|
9
17
|
```bash
|
|
10
|
-
npx skills add
|
|
18
|
+
npx @booklib/skills add --profile=python # Python
|
|
19
|
+
npx @booklib/skills add --profile=ts # TypeScript / JavaScript
|
|
20
|
+
npx @booklib/skills add --profile=jvm # Java + Kotlin + Spring Boot
|
|
21
|
+
npx @booklib/skills add --profile=rust # Rust
|
|
22
|
+
npx @booklib/skills add --profile=architecture # DDD, microservices, system design
|
|
23
|
+
npx @booklib/skills add --profile=data # Pipelines, ETL, storage
|
|
24
|
+
npx @booklib/skills add --profile=ui # UI design, charts, animations
|
|
25
|
+
npx @booklib/skills add --profile=lean # Lean Startup practices
|
|
26
|
+
npx @booklib/skills add --profile=core # Routing + general quality (good default)
|
|
27
|
+
|
|
28
|
+
# Or install everything
|
|
29
|
+
npx @booklib/skills add --all
|
|
11
30
|
```
|
|
12
31
|
|
|
13
|
-
|
|
32
|
+
Add `--global` to any command to install to `~/.claude/` instead of the project directory.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Claude Code
|
|
37
|
+
|
|
38
|
+
### Install
|
|
14
39
|
|
|
15
40
|
```bash
|
|
16
|
-
|
|
41
|
+
# Recommended — install by profile
|
|
42
|
+
npx @booklib/skills add --profile=ts --global
|
|
43
|
+
|
|
44
|
+
# Everything
|
|
45
|
+
npx @booklib/skills add --all --global
|
|
46
|
+
|
|
47
|
+
# Single skill
|
|
48
|
+
npx @booklib/skills add effective-typescript
|
|
17
49
|
```
|
|
18
50
|
|
|
19
|
-
|
|
51
|
+
### How skills trigger
|
|
52
|
+
|
|
53
|
+
Claude Code reads skills from `.claude/skills/` (project) or `~/.claude/skills/` (global) and loads them based on the `description` field in each `SKILL.md`. Skills activate automatically when the context matches.
|
|
54
|
+
|
|
55
|
+
### Slash commands
|
|
20
56
|
|
|
21
|
-
|
|
57
|
+
Each profile also installs companion slash commands:
|
|
22
58
|
|
|
23
59
|
```
|
|
24
|
-
/
|
|
60
|
+
/effective-typescript # runs the effective-typescript skill explicitly
|
|
61
|
+
/clean-code-reviewer # reviews against Clean Code principles
|
|
62
|
+
/skill-router # routes automatically to the best skill
|
|
25
63
|
```
|
|
26
64
|
|
|
27
|
-
|
|
65
|
+
### Agents
|
|
28
66
|
|
|
29
|
-
|
|
67
|
+
Agents are autonomous reviewers installed to `.claude/agents/`. Invoke with `@`:
|
|
30
68
|
|
|
31
|
-
```
|
|
32
|
-
|
|
69
|
+
```
|
|
70
|
+
@booklib-reviewer # auto-routes to the right skill
|
|
71
|
+
@python-reviewer # Python: effective-python + asyncio + scraping
|
|
72
|
+
@ts-reviewer # TypeScript: effective-typescript + clean-code
|
|
73
|
+
@jvm-reviewer # Java/Kotlin: effective-java + kotlin + spring-boot
|
|
74
|
+
@rust-reviewer # Rust: programming-with-rust + rust-in-action
|
|
75
|
+
@architecture-reviewer # DDD + microservices + system-design + DDIA
|
|
76
|
+
@data-reviewer # data-intensive-patterns + data-pipelines
|
|
77
|
+
@ui-reviewer # refactoring-ui + storytelling + animation
|
|
33
78
|
```
|
|
34
79
|
|
|
35
|
-
|
|
80
|
+
### Skill suggestion hook
|
|
36
81
|
|
|
37
|
-
|
|
82
|
+
`add --all` also installs a `UserPromptSubmit` hook (`booklib-suggest.js`) that detects when you're asking to review code and suggests the relevant skill — without firing on every message.
|
|
38
83
|
|
|
39
|
-
|
|
40
|
-
|
|
84
|
+
To activate it, add the hook config to your Claude Code settings:
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"UserPromptSubmit": [{
|
|
88
|
+
"hooks": [{ "type": "command", "command": "node \"$HOME/.claude/booklib-suggest.js\"" }]
|
|
89
|
+
}]
|
|
90
|
+
}
|
|
41
91
|
```
|
|
42
92
|
|
|
43
|
-
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Cursor
|
|
44
96
|
|
|
45
|
-
|
|
97
|
+
Cursor reads rules from `.cursor/rules/`. Use `--target=cursor` to install there:
|
|
46
98
|
|
|
47
99
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
100
|
+
# Install to Cursor only
|
|
101
|
+
npx @booklib/skills add --profile=ts --target=cursor
|
|
50
102
|
|
|
51
|
-
|
|
103
|
+
# Install to both Claude Code and Cursor
|
|
104
|
+
npx @booklib/skills add --profile=ts --target=all
|
|
52
105
|
|
|
53
|
-
|
|
54
|
-
|
|
106
|
+
# Single skill to Cursor
|
|
107
|
+
npx @booklib/skills add effective-typescript --target=cursor
|
|
55
108
|
```
|
|
56
109
|
|
|
57
|
-
|
|
110
|
+
Skills are written as `.cursor/rules/<skill-name>.md`. Cursor loads them in Agent mode. Agents are not applicable to Cursor (no native agent system).
|
|
58
111
|
|
|
59
|
-
|
|
112
|
+
---
|
|
60
113
|
|
|
61
|
-
|
|
62
|
-
|
|
114
|
+
## GitHub Copilot (VS Code)
|
|
115
|
+
|
|
116
|
+
Copilot Chat doesn't load `.claude/skills/` natively. Reference skills explicitly in chat:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
Using the effective-typescript skill, review this file for type safety issues.
|
|
120
|
+
Apply the clean-code-reviewer skill to the current diff.
|
|
63
121
|
```
|
|
64
122
|
|
|
65
|
-
|
|
123
|
+
Or install globally and reference by name — some Copilot extensions pick up `.claude/skills/` as context.
|
|
66
124
|
|
|
67
|
-
|
|
125
|
+
---
|
|
68
126
|
|
|
69
|
-
|
|
127
|
+
## Windsurf
|
|
128
|
+
|
|
129
|
+
Install into your project:
|
|
70
130
|
|
|
71
131
|
```bash
|
|
72
|
-
npx skills add
|
|
132
|
+
npx @booklib/skills add --profile=ts
|
|
73
133
|
```
|
|
74
134
|
|
|
75
|
-
|
|
135
|
+
Skills go to `.claude/skills/`. In Windsurf's Cascade mode, reference a skill by name or use `@booklib-reviewer` if agents are supported. The `skill-router` skill selects the right skill automatically when you describe your task.
|
|
76
136
|
|
|
77
|
-
|
|
78
|
-
Route this task to the right skill, then apply it: [your request]
|
|
79
|
-
```
|
|
137
|
+
---
|
|
80
138
|
|
|
81
|
-
|
|
139
|
+
## Supported platforms
|
|
82
140
|
|
|
83
|
-
|
|
141
|
+
| Platform | Skills | Commands | Agents | Auto-trigger |
|
|
142
|
+
|----------|--------|----------|--------|--------------|
|
|
143
|
+
| Claude Code | `.claude/skills/` | `.claude/commands/` | `.claude/agents/` | Yes |
|
|
144
|
+
| Cursor | `.cursor/rules/` (`--target=cursor`) | — | — | Partial |
|
|
145
|
+
| GitHub Copilot | Manual reference | — | — | No |
|
|
146
|
+
| Windsurf | `.claude/skills/` | — | Partial | Partial |
|
|
84
147
|
|
|
85
|
-
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Manual installation
|
|
86
151
|
|
|
87
152
|
```bash
|
|
88
|
-
# Single skill
|
|
89
|
-
cp -r skills/effective-kotlin /path/to
|
|
153
|
+
# Single skill to any path
|
|
154
|
+
cp -r skills/effective-kotlin /path/to/.claude/skills/
|
|
90
155
|
|
|
91
156
|
# All skills
|
|
92
|
-
cp -r skills/* /path/to
|
|
157
|
+
cp -r skills/* /path/to/.claude/skills/
|
|
93
158
|
```
|
|
94
159
|
|
|
95
|
-
Any agent that reads `.claude/skills/`
|
|
96
|
-
|
|
97
|
-
## Supported agents
|
|
160
|
+
Any agent that reads `.claude/skills/` picks them up automatically.
|
|
98
161
|
|
|
99
|
-
|
|
100
|
-
|-------|-------------|--------------|----------------|
|
|
101
|
-
| Claude Code | `~/.claude/skills/` or `.claude/skills/` | Yes | `/skill-name` |
|
|
102
|
-
| Cursor | `.claude/skills/` | Partial | Reference by name |
|
|
103
|
-
| GitHub Copilot | `~/.claude/skills/` | No | Reference by name |
|
|
104
|
-
| Windsurf | `.claude/skills/` | Partial | Reference by name |
|
|
162
|
+
---
|
|
105
163
|
|
|
106
|
-
## Requesting support for a new
|
|
164
|
+
## Requesting support for a new platform
|
|
107
165
|
|
|
108
|
-
Open an issue titled **"
|
|
166
|
+
Open an issue titled **"Platform Support: [Name]"** and describe how the platform loads context files. We'll add installation instructions here.
|
package/CONTRIBUTING.md
CHANGED
|
@@ -135,6 +135,153 @@ PR checklist:
|
|
|
135
135
|
- [ ] Pass rate ≥ 80% and delta ≥ 20pp in results.json
|
|
136
136
|
- [ ] README.md skills table updated
|
|
137
137
|
|
|
138
|
+
## Adding an Agent
|
|
139
|
+
|
|
140
|
+
An agent is a multi-step autonomous reviewer that orchestrates one or more skills. If you are packaging a single book's principles, write a skill. If you need to combine multiple skills, detect code patterns to route between them, or run a full review pipeline across a whole codebase, write an agent.
|
|
141
|
+
|
|
142
|
+
| Write a skill when... | Write an agent when... |
|
|
143
|
+
|-----------------------|------------------------|
|
|
144
|
+
| You are packaging one book's principles | You need two or more skills applied together |
|
|
145
|
+
| The logic is a single lens on code | You need routing logic (detect language → pick skill) |
|
|
146
|
+
| Instructions fit in one SKILL.md | You need a multi-step process (diff → detect → review → output) |
|
|
147
|
+
|
|
148
|
+
### 1. Create the file
|
|
149
|
+
|
|
150
|
+
Agents live in a flat directory at the repo root:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
agents/<agent-name>.md
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
The filename must be lowercase and hyphen-separated. It does not need a matching folder — unlike skills, agents have no `examples/` or `evals/` subdirectories.
|
|
157
|
+
|
|
158
|
+
### 2. Write the frontmatter
|
|
159
|
+
|
|
160
|
+
Every agent file starts with YAML frontmatter:
|
|
161
|
+
|
|
162
|
+
```markdown
|
|
163
|
+
---
|
|
164
|
+
name: agent-name
|
|
165
|
+
description: >
|
|
166
|
+
When to invoke this agent and what it does. Include language names,
|
|
167
|
+
domain terms, and trigger conditions. Claude Code uses this field
|
|
168
|
+
for auto-invocation, so make it specific. Max 1024 characters.
|
|
169
|
+
tools: ["Read", "Grep", "Glob", "Bash"]
|
|
170
|
+
model: sonnet
|
|
171
|
+
---
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Required fields:**
|
|
175
|
+
|
|
176
|
+
- `name` — lowercase, hyphens only, matches filename exactly (without `.md`)
|
|
177
|
+
- `description` — used by Claude Code to decide when to invoke the agent automatically; include what it does, which skills it applies, and when to use it over alternatives
|
|
178
|
+
- `tools` — list of Claude Code tools the agent may call; `["Read", "Grep", "Glob", "Bash"]` covers most reviewers
|
|
179
|
+
- `model` — controls cost and capability (see model selection below)
|
|
180
|
+
|
|
181
|
+
### 3. Write the body
|
|
182
|
+
|
|
183
|
+
A good agent body has five parts:
|
|
184
|
+
|
|
185
|
+
**Opening sentence** — one sentence identifying what the agent is, which books it draws from, and its scope.
|
|
186
|
+
|
|
187
|
+
**Process** — numbered steps the agent follows every time it runs:
|
|
188
|
+
|
|
189
|
+
1. **Get the scope** — how to determine what to review (e.g., `git diff HEAD`, specific files passed by the user, or a directory scan)
|
|
190
|
+
2. **Detect signals** — bash commands or grep patterns that route to the right skill(s)
|
|
191
|
+
3. **Apply skill(s)** — one `### Step N` section per skill, each with `HIGH`/`MEDIUM`/`LOW` focus areas
|
|
192
|
+
4. **Output** — the standard output format
|
|
193
|
+
|
|
194
|
+
**Detection table** — a Markdown table mapping code signals to skills:
|
|
195
|
+
|
|
196
|
+
```markdown
|
|
197
|
+
| Code contains | Apply |
|
|
198
|
+
|---------------|-------|
|
|
199
|
+
| `async def`, `await`, `asyncio` | `using-asyncio-python` |
|
|
200
|
+
| `BeautifulSoup`, `scrapy` | `web-scraping-python` |
|
|
201
|
+
| General Python | `effective-python` |
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Per-skill focus areas** — for each skill applied, list what to look for under `HIGH`, `MEDIUM`, and `LOW` headings. Pull these from the skills' own SKILL.md files, but trim to what is relevant for this agent's scope.
|
|
205
|
+
|
|
206
|
+
**Output format** — end the body with the standard output block:
|
|
207
|
+
|
|
208
|
+
```markdown
|
|
209
|
+
### Step N — Output format
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
**Skills applied:** `skill-name(s)`
|
|
213
|
+
**Scope:** [files reviewed]
|
|
214
|
+
|
|
215
|
+
### HIGH
|
|
216
|
+
- `file:line` — finding
|
|
217
|
+
|
|
218
|
+
### MEDIUM
|
|
219
|
+
- `file:line` — finding
|
|
220
|
+
|
|
221
|
+
### LOW
|
|
222
|
+
- `file:line` — finding
|
|
223
|
+
|
|
224
|
+
**Summary:** X HIGH, Y MEDIUM, Z LOW findings.
|
|
225
|
+
```
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### 4. Choose the right model
|
|
229
|
+
|
|
230
|
+
| Model | When to use |
|
|
231
|
+
|-------|-------------|
|
|
232
|
+
| `haiku` | Fast, cheap; use for simple or narrow tasks with a single skill and little routing logic |
|
|
233
|
+
| `sonnet` | Default for most reviewers; handles multi-skill routing and structured output well |
|
|
234
|
+
| `opus` | Only for architecture or reasoning-heavy agents where depth matters more than cost (e.g., `architecture-reviewer`) |
|
|
235
|
+
|
|
236
|
+
When in doubt, use `sonnet`.
|
|
237
|
+
|
|
238
|
+
### 5. Follow naming conventions
|
|
239
|
+
|
|
240
|
+
| Pattern | Examples | Use for |
|
|
241
|
+
|---------|----------|---------|
|
|
242
|
+
| `<language>-reviewer` | `python-reviewer`, `jvm-reviewer`, `ts-reviewer` | Language-cluster agents combining all relevant skills for a language |
|
|
243
|
+
| `<domain>-reviewer` | `architecture-reviewer`, `data-reviewer`, `ui-reviewer` | Domain-cluster agents cutting across languages |
|
|
244
|
+
| Descriptive name | `booklib-reviewer` | Meta or router agents that don't fit a single language or domain |
|
|
245
|
+
|
|
246
|
+
### 6. Installation
|
|
247
|
+
|
|
248
|
+
Agents install to `.claude/agents/` alongside skills:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
# Install one agent
|
|
252
|
+
npx skills add booklib-ai/skills --agent=python-reviewer
|
|
253
|
+
|
|
254
|
+
# Install everything (skills + agents)
|
|
255
|
+
npx skills add booklib-ai/skills --all
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Once installed, Claude Code reads the agent's `description` field and auto-invokes it when a matching request arrives — no slash command needed.
|
|
259
|
+
|
|
260
|
+
### 7. No eval system (yet)
|
|
261
|
+
|
|
262
|
+
There is no `evals/` system for agents. Instead:
|
|
263
|
+
|
|
264
|
+
- Make the `description` accurate — it controls when the agent auto-invokes
|
|
265
|
+
- Check that every `### Step N` section has a clear, testable action
|
|
266
|
+
- Test manually: install the agent locally and run it against a real codebase
|
|
267
|
+
|
|
268
|
+
### 8. Submit a PR
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
git checkout -b agent/agent-name
|
|
272
|
+
git add agents/agent-name.md
|
|
273
|
+
git commit -m "feat: add agent-name agent"
|
|
274
|
+
gh pr create --title "feat: add agent-name agent" --body "..."
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
PR checklist:
|
|
278
|
+
- [ ] Filename matches `name` in frontmatter
|
|
279
|
+
- [ ] `description` is under 1024 characters and describes when to invoke it
|
|
280
|
+
- [ ] `model` is appropriate for the agent's complexity
|
|
281
|
+
- [ ] Process steps are numbered and each has a clear action
|
|
282
|
+
- [ ] Detection table covers the signals the agent handles
|
|
283
|
+
- [ ] Output format section matches the standard `HIGH`/`MEDIUM`/`LOW` format
|
|
284
|
+
|
|
138
285
|
## Requesting a skill
|
|
139
286
|
|
|
140
287
|
Open an issue titled **"Skill Request: [Book Name]"** and describe why the book would make a good skill. Community members can then pick it up.
|
package/PLAN.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Implementation Plan
|
|
2
|
+
|
|
3
|
+
Current version: **1.10.0**
|
|
4
|
+
|
|
5
|
+
## Completed in 1.9.0
|
|
6
|
+
|
|
7
|
+
- `skills agents` list command
|
|
8
|
+
- Cursor support (`--target=cursor` / `--target=all`)
|
|
9
|
+
- Hooks: `hooks/suggest.js` + `hooks/hooks.json`
|
|
10
|
+
- README overhaul (three-tier architecture)
|
|
11
|
+
- AGENTS.md rewrite
|
|
12
|
+
|
|
13
|
+
## Completed in 1.10.0
|
|
14
|
+
|
|
15
|
+
- Rules system: `rules/{language}/*.md` always-on standards files
|
|
16
|
+
- `skills add --rules` / `skills add --rules=<language>` installs to `.claude/rules/`
|
|
17
|
+
- `skills rules` list command
|
|
18
|
+
- `skills add --hooks` standalone flag (previously hooks only installed via `--all`)
|
|
19
|
+
- CONTRIBUTING.md: "Adding an Agent" section
|
|
20
|
+
- `--all` now also installs all rules
|
|
21
|
+
|
|
22
|
+
## Possible next steps
|
|
23
|
+
|
|
24
|
+
- `skills add --profile=<name> --rules` to install profile + relevant rules together
|
|
25
|
+
- Profile-aware rules: each profile installs matching rules automatically
|
|
26
|
+
- `skills rules --info=<language>` for detailed view
|
|
27
|
+
- Rules for more languages (Go, Swift, C++)
|
|
28
|
+
- Agent evals system
|