@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.
- package/README.md +11 -7
- package/agents/coder.md +150 -25
- package/bin/install.cjs +171 -16
- 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 +9 -11
- 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/__tests__/version.test.ts +37 -0
- package/src/adapters/local/.gitkeep +0 -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/__tests__/config.test.ts +163 -0
- package/src/server/adapters/__tests__/a-client-linear.test.ts +197 -0
- package/src/server/adapters/__tests__/adapter-factory.test.ts +230 -0
- package/src/server/adapters/__tests__/dependency-ops.test.ts +429 -0
- package/src/server/adapters/__tests__/document-ops.test.ts +306 -0
- package/src/server/adapters/__tests__/linear-adapter.test.ts +91 -0
- package/src/server/adapters/__tests__/linear-config.test.ts +425 -0
- package/src/server/adapters/__tests__/linear-criteria-parser.test.ts +287 -0
- package/src/server/adapters/__tests__/linear-description-test.ts +238 -0
- package/src/server/adapters/__tests__/linear-epic-crud.test.ts +496 -0
- package/src/server/adapters/__tests__/linear-mappers-description.test.ts +276 -0
- package/src/server/adapters/__tests__/linear-mappers-epic.test.ts +294 -0
- package/src/server/adapters/__tests__/linear-mappers-prd.test.ts +300 -0
- package/src/server/adapters/__tests__/linear-mappers-task.test.ts +197 -0
- package/src/server/adapters/__tests__/linear-prd-crud.test.ts +620 -0
- package/src/server/adapters/__tests__/linear-stats.test.ts +450 -0
- package/src/server/adapters/__tests__/linear-task-crud.test.ts +534 -0
- package/src/server/adapters/__tests__/linear-types.test.ts +243 -0
- package/src/server/adapters/__tests__/status-ops.test.ts +441 -0
- package/src/server/adapters/factory.ts +90 -0
- package/src/server/adapters/index.ts +9 -0
- package/src/server/adapters/linear/adapter.ts +1141 -0
- package/src/server/adapters/linear/client.ts +169 -0
- package/src/server/adapters/linear/config.ts +152 -0
- package/src/server/adapters/linear/helpers/criteria-parser.ts +197 -0
- package/src/server/adapters/linear/helpers/index.ts +7 -0
- package/src/server/adapters/linear/index.ts +16 -0
- package/src/server/adapters/linear/mappers/description.ts +136 -0
- package/src/server/adapters/linear/mappers/epic.ts +81 -0
- package/src/server/adapters/linear/mappers/index.ts +27 -0
- package/src/server/adapters/linear/mappers/prd.ts +178 -0
- package/src/server/adapters/linear/mappers/task.ts +82 -0
- package/src/server/adapters/linear/types.ts +264 -0
- package/src/server/adapters/local-adapter.ts +1009 -0
- package/src/server/adapters/types.ts +293 -0
- package/src/server/config.ts +73 -0
- package/src/server/db/__tests__/queries.test.ts +473 -0
- package/src/server/db/ids.ts +17 -0
- package/src/server/db/index.ts +69 -0
- package/src/server/db/queries.ts +142 -0
- package/src/server/db/refs.ts +60 -0
- package/src/server/db/schema.ts +97 -0
- package/src/server/db/sqlite.ts +10 -0
- package/src/server/index.ts +81 -0
- package/src/server/tools/__tests__/crud.test.ts +411 -0
- package/src/server/tools/__tests__/get-version.test.ts +27 -0
- package/src/server/tools/__tests__/mcp-interface.test.ts +479 -0
- package/src/server/tools/__tests__/query.test.ts +405 -0
- package/src/server/tools/__tests__/z-configure-linear.test.ts +511 -0
- package/src/server/tools/__tests__/z-get-linear-url.test.ts +108 -0
- package/src/server/tools/configure-linear.ts +373 -0
- package/src/server/tools/create-epic.ts +44 -0
- package/src/server/tools/create-prd.ts +40 -0
- package/src/server/tools/create-task.ts +47 -0
- package/src/server/tools/criteria.ts +50 -0
- package/src/server/tools/delete-entity.ts +76 -0
- package/src/server/tools/dependencies.ts +55 -0
- package/src/server/tools/get-entity.ts +240 -0
- package/src/server/tools/get-linear-url.ts +28 -0
- package/src/server/tools/get-stats.ts +52 -0
- package/src/server/tools/get-version.ts +20 -0
- package/src/server/tools/index.ts +158 -0
- package/src/server/tools/init-project.ts +108 -0
- package/src/server/tools/query-entities.ts +167 -0
- package/src/server/tools/render-status.ts +219 -0
- package/src/server/tools/update-entity.ts +140 -0
- package/src/server/tools/update-status.ts +166 -0
- package/src/server/utils/__tests__/mcp-response.test.ts +331 -0
- package/src/server/utils/logger.ts +9 -0
- package/src/server/utils/mcp-response.ts +254 -0
- package/src/server/utils/status-transitions.ts +160 -0
- package/src/status-line/__tests__/status-line.test.ts +215 -0
- package/src/status-line/index.ts +147 -0
- package/src/utils/__tests__/chalk-import.test.ts +32 -0
- package/src/utils/__tests__/display.test.ts +97 -0
- package/src/utils/__tests__/status-renderer.test.ts +310 -0
- package/src/utils/display.ts +62 -0
- package/src/utils/status-renderer.ts +214 -0
- package/src/version.ts +5 -0
- package/dist/server/index.js +0 -87063
- 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
|
+

|
|
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
|
+
});
|