@iamdevlinph/codex-kit 1.0.11 → 1.0.12
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/README.md
CHANGED
|
@@ -5,6 +5,7 @@ Portable Codex setup for new devices and multiple projects. It provides:
|
|
|
5
5
|
- three automatically routed roles plus a manual quick implementer
|
|
6
6
|
- automatic global role routing
|
|
7
7
|
- a reusable, stack-neutral `AGENTS.md` template
|
|
8
|
+
- a package-owned `codex-kit-reconcile-agents` skill for semantic reconciliation
|
|
8
9
|
- safe commands for global setup, project synchronization, and reconciliation
|
|
9
10
|
|
|
10
11
|
The package contains no credentials. Global installation does not modify the
|
|
@@ -28,9 +29,13 @@ that they run the installed `${CODEX_HOME:-~/.codex}/codex-kit/routing-hook.js`.
|
|
|
28
29
|
For one-off use without a global installation, prefix a command with
|
|
29
30
|
`pnpm dlx @iamdevlinph/codex-kit@latest`.
|
|
30
31
|
|
|
31
|
-
`global install` copies reusable agents
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
`global install` copies reusable agents and the
|
|
33
|
+
`skills/codex-kit-reconcile-agents` skill to `${CODEX_HOME:-~/.codex}`, maintains
|
|
34
|
+
the package routing section in global `AGENTS.md`, and adds package-owned
|
|
35
|
+
handlers to `hooks.json` without replacing existing hooks. `global list` shows
|
|
36
|
+
the reconciliation skill's ownership status. Install and uninstall preserve
|
|
37
|
+
modified or user-owned skill files using the same backup/restore semantics as
|
|
38
|
+
other package files.
|
|
34
39
|
|
|
35
40
|
The Sol root plans, routes, coordinates, and validates. On every prompt, the
|
|
36
41
|
routing hook supplies the current `SUBAGENT_ROUTING.md`; the root classifies the
|
|
@@ -41,6 +46,18 @@ read-only checks, documentation, bookkeeping, and clear changes spanning up to
|
|
|
41
46
|
roughly three files. Automatic delegation is reserved for broad discovery,
|
|
42
47
|
large multi-file implementation or debugging, and high-risk review.
|
|
43
48
|
|
|
49
|
+
## Available subagents
|
|
50
|
+
|
|
51
|
+
| Subagent | Routing | Model and effort | Used for |
|
|
52
|
+
| --- | --- | --- | --- |
|
|
53
|
+
| `code-explorer` | Automatic | `gpt-5.6-terra`, medium | Read-only broad repository discovery, contract tracing, and multi-file searches |
|
|
54
|
+
| `implementer` | Automatic | `gpt-5.6-luna`, high | Large behavior changes, non-obvious debugging, migrations, and substantial tests |
|
|
55
|
+
| `code-reviewer` | Automatic | `gpt-5.6-sol`, high | Read-only review of security-sensitive, architectural, public-API, concurrency, migration, or difficult-to-validate changes |
|
|
56
|
+
| `quick-implementer` | Manual only | `gpt-5.6-luna`, medium | Small, mechanical, well-specified changes limited to one or two files |
|
|
57
|
+
|
|
58
|
+
The root orchestrator is not a subagent. It owns planning, routing, integration,
|
|
59
|
+
and final validation.
|
|
60
|
+
|
|
44
61
|
For a substantial task that splits into genuinely independent slices, the root
|
|
45
62
|
may run multiple `implementer` instances concurrently. Each receives exclusive
|
|
46
63
|
file or module ownership and separate validation scope. Work that shares types,
|
|
@@ -69,11 +86,6 @@ codex-kit global configure \
|
|
|
69
86
|
--plan-reasoning-effort high
|
|
70
87
|
```
|
|
71
88
|
|
|
72
|
-
Automatic role models are tuned by task shape: Terra-medium performs broad
|
|
73
|
-
repository exploration, Luna-high performs large implementation slices, and
|
|
74
|
-
Sol-high reviews consequential changes. Luna-medium `quick-implementer` remains
|
|
75
|
-
manual-only.
|
|
76
|
-
|
|
77
89
|
Delegation is time-bounded. The root waits once for up to 60 seconds, requests
|
|
78
90
|
one progress update, and then enforces a three-minute read/review/manual-quick
|
|
79
91
|
deadline or five-minute implementation deadline. Validation commands that make
|
|
@@ -101,8 +113,8 @@ pnpm dlx @iamdevlinph/codex-kit@latest global list
|
|
|
101
113
|
```
|
|
102
114
|
|
|
103
115
|
The summary shows the Codex home, orchestrator, normal and Plan-mode reasoning
|
|
104
|
-
effort, routing-file and routing-hook status,
|
|
105
|
-
dumping unrelated configuration.
|
|
116
|
+
effort, routing-file and routing-hook status, reconciliation-skill status, and
|
|
117
|
+
installed custom agents without dumping unrelated configuration.
|
|
106
118
|
|
|
107
119
|
Uninstall package-managed global files:
|
|
108
120
|
|
|
@@ -174,13 +186,14 @@ pnpm dlx @iamdevlinph/codex-kit@latest project sync
|
|
|
174
186
|
codex-kit project status
|
|
175
187
|
```
|
|
176
188
|
|
|
177
|
-
`project sync` never edits `AGENTS.md` or project skills. It
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
189
|
+
`project sync` never edits `AGENTS.md` or project skills. It routes Codex to the
|
|
190
|
+
global `codex-kit-reconcile-agents` skill, which inspects project state and
|
|
191
|
+
existing skills, merges only applicable reusable changes, preserves local
|
|
192
|
+
adaptations and organization, and may create or update a concrete conditional
|
|
193
|
+
workflow under `.agents/skills`. Critical safety, authorization, secrets,
|
|
194
|
+
database, deployment, and destructive-operation rules remain in `AGENTS.md`;
|
|
195
|
+
do not copy the complete template or introduce managed markers. After semantic
|
|
196
|
+
reconciliation and validation, record the applied template hash:
|
|
184
197
|
|
|
185
198
|
```sh
|
|
186
199
|
codex-kit project mark-applied
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Shared Agent Defaults
|
|
2
2
|
|
|
3
3
|
Reusable defaults for coding agents. Adapt stack details, commands, paths,
|
|
4
|
-
product context, and local conventions in the project
|
|
5
|
-
the managed markers.
|
|
4
|
+
product context, and local conventions in the project's active `AGENTS.md`.
|
|
6
5
|
|
|
7
6
|
## Context And Instruction Scope
|
|
8
7
|
|
|
@@ -40,16 +39,18 @@ the managed markers.
|
|
|
40
39
|
- `TEMPLATE_AGENTS.md` is a staged reference copy of codex-kit's reusable
|
|
41
40
|
instructions, not active project guidance. Active repository guidance lives
|
|
42
41
|
in `AGENTS.md` and applicable project skills under `.agents/skills`.
|
|
43
|
-
- When `codex-kit project status` reports
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
`
|
|
42
|
+
- When the template is refreshed, `codex-kit project status` reports
|
|
43
|
+
`reconciliation required`, or a user requests template sync or mark-applied,
|
|
44
|
+
use the global `$codex-kit-reconcile-agents` skill. It compares the template
|
|
45
|
+
with `AGENTS.md`, project state, and existing skills; preserves local rules;
|
|
46
|
+
applies only relevant reusable changes; validates them; and marks applied
|
|
47
|
+
only after success.
|
|
47
48
|
- Keep project-specific rules out of `TEMPLATE_AGENTS.md`. Treat local template
|
|
48
49
|
edits as candidates that must be generalized and promoted to the canonical
|
|
49
50
|
`assets/TEMPLATE_AGENTS.md` in the codex-kit repository. Updating `AGENTS.md`
|
|
50
51
|
does not update either template automatically.
|
|
51
|
-
- Keep project-specific context
|
|
52
|
-
reusable cross-project rules
|
|
52
|
+
- Keep project-specific context out of the packaged template; keep only
|
|
53
|
+
reusable cross-project rules here.
|
|
53
54
|
- When a request introduces a reusable workflow preference, convention, agent
|
|
54
55
|
behavior, tooling default, or safety rule, tell the user it appears
|
|
55
56
|
template-level and update the current project's active instructions when
|
|
@@ -66,26 +67,16 @@ the managed markers.
|
|
|
66
67
|
- Merge template updates into other projects without overwriting project-specific
|
|
67
68
|
context.
|
|
68
69
|
|
|
69
|
-
## Template
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
instruction from the current AGENTS.md after the managed block under
|
|
80
|
-
# Project-Specific Instructions, remove only duplicate shared rules, and do not
|
|
81
|
-
change project behavior. Review existing project skills under .agents/skills and
|
|
82
|
-
move conditionally relevant, repeatable procedures out of AGENTS.md only when a
|
|
83
|
-
skill is warranted. Preserve critical safety and authorization rules in
|
|
84
|
-
AGENTS.md, preserve existing relevant skills, avoid speculative skills, and
|
|
85
|
-
validate any skill you create or modify. Afterward, summarize what was
|
|
86
|
-
preserved, what moved into a skill, and whether any local rules appear
|
|
87
|
-
template-worthy.
|
|
88
|
-
```
|
|
70
|
+
## Template reconciliation
|
|
71
|
+
|
|
72
|
+
Do not copy the complete template into `AGENTS.md`, replace it wholesale, or
|
|
73
|
+
introduce managed markers. If a legacy shared-template marker is present,
|
|
74
|
+
preserve local content and reconcile its meaning safely without creating new
|
|
75
|
+
markers. Summarize added, updated, skipped, adapted, and skill-moved guidance,
|
|
76
|
+
including local/template conflicts and any generalized template-worthy
|
|
77
|
+
promotion. Keep critical safety, authorization, secrets, database, deployment,
|
|
78
|
+
and destructive-operation rules always-on in `AGENTS.md`; extract only concrete
|
|
79
|
+
conditional procedures into validated project skills.
|
|
89
80
|
|
|
90
81
|
## Core Behavior
|
|
91
82
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codex-kit-reconcile-agents
|
|
3
|
+
description: Reconcile a refreshed TEMPLATE_AGENTS.md with a project's AGENTS.md and applicable skills while preserving local adaptations. Use when project status requires reconciliation, the template was refreshed, or the user requests an agent-template sync or mark-applied.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Reconcile codex-kit agent guidance
|
|
7
|
+
|
|
8
|
+
## Procedure
|
|
9
|
+
|
|
10
|
+
1. Inspect `AGENTS.md`, `TEMPLATE_AGENTS.md`, `.codex-kit-state.json`, the
|
|
11
|
+
project's existing `.agents/skills`, and `codex-kit project status`. If a
|
|
12
|
+
codex-kit template backup exists, compare it with the refreshed template to
|
|
13
|
+
isolate the actual template change.
|
|
14
|
+
2. Preserve the existing `AGENTS.md` organization and all project-specific
|
|
15
|
+
adaptations. Merge only reusable template guidance that applies to this
|
|
16
|
+
repository; report conflicts between local and template rules, and do not
|
|
17
|
+
replace `AGENTS.md` wholesale or copy the complete template into it.
|
|
18
|
+
3. Keep critical always-on safety, authorization, secrets, database,
|
|
19
|
+
deployment, and destructive-operation rules in `AGENTS.md`.
|
|
20
|
+
4. Extract only concrete, conditional, repeatable project procedures into a
|
|
21
|
+
focused skill under `.agents/skills/<skill-name>/SKILL.md`. Preserve relevant
|
|
22
|
+
existing skills, use valid YAML frontmatter, and do not create speculative
|
|
23
|
+
skills or duplicate detailed instructions.
|
|
24
|
+
5. Review the final instruction diff for preserved local rules, duplicates, and
|
|
25
|
+
unintended template edits. Validate every created or modified project skill
|
|
26
|
+
with an available skill validator and run the repository's documented checks.
|
|
27
|
+
Do not mark the template applied until reconciliation and validation succeed.
|
|
28
|
+
6. Run `codex-kit project mark-applied` only after successful reconciliation and
|
|
29
|
+
validation, then confirm `codex-kit project status` is up to date.
|
|
30
|
+
7. Summarize added, updated, skipped, adapted, and skill-moved guidance, with
|
|
31
|
+
reasons. Identify genuinely reusable, generalized changes that should be
|
|
32
|
+
promoted to codex-kit's canonical template and report the target section and
|
|
33
|
+
wording.
|
|
34
|
+
|
|
35
|
+
If legacy `codex-kit:shared-template` markers are present, preserve local
|
|
36
|
+
content and reconcile their meaning semantically. Do not add, recreate, or
|
|
37
|
+
depend on managed markers, and do not discard local adaptations.
|
package/bin/codex-kit.js
CHANGED
|
@@ -9,6 +9,10 @@ const isRecord = (value) => typeof value === "object" && value !== null;
|
|
|
9
9
|
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
10
|
const ASSETS = join(ROOT, "assets");
|
|
11
11
|
const AGENTS_DIR = join(ASSETS, "agents");
|
|
12
|
+
const SKILLS_DIR = join(ASSETS, "skills");
|
|
13
|
+
const RECONCILE_SKILL = "codex-kit-reconcile-agents";
|
|
14
|
+
const RECONCILE_SKILL_FILE = join(SKILLS_DIR, RECONCILE_SKILL, "SKILL.md");
|
|
15
|
+
const RECONCILE_SKILL_METADATA_FILE = join(SKILLS_DIR, RECONCILE_SKILL, "agents", "openai.yaml");
|
|
12
16
|
const ROUTING_FILE = join(ASSETS, "SUBAGENT_ROUTING.md");
|
|
13
17
|
const ROUTING_HOOK_FILE = join(ROOT, "bin", "routing-hook.js");
|
|
14
18
|
const TEMPLATE_FILE = join(ASSETS, "TEMPLATE_AGENTS.md");
|
|
@@ -266,29 +270,15 @@ function saveProjectState(cwd, state) {
|
|
|
266
270
|
write(join(cwd, PROJECT_STATE_FILE), `${JSON.stringify(state, null, 2)}\n`);
|
|
267
271
|
}
|
|
268
272
|
function templatePrompt() {
|
|
269
|
-
return `Template reference updated.
|
|
273
|
+
return `Template reference updated. Use the global $${RECONCILE_SKILL} skill to reconcile it semantically.
|
|
270
274
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
template
|
|
277
|
-
|
|
278
|
-
would reduce conditional detail in AGENTS.md. Preserve existing relevant skills
|
|
279
|
-
and avoid duplicating detailed instructions between AGENTS.md and SKILL.md.
|
|
280
|
-
|
|
281
|
-
Keep critical safety, authorization, database, deployment, and destructive-
|
|
282
|
-
operation restrictions in AGENTS.md even when a skill contains the detailed
|
|
283
|
-
workflow. Do not create speculative skills.
|
|
284
|
-
|
|
285
|
-
Preserve project-specific instructions and existing adaptations. Do not replace
|
|
286
|
-
AGENTS.md wholesale. If a template rule conflicts with a local rule, keep the
|
|
287
|
-
local rule and report the conflict.
|
|
288
|
-
|
|
289
|
-
Summarize what was added, updated, skipped, adapted, or moved into a skill, and
|
|
290
|
-
why. Validate any created or modified skills. When finished, run codex-kit
|
|
291
|
-
project mark-applied.`;
|
|
275
|
+
Inspect TEMPLATE_AGENTS.md, AGENTS.md, .codex-kit-state.json, existing
|
|
276
|
+
.agents/skills, and codex-kit project status. Preserve local adaptations and
|
|
277
|
+
AGENTS.md organization; merge only applicable reusable guidance. Keep critical
|
|
278
|
+
always-on safety and authorization rules in AGENTS.md, extract only concrete
|
|
279
|
+
conditional procedures into validated skills, and do not copy the complete
|
|
280
|
+
template or introduce managed markers. Mark applied only after reconciliation
|
|
281
|
+
and validation, then report any template-worthy generalized promotion.`;
|
|
292
282
|
}
|
|
293
283
|
function managedBlock(content, begin, end) {
|
|
294
284
|
return `${begin}\n${content.trimEnd()}\n${end}`;
|
|
@@ -367,6 +357,12 @@ function installGlobal(options) {
|
|
|
367
357
|
const routingRecord = installFile(ROUTING_FILE, join(home, "SUBAGENT_ROUTING.md"), "routing", prior, options.force);
|
|
368
358
|
if (routingRecord)
|
|
369
359
|
next.files.routing = routingRecord;
|
|
360
|
+
const reconciliationSkill = installFile(RECONCILE_SKILL_FILE, join(home, "skills", RECONCILE_SKILL, "SKILL.md"), `skills/${RECONCILE_SKILL}/SKILL.md`, prior, options.force);
|
|
361
|
+
if (reconciliationSkill)
|
|
362
|
+
next.files[`skills/${RECONCILE_SKILL}/SKILL.md`] = reconciliationSkill;
|
|
363
|
+
const reconciliationSkillMetadata = installFile(RECONCILE_SKILL_METADATA_FILE, join(home, "skills", RECONCILE_SKILL, "agents", "openai.yaml"), `skills/${RECONCILE_SKILL}/agents/openai.yaml`, prior, options.force);
|
|
364
|
+
if (reconciliationSkillMetadata)
|
|
365
|
+
next.files[`skills/${RECONCILE_SKILL}/agents/openai.yaml`] = reconciliationSkillMetadata;
|
|
370
366
|
const hookRecord = installFile(ROUTING_HOOK_FILE, join(home, "codex-kit", "routing-hook.js"), "routing-hook", prior, options.force);
|
|
371
367
|
if (hookRecord)
|
|
372
368
|
next.files["routing-hook"] = hookRecord;
|
|
@@ -491,6 +487,16 @@ function listGlobal(options) {
|
|
|
491
487
|
existsSync(routingHook.target) &&
|
|
492
488
|
readText(routingHook.target).includes(routingHook.command));
|
|
493
489
|
console.log(`Routing hook: ${hooksInstalled ? "installed" : "not installed"}`);
|
|
490
|
+
const skillTargets = [
|
|
491
|
+
[join(home, "skills", RECONCILE_SKILL, "SKILL.md"), state.files[`skills/${RECONCILE_SKILL}/SKILL.md`]],
|
|
492
|
+
[join(home, "skills", RECONCILE_SKILL, "agents", "openai.yaml"), state.files[`skills/${RECONCILE_SKILL}/agents/openai.yaml`]],
|
|
493
|
+
];
|
|
494
|
+
const skillStatus = skillTargets.every(([target, record]) => existsSync(target) && record && sha256(read(target)) === record.hash)
|
|
495
|
+
? "installed"
|
|
496
|
+
: skillTargets.some(([target]) => existsSync(target))
|
|
497
|
+
? "modified or incomplete"
|
|
498
|
+
: "missing";
|
|
499
|
+
console.log(`Reconciliation skill: ${skillStatus}`);
|
|
494
500
|
console.log("Custom agents:");
|
|
495
501
|
const agents = existsSync(agentsDir)
|
|
496
502
|
? readdirSync(agentsDir).filter((name) => name.endsWith(".toml")).sort()
|
|
@@ -574,6 +580,14 @@ function uninstallGlobal(options) {
|
|
|
574
580
|
}
|
|
575
581
|
if (state.hooks)
|
|
576
582
|
uninstallRoutingHooks(state.hooks);
|
|
583
|
+
const skillDir = join(home, "skills", RECONCILE_SKILL);
|
|
584
|
+
const skillMetadataDir = join(skillDir, "agents");
|
|
585
|
+
if (existsSync(skillMetadataDir) && statSync(skillMetadataDir).isDirectory() && !readdirSync(skillMetadataDir).length) {
|
|
586
|
+
rmSync(skillMetadataDir, { recursive: true });
|
|
587
|
+
}
|
|
588
|
+
if (existsSync(skillDir) && statSync(skillDir).isDirectory() && !readdirSync(skillDir).length) {
|
|
589
|
+
rmSync(skillDir, { recursive: true });
|
|
590
|
+
}
|
|
577
591
|
const allowancesDir = join(home, "codex-kit", "allowances");
|
|
578
592
|
if (existsSync(allowancesDir))
|
|
579
593
|
rmSync(allowancesDir, { recursive: true, force: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iamdevlinph/codex-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Portable Codex subagents and project AGENTS.md defaults.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"assets/agents",
|
|
11
11
|
"assets/SUBAGENT_ROUTING.md",
|
|
12
12
|
"assets/TEMPLATE_AGENTS.md",
|
|
13
|
+
"assets/skills",
|
|
13
14
|
"bin"
|
|
14
15
|
],
|
|
15
16
|
"scripts": {
|