rhachet-roles-bhrain 0.1.1 → 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 (159) hide show
  1. package/dist/.test/getContextOpenAI.js +1 -1
  2. package/dist/.test/getContextOpenAI.js.map +1 -1
  3. package/dist/domain.operations/review/compileReviewPrompt.d.ts +22 -0
  4. package/dist/domain.operations/review/compileReviewPrompt.js +95 -0
  5. package/dist/domain.operations/review/compileReviewPrompt.js.map +1 -0
  6. package/dist/domain.operations/review/enumFilesFromDiffs.d.ts +8 -0
  7. package/dist/domain.operations/review/enumFilesFromDiffs.js +74 -0
  8. package/dist/domain.operations/review/enumFilesFromDiffs.js.map +1 -0
  9. package/dist/domain.operations/review/enumFilesFromGlob.d.ts +8 -0
  10. package/dist/domain.operations/review/enumFilesFromGlob.js +31 -0
  11. package/dist/domain.operations/review/enumFilesFromGlob.js.map +1 -0
  12. package/dist/domain.operations/review/estimateTokenCount.d.ts +9 -0
  13. package/dist/domain.operations/review/estimateTokenCount.js +20 -0
  14. package/dist/domain.operations/review/estimateTokenCount.js.map +1 -0
  15. package/dist/domain.operations/review/formatReviewOutput.d.ts +14 -0
  16. package/dist/domain.operations/review/formatReviewOutput.js +42 -0
  17. package/dist/domain.operations/review/formatReviewOutput.js.map +1 -0
  18. package/dist/domain.operations/review/genTokenBreakdownMarkdown.d.ts +19 -0
  19. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js +110 -0
  20. package/dist/domain.operations/review/genTokenBreakdownMarkdown.js.map +1 -0
  21. package/dist/domain.operations/review/genTokenBreakdownReport.d.ts +24 -0
  22. package/dist/domain.operations/review/genTokenBreakdownReport.js +64 -0
  23. package/dist/domain.operations/review/genTokenBreakdownReport.js.map +1 -0
  24. package/dist/domain.operations/review/invokeClaudeCode.d.ts +22 -0
  25. package/dist/domain.operations/review/invokeClaudeCode.js +92 -0
  26. package/dist/domain.operations/review/invokeClaudeCode.js.map +1 -0
  27. package/dist/domain.operations/review/writeInputArtifacts.d.ts +27 -0
  28. package/dist/domain.operations/review/writeInputArtifacts.js +50 -0
  29. package/dist/domain.operations/review/writeInputArtifacts.js.map +1 -0
  30. package/dist/domain.operations/review/writeOutputArtifacts.d.ts +12 -0
  31. package/dist/domain.operations/review/writeOutputArtifacts.js +46 -0
  32. package/dist/domain.operations/review/writeOutputArtifacts.js.map +1 -0
  33. package/dist/roles/architect/briefs/brains.replic/arc000.sources.[catalog].md +178 -0
  34. package/dist/roles/architect/briefs/brains.replic/arc101.concept.llm.[article].md +25 -0
  35. package/dist/roles/architect/briefs/brains.replic/arc102.concept.repl.[article].md +33 -0
  36. package/dist/roles/architect/briefs/brains.replic/arc103.concept.replic-brain.[article].md +35 -0
  37. package/dist/roles/architect/briefs/brains.replic/arc104.concept.context-window.[article].md +40 -0
  38. package/dist/roles/architect/briefs/brains.replic/arc105.concept.system-prompt.[article].md +44 -0
  39. package/dist/roles/architect/briefs/brains.replic/arc106.concept.tool-definition.[article].md +59 -0
  40. package/dist/roles/architect/briefs/brains.replic/arc107.concept.tool-call.[article].md +54 -0
  41. package/dist/roles/architect/briefs/brains.replic/arc108.concept.tool-result.[article].md +58 -0
  42. package/dist/roles/architect/briefs/brains.replic/arc109.concept.agentic-loop.[article].md +62 -0
  43. package/dist/roles/architect/briefs/brains.replic/arc110.concept.reasoning-trace.[article].md +58 -0
  44. package/dist/roles/architect/briefs/brains.replic/arc111.concept.react-pattern.[article].md +65 -0
  45. package/dist/roles/architect/briefs/brains.replic/arc112.concept.reflexion-pattern.[article].md +68 -0
  46. package/dist/roles/architect/briefs/brains.replic/arc113.concept.tree-of-thoughts.[article].md +76 -0
  47. package/dist/roles/architect/briefs/brains.replic/arc114.concept.self-consistency.[article].md +73 -0
  48. package/dist/roles/architect/briefs/brains.replic/arc115.concept.lats-pattern.[article].md +78 -0
  49. package/dist/roles/architect/briefs/brains.replic/arc116.concept.context-compaction.[article].md +71 -0
  50. package/dist/roles/architect/briefs/brains.replic/arc117.concept.subagent.[article].md +71 -0
  51. package/dist/roles/architect/briefs/brains.replic/arc118.concept.extended-thinking.[article].md +69 -0
  52. package/dist/roles/architect/briefs/brains.replic/arc119.concept.mcp.[article].md +78 -0
  53. package/dist/roles/architect/briefs/brains.replic/arc120.concept.session.[article].md +67 -0
  54. package/dist/roles/architect/briefs/brains.replic/arc121.concept.message.[article].md +79 -0
  55. package/dist/roles/architect/briefs/brains.replic/arc122.concept.plan-and-solve.[article].md +80 -0
  56. package/dist/roles/architect/briefs/brains.replic/arc150.concepts.treestruct.[article].md +126 -0
  57. package/dist/roles/architect/briefs/brains.replic/arc201.blueprint.claude-code.[article].md +417 -0
  58. package/dist/roles/architect/briefs/brains.replic/arc201.blueprint.claude-code.zoomin.reason.[article].md +507 -0
  59. package/dist/roles/architect/briefs/brains.replic/arc202.blueprint.codex.[article].md +354 -0
  60. package/dist/roles/architect/briefs/brains.replic/arc300.blueprints.comparison.[catalog].md +284 -0
  61. package/dist/roles/getRoleRegistry.js +2 -1
  62. package/dist/roles/getRoleRegistry.js.map +1 -1
  63. package/dist/roles/getRoleRegistry.readme.js +6 -0
  64. package/dist/roles/getRoleRegistry.readme.js.map +1 -1
  65. package/dist/roles/reviewer/briefs/review.tactics.md +60 -0
  66. package/dist/roles/reviewer/getReviewerRole.d.ts +6 -0
  67. package/dist/roles/reviewer/getReviewerRole.js +80 -0
  68. package/dist/roles/reviewer/getReviewerRole.js.map +1 -0
  69. package/dist/roles/reviewer/skills/review/review.d.ts +57 -0
  70. package/dist/roles/reviewer/skills/review/review.js +445 -0
  71. package/dist/roles/reviewer/skills/review/review.js.map +1 -0
  72. package/dist/roles/reviewer/skills/review/review.sh +21 -0
  73. package/dist/roles/reviewer/skills/review/review.ts +575 -0
  74. package/dist/roles/thinker/briefs/term=brain.atomic_vs_replic.md +8 -0
  75. package/dist/roles/thinker/getThinkerRole.js +1 -1
  76. package/dist/roles/thinker/getThinkerRole.js.map +1 -1
  77. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19..i1.via_chatgpt.md +47 -0
  78. package/dist/roles/thinker/skills/brief.articulate/.demo/article.vision.v2025_08_19.i2.via_rhachet.md +60 -0
  79. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.md +62 -0
  80. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i1.with_feedback.md +89 -0
  81. package/dist/roles/thinker/skills/brief.articulate/.demo/diverge.v2025_08_17.i2.md +47 -0
  82. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i1.md +44 -0
  83. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i2.md +63 -0
  84. package/dist/roles/thinker/skills/brief.articulate/.demo/joke.v2025_08_15.i3.md +51 -0
  85. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i1.md +62 -0
  86. package/dist/roles/thinker/skills/brief.articulate/.demo/user-journey.v2025_08_17.i2.md +49 -0
  87. package/dist/roles/thinker/skills/brief.articulate/.readme.md +0 -0
  88. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js +1 -1
  89. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.js.map +1 -1
  90. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.skill.ts +168 -0
  91. package/dist/roles/thinker/skills/brief.articulate/stepArticulate.ts +157 -0
  92. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i1.md +93 -0
  93. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_08_28.i2.md +84 -0
  94. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i1.no_focus_context.md +8 -0
  95. package/dist/roles/thinker/skills/brief.catalogize/.demo/joke.types.v2025_09_28.i2.md +54 -0
  96. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i1.md +62 -0
  97. package/dist/roles/thinker/skills/brief.catalogize/.demo/persona.usecases.v2025_08_28.i2.md +64 -0
  98. package/dist/roles/thinker/skills/brief.catalogize/.readme.md +5 -0
  99. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js +1 -1
  100. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.js.map +1 -1
  101. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.skill.ts +173 -0
  102. package/dist/roles/thinker/skills/brief.catalogize/stepCatalogize.ts +132 -0
  103. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i4.md +3 -0
  104. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i5.md +3 -0
  105. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.i6.md +3 -0
  106. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.input.example.md +3 -0
  107. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i1.md +52 -0
  108. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i2.md +51 -0
  109. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i3.md +47 -0
  110. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i4.md +62 -0
  111. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i5.md +47 -0
  112. package/dist/roles/thinker/skills/brief.demonstrate/.demo/user.journey.roadtrip.v2025_08_27.i6.md +53 -0
  113. package/dist/roles/thinker/skills/brief.demonstrate/.readme +3 -0
  114. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js +1 -1
  115. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.js.map +1 -1
  116. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.skill.ts +190 -0
  117. package/dist/roles/thinker/skills/brief.demonstrate/stepDemonstrate.ts +164 -0
  118. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i1.md +72 -0
  119. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i2.md +53 -0
  120. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i3.which_objectives.md +58 -0
  121. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input1.cluster.v2025_08_17.i5.which_personas.md +64 -0
  122. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i1.md +67 -0
  123. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i2.md +49 -0
  124. package/dist/roles/thinker/skills/khue.cluster/.demo/user.journeys.input2.cluster.v2025_08_17.i3.md +59 -0
  125. package/dist/roles/thinker/skills/khue.cluster/.readme.md +0 -0
  126. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js +1 -1
  127. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.js.map +1 -1
  128. package/dist/roles/thinker/skills/khue.cluster/stepCluster.skill.ts +174 -0
  129. package/dist/roles/thinker/skills/khue.cluster/stepCluster.ts +150 -0
  130. package/dist/roles/thinker/skills/khue.decompose/.readme.md +9 -0
  131. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i2.md +23 -0
  132. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.examples.v2025_08_17.i3.md +23 -0
  133. package/dist/roles/thinker/skills/khue.diverge/.demo/joke.varieties.v2025_08_17.i1.md +23 -0
  134. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i1.md +9 -0
  135. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i2.md +9 -0
  136. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i3.md +23 -0
  137. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i4.folksy.md +9 -0
  138. package/dist/roles/thinker/skills/khue.diverge/.demo/userjourney.examples.v2025_08_17.i5.folksy.md +23 -0
  139. package/dist/roles/thinker/skills/khue.diverge/.readme.md +0 -0
  140. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js +1 -1
  141. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.js.map +1 -1
  142. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.skill.ts +149 -0
  143. package/dist/roles/thinker/skills/khue.diverge/stepDiverge.ts +151 -0
  144. package/dist/roles/thinker/skills/khue.encompose/.readme.md +7 -0
  145. package/dist/roles/thinker/skills/khue.instantiate/.readme.md +14 -0
  146. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js +1 -1
  147. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.js.map +1 -1
  148. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.skill.ts +190 -0
  149. package/dist/roles/thinker/skills/khue.instantiate/stepInstantiate.ts +132 -0
  150. package/dist/roles/thinker/skills/khue.triage/.demo/laughs.v2025_08_18.i1.md +29 -0
  151. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i1.md +86 -0
  152. package/dist/roles/thinker/skills/khue.triage/.demo/user.journeys.v2025_08_17.i2.md +68 -0
  153. package/dist/roles/thinker/skills/khue.triage/.readme.md +0 -0
  154. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js +1 -1
  155. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.js.map +1 -1
  156. package/dist/roles/thinker/skills/khue.triage/stepTriage.skill.ts +174 -0
  157. package/dist/roles/thinker/skills/khue.triage/stepTriage.ts +153 -0
  158. package/package.json +9 -7
  159. package/readme.md +55 -0
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.invokeClaudeCode = void 0;
4
+ const child_process_1 = require("child_process");
5
+ const helpful_errors_1 = require("helpful-errors");
6
+ /**
7
+ * .what = invokes claude-code cli with the prompt
8
+ * .why = executes the review via the specified brain (claude-code)
9
+ */
10
+ const invokeClaudeCode = async (input) => {
11
+ // invoke claude-code cli via stdin to avoid E2BIG on large prompts
12
+ const output = await new Promise((resolve, reject) => {
13
+ const child = (0, child_process_1.spawn)('claude', ['-p', '-', '--output-format', 'json'], {
14
+ cwd: input.cwd,
15
+ });
16
+ let stdout = '';
17
+ let stderr = '';
18
+ child.stdout.on('data', (data) => {
19
+ stdout += data.toString();
20
+ });
21
+ child.stderr.on('data', (data) => {
22
+ stderr += data.toString();
23
+ });
24
+ child.on('error', reject);
25
+ child.on('close', (code) => {
26
+ if (code !== 0) {
27
+ // check for prompt too long error
28
+ if (stdout.includes('Prompt is too long')) {
29
+ reject(new helpful_errors_1.BadRequestError('prompt is too long for claude context window; reduce --rules or --paths scope', {
30
+ status: code,
31
+ hint: 'try narrowing your glob patterns or excluding large files',
32
+ }));
33
+ return;
34
+ }
35
+ reject(new helpful_errors_1.UnexpectedCodePathError('claude-code exited with non-zero', {
36
+ status: code,
37
+ stdout: stdout.slice(0, 2000),
38
+ stderr: stderr.slice(0, 2000),
39
+ }));
40
+ return;
41
+ }
42
+ resolve(stdout);
43
+ });
44
+ // write prompt to stdin and close
45
+ child.stdin.write(input.prompt);
46
+ child.stdin.end();
47
+ });
48
+ // parse the json response
49
+ const response = (() => {
50
+ try {
51
+ return JSON.parse(output);
52
+ }
53
+ catch {
54
+ throw new helpful_errors_1.UnexpectedCodePathError('failed to parse claude-code response', {
55
+ output,
56
+ });
57
+ }
58
+ })();
59
+ // extract review content from response
60
+ const review = (() => {
61
+ // claude-code json output has a 'result' field with the text content
62
+ if (response.result && typeof response.result === 'string') {
63
+ return response.result;
64
+ }
65
+ // fallback: look for text in message content
66
+ if (response.content && Array.isArray(response.content)) {
67
+ const textContent = response.content.find((c) => c.type === 'text');
68
+ if (textContent?.text) {
69
+ return textContent.text;
70
+ }
71
+ }
72
+ throw new helpful_errors_1.UnexpectedCodePathError('failed to extract review from response', {
73
+ response,
74
+ });
75
+ })();
76
+ // extract usage from response
77
+ const usage = (() => {
78
+ if (!response.usage)
79
+ throw new helpful_errors_1.UnexpectedCodePathError('response.usage not found', {
80
+ response,
81
+ });
82
+ return {
83
+ inputTokens: response.usage.input_tokens ?? 0,
84
+ inputTokensCacheCreation: response.usage.cache_creation_input_tokens ?? 0,
85
+ inputTokensCacheRead: response.usage.cache_read_input_tokens ?? 0,
86
+ outputTokens: response.usage.output_tokens ?? 0,
87
+ };
88
+ })();
89
+ return { response, review, usage };
90
+ };
91
+ exports.invokeClaudeCode = invokeClaudeCode;
92
+ //# sourceMappingURL=invokeClaudeCode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invokeClaudeCode.js","sourceRoot":"","sources":["../../../src/domain.operations/review/invokeClaudeCode.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * .what = writes input artifacts to log directory for auditability
3
+ * .why = enables debugging, replay, and audit of review invocations
4
+ */
5
+ export declare const writeInputArtifacts: (input: {
6
+ logDir: string;
7
+ args: {
8
+ rules: string | string[];
9
+ diffs?: string;
10
+ paths?: string | string[];
11
+ output: string;
12
+ mode: 'soft' | 'hard';
13
+ };
14
+ scope: {
15
+ ruleFiles: string[];
16
+ targetFiles: string[];
17
+ };
18
+ metrics: {
19
+ tokenEstimate: number;
20
+ contextWindowPercent: number;
21
+ costEstimate: number;
22
+ };
23
+ prompt: string;
24
+ }) => Promise<{
25
+ argsPath: string;
26
+ promptPath: string;
27
+ }>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.writeInputArtifacts = void 0;
27
+ const fs = __importStar(require("fs/promises"));
28
+ const path = __importStar(require("path"));
29
+ /**
30
+ * .what = writes input artifacts to log directory for auditability
31
+ * .why = enables debugging, replay, and audit of review invocations
32
+ */
33
+ const writeInputArtifacts = async (input) => {
34
+ // ensure log directory exists
35
+ await fs.mkdir(input.logDir, { recursive: true });
36
+ // write input.args.json
37
+ const argsPath = path.join(input.logDir, 'input.args.json');
38
+ const argsContent = JSON.stringify({
39
+ args: input.args,
40
+ scope: input.scope,
41
+ metrics: input.metrics,
42
+ }, null, 2);
43
+ await fs.writeFile(argsPath, argsContent, 'utf-8');
44
+ // write input.prompt.md
45
+ const promptPath = path.join(input.logDir, 'input.prompt.md');
46
+ await fs.writeFile(promptPath, input.prompt, 'utf-8');
47
+ return { argsPath, promptPath };
48
+ };
49
+ exports.writeInputArtifacts = writeInputArtifacts;
50
+ //# sourceMappingURL=writeInputArtifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeInputArtifacts.js","sourceRoot":"","sources":["../../../src/domain.operations/review/writeInputArtifacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,2CAA6B;AAE7B;;;GAGG;AACI,MAAM,mBAAmB,GAAG,KAAK,EAAE,KAmBzC,EAAqD,EAAE;IACtD,8BAA8B;IAC9B,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,wBAAwB;IACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAChC;QACE,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,KAAK,EAAE,KAAK,CAAC,KAAK;QAClB,OAAO,EAAE,KAAK,CAAC,OAAO;KACvB,EACD,IAAI,EACJ,CAAC,CACF,CAAC;IACF,MAAM,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;IAEnD,wBAAwB;IACxB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC9D,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAClC,CAAC,CAAC;AAzCW,QAAA,mBAAmB,uBAyC9B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * .what = writes output artifacts to log directory for auditability
3
+ * .why = enables debugging, replay, and audit of review results
4
+ */
5
+ export declare const writeOutputArtifacts: (input: {
6
+ logDir: string;
7
+ response: object;
8
+ review: string;
9
+ }) => Promise<{
10
+ responsePath: string;
11
+ reviewPath: string;
12
+ }>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.writeOutputArtifacts = void 0;
27
+ const fs = __importStar(require("fs/promises"));
28
+ const path = __importStar(require("path"));
29
+ /**
30
+ * .what = writes output artifacts to log directory for auditability
31
+ * .why = enables debugging, replay, and audit of review results
32
+ */
33
+ const writeOutputArtifacts = async (input) => {
34
+ // ensure log directory exists (should already exist from writeInputArtifacts)
35
+ await fs.mkdir(input.logDir, { recursive: true });
36
+ // write output.response.json
37
+ const responsePath = path.join(input.logDir, 'output.response.json');
38
+ const responseContent = JSON.stringify(input.response, null, 2);
39
+ await fs.writeFile(responsePath, responseContent, 'utf-8');
40
+ // write output.review.md
41
+ const reviewPath = path.join(input.logDir, 'output.review.md');
42
+ await fs.writeFile(reviewPath, input.review, 'utf-8');
43
+ return { responsePath, reviewPath };
44
+ };
45
+ exports.writeOutputArtifacts = writeOutputArtifacts;
46
+ //# sourceMappingURL=writeOutputArtifacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeOutputArtifacts.js","sourceRoot":"","sources":["../../../src/domain.operations/review/writeOutputArtifacts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAClC,2CAA6B;AAE7B;;;GAGG;AACI,MAAM,oBAAoB,GAAG,KAAK,EAAE,KAI1C,EAAyD,EAAE;IAC1D,8EAA8E;IAC9E,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAElD,6BAA6B;IAC7B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAAC;IACrE,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChE,MAAM,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAE3D,yBAAyB;IACzB,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAC/D,MAAM,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEtD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AACtC,CAAC,CAAC;AAlBW,QAAA,oBAAoB,wBAkB/B"}
@@ -0,0 +1,178 @@
1
+ # research sources catalog
2
+
3
+ ## .what
4
+
5
+ a comprehensive catalog of sources documenting replic brain architectures, reasoning patterns, and performance benchmarks.
6
+
7
+ ## .why
8
+
9
+ these sources form the foundation for understanding how replic brains (LLMs behind REPLs) are constructed, compared, and evaluated.
10
+
11
+ ---
12
+
13
+ ## foundational papers
14
+
15
+ ### reasoning patterns
16
+
17
+ | # | title | authors | url | date | relevance |
18
+ |---|-------|---------|-----|------|-----------|
19
+ | 1 | ReAct: Synergizing Reasoning and Acting in Language Models | Yao et al. | [arXiv:2210.03629](https://arxiv.org/abs/2210.03629) | 2022-10, ICLR 2023 | foundational pattern for interleaved reasoning + action in agentic loops |
20
+ | 2 | Chain-of-Thought Prompting Elicits Reasoning in Large Language Models | Wei et al. | [arXiv:2201.11903](https://arxiv.org/abs/2201.11903) | 2022-01, NeurIPS 2022 | foundational technique enabling step-by-step reasoning |
21
+ | 3 | Tree of Thoughts: Deliberate Problem Solving with Large Language Models | Yao et al. | [arXiv:2305.10601](https://arxiv.org/abs/2305.10601) | 2023-05, NeurIPS 2023 | exploration over reasoning paths, enables backtracking |
22
+ | 4 | Reflexion: Language Agents with Verbal Reinforcement Learning | Shinn et al. | [arXiv:2303.11366](https://arxiv.org/abs/2303.11366) | 2023-03 | self-reflection and iterative refinement for agents |
23
+ | 5 | Self-Consistency Improves Chain of Thought Reasoning | Wang et al. | [arXiv:2203.11171](https://arxiv.org/abs/2203.11171) | 2022-03 | multiple reasoning paths with majority voting |
24
+ | 6 | Language Agent Tree Search (LATS) | Zhou et al. | [arXiv:2310.04406](https://arxiv.org/abs/2310.04406) | 2023-10, ICML 2024 | Monte Carlo tree search for language agents |
25
+
26
+ ### prompting techniques
27
+
28
+ | # | title | authors | url | date | relevance |
29
+ |---|-------|---------|-----|------|-----------|
30
+ | 7 | Plan-and-Solve Prompting | Wang et al. | [arXiv:2305.04091](https://arxiv.org/abs/2305.04091) | 2023-05 | zero-shot decomposition into planning + execution |
31
+ | 8 | Least-to-Most Prompting | Zhou et al. | [arXiv:2205.10625](https://arxiv.org/abs/2205.10625) | 2022-05 | decompose complex problems into simpler subproblems |
32
+ | 9 | Self-Ask: Measuring and Narrowing the Compositionality Gap | Press et al. | [arXiv:2210.03350](https://arxiv.org/abs/2210.03350) | 2022-10, ICLR 2023 | model asks follow-up questions before answering |
33
+ | 10 | Auto-CoT: Automatic Chain of Thought Prompting | Zhang et al. | [arXiv:2210.03493](https://arxiv.org/abs/2210.03493) | 2022-10 | automatic demonstration construction with diversity |
34
+ | 11 | Show Your Work: Scratchpads for Intermediate Computation | Nye et al. | [arXiv:2112.00114](https://arxiv.org/abs/2112.00114) | 2021-12 | intermediate computation steps improve multi-step tasks |
35
+
36
+ ### tool use and function calling
37
+
38
+ | # | title | authors | url | date | relevance |
39
+ |---|-------|---------|-----|------|-----------|
40
+ | 12 | Toolformer: Language Models Can Teach Themselves to Use Tools | Schick et al. | [arXiv:2302.04761](https://arxiv.org/abs/2302.04761) | 2023-02 | self-supervised tool use learning |
41
+ | 13 | PAL: Program-Aided Language Models | Gao et al. | [arXiv:2211.10435](https://arxiv.org/abs/2211.10435) | 2022-11 | offload computation to program interpreter |
42
+
43
+ ### embodied and agentic systems
44
+
45
+ | # | title | authors | url | date | relevance |
46
+ |---|-------|---------|-----|------|-----------|
47
+ | 14 | Inner Monologue: Embodied Reasoning through Planning with Language Models | Huang et al. | [arXiv:2207.05608](https://arxiv.org/abs/2207.05608) | 2022-07, CoRL | closed-loop feedback for robot planning |
48
+ | 15 | Generative Agents: Interactive Simulacra of Human Behavior | Park et al. | [arXiv:2304.03442](https://arxiv.org/abs/2304.03442) | 2023-04 | memory architecture for believable agent behavior |
49
+ | 16 | MemGPT: Towards LLMs as Operating Systems | Packer et al. | [arXiv:2310.08560](https://arxiv.org/abs/2310.08560) | 2023-10 | virtual context management, memory hierarchy |
50
+
51
+ ### surveys and meta-analyses
52
+
53
+ | # | title | authors | url | date | relevance |
54
+ |---|-------|---------|-----|------|-----------|
55
+ | 17 | CoALA: Cognitive Architectures for Language Agents | Sumers et al. | [arXiv:2309.02427](https://arxiv.org/abs/2309.02427) | 2023-09 | systematic framework for language agent architectures |
56
+ | 18 | AgentBench: Evaluating LLMs as Agents | Liu et al. | [arXiv:2308.03688](https://arxiv.org/abs/2308.03688) | 2023-08 | comprehensive benchmark for evaluating LLM agents |
57
+ | 19 | Understanding the Planning of LLM Agents: A Survey | Huang et al. | [arXiv:2402.02716](https://arxiv.org/abs/2402.02716) | 2024-02 | taxonomy of planning approaches |
58
+ | 20 | ADaPT: As-Needed Decomposition and Planning | Prasad et al. | [arXiv:2311.05772](https://arxiv.org/abs/2311.05772) | 2023-11, NAACL 2024 | adaptive decomposition based on task complexity |
59
+ | 21 | Reasoning with Language Model Prompting: A Survey | Qiao et al. | [github.com/zjunlp](https://github.com/zjunlp/Prompt4ReasoningPapers) | 2023, ACL 2023 | comprehensive survey of prompting for reasoning |
60
+ | 22 | LLM-Based Agents for Tool Learning: A Survey | - | [Springer](https://link.springer.com/article/10.1007/s41019-025-00296-9) | 2024 | survey of tool learning approaches |
61
+ | 23 | A Survey of Task Planning with Large Language Models | - | [Intelligent Computing](https://spj.science.org/doi/10.34133/icomputing.0124) | 2024 | task planning and decomposition survey |
62
+
63
+ ---
64
+
65
+ ## claude-code architecture
66
+
67
+ | # | title | source | url | date | relevance |
68
+ |---|-------|--------|-----|------|-----------|
69
+ | 24 | Building Effective Agents | Anthropic blog | [anthropic.com/research](https://www.anthropic.com/research/building-effective-agents) | 2024-12 | official guidance on agent architecture patterns |
70
+ | 25 | Building Agents with the Claude Agent SDK | Anthropic engineering | [anthropic.com/engineering](https://www.anthropic.com/engineering/building-agents-with-the-claude-agent-sdk) | 2024 | SDK architecture and design principles |
71
+ | 26 | Advanced Tool Use on Claude | Anthropic engineering | [anthropic.com/engineering](https://www.anthropic.com/engineering/advanced-tool-use) | 2024 | tool search, programmatic calling, examples |
72
+ | 27 | Claude's Extended Thinking | Anthropic | [anthropic.com/news](https://www.anthropic.com/news/visible-extended-thinking) | 2025 | hybrid reasoning with thinking budgets |
73
+ | 28 | The "think" Tool: Enabling Claude to Stop and Think | Anthropic engineering | [anthropic.com/engineering](https://www.anthropic.com/engineering/claude-think-tool) | 2024 | structured thinking during tool use |
74
+ | 29 | Model Context Protocol (MCP) | Anthropic | [modelcontextprotocol.io](https://modelcontextprotocol.io/) | 2024 | standardized tool integration protocol |
75
+ | 30 | Claude Agent SDK Repository | GitHub | [github.com/anthropics/claude-agent-sdk-python](https://github.com/anthropics/claude-agent-sdk-python) | 2024 | reference implementation |
76
+ | 31 | Claude Code System Prompt Analysis | Zenn (community) | [zenn.dev](https://zenn.dev/) | 2024 | detailed analysis of system prompt structure |
77
+
78
+ ---
79
+
80
+ ## alternative architectures
81
+
82
+ ### openai codex
83
+
84
+ | # | title | source | url | date | relevance |
85
+ |---|-------|--------|-----|------|-----------|
86
+ | 32 | Codex Cloud Architecture | OpenAI | [developers.openai.com/codex/cloud](https://developers.openai.com/codex/cloud/) | 2025 | cloud sandbox execution environment |
87
+ | 33 | Codex CLI Features | OpenAI | [developers.openai.com/codex/cli/features](https://developers.openai.com/codex/cli/features/) | 2025 | CLI capabilities and workflows |
88
+ | 34 | Codex Security Guide | OpenAI | [developers.openai.com/codex/security](https://developers.openai.com/codex/security/) | 2025 | sandboxing and network isolation |
89
+ | 35 | Codex SDK | OpenAI | [developers.openai.com/codex/sdk](https://developers.openai.com/codex/sdk/) | 2025 | programmatic integration |
90
+
91
+ ### other coding assistants
92
+
93
+ | # | title | source | url | date | relevance |
94
+ |---|-------|--------|-----|------|-----------|
95
+ | 36 | Devin AI Architecture | various | (multiple sources) | 2024 | autonomous software engineer |
96
+ | 37 | Aider: AI Pair Programming | aider.chat | [aider.chat](https://aider.chat/) | 2024 | git-integrated coding assistant |
97
+ | 38 | Cursor AI | cursor.com | [cursor.com](https://cursor.com/) | 2024 | AI-augmented IDE |
98
+ | 39 | GitHub Copilot | GitHub | [github.blog](https://github.blog/) | 2024 | code completion and chat |
99
+
100
+ ---
101
+
102
+ ## context management
103
+
104
+ | # | title | source | url | date | relevance |
105
+ |---|-------|--------|-----|------|-----------|
106
+ | 40 | MemGPT: Virtual Context Management | Packer et al. | [arXiv:2310.08560](https://arxiv.org/abs/2310.08560) | 2023-10 | hierarchical memory for extended context |
107
+ | 41 | Extended Thinking Documentation | Anthropic | [support.claude.com](https://support.claude.com/en/articles/10574485-using-extended-thinking) | 2025 | thinking budgets and serial test-time compute |
108
+ | 42 | Context Window Management Strategies | various | (multiple sources) | 2024 | summarization and compaction techniques |
109
+
110
+ ---
111
+
112
+ ## benchmarks and performance
113
+
114
+ ### code generation benchmarks
115
+
116
+ | # | title | source | url | date | relevance |
117
+ |---|-------|--------|-----|------|-----------|
118
+ | 43 | SWE-bench: Software Engineering Benchmark | Princeton NLP | [swebench.com](https://www.swebench.com/) | 2024 | real-world github issue resolution |
119
+ | 44 | HumanEval Benchmark | OpenAI | [paperswithcode.com](https://paperswithcode.com/dataset/humaneval) | 2021 | function synthesis from docstrings |
120
+ | 45 | HumanEval Pro and MBPP Pro | - | [arXiv:2412.21199](https://arxiv.org/abs/2412.21199) | 2024-12, ACL 2025 | self-invoking code generation |
121
+ | 46 | MBPP Benchmark | Google | [paperswithcode.com](https://paperswithcode.com/sota/code-generation-on-mbpp) | 2021 | mostly basic python problems |
122
+ | 47 | EvalPlus Leaderboard | - | [evalplus.github.io](https://evalplus.github.io/leaderboard.html) | 2024 | augmented test suites for HumanEval/MBPP |
123
+
124
+ ### agent benchmarks
125
+
126
+ | # | title | source | url | date | relevance |
127
+ |---|-------|--------|-----|------|-----------|
128
+ | 48 | AgentBench | Liu et al. | [arXiv:2308.03688](https://arxiv.org/abs/2308.03688) | 2023-08 | multi-environment agent evaluation |
129
+ | 49 | LiveBench | - | [livebench.ai](https://livebench.ai/) | 2024 | continuously updated LLM evaluation |
130
+
131
+ ### tool comparisons
132
+
133
+ | # | title | source | url | date | relevance |
134
+ |---|-------|--------|-----|------|-----------|
135
+ | 50 | Coding Agents Comparison | Artificial Analysis | [artificialanalysis.ai](https://artificialanalysis.ai/insights/coding-agents-comparison) | 2024 | Claude Code, Cursor, Copilot comparison |
136
+ | 51 | AI Coding Agents Benchmark 2025 | Render | [render.com/blog](https://render.com/blog/ai-coding-agents-benchmark) | 2025 | practical benchmark results |
137
+ | 52 | Best AI Code Apply Tools 2025 | Morph | [morphllm.com/comparisons](https://www.morphllm.com/comparisons) | 2025 | enterprise benchmarks |
138
+ | 53 | Claude Code vs Cursor Deep Comparison | Qodo | [qodo.ai/blog](https://www.qodo.ai/blog/claude-code-vs-cursor/) | 2025 | detailed feature comparison |
139
+
140
+ ---
141
+
142
+ ## reasoning strategy comparisons
143
+
144
+ | # | title | source | url | date | relevance |
145
+ |---|-------|--------|-----|------|-----------|
146
+ | 54 | ReAct vs CoT Performance | Google Research | [research.google/blog](https://research.google/blog/react-synergizing-reasoning-and-acting-in-language-models/) | 2022 | comparative analysis on HotPotQA, FEVER, ALFWorld |
147
+ | 55 | Comprehensive Guide to ReAct Prompting | Mercity | [mercity.ai/blog-post](https://www.mercity.ai/blog-post/react-prompting-and-react-based-agentic-systems) | 2024 | practical guide with performance notes |
148
+
149
+ ---
150
+
151
+ ## key performance findings
152
+
153
+ ### reasoning strategies (from sources)
154
+
155
+ | strategy | benchmark | performance | source |
156
+ |----------|-----------|-------------|--------|
157
+ | ReAct | HotPotQA | competitive with CoT, better grounding | [1] |
158
+ | ReAct | ALFWorld | +34% over imitation learning | [1] |
159
+ | CoT | HotPotQA | higher success, but 56% hallucination in failures | [1] |
160
+ | Self-Consistency | various | significant improvement over single-path CoT | [5] |
161
+ | Tree of Thoughts | Game of 24 | 74% (vs 4% CoT) | [3] |
162
+ | LATS | HotPotQA | state-of-the-art with MCTS | [6] |
163
+ | Reflexion | ALFWorld | +22% improvement via self-reflection | [4] |
164
+
165
+ ### code generation (from sources)
166
+
167
+ | model/tool | HumanEval | MBPP | SWE-bench | source |
168
+ |------------|-----------|------|-----------|--------|
169
+ | o1-mini | 96.2% | - | - | [45] |
170
+ | o1-mini (Pro) | 76.2% | - | - | [45] |
171
+ | GPT-4o + planning | - | 84.8% | - | [43] |
172
+ | Claude Code | - | - | ~49% (verified) | [44] |
173
+
174
+ ---
175
+
176
+ ## access date
177
+
178
+ all sources accessed: 2025-12-23
@@ -0,0 +1,25 @@
1
+ # llm (large language model)
2
+
3
+ ## .what
4
+
5
+ a neural network trained on vast text corpora that predicts the next token in a sequence, enabling it to generate coherent text, follow instructions, and perform reasoning.
6
+
7
+ ## .why
8
+
9
+ the llm is the core intelligence of a replic brain. it provides the reasoning and generation capabilities that power all downstream behaviors — from understanding natural language to generating code to deciding which tools to invoke.
10
+
11
+ ## dependsOn
12
+
13
+ - (none — foundational primitive)
14
+
15
+ ## key characteristics
16
+
17
+ - **autoregressive generation**: produces output one token at a time, conditioning on all previous tokens
18
+ - **context window**: has a fixed maximum number of tokens it can process at once
19
+ - **emergent capabilities**: reasoning, instruction-following, and tool use emerge at scale
20
+ - **stochastic**: outputs are probabilistic, controlled via temperature parameter
21
+
22
+ ## sources
23
+
24
+ - [Chain-of-Thought Prompting](https://arxiv.org/abs/2201.11903) — demonstrates reasoning emergence in LLMs
25
+ - [CoALA: Cognitive Architectures for Language Agents](https://arxiv.org/abs/2309.02427) — positions LLM as central to agent architecture
@@ -0,0 +1,33 @@
1
+ # repl (read-eval-print-loop)
2
+
3
+ ## .what
4
+
5
+ an interactive programming pattern where the system reads user input, evaluates it, prints the result, and loops back to read more input.
6
+
7
+ ## .why
8
+
9
+ the repl pattern enables iterative, conversational interaction. when an llm operates behind a repl, it can receive feedback, execute actions, observe results, and refine its approach — the foundation of agentic behavior.
10
+
11
+ ## dependsOn
12
+
13
+ - (none — foundational primitive)
14
+
15
+ ## key characteristics
16
+
17
+ - **read**: accept input from user or environment
18
+ - **eval**: process and execute the input
19
+ - **print**: display results or output
20
+ - **loop**: repeat the cycle indefinitely
21
+
22
+ ## in replic brains
23
+
24
+ the repl structure manifests as:
25
+ 1. **read**: receive user message or tool result
26
+ 2. **eval**: llm generates response/action
27
+ 3. **print**: emit response or execute tool
28
+ 4. **loop**: continue until task complete
29
+
30
+ ## sources
31
+
32
+ - unix shell, lisp repl — historical precedent
33
+ - [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents) — describes agentic loop as repl-like
@@ -0,0 +1,35 @@
1
+ # replic-brain
2
+
3
+ ## .what
4
+
5
+ an llm operating behind a repl interface, forming an interactive system capable of iterative reasoning, tool use, and task completion through conversation.
6
+
7
+ ## .why
8
+
9
+ the term "replic brain" names the specific architectural pattern where an llm's capabilities are harnessed through a read-eval-print-loop. this pattern enables the llm to act as an agent — receiving feedback, taking actions, and iterating toward goals.
10
+
11
+ ## dependsOn
12
+
13
+ - `llm` — provides reasoning and generation
14
+ - `repl` — provides interactive loop structure
15
+
16
+ ## key characteristics
17
+
18
+ - **conversational**: maintains dialogue state across turns
19
+ - **tool-capable**: can invoke external tools and process results
20
+ - **iterative**: refines approach based on feedback
21
+ - **goal-directed**: works toward completing user tasks
22
+
23
+ ## examples
24
+
25
+ | name | organization | context |
26
+ |------|--------------|---------|
27
+ | claude code | anthropic | cli-based coding assistant |
28
+ | codex | openai | cloud sandbox coding agent |
29
+ | cursor | cursor inc | ide-integrated coding assistant |
30
+ | aider | open source | git-integrated pair programmer |
31
+
32
+ ## sources
33
+
34
+ - [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents) — describes the agentic loop pattern
35
+ - [CoALA](https://arxiv.org/abs/2309.02427) — systematic framework for language agent architectures
@@ -0,0 +1,40 @@
1
+ # context-window
2
+
3
+ ## .what
4
+
5
+ the fixed-size buffer of tokens that an llm can process in a single forward pass, representing its working memory during generation.
6
+
7
+ ## .why
8
+
9
+ the context window is the fundamental constraint that shapes all replic brain architectures. it determines how much conversation history, code, and tool results can be processed simultaneously. strategies like context compaction, subagents, and memory hierarchies exist specifically to work within or around this limit.
10
+
11
+ ## dependsOn
12
+
13
+ - `llm` — context window is a property of the llm
14
+
15
+ ## key characteristics
16
+
17
+ - **fixed size**: measured in tokens (e.g., 200k tokens for claude)
18
+ - **attention-based**: all tokens attend to all other tokens (O(n²) complexity)
19
+ - **includes everything**: system prompt, conversation, tool calls, tool results
20
+ - **ephemeral**: cleared between sessions (no persistent memory)
21
+
22
+ ## size examples (2024-2025)
23
+
24
+ | model | context window |
25
+ |-------|----------------|
26
+ | gpt-4o | 128k tokens |
27
+ | claude 3.5/4 | 200k tokens |
28
+ | gemini 1.5 | 1m+ tokens |
29
+
30
+ ## implications for architecture
31
+
32
+ - longer context = more code/conversation in single pass
33
+ - summarization needed when context fills
34
+ - subagents can isolate context usage
35
+ - caching optimizes repeated prompts
36
+
37
+ ## sources
38
+
39
+ - [MemGPT](https://arxiv.org/abs/2310.08560) — virtual context management
40
+ - [Claude Documentation](https://docs.anthropic.com) — 200k token context
@@ -0,0 +1,44 @@
1
+ # system-prompt
2
+
3
+ ## .what
4
+
5
+ the initial instructions provided to an llm at the start of a conversation that define its behavior, capabilities, constraints, and persona.
6
+
7
+ ## .why
8
+
9
+ the system prompt is the primary mechanism for shaping a replic brain's behavior. it establishes what tools are available, how to use them, what style to adopt, and what constraints to follow. changes to the system prompt fundamentally alter the agent's capabilities.
10
+
11
+ ## dependsOn
12
+
13
+ - `llm` — interprets and follows the system prompt
14
+ - `context-window` — system prompt consumes context tokens
15
+
16
+ ## key characteristics
17
+
18
+ - **persistent**: remains in context for entire conversation
19
+ - **privileged**: typically cannot be overridden by user messages
20
+ - **declarative**: describes desired behavior, not code
21
+ - **composable**: can include tool definitions, examples, constraints
22
+
23
+ ## typical contents (replic brains)
24
+
25
+ ```
26
+ - persona/role definition
27
+ - available tools and their schemas
28
+ - behavioral constraints
29
+ - output format requirements
30
+ - examples of desired behavior
31
+ - safety guardrails
32
+ ```
33
+
34
+ ## examples
35
+
36
+ | system | system prompt size | notable elements |
37
+ |--------|-------------------|------------------|
38
+ | claude code | ~15k tokens | tool definitions, coding guidelines, git workflow |
39
+ | codex | varies | sandbox rules, security constraints |
40
+
41
+ ## sources
42
+
43
+ - [Claude Code System Prompt Analysis](https://zenn.dev/) — detailed breakdown
44
+ - [Building Effective Agents](https://www.anthropic.com/research/building-effective-agents) — system prompt design