@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.
Files changed (48) hide show
  1. package/README.md +3 -3
  2. package/agents/coder.md +150 -25
  3. package/bin/install.cjs +22 -1
  4. package/commands/breakdown.md +47 -10
  5. package/commands/dashboard.md +29 -0
  6. package/commands/flux.md +92 -12
  7. package/commands/implement.md +166 -17
  8. package/commands/linear.md +6 -5
  9. package/commands/prd.md +996 -82
  10. package/manifest.json +2 -1
  11. package/package.json +4 -2
  12. package/skills/flux-orchestrator/SKILL.md +11 -3
  13. package/skills/prd-writer/SKILL.md +761 -0
  14. package/skills/ux-ui-design/SKILL.md +346 -0
  15. package/skills/ux-ui-design/references/design-tokens.md +359 -0
  16. package/src/dashboard/__tests__/api.test.ts +211 -0
  17. package/src/dashboard/browser.ts +35 -0
  18. package/src/dashboard/public/app.js +869 -0
  19. package/src/dashboard/public/index.html +90 -0
  20. package/src/dashboard/public/styles.css +807 -0
  21. package/src/dashboard/public/vendor/highlight.css +10 -0
  22. package/src/dashboard/public/vendor/highlight.min.js +8422 -0
  23. package/src/dashboard/public/vendor/marked.min.js +2210 -0
  24. package/src/dashboard/server.ts +296 -0
  25. package/src/dashboard/watchers.ts +83 -0
  26. package/src/server/adapters/__tests__/dependency-ops.test.ts +52 -18
  27. package/src/server/adapters/linear/adapter.ts +19 -14
  28. package/src/server/adapters/local-adapter.ts +48 -7
  29. package/src/server/db/__tests__/queries.test.ts +2 -1
  30. package/src/server/db/schema.ts +9 -0
  31. package/src/server/index.ts +0 -2
  32. package/src/server/tools/__tests__/crud.test.ts +111 -1
  33. package/src/server/tools/__tests__/mcp-interface.test.ts +100 -9
  34. package/src/server/tools/__tests__/query.test.ts +73 -21
  35. package/src/server/tools/__tests__/z-configure-linear.test.ts +1 -1
  36. package/src/server/tools/__tests__/z-get-linear-url.test.ts +1 -1
  37. package/src/server/tools/create-epic.ts +11 -2
  38. package/src/server/tools/create-prd.ts +11 -2
  39. package/src/server/tools/create-task.ts +11 -2
  40. package/src/server/tools/dependencies.ts +2 -2
  41. package/src/server/tools/get-entity.ts +12 -10
  42. package/src/server/tools/index.ts +53 -9
  43. package/src/server/tools/init-project.ts +1 -1
  44. package/src/server/tools/render-status.ts +38 -20
  45. package/src/status-line/__tests__/status-line.test.ts +1 -1
  46. package/src/utils/status-renderer.ts +32 -6
  47. package/skills/prd-template/SKILL.md +0 -242
  48. package/src/server/tools/get-project-context.ts +0 -33
@@ -53,8 +53,7 @@ The orchestrator resolves all refs to tasks, builds a dependency-ordered queue,
53
53
 
54
54
  ## Pre-checks
55
55
 
56
- 1. Call `get_project_context` to ensure Flux is initialized
57
- 2. Parse arguments and resolve to tasks:
56
+ 1. Parse arguments and resolve to tasks (if any tool returns `PROJECT_NOT_INITIALIZED` error, tell user: "Run `/flux` first to initialize the project." and exit):
58
57
  - No args: Query for next PENDING task with no blockers
59
58
  - PRD ref(s): Expand to all epics → all tasks
60
59
  - Epic ref(s): Expand to all tasks
@@ -62,8 +61,100 @@ The orchestrator resolves all refs to tasks, builds a dependency-ordered queue,
62
61
  - Mixed refs: Resolve each, deduplicate, merge
63
62
  - `tag:{name}`: Query PRDs by tag → expand all
64
63
 
64
+ 2. Git state check (REQUIRED before any implementation):
65
+ - Run `git status` to check for uncommitted changes
66
+ - If dirty working tree: Ask user whether to commit, stash, or abort
67
+ - Never proceed with uncommitted changes
68
+
65
69
  ## Workflow
66
70
 
71
+ ### Step 0: Git Branch Setup
72
+
73
+ **Always start from latest main with a fresh branch.** This ensures clean PRs and avoids merge conflicts.
74
+
75
+ #### 0.1 Ensure Clean State
76
+
77
+ ```bash
78
+ # Check for uncommitted changes
79
+ git status --porcelain
80
+ ```
81
+
82
+ If output is non-empty, use AskUserQuestion:
83
+ ```json
84
+ {
85
+ "questions": [{
86
+ "question": "You have uncommitted changes. How would you like to proceed?",
87
+ "header": "Git Status",
88
+ "options": [
89
+ {"label": "Commit them first", "description": "Stage and commit current changes before starting"},
90
+ {"label": "Stash them", "description": "Stash changes temporarily, restore after implementation"},
91
+ {"label": "Abort implementation", "description": "Stop here and handle changes manually"}
92
+ ],
93
+ "multiSelect": false
94
+ }]
95
+ }
96
+ ```
97
+
98
+ #### 0.2 Create Feature Branch from Latest Main
99
+
100
+ ```bash
101
+ # Fetch latest and create branch
102
+ git fetch origin main
103
+ git checkout -b {branch-name} origin/main
104
+ ```
105
+
106
+ #### 0.3 Branch Naming Convention
107
+
108
+ | Scope | Branch Name | Example |
109
+ |-------|-------------|---------|
110
+ | `tag:xxx` | `feat/tag-{tag}` | `feat/tag-phase-3` |
111
+ | Single PRD | `feat/{prd-ref}` | `feat/FLUX-P3` |
112
+ | Multiple PRDs | `feat/{first-prd-ref}` | `feat/FLUX-P3` |
113
+ | Single Epic | `feat/{epic-ref}` | `feat/FLUX-E14` |
114
+ | Multiple Epics | `feat/{first-epic-ref}` | `feat/FLUX-E14` |
115
+ | Single Task | `feat/{task-ref}` | `feat/FLUX-T31` |
116
+ | Multiple Tasks | `feat/{first-task-ref}` | `feat/FLUX-T31` |
117
+ | No args (next task) | `feat/{task-ref}` | `feat/FLUX-T42` |
118
+ | Mixed refs | `feat/{highest-level-ref}` | `feat/FLUX-P3` (PRD > Epic > Task) |
119
+
120
+ **Priority for mixed refs**: Use the highest-level entity (PRD > Epic > Task). If multiple of the same level, use the first one alphabetically.
121
+
122
+ #### 0.4 Handle Existing Branch
123
+
124
+ If the branch already exists:
125
+ ```bash
126
+ # Check if branch exists
127
+ git rev-parse --verify feat/FLUX-P3 2>/dev/null
128
+ ```
129
+
130
+ If branch exists, use AskUserQuestion:
131
+ ```json
132
+ {
133
+ "questions": [{
134
+ "question": "Branch 'feat/FLUX-P3' already exists. What would you like to do?",
135
+ "header": "Branch",
136
+ "options": [
137
+ {"label": "Continue on existing (Recommended)", "description": "Resume work on the existing branch"},
138
+ {"label": "Delete and recreate", "description": "Start fresh from latest main"},
139
+ {"label": "Use different name", "description": "Create a new branch with a different name"}
140
+ ],
141
+ "multiSelect": false
142
+ }]
143
+ }
144
+ ```
145
+
146
+ #### Example Output
147
+
148
+ ```
149
+ Git Setup:
150
+ ✓ Working tree clean
151
+ ✓ Fetched origin/main
152
+ ✓ Created branch: feat/tag-phase-3
153
+ └── Based on: origin/main (abc1234)
154
+
155
+ Ready to implement 3 PRDs (tag: phase-3)
156
+ ```
157
+
67
158
  ### Step 1: Gather Context
68
159
 
69
160
  Resolve all refs to a unified task list:
@@ -185,31 +276,87 @@ When spawning a coding subagent, provide this context:
185
276
  - Epic: {epic.ref} - {epic.title}
186
277
  - PRD: {prd.ref} (read if more context needed)
187
278
 
279
+ ## Project Skill (APPLY THESE PATTERNS)
280
+ {skillContent || "No project-specific skill found. Use general best practices for this language."}
281
+
188
282
  ## Workflow
189
- 1. Auto-detect project type and apply matching skill
283
+ 1. Apply the project skill patterns above (if provided)
190
284
  2. Write tests for each [auto] criterion FIRST
191
- 3. Implement until all tests pass
192
- 4. For [manual] criteria, document verification steps
193
- 5. Commit with message: "{task.ref}: {brief description}"
194
- 6. Report back: COMPLETED or BLOCKED (with reason)
285
+ 3. Write tests for critical components (business logic, data transformations, error paths)
286
+ 4. Implement until all tests pass
287
+ 5. For [manual] criteria, document verification steps
288
+ 6. Commit with message: "{task.ref}: {brief description}"
289
+ 7. Report back: COMPLETED or BLOCKED (with reason)
290
+
291
+ ## Code Quality Requirements
292
+ - Write clean, modular, testable code
293
+ - Small focused functions with clear separation of concerns
294
+ - Inject dependencies for testability
295
+ - NO unnecessary comments - let code be self-documenting
296
+ - Comments only for non-obvious "why", never for "what"
297
+ - No commented-out code
195
298
 
196
299
  ## Files to Focus On
197
300
  {relevantFiles}
198
301
  ```
199
302
 
200
- ## Skill Auto-Detection
303
+ **Note:** The orchestrator MUST discover and include skill content before spawning. See "Skill Discovery & Application" section above.
304
+
305
+ ## Skill Discovery & Application
306
+
307
+ Before spawning a coding subagent, discover and load relevant project skills.
308
+
309
+ ### Step 1: Detect Project Type
310
+
311
+ Check for project indicator files:
312
+
313
+ ```bash
314
+ ls -la | head -20
315
+ ```
316
+
317
+ | File Found | Project Type |
318
+ |------------|--------------|
319
+ | `go.mod` | Go |
320
+ | `tsconfig.json` | TypeScript |
321
+ | `pom.xml` / `build.gradle` | Java/Spring |
322
+ | `package.json` + react | React |
323
+ | `Cargo.toml` | Rust |
324
+ | `requirements.txt` / `pyproject.toml` | Python |
325
+
326
+ ### Step 2: Search for Matching Skills
327
+
328
+ Check `.claude/skills/` for project-specific skills:
329
+
330
+ ```bash
331
+ # List available skills
332
+ ls .claude/skills/ 2>/dev/null || echo "No skills directory"
333
+ ```
334
+
335
+ **Skill matching patterns:**
336
+
337
+ | Project Type | Skill Search Patterns |
338
+ |--------------|----------------------|
339
+ | Go | `golang*`, `go-*`, `go_*` |
340
+ | TypeScript | `typescript*`, `ts-*`, `ts_*` |
341
+ | Java/Spring | `java*`, `spring*`, `springboot*` |
342
+ | React | `react*`, `ui-*`, `frontend*` |
343
+ | Rust | `rust*` |
344
+ | Python | `python*`, `py-*` |
345
+
346
+ ### Step 3: Load Skill Content
347
+
348
+ If a matching skill is found, read its content:
349
+
350
+ ```bash
351
+ # Read skill content
352
+ cat .claude/skills/{skill-name}/SKILL.md
353
+ ```
201
354
 
202
- The coding subagent detects project type and applies matching skills:
355
+ ### Step 4: Pass Skill to Subagent
203
356
 
204
- | Detection | Skill | Patterns Applied |
205
- |-----------|-------|------------------|
206
- | `pom.xml` | `springboot-patterns` | DDD, transactions, Java style |
207
- | `tsconfig.json` | `typescript-patterns` | Async/await, typed errors |
208
- | `package.json` + React | `ui-patterns` | Components, Tailwind, dark mode |
209
- | `go.mod` | Go patterns | Error handling, interfaces |
210
- | `Cargo.toml` | Rust patterns | Result types, ownership |
357
+ Include the skill content in the coding subagent prompt (see template below).
211
358
 
212
- Detection happens at subagent spawn time by checking project root files.
359
+ **Important:** If no matching skill is found, the subagent falls back to general best practices for that language.
213
360
 
214
361
  ## Status Management
215
362
 
@@ -313,3 +460,5 @@ Action needed: Resolve blockers, then run `/flux:implement FP-T45`
313
460
  - **Fail fast**: Report blockers immediately
314
461
  - **One commit per task**: Keep history clean
315
462
  - **TDD always**: Tests before implementation
463
+ - **Test critical components**: Not just acceptance criteria - test business logic, transformations, error paths
464
+ - **Clean code**: Modular, testable, self-documenting - no unnecessary comments
@@ -21,13 +21,14 @@ The `configure_linear` tool supports progressive discovery:
21
21
 
22
22
  ## Flow
23
23
 
24
- ### Step 1: Verify Project
24
+ ### Step 1: Verify Project & Fetch Teams
25
25
 
26
- Call `get_project_context`.
26
+ Call `configure_linear` with `{interactive: true}`.
27
27
 
28
- - If `initialized: false` → Tell user to run `/flux` first, then exit.
29
- - If `adapter.type === "linear"` and config exists Already configured, show info and exit.
30
- - OtherwiseContinue to Step 2.
28
+ - If error with `code: "PROJECT_NOT_INITIALIZED"` → Tell user to run `/flux` first, then exit.
29
+ - If error about Linear API keyShow instructions (see Step 2 error handling).
30
+ - If success with `step: "already_configured"` Already configured, show info and exit.
31
+ - Otherwise → Continue with team selection (response contains teams list).
31
32
 
32
33
  ### Step 2: Fetch Teams
33
34