Skip to content

Commit 89935c0

Browse files
blafourcadeclaude
andauthored
refactor(aidd-context): rework 10-learn around scoring and explicit confirm (#282)
Rebuild the learn skill so it reads a source, scores each lesson, asks the user what to do with each, and writes only what they approve. - 4 actions (gather, assess, write, sync) with the Input/Output/Process/Test anatomy; the SKILL.md router gains a plain Destinations block. - assess scores each candidate 0-10, proposes a destination, and reconciles it against the destination's current content (new, already covered, or supersedes) so a reworded repeat is not re-added and a reversal replaces the stale entry. - four destinations: Memory (fold into the matching file), Decision (a record in aidd_docs/memory/internal/decisions/ from the template), Rule and Skill (handed to their generators, never authored here). - description advertises only the directive triggers it reliably fires on. - drop the old DEC-XXX / ADR.md ceremony and the command-frontmatter templates for one clean decision-record template. Validated end to end via headless claude -p: routes, the score brake, contradiction-supersede, multi-item, exact-duplicate dedup, and a French directive (the description matches intent across languages). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent a0e8da7 commit 89935c0

12 files changed

Lines changed: 159 additions & 245 deletions

File tree

‎plugins/aidd-context/CATALOG.md‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ Auto-generated index of skills, agents, references and assets shipped by the `ai
169169

170170
#### `skills/10-learn`
171171

172-
| Group | File | Description | Argument Hint |
173-
|-------|------|---|---|
174-
| `actions` | [01-scope.md](skills/10-learn/actions/01-scope.md) | - | - |
175-
| `actions` | [02-write.md](skills/10-learn/actions/02-write.md) | - | - |
176-
| `actions` | [03-sync.md](skills/10-learn/actions/03-sync.md) | - | - |
177-
| `assets` | [adr-template.md](skills/10-learn/assets/adr-template.md) | `Architecture Decision Record template` | - |
178-
| `assets` | [decision-template.md](skills/10-learn/assets/decision-template.md) | `Individual decision record template` | `<title>` |
179-
| `-` | [README.md](skills/10-learn/README.md) | - | - |
180-
| `-` | [SKILL.md](skills/10-learn/SKILL.md) | `Capture and store project-level learnings, conventions, and decisions surfaced during work into memory, decisions, or rules. Use proactively when the user states a durable project rule or convention ("for next", "always do X", "from now on", "going forward", "rule:", "convention:"), records a technical decision and its rationale, deprecates something, or notes an insight that should outlive the current task. Do NOT use for personal or AI-preference reminders (those belong to user memory), routine code edits, minor fixes, or anything already captured.` | - |
172+
| Group | File | Description |
173+
|-------|------|---|
174+
| `actions` | [01-gather.md](skills/10-learn/actions/01-gather.md) | - |
175+
| `actions` | [02-assess.md](skills/10-learn/actions/02-assess.md) | - |
176+
| `actions` | [03-write.md](skills/10-learn/actions/03-write.md) | - |
177+
| `actions` | [04-sync.md](skills/10-learn/actions/04-sync.md) | - |
178+
| `assets` | [decision-template.md](skills/10-learn/assets/decision-template.md) | - |
179+
| `-` | [README.md](skills/10-learn/README.md) | - |
180+
| `-` | [SKILL.md](skills/10-learn/SKILL.md) | `Capture durable project learnings from the conversation or the project's git history and route them to memory, a decision record, a rule, or a new skill. Use when the user asks to capture, record, or remember a decision, a convention, or a lesson, or to distill what recent work taught. Scores each candidate and confirms before writing. Not for personal or AI preferences, routine edits, or anything already captured.` |
181181

182182
#### `skills/11-discovery`
183183

Lines changed: 26 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,43 @@
1-
← [aidd-framework](../../../../README.md) / [aidd-context](../../README.md)
1+
← [framework](../../../../README.md) / [aidd-context](../../README.md)
22

3-
# 05 - Learn
3+
# 10 - Learn
44

5-
Captures durable project-level learnings, conventions, and decisions
6-
surfaced during work and stores them as memory entries, decision records,
7-
or rules. Then refreshes the `<aidd_project_memory>` block in installed AI
8-
context files so the new knowledge is in scope on the next turn.
5+
Distills what a piece of work taught into the project's lasting context. It picks a source, scores each candidate learning, asks the user what to do with each one, writes only the approved lessons, and refreshes the memory block so the next session starts from them.
96

107
## When to use
118

12-
- The user states a durable rule or convention ("for next", "always do X",
13-
"from now on", "going forward", "rule:", "convention:").
14-
- A technical decision is made and worth recording with its rationale.
15-
- Something is deprecated, or an insight should outlive the current task.
9+
- The user states a lasting rule or convention ("from now on", "always", "going forward").
10+
- A decision is made and worth recording with its rationale.
11+
- Something is deprecated, or a piece of work is worth distilling before moving on.
1612

17-
## When NOT to use
13+
## When not to use
1814

19-
- For personal or AI-preference reminders (those belong in user memory,
20-
not project memory).
21-
- For routine code edits, minor fixes, or anything already captured.
22-
- To initialize the memory bank itself → use `02-project-memory`.
15+
- For personal or AI-preference reminders. Those belong in user memory, not the project.
16+
- For routine edits, minor fixes, or anything already captured.
17+
- To stand up the memory bank itself. Use `aidd-context:02-project-memory`.
2318

24-
## How to invoke
19+
## Requires
2520

26-
```
27-
Use skill aidd-context:10-learn
28-
```
21+
An existing memory bank (`aidd_docs/memory/`). If it is missing, run `aidd-context:02-project-memory` first.
2922

30-
The skill walks 3 atomic actions:
23+
## Flow
3124

32-
1. `scope` - worth-learning check, auto-analyze, categorize, and get
33-
explicit user approval. Exits cleanly here when nothing is
34-
learning-worthy (gates 02 and 03 out).
35-
2. `write` - create or update files for each approved item (memory entry,
36-
decision record, or rule).
37-
3. `sync` - refresh the `<aidd_project_memory>` block in installed AI
38-
context files so the new content is loaded next turn.
25+
Four actions, in order:
3926

40-
## Outputs
27+
1. `gather`: pick a source (the conversation, the git history, or one the user names), collect candidates, drop the noise.
28+
2. `assess`: score each candidate from 0 to 10 with a reason, propose a destination, and ask the user what to do with each.
29+
3. `write`: write the lessons the user approved to their destinations.
30+
4. `sync`: refresh the memory block in every context file.
4131

42-
- New or updated files under `aidd_docs/memory/`, `aidd_docs/decisions/`,
43-
or the rules directory, depending on the categorization in action 01.
44-
- Refreshed `<aidd_project_memory>` block across every installed AI
45-
context file.
46-
- A short summary table of what was learned and where it went.
32+
## Destinations
4733

48-
## Prerequisites
34+
- **Memory**: a fact or convention, into the matching memory file.
35+
- **Decision**: a choice with a rationale, a record in `aidd_docs/memory/internal/decisions/` from `assets/decision-template.md`.
36+
- **Rule**: a convention to enforce, handed to `aidd-context:05-rule-generate`.
37+
- **Skill**: a reusable workflow, handed to `aidd-context:04-skill-generate`.
4938

50-
- Project initialized with the AIDD context layer (run `02-project-memory`
51-
first if `aidd_docs/memory/` is missing).
52-
- A conversation signal worth capturing - the skill exits cleanly when
53-
there isn't one.
39+
The score is the brake (bar 6 of 10), and the user decides every item before anything is written.
5440

55-
## Technical details
41+
## Details
5642

57-
See [`SKILL.md`](SKILL.md) for the action contract,
58-
[`actions/`](actions/) for each step, and the templates in
59-
`assets/decision-template.md` and `assets/adr-template.md` for decision
60-
records.
43+
See [`SKILL.md`](SKILL.md) and [`actions/`](actions/).
Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
---
22
name: 10-learn
3-
description: Capture and store project-level learnings, conventions, and decisions surfaced during work into memory, decisions, or rules. Use proactively when the user states a durable project rule or convention ("for next", "always do X", "from now on", "going forward", "rule:", "convention:"), records a technical decision and its rationale, deprecates something, or notes an insight that should outlive the current task. Do NOT use for personal or AI-preference reminders (those belong to user memory), routine code edits, minor fixes, or anything already captured.
3+
description: Capture durable project learnings from the conversation or the project's git history and route them to memory, a decision record, a rule, or a new skill. Use when the user asks to capture, record, or remember a decision, a convention, or a lesson, or to distill what recent work taught. Scores each candidate and confirms before writing. Not for personal or AI preferences, routine edits, or anything already captured.
44
---
55

6-
# Skill: learn
6+
# Learn
77

8-
Updates memory bank, decisions, and rules to keep project context accurate after implementation.
8+
Turns what a piece of work taught into the project's lasting context. It reads a source, scores each lesson, asks the user what to do with each, and writes only what the user approves.
99

10-
## Rules
10+
## Actions
1111

12-
- Less is more. Documentation stays concise and to the point.
13-
- Avoid putting too much information.
14-
- Focus on important changes or non-alignments with existing docs.
15-
- Memory must ALWAYS be up-to-date.
12+
| # | Action | Role | Input |
13+
| --- | -------- | ------------------------------------------------------ | ----------------- |
14+
| 01 | `gather` | Pick a source and collect candidate lessons | the trigger |
15+
| 02 | `assess` | Score each lesson, propose a destination, ask the user | the candidates |
16+
| 03 | `write` | Write the approved lessons to their destinations | the approved plan |
17+
| 04 | `sync` | Refresh the memory block in every context file | the written files |
1618

17-
## Available actions
19+
Order: `01 → 02 → 03 → 04`. Run each action's `## Test` before the next. When nothing is worth learning, `01` exits and the rest is skipped.
1820

19-
| # | Action | Role | Input |
20-
| --- | ---------- | -------------------------------------------------------------------------- | ---------------------- |
21-
| 01 | `scope` | Worth-learning check, auto-analyze, categorize, user approval | conversation signal |
22-
| 02 | `write` | Create or update files for each approved item | approved plan from 01 |
23-
| 03 | `sync` | Refresh `<aidd_project_memory>` block in installed AI context files | summary table from 02 |
21+
## Destinations
2422

25-
## Default flow
23+
- **Memory.** A fact or convention. Update the matching memory file.
24+
- **Decision.** A choice with a rationale. A record in `aidd_docs/memory/internal/decisions/`, written from the decision template.
25+
- **Rule.** A convention to enforce. Handed to the rule generator, never written here.
26+
- **Skill.** A reusable workflow. Handed to the skill generator, never written here.
2627

27-
`01 → 02 → 03`. Action 01 exits cleanly when nothing is learning-worthy (Phase 1 gate); 02 and 03 are skipped in that case.
28+
## Transversal rules
29+
30+
- Ask before you write. For every lesson, show its score and proposed destination, and let the user keep it, move it, or skip it. Write nothing anywhere until the user answers.
31+
- Default to not capturing. The score is the brake. Recommend the bar at 6 of 10.
32+
- Learn needs an existing memory bank. If `aidd_docs/memory/` is absent, route to the project-memory skill, do not scaffold here.
33+
- Capture the user's project, never AIDD's own scaffold.
34+
- Touch only what a lesson affects. Preserve the user's edits. Write files, never display their content.
2835

2936
## Assets
3037

31-
- `@assets/decision-template.md` - individual decision record template
32-
- `@assets/adr-template.md` - ADR log template
38+
- `assets/decision-template.md`: the decision record format.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# 01 - Gather
2+
3+
Pick where the learning comes from, collect the raw candidates, and drop anything not worth a second look.
4+
5+
## Input
6+
7+
The trigger: the user invoked the skill, or a conversation signal auto-routed to it.
8+
9+
## Output
10+
11+
A list of raw candidate learnings, each tagged with the source it came from. An empty list when nothing surfaced, which ends the skill.
12+
13+
## Process
14+
15+
1. **Pick the source.** Offer three and let the user choose, or take the one the user named:
16+
- the current conversation, for recent decisions, pivots, and stated conventions,
17+
- the project's git history, for recent commits or the current branch's diff against the main line,
18+
- a source the user points at, like a file, a change set, or a range.
19+
20+
Block on the choice when it is ambiguous. Default to the conversation when the user gives no steer. If the git source yields nothing (not a repository, on the main line with no branch, or an empty diff), say so and fall back to the conversation or ask the user.
21+
2. **Collect.** From the chosen source, pull the raw signals: a stated rule or convention, a decision and its reason, a deprecation, a pivot that cost time, a pattern worth reusing, a pitfall worth avoiding. Read git changes for what changed and why, not line by line.
22+
3. **Drop noise.** Remove anything personal, an AI preference, a routine edit, or already captured in memory, a rule, or a decision. These never reach scoring.
23+
24+
## Test
25+
26+
- The action emits a candidate list where every item names its source, or it prints a one-line skip and ends when nothing survives the noise filter.

‎plugins/aidd-context/skills/10-learn/actions/01-scope.md‎

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# 02 - Assess
2+
3+
Score each candidate, propose where it goes, and let the user decide every one.
4+
5+
## Input
6+
7+
The candidate lessons from action 01, each with its source.
8+
9+
## Output
10+
11+
A plan the user has approved: the lessons to keep, each with its destination.
12+
13+
## Process
14+
15+
1. **Score.** Give each candidate a relevance score from 0 to 10 with a one-line reason. Weigh how durable it is, how far it generalizes beyond this task, and whether it extends or contradicts existing context.
16+
2. **Propose and reconcile.** For each candidate, name the destination it fits (Memory, Decision, Rule, or Skill, see the skill's Destinations). Then read that destination's current content and classify the candidate against it: new, already covered, or a change to what is there. A reworded repeat of something already captured is already covered, not a new lesson, even when the existing wording differs. A candidate that reverses an existing entry supersedes it.
17+
3. **Ask.** Show the candidates sorted by score, each with its score, reason, destination, and how it reconciles (new, already covered, or supersedes). Recommend the bar at 6 of 10 and recommend skipping the already-covered ones. For every candidate, let the user keep it, move it to another destination, or skip it. Write nothing anywhere until the user has decided. Block on the answer.
18+
19+
## Test
20+
21+
- Every candidate carries a score, a reason, a proposed destination, and a reconcile classification against that destination's current content, and the action writes nothing before the user has decided each one.

‎plugins/aidd-context/skills/10-learn/actions/02-write.md‎

Lines changed: 0 additions & 38 deletions
This file was deleted.

‎plugins/aidd-context/skills/10-learn/actions/03-sync.md‎

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)