genesis-compiler 1.2.20 → 1.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/plugins/genesis/.codex-plugin/plugin.json +1 -1
- package/prompts/adopt.txt +15 -13
- package/prompts/deslop.txt +4 -3
- package/prompts/start.txt +15 -12
- package/prompts/work.txt +8 -6
- package/skills/genesis-deslop/SKILL.md +13 -5
- package/skills/genesis-project/SKILL.md +22 -11
- package/src/index/codex-hooks.js +8 -7
- package/src/index/context.js +1 -1
- package/src/index/prompt.js +1 -1
package/package.json
CHANGED
package/prompts/adopt.txt
CHANGED
|
@@ -9,17 +9,18 @@ Genesis again or require them to understand Genesis terminology.
|
|
|
9
9
|
Application source, dependencies, migrations, runtime behavior, and deployment
|
|
10
10
|
files are read-only in this turn. You may edit `genesis/blueprint.md`,
|
|
11
11
|
`genesis/stack.md`, explanatory Markdown below `genesis/program/`, and
|
|
12
|
-
Genesis-managed skills/indexes produced by `
|
|
13
|
-
inspection commands. Do not install dependencies, prepare a database,
|
|
14
|
-
migrations or seeds, start a server, deploy, or add compatibility code.
|
|
12
|
+
Genesis-managed skills/indexes produced by the Genesis `stack add` operation or
|
|
13
|
+
Genesis inspection commands. Do not install dependencies, prepare a database,
|
|
14
|
+
run migrations or seeds, start a server, deploy, or add compatibility code.
|
|
15
15
|
|
|
16
16
|
If Stack has no components, inspect direct evidence such as manifests,
|
|
17
17
|
lockfiles, build files, entrypoints, package scripts, tests, configuration,
|
|
18
18
|
database and migration code, and existing project-tool metadata. Record only
|
|
19
|
-
technologies the implementation already uses with `
|
|
20
|
-
<piece
|
|
21
|
-
product-language question only when evidence is genuinely ambiguous.
|
|
22
|
-
|
|
19
|
+
technologies the implementation already uses with the Genesis `stack add
|
|
20
|
+
<piece...>` operation; this is factual import, not a new-technology choice. Ask
|
|
21
|
+
a concise product-language question only when evidence is genuinely ambiguous.
|
|
22
|
+
Then run the Genesis
|
|
23
|
+
`prompt --task adopt "Continue the approved existing-project import."` operation
|
|
23
24
|
and follow the regenerated prompt so every selected Stack piece contributes its
|
|
24
25
|
Adoption requirements.
|
|
25
26
|
|
|
@@ -51,9 +52,10 @@ Create the non-technical Blueprint and useful subsystem-oriented Program from
|
|
|
51
52
|
current source and tests. Do not cite archive internals or Git object storage as
|
|
52
53
|
implementation source; Program sources must be current Git-visible files.
|
|
53
54
|
|
|
54
|
-
Run `
|
|
55
|
-
Verification commands, or evidence required by a
|
|
56
|
-
honest import findings, not permission to invent or
|
|
57
|
-
clear inventory of what was imported, what remains
|
|
58
|
-
what would require a separately approved
|
|
59
|
-
project is ready merely because Stack
|
|
55
|
+
Run the Genesis `check` operation only for structural validation. Missing
|
|
56
|
+
environment inputs, Verification commands, or evidence required by a
|
|
57
|
+
consumer-owned contract are honest import findings, not permission to invent or
|
|
58
|
+
execute them. Finish with a clear inventory of what was imported, what remains
|
|
59
|
+
unconfigured or blocked, and what would require a separately approved
|
|
60
|
+
implementation port. Never claim the project is ready merely because Stack
|
|
61
|
+
components were selected.
|
package/prompts/deslop.txt
CHANGED
|
@@ -8,9 +8,10 @@ and immediately related code. Apply every selected Stack cleanup instruction
|
|
|
8
8
|
supplied below and load applicable official technology skills for additional
|
|
9
9
|
language and framework context.
|
|
10
10
|
|
|
11
|
-
Use `.genesis/machine-city.json` and `
|
|
12
|
-
existing public and internal functions. Remove or consolidate genuine
|
|
13
|
-
helpers, but confirm behavior and call sites in source before changing
|
|
11
|
+
Use `.genesis/machine-city.json` and the Genesis `index <name-or-path>` operation
|
|
12
|
+
to find existing public and internal functions. Remove or consolidate genuine
|
|
13
|
+
repeated helpers, but confirm behavior and call sites in source before changing
|
|
14
|
+
them.
|
|
14
15
|
|
|
15
16
|
The changed paths and nearby code are a location boundary, not permission to
|
|
16
17
|
implement other behavior found there. Deslop may reorganize behavior already
|
package/prompts/start.txt
CHANGED
|
@@ -7,9 +7,10 @@ step are clear.
|
|
|
7
7
|
When `projectKind` is `new`, first ask what the app is about. Ask up to three
|
|
8
8
|
concise, high-impact questions at a time. Use `availableStackPieces` to present
|
|
9
9
|
only the relevant choices, explain them in product language, and let the user
|
|
10
|
-
decide. Never silently select a technology. After an explicit choice, use
|
|
11
|
-
`
|
|
12
|
-
the non-technical Blueprint from the user's answers before
|
|
10
|
+
decide. Never silently select a technology. After an explicit choice, use the
|
|
11
|
+
Genesis `stack add <piece...>` operation; do not edit `genesis/stack.md` by
|
|
12
|
+
hand. Establish the non-technical Blueprint from the user's answers before
|
|
13
|
+
implementation.
|
|
13
14
|
If the product direction becomes clear while Stack is still empty, do not end
|
|
14
15
|
the turn after only writing or summarizing the Blueprint: present the relevant
|
|
15
16
|
Stack choices in that same turn and ask the user to select one explicitly.
|
|
@@ -18,13 +19,15 @@ work, so do not force a separate profile question. When the user asks for a
|
|
|
18
19
|
different engineering approach, or the product clearly has long-lived
|
|
19
20
|
compatibility, operational, security, reliability, or compliance constraints,
|
|
20
21
|
use `availableEngineeringProfiles` to explain only the relevant choices in
|
|
21
|
-
product language. After an explicit choice, run `
|
|
22
|
-
<profile
|
|
23
|
-
explicit obligations in `genesis/engineering.md` under Project
|
|
22
|
+
product language. After an explicit choice, run the Genesis `engineering set
|
|
23
|
+
<profile>` operation; do not invent or duplicate a built-in profile. Record
|
|
24
|
+
additional explicit obligations in `genesis/engineering.md` under Project
|
|
25
|
+
requirements.
|
|
24
26
|
This opening turn owns product direction and Stack selection, not final
|
|
25
|
-
verification. Do not run `
|
|
26
|
-
structural validation is useful, run `
|
|
27
|
-
remain governed by their own tools and must not be
|
|
27
|
+
verification. Do not run the Genesis `verify` operation before implementation
|
|
28
|
+
exists. If structural validation is useful, run the Genesis `check` operation;
|
|
29
|
+
consumer-owned operations remain governed by their own tools and must not be
|
|
30
|
+
inferred here.
|
|
28
31
|
|
|
29
32
|
When `projectKind` is `existing`, ask what the user wants to understand or
|
|
30
33
|
change. Use the current Blueprint, Stack, Program, and code index when present.
|
|
@@ -45,9 +48,9 @@ understand or change and strongly recommend preparing the existing project for
|
|
|
45
48
|
guided editing before substantial work. Explain in product language that this
|
|
46
49
|
preserves the implementation while importing its current setup, run, database,
|
|
47
50
|
preview, verification, and product context. Do not require the user to know
|
|
48
|
-
Genesis terminology or type a command. If they approve, run `
|
|
49
|
-
yourself and follow its adoption prompt. If they decline, continue
|
|
50
|
-
do not repeat the recommendation.
|
|
51
|
+
Genesis terminology or type a command. If they approve, run the Genesis `adopt`
|
|
52
|
+
operation yourself and follow its adoption prompt. If they decline, continue
|
|
53
|
+
normally and do not repeat the recommendation.
|
|
51
54
|
|
|
52
55
|
If the request already contains an unambiguous product description and an
|
|
53
56
|
explicit Stack choice, you may apply that choice and establish the Blueprint.
|
package/prompts/work.txt
CHANGED
|
@@ -4,8 +4,9 @@ implement the request in the ordinary local Git tree.
|
|
|
4
4
|
Load the applicable official or project technology skills listed below. Use
|
|
5
5
|
their normal generators, commands, packages, and established seams. Do not
|
|
6
6
|
search package internals or unrelated manuals merely to reconfirm an exact lane.
|
|
7
|
-
Before adding a helper or public operation, query
|
|
8
|
-
and reuse an existing function when it already
|
|
7
|
+
Before adding a helper or public operation, query the Genesis
|
|
8
|
+
`index <name-or-path>` operation and reuse an existing function when it already
|
|
9
|
+
owns the behavior.
|
|
9
10
|
|
|
10
11
|
This is the implementation turn. Do not edit the Blueprint, Program, or
|
|
11
12
|
`.genesis/`; the separate reconciliation turn owns explanatory changes. Keep
|
|
@@ -20,8 +21,9 @@ Run focused checks when useful. Summarize files changed, checks actually run,
|
|
|
20
21
|
and anything still requiring attention.
|
|
21
22
|
|
|
22
23
|
If no Stack components are selected, continue the project-opening
|
|
23
|
-
conversation instead of guessing a technology. Use `
|
|
24
|
-
the current catalog, present relevant choices, wait for an
|
|
25
|
-
and add the selection with
|
|
26
|
-
|
|
24
|
+
conversation instead of guessing a technology. Use the Genesis `stack list`
|
|
25
|
+
operation for the current catalog, present relevant choices, wait for an
|
|
26
|
+
explicit decision, and add the selection with the Genesis
|
|
27
|
+
`stack add <piece...>` operation before relying on technology-specific
|
|
28
|
+
operations. Do not end after only updating
|
|
27
29
|
or summarizing the Blueprint while the Stack remains empty.
|
|
@@ -9,14 +9,22 @@ Review and simplify the current local codebase without changing product
|
|
|
9
9
|
behavior. Start with the requested scope, or otherwise the ordinary Git diff
|
|
10
10
|
and the code immediately around it.
|
|
11
11
|
|
|
12
|
+
When this repository is Genesis itself or has `genesis-compiler` installed
|
|
13
|
+
locally, invoke every Genesis CLI operation through the project-pinned package:
|
|
14
|
+
`npm exec --no -- genesis <arguments>`. This runs without fetching another
|
|
15
|
+
package. Otherwise use `genesis <arguments>` only when that executable is
|
|
16
|
+
already available on `PATH`. Never install or update Genesis merely to satisfy
|
|
17
|
+
a workflow instruction.
|
|
18
|
+
|
|
12
19
|
Apply the engineering approach supplied with the task. If this skill is invoked
|
|
13
20
|
directly, read `genesis/engineering.md` as well as the relevant project context.
|
|
14
21
|
Cleanup must reduce or preserve complexity, never introduce unapproved
|
|
15
22
|
machinery that the selected profile or a concrete requirement does not need.
|
|
16
23
|
|
|
17
|
-
Consult `.genesis/machine-city.json` or run `
|
|
18
|
-
find existing public and internal functions before introducing or
|
|
19
|
-
an abstraction. Confirm every apparent duplicate in source and
|
|
24
|
+
Consult `.genesis/machine-city.json` or run the Genesis `index <name-or-path>`
|
|
25
|
+
operation to find existing public and internal functions before introducing or
|
|
26
|
+
consolidating an abstraction. Confirm every apparent duplicate in source and
|
|
27
|
+
its call sites.
|
|
20
28
|
|
|
21
29
|
Within the preceding implementation's intended behavior and scope, leave no
|
|
22
30
|
repeated helpers, no code that is unclear or hard to reason about, and no code
|
|
@@ -45,5 +53,5 @@ external resources. Do not weaken tests, public behavior, or data guarantees.
|
|
|
45
53
|
Do not create a second architecture or perform unrelated rewrites.
|
|
46
54
|
|
|
47
55
|
Run focused checks when useful. Final declared checks remain available through
|
|
48
|
-
`
|
|
49
|
-
actually run.
|
|
56
|
+
the Genesis `verify` operation. Summarize what became simpler, files changed,
|
|
57
|
+
and checks actually run.
|
|
@@ -8,6 +8,15 @@ description: Work safely in a Genesis-enriched codebase using its Blueprint, Sta
|
|
|
8
8
|
Genesis is an explanatory and verification companion. It does not replace the
|
|
9
9
|
codebase, tests, Git review, or the coding agent.
|
|
10
10
|
|
|
11
|
+
## Run Genesis commands
|
|
12
|
+
|
|
13
|
+
When this repository is Genesis itself or has `genesis-compiler` installed
|
|
14
|
+
locally, invoke every Genesis CLI operation through the project-pinned package:
|
|
15
|
+
`npm exec --no -- genesis <arguments>`. This runs without fetching another
|
|
16
|
+
package. Otherwise use `genesis <arguments>` only when that executable is
|
|
17
|
+
already available on `PATH`. Never install or update Genesis merely to satisfy
|
|
18
|
+
a workflow instruction.
|
|
19
|
+
|
|
11
20
|
## Establish context
|
|
12
21
|
|
|
13
22
|
1. Read `genesis/blueprint.md` for non-technical product intent.
|
|
@@ -16,10 +25,11 @@ codebase, tests, Git review, or the coding agent.
|
|
|
16
25
|
3. Read `genesis/stack.md` for the selected technical composition, resources,
|
|
17
26
|
and verification commands.
|
|
18
27
|
4. Locate the source involved in the request.
|
|
19
|
-
5. Run `
|
|
20
|
-
Reuse an existing function when it already owns the
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
5. Run the Genesis `index <name-or-path>` operation before adding a helper or
|
|
29
|
+
public operation. Reuse an existing function when it already owns the
|
|
30
|
+
behavior.
|
|
31
|
+
6. Run the Genesis `context <path...>` operation for the relevant Program
|
|
32
|
+
explanations and selected Stack context.
|
|
23
33
|
7. Load applicable technology skills from `.agents/skills/` or from the
|
|
24
34
|
agent's own installed skill catalog.
|
|
25
35
|
|
|
@@ -38,7 +48,8 @@ tests, and runtime behavior.
|
|
|
38
48
|
|
|
39
49
|
`.genesis/machine-city.json` is a derived detailed file/function map.
|
|
40
50
|
`.genesis/program-city.json` is a derived simpler subsystem/operation map.
|
|
41
|
-
Neither is authority or proof; both may be regenerated with
|
|
51
|
+
Neither is authority or proof; both may be regenerated with the Genesis
|
|
52
|
+
`index` operation.
|
|
42
53
|
|
|
43
54
|
## Implement ordinary local work
|
|
44
55
|
|
|
@@ -70,9 +81,9 @@ Neither is authority or proof; both may be regenerated with `genesis index`.
|
|
|
70
81
|
|
|
71
82
|
## Verify and report
|
|
72
83
|
|
|
73
|
-
After the selected technology's workspace substrate exists, use
|
|
74
|
-
verify` for the Stack's declared final checks. An unconfigured result
|
|
75
|
-
declared workspace or checks do not exist yet; it is not a failing
|
|
76
|
-
files changed, checks actually run, and anything still requiring
|
|
77
|
-
Never claim that an unrun check passed or that passing checks prove
|
|
78
|
-
product.
|
|
84
|
+
After the selected technology's workspace substrate exists, use the Genesis
|
|
85
|
+
`verify` operation for the Stack's declared final checks. An unconfigured result
|
|
86
|
+
means the declared workspace or checks do not exist yet; it is not a failing
|
|
87
|
+
check. Report files changed, checks actually run, and anything still requiring
|
|
88
|
+
attention. Never claim that an unrun check passed or that passing checks prove
|
|
89
|
+
the whole product.
|
package/src/index/codex-hooks.js
CHANGED
|
@@ -128,7 +128,7 @@ async function optionalEngineering(projectRoot) {
|
|
|
128
128
|
'',
|
|
129
129
|
await readEngineeringBaseline(),
|
|
130
130
|
'',
|
|
131
|
-
'The project engineering profile is invalid. Do not infer a replacement; run `
|
|
131
|
+
'The project engineering profile is invalid. Do not infer a replacement; run the Genesis `check` operation and ask the user before implementation if the selected approach matters.',
|
|
132
132
|
].join('\n'),
|
|
133
133
|
profile: null,
|
|
134
134
|
status: 'invalid',
|
|
@@ -145,7 +145,7 @@ export async function codexSessionContext({ projectRoot } = {}) {
|
|
|
145
145
|
const selected = stack?.components.map(({ id }) => id) || [];
|
|
146
146
|
const stackStatus = stack
|
|
147
147
|
? (selected.length > 0 ? selected.join(', ') : 'none')
|
|
148
|
-
: 'unavailable; run `
|
|
148
|
+
: 'unavailable; run the Genesis `check` operation';
|
|
149
149
|
return {
|
|
150
150
|
status: 'ready',
|
|
151
151
|
output: [
|
|
@@ -155,15 +155,16 @@ export async function codexSessionContext({ projectRoot } = {}) {
|
|
|
155
155
|
'- `genesis/stack.md` selects optional technology guidance and verification.',
|
|
156
156
|
'- `genesis/program/<subsystem>/` explains public operations and useful internal seams.',
|
|
157
157
|
'- Project Agent Skills live in `.agents/skills/`; load applicable skills progressively.',
|
|
158
|
-
'-
|
|
159
|
-
'-
|
|
158
|
+
'- When this repository is Genesis itself or has local `genesis-compiler`, run every Genesis CLI operation as `npm exec --no -- genesis <arguments>` so the project-pinned version is used without fetching another package. Otherwise use `genesis <arguments>` only when that executable is already available on `PATH`. Never install or update Genesis merely to run a workflow instruction.',
|
|
159
|
+
'- After locating relevant source files, run the Genesis `context <path...>` operation to load their Program and selected Stack material.',
|
|
160
|
+
'- Before creating a helper or public operation, run the Genesis `index <name-or-path>` operation and reuse an existing function when it already owns the behavior.',
|
|
160
161
|
'- `.genesis/machine-city.json` is the detailed code/function map; `.genesis/program-city.json` is the simpler subsystem/operation map.',
|
|
161
162
|
'- Program is fallible explanation; code, tests, and runtime behavior remain evidence.',
|
|
162
|
-
'- Before the first project-file edit in a user-requested implementation turn, silently run `
|
|
163
|
+
'- Before the first project-file edit in a user-requested implementation turn, silently run the Genesis `hook authorize` operation once in every Git repository you will edit. This is internal Genesis bookkeeping, not a request for user permission: do not ask the user, announce successful authorization, or include it in progress or final summaries. Mention it only if the command fails.',
|
|
163
164
|
'- Authorization is turn-scoped. Run it again for a later code-changing turn after a user follow-up or interruption, but not again within the same active turn after it succeeds. The command must report `authorize: authorized` or `authorize: unchanged`; otherwise stop before editing. Never authorize answer, explanation, review, diagnosis-only, reconciliation, or Deslop turns.',
|
|
164
165
|
'- Apply the engineering approach below to implementation and cleanup; the Stop hook owns optional Stack Post-change work, Blueprint/Program reconciliation, and Deslop turns.',
|
|
165
166
|
'- After an authorized code-changing turn, Genesis may request separate post-change, explanation, and cleanup turns.',
|
|
166
|
-
`Engineering profile: ${engineering.profile?.id || 'invalid; run \`
|
|
167
|
+
`Engineering profile: ${engineering.profile?.id || 'invalid; run the Genesis \`check\` operation'}.`,
|
|
167
168
|
`Selected Stack components: ${stackStatus}.`,
|
|
168
169
|
'',
|
|
169
170
|
'ENGINEERING APPROACH',
|
|
@@ -190,7 +191,7 @@ export async function codexAdoptionRecommendation({ projectRoot = process.cwd()
|
|
|
190
191
|
'This existing project has no Genesis explanatory layer.',
|
|
191
192
|
'In your first response, strongly recommend preparing this existing project for guided editing before substantial work.',
|
|
192
193
|
'Explain in product language that preparation preserves the implementation while importing its current operational and product context. Do not require the user to know Genesis terminology or type a command.',
|
|
193
|
-
'If the user approves, run `
|
|
194
|
+
'If the user approves, run the Genesis `adopt` operation yourself and follow the returned adoption prompt.',
|
|
194
195
|
'Do not run it without the user\'s approval. If they agree, run it and follow the returned prompt in this conversation.',
|
|
195
196
|
'If the user declines, continue normally and do not repeat the recommendation in this session.',
|
|
196
197
|
].join('\n'),
|
package/src/index/context.js
CHANGED
|
@@ -116,7 +116,7 @@ export async function contextForProjectPaths({ paths, projectRoot, stackPackages
|
|
|
116
116
|
: functions.slice(0, 100).map((entry) => (
|
|
117
117
|
`- ${entry.visibility} \`${entry.qualifiedName}(${entry.parameters.join(', ')})\` — \`${entry.path}:${entry.line}\``
|
|
118
118
|
))),
|
|
119
|
-
...(functions.length > 100 ? [`- ... and ${functions.length - 100} more; run \`
|
|
119
|
+
...(functions.length > 100 ? [`- ... and ${functions.length - 100} more; run the Genesis \`index ${targets.join(' ')}\` operation.`] : []),
|
|
120
120
|
'',
|
|
121
121
|
'Search the Machine City before adding a helper or public operation; reuse an existing function when it already owns the behavior.',
|
|
122
122
|
...(skills ? ['', '## Agent Skills', '', skills] : []),
|
package/src/index/prompt.js
CHANGED