@erclx/aitk 0.99.1 → 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 +46 -0
- package/claude/skills/claude-teach/SKILL.md +115 -0
- package/claude/skills/claude-teach/references/lesson-craft.md +52 -0
- package/claude/skills/claude-teach/references/pedagogy.md +67 -0
- package/docs/agents/commands.md +5 -0
- package/docs/agents/index.md +1 -0
- package/docs/agents/records.md +10 -9
- package/docs/agents/teach.md +119 -0
- package/docs/ai-workflow.md +4 -3
- 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/backup.ts +4 -2
- package/src/records/validate.ts +190 -3
- package/src/teach/workspace.ts +797 -0
- package/standards/index.md +1 -0
- package/standards/teach.md +155 -0
|
@@ -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
|
|
|
@@ -89,7 +89,7 @@ The plan's shape is fixed by `.claude/standards/plan.md`: the section list, the
|
|
|
89
89
|
|
|
90
90
|
An execution that picks other than the suggestion rewrites the `- Suggested:` line as `overridden at execution to <pick>,` followed by the measurement that moved it, and leaves the slot blank. That fixed phrase is how a reader of the archived plan tells an override from a suggestion the execution accepted, since an authored suggestion often carries a number of its own. The same deviation takes one line in the open task's `## Findings`, which is the register that survives the plan being archived. A deviation from a question somebody already answered goes back to whoever answered it instead, since a filled slot is a decision already made.
|
|
91
91
|
|
|
92
|
-
`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`, and `
|
|
92
|
+
`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.
|
|
93
93
|
|
|
94
94
|
`aitk records push` carries these folders off the disk they live on, and `aitk records pull` brings them back. Eight of them are backed: `groundwork`, `intake`, `memory`, `plans`, `plans-archive`, `review`, `task-archive`, and `tasks`. 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.
|
|
95
95
|
|
|
@@ -278,8 +278,9 @@ This section is the corpus the coverage claim is measured against: every name `a
|
|
|
278
278
|
| -------------------------- | ------------------------------------------------------------------------------ |
|
|
279
279
|
| `aitk:toolkit-cli` | Before a sync or install, to learn what it overwrites, merges, or leaves alone |
|
|
280
280
|
| `aitk:youtube-transcripts` | When a video transcript is wanted in the repo as context |
|
|
281
|
+
| `aitk:claude-teach` | To learn a subject across sessions, in a workspace that holds the progress |
|
|
281
282
|
|
|
282
|
-
|
|
283
|
+
Every row answers a question rather than marking a point in a project's life, so a phase above would send a reader to the wrong group.
|
|
283
284
|
|
|
284
285
|
## Feedback routing
|
|
285
286
|
|
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)
|