feat(reuse): recording model becomes the pattern library — every shape at first build (#2687)
Decision #2686: snippets are the project's pattern library, not a dedup net. The floor, the reusing-code skill, and the snippet tool docstrings now state the proactive model — record every shape the first time it is built, with no will-it-recur judgment, and start later instances from the recorded shape; second-copy consolidation stays as the backstop. The floor guard test pins all three elements (tool, first-build trigger, backstop) so the model cannot silently regress to the reactive wording. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -52,16 +52,21 @@ for the operator's work, and as your own working memory across sessions.
|
||||
it. An untagged project record carries the `systems_hint` question instead,
|
||||
on creates, updates, and work-logs alike — treat it as the tagging question
|
||||
asked at the moment of work, not as noise to skip past.
|
||||
- **Reuse before rebuilding — and record what you build** — before writing a
|
||||
new helper/utility/component, search recorded **snippets** (reusable code
|
||||
recorded once for recall) and reuse the prior art instead of re-solving it.
|
||||
The recording half has NAMED TRIGGERS, not a vibe: the moment you extract a
|
||||
shared component, hoist a helper into a common module, or notice you are
|
||||
writing the second copy of anything, record it with `create_snippet` (name,
|
||||
code, when-to-reach-for-it, location) in the same breath as the commit.
|
||||
Work that "refactors X into a shared Y" is not finished until Y is recorded
|
||||
— an unrecorded shared component is invisible to every later session, which
|
||||
is how a codebase grows four `.btn-primary` definitions.
|
||||
- **The pattern library: start from recorded shapes, and record every shape
|
||||
at first build** — recorded **snippets** are the project's pattern library,
|
||||
not a dedup net. Before building ANY shape — a button, an input field, a
|
||||
modal, a route handler, a service class, a test scaffold, up through complex
|
||||
subsystem patterns — search snippets and START from the recorded shape; a
|
||||
deliberate departure is recorded as its own named variant, never left as
|
||||
silent drift. And the FIRST time a shape is built, record it with
|
||||
`create_snippet` (name, when-to-reach-for-it, location, code) in the same
|
||||
breath — do not judge whether it "might recur": the builder of the first
|
||||
instance can never know, and a missed record is invisible until it
|
||||
resurfaces as an uninformed duplicate. A mature project's snippet corpus
|
||||
should read as a map of every shape in it. The backstop still holds:
|
||||
noticing the second copy of anything, or consolidating copies into a shared
|
||||
X, means X gets recorded before that work is finished — which is how a
|
||||
codebase is kept from growing four `.btn-primary` definitions.
|
||||
- Do **not** keep the operator's rules, plans, or project notes in local
|
||||
memory / CLAUDE.md in parallel with Scribe — Scribe holds the single copy.
|
||||
- **Compact at clean seams** — because you record as you go, a context
|
||||
|
||||
Reference in New Issue
Block a user