@sockulags/agent-os 0.14.0 → 0.16.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 (101) hide show
  1. package/README.md +102 -49
  2. package/cli/doctor.mjs +307 -0
  3. package/cli/index.mjs +328 -151
  4. package/cli/index.test.mjs +406 -9
  5. package/package.json +5 -6
  6. package/plugins/agent-os-core/.claude-plugin/plugin.json +18 -0
  7. package/plugins/agent-os-core/.codex-plugin/plugin.json +24 -0
  8. package/plugins/agent-os-core/skills/capture-intent/SKILL.md +65 -0
  9. package/plugins/agent-os-core/skills/capture-intent/references/intent-template.md +47 -0
  10. package/plugins/agent-os-core/skills/explain-work/SKILL.md +42 -0
  11. package/{skills → plugins/agent-os-core/skills}/list-skills/SKILL.md +13 -6
  12. package/{skills → plugins/agent-os-core/skills}/plain-voice/SKILL.md +7 -4
  13. package/plugins/agent-os-core/skills/plan-work/SKILL.md +133 -0
  14. package/plugins/agent-os-core/skills/plan-work/references/elicitation.md +32 -0
  15. package/plugins/agent-os-core/skills/plan-work/references/map.md +108 -0
  16. package/plugins/agent-os-core/skills/plan-work/references/spec-template.md +64 -0
  17. package/plugins/agent-os-core/skills/record-lesson/SKILL.md +47 -0
  18. package/plugins/agent-os-core/skills/scope-guard/SKILL.md +53 -0
  19. package/{skills → plugins/agent-os-core/skills}/verify-before-done/SKILL.md +6 -2
  20. package/plugins/agent-os-dev/.claude-plugin/plugin.json +18 -0
  21. package/plugins/agent-os-dev/.codex-plugin/plugin.json +24 -0
  22. package/plugins/agent-os-dev/hooks/hooks.json +42 -0
  23. package/{skills → plugins/agent-os-dev/skills}/batch-work/SKILL.md +9 -4
  24. package/{skills → plugins/agent-os-dev/skills}/batch-work/references/manifest.md +8 -0
  25. package/{skills → plugins/agent-os-dev/skills}/check-work/SKILL.md +31 -14
  26. package/{skills/deliver-work/workflow.md → plugins/agent-os-dev/skills/deliver-work/SKILL.md} +85 -17
  27. package/plugins/agent-os-dev/skills/design-work/SKILL.md +145 -0
  28. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.mjs +233 -0
  29. package/plugins/agent-os-dev/skills/design-work/scripts/render-sketch.test.mjs +73 -0
  30. package/plugins/agent-os-dev/skills/diagnose-before-fix/SKILL.md +29 -0
  31. package/{skills → plugins/agent-os-dev/skills}/dispatch-next/SKILL.md +10 -4
  32. package/plugins/agent-os-dev/skills/init-agent-os/SKILL.md +121 -0
  33. package/plugins/agent-os-dev/skills/init-agent-os/policy.md +88 -0
  34. package/plugins/agent-os-dev/skills/init-agent-os/references/guards.md +39 -0
  35. package/{skills → plugins/agent-os-dev/skills}/init-agent-os/references/repository-init.md +41 -9
  36. package/plugins/agent-os-dev/skills/init-agent-os/references/review-template.md +35 -0
  37. package/plugins/agent-os-dev/skills/init-agent-os/scripts/policy-block.mjs +187 -0
  38. package/plugins/agent-os-dev/skills/init-agent-os/templates/agent-review.yml +59 -0
  39. package/plugins/agent-os-dev/skills/init-agent-os/templates/lint-intents.yml +30 -0
  40. package/{skills → plugins/agent-os-dev/skills}/proportional-testing/SKILL.md +1 -1
  41. package/plugins/agent-os-dev/skills/quality-ratchet/SKILL.md +103 -0
  42. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/project-controls.md +31 -3
  43. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.mjs +145 -0
  44. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/analyzers.test.mjs +158 -0
  45. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.mjs +372 -0
  46. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/guards.test.mjs +138 -0
  47. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.mjs +322 -0
  48. package/plugins/agent-os-dev/skills/quality-ratchet/scripts/intent-files.test.mjs +172 -0
  49. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.mjs +59 -8
  50. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/project-controls.test.mjs +134 -8
  51. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.mjs +296 -22
  52. package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/scripts/quality-delta.test.mjs +114 -6
  53. package/plugins/agent-os-dev/skills/shape-work/SKILL.md +124 -0
  54. package/plugins/agent-os-dev/skills/shape-work/references/implementation-issues.md +143 -0
  55. package/{skills/chart-work → plugins/agent-os-dev/skills/shape-work}/references/prototypes.md +11 -13
  56. package/plugins/agent-os-dev/skills/simplify/SKILL.md +91 -0
  57. package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.mjs +166 -0
  58. package/plugins/agent-os-dev/skills/simplify/scripts/audit-evidence.test.mjs +49 -0
  59. package/policy.md +53 -20
  60. package/hooks/hooks.json +0 -17
  61. package/skills/chart-work/SKILL.md +0 -42
  62. package/skills/chart-work/references/elicitation.md +0 -25
  63. package/skills/chart-work/references/map.md +0 -84
  64. package/skills/deliver-work/SKILL.md +0 -12
  65. package/skills/diagnose-before-fix/SKILL.md +0 -24
  66. package/skills/explain-work/SKILL.md +0 -27
  67. package/skills/guide-me/SKILL.md +0 -36
  68. package/skills/init-agent-os/SKILL.md +0 -54
  69. package/skills/init-agent-os/scripts/policy-block.ps1 +0 -87
  70. package/skills/notice-lesson/SKILL.md +0 -20
  71. package/skills/quality-ratchet/SKILL.md +0 -72
  72. package/skills/record-lesson/SKILL.md +0 -31
  73. package/skills/scope-guard/SKILL.md +0 -32
  74. package/skills/shape-work/SKILL.md +0 -48
  75. package/skills/shape-work/references/implementation-issues.md +0 -69
  76. package/skills/shape-work/references/mockups.md +0 -23
  77. package/skills/simplifier/SKILL.md +0 -35
  78. package/skills/simplifier/agents/openai.yaml +0 -2
  79. package/skills/simplifier-audit/SKILL.md +0 -30
  80. package/skills/simplifier-review/SKILL.md +0 -40
  81. package/skills/understand-work/SKILL.md +0 -31
  82. package/skills/understand-work/agents/openai.yaml +0 -2
  83. package/skills/writing-skills/SKILL.md +0 -68
  84. package/skills/writing-skills/agents/openai.yaml +0 -2
  85. /package/{skills/batch-work → plugins/agent-os-core/skills/capture-intent}/agents/openai.yaml +0 -0
  86. /package/{skills/chart-work → plugins/agent-os-core/skills/explain-work}/agents/openai.yaml +0 -0
  87. /package/{skills/deliver-work → plugins/agent-os-core/skills/list-skills}/agents/openai.yaml +0 -0
  88. /package/{skills → plugins/agent-os-core/skills}/plain-voice/references/tells.md +0 -0
  89. /package/{skills/dispatch-next → plugins/agent-os-core/skills/plan-work}/agents/openai.yaml +0 -0
  90. /package/{skills/explain-work → plugins/agent-os-dev/skills/batch-work}/agents/openai.yaml +0 -0
  91. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/manifest-hash.mjs +0 -0
  92. /package/{skills → plugins/agent-os-dev/skills}/batch-work/scripts/test-manifest-hash.mjs +0 -0
  93. /package/{skills → plugins/agent-os-dev/skills}/check-work/references/findings.md +0 -0
  94. /package/{skills/guide-me → plugins/agent-os-dev/skills/deliver-work}/agents/openai.yaml +0 -0
  95. /package/{skills/init-agent-os → plugins/agent-os-dev/skills/design-work}/agents/openai.yaml +0 -0
  96. /package/{skills/list-skills → plugins/agent-os-dev/skills/dispatch-next}/agents/openai.yaml +0 -0
  97. /package/{skills/record-lesson → plugins/agent-os-dev/skills/init-agent-os}/agents/openai.yaml +0 -0
  98. /package/{skills → plugins/agent-os-dev/skills}/proportional-testing/references/strategy.md +0 -0
  99. /package/{skills → plugins/agent-os-dev/skills}/quality-ratchet/references/structure.md +0 -0
  100. /package/{skills → plugins/agent-os-dev/skills}/shape-work/agents/openai.yaml +0 -0
  101. /package/{skills/simplifier-audit → plugins/agent-os-dev/skills/simplify}/agents/openai.yaml +0 -0
@@ -0,0 +1,166 @@
1
+ #!/usr/bin/env node
2
+ // Collects deterministic simplification candidates for a repository-wide audit: the most complex
3
+ // functions (lizard), duplicated blocks (jscpd), and unused code (knip for JavaScript/TypeScript,
4
+ // vulture for Python). Each tool is optional and never installed here; a missing tool is reported
5
+ // as unavailable. The output is a ranked candidate list to verify, not a list of findings.
6
+
7
+ import { spawnSync } from 'node:child_process'
8
+ import fs from 'node:fs'
9
+ import os from 'node:os'
10
+ import path from 'node:path'
11
+ import { pathToFileURL } from 'node:url'
12
+ import { findLizard, lizardFunctions } from '../../quality-ratchet/scripts/analyzers.mjs'
13
+ import { isSourcePath } from '../../quality-ratchet/scripts/quality-delta.mjs'
14
+
15
+ const TIMEOUT_MS = 300000
16
+ const LINE_LIMIT = 40
17
+
18
+ function run(command, args, cwd, spawn) {
19
+ return spawn(command, args, {
20
+ cwd, encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: TIMEOUT_MS, maxBuffer: 64 * 1024 * 1024,
21
+ shell: process.platform === 'win32' && /\.(?:cmd|bat)$/i.test(command)
22
+ })
23
+ }
24
+
25
+ function sourceFiles(root, spawn) {
26
+ const result = run('git', ['-C', root, 'ls-files', '-z', '--cached', '--others', '--exclude-standard'], root, spawn)
27
+ if (result.status !== 0) throw new Error(`git ls-files failed: ${result.stderr?.trim()}`)
28
+ return result.stdout.split('\0').filter(Boolean).map((file) => file.replaceAll('\\', '/')).filter(isSourcePath)
29
+ }
30
+
31
+ function localBin(root, name) {
32
+ const base = path.join(root, 'node_modules', '.bin', name)
33
+ return [base + (process.platform === 'win32' ? '.cmd' : ''), base].find((file) => fs.existsSync(file)) || null
34
+ }
35
+
36
+ // Resolves a command to its full path so Windows .cmd shims can be launched.
37
+ function onPath(command, spawn) {
38
+ try {
39
+ const result = run(process.platform === 'win32' ? 'where.exe' : 'which', [command], process.cwd(), spawn)
40
+ if (result.status !== 0) return null
41
+ const hits = result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean)
42
+ // where.exe also lists extensionless shell shims that Windows cannot launch.
43
+ return (process.platform === 'win32' ? hits.find((hit) => /\.(?:exe|cmd|bat)$/i.test(hit)) : hits[0]) || null
44
+ } catch {
45
+ return null
46
+ }
47
+ }
48
+
49
+ function firstLines(text, limit = LINE_LIMIT) {
50
+ const lines = text.split(/\r?\n/).filter((line) => line.trim())
51
+ return { lines: lines.slice(0, limit), omitted: Math.max(0, lines.length - limit) }
52
+ }
53
+
54
+ export function complexitySection(root, files, { analyze, limit = 15 } = {}) {
55
+ const functions = analyze(root, files)
56
+ if (functions === null) return { status: 'unavailable', reason: 'lizard is not installed.' }
57
+ const ranked = [...functions].sort((left, right) => right.ccn - left.ccn).slice(0, limit)
58
+ return { status: 'available', functions: ranked, analyzed: functions.length }
59
+ }
60
+
61
+ export function summarizeJscpd(report, limit = 10) {
62
+ const total = report.statistics?.total || {}
63
+ const clones = (report.duplicates || [])
64
+ .map((clone) => ({
65
+ lines: clone.lines,
66
+ first: `${clone.firstFile.name.replaceAll('\\', '/')}:${clone.firstFile.start}-${clone.firstFile.end}`,
67
+ second: `${clone.secondFile.name.replaceAll('\\', '/')}:${clone.secondFile.start}-${clone.secondFile.end}`
68
+ }))
69
+ .sort((left, right) => right.lines - left.lines)
70
+ return { status: 'available', percentage: total.percentage ?? 0, clones: clones.slice(0, limit), total: clones.length }
71
+ }
72
+
73
+ function duplicationSection(root, spawn) {
74
+ const command = localBin(root, 'jscpd') || onPath('jscpd', spawn)
75
+ if (!command) return { status: 'unavailable', reason: 'jscpd is not installed in node_modules/.bin or on PATH.' }
76
+ const output = fs.mkdtempSync(path.join(os.tmpdir(), 'agent-os-jscpd-'))
77
+ try {
78
+ run(command, ['--silent', '--reporters', 'json', '--output', output, '--gitignore',
79
+ '--ignore', '**/node_modules/**,**/dist/**,**/build/**,**/coverage/**,**/.git/**', '.'], root, spawn)
80
+ const reportPath = path.join(output, 'jscpd-report.json')
81
+ if (!fs.existsSync(reportPath)) return { status: 'unavailable', reason: 'jscpd produced no report.' }
82
+ return summarizeJscpd(JSON.parse(fs.readFileSync(reportPath, 'utf8')))
83
+ } finally {
84
+ fs.rmSync(output, { recursive: true, force: true })
85
+ }
86
+ }
87
+
88
+ function deadCodeSection(root, files, spawn) {
89
+ const sections = []
90
+ const knip = localBin(root, 'knip')
91
+ if (knip) {
92
+ const result = run(knip, ['--reporter', 'compact', '--no-progress'], root, spawn)
93
+ sections.push({ tool: 'knip', status: 'available', ...firstLines(`${result.stdout}`) })
94
+ } else if (files.some((file) => /\.(?:[cm]?[jt]sx?)$/.test(file))) {
95
+ sections.push({ tool: 'knip', status: 'unavailable', reason: 'knip is not installed in node_modules/.bin.' })
96
+ }
97
+ const python = files.filter((file) => file.endsWith('.py'))
98
+ if (python.length) {
99
+ const vulture = onPath('vulture', spawn)
100
+ if (vulture) {
101
+ const result = run(vulture, ['--min-confidence', '80', ...python], root, spawn)
102
+ sections.push({ tool: 'vulture', status: 'available', ...firstLines(`${result.stdout}`) })
103
+ } else {
104
+ sections.push({ tool: 'vulture', status: 'unavailable', reason: 'vulture is not on PATH.' })
105
+ }
106
+ }
107
+ return sections
108
+ }
109
+
110
+ export function collectEvidence(root, { spawn = spawnSync, analyze } = {}) {
111
+ const files = sourceFiles(root, spawn)
112
+ const launcher = analyze ? undefined : findLizard({ spawn })
113
+ const analyzer = analyze || ((cwd, list) => lizardFunctions(cwd, list, { launcher, spawn }))
114
+ const safe = (fn) => {
115
+ try { return fn() } catch (cause) { return { status: 'unavailable', reason: cause.message } }
116
+ }
117
+ return {
118
+ root,
119
+ sourceFiles: files.length,
120
+ complexity: safe(() => complexitySection(root, files, { analyze: analyzer })),
121
+ duplication: safe(() => duplicationSection(root, spawn)),
122
+ deadCode: safe(() => deadCodeSection(root, files, spawn))
123
+ }
124
+ }
125
+
126
+ export function formatEvidence(evidence) {
127
+ const lines = [`Agent OS simplification evidence for ${evidence.root} (${evidence.sourceFiles} source files)`, '']
128
+ const { complexity, duplication, deadCode } = evidence
129
+ lines.push('Most complex functions (lizard, cyclomatic complexity):')
130
+ if (complexity.status === 'available') {
131
+ lines.push(...complexity.functions.map((fn) => ` ${fn.ccn} ${fn.file}:${fn.line} ${fn.function}`))
132
+ } else lines.push(` unavailable: ${complexity.reason}`)
133
+ lines.push('', 'Duplicated blocks (jscpd):')
134
+ if (duplication.status === 'available') {
135
+ lines.push(` ${duplication.percentage}% duplicated lines, ${duplication.total} clones`)
136
+ lines.push(...duplication.clones.map((clone) => ` ${clone.lines} lines ${clone.first} = ${clone.second}`))
137
+ } else lines.push(` unavailable: ${duplication.reason}`)
138
+ lines.push('', 'Unused code:')
139
+ const dead = Array.isArray(deadCode) ? deadCode : [deadCode]
140
+ if (!dead.length) lines.push(' no supported language detected')
141
+ for (const section of dead) {
142
+ if (section.status !== 'available') {
143
+ lines.push(` ${section.tool || 'dead-code'} unavailable: ${section.reason}`)
144
+ continue
145
+ }
146
+ lines.push(` ${section.tool}:`, ...section.lines.map((line) => ` ${line}`))
147
+ if (section.omitted) lines.push(` ... ${section.omitted} more lines`)
148
+ }
149
+ lines.push('', 'These are candidates. Verify usage and intent before reporting any of them as a finding.')
150
+ return lines.join('\n')
151
+ }
152
+
153
+ function main() {
154
+ const args = process.argv.slice(2)
155
+ const json = args.includes('--json')
156
+ const rootArgument = args.find((arg) => !arg.startsWith('--'))
157
+ try {
158
+ const evidence = collectEvidence(path.resolve(rootArgument || process.cwd()))
159
+ console.log(json ? JSON.stringify(evidence, null, 2) : formatEvidence(evidence))
160
+ } catch (cause) {
161
+ console.error(`audit-evidence: ${cause.message}`)
162
+ process.exitCode = 1
163
+ }
164
+ }
165
+
166
+ if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main()
@@ -0,0 +1,49 @@
1
+ import assert from 'node:assert/strict'
2
+ import { execFileSync, spawnSync } from 'node:child_process'
3
+ import fs from 'node:fs'
4
+ import os from 'node:os'
5
+ import path from 'node:path'
6
+ import test from 'node:test'
7
+ import { collectEvidence, formatEvidence, summarizeJscpd } from './audit-evidence.mjs'
8
+
9
+ // Every external tool is reported missing; git still runs.
10
+ function withoutTools(command, args, options) {
11
+ if (['where.exe', 'which'].includes(command)) return { status: 1, stdout: '', stderr: '' }
12
+ return spawnSync(command, args, options)
13
+ }
14
+
15
+ test('ranks complex functions and reports missing tools as unavailable', (t) => {
16
+ const root = fs.mkdtempSync(path.join(os.tmpdir(), 'agent-os-audit-'))
17
+ t.after(() => fs.rmSync(root, { recursive: true, force: true }))
18
+ execFileSync('git', ['init', '-q', root])
19
+ fs.writeFileSync(path.join(root, 'a.js'), 'export const a = 1\n')
20
+ fs.writeFileSync(path.join(root, 'b.py'), 'b = 1\n')
21
+ fs.writeFileSync(path.join(root, 'notes.md'), '# not source\n')
22
+ const analyze = (cwd, files) => files.map((file, index) => ({ file, function: `f${index}`, line: 1, ccn: index + 5, nloc: 1 }))
23
+
24
+ const evidence = collectEvidence(root, { spawn: withoutTools, analyze })
25
+ assert.equal(evidence.sourceFiles, 2)
26
+ assert.deepEqual(evidence.complexity.functions.map((fn) => [fn.file, fn.ccn]), [['b.py', 6], ['a.js', 5]])
27
+ assert.equal(evidence.duplication.status, 'unavailable')
28
+ assert.deepEqual(evidence.deadCode.map((section) => [section.tool, section.status]), [
29
+ ['knip', 'unavailable'],
30
+ ['vulture', 'unavailable']
31
+ ])
32
+ const text = formatEvidence(evidence)
33
+ assert.match(text, /6 {2}b\.py:1 f1/)
34
+ assert.match(text, /These are candidates/)
35
+ })
36
+
37
+ test('summarizes jscpd clones largest first with forward-slash paths', () => {
38
+ const clone = (lines, first, second) => ({
39
+ lines,
40
+ firstFile: { name: first, start: 1, end: lines },
41
+ secondFile: { name: second, start: 10, end: 9 + lines }
42
+ })
43
+ const summary = summarizeJscpd({
44
+ statistics: { total: { percentage: 4.2 } },
45
+ duplicates: [clone(5, 'src\\a.js', 'src\\b.js'), clone(30, 'src/c.js', 'src/d.js')]
46
+ })
47
+ assert.equal(summary.percentage, 4.2)
48
+ assert.deepEqual(summary.clones.map((entry) => [entry.lines, entry.first]), [[30, 'src/c.js:1-30'], [5, 'src/a.js:1-5']])
49
+ })
package/policy.md CHANGED
@@ -1,7 +1,9 @@
1
- # Agent OS — global policy
1
+ # Agent OS global policy
2
2
 
3
3
  Source of truth for the managed policy block installed into `~/.claude/CLAUDE.md` and
4
- `~/.codex/AGENTS.md` by `init-agent-os global`. Edit here, never inside the installed blocks.
4
+ `~/.codex/AGENTS.md` by the installer and `init-agent-os global`. Edit here, never inside the
5
+ installed blocks. Everything above `## Development workflows` is the core policy; the installer adds
6
+ that section only when `agent-os-dev` is installed.
5
7
 
6
8
  ## Core policy
7
9
 
@@ -22,34 +24,65 @@ Rules:
22
24
  - Keep scope and diffs narrow; when work drifts beyond the task, flag it instead of building on.
23
25
  - Escalate only product decisions that cannot be resolved from context and would materially change
24
26
  the outcome. Make reversible implementation choices and report them.
25
- - Use the Git identity configured by the repository or current session. Never add AI attribution or `Co-Authored-By` trailers.
26
27
  - Respond in the language used by the user. Code, commits, and technical artifacts are English unless the project says otherwise.
27
28
  - Lead with the outcome: the first sentence answers "what happened" or "what did you find". Supporting detail comes after.
28
29
  - Readable beats brief: shorten by leaving out what does not change the reader's next step, not by compressing language. Full sentences; no arrow chains, fragment style, or invented shorthand the reader must decode.
29
- - Never force the reader to cross-reference labels or numbering invented earlier in the text — say what you mean in place.
30
+ - Plain voice in every reply and every text you write: each sentence carries a fact, an instruction,
31
+ or a number. Cut claims with no source or mechanism, promotional adjectives, filler openers,
32
+ restated questions, stacked hedges, abstract metaphors in place of the concrete noun, structure
33
+ forced onto the content (ideas in threes, "not just X but Y", bold labels that repeat their line),
34
+ and closing offers of help. State a claim that stays unverified after checking once, plainly. No
35
+ dashes in running text. Established technical terms stay in English in any language. Never rewrite
36
+ code, identifiers, structured data, quoted source material, or the user's own prose unless asked.
37
+ The `plain-voice` skill holds the full checklist for documentation, commits, and pull request text.
38
+ - Never force the reader to cross-reference labels or numbering invented earlier in the text; say what you mean in place.
30
39
  - Explanations belong in prose; tables only for short enumerable facts.
31
40
  - Calibrate tone to the topic: playfulness is fine, neutral and factual the moment the subject is serious. When in doubt, it is serious.
32
- - Orchestration is opt-in: `guide-me`, `chart-work`, `shape-work`, `batch-work`, `deliver-work`,
33
- `dispatch-next`, `init-agent-os`, `understand-work`, `explain-work`, and `record-lesson` exist for
34
- planned work; invoke them through the name exposed by the host (`/guide-me` for direct Claude
35
- skills, `/agent-os:guide-me` for the Claude plugin, or `$guide-me` for Codex). Never self-invoke
36
- them. One exception: a workflow may continue into the workflow its exit contract names once the
37
- developer approves that exit or the existing request already authorizes that continuation, as
38
- `guide-me` does after its approved plain-language gate. The
39
- automatic `check-work` review workflow is also available from supported implicit review requests;
40
- its report mode is read-only and its fix mode requires explicit authority.
41
-
41
+ - Orchestration is opt-in: manual agent-os skills such as `capture-intent`, `plan-work`,
42
+ `explain-work`, `record-lesson`, and `list-skills` run only when invoked through the name the host
43
+ exposes (`/plan-work` for direct Claude skills, `/agent-os-core:plan-work` for the Claude plugin,
44
+ or `$plan-work` for Codex). Never self-invoke them or any other manual agent-os skill. Planning
45
+ depth is chosen internally by plan-work, and its use does not add a general summary approval gate.
46
+ Planning alone never starts implementation.
42
47
  - Always recommend one concrete next action when planning or a delivery unit ends, with the reason
43
- it wins and any blocker. Continuing sequentially through already shaped issues is allowed when
44
- the active implementation request covers that bounded set. Planning alone never starts delivery;
45
- parallel batch execution still requires explicit selection. Existing authority persists across
46
- unit boundaries, but never expands to unrelated backlog work. If the goal is complete and no
47
- useful next action remains, say so instead of manufacturing work.
48
+ it wins and any blocker. Existing authority persists across unit boundaries, but never expands to
49
+ unrelated backlog work. If the goal is complete and no useful next action remains, say so instead
50
+ of manufacturing work.
51
+ - Scope has two independent axes: classify discoveries as required, adjacent, or unrelated to the
52
+ mission, then classify the work as covered by the existing mandate or requiring a new decision or
53
+ external action. Risk guides implementation and verification and can reveal a missing decision;
54
+ risk-area membership does not grant permission. Required covered work normally stays in scope,
55
+ while adjacent work is a follow-up and unrelated work gets no invented proposal.
56
+ - No skill grants external tracker write access automatically. An explicit tracker mandate in the
57
+ request or the project policy's `## Tracker mandate` section may include implementation detail and
58
+ technical ordering/readiness inside the authorized set, but not acceptance changes, new owners or
59
+ deliveries, or closure. Without that mandate, keep corrections local and report the unsynced delta.
60
+ - Decisions that outlive a session live in versioned files: `intents/<id>/intent.md` for what is
61
+ needed and why, and `spec.md` beside it for behavior, interface, boundaries, decisions, and
62
+ ground truth. They change only through a reviewed change, and a file whose `built_on` revision
63
+ is older than its source is stale until it is reconsidered.
48
64
 
49
- ## Preferences (seed defaults — project policy overrides)
65
+ ## Preferences (seed defaults; project policy overrides)
50
66
 
51
67
  - UI feedback under ~250 ms; feedback must not block the next interaction.
52
68
  - Own design identity; do not imitate the look of well-known apps.
53
69
  - Every repo keeps a living project policy (planning surface, design system location, verify
54
70
  commands, conventions, gotchas, and delivery defaults). It grows over time; `init-agent-os`
55
71
  seeds it and `record-lesson` grows it.
72
+
73
+ ## Development workflows
74
+
75
+ - Use the Git identity configured by the repository or current session. Never add AI attribution or `Co-Authored-By` trailers.
76
+ - The development skills `design-work`, `shape-work`, `deliver-work`, `batch-work`, `dispatch-next`,
77
+ `simplify`, and `init-agent-os` are manual too (`/agent-os-dev:deliver-work` for the Claude
78
+ plugin). Existing authority may continue into the workflow a skill's exit contract names, as
79
+ `plan-work` does into `design-work`. Continuing sequentially
80
+ through already shaped units is allowed when the active implementation request covers that bounded
81
+ set; parallel batch execution still requires explicit selection. The automatic `check-work` review
82
+ workflow is also available from supported implicit review requests; its report mode is read-only
83
+ and its fix mode requires explicit authority.
84
+ - `plan.md` beside a spec lists delivery units and dependencies only. Delivery status is never
85
+ written into it: a unit is claimed by a draft pull request whose body carries
86
+ `Intent-Unit: <intent-id>/<unit-key>`, and status is read from open and merged pull requests.
87
+ - Agent OS hooks read `.agent-os/guards.json`. A hook block is a boundary, not an obstacle: change
88
+ course or ask, and never work around it by another tool or path.
package/hooks/hooks.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "description": "Agent OS quality-ratchet lifecycle hook.",
3
- "hooks": {
4
- "Stop": [
5
- {
6
- "hooks": [
7
- {
8
- "type": "command",
9
- "command": "node \"${CLAUDE_PLUGIN_ROOT}/skills/quality-ratchet/scripts/quality-delta.mjs\" hook --agent-os-hook=quality-ratchet",
10
- "commandWindows": "powershell.exe -NoProfile -NonInteractive -EncodedCommand JAByAHUAbgBuAGUAcgAgAD0AIABKAG8AaQBuAC0AUABhAHQAaAAgACQAZQBuAHYAOgBQAEwAVQBHAEkATgBfAFIATwBPAFQAIAAnAHMAawBpAGwAbABzAFwAcQB1AGEAbABpAHQAeQAtAHIAYQB0AGMAaABlAHQAXABzAGMAcgBpAHAAdABzAFwAcQB1AGEAbABpAHQAeQAtAGQAZQBsAHQAYQAuAG0AagBzACcAOwAgAG4AbwBkAGUAIAAkAHIAdQBuAG4AZQByACAAaABvAG8AawAgAC0ALQBhAGcAZQBuAHQALQBvAHMALQBoAG8AbwBrAD0AcQB1AGEAbABpAHQAeQAtAHIAYQB0AGMAaABlAHQA",
11
- "timeout": 10
12
- }
13
- ]
14
- }
15
- ]
16
- }
17
- }
@@ -1,42 +0,0 @@
1
- ---
2
- name: chart-work
3
- description: Charts broad work as a parallel graph of evidence-backed decision tickets. User-invoked when an effort spans several decision threads or sessions. Not for one bounded choice or decision-ready implementation.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Chart work
8
-
9
- Turn fog into decision tickets that can move independently. The ticket is canonical; the map is an
10
- index that can be repaired from its children.
11
-
12
- Read project policy and [references/map.md](references/map.md). Use
13
- [references/elicitation.md](references/elicitation.md) for developer decisions and
14
- [references/prototypes.md](references/prototypes.md) when a solution-changing uncertainty may be
15
- settled by an experiment. Choose that evidence path proactively; do not make prototypes mandatory.
16
-
17
- ## Chart
18
-
19
- Name the destination and boundaries. Create tickets for precise questions, leave immature unknowns
20
- in Fog, connect dependencies, and expose the open unblocked frontier. The invocation authorizes
21
- writes to the configured planning surface. Report the resulting parallel starts.
22
-
23
- Recommend one frontier action using project priorities, uncertainty reduced, and downstream work
24
- unlocked relative to effort. Explain why it wins; a list of unblocked tickets is not a recommendation.
25
-
26
- ## Resolve
27
-
28
- Read and claim one open frontier ticket by default; explicit parallel execution may claim several
29
- independent tickets in separate contexts. Produce evidence, record the decision and consequence,
30
- then update the map without overwriting concurrent work. Human preference evidence must come from
31
- the developer; the agent may recommend and challenge but cannot invent the answer.
32
-
33
- When a branch becomes bounded enough for one `shape-work` session, create or reuse one linked
34
- handoff containing settled decisions and remaining questions. This moves the branch to shaping; it
35
- does not make the branch delivery-ready. Shape-work later creates the implementation issues and
36
- reconciles their links and frontier into the map. A selected branch in shaping keeps the map open.
37
- Close the decision map only when every selected path is delivery-ready, parked, or ruled out and no
38
- Fog remains.
39
-
40
- Planning writes do not imply product implementation. Side discoveries become child decisions,
41
- ordinary backlog items, shaping handoffs, or parked paths rather than hidden scope expansion.
42
- Isolated prototype artifacts follow the authority and stop conditions in the prototype reference.
@@ -1,25 +0,0 @@
1
- # Elicitation and evidence
2
-
3
- Ask for the smallest evidence that can settle the active ticket.
4
-
5
- ## Developer choice
6
-
7
- Follow the questioning loop in [understand-work](../../understand-work/SKILL.md). When words are
8
- insufficient, use a prototype.
9
-
10
- ## Research
11
-
12
- Use repository evidence, primary sources, or direct measurements. Cite the decisive source or
13
- observation and state uncertainty that could change the decision.
14
-
15
- ## Prototype
16
-
17
- Follow [prototypes.md](prototypes.md). Separate observed behavior from the developer's judgment.
18
-
19
- ## Prerequisite task
20
-
21
- Do only the prerequisite needed to make the decision stateable. Record the result and the question
22
- it unlocked.
23
-
24
- Do not treat silence, momentum, or approval of a larger bundle as an answer to a specific product
25
- choice.
@@ -1,84 +0,0 @@
1
- # Decision map
2
-
3
- The configured planning surface owns the map and its tickets. With no project convention, use:
4
-
5
- ```text
6
- planning/<map-slug>/map.md
7
- planning/<map-slug>/decisions/<ticket-slug>.md
8
- planning/<map-slug>/shape-work/<branch-key>.md
9
- ```
10
-
11
- ## Map
12
-
13
- Keep the map low-resolution and rebuildable from its tickets:
14
-
15
- ```text
16
- ## TLDR
17
- ## Destination
18
- ## Boundaries
19
- ## Decisions
20
- - <ticket> → <decision gist> (<link>)
21
- ## Fog
22
- ## Shaping handoffs
23
- - <branch> → <shape-work handoff> (<link>)
24
- ## Delivery-ready branches
25
- - <branch> → <implementation issues and frontier> (<links>)
26
- ## Spawned work
27
- ```
28
-
29
- The map orients. It does not duplicate ticket evidence. `## TLDR` holds the approved plain-language
30
- summary when the map originates from `guide-me`; omit the section otherwise.
31
-
32
- ## Decision tickets
33
-
34
- Every ticket states one question, why it matters, the evidence needed, and its dependencies. Choose
35
- the evidence path that fits:
36
-
37
- - `research`: repository evidence, primary sources, or measurements;
38
- - `prototype`: a comparison that makes the contested behavior observable;
39
- - `grilling`: a product trade-off the developer must decide;
40
- - `task`: a prerequisite needed before the decision can be stated.
41
-
42
- An open, unblocked, unclaimed ticket is on the frontier. Claim before working and re-read live state
43
- before writing. Independent frontier tickets may run in parallel; each worker writes its own ticket.
44
-
45
- Resolve a ticket with:
46
-
47
- ```text
48
- ## Decision
49
- ## Evidence
50
- ## Rejected alternatives
51
- ## Consequence
52
- ## New work
53
- ## Open risks
54
- ```
55
-
56
- Evidence must support the decision. Route new findings as child decisions, ordinary backlog work,
57
- shaping handoffs, or parked paths.
58
-
59
- ## Shape-work handoff
60
-
61
- When a branch's remaining product choices fit one bounded session, create or reuse a handoff.
62
- Identity is `(origin map, branch key)`:
63
-
64
- ```text
65
- ## Shape-work handoff
66
- Origin map: <link or id>
67
- Branch key: <stable key>
68
-
69
- ## Outcome
70
- ## Boundaries
71
- ## Settled decisions
72
- ## Evidence and prototypes
73
- ## Questions left
74
- ```
75
-
76
- Search before creating so retries reuse the same handoff. Link it from the map and relevant source
77
- tickets. Update links idempotently and preserve concurrent entries. The handoff moves the branch to
78
- shaping, not to `delivery-ready`. After shaping, `shape-work` creates or reuses the implementation
79
- issues, records the ready or blocked frontier, and moves the branch to Delivery-ready branches. A
80
- planning handoff or implementation issue does not authorize product implementation; a later
81
- implementation request does.
82
-
83
- A selected branch in shaping keeps the map open. Close it only when selected paths are
84
- delivery-ready, parked, or ruled out and no Fog remains.
@@ -1,12 +0,0 @@
1
- ---
2
- name: deliver-work
3
- description: Delivers one decision-ready change against explicit boundaries and ground truth. User-invoked for implementation, including as a batch worker. Not for exploration or specification-only work.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Deliver work
8
-
9
- Read [workflow.md](workflow.md), then execute its contract. The invocation grants authority to change
10
- repository files inside the requested scope. It does not grant authority to choose unresolved product
11
- behavior or to merge, deploy, perform destructive cleanup, or affect external systems unless the
12
- request or project policy includes those actions.
@@ -1,24 +0,0 @@
1
- ---
2
- name: diagnose-before-fix
3
- description: Finds the root cause of reproducible technical failures before code is changed. It activates when investigating a bug, regression, failing test, crash, or unexpected behavior whose cause is not yet established, before proposing or applying a fix. It skips known-cause mechanical edits, feature implementation, general review, and post-fix verification.
4
- ---
5
-
6
- # Diagnose before fix
7
-
8
- Find the smallest supported explanation that accounts for the failure and predicts a useful check.
9
-
10
- ## Contract
11
-
12
- - **Ground truth:** the narrowest reliable reproduction or observed failure.
13
- - **Working surface:** tests, diagnostics, logs, and instrumentation inside the task scope.
14
- - **Boundary:** do not commit a production fix whose causal story is still guesswork.
15
-
16
- ## Loop
17
-
18
- Reproduce, reduce, trace the nearest seam, and compare plausible causes with high-information checks.
19
- Use temporary instrumentation when it helps. Once evidence supports a cause, implement the smallest
20
- fix and add a regression check when practical. Re-run the original failing path.
21
-
22
- If the failure cannot be reproduced or competing explanations cannot be distinguished, report the
23
- bounded uncertainty and the next discriminating check. Do not turn a plausible hypothesis into a
24
- confirmed diagnosis.
@@ -1,27 +0,0 @@
1
- ---
2
- name: explain-work
3
- description: Explains the current task or plan in plain language with no technical vocabulary, so the developer can judge it beyond the jargon. User-invoked directly or as the closing gate of guide-me. Not a substitute for technical review or verification.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Explain work
8
-
9
- Say what the work solves as if the reader knows no technical terms — then let the developer judge
10
- it.
11
-
12
- ## The summary
13
-
14
- Cover, in everyday language: the problem it solves, who feels that problem, what changes in their
15
- day when it works, and what it deliberately will not do. No technical vocabulary at all — if the
16
- summary cannot stand without a technical term, the understanding is not finished; go back and
17
- understand before explaining. Keep it short enough to read in under a minute: a TLDR, not a report.
18
-
19
- ## The gate
20
-
21
- Present the summary and ask the developer to approve or challenge it. A challenge means the
22
- understanding was wrong somewhere: name what was misunderstood and reopen the questioning or the
23
- plan at that point rather than defending the summary. Under guide-me, approval closes the gate and
24
- the summary becomes the `## TLDR` at the top of the receiving planning artifact.
25
-
26
- Standalone, explain-work can run against any plan, diff, or pull request; the deliverable is the
27
- plain-language summary itself and the developer's verdict on it.
@@ -1,36 +0,0 @@
1
- ---
2
- name: guide-me
3
- description: Guides the developer from a vague desire to work they did not know they wanted, through questioning and a plain-language gate, then continues into chart-work or shape-work. User-invoked when the developer cannot yet state what they want. Not for bounded choices, mapped decision work, or implementation-ready requests.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # Guide me
8
-
9
- Take a developer who cannot yet state what they want to an approved goal and into the right
10
- planning workflow. Guide-me writes no product code and no implementation issues.
11
-
12
- ## Understand
13
-
14
- Run the questioning loop in [understand-work](../understand-work/SKILL.md) until the goal stops
15
- moving or the developer says it is done.
16
-
17
- ## Explain
18
-
19
- Run the plain-language gate in [explain-work](../explain-work/SKILL.md) on the settled
20
- understanding. A challenge reopens understand-work at the misunderstood point. Do not continue
21
- without an approved summary.
22
-
23
- ## Continue
24
-
25
- The approved summary decides the route:
26
-
27
- - several independent decision threads → continue into `chart-work`;
28
- - one bounded idea with material product choices left → continue into `shape-work`;
29
- - something already small and clear → hand the developer a ready-to-send direct request instead of
30
- a workflow.
31
-
32
- The developer's approval at the gate is the opt-in for this continuation. Announce the route, then
33
- proceed with the approved summary and the settled understanding as the handoff. Place the approved
34
- summary as a `## TLDR` at the top of the artifact the next workflow creates, so the map or shape
35
- opens with what the work solves in plain language. Ruled-out directions and open questions travel
36
- with the handoff; nothing already answered is asked again.
@@ -1,54 +0,0 @@
1
- ---
2
- name: init-agent-os
3
- description: Sets up agent-os globally on a machine, or initializes a repo's living project policy through an interview. User-invoked only, at machine setup or when onboarding a repo. Not for ordinary tasks.
4
- disable-model-invocation: true
5
- ---
6
-
7
- # init-agent-os
8
-
9
- The invocation authorizes setup writes for the named target. Use one mode per run.
10
-
11
- ## Mode: `global` (once per machine)
12
-
13
- Invoked as `init-agent-os global`.
14
-
15
- 1. Verify the plugin is visible on this platform (skills listed under the `agent-os` namespace). Report what you find.
16
- 2. Run `scripts/policy-block.ps1 -Check` and report drift between `policy.md` and the managed blocks in `~/.claude/CLAUDE.md` and `~/.codex/AGENTS.md`.
17
- 3. Run `scripts/policy-block.ps1` to apply the managed blocks and show the resulting diff. This
18
- deterministic writer shares its marker contract with the npm installer's policy writer.
19
-
20
- ## Mode: repo init (default)
21
-
22
- Invoked in a repo working directory. Read [repository-init.md](references/repository-init.md)
23
- for the detailed contract.
24
-
25
- 1. Inspect broadly before asking: instruction and policy surfaces, README and docs, package/build
26
- files, test and CI configuration, and evidence of conditional areas. Before writing, every live
27
- host-consumed policy surface must have unambiguous ownership and precedence. Shared identical
28
- content or a clear canonical cross-reference is sufficient; do not select one file while
29
- conflicting applicable rules remain elsewhere. If target ownership cannot be resolved, ask one
30
- ownership question and block the write.
31
- 2. Maintain a transient completeness ledger while working. Every applicable material field ends as
32
- repository-evidenced or confirmed, `N/A`, explicitly deferred/open, or conflicting. Do not
33
- guess through a conflict, and do not write the ledger or interview history to the policy.
34
- 3. Before writing, each mandatory core field must reach one allowed terminal state: repository-
35
- evidenced or confirmed, `N/A`, explicitly deferred/open, or conflicting. The core covers policy
36
- ownership and canonical instruction surface; delivery boundary, stopping point, and external
37
- effects; verification and ground truth, including when commands are insufficient; planning
38
- identities, readiness, and dependencies; and maintenance of durable lessons and gotchas. Only
39
- an unresolved policy ownership/write-target conflict blocks writing; other explicit deferrals
40
- may be written concisely under **Open setup questions**.
41
- 4. Activate only conditional modules supported by repository evidence: frontend/design/rendered QA;
42
- package/release/docs; CI/deploy; auth/security/billing/external writes; database/migration/
43
- concurrency; batch/monorepo; and native/desktop. Omit inactive modules from the output.
44
- 5. Ask only unresolved material questions, one at a time, with a recommendation and consequence.
45
- Explicit deferral is an answer: record it under **Open setup questions** without inventing a
46
- default. Do not ask feature-specific outcome, acceptance, or UI-product questions.
47
- 6. Write only durable behavior-changing defaults and relevant sections to the resolved existing
48
- instruction surface, or a new `policy.md` when none exists. Preserve unrelated instructions,
49
- show the resulting diff, and do not request a second approval for this setup write.
50
-
51
- Block handling remains deterministic: add one missing block, update only well-formed managed content,
52
- and stop on duplicate or malformed markers. Global mode touches no repository files; repo mode
53
- touches one repository. The direct request or recorded delivery defaults govern merge and deploy
54
- actions.