@erclx/aitk 0.100.0 → 0.101.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-orchestrate/SKILL.md +2 -2
- package/claude/skills/claude-orchestrate/references/orchestrator-poll.md +4 -4
- package/claude/skills/claude-orchestrate/scripts/poll.sh +11 -10
- package/claude/skills/claude-pr-review/SKILL.md +16 -16
- package/claude/skills/claude-teach/REQUIREMENT.md +2 -1
- package/claude/skills/claude-teach/SKILL.md +40 -9
- package/docs/agents/commands.md +5 -0
- package/docs/agents/index.md +1 -0
- package/docs/agents/teach.md +119 -0
- package/docs/ai-workflow.md +1 -1
- package/docs/operating-model.md +9 -8
- package/package.json +1 -1
- package/src/cli.ts +4 -0
- package/src/commands/teach.ts +650 -0
- package/src/records/validate.ts +8 -7
- package/src/teach/workspace.ts +797 -0
|
@@ -109,8 +109,8 @@ Write no shape for a correction. A correction is a sentence, and a format for ad
|
|
|
109
109
|
5. Hand off. The human opens a worker worktree with `claude-worktree` and runs `claude-autoship` against the plan. The orchestrator does not spawn workers.
|
|
110
110
|
6. Review the PR. When a worker opens a PR, run `claude-pr-review` to post findings to it. This is the deep, independent pass. The worker's autoship self-review was only the green gate.
|
|
111
111
|
- Learning that a PR moved is the mechanical half, so read `${CLAUDE_SKILL_DIR}/references/orchestrator-poll.md` and start the poll it carries on the first dispatch rather than checking the board by hand. That runbook holds the routing, and a summary of it here is a second source that drifts from it.
|
|
112
|
-
7. Dispatch the handback. A pass posting a finding at any severity tells the session holding that branch to run `claude-address-review`, rather than waiting for a person to relay it.
|
|
113
|
-
-
|
|
112
|
+
7. Dispatch the handback. A pass posting a finding at any severity tells the session holding that branch to run `claude-address-review`, rather than waiting for a person to relay it. Re-review when the answer lands, then the human merges. Tell the trailing worker to rebase when its branch shares a seam with the merged one.
|
|
113
|
+
- Read the threshold off `claude-pr-review`, which states it once and governs the heading with it, so an open heading and an owed dispatch answer the same question and either one is enough to send
|
|
114
114
|
- Resolve the target from a fresh session listing at the moment of sending, never from a mapping written down earlier, since names rotate as sessions end and one recorded earlier in a session has failed inside the hour
|
|
115
115
|
- Open the message with the worktree and branch the sender believes the reader holds, asking to be corrected, whenever that mapping is inferred rather than confirmed
|
|
116
116
|
- Name the skill for the reader to run rather than writing an invocation, which arrives as text
|
|
@@ -34,13 +34,13 @@ Poll GitHub for pull request movement by running <POLL_SCRIPT>, then act on what
|
|
|
34
34
|
- MOVED or RESPONSE on a pull request I have already reviewed: run the aitk:claude-pr-review skill on it immediately, narrow pass. Re-reviews read prior..head and gain nothing from waiting.
|
|
35
35
|
- OPENED, or a pull request with no prior review pass: run the aitk:claude-pr-review skill on it. A draft counts, since every pull request here opens as one and skipping drafts skips everything.
|
|
36
36
|
- SEEN: report it and stop. A pass already covers that head, whether it arrived out of band or before the poll first saw the pull request, so no review follows.
|
|
37
|
-
- STALLED: read the last pass and report what it carried. The pass has sat open for hours with nothing following it, so a worker mid-task is already ruled out and the dispatch either never went out or the session holding it is gone. Confirm and re-send it under the dispatch rule below
|
|
37
|
+
- STALLED: read the last pass and report what it carried. The pass has sat open for hours with nothing following it, so a worker mid-task is already ruled out and the dispatch either never went out or the session holding it is gone. Confirm and re-send it under the dispatch rule below, whatever grades the pass carried. Do not re-run a review to correct the heading, since a pass on an unchanged head with no response behind it stops by design.
|
|
38
38
|
- CONFLICT: report it and stop. The branch owner rebases, not this session.
|
|
39
39
|
- GONE: report it, then sweep the board by invoking the aitk:claude-orchestrate skill and following its queue-refill sweep.
|
|
40
40
|
- A line starting `poll:`: report it verbatim and treat that pull request as unread this run. It is a failed query, not a state.
|
|
41
41
|
- Nothing changed: say exactly "No movement." and nothing else.
|
|
42
42
|
|
|
43
|
-
After any pass that posts a finding, at any severity, tell the session holding that branch to run the aitk:claude-address-review skill. Resolve the target by running `aitk sessions list --branch <branch> --json` at that moment, which scopes the match to this repository, then route on how many sessions it returned. Zero: report the invocation for me and dispatch nobody. Exactly one, with the confidence field reading "confirmed": address that name directly. Any other count, any other confidence, or a command that is missing or refuses: fall back to picking from a session listing, open by naming the worktree and branch you believe the reader holds, and ask to be corrected. Two sessions can hold one branch, so read the count rather than the first row. The
|
|
43
|
+
After any pass that posts a finding, at any severity, tell the session holding that branch to run the aitk:claude-address-review skill. Resolve the target by running `aitk sessions list --branch <branch> --json` at that moment, which scopes the match to this repository, then route on how many sessions it returned. Zero: report the invocation for me and dispatch nobody. Exactly one, with the confidence field reading "confirmed": address that name directly. Any other count, any other confidence, or a command that is missing or refuses: fall back to picking from a session listing, open by naming the worktree and branch you believe the reader holds, and ask to be corrected. Two sessions can hold one branch, so read the count rather than the first row. The threshold is stated once in the aitk:claude-pr-review skill and governs the heading with it, so an open heading and an owed dispatch answer the same question and either one is enough to send.
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
## Reading the output
|
|
@@ -53,6 +53,6 @@ The baseline lives at `.claude/.tmp/pr-poll/baseline.txt` under the main worktre
|
|
|
53
53
|
|
|
54
54
|
The four review headings the script matches are written by `claude-pr-review` and `claude-address-review`. A project that posts its reviews under different headings edits the three jq filters in the script to match, or every pull request reads as never reviewed.
|
|
55
55
|
|
|
56
|
-
`STALLED` is the one state the script derives from a heading rather than from a commit or a count, since `claude-pr-review` posts the open heading
|
|
56
|
+
`STALLED` is the one state the script derives from a heading rather than from a commit or a count, since `claude-pr-review` posts the open heading exactly when a dispatch is owed, per the threshold that skill states. The heading alone cannot carry it, because an open pass means a dispatch was owed and made, so the ordinary healthy thread is a worker still working. The age of that pass is the third test: the state fires when the open pass covers the head, nothing has followed it, and it is older than the `STALE_AFTER` seconds set at the top of the script. It reports once per entry and fires again after any commit or reply resets the thread. A project whose workers run longer than the default two hours raises that number.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
The state reaches every stalled dispatch, since one threshold governs the heading and the dispatch alike and a pass carrying anything posts the open heading. A minors-only pass therefore reports here on the same terms as a blocking one, which widens the state from what it caught while the two were split. It stays a heading test rather than a count test, so nothing here pins the summary line, which is a second string this script does not own.
|
|
@@ -55,11 +55,11 @@ JQ_REPLY_COUNT='
|
|
|
55
55
|
] | length
|
|
56
56
|
'
|
|
57
57
|
|
|
58
|
-
# `claude-pr-review` posts `## Review`
|
|
59
|
-
#
|
|
60
|
-
#
|
|
61
|
-
# waiting on a worker from one
|
|
62
|
-
#
|
|
58
|
+
# `claude-pr-review` states the threshold and posts `## Review` exactly when a
|
|
59
|
+
# pass carries a finding, so the heading of the last review is what says whether
|
|
60
|
+
# any work is owed on it. Taking it as well as the commit is what separates a
|
|
61
|
+
# thread waiting on a worker from one nothing is owed on. A project editing the
|
|
62
|
+
# two filters above for its own headings edits this one with them.
|
|
63
63
|
#
|
|
64
64
|
# The age of that review comes out of the same selection, because the heading
|
|
65
65
|
# alone cannot separate the two. Under the rule above an open heading means a
|
|
@@ -251,11 +251,12 @@ while read -r n head prior resp merges heading age; do
|
|
|
251
251
|
[ "$prior" = "$head" ] && [ "$age" -ge "$STALE_AFTER" ]; then
|
|
252
252
|
# Three things at once: the last pass is open, it covers the head so no
|
|
253
253
|
# commit followed it, and the two branches above found no reply either. The
|
|
254
|
-
# open heading is posted
|
|
255
|
-
#
|
|
256
|
-
#
|
|
257
|
-
#
|
|
258
|
-
#
|
|
254
|
+
# open heading is posted exactly when a dispatch is owed, per the threshold
|
|
255
|
+
# `claude-pr-review` states, so a pass owing one left it here at any grade
|
|
256
|
+
# it carried. Any two of these describe an ordinary review waiting on a
|
|
257
|
+
# worker, which is why the age carries the third: without it every
|
|
258
|
+
# dispatched worker is reported minutes into the work it was sent to do,
|
|
259
|
+
# and a signal firing on the healthy path is one an operator learns to
|
|
259
260
|
# skip. The report still asks for a confirmation rather than asserting.
|
|
260
261
|
echo "STALLED #$n open at ${head:0:7}, no commit or reply in $((age / 3600))h"
|
|
261
262
|
state=reported
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-pr-review
|
|
3
|
-
description: Reviews an open pull request from an independent session and posts findings as a review comment on the PR. Posts a first pass against the whole change and every later pass against only the commits added since, under `## Review` while
|
|
3
|
+
description: Reviews an open pull request from an independent session and posts findings as a review comment on the PR. Posts a first pass against the whole change and every later pass against only the commits added since, under `## Review` while any finding is open and `## Review closed` once a pass carries none. Reads project docs and the roadmap for cross-feature context a self-review lacks. Use when asked to "review the PR", "review this feature's PR", "post a PR review", "re-review the PR", "close out the review", "confirm the findings are fixed", or acting as the orchestrator reviewing a worker's PR. Do NOT use to review local uncommitted changes. That is `claude-review`.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Claude PR review
|
|
@@ -13,10 +13,10 @@ findings to the PR, so the vantage is independent and the output is durable.
|
|
|
13
13
|
It posts at least twice over a pull request's life. A first pass opens the
|
|
14
14
|
review against the whole change, and every later pass reads only the commits
|
|
15
15
|
added since. The heading reports state rather than pass number: a pass carrying
|
|
16
|
-
a
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
a finding at any severity takes `## Review`, and `## Review closed` covers a
|
|
17
|
+
pass carrying none, so the most recent comment's heading reports whether any
|
|
18
|
+
work is owed. Every pass is this skill, and which one it is gets detected from
|
|
19
|
+
the thread rather than named by the caller.
|
|
20
20
|
|
|
21
21
|
## Guards
|
|
22
22
|
|
|
@@ -85,11 +85,11 @@ Review the diff and files for the same axes as `claude-review` (bugs, edge cases
|
|
|
85
85
|
|
|
86
86
|
Apply the high-signal filter: flag only what will cause incorrect behavior, break a documented rule, or mislead a downstream feature. If uncertain, do not flag.
|
|
87
87
|
|
|
88
|
-
A later pass applies the same axes to the delta, and adds one check the first pass cannot make: did each prior finding land, and did the fix regress anything it touched. Findings of its own are normal findings, stated at the same severity and counted the same way. That count is what Step 4 reads to pick the heading, so a pass raising a
|
|
88
|
+
A later pass applies the same axes to the delta, and adds one check the first pass cannot make: did each prior finding land, and did the fix regress anything it touched. Findings of its own are normal findings, stated at the same severity and counted the same way. That count is what Step 4 reads to pick the heading, so a pass raising a finding of its own is not a close-out at any severity.
|
|
89
89
|
|
|
90
|
-
A prior finding can also be settled by argument rather than by a fix. A reply naming the plan question that already declined it, or a constraint this session could not see, withdraws the finding or moves its grade. State that outcome in the body under the finding it changes, naming the fact that produced it, whether the argument arrived on the thread or through the channel that carried the dispatch. Dropping the finding from this body instead leaves a reader unable to tell a withdrawal from an oversight, and the reasoning goes with the session that heard it. A withdrawal removes the finding from the count, so a pass that withdrew every
|
|
90
|
+
A prior finding can also be settled by argument rather than by a fix. A reply naming the plan question that already declined it, or a constraint this session could not see, withdraws the finding or moves its grade. State that outcome in the body under the finding it changes, naming the fact that produced it, whether the argument arrived on the thread or through the channel that carried the dispatch. Dropping the finding from this body instead leaves a reader unable to tell a withdrawal from an oversight, and the reasoning goes with the session that heard it. A withdrawal removes the finding from the count, so a pass that withdrew every finding it carried is a close-out. Write the withdrawal and its cause into that body rather than taking the short close-out line Step 4 supplies, which reports prior findings addressed and would credit a fix nobody made.
|
|
91
91
|
|
|
92
|
-
Use severity: `critical` (blocks merge), `should-fix` (fix before merge), `minor` (
|
|
92
|
+
Use severity: `critical` (blocks merge), `should-fix` (fix before merge), `minor` (blocks nothing). The ladder ranks a finding and decides nothing about who acts on it, since every grade takes the open heading and owes a dispatch under the threshold Step 4 states.
|
|
93
93
|
|
|
94
94
|
## Step 4: post to the PR
|
|
95
95
|
|
|
@@ -144,15 +144,15 @@ Re-reviewed `<short-sha>`, N commits since the prior pass. X critical, Y should-
|
|
|
144
144
|
🤖 Reviewed by Claude Code
|
|
145
145
|
```
|
|
146
146
|
|
|
147
|
-
The
|
|
147
|
+
The threshold is stated here and nowhere else, and every other surface acting on it cites this skill rather than restating the grades. One rule governs both the heading and the dispatch: a pass carrying a finding at any severity takes `## Review` and owes a dispatch to the session holding the branch, and a pass carrying nothing at all takes `## Review closed` and owes none. Sending that dispatch is `claude-orchestrate`'s step rather than this one, which posts and stops. Post the open heading whether it is the first pass or the fourth. A pull request thread then reads as `## Review`, the worker's answer under `## Review response` from `claude-address-review`, another `## Review` while any finding is open, and `## Review closed` when none is.
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
Keying either half on the grade was measured wrong: across 8 findings on one archived pass, 3 were posted as minor and 2 of those were defects a worker fixed rather than recorded, so a floor at should-fix loses real fixes to a grade that runs low. Splitting the two halves so the dispatch fired lower than the heading was the other candidate, and it left a thread reading closed while work was owed on it.
|
|
150
150
|
|
|
151
|
-
The cost is that
|
|
151
|
+
The cost is that the merge decision no longer reads off the heading alone, since an open heading covers a minor as well as a critical. Take it from the counts on the summary line, which is where they already sit. No summary line reports the merge as unblocked under either heading, since a thread reading open cannot also report that nothing blocks it.
|
|
152
152
|
|
|
153
153
|
A minor the dispatched worker declines is what needs a surface that survives the merge, rather than every minor, since one that gets fixed on the branch needs no durable record. Write a declined minor into the `## Findings` section of the task the branch closes, which is where the queue-refill sweep already routes a finding that changes another task. A declined finding left on the thread alone is lost the moment the pull request merges.
|
|
154
154
|
|
|
155
|
-
Read the state off the most recent review comment rather than off the presence of a closed one. A close-out does not close the pull request, so a commit pushed after it gets its own pass, and that pass reopens the review under `## Review` when it raises a
|
|
155
|
+
Read the state off the most recent review comment rather than off the presence of a closed one. A close-out does not close the pull request, so a commit pushed after it gets its own pass, and that pass reopens the review under `## Review` when it raises a finding of any grade.
|
|
156
156
|
|
|
157
157
|
Both of this skill's headings anchor as a section distinct from human threads. Do not invent one beyond those two and the `## Review response` a sibling owns, and do not append the PR number, which GitHub already renders above the comment.
|
|
158
158
|
|
|
@@ -172,14 +172,14 @@ Before posting, run the scan in `.claude/standards/publish.md` against the body,
|
|
|
172
172
|
gh pr review <number> --comment --body-file .claude/.tmp/pr-review/body-<number>-<short-sha>.md
|
|
173
173
|
```
|
|
174
174
|
|
|
175
|
-
A pass carrying nothing at all takes `## Review closed` and a short body, with the footer line included either way. On a first pass, post `✅ No
|
|
175
|
+
A pass carrying nothing at all takes `## Review closed` and a short body, with the footer line included either way. On a first pass, post `✅ No findings. Reviewed against project docs and roadmap.` On a later pass, post `✅ Prior findings addressed. Re-reviewed <short-sha>, N commits since the prior pass.`
|
|
176
176
|
|
|
177
|
-
A pass carrying only minors takes the
|
|
177
|
+
A pass carrying only minors is an ordinary finding-carrying pass, so it takes the open heading and the full shape rather than either short line, since the minors have to be readable and neither line reports them. Keep whichever scope sentence the pass owes on the summary line:
|
|
178
178
|
|
|
179
179
|
```markdown
|
|
180
|
-
## Review
|
|
180
|
+
## Review
|
|
181
181
|
|
|
182
|
-
0 critical, 0 should-fix, Z minor.
|
|
182
|
+
0 critical, 0 should-fix, Z minor. Reviewed against project docs and roadmap.
|
|
183
183
|
|
|
184
184
|
**`path/to/file.ext`**
|
|
185
185
|
|
|
@@ -19,6 +19,7 @@ Two failures land specifically on where the folder sits. A workspace resolved ag
|
|
|
19
19
|
|
|
20
20
|
- Hold the workspace at the main worktree root, so one learner has one history rather than one per worktree
|
|
21
21
|
- Name the write route for a main-root path from a linked worktree, since a body naming only the destination reports a success that did not happen
|
|
22
|
+
- Route every edit inside a workspace file that already exists through a verb resolving the root in-process, since a heredoc reaches a whole-file create alone and the stream editors that would reach the rest are banned
|
|
22
23
|
- Settle the learner's starting point by asking, so difficulty sits above a measured floor
|
|
23
24
|
- Research the subject from sources before teaching it, and record what was read and what was found and not opened
|
|
24
25
|
- Place each lesson from the learning records rather than from the subject's order, and open with retrieval on the last wrong answer
|
|
@@ -40,6 +41,6 @@ Two failures land specifically on where the folder sits. A workspace resolved ag
|
|
|
40
41
|
## Out of scope
|
|
41
42
|
|
|
42
43
|
- Promoting a durable page out of the workspace, which is a judgment about public prose and belongs to a separate surface
|
|
43
|
-
-
|
|
44
|
+
- What the verbs do internally, which is the CLI domain's own contract rather than this skill's, and the records backup that carries the folder off one disk
|
|
44
45
|
- What a lesson renders as and how a quiz behaves once rendered, which the lesson-craft reference shapes and a rendering layer executes
|
|
45
46
|
- Deciding when to fire. The skill is user-invoked through `disable-model-invocation`, so opening a workspace is the learner's call rather than a description match.
|
|
@@ -18,31 +18,54 @@ The shape of the workspace is fixed by `.claude/standards/teach.md`, or `${CLAUD
|
|
|
18
18
|
- Write nothing outside the workspace folder. A durable page stays in `reference/` until a promotion pass moves it, and this skill runs no promotion.
|
|
19
19
|
- Do not open a second workspace on a subject one already covers. Resume that one.
|
|
20
20
|
|
|
21
|
-
## Step 0: resolve the workspace root
|
|
21
|
+
## Step 0: let the CLI resolve the workspace root
|
|
22
22
|
|
|
23
23
|
Workspaces live at the main worktree root, never inside a linked worktree. A copy per worktree forks the learning records, and the learner is one person.
|
|
24
24
|
|
|
25
|
+
Every `aitk teach` verb resolves that root in-process, so no step below composes a path to a workspace file. Read the folder through the CLI rather than deriving its location:
|
|
26
|
+
|
|
25
27
|
```bash
|
|
26
|
-
|
|
28
|
+
aitk teach list --json
|
|
27
29
|
```
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
It reports every workspace with its path, its counts, and the ordinal a new one would take. A `no-teach` refusal means the project has opened none yet, which is the new-workspace path in Step 1 rather than a reason to stop. The open verb creates the folder.
|
|
32
|
+
|
|
33
|
+
From a linked worktree the file-editing tools refuse every path under the main root and offer a worktree copy instead, which is a second file no later session reads. Never take that redirect. The route splits by what the write does to the file:
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
- Creating a whole file that does not exist yet, which is a lesson, a reference page, and a learning record, goes out as one plain shell command carrying a heredoc
|
|
36
|
+
- Changing a line inside a file that already exists goes through the verb that owns it, since the stream editors are banned and no other shell route reaches it
|
|
32
37
|
|
|
33
38
|
## Step 1: open or resume
|
|
34
39
|
|
|
35
|
-
|
|
40
|
+
A topic the listing already carries is a resume, and anything else is a new workspace.
|
|
36
41
|
|
|
37
|
-
On a resume, read `MISSION.md`, the highest-numbered learning record, and `GLOSSARY.md`. Those three carry where the learner stopped and what they got wrong. Report the mission's success lines with what is already met before teaching anything.
|
|
42
|
+
On a resume, run `aitk teach list <topic> --json` for the files behind each count, then read `MISSION.md`, the highest-numbered learning record, and `GLOSSARY.md`. Those three carry where the learner stopped and what they got wrong. Report the mission's success lines with what is already met before teaching anything.
|
|
38
43
|
|
|
39
44
|
On a new workspace, settle the starting point first, by asking rather than by assuming. Difficulty with no floor under it teaches nobody, and the mission cannot be written without it.
|
|
40
45
|
|
|
41
|
-
Then
|
|
46
|
+
Then open the workspace, which derives the ordinal and writes all three required files:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
aitk teach open <topic> --json \
|
|
50
|
+
--subject "<one line stating the subject>" \
|
|
51
|
+
--starting-point "<what the learner already knows>" \
|
|
52
|
+
--success "<an observable thing the learner will be able to do>" \
|
|
53
|
+
--out-of-scope "<what this workspace does not cover>"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Repeat `--success` and `--out-of-scope` per line. The verb refuses a topic another workspace already covers, which is the guard against opening a second one on the same subject.
|
|
42
57
|
|
|
43
58
|
## Step 2: research before teaching
|
|
44
59
|
|
|
45
|
-
Read the subject from sources rather than from recall. Record
|
|
60
|
+
Read the subject from sources rather than from recall. Record what was read and what was only found through the verb that owns the file:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
aitk teach resource <topic> --json \
|
|
64
|
+
--read "<title, naming which claims rest on it>=<url>" \
|
|
65
|
+
--lead "<title>=<url>"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Each flag repeats, and the pair splits on the first `=` so a URL carrying one survives. A URL already listed is refused rather than repeated.
|
|
46
69
|
|
|
47
70
|
A claim nothing was read for is the failure this step exists against. Where no source is reachable, say so in the lesson and mark what rests on recall.
|
|
48
71
|
|
|
@@ -59,7 +82,15 @@ Two outputs with two lifetimes, and the split decides the format.
|
|
|
59
82
|
- A lesson goes to `lessons/<nnnn>-<slug>.html`, self-contained, carrying its own quiz and the feedback for each answer. It links the shared stylesheet under `assets/` rather than restating styles, and the first lesson in a workspace writes that stylesheet before linking it. A lesson is disposable and is never promoted.
|
|
60
83
|
- A reference page goes to `reference/<slug>.md`, written for a reader with no learner in it. This is the half that survives the workspace, so it is written in markdown to pass the authoring gates a promotion would put it through.
|
|
61
84
|
|
|
62
|
-
Add every term the lesson defines to `GLOSSARY.md
|
|
85
|
+
Add every term the lesson defines to `GLOSSARY.md` through the verb, which places the entries alphabetically in the shape the standard fixes:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
aitk teach glossary <topic> --json \
|
|
89
|
+
--term "<term>=<definition, written without using the term>" \
|
|
90
|
+
--first-seen <the lesson or reference page this batch comes from>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`--term` repeats and one call writes the file once, which is what keeps a batch of terms from racing on it. A term already defined is refused, since a definition the subject has moved under is a revision of the entry rather than a second one.
|
|
63
94
|
|
|
64
95
|
Follow `${CLAUDE_SKILL_DIR}/references/lesson-craft.md` for what makes a lesson worth returning to. Keep every quiz answer the same length, so formatting leaks no clue about which one is correct.
|
|
65
96
|
|
package/docs/agents/commands.md
CHANGED
|
@@ -32,6 +32,10 @@ Full help: `aitk <command> --help`. Behavior notes for the install and sync verb
|
|
|
32
32
|
| `aitk tasks validate` | Report board rows whose plan, task file, group, file set, or blocker does not hold (`--json`) |
|
|
33
33
|
| `aitk intake list` | Report intake folder counts, or one folder's items, keeping what is unread with `--unread` (`--json`) |
|
|
34
34
|
| `aitk intake answer` | Write selections into one cluster's answer slots, repeating `--set <item>=<answer>` (`--json`) |
|
|
35
|
+
| `aitk teach list` | Report learning workspaces and the ordinal a new one takes, or what one workspace holds (`--json`) |
|
|
36
|
+
| `aitk teach open` | Open a workspace at the next ordinal with its mission, resources, and glossary files (`--json`) |
|
|
37
|
+
| `aitk teach resource` | Record sources and leads in a workspace, repeating `--read` or `--lead` as `<title>=<url>` (`--json`) |
|
|
38
|
+
| `aitk teach glossary` | Add terms to a workspace glossary alphabetically, repeating `--term <term>=<definition>` (`--json`) |
|
|
35
39
|
| `aitk records validate` | Report a session record or a standard against the standard governing it, per kind (`--json`) |
|
|
36
40
|
| `aitk records push` | Commit the eight backed record folders and push them to a private records remote (`--json`) |
|
|
37
41
|
| `aitk records pull` | Fetch the records remote and write it back, refusing rather than discarding unpushed records (`--json`) |
|
|
@@ -59,6 +63,7 @@ Each domain exposes a consistent shape where applicable: `list`, `install`, `syn
|
|
|
59
63
|
| `slides` | `render`, `list` |
|
|
60
64
|
| `tasks` | `archive`, `validate` |
|
|
61
65
|
| `intake` | `list`, `answer` |
|
|
66
|
+
| `teach` | `list`, `open`, `resource`, `glossary` |
|
|
62
67
|
| `comments` | `scan` |
|
|
63
68
|
| `context` | `audit` |
|
|
64
69
|
| `markdown` | `audit` |
|
package/docs/agents/index.md
CHANGED
|
@@ -26,3 +26,4 @@ CLI catalog and invocation rules for agents, split by command domain. Start with
|
|
|
26
26
|
- [Sessions](sessions.md): Resolving live peer sessions to the worktree and branch each holds, the liveness confidence field, the unresolved reasons, and what the read depends on
|
|
27
27
|
- [Skill audit](skills-audit.md): Measuring both skill corpora against standards/skill.md, the checks it reads, the requirement gate that is the only failing one, and the drift verb that names bodies rewritten since a ref
|
|
28
28
|
- [Tasks](tasks.md): Selecting a shipped task by stem or pull request, recording a number and closing an outcome, the refusal reasons, the board checks validate runs, and why the board root defaults to the main worktree
|
|
29
|
+
- [Teach](teach.md): Listing learning workspaces and the ordinal a new one takes, opening one with its required files, recording sources and glossary terms, the refusal reasons, and why every write here runs through a verb
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Teach
|
|
3
|
+
description: Listing learning workspaces and the ordinal a new one takes, opening one with its required files, recording sources and glossary terms, the refusal reasons, and why every write here runs through a verb
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Teach
|
|
7
|
+
|
|
8
|
+
Learning workspaces sit under `.claude/teach/<nn>-<topic>/`, and `standards/teach.md` fixes their layout, naming, and file formats. Every verb here resolves that folder against the main worktree root rather than against the working directory, so a session standing in a linked worktree reaches the one workspace the learner has rather than opening a second.
|
|
9
|
+
|
|
10
|
+
That root resolution is also why the writing verbs exist at all. The file-editing tools refuse a main-root path from a linked worktree and offer a worktree copy instead, and a caller naming only the destination reports a success that did not happen. A whole-file create still goes out as a shell heredoc. Changing a line inside a file that already exists has no shell route, because the stream editors are banned, so `resource` and `glossary` are the route for the two files a running workspace edits.
|
|
11
|
+
|
|
12
|
+
## List
|
|
13
|
+
|
|
14
|
+
`aitk teach list` reports the workspaces under `.claude/teach/`, or what one workspace holds. It reads and never writes.
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
aitk teach list
|
|
18
|
+
aitk teach list regular-expressions --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
| Option | Behavior |
|
|
22
|
+
| --------------- | ------------------------------------------- |
|
|
23
|
+
| `--json` | Emit a machine-readable record on stdout |
|
|
24
|
+
| `--root <path>` | Teach root, defaulting to the main worktree |
|
|
25
|
+
|
|
26
|
+
With no topic it reports one line per workspace, carrying the lesson, learning-record, reference-page, and glossary-term counts, plus `next`, the ordinal an open would take. With one it reports the filenames behind each count and the glossary entries themselves.
|
|
27
|
+
|
|
28
|
+
A folder not named `NN-<topic>` is still listed rather than dropped, since dropping it hides the one folder that needs a fix. Its ordinal reads as absent, it sorts last, and it moves no ordinal, so a malformed name cannot push a new workspace into a number a reader already cites.
|
|
29
|
+
|
|
30
|
+
The listing also names the required files a workspace does not carry, which is `MISSION.md`, `RESOURCES.md`, and `GLOSSARY.md`. That is a report rather than a refusal, because a workspace missing one is still a workspace a session can resume.
|
|
31
|
+
|
|
32
|
+
## Open
|
|
33
|
+
|
|
34
|
+
`aitk teach open` creates a workspace at the next ordinal and writes all three required files.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
aitk teach open regular-expressions \
|
|
38
|
+
--subject "Reading and writing regular expressions" \
|
|
39
|
+
--starting-point "Comfortable with the shell, has never written a group" \
|
|
40
|
+
--success "Write a pattern matching a date" \
|
|
41
|
+
--success "Explain what a backreference does"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
| Option | Behavior |
|
|
45
|
+
| ------------------------- | ----------------------------------------------------------- |
|
|
46
|
+
| `--subject <line>` | One line stating what the workspace covers, required |
|
|
47
|
+
| `--starting-point <text>` | What the learner already knows, required |
|
|
48
|
+
| `--success <line>` | Observable thing the learner will be able to do, repeatable |
|
|
49
|
+
| `--out-of-scope <line>` | What the workspace does not cover, repeatable |
|
|
50
|
+
| `--title <text>` | Title, defaulting to the topic in sentence case |
|
|
51
|
+
| `--date <YYYY-MM-DD>` | Opening date, defaulting to today |
|
|
52
|
+
| `--json` | Emit a machine-readable record on stdout |
|
|
53
|
+
| `--root <path>` | Teach root, defaulting to the main worktree |
|
|
54
|
+
|
|
55
|
+
The ordinal comes from the highest already present, incremented, so the caller derives no name and composes no path. A topic another workspace already covers is refused rather than opened beside it, since two workspaces on one subject fork the learning records the folder exists to keep whole.
|
|
56
|
+
|
|
57
|
+
`--starting-point` is required rather than defaulted because difficulty with no floor under it teaches nobody, and a mission written without one cannot say what the lessons sit above. At least one `--success` line is required for the same reason in the other direction: a mission nothing can test is a mission nothing can call finished.
|
|
58
|
+
|
|
59
|
+
## Resource
|
|
60
|
+
|
|
61
|
+
`aitk teach resource` records sources in a workspace `RESOURCES.md`, keeping what was read apart from what was only found.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
aitk teach resource regular-expressions \
|
|
65
|
+
--read "MDN regular expressions=https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_expressions" \
|
|
66
|
+
--lead "RE2 syntax=https://github.com/google/re2/wiki/Syntax"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
| Option | Behavior |
|
|
70
|
+
| -------------------- | -------------------------------------------------- |
|
|
71
|
+
| `--read <title=url>` | Source that stands behind the material, repeatable |
|
|
72
|
+
| `--lead <title=url>` | Source found and not opened, repeatable |
|
|
73
|
+
| `--json` | Emit a machine-readable record on stdout |
|
|
74
|
+
| `--root <path>` | Teach root, defaulting to the main worktree |
|
|
75
|
+
|
|
76
|
+
The pair splits on the first `=`, so a URL carrying its own separator survives intact. Say in the title which claims rest on the source, since the entry is the only place a later session reads that from.
|
|
77
|
+
|
|
78
|
+
A URL either heading already lists is refused rather than written twice. Two entries for one source split what rests on it across two lines, and a reader checking a claim then finds half of the answer.
|
|
79
|
+
|
|
80
|
+
A URL a file displays inside a fence does not count as listed, which is how a workspace quoting the entry format in its own prose is read as the sample it is.
|
|
81
|
+
|
|
82
|
+
## Glossary
|
|
83
|
+
|
|
84
|
+
`aitk teach glossary` adds terms to a workspace `GLOSSARY.md`, alphabetically.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
aitk teach glossary regular-expressions \
|
|
88
|
+
--term "capture group=A parenthesised part of a pattern whose match is kept" \
|
|
89
|
+
--first-seen 0002-groups.html
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
| Option | Behavior |
|
|
93
|
+
| -------------------------- | --------------------------------------------------------- |
|
|
94
|
+
| `--term <term=definition>` | Term the subject defines, repeatable |
|
|
95
|
+
| `--first-seen <file>` | Lesson or reference page the batch first defines these in |
|
|
96
|
+
| `--json` | Emit a machine-readable record on stdout |
|
|
97
|
+
| `--root <path>` | Teach root, defaulting to the main worktree |
|
|
98
|
+
|
|
99
|
+
One call writes one file, which keeps a batch of terms from racing on the glossary every one of them shares. `--first-seen` names one page for the whole batch rather than one per term, because a batch comes from one lesson.
|
|
100
|
+
|
|
101
|
+
A term already defined is refused rather than replaced. A definition the subject has moved under is a revision of the entry that exists, and nothing on the command line tells that apart from a second definition arriving by mistake.
|
|
102
|
+
|
|
103
|
+
The entry lands as the standard's shape, leading with the term as a bolded span. A definition not ending in sentence punctuation is terminated before the citation is appended, so a bare phrase does not run into the sentence naming where the term first appears.
|
|
104
|
+
|
|
105
|
+
## Refusal reasons
|
|
106
|
+
|
|
107
|
+
| Reason | Raised when |
|
|
108
|
+
| -------------- | --------------------------------------------------------------- |
|
|
109
|
+
| `no-teach` | The root carries no `.claude/teach/` folder |
|
|
110
|
+
| `no-workspace` | No workspace matches the topic, with the folder names as detail |
|
|
111
|
+
| `ambiguous` | Two workspaces claim one topic, with both names as detail |
|
|
112
|
+
| `exists` | A workspace already covers the topic an open names |
|
|
113
|
+
| `no-file` | The workspace carries no file the verb writes into |
|
|
114
|
+
| `no-section` | `RESOURCES.md` carries no heading the entries belong under |
|
|
115
|
+
| `listed` | A URL is already listed under either heading |
|
|
116
|
+
| `defined` | A term already carries a glossary entry |
|
|
117
|
+
| `bad-input` | The command line is malformed, before any folder is read |
|
|
118
|
+
|
|
119
|
+
A `bad-input` refusal reports the working directory as its root rather than the resolved one, since the command line is rejected before the root is worth resolving.
|
package/docs/ai-workflow.md
CHANGED
|
@@ -73,7 +73,7 @@ When features are independent, run them in parallel instead of sequentially. Use
|
|
|
73
73
|
- Ship each worktree separately with `aitk:git-ship`
|
|
74
74
|
- For full autonomy per worktree, invoke `aitk:claude-autoship` instead of the manual chain. Approve the plan, walk away, come back to draft PRs.
|
|
75
75
|
|
|
76
|
-
To run several worktrees as a coordinated flow rather than ad hoc, assert the orchestrator role in one warm session with `aitk:claude-orchestrate`. It owns the roadmap, handing a needed draft or resequence to a worker that runs `aitk:claude-roadmap` in its branch, plans each feature, refills the ready queue so a free worker never waits, and reviews each worker's PR with `aitk:claude-pr-review`, then tells the session holding that branch to run `aitk:claude-address-review` whenever the pass posted a finding at any severity,
|
|
76
|
+
To run several worktrees as a coordinated flow rather than ad hoc, assert the orchestrator role in one warm session with `aitk:claude-orchestrate`. It owns the roadmap, handing a needed draft or resequence to a worker that runs `aitk:claude-roadmap` in its branch, plans each feature, refills the ready queue so a free worker never waits, and reviews each worker's PR with `aitk:claude-pr-review`, then tells the session holding that branch to run `aitk:claude-address-review` whenever the pass posted a finding at any severity, which is the same threshold `aitk:claude-pr-review` states and posts its open heading under. The human launches workers and merges. See [operating model](operating-model.md) for the full loop.
|
|
77
77
|
|
|
78
78
|
Roadmap ownership holds while a scope exists to sequence. Once the MVP list in `.claude/REQUIREMENTS.md` has shipped, later work arrives as discrete items and the orchestrator reads `.claude/tasks/priority.md` for execution order instead.
|
|
79
79
|
|
package/docs/operating-model.md
CHANGED
|
@@ -40,8 +40,8 @@ One feature travels this path end to end.
|
|
|
40
40
|
2. Orchestrator plans the next feature with `claude-feature`, writing a plan to `.claude/plans/`. Planning stays in the warm session because good planning is cross-feature. It needs the contract other features consume and the shared wiring seam. A cold session would re-derive or guess.
|
|
41
41
|
3. The human opens a worker worktree with `claude-worktree` and runs `claude-autoship` against the plan. The worker builds, self-checks, opens a PR, and stops at the PR boundary.
|
|
42
42
|
4. Orchestrator reviews the PR with `claude-pr-review` and posts findings to it.
|
|
43
|
-
5. Orchestrator tells the session holding that branch to run `claude-address-review` once the pass posted a finding at any severity, resolving the target from a session listing taken at that moment and reporting the invocation for the human when no live session holds it. The worker addresses the findings, rebases onto `origin/main` when a sibling landed first and left the branch unable to merge, then pushes a follow-up. A pass carrying only minor findings dispatches too, since the grade runs low often enough that a floor at should-fix loses fixes a worker would have made.
|
|
44
|
-
6. Orchestrator closes the review out with `claude-pr-review` again. The second pass reads only the commits the follow-up added, or the worker's response alone when the follow-up added none, and posts under `## Review` when it finds
|
|
43
|
+
5. Orchestrator tells the session holding that branch to run `claude-address-review` once the pass posted a finding at any severity, resolving the target from a session listing taken at that moment and reporting the invocation for the human when no live session holds it. The worker addresses the findings, rebases onto `origin/main` when a sibling landed first and left the branch unable to merge, then pushes a follow-up. A pass carrying only minor findings dispatches too, since the grade runs low often enough that a floor at should-fix loses fixes a worker would have made. `claude-pr-review` states that threshold and the heading follows it, so an open heading is itself the signal to send.
|
|
44
|
+
6. Orchestrator closes the review out with `claude-pr-review` again. The second pass reads only the commits the follow-up added, or the worker's response alone when the follow-up added none, and posts under `## Review` when it finds anything and under `## Review closed` when it finds nothing, so a reader learns from the heading whether work is still owed and takes the merge decision from the counts on the line under it. Repeat from step 5 until a pass closes the review.
|
|
45
45
|
7. The human reads the result and merges. The orchestrator tells any trailing worker whose branch shares a seam with the merged one to run `claude-address-review`, which rebases whether or not the review left anything open.
|
|
46
46
|
|
|
47
47
|
There is no loop construct here. Each worker is a single build that halts at the
|
|
@@ -103,12 +103,13 @@ re-read costs a full pass rather than a delta, since the prior reviewed commit n
|
|
|
103
103
|
longer reaches the head, and `claude-pr-review` detects that itself.
|
|
104
104
|
|
|
105
105
|
The heading carries the state rather than the pass number. A pass carrying a
|
|
106
|
-
|
|
107
|
-
`## Review closed`, so a thread can be scanned for what still
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
finding at any severity takes `## Review` and a pass carrying nothing takes
|
|
107
|
+
`## Review closed`, so a thread can be scanned for what still owes work without
|
|
108
|
+
opening a comment. One threshold governs the heading and the dispatch alike, and
|
|
109
|
+
`claude-pr-review` is where it is stated, so every other surface cites that skill
|
|
110
|
+
rather than restating the grades. The merge decision comes off the counts on the
|
|
111
|
+
summary line, since an open heading now covers a minor as well as a critical.
|
|
112
|
+
A minor the worker declines goes to the findings of the task the
|
|
112
113
|
branch closes, since a thread does not survive the merge. The feedback
|
|
113
114
|
becomes a durable artifact both sessions read, survives a session ending, and
|
|
114
115
|
anchors to the change. That removes the copy-paste that otherwise routes review
|
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { register as feedback } from '@/commands/feedback'
|
|
|
21
21
|
import { register as transcripts } from '@/commands/transcripts'
|
|
22
22
|
import { register as tasks } from '@/commands/tasks'
|
|
23
23
|
import { register as intake } from '@/commands/intake'
|
|
24
|
+
import { register as teach } from '@/commands/teach'
|
|
24
25
|
import { register as comments } from '@/commands/comments'
|
|
25
26
|
import { register as context } from '@/commands/context'
|
|
26
27
|
import { register as markdown } from '@/commands/markdown'
|
|
@@ -56,6 +57,7 @@ function showHelp(): void {
|
|
|
56
57
|
`${GREY}│${NC} transcripts <url> ${GREY}# Fetch a YouTube transcript with metadata frontmatter${NC}`,
|
|
57
58
|
`${GREY}│${NC} tasks [cmd] ${GREY}# Task board commands (archive)${NC}`,
|
|
58
59
|
`${GREY}│${NC} intake [cmd] ${GREY}# Intake folders under .claude/intake/ (list, answer)${NC}`,
|
|
60
|
+
`${GREY}│${NC} teach [cmd] ${GREY}# Learning workspaces under .claude/teach/ (list, open, resource, glossary)${NC}`,
|
|
59
61
|
`${GREY}│${NC} comments [cmd] ${GREY}# Measure comment density and trend (scan)${NC}`,
|
|
60
62
|
`${GREY}│${NC} context [cmd] ${GREY}# Report context folder health (audit)${NC}`,
|
|
61
63
|
`${GREY}│${NC} markdown [cmd] ${GREY}# Report markdown against the attribute standards (audit)${NC}`,
|
|
@@ -92,6 +94,7 @@ function showHelp(): void {
|
|
|
92
94
|
`${GREY}│${NC} aitk transcripts https://youtu.be/VIDEO_ID`,
|
|
93
95
|
`${GREY}│${NC} aitk tasks archive --pull-request 673 --json`,
|
|
94
96
|
`${GREY}│${NC} aitk intake list toolkit-overview --unread --json`,
|
|
97
|
+
`${GREY}│${NC} aitk teach list --json`,
|
|
95
98
|
`${GREY}│${NC} aitk comments scan src --json`,
|
|
96
99
|
`${GREY}│${NC} aitk context audit --json`,
|
|
97
100
|
`${GREY}│${NC} aitk markdown audit .claude/rules --json`,
|
|
@@ -150,6 +153,7 @@ feedback(program)
|
|
|
150
153
|
transcripts(program)
|
|
151
154
|
tasks(program)
|
|
152
155
|
intake(program)
|
|
156
|
+
teach(program)
|
|
153
157
|
comments(program)
|
|
154
158
|
context(program)
|
|
155
159
|
markdown(program)
|