@simplysm/claude 13.0.0-beta.22 → 13.0.0-beta.23
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/README.md +330 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @simplysm/claude
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A Claude Code skills, agents, and rules package for the Simplysm framework. Automatically installs Claude Code assets via `postinstall` when added as a dev dependency. Provides opinionated development workflows including TDD, code review, planning, brainstorming, and git worktree management.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,22 +10,345 @@ pnpm add -D @simplysm/claude
|
|
|
10
10
|
npm install --save-dev @simplysm/claude
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Skills and
|
|
13
|
+
Skills, agents, and rules are automatically installed to `.claude/` on `pnpm install` / `npm install`.
|
|
14
14
|
|
|
15
15
|
## How It Works
|
|
16
16
|
|
|
17
|
-
When installed as a dependency, the `postinstall` script:
|
|
17
|
+
When installed as a dependency, the `postinstall` script (`scripts/postinstall.mjs`):
|
|
18
18
|
|
|
19
|
-
1. Copies `sd-*` assets (skills, agents, rules) to the project's `.claude/` directory
|
|
20
|
-
2. Configures `statusLine` in `.claude/settings.json`
|
|
21
|
-
3. Existing `sd-*` entries are replaced with the latest version
|
|
19
|
+
1. Copies all `sd-*` assets (skills, agents, rules, statusline) to the project's `.claude/` directory
|
|
20
|
+
2. Configures `statusLine` in `.claude/settings.json` to use `sd-statusline.js`
|
|
21
|
+
3. Existing `sd-*` entries are replaced with the latest version on each install
|
|
22
|
+
|
|
23
|
+
The `prepack` script (`scripts/sync-claude-assets.mjs`) runs before `npm pack` / `npm publish` to sync assets from the project root `.claude/` directory into the package's `claude/` directory.
|
|
22
24
|
|
|
23
25
|
Updates also trigger reinstallation (`pnpm up @simplysm/claude`).
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
### Directory Structure (Published Package)
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
@simplysm/claude/
|
|
31
|
+
scripts/
|
|
32
|
+
postinstall.mjs # Copies sd-* assets to .claude/ on install
|
|
33
|
+
sync-claude-assets.mjs # Syncs assets from .claude/ before publish
|
|
34
|
+
claude/
|
|
35
|
+
sd-statusline.js # Status line script
|
|
36
|
+
rules/
|
|
37
|
+
sd-context7.md # Context7 MCP rule
|
|
38
|
+
agents/
|
|
39
|
+
sd-code-reviewer.md # Code review agent
|
|
40
|
+
sd-code-simplifier.md # Code simplification agent
|
|
41
|
+
sd-api-reviewer.md # API/DX review agent
|
|
42
|
+
skills/
|
|
43
|
+
sd-brainstorm/ # Brainstorming skill
|
|
44
|
+
sd-plan/ # Plan writing skill
|
|
45
|
+
sd-plan-dev/ # Plan execution skill
|
|
46
|
+
sd-tdd/ # Test-driven development skill
|
|
47
|
+
sd-review/ # Comprehensive code review skill
|
|
48
|
+
sd-check/ # Typecheck + lint + test skill
|
|
49
|
+
sd-commit/ # Git commit skill
|
|
50
|
+
sd-readme/ # README update skill
|
|
51
|
+
sd-worktree/ # Git worktree management skill
|
|
52
|
+
sd-explore/ # Codebase analysis skill
|
|
53
|
+
sd-use/ # Auto skill/agent router
|
|
54
|
+
sd-skill/ # Skill authoring skill
|
|
55
|
+
sd-api-name-review/ # API naming review skill
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Skills
|
|
59
|
+
|
|
60
|
+
Skills are invoked via `/sd-<name>` slash commands in Claude Code.
|
|
61
|
+
|
|
62
|
+
### sd-brainstorm
|
|
63
|
+
|
|
64
|
+
Collaborative design exploration before implementation. Helps turn ideas into fully formed designs through natural dialogue.
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
/sd-brainstorm add a modal component to the UI library
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Process:**
|
|
71
|
+
- Checks project context (files, docs, recent commits)
|
|
72
|
+
- Asks questions one at a time (multiple choice preferred)
|
|
73
|
+
- Proposes 2-3 approaches with trade-offs
|
|
74
|
+
- Presents design in 200-300 word sections with validation
|
|
75
|
+
- Saves validated design to `docs/plans/YYYY-MM-DD-<topic>-design.md`
|
|
76
|
+
|
|
77
|
+
### sd-plan
|
|
78
|
+
|
|
79
|
+
Creates comprehensive implementation plans with TDD, assuming the implementer has zero codebase context.
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
/sd-plan
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Process:**
|
|
86
|
+
- Reads requirements/spec
|
|
87
|
+
- Creates bite-sized tasks (2-5 minutes each)
|
|
88
|
+
- Each task includes: exact file paths, complete code, test commands with expected output
|
|
89
|
+
- Saves plan to `docs/plans/YYYY-MM-DD-<feature-name>.md`
|
|
90
|
+
- Hands off to `sd-plan-dev` for execution
|
|
91
|
+
|
|
92
|
+
**Task structure:**
|
|
93
|
+
1. Write the failing test
|
|
94
|
+
2. Run it to verify it fails
|
|
95
|
+
3. Implement minimal code
|
|
96
|
+
4. Run test to verify it passes
|
|
97
|
+
5. Commit
|
|
98
|
+
|
|
99
|
+
### sd-plan-dev
|
|
100
|
+
|
|
101
|
+
Executes implementation plans via parallel Task agents with dependency-aware scheduling.
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
/sd-plan-dev
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Process:**
|
|
108
|
+
- Reads plan, extracts tasks
|
|
109
|
+
- Analyzes file dependencies to build a task graph
|
|
110
|
+
- Groups independent tasks into parallel batches
|
|
111
|
+
- Each task agent: implements, launches parallel spec + quality review sub-Tasks, fixes issues
|
|
112
|
+
- Repeats review cycle until both reviewers approve
|
|
113
|
+
- Final review across entire implementation
|
|
114
|
+
|
|
115
|
+
### sd-tdd
|
|
116
|
+
|
|
117
|
+
Test-driven development workflow. Enforces the Red-Green-Refactor cycle.
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
# Invoked internally by other skills, not typically called directly
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Iron Law:** No production code without a failing test first.
|
|
124
|
+
|
|
125
|
+
**Cycle:**
|
|
126
|
+
1. **RED** - Write one minimal failing test
|
|
127
|
+
2. **Verify RED** - Run test, confirm it fails for the right reason
|
|
128
|
+
3. **GREEN** - Write simplest code to pass
|
|
129
|
+
4. **Verify GREEN** - Run test, confirm all pass
|
|
130
|
+
5. **REFACTOR** - Clean up while keeping tests green
|
|
131
|
+
|
|
132
|
+
### sd-check
|
|
133
|
+
|
|
134
|
+
Verifies code via typecheck, lint, and tests. Fixes errors automatically.
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
/sd-check
|
|
138
|
+
/sd-check packages/core-common
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
**Process (sequential, fix-and-retry):**
|
|
142
|
+
1. Environment pre-check (pnpm workspace, package.json scripts, vitest config)
|
|
143
|
+
2. `pnpm typecheck [path]` - fix errors, re-run until clean
|
|
144
|
+
3. `pnpm lint --fix [path]` - fix errors, re-run until clean
|
|
145
|
+
4. `pnpm vitest [path] --run` - fix failures, re-run until clean
|
|
146
|
+
|
|
147
|
+
### sd-review
|
|
148
|
+
|
|
149
|
+
Multi-perspective code review of a package or path. Analysis only, no code modifications.
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
/sd-review packages/solid
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Process:**
|
|
156
|
+
1. Runs `sd-explore` skill for deep code analysis (separate context)
|
|
157
|
+
2. Dispatches 3 parallel reviewer agents: `sd-code-reviewer`, `sd-code-simplifier`, `sd-api-reviewer`
|
|
158
|
+
3. Verifies each finding against actual code
|
|
159
|
+
4. Produces comprehensive report grouped by severity (P0-P4)
|
|
160
|
+
|
|
161
|
+
### sd-commit
|
|
162
|
+
|
|
163
|
+
Creates a git commit following Conventional Commits style.
|
|
164
|
+
|
|
165
|
+
```
|
|
166
|
+
/sd-commit
|
|
167
|
+
/sd-commit all
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- Without `all`: stages only relevant files individually
|
|
171
|
+
- With `all`: runs `git add .` then commits everything
|
|
172
|
+
- Commit message format: `type(scope): short description`
|
|
173
|
+
|
|
174
|
+
### sd-readme
|
|
175
|
+
|
|
176
|
+
Updates README.md files based on git commits since their last modification.
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
/sd-readme # Update all package READMEs in parallel
|
|
180
|
+
/sd-readme packages/solid # Update a single package README
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Process:**
|
|
184
|
+
1. Finds last commit that modified the README
|
|
185
|
+
2. Gathers all commits since then
|
|
186
|
+
3. Cross-checks exports in `src/index.ts`
|
|
187
|
+
4. Presents findings and waits for confirmation
|
|
188
|
+
5. Edits only affected sections
|
|
189
|
+
|
|
190
|
+
### sd-worktree
|
|
191
|
+
|
|
192
|
+
Git worktree management for branch isolation during feature work.
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
/sd-worktree add modal-migration # Create worktree
|
|
196
|
+
/sd-worktree rebase # Rebase onto main
|
|
197
|
+
/sd-worktree merge # Merge into main (--no-ff)
|
|
198
|
+
/sd-worktree clean modal-migration # Remove worktree and branch
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Commands:**
|
|
202
|
+
|
|
203
|
+
| Command | Description |
|
|
204
|
+
|---------|-------------|
|
|
205
|
+
| `add <name>` | Create worktree under `.worktrees/<name>`, cd into it |
|
|
206
|
+
| `rebase [name]` | Rebase worktree branch onto main branch |
|
|
207
|
+
| `merge [name]` | Merge worktree branch into main with `--no-ff` |
|
|
208
|
+
| `clean <name>` | Remove worktree directory and delete branch |
|
|
209
|
+
|
|
210
|
+
**Full workflow:**
|
|
211
|
+
```
|
|
212
|
+
/sd-worktree add modal-migration
|
|
213
|
+
# ... work in .worktrees/modal-migration ...
|
|
214
|
+
/sd-worktree rebase
|
|
215
|
+
/sd-worktree merge
|
|
216
|
+
cd <project-root>
|
|
217
|
+
/sd-worktree clean modal-migration
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### sd-explore
|
|
221
|
+
|
|
222
|
+
Deep codebase analysis. Traces execution paths, maps architecture layers, and documents dependencies. Analysis only, no code modifications.
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
# Typically invoked by sd-review, not directly
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Covers:**
|
|
229
|
+
- Feature discovery (entry points, core files, boundaries)
|
|
230
|
+
- Code flow tracing (call chains, data transformations, side effects)
|
|
231
|
+
- Architecture analysis (abstraction layers, design patterns, interfaces)
|
|
232
|
+
- Implementation details (algorithms, error handling, performance)
|
|
233
|
+
|
|
234
|
+
### sd-use
|
|
235
|
+
|
|
236
|
+
Auto skill/agent router. Analyzes the user request and selects the best matching `sd-*` skill or agent.
|
|
237
|
+
|
|
238
|
+
```
|
|
239
|
+
/sd-use review the solid package for bugs
|
|
240
|
+
# Selects sd-review and executes it
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### sd-skill
|
|
244
|
+
|
|
245
|
+
Skill authoring tool. Creates new skills using TDD methodology applied to documentation.
|
|
246
|
+
|
|
247
|
+
```
|
|
248
|
+
/sd-skill
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Process (Red-Green-Refactor for documentation):**
|
|
252
|
+
1. **RED** - Run pressure scenarios without skill, document baseline failures
|
|
253
|
+
2. **GREEN** - Write minimal skill addressing those specific failures
|
|
254
|
+
3. **REFACTOR** - Close loopholes, add rationalization counters, re-test
|
|
255
|
+
|
|
256
|
+
### sd-api-name-review
|
|
257
|
+
|
|
258
|
+
Reviews a library's public API naming for consistency and industry standard alignment. Analysis only, no code modifications.
|
|
259
|
+
|
|
260
|
+
```
|
|
261
|
+
/sd-api-name-review packages/solid
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
**Phases:**
|
|
265
|
+
1. Extract public API surface (exports, parameters, patterns)
|
|
266
|
+
2. Research industry standard naming via web search
|
|
267
|
+
3. Comparative analysis with priority levels (P0-P2 + Keep)
|
|
268
|
+
|
|
269
|
+
## Agents
|
|
270
|
+
|
|
271
|
+
Agents are used by skills as subagents via the Task tool, or can be invoked directly.
|
|
272
|
+
|
|
273
|
+
### sd-code-reviewer
|
|
274
|
+
|
|
275
|
+
Reviews code for bugs, logic errors, security vulnerabilities, and convention adherence. Uses confidence-based filtering (only reports issues with confidence >= 80).
|
|
276
|
+
|
|
277
|
+
**Severity levels:** Critical, Important
|
|
278
|
+
|
|
279
|
+
**Scope:** By default reviews unstaged changes from `git diff`. Can be directed to specific files.
|
|
280
|
+
|
|
281
|
+
### sd-code-simplifier
|
|
282
|
+
|
|
283
|
+
Simplifies and refines code for clarity, consistency, and maintainability while preserving all functionality. Focuses on recently modified code.
|
|
284
|
+
|
|
285
|
+
**Focus areas:**
|
|
286
|
+
- Reduce unnecessary complexity and nesting
|
|
287
|
+
- Eliminate redundant code and abstractions
|
|
288
|
+
- Improve readability through clear naming
|
|
289
|
+
- Avoid nested ternaries (prefer switch/if-else)
|
|
290
|
+
|
|
291
|
+
### sd-api-reviewer
|
|
292
|
+
|
|
293
|
+
Reviews a library's public API for developer experience (DX) quality. Uses confidence-based filtering (only reports issues with confidence >= 70).
|
|
294
|
+
|
|
295
|
+
**Review categories:**
|
|
296
|
+
- Naming consistency and industry standard alignment
|
|
297
|
+
- API intuitiveness and learning curve
|
|
298
|
+
- Type hints and error message quality
|
|
299
|
+
- Configuration complexity and boilerplate
|
|
300
|
+
- Usage pattern coherence
|
|
301
|
+
|
|
302
|
+
**Priority levels:** P0 (API misuse likely), P1 (significant friction), P2 (minor improvement), Keep (already aligned)
|
|
303
|
+
|
|
304
|
+
## Rules
|
|
305
|
+
|
|
306
|
+
### sd-context7
|
|
307
|
+
|
|
308
|
+
Configures Context7 MCP for looking up `@simplysm/*` package documentation. The library ID is pre-configured as `/kslhunter/simplysm`.
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
query-docs(libraryId="/kslhunter/simplysm", query="<your question>")
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## Status Line
|
|
315
|
+
|
|
316
|
+
`sd-statusline.js` displays a Claude Code status bar with:
|
|
317
|
+
|
|
318
|
+
- Model name
|
|
319
|
+
- Context window usage (progress bar + percentage)
|
|
320
|
+
- Daily rate limit usage with reset time (via OAuth API)
|
|
321
|
+
- Weekly rate limit usage with reset time (via OAuth API or stdin fallback)
|
|
322
|
+
- Extra usage credits (if enabled)
|
|
323
|
+
- Current folder name
|
|
324
|
+
|
|
325
|
+
The script reads Claude Code's stdin JSON for context window and model info, and optionally fetches usage data from `https://api.anthropic.com/api/oauth/usage` using the OAuth token from `~/.claude/.credentials.json`.
|
|
326
|
+
|
|
327
|
+
## Scripts
|
|
328
|
+
|
|
329
|
+
### postinstall.mjs
|
|
330
|
+
|
|
331
|
+
Runs automatically on `pnpm install` / `npm install`. Copies `sd-*` assets from the package to the project's `.claude/` directory.
|
|
332
|
+
|
|
333
|
+
```javascript
|
|
334
|
+
// Uses INIT_CWD to find the project root
|
|
335
|
+
// Deletes existing sd-* entries, then copies fresh versions
|
|
336
|
+
// Configures statusLine in .claude/settings.json
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**Environment variables:**
|
|
340
|
+
- `INIT_CWD` - Set by pnpm/npm, points to the project root where the install command was run
|
|
341
|
+
|
|
342
|
+
### sync-claude-assets.mjs
|
|
343
|
+
|
|
344
|
+
Runs before `npm pack` / `npm publish` (via `prepack` script). Syncs `sd-*` assets from the project root's `.claude/` directory into the package's `claude/` directory for distribution.
|
|
345
|
+
|
|
346
|
+
## Notes
|
|
26
347
|
|
|
27
348
|
- If using `pnpm install --ignore-scripts`, the postinstall won't run
|
|
28
349
|
- If using `onlyBuiltDependencies` in `pnpm-workspace.yaml`, add `@simplysm/claude` to the list
|
|
350
|
+
- Skills and agents use the `sd-` prefix to distinguish them from user-defined assets
|
|
351
|
+
- Existing `sd-*` entries are always replaced with the latest version on install
|
|
29
352
|
|
|
30
353
|
## License
|
|
31
354
|
|
package/package.json
CHANGED