appydave-tools 0.83.0 → 0.85.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.
@@ -0,0 +1,344 @@
1
+ # query_apps — App File Discovery Tool
2
+
3
+ **Purpose**: A new CLI tool in appydave-tools that returns file paths from any registered application, using pre-computed named glob patterns stored in each project's `context.globs.json`.
4
+
5
+ **Status**: Planning
6
+ **Created**: 2026-04-05
7
+ **Backlog**: B041
8
+
9
+ ---
10
+
11
+ ## Problem
12
+
13
+ When an LLM agent (or David) needs files from a project, they currently have to:
14
+ 1. Know the project's directory structure
15
+ 2. Manually construct glob patterns
16
+ 3. Hope the patterns are still valid as the project evolves
17
+
18
+ There's no way to say "give me the backend code from FliHub" or "get me all docs from AngelEye" without prior knowledge of each project's layout. `query_brain` solves this for brains, `query_omi` solves it for OMI transcripts — but there's nothing for applications.
19
+
20
+ ---
21
+
22
+ ## Design
23
+
24
+ ### Architecture — Same Pattern as BrainQuery and OmiQuery
25
+
26
+ ```
27
+ bin/query_apps.rb CLI entry point
28
+ lib/appydave/tools/
29
+ app_context/
30
+ app_finder.rb Core query engine (like BrainQuery, OmiQuery)
31
+ options.rb CLI option parsing
32
+ spec/appydave/tools/
33
+ app_context/
34
+ app_query_spec.rb Unit tests
35
+ options_spec.rb
36
+ ```
37
+
38
+ ### Data Flow
39
+
40
+ ```
41
+ locations.json → Find app path by key/alias/fuzzy match
42
+
43
+ context.globs.json → Read named glob patterns from project root
44
+
45
+ Glob expansion → Resolve patterns against actual filesystem
46
+
47
+ File paths (stdout) → One per line, pipe to llm_context
48
+ ```
49
+
50
+ ### The Sidecar File — `context.globs.json`
51
+
52
+ Generated by the `system-context` skill alongside `CONTEXT.md`. Lives in each project root.
53
+
54
+ ```json
55
+ {
56
+ "generated": "2026-04-05",
57
+ "generator": "system-context",
58
+ "project": "flihub",
59
+ "pattern": "rvets",
60
+ "globs": {
61
+ "docs": ["docs/**/*.md", "BACKLOG.md"],
62
+ "types": ["shared/**/*.ts"],
63
+ "config": ["server/config.json", "*.config.*", ".env.example"],
64
+ "server": ["server/src/**/*.ts"],
65
+ "client": ["client/src/**/*.tsx"],
66
+ "services": ["server/src/services/**/*.ts"],
67
+ "routes": ["server/src/routes/**/*.ts"],
68
+ "components": ["client/src/components/**/*.tsx"],
69
+ "views": ["client/src/views/**/*.tsx"],
70
+ "tests": ["**/*.test.ts", "**/*.spec.ts"],
71
+ "styles": ["**/*.css"],
72
+ "mockups": [".mochaccino/designs/**/*.html"],
73
+ "planning": ["docs/prd/**/*.md", "docs/planning/**/*.md"],
74
+ "context": ["CLAUDE.md", "CONTEXT.md", "STEERING.md"]
75
+ },
76
+ "aliases": {
77
+ "backend": ["services", "routes"],
78
+ "frontend": ["components", "views", "styles"],
79
+ "api": ["routes", "types"],
80
+ "data-layer": ["types", "schema"],
81
+ "react": ["components", "views"],
82
+ "ui": ["components", "views", "styles"]
83
+ },
84
+ "composites": {
85
+ "understand": ["context", "docs", "types", "config"],
86
+ "codebase": ["services", "routes", "components", "views"],
87
+ "all-code": ["server", "client"],
88
+ "full": ["*"]
89
+ }
90
+ }
91
+ ```
92
+
93
+ **Key design choices:**
94
+ - **Globs, not file lists** — durable as files are added/removed; only stale if project structure changes fundamentally
95
+ - **Named categories** — "docs", "services", "types" are human-friendly handles
96
+ - **Aliases** — "backend" → services + routes. Handles vague user intent
97
+ - **Composites** — "understand" → context + docs + types + config. Pre-built bundles for common queries
98
+ - **Pattern type** — "rvets", "nextjs", "ruby-gem", "python" enables cross-app queries by architecture
99
+
100
+ ### App Resolution — 4-Tier (Same as BrainQuery)
101
+
102
+ ```
103
+ 1. Exact key match: "flihub" → locations.json key
104
+ 2. Alias match: "hub" → locations.json aliases (future)
105
+ 3. Jump alias match: "jfli-hub" → locations.json jump field
106
+ 4. Substring/fuzzy: "fli" → partial match on key or description
107
+ ```
108
+
109
+ Source: `~/.config/appydave/locations.json` (the `context` field tells us if `context.globs.json` exists).
110
+
111
+ ### Glob Resolution — 3-Tier
112
+
113
+ When the user asks for `--glob backend`:
114
+
115
+ ```
116
+ 1. Direct glob name: "services" → globs.services
117
+ 2. Alias match: "backend" → aliases.backend → [services, routes]
118
+ 3. Composite match: "understand" → composites.understand → [context, docs, types, config]
119
+ 4. Fuzzy fallback: "back" → closest match to "backend"
120
+ ```
121
+
122
+ ### CLI Interface
123
+
124
+ ```bash
125
+ # Basic: get docs from FliHub
126
+ query_apps flihub --glob docs
127
+
128
+ # Alias: "backend" resolves to services + routes
129
+ query_apps flihub --glob backend
130
+
131
+ # Composite: "understand" = context + docs + types + config
132
+ query_apps angeleye --glob understand
133
+
134
+ # Multiple globs (comma-separated)
135
+ query_apps flihub --glob docs,types,config
136
+
137
+ # Cross-app: all RVETS apps, backend code
138
+ query_apps --pattern rvets --glob backend
139
+
140
+ # List available globs for a project
141
+ query_apps flihub --list
142
+
143
+ # List all registered apps that have context.globs.json
144
+ query_apps --list-apps
145
+
146
+ # Meta output (JSON with file counts, not paths)
147
+ query_apps flihub --glob backend --meta
148
+
149
+ # Pipe to llm_context (the whole point)
150
+ query_apps flihub --glob understand | llm_context --stdin -f content
151
+ query_apps angeleye --glob services | llm_context --stdin -f tree
152
+ ```
153
+
154
+ ### Output
155
+
156
+ Default: one file path per line (same as `query_brain` and `query_omi`).
157
+
158
+ ```
159
+ /Users/davidcruwys/dev/ad/flivideo/flihub/server/src/services/watcher.service.ts
160
+ /Users/davidcruwys/dev/ad/flivideo/flihub/server/src/services/naming.service.ts
161
+ /Users/davidcruwys/dev/ad/flivideo/flihub/server/src/routes/index.ts
162
+ ```
163
+
164
+ With `--meta`:
165
+ ```json
166
+ {
167
+ "app": "flihub",
168
+ "path": "/Users/davidcruwys/dev/ad/flivideo/flihub",
169
+ "pattern": "rvets",
170
+ "matched_globs": ["services", "routes"],
171
+ "resolved_from": "backend (alias)",
172
+ "file_count": 14
173
+ }
174
+ ```
175
+
176
+ ---
177
+
178
+ ## Standard Vocabulary
179
+
180
+ These category names are conventions enforced by `system-context` when generating `context.globs.json`. Projects can add custom categories beyond these.
181
+
182
+ | Category | Aliases | Description |
183
+ |----------|---------|-------------|
184
+ | `docs` | documentation, planning, specs | Markdown documentation |
185
+ | `types` | models, schema, data-layer | Type definitions / data shapes |
186
+ | `config` | settings, configuration | Config files |
187
+ | `services` | backend, business-logic | Server-side logic |
188
+ | `routes` | api, endpoints | API routes |
189
+ | `components` | ui, frontend, react | UI components |
190
+ | `views` | pages, screens | Page-level views |
191
+ | `tests` | specs, test | Test files |
192
+ | `styles` | css, styling | Stylesheets |
193
+ | `context` | meta, about | CLAUDE.md, CONTEXT.md, STEERING.md |
194
+
195
+ Standard composites:
196
+
197
+ | Composite | Expands to |
198
+ |-----------|-----------|
199
+ | `understand` | context + docs + types + config |
200
+ | `codebase` | services + routes + components + views |
201
+ | `full` | all glob categories |
202
+
203
+ ### Pattern-Specific Categories
204
+
205
+ These only appear in projects with the matching `pattern` type:
206
+
207
+ | Pattern | Extra Categories |
208
+ |---------|-----------------|
209
+ | `rvets` | mockups (`.mochaccino/`), shared |
210
+ | `nextjs` | actions, validation, auth, middleware, decisions (KDD) |
211
+ | `ruby-gem` | lib, bin, gemspec |
212
+ | `python` | src, requirements |
213
+ | `bmad` | bmad-config, bmad-output, workflows |
214
+
215
+ ---
216
+
217
+ ## System-Context Integration
218
+
219
+ The `system-context` skill (in appydave-plugins) needs a small addition:
220
+
221
+ 1. **After writing CONTEXT.md**, also generate `context.globs.json`
222
+ 2. **Detect project pattern** (rvets, nextjs, ruby-gem, python) from package.json / Gemfile / pyproject.toml
223
+ 3. **Scan the directory** and map discovered paths to standard category names
224
+ 4. **Add project-specific categories** for non-standard directories (e.g., `.mochaccino/` in RVETS apps)
225
+ 5. **Generate aliases and composites** using the standard vocabulary plus any project-specific additions
226
+
227
+ The `context.globs.json` file should be listed in CONTEXT.md's `sources:` frontmatter.
228
+
229
+ ---
230
+
231
+ ## Locations.json Integration
232
+
233
+ The `context` field in `locations.json` already points to `CONTEXT.md`. We can extend this:
234
+
235
+ ```json
236
+ {
237
+ "key": "flihub",
238
+ "path": "/Users/davidcruwys/dev/ad/flivideo/flihub",
239
+ "context": "CONTEXT.md",
240
+ "context_globs": "context.globs.json",
241
+ ...
242
+ }
243
+ ```
244
+
245
+ Or, simpler: `query_apps` can just check for `context.globs.json` in the same directory as `CONTEXT.md` without needing a separate field.
246
+
247
+ ---
248
+
249
+ ## Provenance Chain
250
+
251
+ ```
252
+ system-context skill (generates)
253
+
254
+ context.globs.json (sidecar in each project)
255
+
256
+ query_apps CLI tool (reads locations.json + globs file, resolves names, expands globs)
257
+
258
+ file paths on stdout
259
+
260
+ llm_context CLI tool (assembles content from file paths)
261
+
262
+ LLM-ready payload
263
+ ```
264
+
265
+ The full query ecosystem:
266
+
267
+ ```
268
+ query_brain → brain files ─┐
269
+ query_omi → OMI transcripts ├─→ llm_context → LLM payload
270
+ query_apps → app files ─┘
271
+ ```
272
+
273
+ ---
274
+
275
+ ## Skill Wrappers (Thin Shims)
276
+
277
+ Each query tool should have a corresponding skill in `appydave-plugins/appydave/skills/`:
278
+
279
+ | CLI Tool | Skill | Status |
280
+ |----------|-------|--------|
281
+ | `query_omi` | `omi-query` | Exists, correct pattern |
282
+ | `query_brain` | (none) | **Needs creating** — thin shim to `query_brain` |
283
+ | `query_apps` | (none) | **Create alongside CLI tool** |
284
+ | `llm_context` | (none) | **Needs creating** — downstream assembler, not a query |
285
+
286
+ The `focus` skill's `resolve_brain.py` should eventually be replaced by a call to `query_brain --find --meta` — the Ruby tool already has the same resolution logic with better test coverage.
287
+
288
+ ---
289
+
290
+ ## Implementation Phases
291
+
292
+ ### Phase 1: context.globs.json Generation
293
+ - Update `system-context` skill to generate `context.globs.json` alongside `CONTEXT.md`
294
+ - Generate for the 12 projects that already have `CONTEXT.md`
295
+ - Validate standard vocabulary coverage
296
+
297
+ ### Phase 2: query_apps CLI Tool
298
+ - `AppQuery` class following BrainQuery/OmiQuery pattern
299
+ - 4-tier app resolution from locations.json
300
+ - 3-tier glob resolution (direct → alias → composite → fuzzy)
301
+ - `find` (file paths) and `find_meta` (structured JSON) methods
302
+ - CLI entry point at `bin/query_apps.rb`
303
+ - Unit tests with fixtures
304
+
305
+ ### Phase 3: Skill Wrappers
306
+ - `app-query` skill in appydave-plugins (thin shim to `query_apps`)
307
+ - `brain-query` skill (thin shim to `query_brain`)
308
+ - `llm-context` skill (thin shim to `llm_context`)
309
+
310
+ ### Phase 4: Cross-App Queries
311
+ - `--pattern rvets` to query across all apps of a pattern type
312
+ - Aggregate results from multiple `context.globs.json` files
313
+
314
+ ---
315
+
316
+ ## Related Files
317
+
318
+ | What | Where |
319
+ |------|-------|
320
+ | BrainQuery (reference impl) | `lib/appydave/tools/brain_context/brain_finder.rb` |
321
+ | OmiQuery (reference impl) | `lib/appydave/tools/brain_context/omi_finder.rb` |
322
+ | FileCollector (downstream) | `lib/appydave/tools/llm_context/file_collector.rb` |
323
+ | Locations registry | `~/.config/appydave/locations.json` |
324
+ | System-context skill | `appydave-plugins/appydave/skills/system-context/SKILL.md` |
325
+ | omi-query skill (pattern) | `appydave-plugins/appydave/skills/omi-query/SKILL.md` |
326
+ | Brain query tests | `spec/appydave/tools/brain_context/brain_query_spec.rb` |
327
+ | OMI query tests | `spec/appydave/tools/brain_context/omi_query_spec.rb` |
328
+
329
+ ---
330
+
331
+ ## Open Questions
332
+
333
+ 1. Should `context.globs.json` live at project root or in `.claude/`?
334
+ - Root is simpler and visible; `.claude/` keeps it with other agent artifacts
335
+ - Leaning root (next to `CONTEXT.md`)
336
+
337
+ 2. Should fuzzy matching use Levenshtein distance or simpler substring?
338
+ - BrainQuery uses substring — probably sufficient here too
339
+
340
+ 3. Should `query_apps` live in `brain_context/` module or a new `app_context/` module?
341
+ - New module — apps are not brains, even though the query pattern is the same
342
+
343
+ 4. Should the `context` field in locations.json be extended to `context_globs`, or should query_apps just look for the file conventionally?
344
+ - Leaning conventional (just check for `context.globs.json` in the project dir)
@@ -0,0 +1,142 @@
1
+ # FR-NEW: Query Location & App Registry Integration
2
+
3
+ **Status**: Proposed
4
+ **Priority**: Medium
5
+ **Created**: 2026-04-05
6
+ **Relates to**: `query_brain`, `llm_context` pipeline; `locations.json`, `apps.json`
7
+
8
+ ---
9
+
10
+ ## Problem
11
+
12
+ `query_brain` and `llm_context` work well for brain files but have no way to resolve project paths from the existing registries. When a user says "package the FliVideo project for LLM research", there is no single command that:
13
+ 1. Looks up the project path from `locations.json` or `apps.json`
14
+ 2. Knows which file groupings are relevant (docs, code, prompts, tests)
15
+ 3. Feeds those paths directly into `llm_context`
16
+
17
+ Instead, the user must manually look up the path and write the `llm_context` invocation by hand every time.
18
+
19
+ ---
20
+
21
+ ## Proposed Solution
22
+
23
+ ### Option A — `query_location` CLI (preferred)
24
+
25
+ New binary `bin/query_location.rb` that queries `~/.config/appydave/locations.json` and `~/.config/appydave/apps.json` by key, name, type, or brand.
26
+
27
+ ```bash
28
+ # Find a project by key or name
29
+ query_location --find flivideo
30
+ query_location --find ss-prompt
31
+
32
+ # List all products
33
+ query_location --type product
34
+
35
+ # Get path only (for piping)
36
+ query_location --find flivideo --path-only
37
+
38
+ # Get JSON metadata
39
+ query_location --find flivideo --meta
40
+
41
+ # List all apps from apps.json
42
+ query_location --apps
43
+ query_location --apps --status active
44
+ ```
45
+
46
+ Output modes:
47
+ - Default: path on a single line (pipeable to `llm_context`)
48
+ - `--meta`: JSON with key, path, description, type, status
49
+ - `--path-only`: bare path string
50
+
51
+ ### Option B — Extend `jump.rb` with a query subcommand
52
+
53
+ Add `jump.rb query --find flivideo` rather than a new binary. Lower overhead, shares existing location-loading code.
54
+
55
+ **Recommendation**: Option B — reuse `jump.rb` infrastructure, add a `query` subcommand that outputs path/meta. Less surface area, same capability.
56
+
57
+ ---
58
+
59
+ ## File Groupings (Phase 2)
60
+
61
+ Once location lookup works, the second gap is "which files within a project are relevant for LLM research?" Today the user must specify patterns manually.
62
+
63
+ **Proposed**: A `.llm-groups.yaml` sidecar file at the project root declaring named groupings:
64
+
65
+ ```yaml
66
+ # .llm-groups.yaml
67
+ groups:
68
+ docs:
69
+ - "docs/**/*.md"
70
+ - "README.md"
71
+ - "CLAUDE.md"
72
+ code:
73
+ - "lib/**/*.rb"
74
+ - "bin/**/*.rb"
75
+ tests:
76
+ - "spec/**/*.rb"
77
+ prompts:
78
+ - "poem/**/*.json"
79
+ - "poem/**/*.yaml"
80
+ ```
81
+
82
+ Then:
83
+ ```bash
84
+ # Package docs group for LLM
85
+ query_location --find appydave-tools --path-only | xargs -I{} llm_context -b {} --groups docs
86
+
87
+ # Or inline
88
+ llm_context -b ~/dev/ad/appydave-tools --groups docs,code
89
+ ```
90
+
91
+ `llm_context` would read `.llm-groups.yaml` if present and expand the named groupings into `-i` patterns.
92
+
93
+ ---
94
+
95
+ ## Pipeline Vision (Full)
96
+
97
+ ```bash
98
+ # Today (manual, fragile)
99
+ llm_context -b ~/dev/ad/flivideo -i 'lib/**/*.rb' -i 'docs/**/*.md' -f content -o clipboard
100
+
101
+ # After this feature (location-aware)
102
+ query_location --find flivideo --path-only | xargs -I{} llm_context -b {} --groups docs,code -f content -o clipboard
103
+
104
+ # Or shorthand once groups file exists
105
+ llm_context --project flivideo --groups docs -o clipboard
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Acceptance Criteria
111
+
112
+ - [ ] `jump.rb query --find <term>` returns matching location path(s)
113
+ - [ ] `jump.rb query --find <term> --meta` returns JSON with key, path, description, type
114
+ - [ ] `jump.rb query --type product` lists all product locations
115
+ - [ ] Output is pipeable to `llm_context -b`
116
+ - [ ] Apps from `apps.json` are also queryable (or a separate `--apps` flag)
117
+ - [ ] Spec coverage for new query subcommand
118
+
119
+ ### Phase 2 (separate backlog item)
120
+ - [ ] `llm_context` reads `.llm-groups.yaml` and expands `--groups` flag into `-i` patterns
121
+ - [ ] `.llm-groups.yaml` standard defined and documented
122
+ - [ ] At least 3 projects have `.llm-groups.yaml` files (appydave-tools, flivideo, ss-prompt)
123
+
124
+ ---
125
+
126
+ ## Related Systems
127
+
128
+ - `~/.config/appydave/locations.json` — 70+ project locations (source of truth for `jump`)
129
+ - `~/.config/appydave/apps.json` — app registry with ports, start scripts, status
130
+ - `query_brain` — parallel tool for brain files; this is the project equivalent
131
+ - `llm_context` — the consumer; needs paths to operate
132
+ - `system-comprehension-pattern.md` — the pattern that produces the mental model; needs groupings to be useful at scale
133
+ - `appydave:system-context` skill — MISSING skill that generates `CONTEXT.md` per project; relates to Phase 2 groupings
134
+
135
+ ---
136
+
137
+ ## Notes
138
+
139
+ - Do NOT create a separate JSON registry — `locations.json` is already the source of truth
140
+ - The `jump` skill already knows about `locations.json`; extending `jump.rb` keeps things consistent
141
+ - Phase 2 (`.llm-groups.yaml`) is the real value unlock — Phase 1 is just plumbing
142
+ - This feature is what enables the "package project X for LLM research" workflow without manual path lookup every time
@@ -0,0 +1,107 @@
1
+ # Gap Analysis: system-context vs system-comprehension-pattern
2
+
3
+ **Context**: The `CONTEXT.md` file in this repo was generated by `/appydave:system-context` — a skill
4
+ that doesn't yet exist in appydave-plugins. This note compares what that skill *produced* (the output)
5
+ against the `system-comprehension-pattern.md` in the prompt-patterns brain to assess the gap.
6
+
7
+ **Created**: 2026-04-05
8
+
9
+ ---
10
+
11
+ ## What system-context Produced (CONTEXT.md output)
12
+
13
+ Looking at `CONTEXT.md` (generated 2026-04-03), the skill produced:
14
+
15
+ ```yaml
16
+ # Frontmatter
17
+ generated: 2026-04-03
18
+ generator: system-context
19
+ status: snapshot
20
+ sources: [README.md, gemspec, lib/tools.rb, brand_resolver.rb, project_resolver.rb, jump/commands/generate.rb, docs/dam/batch-s3-listing-requirements.md, CHANGELOG.md (versions 0.76.0-0.77.7)]
21
+ regenerate: "Run /appydave:system-context in the repo root"
22
+ ```
23
+
24
+ Sections produced:
25
+ 1. **Purpose** — one sentence
26
+ 2. **Domain Concepts** — key vocabulary (Brand, Project, DAM, Project Naming, Configuration, Multi-channel)
27
+ 3. **Design Decisions** — 6 decisions with rationale
28
+ 4. **Scope Limits** — 6 explicit "does NOT" statements
29
+
30
+ ---
31
+
32
+ ## What system-comprehension-pattern Produces (Level 1)
33
+
34
+ The 8-dimension Level 1 prompt produces:
35
+
36
+ 1. REAL PURPOSE — pain solved, world without it
37
+ 2. MENTAL MODEL — central metaphor or abstraction
38
+ 3. CORE ABSTRACTIONS — 3-5 building blocks and how they relate
39
+ 4. KEY WORKFLOWS — 2-4 end-to-end workflows (intent → outcome, not API calls)
40
+ 5. DESIGN DECISIONS — why it's built this way, alternatives considered
41
+ 6. NON-OBVIOUS CONSTRAINTS — things that look like they should work but don't
42
+ 7. EXPERT VS BEGINNER — mental shift from competent to expert
43
+ 8. SCOPE LIMITS — explicit non-scope + what handles those things instead
44
+
45
+ ---
46
+
47
+ ## Gap Analysis
48
+
49
+ | Dimension | system-context | system-comprehension Level 1 |
50
+ |-----------|---------------|------------------------------|
51
+ | Purpose / Real problem | ✅ One sentence | ✅ Full explanation + "world without it" |
52
+ | Domain concepts / Core abstractions | ✅ Reasonable depth | ✅ Richer — explains relationships between concepts |
53
+ | Mental model / Central metaphor | ❌ Not present | ✅ The central "how does the system think?" question |
54
+ | Key workflows | ❌ Not present | ✅ End-to-end workflows (intent → outcome) |
55
+ | Design decisions | ✅ Good — 6 decisions with rationale | ✅ Same coverage + alternatives considered |
56
+ | Non-obvious constraints | ❌ Not present | ✅ The "looks like it should work but doesn't" list |
57
+ | Expert vs beginner mental shift | ❌ Not present | ✅ The hardest thing to get from docs |
58
+ | Scope limits | ✅ Good — 6 explicit "does NOT" statements | ✅ Same + what handles those things instead |
59
+
60
+ **Score: system-context covers ~4/8 dimensions well. Missing the 4 that are hardest to get from docs.**
61
+
62
+ ---
63
+
64
+ ## The Core Gap
65
+
66
+ `system-context` is essentially an **automated documentation snapshot** — it reads source files and
67
+ produces a structured summary. It does this well and efficiently (no LLM needed, or minimal).
68
+
69
+ `system-comprehension-pattern` Level 1 is a **mental model prompt** — it produces reasoning about the
70
+ system, not just facts about it. The 4 missing dimensions (mental model, key workflows, non-obvious
71
+ constraints, expert vs beginner) are precisely the things that make a reasoning partner vs a fact retriever.
72
+
73
+ **Practical implication**: `CONTEXT.md` is useful as orientation context for an LLM session. But an LLM
74
+ given only `CONTEXT.md` would produce competent-but-generic answers. An LLM given the Level 1
75
+ comprehension output would produce expert-level, system-aware answers.
76
+
77
+ ---
78
+
79
+ ## What This Means for the system-context Skill (when built)
80
+
81
+ When `/appydave:system-context` is built as a proper skill, it should:
82
+
83
+ 1. **Keep what works**: automated extraction of purpose, domain concepts, design decisions, scope limits
84
+ (these come from README, gemspec, source files — no deep reasoning needed)
85
+
86
+ 2. **Add what's missing**: either
87
+ - Prompt the LLM to produce the missing 4 dimensions as part of the generation
88
+ - Or leave a `## Pending Comprehension` section flagging that Level 1 comprehension hasn't been run
89
+
90
+ 3. **Add a query_brain groupings block** — this is the new gap not in either system:
91
+ ```yaml
92
+ llm_groups:
93
+ docs: ["docs/**/*.md", "README.md", "CLAUDE.md"]
94
+ code: ["lib/**/*.rb", "bin/**/*.rb"]
95
+ tests: ["spec/**/*.rb"]
96
+ ```
97
+ So that `llm_context --project appydave-tools --groups docs` works without manual pattern entry.
98
+
99
+ ---
100
+
101
+ ## Recommendation
102
+
103
+ - **`system-context` as-is**: Good for quick onboarding context. Use it.
104
+ - **Before deep work**: Also run Level 1 comprehension from `system-comprehension-pattern.md` and append
105
+ the output to `CONTEXT.md` or keep it in a separate `COMPREHENSION.md`.
106
+ - **Long-term**: Build the `system-context` skill to include LLM-driven comprehension + groupings block.
107
+ The skill that produces `CONTEXT.md` should be the same skill that makes the project queryable.