@anthropologies/claudestory 0.1.42 → 0.1.44
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/dist/cli.js +20 -13
- package/dist/index.d.ts +42 -42
- package/dist/mcp.js +2 -2
- package/package.json +1 -1
- package/src/skill/SKILL.md +40 -226
- package/src/skill/autonomous-mode.md +65 -0
- package/src/skill/setup-flow.md +581 -0
package/dist/cli.js
CHANGED
|
@@ -8358,7 +8358,7 @@ function getInstalledVersion() {
|
|
|
8358
8358
|
}
|
|
8359
8359
|
}
|
|
8360
8360
|
function getRunningVersion() {
|
|
8361
|
-
return "0.1.
|
|
8361
|
+
return "0.1.44";
|
|
8362
8362
|
}
|
|
8363
8363
|
var init_version_check = __esm({
|
|
8364
8364
|
"src/autonomous/version-check.ts"() {
|
|
@@ -10923,7 +10923,7 @@ var init_mcp = __esm({
|
|
|
10923
10923
|
init_init();
|
|
10924
10924
|
ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
|
|
10925
10925
|
CONFIG_PATH2 = ".story/config.json";
|
|
10926
|
-
version = "0.1.
|
|
10926
|
+
version = "0.1.44";
|
|
10927
10927
|
main().catch((err) => {
|
|
10928
10928
|
process.stderr.write(`Fatal: ${err instanceof Error ? err.message : String(err)}
|
|
10929
10929
|
`);
|
|
@@ -11727,18 +11727,25 @@ async function handleSetupSkill(options = {}) {
|
|
|
11727
11727
|
const existed = existsSync12(join21(skillDir, "SKILL.md"));
|
|
11728
11728
|
const skillContent = await readFile5(join21(srcSkillDir, "SKILL.md"), "utf-8");
|
|
11729
11729
|
await writeFile3(join21(skillDir, "SKILL.md"), skillContent, "utf-8");
|
|
11730
|
-
|
|
11731
|
-
const
|
|
11732
|
-
|
|
11733
|
-
|
|
11734
|
-
|
|
11735
|
-
|
|
11730
|
+
const supportFiles = ["setup-flow.md", "autonomous-mode.md", "reference.md"];
|
|
11731
|
+
const writtenFiles = ["SKILL.md"];
|
|
11732
|
+
const missingFiles = [];
|
|
11733
|
+
for (const filename of supportFiles) {
|
|
11734
|
+
const srcPath = join21(srcSkillDir, filename);
|
|
11735
|
+
if (existsSync12(srcPath)) {
|
|
11736
|
+
const content = await readFile5(srcPath, "utf-8");
|
|
11737
|
+
await writeFile3(join21(skillDir, filename), content, "utf-8");
|
|
11738
|
+
writtenFiles.push(filename);
|
|
11739
|
+
} else {
|
|
11740
|
+
missingFiles.push(filename);
|
|
11741
|
+
}
|
|
11736
11742
|
}
|
|
11737
11743
|
log(`${existed ? "Updated" : "Installed"} /story skill at ${skillDir}/`);
|
|
11738
|
-
|
|
11739
|
-
|
|
11740
|
-
|
|
11741
|
-
|
|
11744
|
+
log(` ${writtenFiles.join(" + ")} written`);
|
|
11745
|
+
if (missingFiles.length > 0) {
|
|
11746
|
+
process.stderr.write(`Warning: support file(s) not found in source: ${missingFiles.join(", ")}
|
|
11747
|
+
`);
|
|
11748
|
+
process.stderr.write(" This may indicate a corrupt installation. Try: npm install -g @anthropologies/claudestory\n");
|
|
11742
11749
|
}
|
|
11743
11750
|
let mcpRegistered = false;
|
|
11744
11751
|
let cliInPath = false;
|
|
@@ -14347,7 +14354,7 @@ async function runCli() {
|
|
|
14347
14354
|
registerSessionCommand: registerSessionCommand2,
|
|
14348
14355
|
registerRepairCommand: registerRepairCommand2
|
|
14349
14356
|
} = await Promise.resolve().then(() => (init_register(), register_exports));
|
|
14350
|
-
const version2 = "0.1.
|
|
14357
|
+
const version2 = "0.1.44";
|
|
14351
14358
|
class HandledError extends Error {
|
|
14352
14359
|
constructor() {
|
|
14353
14360
|
super("HANDLED_ERROR");
|
package/dist/index.d.ts
CHANGED
|
@@ -1377,15 +1377,42 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1377
1377
|
file: z.ZodString;
|
|
1378
1378
|
message: z.ZodString;
|
|
1379
1379
|
}, "strip", z.ZodTypeAny, {
|
|
1380
|
-
message: string;
|
|
1381
1380
|
type: string;
|
|
1381
|
+
message: string;
|
|
1382
1382
|
file: string;
|
|
1383
1383
|
}, {
|
|
1384
|
-
message: string;
|
|
1385
1384
|
type: string;
|
|
1385
|
+
message: string;
|
|
1386
1386
|
file: string;
|
|
1387
1387
|
}>, "many">>;
|
|
1388
1388
|
}, "strip", z.ZodTypeAny, {
|
|
1389
|
+
version: 1;
|
|
1390
|
+
config: {
|
|
1391
|
+
version: number;
|
|
1392
|
+
type: string;
|
|
1393
|
+
language: string;
|
|
1394
|
+
project: string;
|
|
1395
|
+
features: {
|
|
1396
|
+
issues: boolean;
|
|
1397
|
+
tickets: boolean;
|
|
1398
|
+
handovers: boolean;
|
|
1399
|
+
roadmap: boolean;
|
|
1400
|
+
reviews: boolean;
|
|
1401
|
+
} & {
|
|
1402
|
+
[k: string]: unknown;
|
|
1403
|
+
};
|
|
1404
|
+
schemaVersion?: number | undefined;
|
|
1405
|
+
recipe?: string | undefined;
|
|
1406
|
+
recipeOverrides?: {
|
|
1407
|
+
maxTicketsPerSession?: number | undefined;
|
|
1408
|
+
compactThreshold?: string | undefined;
|
|
1409
|
+
reviewBackends?: string[] | undefined;
|
|
1410
|
+
handoverInterval?: number | undefined;
|
|
1411
|
+
stages?: Record<string, Record<string, unknown>> | undefined;
|
|
1412
|
+
} | undefined;
|
|
1413
|
+
} & {
|
|
1414
|
+
[k: string]: unknown;
|
|
1415
|
+
};
|
|
1389
1416
|
issues: z.objectOutputType<{
|
|
1390
1417
|
id: z.ZodString;
|
|
1391
1418
|
title: z.ZodString;
|
|
@@ -1422,8 +1449,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1422
1449
|
claimedBySession: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1423
1450
|
}, z.ZodTypeAny, "passthrough">[];
|
|
1424
1451
|
roadmap: {
|
|
1425
|
-
title: string;
|
|
1426
1452
|
date: string;
|
|
1453
|
+
title: string;
|
|
1427
1454
|
phases: z.objectOutputType<{
|
|
1428
1455
|
id: z.ZodString;
|
|
1429
1456
|
label: z.ZodString;
|
|
@@ -1441,7 +1468,6 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1441
1468
|
} & {
|
|
1442
1469
|
[k: string]: unknown;
|
|
1443
1470
|
};
|
|
1444
|
-
version: 1;
|
|
1445
1471
|
project: string;
|
|
1446
1472
|
notes: z.objectOutputType<{
|
|
1447
1473
|
id: z.ZodString;
|
|
@@ -1467,11 +1493,19 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1467
1493
|
status: z.ZodEnum<["active", "deprecated", "superseded"]>;
|
|
1468
1494
|
}, z.ZodTypeAny, "passthrough">[];
|
|
1469
1495
|
createdAt: string;
|
|
1470
|
-
|
|
1496
|
+
handoverFilenames: string[];
|
|
1497
|
+
warnings?: {
|
|
1471
1498
|
type: string;
|
|
1499
|
+
message: string;
|
|
1500
|
+
file: string;
|
|
1501
|
+
}[] | undefined;
|
|
1502
|
+
}, {
|
|
1503
|
+
version: 1;
|
|
1504
|
+
config: {
|
|
1472
1505
|
version: number;
|
|
1473
|
-
|
|
1506
|
+
type: string;
|
|
1474
1507
|
language: string;
|
|
1508
|
+
project: string;
|
|
1475
1509
|
features: {
|
|
1476
1510
|
issues: boolean;
|
|
1477
1511
|
tickets: boolean;
|
|
@@ -1493,13 +1527,6 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1493
1527
|
} & {
|
|
1494
1528
|
[k: string]: unknown;
|
|
1495
1529
|
};
|
|
1496
|
-
handoverFilenames: string[];
|
|
1497
|
-
warnings?: {
|
|
1498
|
-
message: string;
|
|
1499
|
-
type: string;
|
|
1500
|
-
file: string;
|
|
1501
|
-
}[] | undefined;
|
|
1502
|
-
}, {
|
|
1503
1530
|
issues: z.objectInputType<{
|
|
1504
1531
|
id: z.ZodString;
|
|
1505
1532
|
title: z.ZodString;
|
|
@@ -1536,8 +1563,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1536
1563
|
claimedBySession: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
1537
1564
|
}, z.ZodTypeAny, "passthrough">[];
|
|
1538
1565
|
roadmap: {
|
|
1539
|
-
title: string;
|
|
1540
1566
|
date: string;
|
|
1567
|
+
title: string;
|
|
1541
1568
|
phases: z.objectInputType<{
|
|
1542
1569
|
id: z.ZodString;
|
|
1543
1570
|
label: z.ZodString;
|
|
@@ -1555,35 +1582,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1555
1582
|
} & {
|
|
1556
1583
|
[k: string]: unknown;
|
|
1557
1584
|
};
|
|
1558
|
-
version: 1;
|
|
1559
1585
|
project: string;
|
|
1560
1586
|
createdAt: string;
|
|
1561
|
-
config: {
|
|
1562
|
-
type: string;
|
|
1563
|
-
version: number;
|
|
1564
|
-
project: string;
|
|
1565
|
-
language: string;
|
|
1566
|
-
features: {
|
|
1567
|
-
issues: boolean;
|
|
1568
|
-
tickets: boolean;
|
|
1569
|
-
handovers: boolean;
|
|
1570
|
-
roadmap: boolean;
|
|
1571
|
-
reviews: boolean;
|
|
1572
|
-
} & {
|
|
1573
|
-
[k: string]: unknown;
|
|
1574
|
-
};
|
|
1575
|
-
schemaVersion?: number | undefined;
|
|
1576
|
-
recipe?: string | undefined;
|
|
1577
|
-
recipeOverrides?: {
|
|
1578
|
-
maxTicketsPerSession?: number | undefined;
|
|
1579
|
-
compactThreshold?: string | undefined;
|
|
1580
|
-
reviewBackends?: string[] | undefined;
|
|
1581
|
-
handoverInterval?: number | undefined;
|
|
1582
|
-
stages?: Record<string, Record<string, unknown>> | undefined;
|
|
1583
|
-
} | undefined;
|
|
1584
|
-
} & {
|
|
1585
|
-
[k: string]: unknown;
|
|
1586
|
-
};
|
|
1587
1587
|
notes?: z.objectInputType<{
|
|
1588
1588
|
id: z.ZodString;
|
|
1589
1589
|
title: z.ZodNullable<z.ZodString>;
|
|
@@ -1608,8 +1608,8 @@ declare const SnapshotV1Schema: z.ZodObject<{
|
|
|
1608
1608
|
status: z.ZodEnum<["active", "deprecated", "superseded"]>;
|
|
1609
1609
|
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
1610
1610
|
warnings?: {
|
|
1611
|
-
message: string;
|
|
1612
1611
|
type: string;
|
|
1612
|
+
message: string;
|
|
1613
1613
|
file: string;
|
|
1614
1614
|
}[] | undefined;
|
|
1615
1615
|
handoverFilenames?: string[] | undefined;
|
package/dist/mcp.js
CHANGED
|
@@ -7816,7 +7816,7 @@ function getInstalledVersion() {
|
|
|
7816
7816
|
}
|
|
7817
7817
|
}
|
|
7818
7818
|
function getRunningVersion() {
|
|
7819
|
-
return "0.1.
|
|
7819
|
+
return "0.1.44";
|
|
7820
7820
|
}
|
|
7821
7821
|
|
|
7822
7822
|
// src/autonomous/guide.ts
|
|
@@ -10055,7 +10055,7 @@ async function ensureGitignoreEntries(gitignorePath, entries) {
|
|
|
10055
10055
|
// src/mcp/index.ts
|
|
10056
10056
|
var ENV_VAR2 = "CLAUDESTORY_PROJECT_ROOT";
|
|
10057
10057
|
var CONFIG_PATH2 = ".story/config.json";
|
|
10058
|
-
var version = "0.1.
|
|
10058
|
+
var version = "0.1.44";
|
|
10059
10059
|
function tryDiscoverRoot() {
|
|
10060
10060
|
const envRoot = process.env[ENV_VAR2];
|
|
10061
10061
|
if (envRoot) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anthropologies/claudestory",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.44",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Cross-session context persistence for AI coding projects. Tracks tickets, issues, roadmap, and handovers so every session builds on the last.",
|
|
6
6
|
"keywords": [
|
package/src/skill/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: story
|
|
|
3
3
|
description: Cross-session context persistence for AI coding projects. Load project context, manage sessions, guide setup.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /story
|
|
6
|
+
# /story -- Project Context & Session Management
|
|
7
7
|
|
|
8
8
|
claudestory tracks tickets, issues, roadmap, and handovers in a `.story/` directory so every AI coding session builds on the last instead of starting from zero.
|
|
9
9
|
|
|
@@ -11,16 +11,16 @@ claudestory tracks tickets, issues, roadmap, and handovers in a `.story/` direct
|
|
|
11
11
|
|
|
12
12
|
`/story` is one smart command. Parse the user's intent from context:
|
|
13
13
|
|
|
14
|
-
- `/story`
|
|
15
|
-
- `/story auto`
|
|
16
|
-
- `/story review T-XXX`
|
|
17
|
-
- `/story plan T-XXX`
|
|
18
|
-
- `/story guided T-XXX`
|
|
19
|
-
- `/story handover`
|
|
20
|
-
- `/story snapshot`
|
|
21
|
-
- `/story export`
|
|
22
|
-
- `/story status`
|
|
23
|
-
- `/story help`
|
|
14
|
+
- `/story` -> full context load (default, see Step 2 below)
|
|
15
|
+
- `/story auto` -> start autonomous mode (read `autonomous-mode.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
16
|
+
- `/story review T-XXX` -> start review mode for a ticket (read `autonomous-mode.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
17
|
+
- `/story plan T-XXX` -> start plan mode for a ticket (read `autonomous-mode.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
18
|
+
- `/story guided T-XXX` -> start guided mode for a ticket (read `autonomous-mode.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
19
|
+
- `/story handover` -> draft a session handover. Summarize the session's work, then call `claudestory_handover_create` with the drafted content and a descriptive slug
|
|
20
|
+
- `/story snapshot` -> save project state (call `claudestory_snapshot` MCP tool)
|
|
21
|
+
- `/story export` -> export project for sharing. Ask the user whether to export the current phase or the full project, then call `claudestory_export` with either `phase` or `all` set
|
|
22
|
+
- `/story status` -> quick status check (call `claudestory_status` MCP tool)
|
|
23
|
+
- `/story help` -> show all capabilities (read `reference.md` in the same directory as this skill file; if not found, tell user to run `claudestory setup-skill`)
|
|
24
24
|
|
|
25
25
|
If the user's intent doesn't match any of these, use the full context load.
|
|
26
26
|
|
|
@@ -28,13 +28,13 @@ If the user's intent doesn't match any of these, use the full context load.
|
|
|
28
28
|
|
|
29
29
|
Check if the claudestory MCP tools are available by looking for `claudestory_status` in your available tools.
|
|
30
30
|
|
|
31
|
-
**If MCP tools ARE available**
|
|
31
|
+
**If MCP tools ARE available** -> proceed to Step 1.
|
|
32
32
|
|
|
33
33
|
**If MCP tools are NOT available:**
|
|
34
34
|
|
|
35
35
|
1. Check if the `claudestory` CLI is installed: run `claudestory --version` via Bash
|
|
36
36
|
2. If NOT installed:
|
|
37
|
-
- Check `node --version` and `npm --version`
|
|
37
|
+
- Check `node --version` and `npm --version` -- both must be available
|
|
38
38
|
- If Node.js is missing, tell the user to install Node.js 20+ first
|
|
39
39
|
- Otherwise, with user permission, run: `npm install -g @anthropologies/claudestory`
|
|
40
40
|
- Then run: `claude mcp add claudestory -s user -- claudestory --mcp`
|
|
@@ -56,156 +56,28 @@ Check if the claudestory MCP tools are available by looking for `claudestory_sta
|
|
|
56
56
|
|
|
57
57
|
## Step 1: Check Project
|
|
58
58
|
|
|
59
|
-
- If `.story/` exists in the current working directory (or a parent)
|
|
60
|
-
- If no `.story/` but project indicators exist (code, manifest, .git)
|
|
61
|
-
- If no `.story/` and no project indicators
|
|
62
|
-
|
|
63
|
-
### AI-Assisted Setup Flow
|
|
64
|
-
|
|
65
|
-
This flow creates a meaningful `.story/` project instead of empty scaffolding. Claude analyzes the project, proposes structure, and creates everything via MCP tools.
|
|
66
|
-
|
|
67
|
-
#### 1a. Detect Project Type
|
|
68
|
-
|
|
69
|
-
Check for project indicators to determine if this is an **existing project** or a **new/empty project**:
|
|
70
|
-
|
|
71
|
-
- `package.json` → npm/node (read `name`, `description`, check for `typescript` dep)
|
|
72
|
-
- `Cargo.toml` → Rust
|
|
73
|
-
- `go.mod` → Go
|
|
74
|
-
- `pyproject.toml` / `requirements.txt` → Python
|
|
75
|
-
- `*.xcodeproj` / `Package.swift` → Swift/macOS
|
|
76
|
-
- `*.sln` / `*.csproj` → C#/.NET
|
|
77
|
-
- `Gemfile` → Ruby
|
|
78
|
-
- `build.gradle.kts` / `build.gradle` → Android/Kotlin/Java (or Spring Boot)
|
|
79
|
-
- `pubspec.yaml` → Flutter/Dart
|
|
80
|
-
- `angular.json` → Angular
|
|
81
|
-
- `svelte.config.js` → SvelteKit
|
|
82
|
-
- `.git/` → has version history
|
|
83
|
-
|
|
84
|
-
If none found (empty or near-empty directory) → skip to **1c. New Project Interview**.
|
|
85
|
-
|
|
86
|
-
#### 1b. Existing Project — Analyze
|
|
87
|
-
|
|
88
|
-
Before diving into analysis, briefly introduce claudestory to the user:
|
|
89
|
-
|
|
90
|
-
"Claude Story tracks your project's roadmap, tickets, issues, and session handovers in a `.story/` directory. Every Claude Code session starts by reading this context, so you never re-explain your project from scratch. Sessions build on each other: decisions, blockers, and lessons carry forward automatically. I'll analyze your project and propose a structure. You can adjust everything before I create anything."
|
|
91
|
-
|
|
92
|
-
Keep it to 3-4 sentences. Not a sales pitch, just enough that the user knows what they're opting into and that they're in control.
|
|
93
|
-
|
|
94
|
-
Read these files to understand the project (skip any that don't exist, skip files > 50KB):
|
|
95
|
-
|
|
96
|
-
1. **README.md** — project description, goals, feature list, roadmap/TODO sections
|
|
97
|
-
2. **Package manifest** — project name, dependencies, scripts
|
|
98
|
-
3. **CLAUDE.md** — existing project spec (if any)
|
|
99
|
-
4. **Top-level directory listing** — identify major components (src/, test/, docs/, etc.)
|
|
100
|
-
5. **Git summary** — `git log --oneline -20` for recent work patterns
|
|
101
|
-
6. **GitHub issues (ask user first)** — `gh issue list --limit 30 --state open --json number,title,labels,body,createdAt`. If gh fails (auth, rate limit, no remote), skip cleanly and note "GitHub import skipped: [reason]"
|
|
102
|
-
|
|
103
|
-
**Framework-specific deep scan** — after detecting the project type in 1a, scan deeper into framework conventions to understand architecture:
|
|
104
|
-
|
|
105
|
-
- **Next.js / Nuxt:** Check `app/` vs `pages/` routing, scan `app/api/` or `pages/api/` for API routes, read `next.config.*` / `nuxt.config.*`, check for middleware.
|
|
106
|
-
- **Express / Fastify / Koa:** Scan for route files (`routes/`, `src/routes/`), look for `router.get/post` patterns, identify service/controller layers.
|
|
107
|
-
- **NestJS:** Read `nest-cli.json`, scan `src/` for `*.module.ts`, check for controllers and services.
|
|
108
|
-
- **React (CRA / Vite) / Vue / Svelte:** Check `src/components/` structure, look for state management imports (redux, zustand, pinia), identify routing setup.
|
|
109
|
-
- **Angular:** Read `angular.json`, scan `src/app/` for modules and components, check for services and guards.
|
|
110
|
-
- **Django / FastAPI / Flask:** Check for `manage.py`, scan for app directories or router files, look at models and migrations.
|
|
111
|
-
- **Spring Boot:** Check `pom.xml` or `build.gradle` for Spring deps, scan `src/main/java` for controller/service/repository layers.
|
|
112
|
-
- **Rust:** Check `Cargo.toml` for workspace members, scan for `mod.rs` / `lib.rs` structure, identify crate types.
|
|
113
|
-
- **Swift / Xcode:** Check `.xcodeproj` or `Package.swift`, identify SwiftUI vs UIKit, scan for targets.
|
|
114
|
-
- **Android (Kotlin/Java):** Check `build.gradle.kts`, scan `app/src/main/` for activity/fragment/composable structure, check `AndroidManifest.xml`, identify Compose vs XML layouts.
|
|
115
|
-
- **Flutter / Dart:** Check `pubspec.yaml`, scan `lib/` for feature folders (models/, screens/, widgets/, services/), check for state management imports (provider, riverpod, bloc).
|
|
116
|
-
- **Go:** Check `go.mod`, scan for `cmd/` and `internal/`/`pkg/`, check for `Makefile`.
|
|
117
|
-
- **Monorepo:** If `packages/`, `apps/`, or workspace config detected, list each package with its purpose before proposing phases.
|
|
118
|
-
- **Other:** Scan `src/` two levels deep and identify dominant patterns (MVC, service layers, feature folders).
|
|
119
|
-
|
|
120
|
-
**Derive project metadata:**
|
|
121
|
-
- **name**: from package manifest `name` field, or directory name
|
|
122
|
-
- **type**: from package manager (npm, cargo, pip, etc.)
|
|
123
|
-
- **language**: from file extensions and manifest
|
|
124
|
-
|
|
125
|
-
**Assess project stage** from the data — don't use fixed thresholds. A project with 3 commits and a half-written README is greenfield. A project with 500+ commits, test suites, and release tags is mature. A project with 200 commits and active PRs is active development. Use your judgment.
|
|
126
|
-
|
|
127
|
-
**Propose 3-7 phases** reflecting the project's actual development trajectory. Examples:
|
|
128
|
-
- Library: setup → core-api → documentation → testing → publishing
|
|
129
|
-
- App: mvp → auth → data-layer → ui-polish → deployment
|
|
130
|
-
- Mid-development project: capture completed work as early phases, then plan forward
|
|
131
|
-
|
|
132
|
-
**Propose initial tickets** per active phase (2-5 each), based on:
|
|
133
|
-
- README TODOs or roadmap sections (treat as hints, not ground truth)
|
|
134
|
-
- GitHub issues if imported — infer from label semantics: bug/defect labels → issues, enhancement/feature labels → tickets
|
|
135
|
-
- Obvious gaps (missing tests, no CI, no docs, etc.)
|
|
136
|
-
- If more than 30 GitHub issues exist, note "Showing 30 of N. Additional issues can be imported later."
|
|
137
|
-
|
|
138
|
-
**Important:** Only mark phases complete if explicitly confirmed by user or docs — do NOT infer completion from git history alone.
|
|
139
|
-
|
|
140
|
-
#### 1c. New Project — Interview
|
|
141
|
-
|
|
142
|
-
Ask the user:
|
|
143
|
-
1. "What are you building?" — project name and purpose
|
|
144
|
-
2. "What's the tech stack?" — language, framework, project type
|
|
145
|
-
3. "What are the major milestones?" — helps define phases
|
|
146
|
-
4. "What's the first thing to build?" — seeds the first ticket
|
|
147
|
-
|
|
148
|
-
Propose phases and initial tickets from the answers.
|
|
149
|
-
|
|
150
|
-
#### 1d. Present Proposal
|
|
151
|
-
|
|
152
|
-
Show the user a structured proposal (table format, not raw JSON):
|
|
153
|
-
- **Project:** name, type, language
|
|
154
|
-
- **Phases** (table: id, name, description)
|
|
155
|
-
- **Tickets per phase** (title, type, status)
|
|
156
|
-
- **Issues** (if GitHub import was used)
|
|
157
|
-
|
|
158
|
-
Before asking for approval, briefly explain what they're looking at:
|
|
159
|
-
|
|
160
|
-
"**How this works:** Phases are milestones in your project's development. They track progress from setup to shipping. Tickets are specific work items within each phase. After setup, typing `/story` at the start of any Claude Code session loads this context automatically. Claude will know your project's state, what was done last session, and what to work on next."
|
|
161
|
-
|
|
162
|
-
Then ask for approval with clear interaction guidance:
|
|
163
|
-
|
|
164
|
-
"Does this look right? You can:
|
|
165
|
-
- Adjust any phase (rename, reorder, add, remove)
|
|
166
|
-
- Change tickets (add, remove, rephrase, move between phases)
|
|
167
|
-
- Mark phases as complete or in-progress
|
|
168
|
-
- Split or merge phases
|
|
169
|
-
|
|
170
|
-
I'll iterate until you're happy, then create everything."
|
|
171
|
-
|
|
172
|
-
#### 1e. Execute on Approval
|
|
173
|
-
|
|
174
|
-
1. Call `claudestory_init` with name, type, language — after this, all MCP tools become available dynamically
|
|
175
|
-
2. Call `claudestory_phase_create` for each phase — first phase with `atStart: true`, subsequent with `after: <previous-phase-id>`
|
|
176
|
-
3. Call `claudestory_ticket_create` for each ticket
|
|
177
|
-
4. Call `claudestory_issue_create` for each imported GitHub issue
|
|
178
|
-
5. Call `claudestory_ticket_update` to mark already-complete tickets as `complete`
|
|
179
|
-
6. Call `claudestory_snapshot` to save initial baseline
|
|
180
|
-
|
|
181
|
-
#### 1f. Post-Setup
|
|
182
|
-
|
|
183
|
-
After creation completes:
|
|
184
|
-
- Confirm what was created (e.g., "Created 5 phases, 12 tickets, and 3 issues")
|
|
185
|
-
- Check if `.gitignore` includes `.story/snapshots/` (warn if missing — snapshots should not be committed)
|
|
186
|
-
- Suggest creating `CLAUDE.md` if it doesn't exist (project spec for AI sessions)
|
|
187
|
-
- Suggest creating `RULES.md` if it doesn't exist (development constraints)
|
|
188
|
-
- Write an initial handover documenting the setup decisions
|
|
189
|
-
- Proceed to Step 2 (Load Context) to show the new project state
|
|
59
|
+
- If `.story/` exists in the current working directory (or a parent) -> proceed to Step 2
|
|
60
|
+
- If no `.story/` but project indicators exist (code, manifest, .git) -> read `setup-flow.md` in the same directory as this skill file and follow the AI-Assisted Setup Flow (if not found, tell user to run `claudestory setup-skill`)
|
|
61
|
+
- If no `.story/` and no project indicators -> explain what claudestory is and suggest navigating to a project
|
|
190
62
|
|
|
191
63
|
## Step 2: Load Context (Default /story Behavior)
|
|
192
64
|
|
|
193
65
|
Call these in order:
|
|
194
66
|
|
|
195
|
-
1. **Project status**
|
|
196
|
-
2. **Session recap**
|
|
197
|
-
3. **Recent handovers**
|
|
198
|
-
4. **Development rules**
|
|
199
|
-
5. **Lessons learned**
|
|
200
|
-
6. **Recent commits**
|
|
67
|
+
1. **Project status** -- call `claudestory_status` MCP tool
|
|
68
|
+
2. **Session recap** -- call `claudestory_recap` MCP tool (shows changes since last snapshot)
|
|
69
|
+
3. **Recent handovers** -- call `claudestory_handover_latest` MCP tool with `count: 3` (last 3 sessions' context -- ensures reasoning behind recent decisions is preserved, not just the latest session's state)
|
|
70
|
+
4. **Development rules** -- read `RULES.md` if it exists in the project root
|
|
71
|
+
5. **Lessons learned** -- call `claudestory_lesson_digest` MCP tool
|
|
72
|
+
6. **Recent commits** -- run `git log --oneline -10`
|
|
201
73
|
|
|
202
74
|
## Step 2b: Empty Scaffold Check
|
|
203
75
|
|
|
204
76
|
After `claudestory_status` returns, check in order:
|
|
205
77
|
|
|
206
|
-
1. **Integrity guard**
|
|
207
|
-
2. **Scaffold detection**
|
|
208
|
-
3. **Empty without code**
|
|
78
|
+
1. **Integrity guard** -- if the response starts with "Warning:" and contains "item(s) skipped due to data integrity issues", this is NOT an empty scaffold. Tell the user to run `claudestory validate`. Continue Step 2/3 normally.
|
|
79
|
+
2. **Scaffold detection** -- check BOTH: output contains "## Getting Started" AND shows `Tickets: 0/0 complete` + `Handovers: 0`. If met AND the project has code indicators (git history, package manifest, source files), read `setup-flow.md` in the same directory as this skill file and follow the AI-Assisted Setup Flow (section 1b). After setup completes, restart Step 2 from the top (the project now has data to load).
|
|
80
|
+
3. **Empty without code** -- if scaffold detected but no code indicators (truly empty directory), continue to Step 3 which will show: "Your project is set up but has no tickets yet. Would you like me to help you create your first phase and tickets?"
|
|
209
81
|
|
|
210
82
|
## Step 3: Present Summary
|
|
211
83
|
|
|
@@ -226,9 +98,9 @@ Then ask: **"What would you like to work on?"**
|
|
|
226
98
|
|
|
227
99
|
- **Snapshots** save project state for diffing. They may be auto-taken before context compaction.
|
|
228
100
|
- **Handovers** are session continuity documents. Create one at the end of significant sessions.
|
|
229
|
-
- **Recaps** show what changed since the last snapshot
|
|
101
|
+
- **Recaps** show what changed since the last snapshot -- useful for understanding drift.
|
|
230
102
|
|
|
231
|
-
**Never modify or overwrite existing handover files.** Handovers are append-only historical records. Always create new handover files
|
|
103
|
+
**Never modify or overwrite existing handover files.** Handovers are append-only historical records. Always create new handover files -- never edit, replace, or write to an existing one. If you need to correct something from a previous session, create a new handover that references the correction. This prevents accidental data loss during sessions.
|
|
232
104
|
|
|
233
105
|
Before writing a handover at the end of a session, run `claudestory snapshot` first. This ensures the next session's recap can show what changed. If `setup-skill` has been run, a PreCompact hook auto-takes snapshots before context compaction.
|
|
234
106
|
|
|
@@ -238,20 +110,20 @@ Before writing a handover at the end of a session, run `claudestory snapshot` fi
|
|
|
238
110
|
- Tool/framework quirks discovered during implementation
|
|
239
111
|
- Process improvements (review workflows, testing strategies)
|
|
240
112
|
|
|
241
|
-
Don't duplicate what's already in the handover
|
|
113
|
+
Don't duplicate what's already in the handover -- lessons are structured, tagged, and ranked. Handovers are narrative. Use `claudestory_lesson_digest` to check existing lessons before creating duplicates. Use `claudestory_lesson_reinforce` when an existing lesson proves true again.
|
|
242
114
|
|
|
243
115
|
## Ticket and Issue Discipline
|
|
244
116
|
|
|
245
|
-
**Tickets** are planned work
|
|
117
|
+
**Tickets** are planned work -- features, tasks, refactors. They represent intentional, scoped commitments.
|
|
246
118
|
|
|
247
119
|
**Ticket types:**
|
|
248
|
-
- `task`
|
|
249
|
-
- `feature`
|
|
250
|
-
- `chore`
|
|
120
|
+
- `task` -- Implementation work: building features, writing code, fixing bugs, refactoring.
|
|
121
|
+
- `feature` -- A user-facing capability or significant new functionality. Larger scope than a task.
|
|
122
|
+
- `chore` -- Maintenance, publishing, documentation, cleanup. No functional change to the product.
|
|
251
123
|
|
|
252
|
-
**Issues** are discovered problems
|
|
124
|
+
**Issues** are discovered problems -- bugs, inconsistencies, gaps, risks found during work. If you're not sure whether something is a ticket or an issue, make it an issue. It can be promoted to a ticket later.
|
|
253
125
|
|
|
254
|
-
When working on a task and you encounter a bug, inconsistency, or improvement opportunity that is out of scope for the current ticket, create an issue using `claudestory issue create` (CLI) with a clear title, severity, and impact description. Don't fix it in the current task, don't ignore it
|
|
126
|
+
When working on a task and you encounter a bug, inconsistency, or improvement opportunity that is out of scope for the current ticket, create an issue using `claudestory issue create` (CLI) with a clear title, severity, and impact description. Don't fix it in the current task, don't ignore it -- log it. This keeps the issue tracker growing organically and ensures nothing discovered during work is lost.
|
|
255
127
|
|
|
256
128
|
When starting work on a ticket, update its status to `inprogress`. When done, update to `complete` in the same commit as the code change.
|
|
257
129
|
|
|
@@ -274,7 +146,7 @@ Read operations (list, get, next, blocked) are available via both CLI and MCP.
|
|
|
274
146
|
|
|
275
147
|
## Notes
|
|
276
148
|
|
|
277
|
-
**Notes** are unstructured brainstorming artifacts
|
|
149
|
+
**Notes** are unstructured brainstorming artifacts -- ideas, design thinking, "what if" explorations. Use notes when the content doesn't fit tickets (planned work) or issues (discovered problems).
|
|
278
150
|
|
|
279
151
|
Create notes via CLI: `claudestory note create --content "..." --tags idea`
|
|
280
152
|
|
|
@@ -282,68 +154,10 @@ Create notes via MCP: `claudestory_note_create` with `content`, optional `title`
|
|
|
282
154
|
|
|
283
155
|
List, get, and update notes via MCP: `claudestory_note_list`, `claudestory_note_get`, `claudestory_note_update`. Delete remains CLI-only: `claudestory note delete <id>`.
|
|
284
156
|
|
|
285
|
-
##
|
|
286
|
-
|
|
287
|
-
`/story auto` starts an autonomous coding session. The guide picks tickets, plans, reviews, implements, and commits — looping until all tickets are done or the session limit is reached.
|
|
288
|
-
|
|
289
|
-
**How it works:**
|
|
290
|
-
|
|
291
|
-
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start" }`
|
|
292
|
-
2. The guide returns an instruction with ticket candidates and exact JSON for the next call
|
|
293
|
-
3. Follow every instruction exactly. Call the guide back after each step.
|
|
294
|
-
4. The guide advances through: PICK_TICKET → PLAN → PLAN_REVIEW → IMPLEMENT → CODE_REVIEW → FINALIZE → COMPLETE → loop
|
|
295
|
-
5. Continue until the guide returns SESSION_END
|
|
296
|
-
|
|
297
|
-
**Critical rules for autonomous mode:**
|
|
298
|
-
- Do NOT use Claude Code's plan mode — write plans as markdown files
|
|
299
|
-
- Do NOT ask the user for confirmation or approval
|
|
300
|
-
- Do NOT stop or summarize between tickets — call the guide IMMEDIATELY
|
|
301
|
-
- Follow the guide's instructions exactly — it specifies which tools to call, what parameters to use
|
|
302
|
-
- After each step completes, call `claudestory_autonomous_guide` with `action: "report"` and the results
|
|
303
|
-
|
|
304
|
-
**If the guide says to compact:** Call `claudestory_autonomous_guide` with `action: "pre_compact"`, then run `/compact`, then call with `action: "resume"`.
|
|
305
|
-
|
|
306
|
-
**If something goes wrong:** Call `claudestory_autonomous_guide` with `action: "cancel"` to cleanly end the session.
|
|
307
|
-
|
|
308
|
-
## Tiered Access — Review, Plan, Guided Modes
|
|
309
|
-
|
|
310
|
-
The autonomous guide supports four execution tiers. Same guide, same handlers, different entry/exit points.
|
|
311
|
-
|
|
312
|
-
### `/story review T-XXX`
|
|
313
|
-
|
|
314
|
-
"I wrote code for T-XXX, review it." Enters at CODE_REVIEW, loops review rounds, exits on approval.
|
|
315
|
-
|
|
316
|
-
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start", "mode": "review", "ticketId": "T-XXX" }`
|
|
317
|
-
2. The guide enters CODE_REVIEW — follow its diff capture and review instructions
|
|
318
|
-
3. On approve: session ends automatically. On revise/reject: fix code, re-review
|
|
319
|
-
4. After approval, you can proceed to commit — the guide does NOT auto-commit in review mode
|
|
320
|
-
|
|
321
|
-
**Note:** Review mode relaxes git constraints — dirty working tree is allowed since the user has code ready for review.
|
|
322
|
-
|
|
323
|
-
### `/story plan T-XXX`
|
|
324
|
-
|
|
325
|
-
"Help me plan T-XXX." Enters at PLAN, runs PLAN_REVIEW rounds, exits on approval.
|
|
326
|
-
|
|
327
|
-
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start", "mode": "plan", "ticketId": "T-XXX" }`
|
|
328
|
-
2. The guide enters PLAN — write the implementation plan as a markdown file
|
|
329
|
-
3. On plan review approve: session ends automatically. On revise/reject: revise plan, re-review
|
|
330
|
-
4. The approved plan is saved in `.story/sessions/<id>/plan.md`
|
|
331
|
-
|
|
332
|
-
### `/story guided T-XXX`
|
|
333
|
-
|
|
334
|
-
"Do T-XXX end to end with review." Full pipeline for a single ticket: PLAN → PLAN_REVIEW → IMPLEMENT → CODE_REVIEW → FINALIZE → COMPLETE → HANDOVER → SESSION_END.
|
|
335
|
-
|
|
336
|
-
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start", "mode": "guided", "ticketId": "T-XXX" }`
|
|
337
|
-
2. Follow every instruction exactly, calling the guide back after each step
|
|
338
|
-
3. Session ends automatically after the single ticket is complete
|
|
339
|
-
|
|
340
|
-
**Guided vs Auto:** Guided mode forces `maxTicketsPerSession: 1` and exits after the ticket. Auto mode loops until all tickets are done or the session limit is reached.
|
|
341
|
-
|
|
342
|
-
### All tiered modes:
|
|
343
|
-
- Require a `ticketId` — no ad-hoc review without a ticket in V1
|
|
344
|
-
- Use the same review process as auto mode (same backends, same adaptive depth)
|
|
345
|
-
- Can be cancelled with `action: "cancel"` at any point
|
|
157
|
+
## Support Files
|
|
346
158
|
|
|
347
|
-
|
|
159
|
+
Additional skill documentation, loaded on demand:
|
|
348
160
|
|
|
349
|
-
|
|
161
|
+
- **`setup-flow.md`** -- Project detection and AI-Assisted Setup Flow (new project initialization)
|
|
162
|
+
- **`autonomous-mode.md`** -- Autonomous mode, review, plan, and guided execution tiers
|
|
163
|
+
- **`reference.md`** -- Full CLI command and MCP tool reference
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Autonomous & Tiered Modes
|
|
2
|
+
|
|
3
|
+
This file is referenced from SKILL.md for `/story auto`, `/story review`, `/story plan`, and `/story guided` commands.
|
|
4
|
+
|
|
5
|
+
## Autonomous Mode
|
|
6
|
+
|
|
7
|
+
`/story auto` starts an autonomous coding session. The guide picks tickets, plans, reviews, implements, and commits -- looping until all tickets are done or the session limit is reached.
|
|
8
|
+
|
|
9
|
+
**How it works:**
|
|
10
|
+
|
|
11
|
+
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start" }`
|
|
12
|
+
2. The guide returns an instruction with ticket candidates and exact JSON for the next call
|
|
13
|
+
3. Follow every instruction exactly. Call the guide back after each step.
|
|
14
|
+
4. The guide advances through: PICK_TICKET -> PLAN -> PLAN_REVIEW -> IMPLEMENT -> CODE_REVIEW -> FINALIZE -> COMPLETE -> loop
|
|
15
|
+
5. Continue until the guide returns SESSION_END
|
|
16
|
+
|
|
17
|
+
**Critical rules for autonomous mode:**
|
|
18
|
+
- Do NOT use Claude Code's plan mode -- write plans as markdown files
|
|
19
|
+
- Do NOT ask the user for confirmation or approval
|
|
20
|
+
- Do NOT stop or summarize between tickets -- call the guide IMMEDIATELY
|
|
21
|
+
- Follow the guide's instructions exactly -- it specifies which tools to call, what parameters to use
|
|
22
|
+
- After each step completes, call `claudestory_autonomous_guide` with `action: "report"` and the results
|
|
23
|
+
|
|
24
|
+
**If the guide says to compact:** Call `claudestory_autonomous_guide` with `action: "pre_compact"`, then run `/compact`, then call with `action: "resume"`.
|
|
25
|
+
|
|
26
|
+
**If something goes wrong:** Call `claudestory_autonomous_guide` with `action: "cancel"` to cleanly end the session.
|
|
27
|
+
|
|
28
|
+
## Tiered Access -- Review, Plan, Guided Modes
|
|
29
|
+
|
|
30
|
+
The autonomous guide supports four execution tiers. Same guide, same handlers, different entry/exit points.
|
|
31
|
+
|
|
32
|
+
### `/story review T-XXX`
|
|
33
|
+
|
|
34
|
+
"I wrote code for T-XXX, review it." Enters at CODE_REVIEW, loops review rounds, exits on approval.
|
|
35
|
+
|
|
36
|
+
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start", "mode": "review", "ticketId": "T-XXX" }`
|
|
37
|
+
2. The guide enters CODE_REVIEW -- follow its diff capture and review instructions
|
|
38
|
+
3. On approve: session ends automatically. On revise/reject: fix code, re-review
|
|
39
|
+
4. After approval, you can proceed to commit -- the guide does NOT auto-commit in review mode
|
|
40
|
+
|
|
41
|
+
**Note:** Review mode relaxes git constraints -- dirty working tree is allowed since the user has code ready for review.
|
|
42
|
+
|
|
43
|
+
### `/story plan T-XXX`
|
|
44
|
+
|
|
45
|
+
"Help me plan T-XXX." Enters at PLAN, runs PLAN_REVIEW rounds, exits on approval.
|
|
46
|
+
|
|
47
|
+
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start", "mode": "plan", "ticketId": "T-XXX" }`
|
|
48
|
+
2. The guide enters PLAN -- write the implementation plan as a markdown file
|
|
49
|
+
3. On plan review approve: session ends automatically. On revise/reject: revise plan, re-review
|
|
50
|
+
4. The approved plan is saved in `.story/sessions/<id>/plan.md`
|
|
51
|
+
|
|
52
|
+
### `/story guided T-XXX`
|
|
53
|
+
|
|
54
|
+
"Do T-XXX end to end with review." Full pipeline for a single ticket: PLAN -> PLAN_REVIEW -> IMPLEMENT -> CODE_REVIEW -> FINALIZE -> COMPLETE -> HANDOVER -> SESSION_END.
|
|
55
|
+
|
|
56
|
+
1. Call `claudestory_autonomous_guide` with `{ "sessionId": null, "action": "start", "mode": "guided", "ticketId": "T-XXX" }`
|
|
57
|
+
2. Follow every instruction exactly, calling the guide back after each step
|
|
58
|
+
3. Session ends automatically after the single ticket is complete
|
|
59
|
+
|
|
60
|
+
**Guided vs Auto:** Guided mode forces `maxTicketsPerSession: 1` and exits after the ticket. Auto mode loops until all tickets are done or the session limit is reached.
|
|
61
|
+
|
|
62
|
+
### All tiered modes:
|
|
63
|
+
- Require a `ticketId` -- no ad-hoc review without a ticket in V1
|
|
64
|
+
- Use the same review process as auto mode (same backends, same adaptive depth)
|
|
65
|
+
- Can be cancelled with `action: "cancel"` at any point
|
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
# Setup Flow -- AI-Assisted Project Initialization
|
|
2
|
+
|
|
3
|
+
This file is referenced from SKILL.md when no `.story/` directory exists but project indicators are present. SKILL.md has already determined that setup is needed before routing here.
|
|
4
|
+
|
|
5
|
+
**If arriving from Step 2b (scaffold detection):** The project already has an empty `.story/` scaffold but no tickets. Skip 1a and start at **1b. Existing Project -- Analyze**.
|
|
6
|
+
|
|
7
|
+
## Design Rules
|
|
8
|
+
|
|
9
|
+
These rules govern the entire setup flow. Follow them at every gate.
|
|
10
|
+
|
|
11
|
+
1. **Every "Not sure" recommendation must reference at least one prior answer.** Example: "Monolith -- you described a billing tool for solo contractors, keep it simple." Builds trust, teaches why the choice matters.
|
|
12
|
+
2. **Three-strike acceleration:** If user picks "Not sure" 3 out of any 4 gates, shift to: "Based on what you've told me, I'll recommend the rest. You can review everything in the proposal." Generate recommendations for remaining gates, surface them in the proposal as **editable assumptions** (clearly marked, not presented as certainties). **Exception:** auth model, sensitive domain, and primary AI pattern are never silently collapsed -- always ask these even in acceleration mode.
|
|
13
|
+
3. **Never three bounded-choice gates in a row without a break.** Breaks are: free-text questions, visible mini-summaries, or output. Insert a summary after each cluster of gates.
|
|
14
|
+
4. **Infer domain concerns from descriptions and entities, don't add gates.** If someone describes a collaborative whiteboard, detect realtime and generate websocket/presence tickets. If they describe a SaaS with pricing tiers, generate billing/subscription tickets. The interview captures *what*; the ticket generator knows *what that implies*.
|
|
15
|
+
5. **Unrecognized types (Other):** ask architecture + deployment, skip domain-specific gates unless free-text mentions data or users.
|
|
16
|
+
6. **Deployment recommendations are contextual, not stack-hardcoded.** Long-running processes, websockets, compliance, self-hosting preferences override the stack-based default.
|
|
17
|
+
7. **Claude as recommended LLM is a product-opinionated choice.** claudestory is built on Claude. State this explicitly: "Claude is the product default for the claudestory ecosystem. Choose based on your needs."
|
|
18
|
+
8. **Phrase gates as outcome decisions, not system jargon.** "How do users log in?" not "Auth model?" "What data does this system store?" not "Data layer?" "How should this go live?" not "Deployment target?"
|
|
19
|
+
|
|
20
|
+
## AI-Assisted Setup Flow
|
|
21
|
+
|
|
22
|
+
This flow creates a meaningful `.story/` project instead of empty scaffolding. Claude analyzes the project, proposes structure, and creates everything via MCP tools.
|
|
23
|
+
|
|
24
|
+
#### 1a. Detect Project Type
|
|
25
|
+
|
|
26
|
+
Check for project indicators to determine if this is an **existing project** or a **new/empty project**:
|
|
27
|
+
|
|
28
|
+
- `package.json` -> npm/node (read `name`, `description`, check for `typescript` dep)
|
|
29
|
+
- `Cargo.toml` -> Rust
|
|
30
|
+
- `go.mod` -> Go
|
|
31
|
+
- `pyproject.toml` / `requirements.txt` -> Python
|
|
32
|
+
- `*.xcodeproj` / `Package.swift` -> Swift/macOS
|
|
33
|
+
- `*.sln` / `*.csproj` -> C#/.NET
|
|
34
|
+
- `Gemfile` -> Ruby
|
|
35
|
+
- `build.gradle.kts` / `build.gradle` -> Android/Kotlin/Java (or Spring Boot)
|
|
36
|
+
- `pubspec.yaml` -> Flutter/Dart
|
|
37
|
+
- `angular.json` -> Angular
|
|
38
|
+
- `svelte.config.js` -> SvelteKit
|
|
39
|
+
- `.git/` -> has version history
|
|
40
|
+
|
|
41
|
+
If none found (empty or near-empty directory) -> skip to **1c. New Project -- Interview**.
|
|
42
|
+
|
|
43
|
+
#### 1b. Existing Project -- Analyze
|
|
44
|
+
|
|
45
|
+
Before diving into analysis, briefly introduce claudestory to the user:
|
|
46
|
+
|
|
47
|
+
"Claude Story tracks your project's roadmap, tickets, issues, and session handovers in a `.story/` directory. Every Claude Code session starts by reading this context, so you never re-explain your project from scratch. Sessions build on each other: decisions, blockers, and lessons carry forward automatically. I'll analyze your project and propose a structure. You can adjust everything before I create anything."
|
|
48
|
+
|
|
49
|
+
Keep it to 3-4 sentences. Not a sales pitch, just enough that the user knows what they're opting into and that they're in control.
|
|
50
|
+
|
|
51
|
+
Read these files to understand the project (skip any that don't exist, skip files > 50KB):
|
|
52
|
+
|
|
53
|
+
1. **README.md** -- project description, goals, feature list, roadmap/TODO sections
|
|
54
|
+
2. **Package manifest** -- project name, dependencies, scripts
|
|
55
|
+
3. **CLAUDE.md** -- existing project spec (if any)
|
|
56
|
+
4. **Top-level directory listing** -- identify major components (src/, test/, docs/, etc.)
|
|
57
|
+
5. **Git summary** -- `git log --oneline -20` for recent work patterns
|
|
58
|
+
6. **GitHub issues (ask user first)** -- `gh issue list --limit 30 --state open --json number,title,labels,body,createdAt`. If gh fails (auth, rate limit, no remote), skip cleanly and note "GitHub import skipped: [reason]"
|
|
59
|
+
7. **Project brief / PRD scan** -- glob for `*.md` files in project root and `docs/`. For each candidate (exclude CHANGELOG, LICENSE, CONTRIBUTING, README which is already read above):
|
|
60
|
+
- If file is >100 lines and contains headings matching "entities", "schema", "architecture", "tech stack", "roadmap", "phases", "milestones", "screens", or "API" -- treat as a project brief
|
|
61
|
+
- Read at most 2 candidate briefs (prefer the longest matching file)
|
|
62
|
+
- Extract into structured notes for use in later steps: entity schemas (names, fields, relationships), technical decisions (stack choices, architecture), screen/page inventory, business rules and domain logic, key constraints
|
|
63
|
+
- Summarize once here; do not re-read the full brief at later steps
|
|
64
|
+
|
|
65
|
+
**Brief precedence:** If multiple sources describe the project:
|
|
66
|
+
- Existing `CLAUDE.md` is the authority for current project state
|
|
67
|
+
- A PRD/brief file is the authority for proposed scope and specifications
|
|
68
|
+
- README is a product overview (may be outdated or aspirational)
|
|
69
|
+
- If two briefs disagree on stack, entities, or milestones, ask the user to choose
|
|
70
|
+
|
|
71
|
+
**Framework-specific deep scan** -- after detecting the project type in 1a, scan deeper into framework conventions to understand architecture:
|
|
72
|
+
|
|
73
|
+
- **Next.js / Nuxt:** Check `app/` vs `pages/` routing, scan `app/api/` or `pages/api/` for API routes, read `next.config.*` / `nuxt.config.*`, check for middleware.
|
|
74
|
+
- **Express / Fastify / Koa:** Scan for route files (`routes/`, `src/routes/`), look for `router.get/post` patterns, identify service/controller layers.
|
|
75
|
+
- **NestJS:** Read `nest-cli.json`, scan `src/` for `*.module.ts`, check for controllers and services.
|
|
76
|
+
- **React (CRA / Vite) / Vue / Svelte:** Check `src/components/` structure, look for state management imports (redux, zustand, pinia), identify routing setup.
|
|
77
|
+
- **Angular:** Read `angular.json`, scan `src/app/` for modules and components, check for services and guards.
|
|
78
|
+
- **Django / FastAPI / Flask:** Check for `manage.py`, scan for app directories or router files, look at models and migrations.
|
|
79
|
+
- **Spring Boot:** Check `pom.xml` or `build.gradle` for Spring deps, scan `src/main/java` for controller/service/repository layers.
|
|
80
|
+
- **Rust:** Check `Cargo.toml` for workspace members, scan for `mod.rs` / `lib.rs` structure, identify crate types.
|
|
81
|
+
- **Swift / Xcode:** Check `.xcodeproj` or `Package.swift`, identify SwiftUI vs UIKit, scan for targets.
|
|
82
|
+
- **Android (Kotlin/Java):** Check `build.gradle.kts`, scan `app/src/main/` for activity/fragment/composable structure, check `AndroidManifest.xml`, identify Compose vs XML layouts.
|
|
83
|
+
- **Flutter / Dart:** Check `pubspec.yaml`, scan `lib/` for feature folders (models/, screens/, widgets/, services/), check for state management imports (provider, riverpod, bloc).
|
|
84
|
+
- **Go:** Check `go.mod`, scan for `cmd/` and `internal/`/`pkg/`, check for `Makefile`.
|
|
85
|
+
- **Monorepo:** If `packages/`, `apps/`, or workspace config detected, list each package with its purpose before proposing phases.
|
|
86
|
+
- **Other:** Scan `src/` two levels deep and identify dominant patterns (MVC, service layers, feature folders).
|
|
87
|
+
|
|
88
|
+
When the detected stack has common architectural variants (e.g., App Router vs Pages Router, Expo vs bare), use AskUserQuestion to confirm instead of guessing. Only ask when the choice changes ticket topology. Otherwise infer silently.
|
|
89
|
+
|
|
90
|
+
**Derive project metadata:**
|
|
91
|
+
- **name**: from package manifest `name` field, or directory name
|
|
92
|
+
- **type**: from package manager (npm, cargo, pip, etc.)
|
|
93
|
+
- **language**: from file extensions and manifest
|
|
94
|
+
|
|
95
|
+
**Assess project stage** from the data -- don't use fixed thresholds. A project with 3 commits and a half-written README is greenfield. A project with 500+ commits, test suites, and release tags is mature. A project with 200 commits and active PRs is active development. Use your judgment.
|
|
96
|
+
|
|
97
|
+
**Propose 3-7 phases** reflecting the project's actual development trajectory. Examples:
|
|
98
|
+
- Library: setup -> core-api -> documentation -> testing -> publishing
|
|
99
|
+
- App: mvp -> auth -> data-layer -> ui-polish -> deployment
|
|
100
|
+
- Mid-development project: capture completed work as early phases, then plan forward
|
|
101
|
+
|
|
102
|
+
**Propose initial tickets** per active phase (2-5 each), based on:
|
|
103
|
+
- README TODOs or roadmap sections (treat as hints, not ground truth)
|
|
104
|
+
- GitHub issues if imported -- infer from label semantics: bug/defect labels -> issues, enhancement/feature labels -> tickets
|
|
105
|
+
- Brief entity specs and roadmap sections (if a brief was found)
|
|
106
|
+
- Obvious gaps (missing tests, no CI, no docs, etc.)
|
|
107
|
+
- If more than 30 GitHub issues exist, note "Showing 30 of N. Additional issues can be imported later."
|
|
108
|
+
|
|
109
|
+
**Important:** Only mark phases complete if explicitly confirmed by user or docs -- do NOT infer completion from git history alone.
|
|
110
|
+
|
|
111
|
+
After analysis, skip to **1d. Present Proposal**.
|
|
112
|
+
|
|
113
|
+
#### 1c. New Project -- Interview
|
|
114
|
+
|
|
115
|
+
This is a guided funnel using a mix of free text and structured choices via the `AskUserQuestion` tool. The flow adapts to the user's confidence level and project complexity.
|
|
116
|
+
|
|
117
|
+
**--- Cluster 1: Identity ---**
|
|
118
|
+
|
|
119
|
+
**Step 1:** Ask the user: "What are you building?" (free text -- project name and purpose)
|
|
120
|
+
|
|
121
|
+
Parse the answer. If the user already named a stack ("billing app in Next.js"), confirm it and skip surface + stack questions. Do NOT skip characteristics -- stack doesn't tell us if it's AI-powered, realtime, or marketplace.
|
|
122
|
+
|
|
123
|
+
**Step 2a:** Use `AskUserQuestion`:
|
|
124
|
+
- question: "What's the primary surface?"
|
|
125
|
+
- header: "Surface"
|
|
126
|
+
- options:
|
|
127
|
+
- "Web app" -- SaaS, dashboard, admin panel
|
|
128
|
+
- "Mobile app" -- iOS, Android, cross-platform
|
|
129
|
+
- "API / backend service" -- REST, GraphQL, microservice
|
|
130
|
+
- "Website / content site" -- landing page, blog, docs
|
|
131
|
+
- (Other always available: desktop, CLI, library, package, etc. If Other, ask one free-text follow-up for primary delivery target.)
|
|
132
|
+
|
|
133
|
+
**Step 2b:** Use `AskUserQuestion`:
|
|
134
|
+
- question: "Any special characteristics?"
|
|
135
|
+
- header: "Traits"
|
|
136
|
+
- multiSelect: true
|
|
137
|
+
- options:
|
|
138
|
+
- "AI / LLM powered" -- chatbot, RAG, agent, AI features
|
|
139
|
+
- "Realtime / collaboration" -- live updates, websockets, multiplayer
|
|
140
|
+
- "Marketplace / multi-role" -- multiple user types, separate views
|
|
141
|
+
- "Content-heavy / CMS" -- admin panel, editorial workflow
|
|
142
|
+
- (None of these always available)
|
|
143
|
+
|
|
144
|
+
Surface drives stack recommendations. Characteristics drive additional gates and inferred tickets. Composes cleanly: AI health app = Web + AI. Marketplace = Web + Marketplace. Scales by adding characteristics, not conflicting top-level types.
|
|
145
|
+
|
|
146
|
+
**Simple project fast path:** If surface is Website/content + no AI/realtime/marketplace traits + no brief detected, offer early exit: "This looks like a straightforward site. Want me to skip the detailed questions and go straight to milestones?" If yes: default to Astro + Vercel/Netlify, no auth, no data model. Skip clusters 2-4 entirely. Defaults shown in proposal as editable assumptions. Portfolio user flow: name -> Website -> None -> "Skip?" -> milestones -> proposal. ~4 steps total.
|
|
147
|
+
|
|
148
|
+
**--- Cluster 2: Stack + design ---**
|
|
149
|
+
|
|
150
|
+
**Step 3:** Use `AskUserQuestion` with top 3-4 stacks from the **Default Stack Recommendations** appendix at the bottom of this file. Context-aware: characteristics influence ranking. AI + Web -> Next.js + Vercel AI SDK rises to top. Skip if stack was already confirmed in Step 1.
|
|
151
|
+
|
|
152
|
+
**Step 4:** Framework-specific `AskUserQuestion` only when the choice changes ticket topology:
|
|
153
|
+
- Next.js: App Router (Recommended) vs Pages Router
|
|
154
|
+
- React Native: Expo (Recommended) vs bare
|
|
155
|
+
- ORM: Drizzle (SQL-friendly, lightweight) vs Prisma (higher-level DX, generated types)
|
|
156
|
+
- Other framework-specific choices from the appendix
|
|
157
|
+
|
|
158
|
+
**--- Summary break ---**
|
|
159
|
+
Show: "So far: [name] is a [surface] + [traits] built with [stack]."
|
|
160
|
+
|
|
161
|
+
**Step 4a:** Design source (skip for APIs, CLIs, libraries, backends). Use `AskUserQuestion`:
|
|
162
|
+
- question: "Do you have designs?"
|
|
163
|
+
- header: "Design"
|
|
164
|
+
- options:
|
|
165
|
+
- "Yes, mockups / Figma" -- UI tickets reference designs. Usually skip component library question (implied by mockups, though user can override).
|
|
166
|
+
- "Rough idea / sketches" -- UI tickets include design decisions
|
|
167
|
+
- "No, start from scratch" -- generate design foundation tickets (color palette, typography, layout, component selection)
|
|
168
|
+
- "Not sure yet"
|
|
169
|
+
|
|
170
|
+
If NOT "Yes, mockups / Figma" and project has a UI surface, follow up with component library choice:
|
|
171
|
+
- `AskUserQuestion`: "Component library?"
|
|
172
|
+
- options: shadcn/ui (Recommended for Next.js), Material UI, Chakra UI, None/custom
|
|
173
|
+
|
|
174
|
+
**--- Cluster 3: System structure ---**
|
|
175
|
+
|
|
176
|
+
**Step 4b:** System shape (skip for static sites, CLIs, libs). Use `AskUserQuestion`:
|
|
177
|
+
- question: "How should the system be structured?"
|
|
178
|
+
- header: "Shape"
|
|
179
|
+
- options:
|
|
180
|
+
- "One app does everything" -- monolith, single deployable. Recommended for solo/small projects.
|
|
181
|
+
- "Frontend + backend separately" -- separate frontend and API
|
|
182
|
+
- "Frontend + managed backend (Supabase/Firebase)" -- BaaS handles DB, auth, storage. You build the frontend. Fastest path to MVP.
|
|
183
|
+
- "Not sure -- recommend one"
|
|
184
|
+
|
|
185
|
+
BaaS as a first-class path. If selected: skip ORM choice (BaaS handles it), skip auth gate (BaaS handles it), adjust deployment to match (Vercel + Supabase, or Firebase Hosting + Firebase). Generates different tickets: BaaS setup, client SDK integration, security rules, instead of custom API + auth tickets.
|
|
186
|
+
|
|
187
|
+
**BaaS + AI edge case:** If the user also selected "AI / LLM powered" as a characteristic, AI gates still fire normally. For document ownership tickets (RAG + auth), reference "Supabase RLS policies" or "Firebase Security Rules" instead of "custom row-level access." The AI cluster's data model tickets adapt to the BaaS context.
|
|
188
|
+
|
|
189
|
+
**Step 4b-ii:** Execution model (skip for static sites, CLIs, libs, content sites, BaaS projects). Use `AskUserQuestion`:
|
|
190
|
+
- question: "How does processing work?"
|
|
191
|
+
- header: "Processing"
|
|
192
|
+
- options:
|
|
193
|
+
- "Users request, system responds" -- standard web flow
|
|
194
|
+
- "Background processing needed" -- queues, workers, scheduled tasks
|
|
195
|
+
- "Both" -- user-facing + background processing
|
|
196
|
+
- "Not sure -- recommend one"
|
|
197
|
+
|
|
198
|
+
Note: realtime/event-driven is inferred from the "Realtime" characteristic (design rule 4), not asked as an option here.
|
|
199
|
+
|
|
200
|
+
**Step 4b2:** Deployment (skip for libraries, CLIs, packages). Use `AskUserQuestion`:
|
|
201
|
+
- question: "How should this go live?"
|
|
202
|
+
- header: "Deploy"
|
|
203
|
+
- options:
|
|
204
|
+
- "Easiest path" -- Vercel, Netlify, Railway, Fly.io. Connect repo, push to deploy. Minimal infrastructure work.
|
|
205
|
+
- "Full control (AWS/GCP/Azure)" -- you manage everything. More setup: infrastructure-as-code, containers, CI/CD pipelines.
|
|
206
|
+
- "Self-hosted / own servers" -- Docker Compose, nginx. You manage the hardware and networking.
|
|
207
|
+
- "Not sure -- recommend one"
|
|
208
|
+
|
|
209
|
+
Recommendations are contextual: consider prior answers about compliance, long-running processes, websockets, self-hosting preferences -- not just stack.
|
|
210
|
+
|
|
211
|
+
**--- Summary break ---**
|
|
212
|
+
Show: "[name]: [shape], deploying to [platform]. Now let me understand the data."
|
|
213
|
+
|
|
214
|
+
**--- Cluster 4: Data + domain + auth ---**
|
|
215
|
+
|
|
216
|
+
**Step 4c:** Data model (skip for clearly stateless: static sites, simple CLIs, no persistence. Also skip for BaaS -- handled by BaaS schema setup.) Use `AskUserQuestion`:
|
|
217
|
+
- question: "What data does this system store?"
|
|
218
|
+
- header: "Data"
|
|
219
|
+
- options:
|
|
220
|
+
- "I know the main things" -> follow up with free text: "What are the main objects and how they relate? (e.g., users have many projects, invoices belong to projects, projects have status workflows)"
|
|
221
|
+
- "Help me figure it out" -> Claude proposes entities from brief/interview answers
|
|
222
|
+
- "Keep it simple for now" -- start minimal, add later
|
|
223
|
+
- "Nothing -- no database needed"
|
|
224
|
+
|
|
225
|
+
**Step 4d:** Domain complexity (skip for static sites, CLIs, libs, "no database", "keep it simple", BaaS). Use `AskUserQuestion`:
|
|
226
|
+
- question: "What kind of rules does this system have?"
|
|
227
|
+
- header: "Rules"
|
|
228
|
+
- multiSelect: true
|
|
229
|
+
- options:
|
|
230
|
+
- "Workflows / approvals" -- things move through stages, need approval, have status transitions
|
|
231
|
+
- "Multiple organizations / teams" -- different groups see different data, separate access
|
|
232
|
+
- "None of the above" -- straightforward data, no special rules (exclusive: if selected, deselects the others)
|
|
233
|
+
- "Not sure -- recommend one"
|
|
234
|
+
|
|
235
|
+
Multi-select because these are orthogonal: a system can have both workflows AND org scoping. "None of the above" is the exclusive fallback for simple CRUD projects.
|
|
236
|
+
|
|
237
|
+
**Step 4e:** Auth / identity (skip for static sites, CLIs, libs, packages. Do NOT skip for "no database" -- auth can be external/stateless: JWT, Clerk, Auth0, API keys). Use `AskUserQuestion`:
|
|
238
|
+
- question: "How do users log in?"
|
|
239
|
+
- header: "Auth"
|
|
240
|
+
- options:
|
|
241
|
+
- "No login needed" -- single user or public access
|
|
242
|
+
- "Individual accounts" -- email/password, social login. Easiest setup: Firebase Auth, Clerk, or Supabase Auth.
|
|
243
|
+
- "Team / organization accounts" -- multi-user, org scoping
|
|
244
|
+
- "External auth / SSO" -- enterprise IdP, OAuth providers
|
|
245
|
+
- (Other always available: API keys only, guest+optional, machine clients, etc. + "Not sure -- recommend one")
|
|
246
|
+
|
|
247
|
+
When recommending auth setup for individual accounts, suggest Firebase Auth or Clerk as the easiest options. These handle email/password, social login, session management, and JWT with minimal code. Only recommend custom auth when the user has specific requirements.
|
|
248
|
+
|
|
249
|
+
**Step 4f:** Sensitive domain (skip unless project description or characteristics suggest health, legal, finance, compliance, government, or regulated industry). This is the canonical sensitive domain gate for ALL projects. The AI safety cluster (Cluster 5) references this answer instead of re-asking. Use `AskUserQuestion`:
|
|
250
|
+
- question: "Is this in a sensitive/regulated domain?"
|
|
251
|
+
- header: "Domain"
|
|
252
|
+
- options:
|
|
253
|
+
- "Yes (health, legal, finance, compliance)" -- audit logging, privacy controls, disclaimers, stricter testing, compliance tickets
|
|
254
|
+
- "No"
|
|
255
|
+
- "Not sure"
|
|
256
|
+
|
|
257
|
+
This exists outside the AI branch because a non-AI health billing platform still needs audit trails and compliance tickets.
|
|
258
|
+
|
|
259
|
+
**--- Cluster 5: AI-specific (only when AI characteristic selected in Step 2b) ---**
|
|
260
|
+
|
|
261
|
+
**AI pattern:** Use `AskUserQuestion`:
|
|
262
|
+
- question: "What's the primary AI pattern?"
|
|
263
|
+
- header: "AI Pattern"
|
|
264
|
+
- options:
|
|
265
|
+
- "RAG" -- knowledge base Q&A, document search, domain answers
|
|
266
|
+
- "Agentic / tool use" -- AI that takes actions, calls APIs
|
|
267
|
+
- "Conversational" -- chatbot, assistant, guided interaction
|
|
268
|
+
- "Structured generation" -- extract data, classify, generate reports, transform inputs to JSON
|
|
269
|
+
- (Other + "Not sure -- recommend one")
|
|
270
|
+
|
|
271
|
+
Follow up: "Any secondary capabilities?" (multiSelect, optional). Same options minus the one already picked. This handles real AI products that are RAG + conversational, or agentic + structured generation.
|
|
272
|
+
|
|
273
|
+
**LLM provider:** Use `AskUserQuestion`:
|
|
274
|
+
- question: "Which LLM provider?"
|
|
275
|
+
- header: "LLM"
|
|
276
|
+
- options:
|
|
277
|
+
- "Anthropic Claude (product default)" -- Claude API / Agent SDK. claudestory ecosystem default; choose based on your needs.
|
|
278
|
+
- "OpenAI" -- GPT models
|
|
279
|
+
- "Google Gemini" -- multimodal, good pricing
|
|
280
|
+
- "Self-hosted" -- Qwen, Llama, Mistral via Ollama/vLLM
|
|
281
|
+
- (Other: multi-provider, custom, etc.)
|
|
282
|
+
|
|
283
|
+
**AI processing:** Use `AskUserQuestion`:
|
|
284
|
+
- question: "How does AI processing work?"
|
|
285
|
+
- header: "Processing"
|
|
286
|
+
- options:
|
|
287
|
+
- "Synchronous" -- user sends, waits for response
|
|
288
|
+
- "Async / background" -- ingestion, batch, workers
|
|
289
|
+
- "Both" -- sync chat + async ingestion
|
|
290
|
+
- "Not sure -- recommend one"
|
|
291
|
+
|
|
292
|
+
**Vector database (if RAG primary or secondary):** Use `AskUserQuestion`:
|
|
293
|
+
- question: "Vector database?"
|
|
294
|
+
- header: "Vector DB"
|
|
295
|
+
- options:
|
|
296
|
+
- "pgvector (Recommended)" -- PostgreSQL extension, simple
|
|
297
|
+
- "Pinecone" -- managed, scalable
|
|
298
|
+
- "Qdrant" -- open-source, self-hosted
|
|
299
|
+
- "Not sure -- recommend one"
|
|
300
|
+
|
|
301
|
+
**AI audience + safety:** Use `AskUserQuestion`:
|
|
302
|
+
- question: "Who interacts with the AI output?"
|
|
303
|
+
- header: "Audience"
|
|
304
|
+
- options:
|
|
305
|
+
- "Public users" -- guardrails, content filtering, rate limiting
|
|
306
|
+
- "Internal users" -- lighter guardrails
|
|
307
|
+
- "Backend / pipeline" -- skip safety layer
|
|
308
|
+
- "Not sure -- recommend one"
|
|
309
|
+
|
|
310
|
+
If public or internal, check whether sensitive domain was already answered in Step 4f. If yes, use that answer. If Step 4f was skipped (e.g., AI-only project where sensitive domain wasn't obvious from the description), ask now with `AskUserQuestion`:
|
|
311
|
+
- question: "Is this a sensitive domain?"
|
|
312
|
+
- header: "Domain"
|
|
313
|
+
- options:
|
|
314
|
+
- "Yes (health, legal, finance)" -- audit logging, evals, disclaimers, stricter testing
|
|
315
|
+
- "No"
|
|
316
|
+
|
|
317
|
+
Sensitive domain is orthogonal to audience: an internal health app still needs audit logging.
|
|
318
|
+
|
|
319
|
+
AI gates generate tickets the current flow would miss:
|
|
320
|
+
- LLM client setup (provider SDK, error handling, retries, streaming)
|
|
321
|
+
- Prompt engineering / system prompt design
|
|
322
|
+
- RAG pipeline (if RAG): ingestion, chunking, embedding, retrieval, reranking
|
|
323
|
+
- Secondary AI capabilities as additional tickets
|
|
324
|
+
- Guardrails / safety layer (if user-facing)
|
|
325
|
+
- Evaluation framework (how do you know it's working?)
|
|
326
|
+
- Cost monitoring / token tracking
|
|
327
|
+
- Conversation/session storage
|
|
328
|
+
- Background workers (if async)
|
|
329
|
+
- Document ownership model (if RAG + auth)
|
|
330
|
+
- Audit logging + disclaimers (if sensitive domain)
|
|
331
|
+
|
|
332
|
+
**--- Milestones ---**
|
|
333
|
+
|
|
334
|
+
**Step 5:** "What are the major milestones?" (free text)
|
|
335
|
+
|
|
336
|
+
**Step 6:** "What's the first thing to build?" (free text)
|
|
337
|
+
|
|
338
|
+
Propose phases and initial tickets from all gathered answers.
|
|
339
|
+
|
|
340
|
+
#### 1d. Present Proposal
|
|
341
|
+
|
|
342
|
+
Show the user a structured proposal (table format, not raw JSON):
|
|
343
|
+
- **Project:** name, type, language
|
|
344
|
+
- **System shape + execution model**
|
|
345
|
+
- **Deployment target**
|
|
346
|
+
- **Core entities + key relationships** (if defined)
|
|
347
|
+
- **Domain complexity** (workflows, org scoping, or simple CRUD)
|
|
348
|
+
- **Auth / identity model**
|
|
349
|
+
- **AI pattern + provider + processing** (if AI project)
|
|
350
|
+
- **Any inferred concerns** (realtime, billing, etc. per design rule 4)
|
|
351
|
+
- **Editable assumptions** (if three-strike acceleration was used, clearly marked)
|
|
352
|
+
- **Unresolved decisions**
|
|
353
|
+
- **Phases** (table: id, name, description)
|
|
354
|
+
- **Tickets per phase** (title, type, status)
|
|
355
|
+
- **Issues** (if GitHub import was used)
|
|
356
|
+
|
|
357
|
+
Before asking for approval, briefly explain what they're looking at:
|
|
358
|
+
|
|
359
|
+
"**How this works:** Phases are milestones in your project's development. They track progress from setup to shipping. Tickets are specific work items within each phase. After setup, typing `/story` at the start of any Claude Code session loads this context automatically. Claude will know your project's state, what was done last session, and what to work on next."
|
|
360
|
+
|
|
361
|
+
Then use `AskUserQuestion` for approval:
|
|
362
|
+
- question: "How does this proposal look?"
|
|
363
|
+
- header: "Proposal"
|
|
364
|
+
- options:
|
|
365
|
+
- "Looks good" -- approve and continue
|
|
366
|
+
- "Adjust phases" -- iterate on phase structure
|
|
367
|
+
- "Adjust tickets" -- iterate on ticket details
|
|
368
|
+
- "Start over" -- re-analyze from scratch
|
|
369
|
+
|
|
370
|
+
Re-show this `AskUserQuestion` after adjustments. Loop until "Looks good."
|
|
371
|
+
|
|
372
|
+
#### 1d2. Refinement and Review
|
|
373
|
+
|
|
374
|
+
After the user approves the proposal structure, use `AskUserQuestion` for refinement depth:
|
|
375
|
+
- question: "Want me to refine these before creating?"
|
|
376
|
+
- header: "Depth"
|
|
377
|
+
- options:
|
|
378
|
+
- "Create as-is" -- create tickets now with just titles
|
|
379
|
+
- "Yes, refine them" -- I'll add descriptions, figure out dependencies, and flag oversized tickets
|
|
380
|
+
- "Yes, refine + get a second opinion" -- I'll refine, then have an independent reviewer check my work
|
|
381
|
+
|
|
382
|
+
If "Create as-is" and no brief exists: warn "Note: tickets will have titles only -- you can add descriptions later."
|
|
383
|
+
|
|
384
|
+
**If "Refine tickets" or "Refine + review":**
|
|
385
|
+
|
|
386
|
+
Refine the proposal. If a brief/PRD was found in step 1b, use those structured notes. If no brief exists (e.g., the user came through step 1c interview), infer descriptions from the interview answers and propose standard dependencies based on the tech stack.
|
|
387
|
+
|
|
388
|
+
**Descriptions:** Extract specs from the brief into ticket descriptions -- entity fields, acceptance criteria, API contracts, business rules. If no brief, write descriptions based on the user's interview answers and common patterns for the chosen stack. Cap each description at 3-4 sentences. Keep them actionable, not exhaustive. The goal is "enough to implement without re-reading the brief."
|
|
389
|
+
|
|
390
|
+
**Dependencies:** Infer `blockedBy` relationships from phase ordering and domain logic:
|
|
391
|
+
- Schema/migration tickets block CRUD API tickets
|
|
392
|
+
- Auth tickets block protected route tickets
|
|
393
|
+
- CRUD/model tickets block business logic that depends on them
|
|
394
|
+
- API tickets block UI tickets that consume them
|
|
395
|
+
|
|
396
|
+
**Sizing check:** Flag tickets that cover more than one major concern:
|
|
397
|
+
- Mentions 3+ distinct entities in one ticket
|
|
398
|
+
- Covers both API implementation and UI in one ticket
|
|
399
|
+
- Handles 3+ distinct models, modes, or billing types in one ticket
|
|
400
|
+
- Offer to split flagged tickets into sub-tasks
|
|
401
|
+
|
|
402
|
+
**Missing entity detection:** Cross-reference entities and concepts mentioned in the brief against the proposed ticket list. Flag entities that appear in the brief but have no corresponding ticket. Common misses: user profile/settings, notification system, seed data, admin/config screens.
|
|
403
|
+
|
|
404
|
+
**Core differentiator detection:** Identify the ticket(s) covering what the brief emphasizes most (the main value proposition). If the core differentiator is a single ticket, flag it for decomposition -- it likely needs 3-4 sub-tickets.
|
|
405
|
+
|
|
406
|
+
**Undecided tech choices:** Surface technology decisions mentioned in the brief as "X or Y" that haven't been resolved. Present them as explicit decisions to make before implementation starts (e.g., "ORM: Drizzle or Prisma -- decide before T-002").
|
|
407
|
+
|
|
408
|
+
After refinement, present the updated proposal showing what changed: added descriptions, new blockedBy links, split tickets, newly created tickets for missing entities, and flagged decisions. Wait for the user to approve the refined proposal before continuing.
|
|
409
|
+
|
|
410
|
+
**If "Refine + review":**
|
|
411
|
+
|
|
412
|
+
After refinement, run an independent review of the full proposal (phases, tickets, descriptions, dependencies):
|
|
413
|
+
|
|
414
|
+
**Backend selection:** Use the same review backend selection as autonomous mode -- if the `review_plan` MCP tool is available, use it (pass the full proposal as the plan document); otherwise spawn an independent Claude agent with the brief + proposal and ask it to audit for gaps, sizing issues, missing dependencies, and architectural concerns. If neither is available, skip review with a note.
|
|
415
|
+
|
|
416
|
+
**Review cap:** Maximum 2 review rounds for setup proposals.
|
|
417
|
+
|
|
418
|
+
**After review findings come back:**
|
|
419
|
+
- Present ALL findings to the user as a summary diff: added tickets, changed descriptions, new dependencies, files to be generated.
|
|
420
|
+
- User approves the final version before any execution. Do not auto-incorporate findings.
|
|
421
|
+
- If the user requests changes based on findings, update the proposal and optionally re-review.
|
|
422
|
+
|
|
423
|
+
#### 1e. Execute on Approval
|
|
424
|
+
|
|
425
|
+
**Two-pass ticket creation:**
|
|
426
|
+
|
|
427
|
+
1. Call `claudestory_init` with name, type, language -- after this, all MCP tools become available dynamically
|
|
428
|
+
2. Call `claudestory_phase_create` for each phase -- first phase with `atStart: true`, subsequent with `after: <previous-phase-id>`
|
|
429
|
+
3. **Pass 1:** Call `claudestory_ticket_create` for each ticket WITHOUT `blockedBy` (ticket IDs don't exist until after creation)
|
|
430
|
+
4. Call `claudestory_issue_create` for each imported GitHub issue
|
|
431
|
+
5. **Pass 2:** Call `claudestory_ticket_update` for each ticket that has `blockedBy` dependencies, now that all IDs exist. Validate: no cycles, no self-references.
|
|
432
|
+
6. Call `claudestory_ticket_update` to mark already-complete tickets as `complete`
|
|
433
|
+
7. Call `claudestory_snapshot` to save initial baseline
|
|
434
|
+
|
|
435
|
+
**CLAUDE.md generation:** If a brief/PRD was read in step 1b AND no `CLAUDE.md` exists in the project root, use `AskUserQuestion` for governance files:
|
|
436
|
+
- question: "Write project governance files?"
|
|
437
|
+
- header: "Files"
|
|
438
|
+
- options:
|
|
439
|
+
- "Write both" -- CLAUDE.md and RULES.md
|
|
440
|
+
- "CLAUDE.md only"
|
|
441
|
+
- "RULES.md only"
|
|
442
|
+
- "Skip" -- I'll write them manually
|
|
443
|
+
|
|
444
|
+
**If writing CLAUDE.md**, generate with tiered structure:
|
|
445
|
+
|
|
446
|
+
*Always present:*
|
|
447
|
+
- Project purpose (1-2 sentences)
|
|
448
|
+
- Tech stack and key dependencies (including any pivots from the brief, with rationale)
|
|
449
|
+
- Architecture pattern (shape + execution model) + rationale
|
|
450
|
+
- Testing strategy (TDD when applicable -- see RULES.md generation)
|
|
451
|
+
|
|
452
|
+
*Present when relevant:*
|
|
453
|
+
- Deployment target + hosting model
|
|
454
|
+
- Core entities + key relationships (names + relationships, not full schemas)
|
|
455
|
+
- Domain complexity (workflows, org scoping)
|
|
456
|
+
- Auth / identity model
|
|
457
|
+
- AI pattern + provider + processing model
|
|
458
|
+
- Tenancy model
|
|
459
|
+
- State machines / workflows
|
|
460
|
+
|
|
461
|
+
*Flagged for resolution:*
|
|
462
|
+
- Undecided tech choices (flagged as TBD with options)
|
|
463
|
+
|
|
464
|
+
**Sanitization:** Never copy secrets, tokens, credentials, API keys, connection strings, customer-identifying data, or internal-only endpoints into generated files.
|
|
465
|
+
|
|
466
|
+
Show a preview of the generated content to the user. Only write after explicit approval.
|
|
467
|
+
|
|
468
|
+
**If writing RULES.md**, generate capturing:
|
|
469
|
+
- Domain-specific rules (e.g., "all monetary calculations use fixed-point arithmetic, not floats")
|
|
470
|
+
- API design constraints (versioning, auth requirements, response format)
|
|
471
|
+
- Data integrity rules (soft deletes, audit trails, idempotency requirements)
|
|
472
|
+
- Testing requirements for core business logic
|
|
473
|
+
|
|
474
|
+
**TDD recommendation:** Add when domain complexity includes "Workflows/approvals" or "Multiple organizations/teams", or project has AI evaluation needs, or project has a sensitive domain. This is mechanical -- tied directly to gate answers, no judgment calls:
|
|
475
|
+
|
|
476
|
+
```
|
|
477
|
+
- TDD for business logic: write tests first for core functional code
|
|
478
|
+
(calculations, validation rules, state machines, data transformations,
|
|
479
|
+
AI evaluation harnesses). Tests define the contract before implementation.
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
Same sanitization and preview rules as CLAUDE.md. Only write after explicit approval.
|
|
483
|
+
|
|
484
|
+
#### 1f. Post-Setup
|
|
485
|
+
|
|
486
|
+
After creation completes:
|
|
487
|
+
- Confirm what was created (e.g., "Created 5 phases, 18 tickets, 3 issues, CLAUDE.md, and RULES.md")
|
|
488
|
+
- Check if `.gitignore` includes `.story/snapshots/` (warn if missing -- snapshots should not be committed)
|
|
489
|
+
- Write an initial handover documenting the setup decisions. Explicitly capture which gates were answered and what was chosen: surface, characteristics, stack, system shape, execution model, deployment, data model, domain complexity, auth model, sensitive domain, AI pattern/provider/processing (if applicable), design source. This handover is the source of truth for decisions; CLAUDE.md is the project description.
|
|
490
|
+
- Setup complete. Continue with **Step 2: Load Context** in SKILL.md (already in your context). Execute all 6 steps -- the project now has data to load.
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## Appendix: Default Stack Recommendations
|
|
495
|
+
|
|
496
|
+
Choose based on team familiarity, hosting model, and product shape; these are defaults, not absolutes.
|
|
497
|
+
|
|
498
|
+
### Web application
|
|
499
|
+
- Next.js + TypeScript (Recommended) -- full-stack React, SSR, API routes, easiest deploy via Vercel. Best for: solo devs, startups, fast shipping.
|
|
500
|
+
- SvelteKit + TypeScript -- lighter, less boilerplate, excellent DX. Best for: minimal framework overhead.
|
|
501
|
+
- Django + Python -- batteries-included, built-in admin, ORM, auth. Best for: data-heavy apps, Python teams.
|
|
502
|
+
- Rails -- convention-over-config. Best for: fastest 0-to-MVP.
|
|
503
|
+
|
|
504
|
+
### AI / LLM application
|
|
505
|
+
- Next.js + TypeScript + Vercel AI SDK (Recommended for web AI) -- streaming UI, provider-agnostic. Best for: AI products with web interface.
|
|
506
|
+
- Python + FastAPI + provider SDK -- direct integration, no orchestration overhead. Best for: most AI apps. Add LangChain only when multi-step orchestration matters.
|
|
507
|
+
- Python + FastAPI + LlamaIndex -- simpler for pure retrieval. Best for: knowledge base Q&A.
|
|
508
|
+
- TypeScript + Anthropic SDK / Agent SDK -- Claude-native. Best for: agents and tool use.
|
|
509
|
+
|
|
510
|
+
### BaaS / backendless
|
|
511
|
+
- Supabase (Recommended) -- Postgres, auth, realtime, storage built-in. Best for: fast MVP, solo devs, speed over control.
|
|
512
|
+
- Firebase -- Google ecosystem, NoSQL, good mobile support. Best for: mobile-first, Google Cloud teams.
|
|
513
|
+
- Convex -- reactive database, no REST. Best for: realtime-first apps.
|
|
514
|
+
|
|
515
|
+
### Website / content site
|
|
516
|
+
- Astro (Recommended) -- zero JS default, islands. Best for: marketing, blogs, docs.
|
|
517
|
+
- Next.js -- when site needs dynamic features.
|
|
518
|
+
- Hugo -- pure static, fast builds. Best for: large content sites.
|
|
519
|
+
- Docusaurus -- documentation sites. React-based.
|
|
520
|
+
|
|
521
|
+
### Mobile app
|
|
522
|
+
- Flutter + Dart -- cross-platform, consistent UI, single codebase. Best for: mobile-primary projects wanting one tightly controlled UI system.
|
|
523
|
+
- React Native + Expo + TypeScript -- cross-platform, shares logic with web. Best for: teams already using React.
|
|
524
|
+
- Swift + SwiftUI -- iOS/macOS native. Best for: iOS-only, deep OS integration.
|
|
525
|
+
- Kotlin + Compose -- Android native. Best for: Android-only.
|
|
526
|
+
|
|
527
|
+
(Neither Flutter nor React Native is a universal winner. Recommendation depends on team context.)
|
|
528
|
+
|
|
529
|
+
### Full-stack / multi-service
|
|
530
|
+
- Next.js + NestJS + PostgreSQL -- TypeScript end-to-end, structured API. Best for: strong typing, module organization.
|
|
531
|
+
- Next.js + FastAPI + PostgreSQL -- TS frontend, Python API. Best for: AI features in the API.
|
|
532
|
+
- React + Go + PostgreSQL -- lightweight. Best for: high-throughput services.
|
|
533
|
+
- Monorepo (Turborepo/Nx) when sharing types/utils; polyrepo when teams are independent.
|
|
534
|
+
|
|
535
|
+
### Desktop app
|
|
536
|
+
- Tauri + TypeScript -- cross-platform, Rust backend, small binaries. Best for: lightweight tools.
|
|
537
|
+
- Electron + TypeScript -- cross-platform, largest ecosystem. Best for: feature-rich apps.
|
|
538
|
+
- Swift + SwiftUI -- macOS native. Best for: Mac-only.
|
|
539
|
+
- .NET MAUI -- Windows + macOS. Best for: C#/.NET teams.
|
|
540
|
+
|
|
541
|
+
### API / backend
|
|
542
|
+
- Node.js + Fastify + TypeScript -- fast, lean. Best for: microservices, performance.
|
|
543
|
+
- NestJS + TypeScript -- structured, enterprise-friendly. Best for: larger teams, complex domains.
|
|
544
|
+
- Python + FastAPI -- auto-docs, async. Best for: Python teams, AI, data-heavy.
|
|
545
|
+
- Go -- compiled, high-throughput. Best for: infrastructure services.
|
|
546
|
+
- Rust + Axum -- maximum performance. Best for: systems-level APIs.
|
|
547
|
+
|
|
548
|
+
### CLI tool
|
|
549
|
+
- TypeScript + Node.js -- fast to build, npm distribution.
|
|
550
|
+
- Rust -- single binary, fast. Best for: performance, wide distribution.
|
|
551
|
+
- Go -- single binary, fast compile. Best for: DevOps, infra CLIs.
|
|
552
|
+
- Python + Typer -- fastest to prototype. Best for: internal tools.
|
|
553
|
+
|
|
554
|
+
### Library / package
|
|
555
|
+
- TypeScript -- npm, widest web reach.
|
|
556
|
+
- Rust -- crates.io, WASM target.
|
|
557
|
+
- Python -- PyPI, data science.
|
|
558
|
+
|
|
559
|
+
### Framework-specific choices (ask only when it affects tickets)
|
|
560
|
+
- Next.js: App Router (Recommended) vs Pages Router
|
|
561
|
+
- React Native: Expo (Recommended) vs bare
|
|
562
|
+
- Node.js ORM: Drizzle (SQL-friendly, lightweight) vs Prisma (higher-level DX, generated types)
|
|
563
|
+
- Python ORM: SQLAlchemy vs Django ORM
|
|
564
|
+
- Database: PostgreSQL (Recommended), SQLite (local), MongoDB (documents), MySQL (legacy)
|
|
565
|
+
- Component library (web): shadcn/ui (Recommended for Next.js), Material UI, Chakra UI, None/custom
|
|
566
|
+
- Component library (mobile): default to framework built-in (Flutter Material, RN Paper/NativeBase)
|
|
567
|
+
|
|
568
|
+
### Deployment / hosting
|
|
569
|
+
- Vercel (Recommended for Next.js/Astro) -- zero-config, git push deploy
|
|
570
|
+
- Netlify -- static + serverless
|
|
571
|
+
- Railway -- full-stack, databases included
|
|
572
|
+
- Fly.io -- containers, global edge
|
|
573
|
+
- AWS / GCP / Azure -- maximum control, complex setup
|
|
574
|
+
- Self-hosted / VPS -- Docker Compose + nginx, full control
|
|
575
|
+
|
|
576
|
+
### AI-specific choices
|
|
577
|
+
- LLM: Anthropic Claude (product default), OpenAI, Google Gemini, Self-hosted (Qwen/Llama/Mistral), Multi-provider
|
|
578
|
+
- Pattern: RAG, Agentic, Conversational, Structured generation (composable: primary + secondary)
|
|
579
|
+
- Processing: Sync, Async, Both
|
|
580
|
+
- Vector DB: pgvector (Recommended), Pinecone, Qdrant, Chroma
|
|
581
|
+
- Safety: by audience (public/internal/backend) + domain sensitivity (separate axis)
|