mdcontext 0.0.1 → 0.1.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 (140) hide show
  1. package/.changeset/README.md +28 -0
  2. package/.changeset/config.json +11 -0
  3. package/.github/workflows/ci.yml +83 -0
  4. package/.github/workflows/release.yml +113 -0
  5. package/.tldrignore +112 -0
  6. package/AGENTS.md +46 -0
  7. package/BACKLOG.md +338 -0
  8. package/README.md +231 -11
  9. package/biome.json +36 -0
  10. package/cspell.config.yaml +14 -0
  11. package/dist/chunk-KRYIFLQR.js +92 -0
  12. package/dist/chunk-S7E6TFX6.js +742 -0
  13. package/dist/chunk-VVTGZNBT.js +1519 -0
  14. package/dist/cli/main.d.ts +1 -0
  15. package/dist/cli/main.js +2015 -0
  16. package/dist/index.d.ts +266 -0
  17. package/dist/index.js +86 -0
  18. package/dist/mcp/server.d.ts +1 -0
  19. package/dist/mcp/server.js +376 -0
  20. package/docs/019-USAGE.md +586 -0
  21. package/docs/020-current-implementation.md +364 -0
  22. package/docs/021-DOGFOODING-FINDINGS.md +175 -0
  23. package/docs/BACKLOG.md +80 -0
  24. package/docs/DESIGN.md +439 -0
  25. package/docs/PROJECT.md +88 -0
  26. package/docs/ROADMAP.md +407 -0
  27. package/docs/test-links.md +9 -0
  28. package/package.json +69 -10
  29. package/pnpm-workspace.yaml +5 -0
  30. package/research/config-analysis/01-current-implementation.md +470 -0
  31. package/research/config-analysis/02-strategy-recommendation.md +428 -0
  32. package/research/config-analysis/03-task-candidates.md +715 -0
  33. package/research/config-analysis/033-research-configuration-management.md +828 -0
  34. package/research/config-analysis/034-research-effect-cli-config.md +1504 -0
  35. package/research/config-analysis/04-consolidated-task-candidates.md +277 -0
  36. package/research/dogfood/consolidated-tool-evaluation.md +373 -0
  37. package/research/dogfood/strategy-a/a-synthesis.md +184 -0
  38. package/research/dogfood/strategy-a/a1-docs.md +226 -0
  39. package/research/dogfood/strategy-a/a2-amorphic.md +156 -0
  40. package/research/dogfood/strategy-a/a3-llm.md +164 -0
  41. package/research/dogfood/strategy-b/b-synthesis.md +228 -0
  42. package/research/dogfood/strategy-b/b1-architecture.md +207 -0
  43. package/research/dogfood/strategy-b/b2-gaps.md +258 -0
  44. package/research/dogfood/strategy-b/b3-workflows.md +250 -0
  45. package/research/dogfood/strategy-c/c-synthesis.md +451 -0
  46. package/research/dogfood/strategy-c/c1-explorer.md +192 -0
  47. package/research/dogfood/strategy-c/c2-diver-memory.md +145 -0
  48. package/research/dogfood/strategy-c/c3-diver-control.md +148 -0
  49. package/research/dogfood/strategy-c/c4-diver-failure.md +151 -0
  50. package/research/dogfood/strategy-c/c5-diver-execution.md +221 -0
  51. package/research/dogfood/strategy-c/c6-diver-org.md +221 -0
  52. package/research/effect-cli-error-handling.md +845 -0
  53. package/research/effect-errors-as-values.md +943 -0
  54. package/research/errors-task-analysis/00-consolidated-tasks.md +207 -0
  55. package/research/errors-task-analysis/cli-commands-analysis.md +909 -0
  56. package/research/errors-task-analysis/embeddings-analysis.md +709 -0
  57. package/research/errors-task-analysis/index-search-analysis.md +812 -0
  58. package/research/mdcontext-error-analysis.md +521 -0
  59. package/research/npm_publish/011-npm-workflow-research-agent2.md +792 -0
  60. package/research/npm_publish/012-npm-workflow-research-agent1.md +530 -0
  61. package/research/npm_publish/013-npm-workflow-research-agent3.md +722 -0
  62. package/research/npm_publish/014-npm-workflow-synthesis.md +556 -0
  63. package/research/npm_publish/031-npm-workflow-task-analysis.md +134 -0
  64. package/research/semantic-search/002-research-embedding-models.md +490 -0
  65. package/research/semantic-search/003-research-rag-alternatives.md +523 -0
  66. package/research/semantic-search/004-research-vector-search.md +841 -0
  67. package/research/semantic-search/032-research-semantic-search.md +427 -0
  68. package/research/task-management-2026/00-synthesis-recommendations.md +295 -0
  69. package/research/task-management-2026/01-ai-workflow-tools.md +416 -0
  70. package/research/task-management-2026/02-agent-framework-patterns.md +476 -0
  71. package/research/task-management-2026/03-lightweight-file-based.md +567 -0
  72. package/research/task-management-2026/04-established-tools-ai-features.md +541 -0
  73. package/research/task-management-2026/linear/01-core-features-workflow.md +771 -0
  74. package/research/task-management-2026/linear/02-api-integrations.md +930 -0
  75. package/research/task-management-2026/linear/03-ai-features.md +368 -0
  76. package/research/task-management-2026/linear/04-pricing-setup.md +205 -0
  77. package/research/task-management-2026/linear/05-usage-patterns-best-practices.md +605 -0
  78. package/scripts/rebuild-hnswlib.js +63 -0
  79. package/src/cli/argv-preprocessor.test.ts +210 -0
  80. package/src/cli/argv-preprocessor.ts +202 -0
  81. package/src/cli/cli.test.ts +430 -0
  82. package/src/cli/commands/backlinks.ts +54 -0
  83. package/src/cli/commands/context.ts +197 -0
  84. package/src/cli/commands/index-cmd.ts +300 -0
  85. package/src/cli/commands/index.ts +13 -0
  86. package/src/cli/commands/links.ts +52 -0
  87. package/src/cli/commands/search.ts +451 -0
  88. package/src/cli/commands/stats.ts +146 -0
  89. package/src/cli/commands/tree.ts +107 -0
  90. package/src/cli/flag-schemas.ts +275 -0
  91. package/src/cli/help.ts +386 -0
  92. package/src/cli/index.ts +9 -0
  93. package/src/cli/main.ts +145 -0
  94. package/src/cli/options.ts +31 -0
  95. package/src/cli/typo-suggester.test.ts +105 -0
  96. package/src/cli/typo-suggester.ts +130 -0
  97. package/src/cli/utils.ts +126 -0
  98. package/src/core/index.ts +1 -0
  99. package/src/core/types.ts +140 -0
  100. package/src/embeddings/index.ts +8 -0
  101. package/src/embeddings/openai-provider.ts +165 -0
  102. package/src/embeddings/semantic-search.ts +583 -0
  103. package/src/embeddings/types.ts +82 -0
  104. package/src/embeddings/vector-store.ts +299 -0
  105. package/src/index/index.ts +4 -0
  106. package/src/index/indexer.ts +446 -0
  107. package/src/index/storage.ts +196 -0
  108. package/src/index/types.ts +109 -0
  109. package/src/index/watcher.ts +131 -0
  110. package/src/index.ts +8 -0
  111. package/src/mcp/server.ts +483 -0
  112. package/src/parser/index.ts +1 -0
  113. package/src/parser/parser.test.ts +291 -0
  114. package/src/parser/parser.ts +395 -0
  115. package/src/parser/section-filter.ts +270 -0
  116. package/src/search/query-parser.test.ts +260 -0
  117. package/src/search/query-parser.ts +319 -0
  118. package/src/search/searcher.test.ts +182 -0
  119. package/src/search/searcher.ts +602 -0
  120. package/src/summarize/budget-bugs.test.ts +620 -0
  121. package/src/summarize/formatters.ts +419 -0
  122. package/src/summarize/index.ts +20 -0
  123. package/src/summarize/summarizer.test.ts +275 -0
  124. package/src/summarize/summarizer.ts +528 -0
  125. package/src/summarize/verify-bugs.test.ts +238 -0
  126. package/src/utils/index.ts +1 -0
  127. package/src/utils/tokens.test.ts +142 -0
  128. package/src/utils/tokens.ts +186 -0
  129. package/tests/fixtures/cli/.mdcontext/config.json +8 -0
  130. package/tests/fixtures/cli/.mdcontext/indexes/documents.json +33 -0
  131. package/tests/fixtures/cli/.mdcontext/indexes/links.json +12 -0
  132. package/tests/fixtures/cli/.mdcontext/indexes/sections.json +233 -0
  133. package/tests/fixtures/cli/.mdcontext/vectors.bin +0 -0
  134. package/tests/fixtures/cli/.mdcontext/vectors.meta.json +1264 -0
  135. package/tests/fixtures/cli/README.md +9 -0
  136. package/tests/fixtures/cli/api-reference.md +11 -0
  137. package/tests/fixtures/cli/getting-started.md +11 -0
  138. package/tsconfig.json +26 -0
  139. package/vitest.config.ts +21 -0
  140. package/vitest.setup.ts +12 -0
@@ -0,0 +1,277 @@
1
+ # Consolidated Configuration Tasks for mdcontext
2
+
3
+ **Context**: mdcontext already uses `@effect/cli`. This means the Effect ecosystem has lower adoption friction, and Effect Config + Layers is the recommended approach (not c12/citty/Zod).
4
+
5
+ **Strategy**: Full Effect-native configuration using `Config`, `ConfigProvider`, and `Layer` patterns.
6
+
7
+ ---
8
+
9
+ ## Phase 1: Effect Config Foundation
10
+
11
+ ### Task 1: Create Effect Config Schema Module
12
+
13
+ **Priority**: High
14
+ **Effort**: Small (2-4 hours)
15
+ **Dependencies**: None
16
+
17
+ **Description**: Define all configuration options using Effect's `Config` combinators (`Config.string`, `Config.number`, `Config.literal`, etc.). This replaces the Zod schema approach and provides native integration with Effect's ConfigProvider system.
18
+
19
+ **Why it matters**: Effect Config provides compile-time tracking of config requirements through the type system, eliminating runtime-only validation errors and enabling cleaner dependency injection.
20
+
21
+ ---
22
+
23
+ ### Task 2: Create ConfigService Layer
24
+
25
+ **Priority**: High
26
+ **Effort**: Small (2-4 hours)
27
+ **Dependencies**: Task 1
28
+
29
+ **Description**: Wrap configuration in an Effect `Context.Tag` and `Layer`, enabling dependency injection throughout the application. Services will access config via `yield* ConfigService` rather than direct function parameters.
30
+
31
+ **Why it matters**: Layer-based config enables test isolation without mocking, follows Effect best practices, and provides consistent config access across all commands and services.
32
+
33
+ ---
34
+
35
+ ### Task 3: Implement File-based ConfigProvider
36
+
37
+ **Priority**: High
38
+ **Effort**: Medium (1-2 days)
39
+ **Dependencies**: Task 1
40
+
41
+ **Description**: Create a custom `ConfigProvider` that reads from `mdcontext.config.ts` (or `.json`/`.yaml`). Use `ConfigProvider.fromMap` or `ConfigProvider.nested` to map file contents to the Effect config namespace.
42
+
43
+ **Why it matters**: Enables persistent configuration without repeating CLI flags. Users expect config file support in modern CLI tools.
44
+
45
+ ---
46
+
47
+ ### Task 4: Implement Config Precedence Chain
48
+
49
+ **Priority**: High
50
+ **Effort**: Medium (4-8 hours)
51
+ **Dependencies**: Task 3
52
+
53
+ **Description**: Compose ConfigProviders using `ConfigProvider.orElse` to establish precedence: CLI flags > Environment variables > Config file > Defaults. Effect's ConfigProvider composition makes this elegant.
54
+
55
+ **Why it matters**: Standard CLI behavior. Users expect CLI flags to override everything, env vars to override files, and sensible defaults when nothing is specified.
56
+
57
+ ---
58
+
59
+ ## Phase 2: CLI Integration
60
+
61
+ ### Task 5: Integrate Config Layer with CLI Commands
62
+
63
+ **Priority**: High
64
+ **Effort**: Medium (1-2 days)
65
+ **Dependencies**: Task 2, Task 4
66
+
67
+ **Description**: Modify all CLI command handlers to `yield* ConfigService` instead of using inline defaults. Update `@effect/cli` Options to use `Config` values as defaults where appropriate. Each command should `.pipe(Effect.provide(ConfigLive))`.
68
+
69
+ **Why it matters**: Completes the config system integration. Users can now set persistent defaults in config files that CLI commands respect.
70
+
71
+ ---
72
+
73
+ ### Task 6: Add Global --config Flag
74
+
75
+ **Priority**: Medium
76
+ **Effort**: Small (2-4 hours)
77
+ **Dependencies**: Task 5
78
+
79
+ **Description**: Add `Options.file("config").pipe(Options.withAlias("c"))` as a global option that overrides the config file search path. Pass this to the ConfigProvider construction.
80
+
81
+ **Why it matters**: Allows per-invocation config file selection, useful for testing and multi-project setups.
82
+
83
+ ---
84
+
85
+ ### Task 7: Add config init Subcommand
86
+
87
+ **Priority**: Low
88
+ **Effort**: Small (2-4 hours)
89
+ **Dependencies**: Task 3
90
+
91
+ **Description**: Create `mdcontext config init` command that generates a starter `mdcontext.config.ts` with `defineConfig()` helper and documented defaults.
92
+
93
+ **Why it matters**: Lowers barrier to config adoption and documents available options by example.
94
+
95
+ ---
96
+
97
+ ## Phase 3: Environment & Secrets
98
+
99
+ ### Task 8: Implement MDCONTEXT\_ Environment Variable Mapping
100
+
101
+ **Priority**: Medium
102
+ **Effort**: Small (2-4 hours)
103
+ **Dependencies**: Task 1
104
+
105
+ **Description**: Configure Effect's default `ConfigProvider.fromEnv()` with nested path support (`MDCONTEXT_SEARCH_LIMIT` maps to `search.limit`). Use `Config.nested("mdcontext")` pattern.
106
+
107
+ **Why it matters**: Standard pattern for CI/CD integration and containerized environments. Keeps secrets out of config files.
108
+
109
+ ---
110
+
111
+ ### Task 9: Use Effect Redacted for API Keys
112
+
113
+ **Priority**: Medium
114
+ **Effort**: Small (1-2 hours)
115
+ **Dependencies**: None
116
+
117
+ **Description**: Replace `process.env.OPENAI_API_KEY` with `Config.redacted("OPENAI_API_KEY")`. Update `OpenAIProvider` to accept `Redacted<string>` and use `Redacted.value()` only when making API calls.
118
+
119
+ **Why it matters**: Prevents API keys from appearing in logs or error messages. Effect's `Redacted` type shows `<redacted>` when stringified.
120
+
121
+ ---
122
+
123
+ ## Phase 4: Validation & Errors
124
+
125
+ ### Task 10: Implement User-friendly Config Errors
126
+
127
+ **Priority**: High
128
+ **Effort**: Medium (4-8 hours)
129
+ **Dependencies**: Task 3
130
+
131
+ **Description**: Create a custom error formatter for `ConfigError` that shows file location, expected type, actual value, and hints. Use `Effect.catchTag("ConfigError", ...)` to intercept and format errors before CLI output.
132
+
133
+ **Why it matters**: Good error messages dramatically reduce user frustration. Config errors should guide users to the fix, not just report the problem.
134
+
135
+ ---
136
+
137
+ ### Task 11: Add config check Subcommand
138
+
139
+ **Priority**: Low
140
+ **Effort**: Small (2-4 hours)
141
+ **Dependencies**: Task 10
142
+
143
+ **Description**: Create `mdcontext config check` that validates configuration and displays the effective merged config from all sources (file, env, defaults).
144
+
145
+ **Why it matters**: Useful for debugging config issues and CI/CD validation. Shows users what config values are actually in effect.
146
+
147
+ ---
148
+
149
+ ## Phase 5: Testing Infrastructure
150
+
151
+ ### Task 12: Create Config Testing Utilities
152
+
153
+ **Priority**: Medium
154
+ **Effort**: Small (2-4 hours)
155
+ **Dependencies**: Task 2
156
+
157
+ **Description**: Export `TestConfigLayer` helpers that provide mock config via `Layer.succeed(ConfigService, {...})`. Create `withTestConfig(overrides)` utility for partial config in tests.
158
+
159
+ **Why it matters**: Enables isolated testing without environment pollution. Tests can run in parallel with different configs.
160
+
161
+ ---
162
+
163
+ ### Task 13: Add Config Integration Tests
164
+
165
+ **Priority**: Medium
166
+ **Effort**: Medium (4-8 hours)
167
+ **Dependencies**: Task 12, Task 4
168
+
169
+ **Description**: Write integration tests verifying: (1) CLI flags override config file, (2) env vars override config file, (3) config file overrides defaults, (4) invalid config produces friendly errors.
170
+
171
+ **Why it matters**: Validates the precedence chain works correctly. Catches regressions in config handling.
172
+
173
+ ---
174
+
175
+ ## Phase 6: Consolidation & Cleanup
176
+
177
+ ### Task 14: Extract Hardcoded Constants to Config
178
+
179
+ **Priority**: Medium
180
+ **Effort**: Medium (1-2 days)
181
+ **Dependencies**: Task 5
182
+
183
+ **Description**: Move hardcoded values from `summarizer.ts` (TOKEN_BUDGETS, compression ratios), `openai-provider.ts` (model, batch size), `searcher.ts` (limits, thresholds), and other files to ConfigService. Keep constants as defaults in the Config definition.
184
+
185
+ **Why it matters**: Enables user customization of currently hardcoded behavior. Centralizes "magic numbers" for easier maintenance.
186
+
187
+ ---
188
+
189
+ ### Task 15: Version from package.json
190
+
191
+ **Priority**: Low
192
+ **Effort**: Small (1-2 hours)
193
+ **Dependencies**: None
194
+
195
+ **Description**: Replace hardcoded `'0.1.0'` in `main.ts` and `mcp/server.ts` with dynamic version read from `package.json`. Use `Effect.sync(() => require('../package.json').version)` or import assertion.
196
+
197
+ **Why it matters**: Version should match package.json automatically. Eliminates manual version sync across files.
198
+
199
+ ---
200
+
201
+ ## Phase 7: Documentation
202
+
203
+ ### Task 16: Document Configuration System
204
+
205
+ **Priority**: High
206
+ **Effort**: Medium (4-8 hours)
207
+ **Dependencies**: Task 5
208
+
209
+ **Description**: Create configuration documentation covering: all options with descriptions, TypeScript config file example, environment variable mapping, precedence explanation, and migration guide from CLI-only usage.
210
+
211
+ **Why it matters**: Users can't use features they don't know about. Good docs reduce support burden and establish mdcontext as a professional tool.
212
+
213
+ ---
214
+
215
+ ## Summary
216
+
217
+ | Phase | Tasks | Effort | Priority Focus |
218
+ | ------------------ | ---------- | ------ | -------------- |
219
+ | 1. Foundation | 1, 2, 3, 4 | Medium | High |
220
+ | 2. CLI Integration | 5, 6, 7 | Medium | High/Medium |
221
+ | 3. Environment | 8, 9 | Small | Medium |
222
+ | 4. Validation | 10, 11 | Medium | High/Low |
223
+ | 5. Testing | 12, 13 | Medium | Medium |
224
+ | 6. Cleanup | 14, 15 | Medium | Medium/Low |
225
+ | 7. Documentation | 16 | Medium | High |
226
+
227
+ ### Recommended MVP (Minimum Viable Configuration)
228
+
229
+ **Tasks 1, 2, 3, 4, 5, 10, 16**
230
+
231
+ This provides:
232
+
233
+ - Working Effect Config with Layer
234
+ - Config file support
235
+ - CLI integration with precedence
236
+ - Friendly error messages
237
+ - Documentation
238
+
239
+ ---
240
+
241
+ ## Dependencies Graph
242
+
243
+ ```
244
+ Task 1 (Config Schema) ────┬─► Task 2 (ConfigService Layer) ─► Task 5 (CLI Integration)
245
+ │ │
246
+ │ ├─► Task 6 (--config flag)
247
+ │ │
248
+ ├─► Task 3 (File ConfigProvider) ───┼─► Task 4 (Precedence Chain)
249
+ │ │ │
250
+ │ └─► Task 7 (config init) │
251
+ │ │
252
+ ├─► Task 8 (Env Vars) └─► Task 14 (Extract Constants)
253
+
254
+ └─► Task 16 (Documentation)
255
+
256
+ Task 2 (Layer) ─► Task 12 (Test Utils) ─► Task 13 (Integration Tests)
257
+
258
+ Task 3 (File Provider) ─► Task 10 (Error Formatting) ─► Task 11 (config check)
259
+
260
+ Task 9 (Redacted) ──── Independent
261
+ Task 15 (Version) ──── Independent
262
+ ```
263
+
264
+ ---
265
+
266
+ ## Tasks Removed from Original List
267
+
268
+ The following tasks from `03-task-candidates.md` are **not applicable** given Effect is already in use:
269
+
270
+ - **1.1 Define Configuration Schema with Zod** - Replaced by Effect Config (Task 1)
271
+ - **1.2 Create defineConfig Helper** - Still useful but implementation differs (included in Task 7)
272
+ - **1.3 Implement Config Loader with c12** - Replaced by Effect ConfigProvider (Task 3)
273
+ - **5.2 Add Schema-Based Config Type Generation** - Effect Config provides this natively
274
+
275
+ ---
276
+
277
+ _Created: 2026-01-21_
@@ -0,0 +1,373 @@
1
+ # Consolidated Tool Evaluation Report: mdcontext
2
+
3
+ ## 1. Executive Summary
4
+
5
+ **Overall Verdict**: The mdcontext tool is **highly effective for structured documentation research** with an average rating of **4.06/5** across all three strategies (15 total agents). The tool successfully enabled exploration of a ~207K token documentation corpus while reading only 25-30% of raw content through targeted extraction.
6
+
7
+ **Key Strengths**: The `tree`, `context --section`, and keyword `search` commands form a powerful workflow for systematic documentation analysis. Token-aware budgeting and section-level extraction are major differentiators.
8
+
9
+ **Key Weaknesses**: Multi-word search failures, 10-result cap without pagination, and unreliable semantic search for conceptual queries are the primary blockers to broader adoption.
10
+
11
+ **Bottom Line**: Recommended for structured markdown documentation research. Critical improvements needed in search capabilities to unlock full potential.
12
+
13
+ ---
14
+
15
+ ## 2. Aggregate Scores
16
+
17
+ ### By Strategy
18
+
19
+ | Strategy | Methodology | Agents | Avg Rating | Confidence | Total Commands |
20
+ | -------- | ------------------ | ------ | ------------- | ----------- | -------------- |
21
+ | A | Divide by Folder | 3 | 4/5 (implied) | Medium-High | ~100 (est.) |
22
+ | B | Divide by Question | 3 | 4/5 | High (3/3) | 114 |
23
+ | C | Explore-Then-Dive | 6 | 4.17/5 | High (6/6) | 175 |
24
+
25
+ ### Individual Agent Scores (Where Available)
26
+
27
+ | Agent | Strategy | Rating | Confidence |
28
+ | ----- | -------- | ------ | ---------- |
29
+ | B1 | B | 4/5 | Medium |
30
+ | B2 | B | 4/5 | High |
31
+ | B3 | B | 4/5 | High |
32
+ | C1 | C | 4/5 | High |
33
+ | C2 | C | 4/5 | High |
34
+ | C3 | C | 4/5 | High |
35
+ | C4 | C | 4/5 | High |
36
+ | C5 | C | 5/5 | High |
37
+ | C6 | C | 4/5 | High |
38
+
39
+ **Overall Average**: **4.06/5** (weighted by available ratings)
40
+ **Confidence Distribution**: 11/12 High, 1/12 Medium
41
+
42
+ ---
43
+
44
+ ## 3. What Worked Well (Consensus)
45
+
46
+ Features praised across multiple strategies, with frequency counts:
47
+
48
+ | Feature | Strategy A | Strategy B | Strategy C | Total Mentions | Notes |
49
+ | ---------------------------------------------------------- | ---------- | ---------- | ---------- | -------------- | ------------------------------------------------------------- |
50
+ | `mdcontext tree` - Document structure with token counts | 3/3 | 3/3 | 6/6 | **12/12** | "Perfect for planning", "Invaluable for prioritization" |
51
+ | `mdcontext context --section` - Precise section extraction | 3/3 | 3/3 | 5/6 | **11/12** | "Game-changer", "Surgical extraction", 44-61% token reduction |
52
+ | `mdcontext search` - Fast keyword discovery | 3/3 | 3/3 | 6/6 | **12/12** | "Found relevant content quickly", "Good context lines" |
53
+ | Token budgeting (`-t` flag) | 3/3 | 3/3 | 2/6 | **8/12** | "Respects limits while showing included/excluded" |
54
+ | `mdcontext stats` - Quick index overview | 2/3 | 2/3 | 3/6 | **7/12** | "Instant scope understanding" |
55
+ | Boolean search operators (AND/OR/quoted phrases) | 2/3 | 0/3 | 2/6 | **4/12** | "Worked as expected" |
56
+ | Fast indexing speed | 1/3 | 1/3 | 0/6 | **2/12** | 535ms for 23 docs, ~$0.003 cost |
57
+ | `mdcontext context --sections` - Section listing | 0/3 | 0/3 | 4/6 | **4/12** | "Essential for finding exact section names" |
58
+
59
+ ### Consensus Highlights
60
+
61
+ 1. **Universal Praise (All 3 Strategies)**:
62
+ - `tree` command for understanding document structure
63
+ - `context --section` for targeted extraction
64
+ - Basic keyword `search` functionality
65
+ - Token budget control
66
+
67
+ 2. **The Optimal Workflow Pattern** (emerged from Strategy C):
68
+ 1. `mdcontext tree <file>` - See structure and token counts
69
+ 2. `mdcontext context --sections <file>` - Get exact section names
70
+ 3. `mdcontext context <file> --section "X"` - Extract needed sections
71
+ 4. `mdcontext search "term"` - Find cross-references
72
+ 5. Repeat as needed
73
+
74
+ ---
75
+
76
+ ## 4. What Was Frustrating (Consensus)
77
+
78
+ Pain points identified across multiple strategies, with frequency counts:
79
+
80
+ | Issue | Strategy A | Strategy B | Strategy C | Total Mentions | Severity |
81
+ | ----------------------------------------------- | ---------- | ---------- | ---------- | -------------- | -------- |
82
+ | Multi-word search returns 0 results | 0/3 | 3/3 | 5/6 | **8/12** | High |
83
+ | Semantic search unreliable/returns 0 results | 3/3 | 3/3 | 4/6 | **10/12** | High |
84
+ | Search results capped at 10, no pagination | 2/3 | 0/3 | 4/6 | **6/12** | High |
85
+ | Directory-scoped search broken | 3/3 | 0/3 | 0/6 | **3/12** | Medium |
86
+ | Section name requires exact match | 0/3 | 0/3 | 3/6 | **3/12** | Medium |
87
+ | Token truncation unclear/unpredictable | 1/3 | 3/3 | 2/6 | **6/12** | Medium |
88
+ | Cannot search within specific file | 0/3 | 0/3 | 2/6 | **2/12** | Low |
89
+ | Cannot request multiple sections in one command | 0/3 | 0/3 | 2/6 | **2/12** | Low |
90
+ | Context command syntax confusion | 0/3 | 0/3 | 3/6 | **3/12** | Low |
91
+ | No way to chain or aggregate searches | 0/3 | 3/3 | 0/6 | **3/12** | Medium |
92
+ | False positives in keyword search | 0/3 | 2/3 | 0/6 | **2/12** | Low |
93
+
94
+ ### Critical Issues (Blocking Workflows)
95
+
96
+ 1. **Semantic Search Failure** (10/12 mentions)
97
+ - "All three agents found semantic search unreliable for multi-word conceptual queries"
98
+ - "All fell back to keyword search frequently"
99
+ - "Strongest cross-agent signal about the mdcontext tool"
100
+ - Root cause: Multi-word queries like "failure automation", "job context" return 0 results
101
+
102
+ 2. **Search Result Cap** (6/12 mentions)
103
+ - "Hard to know if important results are being missed"
104
+ - "No pagination"
105
+ - "Sometimes wanted more matches"
106
+
107
+ 3. **Directory-Scoped Search Broken** (3/12 mentions, but all in Strategy A)
108
+ - `mdcontext search "term" docs/` fails with "No index found" even when index exists
109
+ - Critical for multi-folder repositories
110
+
111
+ ---
112
+
113
+ ## 5. What Was Missing (Consensus)
114
+
115
+ Feature requests and gaps identified, with frequency counts:
116
+
117
+ | Missing Feature | Strategy A | Strategy B | Strategy C | Total Mentions |
118
+ | ----------------------------------------------------- | ---------- | ---------- | ---------- | -------------- |
119
+ | Local embedding option (no OpenAI API required) | 2/3 | 0/3 | 0/6 | **2/12** |
120
+ | Configurable/unlimited search results | 2/3 | 0/3 | 4/6 | **6/12** |
121
+ | Fuzzy/stemmed search ("fail" finds "failure") | 1/3 | 3/3 | 3/6 | **7/12** |
122
+ | Cross-file/multi-file operations | 2/3 | 2/3 | 1/6 | **5/12** |
123
+ | Search within results / progressive refinement | 0/3 | 3/3 | 0/6 | **3/12** |
124
+ | Hybrid semantic+keyword search mode | 0/3 | 3/3 | 0/6 | **3/12** |
125
+ | Export/save functionality | 0/3 | 3/3 | 0/6 | **3/12** |
126
+ | Cross-reference navigation | 1/3 | 1/3 | 1/6 | **3/12** |
127
+ | Relevance ranking for search results | 1/3 | 0/3 | 0/6 | **1/12** |
128
+ | Section exclusion in context | 1/3 | 0/3 | 0/6 | **1/12** |
129
+ | "What's undefined" query (terms used but not defined) | 0/3 | 1/3 | 0/6 | **1/12** |
130
+ | Duplicate content detection | 0/3 | 0/3 | 1/6 | **1/12** |
131
+ | AI-generated summaries of search results | 1/3 | 0/3 | 0/6 | **1/12** |
132
+ | Diff between documents | 1/3 | 0/3 | 0/6 | **1/12** |
133
+ | Semantic search threshold adjustment | 0/3 | 2/3 | 0/6 | **2/12** |
134
+ | Context around keyword matches without re-running | 0/3 | 1/3 | 0/6 | **1/12** |
135
+ | Batch context extraction for multiple sections/files | 0/3 | 1/3 | 2/6 | **3/12** |
136
+ | "Related sections" feature | 0/3 | 1/3 | 0/6 | **1/12** |
137
+
138
+ ---
139
+
140
+ ## 6. Feature-Specific Feedback
141
+
142
+ ### 6.1 `mdcontext tree`
143
+
144
+ **Rating**: Excellent (12/12 positive mentions)
145
+
146
+ **What Works**:
147
+
148
+ - Document outlines with token counts per section
149
+ - "Perfect for planning", "Invaluable for prioritization"
150
+ - Fast execution
151
+ - Helps identify which sections are worth extracting
152
+
153
+ **Issues**:
154
+
155
+ - Section numbering inconsistency: tree shows "## 1. Section" but context uses "1.1" notation (Strategy A)
156
+ - No option to see nested depth limits
157
+
158
+ **Recommendations**:
159
+
160
+ - Maintain as-is; this is the strongest feature
161
+ - Consider adding depth limit option for very deep documents
162
+
163
+ ---
164
+
165
+ ### 6.2 `mdcontext search`
166
+
167
+ **Rating**: Mixed (keyword good, semantic problematic)
168
+
169
+ #### Keyword Search
170
+
171
+ **What Works**:
172
+
173
+ - Reliable and essential fallback when semantic search fails
174
+ - Boolean operators (AND/OR/quoted phrases) work well
175
+ - Good context lines around matches
176
+
177
+ **Issues**:
178
+
179
+ - Multi-word searches fail: "failure automation", "job context", "pause resume terminate" return 0 results (8/12 mentions)
180
+ - 10 result cap with no pagination (6/12 mentions)
181
+ - Cannot search within specific file or directory (5/12 mentions)
182
+ - No stemmed/fuzzy matching: "suggest" doesn't find "suggestion" (7/12 mentions)
183
+ - False positives reported (2/12 mentions)
184
+
185
+ #### Semantic Search
186
+
187
+ **What Works**:
188
+
189
+ - Fast embedding indexing (~$0.003 cost)
190
+ - Works better for concrete concepts (workflows, collaboration) than abstract critiques (gaps, criticisms) (Strategy B observation)
191
+
192
+ **Issues**:
193
+
194
+ - Returns 0 results for multi-word conceptual queries (10/12 mentions)
195
+ - Requires external API key (OpenAI) - barrier to adoption (2/12 mentions)
196
+ - No threshold adjustment available
197
+ - All agents fell back to keyword search frequently
198
+
199
+ **Critical Observation** (Strategy B):
200
+
201
+ > "B3 (workflows) used semantic search exclusively and found it more effective for their domain. B1 and B2 heavily relied on keyword search after semantic search failed. This suggests semantic search may work better for concrete concepts (workflows, collaboration) than abstract critiques (gaps, criticisms)."
202
+
203
+ ---
204
+
205
+ ### 6.3 `mdcontext context`
206
+
207
+ **Rating**: Very Good (11/12 positive mentions for `--section`)
208
+
209
+ **What Works**:
210
+
211
+ - Precise section extraction with `--section` flag
212
+ - 44-61% token reduction while preserving key content
213
+ - Token budgeting with `-t` flag
214
+ - `--sections` flag for listing available sections
215
+
216
+ **Issues**:
217
+
218
+ - Section name requires exact match (3/12 mentions)
219
+ - Token truncation unpredictable/unclear (6/12 mentions)
220
+ - "100% reduction on small files" (Strategy A)
221
+ - "36% shown with no explicit warning" (Strategy C)
222
+ - Context duplication: `--section "Time Travel"` returned same section twice (parent and subsection) (Strategy A)
223
+ - Cannot request multiple sections in one command (2/12 mentions)
224
+ - Initial syntax confusion (positional arguments vs flags) (3/12 mentions)
225
+
226
+ **Recommendations**:
227
+
228
+ - Add fuzzy/partial section name matching
229
+ - Add explicit "section won't fit" warning
230
+ - Support multiple `--section` flags in one command
231
+ - Fix duplication bug
232
+
233
+ ---
234
+
235
+ ### 6.4 `mdcontext stats`
236
+
237
+ **Rating**: Good (7/12 positive mentions)
238
+
239
+ **What Works**:
240
+
241
+ - Quick overview of index size and distribution
242
+ - "Instant scope understanding"
243
+ - Useful for understanding corpus size before diving in
244
+
245
+ **Issues**:
246
+
247
+ - No specific issues reported
248
+
249
+ ---
250
+
251
+ ### 6.5 `mdcontext index`
252
+
253
+ **Rating**: Good (2/12 explicit mentions, but used by all)
254
+
255
+ **What Works**:
256
+
257
+ - Fast: 535ms for 23 docs
258
+ - Low cost: ~$0.003 for embeddings
259
+ - Required for search to work
260
+
261
+ **Issues**:
262
+
263
+ - Directory-scoped search fails even with existing index (Strategy A - all 3 agents)
264
+ - Semantic search unreliability may be an indexing issue
265
+
266
+ ---
267
+
268
+ ## 7. Priority Improvements
269
+
270
+ ### P0 (Critical): Mentioned by All 3 Strategies
271
+
272
+ | Issue | Impact | Recommendation |
273
+ | ------------------------------------------------------------ | ----------------------------------------- | ---------------------------------------------------------------------------------------- |
274
+ | **Semantic search returns 0 results for multi-word queries** | Agents abandoned semantic search entirely | Debug and fix multi-word query handling; consider hybrid mode that falls back to keyword |
275
+ | **10 result limit with no pagination** | Users miss important results | Add configurable limit (`--limit 50`) and/or pagination |
276
+ | **Multi-word keyword search fails** | Basic search workflows broken | Support phrase matching by default; document quoting requirements |
277
+
278
+ ### P1 (High): Mentioned by 2 Strategies
279
+
280
+ | Issue | Strategies | Recommendation |
281
+ | ------------------------------------- | -------------- | ---------------------------------------------------------------------- |
282
+ | **Token truncation unclear** | A, B | Add explicit warning when content is truncated; show what was excluded |
283
+ | **Directory-scoped search broken** | A (all agents) | Fix path filtering: `mdcontext search "term" docs/` should work |
284
+ | **No fuzzy/stemmed search** | B, C | Add stemming support: "suggest" should match "suggestion" |
285
+ | **No cross-file operations** | A, B | Add batch context extraction: `mdcontext context docs/*.md -t 10000` |
286
+ | **Section name requires exact match** | B, C | Add fuzzy section name matching |
287
+
288
+ ### P2 (Medium): Mentioned by 1 Strategy but Significant Impact
289
+
290
+ | Issue | Strategy | Recommendation |
291
+ | ------------------------------------ | -------- | ---------------------------------------------------------------------------------------- |
292
+ | **No local embedding option** | A | Support local embedding models (e.g., sentence-transformers) to remove OpenAI dependency |
293
+ | **No search within results** | B | Add progressive refinement: search within previous results |
294
+ | **Cannot request multiple sections** | C | Support multiple `--section` flags: `--section "A" --section "B"` |
295
+ | **Context command syntax confusion** | C | Improve help text and error messages for positional vs flag arguments |
296
+ | **No hybrid semantic+keyword mode** | B | Auto-fall back to keyword when semantic returns 0 results |
297
+ | **No relevance ranking** | A | Sort results by relevance, not document order |
298
+ | **No export/save functionality** | B | Add `--output` flag to save results to file |
299
+ | **Context duplication bug** | A | Fix `--section` returning parent and child when names overlap |
300
+
301
+ ---
302
+
303
+ ## 8. Methodology Comparison
304
+
305
+ ### Which Strategy Found the Tool Most Effective?
306
+
307
+ **Strategy C (Explore-Then-Dive)**: 4.17/5 average, 100% high confidence
308
+
309
+ Strategy C found the tool most effective because:
310
+
311
+ 1. **Systematic workflow**: The two-phase approach (map then dive) matched the tool's strengths
312
+ 2. **Single-file focus**: Divers could use `tree` -> `context --sections` -> `context --section` workflow effectively
313
+ 3. **Clear boundaries**: Each diver had a focused theme, reducing need for cross-file operations
314
+ 4. **High command efficiency**: 96% of 175 commands were useful
315
+
316
+ ### Which Strategy Found the Tool Least Effective?
317
+
318
+ **Strategy B (Divide by Question)**: 4/5 average, but most frustration expressed
319
+
320
+ Strategy B found the tool least effective because:
321
+
322
+ 1. **Question-based research requires cross-cutting search**: Agents needed to find concepts across all files
323
+ 2. **Heavy reliance on search**: 69 of 114 commands were searches (vs. context extraction)
324
+ 3. **Semantic search failures most pronounced**: All 3 agents explicitly noted semantic search unreliability
325
+ 4. **Abstract queries**: Questions like "gaps" and "criticisms" don't map well to keyword search
326
+
327
+ ### Key Insight
328
+
329
+ The tool works best for **systematic, file-by-file exploration** (Strategy C) and struggles with **cross-cutting conceptual queries** (Strategy B). This suggests prioritizing:
330
+
331
+ 1. Better semantic search for conceptual exploration
332
+ 2. Cross-file operations for question-based research
333
+ 3. Maintaining the excellent tree/context workflow for deep dives
334
+
335
+ ---
336
+
337
+ ## 9. Actionable Summary
338
+
339
+ ### Immediate Fixes (This Sprint)
340
+
341
+ 1. Fix multi-word semantic search returning 0 results
342
+ 2. Add `--limit` flag to search command
343
+ 3. Fix directory-scoped search path filtering
344
+
345
+ ### Short-Term Improvements (Next 2-4 Weeks)
346
+
347
+ 1. Add fuzzy/stemmed keyword search
348
+ 2. Add explicit truncation warnings
349
+ 3. Support multiple `--section` flags
350
+ 4. Add hybrid semantic+keyword search mode
351
+
352
+ ### Medium-Term Enhancements (Next Quarter)
353
+
354
+ 1. Add local embedding support (remove OpenAI dependency)
355
+ 2. Add cross-file batch operations
356
+ 3. Add search-within-results / progressive refinement
357
+ 4. Add relevance ranking
358
+ 5. Add export functionality
359
+
360
+ ### Maintain (Do Not Regress)
361
+
362
+ 1. `tree` command with token counts
363
+ 2. `context --section` precise extraction
364
+ 3. Token budgeting (`-t` flag)
365
+ 4. Fast indexing
366
+ 5. Boolean search operators
367
+
368
+ ---
369
+
370
+ _Report generated from Strategy A, B, and C synthesis reports_
371
+ _Total agents contributing: 12 (3 + 3 + 6)_
372
+ _Total commands analyzed: ~389 (100 + 114 + 175)_
373
+ _Documentation corpus: ~207K tokens across 23 files_