@erclx/aitk 3.4.0 → 3.5.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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aitk",
3
3
  "description": "Automated governance, versioning, and discovery tools for Claude Code.",
4
- "version": "3.4.0",
4
+ "version": "3.5.0",
5
5
  "author": {
6
6
  "name": "Eric Le",
7
7
  "url": "https://github.com/erclx"
@@ -40,7 +40,7 @@ No surface carries cross-version sequencing, so report none. A row's `Waiting on
40
40
 
41
41
  A compaction is a moment this skill cannot detect, so the human asks for each side of it and this skill reads the matching runbook when they do.
42
42
 
43
- On a request to write the handoff or save the session, read `${CLAUDE_SKILL_DIR}/references/orchestrator-handoff.md` and follow it. It captures what the session learned, then writes a session map per `${CLAUDE_SKILL_DIR}/../../standards/session.md`, carrying the state of play, the mistakes worth not repeating, and the standing cautions, with the decisions taken under delegated authority added as this role's extension. That capture is the only one this session runs, since the refill sweep reports it as owed rather than paying it. Write nothing to the handoff that the board, a task file, or a groundwork folder already carries.
43
+ On a request to write the handoff or save the session, read `${CLAUDE_SKILL_DIR}/references/orchestrator-handoff.md` and follow it. It sends the generic half to `aitk:session-map`, which captures what the session learned and writes a session map per `${CLAUDE_SKILL_DIR}/../../standards/session.md`, then adds the decisions taken under delegated authority as this role's extension. That capture is the only one this session runs, since the refill sweep reports it as owed rather than paying it. Write nothing to the handoff that the board, a task file, or a groundwork folder already carries.
44
44
 
45
45
  On a request to resume after a compaction, read `${CLAUDE_SKILL_DIR}/references/orchestrator-resume.md`, which reads that file back with the board and the groundwork behind the live work.
46
46
 
@@ -3,9 +3,11 @@ title: Orchestrator handoff runbook
3
3
  description: The two sections an orchestrating session adds over the shared session map, how capture runs from a session that never commits, and the resume invocation the file carries out
4
4
  ---
5
5
 
6
- Write the pre-compaction handoff as orchestrator. Follow `${CLAUDE_SKILL_DIR}/../../standards/session.md` for the filename, the three core sections, the write procedure, and the citation rule. Everything below is the extension this role adds over that core, and none of it belongs to a session holding no delegated authority.
6
+ Write the pre-compaction handoff as orchestrator. Invoke `aitk:session-map` for the generic half, which is the filename, the three core sections, the write procedure, the drift step and the ref it reads, and the citation rule. Everything below is the extension this role adds over that core, and none of it belongs to a session holding no delegated authority.
7
7
 
8
- 1. Run the capture step the core opens with, and tell `aitk:claude-memory-capture` that this session does not commit.
8
+ Settle all three steps below before the door writes, so one write carries the core and the extension together. The door reports the map as written and knows nothing of this role, so its success line ends the generic half rather than this runbook, and a session that stops there ships a map missing both of the things this file exists to add.
9
+
10
+ 1. Tell the door this session does not commit, which is the caveat its capture step takes and passes to `aitk:claude-memory-capture`.
9
11
  2. Add `## Decisions taken under delegated authority` directly after `## State`, holding each decision and why it went that way, so nobody re-proposes it. It sits there rather than after the core because a decision is read against the state it was taken in.
10
12
  3. Close the file with the block below, resolving `${CLAUDE_SKILL_DIR}/references/orchestrator-resume.md` and `${CLAUDE_SKILL_DIR}/references/orchestrator-poll.md` to absolute paths as you write it and pasting each in place of `<RESUME_RUNBOOK>` and `<POLL_RUNBOOK>`:
11
13
 
@@ -25,6 +27,6 @@ The requirement is a resume request to the orchestrator skill with that skill lo
25
27
 
26
28
  Step 1 exists because both other callers of capture are ship-chain skills and this session never ships. Without a call here, the session that receives every operator correction is the one session that records none. A compaction arriving with no warning takes the capture with it, and firing it once per batch of merges leaves the same window open across a long planning stretch, since a sweep runs only on a merge. The refill sweep reports the debt between handoffs so the operator knows one is owed.
27
29
 
28
- Capture is told this session does not commit, so it skips routing and writes memory files alone. A routed fact lands in a context entry, which is a tracked file, and the orchestrator's boundaries forbid writing one from this session. That split is correct rather than a limitation, since a domain fact belongs to the task that owns the surface and goes in that task's Findings, while what this session produces is feedback about how to work.
30
+ Step 1 varies the door rather than replacing it, which is why the door is invoked first and this runbook states only what differs. The generic half moved out whole, the drift step and its ref recovery with it, so nothing here restates a step the door already carries and the two cannot disagree.
29
31
 
30
- The core's drift step answers where the working directory carries `claude/skills/` with history behind it, which is the toolkit repository itself, and refuses by naming the absent tree anywhere else. A project consuming the plugin from a marketplace cache is that second case, so read the refusal as the boundary rather than as a fault.
32
+ Capture is told this session does not commit, so it skips routing and writes memory files alone. A routed fact lands in a context entry, which is a tracked file, and the orchestrator's boundaries forbid writing one from this session. That split is correct rather than a limitation, since a domain fact belongs to the task that owns the surface and goes in that task's Findings, while what this session produces is feedback about how to work.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: session-map
3
+ description: Why the write procedure needs a route any session can take, why the door carries the drift step and its ref recovery, and why it states none of the shape the standard already fixes
4
+ ---
5
+
6
+ # Session map requirement
7
+
8
+ ## Gap
9
+
10
+ Without this skill, the standard governing the pre-compaction handoff carries a complete numbered write procedure and nothing routes a session to it. The reading half already works, since the resume path opens the newest map and leads its report with it, so a file nobody is routed to write is read by a surface built to find it.
11
+
12
+ The only routed writer belongs to the orchestrator role. It disables model invocation, asserts that role on invocation, and adds a section for decisions taken under delegated authority, so a plain feature session that reaches it receives a section it cannot fill and a review poll it does not run.
13
+
14
+ The nearest description by wording writes a different artifact. Capture routes facts to a context entry and writes memory files, and a request naming the session and the moment matches it, so the map goes unwritten while a session believes it has handed off.
15
+
16
+ The drift step is the one most specific to session length and the easiest to skip. It reads the commit the session started from, nothing on the machine records that commit, and a route that names the step without naming how to recover the ref ships an instruction nobody can follow.
17
+
18
+ A step that reads a surface a project may not carry gets skipped on the reasoning that it has nothing to act on. A cold session run against a project with no `.claude/` tree skipped both the capture and the drift step and wrote its own rationale into the map, so the step the route exists to carry did not run on the first test from outside. The skip is worst where it looks most defensible, and a session that takes it quietly leaves a map indistinguishable from a conforming one.
19
+
20
+ A capture fired the same way for every caller breaks the one caller the split leaves. An orchestrating session may write no tracked file, so its capture has to skip routing, and a route offering no way to say so leaves that reader running capture twice or routing facts the role forbids it to fold.
21
+
22
+ A body that restates the sections, the frontmatter, or the numbered steps becomes a second source that drifts from the standard, which is the failure the split between the role writer and the core was made to remove rather than move.
23
+
24
+ ## Must
25
+
26
+ - Write from any session whatever role it holds, without asserting one
27
+ - Cite the standard for the filename, the frontmatter, the sections, the numbered procedure, and the citation rule rather than restating any of them
28
+ - Run the drift step and state how to recover the ref it reads from how long the session has run
29
+ - Record what the drift verb names, and read a refusal as the boundary of what the verb can read
30
+ - Resolve the folder at the main worktree root, and write the file whole from the shell where the editing tools refuse that root
31
+ - Fall back to the branchless filename on an empty slug rather than stopping
32
+ - Leave model invocation enabled, so a session that has dropped its routing still reaches this by description
33
+ - Take a caller's statement that the session does not commit and pass it to capture, so no fact this route fires is routed into a tracked file
34
+ - Report the map alone, plus the line capture returns when a fact routed, since a fold left unreported is a fold nobody runs
35
+
36
+ ## Must not
37
+
38
+ - Restate the standard's sections, frontmatter, or numbered steps
39
+ - Skip a step by predicting what its skill or verb would have answered, rather than running it and recording what came back
40
+ - Assert a role, or add a role's section to a map written by a session holding no such role
41
+ - Fold the capture step's output into this skill's report
42
+ - Take the worktree-local copy the editing tools offer in place of the main-root path
43
+ - Summarize the board, the task files, or the work that shipped, each of which is carried by an artifact a compaction leaves standing
44
+
45
+ ## Guards
46
+
47
+ - Not a git repository: stop, since the filename comes from the branch
48
+ - Empty slug: fall back rather than stop, since the reasoning is worth more than the name
49
+ - The drift verb refusing: record the boundary under standing cautions and keep writing
50
+
51
+ ## Out of scope
52
+
53
+ - Reading a handoff back at the start of the next session: `session-resume`
54
+ - Routing a session fact to the context entry that owns it, and writing what no entry owns to the memory folder: `claude-memory-capture`
55
+ - The sections a role adds over the core three, which belong to that role's own surface. `claude-orchestrate` owns the orchestrator's and cites this route for the generic half.
56
+ - Validating a written map against the standard, which no record kind covers, so a conforming shape rests on the standard being followed
57
+ - Firing the write without being asked, which is a question about what the harness supports and is measured on its own track
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: session-map
3
+ description: Writes the session map, the pre-compaction handoff at `.claude/tasks/session-<slug>.md`, from any session whatever role it holds, running the skill-drift step the write procedure opens with. Use when asked to "write the handoff", "write the session map", "save the session before it compacts", "we are about to compact", "hand off to the next session", or "leave a note for whoever picks this up". Do NOT use to route session facts to a context entry or the memory folder, which is `claude-memory-capture` and writes a different artifact, and do NOT use to read a handoff back, which is `session-resume`.
4
+ ---
5
+
6
+ # Session map
7
+
8
+ Write the pre-compaction handoff for the current session. `${CLAUDE_SKILL_DIR}/../../standards/session.md` fixes the filename, the frontmatter, the three core sections, the numbered write procedure, and the citation rule. Follow that document rather than this body, which states when the procedure runs and what it runs against and leaves the shape where it already lives.
9
+
10
+ Any session writes one. Do not assert a role on invocation, and do not add a role's sections to a map written by a session holding no such role.
11
+
12
+ Run every step rather than judging in advance that one has nothing to act on. The capture skill and the drift verb each answer for themselves, refusal included, and a refusal recorded is a result where a prediction of one is not. A project carrying none of the scaffolding either step reads is the case this fires on, and it is the case where skipping looks most defensible.
13
+
14
+ ## Guards
15
+
16
+ - If `git rev-parse --git-dir` does not resolve, stop: `❌ Not a git repository. A session map takes its filename from the branch.`
17
+ - Derive `<slug>` per `${CLAUDE_SKILL_DIR}/../../standards/slug.md`. An empty result falls back to `latest` rather than stopping, since a handoff is scratch and a stop loses the reasoning the file exists to save.
18
+ - Resolve the containing folder at the main worktree root with `git worktree list --porcelain | grep -m 1 '^worktree ' | cut -d' ' -f2-`. The guard above already stopped where that read has no repository to answer from, so it takes no fallback.
19
+
20
+ ## Step 1: run the capture the procedure opens with
21
+
22
+ Item 1 of `## Writing one` is a capture. Invoke `aitk:claude-memory-capture` and let it return before writing, so the map cites what was written instead of restating the same lesson in prose.
23
+
24
+ Pass on the caveat a caller states about committing. A caller that does not commit says so, and capture then skips routing and writes memory files alone, since a routed fact lands in a context entry and that is a tracked file. A caller stating nothing leaves capture to decide for itself, which is the ordinary run.
25
+
26
+ Carry through the line capture returns when a fact routed, so the session knows a fold is still owed. Report nothing else about what it wrote. The map is this skill's output.
27
+
28
+ ## Step 2: recover the commit the drift step reads
29
+
30
+ Item 2 runs `aitk claude skills drift <ref>` against the commit this session started from, and nothing on the machine records that commit. Estimate how long the session has run, round the duration up, and read the ref item 3 recovers:
31
+
32
+ ```bash
33
+ git log -1 --format=%H --before='<duration> ago'
34
+ ```
35
+
36
+ Round up rather than down. A ref older than the oldest load over-reports, and confirming a name it raises costs one read of that body, so the generous end is the safe one.
37
+
38
+ Record what the verb names under `## Standing cautions`. A refusal is the boundary of what the verb can read rather than a fault, since it answers where the working directory carries `claude/skills/` with history behind it and refuses in a project consuming the plugin from a cache. Record the boundary the verb reported and keep writing, rather than the one it looked likely to report.
39
+
40
+ ## Step 3: write the map
41
+
42
+ Follow items 4 through 6. Write only what a compaction destroys and no other artifact already carries, and cite a commit, a task, or a file and line for every claim.
43
+
44
+ The file sits at the main worktree root, which the file-editing tools refuse from inside a linked worktree while offering a copy under that worktree instead. Take neither the refusal nor the copy. The map is written whole every time, so send it out as one plain shell command carrying a heredoc.
45
+
46
+ ## Step 4: extend it only where a role is held
47
+
48
+ `## Extending it` governs a section added over the core three. Add one only when this session holds the role and the surface owning that role states the section, since a section the writer cannot fill teaches its reader to skip the file. A session holding no role writes the core three and stops.
49
+
50
+ ## Output
51
+
52
+ ```plaintext
53
+ ✅ Session map written: .claude/tasks/session-<slug>.md
54
+ <what the drift verb named, or the boundary it refused at>
55
+ ```
56
+
57
+ Emit the path from the project root. The `## Output` section of the project's instruction file sets the form it takes.
@@ -250,6 +250,7 @@ This section is the corpus the coverage claim is measured against: every name `a
250
250
  | ------------------------- | ------------------------------------------------------------------------------ |
251
251
  | `aitk:claude-orchestrate` | To assert the control session that owns the queue and reviews each worker's PR |
252
252
  | `aitk:session-resume` | At the start of a session, to pick up what a previous one left |
253
+ | `aitk:session-map` | At the close of a session, to write the handoff a compaction would destroy |
253
254
 
254
255
  ### Keep the project current with the toolkit
255
256
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@erclx/aitk",
3
3
  "type": "module",
4
- "version": "3.4.0",
4
+ "version": "3.5.0",
5
5
  "description": "Infrastructure and quality tooling for developer workflows",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -56,9 +56,11 @@ Add a section only for content that fits none of the three and would otherwise b
56
56
 
57
57
  ## Writing one
58
58
 
59
+ The `session-map` skill is the invocable route onto this procedure and holds no role, so a session reaching for a handoff without knowing this document exists still lands here. A session that arrives at this document directly follows the steps below unchanged.
60
+
59
61
  1. Capture what the session learned first, so the map cites what was written instead of restating the same lesson in prose.
60
62
  2. Run `aitk claude skills drift <the commit this session started from>` and record what it names under `## Standing cautions`. A skill body enters a session once and re-invoking the skill does not re-read the file, so the drift is worst at exactly this moment and a name here is a body the session has been following out of date. Recording a name is not acting on it, and the verb misses a body this session edited and has not committed. This step belongs to session length rather than to any role, so every writer runs it, and a refusal names the boundary of what the verb can read rather than a fault.
61
- 3. Recover that commit from how long the session has been running with `git log -1 --format=%H --before='<duration> ago'`, rounding the duration up rather than down. Nothing on the machine records it. A ref older than the oldest load over-reports, and confirming a name costs one read of the body, so the generous end is the safe one and a guess at the exact commit is not worth making.
63
+ 3. Recover that commit from how long the session has been running with `git log -1 --format=%H --before='<duration> ago'`, rounding the duration up rather than down. Nothing on the machine records it. A ref older than the oldest load over-reports, and confirming a name costs one read of the body, so the generous end is the safe one and a guess at the exact commit is not worth making. An empty result means no commit predates the window, so take the oldest commit the history holds and say which of the two the ref came from.
62
64
  4. Write only what a compaction destroys and no other artifact already carries. The board holds the ordering and what each task waits on, a task file holds its own findings, and a measurement folder holds its track.
63
65
  5. Cite a commit, a task, or a file and line for every claim, so the next session can tell a read from a recall.
64
66
  6. Fill a section from reasoning the session actually holds. A session with no cross-feature picture that fills `## State` from what is already in git has written a summary of the tree, which the reader can produce faster than they can read it.
@@ -76,6 +78,7 @@ Do not restate the board, and do not summarize the work that shipped, since vers
76
78
  - Carry every core section whatever else a role adds, and state in the surface that adds a section why the core cannot carry it
77
79
  - Let the adding surface fix where its own section sits, so a role can place one between core sections where that reads better. The core order holds among the core sections alone.
78
80
  - Keep a section out of the core when a session holding no such role would leave it unfilled. An unfilled section teaches a reader to skip the file.
81
+ - Cite the route onto `## Writing one` rather than restating the procedure, so the extension is the only thing the adding surface carries and the two cannot fall out of step
79
82
  - Carry a resume instruction inside the map itself when the routing to that instruction is what a compaction takes. The map survives what the instruction was loaded from, so each reaches a reader the other cannot.
80
83
 
81
84
  ## Template