genesis-compiler 1.0.0 → 1.2.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 (73) hide show
  1. package/.agents/plugins/marketplace.json +20 -0
  2. package/README.md +443 -0
  3. package/bin/genesis.js +15 -0
  4. package/docs/assurance-model.md +26 -0
  5. package/docs/prompt-integration.md +98 -0
  6. package/docs/stack-components.md +304 -0
  7. package/package.json +57 -7
  8. package/plugins/genesis/.codex-plugin/plugin.json +19 -0
  9. package/plugins/genesis/hooks.json +18 -0
  10. package/prompts/blueprint.txt +9 -0
  11. package/prompts/describe.txt +17 -0
  12. package/prompts/deslop.txt +14 -0
  13. package/prompts/program.txt +12 -0
  14. package/prompts/reconcile.txt +12 -0
  15. package/prompts/review.txt +12 -0
  16. package/prompts/start.txt +30 -0
  17. package/prompts/work.txt +28 -0
  18. package/skills/genesis-deslop/SKILL.md +36 -0
  19. package/skills/genesis-deslop/agents/openai.yaml +4 -0
  20. package/skills/genesis-program/SKILL.md +66 -0
  21. package/skills/genesis-program/agents/openai.yaml +4 -0
  22. package/skills/genesis-project/SKILL.md +53 -0
  23. package/skills/genesis-project/agents/openai.yaml +4 -0
  24. package/src/cli.js +276 -0
  25. package/src/index/agent-skills.js +425 -0
  26. package/src/index/assets.js +19 -0
  27. package/src/index/blueprint.js +38 -0
  28. package/src/index/check.js +102 -0
  29. package/src/index/code-index.js +283 -0
  30. package/src/index/code-indexers/ast-grep.js +414 -0
  31. package/src/index/codex-hooks.js +367 -0
  32. package/src/index/codex-plugin.js +73 -0
  33. package/src/index/context.js +137 -0
  34. package/src/index/environment-files.js +19 -0
  35. package/src/index/errors.js +26 -0
  36. package/src/index/git.js +26 -0
  37. package/src/index/init.js +48 -0
  38. package/src/index/launch.js +34 -0
  39. package/src/index/paths.js +10 -0
  40. package/src/index/process.js +89 -0
  41. package/src/index/program.js +181 -0
  42. package/src/index/project-files.js +24 -0
  43. package/src/index/project-state.js +87 -0
  44. package/src/index/prompt.js +347 -0
  45. package/src/index/stack-catalog.js +72 -0
  46. package/src/index/stack-command.js +65 -0
  47. package/src/index/stack-composition.js +38 -0
  48. package/src/index/stack-environment-files.js +83 -0
  49. package/src/index/stack-launch.js +428 -0
  50. package/src/index/stack-piece.js +283 -0
  51. package/src/index/stack-preflight.js +25 -0
  52. package/src/index/stack-process.js +25 -0
  53. package/src/index/stack-workspace-setup.js +129 -0
  54. package/src/index/stack.js +302 -0
  55. package/src/index/utils.js +85 -0
  56. package/src/index/verification.js +77 -0
  57. package/src/index/workspace-setup.js +55 -0
  58. package/src/index.js +102 -0
  59. package/stacks/pieces/cpp.md +22 -0
  60. package/stacks/pieces/csharp.md +22 -0
  61. package/stacks/pieces/go.md +22 -0
  62. package/stacks/pieces/java.md +22 -0
  63. package/stacks/pieces/jskit-mysql.md +37 -0
  64. package/stacks/pieces/jskit.md +70 -0
  65. package/stacks/pieces/kotlin.md +22 -0
  66. package/stacks/pieces/mysql.md +18 -0
  67. package/stacks/pieces/nodejs.md +25 -0
  68. package/stacks/pieces/php.md +23 -0
  69. package/stacks/pieces/python.md +23 -0
  70. package/stacks/pieces/ruby.md +22 -0
  71. package/stacks/pieces/rust.md +22 -0
  72. package/stacks/pieces/shell.md +23 -0
  73. package/stacks/pieces/vue.md +19 -0
@@ -0,0 +1,20 @@
1
+ {
2
+ "name": "genesis",
3
+ "interface": {
4
+ "displayName": "Genesis"
5
+ },
6
+ "plugins": [
7
+ {
8
+ "name": "genesis",
9
+ "source": {
10
+ "source": "local",
11
+ "path": "./plugins/genesis"
12
+ },
13
+ "policy": {
14
+ "installation": "AVAILABLE",
15
+ "authentication": "ON_INSTALL"
16
+ },
17
+ "category": "Productivity"
18
+ }
19
+ ]
20
+ }
package/README.md ADDED
@@ -0,0 +1,443 @@
1
+ # Genesis
2
+
3
+ Genesis is an agent-independent prompt, code-index, and verification companion
4
+ for local codebases. It combines product intent, concise codebase explanation,
5
+ selected technology guidance, an existing-function inventory, and an optional
6
+ user request into a complete prompt for the coding agent you already use.
7
+
8
+ Genesis outputs text. The agent or host you already use owns execution and
9
+ interaction.
10
+
11
+ ## Project files
12
+
13
+ ```text
14
+ genesis/
15
+ blueprint.md non-technical product intent
16
+ stack.md selected technology guidance, checks, setup, and launch data
17
+ stack/ optional per-component Description, Guidance, and Deslop customization
18
+ program/ concise explanations grouped into conceptual subsystems
19
+ .agents/skills/
20
+ genesis-* Genesis workflow skills
21
+ <technology>/ authoritative skills installed by selected Stack pieces
22
+ .codex/hooks.json optional project-local Codex lifecycle integration
23
+ .genesis/
24
+ machine-city.json derived detailed source and function map
25
+ program-city.json derived simple subsystem and operation map
26
+ ```
27
+
28
+ Program paths describe public operations rather than languages or source
29
+ layout:
30
+
31
+ ```text
32
+ genesis/program/notes/list-notes.md
33
+ genesis/program/notes/create-note.md
34
+ ```
35
+
36
+ The directory is a conceptual subsystem. Each file describes one public
37
+ operation provided by that subsystem: an exported method, API action, route,
38
+ command, UI operation, or equivalent entry point. Each module cites one or more
39
+ real files under `## Sources`. There is no 1:1 source mapping: one operation may
40
+ span several files, helper files may be omitted, and one source may support
41
+ multiple operations.
42
+
43
+ An optional `## Implementation map` records only the internal helpers and seams
44
+ that materially help a future agent change or debug that operation. It is
45
+ informational, not part of the public contract, and `check` does not pretend to
46
+ prove it current. Program omits incidental framework glue, generated files,
47
+ tests, fixtures, and migrations. It is useful documentation, not proof that it
48
+ completely or correctly explains the implementation.
49
+
50
+ ## Start
51
+
52
+ Genesis requires Node.js 22 or newer and Git.
53
+
54
+ For an existing codebase, `adopt` is the direct entry point:
55
+
56
+ ```bash
57
+ cd my-existing-project
58
+ git init # if needed
59
+ genesis adopt "Optional product guidance"
60
+ ```
61
+
62
+ It preserves the implementation, initializes the Genesis files and local
63
+ hooks, and prints the `describe` prompt that creates the first useful Blueprint
64
+ and Program. Give that prompt to the agent already working in the repository.
65
+ For a large codebase, the prompt explicitly lets that agent decide whether to
66
+ delegate inspection to subagents and requires it to synthesize one coherent
67
+ result. “Adopt” is intentional: Genesis neither imports nor moves the project.
68
+
69
+ For a new or empty project, initialize first and write the product intent:
70
+
71
+ ```bash
72
+ cd my-project
73
+ git init # if needed
74
+ genesis init
75
+ vi genesis/blueprint.md
76
+ codex
77
+ ```
78
+
79
+ Codex users may also install Genesis's optional discovery plugin once:
80
+
81
+ ```bash
82
+ genesis codex install
83
+ ```
84
+
85
+ When Codex opens a nonempty Git project without `genesis/blueprint.md`, the
86
+ plugin's `SessionStart` hook runs before the first user prompt and adds a strong
87
+ instruction to recommend `genesis adopt`. Codex cannot display an ordinary
88
+ assistant reply until the user speaks, so the recommendation appears in its
89
+ first reply. It never runs adoption without approval and does nothing in an
90
+ empty or already-adopted project.
91
+
92
+ `genesis init` creates an empty Blueprint, an empty optional Stack, three
93
+ project Agent Skills, and project-local Codex hooks. The skills are ordinary
94
+ [Agent Skills](https://agentskills.io): `genesis-project`, `genesis-program`,
95
+ and `genesis-deslop`, each with standard `SKILL.md` and `agents/openai.yaml`
96
+ metadata. Open `/hooks` once in Codex to review and trust the hooks. After
97
+ that, use Codex normally. No technology is assumed until you explicitly select
98
+ Stack components:
99
+
100
+ ```bash
101
+ genesis stack add nodejs # or jskit jskit-mysql
102
+ ```
103
+
104
+ Genesis does not install substitute generic `nodejs`, `vue`, `php`, or similar
105
+ skills. Official, user, or host skills retain their normal names. A Stack piece
106
+ may instead name one authoritative technology skill; Genesis copies that
107
+ complete directory into `.agents/skills/`, including its `references/`,
108
+ `scripts/`, `assets/`, and agent metadata. The agent loads those resources only
109
+ when the skill requires them. For example, the JSKIT piece installs the JSKIT
110
+ package's own `jskit` skill. A piece's optional `## Guidance` is concise
111
+ supplemental project-work guidance; it does not create or replace a generic
112
+ technology skill.
113
+
114
+ `.agents/skills/.genesis-managed.json` records only copies Genesis owns.
115
+ Genesis never overwrites an unmanaged skill and preserves locally modified
116
+ managed skills. Run `genesis init` after manually editing `genesis/stack.md`,
117
+ or use `genesis stack add`, to synchronize selected skills.
118
+
119
+ Hosts that create dependency-empty workspaces can call the public
120
+ `inspectWorkspaceSetup()` API. A concrete Stack piece may declare one exact,
121
+ ordered `## Workspace setup` recipe with labels, argument arrays expressed as
122
+ backticked tokens, abstract runtimes, and optional project-relative working
123
+ directories and readiness paths. A recipe whose declared project marker does
124
+ not exist remains unconfigured until a later inspection. The built-in `jskit`
125
+ piece waits for `package.json` and then declares `npm install`; generic
126
+ `nodejs` and `php` deliberately declare no installer. One project section in
127
+ `genesis/stack.md` replaces all component defaults, including with
128
+ `- Nothing.`. Without that override, exactly one component recipe is used;
129
+ multiple component recipes are reported as ambiguous and never merged.
130
+ Genesis does not run the recipe. Stack resources such as database variables do
131
+ not gate dependency installation.
132
+
133
+ Hosts that manage project environments can call `inspectEnvironment()`.
134
+ An optional readable `## Environment files` section declares safe
135
+ project-relative dotenv projections such as `.env`. A project declaration
136
+ replaces component defaults, including with `- Nothing.`; otherwise component
137
+ paths compose. Genesis reports resource declarations, value-free missing-input
138
+ diagnostics, and paths. It never returns values, writes files, stores secrets,
139
+ or decides which resolved values a host should materialize.
140
+
141
+ Hosts that provide previews can call the public `inspectLaunch()` API. An
142
+ optional readable `## Launch` section in `genesis/stack.md` declares labeled
143
+ targets, exact backticked argument tokens, relative working directories,
144
+ abstract runtime requirements, `{host}`/`{port}` substitutions, and an optional
145
+ application-owned Preview identity block. Concrete components may provide a
146
+ default: `jskit` declares build followed by `npm start`; generic `nodejs` and
147
+ `php` do not guess. Genesis starts nothing itself. It returns preview identity
148
+ command metadata and environment variable names, never their values. The host
149
+ continues to own pinned runtimes, ports, processes, readiness, identity-command
150
+ execution and secrets, browser binaries, Git, and credentials. See
151
+ [`docs/stack-components.md`](docs/stack-components.md) for the v1 contract.
152
+
153
+ At session start, Codex receives only a short explanation of how Genesis is
154
+ organized. After it locates the source involved in a request, it can load the
155
+ specific explanatory and technology context with:
156
+
157
+ ```bash
158
+ genesis context src/path/to/file
159
+ ```
160
+
161
+ Before introducing another helper or public operation, query the current
162
+ function inventory:
163
+
164
+ ```bash
165
+ genesis index normalizeNote
166
+ genesis index src/notes
167
+ ```
168
+
169
+ `genesis index` regenerates two deterministic projections. Machine City is the
170
+ detailed physical view: indexed files, line and byte weights, public and
171
+ internal functions or methods, signatures, source/test role, language, and
172
+ extractor provenance. Program City is intentionally smaller: conceptual
173
+ subsystems, Program operations, informational helper maps, and links to their
174
+ implementing source files.
175
+ Both are derived JSON, not receipts, authority, or correctness claims. An
176
+ extractor warning does not stop ordinary work.
177
+
178
+ The selected Stack decides which structural extractors run. Genesis uses the
179
+ Tree-sitter-backed [ast-grep JavaScript API](https://ast-grep.github.io/guide/api-usage/js-api.html)
180
+ through one shared engine. Built-in adapters cover JavaScript/TypeScript,
181
+ Python, Java, C#, C/C++, PHP, Go, Rust, Ruby, Kotlin, and Shell. A future technology
182
+ adds its adapter through its Stack piece rather than teaching Genesis prompts
183
+ to parse that language.
184
+
185
+ At the end of a turn that changed Git-visible project files, the Stop hook asks
186
+ Codex for two separate, bounded follow-up turns. The first reconciles the
187
+ Blueprint and affected Program explanations from the changed paths and actual
188
+ Git diff, then Genesis deterministically refreshes both City projections. The
189
+ second performs the focused, behavior-preserving Deslop pass, after which both
190
+ Cities are refreshed again to reflect any cleanup. A project with no selected
191
+ Stack uses only the `genesis-deslop` skill. Selected Stack components enrich
192
+ reconciliation and cleanup with their general Guidance, and enrich cleanup
193
+ further with technology-specific Deslop guidance.
194
+
195
+ The hook never starts another Codex process. Its small per-session phase is
196
+ limited to `implementation -> reconcile -> deslop -> done`, so it cannot keep
197
+ continuing recursively. Question-only and unchanged turns finish normally.
198
+
199
+ Projects can customize a selected technology through its matching file, such
200
+ as `genesis/stack/jskit.md`:
201
+
202
+ ```markdown
203
+ # Stack customization: jskit
204
+
205
+ ## Add
206
+
207
+ ### Description
208
+
209
+ Additional project-specific context about how JSKIT is used here.
210
+
211
+ ### Guidance
212
+
213
+ - Additional project-specific implementation and review guidance.
214
+
215
+ ### Deslop
216
+
217
+ - Additional project-specific cleanup guidance.
218
+
219
+ ## Override
220
+
221
+ ### Description
222
+
223
+ A replacement for the installed JSKIT description.
224
+
225
+ ### Guidance
226
+
227
+ - Replacement installed implementation and review guidance.
228
+
229
+ ### Deslop
230
+
231
+ - Replacement installed cleanup guidance.
232
+ ```
233
+
234
+ Every field is optional. For each field, Genesis uses the installed value,
235
+ replaces it when `Override` supplies that field, then appends the corresponding
236
+ `Add` content. Customization affects only `Description`, `Guidance`, and
237
+ `Deslop`; component dependencies, Agent Skill source, resources, and
238
+ verification commands retain their installed contracts. `genesis stack add`
239
+ preserves these matching customization files.
240
+
241
+ Prompt generation remains available for other agents and explicit tasks:
242
+
243
+ ```bash
244
+ genesis prompt
245
+ ```
246
+
247
+ Give the printed prompt to Vibe64 or another coding agent with access to the
248
+ project. Review ordinary edits through Git.
249
+
250
+ An immediate improvement request can be included directly:
251
+
252
+ ```bash
253
+ genesis prompt "Add filtering by note title"
254
+ ```
255
+
256
+ ## Prompt tasks
257
+
258
+ ```bash
259
+ genesis prompt # implementation work
260
+ genesis prompt --task start # open a new or existing project conversation
261
+ genesis prompt "Add filtering by note title"
262
+ genesis prompt --task deslop # explicit cleanup
263
+ genesis prompt --task deslop "Only review billing"
264
+ genesis prompt --task program # refresh explanation
265
+ genesis prompt --task blueprint "Start on notes" # update product intent
266
+ genesis prompt --task describe # create/refresh Blueprint and complete Program
267
+ genesis prompt --task review # compare intent, code, and explanation
268
+ ```
269
+
270
+ The seven task types are deliberately explicit:
271
+
272
+ - `start` opens the project conversation. For a new project it asks what the
273
+ app is about, presents relevant choices from the live Stack catalog, and
274
+ waits for the person to select technology. For an existing project it asks
275
+ what the person wants to understand or change.
276
+ - `work` implements the Blueprint and optional request using current code,
277
+ Program, selected Stack context, and progressively loaded Agent Skills.
278
+ - `deslop` requests cleanup explicitly. Codex projects also receive a bounded
279
+ automatic Deslop turn after their separate explanatory reconciliation turn.
280
+ - `program` edits only `genesis/program/` to explain the code that exists, with
281
+ selected Stack guidance available for technology-specific correctness.
282
+ - `blueprint` edits only `genesis/blueprint.md` from explicit user intent. It
283
+ must not infer product requirements from accidental implementation behavior.
284
+ - `describe` creates or refreshes both the non-technical Blueprint and the
285
+ complete useful Program from the current codebase, optional user guidance,
286
+ and selected Stack guidance where it affects accurate explanation.
287
+ - `review` is read-only. It asks the agent to compare Blueprint, code, Program,
288
+ and tests, identify contradictions and gaps, and distinguish evidence from
289
+ inference.
290
+
291
+ Prompt generation is read-only. Missing external resources are reported in
292
+ the prompt but do not prevent its generation. Genesis never invents values.
293
+
294
+ Use `--json` to receive the prompt and its machine-readable context as one
295
+ object.
296
+
297
+ ## Stack
298
+
299
+ List and select the built-in Stack components:
300
+
301
+ ```bash
302
+ genesis stack list
303
+ genesis stack add jskit jskit-mysql
304
+ ```
305
+
306
+ `genesis/stack.md` records component ids and optional project verification
307
+ commands. Selecting no components is valid. Built-in components include the
308
+ eleven common language families listed above, plus Vue, MySQL, JSKIT, and JSKIT
309
+ with MySQL. Components may contribute:
310
+
311
+ - a concise description and supplemental Guidance used across relevant tasks;
312
+ - one authoritative Agent Skill directory when the component owns one;
313
+ - generic external-resource requirements;
314
+ - cleanup advice used by explicit and automatic Deslop prompts;
315
+ - structural code indexers used by Machine City and function lookup;
316
+ - default verification commands.
317
+
318
+ Technology-specific supplemental rules intentionally remain in Stack pieces.
319
+ General `Guidance` enriches implementation, review, Program, description, and
320
+ cleanup tasks; `Deslop` adds cleanup-only rules. Neither shadows an official
321
+ generic technology skill nor assumes that an upstream skill contains every rule
322
+ Genesis needs.
323
+
324
+ Genesis core contains no MySQL, JSKIT, Vue, Laravel, or other platform-specific
325
+ controller behavior. See [Stack components](docs/stack-components.md).
326
+
327
+ ## Verification
328
+
329
+ Run the Stack's declared checks explicitly:
330
+
331
+ ```bash
332
+ genesis verify
333
+ ```
334
+
335
+ Genesis first evaluates generic Stack resource declarations, then runs each
336
+ declared command without a shell. A complete successful run writes only
337
+ `.genesis/verification.json`, recording:
338
+
339
+ - the exact Git-visible code hash;
340
+ - the selected Stack hash;
341
+ - the commands that passed.
342
+
343
+ The evidence becomes stale when code, selected components, declared resources,
344
+ or verification commands change. Description, Guidance, Agent Skill, and Deslop
345
+ prose do not rewrite what an already-run command proved. A failed verification
346
+ removes prior passing evidence before running. Verification does not claim
347
+ whole-product correctness.
348
+
349
+ A project can replace component defaults in `genesis/stack.md`:
350
+
351
+ ```markdown
352
+ ## Commands
353
+
354
+ - Verify `tests`: `npm` `test`
355
+ - Verify `build`: `npm` `run` `build`
356
+ ```
357
+
358
+ ## Inspection
359
+
360
+ ```bash
361
+ genesis check
362
+ ```
363
+
364
+ `check` is read-only. It reports only structural or recorded facts:
365
+
366
+ - Blueprint and Stack validity;
367
+ - selected Agent Skill presence and structural validity;
368
+ - Program presence and structural validity;
369
+ - missing Stack-declared environment inputs (without claiming the service is
370
+ reachable);
371
+ - verification evidence as `current`, `stale`, `missing`, `invalid`, or
372
+ `unconfigured`.
373
+
374
+ Here, “valid” means parseable and internally consistent: referenced source
375
+ files exist, declared environment inputs are non-placeholder, and recorded
376
+ hashes match. It does not mean that the product behavior makes sense. Generate
377
+ `genesis prompt --task review` for that semantic, evidence-based comparison.
378
+
379
+ Genesis does not label Program semantically current. Program is ordinary
380
+ Markdown reviewed through Git.
381
+
382
+ ## Public API
383
+
384
+ ```js
385
+ import {
386
+ adoptProject,
387
+ addStack,
388
+ check,
389
+ generatePrompt,
390
+ getContext,
391
+ indexCodebase,
392
+ initialize,
393
+ inspectEnvironment,
394
+ inspectLaunch,
395
+ inspectWorkspaceSetup,
396
+ installCodex,
397
+ listStackPieces,
398
+ verify,
399
+ } from 'genesis-compiler';
400
+ ```
401
+
402
+ `initialize()` installs the project files, Genesis workflow skills, selected
403
+ Stack skills, and local Codex hooks.
404
+ `adoptProject()` also returns the initial `describe` prompt for an existing
405
+ codebase. `installCodex()` installs the optional global discovery plugin.
406
+ `getContext()` resolves source paths to the Program modules that cite them,
407
+ the functions already declared there, selected Stack guidance, available Agent
408
+ Skills, and verification commands. `indexCodebase()` regenerates or returns the
409
+ detailed Machine City and simple Program City projections.
410
+ `inspectWorkspaceSetup()` returns one normalized, shell-free workspace
411
+ preparation recipe—or an explicit unconfigured or ambiguous result—for a host
412
+ to execute with its own pinned runtimes, caches, process isolation, and
413
+ credentials. A configured recipe may remain unconfigured while it waits for a
414
+ technology-declared project marker.
415
+ `inspectEnvironment()` returns normalized Stack resource declarations,
416
+ value-free missing-input diagnostics, and dotenv projection paths without
417
+ returning any environment value.
418
+ `inspectLaunch()` returns a validated, normalized Stack launch declaration for
419
+ a host to execute with its own runtime, port, process, readiness, preview
420
+ identity, secret, and browser policy.
421
+
422
+ A host such as Vibe64 can send the generated prompt to its existing agent:
423
+
424
+ ```js
425
+ const work = await generatePrompt({
426
+ projectRoot,
427
+ task: 'work',
428
+ request: userMessage,
429
+ });
430
+
431
+ await currentAgent.send(work.prompt);
432
+ ```
433
+
434
+ The host retains model choice, conversation context, reasoning presentation,
435
+ steering, interruption, permissions, and lifecycle ownership.
436
+
437
+ ## Promise
438
+
439
+ Genesis generates transparent context-rich prompts, performs deterministic
440
+ project operations, and records exact verification evidence. Code, tests, Git
441
+ review, and the user's chosen agent remain responsible for implementation. It
442
+ does not claim universal semantic convergence, exhaustive coverage, or
443
+ whole-product correctness.
package/bin/genesis.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ import process from "node:process";
4
+
5
+ import { runCli } from "../src/cli.js";
6
+
7
+ let stdoutClosed = false;
8
+ process.stdout.on("error", (error) => {
9
+ if (error?.code !== "EPIPE") throw error;
10
+ stdoutClosed = true;
11
+ process.exitCode = 0;
12
+ });
13
+
14
+ const status = await runCli(process.argv.slice(2));
15
+ process.exitCode = stdoutClosed ? 0 : status;
@@ -0,0 +1,26 @@
1
+ # Assurance model
2
+
3
+ Genesis reports only facts it can establish mechanically:
4
+
5
+ 1. Blueprint, Stack, and Program files satisfy their small structural formats.
6
+ 2. Program operations live in conceptual subsystem directories and cite real
7
+ source files. Optional helper maps are not mechanically certified.
8
+ 3. Stack-declared environment inputs are present and non-placeholder. This does
9
+ not prove that an external service is reachable; a verification command must
10
+ establish that when it matters.
11
+ 4. Named verification commands exited successfully against one exact code and
12
+ Stack identity.
13
+ 5. Selected project Agent Skills have valid standard metadata and exist at the
14
+ expected paths. Genesis preserves unmanaged and locally customized skills
15
+ rather than claiming ownership of them.
16
+ 6. Machine City records what selected structural parsers observed, and Program
17
+ City projects the Program modules and source citations that exist. Neither
18
+ proves semantic equivalence, complete dynamic dispatch, or true duplication.
19
+
20
+ Prompt text, Stack Description/Guidance/Deslop prose, Program prose, Agent Skill
21
+ content, and agent output are not assurance evidence. Genesis does not claim
22
+ that product intent and code have converged, that Program is complete or
23
+ semantically current, or that passing checks prove the whole product correct.
24
+
25
+ Git remains the review and recovery boundary. The host running the generated
26
+ prompt owns the agent and its interaction.
@@ -0,0 +1,98 @@
1
+ # Prompt integration
2
+
3
+ Genesis does not start or manage an AI agent. A host asks Genesis for a prompt
4
+ and sends that prompt to the conversation it already owns:
5
+
6
+ ```js
7
+ import { generatePrompt } from 'genesis-compiler';
8
+
9
+ const work = await generatePrompt({
10
+ projectRoot,
11
+ task: 'work',
12
+ request: userMessage,
13
+ });
14
+
15
+ await currentAgent.send(work.prompt);
16
+ ```
17
+
18
+ Tasks are `start`, `work`, `deslop`, `program`, `blueprint`, `describe`, and `review`.
19
+ `start` is the host-independent first conversation: it classifies an initialized
20
+ project from current Genesis facts, asks what a new app is about, exposes the
21
+ live Stack catalog for an explicit user choice, or asks what the person wants
22
+ to do with an existing project. For an existing uninitialized codebase it owns
23
+ the adoption recommendation as part of the same portable prompt. A host such as Vibe64 sends this prompt on the
24
+ first chat turn; it does not recreate the questions or Stack catalog.
25
+ `describe` creates or refreshes the complete Blueprint and useful Program in one
26
+ agent task. The host owns the agent and its interaction. Genesis owns only
27
+ transparent prompt construction and deterministic project operations.
28
+
29
+ ## Instruction sources
30
+
31
+ Genesis keeps each instruction at one useful level:
32
+
33
+ - `skills/genesis-project/`, `skills/genesis-program/`, and
34
+ `skills/genesis-deslop/` are the reusable workflow sources copied into each
35
+ project's `.agents/skills/` directory.
36
+ - `prompts/<task>.txt` is a short task launcher. It selects the relevant
37
+ workflow skill and states only that turn's edit boundary.
38
+ - `stacks/pieces/<component>.md` supplies concise Description, supplemental
39
+ Guidance, Resources, Deslop overlays, structural Indexers, verification
40
+ Commands, and an optional authoritative Agent Skill source.
41
+ - `genesis/blueprint.md`, `genesis/program/`, and `genesis/stack.md` are the
42
+ project's own intent, explanation, and selected technical composition.
43
+ - The generated JSON block contains current structural facts and warnings.
44
+
45
+ Detailed technology manuals belong in the technology skill's `references/`
46
+ directory. Concise rules Genesis needs beyond that skill belong in Stack
47
+ `Guidance`; they are composed into relevant prompts without creating a
48
+ colliding generic skill.
49
+
50
+ ## Existing projects
51
+
52
+ `genesis adopt [product guidance...]` is the explicit starting point for a
53
+ nonempty project. It preserves source, calls the same idempotent initialization
54
+ used by `genesis init`, and prints a `describe` prompt for the current agent to
55
+ follow. The description prompt may direct a large-project agent to use
56
+ subagents at its discretion, but the primary agent must reconcile their work
57
+ into one Blueprint and one subsystem-oriented Program.
58
+
59
+ Codex users can run `genesis codex install` once to install the packaged
60
+ Genesis discovery plugin. Its `SessionStart` hook executes before the first
61
+ user prompt. In a nonempty Git repository without `genesis/blueprint.md`, it
62
+ injects an instruction that the first assistant reply strongly recommend
63
+ `genesis adopt`. It does not perform adoption automatically. If the user
64
+ accepts, Codex can run the command and follow its returned prompt in the same
65
+ conversation. Other hosts can call `adoptProject()` and send its `prompt`
66
+ directly.
67
+
68
+ Codex can instead use the project-local hooks installed by `genesis init`.
69
+ Those hooks inject a short operating guide, record whether the current turn
70
+ changed project files, then request two bounded continuations: first reconcile
71
+ Blueprint and affected Program explanations from the Git-visible changes, then
72
+ Deslop the implementation. They invoke the same Genesis project operations and
73
+ never start another agent process. A per-session phase permits only
74
+ `implementation -> reconcile -> deslop -> done`. Genesis refreshes both City
75
+ projections after reconciliation so Deslop sees the current explanation and
76
+ function inventory, then refreshes them again after Deslop in case cleanup
77
+ changed the implementation map.
78
+
79
+ Once Codex identifies relevant source, `genesis context <path...>` returns only
80
+ Program modules citing those paths plus concise selected Stack context, the
81
+ functions structurally indexed in those paths, available Agent Skill catalog,
82
+ and verification commands. `genesis index <name-or-path>` searches the complete
83
+ current function inventory and refreshes `.genesis/machine-city.json` and
84
+ `.genesis/program-city.json`. No model call or semantic subsystem guess is
85
+ involved.
86
+
87
+ `genesis init` installs the three Genesis workflow skills under
88
+ `.agents/skills/`. `genesis stack add` also installs any complete authoritative
89
+ Agent Skill directory declared by selected components. Generated prompts name
90
+ matching `SKILL.md` entrypoints rather than eagerly embedding their references.
91
+ This follows Agent Skills progressive disclosure and keeps official or
92
+ user-installed generic technology skills independent.
93
+
94
+ Matching files under `genesis/stack/<component>.md` may add to or override that
95
+ selected component's Description, Guidance, and Deslop fields. Effective
96
+ Guidance is used by work, review, Program, describe, Deslop, and path-context
97
+ generation. The Codex continuation flow also carries it into reconciliation and
98
+ cleanup; effective Deslop guidance remains cleanup-only.