continuous-improvement 3.9.2 → 3.11.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-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +61 -0
- package/QUICKSTART.md +13 -8
- package/README.md +84 -153
- package/bin/backfill.mjs +0 -0
- package/bin/check-doc-runtime-claims.mjs +0 -0
- package/bin/check-docs-substrings.mjs +73 -0
- package/bin/check-everything-mirror.mjs +0 -0
- package/bin/check-routing-targets.mjs +0 -0
- package/bin/check-scripts-citation-drift.mjs +210 -0
- package/bin/check-skill-count.mjs +110 -0
- package/bin/check-skill-law-tag.mjs +0 -0
- package/bin/check-skill-mirror.mjs +0 -0
- package/bin/check-skill-tiers.mjs +0 -0
- package/bin/check-test-imports-only.mjs +126 -0
- package/bin/check-third-party-shape.mjs +0 -0
- package/bin/companion-preference-status.mjs +231 -0
- package/bin/gateguard-clear.mjs +53 -0
- package/bin/generate-plugin-manifests.mjs +7 -1
- package/bin/harvest-friction.mjs +0 -0
- package/bin/hook-stats.mjs +0 -0
- package/bin/install.mjs +182 -26
- package/bin/lint-transcript.mjs +0 -0
- package/bin/mcp-server.mjs +215 -2
- package/bin/observe.mjs +0 -0
- package/bin/pre-commit-block-strays.sh +0 -0
- package/bin/refresh-third-party.mjs +315 -313
- package/bin/unified-cli.mjs +0 -0
- package/commands/audit.md +34 -0
- package/commands/companion-preference.md +58 -0
- package/commands/discipline.md +14 -0
- package/commands/distill.md +39 -0
- package/commands/goal-check.md +53 -0
- package/commands/grill-me.md +40 -0
- package/commands/grill-with-docs.md +38 -0
- package/commands/handoff.md +42 -0
- package/commands/proceed-with-the-recommendation.md +20 -0
- package/commands/recall.md +49 -0
- package/commands/reconcile.md +47 -0
- package/commands/superpowers.md +2 -2
- package/commands/verify-install.md +55 -0
- package/hooks/companion-preference.mjs +190 -0
- package/hooks/gateguard.mjs +60 -25
- package/hooks/goal-drift-stop.mjs +183 -0
- package/hooks/observe.sh +15 -1
- package/hooks/route-prompt.mjs +180 -0
- package/hooks/route-table.json +35 -0
- package/hooks/three-section-close.mjs +134 -132
- package/lib/cli-anything.mjs +0 -0
- package/lib/compound-engineering.mjs +0 -0
- package/lib/gateguard-state.mjs +54 -2
- package/lib/goal-drift-gate.mjs +50 -0
- package/lib/goal-state.mjs +285 -0
- package/lib/observe-event.mjs +0 -0
- package/lib/plugin-metadata.mjs +126 -12
- package/lib/pm-marketplace.mjs +0 -0
- package/lib/pm-skills.mjs +0 -0
- package/lib/recall-index.mjs +175 -0
- package/lib/resolve-home-dir.mjs +0 -0
- package/lib/skill-distill.mjs +222 -0
- package/lib/skill-tiers.mjs +0 -0
- package/lib/unified-plugin.mjs +0 -0
- package/llms.txt +1 -1
- package/package.json +11 -7
- package/plugins/beginner.json +8 -3
- package/plugins/continuous-improvement/.claude-plugin/marketplace.json +2 -2
- package/plugins/continuous-improvement/.claude-plugin/plugin.json +2 -2
- package/plugins/continuous-improvement/agents/README.md +2 -2
- package/plugins/continuous-improvement/bin/backfill.mjs +0 -0
- package/plugins/continuous-improvement/bin/gateguard-clear.mjs +53 -0
- package/plugins/continuous-improvement/bin/mcp-server.mjs +215 -2
- package/plugins/continuous-improvement/bin/observe.mjs +0 -0
- package/plugins/continuous-improvement/commands/audit.md +34 -0
- package/plugins/continuous-improvement/commands/companion-preference.md +58 -0
- package/plugins/continuous-improvement/commands/discipline.md +14 -0
- package/plugins/continuous-improvement/commands/distill.md +39 -0
- package/plugins/continuous-improvement/commands/goal-check.md +53 -0
- package/plugins/continuous-improvement/commands/grill-me.md +40 -0
- package/plugins/continuous-improvement/commands/grill-with-docs.md +38 -0
- package/plugins/continuous-improvement/commands/handoff.md +42 -0
- package/plugins/continuous-improvement/commands/proceed-with-the-recommendation.md +20 -0
- package/plugins/continuous-improvement/commands/recall.md +49 -0
- package/plugins/continuous-improvement/commands/reconcile.md +47 -0
- package/plugins/continuous-improvement/commands/superpowers.md +2 -2
- package/plugins/continuous-improvement/commands/verify-install.md +55 -0
- package/plugins/continuous-improvement/hooks/companion-preference.mjs +190 -0
- package/plugins/continuous-improvement/hooks/gateguard.mjs +60 -25
- package/plugins/continuous-improvement/hooks/goal-drift-stop.mjs +183 -0
- package/plugins/continuous-improvement/hooks/hooks.json +18 -2
- package/plugins/continuous-improvement/hooks/observe.sh +15 -1
- package/plugins/continuous-improvement/hooks/route-prompt.mjs +180 -0
- package/plugins/continuous-improvement/hooks/route-table.json +35 -0
- package/plugins/continuous-improvement/hooks/three-section-close.mjs +134 -132
- package/plugins/continuous-improvement/lib/gateguard-state.mjs +137 -0
- package/plugins/continuous-improvement/lib/goal-drift-gate.mjs +50 -0
- package/plugins/continuous-improvement/lib/goal-state.mjs +285 -0
- package/plugins/continuous-improvement/lib/observe-event.mjs +0 -0
- package/plugins/continuous-improvement/lib/plugin-metadata.mjs +126 -12
- package/plugins/continuous-improvement/lib/recall-index.mjs +175 -0
- package/plugins/continuous-improvement/lib/resolve-home-dir.mjs +0 -0
- package/plugins/continuous-improvement/lib/skill-distill.mjs +222 -0
- package/plugins/continuous-improvement/skills/README.md +8 -0
- package/plugins/continuous-improvement/skills/audit/SKILL.md +73 -0
- package/plugins/continuous-improvement/skills/deploy-receipt/SKILL.md +13 -17
- package/plugins/continuous-improvement/skills/gateguard/SKILL.md +36 -17
- package/plugins/continuous-improvement/skills/goal-monitor/SKILL.md +81 -0
- package/plugins/continuous-improvement/skills/grill-me/SKILL.md +66 -0
- package/plugins/continuous-improvement/skills/grill-with-docs/SKILL.md +252 -0
- package/plugins/continuous-improvement/skills/handoff/SKILL.md +59 -0
- package/plugins/continuous-improvement/skills/para-memory-files/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/proceed-with-the-recommendation/SKILL.md +82 -6
- package/plugins/continuous-improvement/skills/ralph/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/recall/SKILL.md +50 -0
- package/plugins/continuous-improvement/skills/reconcile/SKILL.md +80 -0
- package/plugins/continuous-improvement/skills/recovery-classification/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/safety-guard/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/skill-distillation/SKILL.md +57 -0
- package/plugins/continuous-improvement/skills/state-reconciliation/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/strategic-compact/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/superpowers/SKILL.md +76 -2
- package/plugins/continuous-improvement/skills/token-budget-advisor/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/verification-loop/SKILL.md +28 -20
- package/plugins/continuous-improvement/skills/wild-risa-balance/SKILL.md +1 -0
- package/plugins/continuous-improvement/skills/workspace-surface-audit/SKILL.md +1 -1
- package/plugins/continuous-improvement/skills/worktree-safety/SKILL.md +3 -2
- package/plugins/expert.json +27 -2
- package/skills/README.md +3 -0
- package/skills/audit.md +73 -0
- package/skills/deploy-receipt.md +13 -17
- package/skills/gateguard.md +36 -17
- package/skills/goal-monitor.md +81 -0
- package/skills/grill-me.md +66 -0
- package/skills/grill-with-docs.md +252 -0
- package/skills/handoff.md +59 -0
- package/skills/para-memory-files.md +1 -1
- package/skills/proceed-with-the-recommendation.md +82 -6
- package/skills/ralph.md +1 -0
- package/skills/recall.md +50 -0
- package/skills/reconcile.md +80 -0
- package/skills/recovery-classification.md +1 -0
- package/skills/safety-guard.md +1 -0
- package/skills/skill-distillation.md +57 -0
- package/skills/state-reconciliation.md +1 -0
- package/skills/strategic-compact.md +1 -0
- package/skills/superpowers.md +76 -2
- package/skills/token-budget-advisor.md +1 -1
- package/skills/verification-loop.md +28 -20
- package/skills/wild-risa-balance.md +1 -0
- package/skills/workspace-surface-audit.md +1 -1
- package/skills/worktree-safety.md +3 -2
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: goal-monitor
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 2 (Plan Is Sacred) of the 7 Laws of AI Agent Discipline. Detects when a session has drifted away from its stated goal by scoring recent tool activity against the '## Goal' section of task_plan.md, so drift is caught mid-session instead of at end-of-session reflection.
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Goal Monitor — Continuous Drift Detection
|
|
10
|
+
|
|
11
|
+
A "Clear Goal" discipline: a stated goal is only useful if something keeps checking the work against it. `task_plan.md` captures the goal once; this skill turns it into a recurring check so a session that has quietly wandered off into unrelated files surfaces the drift while there is still budget to course-correct.
|
|
12
|
+
|
|
13
|
+
## When to Activate
|
|
14
|
+
|
|
15
|
+
- After a long stretch of edits, before claiming progress on the original goal.
|
|
16
|
+
- When you suspect the work has sprawled across unrelated areas of the codebase.
|
|
17
|
+
- Before a checkpoint or handoff, to confirm the session stayed on its stated goal.
|
|
18
|
+
- Any time the goal in `task_plan.md` and the actual tool activity might have diverged.
|
|
19
|
+
|
|
20
|
+
## Core Concept
|
|
21
|
+
|
|
22
|
+
Law 2 says the plan is sacred. But "sacred" is hollow if nothing measures adherence. Goal Monitor scores the most recent observations against the goal and reports one of three states:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
ON GOAL — recent activity relates to the goal (score >= threshold)
|
|
26
|
+
DRIFT — most recent activity is unrelated, or touched forbidden paths
|
|
27
|
+
NO DATA — not enough observations in the window yet
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The score is the fraction of recent observations whose tool name, input, or output references a goal keyword — or whose edited path falls under a goal-scope glob.
|
|
31
|
+
|
|
32
|
+
## Goal Source
|
|
33
|
+
|
|
34
|
+
The check reads, in order:
|
|
35
|
+
|
|
36
|
+
1. `task_plan.md` in the project root (seeded by `ci_plan_init` / `/planning-with-files`).
|
|
37
|
+
2. `~/.claude/instincts/<project-hash>/goal.md` (fallback for non-repo sessions).
|
|
38
|
+
3. An explicit `goal_file` argument, if provided.
|
|
39
|
+
|
|
40
|
+
The plan needs a `## Goal` section. Two optional sections sharpen the signal:
|
|
41
|
+
|
|
42
|
+
```markdown
|
|
43
|
+
## Goal
|
|
44
|
+
Implement OAuth login with JWT session tokens for the auth service.
|
|
45
|
+
|
|
46
|
+
## Goal Keywords
|
|
47
|
+
oauth, jwt, login, session
|
|
48
|
+
|
|
49
|
+
## Goal Scope
|
|
50
|
+
paths: src/auth/**, test/auth/**
|
|
51
|
+
forbidden: src/marketing/**
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
When `## Goal Keywords` is absent, keywords are auto-extracted from the goal prose (stopwords and short tokens dropped). `## Goal Scope` is optional: `paths` globs count as on-goal matches; `forbidden` globs are a hard drift signal even when keywords also match.
|
|
55
|
+
|
|
56
|
+
## How to Invoke
|
|
57
|
+
|
|
58
|
+
The check is exposed as the `ci_goal_check` MCP tool (expert mode) and the `/goal-check` slash command:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
ci_goal_check # score the last 30 observations against task_plan.md
|
|
62
|
+
ci_goal_check limit=50 # widen the window
|
|
63
|
+
ci_goal_check goal_file=docs/x.md # score against a specific plan file
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Acting on the Result
|
|
67
|
+
|
|
68
|
+
- **ON GOAL** — proceed; the plan and the work agree.
|
|
69
|
+
- **DRIFT** — stop and decide explicitly: either steer back to the goal, or, if the goal has legitimately changed, update the `## Goal` section so the plan stays the single source of truth. Do not silently let the work and the plan disagree — that is exactly the Law 2 violation this skill exists to catch.
|
|
70
|
+
- **NO DATA** — keep working; the observation window is still filling.
|
|
71
|
+
|
|
72
|
+
## Limitations
|
|
73
|
+
|
|
74
|
+
- Keyword scoring is lexical, not semantic: a goal that says "login" will not match activity that only ever says "authentication". Add synonyms to `## Goal Keywords` when vocabulary diverges.
|
|
75
|
+
- A deliberately broad goal ("refactor the whole repo") will score nearly everything as on-goal. Use `## Goal Scope` to add precision when the goal is narrow.
|
|
76
|
+
|
|
77
|
+
## Pairs With
|
|
78
|
+
|
|
79
|
+
- **`proceed-with-the-recommendation`** (orchestrator, Law 2) — run a goal check at phase boundaries to confirm the plan still matches the work.
|
|
80
|
+
- **`para-memory-files`** / planning-with-files — the `## Goal` section this skill reads is the same one those workflows write.
|
|
81
|
+
- **`strategic-compact`** — before compacting a long session, a goal check confirms what the session was actually about.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-me
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Interview the user relentlessly about a plan or design until shared understanding is reached, resolving every branch of the decision tree before any code is written. Ported from mattpocock/skills under MIT.
|
|
5
|
+
origin: https://github.com/mattpocock/skills
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /grill-me — Interrogate the plan before executing it
|
|
9
|
+
|
|
10
|
+
Ported verbatim in behavior from [mattpocock/skills `productivity/grill-me`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md) (MIT, © 2026 Matt Pocock). Cold-storage snapshot at [`third-party/mattpocock-skills/skills/productivity/grill-me/SKILL.md`](../third-party/mattpocock-skills/skills/productivity/grill-me/SKILL.md); SHA pin in [`third-party/MANIFEST.md`](../third-party/MANIFEST.md).
|
|
11
|
+
|
|
12
|
+
## What this skill does
|
|
13
|
+
|
|
14
|
+
Interview the user relentlessly about every aspect of the plan until shared understanding is reached. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide a recommended answer.
|
|
15
|
+
|
|
16
|
+
Ask questions one at a time.
|
|
17
|
+
|
|
18
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
19
|
+
|
|
20
|
+
## When to fire it
|
|
21
|
+
|
|
22
|
+
- The user has just stated a goal at a high level ("add auth", "speed up the API") with no spec underneath.
|
|
23
|
+
- A `/proceed-with-the-recommendation` walk is about to start but the recommendation list itself is ambiguous about scope or success criteria.
|
|
24
|
+
- An RFC, PRD, or plan doc is being drafted and the user wants pressure on the assumptions before writing it.
|
|
25
|
+
- The user types "grill me", "stress-test this plan", or "interview me about X".
|
|
26
|
+
- `gateguard` is firing because the agent does not have enough grounding to proceed safely on a Write/Edit/Bash — alignment is missing, not just facts.
|
|
27
|
+
|
|
28
|
+
## How it differs from `gateguard`
|
|
29
|
+
|
|
30
|
+
`gateguard` is a tool-boundary gate that blocks Edit / Write / Bash until the agent provides concrete investigation (importers, schemas, user instruction). It catches the case where the agent thinks it knows enough to mutate state. `grill-me` is the conversational layer one floor above: it surfaces the missing decisions before any tool call would even be attempted. They compose:
|
|
31
|
+
|
|
32
|
+
| Gap | Caught by |
|
|
33
|
+
|---|---|
|
|
34
|
+
| Agent has no spec, no plan — about to invent one | `grill-me` |
|
|
35
|
+
| Agent has a plan but specific branches are under-specified | `grill-me` |
|
|
36
|
+
| Agent is about to Edit / Write / Bash without grounding | `gateguard` |
|
|
37
|
+
| Plan exists, grounded, but the implementation drifts | `verification-loop`, `tdd-workflow` |
|
|
38
|
+
|
|
39
|
+
## Interview discipline
|
|
40
|
+
|
|
41
|
+
Five rules the agent should hold while grilling:
|
|
42
|
+
|
|
43
|
+
1. **One question at a time.** Multi-question turns let the user skim and answer the easy ones. Force depth on each branch.
|
|
44
|
+
2. **Always recommend.** Every question carries a "my answer would be X because Y" so the user can confirm, override, or expose a third option you hadn't considered.
|
|
45
|
+
3. **Explore before asking.** If `grep` / `ls` / a quick read can answer the question, do that first. Do not waste user attention on questions the codebase already answers.
|
|
46
|
+
4. **Walk the tree, do not jump.** Resolve dependencies in order — do not ask about deployment if you have not pinned the data model yet.
|
|
47
|
+
5. **Stop when the spec is shippable.** The end state is a plan a fresh agent could execute cold, not an endless interview. When the next agent could pick up the doc and run, stop.
|
|
48
|
+
|
|
49
|
+
## How it fits the 7 Laws
|
|
50
|
+
|
|
51
|
+
| Law | Role of this skill |
|
|
52
|
+
|---|---|
|
|
53
|
+
| Law 1 (Research Before Executing) | Pre-execution interrogation closes the alignment gap that misaligns the agent with the user before any tool call. |
|
|
54
|
+
| Law 2 (Plan Is Sacred) | The interview produces a plan grounded in real decisions, not invented defaults. |
|
|
55
|
+
| Law 4 (Verify Before Reporting) | Every recommended answer is a falsifiable claim the user can correct in the moment. |
|
|
56
|
+
|
|
57
|
+
## Companion / alternative skills
|
|
58
|
+
|
|
59
|
+
- [`gateguard`](./gateguard.md) — tool-boundary gate; blocks Edit / Write / Bash until grounding is presented. Fires after `grill-me` has aligned the spec.
|
|
60
|
+
- [`workspace-surface-audit`](./workspace-surface-audit.md) — Law 1 surface audit; inventory of MCP servers, plugins, env, hooks. Use when the missing context is "what is available in this repo" rather than "what should we build."
|
|
61
|
+
- [`superpowers:brainstorming`](https://github.com/obra/superpowers/blob/main/skills/brainstorming/SKILL.md) — Socratic design refinement. Use for open-ended ideation; use `grill-me` once the idea is committed and needs hardening.
|
|
62
|
+
- [`handoff`](./handoff.md) — session-end compaction. Pair with `grill-me`: grill at start, handoff at end.
|
|
63
|
+
|
|
64
|
+
## Attribution
|
|
65
|
+
|
|
66
|
+
This skill is a port of [mattpocock/skills `productivity/grill-me`](https://github.com/mattpocock/skills/blob/main/skills/productivity/grill-me/SKILL.md). MIT-licensed upstream, MIT-licensed here. See [`third-party/mattpocock-skills/LICENSE`](../third-party/mattpocock-skills/LICENSE) for the verbatim license and [`third-party/mattpocock-skills/OUR_NOTES.md`](../third-party/mattpocock-skills/OUR_NOTES.md) for the vendoring rationale and drift radar.
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-with-docs
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 1 (Research Before Executing) and Law 7 (Learn From Every Session) of the 7 Laws of AI Agent Discipline. Grilling session that challenges your plan against the existing domain model, sharpens terminology, and updates CONTEXT.md + ADRs inline as decisions crystallise. Ported from mattpocock/skills under MIT.
|
|
5
|
+
origin: https://github.com/mattpocock/skills
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# /grill-with-docs — Grill the plan AND update the docs as decisions land
|
|
9
|
+
|
|
10
|
+
Ported in behavior from [mattpocock/skills `engineering/grill-with-docs`](https://github.com/mattpocock/skills/blob/main/skills/engineering/grill-with-docs/SKILL.md) (MIT, © 2026 Matt Pocock). Cold-storage snapshot of the three upstream files (`SKILL.md`, `CONTEXT-FORMAT.md`, `ADR-FORMAT.md`) at [`third-party/mattpocock-skills/skills/engineering/grill-with-docs/`](../third-party/mattpocock-skills/skills/engineering/grill-with-docs/); SHA pin in [`third-party/MANIFEST.md`](../third-party/MANIFEST.md).
|
|
11
|
+
|
|
12
|
+
The two format specs (CONTEXT.md format, ADR format) are inlined as appendices in this file so the bundled skill is self-contained — see [Appendix A: CONTEXT.md format](#appendix-a-contextmd-format) and [Appendix B: ADR format](#appendix-b-adr-format).
|
|
13
|
+
|
|
14
|
+
## What this skill does
|
|
15
|
+
|
|
16
|
+
<what-to-do>
|
|
17
|
+
|
|
18
|
+
Interview the user relentlessly about every aspect of this plan until shared understanding is reached. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide a recommended answer.
|
|
19
|
+
|
|
20
|
+
Ask questions one at a time, waiting for feedback on each before continuing.
|
|
21
|
+
|
|
22
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
23
|
+
|
|
24
|
+
</what-to-do>
|
|
25
|
+
|
|
26
|
+
## Domain awareness
|
|
27
|
+
|
|
28
|
+
During codebase exploration, also look for existing documentation:
|
|
29
|
+
|
|
30
|
+
### File structure
|
|
31
|
+
|
|
32
|
+
Most repos have a single context:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
/
|
|
36
|
+
├── CONTEXT.md
|
|
37
|
+
├── docs/
|
|
38
|
+
│ └── adr/
|
|
39
|
+
│ ├── 0001-event-sourced-orders.md
|
|
40
|
+
│ └── 0002-postgres-for-write-model.md
|
|
41
|
+
└── src/
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If a `CONTEXT-MAP.md` exists at the root, the repo has multiple contexts. The map points to where each one lives:
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
/
|
|
48
|
+
├── CONTEXT-MAP.md
|
|
49
|
+
├── docs/
|
|
50
|
+
│ └── adr/ ← system-wide decisions
|
|
51
|
+
├── src/
|
|
52
|
+
│ ├── ordering/
|
|
53
|
+
│ │ ├── CONTEXT.md
|
|
54
|
+
│ │ └── docs/adr/ ← context-specific decisions
|
|
55
|
+
│ └── billing/
|
|
56
|
+
│ ├── CONTEXT.md
|
|
57
|
+
│ └── docs/adr/
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Create files lazily — only when you have something to write. If no `CONTEXT.md` exists, create one when the first term is resolved. If no `docs/adr/` exists, create it when the first ADR is needed.
|
|
61
|
+
|
|
62
|
+
## During the session
|
|
63
|
+
|
|
64
|
+
### Challenge against the glossary
|
|
65
|
+
|
|
66
|
+
When the user uses a term that conflicts with the existing language in `CONTEXT.md`, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y — which is it?"
|
|
67
|
+
|
|
68
|
+
### Sharpen fuzzy language
|
|
69
|
+
|
|
70
|
+
When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account' — do you mean the Customer or the User? Those are different things."
|
|
71
|
+
|
|
72
|
+
### Discuss concrete scenarios
|
|
73
|
+
|
|
74
|
+
When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.
|
|
75
|
+
|
|
76
|
+
### Cross-reference with code
|
|
77
|
+
|
|
78
|
+
When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible — which is right?"
|
|
79
|
+
|
|
80
|
+
### Update CONTEXT.md inline
|
|
81
|
+
|
|
82
|
+
When a term is resolved, update `CONTEXT.md` right there. Don't batch these up — capture them as they happen. Use the format in [Appendix A](#appendix-a-contextmd-format).
|
|
83
|
+
|
|
84
|
+
Don't couple `CONTEXT.md` to implementation details. Only include terms that are meaningful to domain experts.
|
|
85
|
+
|
|
86
|
+
### Offer ADRs sparingly
|
|
87
|
+
|
|
88
|
+
Only offer to create an ADR when all three are true:
|
|
89
|
+
|
|
90
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
91
|
+
2. **Surprising without context** — a future reader will wonder "why did they do it this way?"
|
|
92
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
93
|
+
|
|
94
|
+
If any of the three is missing, skip the ADR. Use the format in [Appendix B](#appendix-b-adr-format).
|
|
95
|
+
|
|
96
|
+
## How it fits the 7 Laws
|
|
97
|
+
|
|
98
|
+
| Law | Role of this skill |
|
|
99
|
+
|---|---|
|
|
100
|
+
| Law 1 (Research Before Executing) | Pre-execution interrogation + codebase exploration close the alignment gap before any tool call. |
|
|
101
|
+
| Law 2 (Plan Is Sacred) | The interview produces a plan grounded in domain language, not invented defaults. |
|
|
102
|
+
| Law 7 (Learn From Every Session) | CONTEXT.md updates persist resolved jargon across sessions; ADRs persist decisions across years. |
|
|
103
|
+
|
|
104
|
+
## How it differs from `grill-me`
|
|
105
|
+
|
|
106
|
+
| Skill | Focus |
|
|
107
|
+
|---|---|
|
|
108
|
+
| [`grill-me`](./grill-me.md) | Conversation-only grilling. No artifact. Use when there is no project to update or the project has no docs convention yet. |
|
|
109
|
+
| `grill-with-docs` | Grilling that **updates `CONTEXT.md` and `docs/adr/` inline as decisions land**. Use once the project has, or is willing to start, a shared-language doc. |
|
|
110
|
+
|
|
111
|
+
If a repo has no CONTEXT.md and the conversation is exploratory, start with `grill-me`. Once the user commits to a direction, switch to `grill-with-docs` to capture terminology and decisions as they crystallise.
|
|
112
|
+
|
|
113
|
+
## Companion / alternative skills
|
|
114
|
+
|
|
115
|
+
- [`grill-me`](./grill-me.md) — same interview discipline, no doc artifact.
|
|
116
|
+
- [`handoff`](./handoff.md) — end-of-session compaction; pairs with grill-with-docs (grill to align, handoff to compact).
|
|
117
|
+
- [`workspace-surface-audit`](./workspace-surface-audit.md) — inventory of available tooling; complementary to the domain-language interview.
|
|
118
|
+
- [`gateguard`](./gateguard.md) — tool-boundary gate that fires after alignment is reached.
|
|
119
|
+
|
|
120
|
+
## Attribution
|
|
121
|
+
|
|
122
|
+
This skill is a port of [mattpocock/skills `engineering/grill-with-docs`](https://github.com/mattpocock/skills/blob/main/skills/engineering/grill-with-docs/SKILL.md) (with bundled `CONTEXT-FORMAT.md` and `ADR-FORMAT.md` inlined as appendices). MIT-licensed upstream, MIT-licensed here. See [`third-party/mattpocock-skills/LICENSE`](../third-party/mattpocock-skills/LICENSE) for the verbatim license and [`third-party/mattpocock-skills/OUR_NOTES.md`](../third-party/mattpocock-skills/OUR_NOTES.md) for the vendoring rationale and drift radar.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## Appendix A: CONTEXT.md format
|
|
127
|
+
|
|
128
|
+
### Structure
|
|
129
|
+
|
|
130
|
+
```md
|
|
131
|
+
# {Context Name}
|
|
132
|
+
|
|
133
|
+
{One or two sentence description of what this context is and why it exists.}
|
|
134
|
+
|
|
135
|
+
## Language
|
|
136
|
+
|
|
137
|
+
**Order**:
|
|
138
|
+
{A concise description of the term}
|
|
139
|
+
_Avoid_: Purchase, transaction
|
|
140
|
+
|
|
141
|
+
**Invoice**:
|
|
142
|
+
A request for payment sent to a customer after delivery.
|
|
143
|
+
_Avoid_: Bill, payment request
|
|
144
|
+
|
|
145
|
+
**Customer**:
|
|
146
|
+
A person or organization that places orders.
|
|
147
|
+
_Avoid_: Client, buyer, account
|
|
148
|
+
|
|
149
|
+
## Relationships
|
|
150
|
+
|
|
151
|
+
- An **Order** produces one or more **Invoices**
|
|
152
|
+
- An **Invoice** belongs to exactly one **Customer**
|
|
153
|
+
|
|
154
|
+
## Example dialogue
|
|
155
|
+
|
|
156
|
+
> **Dev:** "When a **Customer** places an **Order**, do we create the **Invoice** immediately?"
|
|
157
|
+
> **Domain expert:** "No — an **Invoice** is only generated once a **Fulfillment** is confirmed."
|
|
158
|
+
|
|
159
|
+
## Flagged ambiguities
|
|
160
|
+
|
|
161
|
+
- "account" was used to mean both **Customer** and **User** — resolved: these are distinct concepts.
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Rules
|
|
165
|
+
|
|
166
|
+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others as aliases to avoid.
|
|
167
|
+
- **Flag conflicts explicitly.** If a term is used ambiguously, call it out in "Flagged ambiguities" with a clear resolution.
|
|
168
|
+
- **Keep definitions tight.** One sentence max. Define what it IS, not what it does.
|
|
169
|
+
- **Show relationships.** Use bold term names and express cardinality where obvious.
|
|
170
|
+
- **Only include terms specific to this project's context.** General programming concepts (timeouts, error types, utility patterns) don't belong even if the project uses them extensively. Before adding a term, ask: is this a concept unique to this context, or a general programming concept? Only the former belongs.
|
|
171
|
+
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
|
|
172
|
+
- **Write an example dialogue.** A conversation between a dev and a domain expert that demonstrates how the terms interact naturally and clarifies boundaries between related concepts.
|
|
173
|
+
|
|
174
|
+
### Single vs multi-context repos
|
|
175
|
+
|
|
176
|
+
**Single context (most repos):** One `CONTEXT.md` at the repo root.
|
|
177
|
+
|
|
178
|
+
**Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
|
|
179
|
+
|
|
180
|
+
```md
|
|
181
|
+
# Context Map
|
|
182
|
+
|
|
183
|
+
## Contexts
|
|
184
|
+
|
|
185
|
+
- Ordering — receives and tracks customer orders
|
|
186
|
+
- Billing — generates invoices and processes payments
|
|
187
|
+
- Fulfillment — manages warehouse picking and shipping
|
|
188
|
+
|
|
189
|
+
## Relationships
|
|
190
|
+
|
|
191
|
+
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
|
|
192
|
+
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
|
|
193
|
+
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
The skill infers which structure applies:
|
|
197
|
+
|
|
198
|
+
- If `CONTEXT-MAP.md` exists, read it to find contexts
|
|
199
|
+
- If only a root `CONTEXT.md` exists, single context
|
|
200
|
+
- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
|
|
201
|
+
|
|
202
|
+
When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Appendix B: ADR format
|
|
207
|
+
|
|
208
|
+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
|
|
209
|
+
|
|
210
|
+
Create the `docs/adr/` directory lazily — only when the first ADR is needed.
|
|
211
|
+
|
|
212
|
+
### Template
|
|
213
|
+
|
|
214
|
+
```md
|
|
215
|
+
# {Short title of the decision}
|
|
216
|
+
|
|
217
|
+
{1-3 sentences: what's the context, what did we decide, and why.}
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
That's it. An ADR can be a single paragraph. The value is in recording *that* a decision was made and *why* — not in filling out sections.
|
|
221
|
+
|
|
222
|
+
### Optional sections
|
|
223
|
+
|
|
224
|
+
Only include these when they add genuine value. Most ADRs won't need them.
|
|
225
|
+
|
|
226
|
+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
|
|
227
|
+
- **Considered Options** — only when the rejected alternatives are worth remembering
|
|
228
|
+
- **Consequences** — only when non-obvious downstream effects need to be called out
|
|
229
|
+
|
|
230
|
+
### Numbering
|
|
231
|
+
|
|
232
|
+
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
233
|
+
|
|
234
|
+
### When to offer an ADR
|
|
235
|
+
|
|
236
|
+
All three of these must be true:
|
|
237
|
+
|
|
238
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
239
|
+
2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
|
|
240
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
241
|
+
|
|
242
|
+
If a decision is easy to reverse, skip it — you'll just reverse it. If it's not surprising, nobody will wonder why. If there was no real alternative, there's nothing to record beyond "we did the obvious thing."
|
|
243
|
+
|
|
244
|
+
#### What qualifies
|
|
245
|
+
|
|
246
|
+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
|
|
247
|
+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
|
|
248
|
+
- **Technology choices that carry lock-in.** Database, message bus, auth provider, deployment target. Not every library — just the ones that would take a quarter to swap out.
|
|
249
|
+
- **Boundary and scope decisions.** "Customer data is owned by the Customer context; other contexts reference it by ID only." The explicit no-s are as valuable as the yes-s.
|
|
250
|
+
- **Deliberate deviations from the obvious path.** "We're using manual SQL instead of an ORM because X." Anything where a reasonable reader would assume the opposite. These stop the next engineer from "fixing" something that was deliberate.
|
|
251
|
+
- **Constraints not visible in the code.** "We can't use AWS because of compliance requirements." "Response times must be under 200ms because of the partner API contract."
|
|
252
|
+
- **Rejected alternatives when the rejection is non-obvious.** If you considered GraphQL and picked REST for subtle reasons, record it — otherwise someone will suggest GraphQL again in six months.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: handoff
|
|
3
|
+
tier: "2"
|
|
4
|
+
description: Enforces Law 5 (Reflect After Every Session) of the 7 Laws of AI Agent Discipline. Compact the current conversation into a handoff document for another agent to pick up. Ported from mattpocock/skills under MIT.
|
|
5
|
+
argument-hint: "What will the next session be used for?"
|
|
6
|
+
origin: https://github.com/mattpocock/skills
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# /handoff — Hand the session off to a fresh agent
|
|
10
|
+
|
|
11
|
+
Ported verbatim in behavior from [mattpocock/skills `in-progress/handoff`](https://github.com/mattpocock/skills/blob/main/skills/in-progress/handoff/SKILL.md) (MIT, © 2026 Matt Pocock). Cold-storage snapshot at [`third-party/mattpocock-skills/skills/in-progress/handoff/SKILL.md`](../third-party/mattpocock-skills/skills/in-progress/handoff/SKILL.md); SHA pin in [`third-party/MANIFEST.md`](../third-party/MANIFEST.md).
|
|
12
|
+
|
|
13
|
+
## What this skill does
|
|
14
|
+
|
|
15
|
+
Write a handoff document summarising the current conversation so a fresh agent can continue the work. Save it to a path produced by `mktemp -t handoff-XXXXXX.md` (read the file before you write to it).
|
|
16
|
+
|
|
17
|
+
Suggest the skills to be used, if any, by the next session.
|
|
18
|
+
|
|
19
|
+
Do not duplicate content already captured in other artifacts (PRDs, plans, ADRs, issues, commits, diffs). Reference them by path or URL instead.
|
|
20
|
+
|
|
21
|
+
If the user passed arguments, treat them as a description of what the next session will focus on and tailor the doc accordingly.
|
|
22
|
+
|
|
23
|
+
## When to fire it
|
|
24
|
+
|
|
25
|
+
- End of a working session that did not finish the task — you want the next agent to pick up cold without re-reading the whole transcript.
|
|
26
|
+
- Context budget approaching the ceiling and `/compact` would lose load-bearing state — write a handoff doc first, then compact.
|
|
27
|
+
- Switching from one repo or branch to another mid-session — capture what was decided in the active context before the swap.
|
|
28
|
+
- Before invoking a long-running autonomous loop (`/ralph`, `/loop`) that will run while you are away.
|
|
29
|
+
|
|
30
|
+
## What goes in the doc
|
|
31
|
+
|
|
32
|
+
The handoff is a brief, not a transcript. A useful one fits on one screen and answers, in order:
|
|
33
|
+
|
|
34
|
+
1. **Goal** — the one-sentence outcome the user is steering toward.
|
|
35
|
+
2. **Current state** — what is actually true on disk / in the system right now (branch, last commit, open files, last verified step).
|
|
36
|
+
3. **Decisions made this session** — only what is not already in commits, PRDs, ADRs, or the plan doc.
|
|
37
|
+
4. **Open questions** — blocking choices the next agent needs the user to answer before continuing.
|
|
38
|
+
5. **Next concrete step** — the single action the next agent should take first.
|
|
39
|
+
6. **Skills to load** — names of the skills the next session should activate (e.g. `verification-loop`, `superpowers:writing-plans`, `gateguard`).
|
|
40
|
+
|
|
41
|
+
Anything that is already captured elsewhere gets a path or URL pointer, not a duplicate.
|
|
42
|
+
|
|
43
|
+
## How it fits the 7 Laws
|
|
44
|
+
|
|
45
|
+
| Law | Role of this skill |
|
|
46
|
+
|---|---|
|
|
47
|
+
| Law 5 (Reflect After Every Session) | The handoff is the reflection artifact — what changed, what was decided, what remains. |
|
|
48
|
+
| Law 7 (Learn From Every Session) | Naming the skills the next session should activate is a learned-pattern signal. |
|
|
49
|
+
| Law 2 (Plan Is Sacred) | The "next concrete step" preserves the existing plan across the session boundary instead of restarting from blank. |
|
|
50
|
+
|
|
51
|
+
## Companion / alternative skills
|
|
52
|
+
|
|
53
|
+
- [`strategic-compact`](./strategic-compact.md) — compact the current session at a phase boundary instead of writing a handoff doc. Use when the session continues with the same agent.
|
|
54
|
+
- [`para-memory-files`](./para-memory-files.md) — durable cross-session memory under `~/.claude/memory/`. Use for classified facts (user, project, feedback, reference), not per-session handoff briefs.
|
|
55
|
+
- `superpowers:writing-plans` — produce the plan doc the handoff can reference instead of duplicating.
|
|
56
|
+
|
|
57
|
+
## Attribution
|
|
58
|
+
|
|
59
|
+
This skill is a port of [mattpocock/skills `in-progress/handoff`](https://github.com/mattpocock/skills/blob/main/skills/in-progress/handoff/SKILL.md). MIT-licensed upstream, MIT-licensed here. See [`third-party/mattpocock-skills/LICENSE`](../third-party/mattpocock-skills/LICENSE) for the verbatim license and [`third-party/mattpocock-skills/OUR_NOTES.md`](../third-party/mattpocock-skills/OUR_NOTES.md) for the vendoring rationale and drift radar.
|
|
@@ -63,7 +63,7 @@ $AGENT_HOME/life/
|
|
|
63
63
|
- Significant project or company in the user's life.
|
|
64
64
|
- Otherwise, note it in daily notes.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
Atomic facts in `items.yaml` use the fields `id`, `created`, `content`, and optional `status` (`active` or `superseded`) with `superseded_by` pointing to the replacing fact. Memory decay is manual: rewrite `summary.md` weekly from active facts and move inactive entity folders to `archives/`.
|
|
67
67
|
|
|
68
68
|
### Layer 2: Daily Notes (`$AGENT_HOME/memory/YYYY-MM-DD.md`)
|
|
69
69
|
|
|
@@ -57,21 +57,95 @@ Do NOT use when:
|
|
|
57
57
|
- User scoped the work ("just the first one", "only the safe ones") — honor the scope
|
|
58
58
|
- Recommendations conflict with project agent-instruction files (CLAUDE.md / AGENTS.md / GEMINI.md / equivalent)
|
|
59
59
|
|
|
60
|
+
## Fast-Path: `--once` Mode
|
|
61
|
+
|
|
62
|
+
For single-item, low-risk confirmations, the seven-phase flow below is overkill — P-MAG + plan-restate + reflect + three-section close add more ceremony than the work itself. `--once` is an opt-in fast path that runs **Phase 1 (Pre-Flight) + Phase 3 (Execute) + Phase 4 (Verify) only**. Phase 0 (P-MAG), Phase 2 (Plan), Phase 5 (Iterate-on-failure restart), Phase 6 (Reflect), and Phase 7 (three-section close) are skipped.
|
|
63
|
+
|
|
64
|
+
### When `--once` applies
|
|
65
|
+
|
|
66
|
+
Invoke `--once` only when ALL of the following hold:
|
|
67
|
+
|
|
68
|
+
- The prior turn's recommendation list contained **exactly one** item.
|
|
69
|
+
- The item is tagged **`safe`** in Phase 1 (not `caution`, not `needs-approval`).
|
|
70
|
+
- The item is fully verifiable with a single smallest check (one typecheck, one curl, one read-back, one command output snippet).
|
|
71
|
+
- The user explicitly added `--once` to the trigger or invoked `/proceed-with-the-recommendation --once`.
|
|
72
|
+
|
|
73
|
+
### Trigger phrases for `--once`
|
|
74
|
+
|
|
75
|
+
- `/proceed-with-the-recommendation --once`
|
|
76
|
+
- `/proceed --once`
|
|
77
|
+
- "proceed once with that"
|
|
78
|
+
- "just do that one"
|
|
79
|
+
- Any standard trigger phrase plus the literal `--once` suffix anywhere in the user message
|
|
80
|
+
|
|
81
|
+
### What runs under `--once`
|
|
82
|
+
|
|
83
|
+
| Phase | Status under `--once` |
|
|
84
|
+
|---|---|
|
|
85
|
+
| Phase 0 — P-MAG | **Skipped.** Reason: single-item runs do not accumulate enough state to need a past-mistake gate; running it twice on the same surface within minutes is wasted ceremony. |
|
|
86
|
+
| Phase 1 — Pre-Flight | **Runs.** Restate the one item, tag it `safe`, route it. |
|
|
87
|
+
| Phase 2 — Plan | **Skipped.** Reason: a one-line item does not need a `docs/plans/` artifact. |
|
|
88
|
+
| Phase 3 — Execute | **Runs.** Route to the preferred skill or inline fallback. |
|
|
89
|
+
| Phase 4 — Verify | **Runs.** Smallest check, with the output snippet quoted verbatim. |
|
|
90
|
+
| Phase 5 — Iterate | **Halts on failure.** If Phase 4 fails, do NOT silently restart — report the failure and stop. The operator decides whether to re-invoke the full flow. |
|
|
91
|
+
| Phase 6 — Reflect | **Skipped.** No Reflection block, no `observations.jsonl` append, no `Will NOT repeat:` carry-forward. |
|
|
92
|
+
| Phase 7 — Three-section close | **Skipped.** The reply ends with a single line: `Done: <item>. Verified: <check + output>.` No tiered tables, no WILD/RISA, no `Want me to: A or B?` closer. |
|
|
93
|
+
|
|
94
|
+
### Hard preconditions (refuse `--once` if any fail)
|
|
95
|
+
|
|
96
|
+
`--once` MUST refuse and fall back to the full flow if:
|
|
97
|
+
|
|
98
|
+
- The recommendation list has more than one item. The seven-phase flow exists because multi-item runs accumulate state across items; the fast path cannot guarantee that.
|
|
99
|
+
- The item is tagged `caution` or `needs-approval`. P-MAG is the gate that catches "we already broke this last week"; skipping it on caution-tagged work is exactly the failure pattern the gate was built for.
|
|
100
|
+
- The item touches `>3` files, `>150` LOC, or any of `.github/`, `bin/`, `lib/`, `src/`, `third-party/`. Those surfaces have explicit invariants (`verify:all`, the third-party vendor contract, the `.mts` build pipeline) that the seven-phase flow protects.
|
|
101
|
+
- The item is destructive (deploy, force-push, DB drop, secret rotation, file delete that is not a generated artifact). These always route through the full flow regardless of size.
|
|
102
|
+
|
|
103
|
+
If a precondition fails, emit one line: `--once refused: <reason>. Falling back to full proceed flow.` and continue with Phase 0.
|
|
104
|
+
|
|
105
|
+
### What you give up
|
|
106
|
+
|
|
107
|
+
`--once` trades reflection + learning + close-discipline for speed. Concrete losses per skipped phase:
|
|
108
|
+
|
|
109
|
+
- **No P-MAG read** — past mistakes from prior sessions are not surfaced. Acceptable on single-file safe edits; risky on anything touching code paths the operator has corrected before.
|
|
110
|
+
- **No Reflect block** — the run does not append to `observations.jsonl`. Mulahazah will not learn from this iteration.
|
|
111
|
+
- **No three-section close** — the next turn cannot use `wild-risa-balance` tier inference from a `## Recommendation (expert|beginner)` heading because no such heading shipped.
|
|
112
|
+
|
|
113
|
+
`--once` is the right call when the work is genuinely smaller than the ceremony. For anything larger, the seven-phase flow is the discipline.
|
|
114
|
+
|
|
115
|
+
### Example
|
|
116
|
+
|
|
117
|
+
Prior turn (last item from a five-item recommendation block):
|
|
118
|
+
|
|
119
|
+
> 5. Run `npm run verify:docs-substrings` and confirm green before committing.
|
|
120
|
+
|
|
121
|
+
Operator: `/proceed --once`
|
|
122
|
+
|
|
123
|
+
Under `--once`, the entire response is two lines:
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
Routed to: inline (Bash). Item: "Run npm run verify:docs-substrings and confirm green." Tag: safe.
|
|
127
|
+
Done: ran `npm run verify:docs-substrings`. Verified: `OK docs-substrings: all 150 substring assertion(s) match their target files.`
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
No Phase 0 quote, no `Will NOT repeat:`, no Reflection, no tiered tables, no `Want me to:` closer.
|
|
131
|
+
|
|
60
132
|
## Phase 0: Acknowledge (Past Mistake Acknowledgment Gate / P-MAG)
|
|
61
133
|
|
|
62
134
|
Before research begins, the skill must read its own track record. The instinct system records corrections; this gate forces the read at the moment they actually matter — before a new recommendation list is touched. **Three rules, in order. None is optional.**
|
|
63
135
|
|
|
64
136
|
### Rule 1 — Acknowledge before context (right context from the beginning)
|
|
65
137
|
|
|
66
|
-
Scan three surfaces and
|
|
138
|
+
Run [`scripts/scan-past-mistakes.mjs`](../scripts/scan-past-mistakes.mjs) at the project root. Scan three surfaces in one pass and surface every entry with a citation:
|
|
139
|
+
|
|
140
|
+
- `~/.claude/instincts/<project-hash>/observations.jsonl` — last N (default 10) entries with `type: failure` or `correction` (legacy `event` field also matched for pre-2026-05-06 rows)
|
|
141
|
+
- `~/.claude/projects/<project-hash>/memory/feedback_*.md` — every file whose frontmatter declares `type: feedback`; the canonical home of the operator's named corrections (e.g. `feedback_past_mistake_gate.md`, `feedback_no_git_add_all_on_windows.md`)
|
|
142
|
+
- `<project-root>/CLAUDE.md` "## Past Mistakes" table rows (if present)
|
|
67
143
|
|
|
68
|
-
-
|
|
69
|
-
- `~/.claude/projects/<project-hash>/memory/feedback_*.md` — auto-memory `feedback`-typed entries (named-pattern corrections the operator declared in prior sessions); `~/.claude/projects/<project-hash>/memory/MEMORY.md` is the index of these files
|
|
70
|
-
- The active project's `CLAUDE.md` "Past Mistakes" section (if present)
|
|
144
|
+
Pass `--json` for machine consumption, or override paths via `--observations <path>`, `--memory-dir <dir>`, `--claude-md <path>` (the auto-detection derives all three from the project root via the standard `<hash>` convention). If the script outputs `No prior mistakes recorded — proceed.`, all three surfaces were empty and Rule 1 is satisfied.
|
|
71
145
|
|
|
72
|
-
|
|
146
|
+
For each scanned entry, emit one line: `Past mistake observed: <quote>. Source: <file:line>. Active in current scope: yes|no.` The script provides the quote + source citation; the active-in-scope judgment is yours — read each surface against the recommendation list and decide.
|
|
73
147
|
|
|
74
|
-
|
|
148
|
+
Skipping this scan because the surface paths are project-host-specific is the historically most common silent failure of this gate; the script removes that excuse. If the script must run, a skip surfaces as no output emitted at all — making the bypass detectable rather than invisible.
|
|
75
149
|
|
|
76
150
|
### Rule 2 — Clearance gate (don't proceed until the mistake is gone)
|
|
77
151
|
|
|
@@ -128,6 +202,8 @@ For each item in the ORIGINAL order:
|
|
|
128
202
|
|
|
129
203
|
### Routing Table (with Inline Fallbacks)
|
|
130
204
|
|
|
205
|
+
Run [`scripts/route-recommendation.mjs "<item>"`](../scripts/route-recommendation.mjs) to match a single recommendation item to its preferred chain + inline fallback. Default mode prints the matched row; `--json` for programmatic consumption; `--list` enumerates every row. The programmatic source of truth is [`scripts/route-recommendation.routes.json`](../scripts/route-recommendation.routes.json) — the table below is the human-readable documentation that mirrors it. If they drift, the routes.json file wins.
|
|
206
|
+
|
|
131
207
|
Rows whose **Preferred skill** is not bundled with the `continuous-improvement` plugin carry a `(Reference behavior — does not require <skill>.)` marker on the fallback cell. The marker makes the soft-dependency contract visible at point of use: the inline fallback is fully self-contained and runs without that skill installed. Rows whose preferred skill ships with the plugin (`ralph`, `tdd-workflow`, `continuous-improvement`) carry no marker — the dedicated skill is always available.
|
|
132
208
|
|
|
133
209
|
| Recommendation type | Preferred skill | Inline fallback |
|
package/skills/ralph.md
CHANGED
|
@@ -3,6 +3,7 @@ name: ralph
|
|
|
3
3
|
tier: companion
|
|
4
4
|
description: "Enforces Law 6 (Iterate Means One Thing) of the 7 Laws of AI Agent Discipline at PRD scale. Ralph is an autonomous AI agent loop that runs repeatedly until all PRD items are complete. Converts PRDs to executable JSON, implements stories iteratively with quality checks, and tracks progress."
|
|
5
5
|
origin: https://github.com/snarktank/ralph
|
|
6
|
+
disable-model-invocation: true
|
|
6
7
|
---
|
|
7
8
|
|
|
8
9
|
# Ralph — Autonomous Agent Loop
|
package/skills/recall.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: recall
|
|
3
|
+
tier: "1"
|
|
4
|
+
description: Enforces Law 1 (Research Before Executing) of the 7 Laws of AI Agent Discipline. Makes past sessions first-class research material by searching the observation log with BM25 ranking, so 'have I hit this before?' is answerable before re-deriving a fix or repeating a mistake.
|
|
5
|
+
origin: continuous-improvement
|
|
6
|
+
user-invocable: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Recall — Episodic Search Over Past Sessions
|
|
10
|
+
|
|
11
|
+
Law 1 says research before executing. The cheapest research is your own history: the exact error you are staring at may have been solved three sessions ago. `observations.jsonl` already records every tool call, but an append-only log is not searchable. Recall turns that log into a ranked, queryable memory.
|
|
12
|
+
|
|
13
|
+
## When to Activate
|
|
14
|
+
|
|
15
|
+
- Before tackling a problem that feels familiar ("haven't I seen this error before?").
|
|
16
|
+
- Before a risky or destructive operation — check whether a past attempt failed.
|
|
17
|
+
- Before reading large files from scratch — a past session may already summarize the relevant facts.
|
|
18
|
+
- When onboarding into an unfamiliar area of the codebase that you have touched before.
|
|
19
|
+
|
|
20
|
+
## Core Concept
|
|
21
|
+
|
|
22
|
+
Recall builds an in-memory BM25 index over the observation rows and answers a query with the most relevant past activity, newest-first on ties:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
ci_recall query="permission denied push"
|
|
26
|
+
ci_recall query="jq command not found" k=3
|
|
27
|
+
ci_recall query="auth login" since=7d
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Each result is a past tool call with a redacted snippet, a relevance score, and a timestamp.
|
|
31
|
+
|
|
32
|
+
## Privacy
|
|
33
|
+
|
|
34
|
+
Snippets are passed through a secret redactor before they are surfaced. AWS access keys, JWT-shaped triplets, bearer tokens, `KEY`/`SECRET`/`TOKEN`/`PASSWORD` assignments, and long hex strings are masked. The observation log already caps output at 200 characters; redaction is the second layer.
|
|
35
|
+
|
|
36
|
+
## Limitations
|
|
37
|
+
|
|
38
|
+
- **Lexical, not semantic.** A query for "login" will not surface activity that only ever said "authentication". Search with the vocabulary that actually appeared in the tool calls, or try several phrasings.
|
|
39
|
+
- **Scoped to the captured history.** Recall only knows what the hooks recorded. Thin-schema rows (no input/output, emitted when the Node observer is not wired) contribute little signal.
|
|
40
|
+
- **In-memory rebuild per query.** Dependency-free and fast at current volumes; a `node:sqlite` FTS5 index is a planned follow-up if the log grows past ~100k rows.
|
|
41
|
+
|
|
42
|
+
## How to Invoke
|
|
43
|
+
|
|
44
|
+
Exposed as the `ci_recall` MCP tool (expert mode) and the `/recall` slash command. `query` is required; `k` (default 5) and `since` (ISO timestamp or `7d`/`24h`/`30m`) are optional.
|
|
45
|
+
|
|
46
|
+
## Pairs With
|
|
47
|
+
|
|
48
|
+
- **`gateguard`** (Law 1) — before clearing a high-risk action, recall whether a past attempt at the same thing failed.
|
|
49
|
+
- **`continuous-improvement`** (core SKILL.md, Law 7 — Learn From Every Session) — recall is the retrieval side of the same observation log the instinct engine learns from.
|
|
50
|
+
- **`workspace-surface-audit`** — recall confirms whether the environment facts the audit records have bitten this project before.
|