pattyeng 1.0.4 → 1.0.7
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/README.md +103 -43
- package/bin/pattyeng.js +25 -14
- package/lib/skills.js +198 -0
- package/lib/upgrade.js +46 -0
- package/package.json +5 -3
- package/skills/.system/.codex-system-skills.marker +1 -0
- package/skills/.system/imagegen/LICENSE.txt +201 -0
- package/skills/.system/imagegen/SKILL.md +356 -0
- package/skills/.system/imagegen/agents/openai.yaml +6 -0
- package/skills/.system/imagegen/assets/imagegen-small.svg +5 -0
- package/skills/.system/imagegen/assets/imagegen.png +0 -0
- package/skills/.system/imagegen/references/cli.md +242 -0
- package/skills/.system/imagegen/references/codex-network.md +33 -0
- package/skills/.system/imagegen/references/image-api.md +90 -0
- package/skills/.system/imagegen/references/prompting.md +118 -0
- package/skills/.system/imagegen/references/sample-prompts.md +433 -0
- package/skills/.system/imagegen/scripts/image_gen.py +995 -0
- package/skills/.system/imagegen/scripts/remove_chroma_key.py +440 -0
- package/skills/.system/openai-docs/LICENSE.txt +201 -0
- package/skills/.system/openai-docs/SKILL.md +167 -0
- package/skills/.system/openai-docs/agents/openai.yaml +14 -0
- package/skills/.system/openai-docs/assets/openai-small.svg +3 -0
- package/skills/.system/openai-docs/assets/openai.png +0 -0
- package/skills/.system/openai-docs/references/latest-model.md +37 -0
- package/skills/.system/openai-docs/references/prompting-guide.md +244 -0
- package/skills/.system/openai-docs/references/upgrade-guide.md +181 -0
- package/skills/.system/openai-docs/scripts/fetch-codex-manual.mjs +598 -0
- package/skills/.system/openai-docs/scripts/resolve-latest-model-info.js +147 -0
- package/skills/.system/plugin-creator/SKILL.md +243 -0
- package/skills/.system/plugin-creator/agents/openai.yaml +6 -0
- package/skills/.system/plugin-creator/assets/plugin-creator-small.svg +3 -0
- package/skills/.system/plugin-creator/assets/plugin-creator.png +0 -0
- package/skills/.system/plugin-creator/references/installing-and-updating.md +143 -0
- package/skills/.system/plugin-creator/references/plugin-json-spec.md +194 -0
- package/skills/.system/plugin-creator/scripts/create_basic_plugin.py +324 -0
- package/skills/.system/plugin-creator/scripts/read_marketplace_name.py +48 -0
- package/skills/.system/plugin-creator/scripts/update_plugin_cachebuster.py +78 -0
- package/skills/.system/plugin-creator/scripts/validate_plugin.py +586 -0
- package/skills/.system/skill-creator/SKILL.md +416 -0
- package/skills/.system/skill-creator/agents/openai.yaml +5 -0
- package/skills/.system/skill-creator/assets/skill-creator-small.svg +3 -0
- package/skills/.system/skill-creator/assets/skill-creator.png +0 -0
- package/skills/.system/skill-creator/license.txt +202 -0
- package/skills/.system/skill-creator/references/openai_yaml.md +49 -0
- package/skills/.system/skill-creator/scripts/generate_openai_yaml.py +226 -0
- package/skills/.system/skill-creator/scripts/init_skill.py +400 -0
- package/skills/.system/skill-creator/scripts/quick_validate.py +101 -0
- package/skills/.system/skill-installer/LICENSE.txt +202 -0
- package/skills/.system/skill-installer/SKILL.md +58 -0
- package/skills/.system/skill-installer/agents/openai.yaml +5 -0
- package/skills/.system/skill-installer/assets/skill-installer-small.svg +3 -0
- package/skills/.system/skill-installer/assets/skill-installer.png +0 -0
- package/skills/.system/skill-installer/scripts/github_utils.py +21 -0
- package/skills/.system/skill-installer/scripts/install-skill-from-github.py +308 -0
- package/skills/.system/skill-installer/scripts/list-skills.py +107 -0
- package/skills/cap/SKILL.md +77 -0
- package/skills/caveman/SKILL.md +49 -0
- package/skills/code-review/SKILL.md +46 -0
- package/skills/codebook/SKILL.md +184 -0
- package/skills/doc-review/SKILL.md +147 -0
- package/skills/feature-research/SKILL.md +34 -0
- package/skills/file-op/SKILL.md +116 -0
- package/skills/grill-me/SKILL.md +10 -0
- package/skills/grill-with-docs/ADR-FORMAT.md +47 -0
- package/skills/grill-with-docs/CONTEXT-FORMAT.md +60 -0
- package/skills/grill-with-docs/SKILL.md +88 -0
- package/skills/handoff/SKILL.md +17 -0
- package/skills/improve-codebase/SKILL.md +79 -0
- package/skills/linear/SKILL.md +107 -0
- package/skills/next-step/SKILL.md +61 -0
- package/skills/no-reinvent/SKILL.md +131 -0
- package/skills/no-wall/SKILL.md +146 -0
- package/skills/online/SKILL.md +54 -0
- package/skills/plan-review/SKILL.md +55 -0
- package/skills/professional/SKILL.md +111 -0
- package/skills/promise-tracking/SKILL.md +131 -0
- package/skills/prove/SKILL.md +135 -0
- package/skills/read-before-write/SKILL.md +123 -0
- package/skills/review/SKILL.md +78 -0
- package/skills/review-mp/SKILL.md +78 -0
- package/skills/scope-boundary/SKILL.md +121 -0
- package/skills/semble-search/SKILL.md +40 -0
- package/skills/sitrep/SKILL.md +126 -0
- package/skills/structure-code/SKILL.md +116 -0
- package/skills/surface-assumptions/SKILL.md +139 -0
- package/skills/teach/GLOSSARY-FORMAT.md +35 -0
- package/skills/teach/LEARNING-RECORD-FORMAT.md +46 -0
- package/skills/teach/MISSION-FORMAT.md +31 -0
- package/skills/teach/RESOURCES-FORMAT.md +32 -0
- package/skills/teach/SKILL.md +131 -0
- package/skills/team-protocol/SKILL.md +172 -0
- package/skills/tech-lead/SKILL.md +332 -0
- package/skills/to-issues/SKILL.md +83 -0
- package/skills/to-prd/SKILL.md +74 -0
- package/skills/vectorbt-expert/SKILL.md +253 -0
- package/skills/verify-done/SKILL.md +128 -0
- package/skills/work-log/SKILL.md +141 -0
- package/skills/work-log/template.html +496 -0
- package/skills/zoom-out/SKILL.md +7 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codebook
|
|
3
|
+
description: Use when a feature needs to be captured as durable reference documentation for a reader who has never seen the codebase, or when existing feature documentation has drifted from current source code and needs reconciliation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Codebook
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
A skill for producing a **codebook** — a small, structured set of markdown files that lets a reader who has never seen the codebase understand a specific feature cold. Two modes:
|
|
11
|
+
|
|
12
|
+
- **Create** — no codebook exists yet → write one from scratch.
|
|
13
|
+
- **Parity sweep** — codebook exists → reconcile it against current source, fix only drifted parts, never rewrite what's still correct.
|
|
14
|
+
|
|
15
|
+
The output is **always** a folder of 2–4 markdown files inside the project repo, not a single doc and not 8 chapters and not anything in `/tmp`.
|
|
16
|
+
|
|
17
|
+
## Folder structure (enforced)
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
docs/codebook/<feature-name>/
|
|
21
|
+
01-orientation.md # shallow — readable cold
|
|
22
|
+
02-walkthrough.md # medium — guided tour through the code
|
|
23
|
+
03-deep-dive.md # deepest — mechanics, invariants, gotchas
|
|
24
|
+
04-extension-points.md # practical/forward — how to modify/extend
|
|
25
|
+
CHANGELOG.md # one line per create or sweep
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Hard rules:**
|
|
29
|
+
- Folder MUST live at `docs/codebook/<feature-name>/` inside the project repo. Never `/tmp`, never `~/`, never the user's home. If `docs/` doesn't exist, create it.
|
|
30
|
+
- File count MUST be 2–4 chapter files plus `CHANGELOG.md`. Collapse chapters for small features (e.g. trivial bug fix → just `01-orientation.md` + `03-deep-dive.md` + `CHANGELOG.md` = 2 chapters). Never 5+. Never 8.
|
|
31
|
+
- Chapter file names are FIXED. Do not invent `02-code-map.md` or `04-cli-reference.md` or any other naming scheme.
|
|
32
|
+
|
|
33
|
+
## The four-chapter template
|
|
34
|
+
|
|
35
|
+
### `01-orientation.md` (shallow)
|
|
36
|
+
|
|
37
|
+
**Purpose:** A reader who knows nothing can answer "what is this, why does it exist, where does it live?"
|
|
38
|
+
|
|
39
|
+
**Required sections:**
|
|
40
|
+
- One-paragraph "what is this" (the feature, not the implementation)
|
|
41
|
+
- One-paragraph "why does it exist" (the problem it solves)
|
|
42
|
+
- "Where it lives" — directory tree of the 3–8 most important files, with one-line purpose each
|
|
43
|
+
- "What this is NOT" — 3–6 bullets explicitly bounding scope (e.g. "not a strategy generator", "not the full pipeline")
|
|
44
|
+
- A glossary table for jargon introduced later
|
|
45
|
+
- At least one cross-reference to any existing plan/spec doc (don't duplicate it — point at it)
|
|
46
|
+
|
|
47
|
+
**Voice and tone:** Direct, second-person. Walk the reader in. No tables-only sections.
|
|
48
|
+
|
|
49
|
+
### `02-walkthrough.md` (medium)
|
|
50
|
+
|
|
51
|
+
**Purpose:** Trace a real execution from input to output. One concrete end-to-end path through the code.
|
|
52
|
+
|
|
53
|
+
**Required sections:**
|
|
54
|
+
- The actual command(s) to invoke the feature (copy-pasteable)
|
|
55
|
+
- The exact data flow: input → which files get read → which functions get called in what order → output artifacts
|
|
56
|
+
- A worked example using a real artifact path from the repo (e.g. an actual intake YAML, an actual config file), not a synthetic one
|
|
57
|
+
- An explicit "where the orchestration lives vs where the library lives" callout — separate the entry point from the supporting modules
|
|
58
|
+
|
|
59
|
+
**Voice and tone:** Narrative. "First the script does X, then it calls Y which…" Reference tables are allowed in service of the narrative, not in place of it.
|
|
60
|
+
|
|
61
|
+
### `03-deep-dive.md` (deepest)
|
|
62
|
+
|
|
63
|
+
**Purpose:** Explain the mechanics. The reader should be able to predict behavior in edge cases after this chapter.
|
|
64
|
+
|
|
65
|
+
**Required sections:**
|
|
66
|
+
- The actual algorithm/mechanics of every non-obvious operation (e.g. how Wilson LCB is computed, how the sort key works, what the feature-policy classification logic does step-by-step). Pseudocode or short code excerpts are fine.
|
|
67
|
+
- Every invariant the feature enforces (e.g. "test split is never used for ranking"; "every candidate is filtered against floors on both splits")
|
|
68
|
+
- Every gotcha — the things that will silently bite a reader who assumes naive behavior
|
|
69
|
+
- Decisions that were *not* made and why (e.g. "no nested rules because of X"; "no hyperparameter search because of Y")
|
|
70
|
+
|
|
71
|
+
**Voice and tone:** Detailed. Walk through the math or the logic step by step. Cite function names, constants, and line ranges from the actual source.
|
|
72
|
+
|
|
73
|
+
### `04-extension-points.md` (practical/forward)
|
|
74
|
+
|
|
75
|
+
**Purpose:** Reader can modify or extend the feature confidently.
|
|
76
|
+
|
|
77
|
+
**Required sections:**
|
|
78
|
+
- "How to add X" — concrete recipe for the most likely modification (new feature, new intake, new CLI flag, new sibling script)
|
|
79
|
+
- The exact files you'd touch, in order
|
|
80
|
+
- The tests you'd add or run
|
|
81
|
+
- Common modification pitfalls — things that look easy but break invariants
|
|
82
|
+
|
|
83
|
+
**Voice and tone:** Imperative. "Edit `intake.py` line N. Add the column name to `LABEL_COLUMNS` if it's a label. Run test Y."
|
|
84
|
+
|
|
85
|
+
### `CHANGELOG.md`
|
|
86
|
+
|
|
87
|
+
One line per create or sweep, append-only:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
2026-06-24 create — codebook baseline walkthrough for discover_rules.py
|
|
91
|
+
2026-06-25 sweep — synced against commit abc1234; updated §2 (CLI flags), §3 (bundle layout); added note about new feature_policy.py:quarantine_timing
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Frontmatter (mandatory in every chapter)
|
|
95
|
+
|
|
96
|
+
Every chapter file MUST begin with:
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
---
|
|
100
|
+
feature: <feature-name>
|
|
101
|
+
chapter: 01-orientation | 02-walkthrough | 03-deep-dive | 04-extension-points
|
|
102
|
+
last-verified: <commit-hash or ISO date>
|
|
103
|
+
last-verified-by: <agent-name or human-name>
|
|
104
|
+
parity-status: synced | partial | drifted
|
|
105
|
+
---
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This is what makes parity sweeps possible — the agent can grep the project for `^feature: <name>` to find all chapters, and `parity-status: drifted` is a maintenance flag.
|
|
109
|
+
|
|
110
|
+
## Parity-sweep mode
|
|
111
|
+
|
|
112
|
+
Triggered when `docs/codebook/<feature>/` already exists.
|
|
113
|
+
|
|
114
|
+
**Workflow:**
|
|
115
|
+
1. Read every chapter file. Extract concrete claims: file paths, function/class names, signatures, defaults, sort keys, constants.
|
|
116
|
+
2. Probe the codebase to verify each claim: `ls`/`find` for paths, `grep`/`rg` for identifiers, reads for flow correctness.
|
|
117
|
+
3. Classify each claim into one of four buckets:
|
|
118
|
+
- **stale** — was true, no longer true
|
|
119
|
+
- **missing-coverage** — code added since doc was written, not reflected anywhere
|
|
120
|
+
- **wrong-rationale** — code behavior matches but the *why* has drifted (a decision was reversed)
|
|
121
|
+
- **still-true** — leave alone
|
|
122
|
+
4. **Edit surgically.** Only touch the drifted sections. Never rewrite a whole chapter during a sweep — that destroys the parts that are still correct.
|
|
123
|
+
5. Update `last-verified` and `parity-status` in every touched chapter's frontmatter. Set `parity-status: synced` if all claims check out, `partial` if some are stale, `drifted` if the chapter's premise no longer holds.
|
|
124
|
+
6. Append a one-line entry to `CHANGELOG.md` summarizing what was updated, what was added, what was removed.
|
|
125
|
+
7. Report to the user: what was changed, what was deleted, what new code is not yet documented.
|
|
126
|
+
|
|
127
|
+
## Voice and tone — non-negotiable across every chapter
|
|
128
|
+
|
|
129
|
+
- **Second person**: "you", "we". Not "the user", not "one".
|
|
130
|
+
- **Define jargon on first use**, then reuse the term freely.
|
|
131
|
+
- **Narrative over tables** when introducing concepts. Tables are reference material — use them after the concept is walked through.
|
|
132
|
+
- **Real file paths, real identifiers, real defaults**. No `path/to/file` placeholders. If the doc says "the default is 0.72", that number must come from the source.
|
|
133
|
+
- **Show, then explain**. A code block, then a paragraph about what it does — never just a paragraph.
|
|
134
|
+
- **"What this is NOT"** in chapter 01 — always. It bounds scope and pre-empts the wrong mental model.
|
|
135
|
+
|
|
136
|
+
## Anti-patterns (rationalization table)
|
|
137
|
+
|
|
138
|
+
| Excuse | Reality |
|
|
139
|
+
|---|---|
|
|
140
|
+
| "The feature is small, one file is enough" | Even small features have a why. Use 2 chapters minimum: orientation + deep-dive. |
|
|
141
|
+
| "I'll add more chapters as I find things to write about" | Chapter names are fixed. Add extra material to the appropriate chapter; do not invent new files. |
|
|
142
|
+
| "Let me write to `/tmp` first and copy to the repo later" | The repo IS the deliverable. Writing to /tmp means the doc never ships and never gets version-controlled. Write directly to `docs/codebook/`. |
|
|
143
|
+
| "Frontmatter is overhead, I'll add it later" | Frontmatter is the parity sweep mechanism. Without it, the doc is unfindable and unverifiable. |
|
|
144
|
+
| "The mechanics are obvious from the code" | Obvious to you ≠ obvious to a cold reader. Mechanics chapter is non-negotiable. |
|
|
145
|
+
| "I'll just describe the API surface" | API surface is `02-walkthrough` at best. If that's all you've written, you haven't written a codebook. |
|
|
146
|
+
| "Sweep means I should rewrite the whole chapter to match the new code" | Sweep is surgical. Edit only drifted sections. Preserve what's still correct. That is the whole point. |
|
|
147
|
+
| "I'll skip the changelog, it's just overhead" | Changelog is how the next agent (or future-you) sees what changed without diffing the whole chapter. |
|
|
148
|
+
|
|
149
|
+
## Red flags — STOP and start over
|
|
150
|
+
|
|
151
|
+
- File count > 4 chapters (excluding CHANGELOG.md)
|
|
152
|
+
- Any chapter file outside `docs/codebook/<feature>/`
|
|
153
|
+
- Frontmatter missing from any chapter
|
|
154
|
+
- No `CHANGELOG.md`
|
|
155
|
+
- Any chapter that reads like an API reference (no narrative, no "you")
|
|
156
|
+
- Sweep mode that rewrote chapters instead of editing surgically
|
|
157
|
+
- `parity-status: drifted` left unchanged after a sweep that touched the chapter
|
|
158
|
+
|
|
159
|
+
## Quick reference
|
|
160
|
+
|
|
161
|
+
| Operation | Where it goes |
|
|
162
|
+
|---|---|
|
|
163
|
+
| "What is this feature?" | `01-orientation.md` §1 |
|
|
164
|
+
| "What problem does it solve?" | `01-orientation.md` §2 |
|
|
165
|
+
| "What files should I read first?" | `01-orientation.md` §3 + `02-walkthrough.md` §1 |
|
|
166
|
+
| "How do I invoke it?" | `02-walkthrough.md` §1 |
|
|
167
|
+
| "How does the data flow?" | `02-walkthrough.md` §2 |
|
|
168
|
+
| "How does X actually compute Y?" | `03-deep-dive.md` §1 |
|
|
169
|
+
| "What invariants does it enforce?" | `03-deep-dive.md` §2 |
|
|
170
|
+
| "How do I add a new <thing>?" | `04-extension-points.md` §1 |
|
|
171
|
+
| "What will break if I change X?" | `04-extension-points.md` §4 |
|
|
172
|
+
| "When was this last verified?" | Frontmatter `last-verified` field, every chapter |
|
|
173
|
+
| "What's been changed in this codebook?" | `CHANGELOG.md` |
|
|
174
|
+
|
|
175
|
+
## Reference outcome
|
|
176
|
+
|
|
177
|
+
An unconstrained agent given the same task typically produces one of these failure modes — these are the targets this skill exists to prevent:
|
|
178
|
+
|
|
179
|
+
- **Single giant doc** — drops everything into one file, often in `/tmp` or `~/`, not in the project repo
|
|
180
|
+
- **Chapter sprawl** — invents 6–10 chapters by topic (code-map, cli-ref, bundle-layout, sibling-scripts, …) instead of the fixed 4-by-depth template
|
|
181
|
+
- **Reference prose** — describes APIs and flags without second-person narrative, no "you", no worked example
|
|
182
|
+
- **No frontmatter** — no way to know when a chapter was last verified or whether the code still matches
|
|
183
|
+
- **No mechanics chapter** — explains *that* a default is 0.72 but never *how* it is computed
|
|
184
|
+
- **No extension chapter** — leaves the reader stuck when they need to modify the feature
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: doc-review
|
|
3
|
+
description: 'Use right after an agent creates a doc (README, ADR, handoff, worklog entry, design doc, spec, runbook, etc.) — re-reads the doc against the conversation and any related plan/spec/code to catch dropped decisions (gaps), fabricated content (things written that were never decided), drift, staleness, and self-contradiction. Surfaces a punch-list first, then revises the doc in place once the user confirms the findings. Trigger: /doc-review, "review this doc", "check the doc against what we said", "did you miss anything in the doc?".'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Doc Review
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
A doc you just wrote is a draft. It reflects what you *think* was decided — not what was *actually* decided. Writing it forward from memory guarantees drift. The fix is to check it backward against the source of truth: the conversation, plus any plan, spec, or code the doc should match.
|
|
11
|
+
|
|
12
|
+
The failure modes are **bidirectional**, and both are silent:
|
|
13
|
+
|
|
14
|
+
- **Gaps** — discussed and agreed, then quietly dropped from the doc.
|
|
15
|
+
- **Fabrications** — written in the doc but never actually said. Hallucinated requirements, invented constraints, "helpful" additions nobody asked for.
|
|
16
|
+
|
|
17
|
+
Both slip through a casual re-read because the doc *sounds* right. The check only works if you walk both directions deliberately.
|
|
18
|
+
|
|
19
|
+
## The source of truth
|
|
20
|
+
|
|
21
|
+
For a doc just written, the sources of truth are, in order:
|
|
22
|
+
|
|
23
|
+
1. **The conversation** — primary. Every decision, requirement, constraint, number, name, and edge case lives here.
|
|
24
|
+
2. **The plan / spec / PRD** (if one exists) — defines what "done" means and what the doc must cover.
|
|
25
|
+
3. **The code** (if the doc describes code) — the code is the ground truth; if the doc says the function does X and the function does Y, the doc is wrong.
|
|
26
|
+
4. **Related docs** — for consistency (does this contradict an existing ADR, runbook, or sibling doc?).
|
|
27
|
+
|
|
28
|
+
If the doc disagrees with any of these, the doc is the thing that's wrong — not the source.
|
|
29
|
+
|
|
30
|
+
## The bidirectional check
|
|
31
|
+
|
|
32
|
+
This is the core mechanism. Run it both ways.
|
|
33
|
+
|
|
34
|
+
### Direction 1: Conversation → Doc (find gaps)
|
|
35
|
+
|
|
36
|
+
Walk the conversation and ask, for each meaningful decision/requirement/constraint:
|
|
37
|
+
|
|
38
|
+
- Is it in the doc?
|
|
39
|
+
- Is it in the doc *correctly* — same meaning, not paraphrased into something weaker?
|
|
40
|
+
- Is it in the doc *completely* — including the why, the edge cases, the constraints, not just the headline?
|
|
41
|
+
|
|
42
|
+
Anything discussed-and-agreed but missing or weakened is a **gap**. List them.
|
|
43
|
+
|
|
44
|
+
### Direction 2: Doc → Conversation (find fabrications and drift)
|
|
45
|
+
|
|
46
|
+
Walk the doc section by section and ask, for each claim/requirement/number/name:
|
|
47
|
+
|
|
48
|
+
- Did we actually decide this? Where in the conversation?
|
|
49
|
+
- Is this what we decided, or a slightly mutated version? (Drift: a number changed, a constraint softened, "must" became "should".)
|
|
50
|
+
- Is this still current, or did a later decision supersede it?
|
|
51
|
+
- Is this in scope? Did the user ask for this, or did I invent it?
|
|
52
|
+
|
|
53
|
+
Anything in the doc that you cannot trace back to a decision in the conversation is a **fabrication or drift**. List them with the doc location.
|
|
54
|
+
|
|
55
|
+
### Direction 3: Self-consistency pass
|
|
56
|
+
|
|
57
|
+
Read the doc end-to-end and check:
|
|
58
|
+
|
|
59
|
+
- Does section 2 contradict section 4?
|
|
60
|
+
- Does the summary match the body?
|
|
61
|
+
- Are terms used consistently (same word = same meaning throughout)?
|
|
62
|
+
- Are numbers/names/paths consistent across sections?
|
|
63
|
+
|
|
64
|
+
Internal contradictions are the easiest to miss and the most embarrassing to ship.
|
|
65
|
+
|
|
66
|
+
## The protocol
|
|
67
|
+
|
|
68
|
+
### 1. Identify the target doc
|
|
69
|
+
- If the user named a path (`/doc-review path/to/x.md`), use that.
|
|
70
|
+
- Otherwise: the most recently created or edited doc by you this session. State which file you're reviewing — don't review the wrong doc silently.
|
|
71
|
+
|
|
72
|
+
### 2. Re-read everything (don't skim)
|
|
73
|
+
- The full doc.
|
|
74
|
+
- The full conversation — especially the parts where decisions were made.
|
|
75
|
+
- Any plan/spec/code the doc should match.
|
|
76
|
+
|
|
77
|
+
### 3. Run the bidirectional check + self-consistency pass
|
|
78
|
+
Produce findings, each tagged:
|
|
79
|
+
- **[GAP]** — discussed, missing or weakened in the doc. Cite where in the conversation it was decided.
|
|
80
|
+
- **[FAB]** — in the doc, not traceable to any decision. Cite the doc location.
|
|
81
|
+
- **[DRIFT]** — in the doc, but mutated from what was decided. Cite both the doc and the conversation.
|
|
82
|
+
- **[STALE]** — in the doc, superseded by a later decision. Cite both.
|
|
83
|
+
- **[CONFLICT]** — internal contradiction, or contradiction with a related doc/ADR/code. Cite both locations.
|
|
84
|
+
- **[VAGUE]** — placeholder-y language where something specific was decided. Cite both.
|
|
85
|
+
|
|
86
|
+
Each finding must be **specific**: file path, section/heading, line if useful, and the exact divergence. "Missing some details" is not a finding.
|
|
87
|
+
|
|
88
|
+
### 4. Categorize each finding, then ACT (don't ask)
|
|
89
|
+
Present the findings as a numbered list AND categorize each one:
|
|
90
|
+
- **Correction** ([GAP] missing from conversation, [DRIFT] mutated, [STALE] superseded, [CONFLICT] internal contradiction) — apply directly. The doc catching up to what was decided is not a choice.
|
|
91
|
+
- **Recommendation** ([VAGUE] with a sensible default, [FAB] with low-stakes implications) — apply with your pick, name the pick in the punch list. The user can override after the fact.
|
|
92
|
+
- **Genuine fork** ([FAB] that would change user-visible behavior significantly, content the user might deliberately want kept, or affects a decision that depends on user context you don't have) — surface and wait. **This is rare**; most findings are corrections or recommendations.
|
|
93
|
+
|
|
94
|
+
The user wants the doc fixed, not pre-approved. Don't ask "want me to apply these?" for the default case — apply them, mark them applied in the punch list, and end with a one-line diff summary. The user reviews the diff after the fact, not before each edit.
|
|
95
|
+
|
|
96
|
+
**Process every finding — do not pick and choose.** Apply EVERY correction, apply EVERY recommendation (with your pick), surface EVERY genuine fork. The user wants all items fixed, not the agent's selection. If you found 5 [GAP]s and 2 [FAB]s, you produce 5+2 actions (or 5+2 surfacings), not "I'll just do the 3 obvious ones." Selective fixing is the violation.
|
|
97
|
+
|
|
98
|
+
### 5. Revise in place
|
|
99
|
+
Edit the doc directly — do not produce a parallel doc or a "here's what I'd change" writeup. Each edit traces directly to a finding (now applied). The user reviews the diff after the fact; they don't need to pre-approve each edit.
|
|
100
|
+
|
|
101
|
+
### 6. Re-verify
|
|
102
|
+
After editing, re-read the doc once more end-to-end. Did the edits introduce new contradictions? Did fixing a gap create drift elsewhere? A second pass catches second-order issues.
|
|
103
|
+
|
|
104
|
+
## What this is NOT
|
|
105
|
+
|
|
106
|
+
- **Not a copy-edit / grammar pass.** Tone, spelling, and formatting are out of scope unless they change meaning. (If the user asked for a specific format and the doc doesn't match, that's a finding; otherwise leave style alone.)
|
|
107
|
+
- **Not a "make it longer" pass.** Brevity is fine. Don't pad the doc with things never discussed just to feel thorough.
|
|
108
|
+
- **Not a rewrite.** Surgical edits that map to findings only. Resist "while I'm in here…" changes.
|
|
109
|
+
- **Not a substitute for the user's judgment.** The punch-list goes to the user before any edit. You propose; they decide.
|
|
110
|
+
|
|
111
|
+
## Critical behaviors
|
|
112
|
+
|
|
113
|
+
- **Re-read the whole conversation, not the tail.** Decisions made early and never revisited are exactly what get dropped.
|
|
114
|
+
- **Cite both sides of every divergence.** A finding without locations is a vibe.
|
|
115
|
+
- **Default to the conversation as truth.** If doc and conversation disagree, the doc is wrong — unless the user says otherwise.
|
|
116
|
+
- **Surface fabrications even if they "sound right."** A plausible-sounding requirement you invented is the most dangerous finding. Don't self-censor.
|
|
117
|
+
- **Categorize, then act by default.** Corrections and recommendations get applied directly. Genuine forks get surfaced. Don't ask the user to pre-approve each finding.
|
|
118
|
+
- **Don't add things you weren't asked to add.** Reviewing is not authoring. If you spot something genuinely missing that wasn't discussed, flag it as a question ("should this also cover X?"), don't write it in.
|
|
119
|
+
|
|
120
|
+
## When to use
|
|
121
|
+
|
|
122
|
+
Triggered by:
|
|
123
|
+
- `/doc-review [path]`
|
|
124
|
+
- "review this doc"
|
|
125
|
+
- "check the doc against what we said"
|
|
126
|
+
- "did you miss anything in the doc?"
|
|
127
|
+
- "is the doc complete?"
|
|
128
|
+
- any time an agent just produced a doc and the user wants it stress-tested before it ships
|
|
129
|
+
|
|
130
|
+
Best run **immediately after the doc is written**, while the conversation context is fresh. The longer you wait, the more the conversation compacts and the harder it is to verify against.
|
|
131
|
+
|
|
132
|
+
## Common failure modes
|
|
133
|
+
|
|
134
|
+
- **The surface re-read.** "Looks good!" without walking both directions. Not a review.
|
|
135
|
+
- **Confirming your own draft.** You wrote it, so of course it reads right to you. The bidirectional check exists because forward-reading your own work is unreliable.
|
|
136
|
+
- **Skipping fabrications.** "That sounds like something we'd want" → keeping an invented requirement. No. If it wasn't decided, it's a finding.
|
|
137
|
+
- **Asking for permission on every finding.** Treating the user as a pre-approval gate. The user wants the doc fixed, not pre-approved. Apply corrections and recommendations; only ask for genuine forks.
|
|
138
|
+
- **Picking and choosing which findings to fix.** The user wants all items fixed, not the agent's selection. If you found 5 corrections and 2 recommendations, you act on 5+2, not "the 3 I'm most confident about." Selective fixing is the violation.
|
|
139
|
+
- **Style-editing under the guise of review.** Tweaking phrasing because you prefer it. Out of scope.
|
|
140
|
+
- **Padding the doc.** Adding sections to "be thorough" that were never discussed. That's a fabrication, not a fix.
|
|
141
|
+
|
|
142
|
+
## Related
|
|
143
|
+
|
|
144
|
+
- **`plan-review`** — the narrower sibling. Use `plan-review` when the doc is specifically a *plan* (defines "done", sequencing, scope). Use `doc-review` for any other doc type.
|
|
145
|
+
- **`prove-it`** — governs single claims. `doc-review` applies the same evidence discipline across a whole document.
|
|
146
|
+
- **`sitrep`** — a sitrep verifies *understanding*; `doc-review` verifies a *written artifact*. Same discipline, different target.
|
|
147
|
+
- **`professional`** — the professional does not ship docs with fabricated content. `doc-review` is how you uphold that.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: feature-research
|
|
3
|
+
description: Research existing architecture before implementing a complex feature.
|
|
4
|
+
metadata:
|
|
5
|
+
author: morph
|
|
6
|
+
version: "0.1.0"
|
|
7
|
+
argument-hint: <feature>
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Feature Research
|
|
11
|
+
|
|
12
|
+
Before implementing a complex feature, use codebase_search to avoid duplicating patterns and to match existing conventions.
|
|
13
|
+
|
|
14
|
+
## When To Use
|
|
15
|
+
|
|
16
|
+
- New feature spans multiple modules/services.
|
|
17
|
+
- You need to find existing patterns for similar features.
|
|
18
|
+
- You need to identify API boundaries, data models, and tests.
|
|
19
|
+
|
|
20
|
+
## Steps
|
|
21
|
+
|
|
22
|
+
1. Identify the likely "shape" of the feature (routes, state, DB, background jobs, UI).
|
|
23
|
+
2. Run `codebase_search` with a natural language question or description that asks for similar features and relevant files.
|
|
24
|
+
3. Extract:
|
|
25
|
+
- Existing patterns to reuse
|
|
26
|
+
- Integration points
|
|
27
|
+
- Config/feature-flag conventions
|
|
28
|
+
- Tests to mirror
|
|
29
|
+
4. Propose an implementation plan that matches the repo.
|
|
30
|
+
5. Implement.
|
|
31
|
+
|
|
32
|
+
## Query Template
|
|
33
|
+
|
|
34
|
+
"Find existing implementations similar to <feature>. Include endpoints, data models, background tasks, and tests."
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: file-op
|
|
3
|
+
description: Execute FileOpsREQ protocol requests. Handles autoflow domain ops for .ccb/ state management.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# FileOps Executor (Codex Side)
|
|
7
|
+
|
|
8
|
+
You receive FileOpsREQ JSON from Claude and must return FileOpsRES JSON only. No markdown, no prose.
|
|
9
|
+
|
|
10
|
+
## Protocol Reference
|
|
11
|
+
|
|
12
|
+
See `~/.claude/skills/docs/protocol.md` for full FileOpsREQ/FileOpsRES schema.
|
|
13
|
+
|
|
14
|
+
## Execution Rules
|
|
15
|
+
|
|
16
|
+
1. Parse the incoming FileOpsREQ JSON
|
|
17
|
+
2. Validate against schema (proto, id, purpose, ops, done, report)
|
|
18
|
+
3. Execute each op in order
|
|
19
|
+
4. Return FileOpsRES JSON only
|
|
20
|
+
|
|
21
|
+
## AutoFlow Domain Ops Implementation
|
|
22
|
+
|
|
23
|
+
All state files live under `.ccb/` directory relative to repo root.
|
|
24
|
+
|
|
25
|
+
### `autoflow_plan_init`
|
|
26
|
+
|
|
27
|
+
Input: `plan` object with taskName, objective, context, constraints, steps[], finalDone[]
|
|
28
|
+
|
|
29
|
+
Actions:
|
|
30
|
+
1. Create `.ccb/` directory if not exists
|
|
31
|
+
2. Build `state.json` from plan:
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"taskName": plan.taskName,
|
|
35
|
+
"objective": plan.objective,
|
|
36
|
+
"context": plan.context,
|
|
37
|
+
"constraints": plan.constraints,
|
|
38
|
+
"current": { "type": "step", "stepIndex": 1, "subIndex": null },
|
|
39
|
+
"steps": [ { "index": i+1, "title": title, "status": "todo" (first="doing"), "attempts": 0, "substeps": [] } ],
|
|
40
|
+
"finalDone": plan.finalDone
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
3. Write `.ccb/state.json`
|
|
44
|
+
4. Generate `.ccb/todo.md` from state (see formats.md)
|
|
45
|
+
5. Generate `.ccb/plan_log.md` with initial plan entry
|
|
46
|
+
|
|
47
|
+
### `autoflow_state_preflight`
|
|
48
|
+
|
|
49
|
+
Input: `path` (default `.ccb/state.json`), `maxAttempts` (default 2)
|
|
50
|
+
|
|
51
|
+
Actions:
|
|
52
|
+
1. Read `.ccb/state.json`
|
|
53
|
+
2. If file missing → return fail status with "No plan. Use /tp first."
|
|
54
|
+
3. Validate `current` pointer
|
|
55
|
+
4. If `current.type == "none"` → return ok with taskComplete flag
|
|
56
|
+
5. Get current step/substep, check attempts < maxAttempts
|
|
57
|
+
6. If attempts exceeded → return fail with "Max attempts exceeded"
|
|
58
|
+
7. Increment attempts, write back `.ccb/state.json`
|
|
59
|
+
8. Return ok with `data.state` (current pointer) and `data.stepContext` (step title, objective, relevant info)
|
|
60
|
+
|
|
61
|
+
### `autoflow_state_apply_split`
|
|
62
|
+
|
|
63
|
+
Input: `stepIndex`, `substeps` (array of 3-7 title strings)
|
|
64
|
+
|
|
65
|
+
Actions:
|
|
66
|
+
1. Read `.ccb/state.json`
|
|
67
|
+
2. Find step by stepIndex
|
|
68
|
+
3. Set step.substeps = substeps mapped to `{ index: i+1, title: t, status: "todo" }`, first one "doing"
|
|
69
|
+
4. Set `current = { type: "substep", stepIndex: stepIndex, subIndex: 1 }`
|
|
70
|
+
5. Write `.ccb/state.json`
|
|
71
|
+
6. Regenerate `.ccb/todo.md`
|
|
72
|
+
|
|
73
|
+
### `autoflow_state_finalize`
|
|
74
|
+
|
|
75
|
+
Input: `verification` (string), `changedFiles` (optional array)
|
|
76
|
+
|
|
77
|
+
Actions:
|
|
78
|
+
1. Read `.ccb/state.json`
|
|
79
|
+
2. Mark current step/substep status = "done"
|
|
80
|
+
3. Advance `current` to next todo step/substep:
|
|
81
|
+
- If substeps remain in current step → next substep
|
|
82
|
+
- If no substeps remain → next step
|
|
83
|
+
- If no steps remain → set `current = { type: "none", stepIndex: null, subIndex: null }`
|
|
84
|
+
4. If next item exists, set its status to "doing"
|
|
85
|
+
5. Write `.ccb/state.json`
|
|
86
|
+
6. Regenerate `.ccb/todo.md`
|
|
87
|
+
7. Append completion entry to `.ccb/plan_log.md`
|
|
88
|
+
|
|
89
|
+
### `autoflow_state_mark_blocked`
|
|
90
|
+
|
|
91
|
+
Input: `reason` (string)
|
|
92
|
+
|
|
93
|
+
Actions:
|
|
94
|
+
1. Read `.ccb/state.json`
|
|
95
|
+
2. Mark current step/substep status = "blocked"
|
|
96
|
+
3. Write `.ccb/state.json`
|
|
97
|
+
4. Regenerate `.ccb/todo.md`
|
|
98
|
+
|
|
99
|
+
### `autoflow_state_append_steps`
|
|
100
|
+
|
|
101
|
+
Input: `steps` (array of 1-2 title strings), `maxAllowed` (default 2)
|
|
102
|
+
|
|
103
|
+
Precondition: `current.type == "none"` (task completed)
|
|
104
|
+
|
|
105
|
+
Actions:
|
|
106
|
+
1. Read `.ccb/state.json`
|
|
107
|
+
2. If steps.length > maxAllowed → return fail
|
|
108
|
+
3. Append new steps to steps array
|
|
109
|
+
4. Set `current` to first new step, mark it "doing"
|
|
110
|
+
5. Write `.ccb/state.json`
|
|
111
|
+
6. Regenerate `.ccb/todo.md`
|
|
112
|
+
7. Append to `.ccb/plan_log.md`
|
|
113
|
+
|
|
114
|
+
## Output Format
|
|
115
|
+
|
|
116
|
+
Always return pure JSON matching FileOpsRES schema. Never wrap in markdown code blocks.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: grill-me
|
|
3
|
+
description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
|
|
7
|
+
|
|
8
|
+
Ask the questions one at a time.
|
|
9
|
+
|
|
10
|
+
If a question can be answered by exploring the codebase, explore the codebase instead.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# ADR Format
|
|
2
|
+
|
|
3
|
+
ADRs live in `docs/adr/` and use sequential numbering: `0001-slug.md`, `0002-slug.md`, etc.
|
|
4
|
+
|
|
5
|
+
Create the `docs/adr/` directory lazily — only when the first ADR is needed.
|
|
6
|
+
|
|
7
|
+
## Template
|
|
8
|
+
|
|
9
|
+
```md
|
|
10
|
+
# {Short title of the decision}
|
|
11
|
+
|
|
12
|
+
{1-3 sentences: what's the context, what did we decide, and why.}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
## Optional sections
|
|
18
|
+
|
|
19
|
+
Only include these when they add genuine value. Most ADRs won't need them.
|
|
20
|
+
|
|
21
|
+
- **Status** frontmatter (`proposed | accepted | deprecated | superseded by ADR-NNNN`) — useful when decisions are revisited
|
|
22
|
+
- **Considered Options** — only when the rejected alternatives are worth remembering
|
|
23
|
+
- **Consequences** — only when non-obvious downstream effects need to be called out
|
|
24
|
+
|
|
25
|
+
## Numbering
|
|
26
|
+
|
|
27
|
+
Scan `docs/adr/` for the highest existing number and increment by one.
|
|
28
|
+
|
|
29
|
+
## When to offer an ADR
|
|
30
|
+
|
|
31
|
+
All three of these must be true:
|
|
32
|
+
|
|
33
|
+
1. **Hard to reverse** — the cost of changing your mind later is meaningful
|
|
34
|
+
2. **Surprising without context** — a future reader will look at the code and wonder "why on earth did they do it this way?"
|
|
35
|
+
3. **The result of a real trade-off** — there were genuine alternatives and you picked one for specific reasons
|
|
36
|
+
|
|
37
|
+
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."
|
|
38
|
+
|
|
39
|
+
### What qualifies
|
|
40
|
+
|
|
41
|
+
- **Architectural shape.** "We're using a monorepo." "The write model is event-sourced, the read model is projected into Postgres."
|
|
42
|
+
- **Integration patterns between contexts.** "Ordering and Billing communicate via domain events, not synchronous HTTP."
|
|
43
|
+
- **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.
|
|
44
|
+
- **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.
|
|
45
|
+
- **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.
|
|
46
|
+
- **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."
|
|
47
|
+
- **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,60 @@
|
|
|
1
|
+
# CONTEXT.md Format
|
|
2
|
+
|
|
3
|
+
## Structure
|
|
4
|
+
|
|
5
|
+
```md
|
|
6
|
+
# {Context Name}
|
|
7
|
+
|
|
8
|
+
{One or two sentence description of what this context is and why it exists.}
|
|
9
|
+
|
|
10
|
+
## Language
|
|
11
|
+
|
|
12
|
+
**Order**:
|
|
13
|
+
{A one or two sentence description of the term}
|
|
14
|
+
_Avoid_: Purchase, transaction
|
|
15
|
+
|
|
16
|
+
**Invoice**:
|
|
17
|
+
A request for payment sent to a customer after delivery.
|
|
18
|
+
_Avoid_: Bill, payment request
|
|
19
|
+
|
|
20
|
+
**Customer**:
|
|
21
|
+
A person or organization that places orders.
|
|
22
|
+
_Avoid_: Client, buyer, account
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- **Be opinionated.** When multiple words exist for the same concept, pick the best one and list the others under `_Avoid_`.
|
|
28
|
+
- **Keep definitions tight.** One or two sentences max. Define what it IS, not what it does.
|
|
29
|
+
- **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.
|
|
30
|
+
- **Group terms under subheadings** when natural clusters emerge. If all terms belong to a single cohesive area, a flat list is fine.
|
|
31
|
+
|
|
32
|
+
## Single vs multi-context repos
|
|
33
|
+
|
|
34
|
+
**Single context (most repos):** One `CONTEXT.md` at the repo root.
|
|
35
|
+
|
|
36
|
+
**Multiple contexts:** A `CONTEXT-MAP.md` at the repo root lists the contexts, where they live, and how they relate to each other:
|
|
37
|
+
|
|
38
|
+
```md
|
|
39
|
+
# Context Map
|
|
40
|
+
|
|
41
|
+
## Contexts
|
|
42
|
+
|
|
43
|
+
- [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
|
|
44
|
+
- [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
|
|
45
|
+
- [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping
|
|
46
|
+
|
|
47
|
+
## Relationships
|
|
48
|
+
|
|
49
|
+
- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them to start picking
|
|
50
|
+
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched` events; Billing consumes them to generate invoices
|
|
51
|
+
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The skill infers which structure applies:
|
|
55
|
+
|
|
56
|
+
- If `CONTEXT-MAP.md` exists, read it to find contexts
|
|
57
|
+
- If only a root `CONTEXT.md` exists, single context
|
|
58
|
+
- If neither exists, create a root `CONTEXT.md` lazily when the first term is resolved
|
|
59
|
+
|
|
60
|
+
When multiple contexts exist, infer which one the current topic relates to. If unclear, ask.
|