@locksmithdon/dons-flow 2.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 locksmithdon
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,140 @@
1
+ # @locksmithdon/dons-flow
2
+
3
+ **Don's Flow v2** — a developer-specific Pi Agent workflow package that combines:
4
+
5
+ - **[RPIV](https://www.npmjs.com/package/@juicesharp/rpiv-pi)** — the observable, artifact-chained delivery pipeline (`discover → research → design → plan → implement → validate → review → commit`).
6
+ - **[Superpowers](https://github.com/obra/superpowers)** — scope control, verification-before-claims, and TDD/subagent execution patterns.
7
+ - **A structured cycle closeout (`land`)** — the 10-step ritual that turns a verified branch into a clean, navigable, documented codebase ready for the next cycle.
8
+
9
+ This package is opinionated. It assumes a particular doc layout and a particular philosophy about what belongs in the codebase vs. what belongs in the developer's tooling.
10
+
11
+ > **Why v2?** The first iteration of Don's Flow was a Superpowers-based workflow with a custom landing ritual. This version integrates RPIV's observable delivery pipeline while keeping the closeout, scope-control, and learning-capture practices that made v1 work.
12
+
13
+ ## Install
14
+
15
+ ```bash
16
+ pi install npm:@locksmithdon/dons-flow
17
+ ```
18
+
19
+ This package peer-depends on RPIV, the Pi subagent runtime, and Superpowers:
20
+
21
+ ```bash
22
+ pi install npm:@juicesharp/rpiv-pi
23
+ pi install npm:@tintinweb/pi-subagents
24
+ ```
25
+
26
+ Superpowers is not published to npm under a name we can resolve cleanly, so it is declared as an **optional git peer dependency** (`github:obra/superpowers`). You have three ways to satisfy it:
27
+
28
+ 1. **Install via your agent harness's plugin system** (most common):
29
+ - Claude Code: `/plugin install superpowers@superpowers-marketplace`
30
+ - Codex CLI: `/plugins` → search "Superpowers"
31
+ - Gemini CLI: `gemini extensions install https://github.com/obra/superpowers`
32
+ - See [obra/superpowers](https://github.com/obra/superpowers) for other harnesses.
33
+
34
+ 2. **Install from GitHub directly** (if your Pi/npm setup supports git URLs):
35
+ ```bash
36
+ pi install github:obra/superpowers
37
+ # or
38
+ npm install github:obra/superpowers
39
+ ```
40
+
41
+ 3. **Fork and publish under your own scope** (cleanest long-term):
42
+ Fork `obra/superpowers`, publish it as `@locksmithdon/superpowers`, then update this package's `peerDependencies` to point at your scoped package. This is the closest analog to how we track RPIV.
43
+
44
+ If RPIV's `/rpiv-setup` command is available, it can install the RPIV sibling plugins in one go.
45
+
46
+ ## Relationship to Superpowers
47
+
48
+ This package does not replace Superpowers. It treats Superpowers as the upstream methodology for:
49
+
50
+ - `brainstorming` — Socratic design refinement before code.
51
+ - `writing-plans` — bite-sized, code-complete implementation plans.
52
+ - `subagent-driven-development` / `executing-plans` — task execution with review.
53
+ - `test-driven-development` — red/green/refactor discipline.
54
+ - `verification-before-completion` — evidence-before-claims.
55
+
56
+ Where RPIV provides an equivalent or stronger mechanism, this package routes through RPIV (e.g., `discover`/`research`/`blueprint` for design and planning, `implement`/`validate` for execution). Where Superpowers has no RPIV equivalent, this package ports or keeps the Superpowers skill (e.g., `land`, `epiphany-tabling`, `capturing-learnings`).
57
+
58
+ ## What this package adds to RPIV
59
+
60
+ RPIV gives you a strong delivery pipeline. This package adds the seams around it:
61
+
62
+ | Skill | Purpose |
63
+ |---|---|
64
+ | `dons-flow` | The map. Tells you which skill to invoke when, and how the workflow fits together. |
65
+ | `setup-dons-flow` | Onboarding: checks prerequisites, detects Superpowers, creates repo conventions. |
66
+ | `land` | The 10-step cycle closeout: code review → arch review → security review → as-built docs → doc/knowledge-graph review → AGENTS.md updates → memory reconcile → retro → status review → integrate. |
67
+ | `epiphany-tabling` | Capture mid-flight realizations in `docs/tabled.md` without derailing current work. |
68
+ | `as-built-documentation` | Replace spec/plan scaffolding with a permanent `docs/changes/` record of what shipped. |
69
+ | `capturing-learnings` | End-of-artifact checkpoints + the "once is a moment; twice is a pattern" promotion rule. |
70
+ | `writing-retros` | Produce frozen retrospective documents at milestone close. |
71
+ | `verification-before-completion` | Evidence-before-claims discipline embedded in execution. |
72
+ | `finishing-a-development-branch` | Merge / PR / cleanup decisions at cycle end. |
73
+ | `using-git-worktrees` | Isolated workspaces for parallel workstreams. |
74
+
75
+ ## The integrated workflow
76
+
77
+ ```
78
+ /skill:discover "..."
79
+ /skill:research .rpiv/artifacts/discover/<latest>.md
80
+ /skill:blueprint .rpiv/artifacts/research/<latest>.md # or design → plan
81
+ /skill:implement .rpiv/artifacts/plans/<latest>.md
82
+ /skill:validate .rpiv/artifacts/plans/<latest>.md
83
+ /skill:code-review
84
+ /skill:commit
85
+ /skill:land
86
+ ```
87
+
88
+ Between every major artifact, run `capturing-learnings`. During execution, keep `epiphany-tabling` active. If you stop mid-work, use `create-handoff` / `resume-handoff`.
89
+
90
+ ## Repo conventions
91
+
92
+ This workflow expects the following project-owned files and folders in the codebase:
93
+
94
+ | Path | Purpose |
95
+ |---|---|
96
+ | `docs/tabled.md` | Working memory for deferred ideas and follow-ups |
97
+ | `docs/status.md` | Living status: Recently Completed, What's Next |
98
+ | `docs/memory/` | Persistent memory entries + `MEMORY.md` index |
99
+ | `docs/changes/` | As-built documentation: what shipped and why |
100
+ | `docs/retros/` | Frozen retrospective documents |
101
+ | `docs/runbooks/` | Multi-skill processes |
102
+ | `AGENTS.md` | Repo-level agent guidance |
103
+
104
+ These documents live in the codebase because they are shared context for the whole team. The skills that produce and maintain them live in this package.
105
+
106
+ ## Philosophy: what lives where
107
+
108
+ **In the codebase (shared):**
109
+ - The code changes.
110
+ - As-built docs (`docs/changes/`).
111
+ - Retros (`docs/retros/`).
112
+ - Status, memory, and runbooks.
113
+
114
+ **In this package (developer-owned):**
115
+ - The skills and workflow conventions.
116
+ - The closeout ritual.
117
+ - The promotion rules for turning observations into durable artifacts.
118
+
119
+ This separation lets the same workflow travel with you across repos while keeping each repo's shared knowledge in the repo.
120
+
121
+ ## Monitoring upstream evolution
122
+
123
+ The dependency relationship with Superpowers is intentionally deferred. We review monthly whether to keep the git peer dependency, fork Superpowers, or drop it.
124
+
125
+ - Memory: `docs/memory/monitor_upstream_evolution.md`
126
+ - Runbook: `docs/runbooks/monitor-upstream-evolution.md`
127
+
128
+ Set a monthly calendar reminder for the 13th, or run the runbook after every 2–3 completed projects.
129
+
130
+ ## Typical first use
131
+
132
+ 1. Install this package and its peer dependencies in a repo.
133
+ 2. Run `/skill:setup-dons-flow` to check prerequisites and scaffold repo conventions.
134
+ 3. Start a feature with `/skill:discover "[feature description]"`.
135
+ 4. When implementation is validated and reviewed, run `/skill:land` to close the cycle.
136
+ 5. After 2–3 projects, run `docs/runbooks/monitor-upstream-evolution.md` and decide whether to fork Superpowers.
137
+
138
+ ## License
139
+
140
+ MIT
@@ -0,0 +1,55 @@
1
+ # Repo Conventions for RPIV + Superpowers Landing
2
+
3
+ This workflow expects a small set of project-owned documents in every repo that uses it. These are **not** part of the `@locksmithdon/dons-flow` package; they live in the codebase because they are shared by the whole team.
4
+
5
+ ## Required files and folders
6
+
7
+ ```
8
+ docs/
9
+ tabled.md # Working memory for epiphanies and deferred work
10
+ tabled/ # Optional per-item tabled docs (keep .gitkeep)
11
+ status.md # Living status: Recently Completed, What's Next
12
+ memory/
13
+ MEMORY.md # Index of memory entries
14
+ <type>_<topic>.md # Individual memory entries
15
+ changes/ # As-built documentation
16
+ YYYY-MM-DD-<topic>.md
17
+ retros/ # Frozen retrospectives
18
+ YYYY-MM-DD-<topic>.md
19
+ runbooks/ # Multi-skill processes and practices
20
+ AGENTS.md # Repo-level agent guidance
21
+ ```
22
+
23
+ ## `docs/tabled.md`
24
+
25
+ Single working-memory location for epiphanies, forks, and follow-up items. Add bullet entries as they surface. Process them at end-of-artifact checkpoints and during `land` step 9. The file should end each cycle empty (or near-empty).
26
+
27
+ ## `docs/status.md`
28
+
29
+ Living document with at least these sections:
30
+
31
+ - **Recently Completed** — links to the last as-built or retro.
32
+ - **What's Next** — highest-priority items moved from `docs/tabled.md`.
33
+ - **Active Work** — current branch / milestone.
34
+
35
+ Update during `land` step 9.
36
+
37
+ ## `docs/memory/`
38
+
39
+ Persistent context that should carry across sessions. Keep entries short and index them in `MEMORY.md`. Memory is a thin index pointing at authoritative sources (as-builts, runbooks, code), not a duplication of them.
40
+
41
+ ## `docs/changes/`
42
+
43
+ Permanent record of shipped work. One file per closed piece of work, written by the `as-built-documentation` skill. Specs and plans are scaffolding; as-builts are the durable reference.
44
+
45
+ ## `docs/retros/`
46
+
47
+ Frozen retrospective documents. Once committed, a retro is not edited inline; future amendments go into a new retro.
48
+
49
+ ## `docs/runbooks/`
50
+
51
+ Broader processes that compose multiple skills. For example, this workflow itself could be summarized as a runbook (`docs/runbooks/dons-flow.md`) if a project wants a local copy.
52
+
53
+ ## `AGENTS.md`
54
+
55
+ Repo-level guidance for AI agents. Update only what changed during the cycle (land step 6).
@@ -0,0 +1,9 @@
1
+ # Memory Index
2
+
3
+ Cross-session context for `@locksmithdon/dons-flow`.
4
+
5
+ ## Entries
6
+
7
+ | File | Type | Why it matters |
8
+ |---|---|---|
9
+ | [monitor_upstream_evolution.md](./monitor_upstream_evolution.md) | decision-deferred | We deferred choosing how to track Superpowers. Review monthly. |
@@ -0,0 +1,52 @@
1
+ # Memory: Monitor RPIV and Superpowers Evolution
2
+
3
+ type: decision-deferred
4
+ cadence: monthly review
5
+ last-reviewed: 2026-06-13
6
+ next-review: 2026-07-13
7
+
8
+ ## Decision we deferred
9
+
10
+ How should `@locksmithdon/dons-flow` track its upstream projects?
11
+
12
+ - **RPIV** (`@juicesharp/rpiv-pi`) is published to npm and already declared as a normal peer dependency.
13
+ - **Superpowers** (`obra/superpowers`) is a GitHub-only skills framework, not published to npm under a resolvable name. The `superpowers` name on npm is taken by an unrelated package.
14
+
15
+ We are not forking or publishing Superpowers yet. Instead, we declared it as an optional git peer dependency (`github:obra/superpowers`) and will monitor both projects for 2–3 months before deciding whether to:
16
+
17
+ 1. Keep the optional git peer dependency.
18
+ 2. Fork Superpowers and publish it under `@locksmithdon/superpowers` as a normal npm peer dependency.
19
+ 3. Remove the Superpowers peer dependency entirely and rely on this package's ported closeout skills + RPIV's pipeline.
20
+ 4. Some hybrid we haven't thought of yet.
21
+
22
+ ## Why we deferred
23
+
24
+ The integration is new. We want real usage data — at least 2–3 projects run through the full workflow — before committing to a maintenance-heavy fork. Premature formalization of the dependency relationship could create more work than it saves.
25
+
26
+ ## What to watch
27
+
28
+ | Project | URL | What to check |
29
+ |---|---|---|
30
+ | RPIV | https://github.com/juicesharp/rpiv-mono | New skills that overlap with our closeout workflow; changes to `implement`, `validate`, `code-review`; new onboarding commands. |
31
+ | Superpowers | https://github.com/obra/superpowers | New closeout/landing skills; npm publishing; changes to `brainstorming`, `writing-plans`, `verification-before-completion`; license changes. |
32
+
33
+ ## Decision criteria
34
+
35
+ Fork and publish Superpowers if:
36
+ - We find ourselves needing its upstream entry points (`brainstorming`, `test-driven-development`, `subagent-driven-development`) in projects where RPIV equivalents don't fit.
37
+ - Superpowers still isn't on npm after 3 months of monitoring.
38
+ - The maintenance burden of a fork feels smaller than the friction of the git dependency.
39
+
40
+ Keep the git peer dependency if:
41
+ - The optional install path works reliably across harnesses.
42
+ - We rarely need Superpowers-specific entry points because RPIV covers the pipeline.
43
+
44
+ Remove it if:
45
+ - RPIV adds equivalent closeout/landing skills.
46
+ - We stop using Superpowers entry points entirely.
47
+
48
+ ## Related
49
+
50
+ - Runbook: `docs/runbooks/monitor-upstream-evolution.md`
51
+ - Skill: `setup-dons-flow`
52
+ - Package: `package.json` § `peerDependencies`
@@ -0,0 +1,82 @@
1
+ # Runbook: Monitor Upstream Evolution
2
+
3
+ Check RPIV and Superpowers monthly to decide how `@locksmithdon/dons-flow` should track them.
4
+
5
+ ## Schedule
6
+
7
+ - **Cadence:** Monthly, or after every 2–3 projects completed with this workflow.
8
+ - **Duration:** 15–30 minutes.
9
+ - **Owner:** @locksmithdon.
10
+
11
+ ## Trigger
12
+
13
+ - Calendar reminder on the 13th of each month.
14
+ - After any project closeout where the dependency relationship felt awkward.
15
+
16
+ ## Steps
17
+
18
+ ### 1. Check RPIV
19
+
20
+ Visit https://github.com/juicesharp/rpiv-mono and look at:
21
+
22
+ - **Releases / CHANGELOG** — new versions of `@juicesharp/rpiv-pi`.
23
+ - **Skills** — has RPIV added a `land`, `closeout`, `retro`, or `as-built` skill? If so, evaluate whether our port is still needed.
24
+ - **Implement / validate / code-review** — have these skills changed in ways that affect our closeout sequence?
25
+ - **Onboarding** — has RPIV added smoother setup commands we should mirror?
26
+
27
+ Record findings in `docs/memory/monitor_upstream_evolution.md` under a dated heading.
28
+
29
+ ### 2. Check Superpowers
30
+
31
+ Visit https://github.com/obra/superpowers and look at:
32
+
33
+ - **Releases / RELEASE-NOTES.md** — new versions.
34
+ - **Skills** — has Superpowers added a `land`, `closeout`, or `as-built` skill? Has it published to npm?
35
+ - **Brainstorming / writing-plans / subagent-driven-development** — have these changed in ways that make them more or less attractive than RPIV equivalents?
36
+ - **License** — still MIT and forkable?
37
+
38
+ Record findings in `docs/memory/monitor_upstream_evolution.md` under the same dated heading.
39
+
40
+ ### 3. Check our own usage
41
+
42
+ Review recent projects that used this workflow:
43
+
44
+ - Did we use Superpowers-specific entry points (`brainstorming`, `writing-plans`, `subagent-driven-development`) or RPIV entry points (`discover`, `blueprint`, `implement`)?
45
+ - Did the optional git peer dependency cause install friction?
46
+ - Did RPIV's pipeline cover everything we needed?
47
+ - Did our `land` skill feel like the right cycle boundary?
48
+
49
+ Sources:
50
+ - Recent `docs/retros/` files.
51
+ - Recent `docs/changes/` files.
52
+ - `docs/tabled.md` history.
53
+
54
+ ### 4. Decide or defer
55
+
56
+ Ask:
57
+
58
+ 1. Is Superpowers on npm yet?
59
+ 2. Does RPIV now provide closeout/landing?
60
+ 3. Are we actively hurt by the current dependency setup?
61
+ 4. Would a fork save more friction than it costs?
62
+
63
+ If the answer to any of 1–3 is **yes**, consider updating `package.json` and the workflow.
64
+
65
+ If the answer is **no**, bump `next-review` by one month and keep monitoring.
66
+
67
+ ### 5. Capture the decision
68
+
69
+ If you make a change:
70
+ - Update `docs/memory/monitor_upstream_evolution.md`.
71
+ - Write a brief note in `docs/changes/` if the package behavior changed.
72
+ - Update `README.md` and `skills/dons-flow/SKILL.md` if install instructions changed.
73
+
74
+ If you defer:
75
+ - Update `last-reviewed` and `next-review` in `docs/memory/monitor_upstream_evolution.md`.
76
+ - Add one paragraph summarizing the month's observations.
77
+
78
+ ## Outputs
79
+
80
+ - Updated `docs/memory/monitor_upstream_evolution.md`.
81
+ - Optional `docs/changes/` entry if the package changed.
82
+ - Optional update to install docs.
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@locksmithdon/dons-flow",
3
+ "version": "2.0.0",
4
+ "description": "Don's Flow v2 — a developer-specific Pi Agent workflow built on RPIV's observable pipeline, Superpowers' discipline, and a structured landing closeout.",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension",
8
+ "dons-flow",
9
+ "rpiv",
10
+ "superpowers",
11
+ "skills",
12
+ "workflow",
13
+ "landing",
14
+ "closeout"
15
+ ],
16
+ "license": "MIT",
17
+ "author": "locksmithdon",
18
+ "type": "module",
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/don-smith/dons-flow.git"
22
+ },
23
+ "homepage": "https://github.com/don-smith/dons-flow#readme",
24
+ "bugs": {
25
+ "url": "https://github.com/don-smith/dons-flow/issues"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public"
29
+ },
30
+ "files": [
31
+ "skills/",
32
+ "docs/",
33
+ "README.md",
34
+ "LICENSE"
35
+ ],
36
+ "pi": {
37
+ "skills": [
38
+ "./skills"
39
+ ]
40
+ },
41
+ "peerDependencies": {
42
+ "@earendil-works/pi-coding-agent": "*",
43
+ "@tintinweb/pi-subagents": "*",
44
+ "@juicesharp/rpiv-pi": "*",
45
+ "superpowers": "github:obra/superpowers"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "superpowers": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "scripts": {
53
+ "lint": "echo 'No lint configured yet'",
54
+ "test": "echo 'No tests configured yet'"
55
+ }
56
+ }
@@ -0,0 +1,143 @@
1
+ ---
2
+ name: as-built-documentation
3
+ description: Use at the end of a feature branch to create permanent as-built documentation - distills planning docs, git history, and code changes into a single reference document, then cleans up superseded plans
4
+ ---
5
+
6
+ # As-Built Documentation
7
+
8
+ Create a permanent "as-built" document that captures what changed, why, and what future agents/humans need to know. This replaces all planning documents with one high-signal reference.
9
+
10
+ ## When to Use
11
+
12
+ At the end of a major piece of work, after:
13
+ - All implementation is complete
14
+ - Tests pass
15
+
16
+ Typically invoked by the **land** skill, which determines whether as-built documentation is warranted and whether to create a new document or update an existing one.
17
+
18
+ ## The Process
19
+
20
+ ### Phase 1: Automated Discovery
21
+
22
+ Gather source material from the completed work:
23
+
24
+ 1. **Git history**: Understand the arc of work — what was built, in what order, and any pivots or reversals.
25
+ - On a feature branch: `git log main..HEAD --oneline`
26
+ - On main: `git log --oneline` for the relevant range of commits (use planning docs and commit messages to identify the boundary)
27
+ 2. **Planning documents**: Read all docs in `docs/plans/` that relate to the completed work. These are the primary source material for synthesis.
28
+ 3. **Code changes**: Identify scope from the git history, then read the key files to understand the current architecture. Prioritize repo-level AGENTS.md files — they often capture the implementation's shape already.
29
+ 4. **Existing documentation**: Check for any other docs, comments, or READMEs that were created or modified as part of this work.
30
+ 5. **Existing as-built docs**: Check `docs/changes/` for related documents. If one exists for this area, consider updating it rather than creating a new one.
31
+
32
+ ### Phase 2: Synthesis
33
+
34
+ Draft the as-built document following the template below. Key principles:
35
+
36
+ - **Write "How It Works Now" from the code, not from plans.** Plans may be outdated. The code is the source of truth.
37
+ - **Assess regression risk for each decision.** Ask: "How likely is it that a future agent re-proposes the rejected approach?" Rate as low/medium/high.
38
+ - **Low risk**: Brief rationale is sufficient
39
+ - **Medium risk**: Document what was rejected and why
40
+ - **High risk**: Explicit "why not" section with enough detail to prevent the regression
41
+ - **Be concise.** This document should be shorter than the sum of the plans it replaces. Every sentence should earn its place.
42
+ - **Use terms consistently.** Key concepts in the Quick Reference should match the terminology used throughout the document.
43
+
44
+ ### Phase 3: Clarification (if needed)
45
+
46
+ If you have gaps or uncertainties that can't be resolved from code and docs alone, ask the developer targeted questions. This should be rare - most branches will have sufficient material for synthesis without intervention.
47
+
48
+ ### Phase 4: Write & Clean Up
49
+
50
+ **Where does the as-built document go?**
51
+
52
+ Documents live where their scope lives:
53
+ - **Repo-specific work** (transforms, adapters, features within one repo) → the repo's `docs/changes/` folder
54
+ - **Cross-repo or project-level changes** (architecture, shared conventions, infrastructure that affects all repos) → root `docs/changes/`
55
+
56
+ Most as-built docs will be repo-specific. Ask: "does this document primarily help agents working in one repo, or across multiple repos?"
57
+
58
+ **Creating a new document:**
59
+ 1. **Write** to `docs/changes/YYYY-MM-DD-<topic>.md` (in the appropriate repo or root)
60
+ - Use today's date
61
+ - Use a short, descriptive kebab-case topic name
62
+
63
+ **Updating an existing document:**
64
+ 1. **Edit** the existing document in `docs/changes/` to incorporate the new work
65
+ - Update the date and Quick Reference section
66
+ - Revise "How It Works Now" from the current code
67
+ - Add any new Key Decisions
68
+
69
+ **Retiring planning documents:**
70
+
71
+ Planning documents from root `docs/plans/` that are repo-specific should be either:
72
+ - **Deleted** if fully consumed into the as-built doc
73
+ - **Moved** to the repo's `docs/` folder if they contain standing rationale that agents may need (e.g., "why we chose X over Y") but aren't linked from navigational documents
74
+
75
+ Cross-repo planning documents in root `docs/plans/` should only be deleted if they've been fully superseded.
76
+
77
+ **Then:**
78
+ 2. **Stage** all changes (new/updated files + deletions) with `git add`
79
+ 3. **Do NOT commit.** Leave the staged changes for the developer to review and commit.
80
+
81
+ Inform the developer what was created/updated and what was deleted/moved, so they can review before committing.
82
+
83
+ ## Document Template
84
+
85
+ ```markdown
86
+ # <Title: concise name of the change>
87
+
88
+ ## Quick Reference
89
+ - **Date:** YYYY-MM-DD
90
+ - **Key files:** <list of primary files added/modified>
91
+ - **Key concepts:** <3-5 searchable terms>
92
+ - **One-line summary:** <what changed and why, in one sentence>
93
+
94
+ ## How It Works Now
95
+
96
+ <The current architectural contracts. How the pieces fit together.
97
+ This is the section an agent reads when it needs to modify this area.
98
+ Write from the actual code, not from planning documents.>
99
+
100
+ ## Key Decisions
101
+
102
+ <For each major decision made during this branch:
103
+
104
+ ### <Decision title>
105
+
106
+ **What:** <What was decided>
107
+ **Why:** <The motivation>
108
+ **Regression risk:** low | medium | high
109
+
110
+ If medium or high risk:
111
+ **Rejected alternative:** <What was considered and rejected>
112
+ **Why rejected:** <Specific reasons it won't work or is worse>>
113
+
114
+ ## Constraints & Gotchas
115
+
116
+ <Things that will bite you if you don't know about them.
117
+ Edge cases, ordering dependencies, things that look wrong but are intentional.
118
+ If there are none, omit this section.>
119
+
120
+ ## Background Context
121
+
122
+ <Brief context on why this project happened at all.
123
+ Goals, personas, acceptance criteria - only what's needed to understand the "why."
124
+ Keep this short - a few sentences to a short paragraph.>
125
+ ```
126
+
127
+ ## Key Principles
128
+
129
+ - **Audience is 85% AI agents, 15% humans.** Optimize for structured, parseable content with explicit terminology.
130
+ - **Current state first, history second.** An agent reading this is usually about to modify something and needs to understand the current architecture before the backstory.
131
+ - **Every section earns its place.** If a section would be empty or trivial, omit it.
132
+ - **The git history of this file traces back to the original branch work.** If deeper commit-level context is ever needed, the file's own history provides the path.
133
+ - **Plans are scaffolding, as-builts are permanent.** Don't preserve planning language or structure out of habit. Rewrite for the document's actual purpose.
134
+
135
+ ## Common Pitfalls
136
+
137
+ | Pitfall | Instead |
138
+ |---------|---------|
139
+ | Copying plan content verbatim | Rewrite from the code's perspective - plans may be outdated |
140
+ | Documenting every small decision | Focus on decisions that affect future work or have regression risk |
141
+ | Writing for a human narrative | Structure for quick scanning - headers, lists, tables over prose |
142
+ | Including implementation steps | The code is the implementation; document the "what" and "why," not the "how to build it" |
143
+ | Forgetting to delete old plans | Always check `docs/plans/` for branch-related documents to remove |
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: capturing-learnings
3
+ description: Use at end-of-artifact checkpoints (after a spec, plan, or major commit set) and when deciding whether something observed during work should become a skill, runbook, memory entry, or be consciously dropped
4
+ ---
5
+
6
+ # Capturing Learnings
7
+
8
+ ## Overview
9
+
10
+ Observations turn into durable artifacts — skills, runbooks, memory entries — or they turn into nothing. The rule is **once is a moment; twice is a pattern.** Don't formalize on first occurrence; wait for the second sighting.
11
+
12
+ This skill covers two companion practices:
13
+
14
+ 1. The **end-of-artifact checkpoint** — four questions we run after each approved spec, plan, or major commit set.
15
+ 2. The **promotion rule** — how we decide whether a tabled observation becomes a skill, a runbook, a memory entry, or a conscious drop.
16
+
17
+ **Announce at start:** "I'm using the capturing-learnings skill to run the end-of-artifact checkpoint" or "…to decide where this learning goes."
18
+
19
+ ## End-of-artifact checkpoint
20
+
21
+ After each approved spec, plan, or major commit set — and **before proceeding to the next artifact** — answer four questions:
22
+
23
+ 1. **Is the current artifact solid?** Does it include what it should? Any obvious gap or drift?
24
+ 2. **Are we carrying an assumption that hasn't been tested?** If yes, note it — ideally as a tabled entry or a memory update.
25
+ 3. **What in `docs/tabled.md` is ready to be processed?** Walk each entry; decide destination.
26
+ 4. **What should be promoted to an artifact (skill, runbook, memory) or remembered going forward?**
27
+ 5. **Any existing memory in `docs/memory/` that is now stale?** Glance through the index. If a memory's rationale has dissolved (milestone shipped, decision was reversed, scope narrowed), update or remove it. Announce the change per AGENTS.md.
28
+
29
+ The checkpoint produces either (a) a concrete change (a file written, a memory updated, a skill created) or (b) an explicit "nothing to do" — never a vague promise to "come back to this later."
30
+
31
+ ## Promotion rule — once is a moment; twice is a pattern
32
+
33
+ Premature formalization has the same cost structure as premature abstraction in code. Wait for the second sighting, then capture. Applied consistently:
34
+
35
+ - **First occurrence of a pattern:** observe. Table if useful; otherwise carry on.
36
+ - **Second occurrence:** capture as an artifact.
37
+
38
+ The second sighting need not be in the same session or milestone — a tabled entry from months ago is perfectly valid as the "first" sighting when the second arrives.
39
+
40
+ ## Which artifact?
41
+
42
+ When the second sighting arrives, match the learning to an artifact type:
43
+
44
+ | Learning shape | Artifact | Where it lives | Half-life |
45
+ |---|---|---|---|
46
+ | A tactical, reusable how-to — the specific steps for doing one thing well (may include a script) | **Skill** | Project-local `.pi/skills/<name>/SKILL.md`, global `~/.pi/agent/skills/<name>/SKILL.md`, or an installed Pi package skill | Long — skills travel. |
47
+ | A broader process or practice — often composing multiple skills, sometimes with its own scripts | **Runbook** | `docs/runbooks/<name>.md` | Medium — check on use; runbooks rot fast. |
48
+ | A recurring user preference, constraint, or project context to carry across sessions | **Memory entry** | `docs/memory/<type>_<topic>.md` + index in `docs/memory/MEMORY.md` | Long — until the context shifts. |
49
+ | A permanent record of shipped work | **As-built** | `docs/changes/YYYY-MM-DD-<topic>.md` | Permanent — frozen. See the `as-built-documentation` skill. |
50
+
51
+ **Skill vs runbook — working heuristic:** a **skill** is the tactical detail: how you do one specific thing (e.g. "epiphany-tabling," "as-built-documentation," "running a particular class of query"). A **runbook** is a broader process or practice that often orchestrates multiple skills (e.g. "onboard a new agent," "release a new image") and may also carry its own scripts. Both skills and runbooks can reference or invoke scripts; the difference is scope — tactical vs. procedural.
52
+
53
+ This heuristic is still being refined — we have a few of each to date and expect to recalibrate as the first runbook lands that clearly composes multiple skills. Rewrite is cheap; the important thing is to start putting these artifacts in place so the codebase becomes more navigable for AI agents and humans together.
54
+
55
+ ## Proliferation test
56
+
57
+ **Before creating any new markdown file, ask: does the content belong in an existing document?**
58
+
59
+ - If yes → extend the existing document. Add a section, a bullet, a row.
60
+ - If no → justify the new file explicitly. Add a row to the document inventory in `docs/ways-of-working.md` in the **same change** that creates the file.
61
+
62
+ Markdown sprawl is the failure mode. The inventory is the mitigation. Consolidate aggressively; delete willingly.
63
+
64
+ ## When NOT to capture
65
+
66
+ - **The learning is truly one-off.** The second sighting hasn't arrived and is unlikely to. Drop it, or leave the tabled entry in place for later.
67
+ - **It is already documented** somewhere appropriate (existing skill, existing runbook, an existing memory entry). Update the existing artifact rather than creating a new one.
68
+ - **It is a mechanical constraint that can be enforced by code or CI** (lint rule, type check, validation). Encode it, don't document it — save documentation for judgment calls.
69
+
70
+ ## Related practices
71
+
72
+ - `epiphany-tabling` — the source of most learnings this skill processes.
73
+ - `writing-retros` — the milestone-level version of the end-of-artifact checkpoint.
74
+ - `as-built-documentation` — the permanent artifact for a closed piece of work.