@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.
- package/README.md +2 -1
- package/dist/index.js +202 -4
- package/dist/template/.pi/README.md +29 -8
- package/dist/template/.pi/VERSION +1 -1
- package/dist/template/.pi/agents/general.md +1 -1
- package/dist/template/.pi/agents/review.md +1 -1
- package/dist/template/.pi/extensions/templates-injector.ts +1 -1
- package/dist/template/.pi/packages.json +13 -0
- package/dist/template/.pi/prompts/audit.md +4 -1
- package/dist/template/.pi/prompts/create.md +1 -0
- package/dist/template/.pi/prompts/fix.md +7 -1
- package/dist/template/.pi/prompts/gc.md +3 -0
- package/dist/template/.pi/prompts/init.md +3 -0
- package/dist/template/.pi/prompts/plan.md +5 -2
- package/dist/template/.pi/prompts/research.md +3 -0
- package/dist/template/.pi/prompts/ship.md +7 -1
- package/dist/template/.pi/prompts/verify.md +4 -1
- package/dist/template/.pi/skills/INDEX.md +49 -12
- package/dist/template/.pi/skills/accessibility-audit/SKILL.md +8 -2
- package/dist/template/.pi/skills/baseline-ui/SKILL.md +211 -0
- package/dist/template/.pi/skills/dcp-hygiene/SKILL.md +106 -0
- package/dist/template/.pi/skills/design-taste-frontend/SKILL.md +53 -42
- package/dist/template/.pi/skills/fixing-accessibility/SKILL.md +509 -0
- package/dist/template/.pi/skills/frontend-design/SKILL.md +59 -46
- package/dist/template/.pi/skills/frontend-ui-engineering/SKILL.md +21 -27
- package/dist/template/.pi/skills/memory-system/SKILL.md +118 -0
- package/dist/template/.pi/skills/oklch-color-workflow/SKILL.md +426 -0
- package/dist/template/.pi/skills/production-hardening/SKILL.md +652 -0
- package/dist/template/.pi/skills/ui-craft-principles/SKILL.md +564 -0
- package/dist/template/.pi/skills/ui-quality-audit/SKILL.md +329 -0
- package/dist/template/.pi/templates/DESIGN.md +76 -0
- package/dist/template/.pi/workflows/INDEX.md +2 -1
- package/dist/template/.pi/workflows/frontend-feature-workflow.md +343 -0
- package/dist/template/.pi/workflows/quality-loop.md +3 -1
- package/package.json +1 -1
- /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: `
|
|
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
|
-
##
|
|
83
|
-
|
|
84
|
-
These patterns immediately signal "AI made this." Avoid them all.
|
|
95
|
+
## Don't
|
|
85
96
|
|
|
86
97
|
### Typography
|
|
87
98
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
-
|
|
122
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
- [ ]
|
|
257
|
-
- [ ]
|
|
258
|
-
- [ ]
|
|
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
|
-
- [ ]
|
|
261
|
-
- [ ]
|
|
262
|
-
- [ ] No
|
|
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
|
|
34
|
-
| `design
|
|
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
|
-
| `
|
|
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
|
-
| `
|
|
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
|
|
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
|
|
106
|
+
### Avoid Common Visual Anti-Patterns
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
These patterns degrade implementation quality. For design-level aesthetic rules, see `design-taste-frontend`.
|
|
108
109
|
|
|
109
|
-
|
|
|
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
|
-
##
|
|
189
|
+
## Don't
|
|
189
190
|
|
|
190
|
-
|
|
|
191
|
-
|
|
192
|
-
|
|
|
193
|
-
|
|
|
194
|
-
|
|
|
195
|
-
|
|
|
196
|
-
|
|
|
197
|
-
|
|
198
|
-
|
|
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
|