gaslighting-engine 0.2.2 → 0.3.1

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 (36) hide show
  1. package/.agents/prompts/gaslighting.md +2 -1
  2. package/.agents/skills/gaslighting/SKILL.md +4 -1
  3. package/.codex/prompts/gaslighting.md +2 -1
  4. package/.codex/skills/gaslighting/SKILL.md +4 -1
  5. package/README.md +50 -1
  6. package/dist/cli.js +41 -1
  7. package/dist/commands/cockpit.js +197 -0
  8. package/dist/commands/doctor.js +1 -0
  9. package/dist/core/cockpitHtml.js +598 -0
  10. package/dist/core/codexRuntime.js +103 -0
  11. package/dist/core/generateDocs.js +5 -3
  12. package/dist/core/generateOtherMarkdown.js +68 -4
  13. package/dist/index.js +1 -1
  14. package/dist/utils/logger.js +1 -1
  15. package/dist/version.js +1 -1
  16. package/docs/codex-usage.md +24 -4
  17. package/docs/examples.md +3 -0
  18. package/examples/ecommerce/.codex/prompts/gaslighting.md +2 -1
  19. package/examples/ecommerce/.codex/skills/gaslighting/SKILL.md +4 -1
  20. package/examples/ecommerce/.gaslighting/AGENTS.md +3 -1
  21. package/examples/ecommerce/.gaslighting/AGENT_RUNTIME.md +54 -0
  22. package/examples/ecommerce/.gaslighting/CODEX_PROMPT.md +2 -1
  23. package/examples/ecommerce/AGENTS.md +3 -2
  24. package/examples/hospital-homepage/.codex/prompts/gaslighting.md +2 -1
  25. package/examples/hospital-homepage/.codex/skills/gaslighting/SKILL.md +4 -1
  26. package/examples/hospital-homepage/.gaslighting/AGENTS.md +3 -1
  27. package/examples/hospital-homepage/.gaslighting/AGENT_RUNTIME.md +54 -0
  28. package/examples/hospital-homepage/.gaslighting/CODEX_PROMPT.md +2 -1
  29. package/examples/hospital-homepage/AGENTS.md +3 -2
  30. package/examples/landing-page/.codex/prompts/gaslighting.md +2 -1
  31. package/examples/landing-page/.codex/skills/gaslighting/SKILL.md +4 -1
  32. package/examples/landing-page/.gaslighting/AGENTS.md +3 -1
  33. package/examples/landing-page/.gaslighting/AGENT_RUNTIME.md +54 -0
  34. package/examples/landing-page/.gaslighting/CODEX_PROMPT.md +2 -1
  35. package/examples/landing-page/AGENTS.md +3 -2
  36. package/package.json +1 -1
@@ -0,0 +1,103 @@
1
+ import { spawn } from "node:child_process";
2
+ import { platform } from "node:os";
3
+ const defaultCodexArgs = "--search --dangerously-bypass-approvals-and-sandbox";
4
+ export function getDefaultCodexArgs() {
5
+ return process.env.GASLIGHTING_CODEX_ARGS || defaultCodexArgs;
6
+ }
7
+ export function buildCodexPrompt(request) {
8
+ return [
9
+ "Use the gaslighting skill.",
10
+ "",
11
+ "Read these files before doing any implementation:",
12
+ "1. AGENTS.md",
13
+ "2. .gaslighting/GASLIGHTING.md",
14
+ "3. .gaslighting/PRD.md",
15
+ "4. .gaslighting/STACK_POLICY.md",
16
+ "5. .gaslighting/MISSING_INFO.md",
17
+ "6. .gaslighting/ASSUMPTIONS.md",
18
+ "7. .gaslighting/DECISION_LOG.md",
19
+ "8. .gaslighting/MEMORY.md",
20
+ "9. .gaslighting/AGENT_RUNTIME.md",
21
+ "10. .gaslighting/PROJECT_CARE.md",
22
+ "",
23
+ `Project request: ${request}`,
24
+ "",
25
+ "Implement the MVP. Preserve full scope. Do not use TODOs as fake implementation. Do not deliver representative examples when full coverage is required. If something is incomplete, declare it explicitly.",
26
+ ].join("\n");
27
+ }
28
+ export function buildCodexCommand(input) {
29
+ return buildCodexCommandParts(input).command;
30
+ }
31
+ export function launchCodexInCurrentTerminal(input) {
32
+ const parts = buildCodexCommandParts(input);
33
+ try {
34
+ const child = platform() === "win32"
35
+ ? spawn("cmd.exe", ["/d", "/s", "/c", "codex", ...parts.args, "-C", input.root, parts.prompt], {
36
+ cwd: input.root,
37
+ stdio: "inherit",
38
+ })
39
+ : spawn("codex", [...parts.args, "-C", input.root, parts.prompt], {
40
+ cwd: input.root,
41
+ stdio: "inherit",
42
+ });
43
+ child.on("exit", (code) => {
44
+ process.exit(code ?? 0);
45
+ });
46
+ child.on("error", (error) => {
47
+ console.error(`Could not start Codex: ${error.message}`);
48
+ console.error(parts.command);
49
+ process.exit(1);
50
+ });
51
+ return { ok: true, command: parts.command, message: "Mission Control handed off to Codex in this terminal." };
52
+ }
53
+ catch (error) {
54
+ const message = error instanceof Error ? error.message : "Unknown Codex launch failure.";
55
+ return { ok: false, command: parts.command, message };
56
+ }
57
+ }
58
+ export function launchCodexInNewTerminal(input) {
59
+ const parts = buildCodexCommandParts(input);
60
+ try {
61
+ if (platform() === "win32") {
62
+ const child = spawn("cmd.exe", ["/c", "start", "Gaslighting Codex", "/D", input.root, "codex", ...parts.args, "-C", input.root, parts.prompt], {
63
+ cwd: input.root,
64
+ detached: true,
65
+ stdio: "ignore",
66
+ });
67
+ child.unref();
68
+ return { ok: true, command: parts.command, message: "Started Codex in a new terminal window." };
69
+ }
70
+ if (platform() === "darwin") {
71
+ const script = `tell application "Terminal" to do script ${JSON.stringify(`cd ${quoteShell(input.root)} && ${parts.command}`)}`;
72
+ const child = spawn("osascript", ["-e", script], { detached: true, stdio: "ignore" });
73
+ child.unref();
74
+ return { ok: true, command: parts.command, message: "Started Codex in Terminal." };
75
+ }
76
+ const child = spawn("sh", ["-lc", `cd ${quoteShell(input.root)} && ${parts.command}`], { detached: true, stdio: "ignore" });
77
+ child.unref();
78
+ return { ok: true, command: parts.command, message: "Started Codex in the background. If no terminal appears, copy the command and run it manually." };
79
+ }
80
+ catch (error) {
81
+ const message = error instanceof Error ? error.message : "Unknown Codex launch failure.";
82
+ return { ok: false, command: parts.command, message };
83
+ }
84
+ }
85
+ function buildCodexCommandParts(input) {
86
+ const args = splitCommandArgs(input.codexArgs || getDefaultCodexArgs());
87
+ const prompt = buildCodexPrompt(input.request);
88
+ return { args, prompt, command: ["codex", ...args, "-C", quoteArg(input.root), quoteArg(prompt)].join(" ") };
89
+ }
90
+ export function splitCommandArgs(input) {
91
+ const args = [];
92
+ const pattern = /"([^"]*)"|'([^']*)'|(\S+)/g;
93
+ let match;
94
+ while ((match = pattern.exec(input)) !== null)
95
+ args.push(match[1] ?? match[2] ?? match[3] ?? "");
96
+ return args.filter(Boolean);
97
+ }
98
+ function quoteArg(value) {
99
+ return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"').replaceAll("\n", "\\n")}"`;
100
+ }
101
+ function quoteShell(value) {
102
+ return `'${value.replaceAll("'", "'\\''")}'`;
103
+ }
@@ -2,7 +2,7 @@ import { analyze } from "./analyze.js";
2
2
  import { generateGaslightingMarkdown } from "./generateGaslightingMarkdown.js";
3
3
  import { generatePrdMarkdown } from "./generatePrdMarkdown.js";
4
4
  import { generateProjectCareMarkdown } from "./projectCare.js";
5
- import { generateAgentsMarkdown, generateAssumptionsMarkdown, generateCodexPromptMarkdown, generateCodexSlashPromptMarkdown, generateDecisionLogMarkdown, generateMemoryMarkdown, generateMissingInfoMarkdown, generateSkillMarkdown, generateSkillOpenAiYaml, generateSkillReferenceDocs, generateStackPolicyMarkdown, } from "./generateOtherMarkdown.js";
5
+ import { generateAgentsMarkdown, generateAgentRuntimeMarkdown, generateAssumptionsMarkdown, generateCodexPromptMarkdown, generateCodexSlashPromptMarkdown, generateDecisionLogMarkdown, generateMemoryMarkdown, generateMissingInfoMarkdown, generateSkillMarkdown, generateSkillOpenAiYaml, generateSkillReferenceDocs, generateStackPolicyMarkdown, } from "./generateOtherMarkdown.js";
6
6
  const disciplineDir = ".gaslighting";
7
7
  export function generateDocs(input, root = process.cwd()) {
8
8
  const normalized = {
@@ -18,6 +18,7 @@ export function generateDocs(input, root = process.cwd()) {
18
18
  { filename: `${disciplineDir}/MISSING_INFO.md`, content: generateMissingInfoMarkdown(analysis) },
19
19
  { filename: `${disciplineDir}/DECISION_LOG.md`, content: generateDecisionLogMarkdown(normalized, analysis) },
20
20
  { filename: `${disciplineDir}/MEMORY.md`, content: generateMemoryMarkdown(normalized, analysis) },
21
+ { filename: `${disciplineDir}/AGENT_RUNTIME.md`, content: generateAgentRuntimeMarkdown(normalized, analysis) },
21
22
  { filename: `${disciplineDir}/STACK_POLICY.md`, content: generateStackPolicyMarkdown(analysis) },
22
23
  { filename: `${disciplineDir}/PROJECT_CARE.md`, content: generateProjectCareMarkdown(normalized, analysis, root) },
23
24
  { filename: `${disciplineDir}/AGENTS.md`, content: generateAgentsMarkdown() },
@@ -88,8 +89,9 @@ Before doing any work, read these files in order:
88
89
  5. \`.gaslighting/ASSUMPTIONS.md\`
89
90
  6. \`.gaslighting/DECISION_LOG.md\`
90
91
  7. \`.gaslighting/MEMORY.md\`
91
- 8. \`.gaslighting/PROJECT_CARE.md\`
92
- 9. \`.gaslighting/AGENTS.md\`
92
+ 8. \`.gaslighting/AGENT_RUNTIME.md\`
93
+ 9. \`.gaslighting/PROJECT_CARE.md\`
94
+ 10. \`.gaslighting/AGENTS.md\`
93
95
 
94
96
  Do not reduce scope.
95
97
 
@@ -223,7 +223,8 @@ Before doing any work, read these files in order:
223
223
  5. \`.gaslighting/ASSUMPTIONS.md\`
224
224
  6. \`.gaslighting/DECISION_LOG.md\`
225
225
  7. \`.gaslighting/MEMORY.md\`
226
- 8. \`.gaslighting/PROJECT_CARE.md\`
226
+ 8. \`.gaslighting/AGENT_RUNTIME.md\`
227
+ 9. \`.gaslighting/PROJECT_CARE.md\`
227
228
 
228
229
  ## Prime Directive
229
230
 
@@ -253,6 +254,7 @@ A task is complete only when:
253
254
  - New assumptions are documented.
254
255
  - New technical decisions are recorded.
255
256
  - Stable project facts are recorded in \`.gaslighting/MEMORY.md\`.
257
+ - Runtime execution rules are preserved in \`.gaslighting/AGENT_RUNTIME.md\`.
256
258
  - Operational risks are recorded in \`.gaslighting/PROJECT_CARE.md\`.
257
259
  - The result does not contradict \`.gaslighting/GASLIGHTING.md\`.
258
260
 
@@ -322,6 +324,63 @@ When a memory becomes wrong, do not silently delete it. Mark it outdated and app
322
324
  ${bullets(analysis.assumptions)}
323
325
  `;
324
326
  }
327
+ export function generateAgentRuntimeMarkdown(input, analysis) {
328
+ return `# AGENT_RUNTIME.md
329
+
330
+ This file defines how Codex must operate after Gaslighting-engine prepares the project.
331
+
332
+ It is not a suggestion file.
333
+
334
+ It is the runtime loop.
335
+
336
+ ## Mission
337
+
338
+ - Original request: ${input.rawUserRequest}
339
+ - Project type: ${analysis.projectType}
340
+ - Classification confidence: ${analysis.confidence}
341
+ - Runtime stance: Codex-first, full-scope, no fake completion.
342
+
343
+ ## Required Loop
344
+
345
+ 1. Read the control files before implementation.
346
+ 2. Restate the project purpose in one short paragraph.
347
+ 3. Convert the PRD into a concrete task checklist.
348
+ 4. Implement the checklist systematically.
349
+ 5. Use scripts or structured data for repetitive work.
350
+ 6. Verify the result with build, tests, lint, browser checks, or direct inspection as appropriate.
351
+ 7. Update \`.gaslighting/DECISION_LOG.md\` when a product or technical decision changes.
352
+ 8. Update \`.gaslighting/MISSING_INFO.md\` when missing information is discovered or resolved.
353
+ 9. Update \`.gaslighting/MEMORY.md\` when stable project facts are learned.
354
+ 10. Update \`.gaslighting/PROJECT_CARE.md\` when GitHub, domain, deployment, env, analytics, email, or launch ownership changes.
355
+
356
+ ## Agent Rules
357
+
358
+ - Do not ask the user for non-blocking information before starting work.
359
+ - Do make a reasonable temporary assumption, document it, and continue.
360
+ - Do not create only the visible surface and ignore operational details.
361
+ - Do not stop at a plan when implementation was requested.
362
+ - Do not call a scaffold complete.
363
+ - Do not call TODO comments implementation.
364
+ - Do not call examples full coverage.
365
+ - Do not hide risk behind confident wording.
366
+ - Do not over-engineer to look sophisticated.
367
+ - Do not under-deliver because the work is repetitive.
368
+
369
+ ## Codex Execution Contract
370
+
371
+ Before claiming completion, Codex must be able to answer:
372
+
373
+ - What exact requested scope was completed?
374
+ - What exact files changed?
375
+ - What verification was run?
376
+ - What assumptions are still active?
377
+ - What missing information remains?
378
+ - What care risks remain?
379
+ - Is anything incomplete?
380
+
381
+ If anything is incomplete, use the failure declaration protocol in \`.gaslighting/GASLIGHTING.md\`.
382
+ `;
383
+ }
325
384
  export function generateSkillMarkdown() {
326
385
  return `---
327
386
  name: gaslighting
@@ -348,7 +407,8 @@ Instead:
348
407
  10. Generate \`.gaslighting/DECISION_LOG.md\`.
349
408
  11. Generate \`.gaslighting/STACK_POLICY.md\`.
350
409
  12. Generate or update root \`AGENTS.md\`.
351
- 13. Generate \`.gaslighting/PROJECT_CARE.md\`.
410
+ 13. Generate \`.gaslighting/AGENT_RUNTIME.md\`.
411
+ 14. Generate \`.gaslighting/PROJECT_CARE.md\`.
352
412
 
353
413
  ## Hardcore Discipline Rule
354
414
 
@@ -417,6 +477,8 @@ Keep main project-control files in \`.gaslighting/\` and keep only the Codex poi
417
477
 
418
478
  Use \`.gaslighting/PROJECT_CARE.md\` to track Git/GitHub/domain/deployment/launch risks without blocking implementation.
419
479
 
480
+ Use \`.gaslighting/AGENT_RUNTIME.md\` to define the execution loop Codex must follow after the docs are generated.
481
+
420
482
  Do not only explain.
421
483
 
422
484
  Do not produce a plan without files.
@@ -462,7 +524,8 @@ Read the following files before doing any work:
462
524
  6. \`.gaslighting/DECISION_LOG.md\`
463
525
  7. \`AGENTS.md\`
464
526
  8. \`.gaslighting/MEMORY.md\`
465
- 9. \`.gaslighting/PROJECT_CARE.md\`
527
+ 9. \`.gaslighting/AGENT_RUNTIME.md\`
528
+ 10. \`.gaslighting/PROJECT_CARE.md\`
466
529
 
467
530
  Then implement the project MVP.
468
531
 
@@ -502,7 +565,8 @@ Read the Gaslighting-engine project-control files before doing any work:
502
565
  6. \`.gaslighting/DECISION_LOG.md\`
503
566
  7. \`AGENTS.md\`
504
567
  8. \`.gaslighting/MEMORY.md\`
505
- 9. \`.gaslighting/PROJECT_CARE.md\`
568
+ 9. \`.gaslighting/AGENT_RUNTIME.md\`
569
+ 10. \`.gaslighting/PROJECT_CARE.md\`
506
570
 
507
571
  Then execute the user's requested implementation.
508
572
 
package/dist/index.js CHANGED
@@ -2,4 +2,4 @@
2
2
  import { buildCli, normalizeDefaultInitArgv } from "./cli.js";
3
3
  import { notifyIfUpdateAvailable } from "./utils/updateCheck.js";
4
4
  await notifyIfUpdateAvailable(process.argv);
5
- buildCli().parse(normalizeDefaultInitArgv(process.argv));
5
+ await buildCli().parseAsync(normalizeDefaultInitArgv(process.argv));
@@ -31,5 +31,5 @@ export function printSummary(analysis, modeLines, results, care) {
31
31
  console.log(`- WARN ${warning.label}: ${warning.message} Next: ${warning.action}`);
32
32
  }
33
33
  console.log('\nNext:\nOpen Codex and say:\n');
34
- console.log('"Read AGENTS.md, .gaslighting/GASLIGHTING.md, .gaslighting/PRD.md, .gaslighting/STACK_POLICY.md, .gaslighting/MISSING_INFO.md, .gaslighting/ASSUMPTIONS.md, .gaslighting/DECISION_LOG.md, .gaslighting/MEMORY.md, and .gaslighting/PROJECT_CARE.md. Implement the MVP without shrinking scope, without TODO escape, and without fake completion."');
34
+ console.log('"Read AGENTS.md, .gaslighting/GASLIGHTING.md, .gaslighting/PRD.md, .gaslighting/STACK_POLICY.md, .gaslighting/MISSING_INFO.md, .gaslighting/ASSUMPTIONS.md, .gaslighting/DECISION_LOG.md, .gaslighting/MEMORY.md, .gaslighting/AGENT_RUNTIME.md, and .gaslighting/PROJECT_CARE.md. Implement the MVP without shrinking scope, without TODO escape, and without fake completion."');
35
35
  }
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const packageName = "gaslighting-engine";
2
- export const packageVersion = "0.2.2";
2
+ export const packageVersion = "0.3.1";
@@ -48,19 +48,39 @@ This is the recommended update flow. It overwrites the local Codex skill and pro
48
48
 
49
49
  ## Generate Discipline Docs
50
50
 
51
- Generate documents:
51
+ Generate documents and open Mission Control:
52
52
 
53
53
  ```bash
54
- gaslighting-engine "I want to build a hospital website."
54
+ npx gaslighting-engine@latest start "I want to build a hospital website."
55
+ ```
56
+
57
+ `Start Codex` continues in the same terminal by default. Use `--new-terminal` only when you intentionally want a separate terminal window.
58
+
59
+ Custom Codex flags:
60
+
61
+ ```bash
62
+ npx gaslighting-engine@latest start "I want to build a hospital website." --codex-args="--search --dangerously-bypass-approvals-and-sandbox"
63
+ ```
64
+
65
+ Open the GUI for an existing Gaslighting project:
66
+
67
+ ```bash
68
+ npx gaslighting-engine@latest cockpit
69
+ ```
70
+
71
+ Run Codex without the GUI:
72
+
73
+ ```bash
74
+ npx gaslighting-engine@latest run "I want to build a hospital website."
55
75
  ```
56
76
 
57
77
  Then ask Codex:
58
78
 
59
79
  ```txt
60
- Read AGENTS.md, .gaslighting/GASLIGHTING.md, .gaslighting/PRD.md, .gaslighting/STACK_POLICY.md, .gaslighting/MISSING_INFO.md, .gaslighting/ASSUMPTIONS.md, .gaslighting/DECISION_LOG.md, .gaslighting/MEMORY.md, and .gaslighting/PROJECT_CARE.md.
80
+ Read AGENTS.md, .gaslighting/GASLIGHTING.md, .gaslighting/PRD.md, .gaslighting/STACK_POLICY.md, .gaslighting/MISSING_INFO.md, .gaslighting/ASSUMPTIONS.md, .gaslighting/DECISION_LOG.md, .gaslighting/MEMORY.md, .gaslighting/AGENT_RUNTIME.md, and .gaslighting/PROJECT_CARE.md.
61
81
  Implement the MVP without shrinking scope, without TODO escape, and without fake completion.
62
82
  ```
63
83
 
64
84
  Codex should treat root `AGENTS.md` as the project guidance pointer and `.gaslighting/GASLIGHTING.md` as the anti-escape contract.
65
85
 
66
- The CLI also generates Codex Skill files, prompt fallback files, `.gaslighting/CODEX_GASLIGHTING.md`, and `.gaslighting/PROJECT_CARE.md` so the workflow still works when a specific Codex surface does not expose a custom slash entry.
86
+ The CLI also generates Codex Skill files, prompt fallback files, `.gaslighting/CODEX_GASLIGHTING.md`, `.gaslighting/AGENT_RUNTIME.md`, and `.gaslighting/PROJECT_CARE.md` so the workflow still works when a specific Codex surface does not expose a custom slash entry.
package/docs/examples.md CHANGED
@@ -18,6 +18,9 @@ node dist/index.js "Build a landing page for a new service that captures leads."
18
18
  Published usage:
19
19
 
20
20
  ```bash
21
+ npx gaslighting-engine@latest start "I want to build a hospital website."
22
+ npx gaslighting-engine@latest cockpit
23
+ npx gaslighting-engine@latest run "I want to build a hospital website."
21
24
  npx gaslighting-engine "I want to build a hospital website."
22
25
  npx gaslighting-engine@latest upgrade
23
26
  ```
@@ -10,7 +10,8 @@ Read the Gaslighting-engine project-control files before doing any work:
10
10
  6. `.gaslighting/DECISION_LOG.md`
11
11
  7. `AGENTS.md`
12
12
  8. `.gaslighting/MEMORY.md`
13
- 9. `.gaslighting/PROJECT_CARE.md`
13
+ 9. `.gaslighting/AGENT_RUNTIME.md`
14
+ 10. `.gaslighting/PROJECT_CARE.md`
14
15
 
15
16
  Then execute the user's requested implementation.
16
17
 
@@ -23,7 +23,8 @@ Instead:
23
23
  10. Generate `.gaslighting/DECISION_LOG.md`.
24
24
  11. Generate `.gaslighting/STACK_POLICY.md`.
25
25
  12. Generate or update root `AGENTS.md`.
26
- 13. Generate `.gaslighting/PROJECT_CARE.md`.
26
+ 13. Generate `.gaslighting/AGENT_RUNTIME.md`.
27
+ 14. Generate `.gaslighting/PROJECT_CARE.md`.
27
28
 
28
29
  ## Hardcore Discipline Rule
29
30
 
@@ -92,6 +93,8 @@ Keep main project-control files in `.gaslighting/` and keep only the Codex point
92
93
 
93
94
  Use `.gaslighting/PROJECT_CARE.md` to track Git/GitHub/domain/deployment/launch risks without blocking implementation.
94
95
 
96
+ Use `.gaslighting/AGENT_RUNTIME.md` to define the execution loop Codex must follow after the docs are generated.
97
+
95
98
  Do not only explain.
96
99
 
97
100
  Do not produce a plan without files.
@@ -11,7 +11,8 @@ Before doing any work, read these files in order:
11
11
  5. `.gaslighting/ASSUMPTIONS.md`
12
12
  6. `.gaslighting/DECISION_LOG.md`
13
13
  7. `.gaslighting/MEMORY.md`
14
- 8. `.gaslighting/PROJECT_CARE.md`
14
+ 8. `.gaslighting/AGENT_RUNTIME.md`
15
+ 9. `.gaslighting/PROJECT_CARE.md`
15
16
 
16
17
  ## Prime Directive
17
18
 
@@ -41,6 +42,7 @@ A task is complete only when:
41
42
  - New assumptions are documented.
42
43
  - New technical decisions are recorded.
43
44
  - Stable project facts are recorded in `.gaslighting/MEMORY.md`.
45
+ - Runtime execution rules are preserved in `.gaslighting/AGENT_RUNTIME.md`.
44
46
  - Operational risks are recorded in `.gaslighting/PROJECT_CARE.md`.
45
47
  - The result does not contradict `.gaslighting/GASLIGHTING.md`.
46
48
 
@@ -0,0 +1,54 @@
1
+ # AGENT_RUNTIME.md
2
+
3
+ This file defines how Codex must operate after Gaslighting-engine prepares the project.
4
+
5
+ It is not a suggestion file.
6
+
7
+ It is the runtime loop.
8
+
9
+ ## Mission
10
+
11
+ - Original request: Build an ecommerce MVP with product catalog, cart, checkout, and admin orders.
12
+ - Project type: ecommerce
13
+ - Classification confidence: high
14
+ - Runtime stance: Codex-first, full-scope, no fake completion.
15
+
16
+ ## Required Loop
17
+
18
+ 1. Read the control files before implementation.
19
+ 2. Restate the project purpose in one short paragraph.
20
+ 3. Convert the PRD into a concrete task checklist.
21
+ 4. Implement the checklist systematically.
22
+ 5. Use scripts or structured data for repetitive work.
23
+ 6. Verify the result with build, tests, lint, browser checks, or direct inspection as appropriate.
24
+ 7. Update `.gaslighting/DECISION_LOG.md` when a product or technical decision changes.
25
+ 8. Update `.gaslighting/MISSING_INFO.md` when missing information is discovered or resolved.
26
+ 9. Update `.gaslighting/MEMORY.md` when stable project facts are learned.
27
+ 10. Update `.gaslighting/PROJECT_CARE.md` when GitHub, domain, deployment, env, analytics, email, or launch ownership changes.
28
+
29
+ ## Agent Rules
30
+
31
+ - Do not ask the user for non-blocking information before starting work.
32
+ - Do make a reasonable temporary assumption, document it, and continue.
33
+ - Do not create only the visible surface and ignore operational details.
34
+ - Do not stop at a plan when implementation was requested.
35
+ - Do not call a scaffold complete.
36
+ - Do not call TODO comments implementation.
37
+ - Do not call examples full coverage.
38
+ - Do not hide risk behind confident wording.
39
+ - Do not over-engineer to look sophisticated.
40
+ - Do not under-deliver because the work is repetitive.
41
+
42
+ ## Codex Execution Contract
43
+
44
+ Before claiming completion, Codex must be able to answer:
45
+
46
+ - What exact requested scope was completed?
47
+ - What exact files changed?
48
+ - What verification was run?
49
+ - What assumptions are still active?
50
+ - What missing information remains?
51
+ - What care risks remain?
52
+ - Is anything incomplete?
53
+
54
+ If anything is incomplete, use the failure declaration protocol in `.gaslighting/GASLIGHTING.md`.
@@ -14,7 +14,8 @@ Read the following files before doing any work:
14
14
  6. `.gaslighting/DECISION_LOG.md`
15
15
  7. `AGENTS.md`
16
16
  8. `.gaslighting/MEMORY.md`
17
- 9. `.gaslighting/PROJECT_CARE.md`
17
+ 9. `.gaslighting/AGENT_RUNTIME.md`
18
+ 10. `.gaslighting/PROJECT_CARE.md`
18
19
 
19
20
  Then implement the project MVP.
20
21
 
@@ -13,8 +13,9 @@ Before doing any work, read these files in order:
13
13
  5. `.gaslighting/ASSUMPTIONS.md`
14
14
  6. `.gaslighting/DECISION_LOG.md`
15
15
  7. `.gaslighting/MEMORY.md`
16
- 8. `.gaslighting/PROJECT_CARE.md`
17
- 9. `.gaslighting/AGENTS.md`
16
+ 8. `.gaslighting/AGENT_RUNTIME.md`
17
+ 9. `.gaslighting/PROJECT_CARE.md`
18
+ 10. `.gaslighting/AGENTS.md`
18
19
 
19
20
  Do not reduce scope.
20
21
 
@@ -10,7 +10,8 @@ Read the Gaslighting-engine project-control files before doing any work:
10
10
  6. `.gaslighting/DECISION_LOG.md`
11
11
  7. `AGENTS.md`
12
12
  8. `.gaslighting/MEMORY.md`
13
- 9. `.gaslighting/PROJECT_CARE.md`
13
+ 9. `.gaslighting/AGENT_RUNTIME.md`
14
+ 10. `.gaslighting/PROJECT_CARE.md`
14
15
 
15
16
  Then execute the user's requested implementation.
16
17
 
@@ -23,7 +23,8 @@ Instead:
23
23
  10. Generate `.gaslighting/DECISION_LOG.md`.
24
24
  11. Generate `.gaslighting/STACK_POLICY.md`.
25
25
  12. Generate or update root `AGENTS.md`.
26
- 13. Generate `.gaslighting/PROJECT_CARE.md`.
26
+ 13. Generate `.gaslighting/AGENT_RUNTIME.md`.
27
+ 14. Generate `.gaslighting/PROJECT_CARE.md`.
27
28
 
28
29
  ## Hardcore Discipline Rule
29
30
 
@@ -92,6 +93,8 @@ Keep main project-control files in `.gaslighting/` and keep only the Codex point
92
93
 
93
94
  Use `.gaslighting/PROJECT_CARE.md` to track Git/GitHub/domain/deployment/launch risks without blocking implementation.
94
95
 
96
+ Use `.gaslighting/AGENT_RUNTIME.md` to define the execution loop Codex must follow after the docs are generated.
97
+
95
98
  Do not only explain.
96
99
 
97
100
  Do not produce a plan without files.
@@ -11,7 +11,8 @@ Before doing any work, read these files in order:
11
11
  5. `.gaslighting/ASSUMPTIONS.md`
12
12
  6. `.gaslighting/DECISION_LOG.md`
13
13
  7. `.gaslighting/MEMORY.md`
14
- 8. `.gaslighting/PROJECT_CARE.md`
14
+ 8. `.gaslighting/AGENT_RUNTIME.md`
15
+ 9. `.gaslighting/PROJECT_CARE.md`
15
16
 
16
17
  ## Prime Directive
17
18
 
@@ -41,6 +42,7 @@ A task is complete only when:
41
42
  - New assumptions are documented.
42
43
  - New technical decisions are recorded.
43
44
  - Stable project facts are recorded in `.gaslighting/MEMORY.md`.
45
+ - Runtime execution rules are preserved in `.gaslighting/AGENT_RUNTIME.md`.
44
46
  - Operational risks are recorded in `.gaslighting/PROJECT_CARE.md`.
45
47
  - The result does not contradict `.gaslighting/GASLIGHTING.md`.
46
48
 
@@ -0,0 +1,54 @@
1
+ # AGENT_RUNTIME.md
2
+
3
+ This file defines how Codex must operate after Gaslighting-engine prepares the project.
4
+
5
+ It is not a suggestion file.
6
+
7
+ It is the runtime loop.
8
+
9
+ ## Mission
10
+
11
+ - Original request: I want to build a hospital website.
12
+ - Project type: hospital_homepage
13
+ - Classification confidence: medium
14
+ - Runtime stance: Codex-first, full-scope, no fake completion.
15
+
16
+ ## Required Loop
17
+
18
+ 1. Read the control files before implementation.
19
+ 2. Restate the project purpose in one short paragraph.
20
+ 3. Convert the PRD into a concrete task checklist.
21
+ 4. Implement the checklist systematically.
22
+ 5. Use scripts or structured data for repetitive work.
23
+ 6. Verify the result with build, tests, lint, browser checks, or direct inspection as appropriate.
24
+ 7. Update `.gaslighting/DECISION_LOG.md` when a product or technical decision changes.
25
+ 8. Update `.gaslighting/MISSING_INFO.md` when missing information is discovered or resolved.
26
+ 9. Update `.gaslighting/MEMORY.md` when stable project facts are learned.
27
+ 10. Update `.gaslighting/PROJECT_CARE.md` when GitHub, domain, deployment, env, analytics, email, or launch ownership changes.
28
+
29
+ ## Agent Rules
30
+
31
+ - Do not ask the user for non-blocking information before starting work.
32
+ - Do make a reasonable temporary assumption, document it, and continue.
33
+ - Do not create only the visible surface and ignore operational details.
34
+ - Do not stop at a plan when implementation was requested.
35
+ - Do not call a scaffold complete.
36
+ - Do not call TODO comments implementation.
37
+ - Do not call examples full coverage.
38
+ - Do not hide risk behind confident wording.
39
+ - Do not over-engineer to look sophisticated.
40
+ - Do not under-deliver because the work is repetitive.
41
+
42
+ ## Codex Execution Contract
43
+
44
+ Before claiming completion, Codex must be able to answer:
45
+
46
+ - What exact requested scope was completed?
47
+ - What exact files changed?
48
+ - What verification was run?
49
+ - What assumptions are still active?
50
+ - What missing information remains?
51
+ - What care risks remain?
52
+ - Is anything incomplete?
53
+
54
+ If anything is incomplete, use the failure declaration protocol in `.gaslighting/GASLIGHTING.md`.
@@ -14,7 +14,8 @@ Read the following files before doing any work:
14
14
  6. `.gaslighting/DECISION_LOG.md`
15
15
  7. `AGENTS.md`
16
16
  8. `.gaslighting/MEMORY.md`
17
- 9. `.gaslighting/PROJECT_CARE.md`
17
+ 9. `.gaslighting/AGENT_RUNTIME.md`
18
+ 10. `.gaslighting/PROJECT_CARE.md`
18
19
 
19
20
  Then implement the project MVP.
20
21
 
@@ -13,8 +13,9 @@ Before doing any work, read these files in order:
13
13
  5. `.gaslighting/ASSUMPTIONS.md`
14
14
  6. `.gaslighting/DECISION_LOG.md`
15
15
  7. `.gaslighting/MEMORY.md`
16
- 8. `.gaslighting/PROJECT_CARE.md`
17
- 9. `.gaslighting/AGENTS.md`
16
+ 8. `.gaslighting/AGENT_RUNTIME.md`
17
+ 9. `.gaslighting/PROJECT_CARE.md`
18
+ 10. `.gaslighting/AGENTS.md`
18
19
 
19
20
  Do not reduce scope.
20
21
 
@@ -10,7 +10,8 @@ Read the Gaslighting-engine project-control files before doing any work:
10
10
  6. `.gaslighting/DECISION_LOG.md`
11
11
  7. `AGENTS.md`
12
12
  8. `.gaslighting/MEMORY.md`
13
- 9. `.gaslighting/PROJECT_CARE.md`
13
+ 9. `.gaslighting/AGENT_RUNTIME.md`
14
+ 10. `.gaslighting/PROJECT_CARE.md`
14
15
 
15
16
  Then execute the user's requested implementation.
16
17
 
@@ -23,7 +23,8 @@ Instead:
23
23
  10. Generate `.gaslighting/DECISION_LOG.md`.
24
24
  11. Generate `.gaslighting/STACK_POLICY.md`.
25
25
  12. Generate or update root `AGENTS.md`.
26
- 13. Generate `.gaslighting/PROJECT_CARE.md`.
26
+ 13. Generate `.gaslighting/AGENT_RUNTIME.md`.
27
+ 14. Generate `.gaslighting/PROJECT_CARE.md`.
27
28
 
28
29
  ## Hardcore Discipline Rule
29
30
 
@@ -92,6 +93,8 @@ Keep main project-control files in `.gaslighting/` and keep only the Codex point
92
93
 
93
94
  Use `.gaslighting/PROJECT_CARE.md` to track Git/GitHub/domain/deployment/launch risks without blocking implementation.
94
95
 
96
+ Use `.gaslighting/AGENT_RUNTIME.md` to define the execution loop Codex must follow after the docs are generated.
97
+
95
98
  Do not only explain.
96
99
 
97
100
  Do not produce a plan without files.
@@ -11,7 +11,8 @@ Before doing any work, read these files in order:
11
11
  5. `.gaslighting/ASSUMPTIONS.md`
12
12
  6. `.gaslighting/DECISION_LOG.md`
13
13
  7. `.gaslighting/MEMORY.md`
14
- 8. `.gaslighting/PROJECT_CARE.md`
14
+ 8. `.gaslighting/AGENT_RUNTIME.md`
15
+ 9. `.gaslighting/PROJECT_CARE.md`
15
16
 
16
17
  ## Prime Directive
17
18
 
@@ -41,6 +42,7 @@ A task is complete only when:
41
42
  - New assumptions are documented.
42
43
  - New technical decisions are recorded.
43
44
  - Stable project facts are recorded in `.gaslighting/MEMORY.md`.
45
+ - Runtime execution rules are preserved in `.gaslighting/AGENT_RUNTIME.md`.
44
46
  - Operational risks are recorded in `.gaslighting/PROJECT_CARE.md`.
45
47
  - The result does not contradict `.gaslighting/GASLIGHTING.md`.
46
48