@erclx/aitk 0.58.0 → 0.60.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.
@@ -16,6 +16,7 @@ Governs a groundwork track under `.claude/groundwork/<slug>/`: folder layout, re
16
16
  Does not govern:
17
17
 
18
18
  - A dump of many findings filed by domain, each carrying its own verdict: `intake.md`
19
+ - The feature plan a closed track feeds, and the contract its answer slots keep: `plan.md`
19
20
  - The task file a closing track writes, and the origin line pointing back at the folder: `tasks.md`
20
21
  - Voice and word choice: `prose.md`
21
22
  - Headings, punctuation, and file references: `markdown.md`
@@ -14,6 +14,8 @@ Reference docs for consistent authoring across the toolkit and target projects.
14
14
  - [Groundwork reference](groundwork.md): Folder layout, reserved numbering, frontmatter and dating, required file contents, and conventions for a measurement track
15
15
  - [Intake reference](intake.md): Folder layout, reserved index number, frontmatter and dating, the item template, the answer contract, and retrieval
16
16
  - [Markdown reference](markdown.md): Headings, paragraph and list structure, code spans, punctuation, emphasis, and file references
17
+ - [Memory reference](memory.md): Filename and type prefix, frontmatter, the body shape per type, links between entries, and the lifecycle from write to retire
18
+ - [Plan reference](plan.md): Filename and slug, required sections, the suggested-and-answer contract, and the lifecycle from the live folder to the archive
17
19
  - [Prose reference](prose.md): Voice, language, and frontmatter wording for reference markdown
18
20
  - [Publish reference](publish.md): Scan run against finished text leaving through a channel no automated check covers
19
21
  - [Readme reference](readme.md): Readme voice, structure, and content conventions
@@ -16,6 +16,7 @@ Governs an intake folder under `.claude/intake/<slug>/`: folder layout, the rese
16
16
  Does not govern:
17
17
 
18
18
  - One question measured in depth before anyone can plan against it: `groundwork.md`
19
+ - The feature plan a promoted item feeds, and the inverted answer contract it keeps: `plan.md`
19
20
  - The task file promoting an item onto the board, and the origin line pointing back at the folder: `tasks.md`
20
21
  - Voice and word choice: `prose.md`
21
22
  - Headings, punctuation, and file references: `markdown.md`
@@ -0,0 +1,131 @@
1
+ ---
2
+ title: Memory reference
3
+ description: Filename and type prefix, frontmatter, the body shape per type, links between entries, and the lifecycle from write to retire
4
+ ---
5
+
6
+ # Memory reference
7
+
8
+ Applies to a memory entry at `.claude/memory/<type>-<slug>.md`. One file holds one rule or one fact, written at the end of the session that produced it and read by a session that holds none of it. Which surface owns a given fact is settled before an entry is written at all, and that routing is project policy rather than a shape rule.
9
+
10
+ The folder is gitignored and unbacked. Nothing recovers a deleted entry, which is why the retire step below is a move rather than a cleanup.
11
+
12
+ ## Scope
13
+
14
+ Governs a memory entry under `.claude/memory/<type>-<slug>.md`: the filename and its type prefix, the frontmatter, the body shape each type carries, links between entries, and the lifecycle from the first write to retirement.
15
+
16
+ Does not govern:
17
+
18
+ - The per-domain entry a domain fact is routed to instead of memory: `context.md`
19
+ - The feature plan a session executes, and its answer contract: `plan.md`
20
+ - The task file tracking what is being built: `tasks.md`
21
+ - Voice and word choice: `prose.md`
22
+ - Headings, punctuation, and file references: `markdown.md`
23
+ - Which facts a project captures at all, and where the folder sits, which are project policy
24
+
25
+ ## What a working entry looks like
26
+
27
+ An entry works when a session holding none of the conversation that produced it can act on the rule from the file alone:
28
+
29
+ - What is the rule or the fact, stated in one line?
30
+ - What happened in a session to earn it, so a later reader can tell whether it still holds?
31
+ - When does it fire next, and what does the reader do at that moment?
32
+ - Does another surface already own this, which would make the entry a duplicate of something sessions trust more?
33
+
34
+ An entry failing these is non-conforming even when it satisfies every shape rule below.
35
+
36
+ ## Types
37
+
38
+ Four types, and the type decides both the filename prefix and the body shape.
39
+
40
+ | Type | Holds | Fires on |
41
+ | ----------- | -------------------------------------------------------------------- | ------------------------------------------- |
42
+ | `feedback` | a correction or a confirmed approach governing how the agent works | explicit correction, or the same slip twice |
43
+ | `project` | a decision, constraint, or measured fact not derivable from the code | first disclosure |
44
+ | `user` | role, expertise, responsibilities, or working preferences | first disclosure |
45
+ | `reference` | a pointer to an external system, repository, or channel | first disclosure |
46
+
47
+ Hold a feedback entry to the higher bar. A first-occurrence slip is noise, and a folder that records every one of them buries the rules that were paid for.
48
+
49
+ Write no entry for a fact another surface already owns. A fact about a domain belongs in that domain's entry, where sessions working the domain already read it, and the same fact in memory sits in a folder nothing opens. Memory keeps the residue, which in practice is feedback about how to work.
50
+
51
+ ## Filename
52
+
53
+ - Name the file `<type>-<slug>.md`, with `<type>` one of the four above and `<slug>` kebab-case naming the rule rather than the incident.
54
+ - Write one rule per file. Two rules under one slug cannot be retired or promoted separately, and one of them always outlives the other.
55
+ - Keep the prefix and the `category` field the same fact in two spellings. A prefix outside the four types reads as a fifth type to anything grouping the folder, and it silently belongs to none.
56
+
57
+ ## Frontmatter
58
+
59
+ Every entry carries all three fields.
60
+
61
+ ```yaml
62
+ ---
63
+ title: A scope glob wide enough for a correct run can be wide enough for every wrong one
64
+ description: Omit a declaration key whose only passing value admits the whole tree
65
+ category: Project
66
+ ---
67
+ ```
68
+
69
+ - `title` (required): the rule stated as a line a reader can act on, in sentence case.
70
+ - `description` (required): one line naming what the entry settles, so a reader scanning the catalog decides whether to open it.
71
+ - `category` (required): the type in sentence case, which is what groups the catalog.
72
+
73
+ Never write the filename stem as the `title`. The stem is a slug, and an entry titled with it reads as an unwritten file in every catalog that renders the field.
74
+
75
+ Quote a `description` opening with a backtick or a colon. An unquoted one fails to parse and takes the whole folder's catalog with it.
76
+
77
+ ## Body
78
+
79
+ A `feedback` or `project` body carries three parts in this order. Blank lines between them are optional and the three parts are not.
80
+
81
+ - The rule or the fact, stated in one or two sentences as something to do rather than something that happened.
82
+ - A `**Why:**` line naming the session signal that earned it. This is what a later reader tests the rule against when the tree has moved.
83
+ - A `**How to apply:**` line naming the next moment the rule fires and what to do then.
84
+
85
+ A `user` or `reference` body is a single sentence and carries neither marker. There is no rule to apply and no signal to date, so the two lines would be filler.
86
+
87
+ Capture the pattern rather than the recovery. What was tried, what failed, and who noticed belong to the session that is ending, and a body carrying them is a story where the next reader needs an instruction.
88
+
89
+ ## Links
90
+
91
+ Link a related entry as `[[name]]`, where `name` is the target's filename stem without the extension. Link freely: the folder is flat and the links are the only structure it has.
92
+
93
+ - Place links inside the body part they support, not in a list of their own at the end.
94
+ - A link naming an entry nobody has written yet is legal, and it marks a rule worth writing rather than a defect.
95
+ - A bracketed token inside a code span is not a link. Backticked syntax from another language routinely reads as one.
96
+
97
+ ## Lifecycle
98
+
99
+ - Check the folder for an entry on the same topic before writing a new one, and update that entry in place when one exists. Two entries on one rule disagree the moment either is edited.
100
+ - Rewrite an entry the tree has moved under rather than appending a second passage narrating the change. A reader cannot tell which of two claims is current.
101
+ - Never delete an entry. Retire one by moving it to an archive under its own name, because the folder is unbacked and a bulk judgment has no undo behind it.
102
+ - Treat the folder as a holding pen rather than a destination. An entry whose rule belongs on a durable surface is promoted there and retired here, and the rest is what the pen is for.
103
+
104
+ The catalog is generated from sibling frontmatter rather than authored. Never hand-edit it, since the next regeneration discards whatever was added by hand.
105
+
106
+ ## Anti-patterns
107
+
108
+ - **The domain fact filed as memory.** It reads as a capture and lands in the one folder no session opens while working that domain.
109
+ - **The incident narrative.** A body recounting what went wrong states no rule, so the next reader has to infer one and infers a different one.
110
+ - **The entry titled with its own slug.** Every catalog rendering the field shows a filename where the rule should be.
111
+ - **The duplicate written beside the original.** Two entries on one topic drift, and nothing says which is current.
112
+ - **The first-occurrence capture.** A folder recording every slip buries the rules that repeated.
113
+ - **The entry deleted on retire.** The folder has no history, so the judgment that discarded it cannot be reviewed or reversed.
114
+
115
+ ## Template
116
+
117
+ ```markdown
118
+ ---
119
+ title: <the rule, stated as a line a reader can act on>
120
+ description: <one line naming what the entry settles>
121
+ category: <Feedback|Project|User|Reference>
122
+ ---
123
+
124
+ <the rule or fact, in one or two sentences, as something to do>
125
+
126
+ **Why:** <the session signal that earned it, with the measurement where one exists>
127
+
128
+ **How to apply:** <the next moment it fires, and what to do then> See [[related-entry]].
129
+ ```
130
+
131
+ A `user` or `reference` entry carries the same frontmatter and a single sentence in place of the three parts.
@@ -0,0 +1,145 @@
1
+ ---
2
+ title: Plan reference
3
+ description: Filename and slug, required sections, the suggested-and-answer contract, and the lifecycle from the live folder to the archive
4
+ ---
5
+
6
+ # Plan reference
7
+
8
+ Applies to a feature plan at `.claude/plans/feature-<slug>.md`. One file holds one concern, written before implementation starts and read by whatever executes it, so it has to carry the scope without the conversation that produced it.
9
+
10
+ The folder is gitignored and unbacked. Nothing recovers a deleted plan, which is why the archive step below is a move rather than a cleanup.
11
+
12
+ ## Scope
13
+
14
+ Governs a feature plan under `.claude/plans/feature-<slug>.md`: the filename, the required sections, what each holds, the suggested-and-answer contract, and the lifecycle from the live folder to the archive.
15
+
16
+ Does not govern:
17
+
18
+ - One question measured in depth before anyone can plan against it: `groundwork.md`
19
+ - A dump of many findings filed by domain, each carrying its own verdict: `intake.md`
20
+ - The task file a plan is linked from, and the origin line pointing back at it: `tasks.md`
21
+ - The transform from a branch name to a slug: `slug.md`
22
+ - Voice and word choice: `prose.md`
23
+ - Headings, punctuation, and file references: `markdown.md`
24
+ - When a plan is written at all, and whether a short one goes to a file or to the conversation, which belong to the surface driving it
25
+
26
+ ## What a working plan looks like
27
+
28
+ A plan works when a session holding none of the conversation that produced it can execute from the file alone:
29
+
30
+ - What is being built, and which files does it change?
31
+ - Which decisions are already settled, and which are still open?
32
+ - For each open decision, what happens when nobody answers it?
33
+ - What is likely to go wrong, and where does the work collide with something already in flight?
34
+
35
+ A plan failing these is non-conforming even when it satisfies every shape rule below.
36
+
37
+ ## Filename and slug
38
+
39
+ - Name the file `feature-<slug>.md`, with `<slug>` two to four kebab-case words naming the concern.
40
+ - Write one concern per file. A request spanning two independent concerns takes two plans rather than one bundling both, since a bundled plan cannot be executed by two sessions or abandoned by half.
41
+ - Derive the slug from the concern rather than from a branch, because the plan is written before the branch exists.
42
+ - Give the branch that executes the plan the same slug. A later surface finds the plan from the branch name and finds nothing when the two spellings differ.
43
+
44
+ A plan carries no frontmatter. Its filename is the whole of its identity, so a folder of plans is read by name rather than by a generated catalog.
45
+
46
+ ## Sections
47
+
48
+ The document opens with `# Feature: <short title>` and one paragraph stating what is being built and why now. The sections below follow in this order.
49
+
50
+ | Section | Holds | Required |
51
+ | --------------------- | ------------------------------------------------------------------------- | ------------- |
52
+ | `## Summary` | three to five one-line bullets: the goal, the deliverables, the trade-off | Always |
53
+ | `**Constraints:**` | durable rules the work must respect | When supplied |
54
+ | `**Files to touch:**` | each file with a one-line reason | Always |
55
+ | `**Risks:**` | conflicts, coupling, and the tricky spots | Always |
56
+ | `**Questions:**` | numbered open decisions, each with a suggestion and an answer slot | Always |
57
+
58
+ - Write each marker as the table gives it. `Summary` opens the prose a reader scans, so it takes an H2, and the four that follow are labels over lists rather than sections of prose.
59
+ - A section written in the other spelling is still that section. `## Risks` and `**Risks:**` name one thing, and a plan carrying either has stated its risks, so neither reads as an omission. Write the table's form in a new plan and leave an existing plan's spelling alone.
60
+ - Write `None identified.` under a required section with nothing to report rather than dropping the marker. A dropped section and an unconsidered one read identically.
61
+ - Aim `## Summary` at a person scanning the plan, not at the session executing it. The other sections carry what execution needs.
62
+ - Give every `**Files to touch:**` entry a backticked path and something said about it. A bare path states scope and not intent, and the reason is what an executing session checks its edit against. Lead with the path or lead with a label carrying the path, whichever reads better for the entry.
63
+ - State every count and every claim about the tree as measured during the pass that wrote the plan. A figure carried in from a summary or an earlier session is the most common way a plan ships the wrong scope.
64
+ - Prefer a short plan over a padded one. A section filled to look thorough costs the reader the same attention as one that matters.
65
+
66
+ ### Constraints
67
+
68
+ A constraint naming a surface to leave alone forbids two different acts, and it says which. A constraint carrying only the surface leaves the executing session to guess.
69
+
70
+ - Forbid conforming that surface to whatever shape the change introduces. This is what a scope constraint means, and it keeps the branch from growing a second concern.
71
+ - Never forbid retargeting a pointer the change breaks. A rename, a split, or a deletion that leaves a citation behind ships a dangling reference, so repairing it is required work rather than scope creep.
72
+ - Decide both acts for every surface the constraint names. Carving the distinction out for one file and leaving its siblings under the bare wording ships one correct call beside one broken reference.
73
+
74
+ ### Risks
75
+
76
+ - Name the collision rather than the category. A risk a reader cannot act on is padding.
77
+ - Where the work establishes a resource with more than one consumer, list the consumers and mark each one read or write. A policy stated over that resource has to hold for the writers and not only for the consumer that prompted it.
78
+
79
+ ## The suggested-and-answer contract
80
+
81
+ Every question carries a `- Suggested:` line and an empty `- Answer:` slot below it.
82
+
83
+ ```markdown
84
+ 1. <question>
85
+ - Suggested: <pick>, <reason or tradeoff>
86
+ - Answer:
87
+ ```
88
+
89
+ - A blank `- Answer:` means accept the suggestion at execution time. That default is what makes the plan decision-ready in one pass, with no separate round to collect answers.
90
+ - Never ship a question without a suggestion. A bare question defers the judgment the plan exists to supply, and it arrives at the executing session as a stop.
91
+ - State the pick in one line with its reason or its main tradeoff. List an alternative only where it changes the pick.
92
+ - Write `- Suggested: needs your call, <why>` where the answer turns on preference rather than on a technical default. Fabricating a default there hides an open question behind an accepted answer.
93
+ - Never fill an `- Answer:` slot on behalf of the person who owns it. Recording the pick as the suggestion is what the suggestion line is for.
94
+ - Answer in place when a question is settled in conversation, so the file and the decision do not disagree.
95
+
96
+ This contract inverts the one an intake folder keeps, where an empty slot means unread and acceptance is typed out. A plan is written and read in one sitting with every question already surfaced, so silence is a usable default here and is not one there. Both files state the inversion, since a contract read on only one side of a boundary is the one that gets applied to the wrong document.
97
+
98
+ ## Lifecycle
99
+
100
+ - Write the plan before implementation starts, and treat it as the scope of the run that executes it.
101
+ - Keep every plan at one root. A plan copied into each parallel working tree forks, and the copies answer the same question differently.
102
+ - Amend the plan in place when a decision changes mid-flight. Do not append a second passage narrating the change, which leaves a reader to work out which of two answers is current.
103
+ - Move the plan to `.claude/plans-archive/` when the work it describes ships. Never delete it, because the plan is where the rejected alternative is written down and nothing else records it.
104
+ - Write the plan in the same session that opens the task it serves. The session executing it later inherits reasoning it would otherwise re-derive.
105
+
106
+ ## Anti-patterns
107
+
108
+ - **The plan written before the measuring.** A subject that has to be measured before anyone can plan against it belongs in a measurement track, and every plan that skipped that step had to be superseded.
109
+ - **The bundled plan.** Two concerns under one slug cannot be split later without rewriting both halves.
110
+ - **The question with no suggestion.** It reads as thoroughness and lands as a blocked run.
111
+ - **The answer filled in by the author.** A slot holding the writer's own pick destroys the only signal that anyone else agreed.
112
+ - **The count carried in.** A figure quoted from an earlier session survives the change that invalidated it, and the scope built on it is quietly wrong.
113
+ - **The plan deleted on ship.** The considered-and-dropped reasoning goes with it, and the next session re-proposes what this one rejected.
114
+
115
+ ## Template
116
+
117
+ ```markdown
118
+ # Feature: <short title>
119
+
120
+ <One paragraph on what is being built and why now.>
121
+
122
+ ## Summary
123
+
124
+ - <one-line bullet covering the goal>
125
+ - <one-line bullet covering the main deliverables>
126
+ - <one-line bullet covering the key decision or trade-off>
127
+
128
+ **Constraints:**
129
+
130
+ - <durable rule the work must respect>
131
+
132
+ **Files to touch:**
133
+
134
+ - `<path/to/file>`: <reason>
135
+
136
+ **Risks:**
137
+
138
+ - <conflict, coupling, or tricky spot>
139
+
140
+ **Questions:**
141
+
142
+ 1. <question>
143
+ - Suggested: <pick>, <reason or tradeoff>
144
+ - Answer:
145
+ ```
@@ -15,6 +15,7 @@ Governs the task board under `.claude/tasks/`: folder layout, filenames, frontma
15
15
 
16
16
  Does not govern:
17
17
 
18
+ - The plan file a task cites, its sections, and its answer contract: `plan.md`
18
19
  - Phase-label format and which surfaces a label may appear on: `versioning.md`
19
20
  - Sequencing across versions and why the order is what it is: `roadmap.md`
20
21
  - Architectural reasoning that outlives a task: `architecture.md`
@@ -73,11 +73,8 @@
73
73
 
74
74
  - Write all memory files to `.claude/memory/`, not `~/.claude/projects/`
75
75
  - A fact about a domain goes to that domain's `.claude/context/` entry, not to memory. `claude-memory-capture` routes it there and `claude-docs` folds it in. Memory keeps only what no context entry owns.
76
- - Save a feedback memory only when the same mistake happens twice in the session, or when the user explicitly corrects you. First-occurrence slips are noise.
77
- - Keep feedback memories to 3 lines: the rule, a one-line Why, and a one-line How to apply. Capture the pattern, not the recovery narrative.
78
- - Before creating a new memory file, check for an existing one on the same topic. Update rather than duplicate.
79
- - Give every entry `title`, `description`, and a sentence-case `category`. Never hand-edit `.claude/memory/index.md`. A hook regenerates it from sibling frontmatter.
80
- - Never delete a memory entry. `claude-memory-review` moves a retired one to `.claude/.tmp/memory-archive/`.
76
+ - Never delete a memory entry. Retire one by moving it to `.claude/.tmp/memory-archive/`. A bulk retire runs through the shell, where no file edit fires a path-scoped rule, and the folder is gitignored with nothing to recover from.
77
+ - Follow `.claude/standards/memory.md` for the filename and type prefix, the frontmatter, the body shape each type carries, and the lifecycle. Run `aitk records validate memory` to check the pen against it.
81
78
 
82
79
  ## Scratch
83
80