@cliangdev/flux-plugin 0.1.0 → 0.2.0-dev.4f12f3f

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 (99) hide show
  1. package/README.md +54 -21
  2. package/agents/coder.md +192 -0
  3. package/agents/critic.md +174 -0
  4. package/agents/researcher.md +146 -0
  5. package/agents/verifier.md +149 -0
  6. package/bin/install.cjs +369 -0
  7. package/commands/breakdown.md +4 -3
  8. package/commands/flux.md +218 -94
  9. package/commands/implement.md +2 -2
  10. package/commands/linear.md +172 -0
  11. package/commands/prd.md +4 -3
  12. package/manifest.json +15 -0
  13. package/package.json +15 -11
  14. package/skills/agent-creator/SKILL.md +2 -0
  15. package/skills/epic-template/SKILL.md +2 -0
  16. package/skills/flux-orchestrator/SKILL.md +60 -76
  17. package/skills/prd-template/SKILL.md +3 -1
  18. package/src/__tests__/version.test.ts +37 -0
  19. package/src/adapters/local/.gitkeep +0 -0
  20. package/src/server/__tests__/config.test.ts +163 -0
  21. package/src/server/adapters/__tests__/a-client-linear.test.ts +197 -0
  22. package/src/server/adapters/__tests__/adapter-factory.test.ts +230 -0
  23. package/src/server/adapters/__tests__/dependency-ops.test.ts +395 -0
  24. package/src/server/adapters/__tests__/document-ops.test.ts +306 -0
  25. package/src/server/adapters/__tests__/linear-adapter.test.ts +91 -0
  26. package/src/server/adapters/__tests__/linear-config.test.ts +425 -0
  27. package/src/server/adapters/__tests__/linear-criteria-parser.test.ts +287 -0
  28. package/src/server/adapters/__tests__/linear-description-test.ts +238 -0
  29. package/src/server/adapters/__tests__/linear-epic-crud.test.ts +496 -0
  30. package/src/server/adapters/__tests__/linear-mappers-description.test.ts +276 -0
  31. package/src/server/adapters/__tests__/linear-mappers-epic.test.ts +294 -0
  32. package/src/server/adapters/__tests__/linear-mappers-prd.test.ts +300 -0
  33. package/src/server/adapters/__tests__/linear-mappers-task.test.ts +197 -0
  34. package/src/server/adapters/__tests__/linear-prd-crud.test.ts +620 -0
  35. package/src/server/adapters/__tests__/linear-stats.test.ts +450 -0
  36. package/src/server/adapters/__tests__/linear-task-crud.test.ts +534 -0
  37. package/src/server/adapters/__tests__/linear-types.test.ts +243 -0
  38. package/src/server/adapters/__tests__/status-ops.test.ts +441 -0
  39. package/src/server/adapters/factory.ts +90 -0
  40. package/src/server/adapters/index.ts +9 -0
  41. package/src/server/adapters/linear/adapter.ts +1136 -0
  42. package/src/server/adapters/linear/client.ts +169 -0
  43. package/src/server/adapters/linear/config.ts +152 -0
  44. package/src/server/adapters/linear/helpers/criteria-parser.ts +197 -0
  45. package/src/server/adapters/linear/helpers/index.ts +7 -0
  46. package/src/server/adapters/linear/index.ts +16 -0
  47. package/src/server/adapters/linear/mappers/description.ts +136 -0
  48. package/src/server/adapters/linear/mappers/epic.ts +81 -0
  49. package/src/server/adapters/linear/mappers/index.ts +27 -0
  50. package/src/server/adapters/linear/mappers/prd.ts +178 -0
  51. package/src/server/adapters/linear/mappers/task.ts +82 -0
  52. package/src/server/adapters/linear/types.ts +264 -0
  53. package/src/server/adapters/local-adapter.ts +968 -0
  54. package/src/server/adapters/types.ts +293 -0
  55. package/src/server/config.ts +73 -0
  56. package/src/server/db/__tests__/queries.test.ts +472 -0
  57. package/src/server/db/ids.ts +17 -0
  58. package/src/server/db/index.ts +69 -0
  59. package/src/server/db/queries.ts +142 -0
  60. package/src/server/db/refs.ts +60 -0
  61. package/src/server/db/schema.ts +88 -0
  62. package/src/server/db/sqlite.ts +10 -0
  63. package/src/server/index.ts +81 -0
  64. package/src/server/tools/__tests__/crud.test.ts +301 -0
  65. package/src/server/tools/__tests__/get-version.test.ts +27 -0
  66. package/src/server/tools/__tests__/mcp-interface.test.ts +478 -0
  67. package/src/server/tools/__tests__/query.test.ts +334 -0
  68. package/src/server/tools/__tests__/z-configure-linear.test.ts +511 -0
  69. package/src/server/tools/__tests__/z-get-linear-url.test.ts +108 -0
  70. package/src/server/tools/configure-linear.ts +373 -0
  71. package/src/server/tools/create-epic.ts +35 -0
  72. package/src/server/tools/create-prd.ts +31 -0
  73. package/src/server/tools/create-task.ts +38 -0
  74. package/src/server/tools/criteria.ts +50 -0
  75. package/src/server/tools/delete-entity.ts +76 -0
  76. package/src/server/tools/dependencies.ts +55 -0
  77. package/src/server/tools/get-entity.ts +238 -0
  78. package/src/server/tools/get-linear-url.ts +28 -0
  79. package/src/server/tools/get-stats.ts +52 -0
  80. package/src/server/tools/get-version.ts +20 -0
  81. package/src/server/tools/index.ts +158 -0
  82. package/src/server/tools/init-project.ts +108 -0
  83. package/src/server/tools/query-entities.ts +167 -0
  84. package/src/server/tools/render-status.ts +201 -0
  85. package/src/server/tools/update-entity.ts +140 -0
  86. package/src/server/tools/update-status.ts +166 -0
  87. package/src/server/utils/__tests__/mcp-response.test.ts +331 -0
  88. package/src/server/utils/logger.ts +9 -0
  89. package/src/server/utils/mcp-response.ts +254 -0
  90. package/src/server/utils/status-transitions.ts +160 -0
  91. package/src/status-line/__tests__/status-line.test.ts +215 -0
  92. package/src/status-line/index.ts +147 -0
  93. package/src/utils/__tests__/chalk-import.test.ts +32 -0
  94. package/src/utils/__tests__/display.test.ts +97 -0
  95. package/src/utils/__tests__/status-renderer.test.ts +310 -0
  96. package/src/utils/display.ts +62 -0
  97. package/src/utils/status-renderer.ts +188 -0
  98. package/src/version.ts +5 -0
  99. package/dist/server/index.js +0 -86929
package/commands/flux.md CHANGED
@@ -1,112 +1,236 @@
1
1
  ---
2
+ name: flux
2
3
  description: AI-first workflow orchestration for spec-driven development
3
- allowed-tools: mcp__flux__*
4
+ allowed-tools: mcp__plugin_flux_flux__*, AskUserQuestion, Read, Write
4
5
  ---
5
6
 
6
- # Flux Orchestrator
7
+ # Flux Command
7
8
 
8
- You are the Flux orchestrator. Your job is to detect the project state and guide the user through the appropriate workflow.
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
9
13
 
10
- ## Step 0: Check for Version Subcommand
14
+ ## Available Commands
11
15
 
12
- First, check if the user requested version information:
13
- - `/flux version` - Show version information
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 |
14
23
 
15
- If the argument is "version":
24
+ ## Subcommand Routing
16
25
 
17
- 1. Call the `get_version` MCP tool
18
- 2. Display the version information in a friendly format:
19
- ```
20
- Flux Plugin v{version}
21
- Package: @cliangdev/{name}
22
- ```
23
- 3. Exit (do not proceed to project state check)
26
+ When user provides arguments, route to the appropriate command:
24
27
 
25
- ## Step 1: Check Project State
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)
60
+
61
+ ## Main Flow
62
+
63
+ ### Step 0: Check for Subcommands
64
+
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.
67
+
68
+ ### Step 1: Check Project State
69
+
70
+ If no subcommand, call `render_status` with `{view: "summary"}` to show current state.
71
+
72
+ ### Step 2: Route Based on Response
73
+
74
+ **If error with `code: "PROJECT_NOT_INITIALIZED"`:**
75
+ → Guide through initialization (see Initialization Flow below)
26
76
 
27
- If no subcommand was provided, call the `get_project_context` MCP tool to check if this is a Flux project.
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
28
81
 
29
- ## Step 2: Handle Result
82
+ ## Initialization Flow
30
83
 
31
- ### If `initialized: false` (New Project)
84
+ Use the `AskUserQuestion` tool for all questions during initialization.
85
+
86
+ ### Step 1: Confirm Initialization
87
+
88
+ Use AskUserQuestion:
89
+ ```json
90
+ {
91
+ "questions": [{
92
+ "question": "No Flux project found. Would you like to initialize one?",
93
+ "header": "Initialize",
94
+ "options": [
95
+ {"label": "Yes", "description": "Create a new Flux project in this directory"},
96
+ {"label": "No", "description": "Cancel initialization"}
97
+ ],
98
+ "multiSelect": false
99
+ }]
100
+ }
101
+ ```
102
+
103
+ If "No", exit with: "Run `/flux` when you're ready to set up Flux."
32
104
 
33
- This is a new project. Guide the user through initialization:
105
+ ### Step 2: Collect Project Details
34
106
 
35
- 1. Ask: "No Flux project found in this directory. Would you like to initialize one?"
36
- - If no, end with: "Run `/flux` when you're ready to set up Flux."
37
-
38
- 2. Ask: "What is the name of this project?"
39
- - Wait for response
40
-
41
- 3. Ask: "Brief vision - what does this project do? (one sentence)"
42
- - Wait for response
43
-
44
- 4. Call `init_project` tool with the name and vision
45
-
46
- 5. Display success message:
47
- ```
48
- Flux project initialized!
49
-
50
- Project: {name}
51
- Vision: {vision}
52
- Reference prefix: {ref_prefix}
53
-
54
- Created:
55
- - .flux/project.json
56
- - .flux/flux.db
57
-
58
- Next: Run /flux:prd to start planning your first PRD.
59
- ```
60
-
61
- ### If Project Exists (Initialized)
62
-
63
- This is an existing Flux project. Show status and suggest next action:
64
-
65
- 1. Call `get_stats` to get entity counts
66
-
67
- 2. Display status summary:
68
- ```
69
- Project: {name}
70
- Vision: {vision}
71
-
72
- Status:
73
- - PRDs: {total} ({draft} draft, {pending_review} in review, {approved} approved)
74
- - Epics: {total} ({pending} pending, {in_progress} active, {completed} done)
75
- - Tasks: {total} ({pending} pending, {in_progress} active, {completed} done)
76
- ```
77
-
78
- 3. Determine and suggest next action based on state:
79
-
80
- **If no PRDs exist:**
81
- > "No PRDs yet. Run `/flux:prd` to create your first product requirements document."
82
-
83
- **If PRDs exist with DRAFT status:**
84
- > "You have draft PRDs. Review them and run `/flux:prd refine` or submit for review."
85
-
86
- **If PRDs in PENDING_REVIEW:**
87
- > "PRDs pending review. The critique agent will analyze feasibility and risks."
88
-
89
- **If PRDs in REVIEWED status:**
90
- > "Critique complete. Review feedback, then approve or revise the PRD."
91
-
92
- **If PRDs APPROVED but no epics:**
93
- > "PRDs approved! Run `/flux:breakdown` to break them into epics and tasks."
94
-
95
- **If PRDs BREAKDOWN_READY with epics/tasks:**
96
- > "Ready to implement! Run `/flux:implement` to start working on tasks."
97
-
98
- **If tasks exist with PENDING status:**
99
- > "Tasks ready. Run `/flux:implement` to start working."
100
-
101
- **If tasks IN_PROGRESS:**
102
- > "Implementation in progress. Run `/flux:implement` to continue."
103
-
104
- **If all tasks COMPLETED:**
105
- > "All tasks complete! Review your work and create a PR."
107
+ Use AskUserQuestion with text input (user will select "Other" to type):
108
+ - Ask for project name
109
+ - Ask for project vision (brief description)
110
+
111
+ ### Step 3: Select Storage Backend
112
+
113
+ Use AskUserQuestion:
114
+ ```json
115
+ {
116
+ "questions": [{
117
+ "question": "Where should Flux store data?",
118
+ "header": "Storage",
119
+ "options": [
120
+ {"label": "Local (Recommended)", "description": "SQLite database in .flux/ - offline-first, no setup required"},
121
+ {"label": "Linear", "description": "Sync with Linear for team collaboration and issue tracking"}
122
+ ],
123
+ "multiSelect": false
124
+ }]
125
+ }
126
+ ```
127
+
128
+ ### Step 4: Ask About Tool Permissions
129
+
130
+ Use AskUserQuestion:
131
+ ```json
132
+ {
133
+ "questions": [{
134
+ "question": "Add Flux tools to allow list? This prevents permission prompts for Flux operations.",
135
+ "header": "Permissions",
136
+ "options": [
137
+ {"label": "Yes (Recommended)", "description": "Allow all Flux MCP tools without prompting"},
138
+ {"label": "No", "description": "Ask for permission each time"}
139
+ ],
140
+ "multiSelect": false
141
+ }]
142
+ }
143
+ ```
144
+
145
+ If "Yes", update the settings file:
146
+
147
+ 1. Read `.claude/settings.local.json` (create if doesn't exist)
148
+ 2. Parse JSON (or start with `{"permissions": {"allow": []}}` if empty/missing)
149
+ 3. Add `"mcp__plugin_flux_flux__*"` to `permissions.allow` array if not already present
150
+ 4. Write back to `.claude/settings.local.json`
151
+
152
+ Example result:
153
+ ```json
154
+ {
155
+ "permissions": {
156
+ "allow": ["mcp__plugin_flux_flux__*"]
157
+ }
158
+ }
159
+ ```
160
+
161
+ Confirm to user: "Flux tools added to allow list. No more permission prompts for Flux operations."
162
+
163
+ ### Step 5: Initialize Project
164
+
165
+ Call `init_project` with collected values:
166
+ - `name`: project name
167
+ - `vision`: project vision
168
+ - `adapter`: "local" or "linear"
169
+
170
+ ### Step 6: Next Steps
171
+
172
+ Display success message, then:
173
+
174
+ - **If Local**: "Project initialized! Run `/flux:prd` to create your first PRD."
175
+ - **If Linear**: "Project initialized! Now run `/flux:linear` to connect to Linear."
176
+
177
+ ## Workflow States
178
+
179
+ Detect current state and suggest the appropriate next action:
180
+
181
+ | State | Detection | Next Action |
182
+ |-------|-----------|-------------|
183
+ | No PRDs | `prds.total == 0` | `/flux:prd` to create first PRD |
184
+ | Draft PRDs | PRDs in DRAFT | Review and refine or submit for review |
185
+ | Pending Review | PRDs in PENDING_REVIEW | Critique agent will analyze |
186
+ | Reviewed | PRDs in REVIEWED | Address feedback, approve or revise |
187
+ | Approved | PRDs in APPROVED, no epics | `/flux:breakdown` to create epics |
188
+ | Breakdown Ready | PRDs in BREAKDOWN_READY | `/flux:implement` to start coding |
189
+ | In Progress | Tasks IN_PROGRESS | Continue with `/flux:implement` |
190
+ | Complete | All tasks COMPLETED | Create PR |
191
+
192
+ ## Confidence-Based Autonomy
193
+
194
+ When determining actions:
195
+
196
+ | Confidence | Behavior |
197
+ |------------|----------|
198
+ | > 80% | Auto-execute, inform user |
199
+ | 50-80% | Suggest action, wait for confirmation |
200
+ | < 50% | Ask clarifying question |
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
+ ```
106
229
 
107
230
  ## Guidelines
108
231
 
109
- - Be concise - users want quick status, not essays
110
- - One question at a time during initialization
111
- - Show actionable next steps
112
- - Use the MCP tools, don't read filesystem directly
232
+ - Use `AskUserQuestion` tool for all user choices during initialization
233
+ - Be concise - show status and one clear next action
234
+ - Use `render_status` for visual project overview
235
+ - Apply confidence-based autonomy for decisions
236
+ - When user input matches a subcommand pattern, delegate immediately without calling render_status first
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: flux:implement
2
3
  description: Implement epics and tasks with orchestrator/subagent architecture
3
4
  allowed-tools: mcp__flux__*, Read, Bash, Task, AskUserQuestion
4
5
  ---
@@ -52,8 +53,7 @@ The orchestrator resolves all refs to tasks, builds a dependency-ordered queue,
52
53
 
53
54
  ## Pre-checks
54
55
 
55
- 1. Call `get_project_context` to ensure Flux is initialized
56
- 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):
57
57
  - No args: Query for next PENDING task with no blockers
58
58
  - PRD ref(s): Expand to all epics → all tasks
59
59
  - Epic ref(s): Expand to all tasks
@@ -0,0 +1,172 @@
1
+ ---
2
+ name: flux:linear
3
+ description: Connect Flux project to Linear for issue tracking
4
+ allowed-tools: mcp__plugin_flux_flux__*, AskUserQuestion
5
+ ---
6
+
7
+ # Linear Integration Setup
8
+
9
+ Connect a Flux project to Linear using the interactive configuration flow.
10
+
11
+ ## How Interactive Mode Works
12
+
13
+ The `configure_linear` tool supports progressive discovery:
14
+
15
+ | Call | Response |
16
+ |------|----------|
17
+ | `{interactive: true}` | Returns `{step: "select_team", teams: [...], user: {...}}` |
18
+ | `{interactive: true, teamId: "xxx"}` | Returns `{step: "select_project", projects: [...], team: {...}}` |
19
+ | `{teamId: "xxx", projectName: "..."}` | Creates new project and configures |
20
+ | `{teamId: "xxx", existingProjectId: "..."}` | Uses existing project and configures |
21
+
22
+ ## Flow
23
+
24
+ ### Step 1: Verify Project & Fetch Teams
25
+
26
+ Call `configure_linear` with `{interactive: true}`.
27
+
28
+ - If error with `code: "PROJECT_NOT_INITIALIZED"` → Tell user to run `/flux` first, then exit.
29
+ - If error about Linear API key → Show 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).
32
+
33
+ ### Step 2: Fetch Teams
34
+
35
+ **IMPORTANT**: Call `configure_linear` with ONLY `interactive: true`. Do NOT pass teamId, projectName, or any other params.
36
+
37
+ ```json
38
+ {"interactive": true}
39
+ ```
40
+
41
+ This is the ONLY parameter needed for the first call. The tool will return available teams.
42
+
43
+ **If error** (e.g., "Linear API key not found"):
44
+ ```
45
+ Linear API key required.
46
+
47
+ 1. Get your key: Linear → Settings → API → Personal API keys
48
+ 2. Set it: export LINEAR_API_KEY=lin_api_xxx
49
+ 3. Run /flux:linear again
50
+ ```
51
+ Then exit.
52
+
53
+ **If success**, response will be:
54
+ ```json
55
+ {
56
+ "step": "select_team",
57
+ "user": {"name": "...", "email": "..."},
58
+ "teams": [
59
+ {"id": "team-abc", "name": "Engineering", "key": "ENG"},
60
+ {"id": "team-def", "name": "Product", "key": "PROD"}
61
+ ]
62
+ }
63
+ ```
64
+
65
+ Display: "Connected as {user.name} ({user.email})"
66
+
67
+ Use AskUserQuestion to let user select a team:
68
+ ```json
69
+ {
70
+ "questions": [{
71
+ "question": "Which Linear team should Flux use?",
72
+ "header": "Team",
73
+ "options": [
74
+ {"label": "Engineering (ENG)", "description": "team-abc"},
75
+ {"label": "Product (PROD)", "description": "team-def"}
76
+ ],
77
+ "multiSelect": false
78
+ }]
79
+ }
80
+ ```
81
+
82
+ Note: Put the team ID in the description field so you can retrieve it from the response.
83
+
84
+ ### Step 3: Fetch Projects
85
+
86
+ Call `configure_linear` with:
87
+ ```json
88
+ {"interactive": true, "teamId": "<selected_team_id>"}
89
+ ```
90
+
91
+ Response will be:
92
+ ```json
93
+ {
94
+ "step": "select_project",
95
+ "team": {"id": "...", "name": "...", "key": "..."},
96
+ "projects": [
97
+ {"id": "proj-123", "name": "Q1 Sprint", "state": "started"},
98
+ {"id": "proj-456", "name": "Backlog", "state": "planned"}
99
+ ]
100
+ }
101
+ ```
102
+
103
+ Use AskUserQuestion:
104
+ ```json
105
+ {
106
+ "questions": [{
107
+ "question": "Which project should Flux sync to?",
108
+ "header": "Project",
109
+ "options": [
110
+ {"label": "Create New Project", "description": "new"},
111
+ {"label": "Q1 Sprint", "description": "proj-123"},
112
+ {"label": "Backlog", "description": "proj-456"}
113
+ ],
114
+ "multiSelect": false
115
+ }]
116
+ }
117
+ ```
118
+
119
+ ### Step 4: Configure
120
+
121
+ **If user selected "Create New Project":**
122
+
123
+ Ask for project name, then call:
124
+ ```json
125
+ {
126
+ "teamId": "<team_id>",
127
+ "projectName": "<user_provided_name>"
128
+ }
129
+ ```
130
+
131
+ **If user selected existing project:**
132
+
133
+ Call:
134
+ ```json
135
+ {
136
+ "teamId": "<team_id>",
137
+ "existingProjectId": "<project_id>"
138
+ }
139
+ ```
140
+
141
+ ### Step 5: Success
142
+
143
+ Response will include:
144
+ ```json
145
+ {
146
+ "success": true,
147
+ "team": "Engineering",
148
+ "project": {"id": "...", "name": "..."},
149
+ "labels": {...},
150
+ "view": {"created": "...", "setup_hint": "..."}
151
+ }
152
+ ```
153
+
154
+ Display:
155
+ ```
156
+ Linear connected!
157
+
158
+ Team: {team}
159
+ Project: {project.name}
160
+
161
+ All PRDs, epics, and tasks will sync to Linear.
162
+ Run /flux:prd to create your first PRD.
163
+ ```
164
+
165
+ If `view.setup_hint` exists, show it as a tip.
166
+
167
+ ## Key Points
168
+
169
+ - Always use `{"interactive": true}` (boolean) not a string
170
+ - The response `step` field tells you what stage you're at
171
+ - Use AskUserQuestion for team/project selection
172
+ - Store the selected IDs from previous responses to use in next calls
package/commands/prd.md CHANGED
@@ -1,4 +1,5 @@
1
1
  ---
2
+ name: flux:prd
2
3
  description: Create or refine PRDs through guided interview
3
4
  allowed-tools: mcp__flux__*, AskUserQuestion
4
5
  ---
@@ -19,8 +20,8 @@ Check if arguments were provided:
19
20
 
20
21
  ### Pre-check
21
22
 
22
- 1. Call `get_project_context` to ensure Flux is initialized
23
- - If not initialized, tell user: "Run `/flux` first to initialize the project."
23
+ 1. Call `query_entities` with `type: "prd"` to verify project is initialized
24
+ - If error with `code: "PROJECT_NOT_INITIALIZED"`, tell user: "Run `/flux` first to initialize the project." and exit.
24
25
 
25
26
  2. Call `get_interview` to check for any in-progress interview
26
27
  - If exists, ask: "You have an unfinished interview. Resume it or start fresh?"
@@ -95,7 +96,7 @@ Use AskUserQuestion to confirm:
95
96
 
96
97
  ## After Interview Complete
97
98
 
98
- The `get_project_context` call from Pre-check returns the adapter type. Use this to determine storage behavior.
99
+ The `create_prd` response includes project context. Use it to determine storage behavior, or call `get_entity` on the created PRD to check the adapter type.
99
100
 
100
101
  ### For Local Adapter (`adapter.type === "local"`):
101
102
 
package/manifest.json ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "./manifest.schema.json",
3
+ "version": "1.0.0",
4
+ "structure": {
5
+ "commands": ["flux.md", "prd.md", "breakdown.md", "implement.md"],
6
+ "skills": [
7
+ "agent-creator",
8
+ "epic-template",
9
+ "flux-orchestrator",
10
+ "prd-template"
11
+ ],
12
+ "agents": ["coder.md", "critic.md", "researcher.md", "verifier.md"],
13
+ "hooks": []
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,32 +1,36 @@
1
1
  {
2
2
  "name": "@cliangdev/flux-plugin",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-dev.4f12f3f",
4
4
  "description": "Claude Code plugin for AI-first workflow orchestration with MCP server",
5
5
  "type": "module",
6
6
  "main": "./dist/server/index.js",
7
7
  "bin": {
8
- "flux-plugin": "./dist/server/index.js"
8
+ "flux-plugin": "./bin/install.cjs"
9
9
  },
10
10
  "files": [
11
- "dist/",
11
+ "bin/install.cjs",
12
+ "src/",
12
13
  "skills/",
13
- "commands/"
14
+ "commands/",
15
+ "agents/",
16
+ "manifest.json"
14
17
  ],
15
18
  "scripts": {
16
19
  "dev": "bun run src/server/index.ts",
17
- "build": "bun build src/server/index.ts --outdir dist/server --target node",
18
- "postbuild": "node -e \"const fs=require('fs');const f='dist/server/index.js';const c=fs.readFileSync(f,'utf-8');if(!c.startsWith('#!/usr/bin/env node')){fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c)}\"",
19
- "build:compile": "bun build --compile --outfile bin/flux-server src/server/index.ts && bun build --compile --outfile bin/flux-status src/status-line/index.ts",
20
- "build:compile:server": "bun build --compile --outfile bin/flux-server src/server/index.ts",
21
- "build:compile:status": "bun build --compile --outfile bin/flux-status src/status-line/index.ts",
22
- "prepublishOnly": "bun run build",
20
+ "build": "bun build --compile --outfile bin/flux-server src/server/index.ts && bun build --compile --outfile bin/flux-status src/status-line/index.ts",
21
+ "build:server": "bun build --compile --outfile bin/flux-server src/server/index.ts",
22
+ "build:status": "bun build --compile --outfile bin/flux-status src/status-line/index.ts",
23
+ "validate": "node scripts/validate-structure.cjs",
24
+ "test:integration": "bun test scripts/__tests__/integration.test.ts --timeout 120000",
25
+ "prepublishOnly": "bun run validate && bun run test:integration",
23
26
  "test": "bun test",
24
27
  "test:linear-description": "bun run src/server/adapters/__tests__/linear-description-test.ts",
25
28
  "typecheck": "tsc --noEmit",
26
29
  "lint": "biome check .",
27
30
  "lint:fix": "biome check --write .",
28
31
  "format": "biome format --write .",
29
- "verify-release": "bun run scripts/verify-release.ts"
32
+ "verify-release": "bun run scripts/verify-release.ts",
33
+ "release": "./scripts/release.sh"
30
34
  },
31
35
  "repository": {
32
36
  "type": "git",
@@ -1,5 +1,7 @@
1
1
  ---
2
+ name: flux:agent-creator
2
3
  description: Guide for creating effective subagents. Use when users want to create a new agent that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
4
+ user-invocable: false
3
5
  ---
4
6
 
5
7
  # Agent Creator Skill
@@ -1,5 +1,7 @@
1
1
  ---
2
+ name: flux:epic-template
2
3
  description: Epic and task structure patterns for Flux. Use when breaking PRDs into epics and tasks. Epics should be self-contained with clear acceptance criteria.
4
+ user-invocable: false
3
5
  ---
4
6
 
5
7
  # Epic Template Skill