@erclx/aitk 1.5.0 โ 1.7.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.
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/claude-docs/REQUIREMENT.md +5 -0
- package/claude/skills/claude-docs/SKILL.md +19 -4
- package/claude/skills/claude-memory-review/REQUIREMENT.md +4 -1
- package/claude/skills/claude-memory-review/SKILL.md +17 -7
- package/docs/agents/records.md +4 -4
- package/docs/ai-workflow.md +3 -1
- package/package.json +1 -1
- package/scripts/core/check-color-source.sh +41 -0
- package/scripts/core/snapshot.sh +17 -15
- package/scripts/core/verify.sh +1 -0
- package/scripts/lib/ui.sh +82 -13
- package/scripts/manage-sandbox.sh +6 -0
- package/scripts/tooling/ref.sh +6 -0
- package/src/records/backup.ts +1 -0
- package/standards/memory.md +13 -0
- package/tooling/claude/manifest.toml +1 -1
- package/tooling/claude/reference.md +2 -1
|
@@ -13,6 +13,8 @@ A decision's verification anchor has the same shape of gap in the other directio
|
|
|
13
13
|
|
|
14
14
|
A handoff file has the same shape of gap as an unmarked outcome. A page a learning workspace produced and an operator already picked a destination for sits in gitignored scratch until something lands it, and the session that produced it is gone by the time a branch exists to carry the write. Left unfolded it reads as promoted while the destination holds nothing.
|
|
15
15
|
|
|
16
|
+
The receipt half of that sweep was missing entirely. A review receipt is deleted per shipped branch and a memory-review receipt was skipped, because the exclusion protecting the checklist and audit prefixes caught a third by accident. Nothing but an operator asking collected it, and a collection that waits on someone remembering to ask is one a folder outgrows, so the skipped population grew per shipped branch and never shrank until it was most of the folder.
|
|
17
|
+
|
|
16
18
|
The trigger side carries a gap of its own. "Sync the docs" names either corpus to the person saying it, so a description leaving its corpus to the opening clause alone competes with its public-facing sibling on nothing the routing field states, and the planning surface the request was about goes untouched.
|
|
17
19
|
|
|
18
20
|
## Must
|
|
@@ -26,6 +28,9 @@ The trigger side carries a gap of its own. "Sync the docs" names either corpus t
|
|
|
26
28
|
- Retarget a closed task at the archived plan, so the reasoning behind finished work stays reachable
|
|
27
29
|
- Anchor a decision entry this run writes or amends whose reasoning cites a measured number, re-reading the number against the tree before writing the marker
|
|
28
30
|
- Report an anchored decision whose cited path the diff touched, since the number was read before the branch moved what it counted
|
|
31
|
+
- Scan every memory-review receipt rather than the one matching this slug, since the skill that writes them runs after this one in the ship chain and a slug is unique per feature
|
|
32
|
+
- Collect a memory-review receipt whose items are all decided, folding each skip into its memory entry first, since a declined item is recorded nowhere else and a promoted one is already in git
|
|
33
|
+
- Leave a memory-review receipt holding a pending item, and report the count. A branch shipping is not an operator deciding what the receipt proposed.
|
|
29
34
|
- Land each block of a promotion handoff at the destination its heading names, then delete the file so a later run does not fold it twice
|
|
30
35
|
- Take a promotion destination as already decided, since the operator confirmed it where the page was produced
|
|
31
36
|
|
|
@@ -215,7 +215,9 @@ Sweep reviews this session consumed, and sweep plans across the whole board. Res
|
|
|
215
215
|
|
|
216
216
|
Every move and delete below is a shell operation, so send each as a plain single `Bash` command rather than joining a `mkdir -p` to the `mv` with `&&`, which is refused as compound from a linked worktree. The one edit inside an existing file is the `Plan:` retarget, and no verb covers it: read the task file and write it back whole with a heredoc, which the file-editing tools refuse from a linked worktree and no shell stream editor may do.
|
|
217
217
|
|
|
218
|
-
|
|
218
|
+
### Plans
|
|
219
|
+
|
|
220
|
+
Scan every file in `.claude/tasks/`, not only the ones this session touched. For each task file whose outcomes are now all `[x]`, check for a `Plan:` line directly under the title and parse the target.
|
|
219
221
|
|
|
220
222
|
The line carries a markdown link, so read the target out of the parentheses rather than taking the rest of the line. A task still carrying the older bare-path form parses the same way once the link is absent, so accept both. Resolve the target against `.claude/tasks/` before routing on it, which lands `../plans/x.md` and `.claude/plans/x.md` on the same file.
|
|
221
223
|
|
|
@@ -242,17 +244,30 @@ A plan can serve more than one task, and archiving on the first task to close st
|
|
|
242
244
|
|
|
243
245
|
Write the retarget as a markdown link, `Plan: [feature-<slug>](../plans-archive/feature-<slug>.md)`, updating both halves so the text and the target stay in step. This branch is the only writer that produces a `Plan:` line nobody authored by hand, so a retarget that emits a bare path converts every task to the old form as it closes and drifts the board back to two shapes on its own.
|
|
244
246
|
|
|
245
|
-
|
|
247
|
+
### Reviews
|
|
248
|
+
|
|
249
|
+
Derive `<slug>` per `${CLAUDE_SKILL_DIR}/../../standards/slug.md`. Fall back to `latest` on an empty result.
|
|
250
|
+
|
|
251
|
+
If `.claude/review/review-<slug>.md` exists, delete it. `claude-review` writes with this convention.
|
|
252
|
+
|
|
253
|
+
Memory receipts sweep board-wide, like plans above and unlike the review receipt. Scan every `.claude/review/memory-review-*.md`, not only the one matching this slug. `claude-memory-review` writes its receipt after this skill has run in every ship chain, so a sweep keyed on the current slug looks for a file that does not exist yet, and no later branch looks for it either because a slug is unique per feature. Scanning the folder is what makes the sweep fire at all.
|
|
254
|
+
|
|
255
|
+
For each receipt, count the H2 items still marked ๐ pending:
|
|
256
|
+
|
|
257
|
+
- No pending item: fold it per the collection rule in `${CLAUDE_SKILL_DIR}/../../standards/memory.md`, then delete the receipt.
|
|
258
|
+
- Any pending item: leave it and report the count. Pending items are decision state, and a branch shipping is not an operator deciding them.
|
|
246
259
|
|
|
247
|
-
|
|
260
|
+
That standard owns what a fold writes and which entry types take one. `claude-memory-review` collects a receipt on the same rule, so neither body restates it.
|
|
248
261
|
|
|
249
|
-
Do not sweep `ui-checklist-*.md` (pending human verification), `ux-audit-*.md`, or `ux-measure-*.md` (standalone deliverables).
|
|
262
|
+
Do not sweep `ui-checklist-*.md` (pending human verification), `ux-audit-*.md`, or `ux-measure-*.md` (standalone deliverables), or any other `review-*.md` file.
|
|
250
263
|
|
|
251
264
|
Output one line per file swept:
|
|
252
265
|
|
|
253
266
|
- `๐ฆ Archived: <path>` for a plan moved into `.claude/plans-archive/`
|
|
254
267
|
- `โญ Kept: <path>, still cited by <task-file>` for a plan another live task shares
|
|
255
268
|
- `๐งน Deleted: <path>` for a swept review
|
|
269
|
+
- `๐งน Deleted: <path>, folded <n> skips` for a swept memory receipt
|
|
270
|
+
- `โญ Kept: <path>, <n> items pending` for a memory receipt still holding decisions
|
|
256
271
|
|
|
257
272
|
If nothing qualifies, skip this step silently.
|
|
258
273
|
|
|
@@ -21,7 +21,10 @@ A pen the caller cannot face is the same gap wearing a different shape. Routing
|
|
|
21
21
|
- Write the proposal to a receipt on disk and take no action until the user decides per item
|
|
22
22
|
- Route every decision channel through the receipt, writing a decision given in chat into its item's slot before the parse reads the file, so a channel the skill advertises drains the pen rather than passing over it
|
|
23
23
|
- Keep a promotion on its own commit, since a change to how the agent operates should not ride inside a feature a reviewer is vetting for something else
|
|
24
|
-
-
|
|
24
|
+
- Collect a receipt as soon as its last item resolves, rather than waiting for an operator to ask, since a collection nobody triggers is a folder that only grows
|
|
25
|
+
- Fold each declined item into its memory entry before the receipt goes, because a promoted item survives in its target and in git while a decline is recorded nowhere else
|
|
26
|
+
- Record that decline by rewriting the entry rather than appending to it, so the file states one current claim
|
|
27
|
+
- Confine the pass that runs after application to the one receipt it tested, so tidying up removes a file whose decisions are known to be resolved and leaves every untested receipt alone
|
|
25
28
|
|
|
26
29
|
## Must not
|
|
27
30
|
|
|
@@ -15,7 +15,7 @@ What an entry looks like and why a retired one is moved rather than deleted are
|
|
|
15
15
|
| "challenge the promotes" (receipt exists) | Challenge | review file only |
|
|
16
16
|
| "discuss", "respond to questions" | Discuss | review file only |
|
|
17
17
|
| "apply decisions", "commit", "ship the review" | Apply | tracked files + memory files |
|
|
18
|
-
| "cleanup", "delete the receipt" | Cleanup | one
|
|
18
|
+
| "cleanup", "delete the receipt" | Cleanup | one receipt + its skips |
|
|
19
19
|
|
|
20
20
|
If the user re-pings the skill with no new phrase and a receipt exists, default to Discuss when any `Decision:` contains `?`, otherwise Apply.
|
|
21
21
|
|
|
@@ -168,25 +168,34 @@ Apply promotion edits one at a time via `Edit`. Claude Code's tool permission di
|
|
|
168
168
|
|
|
169
169
|
This governs the tracked surfaces a promote lands in, which sit at `pwd` and take `Edit` from anywhere. The receipt and the memory entries are main-root scratch and follow the guard instead.
|
|
170
170
|
|
|
171
|
-
As each item resolves, update its status in the review file: flip the H2 emoji from ๐ to โ
for applied, โญ for skipped, ๐ฆ for retired, or ๐ค for handed off. Refresh the summary block counts at the top. Do not delete the
|
|
171
|
+
As each item resolves, update its status in the review file: flip the H2 emoji from ๐ to โ
for applied, โญ for skipped, ๐ฆ for retired, or ๐ค for handed off. Refresh the summary block counts at the top. Do not delete the file here. The sweep below decides whether it goes.
|
|
172
172
|
|
|
173
173
|
**Chat shortcut:** the user replies with `all`, `none`, a comma-separated list of numbers, or `skip <nums>`. Write the matching verb into the `Decision:` slot of every item the reply names, `apply` for `all` or a bare list and `skip` for a `skip` reply, then run the parse above against the file. A reply of `none` writes nothing. A slot the reply does not name keeps its own value, so the receipt stays the source of truth and an empty slot still means take no action.
|
|
174
174
|
|
|
175
|
+
### Sweep the receipt
|
|
176
|
+
|
|
177
|
+
Count the items still ๐ pending once the parse above has run. Apply leaves one pending on `defer`, on empty, and on any unrecognized verb, so a receipt reaching this point may still be holding decisions.
|
|
178
|
+
|
|
179
|
+
Leave the receipt in place when any remain. When none do, collect it per the collection rule in `${CLAUDE_SKILL_DIR}/../../standards/memory.md`, which owns what a fold writes and which entry types take one.
|
|
180
|
+
|
|
181
|
+
`claude-docs` Step 10 sweeps the same folder on the same rule once per shipped branch, and either may reach a receipt first. Whichever does, the other finds no file and moves on.
|
|
182
|
+
|
|
175
183
|
End with: `โ
Applied: <nums> | โญ Skipped: <nums> | ๐ Pending: <nums>`. Omit empty buckets. If anything is pending, remind the user they can refine `Decision:` lines and re-ping, run "discuss" for question items, or commit a skip with `skip <nums>` in chat.
|
|
176
184
|
|
|
177
185
|
## Cleanup phase
|
|
178
186
|
|
|
179
187
|
Trigger: user says "cleanup" or "delete the receipt" after Apply has run.
|
|
180
188
|
|
|
181
|
-
Cleanup
|
|
189
|
+
Cleanup folds one receipt's skips and removes that receipt, and does nothing else. It is the fallback route now that Apply and `claude-docs` Step 10 each collect a resolved receipt on their own, so it reaches a file those two left behind rather than being the only collector. Apply is still the only phase that moves a memory entry out of the pen, and it does so per approved item into `.claude/.tmp/memory-archive/`. A user asking to sweep stale memories wants Propose, which classifies entries and writes a decision slot per entry.
|
|
182
190
|
|
|
183
191
|
If no `.claude/review/memory-review-*.md` exists at the main root, stop: `โ
No review receipt to clean up.` Every other refusal in this skill carries a message, and the phase reads a receipt before it does anything else.
|
|
184
192
|
|
|
185
193
|
1. Read the latest `.claude/review/memory-review-*.md` at the main root and confirm Apply has run against it. If any item is still ๐ pending, stop and name the pending numbers.
|
|
186
|
-
2.
|
|
187
|
-
3. Leave every
|
|
194
|
+
2. Collect it per the collection rule in `${CLAUDE_SKILL_DIR}/../../standards/memory.md`, folding each โญ skipped item before the file goes. The fold happens wherever a receipt is collected, so this phase runs the same rule the Apply sweep does.
|
|
195
|
+
3. Delete that one file. Leave every other receipt beside it in place, because the pending test above covers the file it read and nothing has tested the rest.
|
|
196
|
+
4. Leave every memory entry in the pen. A skip records the decline on the entry and keeps the file, and applied promotions, governance handoffs, and user-type memories each stay as the review left them.
|
|
188
197
|
|
|
189
|
-
Do not promote
|
|
198
|
+
Do not promote or archive a memory entry. The skip fold is the one rewrite this phase makes, and it records a decline on an entry that stays in the pen.
|
|
190
199
|
|
|
191
200
|
## After completion
|
|
192
201
|
|
|
@@ -195,6 +204,7 @@ Output one line per action taken in the most recent phase:
|
|
|
195
204
|
- `โ
Promoted: .claude/memory/<memory-file> โ <target>`
|
|
196
205
|
- `โ
Handed off: .claude/memory/<memory-file> โ governance`
|
|
197
206
|
- `๐ฆ Retired: .claude/memory/<memory-file> โ .claude/.tmp/memory-archive/`
|
|
198
|
-
- `๐ Swept: .claude/review/<review-file
|
|
207
|
+
- `๐ Swept: .claude/review/<review-file>, folded <n> skips`
|
|
208
|
+
- `โญ Kept: .claude/review/<review-file>, <n> items pending`
|
|
199
209
|
|
|
200
210
|
If the user accepted nothing, output: `โ
No changes applied.`
|
package/docs/agents/records.md
CHANGED
|
@@ -74,7 +74,7 @@ For the shapes each check enforces, see `.claude/standards/plan.md`, `.claude/st
|
|
|
74
74
|
|
|
75
75
|
## Size
|
|
76
76
|
|
|
77
|
-
`aitk records size` reports what each record folder holds and how much of it is recent. It reads the
|
|
77
|
+
`aitk records size` reports what each record folder holds and how much of it is recent. It reads the ten backed folders named under Push and pull, plus `.claude/.tmp`, and it gates nothing.
|
|
78
78
|
|
|
79
79
|
```bash
|
|
80
80
|
aitk records size
|
|
@@ -110,9 +110,9 @@ aitk records push --json
|
|
|
110
110
|
aitk records pull
|
|
111
111
|
```
|
|
112
112
|
|
|
113
|
-
The backed folders are `groundwork`, `intake`, `memory`, `plans`, `plans-archive`, `review`, `task-archive`, `tasks`, and `teach`, all under `.claude/`. They are the gitignored Claude group minus `.claude/.tmp`, which is deletable without loss, and `.claude/worktrees/`, whose contents belong to the project repository already. The list is a constant rather than configuration, matching the four folder names `validate` hardcodes.
|
|
113
|
+
The backed folders are `groundwork`, `intake`, `memory`, `plans`, `plans-archive`, `review`, `review-archive`, `task-archive`, `tasks`, and `teach`, all under `.claude/`. They are the gitignored Claude group minus `.claude/.tmp`, which is deletable without loss, and `.claude/worktrees/`, whose contents belong to the project repository already. The list is a constant rather than configuration, matching the four folder names `validate` hardcodes.
|
|
114
114
|
|
|
115
|
-
Records are gitignored by design, so the history lives in a second git directory at `.claude/.records.git` with `.claude/` as its work tree. Every path stays where it is, which is what a separate checkout could not do. The verbs stage the
|
|
115
|
+
Records are gitignored by design, so the history lives in a second git directory at `.claude/.records.git` with `.claude/` as its work tree. Every path stays where it is, which is what a separate checkout could not do. The verbs stage the ten folders by explicit pathspec with `--force`, so nothing outside them can enter the index however the ignore rules read, and the project working tree and its index are never touched.
|
|
116
116
|
|
|
117
117
|
### Setup
|
|
118
118
|
|
|
@@ -141,7 +141,7 @@ Point it at a private repository, and at one that is not a remote of the project
|
|
|
141
141
|
| `local-ahead` | `pull` found local commits that never reached the origin |
|
|
142
142
|
| `git-failed` | A git call failed, with its stderr in the message |
|
|
143
143
|
|
|
144
|
-
The two `pull` refusals exist because the directions are not symmetric. A push only adds, while a pull onto a machine holding work that never left it would discard that work. Resolve either by running `push` first, or by moving the local folders aside. A machine holding none of the
|
|
144
|
+
The two `pull` refusals exist because the directions are not symmetric. A push only adds, while a pull onto a machine holding work that never left it would discard that work. Resolve either by running `push` first, or by moving the local folders aside. A machine holding none of the ten has nothing to lose, so a restore onto a fresh checkout runs straight through.
|
|
145
145
|
|
|
146
146
|
### When it runs
|
|
147
147
|
|
package/docs/ai-workflow.md
CHANGED
|
@@ -93,7 +93,7 @@ An execution that picks other than the suggestion rewrites the `- Suggested:` li
|
|
|
93
93
|
|
|
94
94
|
`aitk records validate plans` reports where a plan and that standard disagree: a filename that is not `feature-<slug>.md`, a missing required section, a files-to-touch entry naming no file, and a question carrying a suggestion with no answer slot. The same verb takes `groundwork`, `intake`, `memory`, and `teach`, which are governed the same way and were unreachable for the same reason. Nothing fires it automatically, because all five folders are gitignored and every check the repository runs reads changed files from git. It reports and never writes, since the folders are per-machine scratch with no history to recover a wrong repair from.
|
|
95
95
|
|
|
96
|
-
`aitk records push` carries these folders off the disk they live on, and `aitk records pull` brings them back.
|
|
96
|
+
`aitk records push` carries these folders off the disk they live on, and `aitk records pull` brings them back. Ten of them are backed: `groundwork`, `intake`, `memory`, `plans`, `plans-archive`, `review`, `review-archive`, `task-archive`, `tasks`, and `teach`. The history lives in a second git directory at `.claude/.records.git` with `.claude/` as its work tree, so every path a task file cites stays where it is.
|
|
97
97
|
|
|
98
98
|
A person points it at a private repository once and both verbs refuse until they have, and `push` refuses when that origin is also a remote of the project, since the payload is the memory pen and the groundwork trails. `.husky/post-merge` runs the push after its archive loop, on every merge rather than only on one that closed a task. See [records](agents/records.md) for the refusal table.
|
|
99
99
|
|
|
@@ -150,6 +150,8 @@ If capture wrote at least one memory file, `claude-memory-review` then proposes
|
|
|
150
150
|
|
|
151
151
|
Run `claude-memory-review` standalone to curate the whole pen. An entry it retires moves to `.claude/.tmp/memory-archive/` rather than being deleted, since the folder is gitignored and a bulk pass has no undo.
|
|
152
152
|
|
|
153
|
+
The receipt is collected once every item on it has been decided, and it survives untouched while any item is still pending. Whichever runs first takes it: Apply collects the receipt it has resolved, and `claude-docs` scans the folder on every shipped branch for one an earlier session left behind. Before the file goes, each declined item is folded into the entry it was about, since a promotion survives in its target and in git while a decline is recorded nowhere else. `aitk standards memory` states what a fold writes and which entry types take one.
|
|
154
|
+
|
|
153
155
|
### UI polish
|
|
154
156
|
|
|
155
157
|
Verify the change manually in the browser. Invoke `aitk:claude-ui-test` if you need e2e tests and a visual verification checklist for the session. For the fix itself, describe the change in Claude Code directly.
|
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -e
|
|
3
|
+
set -o pipefail
|
|
4
|
+
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
|
|
7
|
+
|
|
8
|
+
SCRIPTS_ROOT="$PROJECT_ROOT/scripts"
|
|
9
|
+
PALETTE_SOURCE="$SCRIPTS_ROOT/lib/ui.sh"
|
|
10
|
+
|
|
11
|
+
# `find` writes to stderr and returns non-zero for a missing root, inside a
|
|
12
|
+
# process substitution whose status nothing reads. Without this the walk covers
|
|
13
|
+
# nothing and the check reports the tree clean having never measured it.
|
|
14
|
+
if [ ! -f "$PALETTE_SOURCE" ]; then
|
|
15
|
+
echo "No palette source at ${PALETTE_SOURCE#"$PROJECT_ROOT/"}, color sourcing unverifiable." >&2
|
|
16
|
+
exit 1
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
# Any SGR sequence in either spelling. The cursor and erase sequences an
|
|
20
|
+
# interactive prompt writes end in a letter instead, and they run only where a
|
|
21
|
+
# terminal already exists, so they are not what this measures.
|
|
22
|
+
SGR='\\(033|e|x1b)\[[0-9;]*m'
|
|
23
|
+
|
|
24
|
+
# Sixteen copies of one decision is what made color impossible to turn off on
|
|
25
|
+
# the TypeScript side. A rule nothing enforces rebuilds them the next time a
|
|
26
|
+
# script wants grey, so the escape lives in the shared library and every other
|
|
27
|
+
# script reads the palette that library derives for its stream.
|
|
28
|
+
offenders=""
|
|
29
|
+
while IFS= read -r file; do
|
|
30
|
+
[ "$file" = "$PALETTE_SOURCE" ] && continue
|
|
31
|
+
if grep -qE "$SGR" "$file"; then
|
|
32
|
+
offenders="$offenders ${file#"$PROJECT_ROOT/"}"$'\n'
|
|
33
|
+
fi
|
|
34
|
+
done < <(find "$SCRIPTS_ROOT" -type f -name '*.sh')
|
|
35
|
+
|
|
36
|
+
if [ -n "$offenders" ]; then
|
|
37
|
+
echo "A color escape is defined outside the shared library:" >&2
|
|
38
|
+
printf '%s' "$offenders" >&2
|
|
39
|
+
echo "Source scripts/lib/ui.sh and read its palette, so one answer covers every writer." >&2
|
|
40
|
+
exit 1
|
|
41
|
+
fi
|
package/scripts/core/snapshot.sh
CHANGED
|
@@ -2,19 +2,13 @@
|
|
|
2
2
|
set -e
|
|
3
3
|
set -o pipefail
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
WHITE='\033[1;37m'
|
|
8
|
-
GREY='\033[0;90m'
|
|
9
|
-
NC='\033[0m'
|
|
5
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
6
|
+
PROJECT_ROOT="${PROJECT_ROOT:-$(cd "$SCRIPT_DIR/../.." && pwd)}"
|
|
10
7
|
|
|
11
|
-
|
|
8
|
+
# shellcheck source=/dev/null
|
|
9
|
+
source "$PROJECT_ROOT/scripts/lib/ui.sh"
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
log_error() {
|
|
15
|
-
echo -e "${GREY}โ${NC} ${RED}โ${NC} $1"
|
|
16
|
-
exit 1
|
|
17
|
-
}
|
|
11
|
+
NESTED="${VERIFY_NESTED:-false}"
|
|
18
12
|
|
|
19
13
|
OUTPUT_FILE=".claude/.tmp/project/PROJECT-SNAPSHOT.md"
|
|
20
14
|
|
|
@@ -117,15 +111,23 @@ write_snapshot() {
|
|
|
117
111
|
main() {
|
|
118
112
|
check_dependencies
|
|
119
113
|
|
|
120
|
-
if [ "$NESTED" = false ]; then
|
|
114
|
+
if [ "$NESTED" = false ]; then open_timeline; fi
|
|
121
115
|
|
|
122
|
-
|
|
116
|
+
log_step "Snapshot"
|
|
123
117
|
write_snapshot
|
|
124
118
|
log_info "Written to $OUTPUT_FILE"
|
|
125
119
|
|
|
120
|
+
# The whole frame goes to stderr, since the run writes its document to a file
|
|
121
|
+
# and leaves stdout carrying nothing. Edges on stdout with the body on stderr
|
|
122
|
+
# would capture as a frame with no body inside it.
|
|
126
123
|
if [ "$NESTED" = false ]; then
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
close_timeline
|
|
125
|
+
# All six are declared to scope what `set_palette` assigns, so the four this
|
|
126
|
+
# line never spells stay out of the globals a sourcing script reads.
|
|
127
|
+
# shellcheck disable=SC2034
|
|
128
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
129
|
+
set_palette 2
|
|
130
|
+
echo -e "\n${GREEN}โ Snapshot complete${NC}" >&2
|
|
129
131
|
fi
|
|
130
132
|
}
|
|
131
133
|
|
package/scripts/core/verify.sh
CHANGED
|
@@ -595,6 +595,7 @@ main() {
|
|
|
595
595
|
log_step "Shell"
|
|
596
596
|
if has_changed '\.sh$|^package\.json$'; then
|
|
597
597
|
run_check "bun run check:shell" "Shell check failed"
|
|
598
|
+
run_check "bash $PROJECT_ROOT/scripts/core/check-color-source.sh" "A color escape is defined outside scripts/lib/ui.sh."
|
|
598
599
|
log_info "Shell check passed"
|
|
599
600
|
else
|
|
600
601
|
log_info "Skipped, no shell changes"
|
package/scripts/lib/ui.sh
CHANGED
|
@@ -12,26 +12,85 @@ fi
|
|
|
12
12
|
# shellcheck source=/dev/null
|
|
13
13
|
source "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/sandbox-path.sh"
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
# `NO_COLOR` follows the published convention, where any non-empty value turns
|
|
16
|
+
# color off whatever the value says.
|
|
17
|
+
supports_color() {
|
|
18
|
+
[ -z "${NO_COLOR:-}" ] && [ -t "$1" ]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
# Assigns the six palette names for one file descriptor. The blank palette keeps
|
|
22
|
+
# every frame character and drops only the escapes, so a captured run still
|
|
23
|
+
# reads as one block.
|
|
24
|
+
#
|
|
25
|
+
# Bash returns a string and nothing richer, so the palette arrives through the
|
|
26
|
+
# caller's own scope. A writer declaring all six `local` before calling this
|
|
27
|
+
# keeps the assignment to itself, which is what leaves the source-time answer
|
|
28
|
+
# below standing for anything that sources this file.
|
|
29
|
+
set_palette() {
|
|
30
|
+
if supports_color "$1"; then
|
|
31
|
+
GREEN='\033[0;32m'
|
|
32
|
+
RED='\033[0;31m'
|
|
33
|
+
YELLOW='\033[0;33m'
|
|
34
|
+
WHITE='\033[1;37m'
|
|
35
|
+
GREY='\033[0;90m'
|
|
36
|
+
NC='\033[0m'
|
|
37
|
+
else
|
|
38
|
+
GREEN=''
|
|
39
|
+
RED=''
|
|
40
|
+
YELLOW=''
|
|
41
|
+
WHITE=''
|
|
42
|
+
GREY=''
|
|
43
|
+
NC=''
|
|
44
|
+
fi
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
# Every writer below frames to stderr and asks about that stream at write time,
|
|
48
|
+
# so no answer is frozen before a caller's redirect is in place. This one answers
|
|
49
|
+
# for stdout instead, because it is read by a sourcing script writing its own
|
|
50
|
+
# frame with a bare `echo`, and that is the stream a bare `echo` reaches.
|
|
51
|
+
set_palette 1
|
|
52
|
+
|
|
53
|
+
log_info() {
|
|
54
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
55
|
+
set_palette 2
|
|
56
|
+
echo -e "${GREY}โ${NC} ${GREEN}โ${NC} $1" >&2
|
|
57
|
+
}
|
|
58
|
+
log_warn() {
|
|
59
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
60
|
+
set_palette 2
|
|
61
|
+
echo -e "${GREY}โ${NC} ${YELLOW}!${NC} $1" >&2
|
|
62
|
+
}
|
|
24
63
|
log_error() {
|
|
64
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
65
|
+
set_palette 2
|
|
25
66
|
echo -e "${GREY}โ${NC} ${RED}โ${NC} $1" >&2
|
|
26
67
|
exit 1
|
|
27
68
|
}
|
|
28
|
-
log_step() {
|
|
29
|
-
|
|
30
|
-
|
|
69
|
+
log_step() {
|
|
70
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
71
|
+
set_palette 2
|
|
72
|
+
echo -e "${GREY}โ${NC}\n${GREY}โ${NC} ${WHITE}$1${NC}" >&2
|
|
73
|
+
}
|
|
74
|
+
log_add() {
|
|
75
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
76
|
+
set_palette 2
|
|
77
|
+
echo -e "${GREY}โ${NC} ${GREEN}+${NC} $1" >&2
|
|
78
|
+
}
|
|
79
|
+
log_rem() {
|
|
80
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
81
|
+
set_palette 2
|
|
82
|
+
echo -e "${GREY}โ${NC} ${RED}-${NC} $1" >&2
|
|
83
|
+
}
|
|
31
84
|
|
|
32
|
-
pipe_output() {
|
|
85
|
+
pipe_output() {
|
|
86
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
87
|
+
set_palette 2
|
|
88
|
+
while IFS= read -r line; do echo -e "${GREY}โ${NC} $line" >&2; done
|
|
89
|
+
}
|
|
33
90
|
|
|
34
91
|
open_timeline() {
|
|
92
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
93
|
+
set_palette 2
|
|
35
94
|
echo -e "${GREY}โ${NC}" >&2
|
|
36
95
|
if [ -n "${1:-}" ]; then
|
|
37
96
|
echo -e "${GREY}โ${NC} ${WHITE}$1${NC}" >&2
|
|
@@ -39,6 +98,8 @@ open_timeline() {
|
|
|
39
98
|
}
|
|
40
99
|
|
|
41
100
|
close_timeline() {
|
|
101
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
102
|
+
set_palette 2
|
|
42
103
|
echo -e "${GREY}โ${NC}" >&2
|
|
43
104
|
}
|
|
44
105
|
|
|
@@ -52,6 +113,8 @@ guard_root() {
|
|
|
52
113
|
}
|
|
53
114
|
|
|
54
115
|
require_project_root() {
|
|
116
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
117
|
+
set_palette 2
|
|
55
118
|
local sandbox
|
|
56
119
|
sandbox="$(resolve_sandbox_dir)"
|
|
57
120
|
if [[ "$PWD" == "$sandbox" || "$PWD" == "$sandbox"/* ]]; then
|
|
@@ -65,6 +128,8 @@ require_project_root() {
|
|
|
65
128
|
}
|
|
66
129
|
|
|
67
130
|
ask() {
|
|
131
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
132
|
+
set_palette 2
|
|
68
133
|
local prompt_text=$1
|
|
69
134
|
local var_name=$2
|
|
70
135
|
local default_val=$3
|
|
@@ -107,6 +172,8 @@ ask() {
|
|
|
107
172
|
}
|
|
108
173
|
|
|
109
174
|
select_or_route_scenario() {
|
|
175
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
176
|
+
set_palette 2
|
|
110
177
|
local prompt_text=$1
|
|
111
178
|
shift
|
|
112
179
|
local options=("$@")
|
|
@@ -122,6 +189,8 @@ select_or_route_scenario() {
|
|
|
122
189
|
}
|
|
123
190
|
|
|
124
191
|
select_option() {
|
|
192
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
193
|
+
set_palette 2
|
|
125
194
|
local prompt_text=$1
|
|
126
195
|
shift
|
|
127
196
|
local options=("$@")
|
|
@@ -320,6 +320,8 @@ execute_sandbox_and_commit() {
|
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
finalize_sandbox_run() {
|
|
323
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
324
|
+
set_palette 2
|
|
323
325
|
trap - EXIT
|
|
324
326
|
close_timeline
|
|
325
327
|
echo "" >&2
|
|
@@ -327,6 +329,8 @@ finalize_sandbox_run() {
|
|
|
327
329
|
}
|
|
328
330
|
|
|
329
331
|
cmd_clean() {
|
|
332
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
333
|
+
set_palette 2
|
|
330
334
|
log_step "Removing sandbox"
|
|
331
335
|
rm -rf "$SANDBOX"
|
|
332
336
|
log_rem "$SANDBOX"
|
|
@@ -337,6 +341,8 @@ cmd_clean() {
|
|
|
337
341
|
}
|
|
338
342
|
|
|
339
343
|
reset_sandbox() {
|
|
344
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
345
|
+
set_palette 2
|
|
340
346
|
if [ ! -d "$SANDBOX/.git" ]; then
|
|
341
347
|
log_error "No sandbox found. Run \`aitk sandbox\` first."
|
|
342
348
|
fi
|
package/scripts/tooling/ref.sh
CHANGED
|
@@ -91,6 +91,12 @@ main() {
|
|
|
91
91
|
local stack="$1"
|
|
92
92
|
local target="${2:-.}"
|
|
93
93
|
|
|
94
|
+
# Every frame below goes to stderr, so it asks about that stream rather than
|
|
95
|
+
# reading the source-time answer, which is for stdout and is what `show_help`
|
|
96
|
+
# above wants. Declared after the help branch so that call keeps it.
|
|
97
|
+
local GREEN RED YELLOW WHITE GREY NC
|
|
98
|
+
set_palette 2
|
|
99
|
+
|
|
94
100
|
echo -e "${GREY}โ${NC}" >&2
|
|
95
101
|
echo -e "${GREY}โ${NC} ${WHITE}aitk tooling ref${NC}" >&2
|
|
96
102
|
|
package/src/records/backup.ts
CHANGED
package/standards/memory.md
CHANGED
|
@@ -103,6 +103,19 @@ Link a related entry as `[[name]]`, where `name` is the target's filename stem w
|
|
|
103
103
|
|
|
104
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
105
|
|
|
106
|
+
## Collecting a review receipt
|
|
107
|
+
|
|
108
|
+
A review of the pen writes a receipt recording what it proposed per entry and what was decided. The receipt is collected once every item on it has resolved, and it is held while any item is still pending, since a pending item is decision state the next round reads back.
|
|
109
|
+
|
|
110
|
+
Fold the declines before the receipt goes. A promoted entry survives in its target and in git and a retired one survives in the archive, so the one thing a receipt uniquely holds is the record that a rule was considered and turned down.
|
|
111
|
+
|
|
112
|
+
- Fold into the entry the item was about, and only into that entry. A decline whose proposed target was another surface still lands here.
|
|
113
|
+
- Fold a `feedback` or `project` entry alone. The decline belongs in the `**Why:**` line, which is what a later reader tests the rule against.
|
|
114
|
+
- Fold nothing into a `user` or `reference` entry. Its body is one sentence carrying neither marker, and such an entry is declined for having no in-repo target, which its type already states. Writing that on the entry restates the type and breaks the body shape.
|
|
115
|
+
- Record the decline by rewriting the entry, never by appending to it, per the lifecycle rule above.
|
|
116
|
+
|
|
117
|
+
Which surface runs the collection is project policy. More than one may, so a collector finding no receipt has been beaten to it rather than misconfigured.
|
|
118
|
+
|
|
106
119
|
## Anti-patterns
|
|
107
120
|
|
|
108
121
|
- **The domain fact filed as memory.** It reads as a capture and lands in the one folder no session opens while working that domain.
|
|
@@ -8,4 +8,4 @@ runtime = ""
|
|
|
8
8
|
scaffold = ""
|
|
9
9
|
|
|
10
10
|
[gitignore]
|
|
11
|
-
"# Claude" = [".claude/.tmp/", ".claude/groundwork/", ".claude/intake/", ".claude/memory/", ".claude/plans/", ".claude/plans-archive/", ".claude/review/", ".claude/task-archive/", ".claude/worktrees/", ".claude/tasks/"]
|
|
11
|
+
"# Claude" = [".claude/.tmp/", ".claude/groundwork/", ".claude/intake/", ".claude/memory/", ".claude/plans/", ".claude/plans-archive/", ".claude/review/", ".claude/review-archive/", ".claude/task-archive/", ".claude/worktrees/", ".claude/tasks/"]
|
|
@@ -19,6 +19,7 @@ The claude stack installs the `.claude/` workflow directory into a project. Stat
|
|
|
19
19
|
โโโ settings.json โ seeded. Project-level Claude Code config (PreToolUse and PostToolUse hooks). User-level config installed separately via `aitk claude setup`.
|
|
20
20
|
โโโ plans/ โ execution detail for multi-step tasks, gitignored. `feature-*.md` entries swept by claude-docs.
|
|
21
21
|
โโโ review/ โ scratch for claude-review and claude-ui-test output, gitignored
|
|
22
|
+
โโโ review-archive/ โ memory-review receipts a triage took out of review/, gitignored
|
|
22
23
|
โโโ .tmp/ โ ephemeral scratch space, gitignored
|
|
23
24
|
โโโ memory/ โ session facts no context entry owns, gitignored. `index.md` regenerated by a hook.
|
|
24
25
|
```
|
|
@@ -49,7 +50,7 @@ A project installed before the diagram surface became a folder still holds `.cla
|
|
|
49
50
|
|
|
50
51
|
## Gitignore
|
|
51
52
|
|
|
52
|
-
- `# Claude`: `.claude/.tmp/`, `.claude/groundwork/`, `.claude/intake/`, `.claude/memory/`, `.claude/plans/`, `.claude/plans-archive/`, `.claude/review/`, `.claude/task-archive/`, `.claude/worktrees/`, `.claude/tasks/`
|
|
53
|
+
- `# Claude`: `.claude/.tmp/`, `.claude/groundwork/`, `.claude/intake/`, `.claude/memory/`, `.claude/plans/`, `.claude/plans-archive/`, `.claude/review/`, `.claude/review-archive/`, `.claude/task-archive/`, `.claude/worktrees/`, `.claude/tasks/`
|
|
53
54
|
|
|
54
55
|
## CLI
|
|
55
56
|
|