@elixium.ai/mcp-server 0.1.7 β†’ 0.1.9

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/dist/index.js CHANGED
@@ -113,16 +113,9 @@ const parseLaneStyle = (value) => {
113
113
  return null;
114
114
  };
115
115
  const inferLaneStyleFromUrl = (apiUrl) => {
116
- try {
117
- const host = new URL(apiUrl).hostname.toLowerCase();
118
- if (host === "localhost" || host === "127.0.0.1" || host.endsWith(".local")) {
119
- return "title";
120
- }
121
- }
122
- catch {
123
- // Fall through to default.
124
- }
125
- return "upper";
116
+ // Default to title case as that's what the frontend LaneType enum expects
117
+ // (e.g., "Backlog", "Current", "Done", "Icebox")
118
+ return "title";
126
119
  };
127
120
  const normalizeLaneForComparison = (lane) => {
128
121
  if (typeof lane !== "string")
@@ -453,7 +446,7 @@ const createServer = () => {
453
446
  // TDD Workflow Tools
454
447
  {
455
448
  name: "start_story",
456
- description: "Start TDD workflow for a story - creates branch and sets workflow_stage to tdd_start. Call this first, then write tests.",
449
+ description: "Start TDD workflow for a story. By default creates a feature branch. Set trunkBased=true to work directly on main (recommended for small changes).",
457
450
  inputSchema: {
458
451
  type: "object",
459
452
  properties: {
@@ -463,9 +456,13 @@ const createServer = () => {
463
456
  },
464
457
  branchPrefix: {
465
458
  type: "string",
466
- description: "Branch prefix (feat, fix, chore)",
459
+ description: "Branch prefix (feat, fix, chore) - ignored if trunkBased=true",
467
460
  enum: ["feat", "fix", "chore"],
468
461
  },
462
+ trunkBased: {
463
+ type: "boolean",
464
+ description: "If true, skip branch creation and commit directly to main. Recommended for small, well-tested changes.",
465
+ },
469
466
  },
470
467
  required: ["storyId"],
471
468
  },
@@ -538,6 +535,12 @@ const createServer = () => {
538
535
  const args = request.params.arguments;
539
536
  const normalizedLane = await normalizeLane(args.lane);
540
537
  const boardId = await resolveBoardId();
538
+ // Warn if no boardId - stories may not appear on board UI
539
+ if (!boardId) {
540
+ console.warn("Warning: ELIXIUM_BOARD_SLUG is not set or board not found. " +
541
+ "Stories created without boardId may not appear on the board UI. " +
542
+ "Set ELIXIUM_BOARD_SLUG in your MCP configuration.");
543
+ }
541
544
  // Use requester from args, fall back to env var, then let backend use API key owner
542
545
  const requester = args.requester || USER_EMAIL;
543
546
  const response = await client.post("/stories", {
@@ -720,15 +723,35 @@ Here’s the smallest change that will validate it:
720
723
  // TDD Workflow Handlers
721
724
  case "start_story": {
722
725
  const args = request.params.arguments;
723
- const { storyId, branchPrefix } = args;
726
+ const { storyId, branchPrefix, trunkBased } = args;
724
727
  if (!storyId) {
725
728
  throw new Error("storyId is required");
726
729
  }
727
730
  const response = await client.post(`/stories/${storyId}/start`, {
728
731
  branchPrefix: branchPrefix || "feat",
732
+ trunkBased: trunkBased || false,
729
733
  });
730
734
  const result = response.data;
731
- const formattedResult = `
735
+ const isTrunk = trunkBased || result.branch === "main";
736
+ const formattedResult = isTrunk ? `
737
+ # Story Started (Trunk-Based): ${storyId}
738
+
739
+ **Mode:** πŸš€ Direct to main (trunk-based development)
740
+ **Workflow Stage:** ${result.workflow_stage}
741
+
742
+ ## Acceptance Criteria
743
+ ${result.acceptance_criteria || "No specific AC provided."}
744
+
745
+ ## Trunk-Based Workflow
746
+ 1. βœ… Write tests first
747
+ 2. βœ… Call \`propose_test_plan\` and wait for approval
748
+ 3. βœ… Implement (make tests pass)
749
+ 4. βœ… Run \`npm run build\` to verify
750
+ 5. βœ… Commit directly to main
751
+ 6. πŸš€ Auto-deploy on green CI
752
+
753
+ > ⚠️ **TDD Workflow:** Write tests first, then call \`propose_test_plan\` before implementing.
754
+ ` : `
732
755
  # Story Started: ${storyId}
733
756
 
734
757
  **Branch:** \`${result.branch}\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elixium.ai/mcp-server",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "type": "module",
5
5
  "description": "MCP Server for Elixium.ai",
6
6
  "publishConfig": {
@@ -7,6 +7,13 @@ Follow this workflow when a developer selects a story for implementation.
7
7
  > [!IMPORTANT]
8
8
  > This workflow enforces **Test-Driven Development**. You cannot skip tests.
9
9
 
10
+ ## Workflow Modes
11
+
12
+ | Mode | When to Use | Branch Strategy |
13
+ |------|-------------|-----------------|
14
+ | **Trunk-Based** (recommended) | Small, well-scoped stories (<1 day) | Direct to `main` |
15
+ | **Branch-Based** | Large features, breaking changes | Feature branch β†’ PR β†’ merge |
16
+
10
17
  ### 0. Check the North Star
11
18
  - **Before any implementation**, read `docs/NORTHSTAR.md` to understand current priorities and principles.
12
19
  - Verify the story aligns with the decision framework.
@@ -19,8 +26,17 @@ Follow this workflow when a developer selects a story for implementation.
19
26
 
20
27
  ### 2. Start TDD Workflow (MANDATORY)
21
28
  - Call `mcp_elixium_start_story` with the storyId.
22
- - This creates a git branch and sets `workflow_stage: tdd_start`.
23
- - You will receive the branch name and a reminder to write tests first.
29
+ - **For trunk-based (default for small changes):** Add `trunkBased: true`
30
+ - **For branch-based (large features):** Omit trunkBased or set to false
31
+ - This sets `workflow_stage: tdd_start`.
32
+
33
+ ```
34
+ // Trunk-based (recommended for most stories)
35
+ mcp_elixium_start_story({ storyId: "abc123", trunkBased: true })
36
+
37
+ // Branch-based (for larger features)
38
+ mcp_elixium_start_story({ storyId: "abc123", branchPrefix: "feat" })
39
+ ```
24
40
 
25
41
  ### 3. Write Tests First (MANDATORY)
26
42
  - Create test files that cover the acceptance criteria.
@@ -60,12 +76,16 @@ Follow this workflow when a developer selects a story for implementation.
60
76
  - `implementationNotes`: Summary of what was implemented
61
77
  - This sets `state: finished` and `workflow_stage: review`.
62
78
 
63
- ### 8. Final Human Review
64
- - The developer reviews the diff and runs tests one more time.
79
+ ### 8. Merge & Deploy
80
+ - **Trunk-based:** Push to main β†’ CI runs β†’ auto-deploys to prod on green βœ…
81
+ - **Branch-based:** Create PR β†’ review β†’ merge β†’ auto-deploys to prod
82
+
83
+ ### 9. Final Human Review
84
+ - The developer reviews the deployment in production.
65
85
  - **Only the developer** can move the story to Done lane.
66
86
  - **Only the developer** can set state to `accepted`.
67
87
 
68
- ### 9. Record Learning
88
+ ### 10. Record Learning
69
89
  - Before the developer moves to Done, use `mcp_elixium_record_learning` to capture:
70
90
  - What was validated?
71
91
  - What new risks appeared?