@dtmd/temper 0.0.3 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -12
- package/dist/src/assembly.d.ts +32 -19
- package/dist/src/assembly.js +10 -10
- package/dist/src/builtins.d.ts +181 -12
- package/dist/src/builtins.js +269 -9
- package/dist/src/claude-code.d.ts +7 -9
- package/dist/src/claude-code.js +6 -8
- package/dist/src/contract.d.ts +97 -30
- package/dist/src/contract.js +80 -10
- package/dist/src/declarations.d.ts +28 -61
- package/dist/src/declarations.js +364 -50
- package/dist/src/emit.d.ts +13 -32
- package/dist/src/emit.js +136 -53
- package/dist/src/generated/AssemblyFactRow.d.ts +29 -0
- package/dist/src/generated/AssemblyFactRow.js +2 -0
- package/dist/src/generated/BoundRow.d.ts +14 -0
- package/dist/src/generated/BoundRow.js +2 -0
- package/dist/src/generated/CharsetRow.d.ts +15 -0
- package/dist/src/generated/CharsetRow.js +2 -0
- package/dist/src/generated/ClauseRow.d.ts +97 -0
- package/dist/src/generated/ClauseRow.js +1 -0
- package/dist/src/generated/CollectionEntryRow.d.ts +23 -0
- package/dist/src/generated/CollectionEntryRow.js +2 -0
- package/dist/src/generated/CollectionEntryWire.d.ts +17 -0
- package/dist/src/generated/CollectionEntryWire.js +2 -0
- package/dist/src/generated/CountBoundRow.d.ts +13 -0
- package/dist/src/generated/CountBoundRow.js +2 -0
- package/dist/src/generated/Declarations.d.ts +72 -0
- package/dist/src/generated/Declarations.js +1 -0
- package/dist/src/generated/DegreeBoundRow.d.ts +15 -0
- package/dist/src/generated/DegreeBoundRow.js +1 -0
- package/dist/src/generated/EdgeBoundRow.d.ts +13 -0
- package/dist/src/generated/EdgeBoundRow.js +2 -0
- package/dist/src/generated/EmbeddedMember.d.ts +45 -0
- package/dist/src/generated/EmbeddedMember.js +1 -0
- package/dist/src/generated/EmbeddedMemberCollectionEntry.d.ts +21 -0
- package/dist/src/generated/EmbeddedMemberCollectionEntry.js +1 -0
- package/dist/src/generated/FeatureValue.d.ts +23 -0
- package/dist/src/generated/FeatureValue.js +1 -0
- package/dist/src/generated/Features.d.ts +82 -0
- package/dist/src/generated/Features.js +1 -0
- package/dist/src/generated/FencedBlock.d.ts +24 -0
- package/dist/src/generated/FencedBlock.js +2 -0
- package/dist/src/generated/IncludeRow.d.ts +18 -0
- package/dist/src/generated/IncludeRow.js +2 -0
- package/dist/src/generated/KindFactRow.d.ts +51 -0
- package/dist/src/generated/KindFactRow.js +1 -0
- package/dist/src/generated/LayoutRegionRow.d.ts +29 -0
- package/dist/src/generated/LayoutRegionRow.js +2 -0
- package/dist/src/generated/LayoutRow.d.ts +12 -0
- package/dist/src/generated/LayoutRow.js +1 -0
- package/dist/src/generated/MentionRow.d.ts +17 -0
- package/dist/src/generated/MentionRow.js +2 -0
- package/dist/src/generated/NestedMemberRow.d.ts +39 -0
- package/dist/src/generated/NestedMemberRow.js +1 -0
- package/dist/src/generated/Payload.d.ts +25 -0
- package/dist/src/generated/Payload.js +1 -0
- package/dist/src/generated/PayloadMember.d.ts +31 -0
- package/dist/src/generated/PayloadMember.js +2 -0
- package/dist/src/generated/RangeBoundRow.d.ts +15 -0
- package/dist/src/generated/RangeBoundRow.js +2 -0
- package/dist/src/generated/RequirementRow.d.ts +40 -0
- package/dist/src/generated/RequirementRow.js +1 -0
- package/dist/src/generated/SatisfiesRow.d.ts +14 -0
- package/dist/src/generated/SatisfiesRow.js +2 -0
- package/dist/src/generated/Section.d.ts +21 -0
- package/dist/src/generated/Section.js +2 -0
- package/dist/src/generated/SectionContainsRow.d.ts +14 -0
- package/dist/src/generated/SectionContainsRow.js +2 -0
- package/dist/src/generated/ValueType.d.ts +9 -0
- package/dist/src/generated/ValueType.js +2 -0
- package/dist/src/generated/index.d.ts +29 -0
- package/dist/src/generated/index.js +1 -0
- package/dist/src/index.d.ts +15 -19
- package/dist/src/index.js +10 -13
- package/dist/src/kind.d.ts +163 -41
- package/dist/src/kind.js +24 -24
- package/dist/src/needs.d.ts +8 -8
- package/dist/src/needs.js +7 -7
- package/dist/src/prose.d.ts +75 -28
- package/dist/src/prose.js +0 -0
- package/package.json +1 -1
- package/dist/src/genres.d.ts +0 -38
- package/dist/src/genres.js +0 -24
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# temper-sdk — the authoring face
|
|
2
2
|
|
|
3
3
|
The typed module library the ratified corpus names as temper's authoring
|
|
4
|
-
medium (`specs/intent
|
|
5
|
-
|
|
4
|
+
medium (`specs/intent.md`; `specs/model/pipeline.md`, "The SDK"). A harness
|
|
5
|
+
author composes members as typed
|
|
6
6
|
values in the **six-noun model**; `emit` compiles the whole into the declaration
|
|
7
7
|
rows the engine reads, a byte-faithful `.claude/**` projection, and the lock. The
|
|
8
8
|
SDK implements **no semantics** — every type erases at the seam, and the engine
|
|
@@ -11,14 +11,15 @@ consumes only declared data, offline, no Node.
|
|
|
11
11
|
## The six-noun face
|
|
12
12
|
|
|
13
13
|
- **`harness()`** — the assembly as one typed value: `members · expect ·
|
|
14
|
-
require · settings
|
|
15
|
-
- **`kind<T>()
|
|
14
|
+
require · settings` (`specs/model/pipeline.md`, "The SDK").
|
|
15
|
+
- **`kind<T>()`** — the engine room: a kind is a typed
|
|
16
16
|
constructor plus five facts of runtime residue (label, locus, layout,
|
|
17
|
-
registration, edge fields — `specs/
|
|
18
|
-
Claude Code kinds `rule` / `skill` / `memory` are ordinary `kind<T>()` values
|
|
17
|
+
registration, edge fields — `specs/model/representation.md`). The built-in
|
|
18
|
+
Claude Code kinds `rule` / `skill` / `memory` are ordinary `kind<T>()` values;
|
|
19
|
+
an embedded child kind is the same constructor at the `embedded` locus.
|
|
19
20
|
- **Clause values** — `clause(predicate, { severity, guidance, cite })` over the
|
|
20
21
|
closed predicate algebra (`required`, `maxLines`, …); a floor is an exported
|
|
21
|
-
clause array, adopted by spread in `expect` (`specs/
|
|
22
|
+
clause array, adopted by spread in `expect` (`specs/model/contract.md`).
|
|
22
23
|
- **`needs`** — the capabilities a member uses (`bash("git diff")`); emit derives
|
|
23
24
|
the permission union, so a permission is never authored twice.
|
|
24
25
|
- **`file()` / `` text`…` `` / `blocks()`** — the three prose constructors, one
|
|
@@ -26,7 +27,8 @@ consumes only declared data, offline, no Node.
|
|
|
26
27
|
|
|
27
28
|
## What `emit` produces
|
|
28
29
|
|
|
29
|
-
One deterministic pass over the harness, double-emit verified
|
|
30
|
+
One deterministic pass over the harness, double-emit verified
|
|
31
|
+
(`specs/model/pipeline.md`, "Emit"):
|
|
30
32
|
|
|
31
33
|
- **Declaration rows** — the erased program (kind facts, clauses, requirements,
|
|
32
34
|
assembly facts) on the internal versioned JSON pipe and in the lock's
|
|
@@ -43,12 +45,8 @@ projection on disk; the JSON pipe is in-flight, not a committed artifact.
|
|
|
43
45
|
|
|
44
46
|
## Stated bounds — each a named follow-on, never silently faked
|
|
45
47
|
|
|
46
|
-
- **`blocks()` composes now, renders later** — the shared genre fence format is
|
|
47
|
-
`(genre-fence-format)`, deferred until its first consumer; emit refuses to
|
|
48
|
-
project a `blocks()` body until then.
|
|
49
48
|
- **The permission union is carried as data** — the fold into the settings
|
|
50
49
|
artifact lands with the hook/MCP kinds it folds many-to-one.
|
|
51
|
-
- **Publish name/scope** pending the PACKAGING-CHANNELS ruling; `private: true`.
|
|
52
50
|
|
|
53
51
|
## Tests
|
|
54
52
|
|
package/dist/src/assembly.d.ts
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The assembly — `harness()` takes the whole as one typed value
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* harnesses is ordinary code.
|
|
2
|
+
* The assembly — `harness()` takes the whole as one typed value: `Harness =
|
|
3
|
+
* members · expect · require · settings · mode`. Like every SDK type it
|
|
4
|
+
* erases at the seam — the engine never sees the constructor, only the
|
|
5
|
+
* declaration rows it compiles to. There is no second authoring surface: no
|
|
6
|
+
* `temper.toml`, no roster/bindings dialect (the Decision rejects both);
|
|
7
|
+
* composing partial harnesses is ordinary code.
|
|
9
8
|
*/
|
|
10
9
|
import type { Member, KindDefinition } from "./kind.js";
|
|
11
|
-
import type { Clause, Requirement
|
|
10
|
+
import type { Clause, Requirement } from "./contract.js";
|
|
12
11
|
/**
|
|
13
|
-
* One `expect` binding — universal: every member of `kind` owes these clauses
|
|
14
|
-
*
|
|
15
|
-
*
|
|
12
|
+
* One `expect` binding — universal: every member of `kind` owes these clauses.
|
|
13
|
+
* Keyed by the kind **value**, an import never a string; binding is implicit
|
|
14
|
+
* — a floor is just a clause array spread into `clauses`.
|
|
16
15
|
*/
|
|
17
16
|
export interface ExpectBinding {
|
|
18
|
-
readonly kind: KindDefinition<
|
|
17
|
+
readonly kind: KindDefinition<never>;
|
|
19
18
|
readonly clauses: readonly Clause[];
|
|
20
19
|
}
|
|
21
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* The declared enforcement-mode vocabulary — how firmly the `PreToolUse` guard
|
|
22
|
+
* binds a tool call, split by where the finding goes.
|
|
23
|
+
* `block`: denies the call.
|
|
24
|
+
* `warn` (default): allows the call and surfaces the finding in-band, into the
|
|
25
|
+
* live context. `note`: allows the call and records the finding out-of-band
|
|
26
|
+
* only — the next report, never the session.
|
|
27
|
+
*/
|
|
28
|
+
export type EnforcementMode = "note" | "warn" | "block";
|
|
29
|
+
/** The composed harness — the root member's own fields, erased to rows at the seam. */
|
|
22
30
|
export interface Harness {
|
|
23
|
-
/** The member roster — the assembly's imports
|
|
31
|
+
/** The member roster — the assembly's imports. */
|
|
24
32
|
readonly members: readonly Member[];
|
|
25
33
|
/** Universal clause bindings, keyed by kind value. */
|
|
26
34
|
readonly expect: readonly ExpectBinding[];
|
|
@@ -28,18 +36,23 @@ export interface Harness {
|
|
|
28
36
|
readonly require: Readonly<Record<string, Requirement>>;
|
|
29
37
|
/** The residual harness-level settings with no member home (a shrinking list). */
|
|
30
38
|
readonly settings: Readonly<Record<string, unknown>>;
|
|
31
|
-
/**
|
|
32
|
-
|
|
39
|
+
/**
|
|
40
|
+
* The root member's declared enforcement mode — harness-wide, overridable
|
|
41
|
+
* per member. Defaults to `warn`: temper fabricates no enforcement the
|
|
42
|
+
* author did not declare.
|
|
43
|
+
*/
|
|
44
|
+
readonly mode: EnforcementMode;
|
|
33
45
|
}
|
|
34
46
|
/**
|
|
35
47
|
* Compose the harness from its five fields — ordinary code, Turing-completeness
|
|
36
|
-
* quarantined at authoring time
|
|
37
|
-
* fields default empty; the member list is the
|
|
48
|
+
* quarantined at authoring time. Absent
|
|
49
|
+
* fields default empty (`mode` defaults `warn`); the member list is the
|
|
50
|
+
* only required part.
|
|
38
51
|
*/
|
|
39
52
|
export declare function harness(init: {
|
|
40
53
|
members: readonly Member[];
|
|
41
54
|
expect?: readonly ExpectBinding[];
|
|
42
55
|
require?: Readonly<Record<string, Requirement>>;
|
|
43
56
|
settings?: Readonly<Record<string, unknown>>;
|
|
44
|
-
|
|
57
|
+
mode?: EnforcementMode;
|
|
45
58
|
}): Harness;
|
package/dist/src/assembly.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The assembly — `harness()` takes the whole as one typed value
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* harnesses is ordinary code.
|
|
2
|
+
* The assembly — `harness()` takes the whole as one typed value: `Harness =
|
|
3
|
+
* members · expect · require · settings · mode`. Like every SDK type it
|
|
4
|
+
* erases at the seam — the engine never sees the constructor, only the
|
|
5
|
+
* declaration rows it compiles to. There is no second authoring surface: no
|
|
6
|
+
* `temper.toml`, no roster/bindings dialect (the Decision rejects both);
|
|
7
|
+
* composing partial harnesses is ordinary code.
|
|
9
8
|
*/
|
|
10
9
|
/**
|
|
11
10
|
* Compose the harness from its five fields — ordinary code, Turing-completeness
|
|
12
|
-
* quarantined at authoring time
|
|
13
|
-
* fields default empty; the member list is the
|
|
11
|
+
* quarantined at authoring time. Absent
|
|
12
|
+
* fields default empty (`mode` defaults `warn`); the member list is the
|
|
13
|
+
* only required part.
|
|
14
14
|
*/
|
|
15
15
|
export function harness(init) {
|
|
16
16
|
return {
|
|
@@ -18,6 +18,6 @@ export function harness(init) {
|
|
|
18
18
|
expect: init.expect ?? [],
|
|
19
19
|
require: init.require ?? {},
|
|
20
20
|
settings: init.settings ?? {},
|
|
21
|
-
|
|
21
|
+
mode: init.mode ?? "warn",
|
|
22
22
|
};
|
|
23
23
|
}
|
package/dist/src/builtins.d.ts
CHANGED
|
@@ -1,40 +1,81 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The built-in Claude Code kinds — the face nouns a harness author imports
|
|
3
|
-
*
|
|
2
|
+
* The built-in Claude Code kinds — the face nouns a harness author imports.
|
|
3
|
+
* Each is an
|
|
4
4
|
* ordinary `kind<T>()` value built with the same constructor every provider uses
|
|
5
5
|
* (ownership not privilege). Their five facts are external facts about the Claude
|
|
6
6
|
* Code harness, cited at the point of claim.
|
|
7
7
|
*
|
|
8
8
|
* These are the SDK's own provider-face exports, surfaced through the
|
|
9
|
-
* `@dtmd/temper/claude-code` subpath
|
|
10
|
-
*
|
|
9
|
+
* `@dtmd/temper/claude-code` subpath
|
|
10
|
+
* — never from the root.
|
|
11
11
|
*/
|
|
12
12
|
import type { KindDefinition } from "./kind.js";
|
|
13
13
|
import type { Prose } from "./prose.js";
|
|
14
|
+
import type { Clause } from "./contract.js";
|
|
14
15
|
/** A Claude Code skill — a directory whose entry file is `SKILL.md` with YAML frontmatter. */
|
|
15
16
|
export interface Skill {
|
|
16
17
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
* The description trigger — always in context; the body loads on invocation
|
|
19
|
+
* (code.claude.com/docs/en/skills, retrieved 2026-07-02).
|
|
20
|
+
*/
|
|
20
21
|
readonly description: string;
|
|
21
22
|
/** The optional license field the skill spec carries (agentskills.io/specification). */
|
|
22
23
|
readonly license?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Set `true` to prevent Claude from automatically loading this skill — only
|
|
26
|
+
* the user-invoked channel stays live (code.claude.com/docs/en/skills,
|
|
27
|
+
* "Control who invokes a skill", retrieved 2026-07-07). Default: `false`.
|
|
28
|
+
*/
|
|
29
|
+
readonly "disable-model-invocation"?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Set `false` to hide the skill from the `/` menu — only the
|
|
32
|
+
* description-trigger channel stays live (code.claude.com/docs/en/skills,
|
|
33
|
+
* "Control who invokes a skill", retrieved 2026-07-07). Default: `true`.
|
|
34
|
+
*/
|
|
35
|
+
readonly "user-invocable"?: boolean;
|
|
23
36
|
readonly prose?: Prose;
|
|
24
37
|
}
|
|
25
38
|
/**
|
|
26
39
|
* `skill` — `.claude/skills/<name>/SKILL.md`, a directory unit, YAML frontmatter
|
|
27
|
-
* carrying `name` then `description`; registers
|
|
40
|
+
* carrying `name` then `description`; registers on both documented invocation
|
|
41
|
+
* channels — user-invoked (`/name`) and description-trigger — modulated per
|
|
42
|
+
* member by the `disable-model-invocation`/`user-invocable` fields
|
|
28
43
|
* (code.claude.com/docs/en/skills, agentskills.io/specification, retrieved
|
|
29
|
-
* 2026-07-
|
|
44
|
+
* 2026-07-07).
|
|
30
45
|
*/
|
|
31
46
|
export declare const skill: KindDefinition<Skill>;
|
|
47
|
+
/**
|
|
48
|
+
* `command` — `.claude/commands/*.md`, the skill surface's legacy file placement
|
|
49
|
+
* (Claude Code merged commands into skills; code.claude.com/docs/en/skills,
|
|
50
|
+
* retrieved 2026-07-07): a lone file (identity from the stem, so no
|
|
51
|
+
* `identityField` — like `rule`), the skill's field schema by import, registering
|
|
52
|
+
* on the same two documented invocation channels as `skill`.
|
|
53
|
+
*/
|
|
54
|
+
export declare const command: KindDefinition<Skill>;
|
|
55
|
+
/** A Claude Code subagent definition. */
|
|
56
|
+
export interface Agent {
|
|
57
|
+
/**
|
|
58
|
+
* When Claude should delegate to this subagent — the sole registration
|
|
59
|
+
* channel (code.claude.com/docs/en/sub-agents, retrieved 2026-07-07).
|
|
60
|
+
*/
|
|
61
|
+
readonly description: string;
|
|
62
|
+
readonly prose?: Prose;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* `agent` — every markdown file under `.claude/agents`, discovered recursively (a
|
|
66
|
+
* containing subdirectory is purely organizational), YAML frontmatter carrying
|
|
67
|
+
* `name` then `description`; identity is the `name` field (never the filename),
|
|
68
|
+
* the named-field mode; registers on the description-trigger channel only — no
|
|
69
|
+
* user-invoked slash command (code.claude.com/docs/en/sub-agents, retrieved
|
|
70
|
+
* 2026-07-07).
|
|
71
|
+
*/
|
|
72
|
+
export declare const agent: KindDefinition<Agent>;
|
|
32
73
|
/** A Claude Code rule — a flat markdown file with an optional `paths` scope. */
|
|
33
74
|
export interface Rule {
|
|
34
75
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
76
|
+
* The path scope — a present list matching zero files is a dead edge; an absent
|
|
77
|
+
* one loads unconditionally (code.claude.com/docs/en/memory, retrieved 2026-07-02).
|
|
78
|
+
*/
|
|
38
79
|
readonly paths?: readonly string[];
|
|
39
80
|
readonly prose?: Prose;
|
|
40
81
|
}
|
|
@@ -56,3 +97,131 @@ export interface Memory {
|
|
|
56
97
|
* a module-carried memory projects the root file.
|
|
57
98
|
*/
|
|
58
99
|
export declare const memory: KindDefinition<Memory>;
|
|
100
|
+
/**
|
|
101
|
+
* The default contract for `skill` — Anthropic's documented skill contract: the Agent
|
|
102
|
+
* Skills open standard (agentskills.io), Anthropic's platform upload
|
|
103
|
+
* validation, and Claude Code's own docs.
|
|
104
|
+
* All sources retrieved 2026-07-09.
|
|
105
|
+
*
|
|
106
|
+
* Checks the strictest documented profile: the spec and upload validation are
|
|
107
|
+
* hard, Claude Code's runtime is deliberately forgiving ("All fields are
|
|
108
|
+
* optional") — a skill that passes here loads everywhere the format is
|
|
109
|
+
* honored, not merely on the machine it was written on; where the runtime
|
|
110
|
+
* diverges, the clause's own guidance says so.
|
|
111
|
+
*
|
|
112
|
+
* Deliberately absent — undecidable, so never gate clauses: whether the
|
|
113
|
+
* description actually triggers well or reads third-person (semantic);
|
|
114
|
+
* vagueness/no-op detection (semantic); gerund naming (judgment). Two
|
|
115
|
+
* decidable spec rules are also absent, pending a vocabulary addition (a
|
|
116
|
+
* narrow shape predicate governs additions): the name
|
|
117
|
+
* must not start/end with a hyphen or contain consecutive hyphens; likewise
|
|
118
|
+
* the platform's "no XML tags in the description."
|
|
119
|
+
*
|
|
120
|
+
* Authoring notes the clauses cannot carry: prefer gerund or noun-phrase
|
|
121
|
+
* names (`processing-pdfs`, `pdf-processing`) over vague ones (`helper`,
|
|
122
|
+
* `utils`); `disable-model-invocation: true` for side-effectful workflows you
|
|
123
|
+
* want to time yourself; `user-invocable: false` for background knowledge
|
|
124
|
+
* that is not a command; `metadata` is the sanctioned home for versioning —
|
|
125
|
+
* there is no top-level `version` field.
|
|
126
|
+
*/
|
|
127
|
+
export declare const skillDefaultContract: readonly Clause[];
|
|
128
|
+
/**
|
|
129
|
+
* The default contract for `command` — `skillDefaultContract`'s clauses minus `nameMatchesDir`: a
|
|
130
|
+
* command is a lone file with no parent directory to match, so the one clause
|
|
131
|
+
* that ranges over the directory relationship does not apply; every other
|
|
132
|
+
* documented skill-schema recommendation, name-requiredness included, still
|
|
133
|
+
* governs a command by the same import (code.claude.com/docs/en/skills,
|
|
134
|
+
* retrieved 2026-07-07).
|
|
135
|
+
*/
|
|
136
|
+
export declare const commandDefaultContract: readonly Clause[];
|
|
137
|
+
/**
|
|
138
|
+
* The default contract for `agent` — Anthropic's documented subagent contract
|
|
139
|
+
* (code.claude.com/docs/en/sub-agents, retrieved 2026-07-07): `name` and
|
|
140
|
+
* `description` are the only required fields, `name` is a "unique identifier
|
|
141
|
+
* using lowercase letters and hyphens" (no digits, unlike a skill's `name`), and
|
|
142
|
+
* "keep `name` values unique across the whole tree" — a same-scope collision
|
|
143
|
+
* loads only one definition.
|
|
144
|
+
*
|
|
145
|
+
* Deliberately narrow, like `ruleDefaultContract`: undecidable properties (whether the
|
|
146
|
+
* description triggers well, model/permissionMode's semi-open vocabularies) stay
|
|
147
|
+
* out of the gate — the format documents little else that is decidable.
|
|
148
|
+
*/
|
|
149
|
+
export declare const agentDefaultContract: readonly Clause[];
|
|
150
|
+
/**
|
|
151
|
+
* The default contract for `rule` — Anthropic's documented contract for a Claude Code
|
|
152
|
+
* rules file, sourced from the memory docs (`.claude/rules/` landed in
|
|
153
|
+
* v2.0.64; `packages/rule.anthropic/PACKAGE.md`, the curated authoring
|
|
154
|
+
* reference this migrates verbatim). All sources retrieved 2026-07-09.
|
|
155
|
+
*
|
|
156
|
+
* `paths` is the one documented frontmatter key for rules: glob patterns
|
|
157
|
+
* (brace expansion supported) that scope the rule to matching files. Rules
|
|
158
|
+
* without it load at launch with the same priority as CLAUDE.md; path-scoped
|
|
159
|
+
* rules load when Claude reads a matching file. Note skills now take a
|
|
160
|
+
* `paths` key too — the two schemas are separate. (Guidance only: an
|
|
161
|
+
* optional field asserts nothing decidable, so it carries no clause of its
|
|
162
|
+
* own: `required` is the one
|
|
163
|
+
* presence predicate, and its absence is not itself a predicate.)
|
|
164
|
+
* https://code.claude.com/docs/en/memory#path-specific-rules (retrieved 2026-07-09)
|
|
165
|
+
*
|
|
166
|
+
* What the clauses cannot carry, as guidance: keep a rule to facts Claude
|
|
167
|
+
* should hold whenever the rule is in scope — concrete enough to verify ("use
|
|
168
|
+
* 2-space indentation", not "format code properly"). If an entry is a
|
|
169
|
+
* multi-step procedure or only matters occasionally, it belongs in a skill
|
|
170
|
+
* (on-demand) rather than a rule (always-on). Prefer path-scoped rules when
|
|
171
|
+
* one convention governs scattered paths; prefer per-directory CLAUDE.md when
|
|
172
|
+
* directory owners maintain their own. Treat rules like code: prune them when
|
|
173
|
+
* behavior drifts, and test a change by watching whether Claude's behavior
|
|
174
|
+
* actually shifts.
|
|
175
|
+
*/
|
|
176
|
+
export declare const ruleDefaultContract: readonly Clause[];
|
|
177
|
+
/**
|
|
178
|
+
* The default contract for the qualified `claude-code.memory` kind — Anthropic's
|
|
179
|
+
* documented contract for a project `CLAUDE.md` (`packages/memory.anthropic/PACKAGE.md`,
|
|
180
|
+
* the curated authoring reference this migrates verbatim). Retrieved 2026-07-09.
|
|
181
|
+
*
|
|
182
|
+
* Deliberately near-empty, because the format is: `CLAUDE.md` is plain
|
|
183
|
+
* markdown with no documented frontmatter and no required fields
|
|
184
|
+
* (code.claude.com/docs/en/memory, retrieved 2026-07-09), so there is no
|
|
185
|
+
* schema to gate — manufacturing a required field or a forbidden-key list
|
|
186
|
+
* would fake a check the format does not carry. The single clause is a context-cost
|
|
187
|
+
* budget; everything else the contract could say is guidance.
|
|
188
|
+
*
|
|
189
|
+
* What the clauses cannot carry, as guidance: a `paths:` frontmatter block
|
|
190
|
+
* belongs on a `.claude/rules/*.md` file, not on `CLAUDE.md` — the memory
|
|
191
|
+
* docs document `paths` only for rules, so a rules-style header on
|
|
192
|
+
* `CLAUDE.md` is dead configuration. Split a large file with `@path` imports
|
|
193
|
+
* (resolved relative to the importing file, absolute allowed, recursion
|
|
194
|
+
* capped at four hops; wrap a path in backticks to mention it without
|
|
195
|
+
* importing). If the repo already ships an `AGENTS.md` for other agents,
|
|
196
|
+
* don't duplicate it — create a `CLAUDE.md` that `@AGENTS.md`-imports it (or
|
|
197
|
+
* symlink, except on Windows where the import is the recommended bridge).
|
|
198
|
+
* Mind the loading asymmetry: every ancestor `CLAUDE.md` loads in full at
|
|
199
|
+
* launch, while files in subdirectories load only when Claude reads a file
|
|
200
|
+
* there — so a rule that must always hold belongs above the working
|
|
201
|
+
* directory, not below it. Personal, un-shared notes go in `CLAUDE.local.md`
|
|
202
|
+
* (gitignored), appended after `CLAUDE.md` at its level.
|
|
203
|
+
*/
|
|
204
|
+
export declare const memoryAnthropicDefaultContract: readonly Clause[];
|
|
205
|
+
/**
|
|
206
|
+
* The default contract for the qualified `agents-md.memory` kind — the AGENTS.md
|
|
207
|
+
* standard's contract for a memory file, which is that there is almost none
|
|
208
|
+
* (`packages/memory.agents-md/PACKAGE.md`, the curated authoring reference
|
|
209
|
+
* this migrates). Guidance-only, and that is the honest encoding: `AGENTS.md`
|
|
210
|
+
* "is just standard Markdown" with no required fields, no sections, and no
|
|
211
|
+
* frontmatter (agents.md, retrieved 2026-07-09); the format deliberately
|
|
212
|
+
* constrains nothing. A default contract that manufactured a required field, a size
|
|
213
|
+
* gate, or a forbidden-key list would assert a contract the standard
|
|
214
|
+
* disclaims. Even the tempting size
|
|
215
|
+
* number is a *tool's* rule, not the format's: agents read the closest
|
|
216
|
+
* `AGENTS.md` in the tree (nested, nearest-wins; agents.md, retrieved
|
|
217
|
+
* 2026-07-09); Codex concatenates the chain root-to-cwd and stops once
|
|
218
|
+
* combined size hits a byte budget, not a per-file line count
|
|
219
|
+
* (`project_doc_max_bytes`, 32 KiB default;
|
|
220
|
+
* developers.openai.com/codex/guides/agents-md, retrieved 2026-07-09);
|
|
221
|
+
* Gemini CLI reads `GEMINI.md` by default and only treats `AGENTS.md` as an
|
|
222
|
+
* alias when configured via `context.fileName` (geminicli.com/docs/cli/gemini-md,
|
|
223
|
+
* retrieved 2026-07-09); Claude Code does not read `AGENTS.md` natively —
|
|
224
|
+
* bridge it with a `CLAUDE.md` that `@AGENTS.md`-imports it
|
|
225
|
+
* (code.claude.com/docs/en/memory, retrieved 2026-07-09).
|
|
226
|
+
*/
|
|
227
|
+
export declare const memoryAgentsMdDefaultContract: readonly Clause[];
|