@sockulags/agent-os 0.15.0 → 0.17.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.
- package/README.md +105 -59
- package/cli/doctor.mjs +351 -0
- package/cli/index.mjs +328 -151
- package/cli/index.test.mjs +436 -9
- package/package.json +5 -6
- package/plugins/agent-os-core/.claude-plugin/plugin.json +18 -0
- package/plugins/agent-os-core/.codex-plugin/plugin.json +24 -0
- package/plugins/agent-os-core/skills/capture-intent/SKILL.md +68 -0
- package/plugins/agent-os-core/skills/capture-intent/references/intent-template.md +47 -0
- package/plugins/agent-os-core/skills/explain-work/SKILL.md +42 -0
- package/{skills → plugins/agent-os-core/skills}/list-skills/SKILL.md +16 -7
- package/{skills → plugins/agent-os-core/skills}/plain-voice/SKILL.md +7 -4
- package/plugins/agent-os-core/skills/plan-work/SKILL.md +151 -0
- package/{skills → plugins/agent-os-core/skills}/plan-work/references/elicitation.md +7 -3
- package/plugins/agent-os-core/skills/plan-work/references/spec-template.md +65 -0
- package/plugins/agent-os-core/skills/record-lesson/SKILL.md +47 -0
- package/{skills → plugins/agent-os-core/skills}/scope-guard/SKILL.md +11 -6
- package/{skills → plugins/agent-os-core/skills}/verify-before-done/SKILL.md +6 -2
- package/plugins/agent-os-dev/.claude-plugin/plugin.json +18 -0
- package/plugins/agent-os-dev/.codex-plugin/plugin.json +24 -0
- package/plugins/agent-os-dev/hooks/hooks.json +42 -0
- package/{skills → plugins/agent-os-dev/skills}/batch-work/SKILL.md +6 -2
- package/{skills → plugins/agent-os-dev/skills}/check-work/SKILL.md +33 -14
- package/{skills/deliver-work/workflow.md → plugins/agent-os-dev/skills/deliver-work/SKILL.md} +126 -57
- package/plugins/agent-os-dev/skills/deliver-work/references/work-records.md +20 -0
- package/plugins/agent-os-dev/skills/design-work/SKILL.md +160 -0
- package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.mjs +233 -0
- package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs +73 -0
- package/plugins/agent-os-dev/skills/diagnose-before-fix/SKILL.md +29 -0
- package/{skills → plugins/agent-os-dev/skills}/dispatch-next/SKILL.md +11 -3
- package/plugins/agent-os-dev/skills/init-agent-os/SKILL.md +131 -0
- package/plugins/agent-os-dev/skills/init-agent-os/policy.md +91 -0
- package/plugins/agent-os-dev/skills/init-agent-os/references/guards.md +40 -0
- package/plugins/agent-os-dev/skills/init-agent-os/references/repository-init.md +115 -0
- package/plugins/agent-os-dev/skills/init-agent-os/references/review-template.md +35 -0
- package/plugins/agent-os-dev/skills/init-agent-os/references/workflow-template.md +80 -0
- package/plugins/agent-os-dev/skills/init-agent-os/scripts/policy-block.mjs +187 -0
- package/plugins/agent-os-dev/skills/init-agent-os/templates/agent-review.yml +59 -0
- package/plugins/agent-os-dev/skills/init-agent-os/templates/lint-intents.yml +30 -0
- package/{skills → plugins/agent-os-dev/skills}/proportional-testing/SKILL.md +1 -1
- package/plugins/agent-os-dev/skills/quality-ratchet/SKILL.md +104 -0
- package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/project-controls.md +31 -3
- package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.mjs +145 -0
- package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.test.mjs +158 -0
- package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.mjs +372 -0
- package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.test.mjs +138 -0
- package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.mjs +322 -0
- package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.test.mjs +177 -0
- package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.mjs +59 -8
- package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.test.mjs +134 -8
- package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.mjs +296 -22
- package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.test.mjs +114 -6
- package/plugins/agent-os-dev/skills/shape-work/SKILL.md +135 -0
- package/plugins/agent-os-dev/skills/shape-work/references/implementation-issues.md +163 -0
- package/{skills/plan-work → plugins/agent-os-dev/skills/shape-work}/references/prototypes.md +9 -10
- package/plugins/agent-os-dev/skills/simplify/SKILL.md +91 -0
- package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.mjs +166 -0
- package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.test.mjs +49 -0
- package/policy.md +57 -30
- package/hooks/hooks.json +0 -17
- package/skills/deliver-work/SKILL.md +0 -12
- package/skills/diagnose-before-fix/SKILL.md +0 -24
- package/skills/explain-work/SKILL.md +0 -28
- package/skills/init-agent-os/SKILL.md +0 -55
- package/skills/init-agent-os/references/repository-init.md +0 -75
- package/skills/init-agent-os/scripts/policy-block.ps1 +0 -87
- package/skills/notice-lesson/SKILL.md +0 -20
- package/skills/plan-work/SKILL.md +0 -100
- package/skills/quality-ratchet/SKILL.md +0 -72
- package/skills/record-lesson/SKILL.md +0 -31
- package/skills/shape-work/SKILL.md +0 -71
- package/skills/shape-work/references/implementation-issues.md +0 -90
- package/skills/shape-work/references/mockups.md +0 -23
- package/skills/simplifier/SKILL.md +0 -35
- package/skills/simplifier-audit/SKILL.md +0 -30
- package/skills/simplifier-review/SKILL.md +0 -40
- package/skills/understand-work/SKILL.md +0 -32
- package/skills/understand-work/agents/openai.yaml +0 -2
- package/skills/writing-skills/SKILL.md +0 -68
- package/skills/writing-skills/agents/openai.yaml +0 -2
- /package/{skills/batch-work → plugins/agent-os-core/skills/capture-intent}/agents/openai.yaml +0 -0
- /package/{skills/deliver-work → plugins/agent-os-core/skills/explain-work}/agents/openai.yaml +0 -0
- /package/{skills/dispatch-next → plugins/agent-os-core/skills/list-skills}/agents/openai.yaml +0 -0
- /package/{skills → plugins/agent-os-core/skills}/plain-voice/references/tells.md +0 -0
- /package/{skills/explain-work → plugins/agent-os-core/skills/plan-work}/agents/openai.yaml +0 -0
- /package/{skills → plugins/agent-os-core/skills}/plan-work/references/map.md +0 -0
- /package/{skills/init-agent-os → plugins/agent-os-dev/skills/batch-work}/agents/openai.yaml +0 -0
- /package/{skills → plugins/agent-os-dev/skills}/batch-work/references/manifest.md +0 -0
- /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/manifest-hash.mjs +0 -0
- /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/test-manifest-hash.mjs +0 -0
- /package/{skills → plugins/agent-os-dev/skills}/check-work/references/findings.md +0 -0
- /package/{skills/list-skills → plugins/agent-os-dev/skills/deliver-work}/agents/openai.yaml +0 -0
- /package/{skills/plan-work → plugins/agent-os-dev/skills/design-work}/agents/openai.yaml +0 -0
- /package/{skills/record-lesson → plugins/agent-os-dev/skills/dispatch-next}/agents/openai.yaml +0 -0
- /package/{skills/shape-work → plugins/agent-os-dev/skills/init-agent-os}/agents/openai.yaml +0 -0
- /package/{skills → plugins/agent-os-dev/skills}/proportional-testing/references/strategy.md +0 -0
- /package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/structure.md +0 -0
- /package/{skills/simplifier-audit → plugins/agent-os-dev/skills/shape-work}/agents/openai.yaml +0 -0
- /package/{skills/simplifier → plugins/agent-os-dev/skills/simplify}/agents/openai.yaml +0 -0
package/cli/index.test.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import assert from 'node:assert/strict'
|
|
2
|
+
import { spawnSync } from 'node:child_process'
|
|
2
3
|
import fs from 'node:fs'
|
|
3
4
|
import os from 'node:os'
|
|
4
5
|
import path from 'node:path'
|
|
@@ -7,18 +8,22 @@ import { fileURLToPath } from 'node:url'
|
|
|
7
8
|
import {
|
|
8
9
|
buildManagedHookCommand,
|
|
9
10
|
buildPlan,
|
|
11
|
+
CODEX_HOOK_TRUST_NOTICE,
|
|
10
12
|
executeInstall,
|
|
11
13
|
hookConfigPath,
|
|
12
14
|
INSTALL_MANIFEST,
|
|
13
15
|
PACKAGE_NAME,
|
|
14
16
|
parseArgs,
|
|
15
|
-
|
|
17
|
+
planManagedHooks,
|
|
16
18
|
planPolicyUpdate,
|
|
19
|
+
policyBlockVersion,
|
|
17
20
|
resolveOptions,
|
|
18
21
|
run,
|
|
19
22
|
targetSkillRoot,
|
|
20
23
|
VERSION
|
|
21
24
|
} from './index.mjs'
|
|
25
|
+
import { compareVersions, latestPublishedVersion } from './doctor.mjs'
|
|
26
|
+
import { resolvePolicyVersion } from '../plugins/agent-os-dev/skills/init-agent-os/scripts/policy-block.mjs'
|
|
22
27
|
|
|
23
28
|
const temporaryRoots = []
|
|
24
29
|
|
|
@@ -46,11 +51,13 @@ test('defaults to guided direct install', () => {
|
|
|
46
51
|
platform: null,
|
|
47
52
|
method: null,
|
|
48
53
|
scope: null,
|
|
54
|
+
package: null,
|
|
49
55
|
policy: null,
|
|
50
56
|
yes: false,
|
|
51
57
|
dryRun: false,
|
|
52
58
|
help: false,
|
|
53
|
-
version: false
|
|
59
|
+
version: false,
|
|
60
|
+
offline: false
|
|
54
61
|
})
|
|
55
62
|
})
|
|
56
63
|
|
|
@@ -69,11 +76,13 @@ test('parses non-interactive direct update flags', () => {
|
|
|
69
76
|
platform: 'both',
|
|
70
77
|
method: 'direct',
|
|
71
78
|
scope: 'project',
|
|
79
|
+
package: null,
|
|
72
80
|
policy: false,
|
|
73
81
|
yes: true,
|
|
74
82
|
dryRun: false,
|
|
75
83
|
help: false,
|
|
76
|
-
version: false
|
|
84
|
+
version: false,
|
|
85
|
+
offline: false
|
|
77
86
|
})
|
|
78
87
|
})
|
|
79
88
|
|
|
@@ -83,11 +92,13 @@ test('supports Claude Code as a platform alias and upgrade as update', () => {
|
|
|
83
92
|
platform: 'claude',
|
|
84
93
|
method: null,
|
|
85
94
|
scope: null,
|
|
95
|
+
package: null,
|
|
86
96
|
policy: null,
|
|
87
97
|
yes: true,
|
|
88
98
|
dryRun: false,
|
|
89
99
|
help: false,
|
|
90
|
-
version: false
|
|
100
|
+
version: false,
|
|
101
|
+
offline: false
|
|
91
102
|
})
|
|
92
103
|
})
|
|
93
104
|
|
|
@@ -220,7 +231,9 @@ test('direct project install configures both hosts without replacing unrelated h
|
|
|
220
231
|
]) {
|
|
221
232
|
const config = JSON.parse(fs.readFileSync(file, 'utf8'))
|
|
222
233
|
assert.deepEqual(config.permissions, unrelated.permissions)
|
|
223
|
-
assert.deepEqual(config.hooks.PreToolUse, unrelated.hooks.PreToolUse)
|
|
234
|
+
assert.deepEqual(config.hooks.PreToolUse[0], unrelated.hooks.PreToolUse[0])
|
|
235
|
+
assert.equal(config.hooks.PreToolUse.filter((group) => JSON.stringify(group).includes('--agent-os-hook=guards')).length, 1)
|
|
236
|
+
assert.equal(config.hooks.SessionStart.filter((group) => JSON.stringify(group).includes('--agent-os-hook=guards')).length, 1)
|
|
224
237
|
assert.deepEqual(config.hooks.Stop[0], unrelated.hooks.Stop[0])
|
|
225
238
|
assert.equal(config.hooks.Stop.filter((group) => JSON.stringify(group).includes('--agent-os-hook=quality-ratchet')).length, 1)
|
|
226
239
|
const command = config.hooks.Stop.find((group) =>
|
|
@@ -230,6 +243,21 @@ test('direct project install configures both hosts without replacing unrelated h
|
|
|
230
243
|
}
|
|
231
244
|
})
|
|
232
245
|
|
|
246
|
+
test('a changed Codex hook tells the developer to trust it in /hooks, and an unchanged one stays quiet', async () => {
|
|
247
|
+
const root = temporaryRoot()
|
|
248
|
+
const project = path.join(root, 'project')
|
|
249
|
+
fs.mkdirSync(project, { recursive: true })
|
|
250
|
+
const install = async () => {
|
|
251
|
+
let text = ''
|
|
252
|
+
await executeInstall({
|
|
253
|
+
command: 'install', platform: 'codex', method: 'direct', scope: 'project', policy: false
|
|
254
|
+
}, { output: { write(chunk) { text += chunk } }, homeDir: root, cwd: project })
|
|
255
|
+
return text
|
|
256
|
+
}
|
|
257
|
+
assert.equal((await install()).includes(CODEX_HOOK_TRUST_NOTICE), true)
|
|
258
|
+
assert.equal((await install()).includes(CODEX_HOOK_TRUST_NOTICE), false)
|
|
259
|
+
})
|
|
260
|
+
|
|
233
261
|
test('managed hook updates replace only the exact Agent OS entry', () => {
|
|
234
262
|
const durableScript = path.join(temporaryRoot(), '.codex', 'skills', 'quality-ratchet', 'scripts', 'quality-delta.mjs')
|
|
235
263
|
const managedCommand = buildManagedHookCommand(durableScript)
|
|
@@ -243,7 +271,9 @@ test('managed hook updates replace only the exact Agent OS entry', () => {
|
|
|
243
271
|
]
|
|
244
272
|
}
|
|
245
273
|
}, null, 2) + '\n'
|
|
246
|
-
const planned =
|
|
274
|
+
const planned = planManagedHooks(original, [
|
|
275
|
+
{ event: 'Stop', marker: '--agent-os-hook=quality-ratchet', command: managedCommand }
|
|
276
|
+
], 'test hooks.json')
|
|
247
277
|
assert.equal(planned.status, 'UPDATED')
|
|
248
278
|
const config = JSON.parse(planned.content)
|
|
249
279
|
assert.equal(config.unrelated, true)
|
|
@@ -417,11 +447,11 @@ test('upgrades a schema 1 direct manifest while retaining managed integration st
|
|
|
417
447
|
|
|
418
448
|
test('packaged hook asset and direct command use the stable runner marker', () => {
|
|
419
449
|
const packageJson = JSON.parse(fs.readFileSync(path.join(packageRootForTest(), 'package.json'), 'utf8'))
|
|
420
|
-
const hooks = JSON.parse(fs.readFileSync(path.join(packageRootForTest(), 'hooks', 'hooks.json'), 'utf8'))
|
|
450
|
+
const hooks = JSON.parse(fs.readFileSync(path.join(packageRootForTest(), 'plugins', 'agent-os-dev', 'hooks', 'hooks.json'), 'utf8'))
|
|
421
451
|
const durableScript = path.join(temporaryRoot(), '.claude', 'skills', 'quality-ratchet', 'scripts', 'quality-delta.mjs')
|
|
422
452
|
const command = buildManagedHookCommand(durableScript)
|
|
423
453
|
const nativeHook = hooks.hooks.Stop[0].hooks[0]
|
|
424
|
-
assert.ok(packageJson.files.includes('
|
|
454
|
+
assert.ok(packageJson.files.includes('plugins/'))
|
|
425
455
|
assert.equal(hooks.description.includes('quality-ratchet'), true)
|
|
426
456
|
assert.match(nativeHook.command, /\$\{CLAUDE_PLUGIN_ROOT\}/)
|
|
427
457
|
assert.equal(typeof nativeHook.commandWindows, 'string')
|
|
@@ -495,6 +525,43 @@ test('policy planning preserves surrounding text and rejects malformed markers',
|
|
|
495
525
|
() => planPolicyUpdate('<!-- BEGIN AGENT OS -->\nbroken\n', policy),
|
|
496
526
|
/Malformed Agent OS policy markers/
|
|
497
527
|
)
|
|
528
|
+
|
|
529
|
+
const versioned = planPolicyUpdate(updated.content, policy, '9.9.9')
|
|
530
|
+
assert.equal(versioned.status, 'UPDATED')
|
|
531
|
+
assert.equal(policyBlockVersion(versioned.content), '9.9.9')
|
|
532
|
+
assert.match(versioned.content, /<!-- BEGIN AGENT OS -->\n<!-- agent-os version 9\.9\.9 -->\n# Policy\n/)
|
|
533
|
+
assert.equal(planPolicyUpdate(versioned.content, policy, '9.9.9').status, 'OK')
|
|
534
|
+
assert.equal(policyBlockVersion('no block here'), null)
|
|
535
|
+
})
|
|
536
|
+
|
|
537
|
+
test('policy sync follows the selected platform and the installed policy script works without a checkout', async () => {
|
|
538
|
+
const root = temporaryRoot()
|
|
539
|
+
const homeDir = path.join(root, 'home')
|
|
540
|
+
await executeInstall({
|
|
541
|
+
command: 'install',
|
|
542
|
+
platform: 'codex',
|
|
543
|
+
method: 'direct',
|
|
544
|
+
scope: 'user',
|
|
545
|
+
policy: true
|
|
546
|
+
}, { output: silentOutput(), homeDir, cwd: root })
|
|
547
|
+
|
|
548
|
+
const installedPolicy = fs.readFileSync(path.join(homeDir, '.codex', 'AGENTS.md'), 'utf8')
|
|
549
|
+
assert.match(installedPolicy, /BEGIN AGENT OS/)
|
|
550
|
+
assert.equal(policyBlockVersion(installedPolicy), VERSION)
|
|
551
|
+
assert.equal(fs.existsSync(path.join(homeDir, '.claude', 'CLAUDE.md')), false)
|
|
552
|
+
|
|
553
|
+
const script = path.join(homeDir, '.codex', 'skills', 'init-agent-os', 'scripts', 'policy-block.mjs')
|
|
554
|
+
// The installed skill resolves the same version from the install manifest, so it sees no drift.
|
|
555
|
+
const installedCheck = spawnSync(process.execPath, [script, '--check', '--target', path.join(homeDir, '.codex', 'AGENTS.md')], { encoding: 'utf8' })
|
|
556
|
+
assert.equal(installedCheck.status, 0, installedCheck.stdout + installedCheck.stderr)
|
|
557
|
+
const target = path.join(root, 'CLAUDE.md')
|
|
558
|
+
fs.writeFileSync(target, '# Mine\n')
|
|
559
|
+
const run = (...args) => spawnSync(process.execPath, [script, '--target', target, ...args], { encoding: 'utf8' })
|
|
560
|
+
assert.equal(run('--check').status, 1)
|
|
561
|
+
assert.equal(fs.readFileSync(target, 'utf8'), '# Mine\n')
|
|
562
|
+
assert.equal(run().status, 0)
|
|
563
|
+
assert.equal(run('--check').status, 0)
|
|
564
|
+
assert.match(fs.readFileSync(target, 'utf8'), /^# Mine\n\n<!-- BEGIN AGENT OS -->/)
|
|
498
565
|
})
|
|
499
566
|
|
|
500
567
|
test('malformed policy markers abort before direct skill installation', async () => {
|
|
@@ -569,6 +636,366 @@ test('plugin update skips Git refresh for a registered local Codex marketplace',
|
|
|
569
636
|
assert.deepEqual(calls.map((call) => call[1]), [
|
|
570
637
|
['plugin', 'marketplace', 'list', '--json'],
|
|
571
638
|
['plugin', 'list', '--json'],
|
|
572
|
-
['plugin', 'add', 'agent-os@agent-os']
|
|
639
|
+
['plugin', 'add', 'agent-os-core@agent-os'],
|
|
640
|
+
['plugin', 'add', 'agent-os-dev@agent-os']
|
|
573
641
|
])
|
|
574
642
|
})
|
|
643
|
+
|
|
644
|
+
test('core-only install copies core skills, adds no hooks, and installs the policy without its dev section', async () => {
|
|
645
|
+
const root = temporaryRoot()
|
|
646
|
+
const homeDir = path.join(root, 'home')
|
|
647
|
+
const options = { command: 'install', platform: 'claude', method: 'direct', scope: 'user', policy: true, package: 'core' }
|
|
648
|
+
await executeInstall(options, { output: silentOutput(), homeDir, cwd: root })
|
|
649
|
+
const skillsRoot = path.join(homeDir, '.claude', 'skills')
|
|
650
|
+
assert.equal(fs.existsSync(path.join(skillsRoot, 'plan-work', 'SKILL.md')), true)
|
|
651
|
+
assert.equal(fs.existsSync(path.join(skillsRoot, 'deliver-work')), false)
|
|
652
|
+
const manifest = JSON.parse(fs.readFileSync(path.join(skillsRoot, INSTALL_MANIFEST), 'utf8'))
|
|
653
|
+
assert.deepEqual(manifest.packages, ['agent-os-core'])
|
|
654
|
+
assert.equal(fs.existsSync(path.join(homeDir, '.claude', 'settings.json')), false)
|
|
655
|
+
const policy = fs.readFileSync(path.join(homeDir, '.claude', 'CLAUDE.md'), 'utf8')
|
|
656
|
+
assert.match(policy, /## Core policy/)
|
|
657
|
+
assert.doesNotMatch(policy, /^## Development workflows$/m)
|
|
658
|
+
|
|
659
|
+
const doctor = await runDoctor(homeDir, root)
|
|
660
|
+
assert.match(doctor.text, /OK {4}claude direct user .*version /)
|
|
661
|
+
assert.match(doctor.text, /OK {4}claude global policy/)
|
|
662
|
+
assert.doesNotMatch(doctor.text, /hook missing|hooks missing|skills missing/)
|
|
663
|
+
})
|
|
664
|
+
|
|
665
|
+
test('switching from all packages to core removes dev skills and every managed hook', async () => {
|
|
666
|
+
const root = temporaryRoot()
|
|
667
|
+
const homeDir = path.join(root, 'home')
|
|
668
|
+
const options = { command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: false }
|
|
669
|
+
await executeInstall(options, { output: silentOutput(), homeDir, cwd: root })
|
|
670
|
+
const hookFile = path.join(homeDir, '.codex', 'hooks.json')
|
|
671
|
+
const all = JSON.parse(fs.readFileSync(hookFile, 'utf8'))
|
|
672
|
+
assert.equal(all.hooks.PreToolUse[0].matcher.includes('Edit'), true)
|
|
673
|
+
assert.match(JSON.stringify(all.hooks.SessionStart), /guards\.mjs/)
|
|
674
|
+
await executeInstall({ ...options, command: 'update', package: 'core' }, { output: silentOutput(), homeDir, cwd: root })
|
|
675
|
+
assert.equal(fs.existsSync(path.join(homeDir, '.codex', 'skills', 'deliver-work')), false)
|
|
676
|
+
assert.doesNotMatch(fs.readFileSync(hookFile, 'utf8'), /--agent-os-hook=/)
|
|
677
|
+
})
|
|
678
|
+
|
|
679
|
+
test('a direct install names the setup command, and a core-only install does not', async () => {
|
|
680
|
+
const install = async (extra) => {
|
|
681
|
+
const root = temporaryRoot()
|
|
682
|
+
let text = ''
|
|
683
|
+
await executeInstall({
|
|
684
|
+
command: 'install', platform: 'claude', method: 'direct', scope: 'user', policy: false, ...extra
|
|
685
|
+
}, { output: { write(chunk) { text += chunk } }, homeDir: path.join(root, 'home'), cwd: root })
|
|
686
|
+
return text
|
|
687
|
+
}
|
|
688
|
+
assert.match(await install({}), /Next: run \/init-agent-os global once for your personal preferences, then \/init-agent-os in each repository/)
|
|
689
|
+
assert.doesNotMatch(await install({ package: 'core' }), /init-agent-os/)
|
|
690
|
+
})
|
|
691
|
+
|
|
692
|
+
test('lint-intents reports errors with a failing exit code and warnings only under --strict', async () => {
|
|
693
|
+
const root = temporaryRoot()
|
|
694
|
+
const folder = path.join(root, 'intents', '2026-11-export')
|
|
695
|
+
fs.mkdirSync(folder, { recursive: true })
|
|
696
|
+
fs.writeFileSync(path.join(folder, 'intent.md'), '---\nid: 2026-11-export\nstatus: accepted\nrev: 2\nsupersedes: null\n---\n# Export\n')
|
|
697
|
+
fs.writeFileSync(path.join(folder, 'spec.md'), '---\nintent: 2026-11-export\nrev: 1\nbuilt_on: intent@1\nstatus: accepted\n---\n# Export\n')
|
|
698
|
+
const lint = async (...args) => {
|
|
699
|
+
let text = ''
|
|
700
|
+
const code = await run(['lint-intents', ...args], { output: { write(chunk) { text += chunk } }, cwd: root })
|
|
701
|
+
return { code, text }
|
|
702
|
+
}
|
|
703
|
+
const relaxed = await lint()
|
|
704
|
+
assert.equal(relaxed.code, 0, relaxed.text)
|
|
705
|
+
assert.match(relaxed.text, /WARN intents\/2026-11-export\/spec\.md: stale/)
|
|
706
|
+
assert.equal((await lint('--strict')).code, 1)
|
|
707
|
+
fs.writeFileSync(path.join(folder, 'spec.md'), '---\nintent: other\nrev: 1\nbuilt_on: intent@3\nstatus: draft\n---\n')
|
|
708
|
+
const broken = await lint()
|
|
709
|
+
assert.equal(broken.code, 1)
|
|
710
|
+
assert.match(broken.text, /ERROR intents\/2026-11-export\/spec\.md: status must be one of accepted, superseded/)
|
|
711
|
+
})
|
|
712
|
+
|
|
713
|
+
test('doctor reports a current install as clean and names drift with the fixing command', async () => {
|
|
714
|
+
const root = temporaryRoot()
|
|
715
|
+
const homeDir = path.join(root, 'home')
|
|
716
|
+
const cwd = path.join(root, 'project')
|
|
717
|
+
fs.mkdirSync(cwd, { recursive: true })
|
|
718
|
+
await executeInstall({
|
|
719
|
+
command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: true
|
|
720
|
+
}, { output: silentOutput(), homeDir, cwd })
|
|
721
|
+
|
|
722
|
+
const doctor = async (args = ['doctor', '--offline'], extra = {}) => {
|
|
723
|
+
let text = ''
|
|
724
|
+
const code = await run(args, { output: { write(chunk) { text += chunk } }, homeDir, cwd, ...extra })
|
|
725
|
+
return { code, text }
|
|
726
|
+
}
|
|
727
|
+
const clean = await doctor()
|
|
728
|
+
assert.equal(clean.code, 0, clean.text)
|
|
729
|
+
assert.match(clean.text, /OK {4}codex direct user .*version /)
|
|
730
|
+
assert.match(clean.text, /OK {4}codex global policy/)
|
|
731
|
+
assert.match(clean.text, /No version drift found/)
|
|
732
|
+
|
|
733
|
+
const outdated = await doctor(['doctor'], { latestVersion: () => '999.0.0' })
|
|
734
|
+
assert.match(outdated.text, /WARN {2}installer: .*latest published version is 999\.0\.0/)
|
|
735
|
+
|
|
736
|
+
const skillsRoot = path.join(homeDir, '.codex', 'skills')
|
|
737
|
+
const manifestPath = path.join(skillsRoot, INSTALL_MANIFEST)
|
|
738
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
|
|
739
|
+
manifest.version = '0.1.0'
|
|
740
|
+
manifest.skills.push('retired-skill')
|
|
741
|
+
fs.writeFileSync(manifestPath, JSON.stringify(manifest))
|
|
742
|
+
fs.mkdirSync(path.join(skillsRoot, 'retired-skill'))
|
|
743
|
+
fs.writeFileSync(path.join(skillsRoot, 'retired-skill', 'SKILL.md'), '---\nname: retired-skill\n---\n')
|
|
744
|
+
fs.mkdirSync(path.join(homeDir, '.claude', 'plugins'), { recursive: true })
|
|
745
|
+
fs.writeFileSync(path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json'), JSON.stringify({
|
|
746
|
+
plugins: { 'agent-os@agent-os-marketplace': [{ scope: 'user', version: '0.2.0' }] }
|
|
747
|
+
}))
|
|
748
|
+
const policyPath = path.join(homeDir, '.codex', 'AGENTS.md')
|
|
749
|
+
fs.writeFileSync(policyPath, fs.readFileSync(policyPath, 'utf8').replace(/<!-- agent-os version [^>]+ -->\n/, ''))
|
|
750
|
+
|
|
751
|
+
const drifted = await doctor()
|
|
752
|
+
assert.equal(drifted.code, 1)
|
|
753
|
+
assert.match(drifted.text, /DRIFT codex direct user .*installed 0\.1\.0.*update --platform codex --scope user/)
|
|
754
|
+
assert.match(drifted.text, /retired skills still installed: retired-skill/)
|
|
755
|
+
assert.match(drifted.text, /DRIFT claude plugin agent-os@agent-os-marketplace \(user\): the single agent-os plugin is replaced by agent-os-core and agent-os-dev/)
|
|
756
|
+
assert.match(drifted.text, /DRIFT codex global policy .*no version line/)
|
|
757
|
+
assert.equal(fs.readFileSync(manifestPath, 'utf8'), JSON.stringify(manifest))
|
|
758
|
+
})
|
|
759
|
+
|
|
760
|
+
test('doctor finds no installation and suggests install', async () => {
|
|
761
|
+
const root = temporaryRoot()
|
|
762
|
+
let text = ''
|
|
763
|
+
const code = await run(['doctor', '--offline'], {
|
|
764
|
+
output: { write(chunk) { text += chunk } }, homeDir: path.join(root, 'home'), cwd: root
|
|
765
|
+
})
|
|
766
|
+
assert.equal(code, 0)
|
|
767
|
+
assert.match(text, /no Agent OS installation found/)
|
|
768
|
+
})
|
|
769
|
+
|
|
770
|
+
test('doctor reports the repository workflow file without counting it as drift', async () => {
|
|
771
|
+
const root = temporaryRoot()
|
|
772
|
+
const homeDir = path.join(root, 'home')
|
|
773
|
+
const repo = path.join(root, 'repo')
|
|
774
|
+
const cwd = path.join(repo, 'src')
|
|
775
|
+
fs.mkdirSync(cwd, { recursive: true })
|
|
776
|
+
fs.mkdirSync(path.join(repo, '.git'))
|
|
777
|
+
|
|
778
|
+
const outside = await runDoctor(homeDir, cwd)
|
|
779
|
+
assert.doesNotMatch(outside.text, /repository /)
|
|
780
|
+
|
|
781
|
+
fs.mkdirSync(path.join(repo, '.agent-os'))
|
|
782
|
+
const missing = await runDoctor(homeDir, cwd)
|
|
783
|
+
assert.equal(missing.code, 0)
|
|
784
|
+
assert.match(missing.text, /WARN {2}repository .*no \.agent-os\/workflow\.md.*init-agent-os/)
|
|
785
|
+
|
|
786
|
+
fs.writeFileSync(path.join(repo, '.agent-os', 'workflow.md'), '# How we work\n\n## Routes\n')
|
|
787
|
+
const unpointed = await runDoctor(homeDir, cwd)
|
|
788
|
+
assert.match(unpointed.text, /WARN {2}repository .*does not point to \.agent-os\/workflow\.md/)
|
|
789
|
+
|
|
790
|
+
fs.writeFileSync(path.join(repo, 'CLAUDE.md'), 'Work routes, tracker, and finishing tasks: .agent-os/workflow.md.\n')
|
|
791
|
+
const ready = await runDoctor(homeDir, cwd)
|
|
792
|
+
assert.match(ready.text, /OK {4}repository .*workflow\.md is present and the project policy points to it/)
|
|
793
|
+
|
|
794
|
+
fs.writeFileSync(path.join(repo, '.agent-os', 'workflow.md'), '# How we work\n')
|
|
795
|
+
const noRoutes = await runDoctor(homeDir, cwd)
|
|
796
|
+
assert.match(noRoutes.text, /WARN {2}repository .*no "## Routes" section/)
|
|
797
|
+
assert.doesNotMatch(noRoutes.text, /OK {4}repository/)
|
|
798
|
+
})
|
|
799
|
+
|
|
800
|
+
function snapshotTree(root) {
|
|
801
|
+
const entries = []
|
|
802
|
+
const visit = (dir) => {
|
|
803
|
+
for (const entry of fs.readdirSync(dir, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
804
|
+
const file = path.join(dir, entry.name)
|
|
805
|
+
if (entry.isDirectory()) {
|
|
806
|
+
entries.push(['dir', path.relative(root, file)])
|
|
807
|
+
visit(file)
|
|
808
|
+
} else {
|
|
809
|
+
entries.push(['file', path.relative(root, file), fs.readFileSync(file, 'utf8')])
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
visit(root)
|
|
814
|
+
return entries
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
async function runDoctor(homeDir, cwd, args = ['doctor', '--offline'], extra = {}) {
|
|
818
|
+
let text = ''
|
|
819
|
+
const code = await run(args, { output: { write(chunk) { text += chunk } }, homeDir, cwd, ...extra })
|
|
820
|
+
return { code, text }
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
test('doctor reports broken install files as findings instead of crashing, and writes nothing', async () => {
|
|
824
|
+
const root = temporaryRoot()
|
|
825
|
+
const homeDir = path.join(root, 'home')
|
|
826
|
+
const cwd = path.join(root, 'project')
|
|
827
|
+
fs.mkdirSync(cwd, { recursive: true })
|
|
828
|
+
fs.mkdirSync(path.join(homeDir, '.claude', 'skills'), { recursive: true })
|
|
829
|
+
fs.writeFileSync(path.join(homeDir, '.claude', 'skills', INSTALL_MANIFEST), 'null')
|
|
830
|
+
fs.mkdirSync(path.join(homeDir, '.claude', 'CLAUDE.md'), { recursive: true })
|
|
831
|
+
fs.mkdirSync(path.join(homeDir, '.claude', 'plugins'), { recursive: true })
|
|
832
|
+
fs.writeFileSync(path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json'),
|
|
833
|
+
JSON.stringify({ plugins: { 'agent-os@m': [null, 5, 'text'] } }))
|
|
834
|
+
fs.mkdirSync(path.join(homeDir, '.codex', 'plugins'), { recursive: true })
|
|
835
|
+
fs.writeFileSync(path.join(homeDir, '.codex', 'plugins', 'cache'), 'not a directory')
|
|
836
|
+
await executeInstall({
|
|
837
|
+
command: 'install', platform: 'codex', method: 'direct', scope: 'project', policy: false
|
|
838
|
+
}, { output: silentOutput(), homeDir, cwd })
|
|
839
|
+
fs.rmSync(path.join(cwd, '.codex', 'hooks.json'))
|
|
840
|
+
fs.mkdirSync(path.join(cwd, '.codex', 'hooks.json'))
|
|
841
|
+
|
|
842
|
+
const before = snapshotTree(root)
|
|
843
|
+
const result = await runDoctor(homeDir, cwd)
|
|
844
|
+
assert.deepEqual(snapshotTree(root), before)
|
|
845
|
+
assert.equal(result.code, 1, result.text)
|
|
846
|
+
assert.match(result.text, /DRIFT claude direct user .*is not a readable Agent OS install manifest.*Move it aside/)
|
|
847
|
+
assert.match(result.text, /WARN {2}codex direct project .*cannot read .*hooks\.json/)
|
|
848
|
+
assert.match(result.text, /WARN {2}claude global policy .*cannot read the file/)
|
|
849
|
+
assert.doesNotMatch(result.text, /no Agent OS installation found/)
|
|
850
|
+
})
|
|
851
|
+
|
|
852
|
+
test('doctor covers plugin caches, duplicates, strays, scopes, and in-place local marketplaces', async () => {
|
|
853
|
+
const root = temporaryRoot()
|
|
854
|
+
const homeDir = path.join(root, 'home')
|
|
855
|
+
const cwd = path.join(root, 'project')
|
|
856
|
+
fs.mkdirSync(cwd, { recursive: true })
|
|
857
|
+
await executeInstall({
|
|
858
|
+
command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: false
|
|
859
|
+
}, { output: silentOutput(), homeDir, cwd })
|
|
860
|
+
const cache = path.join(homeDir, '.codex', 'plugins', 'cache', 'agent-os', 'agent-os-dev')
|
|
861
|
+
fs.mkdirSync(path.join(cache, '0.1.0'), { recursive: true })
|
|
862
|
+
fs.writeFileSync(path.join(cache, '.DS_Store'), '')
|
|
863
|
+
fs.mkdirSync(path.join(homeDir, '.agents', 'skills', 'shape-work'), { recursive: true })
|
|
864
|
+
fs.writeFileSync(path.join(homeDir, '.agents', 'skills', 'shape-work', 'SKILL.md'), '---\nname: shape-work\n---\n')
|
|
865
|
+
|
|
866
|
+
const checkout = path.join(root, 'checkout')
|
|
867
|
+
fs.mkdirSync(path.join(checkout, 'plugins', 'agent-os-core', '.claude-plugin'), { recursive: true })
|
|
868
|
+
fs.writeFileSync(path.join(checkout, 'plugins', 'agent-os-core', '.claude-plugin', 'plugin.json'), JSON.stringify({ name: 'agent-os-core', version: VERSION }))
|
|
869
|
+
const plugins = path.join(homeDir, '.claude', 'plugins')
|
|
870
|
+
fs.mkdirSync(plugins, { recursive: true })
|
|
871
|
+
fs.writeFileSync(path.join(plugins, 'known_marketplaces.json'), JSON.stringify({
|
|
872
|
+
local: { source: { source: 'directory', path: checkout }, installLocation: checkout },
|
|
873
|
+
remote: { source: { source: 'github', repo: 'sockulags/agent-os' } }
|
|
874
|
+
}))
|
|
875
|
+
fs.writeFileSync(path.join(plugins, 'installed_plugins.json'), JSON.stringify({ plugins: {
|
|
876
|
+
'agent-os-core@local': [{ scope: 'user', version: '0.2.0' }],
|
|
877
|
+
'agent-os-dev@remote': [{ scope: 'project', version: '0.1.0' }]
|
|
878
|
+
} }))
|
|
879
|
+
|
|
880
|
+
const { code, text } = await runDoctor(homeDir, cwd)
|
|
881
|
+
assert.equal(code, 1)
|
|
882
|
+
assert.match(text, /DRIFT codex plugin agent-os-dev@agent-os: cached version 0\.1\.0/)
|
|
883
|
+
assert.doesNotMatch(text, /\.DS_Store/)
|
|
884
|
+
assert.match(text, /WARN {2}codex: both the plugin and a direct install are present.*Keep one/)
|
|
885
|
+
assert.match(text, /Agent OS skills outside the managed install: shape-work/)
|
|
886
|
+
assert.match(text, /OK {4}claude plugin agent-os-core@local \(user\): loaded in place from .*version /)
|
|
887
|
+
assert.match(text, /claude plugin update agent-os-dev@remote --scope project/)
|
|
888
|
+
})
|
|
889
|
+
|
|
890
|
+
test('doctor names a policy-only fix for plugin users and handles a CLI newer than npm', async () => {
|
|
891
|
+
const root = temporaryRoot()
|
|
892
|
+
const homeDir = path.join(root, 'home')
|
|
893
|
+
fs.mkdirSync(path.join(homeDir, '.claude', 'plugins'), { recursive: true })
|
|
894
|
+
fs.writeFileSync(path.join(homeDir, '.claude', 'plugins', 'installed_plugins.json'), JSON.stringify({
|
|
895
|
+
plugins: {
|
|
896
|
+
'agent-os-core@remote': [{ scope: 'user', version: VERSION }],
|
|
897
|
+
'agent-os-dev@remote': [{ scope: 'user', version: VERSION }]
|
|
898
|
+
}
|
|
899
|
+
}))
|
|
900
|
+
fs.writeFileSync(path.join(homeDir, '.claude', 'CLAUDE.md'), '# Mine\n')
|
|
901
|
+
const { text } = await runDoctor(homeDir, root, ['doctor'], { latestVersion: () => '0.0.1' })
|
|
902
|
+
assert.match(text, /WARN {2}claude global policy .*no Agent OS block\. To add it: run \/agent-os-dev:init-agent-os global/)
|
|
903
|
+
assert.match(text, /INFO {2}installer: this CLI is .* newer than the published 0\.0\.1/)
|
|
904
|
+
})
|
|
905
|
+
|
|
906
|
+
test('version comparison and the npm lookup tolerate odd input', () => {
|
|
907
|
+
assert.ok(compareVersions('0.16.0', '0.15.9') > 0)
|
|
908
|
+
assert.equal(compareVersions('0.15.0', '0.15.0-beta.1'), 0)
|
|
909
|
+
assert.ok(compareVersions('1.0.0', '0.99.99') > 0)
|
|
910
|
+
const calls = []
|
|
911
|
+
const spawn = (command, options) => {
|
|
912
|
+
calls.push([command, options.shell])
|
|
913
|
+
return { status: 0, stdout: '1.2.3\n' }
|
|
914
|
+
}
|
|
915
|
+
assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn }), '1.2.3')
|
|
916
|
+
assert.deepEqual(calls, [['npm view @sockulags/agent-os version', true]])
|
|
917
|
+
assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn: () => ({ status: 1, stdout: '' }) }), null)
|
|
918
|
+
assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn: () => ({ status: 0, stdout: 'npm warn\n' }) }), null)
|
|
919
|
+
assert.equal(latestPublishedVersion('@sockulags/agent-os', { spawn: () => { throw new Error('spawn failed') } }), null)
|
|
920
|
+
assert.equal(latestPublishedVersion('x; rm -rf /', { spawn }), null)
|
|
921
|
+
assert.equal(calls.length, 1)
|
|
922
|
+
})
|
|
923
|
+
|
|
924
|
+
test('the policy script reads the version from the dev plugin or checkout package.json and ignores other packages', () => {
|
|
925
|
+
const root = temporaryRoot()
|
|
926
|
+
const pluginRoot = path.join(root, 'plugins', 'agent-os-dev')
|
|
927
|
+
const scriptDir = path.join(pluginRoot, 'skills', 'init-agent-os', 'scripts')
|
|
928
|
+
fs.mkdirSync(scriptDir, { recursive: true })
|
|
929
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'other-package', version: '9.9.9' }))
|
|
930
|
+
assert.equal(resolvePolicyVersion(scriptDir), null)
|
|
931
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: PACKAGE_NAME, version: '1.2.3' }))
|
|
932
|
+
assert.equal(resolvePolicyVersion(scriptDir), '1.2.3')
|
|
933
|
+
fs.mkdirSync(path.join(pluginRoot, '.claude-plugin'))
|
|
934
|
+
fs.writeFileSync(path.join(pluginRoot, '.claude-plugin', 'plugin.json'), JSON.stringify({ name: 'agent-os-dev', version: '1.5.0' }))
|
|
935
|
+
assert.equal(resolvePolicyVersion(scriptDir), '1.5.0')
|
|
936
|
+
fs.writeFileSync(path.join(pluginRoot, 'skills', INSTALL_MANIFEST), JSON.stringify({ version: '2.0.0' }))
|
|
937
|
+
assert.equal(resolvePolicyVersion(scriptDir), '2.0.0')
|
|
938
|
+
})
|
|
939
|
+
|
|
940
|
+
test('doctor names the recorded Claude plugin key and gives no install advice for an unreadable plugin record', async () => {
|
|
941
|
+
const root = temporaryRoot()
|
|
942
|
+
const homeDir = path.join(root, 'home')
|
|
943
|
+
await executeInstall({
|
|
944
|
+
command: 'install', platform: 'claude', method: 'direct', scope: 'user', policy: false
|
|
945
|
+
}, { output: silentOutput(), homeDir, cwd: root })
|
|
946
|
+
const plugins = path.join(homeDir, '.claude', 'plugins')
|
|
947
|
+
fs.mkdirSync(plugins, { recursive: true })
|
|
948
|
+
fs.writeFileSync(path.join(plugins, 'installed_plugins.json'), JSON.stringify({
|
|
949
|
+
plugins: { 'agent-os-core@team': [{ scope: 'user', version: VERSION }] }
|
|
950
|
+
}))
|
|
951
|
+
const duplicate = await runDoctor(homeDir, root)
|
|
952
|
+
assert.match(duplicate.text, /Keep one: claude plugin uninstall agent-os-core@team, or delete/)
|
|
953
|
+
assert.doesNotMatch(duplicate.text, /agent-os@agent-os-marketplace/)
|
|
954
|
+
|
|
955
|
+
const unreadableHome = path.join(root, 'unreadable')
|
|
956
|
+
fs.mkdirSync(path.join(unreadableHome, '.claude', 'plugins'), { recursive: true })
|
|
957
|
+
fs.writeFileSync(path.join(unreadableHome, '.claude', 'plugins', 'installed_plugins.json'), '{ not json')
|
|
958
|
+
fs.writeFileSync(path.join(unreadableHome, '.claude', 'CLAUDE.md'), '# Mine\n')
|
|
959
|
+
const unreadable = await runDoctor(unreadableHome, root)
|
|
960
|
+
assert.match(unreadable.text, /WARN {2}claude plugins: cannot read/)
|
|
961
|
+
assert.doesNotMatch(unreadable.text, /no Agent OS installation found/)
|
|
962
|
+
assert.doesNotMatch(unreadable.text, /install --platform claude/)
|
|
963
|
+
assert.match(unreadable.text, /To add it: run \/agent-os-dev:init-agent-os global/)
|
|
964
|
+
})
|
|
965
|
+
|
|
966
|
+
test('update without --package keeps an earlier core-only choice', async () => {
|
|
967
|
+
const root = temporaryRoot()
|
|
968
|
+
const homeDir = path.join(root, 'home')
|
|
969
|
+
const options = { command: 'install', platform: 'codex', method: 'direct', scope: 'user', policy: false, package: 'core' }
|
|
970
|
+
await executeInstall(options, { output: silentOutput(), homeDir, cwd: root })
|
|
971
|
+
const parsed = await resolveOptions(parseArgs(['update', '--platform', 'codex', '--yes', '--no-policy']), {
|
|
972
|
+
input: { isTTY: false }, output: { isTTY: false }
|
|
973
|
+
})
|
|
974
|
+
assert.equal(parsed.package, null)
|
|
975
|
+
await executeInstall(parsed, { output: silentOutput(), homeDir, cwd: root })
|
|
976
|
+
const skillsRoot = path.join(homeDir, '.codex', 'skills')
|
|
977
|
+
assert.equal(fs.existsSync(path.join(skillsRoot, 'deliver-work')), false)
|
|
978
|
+
assert.deepEqual(JSON.parse(fs.readFileSync(path.join(skillsRoot, INSTALL_MANIFEST), 'utf8')).packages, ['agent-os-core'])
|
|
979
|
+
assert.equal(fs.existsSync(path.join(homeDir, '.codex', 'hooks.json')), false)
|
|
980
|
+
})
|
|
981
|
+
|
|
982
|
+
test('Claude plugin update removes the single legacy plugin before installing core and dev', async () => {
|
|
983
|
+
const calls = []
|
|
984
|
+
await executeInstall({
|
|
985
|
+
command: 'update', platform: 'claude', method: 'plugin', scope: 'user', policy: false
|
|
986
|
+
}, {
|
|
987
|
+
output: silentOutput(),
|
|
988
|
+
exists: () => true,
|
|
989
|
+
execute: (command, args) => {
|
|
990
|
+
calls.push(args.join(' '))
|
|
991
|
+
if (args.join(' ') === 'plugin marketplace list --json') {
|
|
992
|
+
return { status: 0, stdout: JSON.stringify([{ name: 'agent-os-marketplace' }]), stderr: '' }
|
|
993
|
+
}
|
|
994
|
+
return { status: 0, stdout: '', stderr: '' }
|
|
995
|
+
}
|
|
996
|
+
})
|
|
997
|
+
const uninstall = calls.indexOf('plugin uninstall agent-os@agent-os-marketplace --scope user')
|
|
998
|
+
assert.ok(uninstall >= 0, calls.join('\n'))
|
|
999
|
+
assert.ok(uninstall < calls.indexOf('plugin install agent-os-core@agent-os-marketplace --scope user'))
|
|
1000
|
+
assert.ok(calls.includes('plugin install agent-os-dev@agent-os-marketplace --scope user'))
|
|
1001
|
+
})
|
package/package.json
CHANGED
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sockulags/agent-os",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A lightweight
|
|
3
|
+
"version": "0.17.0",
|
|
4
|
+
"description": "A lightweight agent operating system for Claude Code and Codex: agent-os-core for intent, planning, and evidence, and agent-os-dev for delivery, review, and guard hooks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"agent-os": "./cli/index.mjs"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"cli/",
|
|
11
|
-
"
|
|
12
|
-
"policy.md"
|
|
13
|
-
"skills/"
|
|
11
|
+
"plugins/",
|
|
12
|
+
"policy.md"
|
|
14
13
|
],
|
|
15
14
|
"engines": {
|
|
16
15
|
"node": ">=18.18"
|
|
17
16
|
},
|
|
18
17
|
"scripts": {
|
|
19
|
-
"test": "node --test cli/index.test.mjs skills/quality-ratchet/scripts/quality-delta.test.mjs skills/quality-ratchet/scripts/project-controls.test.mjs",
|
|
18
|
+
"test": "node --test cli/index.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/quality-delta.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/project-controls.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.test.mjs plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.test.mjs plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.test.mjs plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs",
|
|
20
19
|
"test:evals": "node scripts/test-eval-agent-behavior.mjs",
|
|
21
20
|
"validate": "node scripts/validate-agent-os.mjs",
|
|
22
21
|
"verify:release": "node scripts/verify-release.mjs"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-os-core",
|
|
3
|
+
"description": "Agent OS core: capture intent, plan decisions, explain plainly, keep scope, and prove claims. Useful for any agent work, not only code.",
|
|
4
|
+
"version": "0.17.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Lucas Skog"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://sockulags.github.io/agent-os/",
|
|
9
|
+
"repository": "https://github.com/sockulags/agent-os",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"workflow",
|
|
12
|
+
"planning",
|
|
13
|
+
"intent",
|
|
14
|
+
"scope-control",
|
|
15
|
+
"verification",
|
|
16
|
+
"skills"
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-os-core",
|
|
3
|
+
"description": "Agent OS core: capture intent, plan decisions, explain plainly, keep scope, and prove claims. Useful for any agent work, not only code.",
|
|
4
|
+
"version": "0.17.0",
|
|
5
|
+
"homepage": "https://sockulags.github.io/agent-os/",
|
|
6
|
+
"repository": "https://github.com/sockulags/agent-os",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"workflow",
|
|
9
|
+
"planning",
|
|
10
|
+
"intent",
|
|
11
|
+
"scope-control",
|
|
12
|
+
"verification",
|
|
13
|
+
"skills"
|
|
14
|
+
],
|
|
15
|
+
"skills": "./skills/",
|
|
16
|
+
"interface": {
|
|
17
|
+
"displayName": "Agent OS Core",
|
|
18
|
+
"shortDescription": "Intent, planning, and evidence disciplines",
|
|
19
|
+
"longDescription": "Captures what is needed and why as a versioned intent, plans decisions and ground truth as a spec with a plain-language summary, explains or shortens text for non-technical readers, keeps work inside its agreed scope, records durable lessons, and requires fresh evidence before any completion claim. Works for product, documentation, and analysis work as well as code.",
|
|
20
|
+
"developerName": "Lucas Skog",
|
|
21
|
+
"category": "Productivity",
|
|
22
|
+
"websiteURL": "https://sockulags.github.io/agent-os/"
|
|
23
|
+
}
|
|
24
|
+
}
|