@dtmd/temper 0.0.24 → 0.0.26

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 (70) hide show
  1. package/README.md +14 -12
  2. package/dist/src/assembly.d.ts +45 -11
  3. package/dist/src/assembly.js +116 -8
  4. package/dist/src/builtins.d.ts +436 -103
  5. package/dist/src/builtins.js +772 -167
  6. package/dist/src/claude-code.d.ts +6 -3
  7. package/dist/src/claude-code.js +2 -2
  8. package/dist/src/contract.d.ts +153 -44
  9. package/dist/src/contract.js +123 -34
  10. package/dist/src/counsel.d.ts +11 -0
  11. package/dist/src/counsel.js +68 -0
  12. package/dist/src/declarations.d.ts +108 -2
  13. package/dist/src/declarations.js +606 -100
  14. package/dist/src/dial.d.ts +3 -3
  15. package/dist/src/dial.js +21 -5
  16. package/dist/src/emit.d.ts +12 -14
  17. package/dist/src/emit.js +123 -47
  18. package/dist/src/generated/AbsenceGateRow.d.ts +16 -0
  19. package/dist/src/generated/AbsenceGateRow.js +2 -0
  20. package/dist/src/generated/AreaMode.d.ts +5 -0
  21. package/dist/src/generated/AreaMode.js +2 -0
  22. package/dist/src/generated/AreaRow.d.ts +20 -0
  23. package/dist/src/generated/AreaRow.js +1 -0
  24. package/dist/src/generated/AssemblyFactRow.d.ts +17 -4
  25. package/dist/src/generated/BoundRow.d.ts +9 -4
  26. package/dist/src/generated/CedeRow.d.ts +14 -0
  27. package/dist/src/generated/CedeRow.js +2 -0
  28. package/dist/src/generated/CharsetRow.d.ts +14 -3
  29. package/dist/src/generated/ClauseRow.d.ts +23 -21
  30. package/dist/src/generated/CollectionAddressRow.d.ts +1 -1
  31. package/dist/src/generated/Declarations.d.ts +24 -9
  32. package/dist/src/generated/FeatureValue.d.ts +3 -3
  33. package/dist/src/generated/Features.d.ts +3 -3
  34. package/dist/src/generated/KindFactRow.d.ts +41 -8
  35. package/dist/src/generated/Payload.d.ts +3 -5
  36. package/dist/src/generated/PayloadMember.d.ts +7 -0
  37. package/dist/src/generated/RunsRow.d.ts +17 -0
  38. package/dist/src/generated/RunsRow.js +2 -0
  39. package/dist/src/generated/Section.d.ts +2 -2
  40. package/dist/src/generated/SectionContainsRow.d.ts +1 -1
  41. package/dist/src/generated/TypecheckRow.d.ts +20 -0
  42. package/dist/src/generated/TypecheckRow.js +2 -0
  43. package/dist/src/generated/Verifier.d.ts +8 -2
  44. package/dist/src/generated/index.d.ts +6 -0
  45. package/dist/src/index.d.ts +20 -15
  46. package/dist/src/index.js +10 -9
  47. package/dist/src/kind.d.ts +382 -52
  48. package/dist/src/kind.js +461 -49
  49. package/dist/src/lockfile.d.ts +39 -0
  50. package/dist/src/lockfile.js +265 -0
  51. package/dist/src/member-address.d.ts +15 -3
  52. package/dist/src/member-address.js +23 -6
  53. package/dist/src/needs.d.ts +25 -15
  54. package/dist/src/needs.js +10 -11
  55. package/dist/src/patterns.d.ts +112 -0
  56. package/dist/src/patterns.js +90 -0
  57. package/dist/src/pipe.d.ts +16 -0
  58. package/dist/src/pipe.js +39 -0
  59. package/dist/src/playbook.d.ts +203 -0
  60. package/dist/src/playbook.js +239 -0
  61. package/dist/src/prose.d.ts +69 -12
  62. package/dist/src/prose.js +125 -13
  63. package/dist/src/reference.d.ts +70 -0
  64. package/dist/src/reference.js +368 -0
  65. package/package.json +13 -4
  66. package/schemas/agent.json +23 -0
  67. package/schemas/command.json +5 -0
  68. package/schemas/output-style.json +4 -0
  69. package/schemas/rule.json +33 -0
  70. package/schemas/skill.json +63 -0
package/README.md CHANGED
@@ -41,31 +41,33 @@ ordinary imports, and requirements are declared next to the members that fill
41
41
  them:
42
42
 
43
43
  ```ts
44
- import { emit, harness } from "@dtmd/temper";
44
+ import { harness, input, tool } from "@dtmd/temper";
45
45
  import { memory_CLAUDE } from "./memory/CLAUDE.ts";
46
46
  import { rule_collaboration } from "./rules/collaboration.ts";
47
47
  import { skill_captureFriction } from "./skills/capture-friction.ts";
48
48
 
49
- const program = harness({
49
+ const tsc = tool({ package: "typescript", bin: "tsc" });
50
+
51
+ export default harness({
52
+ typecheck: { tool: tsc, project: input(import.meta.url, "./tsconfig.json") },
50
53
  require: {
51
54
  "friction-capture-procedure": {
52
55
  prose: "an agent that hits harness friction needs a procedure for filing the capture",
53
56
  required: true,
54
57
  },
55
58
  },
56
- members: [memory_CLAUDE, rule_collaboration, skill_captureFriction],
59
+ members: [memory_CLAUDE, rule_collaboration, skill_captureFriction, tsc],
57
60
  });
58
-
59
- process.stdout.write(emit(program).seam);
60
61
  ```
61
62
 
62
- `temper emit` compiles the program into the projected `.claude/**` files and
63
- a lock, byte-for-byte reproducible; it verifies itself by emitting twice.
64
- `temper check` gates against the lock, so it can answer what fills each
65
- requirement and what would strand it. A hand edit to a generated file
66
- surfaces as drift routed to its authored source, never merged around. The SDK
67
- implements no semantics: every type erases at the seam, and the engine
68
- consumes only declared data, offline, no Node.
63
+ `temper emit` first runs the typecheck the program declares (its own compiler
64
+ over its own project, refusing on a type error), then compiles the program
65
+ into the projected `.claude/**` files and a lock, byte-for-byte reproducible;
66
+ it verifies itself by emitting twice. `temper check` gates against the lock,
67
+ so it can answer what fills each requirement and what would strand it. A hand
68
+ edit to a generated file surfaces as drift routed to its authored source,
69
+ never merged around. The SDK implements no semantics: every type erases at the
70
+ seam, and the engine consumes only declared data, offline, no Node.
69
71
 
70
72
  ## Documentation
71
73
 
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * The assembly — `harness()` takes the whole as one typed value: `Harness =
3
- * members · expect · require · settings · mode`. Like every SDK type it
3
+ * members · expect · admit · require · settings · mode · contract · typecheck`. Like every SDK type it
4
4
  * erases at the seam — the engine never sees the constructor, only the
5
5
  * declaration rows it compiles to. There is no second authoring surface: no
6
6
  * `temper.toml`, no roster/bindings dialect (the Decision rejects both);
7
7
  * composing partial harnesses is ordinary code.
8
8
  */
9
- import type { Member, KindDefinition } from "./kind.js";
10
- import type { Clause, Requirement } from "./contract.js";
9
+ import type { Input, Member, KindDefinition } from "./kind.js";
10
+ import type { Clause, Requirement, RequirementValue } from "./contract.js";
11
11
  /**
12
12
  * One `expect` binding — universal: every member of `kind` owes these clauses.
13
13
  * Keyed by the kind **value**, an import never a string; binding is implicit
@@ -37,6 +37,21 @@ export interface Admission {
37
37
  * only — the next report, never the session.
38
38
  */
39
39
  export type EnforcementMode = "note" | "warn" | "block";
40
+ /**
41
+ * The program's **typecheck** — the compiler `emit` runs over the program before running
42
+ * it, refusing on a type error with the compiler's own diagnostics. It is the consumer's
43
+ * own toolchain, declared and never guessed: `tool` is the composed {@link tool} member
44
+ * whose command runs the compiler (`tool({ package: "typescript", bin: "tsc" })` runs the
45
+ * program's own `node_modules/.bin/tsc`), and `project` is the project file it checks,
46
+ * stated as an {@link input} so a change to it marks the lock stale. Emit passes the
47
+ * compiler `--noEmit --project <project>`, and refuses a program that declares none.
48
+ */
49
+ export interface Typecheck {
50
+ /** The {@link tool} member that runs the compiler — composed in `members` like any tool. */
51
+ readonly tool: Member;
52
+ /** The project file the compiler checks — `input(import.meta.url, "./tsconfig.json")`. */
53
+ readonly project: Input;
54
+ }
40
55
  /** The composed harness — the root member's own fields, erased to rows at the seam. */
41
56
  export interface Harness {
42
57
  /** The member roster — the assembly's imports. */
@@ -45,10 +60,16 @@ export interface Harness {
45
60
  readonly expect: readonly ExpectBinding[];
46
61
  /** The embedded kinds each host kind's composed body admits, keyed by kind value. */
47
62
  readonly admit: readonly Admission[];
48
- /** Existential obligations the harness must contain a fill for, keyed by name. */
63
+ /**
64
+ * Existential obligations the harness must contain a fill for, keyed by name — every
65
+ * requirement the assembly declares, whether through `require` or as a requirement
66
+ * member composed in `members` (which {@link harness} draws out of the roster).
67
+ */
49
68
  readonly require: Readonly<Record<string, Requirement>>;
50
69
  /** The residual harness-level settings with no member home (a shrinking list). */
51
70
  readonly settings: Readonly<Record<string, unknown>>;
71
+ /** The program's declared {@link Typecheck}; absent where the program declares none, which `emit` refuses. */
72
+ readonly typecheck?: Typecheck;
52
73
  /**
53
74
  * The **root member's own contract** — the clauses that bind to the whole governed
54
75
  * forest rather than to one kind's population. Lowered to top-level clause rows
@@ -57,9 +78,10 @@ export interface Harness {
57
78
  * harness the way it attaches to any member).
58
79
  *
59
80
  * Every clause here is judged at the selection grain, so the vocabulary is the
60
- * selection predicates plus {@link reachable}; a member-grain clause names a field in
61
- * a schema the root has no single kind to supply, and the gate refuses it at
62
- * admissibility rather than leaving it unjudged.
81
+ * selection predicates plus {@link reachable}, and one member-grain form: an each-grain
82
+ * `extent`, bare or under a `loads` guard, sizing the import targets no kind claims.
83
+ * Any other member-grain clause names a field in a schema the root has no single kind
84
+ * to supply, and the gate refuses it at admissibility rather than leaving it unjudged.
63
85
  *
64
86
  * Absent, {@link rootDefaultContract} applies — the shipped floor, composed by
65
87
  * {@link harness}.
@@ -86,7 +108,7 @@ export interface Harness {
86
108
  readonly mode: EnforcementMode;
87
109
  }
88
110
  /**
89
- * Compose the harness from its six fields — ordinary code, Turing-completeness
111
+ * Compose the harness from its fields — ordinary code, Turing-completeness
90
112
  * quarantined at authoring time. Absent
91
113
  * fields default empty (`mode` defaults `warn`); the member list is the
92
114
  * only required part.
@@ -95,10 +117,11 @@ export declare function harness(init: {
95
117
  members: readonly Member[];
96
118
  expect?: readonly ExpectBinding[];
97
119
  admit?: readonly Admission[];
98
- require?: Readonly<Record<string, Requirement>>;
120
+ require?: Readonly<Record<string, RequirementValue>>;
99
121
  settings?: Readonly<Record<string, unknown>>;
100
122
  mode?: EnforcementMode;
101
123
  contract?: readonly Clause[];
124
+ typecheck?: Typecheck;
102
125
  }): Harness;
103
126
  /**
104
127
  * The **shipped root default contract** — what the root member owes absent an authored
@@ -108,7 +131,7 @@ export declare function harness(init: {
108
131
  * Homed beside the root member's other fields, the precedent `dialDefaultContract` sets
109
132
  * in `dial.ts`: a default contract lives with the surface it governs.
110
133
  *
111
- * Four clauses, all predicates only the root can bind: their selection is the whole
134
+ * Eight clauses, all predicates only the root can bind: their selection is the whole
112
135
  * forest and their judges read the reference graph, the committed lock and the discovery
113
136
  * walk, none of which any one kind's population carries. `reachable` is the one check
114
137
  * that catches authored configuration the harness never loads at all; `fresh` is the one
@@ -117,7 +140,18 @@ export declare function harness(init: {
117
140
  * governed locus that the program never declared; `engine-matches` is the one that
118
141
  * catches a lock compiled by an engine other than the one now reading it.
119
142
  *
120
- * All advisory — today's posture for each, so no adopter turns red on the upgrade. A
143
+ * `resolves` and `import-backed`: a reference naming nothing, and an `@path` import
144
+ * loading nothing. Both judge the reference graph, so they bind at the root too.
145
+ *
146
+ * `listing` closes the set: Claude Code's one skill listing carries every model-invocable
147
+ * skill and command under one budget, so no single kind's population holds the sum —
148
+ * two kinds each under budget can overrun it together. The size clause over unclaimed
149
+ * import targets is the one member-grain clause here: a file no kind claims has no kind
150
+ * contract, so the root sizes it.
151
+ *
152
+ * `resolves` ships at `required`: a reference naming nothing is a broken program, which
153
+ * `emit` already refuses, and the gate holds the same line on a tree it did not write.
154
+ * The rest are advisory — today's posture for each, so no adopter turns red on the upgrade. A
121
155
  * dead registration is often deliberate work-in-progress, a drifted projection is usually
122
156
  * a re-emit away, an undeclared document is often a surface mid-adoption, and a stale
123
157
  * engine stamp is the ordinary state of every checkout between an upgrade and the next
@@ -1,24 +1,28 @@
1
1
  /**
2
2
  * The assembly — `harness()` takes the whole as one typed value: `Harness =
3
- * members · expect · require · settings · mode`. Like every SDK type it
3
+ * members · expect · admit · require · settings · mode · contract · typecheck`. Like every SDK type it
4
4
  * erases at the seam — the engine never sees the constructor, only the
5
5
  * declaration rows it compiles to. There is no second authoring surface: no
6
6
  * `temper.toml`, no roster/bindings dialect (the Decision rejects both);
7
7
  * composing partial harnesses is ordinary code.
8
8
  */
9
- import { clause, engineMatches, fresh, locusDeclared, reachable } from "./contract.js";
9
+ import { clause, engineMatches, fresh, importBacked, listing, locusDeclared, reachable, resolves } from "./contract.js";
10
+ import { command, gateHookTool, isRequirement, requirementOf, skill, unclaimedImportSizeClause } from "./builtins.js";
11
+ import { memberAddress } from "./member-address.js";
10
12
  /**
11
- * Compose the harness from its six fields — ordinary code, Turing-completeness
13
+ * Compose the harness from its fields — ordinary code, Turing-completeness
12
14
  * quarantined at authoring time. Absent
13
15
  * fields default empty (`mode` defaults `warn`); the member list is the
14
16
  * only required part.
15
17
  */
16
18
  export function harness(init) {
19
+ const { members, require } = assemblyRequirements(withoutRepeatedGateHooks(init.members), init.require ?? {});
17
20
  return {
18
- members: init.members,
21
+ members,
22
+ ...(init.typecheck === undefined ? {} : { typecheck: init.typecheck }),
19
23
  expect: init.expect ?? [],
20
24
  admit: init.admit ?? [],
21
- require: init.require ?? {},
25
+ require,
22
26
  settings: init.settings ?? {},
23
27
  mode: init.mode ?? "warn",
24
28
  // The one place "a shipped root default applies when the author declares none" is
@@ -32,6 +36,75 @@ export function harness(init) {
32
36
  contractDeclared: init.contract !== undefined,
33
37
  };
34
38
  }
39
+ /**
40
+ * `roster` with each repeated gate hook dropped: a gate hook at the address of an earlier
41
+ * one that runs the same tool and fills the same requirements is the same hook, so the
42
+ * edge runs one command. A playbook's guard attachment and the harness's own gate hooks
43
+ * both place the `PreToolUse` guard; any difference between the two is left to the
44
+ * duplicate-address refusal.
45
+ */
46
+ function withoutRepeatedGateHooks(roster) {
47
+ const seen = new Map();
48
+ return roster.filter((member) => {
49
+ const tool = gateHookTool(member);
50
+ if (tool === undefined)
51
+ return true;
52
+ const address = memberAddress(member);
53
+ const held = seen.get(address);
54
+ if (held === undefined) {
55
+ seen.set(address, member);
56
+ return true;
57
+ }
58
+ const same = gateHookTool(held) === tool &&
59
+ held.satisfies.length === member.satisfies.length &&
60
+ held.satisfies.every((name, at) => member.satisfies[at] === name);
61
+ return !same;
62
+ });
63
+ }
64
+ /**
65
+ * The assembly's requirements, one namespace: each `require` entry under its key, then
66
+ * each requirement member the roster composes (a `requirement(…)` member, or a member of
67
+ * a kind extending it) under its own name — drawn out of the roster, since a requirement
68
+ * is what satisfies edges target, not a member the projection or the member rows carry.
69
+ *
70
+ * # Throws
71
+ * If a name is declared twice, or a roster requirement member states no name.
72
+ */
73
+ function assemblyRequirements(roster, declared) {
74
+ const require = {};
75
+ for (const [name, value] of Object.entries(declared))
76
+ require[name] = requirementOf(name, value);
77
+ const members = [];
78
+ for (const member of roster) {
79
+ if (!isRequirement(member)) {
80
+ members.push(member);
81
+ continue;
82
+ }
83
+ if (member.name === "") {
84
+ throw new Error("harness: a requirement member in `members` names itself — pass `requirement({ name, … })`, " +
85
+ "or declare it under its name in `require`.");
86
+ }
87
+ if (Object.hasOwn(require, member.name)) {
88
+ throw new Error(`harness: requirement \`${member.name}\` is declared twice — a requirement has one identity.`);
89
+ }
90
+ require[member.name] = requirementOf(member.name, member);
91
+ }
92
+ return { members, require };
93
+ }
94
+ /**
95
+ * The skill listing's character budget, one budget over skills and commands alike: "The
96
+ * budget scales dynamically at 1% of the context window, with a fallback of 8,000 characters" (`SLASH_COMMAND_TOOL_CHAR_BUDGET`, env-vars
97
+ * docs). The fallback is the one character figure the docs give, and judging it keeps a
98
+ * passing listing whole wherever the budget is not raised.
99
+ */
100
+ const SKILL_LISTING_CHARACTER_BUDGET = 8_000;
101
+ /**
102
+ * The per-entry cap: "the combined `description` and `when_to_use` text is truncated at
103
+ * 1,536 characters in the skill listing" — `skillListingMaxDescChars`, default `1536`.
104
+ */
105
+ const SKILL_LISTING_ENTRY_CAP = 1_536;
106
+ /** The skills and env-vars docs' statements of the listing budget and its per-entry cap. */
107
+ const SKILL_LISTING_BUDGET_CITE = "https://code.claude.com/docs/en/skills#skill-descriptions-are-cut-short; https://code.claude.com/docs/en/env-vars (SLASH_COMMAND_TOOL_CHAR_BUDGET); https://code.claude.com/docs/en/settings-reference#skilllistingmaxdescchars (retrieved 2026-11-26)";
35
108
  /**
36
109
  * The **shipped root default contract** — what the root member owes absent an authored
37
110
  * one, and what the embedded built-in lock therefore carries for the stranger gate (a
@@ -40,7 +113,7 @@ export function harness(init) {
40
113
  * Homed beside the root member's other fields, the precedent `dialDefaultContract` sets
41
114
  * in `dial.ts`: a default contract lives with the surface it governs.
42
115
  *
43
- * Four clauses, all predicates only the root can bind: their selection is the whole
116
+ * Eight clauses, all predicates only the root can bind: their selection is the whole
44
117
  * forest and their judges read the reference graph, the committed lock and the discovery
45
118
  * walk, none of which any one kind's population carries. `reachable` is the one check
46
119
  * that catches authored configuration the harness never loads at all; `fresh` is the one
@@ -49,7 +122,18 @@ export function harness(init) {
49
122
  * governed locus that the program never declared; `engine-matches` is the one that
50
123
  * catches a lock compiled by an engine other than the one now reading it.
51
124
  *
52
- * All advisory — today's posture for each, so no adopter turns red on the upgrade. A
125
+ * `resolves` and `import-backed`: a reference naming nothing, and an `@path` import
126
+ * loading nothing. Both judge the reference graph, so they bind at the root too.
127
+ *
128
+ * `listing` closes the set: Claude Code's one skill listing carries every model-invocable
129
+ * skill and command under one budget, so no single kind's population holds the sum —
130
+ * two kinds each under budget can overrun it together. The size clause over unclaimed
131
+ * import targets is the one member-grain clause here: a file no kind claims has no kind
132
+ * contract, so the root sizes it.
133
+ *
134
+ * `resolves` ships at `required`: a reference naming nothing is a broken program, which
135
+ * `emit` already refuses, and the gate holds the same line on a tree it did not write.
136
+ * The rest are advisory — today's posture for each, so no adopter turns red on the upgrade. A
53
137
  * dead registration is often deliberate work-in-progress, a drifted projection is usually
54
138
  * a re-emit away, an undeclared document is often a surface mid-adoption, and a stale
55
139
  * engine stamp is the ordinary state of every checkout between an upgrade and the next
@@ -65,13 +149,37 @@ export const rootDefaultContract = [
65
149
  clause(fresh(), {
66
150
  severity: "advisory",
67
151
  guidance: "A lock row this member owns no longer matches disk: either its committed projection was hand-edited, or a fingerprinted source dependency has moved: a layout import, a prose include, a declared input, or — on the root member — a module the program itself loaded. Nothing reverse-parses a projection back into the program, so the two sides stay apart until you reconcile them: edit the owning source and re-emit, and for a moved declared input re-verify the member's claims against the new bytes first. Advisory because a drifted checkout is usually one `emit` away and blocking every such run would be temper's escalation, not yours; dial this label to `required` — or re-declare the clause — once a drifted projection should fail CI.",
152
+ cite: "https://github.com/duct-tape-and-markdown/temper/blob/main/specs/model/pipeline.md#drift (retrieved 2026-11-26)",
68
153
  }),
69
154
  clause(locusDeclared(), {
70
155
  severity: "advisory",
71
- guidance: "A document sits at a governed locus that your program declares no member for. temper maintains nothing about it: `emit` never writes or reaps it, `guard` never bound it, and every address under it resolves to nothing — so it reads as governed configuration while being governed by no one. Where the locus is one the harness itself loads — a built-in kind's — it is live context on top of that; where the kind is your own, who reads it is yours to know and not temper's to claim. Declare the member in the program and re-emit; for a directory whose documents are authored in place rather than projected, declare its kind `local` so `check` derives the rows at read time instead. Advisory because a tree mid-adoption legitimately carries documents the program has not reached yet; dial this label to `required` — or re-declare the clause — once every document at a governed locus should be one you declared.",
156
+ guidance: "A document sits at a governed locus that your program declares no member for. temper maintains nothing about it: `emit` never reaps it, and where your registrations write into it, `emit` renders their entries and refuses to delete any key it does not own; `guard` never bound it, and every address under it resolves to nothing — so it reads as governed configuration while being governed by no one. Where the locus is one the harness itself loads — a built-in kind's — it is live context on top of that; where the kind is your own, who reads it is yours to know and not temper's to claim. Declare the member in the program and re-emit; for a directory whose documents are authored in place rather than projected, declare its kind `local` so `check` derives the rows at read time instead. Advisory because a tree mid-adoption legitimately carries documents the program has not reached yet; dial this label to `required` — or re-declare the clause — once every document at a governed locus should be one you declared.",
157
+ cite: "https://github.com/duct-tape-and-markdown/temper/blob/main/specs/decisions/0054-the-root-member-carries-a-contract.md (retrieved 2026-11-26)",
72
158
  }),
73
159
  clause(engineMatches(), {
74
160
  severity: "advisory",
75
161
  guidance: "Your committed lock records a different temper version than the one running this gate. The rows being read were compiled by a compiler this binary is not, so every verdict below rests on a translation: an older spelling normalizes at read time, but a genuine change in what a row means reads the same from the inside. Re-run `emit` — it rewrites the lock whole in this engine's canonical form, and the stamp goes back to matching. Advisory because a lagging stamp is the ordinary state of every checkout between an upgrade and the next emit, and blocking there would make an upgrade a hard stop; dial this label to `required` — or re-declare the clause — once your CI should refuse a lock it did not compile.",
162
+ cite: "https://github.com/duct-tape-and-markdown/temper/blob/main/specs/model/pipeline.md#the-lock (retrieved 2026-11-26)",
163
+ }),
164
+ clause(resolves(), {
165
+ severity: "required",
166
+ guidance: "A reference this member declares — a field naming another member, or a mention in its prose — names a target the tree does not hold, or a bare key several hosts carry. The runtime resolves such a field by name: a subagent's `skills` list, for one, preloads each skill it names, so a name that matches no skill delivers nothing. Fix the name, author the missing member, or spell the whole `<host-address>/<kind>/<key>` address where hosts share a key. Required because the program's own `emit` refuses the same reference; dial this label to `advisory` while a tree mid-adoption still carries one.",
167
+ cite: "https://code.claude.com/docs/en/sub-agents#preload-skills-into-subagents (retrieved 2026-11-26)",
168
+ }),
169
+ clause(importBacked(), {
170
+ severity: "advisory",
171
+ guidance: "This member's `@path` import names no member and no repository file. Claude Code expands an import into context beside the file that carries it, resolving a relative path against that file rather than the working directory, so a path that reaches nothing loads nothing, silently. Fix the path relative to the importing file — a trailing `.` reads as part of it — or set the text off in backticks if it was never meant as an import. Advisory because the importing file still loads; dial this label to `required` — or re-declare the clause — once a dead import should fail CI.",
172
+ cite: "https://code.claude.com/docs/en/memory#import-additional-files (retrieved 2026-11-26)",
173
+ }),
174
+ clause(listing(["description", "when_to_use"], {
175
+ entry: SKILL_LISTING_ENTRY_CAP,
176
+ budget: SKILL_LISTING_CHARACTER_BUDGET,
177
+ withheldBy: "disable-model-invocation",
178
+ kinds: [skill, command],
179
+ }), {
180
+ severity: "advisory",
181
+ guidance: "Every model-invocable skill's and command's `description` and `when_to_use` ride every request in one listing, under a character budget that scales at 1% of the context window, with a fallback of 8,000 characters — the figure this clause judges. Each entry counts up to the 1,536-character cap the listing cuts it at. Over the budget, Claude Code keeps every name but drops descriptions starting with the ones you invoke least, so those skills and commands lose the keywords Claude matches a request against. One with `disable-model-invocation: true` is not listed and is not counted. Trim descriptions to the key use case first, set rarely-used ones to `disable-model-invocation: true` or to `name-only` in `skillOverrides`, or raise the budget with `skillListingBudgetFraction` (or `SLASH_COMMAND_TOOL_CHAR_BUDGET`) and retune this clause's bound to match. Counted over this harness's own skills and commands only: plugin, bundled and personal skills share the same listing, so the real headroom is smaller.",
182
+ cite: SKILL_LISTING_BUDGET_CITE,
76
183
  }),
184
+ unclaimedImportSizeClause,
77
185
  ];