@fro.bot/systematic 2.3.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +12 -13
  2. package/agents/design/design-implementation-reviewer.md +2 -19
  3. package/agents/design/design-iterator.md +2 -31
  4. package/agents/design/figma-design-sync.md +2 -22
  5. package/agents/docs/ankane-readme-writer.md +2 -19
  6. package/agents/document-review/adversarial-document-reviewer.md +3 -2
  7. package/agents/document-review/coherence-reviewer.md +5 -7
  8. package/agents/document-review/design-lens-reviewer.md +3 -4
  9. package/agents/document-review/feasibility-reviewer.md +3 -4
  10. package/agents/document-review/product-lens-reviewer.md +25 -6
  11. package/agents/document-review/scope-guardian-reviewer.md +3 -4
  12. package/agents/document-review/security-lens-reviewer.md +3 -4
  13. package/agents/research/best-practices-researcher.md +4 -21
  14. package/agents/research/framework-docs-researcher.md +2 -19
  15. package/agents/research/git-history-analyzer.md +2 -19
  16. package/agents/research/issue-intelligence-analyst.md +2 -24
  17. package/agents/research/learnings-researcher.md +7 -28
  18. package/agents/research/repo-research-analyst.md +3 -32
  19. package/agents/research/slack-researcher.md +128 -0
  20. package/agents/review/agent-native-reviewer.md +109 -195
  21. package/agents/review/architecture-strategist.md +3 -19
  22. package/agents/review/cli-agent-readiness-reviewer.md +1 -27
  23. package/agents/review/code-simplicity-reviewer.md +5 -19
  24. package/agents/review/data-integrity-guardian.md +3 -19
  25. package/agents/review/data-migration-expert.md +3 -19
  26. package/agents/review/deployment-verification-agent.md +3 -19
  27. package/agents/review/pattern-recognition-specialist.md +4 -20
  28. package/agents/review/performance-oracle.md +3 -31
  29. package/agents/review/project-standards-reviewer.md +5 -5
  30. package/agents/review/schema-drift-detector.md +3 -19
  31. package/agents/review/security-sentinel.md +3 -25
  32. package/agents/review/testing-reviewer.md +3 -3
  33. package/agents/workflow/pr-comment-resolver.md +54 -22
  34. package/agents/workflow/spec-flow-analyzer.md +2 -25
  35. package/package.json +1 -1
  36. package/skills/agent-native-architecture/SKILL.md +28 -27
  37. package/skills/agent-native-architecture/references/agent-execution-patterns.md +3 -3
  38. package/skills/agent-native-architecture/references/agent-native-testing.md +1 -1
  39. package/skills/agent-native-architecture/references/mobile-patterns.md +1 -1
  40. package/skills/andrew-kane-gem-writer/SKILL.md +5 -5
  41. package/skills/ce-brainstorm/SKILL.md +43 -181
  42. package/skills/ce-compound/SKILL.md +143 -89
  43. package/skills/ce-compound-refresh/SKILL.md +48 -5
  44. package/skills/ce-ideate/SKILL.md +27 -242
  45. package/skills/ce-plan/SKILL.md +165 -81
  46. package/skills/ce-review/SKILL.md +348 -125
  47. package/skills/ce-review/references/findings-schema.json +5 -0
  48. package/skills/ce-review/references/persona-catalog.md +2 -2
  49. package/skills/ce-review/references/resolve-base.sh +5 -2
  50. package/skills/ce-review/references/subagent-template.md +25 -3
  51. package/skills/ce-work/SKILL.md +95 -242
  52. package/skills/ce-work-beta/SKILL.md +154 -301
  53. package/skills/dhh-rails-style/SKILL.md +13 -12
  54. package/skills/document-review/SKILL.md +56 -109
  55. package/skills/document-review/references/findings-schema.json +0 -23
  56. package/skills/document-review/references/subagent-template.md +13 -18
  57. package/skills/dspy-ruby/SKILL.md +8 -8
  58. package/skills/every-style-editor/SKILL.md +3 -2
  59. package/skills/frontend-design/SKILL.md +2 -3
  60. package/skills/git-commit/SKILL.md +1 -1
  61. package/skills/git-commit-push-pr/SKILL.md +81 -265
  62. package/skills/git-worktree/SKILL.md +20 -21
  63. package/skills/lfg/SKILL.md +10 -17
  64. package/skills/onboarding/SKILL.md +2 -2
  65. package/skills/onboarding/scripts/inventory.mjs +31 -7
  66. package/skills/proof/SKILL.md +134 -28
  67. package/skills/resolve-pr-feedback/SKILL.md +7 -2
  68. package/skills/setup/SKILL.md +1 -1
  69. package/skills/test-browser/SKILL.md +10 -11
  70. package/skills/test-xcode/SKILL.md +6 -3
  71. package/dist/lib/manifest.d.ts +0 -39
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ce:compound
3
3
  description: Document a recently solved problem to compound your team's knowledge
4
- argument-hint: '[optional: brief context about the fix]'
5
4
  ---
6
5
 
7
6
  # /compound
@@ -21,28 +20,49 @@ Captures problem solutions while context is fresh, creating structured documenta
21
20
  /ce:compound [brief context] # Provide additional context hint
22
21
  ```
23
22
 
23
+ ## Support Files
24
+
25
+ These files are the durable contract for the workflow. Read them on-demand at the step that needs them — do not bulk-load at skill start.
26
+
27
+ - `references/schema.yaml` — canonical frontmatter fields and enum values (read when validating YAML)
28
+ - `references/yaml-schema.md` — category mapping from problem_type to directory (read when classifying)
29
+ - `assets/resolution-template.md` — section structure for new docs (read when assembling)
30
+
31
+ When spawning subagents, pass the relevant file contents into the task prompt so they have the contract without needing cross-skill paths.
32
+
24
33
  ## Execution Strategy
25
34
 
26
- **Always run full mode by default.** Proceed directly to Phase 1 unless the user explicitly requests compact-safe mode (e.g., `/ce:compound --compact` or "use compact mode").
35
+ Present the user with two options before proceeding, using the platform's blocking question tool (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, present the options and wait for the user's reply.
36
+
37
+ ```
38
+ 1. Full (recommended) — the complete compound workflow. Researches,
39
+ cross-references, and reviews your solution to produce documentation
40
+ that compounds your team's knowledge.
41
+
42
+ 2. Lightweight — same documentation, single pass. Faster and uses
43
+ fewer tokens, but won't detect duplicates or cross-reference
44
+ existing docs. Best for simple fixes or long sessions nearing
45
+ context limits.
46
+ ```
27
47
 
28
- Compact-safe mode exists as a lightweight alternative see the **Compact-Safe Mode** section below. It's there if the user wants it, not something to push.
48
+ Do NOT pre-select a mode. Do NOT skip this prompt. Wait for the user's choice before proceeding.
29
49
 
30
50
  ---
31
51
 
32
52
  ### Full Mode
33
53
 
34
54
  <critical_requirement>
35
- **Only ONE file gets written - the final documentation.**
55
+ **The primary output is ONE file - the final documentation.**
36
56
 
37
- Phase 1 subagents return TEXT DATA to the orchestrator. They must NOT use Write, Edit, or create any files. Only the orchestrator (Phase 2) writes the final documentation file.
57
+ Phase 1 subagents return TEXT DATA to the orchestrator. They must NOT use Write, Edit, or create any files. Only the orchestrator writes files: the solution doc in Phase 2, and — if the Discoverability Check finds a gap — a small edit to a project instruction file (AGENTS.md). The instruction-file edit is maintenance, not a second deliverable; it ensures future agents can discover the knowledge store.
38
58
  </critical_requirement>
39
59
 
40
60
  ### Phase 0.5: Auto Memory Scan
41
61
 
42
- Before launching Phase 1 subagents, check the auto memory directory for notes relevant to the problem being documented.
62
+ Before launching Phase 1 subagents, check the auto-memory block injected into your system prompt for notes relevant to the problem being documented.
43
63
 
44
- 1. Read MEMORY.md from the auto memory directory (the path is known from the system prompt context)
45
- 2. If the directory or MEMORY.md does not exist, is empty, or is unreadable, skip this step and proceed to Phase 1 unchanged
64
+ 1. Look for a block labeled "user's auto-memory" (OpenCode only) already present in your system prompt context — MEMORY.md's entries are inlined there
65
+ 2. If the block is absent, empty, or this is a non-Claude-Code platform, skip this step and proceed to Phase 1 unchanged
46
66
  3. Scan the entries for anything related to the problem being documented -- use semantic judgment, not keyword matching
47
67
  4. If relevant entries are found, prepare a labeled excerpt block:
48
68
 
@@ -58,57 +78,34 @@ and codebase findings take priority over these notes.
58
78
 
59
79
  If no relevant entries are found, proceed to Phase 1 without passing memory context.
60
80
 
61
- ### Phase 1: Parallel Research
81
+ ### Phase 1: Research
62
82
 
63
- <parallel_tasks>
83
+ Launch research subagents. Each returns text data to the orchestrator.
84
+
85
+ **Dispatch order:** launch `Context Analyzer`, `Solution Extractor`, and `Related Docs Finder` in parallel (background).
64
86
 
65
- Launch these subagents IN PARALLEL. Each returns text data to the orchestrator.
87
+ <parallel_tasks>
66
88
 
67
89
  #### 1. **Context Analyzer**
68
90
  - Extracts conversation history
69
- - Identifies problem type, component, symptoms
70
- - Incorporates auto memory excerpts (if provided by the orchestrator) as supplementary evidence when identifying problem type, component, and symptoms
71
- - Validates all enum fields against the schema values below
72
- - Maps problem_type to the `docs/solutions/` category directory
91
+ - Reads `references/schema.yaml` for enum validation and **track classification**
92
+ - Determines the track (bug or knowledge) from the problem_type
93
+ - Identifies problem type, component, and track-appropriate fields:
94
+ - **Bug track**: symptoms, root_cause, resolution_type
95
+ - **Knowledge track**: applies_when (symptoms/root_cause/resolution_type optional)
96
+ - Incorporates auto memory excerpts (if provided by the orchestrator) as supplementary evidence
97
+ - Reads `references/yaml-schema.md` for category mapping into `docs/solutions/`
73
98
  - Suggests a filename using the pattern `[sanitized-problem-slug]-[date].md`
74
- - Returns: YAML frontmatter skeleton (must include `category:` field mapped from problem_type), category directory path, and suggested filename
75
-
76
- **Schema enum values (validate against these exactly):**
77
-
78
- - **problem_type**: build_error, test_failure, runtime_error, performance_issue, database_issue, security_issue, ui_bug, integration_issue, logic_error, developer_experience, workflow_issue, best_practice, documentation_gap
79
- - **component**: rails_model, rails_controller, rails_view, service_object, background_job, database, frontend_stimulus, hotwire_turbo, email_processing, brief_system, assistant, authentication, payments, development_workflow, testing_framework, documentation, tooling
80
- - **root_cause**: missing_association, missing_include, missing_index, wrong_api, scope_issue, thread_violation, async_timing, memory_leak, config_error, logic_error, test_isolation, missing_validation, missing_permission, missing_workflow_step, inadequate_documentation, missing_tooling, incomplete_setup
81
- - **resolution_type**: code_fix, migration, config_change, test_fix, dependency_update, environment_setup, workflow_improvement, documentation_update, tooling_addition, seed_data_update
82
- - **severity**: critical, high, medium, low
83
-
84
- **Category mapping (problem_type -> directory):**
85
-
86
- | problem_type | Directory |
87
- |---|---|
88
- | build_error | build-errors/ |
89
- | test_failure | test-failures/ |
90
- | runtime_error | runtime-errors/ |
91
- | performance_issue | performance-issues/ |
92
- | database_issue | database-issues/ |
93
- | security_issue | security-issues/ |
94
- | ui_bug | ui-bugs/ |
95
- | integration_issue | integration-issues/ |
96
- | logic_error | logic-errors/ |
97
- | developer_experience | developer-experience/ |
98
- | workflow_issue | workflow-issues/ |
99
- | best_practice | best-practices/ |
100
- | documentation_gap | documentation-gaps/ |
99
+ - Returns: YAML frontmatter skeleton (must include `category:` field mapped from problem_type), category directory path, suggested filename, and which track applies
100
+ - Does not invent enum values, categories, or frontmatter fields from memory; reads the schema and mapping files above
101
+ - Does not force bug-track fields onto knowledge-track learnings or vice versa
101
102
 
102
103
  #### 2. **Solution Extractor**
103
- - Analyzes all investigation steps
104
- - Identifies root cause
105
- - Extracts working solution with code examples
104
+ - Reads `references/schema.yaml` for track classification (bug vs knowledge)
105
+ - Adapts output structure based on the problem_type track
106
106
  - Incorporates auto memory excerpts (if provided by the orchestrator) as supplementary evidence -- conversation history and the verified fix take priority; if memory notes contradict the conversation, note the contradiction as cautionary context
107
- - Develops prevention strategies and best practices guidance
108
- - Generates test cases if applicable
109
- - Returns: Solution content block including prevention section
110
107
 
111
- **Expected output sections (follow this structure):**
108
+ **Bug track output sections:**
112
109
 
113
110
  - **Problem**: 1-2 sentence description of the issue
114
111
  - **Symptoms**: Observable symptoms (error messages, behavior)
@@ -117,6 +114,14 @@ Launch these subagents IN PARALLEL. Each returns text data to the orchestrator.
117
114
  - **Why This Works**: Root cause explanation and why the solution addresses it
118
115
  - **Prevention**: Strategies to avoid recurrence, best practices, and test cases. Include concrete code examples where applicable (e.g., gem configurations, test assertions, linting rules)
119
116
 
117
+ **Knowledge track output sections:**
118
+
119
+ - **Context**: What situation, gap, or friction prompted this guidance
120
+ - **Guidance**: The practice, pattern, or recommendation with code examples when useful
121
+ - **Why This Matters**: Rationale and impact of following or not following this guidance
122
+ - **When to Apply**: Conditions or situations where this applies
123
+ - **Examples**: Concrete before/after or usage examples showing the practice in action
124
+
120
125
  #### 3. **Related Docs Finder**
121
126
  - Searches `docs/solutions/` for related documentation
122
127
  - Identifies cross-references and links
@@ -169,11 +174,13 @@ The orchestrating agent (main conversation) performs these steps:
169
174
 
170
175
  When updating an existing doc, preserve its file path and frontmatter structure. Update the solution, code examples, prevention tips, and any stale references. Add a `last_updated: YYYY-MM-DD` field to the frontmatter. Do not change the title unless the problem framing has materially shifted.
171
176
 
172
- 3. Assemble complete markdown file from the collected pieces
173
- 4. Validate YAML frontmatter against schema
177
+ 3. Assemble complete markdown file from the collected pieces, reading `assets/resolution-template.md` for the section structure of new docs
178
+ 4. Validate YAML frontmatter against `references/schema.yaml`
174
179
  5. Create directory if needed: `mkdir -p docs/solutions/[category]/`
175
180
  6. Write the file: either the updated existing doc or the new `docs/solutions/[category]/[filename].md`
176
181
 
182
+ When creating a new doc, preserve the section order from `assets/resolution-template.md` unless the user explicitly asks for a different structure.
183
+
177
184
  </sequential_tasks>
178
185
 
179
186
  ### Phase 2.5: Selective Refresh Check
@@ -202,7 +209,7 @@ Use these rules:
202
209
 
203
210
  - If there is **one obvious stale candidate**, invoke `ce:compound-refresh` with a narrow scope hint after the new learning is written
204
211
  - If there are **multiple candidates in the same area**, ask the user whether to run a targeted refresh for that module, category, or pattern set
205
- - If context is already tight or you are in compact-safe mode, do not expand into a broad refresh automatically; instead recommend `ce:compound-refresh` as the next step with a scope hint
212
+ - If context is already tight or you are in lightweight mode, do not expand into a broad refresh automatically; instead recommend `ce:compound-refresh` as the next step with a scope hint
206
213
 
207
214
  When invoking or recommending `ce:compound-refresh`, be explicit about the argument to pass. Prefer the narrowest useful scope:
208
215
 
@@ -224,6 +231,40 @@ Do not invoke `ce:compound-refresh` without an argument unless the user explicit
224
231
 
225
232
  Always capture the new learning first. Refresh is a targeted maintenance follow-up, not a prerequisite for documentation.
226
233
 
234
+ ### Discoverability Check
235
+
236
+ After the learning is written and the refresh decision is made, check whether the project's instruction files would lead an agent to discover and search `docs/solutions/` before starting work in a documented area. This runs every time — the knowledge store only compounds value when agents can find it.
237
+
238
+ 1. Identify whether a root-level `AGENTS.md` exists. Read it to determine whether it holds substantive content or is just a shim that `@`-includes another file; treat the substantive file as the assessment and edit target and ignore shims. If no `AGENTS.md` exists, skip this check entirely.
239
+ 2. Assess whether an agent reading the instruction files would learn three things:
240
+ - That a searchable knowledge store of documented solutions exists
241
+ - Enough about its structure to search effectively (category organization, YAML frontmatter fields like `module`, `tags`, `problem_type`)
242
+ - When to search it (before implementing features, debugging issues, or making decisions in documented areas — learnings may cover bugs, best practices, workflow patterns, or other institutional knowledge)
243
+
244
+ This is a semantic assessment, not a string match. The information could be a line in an architecture section, a bullet in a gotchas section, spread across multiple places, or expressed without ever using the exact path `docs/solutions/`. Use judgment — if an agent would reasonably discover and use the knowledge store after reading the file, the check passes.
245
+
246
+ 3. If the spirit is already met, no action needed — move on.
247
+ 4. If not:
248
+ a. Based on the file's existing structure, tone, and density, identify where a mention fits naturally. Before creating a new section, check whether the information could be a single line in the closest related section — an architecture tree, a directory listing, a documentation section, or a conventions block. A line added to an existing section is almost always better than a new headed section. Only add a new section as a last resort when the file has clear sectioned structure and nothing is even remotely related.
249
+ b. Draft the smallest addition that communicates the three things. Match the file's existing style and density. The addition should describe the knowledge store itself, not the plugin — an agent without the plugin should still find value in it.
250
+
251
+ Keep the tone informational, not imperative. Express timing as description, not instruction — "relevant when implementing or debugging in documented areas" rather than "check before implementing or debugging." Imperative directives like "always search before implementing" cause redundant reads when a workflow already includes a dedicated search step. The goal is awareness: agents learn the folder exists and what's in it, then use their own judgment about when to consult it.
252
+
253
+ Examples of calibration (not templates — adapt to the file):
254
+
255
+ When there's an existing directory listing or architecture section — add a line:
256
+ ```
257
+ docs/solutions/ # documented solutions to past problems (bugs, best practices, workflow patterns), organized by category with YAML frontmatter (module, tags, problem_type)
258
+ ```
259
+
260
+ When nothing in the file is a natural fit — a small headed section is appropriate:
261
+ ```
262
+ ## Documented Solutions
263
+
264
+ `docs/solutions/` — documented solutions to past problems (bugs, best practices, workflow patterns), organized by category with YAML frontmatter (`module`, `tags`, `problem_type`). Relevant when implementing or debugging in documented areas.
265
+ ```
266
+ c. In full mode, explain to the user why this matters — agents working in this repo (including fresh sessions, other tools, or collaborators without the plugin) won't know to check `docs/solutions/` unless the instruction file surfaces it. Show the proposed change and where it would go, then use the platform's blocking question tool (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini) to get consent before making the edit. If no question tool is available, present the proposal and wait for the user's reply. In lightweight mode, output a one-liner note and move on
267
+
227
268
  ### Phase 3: Optional Enhancement
228
269
 
229
270
  **WAIT for Phase 2 to complete before proceeding.**
@@ -232,51 +273,56 @@ Always capture the new learning first. Refresh is a targeted maintenance follow-
232
273
 
233
274
  Based on problem type, optionally invoke specialized agents to review the documentation:
234
275
 
235
- - **performance_issue** → `performance-oracle`
236
- - **security_issue** → `security-sentinel`
237
- - **database_issue** → `data-integrity-guardian`
238
- - **test_failure** → `cora-test-reviewer`
239
- - Any code-heavy issue `kieran-rails-reviewer` + `code-simplicity-reviewer`
276
+ - **performance_issue** → `systematic:review:performance-oracle`
277
+ - **security_issue** → `systematic:review:security-sentinel`
278
+ - **database_issue** → `systematic:review:data-integrity-guardian`
279
+ - Any code-heavy issue always run `systematic:review:code-simplicity-reviewer`, and additionally run the kieran reviewer that matches the repo's primary stack:
280
+ - Ruby/Rails also run `systematic:review:kieran-rails-reviewer`
281
+ - Python → also run `systematic:review:kieran-python-reviewer`
282
+ - TypeScript/JavaScript → also run `systematic:review:kieran-typescript-reviewer`
283
+ - Other stacks → no kieran reviewer needed
240
284
 
241
285
  </parallel_tasks>
242
286
 
243
287
  ---
244
288
 
245
- ### Compact-Safe Mode
289
+ ### Lightweight Mode
246
290
 
247
291
  <critical_requirement>
248
- **Single-pass alternative for context-constrained sessions.**
292
+ **Single-pass alternative same documentation, fewer tokens.**
249
293
 
250
- When context budget is tight, this mode skips parallel subagents entirely. The orchestrator performs all work in a single pass, producing a minimal but complete solution document.
294
+ This mode skips parallel subagents entirely. The orchestrator performs all work in a single pass, producing the same solution document without cross-referencing or duplicate detection.
251
295
  </critical_requirement>
252
296
 
253
297
  The orchestrator (main conversation) performs ALL of the following in one sequential pass:
254
298
 
255
- 1. **Extract from conversation**: Identify the problem, root cause, and solution from conversation history. Also read MEMORY.md from the auto memory directory if it exists -- use any relevant notes as supplementary context alongside conversation history. Tag any memory-sourced content incorporated into the final doc with "(auto memory [claude])"
256
- 2. **Classify**: Determine category and filename (same categories as full mode)
257
- 3. **Write minimal doc**: Create `docs/solutions/[category]/[filename].md` with:
258
- - YAML frontmatter (title, category, date, tags)
259
- - Problem description (1-2 sentences)
260
- - Root cause (1-2 sentences)
261
- - Solution with key code snippets
262
- - One prevention tip
299
+ 1. **Extract from conversation**: Identify the problem and solution from conversation history. Also scan the "user's auto-memory" block injected into your system prompt, if present (OpenCode only) -- use any relevant notes as supplementary context alongside conversation history. Tag any memory-sourced content incorporated into the final doc with "(auto memory [claude])"
300
+ 2. **Classify**: Read `references/schema.yaml` and `references/yaml-schema.md`, then determine track (bug vs knowledge), category, and filename
301
+ 3. **Write minimal doc**: Create `docs/solutions/[category]/[filename].md` using the appropriate track template from `assets/resolution-template.md`, with:
302
+ - YAML frontmatter with track-appropriate fields
303
+ - Bug track: Problem, root cause, solution with key code snippets, one prevention tip
304
+ - Knowledge track: Context, guidance with key examples, one applicability note
263
305
  4. **Skip specialized agent reviews** (Phase 3) to conserve context
264
306
 
265
- **Compact-safe output:**
307
+ **Lightweight output:**
266
308
  ```
267
- ✓ Documentation complete (compact-safe mode)
309
+ ✓ Documentation complete (lightweight mode)
268
310
 
269
311
  File created:
270
312
  - docs/solutions/[category]/[filename].md
271
313
 
272
- Note: This was created in compact-safe mode. For richer documentation
314
+ [If discoverability check found instruction files don't surface the knowledge store:]
315
+ Tip: Your AGENTS.md doesn't surface docs/solutions/ to agents —
316
+ a brief mention helps all agents discover these learnings.
317
+
318
+ Note: This was created in lightweight mode. For richer documentation
273
319
  (cross-references, detailed prevention strategies, specialized reviews),
274
320
  re-run /compound in a fresh session.
275
321
  ```
276
322
 
277
323
  **No subagents are launched. No parallel tasks. One file written.**
278
324
 
279
- In compact-safe mode, the overlap check is skipped (no Related Docs Finder subagent). This means compact-safe mode may create a doc that overlaps with an existing one. That is acceptable — `ce:compound-refresh` will catch it later. Only suggest `ce:compound-refresh` if there is an obvious narrow refresh target. Do not broaden into a large refresh sweep from a compact-safe session.
325
+ In lightweight mode, the overlap check is skipped (no Related Docs Finder subagent). This means lightweight mode may create a doc that overlaps with an existing one. That is acceptable — `ce:compound-refresh` will catch it later. Only suggest `ce:compound-refresh` if there is an obvious narrow refresh target. Do not broaden into a large refresh sweep from a lightweight session.
280
326
 
281
327
  ---
282
328
 
@@ -311,6 +357,7 @@ In compact-safe mode, the overlap check is skipped (no Related Docs Finder subag
311
357
 
312
358
  **Categories auto-detected from problem:**
313
359
 
360
+ Bug track:
314
361
  - build-errors/
315
362
  - test-failures/
316
363
  - runtime-errors/
@@ -321,13 +368,19 @@ In compact-safe mode, the overlap check is skipped (no Related Docs Finder subag
321
368
  - integration-issues/
322
369
  - logic-errors/
323
370
 
371
+ Knowledge track:
372
+ - best-practices/
373
+ - workflow-issues/
374
+ - developer-experience/
375
+ - documentation-gaps/
376
+
324
377
  ## Common Mistakes to Avoid
325
378
 
326
379
  | ❌ Wrong | ✅ Correct |
327
380
  |----------|-----------|
328
381
  | Subagents write files like `context-analysis.md`, `solution-draft.md` | Subagents return text data; orchestrator writes one final file |
329
382
  | Research and assembly run in parallel | Research completes → then assembly runs |
330
- | Multiple files created during workflow | One file written or updated: `docs/solutions/[category]/[filename].md` |
383
+ | Multiple files created during workflow | One solution doc written or updated: `docs/solutions/[category]/[filename].md` (plus an optional small edit to a project instruction file for discoverability) |
331
384
  | Creating a new doc when an existing doc covers the same problem | Check overlap assessment; update the existing doc when overlap is high |
332
385
 
333
386
  ## Success Output
@@ -341,12 +394,12 @@ Subagent Results:
341
394
  ✓ Context Analyzer: Identified performance_issue in brief_system, category: performance-issues/
342
395
  ✓ Solution Extractor: 3 code fixes, prevention strategies
343
396
  ✓ Related Docs Finder: 2 related issues
397
+ ✓ Session History: 3 prior sessions on same branch, 2 failed approaches surfaced
344
398
 
345
399
  Specialized Agent Reviews (Auto-Triggered):
346
400
  ✓ performance-oracle: Validated query optimization approach
347
- ✓ kieran-rails-reviewer: Code examples meet Rails standards
401
+ ✓ kieran-rails-reviewer: Code examples meet Rails conventions
348
402
  ✓ code-simplicity-reviewer: Solution is appropriately minimal
349
- ✓ every-style-editor: Documentation style verified
350
403
 
351
404
  File created:
352
405
  - docs/solutions/performance-issues/n-plus-one-brief-generation.md
@@ -362,6 +415,8 @@ What's next?
362
415
  5. Other
363
416
  ```
364
417
 
418
+ **After displaying the success output, present the "What's next?" options using the platform's blocking question tool** (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini). If no question tool is available, present the numbered options and wait for the user's reply before proceeding. Do not continue the workflow or end the turn without the user's selection.
419
+
365
420
  **Alternate output (when updating an existing doc due to high overlap):**
366
421
 
367
422
  ```
@@ -400,29 +455,29 @@ Build → Test → Find Issue → Research → Improve → Document → Validate
400
455
 
401
456
  <manual_override> Use /ce:compound [context] to document immediately without waiting for auto-detection. </manual_override> </auto_invoke>
402
457
 
403
- ## Routes To
458
+ ## Output
404
459
 
405
- `compound-docs` skill
460
+ Writes the final learning directly into `docs/solutions/`.
406
461
 
407
462
  ## Applicable Specialized Agents
408
463
 
409
464
  Based on problem type, these agents can enhance documentation:
410
465
 
411
466
  ### Code Quality & Review
412
- - **kieran-rails-reviewer**: Reviews code examples for Rails best practices
413
- - **code-simplicity-reviewer**: Ensures solution code is minimal and clear
414
- - **pattern-recognition-specialist**: Identifies anti-patterns or repeating issues
467
+ - **systematic:review:kieran-rails-reviewer**: Reviews code examples for Rails best practices
468
+ - **systematic:review:kieran-python-reviewer**: Reviews code examples for Python best practices
469
+ - **systematic:review:kieran-typescript-reviewer**: Reviews code examples for TypeScript best practices
470
+ - **systematic:review:code-simplicity-reviewer**: Ensures solution code is minimal and clear
471
+ - **systematic:review:pattern-recognition-specialist**: Identifies anti-patterns or repeating issues
415
472
 
416
473
  ### Specific Domain Experts
417
- - **performance-oracle**: Analyzes performance_issue category solutions
418
- - **security-sentinel**: Reviews security_issue solutions for vulnerabilities
419
- - **cora-test-reviewer**: Creates test cases for prevention strategies
420
- - **data-integrity-guardian**: Reviews database_issue migrations and queries
474
+ - **systematic:review:performance-oracle**: Analyzes performance_issue category solutions
475
+ - **systematic:review:security-sentinel**: Reviews security_issue solutions for vulnerabilities
476
+ - **systematic:review:data-integrity-guardian**: Reviews database_issue migrations and queries
421
477
 
422
- ### Enhancement & Documentation
423
- - **best-practices-researcher**: Enriches solution with industry best practices
424
- - **every-style-editor**: Reviews documentation style and clarity
425
- - **framework-docs-researcher**: Links to Rails/gem documentation references
478
+ ### Enhancement & Research
479
+ - **systematic:research:best-practices-researcher**: Enriches solution with industry best practices
480
+ - **systematic:research:framework-docs-researcher**: Links to framework/library documentation references
426
481
 
427
482
  ### When to Invoke
428
483
  - **Auto-triggered** (optional): Agents can run post-documentation for enhancement
@@ -432,4 +487,3 @@ Based on problem type, these agents can enhance documentation:
432
487
 
433
488
  - `/research [topic]` - Deep investigation (searches docs/solutions/ for patterns)
434
489
  - `/ce:plan` - Planning workflow (references documented solutions)
435
-
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ce:compound-refresh
3
3
  description: Refresh stale or drifting learnings and pattern docs in docs/solutions/ by reviewing, updating, consolidating, replacing, or deleting them against the current codebase. Use after refactors, migrations, dependency upgrades, or when a retrieved learning feels outdated or wrong. Also use when reviewing docs/solutions/ for accuracy, when a recently solved problem contradicts an existing learning, when pattern docs no longer reflect current code, or when multiple docs seem to cover the same topic and might benefit from consolidation.
4
- argument-hint: '[mode:autofix] [optional: scope hint]'
5
4
  disable-model-invocation: true
6
5
  ---
7
6
 
@@ -164,7 +163,7 @@ A learning has several dimensions that can independently go stale. Surface-level
164
163
  - **Recommended solution** — does the fix still match how the code actually works today? A renamed file with a completely different implementation pattern is not just a path update.
165
164
  - **Code examples** — if the learning includes code snippets, do they still reflect the current implementation?
166
165
  - **Related docs** — are cross-referenced learnings and patterns still present and consistent?
167
- - **Auto memory** — does the auto memory directory contain notes in the same problem domain? Read MEMORY.md from the auto memory directory (the path is known from the system prompt context). If it does not exist or is empty, skip this dimension. A memory note describing a different approach than what the learning recommends is a supplementary drift signal.
166
+ - **Auto memory** (OpenCode only) — does the injected auto-memory block in your system prompt contain entries in the same problem domain? Scan that block directly. If the block is absent, skip this dimension. A memory note describing a different approach than what the learning recommends is a supplementary drift signal.
168
167
  - **Overlap** — while investigating, note when another doc in scope covers the same problem domain, references the same files, or recommends a similar solution. For each overlap, record: the two file paths, which dimensions overlap (problem, solution, root cause, files, prevention), and which doc appears broader or more current. These signals feed Phase 1.75 (Document-Set Analysis).
169
168
 
170
169
  Match investigation depth to the learning's specificity — a learning referencing exact file paths and code snippets needs more verification than one describing a general principle.
@@ -271,11 +270,11 @@ Use subagents for context isolation when investigating multiple artifacts — no
271
270
  | **Parallel subagents** | 3+ truly independent artifacts with low overlap |
272
271
  | **Batched subagents** | Broad sweeps — narrow scope first, then investigate in batches |
273
272
 
274
- **When spawning any subagent, include this instruction in its task prompt:**
273
+ **When spawning any subagent**, omit the `mode` parameter so the user's configured permission settings apply. Include this instruction in its task prompt:
275
274
 
276
275
  > Use dedicated file search and read tools (Glob, Grep, Read) for all investigation. Do NOT use shell commands (ls, find, cat, grep, test, bash) for file operations. This avoids permission prompts and is more reliable.
277
276
  >
278
- > Also read MEMORY.md from the auto memory directory if it exists. Check for notes related to the learning's problem domain. Report any memory-sourced drift signals separately from codebase-sourced evidence, tagged with "(auto memory [claude])" in the evidence section. If MEMORY.md does not exist or is empty, skip this check.
277
+ > Also scan the "user's auto-memory" block injected into your system prompt (OpenCode only). Check for notes related to the learning's problem domain. Report any memory-sourced drift signals separately from codebase-sourced evidence, tagged with "(auto memory [claude])" in the evidence section. If the block is not present in your context, skip this check.
279
278
 
280
279
  There are two subagent roles:
281
280
 
@@ -503,13 +502,22 @@ If a doc cluster has 3+ overlapping docs, process pairwise: consolidate the two
503
502
 
504
503
  Process Replace candidates **one at a time, sequentially**. Each replacement is written by a subagent to protect the main context window.
505
504
 
505
+ When a replacement is needed, read the documentation contract files and pass their contents into the replacement subagent's task prompt:
506
+
507
+ - `references/schema.yaml` — frontmatter fields and enum values
508
+ - `references/yaml-schema.md` — category mapping
509
+ - `assets/resolution-template.md` — section structure
510
+
511
+ Do not let replacement subagents invent frontmatter fields, enum values, or section order from memory.
512
+
506
513
  **When evidence is sufficient:**
507
514
 
508
515
  1. Spawn a single subagent to write the replacement learning. Pass it:
509
516
  - The old learning's full content
510
517
  - A summary of the investigation evidence (what changed, what the current code does, why the old guidance is misleading)
511
518
  - The target path and category (same category as the old learning unless the category itself changed)
512
- 2. The subagent writes the new learning following `ce:compound`'s document format: YAML frontmatter (title, category, date, module, component, tags), problem description, root cause, current solution with code examples, and prevention tips. It should use dedicated file search and read tools if it needs additional context beyond what was passed.
519
+ - The relevant contents of the three support files listed above
520
+ 2. The subagent writes the new learning using the support files as the source of truth: `references/schema.yaml` for frontmatter fields and enum values, `references/yaml-schema.md` for category mapping, and `assets/resolution-template.md` for section order. It should use dedicated file search and read tools if it needs additional context beyond what was passed.
513
521
  3. After the subagent completes, the orchestrator deletes the old learning file. The new learning's frontmatter may include `supersedes: [old learning filename]` for traceability, but this is optional — the git history and commit message provide the same information.
514
522
 
515
523
  **When evidence is insufficient:**
@@ -634,3 +642,38 @@ Use **Replace** only when the refresh process has enough real evidence to write
634
642
 
635
643
  Use **Consolidate** proactively when the document set has grown organically and redundancy has crept in. Every `ce:compound` invocation adds a new doc — over time, multiple docs may cover the same problem from slightly different angles. Periodic consolidation keeps the document set lean and authoritative.
636
644
 
645
+ ## Discoverability Check
646
+
647
+ After the refresh report is generated, check whether the project's instruction files would lead an agent to discover and search `docs/solutions/` before starting work in a documented area. This runs every time — the knowledge store only compounds value when agents can find it. If this check produces edits, they are committed as part of (or immediately after) the Phase 5 commit flow — see step 5 below.
648
+
649
+ 1. Identify whether a root-level `AGENTS.md` exists. Read it to determine whether it holds substantive content or is just a shim that `@`-includes another file; treat the substantive file as the assessment and edit target and ignore shims. If no `AGENTS.md` exists, skip this check entirely.
650
+ 2. Assess whether an agent reading the instruction files would learn three things:
651
+ - That a searchable knowledge store of documented solutions exists
652
+ - Enough about its structure to search effectively (category organization, YAML frontmatter fields like `module`, `tags`, `problem_type`)
653
+ - When to search it (before implementing features, debugging issues, or making decisions in documented areas — learnings may cover bugs, best practices, workflow patterns, or other institutional knowledge)
654
+
655
+ This is a semantic assessment, not a string match. The information could be a line in an architecture section, a bullet in a gotchas section, spread across multiple places, or expressed without ever using the exact path `docs/solutions/`. Use judgment — if an agent would reasonably discover and use the knowledge store after reading the file, the check passes.
656
+
657
+ 3. If the spirit is already met, no action needed.
658
+ 4. If not:
659
+ a. Based on the file's existing structure, tone, and density, identify where a mention fits naturally. Before creating a new section, check whether the information could be a single line in the closest related section — an architecture tree, a directory listing, a documentation section, or a conventions block. A line added to an existing section is almost always better than a new headed section. Only add a new section as a last resort when the file has clear sectioned structure and nothing is even remotely related.
660
+ b. Draft the smallest addition that communicates the three things. Match the file's existing style and density. The addition should describe the knowledge store itself, not the plugin.
661
+
662
+ Keep the tone informational, not imperative. Express timing as description, not instruction — "relevant when implementing or debugging in documented areas" rather than "check before implementing or debugging." Imperative directives like "always search before implementing" cause redundant reads when a workflow already includes a dedicated search step. The goal is awareness: agents learn the folder exists and what's in it, then use their own judgment about when to consult it.
663
+
664
+ Examples of calibration (not templates — adapt to the file):
665
+
666
+ When there's an existing directory listing or architecture section — add a line:
667
+ ```
668
+ docs/solutions/ # documented solutions to past problems (bugs, best practices, workflow patterns), organized by category with YAML frontmatter (module, tags, problem_type)
669
+ ```
670
+
671
+ When nothing in the file is a natural fit — a small headed section is appropriate:
672
+ ```
673
+ ## Documented Solutions
674
+
675
+ `docs/solutions/` — documented solutions to past problems (bugs, best practices, workflow patterns), organized by category with YAML frontmatter (`module`, `tags`, `problem_type`). Relevant when implementing or debugging in documented areas.
676
+ ```
677
+ c. In interactive mode, explain to the user why this matters — agents working in this repo (including fresh sessions, other tools, or collaborators without the plugin) won't know to check `docs/solutions/` unless the instruction file surfaces it. Show the proposed change and where it would go, then use the platform's blocking question tool (`question` in OpenCode, `request_user_input` in Codex, `ask_user` in Gemini) to get consent before making the edit. If no question tool is available, present the proposal and wait for the user's reply. In autofix mode, include it as a "Discoverability recommendation" line in the report — do not attempt to edit instruction files (autofix scope is doc maintenance, not project config).
678
+
679
+ 5. **Amend or create a follow-up commit when the check produces edits.** If step 4 resulted in an edit to an instruction file and Phase 5 already committed the refresh changes, stage the newly edited file and either amend the existing commit (if still on the same branch and no push has occurred) or create a small follow-up commit (e.g., `docs: add docs/solutions/ discoverability to AGENTS.md`). If Phase 5 already pushed the branch to a remote (e.g., the branch+PR path), push the follow-up commit as well so the open PR includes the discoverability change. This keeps the working tree clean and the remote in sync at the end of the run. If the user chose "Don't commit" in Phase 5, leave the instruction-file edit unstaged alongside the other uncommitted refresh changes — no separate commit logic needed.