@atheneworkai/speci5 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Nguyen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,66 @@
1
+ # speci5
2
+
3
+ A spec-driven development framework for AI-assisted coding. Gives your AI coding agent a structured workflow: **brainstorm** → **specify** → **plan** → **check**.
4
+
5
+ ## Install
6
+
7
+ Add speci5 to any project:
8
+
9
+ ```bash
10
+ npx speci5 init
11
+ ```
12
+
13
+ This copies the skill definitions and config into your repo:
14
+
15
+ ```
16
+ CLAUDE.md # Framework instructions for your AI agent
17
+ .claude/skills/ # Skill definitions (slash commands)
18
+ .spec/ideas/ # Your brainstormed ideas go here
19
+ .spec/features/ # Structured specs land here
20
+ ```
21
+
22
+ To update to the latest version:
23
+
24
+ ```bash
25
+ npx speci5 update
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ Once installed, the skills are available as `/slash` commands in Copilot Chat:
31
+
32
+ | Command | What it does |
33
+ |---------|-------------|
34
+ | `/speci5.brainstorm` | Elaborate rough thoughts into structured idea documents |
35
+ | `/speci5.specify` | Transform ideas into feature and story specs |
36
+ | `/speci5.plan` | Create concrete implementation tasks from a story |
37
+ | `/speci5.check` | Verify code against a story's plan and update progress |
38
+
39
+ ### Workflow
40
+
41
+ ```
42
+ 1. /speci5.brainstorm "user authentication with OAuth"
43
+ → writes .spec/ideas/user-auth-oauth.md
44
+
45
+ 2. /speci5.specify
46
+ → writes .spec/features/user-auth/feature.md
47
+ → writes .spec/features/user-auth/oauth-login/story.md
48
+
49
+ 3. /speci5.plan .spec/features/user-auth/oauth-login
50
+ → writes .spec/features/user-auth/oauth-login/plan.md
51
+
52
+ 4. (implement the code)
53
+
54
+ 5. /speci5.check .spec/features/user-auth/oauth-login
55
+ → updates plan.md checkboxes, reports progress
56
+ ```
57
+
58
+ ## How it works
59
+
60
+ Speci5 is a set of AI coding skills that enforce a spec-driven workflow. Instead of jumping straight to code, you capture ideas, break them into features and stories with acceptance criteria, then create concrete implementation plans — all tracked in `.spec/` alongside your code.
61
+
62
+ See [CLAUDE.md](CLAUDE.md) for the full framework reference.
63
+
64
+ ## License
65
+
66
+ MIT
package/bin/cli.mjs ADDED
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
4
+ import { resolve, dirname, join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+ import { createInterface } from 'node:readline';
7
+ import { homedir as osHomedir } from 'node:os';
8
+
9
+ const __dirname = dirname(fileURLToPath(import.meta.url));
10
+ const PKG_ROOT = resolve(__dirname, '..');
11
+ const CWD = process.cwd();
12
+ const HOME = osHomedir();
13
+
14
+ const SKILLS = [
15
+ 'speci5.brainstorm',
16
+ 'speci5.check',
17
+ 'speci5.plan',
18
+ 'speci5.specify',
19
+ ];
20
+
21
+ const command = process.argv[2];
22
+ const force = process.argv.includes('--force');
23
+ const userLevel = process.argv.includes('--user');
24
+
25
+ async function main() {
26
+ switch (command) {
27
+ case 'init':
28
+ await init();
29
+ break;
30
+ case 'update':
31
+ await update();
32
+ break;
33
+ default:
34
+ printUsage();
35
+ break;
36
+ }
37
+ }
38
+
39
+ function printUsage() {
40
+ const pkg = JSON.parse(readFileSync(join(PKG_ROOT, 'package.json'), 'utf8'));
41
+ console.log(`
42
+ speci5 v${pkg.version} — Spec-Driven Development Framework
43
+
44
+ Usage: npx speci5 <command>
45
+
46
+ Commands:
47
+ init Install speci5 skills and config into the current project
48
+ update Update existing speci5 installation to latest version
49
+
50
+ Options:
51
+ --user Install skills at user level (~/.claude/skills) instead of project level
52
+ --force Overwrite existing files without prompting
53
+ `);
54
+ }
55
+
56
+ async function init() {
57
+ const scope = userLevel ? 'user' : 'project';
58
+ const destBase = userLevel ? HOME : CWD;
59
+ const label = userLevel ? '~/.claude/skills' : '.claude/skills';
60
+
61
+ console.log(`\nspeci5 — Installing skills at ${scope} level (${label})\n`);
62
+
63
+ const skillsDir = join(destBase, '.claude', 'skills');
64
+ const existing = SKILLS.filter(s => existsSync(join(skillsDir, s)));
65
+
66
+ if (existing.length > 0 && !force) {
67
+ console.log('Found existing skills:');
68
+ existing.forEach(s => console.log(` ${label}/${s}/`));
69
+
70
+ const answer = await confirm('\nOverwrite? (y/N) ');
71
+ if (!answer) {
72
+ console.log('Aborted.\n');
73
+ process.exit(0);
74
+ }
75
+ }
76
+
77
+ copyFiles(destBase, label);
78
+
79
+ if (!userLevel) {
80
+ createSpecDir();
81
+ }
82
+
83
+ const pkg = JSON.parse(readFileSync(join(PKG_ROOT, 'package.json'), 'utf8'));
84
+ writeConfig({ version: pkg.version, scope });
85
+
86
+ console.log(`
87
+ Done! speci5 installed at ${scope} level.
88
+
89
+ Next steps:
90
+ 1. Skills are available as /slash commands in Copilot Chat
91
+ 2. Start with: /speci5.brainstorm to capture an idea
92
+ 3. Then: /speci5.specify -> /speci5.plan -> /speci5.check
93
+ `);
94
+ }
95
+
96
+ async function update() {
97
+ const config = readConfig();
98
+ const scope = userLevel ? 'user' : (config.scope || 'project');
99
+ const destBase = scope === 'user' ? HOME : CWD;
100
+ const label = scope === 'user' ? '~/.claude/skills' : '.claude/skills';
101
+
102
+ console.log(`\nspeci5 — Updating ${scope}-level skills\n`);
103
+ copyFiles(destBase, label);
104
+
105
+ const pkg = JSON.parse(readFileSync(join(PKG_ROOT, 'package.json'), 'utf8'));
106
+ writeConfig({ version: pkg.version, scope });
107
+
108
+ console.log('\nDone! speci5 updated successfully.\n');
109
+ }
110
+
111
+ function readConfig() {
112
+ const configPath = join(CWD, '.speci5.config.yml');
113
+ if (!existsSync(configPath)) return {};
114
+ const content = readFileSync(configPath, 'utf8');
115
+ const config = {};
116
+ for (const line of content.split('\n')) {
117
+ const match = line.match(/^(\w+):\s*"?([^"]+)"?\s*$/);
118
+ if (match) config[match[1]] = match[2];
119
+ }
120
+ return config;
121
+ }
122
+
123
+ function copyFiles(destBase, label) {
124
+ for (const skill of SKILLS) {
125
+ const skillSrc = join(PKG_ROOT, 'skills', skill);
126
+ const skillDest = join(destBase, '.claude', 'skills', skill);
127
+ mkdirSync(skillDest, { recursive: true });
128
+ cpSync(skillSrc, skillDest, { recursive: true });
129
+ console.log(` ${label}/${skill}/`);
130
+ }
131
+ }
132
+
133
+ function createSpecDir() {
134
+ const specDir = join(CWD, '.spec', 'ideas');
135
+ if (!existsSync(specDir)) {
136
+ mkdirSync(specDir, { recursive: true });
137
+ console.log(' .spec/ideas/');
138
+ }
139
+ const featuresDir = join(CWD, '.spec', 'features');
140
+ if (!existsSync(featuresDir)) {
141
+ mkdirSync(featuresDir, { recursive: true });
142
+ console.log(' .spec/features/');
143
+ }
144
+ }
145
+
146
+ function writeConfig({ version, scope }) {
147
+ const configPath = join(CWD, '.speci5.config.yml');
148
+ const lines = [
149
+ `# speci5 configuration`,
150
+ `# Generated by speci5 init — edit freely`,
151
+ ``,
152
+ `version: "${version}"`,
153
+ `scope: ${scope}`,
154
+ ];
155
+ writeFileSync(configPath, lines.join('\n') + '\n');
156
+ console.log(' .speci5.config.yml');
157
+ }
158
+
159
+ function confirm(prompt) {
160
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
161
+ return new Promise(resolve => {
162
+ rl.question(prompt, answer => {
163
+ rl.close();
164
+ resolve(answer.toLowerCase() === 'y');
165
+ });
166
+ });
167
+ }
168
+
169
+ main().catch(err => {
170
+ console.error(`Error: ${err.message}`);
171
+ process.exit(1);
172
+ });
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "@atheneworkai/speci5",
3
+ "version": "0.1.0",
4
+ "description": "Spec-driven development framework for AI-assisted coding",
5
+ "type": "module",
6
+ "bin": {
7
+ "speci5": "./bin/cli.mjs"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "skills/"
12
+ ],
13
+ "keywords": [
14
+ "spec",
15
+ "ai",
16
+ "copilot",
17
+ "claude",
18
+ "development",
19
+ "workflow",
20
+ "skills",
21
+ "spec driven development"
22
+ ],
23
+ "author": "David Nguyen",
24
+ "license": "MIT",
25
+ "engines": {
26
+ "node": ">=18"
27
+ }
28
+ }
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: speci5.brainstorm
3
+ description: "Elaborate and expand user input into structured idea documents in .spec/ideas/. Takes rough thoughts, researches patterns, surfaces trade-offs and open questions. WHEN: /brainstorm, brainstorm idea, new idea, capture idea, explore concept, elaborate on, think about, research idea. DO NOT USE FOR: writing specs (use specify), creating plans (use plan), checking implementation (use check)."
4
+ argument-hint: "Describe the idea or concept you want to brainstorm"
5
+ ---
6
+
7
+ # Brainstorm
8
+
9
+ Turn rough ideas into well-structured idea documents through collaborative dialogue.
10
+
11
+ Start by understanding the project context and the user's intent, then ask clarifying questions before elaborating. The goal is a thinking artifact — not a formal spec.
12
+
13
+ <HARD-GATE>
14
+ Do NOT create feature files, story files, specs, plans, or code. This skill ONLY produces idea documents in `.spec/ideas/`. The **specify** skill is the next step.
15
+ </HARD-GATE>
16
+
17
+ ## Triggers
18
+
19
+ Activate this skill when the user wants to:
20
+ - Capture a new idea or concept
21
+ - Elaborate on a rough thought
22
+ - Research patterns, prior art, or trade-offs for an idea
23
+ - Update or refine an existing idea document
24
+
25
+ ## Rules
26
+
27
+ 1. Use **kebab-case** for all filenames (e.g., `user-auth.md`).
28
+ 2. Do NOT create feature or story files — that's the **specify** skill's job.
29
+ 3. If updating an existing idea, preserve human-written content and append/refine rather than overwrite.
30
+ 4. Keep language clear and concise — this is a thinking artifact, not a formal spec.
31
+ 5. **YAGNI ruthlessly** — Strip unnecessary complexity. Simpler ideas are better ideas. If a feature isn't clearly needed, leave it out.
32
+
33
+ ## Conversation Style
34
+
35
+ - **One question at a time.** Don't overwhelm the user with multiple questions in one message.
36
+ - **Prefer multiple choice** when possible — easier to answer than open-ended.
37
+ - **Be flexible** — go back and clarify when something doesn't make sense.
38
+
39
+ ## Steps
40
+
41
+ 1. **Explore project context** — Scan `.spec/ideas/` for existing ideas, but also check the codebase, docs, and recent changes to understand what's already built and what patterns are in use. Ideas don't exist in a vacuum.
42
+ 2. **Check scope** — If the user's input describes multiple independent subsystems or a very large surface area, flag this immediately. Help decompose into smaller, independent ideas before elaborating. Each idea should be a single cohesive concept.
43
+ 3. **Ask clarifying questions** — Before writing anything, ask questions one at a time to understand purpose, constraints, and success criteria. Don't skip this even for "simple" ideas — unexamined assumptions cause the most wasted work.
44
+ 4. **Propose 2-3 approaches** — Present different ways to tackle the idea, with trade-offs for each. Lead with your recommendation and explain why.
45
+ 5. **Write or update** — Once you and the user are aligned, write the idea document. If the input closely relates to an existing idea file, **update** it. Otherwise, **create** a new file in `.spec/ideas/`.
46
+ 6. **Present** — Show the user the resulting idea document and highlight any open questions.
47
+
48
+ ## Output Format
49
+
50
+ See [output template](./assets/output.md).
@@ -0,0 +1,28 @@
1
+ Write to `.spec/ideas/<slug>.md` using this structure:
2
+
3
+ ```markdown
4
+ # <Idea Title>
5
+
6
+ ## Context
7
+ Why this idea matters. Background and motivation.
8
+
9
+ ## Description
10
+ Detailed elaboration of the idea.
11
+
12
+ ## Approaches Considered
13
+ ### Approach A: <Name> (Recommended)
14
+ Brief description. Why this is the recommended path.
15
+ - **Pros:** ...
16
+ - **Cons:** ...
17
+
18
+ ### Approach B: <Name>
19
+ Brief description.
20
+ - **Pros:** ...
21
+ - **Cons:** ...
22
+
23
+ ## Key Considerations
24
+ - Bullet points covering edge cases, trade-offs, constraints.
25
+
26
+ ## Open Questions
27
+ - Unresolved questions that need human input before specifying.
28
+ ```
@@ -0,0 +1,42 @@
1
+ ---
2
+ name: speci5.check
3
+ description: "Verify implementation progress by inspecting source code against a story's plan. Reads plan.md tasks, searches the codebase for evidence of completion, and toggles task checkboxes. WHEN: /check, check progress, verify implementation, check story, are tasks done, update plan status, check plan. DO NOT USE FOR: brainstorming ideas (use brainstorm), writing specs (use specify), creating plans (use plan)."
4
+ argument-hint: "Path to the story folder, e.g. .spec/features/user-auth/login-with-email"
5
+ ---
6
+
7
+ # Check
8
+
9
+ Verify implementation progress by inspecting source code against a story's plan.
10
+
11
+ ## Triggers
12
+
13
+ Activate this skill when the user wants to:
14
+ - Verify if planned tasks have been implemented
15
+ - Check progress on a story
16
+ - Update task checkboxes based on current code state
17
+ - Get a status report on implementation progress
18
+
19
+ ## Rules
20
+
21
+ 1. Do NOT modify source code — this is a **read-only verification** skill.
22
+ 2. Do NOT modify `story.md` or `feature.md`.
23
+ 3. Only modify `plan.md` to toggle task checkboxes and add brief inline notes.
24
+ 4. Be **conservative** — only mark a task complete if there is clear evidence in the code.
25
+ 5. If a task is partially done, leave it unchecked and note what's missing.
26
+
27
+ ## Steps
28
+
29
+ 1. **Read the plan** — Load `.spec/features/<feature>/<story>/plan.md`.
30
+ 2. **Read the story** — Load `story.md` to understand acceptance criteria context.
31
+ 3. **Verify each task** — For each task in the plan:
32
+ - Search the codebase for the specific files, functions, routes, components, or tests mentioned.
33
+ - Evaluate whether the implementation satisfies the task's intent, not just that a file exists.
34
+ 4. **Update plan.md** — Toggle checkboxes:
35
+ - Completed: `- [ ]` → `- [x]`
36
+ - Regressed (removed/broken): `- [x]` → `- [ ]`
37
+ - Uncertain: leave unchecked, add a note.
38
+ 5. **Report summary** — Present results to the user.
39
+
40
+ ## Output
41
+
42
+ See [output template](./assets/output.md).
@@ -0,0 +1,13 @@
1
+ After updating `plan.md`, print a summary:
2
+
3
+ ```
4
+ ## Check Summary: <Story Title>
5
+
6
+ Progress: X/Y tasks complete
7
+
8
+ ### Completed
9
+ - ✅ Task description
10
+
11
+ ### Remaining
12
+ - ⬜ Task description — (reason or what's missing)
13
+ ```
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: speci5.plan
3
+ description: "Read a story spec and create a concrete implementation plan with tasks in .spec/features/<feature>/<story>/plan.md. Analyzes the codebase to produce specific, actionable tasks with file paths and function names. WHEN: /plan, create plan, plan story, break down story, implementation tasks, plan implementation, what to build. DO NOT USE FOR: brainstorming ideas (use brainstorm), writing specs (use specify), checking implementation (use check)."
4
+ argument-hint: "Path to the story folder, e.g. .spec/features/user-auth/login-with-email"
5
+ ---
6
+
7
+ # Plan
8
+
9
+ Read a story spec and create a concrete implementation plan with tasks.
10
+
11
+ ## Triggers
12
+
13
+ Activate this skill when the user wants to:
14
+ - Create an implementation plan for a story
15
+ - Break a story into concrete development tasks
16
+ - Understand what needs to be built for a story
17
+ - Update an existing plan with revised tasks
18
+
19
+ ## Rules
20
+
21
+ 1. Tasks must be **specific and actionable** — not vague ("implement feature") but concrete ("Create `POST /api/auth/login` route in `src/routes/auth.ts`").
22
+ 2. Include tasks for tests where the story's acceptance criteria warrant them.
23
+ 3. If a `plan.md` already exists, update it — preserve any checked-off tasks and add/revise remaining ones.
24
+ 4. Do NOT modify `story.md` or `feature.md` — those are the **specify** skill's domain.
25
+ 5. Do NOT implement the code — only produce the plan.
26
+
27
+ ## Steps
28
+
29
+ 1. **Read the story** — Load `.spec/features/<feature>/<story>/story.md`.
30
+ 2. **Read the feature** — Load the parent `feature.md` for broader context.
31
+ 3. **Analyze the codebase** — Understand:
32
+ - Project structure, tech stack, and conventions.
33
+ - What related code already exists.
34
+ - Where new code should be placed.
35
+ 4. **Break down tasks** — Convert acceptance criteria into ordered, actionable implementation tasks with specific file paths and module names.
36
+ 5. **Write the plan** — Save to `.spec/features/<feature>/<story>/plan.md`.
37
+
38
+ ## Output Format
39
+
40
+ See [output template](./assets/output.md).
@@ -0,0 +1,13 @@
1
+ Write to `.spec/features/<feature>/<story>/plan.md`:
2
+
3
+ ```markdown
4
+ # Plan: <Story Title>
5
+
6
+ ## Context
7
+ Brief summary of what this plan implements and any technical decisions.
8
+
9
+ ## Tasks
10
+ - [ ] Task 1 — description with specifics (file paths, function names, etc.)
11
+ - [ ] Task 2 — description
12
+ - [ ] Task 3 — description
13
+ ```
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: speci5.specify
3
+ description: "Transform idea documents from .spec/ideas/ into structured feature and story specs in .spec/features/. Creates feature.md and story.md files organized by feature folders and story subfolders. WHEN: /specify, write spec, create spec, turn idea into spec, specify feature, define stories, break down feature, structure requirements. DO NOT USE FOR: brainstorming ideas (use brainstorm), creating plans (use plan), checking implementation (use check)."
4
+ argument-hint: "Name the idea(s) to specify, or leave blank to process all ideas"
5
+ ---
6
+
7
+ # Specify
8
+
9
+ Transform idea documents into structured feature and story specs.
10
+
11
+ ## Triggers
12
+
13
+ Activate this skill when the user wants to:
14
+ - Convert ideas into formal feature/story specifications
15
+ - Break a feature down into deliverable stories
16
+ - Create or update feature and story specs
17
+ - Structure requirements from idea documents
18
+
19
+ ## Rules
20
+
21
+ 1. Use **kebab-case** for all folder and file names.
22
+ 2. Each story must have concrete, testable acceptance criteria.
23
+ 3. Stories should be small enough to implement in a single focused effort.
24
+ 4. Do NOT create `plan.md` files — that's the **plan** skill's job.
25
+ 5. Link stories in `feature.md` using relative paths.
26
+ 6. If features/stories already exist, update them — do not overwrite human edits.
27
+ 7. Present the proposed feature/story breakdown to the user for confirmation before writing files.
28
+
29
+ ## Steps
30
+
31
+ 1. **Read ideas** — Read the specified idea file(s) from `.spec/ideas/`. If none specified, read all.
32
+ 2. **Read existing specs** — Scan `.spec/features/` to avoid duplicating or conflicting with what's already specified.
33
+ 3. **Synthesize** — Break ideas into **features** (cohesive capabilities) and **stories** (independently deliverable slices of a feature).
34
+ 4. **Propose** — Present the feature/story breakdown to the user for confirmation.
35
+ 5. **Write specs** — For each feature, create a folder with `feature.md`. For each story, create a subfolder with `story.md`.
36
+
37
+ ## Folder Structure
38
+
39
+ ```
40
+ .spec/features/
41
+ <feature-slug>/
42
+ feature.md
43
+ <story-slug>/
44
+ story.md
45
+ ```
46
+
47
+ ## Output Formats
48
+
49
+ See [output templates](./assets/output.md).
@@ -0,0 +1,34 @@
1
+ ## feature.md
2
+
3
+ Write to `.spec/features/<feature-slug>/feature.md`:
4
+
5
+ ```markdown
6
+ # Feature: <Feature Title>
7
+
8
+ ## Overview
9
+ What this feature is and why it matters.
10
+
11
+ ## Goals
12
+ - Goal 1
13
+ - Goal 2
14
+
15
+ ## Stories
16
+ - [<story-title>](<story-slug>/)
17
+ - [<story-title>](<story-slug>/)
18
+ ```
19
+
20
+ ## story.md
21
+
22
+ Write to `.spec/features/<feature-slug>/<story-slug>/story.md`:
23
+
24
+ ```markdown
25
+ # Story: <Story Title>
26
+
27
+ ## Description
28
+ As a <role>, I can <action> so that <benefit>.
29
+
30
+ ## Acceptance Criteria
31
+ - [ ] Criterion 1
32
+ - [ ] Criterion 2
33
+ - [ ] Criterion 3
34
+ ```