@minhduydev/mdpi 0.3.2 → 0.4.1

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.
Files changed (36) hide show
  1. package/README.md +2 -1
  2. package/dist/index.js +202 -4
  3. package/dist/template/.pi/README.md +29 -8
  4. package/dist/template/.pi/VERSION +1 -1
  5. package/dist/template/.pi/agents/general.md +1 -1
  6. package/dist/template/.pi/agents/review.md +1 -1
  7. package/dist/template/.pi/extensions/templates-injector.ts +1 -1
  8. package/dist/template/.pi/packages.json +13 -0
  9. package/dist/template/.pi/prompts/audit.md +4 -1
  10. package/dist/template/.pi/prompts/create.md +1 -0
  11. package/dist/template/.pi/prompts/fix.md +7 -1
  12. package/dist/template/.pi/prompts/gc.md +3 -0
  13. package/dist/template/.pi/prompts/init.md +3 -0
  14. package/dist/template/.pi/prompts/plan.md +5 -2
  15. package/dist/template/.pi/prompts/research.md +3 -0
  16. package/dist/template/.pi/prompts/ship.md +7 -1
  17. package/dist/template/.pi/prompts/verify.md +4 -1
  18. package/dist/template/.pi/skills/INDEX.md +49 -12
  19. package/dist/template/.pi/skills/accessibility-audit/SKILL.md +8 -2
  20. package/dist/template/.pi/skills/baseline-ui/SKILL.md +211 -0
  21. package/dist/template/.pi/skills/dcp-hygiene/SKILL.md +106 -0
  22. package/dist/template/.pi/skills/design-taste-frontend/SKILL.md +53 -42
  23. package/dist/template/.pi/skills/fixing-accessibility/SKILL.md +509 -0
  24. package/dist/template/.pi/skills/frontend-design/SKILL.md +59 -46
  25. package/dist/template/.pi/skills/frontend-ui-engineering/SKILL.md +21 -27
  26. package/dist/template/.pi/skills/memory-system/SKILL.md +118 -0
  27. package/dist/template/.pi/skills/oklch-color-workflow/SKILL.md +426 -0
  28. package/dist/template/.pi/skills/production-hardening/SKILL.md +652 -0
  29. package/dist/template/.pi/skills/ui-craft-principles/SKILL.md +564 -0
  30. package/dist/template/.pi/skills/ui-quality-audit/SKILL.md +329 -0
  31. package/dist/template/.pi/templates/DESIGN.md +76 -0
  32. package/dist/template/.pi/workflows/INDEX.md +2 -1
  33. package/dist/template/.pi/workflows/frontend-feature-workflow.md +343 -0
  34. package/dist/template/.pi/workflows/quality-loop.md +3 -1
  35. package/package.json +1 -1
  36. /package/dist/template/.pi/templates/{design.md → feature-design.md} +0 -0
@@ -3,6 +3,8 @@ name: frontend-design
3
3
  description: MUST load when building any web UI with React-based frameworks — components, pages, or full applications. Covers Tailwind CSS v4, shadcn/ui, Motion animations. Base UI implementation skill; combine with aesthetic overlays (minimalist-ui, high-end-visual-design) for specific styles.
4
4
  ---
5
5
 
6
+ **Aesthetic Context:** Your implementation must reflect the project `.pi/DESIGN.md` identity. Before writing any component, internalize the Overview & Mood, Colors, and Typography sections. All code output should feel like it belongs to the same intentional design system.
7
+
6
8
  # Frontend Design
7
9
 
8
10
  ## When to Use
@@ -18,6 +20,17 @@ description: MUST load when building any web UI with React-based frameworks —
18
20
 
19
21
  - Backend-only tasks or minimal UI with no visual design requirements.
20
22
 
23
+ ## Relationship to Other Skills
24
+
25
+ | Skill | Role |
26
+ |-------|------|
27
+ | `design-taste-frontend` | Upstream — sets aesthetic baseline and anti-AI-slops. Load BEFORE this skill. |
28
+ | `frontend-ui-engineering` | Sibling — handles component implementation, accessibility, and state patterns. |
29
+ | `react-best-practices` | Complement — React/Next.js performance patterns. |
30
+ | `baseline-ui` | Quick deslop pass for automatic fixes (spacing, typography). |
31
+
32
+ **Pipeline:** `design-taste-frontend` → `frontend-design` → `frontend-ui-engineering`
33
+
21
34
  ## Reference Documentation
22
35
 
23
36
  ### Tailwind CSS v4.1
@@ -67,7 +80,7 @@ For sophisticated compositions: posters, brand materials, design systems.
67
80
  - `./references/design/interaction.md` - State models, focus, dialogs/popovers, loading patterns
68
81
  - `./references/design/ux-writing.md` - Button copy, error structure, empty states, i18n
69
82
 
70
- Search: `AI Slop Test`, `tinted neutrals`, `focus-visible`, `verb + object`, `65ch`
83
+ Search: `tinted neutrals`, `focus-visible`, `verb + object`, `65ch`
71
84
 
72
85
  ## Design Thinking
73
86
 
@@ -79,49 +92,56 @@ Before coding, commit to BOLD aesthetic direction:
79
92
 
80
93
  Bold maximalism and refined minimalism both work. Key is intentionality.
81
94
 
82
- ## Anti-Patterns (AI Fingerprints — NEVER)
83
-
84
- These patterns immediately signal "AI made this." Avoid them all.
95
+ ## Don't
85
96
 
86
97
  ### Typography
87
98
 
88
- - **Banned fonts**: Inter, Roboto, Arial, Open Sans, Lato, Montserrat, Space Grotesk, system-ui as display font
89
- - Monospace used as "developer aesthetic" shorthand
90
- - Big icons centered above every heading
91
- - Using `px` for body text (use `rem`/`em` to respect user settings)
99
+ | Pattern | Replacement | Because |
100
+ |---------|-------------|---------|
101
+ | Inter, Roboto, Arial as display fonts | Distinctive display fonts (Instrument Sans, Outfit, Fraunces) | Overused fonts signal generic design |
102
+ | Monospace used as "developer aesthetic" shorthand | Purposeful type choice; mono only for code/data | Mono-as-aesthetic reads as placeholder design |
103
+ | Big icons centered above every heading | Integrated icon + heading lockup, or icon inline | Giant centered icons feel template-generated |
104
+ | Using `px` for body text | `rem`/`em` to respect user font-size preferences | `px` ignores accessibility and user settings |
92
105
 
93
106
  ### Color
94
107
 
95
- - **AI palette**: Cyan-on-dark, purple-to-blue gradients, neon accents on dark backgrounds
96
- - Gray text on colored backgrounds (use darker shade of background color instead)
97
- - Pure `#000` or `#fff` (always tint pure black/white don't exist in nature)
98
- - Gradient text on headings or metrics
99
- - `rgba()` / heavy alpha transparency as primary palette (design smell define explicit colors)
108
+ | Pattern | Replacement | Because |
109
+ |---------|-------------|---------|
110
+ | Gray text on colored backgrounds | Darker shade of the background color | Gray-on-color fails contrast and looks muddy |
111
+ | Pure `#000` or `#fff` | Tinted near-black or near-white | Pure black/white don't exist in natural light |
112
+ | Gradient text on headings or metrics | Solid, well-chosen heading color | Gradient text is a design crutch |
113
+ | `rgba()` / heavy alpha transparency as primary palette | Explicit, named color values | Heavy alpha stacking creates unpredictable colors |
100
114
 
101
115
  ### Layout
102
116
 
103
- - Cards nested inside cards (use typography, spacing, dividers for hierarchy within a card)
104
- - Identical card grids (icon + heading + text repeated 3-6 times)
105
- - Hero metric template (big number + small label + gradient accent)
106
- - Center-aligning everything
107
- - Same spacing everywhere (no visual rhythm)
117
+ | Pattern | Replacement | Because |
118
+ |---------|-------------|---------|
119
+ | Cards nested inside cards | Typography, spacing, dividers for hierarchy | Nested cards create visual noise without purpose |
120
+ | Identical card grids (icon + heading + text ×3-6) | Varied layout with purposeful asymmetry | Repeated identical cards is the #1 AI tell |
121
+ | Hero metric template (big number + small label + gradient accent) | Contextual data display — number embedded in prose or card | Generic hero metrics are the startup-template cliché |
122
+ | Center-aligning everything | Left-align content blocks; reserve center for short hero headlines | Center-aligned body text is hard to scan |
123
+ | Same spacing everywhere (no visual rhythm) | Use proximity to group related items; vary spacing to create sections | Uniform spacing flattens hierarchy |
108
124
 
109
125
  ### Visual
110
126
 
111
- - Glassmorphism used decoratively (blur cards, glow borders)
112
- - Thick colored border on one side of rounded rectangles
113
- - Sparklines as decoration (not connected to real data)
114
- - Generic drop shadows on everything
115
- - Rounded rectangles as the only shape language
127
+ | Pattern | Replacement | Because |
128
+ |---------|-------------|---------|
129
+ | Glassmorphism used decoratively | Flat surfaces or layered shadows | Glassmorphism needs a functional reason for depth |
130
+ | Thick colored border on one side of rounded rectangles | Subtle border or shadow on entire element | One-sided colored borders are a dated pattern |
131
+ | Sparklines as decoration (not connected to real data) | Real sparklines from actual data, or omit entirely | Decorative sparklines are fake data theater |
132
+ | Generic drop shadows on everything | Intentional shadow hierarchy — only where depth communicates meaning | Shadow-everywhere flattens the depth language |
133
+ | Rounded rectangles as the only shape language | Mix shapes: sharp corners, soft corners, circles, organic shapes | Single-shape designs feel templated |
116
134
 
117
135
  ### Motion
118
136
 
119
- - Bounce or elastic easing (real objects decelerate smoothly)
120
- - Animating `height`, `width`, `padding`, `margin` (causes layout recalculation)
121
- - Default `ease` (compromise that's rarely optimal use exponential easing)
122
- - Missing `prefers-reduced-motion` handling
137
+ | Pattern | Replacement | Because |
138
+ |---------|-------------|---------|
139
+ | Bounce or elastic easing on UI | Exponential easing `cubic-bezier(0.16, 1, 0.3, 1)` | Real objects decelerate smoothly, not bounce |
140
+ | Animating `height`, `width`, `padding`, `margin` | Animate only `transform` and `opacity` | Layout animations cause expensive repaints |
141
+ | Default `ease` | Exponential easing curves tuned to animation purpose | Default `ease` is a compromise rarely optimal |
142
+ | Missing `prefers-reduced-motion` handling | Always respect reduced motion preferences | ~35% of adults over 40 prefer reduced motion |
123
143
 
124
- > **The AI Slop Test**: If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
144
+ > **The Slop Test:** If you showed this interface to someone and said "AI made this," would they believe you immediately? If yes, that's the problem.
125
145
 
126
146
  ## Best Practices
127
147
 
@@ -235,28 +255,21 @@ Create atmosphere: gradient meshes, noise textures, geometric patterns, layered
235
255
 
236
256
  | Rationalization | Reality |
237
257
  |---|---|
238
- | "The AI aesthetic is fine for now" | AI default styles (purple gradients, oversized cards) signal low quality. Use the design system. |
258
+ | "The default look is fine for now" | Default styles signal low quality. Use the design system from the start. |
239
259
  | "I'll make it responsive later" | Retrofitting responsive design is 3x harder than building it mobile-first. |
240
260
  | "Accessibility is a nice-to-have" | It's a legal requirement in many jurisdictions and an engineering quality standard. |
241
261
  | "This is just a prototype" | Prototypes become production code. Build the foundation right from the start. |
242
-
243
- ## Red Flags
244
-
245
- - Components exceeding 200 lines (split them)
246
- - Inline styles or arbitrary pixel values
247
- - Missing error states, loading states, or empty states
248
- - No keyboard navigation testing
249
- - Color as the sole indicator of state (red/green without text or icons)
250
- - Generic "AI look" (purple gradients, oversized cards, stock layouts)
262
+ | "Typography doesn't matter for functionality" | Typography is 95% of web design. Bad type ruins even good layouts. |
263
+ | "Users won't notice the details" | Users may not articulate it, but they feel quality. Details accumulate into perception. |
251
264
 
252
265
  ## Verification
253
266
 
254
- After building UI:
255
-
256
- - [ ] Component renders without console errors
257
- - [ ] All interactive elements are keyboard accessible (Tab through the page)
258
- - [ ] Screen reader can convey the page's content and structure
267
+ - [ ] Design tokens defined: primitives + semantic layer, with dark mode variants
268
+ - [ ] Typography: distinctive font pairing, fluid sizing with `clamp()`, `max-width: 65ch` on body text
269
+ - [ ] Color: OKLCH tokens, tinted neutrals (chroma 0.01-0.02), sufficient contrast (4.5:1 min)
270
+ - [ ] Motion: exponential easing only, `prefers-reduced-motion` handled, only `transform` + `opacity` animated
271
+ - [ ] Spacing: consistent 4pt scale, `gap` over margins, self-adjusting grids
259
272
  - [ ] Responsive: works at 320px, 768px, 1024px, 1440px
260
- - [ ] Loading, error, and empty states all handled
261
- - [ ] Follows the project's design system (spacing, colors, typography)
262
- - [ ] No accessibility warnings in dev tools or axe-core
273
+ - [ ] Interaction: all 8 states designed, `:focus-visible` used, skeletons over spinners
274
+ - [ ] UX Writing: verb + object buttons, error = what + why + fix, empty states are onboarding
275
+ - [ ] No banned fonts, no gray-on-color text, no pure black/white
@@ -30,14 +30,15 @@ This skill composes with others for a complete frontend quality pipeline:
30
30
 
31
31
  | Skill | Relationship | When to combine |
32
32
  |-------|-------------|-----------------|
33
- | `frontend-design` | Sibling | `frontend-design` covers general UI patterns with React. `frontend-ui-engineering` adds production-quality standards (accessibility, AI-aesthetic avoidance). Load both for serious UI work. |
34
- | `design-taste-frontend` | Upstream | Apply design-taste rules FIRST to establish the aesthetic baseline. Then use `frontend-ui-engineering` for implementation quality. |
33
+ | `design-taste-frontend` | Upstream | Apply aesthetic baseline FIRST. Then use `frontend-ui-engineering` for implementation quality. |
34
+ | `frontend-design` | Upstream | `frontend-design` covers design system + tokens. `frontend-ui-engineering` adds component implementation patterns. |
35
35
  | `react-best-practices` | Complement | Load when building React/Next.js components — covers performance-specific patterns (memo, useMemo, server components). |
36
- | `accessibility-audit` | Gate | After building UI, run `accessibility-audit` to verify WCAG 2.1 AA compliance. |
36
+ | `baseline-ui` | Upstream | Quick deslop pass before implementation fixes spacing, typography, layout basics automatically. |
37
+ | `fixing-accessibility` | Gate | After building UI, run `fixing-accessibility` for actionable WCAG 2.1 AA fixes. |
37
38
  | `performance-optimization` | Gate | After UI is working, profile with `performance-optimization` for Core Web Vitals. |
38
- | `mockup-to-code` | Upstream | If converting from Figma/mockup, run `mockup-to-code` first, then refine with `frontend-ui-engineering`. |
39
+ | `ui-craft-principles` | Complement | Apply 16 craft principles (concentric radius, optical alignment, etc.) for polish. |
39
40
 
40
- **Pipeline:** `design-taste-frontend` → `frontend-ui-engineering` → `accessibility-audit` + `performance-optimization`
41
+ **Pipeline:** `design-taste-frontend` → `frontend-design` → `frontend-ui-engineering` → `fixing-accessibility` + `performance-optimization`
41
42
 
42
43
  ## Component Architecture
43
44
 
@@ -102,11 +103,11 @@ Global store (Zustand, Redux) → Complex client state shared app-wide
102
103
 
103
104
  ## Design System Adherence
104
105
 
105
- ### Avoid the AI Aesthetic
106
+ ### Avoid Common Visual Anti-Patterns
106
107
 
107
- AI-generated UI has recognizable patterns. Avoid all of them:
108
+ These patterns degrade implementation quality. For design-level aesthetic rules, see `design-taste-frontend`.
108
109
 
109
- | AI Default | Production Quality |
110
+ | Degraded Pattern | Production Quality |
110
111
  |---|---|
111
112
  | Purple/indigo everything | Use the project's actual color palette |
112
113
  | Excessive gradients | Flat or subtle gradients matching the design system |
@@ -185,29 +186,20 @@ Test at: 320px, 768px, 1024px, 1440px.
185
186
  - `aria-busy="true"` on loading regions
186
187
  - Avoid layout shifts during loading (reserve space)
187
188
 
188
- ## Common Rationalizations
189
+ ## Don't
189
190
 
190
- | Rationalization | Reality |
191
- |---|---|
192
- | "Accessibility is a nice-to-have" | It's a legal requirement in many jurisdictions and an engineering quality standard. |
193
- | "We'll make it responsive later" | Retrofitting responsive design is 3x harder than building it from the start. |
194
- | "The design isn't final, so I'll skip styling" | Use the design system defaults. Unstyled UI creates a broken first impression. |
195
- | "This is just a prototype" | Prototypes become production code. Build the foundation right. |
196
- | "The AI aesthetic is fine for now" | It signals low quality. Use the project's actual design system from the start. |
197
-
198
- ## Red Flags
199
-
200
- - Components with more than 200 lines (split them)
201
- - Inline styles or arbitrary pixel values
202
- - Missing error states, loading states, or empty states
203
- - No keyboard navigation testing
204
- - Color as the sole indicator of state (red/green without text or icons)
205
- - Generic "AI look" (purple gradients, oversized cards, stock layouts)
191
+ | Pattern | Replacement | Because |
192
+ |---------|-------------|---------|
193
+ | Components over 200 lines | Split into smaller focused sub-components | Large components violate single responsibility |
194
+ | Inline styles or arbitrary pixel values | Use design tokens and consistent spacing scale | Inline styles are not maintainable |
195
+ | Missing error, loading, or empty states | Handle all 4 data states (loading, empty, error, normal) | Users see blank screens without complete state handling |
196
+ | Color as sole indicator of state | Add text labels or icons alongside color | Color-only cues are inaccessible to colorblind users |
197
+ | `<div onClick>` instead of `<button>` | Use `<button type="button">` with proper styling | div onClick has no keyboard or screen reader semantics |
198
+ | Prop drilling deeper than 3 levels | Use context, composition, or state management | Deep prop drilling couples components unnecessarily |
199
+ | Skipping heading levels (h1 → h3) | Maintain sequential hierarchy (h1 → h2 → h3) | Skipped levels break screen reader page navigation |
206
200
 
207
201
  ## Verification
208
202
 
209
- After building UI:
210
-
211
203
  - [ ] Component renders without console errors
212
204
  - [ ] All interactive elements are keyboard accessible (Tab through the page)
213
205
  - [ ] Screen reader can convey the page's content and structure
@@ -215,3 +207,5 @@ After building UI:
215
207
  - [ ] Loading, error, and empty states all handled
216
208
  - [ ] Follows the project's design system (spacing, colors, typography)
217
209
  - [ ] No accessibility warnings in dev tools or axe-core
210
+ - [ ] No `<div onClick>` as button replacement — all interactive elements use semantic HTML
211
+ - [ ] Components < 200 lines; larger components split into sub-components
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: memory-system
3
+ description: "Documents pi-hermes-memory capabilities: background auto-review, correction detection, tools (memory, memory_search, session_search), and commands. Load when the agent needs to understand or leverage the memory system — searching past failures, saving learnings, or learning the auto-flywheel."
4
+ ---
5
+
6
+ # Memory System (pi-hermes-memory)
7
+
8
+ ## Overview
9
+
10
+ pi-hermes-memory is the **persistent memory extension** that runs automatically in every pi session. It provides a self-learning flywheel without the agent needing to trigger it manually. This skill documents its capabilities so the agent can leverage them strategically.
11
+
12
+ ## Auto-Flywheel (already running — no trigger needed)
13
+
14
+ ### 1. Background Review — automated "compound" every ~10 turns
15
+
16
+ Every N turns (default: 10) OR after accumulating enough tool calls, pi-hermes-memory spawns a background child process that:
17
+
18
+ - Snaps the full conversation as `[USER]`/`[ASSISTANT]` prefixed text
19
+ - Reviews for: user preferences, corrections, failures, insights, conventions, tool-quirks
20
+ - Saves notable findings to `MEMORY.md`, `USER.md`, or `failures.md`
21
+ - Only acts if there's something genuinely worth saving ("Nothing to save." otherwise)
22
+ - Non-blocking — the session continues while the review runs
23
+
24
+ **→ You do NOT need to call this yourself.** It fires automatically on `turn_end`.
25
+
26
+ ### 2. Correction Detection — real-time error learning
27
+
28
+ On every user message, pi-hermes-memory checks for correction patterns:
29
+
30
+ | Strength | Patterns | Example |
31
+ |----------|----------|---------|
32
+ | **Strong** (always trigger) | `"don't do that"`, `"not like that"`, `"I said..."`, `"I told you..."`, `"that's not what I..."` | "Don't do that — use pnpm instead" |
33
+ | **Weak** (needs directive) | `"no, ..."`, `"wrong, ..."`, `"actually..."` + verb like "use", "change", "fix" | "No, use the other approach" |
34
+ | **Negative** (suppress) | `"no worries"`, `"no problem"`, `"actually looks great"` | Ignored |
35
+
36
+ When detected → immediately saves to `target='failure', category='correction'` with the reason "User corrected the agent".
37
+
38
+ **→ Corrections are captured automatically.** You don't need to save them — it's already done.
39
+
40
+ ### 3. Session Flush
41
+
42
+ Before session compaction/shutdown, a flush prompt extracts anything worth remembering from the closing session.
43
+
44
+ ### 4. Auto-Consolidation
45
+
46
+ When `MEMORY.md` reaches the 5,000 character limit, entries are auto-merged, deduped, and staled entries (>30 days, unreferenced) are removed.
47
+
48
+ ## Tools Available (agent can call)
49
+
50
+ | Tool | Purpose | Key params |
51
+ |------|---------|------------|
52
+ | `memory` | Save/update/delete memories | `action` (add/replace/remove), `target` (memory/user/failure/project), `content`, `category` |
53
+ | `memory_search` | Search durable memories across sessions | `query`, `target`, `category`, `project` |
54
+ | `session_search` | Search past conversation messages | `query`, `project`, `role` |
55
+ | `skill_manage` | Create/update procedural skills | `action`, `name`, `scope`, `when_to_use`, `procedure_steps` |
56
+
57
+ ## Memory Categories (for `target='failure'`)
58
+
59
+ | Category | When to use | Example |
60
+ |----------|------------|---------|
61
+ | `failure` | Something tried that didn't work | "Used localStorage for tokens — XSS vulnerability" |
62
+ | `correction` | User corrected the agent | "Use pnpm, not npm" |
63
+ | `insight` | Durable learning from experience | "Complexity over 15 in a single function causes CI timeout" |
64
+ | `preference` | User preference or work style | "Prefers terse responses, no cheerleading" |
65
+ | `convention` | Project or team convention | "Monorepo with turborepo, uses pnpm workspaces" |
66
+ | `tool-quirk` | Non-obvious tool behavior | "tsc --noEmit fails silently on .d.ts syntax errors" |
67
+
68
+ ## Commands Available (user can run)
69
+
70
+ | Command | Purpose |
71
+ |---------|---------|
72
+ | `/memory-insights` | Show everything stored in memory |
73
+ | `/memory-skills` | List all saved procedural skills |
74
+ | `/memory-consolidate` | Manually trigger memory cleanup/merge |
75
+ | `/memory-interview` | Onboarding interview to pre-fill user profile |
76
+ | `/memory-switch-project` | List all project memories |
77
+ | `/memory-index-sessions` | Import past sessions for search |
78
+ | `/memory-sync-markdown` | Backfill Markdown entries into SQLite search |
79
+ | `/memory-preview-context` | Show memory policy or legacy prompt blocks |
80
+ | `/learn-memory-tool` | Interactive guide to the memory system |
81
+
82
+ ## When to Use memory_search
83
+
84
+ Use `memory_search` when you need **durable, cross-session knowledge** — things that happened in previous sessions, not just the current one:
85
+
86
+ - **Searching past failures**: `memory_search({ query: "similar error", target: "failure", category: "failure" })`
87
+ - **Finding project conventions**: `memory_search({ query: "typescript pattern", project: "<project>" })`
88
+ - **Recalling user preferences**: `memory_search({ query: "prefers", target: "user" })`
89
+ - **Checking tool quirks**: `memory_search({ query: "pnpm install", category: "tool-quirk" })`
90
+
91
+ Use `vcc_recall` when you need **current-session lineage** — what was just discussed or tried in this active workflow.
92
+
93
+ Use both together in Guard phases for maximum recall coverage.
94
+
95
+ ## When to Explicitly Save (manual `memory` tool)
96
+
97
+ Even though auto-review runs every 10 turns, manually save when:
98
+
99
+ - **On 2x verification failure** — save the failed approach immediately so future sessions won't repeat it. Use `target='failure', category='failure'` with: what was tried, why it failed, the error, and what worked instead (if known).
100
+ - **On a critical discovery** — if you learn something that would save 15+ minutes for future-self, don't wait for the auto-review cycle.
101
+ - **On user's explicit request** — "remember this" → save immediately.
102
+ - **On learning a tool-quirk** — non-obvious behavior that would trip up a future agent.
103
+
104
+ ## Pitfalls
105
+
106
+ - **Waiting for auto-review for critical failures** — if verification just failed 2x, save that failure NOW. The auto-review might not fire for 10 more turns.
107
+ - **Using vcc_recall for cross-session knowledge** — vcc_recall is lineage-scoped (active session); it may not find failures from a closed session. Use `memory_search` instead.
108
+ - **Over-saving** — don't save task progress, session outcomes, or temporary state. The auto-review already captures durable learnings. Manual saves are for URGENT or USER-REQUESTED facts only.
109
+ - **Assuming memory_search has everything** — if the SQLite sync is broken (the memory-sync-markdown command can fix this), older Markdown entries may not appear in search. The `/memory-sync-markdown` command backfills them.
110
+
111
+ ## Verification
112
+
113
+ Before relying on memory_search:
114
+
115
+ - [ ] Check if the SQLite sync is healthy (`/memory-insights` shows recent entries)
116
+ - [ ] If search returns nothing but you KNOW the info was saved, run `/memory-sync-markdown`
117
+ - [ ] Use both `memory_search` AND `vcc_recall` in Guard phases for dual coverage
118
+ - [ ] When saving a failure, include: what was tried, why it failed, the error message, reproduction steps