@cliangdev/flux-plugin 0.2.0-dev.dc5e2c4 → 0.2.0-dev.e8f7aab
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/agents/coder.md +150 -25
- package/bin/install.cjs +22 -1
- package/commands/breakdown.md +47 -10
- package/commands/dashboard.md +29 -0
- package/commands/flux.md +92 -12
- package/commands/implement.md +166 -17
- package/commands/linear.md +6 -5
- package/commands/prd.md +996 -82
- package/manifest.json +2 -1
- package/package.json +4 -2
- package/skills/flux-orchestrator/SKILL.md +11 -3
- package/skills/prd-writer/SKILL.md +761 -0
- package/skills/ux-ui-design/SKILL.md +346 -0
- package/skills/ux-ui-design/references/design-tokens.md +359 -0
- package/src/dashboard/__tests__/api.test.ts +211 -0
- package/src/dashboard/browser.ts +35 -0
- package/src/dashboard/public/app.js +869 -0
- package/src/dashboard/public/index.html +90 -0
- package/src/dashboard/public/styles.css +807 -0
- package/src/dashboard/public/vendor/highlight.css +10 -0
- package/src/dashboard/public/vendor/highlight.min.js +8422 -0
- package/src/dashboard/public/vendor/marked.min.js +2210 -0
- package/src/dashboard/server.ts +296 -0
- package/src/dashboard/watchers.ts +83 -0
- package/src/server/adapters/__tests__/dependency-ops.test.ts +52 -18
- package/src/server/adapters/linear/adapter.ts +19 -14
- package/src/server/adapters/local-adapter.ts +48 -7
- package/src/server/db/__tests__/queries.test.ts +2 -1
- package/src/server/db/schema.ts +9 -0
- package/src/server/index.ts +0 -2
- package/src/server/tools/__tests__/crud.test.ts +111 -1
- package/src/server/tools/__tests__/mcp-interface.test.ts +100 -9
- package/src/server/tools/__tests__/query.test.ts +73 -21
- package/src/server/tools/__tests__/z-configure-linear.test.ts +1 -1
- package/src/server/tools/__tests__/z-get-linear-url.test.ts +1 -1
- package/src/server/tools/create-epic.ts +11 -2
- package/src/server/tools/create-prd.ts +11 -2
- package/src/server/tools/create-task.ts +11 -2
- package/src/server/tools/dependencies.ts +2 -2
- package/src/server/tools/get-entity.ts +12 -10
- package/src/server/tools/index.ts +53 -9
- package/src/server/tools/init-project.ts +1 -1
- package/src/server/tools/render-status.ts +38 -20
- package/src/status-line/__tests__/status-line.test.ts +1 -1
- package/src/utils/status-renderer.ts +32 -6
- package/skills/prd-template/SKILL.md +0 -242
- package/src/server/tools/get-project-context.ts +0 -33
package/README.md
CHANGED
|
@@ -36,7 +36,7 @@ The installer automatically:
|
|
|
36
36
|
| Command | Purpose |
|
|
37
37
|
|---------|---------|
|
|
38
38
|
| `/flux` | Smart entry point - shows status and guides you to the next step |
|
|
39
|
-
| `/flux:prd` | Create
|
|
39
|
+
| `/flux:prd` | Create PRDs through discovery, research, and guided writing |
|
|
40
40
|
| `/flux:breakdown` | Break PRDs into epics and tasks with acceptance criteria |
|
|
41
41
|
| `/flux:implement` | Implement tasks with TDD workflow |
|
|
42
42
|
|
|
@@ -143,7 +143,7 @@ Check your current version:
|
|
|
143
143
|
|
|
144
144
|
```bash
|
|
145
145
|
rm -rf ~/.claude/commands/flux.md ~/.claude/commands/flux
|
|
146
|
-
rm -rf ~/.claude/skills/agent-creator ~/.claude/skills/epic-template ~/.claude/skills/flux-orchestrator ~/.claude/skills/prd-
|
|
146
|
+
rm -rf ~/.claude/skills/agent-creator ~/.claude/skills/epic-template ~/.claude/skills/flux-orchestrator ~/.claude/skills/prd-writer
|
|
147
147
|
rm -f ~/.claude/flux-version
|
|
148
148
|
# Edit ~/.claude.json and remove the "flux" entry from "mcpServers"
|
|
149
149
|
```
|
|
@@ -152,7 +152,7 @@ rm -f ~/.claude/flux-version
|
|
|
152
152
|
|
|
153
153
|
```bash
|
|
154
154
|
rm -rf .claude/commands/flux.md .claude/commands/flux
|
|
155
|
-
rm -rf .claude/skills/agent-creator .claude/skills/epic-template .claude/skills/flux-orchestrator .claude/skills/prd-
|
|
155
|
+
rm -rf .claude/skills/agent-creator .claude/skills/epic-template .claude/skills/flux-orchestrator .claude/skills/prd-writer
|
|
156
156
|
rm -f .claude/flux-version
|
|
157
157
|
# Edit .claude.json and remove the "flux" entry from "mcpServers"
|
|
158
158
|
```
|
package/agents/coder.md
CHANGED
|
@@ -20,30 +20,41 @@ You receive only:
|
|
|
20
20
|
|
|
21
21
|
This keeps your context clean for high-quality code output.
|
|
22
22
|
|
|
23
|
-
## Step 1:
|
|
23
|
+
## Step 1: Apply Project Skill
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The orchestrator should provide a **Project Skill** section in your prompt with patterns to follow. If provided, strictly follow those patterns for:
|
|
26
|
+
- Code structure and organization
|
|
27
|
+
- Error handling conventions
|
|
28
|
+
- Testing patterns
|
|
29
|
+
- Naming conventions
|
|
30
|
+
|
|
31
|
+
### Fallback: Discover Skill Yourself
|
|
32
|
+
|
|
33
|
+
If no skill was provided in your prompt, discover and load it:
|
|
26
34
|
|
|
27
35
|
```bash
|
|
28
|
-
#
|
|
36
|
+
# 1. Detect project type
|
|
29
37
|
ls -la | head -20
|
|
38
|
+
|
|
39
|
+
# 2. Check for matching skill in .claude/skills/
|
|
40
|
+
ls .claude/skills/ 2>/dev/null
|
|
30
41
|
```
|
|
31
42
|
|
|
32
|
-
| File Found | Project Type | Skill
|
|
33
|
-
|
|
34
|
-
| `
|
|
35
|
-
| `
|
|
36
|
-
| `
|
|
37
|
-
| `package.json` +
|
|
38
|
-
| `
|
|
39
|
-
| `
|
|
40
|
-
| `requirements.txt` / `pyproject.toml` | Python | Python idioms |
|
|
43
|
+
| File Found | Project Type | Skill Search Pattern |
|
|
44
|
+
|------------|--------------|---------------------|
|
|
45
|
+
| `go.mod` | Go | `golang*`, `go-*` |
|
|
46
|
+
| `tsconfig.json` | TypeScript | `typescript*`, `ts-*` |
|
|
47
|
+
| `pom.xml` / `build.gradle` | Java/Spring | `java*`, `spring*` |
|
|
48
|
+
| `package.json` + react | React | `react*`, `ui-*` |
|
|
49
|
+
| `Cargo.toml` | Rust | `rust*` |
|
|
50
|
+
| `requirements.txt` | Python | `python*`, `py-*` |
|
|
41
51
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
52
|
+
```bash
|
|
53
|
+
# 3. Read matching skill
|
|
54
|
+
cat .claude/skills/{matched-skill}/SKILL.md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Apply the loaded skill patterns** - if no matching skill exists, use general best practices for that language.
|
|
47
58
|
|
|
48
59
|
## Step 2: Understand the Task
|
|
49
60
|
|
|
@@ -61,10 +72,11 @@ Acceptance Criteria:
|
|
|
61
72
|
|
|
62
73
|
## Step 3: Write Tests First (TDD)
|
|
63
74
|
|
|
75
|
+
### 3.1 Tests for Acceptance Criteria
|
|
76
|
+
|
|
64
77
|
For each `[auto]` criterion, write a failing test:
|
|
65
78
|
|
|
66
79
|
```typescript
|
|
67
|
-
// Example for TypeScript
|
|
68
80
|
describe('Login API', () => {
|
|
69
81
|
it('returns 401 for invalid credentials', async () => {
|
|
70
82
|
const response = await api.post('/login', {
|
|
@@ -82,6 +94,34 @@ describe('Login API', () => {
|
|
|
82
94
|
});
|
|
83
95
|
```
|
|
84
96
|
|
|
97
|
+
### 3.2 Tests for Critical Components
|
|
98
|
+
|
|
99
|
+
Beyond acceptance criteria, also test:
|
|
100
|
+
|
|
101
|
+
- **Core business logic**: Functions that make important decisions
|
|
102
|
+
- **Data transformations**: Parsing, validation, mapping functions
|
|
103
|
+
- **Error paths**: Edge cases and failure scenarios
|
|
104
|
+
- **Integration points**: API handlers, database operations
|
|
105
|
+
- **Utilities used in multiple places**: Shared helpers and utils
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
describe('SessionManager', () => {
|
|
109
|
+
it('expires sessions after TTL', async () => {
|
|
110
|
+
const session = await sessionManager.create(userId);
|
|
111
|
+
await advanceTime(SESSION_TTL + 1000);
|
|
112
|
+
expect(await sessionManager.isValid(session.id)).toBe(false);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('handles concurrent session creation', async () => {
|
|
116
|
+
const results = await Promise.all([
|
|
117
|
+
sessionManager.create(userId),
|
|
118
|
+
sessionManager.create(userId),
|
|
119
|
+
]);
|
|
120
|
+
expect(results[0].id).not.toBe(results[1].id);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
85
125
|
Run tests to confirm they fail:
|
|
86
126
|
```bash
|
|
87
127
|
bun test login.test.ts
|
|
@@ -103,6 +143,81 @@ Write minimal code to make tests pass:
|
|
|
103
143
|
bun test
|
|
104
144
|
```
|
|
105
145
|
|
|
146
|
+
## Code Quality Standards
|
|
147
|
+
|
|
148
|
+
### Write Clean, Modular, Testable Code
|
|
149
|
+
|
|
150
|
+
**Modularity**
|
|
151
|
+
- Small, focused functions that do one thing well
|
|
152
|
+
- Clear separation of concerns (business logic vs I/O vs presentation)
|
|
153
|
+
- Dependencies injected, not hardcoded - makes testing easy
|
|
154
|
+
- Extract reusable logic into well-named helper functions
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// ✅ Good: Modular, testable
|
|
158
|
+
function validateCredentials(email: string, password: string): ValidationResult {
|
|
159
|
+
if (!isValidEmail(email)) return { valid: false, error: 'Invalid email' };
|
|
160
|
+
if (password.length < 8) return { valid: false, error: 'Password too short' };
|
|
161
|
+
return { valid: true };
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async function login(credentials: Credentials, userRepo: UserRepository) {
|
|
165
|
+
const validation = validateCredentials(credentials.email, credentials.password);
|
|
166
|
+
if (!validation.valid) throw new ValidationError(validation.error);
|
|
167
|
+
return userRepo.findByEmail(credentials.email);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// ❌ Bad: Monolithic, hard to test
|
|
171
|
+
async function login(email: string, password: string) {
|
|
172
|
+
// validation mixed with business logic mixed with database calls
|
|
173
|
+
const db = getDatabase();
|
|
174
|
+
if (!email.includes('@')) throw new Error('bad email');
|
|
175
|
+
const user = await db.query('SELECT * FROM users WHERE email = ?', [email]);
|
|
176
|
+
// ... more mixed concerns
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Testability**
|
|
181
|
+
- Pure functions where possible (same input → same output)
|
|
182
|
+
- Side effects isolated and explicit
|
|
183
|
+
- Avoid global state
|
|
184
|
+
- Use interfaces/types for dependencies
|
|
185
|
+
|
|
186
|
+
### No Unnecessary Comments
|
|
187
|
+
|
|
188
|
+
Let code be self-documenting. Comments should explain **why**, not **what**.
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
// ❌ Bad: Comments that restate the code
|
|
192
|
+
// Check if user is admin
|
|
193
|
+
if (user.role === 'admin') {
|
|
194
|
+
// Grant admin access
|
|
195
|
+
grantAdminAccess(user);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ✅ Good: Code explains itself
|
|
199
|
+
if (user.role === 'admin') {
|
|
200
|
+
grantAdminAccess(user);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// ✅ Good: Comment explains non-obvious "why"
|
|
204
|
+
// Rate limit bypass for internal services to prevent cascade failures
|
|
205
|
+
if (request.source === 'internal') {
|
|
206
|
+
skipRateLimit = true;
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**When to comment:**
|
|
211
|
+
- Non-obvious business rules or edge cases
|
|
212
|
+
- Workarounds for external bugs/limitations
|
|
213
|
+
- Performance optimizations that sacrifice readability
|
|
214
|
+
- Public API documentation (JSDoc for library interfaces)
|
|
215
|
+
|
|
216
|
+
**Never comment:**
|
|
217
|
+
- What the code does (let naming convey this)
|
|
218
|
+
- Obvious operations
|
|
219
|
+
- Commented-out code (delete it, git has history)
|
|
220
|
+
|
|
106
221
|
## Step 5: Handle Manual Criteria
|
|
107
222
|
|
|
108
223
|
For `[manual]` criteria, add a comment or doc noting verification steps:
|
|
@@ -174,13 +289,23 @@ Needs:
|
|
|
174
289
|
|
|
175
290
|
## Boundaries
|
|
176
291
|
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
292
|
+
**DO:**
|
|
293
|
+
- Focus only on the assigned task
|
|
294
|
+
- Apply project skill patterns from your prompt (or discover them from `.claude/skills/`)
|
|
295
|
+
- Write tests before implementation
|
|
296
|
+
- Test critical components beyond just acceptance criteria
|
|
297
|
+
- Write clean, modular, testable code
|
|
298
|
+
- Use clear naming that makes code self-documenting
|
|
299
|
+
|
|
300
|
+
**DON'T:**
|
|
301
|
+
- Ignore provided skill patterns - they contain project-specific conventions
|
|
302
|
+
- Refactor unrelated code
|
|
303
|
+
- Add features not in acceptance criteria
|
|
304
|
+
- Skip tests for `[auto]` criteria
|
|
305
|
+
- Make commits without running tests
|
|
306
|
+
- Add comments that restate what code does
|
|
307
|
+
- Add unnecessary JSDoc/docstrings for simple functions
|
|
308
|
+
- Leave commented-out code
|
|
184
309
|
|
|
185
310
|
## Context Escalation
|
|
186
311
|
|
package/bin/install.cjs
CHANGED
|
@@ -21,6 +21,19 @@ if (args[0] === "serve") {
|
|
|
21
21
|
process.exit(1);
|
|
22
22
|
});
|
|
23
23
|
child.on("close", (code) => process.exit(code || 0));
|
|
24
|
+
} else if (args[0] === "dashboard") {
|
|
25
|
+
const dashboardSrc = path.join(__dirname, "..", "src", "dashboard", "server.ts");
|
|
26
|
+
const bunPath = getBunPath();
|
|
27
|
+
if (!bunPath) {
|
|
28
|
+
console.error("Failed to start Flux Dashboard: Bun is required but not found");
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
const child = spawn(bunPath, ["run", dashboardSrc], { stdio: "inherit" });
|
|
32
|
+
child.on("error", (err) => {
|
|
33
|
+
console.error("Failed to start Flux Dashboard:", err.message);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
});
|
|
36
|
+
child.on("close", (code) => process.exit(code || 0));
|
|
24
37
|
} else {
|
|
25
38
|
runInstaller();
|
|
26
39
|
}
|
|
@@ -66,7 +79,12 @@ ${cyan} ███████╗██╗ ██╗ ██╗██╗
|
|
|
66
79
|
console.log(banner);
|
|
67
80
|
|
|
68
81
|
if (hasHelp) {
|
|
69
|
-
console.log(` ${yellow}Usage:${reset} bunx @cliangdev/flux-plugin [options]
|
|
82
|
+
console.log(` ${yellow}Usage:${reset} bunx @cliangdev/flux-plugin [command] [options]
|
|
83
|
+
|
|
84
|
+
${yellow}Commands:${reset}
|
|
85
|
+
${cyan}(none)${reset} Run the installer (default)
|
|
86
|
+
${cyan}serve${reset} Start the MCP server
|
|
87
|
+
${cyan}dashboard${reset} Open the Flux Dashboard in browser
|
|
70
88
|
|
|
71
89
|
${yellow}Options:${reset}
|
|
72
90
|
${cyan}-g, --global${reset} Install globally (to ~/.claude)
|
|
@@ -83,6 +101,9 @@ ${cyan} ███████╗██╗ ██╗ ██╗██╗
|
|
|
83
101
|
${dim}# Install locally (current project only)${reset}
|
|
84
102
|
bunx @cliangdev/flux-plugin --local
|
|
85
103
|
|
|
104
|
+
${dim}# Open the dashboard${reset}
|
|
105
|
+
bunx @cliangdev/flux-plugin dashboard
|
|
106
|
+
|
|
86
107
|
${yellow}Note:${reset} This plugin requires Bun. Install from https://bun.sh
|
|
87
108
|
`);
|
|
88
109
|
process.exit(0);
|
package/commands/breakdown.md
CHANGED
|
@@ -16,12 +16,26 @@ Check if arguments were provided:
|
|
|
16
16
|
|
|
17
17
|
## Pre-checks
|
|
18
18
|
|
|
19
|
-
1.
|
|
20
|
-
- If
|
|
19
|
+
1. If no ref provided, call `query_entities` with type=prd, status=APPROVED
|
|
20
|
+
- If error with `code: "PROJECT_NOT_INITIALIZED"`, tell user: "Run `/flux` first to initialize the project." and exit.
|
|
21
21
|
|
|
22
|
-
2. If
|
|
22
|
+
2. If query successful but no approved PRDs found:
|
|
23
23
|
- If no approved PRDs, tell user: "No approved PRDs found. Approve a PRD first or run `/flux:prd` to create one."
|
|
24
|
-
- If multiple approved PRDs, use AskUserQuestion to let user select
|
|
24
|
+
- If multiple approved PRDs, use AskUserQuestion to let user select:
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"questions": [{
|
|
28
|
+
"question": "Which PRD would you like to break down?",
|
|
29
|
+
"header": "Select PRD",
|
|
30
|
+
"options": [
|
|
31
|
+
{"label": "{PRD-1 title}", "description": "{ref} - {brief description}"},
|
|
32
|
+
{"label": "{PRD-2 title}", "description": "{ref} - {brief description}"}
|
|
33
|
+
],
|
|
34
|
+
"multiSelect": false
|
|
35
|
+
}]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
Note: Dynamically populate options from the query results.
|
|
25
39
|
|
|
26
40
|
3. If ref provided, call `get_entity` with the ref
|
|
27
41
|
- Verify status is APPROVED
|
|
@@ -78,9 +92,21 @@ Which approach do you prefer?
|
|
|
78
92
|
|
|
79
93
|
1. Get PRD entity with `get_entity` including `include: ['epics']`
|
|
80
94
|
2. Read full PRD content from `folder_path + '/prd.md'` using Read tool
|
|
81
|
-
3. If PRD already has epics, inform user:
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
3. If PRD already has epics, inform user and use AskUserQuestion:
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"questions": [{
|
|
99
|
+
"question": "This PRD already has {count} epics. What would you like to do?",
|
|
100
|
+
"header": "Epics",
|
|
101
|
+
"options": [
|
|
102
|
+
{"label": "Add more epics", "description": "Keep existing epics and add new ones"},
|
|
103
|
+
{"label": "View existing", "description": "See current epic structure before deciding"},
|
|
104
|
+
{"label": "Start fresh", "description": "Delete existing epics and recreate from scratch"}
|
|
105
|
+
],
|
|
106
|
+
"multiSelect": false
|
|
107
|
+
}]
|
|
108
|
+
}
|
|
109
|
+
```
|
|
84
110
|
|
|
85
111
|
### Step 2: Analyze & Identify Epics
|
|
86
112
|
|
|
@@ -142,9 +168,20 @@ Ready to create these epics?
|
|
|
142
168
|
```
|
|
143
169
|
|
|
144
170
|
Use AskUserQuestion only when uncertain:
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
171
|
+
```json
|
|
172
|
+
{
|
|
173
|
+
"questions": [{
|
|
174
|
+
"question": "Ready to create these epics?",
|
|
175
|
+
"header": "Confirm",
|
|
176
|
+
"options": [
|
|
177
|
+
{"label": "Create all epics (Recommended)", "description": "Proceed with the proposed structure"},
|
|
178
|
+
{"label": "Modify structure first", "description": "Adjust epic boundaries or dependencies"},
|
|
179
|
+
{"label": "Add/remove epics", "description": "Change the number of epics"}
|
|
180
|
+
],
|
|
181
|
+
"multiSelect": false
|
|
182
|
+
}]
|
|
183
|
+
}
|
|
184
|
+
```
|
|
148
185
|
|
|
149
186
|
### Step 4: Create Epics
|
|
150
187
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flux:dashboard
|
|
3
|
+
description: Open the Flux Dashboard to visualize PRDs, epics, and tasks
|
|
4
|
+
allowed-tools: Bash
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Flux Dashboard
|
|
8
|
+
|
|
9
|
+
Launch the Flux Dashboard web interface to visualize project status.
|
|
10
|
+
|
|
11
|
+
## Instructions
|
|
12
|
+
|
|
13
|
+
Run the dashboard server:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bunx @cliangdev/flux-plugin dashboard
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This will:
|
|
20
|
+
1. Start the dashboard server on port 3333 (or next available)
|
|
21
|
+
2. Open the dashboard in the default browser
|
|
22
|
+
|
|
23
|
+
The dashboard shows:
|
|
24
|
+
- All PRDs with their epics and tasks
|
|
25
|
+
- Status indicators and progress
|
|
26
|
+
- Dependency graph visualization
|
|
27
|
+
- Detailed views for each entity
|
|
28
|
+
|
|
29
|
+
Tell the user the dashboard is starting and they can close it with Ctrl+C when done.
|
package/commands/flux.md
CHANGED
|
@@ -6,27 +6,78 @@ allowed-tools: mcp__plugin_flux_flux__*, AskUserQuestion, Read, Write
|
|
|
6
6
|
|
|
7
7
|
# Flux Command
|
|
8
8
|
|
|
9
|
-
You are the Flux orchestrator
|
|
9
|
+
You are the Flux orchestrator - the main entry point for all Flux operations. Your job is to:
|
|
10
|
+
1. Detect project state and guide users to the appropriate next action
|
|
11
|
+
2. Route to specialized commands based on user input
|
|
12
|
+
3. Provide intelligent suggestions based on workflow state
|
|
13
|
+
|
|
14
|
+
## Available Commands
|
|
15
|
+
|
|
16
|
+
| Command | Description |
|
|
17
|
+
|---------|-------------|
|
|
18
|
+
| `/flux` | Show project status and suggest next action |
|
|
19
|
+
| `/flux:prd` | Create or refine PRDs through guided interview |
|
|
20
|
+
| `/flux:breakdown` | Break approved PRD into dependency-ordered epics and tasks |
|
|
21
|
+
| `/flux:implement` | Implement tasks with TDD workflow using specialized coding agents |
|
|
22
|
+
| `/flux:linear` | Connect Flux project to Linear for issue tracking |
|
|
23
|
+
|
|
24
|
+
## Subcommand Routing
|
|
25
|
+
|
|
26
|
+
When user provides arguments, route to the appropriate command:
|
|
27
|
+
|
|
28
|
+
| User Input | Action |
|
|
29
|
+
|------------|--------|
|
|
30
|
+
| `/flux` | Show status (see Main Flow) |
|
|
31
|
+
| `/flux version` | Call `get_version` and display result |
|
|
32
|
+
| `/flux status` | Call `render_status` with `{view: "full"}` |
|
|
33
|
+
| `/flux prd` or `/flux prd ...` | Delegate to `/flux:prd` with any additional args |
|
|
34
|
+
| `/flux breakdown` or `/flux breakdown ...` | Delegate to `/flux:breakdown` with any additional args |
|
|
35
|
+
| `/flux implement` or `/flux implement ...` | Delegate to `/flux:implement` with any additional args |
|
|
36
|
+
| `/flux linear` | Delegate to `/flux:linear` |
|
|
37
|
+
| `/flux help` | Show available commands and their purposes |
|
|
38
|
+
|
|
39
|
+
## Available MCP Tools
|
|
40
|
+
|
|
41
|
+
These tools are available for programmatic access:
|
|
42
|
+
|
|
43
|
+
**Entity Management:**
|
|
44
|
+
- `create_prd`, `create_epic`, `create_task` - Create entities
|
|
45
|
+
- `update_entity`, `update_status`, `delete_entity` - Modify entities
|
|
46
|
+
- `get_entity`, `query_entities` - Retrieve entities
|
|
47
|
+
|
|
48
|
+
**Project:**
|
|
49
|
+
- `init_project` - Initialize new Flux project
|
|
50
|
+
- `get_stats` - Get entity counts by status
|
|
51
|
+
- `get_version` - Get plugin version
|
|
52
|
+
- `render_status` - Visual project status with progress bars
|
|
53
|
+
|
|
54
|
+
**Relationships:**
|
|
55
|
+
- `add_dependency`, `remove_dependency` - Task/epic dependencies
|
|
56
|
+
- `add_criteria`, `mark_criteria_met` - Acceptance criteria
|
|
57
|
+
|
|
58
|
+
**Integration:**
|
|
59
|
+
- `configure_linear` - Connect to Linear (interactive mode supported)
|
|
10
60
|
|
|
11
|
-
##
|
|
61
|
+
## Main Flow
|
|
12
62
|
|
|
13
|
-
|
|
14
|
-
- `/flux linear` - Connect to Linear (delegate to `/flux:linear`)
|
|
63
|
+
### Step 0: Check for Subcommands
|
|
15
64
|
|
|
16
|
-
|
|
65
|
+
First, check if the user provided arguments (e.g., `/flux prd`, `/flux implement FP-T1`).
|
|
66
|
+
If so, route to the appropriate command as described in Subcommand Routing above.
|
|
17
67
|
|
|
18
|
-
### Step 1:
|
|
68
|
+
### Step 1: Check Project State
|
|
19
69
|
|
|
20
|
-
|
|
70
|
+
If no subcommand, call `render_status` with `{view: "summary"}` to show current state.
|
|
21
71
|
|
|
22
|
-
### Step 2: Route Based on
|
|
72
|
+
### Step 2: Route Based on Response
|
|
23
73
|
|
|
24
|
-
**If `
|
|
74
|
+
**If error with `code: "PROJECT_NOT_INITIALIZED"`:**
|
|
25
75
|
→ Guide through initialization (see Initialization Flow below)
|
|
26
76
|
|
|
27
|
-
**If
|
|
28
|
-
→
|
|
29
|
-
→
|
|
77
|
+
**If success:**
|
|
78
|
+
→ Display the rendered status
|
|
79
|
+
→ Analyze workflow state and suggest the most appropriate next action (see Workflow States)
|
|
80
|
+
→ If multiple actions are possible, use AskUserQuestion to let user choose
|
|
30
81
|
|
|
31
82
|
## Initialization Flow
|
|
32
83
|
|
|
@@ -148,9 +199,38 @@ When determining actions:
|
|
|
148
199
|
| 50-80% | Suggest action, wait for confirmation |
|
|
149
200
|
| < 50% | Ask clarifying question |
|
|
150
201
|
|
|
202
|
+
## Help Output
|
|
203
|
+
|
|
204
|
+
When user runs `/flux help`, display:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
Flux - AI-first workflow orchestration
|
|
208
|
+
|
|
209
|
+
Commands:
|
|
210
|
+
/flux Show project status and next action
|
|
211
|
+
/flux:prd Create or refine PRDs
|
|
212
|
+
/flux:breakdown Break PRD into epics and tasks
|
|
213
|
+
/flux:implement Implement tasks with TDD
|
|
214
|
+
/flux:linear Connect to Linear
|
|
215
|
+
|
|
216
|
+
Shortcuts:
|
|
217
|
+
/flux prd Same as /flux:prd
|
|
218
|
+
/flux breakdown Same as /flux:breakdown
|
|
219
|
+
/flux implement Same as /flux:implement
|
|
220
|
+
/flux status Show detailed project status
|
|
221
|
+
/flux version Show plugin version
|
|
222
|
+
|
|
223
|
+
Workflow:
|
|
224
|
+
1. /flux Initialize project (first time)
|
|
225
|
+
2. /flux:prd Create your first PRD
|
|
226
|
+
3. /flux:breakdown Break PRD into tasks
|
|
227
|
+
4. /flux:implement Start coding with TDD
|
|
228
|
+
```
|
|
229
|
+
|
|
151
230
|
## Guidelines
|
|
152
231
|
|
|
153
232
|
- Use `AskUserQuestion` tool for all user choices during initialization
|
|
154
233
|
- Be concise - show status and one clear next action
|
|
155
234
|
- Use `render_status` for visual project overview
|
|
156
235
|
- Apply confidence-based autonomy for decisions
|
|
236
|
+
- When user input matches a subcommand pattern, delegate immediately without calling render_status first
|