@cliangdev/flux-plugin 0.0.0-dev.df9c61f → 0.1.0-dev.588ae42

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.
Files changed (89) hide show
  1. package/README.md +8 -4
  2. package/bin/install.cjs +158 -24
  3. package/commands/flux.md +127 -84
  4. package/commands/linear.md +171 -0
  5. package/package.json +10 -12
  6. package/skills/flux-orchestrator/SKILL.md +58 -76
  7. package/src/__tests__/version.test.ts +37 -0
  8. package/src/adapters/local/.gitkeep +0 -0
  9. package/src/server/__tests__/config.test.ts +163 -0
  10. package/src/server/adapters/__tests__/a-client-linear.test.ts +197 -0
  11. package/src/server/adapters/__tests__/adapter-factory.test.ts +230 -0
  12. package/src/server/adapters/__tests__/dependency-ops.test.ts +395 -0
  13. package/src/server/adapters/__tests__/document-ops.test.ts +306 -0
  14. package/src/server/adapters/__tests__/linear-adapter.test.ts +91 -0
  15. package/src/server/adapters/__tests__/linear-config.test.ts +425 -0
  16. package/src/server/adapters/__tests__/linear-criteria-parser.test.ts +287 -0
  17. package/src/server/adapters/__tests__/linear-description-test.ts +238 -0
  18. package/src/server/adapters/__tests__/linear-epic-crud.test.ts +496 -0
  19. package/src/server/adapters/__tests__/linear-mappers-description.test.ts +276 -0
  20. package/src/server/adapters/__tests__/linear-mappers-epic.test.ts +294 -0
  21. package/src/server/adapters/__tests__/linear-mappers-prd.test.ts +300 -0
  22. package/src/server/adapters/__tests__/linear-mappers-task.test.ts +197 -0
  23. package/src/server/adapters/__tests__/linear-prd-crud.test.ts +620 -0
  24. package/src/server/adapters/__tests__/linear-stats.test.ts +450 -0
  25. package/src/server/adapters/__tests__/linear-task-crud.test.ts +534 -0
  26. package/src/server/adapters/__tests__/linear-types.test.ts +243 -0
  27. package/src/server/adapters/__tests__/status-ops.test.ts +441 -0
  28. package/src/server/adapters/factory.ts +90 -0
  29. package/src/server/adapters/index.ts +9 -0
  30. package/src/server/adapters/linear/adapter.ts +1136 -0
  31. package/src/server/adapters/linear/client.ts +169 -0
  32. package/src/server/adapters/linear/config.ts +152 -0
  33. package/src/server/adapters/linear/helpers/criteria-parser.ts +197 -0
  34. package/src/server/adapters/linear/helpers/index.ts +7 -0
  35. package/src/server/adapters/linear/index.ts +16 -0
  36. package/src/server/adapters/linear/mappers/description.ts +136 -0
  37. package/src/server/adapters/linear/mappers/epic.ts +81 -0
  38. package/src/server/adapters/linear/mappers/index.ts +27 -0
  39. package/src/server/adapters/linear/mappers/prd.ts +178 -0
  40. package/src/server/adapters/linear/mappers/task.ts +82 -0
  41. package/src/server/adapters/linear/types.ts +264 -0
  42. package/src/server/adapters/local-adapter.ts +968 -0
  43. package/src/server/adapters/types.ts +293 -0
  44. package/src/server/config.ts +73 -0
  45. package/src/server/db/__tests__/queries.test.ts +472 -0
  46. package/src/server/db/ids.ts +17 -0
  47. package/src/server/db/index.ts +69 -0
  48. package/src/server/db/queries.ts +142 -0
  49. package/src/server/db/refs.ts +60 -0
  50. package/src/server/db/schema.ts +88 -0
  51. package/src/server/db/sqlite.ts +10 -0
  52. package/src/server/index.ts +83 -0
  53. package/src/server/tools/__tests__/crud.test.ts +301 -0
  54. package/src/server/tools/__tests__/get-version.test.ts +27 -0
  55. package/src/server/tools/__tests__/mcp-interface.test.ts +388 -0
  56. package/src/server/tools/__tests__/query.test.ts +353 -0
  57. package/src/server/tools/__tests__/z-configure-linear.test.ts +511 -0
  58. package/src/server/tools/__tests__/z-get-linear-url.test.ts +108 -0
  59. package/src/server/tools/configure-linear.ts +373 -0
  60. package/src/server/tools/create-epic.ts +35 -0
  61. package/src/server/tools/create-prd.ts +31 -0
  62. package/src/server/tools/create-task.ts +38 -0
  63. package/src/server/tools/criteria.ts +50 -0
  64. package/src/server/tools/delete-entity.ts +76 -0
  65. package/src/server/tools/dependencies.ts +55 -0
  66. package/src/server/tools/get-entity.ts +238 -0
  67. package/src/server/tools/get-linear-url.ts +28 -0
  68. package/src/server/tools/get-project-context.ts +33 -0
  69. package/src/server/tools/get-stats.ts +52 -0
  70. package/src/server/tools/get-version.ts +20 -0
  71. package/src/server/tools/index.ts +114 -0
  72. package/src/server/tools/init-project.ts +108 -0
  73. package/src/server/tools/query-entities.ts +167 -0
  74. package/src/server/tools/render-status.ts +201 -0
  75. package/src/server/tools/update-entity.ts +140 -0
  76. package/src/server/tools/update-status.ts +166 -0
  77. package/src/server/utils/__tests__/mcp-response.test.ts +331 -0
  78. package/src/server/utils/logger.ts +9 -0
  79. package/src/server/utils/mcp-response.ts +254 -0
  80. package/src/server/utils/status-transitions.ts +160 -0
  81. package/src/status-line/__tests__/status-line.test.ts +215 -0
  82. package/src/status-line/index.ts +147 -0
  83. package/src/utils/__tests__/chalk-import.test.ts +32 -0
  84. package/src/utils/__tests__/display.test.ts +97 -0
  85. package/src/utils/__tests__/status-renderer.test.ts +310 -0
  86. package/src/utils/display.ts +62 -0
  87. package/src/utils/status-renderer.ts +188 -0
  88. package/src/version.ts +5 -0
  89. package/dist/server/index.js +0 -86958
package/README.md CHANGED
@@ -2,10 +2,14 @@
2
2
 
3
3
  Agent-orchestrated, spec-driven workflow for Claude Code.
4
4
 
5
+ ## Prerequisites
6
+
7
+ This plugin requires [Bun](https://bun.sh). If you don't have Bun installed, the installer will offer to install it for you.
8
+
5
9
  ## Installation
6
10
 
7
11
  ```bash
8
- npx @cliangdev/flux-plugin
12
+ bunx @cliangdev/flux-plugin
9
13
  ```
10
14
 
11
15
  This installs:
@@ -16,8 +20,8 @@ This installs:
16
20
  ### Options
17
21
 
18
22
  ```bash
19
- npx @cliangdev/flux-plugin --global # Install to ~/.claude (all projects)
20
- npx @cliangdev/flux-plugin --local # Install to ./.claude (current project)
23
+ bunx @cliangdev/flux-plugin --global # Install to ~/.claude (all projects)
24
+ bunx @cliangdev/flux-plugin --local # Install to ./.claude (current project)
21
25
  ```
22
26
 
23
27
  ### What Gets Configured
@@ -121,7 +125,7 @@ your-project/
121
125
  To update to the latest version, simply re-run the installer:
122
126
 
123
127
  ```bash
124
- npx @cliangdev/flux-plugin@latest --global
128
+ bunx @cliangdev/flux-plugin@latest --global
125
129
  ```
126
130
 
127
131
  This will:
package/bin/install.cjs CHANGED
@@ -4,22 +4,45 @@ const fs = require("fs");
4
4
  const path = require("path");
5
5
  const os = require("os");
6
6
  const readline = require("readline");
7
+ const { execSync, spawn } = require("child_process");
7
8
 
8
9
  const args = process.argv.slice(2);
9
10
 
10
11
  if (args[0] === "serve") {
11
- import("../dist/server/index.js").catch((err) => {
12
+ const serverSrc = path.join(__dirname, "..", "src", "server", "index.ts");
13
+ const bunPath = getBunPath();
14
+ if (!bunPath) {
15
+ console.error("Failed to start Flux MCP server: Bun is required but not found");
16
+ process.exit(1);
17
+ }
18
+ const child = spawn(bunPath, ["run", serverSrc], { stdio: "inherit" });
19
+ child.on("error", (err) => {
12
20
  console.error("Failed to start Flux MCP server:", err.message);
13
21
  process.exit(1);
14
22
  });
23
+ child.on("close", (code) => process.exit(code || 0));
15
24
  } else {
16
25
  runInstaller();
17
26
  }
18
27
 
28
+ function getBunPath() {
29
+ const bunDir = path.join(os.homedir(), ".bun", "bin");
30
+ const bunBinary = process.platform === "win32" ? "bun.exe" : "bun";
31
+ const localBunPath = path.join(bunDir, bunBinary);
32
+ if (fs.existsSync(localBunPath)) return localBunPath;
33
+ try {
34
+ execSync("bun --version", { stdio: "ignore" });
35
+ return "bun";
36
+ } catch {
37
+ return null;
38
+ }
39
+ }
40
+
19
41
  function runInstaller() {
20
42
  const cyan = "\x1b[36m";
21
43
  const green = "\x1b[32m";
22
44
  const yellow = "\x1b[33m";
45
+ const red = "\x1b[31m";
23
46
  const dim = "\x1b[2m";
24
47
  const reset = "\x1b[0m";
25
48
  const pkg = require("../package.json");
@@ -43,7 +66,7 @@ ${cyan} ███████╗██╗ ██╗ ██╗██╗
43
66
  console.log(banner);
44
67
 
45
68
  if (hasHelp) {
46
- console.log(` ${yellow}Usage:${reset} npx @cliangdev/flux-plugin [options]
69
+ console.log(` ${yellow}Usage:${reset} bunx @cliangdev/flux-plugin [options]
47
70
 
48
71
  ${yellow}Options:${reset}
49
72
  ${cyan}-g, --global${reset} Install globally (to ~/.claude)
@@ -52,17 +75,123 @@ ${cyan} ███████╗██╗ ██╗ ██╗██╗
52
75
 
53
76
  ${yellow}Examples:${reset}
54
77
  ${dim}# Interactive installation${reset}
55
- npx @cliangdev/flux-plugin
78
+ bunx @cliangdev/flux-plugin
56
79
 
57
80
  ${dim}# Install globally (all projects)${reset}
58
- npx @cliangdev/flux-plugin --global
81
+ bunx @cliangdev/flux-plugin --global
59
82
 
60
83
  ${dim}# Install locally (current project only)${reset}
61
- npx @cliangdev/flux-plugin --local
84
+ bunx @cliangdev/flux-plugin --local
85
+
86
+ ${yellow}Note:${reset} This plugin requires Bun. Install from https://bun.sh
62
87
  `);
63
88
  process.exit(0);
64
89
  }
65
90
 
91
+ function isBunInstalled() {
92
+ const bunDir = path.join(os.homedir(), ".bun", "bin");
93
+ const envPath = process.env.PATH || "";
94
+ const pathWithBun = envPath.includes(bunDir)
95
+ ? envPath
96
+ : `${bunDir}${path.delimiter}${envPath}`;
97
+
98
+ try {
99
+ execSync("bun --version", {
100
+ stdio: "ignore",
101
+ env: { ...process.env, PATH: pathWithBun },
102
+ });
103
+ return true;
104
+ } catch {
105
+ return false;
106
+ }
107
+ }
108
+
109
+ function installBun() {
110
+ return new Promise((resolve, reject) => {
111
+ const platform = os.platform();
112
+ const installCmd = platform === "win32" ? "powershell" : "/bin/sh";
113
+ const installArgs = platform === "win32"
114
+ ? ["-c", "irm bun.sh/install.ps1 | iex"]
115
+ : ["-c", "curl -fsSL https://bun.sh/install | bash"];
116
+
117
+ console.log(`\n ${cyan}Installing Bun...${reset}\n`);
118
+
119
+ const child = spawn(installCmd, installArgs, {
120
+ stdio: "inherit",
121
+ shell: false,
122
+ });
123
+
124
+ child.on("close", (code) => {
125
+ if (code === 0) {
126
+ console.log(`\n ${green}✓${reset} Bun installed successfully\n`);
127
+ resolve(true);
128
+ } else {
129
+ reject(new Error(`Installation exited with code ${code}`));
130
+ }
131
+ });
132
+
133
+ child.on("error", (err) => {
134
+ reject(err);
135
+ });
136
+ });
137
+ }
138
+
139
+ function showBunInstallInstructions() {
140
+ console.log(`
141
+ ${yellow}Bun is required but not installed.${reset}
142
+
143
+ Install Bun manually:
144
+
145
+ ${cyan}macOS/Linux:${reset}
146
+ curl -fsSL https://bun.sh/install | bash
147
+
148
+ ${cyan}Windows:${reset}
149
+ powershell -c "irm bun.sh/install.ps1 | iex"
150
+
151
+ Then restart your terminal and run this installer again.
152
+
153
+ ${dim}Learn more: https://bun.sh${reset}
154
+ `);
155
+ }
156
+
157
+ async function checkBunAndContinue(callback) {
158
+ if (isBunInstalled()) {
159
+ callback();
160
+ return;
161
+ }
162
+
163
+ const rl = readline.createInterface({
164
+ input: process.stdin,
165
+ output: process.stdout,
166
+ });
167
+
168
+ console.log(` ${yellow}Bun is required but not installed.${reset}\n`);
169
+
170
+ rl.question(` Install Bun now? ${dim}[Y/n]${reset}: `, async (answer) => {
171
+ rl.close();
172
+ const shouldInstall = answer.trim().toLowerCase() !== "n";
173
+
174
+ if (shouldInstall) {
175
+ try {
176
+ await installBun();
177
+ if (isBunInstalled()) {
178
+ callback();
179
+ } else {
180
+ console.log(` ${yellow}Please restart your terminal to use Bun, then run the installer again.${reset}\n`);
181
+ process.exit(0);
182
+ }
183
+ } catch (err) {
184
+ console.log(`\n ${red}Failed to install Bun:${reset} ${err.message}\n`);
185
+ showBunInstallInstructions();
186
+ process.exit(1);
187
+ }
188
+ } else {
189
+ showBunInstallInstructions();
190
+ process.exit(1);
191
+ }
192
+ });
193
+ }
194
+
66
195
  function copyDir(src, dest) {
67
196
  fs.mkdirSync(dest, { recursive: true });
68
197
  const entries = fs.readdirSync(src, { withFileTypes: true });
@@ -167,24 +296,25 @@ ${cyan} ███████╗██╗ ██╗ ██╗██╗
167
296
  }
168
297
  }
169
298
 
170
- const claudeJsonPath = isGlobal
299
+ const mcpConfigPath = isGlobal
171
300
  ? path.join(os.homedir(), ".claude.json")
172
- : path.join(process.cwd(), ".claude.json");
301
+ : path.join(process.cwd(), ".mcp.json");
173
302
 
174
- const claudeJson = readJson(claudeJsonPath);
303
+ const mcpConfig = readJson(mcpConfigPath);
175
304
 
176
- if (!claudeJson.mcpServers) {
177
- claudeJson.mcpServers = {};
305
+ if (!mcpConfig.mcpServers) {
306
+ mcpConfig.mcpServers = {};
178
307
  }
179
308
 
180
- claudeJson.mcpServers.flux = {
181
- command: "npx",
182
- args: ["-y", "@cliangdev/flux-plugin", "serve"],
309
+ const versionTag = pkg.version.includes("-dev.") ? "latest" : pkg.version;
310
+ mcpConfig.mcpServers.flux = {
311
+ command: "bunx",
312
+ args: [`@cliangdev/flux-plugin@${versionTag}`, "serve"],
183
313
  };
184
314
 
185
- writeJson(claudeJsonPath, claudeJson);
315
+ writeJson(mcpConfigPath, mcpConfig);
186
316
  console.log(
187
- ` ${green}✓${reset} Configured MCP server in ${isGlobal ? "~/.claude.json" : "./.claude.json"}`
317
+ ` ${green}✓${reset} Configured MCP server in ${isGlobal ? "~/.claude.json" : "./.mcp.json"}`
188
318
  );
189
319
 
190
320
  const versionFile = path.join(claudeDir, "flux-version");
@@ -222,14 +352,18 @@ ${cyan} ███████╗██╗ ██╗ ██╗██╗
222
352
  });
223
353
  }
224
354
 
225
- if (hasGlobal && hasLocal) {
226
- console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
227
- process.exit(1);
228
- } else if (hasGlobal) {
229
- install(true);
230
- } else if (hasLocal) {
231
- install(false);
232
- } else {
233
- promptLocation();
355
+ function startInstallation() {
356
+ if (hasGlobal && hasLocal) {
357
+ console.error(` ${yellow}Cannot specify both --global and --local${reset}`);
358
+ process.exit(1);
359
+ } else if (hasGlobal) {
360
+ install(true);
361
+ } else if (hasLocal) {
362
+ install(false);
363
+ } else {
364
+ promptLocation();
365
+ }
234
366
  }
367
+
368
+ checkBunAndContinue(startInstallation);
235
369
  }
package/commands/flux.md CHANGED
@@ -1,113 +1,156 @@
1
1
  ---
2
2
  name: flux
3
3
  description: AI-first workflow orchestration for spec-driven development
4
- allowed-tools: mcp__flux__*
4
+ allowed-tools: mcp__plugin_flux_flux__*, AskUserQuestion, Read, Write
5
5
  ---
6
6
 
7
- # Flux Orchestrator
7
+ # Flux Command
8
+
9
+ You are the Flux orchestrator. Detect project state and guide the user to the appropriate next action.
10
+
11
+ ## Subcommands
8
12
 
9
- You are the Flux orchestrator. Your job is to detect the project state and guide the user through the appropriate workflow.
13
+ - `/flux version` - Show plugin version (call `get_version`)
14
+ - `/flux linear` - Connect to Linear (delegate to `/flux:linear`)
10
15
 
11
- ## Step 0: Check for Version Subcommand
16
+ ## Main Flow
17
+
18
+ ### Step 1: Get Project Context
12
19
 
13
- First, check if the user requested version information:
14
- - `/flux version` - Show version information
20
+ Call `get_project_context` to check project state.
15
21
 
16
- If the argument is "version":
22
+ ### Step 2: Route Based on State
17
23
 
18
- 1. Call the `get_version` MCP tool
19
- 2. Display the version information in a friendly format:
20
- ```
21
- Flux Plugin v{version}
22
- Package: @cliangdev/{name}
23
- ```
24
- 3. Exit (do not proceed to project state check)
24
+ **If `initialized: false`:**
25
+ Guide through initialization (see Initialization Flow below)
25
26
 
26
- ## Step 1: Check Project State
27
+ **If `initialized: true`:**
28
+ → Call `render_status` with `{view: "summary"}` to show current state
29
+ → Determine next action based on workflow state (see Workflow States)
27
30
 
28
- If no subcommand was provided, call the `get_project_context` MCP tool to check if this is a Flux project.
31
+ ## Initialization Flow
29
32
 
30
- ## Step 2: Handle Result
33
+ Use the `AskUserQuestion` tool for all questions during initialization.
31
34
 
32
- ### If `initialized: false` (New Project)
35
+ ### Step 1: Confirm Initialization
33
36
 
34
- This is a new project. Guide the user through initialization:
37
+ Use AskUserQuestion:
38
+ ```json
39
+ {
40
+ "questions": [{
41
+ "question": "No Flux project found. Would you like to initialize one?",
42
+ "header": "Initialize",
43
+ "options": [
44
+ {"label": "Yes", "description": "Create a new Flux project in this directory"},
45
+ {"label": "No", "description": "Cancel initialization"}
46
+ ],
47
+ "multiSelect": false
48
+ }]
49
+ }
50
+ ```
35
51
 
36
- 1. Ask: "No Flux project found in this directory. Would you like to initialize one?"
37
- - If no, end with: "Run `/flux` when you're ready to set up Flux."
52
+ If "No", exit with: "Run `/flux` when you're ready to set up Flux."
38
53
 
39
- 2. Ask: "What is the name of this project?"
40
- - Wait for response
54
+ ### Step 2: Collect Project Details
41
55
 
42
- 3. Ask: "Brief vision - what does this project do? (one sentence)"
43
- - Wait for response
56
+ Use AskUserQuestion with text input (user will select "Other" to type):
57
+ - Ask for project name
58
+ - Ask for project vision (brief description)
44
59
 
45
- 4. Call `init_project` tool with the name and vision
60
+ ### Step 3: Select Storage Backend
46
61
 
47
- 5. Display success message:
48
- ```
49
- Flux project initialized!
62
+ Use AskUserQuestion:
63
+ ```json
64
+ {
65
+ "questions": [{
66
+ "question": "Where should Flux store data?",
67
+ "header": "Storage",
68
+ "options": [
69
+ {"label": "Local (Recommended)", "description": "SQLite database in .flux/ - offline-first, no setup required"},
70
+ {"label": "Linear", "description": "Sync with Linear for team collaboration and issue tracking"}
71
+ ],
72
+ "multiSelect": false
73
+ }]
74
+ }
75
+ ```
50
76
 
51
- Project: {name}
52
- Vision: {vision}
53
- Reference prefix: {ref_prefix}
77
+ ### Step 4: Ask About Tool Permissions
54
78
 
55
- Created:
56
- - .flux/project.json
57
- - .flux/flux.db
79
+ Use AskUserQuestion:
80
+ ```json
81
+ {
82
+ "questions": [{
83
+ "question": "Add Flux tools to allow list? This prevents permission prompts for Flux operations.",
84
+ "header": "Permissions",
85
+ "options": [
86
+ {"label": "Yes (Recommended)", "description": "Allow all Flux MCP tools without prompting"},
87
+ {"label": "No", "description": "Ask for permission each time"}
88
+ ],
89
+ "multiSelect": false
90
+ }]
91
+ }
92
+ ```
58
93
 
59
- Next: Run /flux:prd to start planning your first PRD.
60
- ```
94
+ If "Yes", update the settings file:
61
95
 
62
- ### If Project Exists (Initialized)
96
+ 1. Read `.claude/settings.local.json` (create if doesn't exist)
97
+ 2. Parse JSON (or start with `{"permissions": {"allow": []}}` if empty/missing)
98
+ 3. Add `"mcp__plugin_flux_flux__*"` to `permissions.allow` array if not already present
99
+ 4. Write back to `.claude/settings.local.json`
63
100
 
64
- This is an existing Flux project. Show status and suggest next action:
101
+ Example result:
102
+ ```json
103
+ {
104
+ "permissions": {
105
+ "allow": ["mcp__plugin_flux_flux__*"]
106
+ }
107
+ }
108
+ ```
65
109
 
66
- 1. Call `get_stats` to get entity counts
67
-
68
- 2. Display status summary:
69
- ```
70
- Project: {name}
71
- Vision: {vision}
72
-
73
- Status:
74
- - PRDs: {total} ({draft} draft, {pending_review} in review, {approved} approved)
75
- - Epics: {total} ({pending} pending, {in_progress} active, {completed} done)
76
- - Tasks: {total} ({pending} pending, {in_progress} active, {completed} done)
77
- ```
78
-
79
- 3. Determine and suggest next action based on state:
80
-
81
- **If no PRDs exist:**
82
- > "No PRDs yet. Run `/flux:prd` to create your first product requirements document."
83
-
84
- **If PRDs exist with DRAFT status:**
85
- > "You have draft PRDs. Review them and run `/flux:prd refine` or submit for review."
86
-
87
- **If PRDs in PENDING_REVIEW:**
88
- > "PRDs pending review. The critique agent will analyze feasibility and risks."
89
-
90
- **If PRDs in REVIEWED status:**
91
- > "Critique complete. Review feedback, then approve or revise the PRD."
92
-
93
- **If PRDs APPROVED but no epics:**
94
- > "PRDs approved! Run `/flux:breakdown` to break them into epics and tasks."
95
-
96
- **If PRDs BREAKDOWN_READY with epics/tasks:**
97
- > "Ready to implement! Run `/flux:implement` to start working on tasks."
98
-
99
- **If tasks exist with PENDING status:**
100
- > "Tasks ready. Run `/flux:implement` to start working."
101
-
102
- **If tasks IN_PROGRESS:**
103
- > "Implementation in progress. Run `/flux:implement` to continue."
104
-
105
- **If all tasks COMPLETED:**
106
- > "All tasks complete! Review your work and create a PR."
110
+ Confirm to user: "Flux tools added to allow list. No more permission prompts for Flux operations."
111
+
112
+ ### Step 5: Initialize Project
113
+
114
+ Call `init_project` with collected values:
115
+ - `name`: project name
116
+ - `vision`: project vision
117
+ - `adapter`: "local" or "linear"
118
+
119
+ ### Step 6: Next Steps
120
+
121
+ Display success message, then:
122
+
123
+ - **If Local**: "Project initialized! Run `/flux:prd` to create your first PRD."
124
+ - **If Linear**: "Project initialized! Now run `/flux:linear` to connect to Linear."
125
+
126
+ ## Workflow States
127
+
128
+ Detect current state and suggest the appropriate next action:
129
+
130
+ | State | Detection | Next Action |
131
+ |-------|-----------|-------------|
132
+ | No PRDs | `prds.total == 0` | `/flux:prd` to create first PRD |
133
+ | Draft PRDs | PRDs in DRAFT | Review and refine or submit for review |
134
+ | Pending Review | PRDs in PENDING_REVIEW | Critique agent will analyze |
135
+ | Reviewed | PRDs in REVIEWED | Address feedback, approve or revise |
136
+ | Approved | PRDs in APPROVED, no epics | `/flux:breakdown` to create epics |
137
+ | Breakdown Ready | PRDs in BREAKDOWN_READY | `/flux:implement` to start coding |
138
+ | In Progress | Tasks IN_PROGRESS | Continue with `/flux:implement` |
139
+ | Complete | All tasks COMPLETED | Create PR |
140
+
141
+ ## Confidence-Based Autonomy
142
+
143
+ When determining actions:
144
+
145
+ | Confidence | Behavior |
146
+ |------------|----------|
147
+ | > 80% | Auto-execute, inform user |
148
+ | 50-80% | Suggest action, wait for confirmation |
149
+ | < 50% | Ask clarifying question |
107
150
 
108
151
  ## Guidelines
109
152
 
110
- - Be concise - users want quick status, not essays
111
- - One question at a time during initialization
112
- - Show actionable next steps
113
- - Use the MCP tools, don't read filesystem directly
153
+ - Use `AskUserQuestion` tool for all user choices during initialization
154
+ - Be concise - show status and one clear next action
155
+ - Use `render_status` for visual project overview
156
+ - Apply confidence-based autonomy for decisions