@joenandez/academy 0.4.0 → 0.5.13

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 (122) hide show
  1. package/.claude-plugin/marketplace.json +5 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/CHANGELOG.md +415 -0
  4. package/README.md +67 -122
  5. package/hooks/backstory/.claude-plugin/plugin.json +11 -0
  6. package/hooks/backstory/LICENSE +21 -0
  7. package/hooks/backstory/SOURCE +2 -0
  8. package/hooks/backstory/bin/backstory +9 -0
  9. package/hooks/backstory/hooks/hooks.json +45 -0
  10. package/hooks/backstory/scripts/knowledge.mjs +87 -0
  11. package/hooks/backstory/scripts/memory.mjs +685 -0
  12. package/hooks/backstory/scripts/tool-tick.mjs +1 -0
  13. package/hooks/backstory/skills/capture/SKILL.md +71 -0
  14. package/hooks/backstory/skills/capture/references/knowledge-capture-input.json +16 -0
  15. package/hooks/backstory/skills/capture/references/tagging-policy.md +29 -0
  16. package/hooks/backstory/skills/memory/SKILL.md +70 -0
  17. package/hooks/backstory/skills/setup/SKILL.md +85 -0
  18. package/hooks/context_metrics.mjs +67 -0
  19. package/hooks/hook_runtime.mjs +43 -2
  20. package/hooks/memory_bridge.mjs +286 -52
  21. package/hooks/memory_store.mjs +78 -26
  22. package/hooks/register_session.mjs +76 -14
  23. package/hooks/roque/.claude-plugin/plugin.json +6 -0
  24. package/hooks/roque/LICENSE +21 -0
  25. package/hooks/roque/SOURCE +1 -0
  26. package/hooks/roque/hooks.json +38 -0
  27. package/hooks/roque/package.json +3 -0
  28. package/hooks/roque/roque.js +1690 -0
  29. package/hooks/sync_memory.mjs +11 -7
  30. package/package.json +10 -3
  31. package/scripts/cli/agent-gate.mjs +70 -0
  32. package/scripts/cli/agent-id.mjs +37 -0
  33. package/scripts/cli/archive.mjs +39 -38
  34. package/scripts/cli/archived.mjs +4 -2
  35. package/scripts/cli/args-kinds.mjs +33 -0
  36. package/scripts/cli/args-notes.mjs +42 -0
  37. package/scripts/cli/args-owner.mjs +37 -0
  38. package/scripts/cli/args-run.mjs +38 -0
  39. package/scripts/cli/args.mjs +47 -104
  40. package/scripts/cli/beads.mjs +57 -0
  41. package/scripts/cli/codex.mjs +66 -12
  42. package/scripts/cli/core.mjs +117 -41
  43. package/scripts/cli/create.mjs +224 -76
  44. package/scripts/cli/curator-feed-codex.mjs +81 -0
  45. package/scripts/cli/curator-feed-observations.mjs +97 -0
  46. package/scripts/cli/curator-feed-scope.mjs +124 -0
  47. package/scripts/cli/curator-feed-sources.mjs +172 -0
  48. package/scripts/cli/curator-feed.mjs +318 -0
  49. package/scripts/cli/default-name.mjs +73 -0
  50. package/scripts/cli/doctor.mjs +67 -2
  51. package/scripts/cli/eventlog.mjs +6 -2
  52. package/scripts/cli/exit-code.mjs +9 -0
  53. package/scripts/cli/first-run.mjs +115 -0
  54. package/scripts/cli/heartbeat.mjs +135 -0
  55. package/scripts/cli/helm-skip.mjs +20 -0
  56. package/scripts/cli/hire-headless.mjs +37 -22
  57. package/scripts/cli/hire.mjs +8 -2
  58. package/scripts/cli/inspect.mjs +36 -18
  59. package/scripts/cli/lifecycle.mjs +95 -49
  60. package/scripts/cli/main.mjs +32 -2
  61. package/scripts/cli/memory-env.mjs +124 -0
  62. package/scripts/cli/migrate.mjs +13 -7
  63. package/scripts/cli/next-steps.mjs +13 -0
  64. package/scripts/cli/nightly-launch.mjs +118 -0
  65. package/scripts/cli/nightly.mjs +228 -0
  66. package/scripts/cli/notes.mjs +58 -8
  67. package/scripts/cli/owner-config.mjs +181 -0
  68. package/scripts/cli/owner-jobs.mjs +201 -0
  69. package/scripts/cli/prompt-append.mjs +135 -0
  70. package/scripts/cli/rename.mjs +90 -109
  71. package/scripts/cli/run-context.mjs +50 -0
  72. package/scripts/cli/run.mjs +236 -79
  73. package/scripts/cli/scaffold.mjs +119 -126
  74. package/scripts/cli/schedule-errors.mjs +70 -0
  75. package/scripts/cli/sessions.mjs +10 -3
  76. package/scripts/cli/skills-check.mjs +147 -0
  77. package/scripts/cli/skills.mjs +170 -0
  78. package/scripts/cli/start.mjs +201 -0
  79. package/scripts/cli/templates.mjs +119 -45
  80. package/scripts/cli/tldr.mjs +184 -0
  81. package/scripts/cli/toml-string.mjs +76 -0
  82. package/scripts/cli/user-work-view.mjs +48 -0
  83. package/scripts/cli/writable-dirs.mjs +23 -0
  84. package/scripts/cli/yaml.mjs +1 -1
  85. package/skills/hire/SKILL.md +112 -100
  86. package/skills/hire/references/owner.md +68 -0
  87. package/templates/agents/claude-code/knowledge-curator.md +5 -2
  88. package/templates/agents/codex/knowledge-curator.toml +2 -1
  89. package/templates/operating-model/base.md +78 -0
  90. package/templates/operating-model/owner.md +11 -0
  91. package/templates/operating-model/principal.md +9 -0
  92. package/templates/operating-model/specialist.md +9 -0
  93. package/templates/packs/owner/craft.md +32 -0
  94. package/templates/packs/owner/identity.md +13 -0
  95. package/templates/packs/owner/mandate.md +26 -0
  96. package/templates/packs/owner/owner/SKILL.md +118 -0
  97. package/templates/packs/owner/owner-feedback/SKILL.md +49 -0
  98. package/templates/packs/owner/owner-heartbeat/SKILL.md +35 -0
  99. package/templates/packs/owner/owner-nightly/SKILL.md +114 -0
  100. package/templates/packs/owner/owner-review/SKILL.md +70 -0
  101. package/templates/packs/owner/owner-work/SKILL.md +53 -0
  102. package/templates/packs/principal/craft.md +27 -0
  103. package/templates/packs/principal/identity.md +13 -0
  104. package/templates/packs/principal/mandate.md +23 -0
  105. package/templates/packs/principal/principal-brief/SKILL.md +44 -0
  106. package/templates/packs/principal/principal-intro/SKILL.md +95 -0
  107. package/templates/packs/principal/principal-nightly/SKILL.md +152 -0
  108. package/templates/skills/check-in/SKILL.md +34 -24
  109. package/templates/skills/knowledge-curation/SKILL.md +89 -48
  110. package/templates/skills/local-rules/SKILL.md +86 -0
  111. package/templates/skills/nightly-consolidation/SKILL.md +131 -100
  112. package/templates/skills/skill-method/SKILL.md +79 -0
  113. package/templates/skills/user-nightly/SKILL.md +143 -0
  114. package/templates/skills/work-graph/SKILL.md +75 -0
  115. package/conformance/README.md +0 -60
  116. package/conformance/discovery.test.mjs +0 -140
  117. package/conformance/envelope.test.mjs +0 -185
  118. package/conformance/error-codes.test.mjs +0 -125
  119. package/conformance/harness.mjs +0 -180
  120. package/conformance/identity.test.mjs +0 -125
  121. package/docs/integration-guide.md +0 -1042
  122. package/templates/skills/self-update/SKILL.md +0 -121
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: local-rules
3
+ layer: craft
4
+ description: Use when the user tells {{agent_name}} how to work — format, cadence, approvals, what to do or stop doing — in any message. Records the feedback at once as a local rule that overrides package skill instructions, and proposes it for every agent of this kind when it is general.
5
+ ---
6
+
7
+ # Local Rules
8
+
9
+ A local rule is the user's own rule for how {{agent_name}} works. It applies at
10
+ the next action; the user never waits for a package release. Rules in
11
+ local-rules.md override any package skill instruction.
12
+
13
+ - Local rules: `{{local_rules_path}}` (already in your session context)
14
+ - Proposal queue for this kind: `{{proposals_dir}}`
15
+ - Pack version: `{{pack_version}}`
16
+
17
+ ## Detect Loop Feedback
18
+
19
+ Loop feedback says how to work, not what the answer to this task is. It arrives
20
+ in ordinary messages; the user does not say "rule". Examples:
21
+
22
+ - "Lead with the recommendation."
23
+ - "Do not ask for approval to research."
24
+ - "Stop sending a summary after every step."
25
+ - "From now on...", "always...", "never...", "that is not how I want you to..."
26
+
27
+ Not loop feedback: a domain or stakeholder fact, a one-off instruction for the
28
+ current task only, or a change to the mandate. Route those as your operating
29
+ model says: a fact about the user to `academy notes add --user`, other steering
30
+ to `academy notes add`, a Workstream to the `work-graph` skill.
31
+
32
+ ## Write The Rule At Once
33
+
34
+ Do this before the next action, not at a check-in or the nightly run.
35
+
36
+ 1. Open `{{local_rules_path}}`. If an entry already covers the same behavior,
37
+ edit that entry (text, Source, Date, Pack version). Never keep two entries
38
+ that contradict each other.
39
+ 2. Otherwise append one entry. Remove the `_(none yet)_` line on the first one.
40
+
41
+ ```
42
+ ## <the rule, one imperative sentence>
43
+ - Source: "<the user's message, quoted briefly>"
44
+ - Date: <YYYY-MM-DD, today>
45
+ - Pack version: {{pack_version}}
46
+ ```
47
+
48
+ 3. Write the rule so a later session can follow it without this conversation.
49
+ Add no commentary.
50
+ 4. Run `academy budget {{agent_name}} --json` and read the `local-rules` row.
51
+ If `withinCap` is `false`, merge or condense rules until it is within its
52
+ cap of 500, and keep each kept rule's Source, Date, and Pack version (on a
53
+ merge, keep the newest). Run the budget again to confirm. Only this skill
54
+ writes local-rules.md; the nightly run never trims it.
55
+ 5. Re-read the file and check the entry reads as intended.
56
+ 6. Confirm in one line — `Local rule saved: <rule>` — then continue the work
57
+ under the rule.
58
+
59
+ If the user withdraws a rule, delete its entry and confirm in one line.
60
+
61
+ ## Precedence
62
+
63
+ A local rule wins over any package skill instruction, this skill included.
64
+ Never edit a package skill file to apply a rule: Academy re-renders those on
65
+ every run. The rule lives only in local-rules.md.
66
+
67
+ ## Propose It For Every Agent Of This Kind
68
+
69
+ When the rule would help every agent of this kind — it is about how the loop
70
+ works in general and names no project, person, repo path, customer, or other
71
+ private detail — also file a proposal. Always write the local rule too; the
72
+ proposal never replaces it.
73
+
74
+ Write `{{proposals_dir}}/<timestamp>-{{agent_name}}.md`, with the timestamp from
75
+ `date -u +%Y%m%dT%H%M%SZ`. Create the directory if it is missing.
76
+
77
+ ```
78
+ # Proposal: <the rule>
79
+ - Agent: {{agent_name}}
80
+ - Source: "<the user's message, quoted>"
81
+ - Date: <YYYY-MM-DD>
82
+ - Pack version: {{pack_version}}
83
+ - Proposed rule: <the rule, written for every agent of this kind>
84
+ ```
85
+
86
+ Add `(proposed for every agent of this kind)` to the one-line confirmation.
@@ -1,13 +1,14 @@
1
1
  ---
2
2
  name: nightly-consolidation
3
- description: Use during {{agent_name}}'s scheduled nightly memory consolidation to update daily memory surfaces and write an observable dreams report.
3
+ layer: craft
4
+ description: Use during {{agent_name}}'s scheduled nightly memory consolidation to update work.md, graduate notes, and write an observable dreams report.
4
5
  ---
5
6
 
6
7
  # Nightly Consolidation
7
8
 
8
9
  This skill runs as {{agent_name}}'s nightly memory pass. It turns recent
9
10
  experience with the user into tighter next-day context without rewriting the
10
- agent's identity or job definition casually.
11
+ agent's identity or mandate casually.
11
12
 
12
13
  ## Agent Paths
13
14
 
@@ -17,13 +18,14 @@ write the nightly result.
17
18
 
18
19
  - Agent home: `{{agent_dir}}`
19
20
  - `identity.md`: `{{identity_path}}`
20
- - `role.md`: `{{role_path}}`
21
+ - `craft.md`: `{{craft_path}}`
22
+ - `mandate.md`: `{{mandate_path}}`
23
+ - `work.md`: `{{work_path}}`
21
24
  - `knowledge.md`: `{{knowledge_path}}`
22
- - `goals.md`: `{{goals_path}}`
23
- - `priorities.md`: `{{priorities_path}}`
24
- - `threads.md`: `{{threads_path}}`
25
25
  - `notes.md`: `{{notes_path}}`
26
- - `dailys.md`: `{{dailys_path}}`
26
+ - Shared, read only: `{{user_path}}`
27
+ - `user-work.md`: your share is in your prompt. Open the full file only when
28
+ you need the full catalog: `{{user_work_path}}`
27
29
  - Memory observations: `{{memory_observations_path}}`
28
30
  - Dreams directory: `{{dreams_dir}}`
29
31
  - This skill: `{{nightly_consolidation_path}}`
@@ -33,111 +35,137 @@ write the nightly result.
33
35
 
34
36
  Prepare tomorrow's version of the agent. The expected outputs are:
35
37
 
36
- - an updated `dailys.md` with the last 7 working-day summaries
37
- - conservative updates to `threads.md`, `notes.md`, and `priorities.md`
38
- - evidence-backed `knowledge.md` graduations applied by the dedicated curator
39
- - optional proposed changes for `goals.md`, `role.md`, `identity.md`,
40
- deferred `knowledge.md` candidates, or skills
38
+ - an updated `work.md`: Goals, Priorities, Focus, Workstreams, Open questions
39
+ - graduated or expired `notes.md` entries
40
+ - evidence-backed `knowledge.md` graduations and `craft.md` promotions applied
41
+ by the dedicated curator
42
+ - proposed changes for `identity.md`, `mandate.md`, deferred candidates, or
43
+ skills
41
44
  - a dreams report at `{{dreams_dir}}/MM-YY-DD.md`
42
45
 
43
46
  ## Source Material
44
47
 
45
48
  Use `{{memory_observations_path}}` as the primary source. It contains the
46
- observations recorded from this Academy agent's own sessions. Then use
47
- recent session context and gather only enough additional evidence to avoid
48
- guessing:
49
+ observations recorded from this Academy agent's own sessions. Then gather only
50
+ enough additional evidence to avoid guessing:
49
51
 
50
52
  1. Read today's observation JSONL from `{{memory_observations_path}}` if it
51
53
  exists.
52
54
  2. Read yesterday's observation JSONL when the nightly job may have run after
53
55
  midnight or the prior day was missed.
54
- 3. Search with concrete terms from recent work, the agent name, and active
55
- thread names when more evidence is needed.
56
- 4. Read previous dreams reports only when checking whether a recommendation is
56
+ 3. Search with concrete terms from recent work and the agent name when more
57
+ evidence is needed.
58
+ 4. Read Beads changes since the newest report to Workstreams and tasks you
59
+ touched: `bd list --type workstream --updated-after <date> --json`. Every
60
+ ready query adds `--exclude-type workstream`.
61
+ 5. Read previous dreams reports only when checking whether a recommendation is
57
62
  recurring or already handled.
58
63
 
64
+ An archive entry is pending until a dreams report lists it under
65
+ `{{report_consumed_field}}` (match `sessionId@timestamp`). Start from the
66
+ newest report; look further back only for entries older than what it
67
+ consumed. A late entry can carry an older timestamp than entries already
68
+ consumed, so never skip an entry for its age alone. Read the pending entries
69
+ in every archive file, including files from earlier dates.
70
+
59
71
  The agent-local observation archive is the required basis for this workflow.
60
- It is the only source that can establish eligibility. If the archive is empty,
61
- stop before editing any memory surface, delegating to the curator, or writing a
62
- dreams report.
72
+ It is the only source that can establish eligibility for observation work. With
73
+ no pending archive entries, skip observation work (steps 2-3). Still run the
74
+ curator on notes (steps 4-6), budget and trim (steps 7-10), and a short dreams
75
+ report with `Inputs: notes only`.
63
76
 
64
77
  {{memory_bridge_guidance}}
65
78
 
66
79
  ## Edit Boundaries
67
80
 
68
- Autonomous edits are allowed for:
81
+ One writer per file. Autonomous edits are allowed for:
69
82
 
70
- - `dailys.md`
71
- - `threads.md`
72
- - `notes.md`
73
- - `priorities.md`
83
+ - `work.md`
84
+ - `notes.md`: add transient notes, and (through the curator) graduate or expire
74
85
  - the nightly dreams report
75
86
 
76
87
  The nightly parent may add transient notes before delegation. Then the
77
88
  foreground `knowledge-curator` subagent receives exclusive ownership of
78
- `notes.md` and `knowledge.md` for the curation phase. The parent must wait for
79
- it to finish and must not edit either file during that phase.
89
+ `notes.md`, `knowledge.md`, `craft.md`, and `references/` for the curation
90
+ phase. The parent waits and edits none of them meanwhile.
80
91
 
81
92
  After the curator returns and manifest verification finishes, the parent may
82
- reduce `knowledge.md` and `notes.md` only to reduce size. It must never add
83
- content to either file, and it must never reverse a curator graduation
84
- decision. The parent may also reduce `priorities.md`, `threads.md`, and
85
- `dailys.md` during the post-curator budget phase. `identity.md`, `role.md`,
86
- and `goals.md` remain propose-only.
87
-
88
- Do not directly rewrite `identity.md`, `role.md`, `goals.md`, or skills from
89
- this workflow unless the user explicitly requested that specific change.
90
- Instead, put a proposal in the dreams report.
93
+ reduce `knowledge.md`, `notes.md`, and `work.md` only to reduce size. It must
94
+ never add content to `knowledge.md` or `notes.md`, never edit `craft.md`, and
95
+ never reverse a curator decision.
96
+
97
+ Propose only, in the dreams report: `identity.md`, `mandate.md`, and skills. Do
98
+ not rewrite them unless the user explicitly requested that change. Never write
99
+ `user.md` or `user-work.md`. If you learn a fact about the user, append it with
100
+ `academy notes add --user "..."`; the curator confirms it.
101
+
102
+ ## Graduation Rules
103
+
104
+ - `notes.md` to `knowledge.md` or `craft.md`: through the curator, when the
105
+ note becomes a reusable pattern. Outside this run, only for an explicit user
106
+ request; otherwise keep the note.
107
+ - `notes.md` to `mandate.md` or `identity.md`: propose only. Identity changes
108
+ only for durable principles or voice.
109
+ - `knowledge.md` to a skill: propose when "how to do this" becomes a
110
+ repeatable procedure.
111
+ - A note about the Academy system itself (a `system` proposal): run
112
+ `bd create "<title>" -t task -l academy-system -d "<note, agent, evidence>"`
113
+ (Beads is shared through `BEADS_DIR`). List it in the dreams report.
114
+ - Stale notes expire. Environment names go only to private files.
91
115
 
92
116
  ## Procedure
93
117
 
94
118
  1. Determine today's date and the dreams filename using `MM-YY-DD` format.
95
- 2. Review recent evidence: loaded context, the observation archive, current
96
- surfaces, and recent dreams reports if useful.
97
- 3. Write a concise daily entry for `dailys.md`. Keep only the last 7 working
98
- days. Each entry should capture work done, decisions, blockers, user
99
- steering, and the next useful step.
100
- 4. Reconcile `threads.md`:
101
- - mark completed work done or remove it from active attention
102
- - demote stale active items to idle or parked
103
- - add only concrete active pursuits with a next step
104
- 5. Add any new transient steering to `notes.md` before delegation. Do not
119
+ 2. Review recent evidence: loaded context, the observation archive, Beads
120
+ changes, current surfaces, and recent dreams reports if useful.
121
+ 3. Reconcile `work.md` with the same five sections in order:
122
+ - **Goals:** each an outcome with a measure, or the word qualitative.
123
+ - **Priorities:** 3-5, in order, each with a reason and its Beads id.
124
+ - **Focus:** what deserves attention now. Focus changes fast; priorities
125
+ change slowly. A busy day does not make a new priority.
126
+ - **Workstreams:** one line each, with its Beads id and state.
127
+ - **Open questions.**
128
+
129
+ Explicit user statements outrank inference. Never mark a Workstream active
130
+ on inference alone (see the `work-graph` skill). Keep `work.md` thin when
131
+ you are a Principal or Specialist: only work unique to you. Write a line
132
+ `Updated by {{agent_name}}'s nightly, <date>` under the title.
133
+ 4. Add any new transient steering to `notes.md` before delegation. Do not
105
134
  graduate or expire notes in the parent.
106
- 6. Reconcile `priorities.md` when recent evidence clearly changes next focus.
107
- Keep 3-5 priorities. Do not turn every unfinished task into a priority.
108
- 7. Invoke the foreground `knowledge-curator` subagent in Claude Code or
109
- `knowledge_curator` in Codex for the bounded knowledge-graduation phase.
110
- Tell it to use its preloaded `knowledge-curation` skill and confirm the
111
- contract at `{{knowledge_curation_path}}`; wait for it to finish and retain
112
- its application manifest.
113
- 8. Re-read `knowledge.md` and `notes.md` after the curator returns. Compare the
114
- files with its manifest. Do not edit either file during manifest
115
- verification. After verification, only the reduce-only budget edits in the
116
- following steps are allowed.
117
- 9. Run `academy budget {{agent_name}} --json`. The reply is the shared response
135
+ 5. Invoke the foreground `knowledge-curator` subagent in Claude Code or
136
+ `knowledge_curator` in Codex for the bounded graduation and promotion
137
+ phase. Tell it to use its preloaded `knowledge-curation` skill and confirm
138
+ the contract at `{{knowledge_curation_path}}`; wait for it to finish and
139
+ retain its application manifest.
140
+ 6. Re-read `knowledge.md`, `craft.md`, `notes.md`, and each `references/` file
141
+ the manifest names after the curator returns. Compare the files with its
142
+ manifest, and check that each named `references/` file has its `useWhen`
143
+ line in `knowledge.md`. Do not edit them during manifest verification.
144
+ 7. Run `academy budget {{agent_name}} --json`. The reply is the shared response
118
145
  envelope: `contract_version`, `ok`, `command`, then the report. Read
119
- `withinBudget`, `surfaces`, and `violations` from the top level. The command
120
- exits 0 for any answer it can compute, so read `ok` and `withinBudget`, never
121
- the exit status. Record the per-surface baseline estimate, cap, overage, and
122
- enforced/advisory verdict.
123
- 10. If no enforced surface is over cap, set Surface Budget status to `pass`.
124
- 11. If an enforced surface is over cap — `withinBudget` is `false`, or an entry
125
- in `violations` has `enforced: true` — trim reduce-only surfaces and re-run
126
- `academy budget {{agent_name}} --json`. The parent may reduce
127
- `knowledge.md` and `notes.md` only to reduce size, may reduce
128
- `priorities.md`, `threads.md`, and `dailys.md`, and must keep
129
- `identity.md`, `role.md`, and `goals.md` as proposals only.
130
- Repeat the trim and re-check cycle until every enforced surface passes or
131
- further reduction is not possible without violating the edit boundary.
132
- 12. Set Surface Budget status to `pass` only when all enforced surfaces pass.
133
- Status converging only when every still-blocking enforced surface has reduced its overage by at least 20% of that surface's baseline overage.
146
+ `surfaces` and `violations` from the top level; `withinBudget` counts
147
+ `local-rules`, so it is not the status gate. The command exits 0 for any
148
+ answer it can compute, so read `ok`, never the exit status. Record the
149
+ per-surface baseline estimate, cap, overage, and enforced/advisory verdict.
150
+ 8. If no enforced surface other than `local-rules` and `mandate.md` is over cap, set Surface Budget status to `pass`.
151
+ 9. If an enforced surface other than `local-rules` and `mandate.md` is over cap — its entry in
152
+ `violations` has `enforced: true` — trim reduce-only surfaces (`knowledge.md`,
153
+ `notes.md`, `work.md`) and re-run `academy budget {{agent_name}} --json`.
154
+ Do not edit `local-rules.md` or `mandate.md`. An over-cap `mandate.md`,
155
+ `identity.md`, `craft.md`, `user.md`, or `user-work.md`: record it under
156
+ Proposed Changes; it does not block `pass`. Repeat the trim and re-check cycle until every
157
+ enforced surface other than `local-rules` and `mandate.md` passes or further reduction is not
158
+ possible without violating the edit boundary.
159
+ 10. Set Surface Budget status to `pass` only when all enforced surfaces other than `local-rules` and `mandate.md` pass.
160
+ Status converging only when every enforced surface other than `local-rules` and `mandate.md` still over cap has reduced its overage by at least 20% of that surface's baseline overage.
134
161
  The 20% value is a minimum progress floor, not a maximum deletion limit.
135
162
  Status failed when neither pass nor the 20% convergence floor can be reached. Converging and failed are explicitly not success.
136
163
  Both recur on the next nightly run.
137
- 13. Write the dreams report, incorporating the curator manifest and Surface
164
+ 11. Write the dreams report, incorporating the curator manifest and Surface
138
165
  Budget results. Always write the dreams report on pass, converging, and
139
- failed, including curator failure.
140
- 14. End with a concise completion summary and include the dreams report path.
166
+ failed, including curator failure. Fill `## {{report_evidence_section}}`
167
+ from what this run actually read and edited.
168
+ 12. End with a concise completion summary and include the dreams report path.
141
169
  Name the Surface Budget status. Describe only `pass` as budget success;
142
170
  describe `converging` or `failed` as an unmet budget.
143
171
 
@@ -146,15 +174,16 @@ Instead, put a proposal in the dreams report.
146
174
  If the curator is unavailable, times out, fails, or does not return a valid
147
175
  manifest:
148
176
 
149
- - leave `knowledge.md` unchanged when the curator did not write it
177
+ - leave `knowledge.md` and `craft.md` unchanged when the curator did not write
178
+ them
150
179
  - preserve all source notes
151
180
  - do not apply the proposed edits yourself
152
- - finish `dailys.md`, `threads.md`, `priorities.md`, and the dreams report
181
+ - finish `work.md` and the dreams report
153
182
  - set the dreams report's Knowledge Graduation status to `failed` and record
154
183
  the exact reason under Verification
155
184
  - run `academy budget {{agent_name}} --json` once, populate every
156
185
  `## Surface Budget` row from the `surfaces` list in that envelope, and record
157
- `pass` when `withinBudget` is `true` or `failed` otherwise
186
+ `pass` when no enforced surface other than `local-rules` and `mandate.md` is over cap, else `failed`
158
187
  - mark budget trimming as skipped because the curator manifest was unavailable
159
188
 
160
189
  If the curator partially changed a file before failing, report the detected
@@ -172,20 +201,23 @@ Create or replace `{{dreams_dir}}/MM-YY-DD.md`:
172
201
  - Recent memory sources consulted:
173
202
  - Important gaps or unavailable sources:
174
203
 
204
+ ## {{report_evidence_section}}
205
+ - {{report_consumed_field}}: each consumed archive entry as `<file> <sessionId>@<timestamp>`
206
+ - {{report_changed_field}}: each memory surface this run edited, or None
207
+ - {{report_no_change_field}}: when no surface changed, the specific archive evidence that made no change correct; otherwise None
208
+
175
209
  ## Changes Made
176
- - `dailys.md`:
177
- - `threads.md`:
210
+ - `work.md`:
178
211
  - `notes.md`:
179
- - `priorities.md`:
180
212
 
181
213
  ## Knowledge Graduation
182
214
  - Status: completed | skipped | failed
183
215
 
184
216
  ### Applied
185
- - Decision: apply | consolidate | correct
217
+ - Decision: apply | consolidate | correct | promote
186
218
  - Candidate:
187
219
  - Evidence:
188
- - Knowledge section changed:
220
+ - Knowledge or craft section changed:
189
221
  - Source notes retired:
190
222
 
191
223
  ### Deferred
@@ -198,43 +230,42 @@ Create or replace `{{dreams_dir}}/MM-YY-DD.md`:
198
230
 
199
231
  ### Verification
200
232
  - `knowledge.md` re-read:
233
+ - `craft.md` re-read:
201
234
  - `notes.md` re-read:
202
235
  - Mismatches or partial failures:
203
236
 
204
237
  ## Proposed Changes
205
- - `goals.md`:
206
- - `role.md`:
207
238
  - `identity.md`:
239
+ - `mandate.md`: include an over-cap mandate
208
240
  - `knowledge.md`: deferred candidates requiring human judgment only
209
241
  - skills:
242
+ - `system` tasks created (title and Beads id), or None
210
243
 
211
244
  ## Surface Budget
212
245
  - Overall status: pass | converging | failed
213
- - `identity.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
214
- - `role.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
215
- - `knowledge.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
216
- - `goals.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
217
- - `priorities.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
218
- - `threads.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
219
- - `notes.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
220
- - `dailys.md`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
246
+ - One row per surface from `academy budget`: baseline estimate, final estimate, cap, final overage, and enforced/advisory verdict
247
+ - `local-rules.md`: report only
248
+ - `mandate.md`: report only
221
249
 
222
250
  ## Tomorrow
223
251
  - Recommended first move:
224
252
  - Watchouts:
225
253
  ```
226
254
 
255
+ `## {{report_evidence_section}}` is your checkpoint: the next nightly treats
256
+ every entry listed in `{{report_consumed_field}}` as consumed, so name every
257
+ entry you consumed. Fill either `{{report_changed_field}}` or
258
+ `{{report_no_change_field}}`. Academy does not read the report; it records only
259
+ how the run ended.
260
+
227
261
  Use `None` where no changes or proposals were warranted. The dreams report is
228
262
  for observability; it should be specific enough that the user can see why the
229
263
  agent will behave differently tomorrow.
230
264
 
231
- Advisory over-cap `identity.md`, `role.md`, and `goals.md` changes are
232
- proposals under `## Proposed Changes`, never edits.
233
-
234
265
  ## Anti-Patterns
235
266
 
236
- - Rewriting stable identity, role, or goals from one noisy day.
267
+ - Rewriting stable identity, mandate, or work from one noisy day.
237
268
  - Treating raw observations as permanent knowledge.
238
269
  - Making priorities a duplicate task list.
239
- - Letting `dailys.md` grow beyond 7 entries.
270
+ - Naming the user, a repo, a system, a person, or a product in `craft.md`.
240
271
  - Hiding skipped evidence or failed memory commands.
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: skill-method
3
+ layer: craft
4
+ description: Use when {{agent_name}} writes, edits, splits, or reviews a skill or reference file, or when `academy skills check` reports a warn or fail.
5
+ ---
6
+
7
+ # Skill Method
8
+
9
+ Skills are how {{agent_name}}'s operating loop and principles are enforced. A
10
+ rule that is not reachable from the entry point at the moment it applies does
11
+ not govern behavior. The token ceiling forces the question of where each rule
12
+ lives, so moved content still loads exactly when it is needed.
13
+
14
+ ## Routes
15
+
16
+ - **Use when writing or editing a skill or reference file:** follow Rules, then
17
+ run the check below before you finish.
18
+ - **Use when a file is at or over 80% of the ceiling:** follow Split, then run
19
+ the check.
20
+ - **Use when the nightly run reports a fail:** split or repair before any other
21
+ maintenance. Never raise the ceiling to make the check pass.
22
+
23
+ ## Rules
24
+
25
+ 1. **One entry point.** Each agent and each pack starts at a small router,
26
+ about 100 tokens, that names the high-order branches and nothing else.
27
+ 2. **Routes carry their condition.** Every link to a skill or reference has a
28
+ `useWhen` condition at the call site. A file name mentioned in prose is not
29
+ a route.
30
+ 3. **Branch by situation, not by topic.** The router branches on what the agent
31
+ is doing now (daily work, feedback, nightly, a decision), so each branch
32
+ loads only what that situation needs.
33
+ 4. **Skill, reference, knowledge.** A skill holds a procedure (how to do). A
34
+ reference holds facts and examples (what to know). knowledge.md holds mental
35
+ models (how to think).
36
+ 5. **A hard ceiling per file.** 2,000 tokens now, with a measured trial at
37
+ 1,500. The whole file counts, including frontmatter and routes, with one
38
+ agreed tokenizer.
39
+ 6. **Split before the ceiling.** At about 80% of the ceiling (1,600 tokens) the
40
+ agent must split. Raising the ceiling is not an option. First remove
41
+ duplication and sharpen conditions; then move detail behind a route.
42
+ 7. **Prohibitions load first.** A "never do X" rule lives on the route to X, so
43
+ it is loaded before the action it governs.
44
+ 8. **Bounded depth.** At most three hops from the entry router to any rule. No
45
+ cycles.
46
+ 9. **Every split is verified.** Map each original rule to its new home, check
47
+ that every route resolves, and check that each new condition covers the
48
+ situations the original covered.
49
+ 10. **Every skill sets a layer.** Put `layer: craft` or `layer: private` in the
50
+ frontmatter. `craft` is a general technique: it is copied when the agent is
51
+ forked or cloned, so it must not name a user, repo, system, person, or
52
+ product. `private` names the environment and is never copied. When unsure,
53
+ use `private`. A split keeps the layer of the original. `layer:` classifies
54
+ the skill's source. Package skills (rendered by Academy from `templates/`,
55
+ Owner pack included) are package-owned and regenerated for each agent. A
56
+ fork, clone, or template never copies a rendered package skill. It renders
57
+ the skill again from the package. Only skills the agent wrote are copied,
58
+ and only when they have `layer: craft`.
59
+
60
+ ## Split
61
+
62
+ 1. Remove duplication. Sharpen vague conditions.
63
+ 2. Still at or over 80%: move a procedure to its own skill, or facts and
64
+ examples to a reference file beside the skill. Put a `useWhen` route to it
65
+ where the moved content used to be. Move each prohibition with its action.
66
+ 3. Verify the split (rule 9). List each original rule and its new home.
67
+
68
+ ## Tokenizer
69
+
70
+ The one agreed tokenizer is Academy's `estimateTokens`: the larger of the
71
+ word-and-symbol chunk count and characters / 4. Bytes / 4 is a lower bound, so
72
+ a file that looks under the ceiling by bytes can still fail.
73
+
74
+ ## Check
75
+
76
+ Run `academy skills check {{agent_name}}` (add `--json` for a report). It
77
+ measures every SKILL.md and reference file in `.claude/skills/` and
78
+ `.agents/skills/`: `warn` at 1,600 tokens, `fail` over 2,000, exit 1 on any
79
+ fail.