@cliangdev/flux-plugin 0.2.0 → 0.3.0

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 (108) hide show
  1. package/README.md +11 -7
  2. package/agents/coder.md +150 -25
  3. package/bin/install.cjs +171 -16
  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 +9 -11
  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/__tests__/version.test.ts +37 -0
  17. package/src/adapters/local/.gitkeep +0 -0
  18. package/src/dashboard/__tests__/api.test.ts +211 -0
  19. package/src/dashboard/browser.ts +35 -0
  20. package/src/dashboard/public/app.js +869 -0
  21. package/src/dashboard/public/index.html +90 -0
  22. package/src/dashboard/public/styles.css +807 -0
  23. package/src/dashboard/public/vendor/highlight.css +10 -0
  24. package/src/dashboard/public/vendor/highlight.min.js +8422 -0
  25. package/src/dashboard/public/vendor/marked.min.js +2210 -0
  26. package/src/dashboard/server.ts +296 -0
  27. package/src/dashboard/watchers.ts +83 -0
  28. package/src/server/__tests__/config.test.ts +163 -0
  29. package/src/server/adapters/__tests__/a-client-linear.test.ts +197 -0
  30. package/src/server/adapters/__tests__/adapter-factory.test.ts +230 -0
  31. package/src/server/adapters/__tests__/dependency-ops.test.ts +429 -0
  32. package/src/server/adapters/__tests__/document-ops.test.ts +306 -0
  33. package/src/server/adapters/__tests__/linear-adapter.test.ts +91 -0
  34. package/src/server/adapters/__tests__/linear-config.test.ts +425 -0
  35. package/src/server/adapters/__tests__/linear-criteria-parser.test.ts +287 -0
  36. package/src/server/adapters/__tests__/linear-description-test.ts +238 -0
  37. package/src/server/adapters/__tests__/linear-epic-crud.test.ts +496 -0
  38. package/src/server/adapters/__tests__/linear-mappers-description.test.ts +276 -0
  39. package/src/server/adapters/__tests__/linear-mappers-epic.test.ts +294 -0
  40. package/src/server/adapters/__tests__/linear-mappers-prd.test.ts +300 -0
  41. package/src/server/adapters/__tests__/linear-mappers-task.test.ts +197 -0
  42. package/src/server/adapters/__tests__/linear-prd-crud.test.ts +620 -0
  43. package/src/server/adapters/__tests__/linear-stats.test.ts +450 -0
  44. package/src/server/adapters/__tests__/linear-task-crud.test.ts +534 -0
  45. package/src/server/adapters/__tests__/linear-types.test.ts +243 -0
  46. package/src/server/adapters/__tests__/status-ops.test.ts +441 -0
  47. package/src/server/adapters/factory.ts +90 -0
  48. package/src/server/adapters/index.ts +9 -0
  49. package/src/server/adapters/linear/adapter.ts +1141 -0
  50. package/src/server/adapters/linear/client.ts +169 -0
  51. package/src/server/adapters/linear/config.ts +152 -0
  52. package/src/server/adapters/linear/helpers/criteria-parser.ts +197 -0
  53. package/src/server/adapters/linear/helpers/index.ts +7 -0
  54. package/src/server/adapters/linear/index.ts +16 -0
  55. package/src/server/adapters/linear/mappers/description.ts +136 -0
  56. package/src/server/adapters/linear/mappers/epic.ts +81 -0
  57. package/src/server/adapters/linear/mappers/index.ts +27 -0
  58. package/src/server/adapters/linear/mappers/prd.ts +178 -0
  59. package/src/server/adapters/linear/mappers/task.ts +82 -0
  60. package/src/server/adapters/linear/types.ts +264 -0
  61. package/src/server/adapters/local-adapter.ts +1009 -0
  62. package/src/server/adapters/types.ts +293 -0
  63. package/src/server/config.ts +73 -0
  64. package/src/server/db/__tests__/queries.test.ts +473 -0
  65. package/src/server/db/ids.ts +17 -0
  66. package/src/server/db/index.ts +69 -0
  67. package/src/server/db/queries.ts +142 -0
  68. package/src/server/db/refs.ts +60 -0
  69. package/src/server/db/schema.ts +97 -0
  70. package/src/server/db/sqlite.ts +10 -0
  71. package/src/server/index.ts +81 -0
  72. package/src/server/tools/__tests__/crud.test.ts +411 -0
  73. package/src/server/tools/__tests__/get-version.test.ts +27 -0
  74. package/src/server/tools/__tests__/mcp-interface.test.ts +479 -0
  75. package/src/server/tools/__tests__/query.test.ts +405 -0
  76. package/src/server/tools/__tests__/z-configure-linear.test.ts +511 -0
  77. package/src/server/tools/__tests__/z-get-linear-url.test.ts +108 -0
  78. package/src/server/tools/configure-linear.ts +373 -0
  79. package/src/server/tools/create-epic.ts +44 -0
  80. package/src/server/tools/create-prd.ts +40 -0
  81. package/src/server/tools/create-task.ts +47 -0
  82. package/src/server/tools/criteria.ts +50 -0
  83. package/src/server/tools/delete-entity.ts +76 -0
  84. package/src/server/tools/dependencies.ts +55 -0
  85. package/src/server/tools/get-entity.ts +240 -0
  86. package/src/server/tools/get-linear-url.ts +28 -0
  87. package/src/server/tools/get-stats.ts +52 -0
  88. package/src/server/tools/get-version.ts +20 -0
  89. package/src/server/tools/index.ts +158 -0
  90. package/src/server/tools/init-project.ts +108 -0
  91. package/src/server/tools/query-entities.ts +167 -0
  92. package/src/server/tools/render-status.ts +219 -0
  93. package/src/server/tools/update-entity.ts +140 -0
  94. package/src/server/tools/update-status.ts +166 -0
  95. package/src/server/utils/__tests__/mcp-response.test.ts +331 -0
  96. package/src/server/utils/logger.ts +9 -0
  97. package/src/server/utils/mcp-response.ts +254 -0
  98. package/src/server/utils/status-transitions.ts +160 -0
  99. package/src/status-line/__tests__/status-line.test.ts +215 -0
  100. package/src/status-line/index.ts +147 -0
  101. package/src/utils/__tests__/chalk-import.test.ts +32 -0
  102. package/src/utils/__tests__/display.test.ts +97 -0
  103. package/src/utils/__tests__/status-renderer.test.ts +310 -0
  104. package/src/utils/display.ts +62 -0
  105. package/src/utils/status-renderer.ts +214 -0
  106. package/src/version.ts +5 -0
  107. package/dist/server/index.js +0 -87063
  108. package/skills/prd-template/SKILL.md +0 -242
@@ -0,0 +1,238 @@
1
+ /**
2
+ * Linear Description Validation Test
3
+ *
4
+ * This test verifies that Linear issue descriptions can handle PRD-equivalent content
5
+ * including rich markdown, images, and diagrams. Run this test manually against a
6
+ * real Linear instance before proceeding with the refactor.
7
+ *
8
+ * Usage:
9
+ * FLUX_LINEAR_API_KEY=lin_api_xxx FLUX_LINEAR_TEAM_ID=xxx bun run test:linear-description
10
+ *
11
+ * Note: This is an integration test that requires real Linear credentials.
12
+ * It creates and then archives a test issue.
13
+ */
14
+
15
+ import { LinearClient } from "@linear/sdk";
16
+
17
+ /**
18
+ * Sample PRD content with rich markdown formatting.
19
+ * This simulates what would be stored in a PRD issue description.
20
+ */
21
+ const SAMPLE_PRD_CONTENT = `# Feature: User Authentication
22
+
23
+ ## Overview
24
+ Implement OAuth2 login with Google and GitHub providers. This feature enables users to sign in without creating a new password and provides a seamless authentication experience.
25
+
26
+ ## User Stories
27
+ - As a user, I want to sign in with Google so I don't need another password
28
+ - As a user, I want to link multiple auth providers to one account
29
+ - As a user, I want to see which providers are linked to my account
30
+ - As a security-conscious user, I want to unlink providers I no longer use
31
+
32
+ ## Requirements
33
+
34
+ ### Functional Requirements
35
+ 1. **Google OAuth Integration**
36
+ - Support Google OAuth 2.0 flow
37
+ - Request minimal scopes (email, profile)
38
+ - Handle token refresh automatically
39
+
40
+ 2. **GitHub OAuth Integration**
41
+ - Support GitHub OAuth flow
42
+ - Request read:user scope
43
+ - Handle organization restrictions
44
+
45
+ 3. **Account Linking**
46
+ - Allow linking multiple providers to one account
47
+ - Prevent duplicate email conflicts
48
+ - Support unlinking providers (min 1 must remain)
49
+
50
+ ### Non-Functional Requirements
51
+ - Authentication response time < 2 seconds
52
+ - Support 1000 concurrent auth requests
53
+ - 99.9% uptime for auth service
54
+
55
+ ## Wireframe
56
+ ![Login Screen](https://via.placeholder.com/400x300?text=Login+Wireframe)
57
+
58
+ ## Architecture
59
+
60
+ \`\`\`mermaid
61
+ graph LR
62
+ A[Client] --> B[Auth Service]
63
+ B --> C[Google OAuth]
64
+ B --> D[GitHub OAuth]
65
+ B --> E[Session Store]
66
+ E --> F[(Redis)]
67
+ B --> G[(PostgreSQL)]
68
+ \`\`\`
69
+
70
+ ## API Design
71
+
72
+ ### POST /auth/google
73
+ \`\`\`json
74
+ {
75
+ "code": "google_auth_code",
76
+ "redirect_uri": "https://app.example.com/callback"
77
+ }
78
+ \`\`\`
79
+
80
+ ### POST /auth/github
81
+ \`\`\`json
82
+ {
83
+ "code": "github_auth_code",
84
+ "redirect_uri": "https://app.example.com/callback"
85
+ }
86
+ \`\`\`
87
+
88
+ ## Acceptance Criteria
89
+ - [ ] Google OAuth integration working
90
+ - [ ] GitHub OAuth integration working
91
+ - [ ] Session management implemented
92
+ - [ ] Account linking/unlinking functional
93
+ - [ ] Error handling for OAuth failures
94
+ - [ ] Rate limiting on auth endpoints
95
+ - [ ] Audit logging for auth events
96
+
97
+ ## Technical Notes
98
+ - Use \`passport.js\` for OAuth abstraction
99
+ - Store refresh tokens encrypted with AES-256
100
+ - Implement PKCE for mobile clients
101
+
102
+ ## Dependencies
103
+ - passport: ^0.7.0
104
+ - passport-google-oauth20: ^2.0.0
105
+ - passport-github2: ^0.1.12
106
+ - ioredis: ^5.3.0
107
+ `;
108
+
109
+ /**
110
+ * Run the validation test.
111
+ * This creates an issue, verifies content, and archives it.
112
+ */
113
+ async function runValidationTest() {
114
+ const apiKey = process.env.FLUX_LINEAR_API_KEY;
115
+ const teamId = process.env.FLUX_LINEAR_TEAM_ID;
116
+
117
+ if (!apiKey || !teamId) {
118
+ console.error("Missing required environment variables:");
119
+ console.error(" FLUX_LINEAR_API_KEY - Your Linear API key (lin_api_...)");
120
+ console.error(" FLUX_LINEAR_TEAM_ID - Your Linear team ID");
121
+ console.error("");
122
+ console.error("Usage:");
123
+ console.error(
124
+ " FLUX_LINEAR_API_KEY=lin_api_xxx FLUX_LINEAR_TEAM_ID=xxx bun run test:linear-description",
125
+ );
126
+ process.exit(1);
127
+ }
128
+
129
+ const client = new LinearClient({ apiKey });
130
+
131
+ console.log("=== Linear Description Validation Test ===\n");
132
+
133
+ // 1. Create test issue with rich markdown content
134
+ console.log("1. Creating test issue with PRD-equivalent content...");
135
+ console.log(` Content length: ${SAMPLE_PRD_CONTENT.length} characters`);
136
+
137
+ const createResult = await client.createIssue({
138
+ title: "[TEST] PRD Description Validation - Can Delete",
139
+ description: SAMPLE_PRD_CONTENT,
140
+ teamId,
141
+ });
142
+
143
+ if (!createResult.success) {
144
+ console.error(" ❌ Failed to create issue");
145
+ process.exit(1);
146
+ }
147
+
148
+ const issue = await createResult.issue;
149
+ if (!issue) {
150
+ console.error(" ❌ Issue not returned after creation");
151
+ process.exit(1);
152
+ }
153
+
154
+ console.log(` ✅ Issue created: ${issue.identifier}`);
155
+ console.log(` URL: ${issue.url}`);
156
+
157
+ // 2. Fetch the issue back and verify content
158
+ console.log("\n2. Fetching issue to verify content preservation...");
159
+
160
+ const fetchedIssue = await client.issue(issue.id);
161
+ if (!fetchedIssue) {
162
+ console.error(" ❌ Failed to fetch issue");
163
+ process.exit(1);
164
+ }
165
+
166
+ const description = fetchedIssue.description || "";
167
+ console.log(
168
+ ` Retrieved description length: ${description.length} characters`,
169
+ );
170
+
171
+ // Verify key sections are present
172
+ const requiredSections = [
173
+ "# Feature: User Authentication",
174
+ "## Overview",
175
+ "## User Stories",
176
+ "## Requirements",
177
+ "## Wireframe",
178
+ "## Architecture",
179
+ "```mermaid",
180
+ "## API Design",
181
+ "## Acceptance Criteria",
182
+ "- [ ] Google OAuth integration working",
183
+ "## Technical Notes",
184
+ "## Dependencies",
185
+ ];
186
+
187
+ let allSectionsFound = true;
188
+ for (const section of requiredSections) {
189
+ if (description.includes(section)) {
190
+ console.log(` ✅ Found: "${section.substring(0, 40)}..."`);
191
+ } else {
192
+ console.log(` ❌ Missing: "${section.substring(0, 40)}..."`);
193
+ allSectionsFound = false;
194
+ }
195
+ }
196
+
197
+ // 3. Check image URL preservation
198
+ console.log("\n3. Checking image URL preservation...");
199
+ const imageUrl = "https://via.placeholder.com/400x300?text=Login+Wireframe";
200
+ if (description.includes(imageUrl)) {
201
+ console.log(` ✅ Image URL preserved: ${imageUrl}`);
202
+ } else {
203
+ console.log(` ⚠️ Image URL may have been processed/modified by Linear`);
204
+ }
205
+
206
+ // 4. Archive the test issue (cleanup)
207
+ console.log("\n4. Archiving test issue (cleanup)...");
208
+ const archiveResult = await fetchedIssue.archive();
209
+ if (archiveResult.success) {
210
+ console.log(" ✅ Test issue archived successfully");
211
+ } else {
212
+ console.log(" ⚠️ Failed to archive test issue - please delete manually");
213
+ console.log(` Issue identifier: ${issue.identifier}`);
214
+ }
215
+
216
+ // Summary
217
+ console.log("\n=== Validation Summary ===");
218
+ if (allSectionsFound) {
219
+ console.log("✅ SUCCESS: Linear issue descriptions can handle PRD content");
220
+ console.log(" - All markdown sections preserved");
221
+ console.log(" - Content length is acceptable");
222
+ console.log(" - Ready to proceed with refactor");
223
+ } else {
224
+ console.log("⚠️ PARTIAL: Some content may be modified by Linear");
225
+ console.log(" - Check the issue in Linear UI to verify rendering");
226
+ console.log(" - Some markdown features may not be fully supported");
227
+ }
228
+
229
+ console.log(
230
+ `\nNote: Check the issue in Linear UI to verify images render correctly: ${issue.url}`,
231
+ );
232
+ }
233
+
234
+ // Run if executed directly
235
+ runValidationTest().catch((error) => {
236
+ console.error("Test failed with error:", error);
237
+ process.exit(1);
238
+ });