kspec 1.0.24 → 1.0.26
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 +107 -11
- package/package.json +1 -1
- package/src/index.js +91 -9
package/README.md
CHANGED
|
@@ -5,6 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
Spec-driven development workflow for Kiro CLI with context management, verification at every step, and Jira integration.
|
|
7
7
|
|
|
8
|
+
## Why kspec?
|
|
9
|
+
|
|
10
|
+
AI coding assistants forget context, drift from requirements, and repeat mistakes. kspec solves this:
|
|
11
|
+
|
|
12
|
+
| Problem | kspec Solution |
|
|
13
|
+
|---------|---------------|
|
|
14
|
+
| **Context loss** | `CONTEXT.md` survives AI context compression |
|
|
15
|
+
| **Scope creep** | Specs define boundaries before coding |
|
|
16
|
+
| **No verification** | Verify at every step (spec → tasks → build) |
|
|
17
|
+
| **Lost learnings** | `memory.md` compounds knowledge across projects |
|
|
18
|
+
| **Enterprise silos** | Jira integration bridges BA/PM and developers |
|
|
19
|
+
|
|
20
|
+
Read the full [Methodology](docs/methodology.md) or see a complete [Example Walkthrough](docs/examples/todo-app/).
|
|
21
|
+
|
|
8
22
|
## Installation
|
|
9
23
|
|
|
10
24
|
```bash
|
|
@@ -130,23 +144,85 @@ Switch agents in kiro-cli: `/agent swap kspec-build` or use keyboard shortcuts.
|
|
|
130
144
|
|
|
131
145
|
```
|
|
132
146
|
.kspec/
|
|
133
|
-
├── config.json # User preferences
|
|
134
|
-
├── .current # Current active spec path
|
|
135
|
-
├── CONTEXT.md # Auto-generated context
|
|
136
|
-
├── memory.md # Project learnings
|
|
147
|
+
├── config.json # User preferences (commit)
|
|
148
|
+
├── .current # Current active spec path (local only)
|
|
149
|
+
├── CONTEXT.md # Auto-generated context (local only)
|
|
150
|
+
├── memory.md # Project learnings (commit)
|
|
137
151
|
└── specs/
|
|
138
152
|
└── 2026-01-22-feature/
|
|
139
|
-
├── spec.md # Full specification
|
|
153
|
+
├── spec.md # Full specification (commit)
|
|
140
154
|
├── spec-lite.md # Concise (for context compression)
|
|
141
|
-
├── tasks.md # Implementation tasks
|
|
142
|
-
├── memory.md # Feature learnings
|
|
143
|
-
└── jira-links.json # Jira issue links (
|
|
155
|
+
├── tasks.md # Implementation tasks (commit)
|
|
156
|
+
├── memory.md # Feature learnings (commit)
|
|
157
|
+
└── jira-links.json # Jira issue links (commit)
|
|
144
158
|
|
|
145
159
|
.kiro/
|
|
146
|
-
├── steering/ # Project rules (
|
|
147
|
-
|
|
160
|
+
├── steering/ # Project rules (commit)
|
|
161
|
+
├── agents/ # kspec-generated agents (commit)
|
|
162
|
+
└── mcp.json.template # MCP config template (commit, no secrets)
|
|
148
163
|
```
|
|
149
164
|
|
|
165
|
+
## Team Collaboration
|
|
166
|
+
|
|
167
|
+
kspec is designed for team collaboration. Most files should be committed to share specifications, tasks, and guidelines across your team.
|
|
168
|
+
|
|
169
|
+
### What to Commit
|
|
170
|
+
|
|
171
|
+
| Path | Commit? | Why |
|
|
172
|
+
|------|---------|-----|
|
|
173
|
+
| `.kiro/steering/` | Yes | Shared product, tech, testing guidelines |
|
|
174
|
+
| `.kiro/agents/` | Yes | Consistent agent configurations |
|
|
175
|
+
| `.kiro/mcp.json.template` | Yes | MCP setup template (no secrets) |
|
|
176
|
+
| `.kspec/config.json` | Yes | Project preferences |
|
|
177
|
+
| `.kspec/specs/` | Yes | Specifications, tasks, memory |
|
|
178
|
+
| `.kspec/.current` | No | Personal working state |
|
|
179
|
+
| `.kspec/CONTEXT.md` | No | Auto-generated, local state |
|
|
180
|
+
| `~/.kiro/mcp.json` | N/A | Personal secrets in home directory |
|
|
181
|
+
|
|
182
|
+
### Setting Up MCP for Teams
|
|
183
|
+
|
|
184
|
+
**Problem**: API tokens should never be committed, but teams need consistent MCP configuration.
|
|
185
|
+
|
|
186
|
+
**Solution**: Use environment variables with a committed template.
|
|
187
|
+
|
|
188
|
+
1. Commit a template file (`.kiro/mcp.json.template`):
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"mcpServers": {
|
|
192
|
+
"atlassian": {
|
|
193
|
+
"command": "npx",
|
|
194
|
+
"args": ["-y", "@anthropic/mcp-atlassian"],
|
|
195
|
+
"env": {
|
|
196
|
+
"ATLASSIAN_HOST": "${ATLASSIAN_HOST}",
|
|
197
|
+
"ATLASSIAN_EMAIL": "${ATLASSIAN_EMAIL}",
|
|
198
|
+
"ATLASSIAN_API_TOKEN": "${ATLASSIAN_API_TOKEN}"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
2. Each team member creates their personal config:
|
|
206
|
+
```bash
|
|
207
|
+
# Copy template to home directory
|
|
208
|
+
mkdir -p ~/.kiro && chmod 700 ~/.kiro
|
|
209
|
+
cp .kiro/mcp.json.template ~/.kiro/mcp.json
|
|
210
|
+
chmod 600 ~/.kiro/mcp.json
|
|
211
|
+
|
|
212
|
+
# Edit with real credentials
|
|
213
|
+
nano ~/.kiro/mcp.json
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
3. Or use environment variables directly:
|
|
217
|
+
```bash
|
|
218
|
+
# Add to ~/.bashrc or ~/.zshrc
|
|
219
|
+
export ATLASSIAN_HOST="https://your-domain.atlassian.net"
|
|
220
|
+
export ATLASSIAN_EMAIL="your-email@example.com"
|
|
221
|
+
export ATLASSIAN_API_TOKEN="your-api-token"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
See [SECURITY.md](SECURITY.md) for detailed security best practices.
|
|
225
|
+
|
|
150
226
|
## Jira Integration
|
|
151
227
|
|
|
152
228
|
Bridge the gap between BAs/PMs and developers by integrating with Jira via Atlassian MCP.
|
|
@@ -178,7 +254,19 @@ Generate Jira subtasks from tasks.md for progress tracking.
|
|
|
178
254
|
|
|
179
255
|
### Prerequisites
|
|
180
256
|
|
|
181
|
-
|
|
257
|
+
`kspec init` creates `.kiro/mcp.json.template` automatically. To enable Jira integration:
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
# Copy template to your home directory (keeps secrets out of repo)
|
|
261
|
+
mkdir -p ~/.kiro && chmod 700 ~/.kiro
|
|
262
|
+
cp .kiro/mcp.json.template ~/.kiro/mcp.json
|
|
263
|
+
chmod 600 ~/.kiro/mcp.json
|
|
264
|
+
|
|
265
|
+
# Edit with your real credentials
|
|
266
|
+
nano ~/.kiro/mcp.json
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Replace the `${...}` placeholders with your actual values:
|
|
182
270
|
|
|
183
271
|
```json
|
|
184
272
|
{
|
|
@@ -198,6 +286,8 @@ Configure Atlassian MCP in `~/.kiro/mcp.json`:
|
|
|
198
286
|
|
|
199
287
|
Get your API token: https://id.atlassian.com/manage-profile/security/api-tokens
|
|
200
288
|
|
|
289
|
+
See [Team Collaboration](#team-collaboration) for secure team setup with environment variables.
|
|
290
|
+
|
|
201
291
|
## Configuration
|
|
202
292
|
|
|
203
293
|
Set during `kspec init`:
|
|
@@ -225,6 +315,12 @@ kspec --version
|
|
|
225
315
|
- Kiro CLI or Amazon Q CLI
|
|
226
316
|
- Atlassian MCP (optional, for Jira integration)
|
|
227
317
|
|
|
318
|
+
## Documentation
|
|
319
|
+
|
|
320
|
+
- [Methodology](docs/methodology.md) — Why spec-driven development works
|
|
321
|
+
- [Example: Todo App](docs/examples/todo-app/) — Complete walkthrough with real files
|
|
322
|
+
- [SECURITY.md](SECURITY.md) — Secure MCP configuration and best practices
|
|
323
|
+
|
|
228
324
|
## License
|
|
229
325
|
|
|
230
326
|
MIT
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -661,7 +661,7 @@ WORKFLOW (do this autonomously):
|
|
|
661
661
|
5. Update .kspec/.current with the spec folder path
|
|
662
662
|
6. Update .kspec/CONTEXT.md with current state
|
|
663
663
|
|
|
664
|
-
|
|
664
|
+
Next step: Run \`/agent swap kspec-tasks\` or \`kspec tasks\` to generate implementation tasks.`,
|
|
665
665
|
keyboardShortcut: 'ctrl+shift+s',
|
|
666
666
|
welcomeMessage: 'Ready to create specification. Describe your feature.'
|
|
667
667
|
},
|
|
@@ -693,7 +693,7 @@ WORKFLOW:
|
|
|
693
693
|
|
|
694
694
|
Tasks must be atomic and independently verifiable.
|
|
695
695
|
|
|
696
|
-
|
|
696
|
+
Next step: Run \`/agent swap kspec-build\` or \`kspec build\` to start implementing tasks.`,
|
|
697
697
|
keyboardShortcut: 'ctrl+shift+t',
|
|
698
698
|
welcomeMessage: 'Reading current spec and generating tasks...'
|
|
699
699
|
},
|
|
@@ -730,7 +730,7 @@ CRITICAL:
|
|
|
730
730
|
- NEVER delete .kiro or .kspec folders
|
|
731
731
|
- Use non-interactive flags for commands (--yes, -y)
|
|
732
732
|
|
|
733
|
-
When all tasks complete
|
|
733
|
+
When all tasks complete: Run \`/agent swap kspec-verify\` or \`kspec verify\` to verify implementation.`,
|
|
734
734
|
keyboardShortcut: 'ctrl+shift+b',
|
|
735
735
|
welcomeMessage: 'Reading current task and building...'
|
|
736
736
|
},
|
|
@@ -908,8 +908,56 @@ const commands = {
|
|
|
908
908
|
}
|
|
909
909
|
}
|
|
910
910
|
|
|
911
|
+
// Create MCP template (safe to commit, no secrets)
|
|
912
|
+
const mcpTemplatePath = path.join('.kiro', 'mcp.json.template');
|
|
913
|
+
if (!fs.existsSync(mcpTemplatePath)) {
|
|
914
|
+
ensureDir('.kiro');
|
|
915
|
+
const mcpTemplate = {
|
|
916
|
+
mcpServers: {
|
|
917
|
+
atlassian: {
|
|
918
|
+
command: 'npx',
|
|
919
|
+
args: ['-y', '@anthropic/mcp-atlassian'],
|
|
920
|
+
env: {
|
|
921
|
+
ATLASSIAN_HOST: '${ATLASSIAN_HOST}',
|
|
922
|
+
ATLASSIAN_EMAIL: '${ATLASSIAN_EMAIL}',
|
|
923
|
+
ATLASSIAN_API_TOKEN: '${ATLASSIAN_API_TOKEN}'
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
fs.writeFileSync(mcpTemplatePath, JSON.stringify(mcpTemplate, null, 2));
|
|
929
|
+
log(`Created ${mcpTemplatePath} (commit this, set env vars for secrets)`);
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
// Update .gitignore for kspec (append if exists, create if not)
|
|
933
|
+
const kspecGitignore = `
|
|
934
|
+
# kspec local state (don't commit - personal working state)
|
|
935
|
+
.kspec/.current
|
|
936
|
+
.kspec/CONTEXT.md
|
|
937
|
+
|
|
938
|
+
# DO commit these for team collaboration:
|
|
939
|
+
# .kspec/config.json - project preferences
|
|
940
|
+
# .kspec/specs/ - specifications, tasks, memory
|
|
941
|
+
# .kiro/steering/ - product, tech, testing guidelines
|
|
942
|
+
# .kiro/agents/ - agent configurations
|
|
943
|
+
# .kiro/mcp.json.template - MCP template (no secrets)
|
|
944
|
+
`;
|
|
945
|
+
const gitignorePath = '.gitignore';
|
|
946
|
+
if (fs.existsSync(gitignorePath)) {
|
|
947
|
+
const existing = fs.readFileSync(gitignorePath, 'utf8');
|
|
948
|
+
if (!existing.includes('.kspec/.current')) {
|
|
949
|
+
fs.appendFileSync(gitignorePath, kspecGitignore);
|
|
950
|
+
log('Updated .gitignore with kspec entries');
|
|
951
|
+
}
|
|
952
|
+
} else {
|
|
953
|
+
fs.writeFileSync(gitignorePath, kspecGitignore.trim() + '\n');
|
|
954
|
+
log('Created .gitignore with kspec entries');
|
|
955
|
+
}
|
|
956
|
+
|
|
911
957
|
console.log('\n✅ kspec initialized!\n');
|
|
912
|
-
console.log('Next:
|
|
958
|
+
console.log('Next step:');
|
|
959
|
+
console.log(' kspec analyse');
|
|
960
|
+
console.log(' or inside kiro-cli: /agent swap kspec-analyse\n');
|
|
913
961
|
},
|
|
914
962
|
|
|
915
963
|
async analyse() {
|
|
@@ -992,6 +1040,10 @@ Folder: ${folder}
|
|
|
992
1040
|
|
|
993
1041
|
spec-lite.md is critical - it's loaded after context compression.`, 'kspec-spec');
|
|
994
1042
|
}
|
|
1043
|
+
|
|
1044
|
+
console.log('\nNext step:');
|
|
1045
|
+
console.log(' kspec tasks');
|
|
1046
|
+
console.log(' or inside kiro-cli: /agent swap kspec-tasks\n');
|
|
995
1047
|
},
|
|
996
1048
|
|
|
997
1049
|
async 'verify-spec'(args) {
|
|
@@ -1140,6 +1192,10 @@ Create ${folder}/tasks.md with:
|
|
|
1140
1192
|
- TDD approach (test first)
|
|
1141
1193
|
- Logical order
|
|
1142
1194
|
- File paths for each task`, 'kspec-tasks');
|
|
1195
|
+
|
|
1196
|
+
console.log('\nNext step:');
|
|
1197
|
+
console.log(' kspec build');
|
|
1198
|
+
console.log(' or inside kiro-cli: /agent swap kspec-build\n');
|
|
1143
1199
|
},
|
|
1144
1200
|
|
|
1145
1201
|
async 'verify-tasks'(args) {
|
|
@@ -1172,7 +1228,10 @@ Report: X/Y tasks done, gaps found, coverage assessment.`, 'kspec-verify');
|
|
|
1172
1228
|
log(`Building: ${folder}`);
|
|
1173
1229
|
if (stats) {
|
|
1174
1230
|
if (stats.remaining === 0) {
|
|
1175
|
-
log('All tasks completed!
|
|
1231
|
+
log('All tasks completed!');
|
|
1232
|
+
console.log('\nNext step:');
|
|
1233
|
+
console.log(' kspec verify');
|
|
1234
|
+
console.log(' or inside kiro-cli: /agent swap kspec-verify\n');
|
|
1176
1235
|
return;
|
|
1177
1236
|
}
|
|
1178
1237
|
log(`Progress: ${stats.done}/${stats.total} (${stats.remaining} remaining)`);
|
|
@@ -1197,6 +1256,18 @@ ${execNote}
|
|
|
1197
1256
|
|
|
1198
1257
|
CRITICAL: Update tasks.md after each task completion.
|
|
1199
1258
|
NEVER delete .kiro or .kspec folders.`, 'kspec-build');
|
|
1259
|
+
|
|
1260
|
+
// Show next step based on remaining tasks
|
|
1261
|
+
const updatedStats = getTaskStats(folder);
|
|
1262
|
+
if (updatedStats && updatedStats.remaining === 0) {
|
|
1263
|
+
console.log('\nAll tasks completed!');
|
|
1264
|
+
console.log('Next step:');
|
|
1265
|
+
console.log(' kspec verify');
|
|
1266
|
+
console.log(' or inside kiro-cli: /agent swap kspec-verify\n');
|
|
1267
|
+
} else if (updatedStats && updatedStats.remaining > 0) {
|
|
1268
|
+
console.log(`\n${updatedStats.remaining} tasks remaining.`);
|
|
1269
|
+
console.log('Continue: kspec build\n');
|
|
1270
|
+
}
|
|
1200
1271
|
},
|
|
1201
1272
|
|
|
1202
1273
|
async verify(args) {
|
|
@@ -1222,6 +1293,9 @@ Report:
|
|
|
1222
1293
|
- Tasks: X/Y completed
|
|
1223
1294
|
- Tests: PASS/FAIL
|
|
1224
1295
|
- Gaps: [list any]`, 'kspec-verify');
|
|
1296
|
+
|
|
1297
|
+
console.log('\nIf verification passed:');
|
|
1298
|
+
console.log(' kspec done (to complete spec and harvest learnings)\n');
|
|
1225
1299
|
},
|
|
1226
1300
|
|
|
1227
1301
|
async refresh(args) {
|
|
@@ -1368,15 +1442,23 @@ Output: APPROVE or REQUEST_CHANGES with specifics.`, 'kspec-review');
|
|
|
1368
1442
|
if (stats) {
|
|
1369
1443
|
console.log(`Tasks: ${stats.done}/${stats.total} completed`);
|
|
1370
1444
|
if (stats.remaining > 0) {
|
|
1371
|
-
console.log(`\nNext
|
|
1445
|
+
console.log(`\nNext step:`);
|
|
1446
|
+
console.log(` kspec build`);
|
|
1447
|
+
console.log(` or inside kiro-cli: /agent swap kspec-build`);
|
|
1372
1448
|
} else {
|
|
1373
|
-
console.log(`\nNext
|
|
1449
|
+
console.log(`\nNext step:`);
|
|
1450
|
+
console.log(` kspec verify`);
|
|
1451
|
+
console.log(` or inside kiro-cli: /agent swap kspec-verify`);
|
|
1374
1452
|
}
|
|
1375
1453
|
} else {
|
|
1376
|
-
console.log(`\nNext
|
|
1454
|
+
console.log(`\nNext step:`);
|
|
1455
|
+
console.log(` kspec tasks`);
|
|
1456
|
+
console.log(` or inside kiro-cli: /agent swap kspec-tasks`);
|
|
1377
1457
|
}
|
|
1378
1458
|
} else {
|
|
1379
|
-
console.log(`\nNo current spec
|
|
1459
|
+
console.log(`\nNo current spec.`);
|
|
1460
|
+
console.log(` kspec spec "Feature Name"`);
|
|
1461
|
+
console.log(` or inside kiro-cli: /agent swap kspec-spec`);
|
|
1380
1462
|
}
|
|
1381
1463
|
console.log('');
|
|
1382
1464
|
},
|