spec-starter 1.0.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/README.md ADDED
@@ -0,0 +1,100 @@
1
+ # spec-starter
2
+
3
+ A Claude Code project template for structured feature development. Drop the `.claude/` folder into any project to get a repeatable workflow for taking features from raw idea to tested implementation.
4
+
5
+ ## How it works
6
+
7
+ Every feature lives in `.claude/_features/<slug>/` and moves through five stages tracked as checkboxes in `1-feature.md`:
8
+
9
+ ```
10
+ - [ ] Brief ← define what to build (non-technical)
11
+ - [ ] Blueprint ← define how to build it (technical)
12
+ - [ ] Implement ← write the code (TDD)
13
+ - [ ] Review ← manual e2e testing
14
+ - [ ] Done
15
+ ```
16
+
17
+ Each stage has a matching slash command. Commands are interactive: called without arguments they show what is available at that stage rather than failing silently.
18
+
19
+ ## Commands
20
+
21
+ | Command | No args | With arg |
22
+ |---|---|---|
23
+ | `/task` | List backlog tasks | Add idea to `.claude/tasks.md` |
24
+ | `/feature:start` | List backlog tasks | Create feature folder + `2-brief.md` |
25
+ | `/feature:review` | List `[?]` features | Review current state and take next action |
26
+ | `/feature:blueprint` | List `[x]` Brief features ready to blueprint | Generate `3-blueprint.md` |
27
+ | `/feature:implement` | List `[x]` Blueprint features ready to implement | Implement + generate `4-e2e-checklist.md` |
28
+ | `/feature:finish` | List `[o]` Review features | Push branch, create PR into `dev`, optionally merge, mark Done |
29
+ | `/feature:test` | List `[x]` Done features | Walk through `4-e2e-checklist.md` interactively, marking pass/fail |
30
+ | `/feature:status` | List all features and their states | — |
31
+ | `/project-init` | Bootstrap a new project — generates `CLAUDE.md`, asks context questions, writes `.claude/testing.md` | — |
32
+
33
+ ## Feature lifecycle
34
+
35
+ ```
36
+ Backlog idea (.claude/tasks.md)
37
+
38
+ /feature:start <idea> → .claude/_features/<slug>/1-feature.md + 2-brief.md [?] Brief
39
+ /feature:review <slug> → iterate on brief, marks [x] Brief when complete
40
+
41
+ /feature:blueprint <slug> → .claude/_features/<slug>/3-blueprint.md [x] Blueprint
42
+
43
+ /feature:implement <slug> → writes code (TDD), generates 4-e2e-checklist.md [x] Implement
44
+
45
+ Manual review → work through 4-e2e-checklist.md [x] Review
46
+
47
+ /feature:finish <slug> → push branch, PR into dev, merge, mark Done [x] Done
48
+
49
+ /feature:test <slug> → walk e2e checklist interactively (post-merge QA)
50
+ ```
51
+
52
+ After `/feature:start`, Claude writes a draft brief and flags it `[?] Brief` — meaning it needs your attention. Answer the questions Claude left in `2-brief.md`, then run `/feature:review <slug>` to iterate until the brief is complete.
53
+
54
+ ## Files per feature
55
+
56
+ ```
57
+ .claude/_features/<slug>/
58
+ 1-feature.md — state checkboxes, title, slug, branch name
59
+ 2-brief.md — non-technical goals, requirements, Q&A
60
+ 3-blueprint.md — technical implementation plan (TDD tasks)
61
+ 4-e2e-checklist.md — manual testing scenarios (generated post-implement)
62
+ 5-implementation-decisions.md — key technical decisions log (generated post-implement)
63
+ ```
64
+
65
+ ## State symbols
66
+
67
+ | Symbol | Meaning |
68
+ |---|---|
69
+ | `[ ]` | Not started |
70
+ | `[?]` | Needs attention — Claude or you flagged this for review |
71
+ | `[o]` | In progress |
72
+ | `[x]` | Complete |
73
+ | `[!]` | Blocked |
74
+
75
+ Either Claude or you can set `[?]` on any stage to trigger a review. Running `/feature:review <slug>` reads the current `[?]` state in `1-feature.md` and takes the appropriate next action automatically.
76
+
77
+ ## Hooks
78
+
79
+ Two `PostToolUse` hooks run automatically (registered in `.claude/settings.json`):
80
+
81
+ - **post-edit.sh** — auto-commits file edits to git with a `minor/moderate/major` size label based on lines changed
82
+ - **post-write.sh** — auto-commits newly created files
83
+
84
+ The hooks are no-ops outside of git repositories.
85
+
86
+ ## Shared testing instructions
87
+
88
+ `/project-init` asks how to manually test the app and writes `.claude/testing.md` with the answers — start command, base URL, test accounts, browser requirements, etc. `/feature:test` reads this file automatically so it has the right context when walking through e2e scenarios.
89
+
90
+ You can also create or edit `.claude/testing.md` by hand at any time.
91
+
92
+ ## Getting started
93
+
94
+ 1. Copy this repo's `.claude/` folder into your project root
95
+ 2. Run `/project-init` to generate `CLAUDE.md` with project context and `.claude/testing.md` with testing setup
96
+ 3. Add ideas to `.claude/tasks.md` (one per line), then run `/feature:start <idea>` to turn one into a feature
97
+
98
+ ## Design principle
99
+
100
+ Every command owns its own state transitions in `1-feature.md`. Nothing relies on `CLAUDE.md` for workflow logic — `CLAUDE.md` is project-specific context that `/project-init` writes fresh for each project.
package/bin/index.js ADDED
@@ -0,0 +1,69 @@
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const src = path.join(__dirname, '..');
7
+ const dest = process.cwd();
8
+
9
+ // Always overwrite — these are the engine files
10
+ const engineDirs = [
11
+ '.claude/commands',
12
+ '.claude/skills',
13
+ '.claude/_templates',
14
+ '.claude/hooks',
15
+ ];
16
+ const engineFiles = [
17
+ '.claude/settings.json',
18
+ ];
19
+
20
+ // Create only if missing — project seeds
21
+ const seedFiles = [
22
+ ['.claude/tasks.md', ''],
23
+ ];
24
+
25
+ // Never touch: .claude/_features/, CLAUDE.md, .claude/testing.md
26
+
27
+ function copyDir(srcDir, destDir) {
28
+ fs.mkdirSync(destDir, { recursive: true });
29
+ for (const entry of fs.readdirSync(srcDir, { withFileTypes: true })) {
30
+ const srcPath = path.join(srcDir, entry.name);
31
+ const destPath = path.join(destDir, entry.name);
32
+ if (entry.isDirectory()) {
33
+ copyDir(srcPath, destPath);
34
+ } else {
35
+ fs.copyFileSync(srcPath, destPath);
36
+ }
37
+ }
38
+ }
39
+
40
+ const isUpdate = fs.existsSync(path.join(dest, '.claude'));
41
+ console.log(isUpdate ? 'Syncing spec-starter...\n' : 'Installing spec-starter...\n');
42
+
43
+ fs.mkdirSync(path.join(dest, '.claude'), { recursive: true });
44
+
45
+ for (const dir of engineDirs) {
46
+ copyDir(path.join(src, dir), path.join(dest, dir));
47
+ console.log(` ✓ ${dir}`);
48
+ }
49
+
50
+ for (const file of engineFiles) {
51
+ fs.mkdirSync(path.dirname(path.join(dest, file)), { recursive: true });
52
+ fs.copyFileSync(path.join(src, file), path.join(dest, file));
53
+ console.log(` ✓ ${file}`);
54
+ }
55
+
56
+ for (const [file, content] of seedFiles) {
57
+ const destFile = path.join(dest, file);
58
+ if (!fs.existsSync(destFile)) {
59
+ fs.writeFileSync(destFile, content);
60
+ console.log(` ✓ ${file} (created)`);
61
+ } else {
62
+ console.log(` - ${file} (kept existing)`);
63
+ }
64
+ }
65
+
66
+ console.log(isUpdate
67
+ ? '\nDone. Engine files updated, project data untouched.'
68
+ : '\nDone. Run /project-init in Claude Code to set up your project.'
69
+ );
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "spec-starter",
3
+ "version": "1.0.0",
4
+ "description": "Claude Code project template for structured feature development",
5
+ "bin": {
6
+ "spec-starter": "bin/index.js"
7
+ },
8
+ "files": [
9
+ "bin/",
10
+ ".claude/commands/",
11
+ ".claude/skills/",
12
+ ".claude/_templates/",
13
+ ".claude/hooks/",
14
+ ".claude/settings.json"
15
+ ],
16
+ "keywords": [
17
+ "claude",
18
+ "claude-code",
19
+ "ai",
20
+ "template"
21
+ ],
22
+ "license": "MIT",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/jonesopolis/spec-starter.git"
26
+ }
27
+ }