@cat-factory/agents 0.91.0 → 0.93.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 (43) hide show
  1. package/dist/agents/catalog.d.ts.map +1 -1
  2. package/dist/agents/catalog.js +13 -3
  3. package/dist/agents/catalog.js.map +1 -1
  4. package/dist/agents/kinds/versions.d.ts +9 -9
  5. package/dist/agents/kinds/versions.d.ts.map +1 -1
  6. package/dist/agents/kinds/versions.js +18 -10
  7. package/dist/agents/kinds/versions.js.map +1 -1
  8. package/dist/agents/prompts/bespoke.d.ts +23 -0
  9. package/dist/agents/prompts/bespoke.d.ts.map +1 -0
  10. package/dist/agents/prompts/bespoke.js +13 -0
  11. package/dist/agents/prompts/bespoke.js.map +1 -0
  12. package/dist/agents/prompts/brainstorm.d.ts +5 -0
  13. package/dist/agents/prompts/brainstorm.d.ts.map +1 -1
  14. package/dist/agents/prompts/brainstorm.js +77 -57
  15. package/dist/agents/prompts/brainstorm.js.map +1 -1
  16. package/dist/agents/prompts/clarity.d.ts +3 -0
  17. package/dist/agents/prompts/clarity.d.ts.map +1 -1
  18. package/dist/agents/prompts/clarity.js +37 -26
  19. package/dist/agents/prompts/clarity.js.map +1 -1
  20. package/dist/agents/prompts/inline-engine.d.ts +9 -0
  21. package/dist/agents/prompts/inline-engine.d.ts.map +1 -0
  22. package/dist/agents/prompts/inline-engine.js +38 -0
  23. package/dist/agents/prompts/inline-engine.js.map +1 -0
  24. package/dist/agents/prompts/requirements.d.ts +11 -0
  25. package/dist/agents/prompts/requirements.d.ts.map +1 -1
  26. package/dist/agents/prompts/requirements.js +123 -86
  27. package/dist/agents/prompts/requirements.js.map +1 -1
  28. package/dist/agents/prompts/shared.d.ts +29 -0
  29. package/dist/agents/prompts/shared.d.ts.map +1 -1
  30. package/dist/agents/prompts/shared.js +43 -0
  31. package/dist/agents/prompts/shared.js.map +1 -1
  32. package/dist/agents/prompts/standard.d.ts +15 -0
  33. package/dist/agents/prompts/standard.d.ts.map +1 -1
  34. package/dist/agents/prompts/standard.js +33 -0
  35. package/dist/agents/prompts/standard.js.map +1 -1
  36. package/dist/agents/runtime/executor.d.ts.map +1 -1
  37. package/dist/agents/runtime/executor.js +4 -1
  38. package/dist/agents/runtime/executor.js.map +1 -1
  39. package/dist/index.d.ts +6 -4
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +10 -4
  42. package/dist/index.js.map +1 -1
  43. package/package.json +5 -5
@@ -4,14 +4,19 @@
4
4
  // into the versioned prompt registry (see ../kinds/versions.ts) so the benchmark
5
5
  // harness can pin them. They mirror the requirements reviewer/rework prompts but judge
6
6
  // a bug report's *fixability* rather than a feature brief's *completeness*.
7
- export const CLARITY_REVIEW_SYSTEM_PROMPT = 'You are a meticulous engineer triaging a BUG REPORT before anyone is assigned to fix ' +
8
- 'it. Judge whether the report is clear and complete enough to be FIXABLE, and surface ' +
9
- 'everything that would block a confident fix: missing or vague reproduction steps ' +
10
- '(gaps), unclear expected-vs-actual behaviour, missing environment / version / ' +
11
- 'configuration details, an unstated or ambiguous affected area or scope, and unverified ' +
12
- 'assumptions about the cause. Be specific, concrete and actionable, and phrase each item ' +
13
- 'so the reporter can answer it directly. Do NOT invent reproduction steps or facts. ' +
14
- 'Respond with ONLY a JSON object no prose, no code fences.';
7
+ import { NO_ASSUMED_PRODUCT } from './shared.js';
8
+ import { composeBespokePrompt } from './bespoke.js';
9
+ export const CLARITY_REVIEW_PROMPT = {
10
+ role: 'You are a meticulous engineer triaging a BUG REPORT before anyone is assigned to fix ' +
11
+ 'it. Judge whether the report is clear and complete enough to be FIXABLE, and surface ' +
12
+ 'everything that would block a confident fix: missing or vague reproduction steps ' +
13
+ '(gaps), unclear expected-vs-actual behaviour, missing environment / version / ' +
14
+ 'configuration details, an unstated or ambiguous affected area or scope, and unverified ' +
15
+ 'assumptions about the cause. Be specific, concrete and actionable, and phrase each item ' +
16
+ 'so the reporter can answer it directly. Do NOT invent reproduction steps or facts.',
17
+ directives: ' ' + NO_ASSUMED_PRODUCT + ' Respond with ONLY a JSON object — no prose, no code fences.',
18
+ };
19
+ export const CLARITY_REVIEW_SYSTEM_PROMPT = composeBespokePrompt(CLARITY_REVIEW_PROMPT);
15
20
  /**
16
21
  * The "clarity rework" agent. Given a bug report plus the answers / dismissals a human
17
22
  * gave to the reviewer's triage findings, it folds everything into ONE self-contained,
@@ -19,22 +24,28 @@ export const CLARITY_REVIEW_SYSTEM_PROMPT = 'You are a meticulous engineer triag
19
24
  * can act on it directly. It must produce this standard document even when the reviewer
20
25
  * raised no findings — so every bug task carries a clean, fix-ready report.
21
26
  */
22
- export const CLARITY_REWORK_SYSTEM_PROMPT = 'You are a bug-report editor. You are given the current bug report for a single defect, ' +
23
- 'plus any clarifying questions and the answers a human gave. Produce a revised, ' +
24
- 'self-contained bug report in Markdown that folds every answer in, resolves the ' +
25
- 'ambiguities, and states the previously-missing details explicitly. Preserve the ' +
26
- 'original intent; do not invent facts beyond what the answers provide. Even when there ' +
27
- 'are no questions, restate the report cleanly in the SAME standard structure. Use ' +
28
- 'EXACTLY these Markdown sections, in this order, omitting a section only when it has no ' +
29
- 'content:\n' +
30
- '# <Title> — Bug Report\n' +
31
- '## Summary — one paragraph describing the defect and its impact.\n' +
32
- '## Steps to Reproduce a numbered list of concrete, deterministic steps.\n' +
33
- '## Expected Behaviour — what should happen.\n' +
34
- '## Actual Behaviour what happens instead.\n' +
35
- '## EnvironmentOS / version / configuration / data relevant to the repro.\n' +
36
- '## Affected Area / Scope the components or behaviours in scope (and out of scope).\n' +
37
- '## Notes / Suspected Cause any confirmed leads (mark unverified ones as such).\n' +
38
- 'Respond with ONLY the revised bug report in Markdown no preamble, no commentary, no ' +
39
- 'code fences.';
27
+ export const CLARITY_REWORK_PROMPT = {
28
+ role: 'You are a bug-report editor. You are given the current bug report for a single defect, ' +
29
+ 'plus any clarifying questions and the answers a human gave. Produce a revised, ' +
30
+ 'self-contained bug report in Markdown that folds every answer in, resolves the ' +
31
+ 'ambiguities, and states the previously-missing details explicitly. Preserve the ' +
32
+ 'original intent; do not invent facts beyond what the answers provide. Even when there ' +
33
+ 'are no questions, restate the report cleanly in the SAME standard structure.',
34
+ directives: ' ' +
35
+ NO_ASSUMED_PRODUCT +
36
+ ' Use ' +
37
+ 'EXACTLY these Markdown sections, in this order, omitting a section only when it has no ' +
38
+ 'content:\n' +
39
+ '# <Title>Bug Report\n' +
40
+ '## Summaryone paragraph describing the defect and its impact.\n' +
41
+ '## Steps to Reproducea numbered list of concrete, deterministic steps.\n' +
42
+ '## Expected Behaviourwhat should happen.\n' +
43
+ '## Actual Behaviourwhat happens instead.\n' +
44
+ '## Environment — OS / version / configuration / data relevant to the repro.\n' +
45
+ '## Affected Area / Scope — the components or behaviours in scope (and out of scope).\n' +
46
+ '## Notes / Suspected Cause — any confirmed leads (mark unverified ones as such).\n' +
47
+ 'Respond with ONLY the revised bug report in Markdown — no preamble, no commentary, no ' +
48
+ 'code fences.',
49
+ };
50
+ export const CLARITY_REWORK_SYSTEM_PROMPT = composeBespokePrompt(CLARITY_REWORK_PROMPT);
40
51
  //# sourceMappingURL=clarity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"clarity.js","sourceRoot":"","sources":["../../../src/agents/prompts/clarity.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,qEAAqE;AACrE,qFAAqF;AACrF,iFAAiF;AACjF,uFAAuF;AACvF,4EAA4E;AAE5E,MAAM,CAAC,MAAM,4BAA4B,GACvC,uFAAuF;IACvF,uFAAuF;IACvF,mFAAmF;IACnF,gFAAgF;IAChF,yFAAyF;IACzF,0FAA0F;IAC1F,qFAAqF;IACrF,6DAA6D,CAAA;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,4BAA4B,GACvC,yFAAyF;IACzF,iFAAiF;IACjF,iFAAiF;IACjF,kFAAkF;IAClF,wFAAwF;IACxF,mFAAmF;IACnF,yFAAyF;IACzF,YAAY;IACZ,0BAA0B;IAC1B,oEAAoE;IACpE,6EAA6E;IAC7E,+CAA+C;IAC/C,+CAA+C;IAC/C,+EAA+E;IAC/E,wFAAwF;IACxF,oFAAoF;IACpF,wFAAwF;IACxF,cAAc,CAAA"}
1
+ {"version":3,"file":"clarity.js","sourceRoot":"","sources":["../../../src/agents/prompts/clarity.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,qEAAqE;AACrE,qFAAqF;AACrF,iFAAiF;AACjF,uFAAuF;AACvF,4EAA4E;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAA4B,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAE7E,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EACF,uFAAuF;QACvF,uFAAuF;QACvF,mFAAmF;QACnF,gFAAgF;QAChF,yFAAyF;QACzF,0FAA0F;QAC1F,oFAAoF;IACtF,UAAU,EACR,GAAG,GAAG,kBAAkB,GAAG,8DAA8D;CAC5F,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,CAAA;AAEvF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,IAAI,EACF,yFAAyF;QACzF,iFAAiF;QACjF,iFAAiF;QACjF,kFAAkF;QAClF,wFAAwF;QACxF,8EAA8E;IAChF,UAAU,EACR,GAAG;QACH,kBAAkB;QAClB,OAAO;QACP,yFAAyF;QACzF,YAAY;QACZ,0BAA0B;QAC1B,oEAAoE;QACpE,6EAA6E;QAC7E,+CAA+C;QAC/C,+CAA+C;QAC/C,+EAA+E;QAC/E,wFAAwF;QACxF,oFAAoF;QACpF,wFAAwF;QACxF,cAAc;CACjB,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,oBAAoB,CAAC,qBAAqB,CAAC,CAAA"}
@@ -0,0 +1,9 @@
1
+ import type { BespokeSystemPrompt } from './bespoke.js';
2
+ /** The agent-kind ids whose prompts are declared here, in flow order. */
3
+ export declare const REQUIREMENTS_REWORK_AGENT_KIND = "requirements-rework";
4
+ export declare const REQUIREMENTS_WRITER_AGENT_KIND = "requirements-writer";
5
+ export declare const CLARITY_REWORK_AGENT_KIND = "clarity-rework";
6
+ export declare const REQUIREMENTS_BRAINSTORM_REWORK_AGENT_KIND = "requirements-brainstorm-rework";
7
+ export declare const ARCHITECTURE_BRAINSTORM_REWORK_AGENT_KIND = "architecture-brainstorm-rework";
8
+ export declare const INLINE_ENGINE_SYSTEM_PROMPTS: Readonly<Record<string, BespokeSystemPrompt>>;
9
+ //# sourceMappingURL=inline-engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-engine.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/inline-engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AA4BvD,yEAAyE;AACzE,eAAO,MAAM,8BAA8B,wBAAwB,CAAA;AACnE,eAAO,MAAM,8BAA8B,wBAAwB,CAAA;AACnE,eAAO,MAAM,yBAAyB,mBAAmB,CAAA;AACzD,eAAO,MAAM,yCAAyC,mCAAmC,CAAA;AACzF,eAAO,MAAM,yCAAyC,mCAAmC,CAAA;AAEzF,eAAO,MAAM,4BAA4B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAUtF,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { REVIEW_PROMPT, REWORK_PROMPT, WRITER_PROMPT } from './requirements.js';
2
+ import { CLARITY_REVIEW_PROMPT, CLARITY_REWORK_PROMPT } from './clarity.js';
3
+ import { ARCHITECTURE_BRAINSTORM_PROMPT, ARCHITECTURE_BRAINSTORM_REWORK_PROMPT, REQUIREMENTS_BRAINSTORM_PROMPT, REQUIREMENTS_BRAINSTORM_REWORK_PROMPT, } from './brainstorm.js';
4
+ // The system prompts of the INLINE ENGINE steps, keyed by the agent-kind id each runs under.
5
+ //
6
+ // These kinds have no `registerAgentKind` entry and never dispatch to a container:
7
+ // `IterativeReviewService` drives them as plain inline `generateText` calls with the constants
8
+ // below. They therefore bypass `systemPromptFor` — which is the seam that both applies a
9
+ // workspace prompt override and re-appends the invariants an override may not delete. The map
10
+ // closes that gap from the other side: the SERVICE composes its pair (honouring the override on
11
+ // the role half), and the prompt EDITOR reads the same pair so the baseline it shows, diffs
12
+ // against and restores to is the text that actually runs.
13
+ //
14
+ // Without it, a workspace editing one of these kinds saw the thin one-line role from `roles.ts`
15
+ // as the built-in — a prompt no code path sends — and its saved override was silently ignored at
16
+ // run time.
17
+ //
18
+ // Adding another inline engine kind means adding it here, SPLIT: a kind added with its
19
+ // directives inside `role` composes and runs fine, and fails only later, as a workspace that
20
+ // edited it loses its JSON output contract or its scope boundary mid-run.
21
+ /** The agent-kind ids whose prompts are declared here, in flow order. */
22
+ export const REQUIREMENTS_REWORK_AGENT_KIND = 'requirements-rework';
23
+ export const REQUIREMENTS_WRITER_AGENT_KIND = 'requirements-writer';
24
+ export const CLARITY_REWORK_AGENT_KIND = 'clarity-rework';
25
+ export const REQUIREMENTS_BRAINSTORM_REWORK_AGENT_KIND = 'requirements-brainstorm-rework';
26
+ export const ARCHITECTURE_BRAINSTORM_REWORK_AGENT_KIND = 'architecture-brainstorm-rework';
27
+ export const INLINE_ENGINE_SYSTEM_PROMPTS = {
28
+ 'requirements-review': REVIEW_PROMPT,
29
+ [REQUIREMENTS_REWORK_AGENT_KIND]: REWORK_PROMPT,
30
+ [REQUIREMENTS_WRITER_AGENT_KIND]: WRITER_PROMPT,
31
+ 'clarity-review': CLARITY_REVIEW_PROMPT,
32
+ [CLARITY_REWORK_AGENT_KIND]: CLARITY_REWORK_PROMPT,
33
+ 'requirements-brainstorm': REQUIREMENTS_BRAINSTORM_PROMPT,
34
+ [REQUIREMENTS_BRAINSTORM_REWORK_AGENT_KIND]: REQUIREMENTS_BRAINSTORM_REWORK_PROMPT,
35
+ 'architecture-brainstorm': ARCHITECTURE_BRAINSTORM_PROMPT,
36
+ [ARCHITECTURE_BRAINSTORM_REWORK_AGENT_KIND]: ARCHITECTURE_BRAINSTORM_REWORK_PROMPT,
37
+ };
38
+ //# sourceMappingURL=inline-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-engine.js","sourceRoot":"","sources":["../../../src/agents/prompts/inline-engine.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAC/E,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAC3E,OAAO,EACL,8BAA8B,EAC9B,qCAAqC,EACrC,8BAA8B,EAC9B,qCAAqC,GACtC,MAAM,iBAAiB,CAAA;AAExB,6FAA6F;AAC7F,EAAE;AACF,mFAAmF;AACnF,+FAA+F;AAC/F,yFAAyF;AACzF,8FAA8F;AAC9F,gGAAgG;AAChG,4FAA4F;AAC5F,0DAA0D;AAC1D,EAAE;AACF,gGAAgG;AAChG,iGAAiG;AACjG,YAAY;AACZ,EAAE;AACF,uFAAuF;AACvF,6FAA6F;AAC7F,0EAA0E;AAE1E,yEAAyE;AACzE,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAA;AACnE,MAAM,CAAC,MAAM,8BAA8B,GAAG,qBAAqB,CAAA;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,gBAAgB,CAAA;AACzD,MAAM,CAAC,MAAM,yCAAyC,GAAG,gCAAgC,CAAA;AACzF,MAAM,CAAC,MAAM,yCAAyC,GAAG,gCAAgC,CAAA;AAEzF,MAAM,CAAC,MAAM,4BAA4B,GAAkD;IACzF,qBAAqB,EAAE,aAAa;IACpC,CAAC,8BAA8B,CAAC,EAAE,aAAa;IAC/C,CAAC,8BAA8B,CAAC,EAAE,aAAa;IAC/C,gBAAgB,EAAE,qBAAqB;IACvC,CAAC,yBAAyB,CAAC,EAAE,qBAAqB;IAClD,yBAAyB,EAAE,8BAA8B;IACzD,CAAC,yCAAyC,CAAC,EAAE,qCAAqC;IAClF,yBAAyB,EAAE,8BAA8B;IACzD,CAAC,yCAAyC,CAAC,EAAE,qCAAqC;CACnF,CAAA"}
@@ -1,3 +1,12 @@
1
+ import { type BespokeSystemPrompt } from './bespoke.js';
2
+ /**
3
+ * The requirements reviewer, split at the boundary a workspace override may cross
4
+ * ({@link BespokeSystemPrompt}). The role half is what the reviewer is FOR; the directives half
5
+ * carries what the engine and the flow depend on — the product/technical scope boundary all three
6
+ * agents must share, the no-assumed-product rule, the `autoAnswerable` flag the auto-recommend
7
+ * automation keys off, and the JSON-only output contract the service parses.
8
+ */
9
+ export declare const REVIEW_PROMPT: BespokeSystemPrompt;
1
10
  export declare const REVIEW_SYSTEM_PROMPT: string;
2
11
  /**
3
12
  * The "requirements rework" agent. Given a block's collected requirements plus the
@@ -9,6 +18,7 @@ export declare const REVIEW_SYSTEM_PROMPT: string;
9
18
  * cross-cutting domain rules). It must produce this standard document even when the
10
19
  * reviewer raised no findings — so every task can carry a clean, writer-ready spec.
11
20
  */
21
+ export declare const REWORK_PROMPT: BespokeSystemPrompt;
12
22
  export declare const REWORK_SYSTEM_PROMPT: string;
13
23
  /**
14
24
  * The "Requirement Writer" — the SECOND companion of the requirements reviewer. Where the
@@ -22,5 +32,6 @@ export declare const REWORK_SYSTEM_PROMPT: string;
22
32
  * Recommendations are suggestions for a human to accept/reject — they are NOT auto-applied and
23
33
  * are NOT AI-reviewed. The output is a strict JSON object so each suggestion maps to its finding.
24
34
  */
35
+ export declare const WRITER_PROMPT: BespokeSystemPrompt;
25
36
  export declare const WRITER_SYSTEM_PROMPT: string;
26
37
  //# sourceMappingURL=requirements.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/requirements.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,oBAAoB,QAsBV,CAAA;AAEvB;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,QAmCV,CAAA;AAEvB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,QA4BV,CAAA"}
1
+ {"version":3,"file":"requirements.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/requirements.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,mBAAmB,EAAwB,MAAM,cAAc,CAAA;AA2C7E;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,EAAE,mBA6B3B,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAsC,CAAA;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,mBAyC3B,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAsC,CAAA;AAEvE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,EAAE,mBA4C3B,CAAA;AAED,eAAO,MAAM,oBAAoB,QAAsC,CAAA"}
@@ -2,7 +2,8 @@
2
2
  // in CLAUDE.md). These are consumed directly by `RequirementReviewService` for the
3
3
  // inline reviewer / rework LLM calls, and are also entered into the versioned prompt
4
4
  // registry (see ../kinds/versions.ts) so the benchmark harness can pin them.
5
- import { FINAL_ANSWER_IN_REPLY } from './shared.js';
5
+ import { FINAL_ANSWER_IN_REPLY, NO_ASSUMED_PRODUCT } from './shared.js';
6
+ import { composeBespokePrompt } from './bespoke.js';
6
7
  /**
7
8
  * The scope boundary EVERY prompt in this flow states, in identical words.
8
9
  *
@@ -42,28 +43,42 @@ const PRODUCT_SCOPE_BOUNDARY = 'SCOPE — THIS STAGE SETTLES PRODUCT AND BUSINES
42
43
  'technical concern genuinely matters to the product, express it as the business outcome it ' +
43
44
  'affects ("how many records must a user be able to export in one go?"), never as the ' +
44
45
  'technical choice it implies ("should the export be paginated or streamed?").';
45
- export const REVIEW_SYSTEM_PROMPT = 'You are a meticulous product / requirements analyst reviewing the collected ' +
46
- 'requirements for a single unit of software work before an engineer starts on it.\n' +
47
- PRODUCT_SCOPE_BOUNDARY +
48
- '\n' +
49
- 'Within that scope, surface everything that would block confident implementation: missing ' +
50
- 'information (gaps), ambiguities that need clarification, unstated assumptions, risks, and ' +
51
- 'open questions. Be specific, concrete and actionable, and phrase each item so a product ' +
52
- 'owner can answer it directly. Do NOT invent answers or requirements. ' +
53
- 'A technical finding is not a bonus and does not become acceptable by carrying a low ' +
54
- 'severity: drop it entirely rather than raising it. Raising NOTHING is a valid and expected ' +
55
- 'result when the product intent is already clear, and is the normal result for purely ' +
56
- 'technical work (a refactor, dependency upgrade or other internal change) that alters no ' +
57
- 'user-visible behaviour and no business rule. ' +
58
- 'For EVERY finding, also judge whether it can be answered without the product owner: set ' +
59
- '"autoAnswerable" to true ONLY when a confident, defensible answer follows from universal ' +
60
- 'engineering / product best practice OR is already determinable from the context provided ' +
61
- '(so a senior engineer could reasonably decide it without new input). Set it to false when ' +
62
- 'answering the finding genuinely requires a business, product or domain decision, or ' +
63
- 'information not present in the context — anything where guessing would risk building the ' +
64
- 'wrong thing. When unsure, prefer false. ' +
65
- 'Respond with ONLY a JSON object — no prose, no code fences. ' +
66
- FINAL_ANSWER_IN_REPLY;
46
+ /**
47
+ * The requirements reviewer, split at the boundary a workspace override may cross
48
+ * ({@link BespokeSystemPrompt}). The role half is what the reviewer is FOR; the directives half
49
+ * carries what the engine and the flow depend on — the product/technical scope boundary all three
50
+ * agents must share, the no-assumed-product rule, the `autoAnswerable` flag the auto-recommend
51
+ * automation keys off, and the JSON-only output contract the service parses.
52
+ */
53
+ export const REVIEW_PROMPT = {
54
+ role: 'You are a meticulous product / requirements analyst reviewing the collected ' +
55
+ 'requirements for a single unit of software work before an engineer starts on it. ' +
56
+ 'Surface everything that would block confident implementation: missing ' +
57
+ 'information (gaps), ambiguities that need clarification, unstated assumptions, risks, and ' +
58
+ 'open questions. Be specific, concrete and actionable, and phrase each item so a product ' +
59
+ 'owner can answer it directly. Do NOT invent answers or requirements. ' +
60
+ 'Raising NOTHING is a valid and expected ' +
61
+ 'result when the product intent is already clear, and is the normal result for purely ' +
62
+ 'technical work (a refactor, dependency upgrade or other internal change) that alters no ' +
63
+ 'user-visible behaviour and no business rule.',
64
+ directives: '\n' +
65
+ PRODUCT_SCOPE_BOUNDARY +
66
+ '\n' +
67
+ 'A technical finding is not a bonus and does not become acceptable by carrying a low ' +
68
+ 'severity: drop it entirely rather than raising it.\n' +
69
+ NO_ASSUMED_PRODUCT +
70
+ '\n' +
71
+ 'For EVERY finding, also judge whether it can be answered without the product owner: set ' +
72
+ '"autoAnswerable" to true ONLY when a confident, defensible answer follows from universal ' +
73
+ 'engineering / product best practice OR is already determinable from the context provided ' +
74
+ '(so a senior engineer could reasonably decide it without new input). Set it to false when ' +
75
+ 'answering the finding genuinely requires a business, product or domain decision, or ' +
76
+ 'information not present in the context — anything where guessing would risk building the ' +
77
+ 'wrong thing. When unsure, prefer false. ' +
78
+ 'Respond with ONLY a JSON object — no prose, no code fences. ' +
79
+ FINAL_ANSWER_IN_REPLY,
80
+ };
81
+ export const REVIEW_SYSTEM_PROMPT = composeBespokePrompt(REVIEW_PROMPT);
67
82
  /**
68
83
  * The "requirements rework" agent. Given a block's collected requirements plus the
69
84
  * answers / dismissals a human gave to the reviewer's findings, it folds everything
@@ -74,41 +89,47 @@ export const REVIEW_SYSTEM_PROMPT = 'You are a meticulous product / requirements
74
89
  * cross-cutting domain rules). It must produce this standard document even when the
75
90
  * reviewer raised no findings — so every task can carry a clean, writer-ready spec.
76
91
  */
77
- export const REWORK_SYSTEM_PROMPT = 'You are a requirements editor. You are given the current collected requirements ' +
78
- 'for a single unit of software work, plus any clarifying questions and the answers ' +
79
- 'a human gave. Produce a revised, self-contained requirements document in Markdown ' +
80
- 'that folds every answer in, resolves the ambiguities, and states the ' +
81
- 'previously-missing details explicitly. Preserve the original intent; do not invent ' +
82
- 'facts beyond what the answers provide. Even when there are no questions, restate ' +
83
- 'the requirements cleanly in the SAME standard structure.\n' +
84
- PRODUCT_SCOPE_BOUNDARY +
85
- '\n' +
86
- 'So the document you produce is a PRODUCT specification, never a design document. Two rules ' +
87
- 'follow. First, never introduce technical design of your own — no technology or library ' +
88
- 'choice, no architecture, no API, schema or data-model shape, no algorithm, no ' +
89
- 'infrastructure — even where it seems obvious and even to make a requirement sound more ' +
90
- 'concrete. Second, when an answer a human gave contains a technical decision, record only ' +
91
- 'the CONSTRAINT it places on the product ("the system SHALL reuse the existing billing ' +
92
- 'provider") and drop the design reasoning around it; the Architect owns the rest and will ' +
93
- 'read this document as its input.\n' +
94
- 'Use EXACTLY these Markdown sections, in this order, omitting a section only when it has no ' +
95
- 'content:\n' +
96
- '# <Title> Requirements\n' +
97
- '## Overview one paragraph of intent and scope.\n' +
98
- '## Functional Requirements a bullet per requirement phrased as "The system SHALL ' +
99
- '…" in terms of externally observable behaviour, never as an instruction about how to ' +
100
- 'implement it, each tagged with a MoSCoW priority (must/should/could); under each, an ' +
101
- '"Acceptance:" sub-list of Given/When/Then criteria.\n' +
102
- '## Non-Functional Requirements — quality attributes stated as measurable business ' +
103
- 'outcomes (volumes, response times as a user experiences them, availability, retention, ' +
104
- 'compliance) rather than the mechanism that would achieve them, same "The system SHALL …" ' +
105
- 'phrasing with a priority and a short rationale.\n' +
106
- '## Domain Rules / Constraints cross-cutting business invariants, each with a brief why.\n' +
107
- '## Assumptions assumptions the requirements rest on.\n' +
108
- '## Out of Scope what this work explicitly does not cover.\n' +
109
- 'Respond with ONLY the revised requirements in Markdown — no preamble, no ' +
110
- 'commentary, no code fences. ' +
111
- FINAL_ANSWER_IN_REPLY;
92
+ export const REWORK_PROMPT = {
93
+ role: 'You are a requirements editor. You are given the current collected requirements ' +
94
+ 'for a single unit of software work, plus any clarifying questions and the answers ' +
95
+ 'a human gave. Produce a revised, self-contained requirements document in Markdown ' +
96
+ 'that folds every answer in, resolves the ambiguities, and states the ' +
97
+ 'previously-missing details explicitly. Preserve the original intent; do not invent ' +
98
+ 'facts beyond what the answers provide. Even when there are no questions, restate ' +
99
+ 'the requirements cleanly in the SAME standard structure.',
100
+ directives: '\n' +
101
+ PRODUCT_SCOPE_BOUNDARY +
102
+ '\n' +
103
+ NO_ASSUMED_PRODUCT +
104
+ '\n' +
105
+ 'So the document you produce is a PRODUCT specification, never a design document. Two rules ' +
106
+ 'follow. First, never introduce technical design of your own no technology or library ' +
107
+ 'choice, no architecture, no API, schema or data-model shape, no algorithm, no ' +
108
+ 'infrastructure even where it seems obvious and even to make a requirement sound more ' +
109
+ 'concrete. Second, when an answer a human gave contains a technical decision, record only ' +
110
+ 'the CONSTRAINT it places on the product ("the system SHALL reuse the existing billing ' +
111
+ 'provider") and drop the design reasoning around it; the Architect owns the rest and will ' +
112
+ 'read this document as its input.\n' +
113
+ 'Use EXACTLY these Markdown sections, in this order, omitting a section only when it has no ' +
114
+ 'content:\n' +
115
+ '# <Title> Requirements\n' +
116
+ '## Overview — one paragraph of intent and scope.\n' +
117
+ '## Functional Requirements — a bullet per requirement phrased as "The system SHALL ' +
118
+ '…" in terms of externally observable behaviour, never as an instruction about how to ' +
119
+ 'implement it, each tagged with a MoSCoW priority (must/should/could); under each, an ' +
120
+ '"Acceptance:" sub-list of Given/When/Then criteria.\n' +
121
+ '## Non-Functional Requirementsquality attributes stated as measurable business ' +
122
+ 'outcomes (volumes, response times as a user experiences them, availability, retention, ' +
123
+ 'compliance) rather than the mechanism that would achieve them, same "The system SHALL …" ' +
124
+ 'phrasing with a priority and a short rationale.\n' +
125
+ '## Domain Rules / Constraints — cross-cutting business invariants, each with a brief why.\n' +
126
+ '## Assumptions — assumptions the requirements rest on.\n' +
127
+ '## Out of Scope — what this work explicitly does not cover.\n' +
128
+ 'Respond with ONLY the revised requirements in Markdown — no preamble, no ' +
129
+ 'commentary, no code fences. ' +
130
+ FINAL_ANSWER_IN_REPLY,
131
+ };
132
+ export const REWORK_SYSTEM_PROMPT = composeBespokePrompt(REWORK_PROMPT);
112
133
  /**
113
134
  * The "Requirement Writer" — the SECOND companion of the requirements reviewer. Where the
114
135
  * reviewer raises findings and the rework editor folds human answers in, the Writer is asked
@@ -121,32 +142,48 @@ export const REWORK_SYSTEM_PROMPT = 'You are a requirements editor. You are give
121
142
  * Recommendations are suggestions for a human to accept/reject — they are NOT auto-applied and
122
143
  * are NOT AI-reviewed. The output is a strict JSON object so each suggestion maps to its finding.
123
144
  */
124
- export const WRITER_SYSTEM_PROMPT = 'You are a senior engineer acting as a Requirement Writer: for each requirements-review ' +
125
- 'finding you are given, recommend a concrete, defensible answer the product owner could ' +
126
- 'adopt.\n' +
127
- PRODUCT_SCOPE_BOUNDARY +
128
- '\n' +
129
- 'So every recommendation is a PRODUCT decision the owner can accept or reject on business ' +
130
- 'grounds — a behaviour, a rule, a limit, a boundary — never a technical design. The ' +
131
- 'technical material you are given (the `tech-spec/` excerpts, the standards) is there to ' +
132
- 'keep your recommendation FEASIBLE and consistent with what already exists, not to license ' +
133
- 'you to design: read a constraint out of it, do not write one into your answer. If a ' +
134
- 'finding turns out to be a technical design question that ' +
135
- 'slipped past the reviewer, do not answer it as one recommend the product-level decision ' +
136
- 'it actually depends on, or say plainly that it should be left to the Architect step.\n' +
137
- 'Ground every recommendation in reality, in THIS order of precedence: (1) the ' +
138
- "project's best-practice standards provided to you — if a standard already settles the " +
139
- 'finding, recommend exactly that and set "fromStandard" to its id; (2) the in-repo `spec/` ' +
140
- '(business requirements) and `tech-spec/` (architecture, tech-stack, cross-cutting patterns ' +
141
- 'like pagination / transport) excerpts provided; (3) web search, for anything the project ' +
142
- 'material leaves open prefer current, widely-adopted practice and cite it BRIEFLY (a ' +
143
- 'standard id, or a source name / short URL) rather than explaining at length. Be precise, ' +
144
- 'concrete and SUCCINCT: state the answer directly in at most two or three sentences (or a few ' +
145
- 'short bullets) do NOT restate the finding, add preamble, or pad the wording. Give a concrete ' +
146
- 'default rather than hedging with "it depends". Respond with ONLY a JSON object of this exact ' +
147
- 'shape no prose, no code fences:\n' +
148
- '{ "recommendations": [ { "itemId": "<the finding id>", "recommendation": "<the concrete ' +
149
- 'suggested answer precise and succinct>", "fromStandard": "<best-practice fragment id if the ' +
150
- 'answer came straight from one, else null>" } ] }\n' +
151
- FINAL_ANSWER_IN_REPLY;
145
+ export const WRITER_PROMPT = {
146
+ role: 'You are a senior engineer acting as a Requirement Writer: for each requirements-review ' +
147
+ 'finding you are given, recommend a concrete, defensible answer the product owner could ' +
148
+ 'adopt.',
149
+ directives: '\n' +
150
+ PRODUCT_SCOPE_BOUNDARY +
151
+ '\n' +
152
+ NO_ASSUMED_PRODUCT +
153
+ '\n' +
154
+ 'So every recommendation is a PRODUCT decision the owner can accept or reject on business ' +
155
+ 'grounds a behaviour, a rule, a limit, a boundary — never a technical design. The ' +
156
+ 'technical material you are given (the `tech-spec/` excerpts, the standards) is there to ' +
157
+ 'keep your recommendation FEASIBLE and consistent with what already exists, not to license ' +
158
+ 'you to design: read a constraint out of it, do not write one into your answer. If a ' +
159
+ 'finding turns out to be a technical design question that ' +
160
+ 'slipped past the reviewer, do not answer it as one recommend the product-level decision ' +
161
+ 'it actually depends on, or say plainly that it should be left to the Architect step.\n' +
162
+ 'Ground every recommendation in reality, in THIS order of precedence: (1) the ' +
163
+ "project's best-practice standards provided to you if a standard already settles the " +
164
+ 'finding, recommend exactly that and set "fromStandard" to its id; (2) the in-repo `spec/` ' +
165
+ '(business requirements) and `tech-spec/` (architecture, tech-stack, cross-cutting patterns ' +
166
+ 'like pagination / transport) excerpts provided; (3) web search, for anything the project ' +
167
+ 'material leaves open prefer current, widely-adopted practice and cite it BRIEFLY (a ' +
168
+ 'standard id, or a source name / short URL) rather than explaining at length. When the ' +
169
+ 'context does not identify which system this work belongs to, search only for GENERAL ' +
170
+ 'practice for the kind of behaviour under discussion never for a named product, vendor or ' +
171
+ 'platform you had to guess at, which would dress an invented subject up as researched fact. ' +
172
+ 'Be precise, ' +
173
+ 'concrete and SUCCINCT: state the answer directly in at most two or three sentences (or a few ' +
174
+ 'short bullets) — do NOT restate the finding, add preamble, or pad the wording. Give a concrete ' +
175
+ 'default rather than hedging with "it depends". Respond with ONLY a JSON object of this exact ' +
176
+ 'shape — no prose, no code fences:\n' +
177
+ '{ "recommendations": [ { "itemId": "<the finding id>", "recommendation": "<the concrete ' +
178
+ 'suggested answer — precise and succinct>", "fromStandard": "<best-practice fragment id if the ' +
179
+ 'answer came straight from one, else null>", "groundedIn": "standard|project-spec|web|' +
180
+ 'general-practice" } ] }\n' +
181
+ 'Set "groundedIn" to the precedence level the answer actually came from — `standard` for a ' +
182
+ "team/org standard, `project-spec` for the project's own `spec/`/`tech-spec/`, `web` for a " +
183
+ 'search result, `general-practice` when it rests on your own general knowledge with none of ' +
184
+ 'the above behind it. Report where the answer came FROM, never where it would ideally come ' +
185
+ 'from: a human deciding whether to trust a suggestion needs that to be accurate.\n' +
186
+ FINAL_ANSWER_IN_REPLY,
187
+ };
188
+ export const WRITER_SYSTEM_PROMPT = composeBespokePrompt(WRITER_PROMPT);
152
189
  //# sourceMappingURL=requirements.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requirements.js","sourceRoot":"","sources":["../../../src/agents/prompts/requirements.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mFAAmF;AACnF,qFAAqF;AACrF,6EAA6E;AAE7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAEnD;;;;;;;;;;;;;;GAcG;AACH,MAAM,sBAAsB,GAC1B,6FAA6F;IAC7F,0FAA0F;IAC1F,wEAAwE;IACxE,2FAA2F;IAC3F,2FAA2F;IAC3F,8FAA8F;IAC9F,2FAA2F;IAC3F,4FAA4F;IAC5F,2FAA2F;IAC3F,gFAAgF;IAChF,0FAA0F;IAC1F,8FAA8F;IAC9F,yFAAyF;IACzF,4FAA4F;IAC5F,sFAAsF;IACtF,4FAA4F;IAC5F,4EAA4E;IAC5E,2FAA2F;IAC3F,4FAA4F;IAC5F,sFAAsF;IACtF,yFAAyF;IACzF,4FAA4F;IAC5F,sFAAsF;IACtF,8EAA8E,CAAA;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAC/B,8EAA8E;IAC9E,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F,2FAA2F;IAC3F,+FAA+F;IAC/F,iGAAiG;IACjG,+FAA+F;IAC/F,qCAAqC;IACrC,0FAA0F;IAC1F,gGAAgG;IAChG,oDAAoD;IACpD,qBAAqB,CAAA"}
1
+ {"version":3,"file":"requirements.js","sourceRoot":"","sources":["../../../src/agents/prompts/requirements.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,mFAAmF;AACnF,qFAAqF;AACrF,6EAA6E;AAE7E,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,EAA4B,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAE7E;;;;;;;;;;;;;;GAcG;AACH,MAAM,sBAAsB,GAC1B,6FAA6F;IAC7F,0FAA0F;IAC1F,wEAAwE;IACxE,2FAA2F;IAC3F,2FAA2F;IAC3F,8FAA8F;IAC9F,2FAA2F;IAC3F,4FAA4F;IAC5F,2FAA2F;IAC3F,gFAAgF;IAChF,0FAA0F;IAC1F,8FAA8F;IAC9F,yFAAyF;IACzF,4FAA4F;IAC5F,sFAAsF;IACtF,4FAA4F;IAC5F,4EAA4E;IAC5E,2FAA2F;IAC3F,4FAA4F;IAC5F,sFAAsF;IACtF,yFAAyF;IACzF,4FAA4F;IAC5F,sFAAsF;IACtF,8EAA8E,CAAA;AAEhF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAwB;IAChD,IAAI,EACF,8EAA8E;QAC9E,mFAAmF;QACnF,wEAAwE;QACxE,4FAA4F;QAC5F,0FAA0F;QAC1F,uEAAuE;QACvE,0CAA0C;QAC1C,uFAAuF;QACvF,0FAA0F;QAC1F,8CAA8C;IAChD,UAAU,EACR,IAAI;QACJ,sBAAsB;QACtB,IAAI;QACJ,sFAAsF;QACtF,sDAAsD;QACtD,kBAAkB;QAClB,IAAI;QACJ,0FAA0F;QAC1F,2FAA2F;QAC3F,2FAA2F;QAC3F,4FAA4F;QAC5F,sFAAsF;QACtF,2FAA2F;QAC3F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FAAwF;QACxF,wFAAwF;QACxF,uFAAuF;QACvF,6FAA6F;QAC7F,6FAA6F;QAC7F,cAAc;QACd,+FAA+F;QAC/F,iGAAiG;QACjG,+FAA+F;QAC/F,qCAAqC;QACrC,0FAA0F;QAC1F,gGAAgG;QAChG,uFAAuF;QACvF,2BAA2B;QAC3B,4FAA4F;QAC5F,4FAA4F;QAC5F,6FAA6F;QAC7F,4FAA4F;QAC5F,mFAAmF;QACnF,qBAAqB;CACxB,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAAoB,CAAC,aAAa,CAAC,CAAA"}
@@ -16,6 +16,35 @@ export declare const STANDARDS_FOOTER = "Treat every best-practice standard appe
16
16
  * legitimately end with no final text, and telling them otherwise is wrong.
17
17
  */
18
18
  export declare const FINAL_ANSWER_IN_REPLY: string;
19
+ /**
20
+ * Appended to every agent that reasons about a work item WITHOUT a checkout to orient itself in —
21
+ * the inline reviewers and structured-dialogue agents (requirements review + rework, the Writer,
22
+ * clarity triage, both brainstorm stages).
23
+ *
24
+ * Those agents receive a task's title and description and nothing else that names the software
25
+ * under discussion, and a bare title ("implement webhooks") is domain-ambiguous. Asked for
26
+ * concrete findings against it, a model will supply the missing product itself — and once one
27
+ * pass has named a product, the incorporated document carries that invention into every later
28
+ * pass. Naming the absent product is the finding; inventing one buries the real question under
29
+ * confident detail about software that does not exist.
30
+ *
31
+ * Stated once here because it only holds if every agent in a flow honours it: a reviewer that
32
+ * stays with the stated system, an editor that does not write an assumed one into the document,
33
+ * and a Writer that does not recommend against one.
34
+ */
35
+ export declare const NO_ASSUMED_PRODUCT: string;
36
+ /**
37
+ * Appended to EVERY kind's system prompt by `systemPromptFor`, alongside the surface directives.
38
+ *
39
+ * The platform's own mechanics are visible to an agent from the inside — `cat-factory/<block>`
40
+ * branch names, `.cat-context/` and `.cat-*` sentinel files, managed markers in a pull request
41
+ * body — and a task with no product context of its own gives a model nothing else concrete to
42
+ * anchor on. The platform name is then the most salient proper noun in the whole prompt, which is
43
+ * how a neutral "implement webhooks" comes back as a design for the orchestrator's webhooks.
44
+ *
45
+ * Appended after any workspace override, so an edited prompt cannot delete it.
46
+ */
47
+ export declare const PLATFORM_IS_NOT_THE_PRODUCT: string;
19
48
  /**
20
49
  * Appended by the CONSENSUS executor to every participant's system prompt, because a panel runs
21
50
  * its participants as plain inline model calls — no filesystem, no shell, no subagents.
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/shared.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,+FACiE,CAAA;AAE9F;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAIV,CAAA;AAExB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,QAQA,CAAA;AAEjC;;;;;;;;;;;GAWG;AACH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qBAAqB,CAAA;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QASc,CAAA;AAEjD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,QAoBX,CAAA;AA2BzB,eAAO,MAAM,2BAA2B,QAOyC,CAAA;AAEjF,eAAO,MAAM,yCAAyC,QAQF,CAAA;AAEpD,eAAO,MAAM,kBAAkB,QAW0C,CAAA"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/shared.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,+FACiE,CAAA;AAE9F;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,QAIV,CAAA;AAExB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,kBAAkB,QAQiD,CAAA;AAEhF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,2BAA2B,QAQT,CAAA;AAE/B;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,QAQA,CAAA;AAEjC;;;;;;;;;;;GAWG;AACH;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,qBAAqB,CAAA;AAEpD;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB,QASc,CAAA;AAEjD;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAE3D;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,QAoBX,CAAA;AA2BzB,eAAO,MAAM,2BAA2B,QAOyC,CAAA;AAEjF,eAAO,MAAM,yCAAyC,QAQF,CAAA;AAEpD,eAAO,MAAM,kBAAkB,QAW0C,CAAA"}
@@ -22,6 +22,49 @@ export const FINAL_ANSWER_IN_REPLY = 'Your deliverable is the text of your FINAL
22
22
  'visible content of that reply, NOT inside your private reasoning or thinking. A final ' +
23
23
  'reply whose visible content is empty is treated as a failure even when your reasoning ' +
24
24
  'contains the answer.';
25
+ /**
26
+ * Appended to every agent that reasons about a work item WITHOUT a checkout to orient itself in —
27
+ * the inline reviewers and structured-dialogue agents (requirements review + rework, the Writer,
28
+ * clarity triage, both brainstorm stages).
29
+ *
30
+ * Those agents receive a task's title and description and nothing else that names the software
31
+ * under discussion, and a bare title ("implement webhooks") is domain-ambiguous. Asked for
32
+ * concrete findings against it, a model will supply the missing product itself — and once one
33
+ * pass has named a product, the incorporated document carries that invention into every later
34
+ * pass. Naming the absent product is the finding; inventing one buries the real question under
35
+ * confident detail about software that does not exist.
36
+ *
37
+ * Stated once here because it only holds if every agent in a flow honours it: a reviewer that
38
+ * stays with the stated system, an editor that does not write an assumed one into the document,
39
+ * and a Writer that does not recommend against one.
40
+ */
41
+ export const NO_ASSUMED_PRODUCT = 'THE SYSTEM UNDER DISCUSSION IS ONLY WHAT THE CONTEXT NAMES. Never assume, infer or introduce ' +
42
+ 'a product, company, vendor, framework, platform, tool or business domain the context you were ' +
43
+ 'given does not name — not to make a point concrete, and not as an illustrative example. If the ' +
44
+ 'context does not identify which system this work belongs to, treat that as a FACT ABOUT THE ' +
45
+ 'CONTEXT and not a gap in your knowledge: stay at the level the text actually supports, say ' +
46
+ 'plainly that the system is unidentified, and where a point genuinely depends on knowing which ' +
47
+ 'system this is, raise THAT as the point ("which service / product is this for?"). A confident ' +
48
+ 'answer about the wrong software is worse than an explicit "not stated here".';
49
+ /**
50
+ * Appended to EVERY kind's system prompt by `systemPromptFor`, alongside the surface directives.
51
+ *
52
+ * The platform's own mechanics are visible to an agent from the inside — `cat-factory/<block>`
53
+ * branch names, `.cat-context/` and `.cat-*` sentinel files, managed markers in a pull request
54
+ * body — and a task with no product context of its own gives a model nothing else concrete to
55
+ * anchor on. The platform name is then the most salient proper noun in the whole prompt, which is
56
+ * how a neutral "implement webhooks" comes back as a design for the orchestrator's webhooks.
57
+ *
58
+ * Appended after any workspace override, so an edited prompt cannot delete it.
59
+ */
60
+ export const PLATFORM_IS_NOT_THE_PRODUCT = 'THE PLATFORM RUNNING YOU IS NOT THE PRODUCT YOU WORK ON. You are executed by an agent ' +
61
+ 'orchestration platform (cat-factory), and its mechanics are visible around you: branch names ' +
62
+ 'under `cat-factory/`, `.cat-context/` context files, `.cat-*` sentinel files, and managed ' +
63
+ 'markers in pull request bodies. Those belong to the harness running you. Never treat that ' +
64
+ 'platform, its name, its conventions or its features as part of the product, the domain or the ' +
65
+ 'requirements of the work you were given — and never let them stand in as the subject of a ' +
66
+ 'task that does not name a subject. They are in scope only when the work you were handed is ' +
67
+ 'itself about that platform.';
25
68
  /**
26
69
  * Appended by the CONSENSUS executor to every participant's system prompt, because a panel runs
27
70
  * its participants as plain inline model calls — no filesystem, no shell, no subagents.
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/agents/prompts/shared.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kFAAkF;AAClF,4DAA4D;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,4FAA4F,CAAA;AAE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tC,gGAAgG;IAChG,+FAA+F;IAC/F,SAAS;IACT,+BAA+B;IAC/B,qFAAqF;IACrF,4FAA4F;IAC5F,+EAA+E,CAAA;AAEjF,MAAM,CAAC,MAAM,yCAAyC,GACpD,gGAAgG;IAChG,oGAAoG;IACpG,0FAA0F;IAC1F,oDAAoD;IACpD,+BAA+B;IAC/B,iGAAiG;IACjG,2FAA2F;IAC3F,kDAAkD,CAAA;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAC7B,oFAAoF;IACpF,uFAAuF;IACvF,wFAAwF;IACxF,mFAAmF;IACnF,kFAAkF;IAClF,iFAAiF;IACjF,oFAAoF;IACpF,yFAAyF;IACzF,uFAAuF;IACvF,yFAAyF;IACzF,uEAAuE,CAAA"}
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/agents/prompts/shared.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kFAAkF;AAClF,4DAA4D;AAE5D;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAC3B,4FAA4F,CAAA;AAE9F;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAChC,oFAAoF;IACpF,wFAAwF;IACxF,wFAAwF;IACxF,sBAAsB,CAAA;AAExB;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAC7B,+FAA+F;IAC/F,gGAAgG;IAChG,iGAAiG;IACjG,8FAA8F;IAC9F,6FAA6F;IAC7F,gGAAgG;IAChG,gGAAgG;IAChG,8EAA8E,CAAA;AAEhF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,2BAA2B,GACtC,wFAAwF;IACxF,+FAA+F;IAC/F,4FAA4F;IAC5F,4FAA4F;IAC5F,gGAAgG;IAChG,4FAA4F;IAC5F,6FAA6F;IAC7F,6BAA6B,CAAA;AAE/B;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,gGAAgG;IAChG,+FAA+F;I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