baro-ai 0.24.0 → 0.25.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/dist/cli.mjs CHANGED
@@ -8049,11 +8049,13 @@ function normalizePrd(input, source) {
8049
8049
  const branchName = typeof input.branchName === "string" ? input.branchName : "";
8050
8050
  const description = typeof input.description === "string" ? input.description : "";
8051
8051
  const stories = Array.isArray(input.userStories) ? input.userStories : [];
8052
+ const decisionDocument = typeof input.decisionDocument === "string" && input.decisionDocument.trim().length > 0 ? input.decisionDocument : void 0;
8052
8053
  return {
8053
8054
  project,
8054
8055
  branchName,
8055
8056
  description,
8056
- userStories: stories.map((s, i) => normalizeStory(s, i, source))
8057
+ userStories: stories.map((s, i) => normalizeStory(s, i, source)),
8058
+ decisionDocument
8057
8059
  };
8058
8060
  }
8059
8061
  function normalizeStory(input, index, source) {
@@ -9110,13 +9112,32 @@ ${prompt}`;
9110
9112
  }
9111
9113
  resolvePrompt(story) {
9112
9114
  const candidatePath = this.opts.promptTemplatePath ?? join(this.opts.cwd, "prompt.md");
9115
+ let prompt;
9113
9116
  if (existsSync(candidatePath)) {
9114
9117
  const tpl = readFileSyncSafe(candidatePath);
9115
- if (tpl) {
9116
- return applyTemplate(tpl, story);
9117
- }
9118
- }
9119
- return buildDefaultStoryPrompt(story);
9118
+ prompt = tpl ? applyTemplate(tpl, story) : buildDefaultStoryPrompt(story);
9119
+ } else {
9120
+ prompt = buildDefaultStoryPrompt(story);
9121
+ }
9122
+ const doc = this.prd?.decisionDocument;
9123
+ if (doc && doc.trim().length > 0) {
9124
+ const header = [
9125
+ "## Design spec (authoritative \u2014 already decided)",
9126
+ "",
9127
+ "The Architect made these decisions before any story started.",
9128
+ "Treat them as fixed: use these exact file paths, names,",
9129
+ "schemas, API shapes, and dependency choices. Do NOT",
9130
+ "improvise alternatives \u2014 your siblings are working from",
9131
+ "the same spec and divergence breaks the build.",
9132
+ "",
9133
+ doc.trim(),
9134
+ "",
9135
+ "---",
9136
+ ""
9137
+ ].join("\n");
9138
+ prompt = header + prompt;
9139
+ }
9140
+ return prompt;
9120
9141
  }
9121
9142
  emit(item) {
9122
9143
  this.envRef?.deliverContextItem(this, item);