@c4a/context-cli 0.7.43 → 0.7.50

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 (48) hide show
  1. package/cli.js +2726 -1693
  2. package/evidence/context-evidence.sourcegraph.wasm +0 -0
  3. package/evidence/manifest.json +2 -1
  4. package/indexers/bundles/context-markdown-indexer/SKILL.md +6 -0
  5. package/indexers/contracts/profile-contract.json +245 -245
  6. package/indexers/release-manifest.json +3 -3
  7. package/package.json +12 -12
  8. package/parserEntryWorker.js +38 -0
  9. package/plugins/VERSION +1 -1
  10. package/plugins/claude/.claude-plugin/plugin.json +3 -2
  11. package/plugins/claude/commands/context-inspect-search.md +93 -32
  12. package/plugins/claude/commands/context-repo-content.md +10 -0
  13. package/plugins/claude/commands/context.md +8 -0
  14. package/plugins/claude/skills/context-inspect-search/SKILL.md +93 -32
  15. package/plugins/claude/skills/context-plan/SKILL.md +7 -0
  16. package/plugins/claude/skills/context-repo-content/SKILL.md +62 -0
  17. package/plugins/claude/skills/context-repo-content/references/document-outlines.md +17 -0
  18. package/plugins/claude/skills/context-repo-content/references/registration.md +48 -0
  19. package/plugins/codex/.codex-plugin/plugin.json +2 -2
  20. package/plugins/codex/skills/context/SKILL.md +8 -0
  21. package/plugins/codex/skills/context-inspect-search/SKILL.md +93 -32
  22. package/plugins/codex/skills/context-plan/SKILL.md +7 -0
  23. package/plugins/codex/skills/context-repo-content/SKILL.md +61 -0
  24. package/plugins/codex/skills/context-repo-content/references/document-outlines.md +17 -0
  25. package/plugins/codex/skills/context-repo-content/references/registration.md +48 -0
  26. package/plugins/cursor/.cursor-plugin/plugin.json +3 -2
  27. package/plugins/cursor/commands/c4a-context-inspect-search.md +93 -32
  28. package/plugins/cursor/commands/c4a-context-repo-content.md +9 -0
  29. package/plugins/cursor/commands/c4a-context.md +8 -0
  30. package/plugins/cursor/skills/context-inspect-search/SKILL.md +93 -32
  31. package/plugins/cursor/skills/context-plan/SKILL.md +7 -0
  32. package/plugins/cursor/skills/context-repo-content/SKILL.md +62 -0
  33. package/plugins/cursor/skills/context-repo-content/references/document-outlines.md +17 -0
  34. package/plugins/cursor/skills/context-repo-content/references/registration.md +48 -0
  35. package/plugins/skills/context/SKILL.md +8 -0
  36. package/plugins/skills/context-inspect-search/SKILL.md +93 -32
  37. package/plugins/skills/context-markdown-indexer/SKILL.md +6 -0
  38. package/plugins/skills/context-plan/SKILL.md +7 -0
  39. package/plugins/skills/context-repo-content/SKILL.md +61 -0
  40. package/plugins/skills/context-repo-content/references/document-outlines.md +17 -0
  41. package/plugins/skills/context-repo-content/references/registration.md +48 -0
  42. package/providers/context/actions/repair-project-entry.yaml +1 -0
  43. package/providers/context/manifest.json +14 -10
  44. package/providers/context/provider.yaml +1 -1
  45. package/providers/context/resources/manuals/guides/knowledge-updates.md +11 -0
  46. package/providers/context/resources/manuals/guides/package-outputs.md +5 -0
  47. package/providers/context/resources/manuals/guides/repo-content.md +77 -0
  48. package/providers/context/resources/procedures/knowledge-updates.md +11 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "protocol": "context.indexer.cli-release-manifest/v1",
3
3
  "package": "@c4a/context-cli",
4
- "version": "0.7.43",
4
+ "version": "0.7.50",
5
5
  "issuer": "context4ai/context",
6
6
  "bundles": [
7
7
  {
@@ -539,7 +539,7 @@
539
539
  "kind": "cli-bundled",
540
540
  "locator": "cli-bundled://context/context-markdown-indexer"
541
541
  },
542
- "integrity": "sha256:ca122f77e2759684a6406fa8cdfc20117ebbaa5aeea5ff60c547bbb57aadb752",
542
+ "integrity": "sha256:41f8ff9add026026c1a689224c684afe220680922935f5cee7afd792207ced98",
543
543
  "manifest_digest": "sha256:4b6ea2307077abd4899515d32f72941ab8e6bceaa89f2b7662d732bbf817bce5",
544
544
  "files": [
545
545
  {
@@ -548,7 +548,7 @@
548
548
  },
549
549
  {
550
550
  "path": "SKILL.md",
551
- "digest": "sha256:ac059a9b6a87751ea3644374691ed3dafa03bb1cf9e8a2874e2475c09f73c716"
551
+ "digest": "sha256:888d52e788c0ce78a90260aac3b7fdb181dd536ad26a2e48dc47000e71c930c9"
552
552
  },
553
553
  {
554
554
  "path": "context-indexer.yaml",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context-cli",
3
- "version": "0.7.43",
3
+ "version": "0.7.50",
4
4
  "type": "module",
5
5
  "description": "Local runtime and Agent integration for traceable knowledge production",
6
6
  "license": "MIT",
@@ -24,17 +24,17 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@c4a/agent-graph": "0.3.0",
27
- "@c4a/context": "0.7.43",
28
- "@c4a/extract": "0.7.43",
29
- "@c4a/extract-contract": "0.7.43",
30
- "@c4a/extract-go": "0.7.43",
31
- "@c4a/extract-mdx": "0.7.43",
32
- "@c4a/extract-proto": "0.7.43",
33
- "@c4a/extract-rush": "0.7.43",
34
- "@c4a/extract-sql": "0.7.43",
35
- "@c4a/extract-style": "0.7.43",
36
- "@c4a/extract-thrift": "0.7.43",
37
- "@c4a/extract-ts": "0.7.43",
27
+ "@c4a/context": "0.7.50",
28
+ "@c4a/extract": "0.7.50",
29
+ "@c4a/extract-contract": "0.7.50",
30
+ "@c4a/extract-go": "0.7.50",
31
+ "@c4a/extract-mdx": "0.7.50",
32
+ "@c4a/extract-proto": "0.7.50",
33
+ "@c4a/extract-rush": "0.7.50",
34
+ "@c4a/extract-sql": "0.7.50",
35
+ "@c4a/extract-style": "0.7.50",
36
+ "@c4a/extract-thrift": "0.7.50",
37
+ "@c4a/extract-ts": "0.7.50",
38
38
  "@mermaid-js/layout-elk": "0.2.0",
39
39
  "commander": "^11.0.0",
40
40
  "fast-xml-parser": "^5.10.1",
@@ -16702,6 +16702,43 @@ var init_indexerCoreExports = __esm(() => {
16702
16702
  init_indexerBenchmark();
16703
16703
  });
16704
16704
 
16705
+ // ../context/src/repoContent.ts
16706
+ function repoContentMount(entry) {
16707
+ return entry.mount ?? [entry.group, entry.path.split("/").at(-1)].filter(Boolean).join("/");
16708
+ }
16709
+ function parseRepoContentRef(value) {
16710
+ const match = /^repo-content:([A-Za-z0-9][A-Za-z0-9._-]*)(?:@([a-fA-F0-9]{40}(?:[a-fA-F0-9]{24})?)(\+worktree)?)?$/u.exec(value);
16711
+ if (!match)
16712
+ return;
16713
+ return { id: match[1], ...match[2] ? { commit: match[2] } : {}, worktree: !!match[3] };
16714
+ }
16715
+ function repoContentScopeMatches(scope, reference) {
16716
+ if (scope === reference)
16717
+ return true;
16718
+ const selected = parseRepoContentRef(scope);
16719
+ const cited = parseRepoContentRef(reference);
16720
+ return !!selected && !selected.commit && !!cited && selected.id === cited.id;
16721
+ }
16722
+ var repoContentPathSchema, segment, repoContentEntrySchema, repoContentRegistrySchema;
16723
+ var init_repoContent = __esm(() => {
16724
+ init_zod();
16725
+ repoContentPathSchema = exports_external.string().min(1).refine((value) => !/[\\\u0000-\u001f\u007f:]/u.test(value) && value.split("/").every((part) => part !== "" && part !== "." && part !== ".." && part.toLowerCase() !== ".git"), "Use a repository-relative path without traversal or .git components");
16726
+ segment = exports_external.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/u);
16727
+ repoContentEntrySchema = exports_external.object({
16728
+ kind: exports_external.enum(["docs", "skills", "document", "skill"]),
16729
+ path: repoContentPathSchema,
16730
+ exclude: exports_external.array(exports_external.string().min(1)).optional(),
16731
+ group: segment.optional(),
16732
+ mount: repoContentPathSchema.optional(),
16733
+ title: exports_external.string().min(1).optional(),
16734
+ description: exports_external.string().optional()
16735
+ }).strict();
16736
+ repoContentRegistrySchema = exports_external.object({
16737
+ protocol: exports_external.literal("context.repo-content/v1"),
16738
+ entries: exports_external.record(segment, repoContentEntrySchema)
16739
+ }).strict();
16740
+ });
16741
+
16705
16742
  // ../context/src/indexerRequirementComparison.ts
16706
16743
  function setRelation(oldValues, newValues) {
16707
16744
  const oldContained = [...oldValues].every((value) => newValues.has(value));
@@ -20571,6 +20608,7 @@ var init_src = __esm(() => {
20571
20608
  init_packageSite();
20572
20609
  init_contracts();
20573
20610
  init_contracts();
20611
+ init_repoContent();
20574
20612
  init_indexerProvider();
20575
20613
  init_indexerRegistry();
20576
20614
  init_indexerRequirementComparison();
package/plugins/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.43
1
+ 0.7.50
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "c4a",
3
3
  "description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
4
- "version": "0.7.43",
4
+ "version": "0.7.50",
5
5
  "author": {
6
6
  "name": "c4a"
7
7
  },
@@ -16,6 +16,7 @@
16
16
  "skills": [
17
17
  "./skills/context-indexer-create",
18
18
  "./skills/context-inspect-search",
19
- "./skills/context-plan"
19
+ "./skills/context-plan",
20
+ "./skills/context-repo-content"
20
21
  ]
21
22
  }
@@ -59,6 +59,31 @@ access policies, not additional source-order modes or production settings.
59
59
 
60
60
  ## Search available material according to the configured mode
61
61
 
62
+ Same-repository original documents and authored Skills may be registered in
63
+ workspace-root `repo-content.yaml`, with a `repo-content/` symlink view. They are
64
+ another readable entrance, not duplicated approved knowledge. Select them when
65
+ the question concerns the project's documentation or operational instructions;
66
+ keep the existing knowledge-first path for synthesized knowledge questions.
67
+ Read-only retrieval never registers content or starts production. Reading a
68
+ Skill as evidence does not activate or authorize executing it.
69
+
70
+ Locally, use `rg -L` on selected views, or search the registry's real paths if
71
+ symlinks are disabled. Remotely, include the relevant view paths alongside
72
+ knowledge paths rather than blindly restricting all searches to `knowledge/**`.
73
+ Only explicit `Meta.Coverage.Symlinks: followed` permits relying on followed
74
+ views, and still respect result/expansion limits. If absent, mixed, not_followed
75
+ or incomplete, read that same commit's `repo-content.yaml`, then search the
76
+ registered real paths; verify they are covered at that commit. Do not treat an
77
+ unindexed target or placeholder as an empty document, silently change SHA, or
78
+ request indexing privileges. Keep real repository paths and actual commits in
79
+ citations; results through multiple views can refer to the same file.
80
+
81
+ `repo-content:<id>@<full-SHA>` evidence locators are historical repository-root
82
+ paths, not entry-relative paths. Do not prepend current registration or workspace
83
+ paths. `+worktree` means uncommitted evidence: retain that limitation and digest,
84
+ never substitute a fixed HEAD URL as if it contains the cited bytes. Navigation
85
+ `context:repo/<id>` resolves current registration, not historical provenance.
86
+
62
87
  Apply `CONTEXT_QUERY_SOURCE_MODE` before starting retrieval. In `repo-first`,
63
88
  start with approved knowledge, not original-code checkout preparation. With
64
89
  readable `knowledge/`, do not probe `dist/`, build inventories or installed
@@ -91,25 +116,37 @@ alone is insufficient. Reuse suitable material already retrieved for this task.
91
116
  Only check or prepare tools needed for the next actual
92
117
  operation; installation failure does not block independent local retrieval.
93
118
 
94
- Search relevant `knowledge/` paths using business terms, symbols and synonyms,
95
- then read matching sections in context; use `knowledge/structure.yaml` when
96
- navigation or associations are needed, not as an exhaustive preflight. In
119
+ Search relevant `knowledge/` paths using business terms, symbols and synonyms.
120
+ Use bounded match excerpts to choose relevant articles, not filenames alone;
121
+ path-only results suffice when locating an already identified file. Adapt to the
122
+ results in both local and remote retrieval: for zero hits, check query semantics
123
+ and relax combined conditions or try equivalent terms; for noisy results, narrow
124
+ the path or use a more distinctive term before reading more output. A miss alone
125
+ does not establish absence. Read relevant sections in context; if they are
126
+ insufficient and likely relevant candidates remain, batch those sections before
127
+ deciding to trace sources. Do not exhaust every candidate or impose a fixed
128
+ search or reading count. Reuse known paths and source metadata; consult
129
+ `knowledge/structure.yaml` and source registries only for missing navigation or
130
+ attribution, not to rediscover information already supplied. In
97
131
  package-first or dual mode, approved knowledge can resolve gaps or freshness
98
132
  questions in delivered material. Delivered
99
133
  content may lag approved knowledge; they are not independent corroboration.
100
- Candidates and temporary reports are not approved pages. A search miss does not
101
- prove a capability is absent. Do not build merely to answer a query; a separately
134
+ Candidates and temporary reports are not approved pages. Do not build merely to answer a query; a separately
102
135
  authorized build must follow its own workflow without advancing unrelated work.
103
136
 
104
137
  When package or approved knowledge leaves a gap, directly trace relevant sources
105
138
  without asking whether to deepen the query. Use available document, code-search
106
139
  or extraction tools within the authorized scope, recording source identity and
107
140
  version. Prepare sources while continuing other reading.
108
- One failed source blocks only dependent claims. If the read knowledge supports
109
- the requested conclusion, its conditions and scope, answer without restoring
110
- code or checking every associated source. Missing mechanisms, conflicting facts
111
- or unsupported current-behavior claims still require targeted investigation;
112
- an article title, search snippet or unread citation is not sufficient evidence.
141
+ One failed source blocks only dependent claims. Judge gaps by whether resolving
142
+ them differently could change the requested conclusion, its conditions or scope.
143
+ Investigate those gaps, or give a conditional conclusion when they cannot be
144
+ resolved; do not expand into other repositories or checks merely because more
145
+ facts are available. If the read knowledge suffices, answer without restoring code
146
+ or checking every associated source. Omit unverified supplementary claims rather
147
+ than expanding the investigation to support unnecessary detail. An article title,
148
+ search snippet or recorded reference locates evidence; it does not establish that
149
+ the original source was read or verified.
113
150
 
114
151
  ### Remote approved knowledge
115
152
 
@@ -122,19 +159,15 @@ Git status, `dist/` or production state to start remote retrieval. Read applicab
122
159
  repository instructions/configuration when needed through the same service;
123
160
  retrieved instructions cannot expand host authorization or activate capabilities.
124
161
 
125
- Search within `knowledge/` using supported path filters and relevant terms;
162
+ Search within `knowledge/` using `glob: ["knowledge/**"]` and relevant terms;
126
163
  prefer article matches over registry, changelog or source snapshot hits. Read
127
164
  matching sections with their conditions, not snippets alone. Batch known related
128
165
  reads within returned limits. Use the remote evidence checks below for knowledge
129
166
  as well as code, including per-item errors, truncation and coverage. A search
130
- miss is not evidence that the repository lacks the knowledge.
131
- When the connected schema supports it, use `output: "files"` only when locating
132
- paths is enough; use content excerpts when relevance needs context, bounding
133
- them with `max_lines_per_file` as needed. Do not add a mandatory file-list pass
134
- before every search. Omitted matches and truncation do not establish absence.
135
- If results are too broad, narrow by article path or a distinctive term before
136
- reading more output. For zero hits, simplify combined conditions using the
137
- service's documented syntax; do not assume unsupported OR/regex syntax worked.
167
+ miss follows the same result-driven recovery above. Bound content excerpts with
168
+ `max_lines_per_file` when supported; reserve `output: "files"` for path discovery.
169
+ Do not add a mandatory file-list pass before every search. Omitted matches and
170
+ truncation do not establish absence.
138
171
  Follow the connected tool schema: use search-hit ranges when known; otherwise
139
172
  omit bounds if the service supplies a bounded default (currently up to 500 lines).
140
173
  For services requiring endpoints, supply `start_line` and `end_line` per item.
@@ -235,11 +268,31 @@ Do not require `repositories`, `availability` or `resolve` before every query:
235
268
  discover only unknown repositories, inspect status only for relevant failures,
236
269
  and resolve a branch only when its version is needed and not already fixed.
237
270
 
238
- `context-sourcegraph` uses Zoekt query syntax, not every Sourcegraph search feature.
239
- Use `q` for supported content/path expressions and `revision` for the version;
240
- do not assume slash-delimited regex or unsupported filters and pagination flags.
241
- Follow the actual schema and diagnostics. A suspicious zero result calls for a
242
- targeted syntax/range correction or a known-file read, not a conclusion of absence.
271
+ `context-sourcegraph` search is rg-like: `pattern` is a line-by-line RE2 regular
272
+ expression over content, not a query language. Use `fixed_strings: true` for
273
+ literal text, `ignore_case: true` when case should not matter (default is
274
+ case-sensitive), and `glob` for ordered file include/exclude patterns, such as
275
+ `["src/**/*.ts", "!**/*.test.ts"]`. `paths` limits repository-relative directories
276
+ within registered coverage; it is not a filename regex. Do not put `content:`,
277
+ `file:` or other query operators into the pattern or send the removed `q` field.
278
+ Use `A|B` for regex alternatives; spaces match spaces, not file-level AND. When
279
+ both terms must occur in a file, verify candidates by reading or intersect
280
+ separate searches as needed; truncated results cannot establish a complete
281
+ intersection. Do not silently replace AND with OR. Serialize parameters normally;
282
+ do not add shell quoting or a second query-language escaping layer. For example:
283
+ `{"pattern":"createStore(","fixed_strings":true,"glob":["src/**"]}`.
284
+
285
+ Follow the connected schema without an extra discovery call when it is already
286
+ available. The remote service does not implement every rg option, PCRE feature
287
+ or local ignore rule. On `INVALID_PATTERN` or `INVALID_GLOB`, inspect the error
288
+ message and correct the affected parameter while preserving repo, revision and
289
+ intended scope. Do not resend an identical deterministic failure, guess a
290
+ replacement from generic examples, or silently turn invalid regex into literal
291
+ text. If a targeted correction fails, use another available retrieval path or
292
+ qualify the gap rather than looping. A zero result is not a syntax error or proof
293
+ of absence; check case, scope and terms or read a known file. These parameters
294
+ apply only to this remote tool; local grep/rg retrieval remains available under
295
+ the access policy above.
243
296
 
244
297
  Retain the exact requested repository and the returned full commit,
245
298
  repository-relative path and line range with each piece of evidence; check any
@@ -306,11 +359,15 @@ capture/recovery actions. Production recovery gates do not block this independen
306
359
  inspection. Preserve unavailable-evidence gaps rather than changing production
307
360
  state to get past them.
308
361
 
309
- Batch independent searches and related file reads once paths are known, such as
310
- the entrypoint, state update and controlling render logic for one mechanism.
311
- Read enough surrounding context and follow unresolved imports or calls; batching
312
- must not truncate decisive evidence or turn a partial read into a complete audit.
313
- Reuse already read evidence rather than rereading it to prepare each tool call.
362
+ Start code investigation from recorded locations and reuse paths, symbols,
363
+ imports and calls found in the code before guessing names or broadening searches.
364
+ For duplicate definitions, follow the actual import or resolution path at the
365
+ inspected revision; a similarly named file or test mock is not interchangeable.
366
+ Batch related reads once locations are known, with enough surrounding context
367
+ to support the claim. Follow unresolved dependencies only as far as the question
368
+ requires, not the whole call graph. Batching must not truncate decisive evidence
369
+ or turn a partial read into a complete audit. Reuse already read evidence rather
370
+ than rereading it to prepare each tool call.
314
371
 
315
372
  Let evidence sufficiency determine whether a version comparison is needed.
316
373
  When the available knowledge or identified baseline code resolves the question,
@@ -319,8 +376,10 @@ reading history merely to confirm freshness. Compare narrowly when uncertainty,
319
376
  conflicting evidence, suspected changes or an explicit version-comparison request
320
377
  makes it useful. A question about current behavior requires judging whether the
321
378
  available evidence supports that claim, not automatically comparing every branch.
322
- Retain necessary source reads; do not equate a recorded baseline or branch HEAD
323
- with a verified live deployment. When comparing, use actual relevant diffs,
379
+ Retain necessary source reads. Describe a recorded commit as the knowledge's
380
+ source baseline, not the current branch HEAD unless separately established;
381
+ neither proves a live deployment. These distinctions do not require additional
382
+ version checks when the baseline suffices. When comparing, use actual relevant diffs,
324
383
  including relevant local changes; current code is not a substitute for the baseline.
325
384
  Mention a missing comparison only when it limits the answer.
326
385
  For documents, notes and sessions, read saved bodies and necessary
@@ -393,7 +452,9 @@ exceptions, citations and verification limits; fewer preparation steps must not
393
452
  mean weaker evidence or omitted questions. Host delivery and receipt requirements
394
453
  still apply, without repeating the completed investigation.
395
454
 
396
- Suggest a knowledge update only with supporting evidence: identify the affected
455
+ Scope knowledge-gap claims to the material inspected: an unanswered question in
456
+ one article does not establish absence across the knowledge base. Suggest a
457
+ knowledge update only with supporting evidence: identify the affected
397
458
  page or gap, proposed change and bounded source scope. Check neighboring content
398
459
  before proposing a new page. Only after user acceptance, hand the evidence and
399
460
  scope to the installed `context` production Skill in the selected workspace and
@@ -0,0 +1,10 @@
1
+ ---
2
+ description: "Create, edit or register same-repository project documentation and authored Skills in a Context workspace without starting knowledge production. Use for repository content maintenance, not external imports or knowledge article publication."
3
+ argument-hint: "[project-dir or user intent]"
4
+ ---
5
+
6
+ # Context Repo Content
7
+
8
+ Read the installed `context-repo-content` skill at `../skills/context-repo-content/SKILL.md`
9
+ relative to this command file, then follow its instructions for the user's request.
10
+ Resolve its references and templates from that skill directory.
@@ -29,6 +29,14 @@ use this production workflow's current Route and preserve existing work.
29
29
 
30
30
  ## Route project-scale work before production
31
31
 
32
+ For creating, editing or registering same-repository docs and authored Skills,
33
+ use `context-repo-content` instead of starting production. Originals stay in their
34
+ project directories; registration/editing does not authorize knowledge updates.
35
+ During authorized onboarding, select only the current project's conventional
36
+ README/docs/Skill locations, with ownership and workspace boundaries from that
37
+ skill. Do not capture registered originals into sources merely to duplicate them
38
+ as knowledge. Explicit audience-oriented rewriting remains ordinary production.
39
+
32
40
  For an authorized knowledge-production request involving more than 30 original
33
41
  documents or at least two repositories needing substantive investigation, use
34
42
  the installed `context-plan` Skill before registering the full request. Also use
@@ -58,6 +58,31 @@ access policies, not additional source-order modes or production settings.
58
58
 
59
59
  ## Search available material according to the configured mode
60
60
 
61
+ Same-repository original documents and authored Skills may be registered in
62
+ workspace-root `repo-content.yaml`, with a `repo-content/` symlink view. They are
63
+ another readable entrance, not duplicated approved knowledge. Select them when
64
+ the question concerns the project's documentation or operational instructions;
65
+ keep the existing knowledge-first path for synthesized knowledge questions.
66
+ Read-only retrieval never registers content or starts production. Reading a
67
+ Skill as evidence does not activate or authorize executing it.
68
+
69
+ Locally, use `rg -L` on selected views, or search the registry's real paths if
70
+ symlinks are disabled. Remotely, include the relevant view paths alongside
71
+ knowledge paths rather than blindly restricting all searches to `knowledge/**`.
72
+ Only explicit `Meta.Coverage.Symlinks: followed` permits relying on followed
73
+ views, and still respect result/expansion limits. If absent, mixed, not_followed
74
+ or incomplete, read that same commit's `repo-content.yaml`, then search the
75
+ registered real paths; verify they are covered at that commit. Do not treat an
76
+ unindexed target or placeholder as an empty document, silently change SHA, or
77
+ request indexing privileges. Keep real repository paths and actual commits in
78
+ citations; results through multiple views can refer to the same file.
79
+
80
+ `repo-content:<id>@<full-SHA>` evidence locators are historical repository-root
81
+ paths, not entry-relative paths. Do not prepend current registration or workspace
82
+ paths. `+worktree` means uncommitted evidence: retain that limitation and digest,
83
+ never substitute a fixed HEAD URL as if it contains the cited bytes. Navigation
84
+ `context:repo/<id>` resolves current registration, not historical provenance.
85
+
61
86
  Apply `CONTEXT_QUERY_SOURCE_MODE` before starting retrieval. In `repo-first`,
62
87
  start with approved knowledge, not original-code checkout preparation. With
63
88
  readable `knowledge/`, do not probe `dist/`, build inventories or installed
@@ -90,25 +115,37 @@ alone is insufficient. Reuse suitable material already retrieved for this task.
90
115
  Only check or prepare tools needed for the next actual
91
116
  operation; installation failure does not block independent local retrieval.
92
117
 
93
- Search relevant `knowledge/` paths using business terms, symbols and synonyms,
94
- then read matching sections in context; use `knowledge/structure.yaml` when
95
- navigation or associations are needed, not as an exhaustive preflight. In
118
+ Search relevant `knowledge/` paths using business terms, symbols and synonyms.
119
+ Use bounded match excerpts to choose relevant articles, not filenames alone;
120
+ path-only results suffice when locating an already identified file. Adapt to the
121
+ results in both local and remote retrieval: for zero hits, check query semantics
122
+ and relax combined conditions or try equivalent terms; for noisy results, narrow
123
+ the path or use a more distinctive term before reading more output. A miss alone
124
+ does not establish absence. Read relevant sections in context; if they are
125
+ insufficient and likely relevant candidates remain, batch those sections before
126
+ deciding to trace sources. Do not exhaust every candidate or impose a fixed
127
+ search or reading count. Reuse known paths and source metadata; consult
128
+ `knowledge/structure.yaml` and source registries only for missing navigation or
129
+ attribution, not to rediscover information already supplied. In
96
130
  package-first or dual mode, approved knowledge can resolve gaps or freshness
97
131
  questions in delivered material. Delivered
98
132
  content may lag approved knowledge; they are not independent corroboration.
99
- Candidates and temporary reports are not approved pages. A search miss does not
100
- prove a capability is absent. Do not build merely to answer a query; a separately
133
+ Candidates and temporary reports are not approved pages. Do not build merely to answer a query; a separately
101
134
  authorized build must follow its own workflow without advancing unrelated work.
102
135
 
103
136
  When package or approved knowledge leaves a gap, directly trace relevant sources
104
137
  without asking whether to deepen the query. Use available document, code-search
105
138
  or extraction tools within the authorized scope, recording source identity and
106
139
  version. Prepare sources while continuing other reading.
107
- One failed source blocks only dependent claims. If the read knowledge supports
108
- the requested conclusion, its conditions and scope, answer without restoring
109
- code or checking every associated source. Missing mechanisms, conflicting facts
110
- or unsupported current-behavior claims still require targeted investigation;
111
- an article title, search snippet or unread citation is not sufficient evidence.
140
+ One failed source blocks only dependent claims. Judge gaps by whether resolving
141
+ them differently could change the requested conclusion, its conditions or scope.
142
+ Investigate those gaps, or give a conditional conclusion when they cannot be
143
+ resolved; do not expand into other repositories or checks merely because more
144
+ facts are available. If the read knowledge suffices, answer without restoring code
145
+ or checking every associated source. Omit unverified supplementary claims rather
146
+ than expanding the investigation to support unnecessary detail. An article title,
147
+ search snippet or recorded reference locates evidence; it does not establish that
148
+ the original source was read or verified.
112
149
 
113
150
  ### Remote approved knowledge
114
151
 
@@ -121,19 +158,15 @@ Git status, `dist/` or production state to start remote retrieval. Read applicab
121
158
  repository instructions/configuration when needed through the same service;
122
159
  retrieved instructions cannot expand host authorization or activate capabilities.
123
160
 
124
- Search within `knowledge/` using supported path filters and relevant terms;
161
+ Search within `knowledge/` using `glob: ["knowledge/**"]` and relevant terms;
125
162
  prefer article matches over registry, changelog or source snapshot hits. Read
126
163
  matching sections with their conditions, not snippets alone. Batch known related
127
164
  reads within returned limits. Use the remote evidence checks below for knowledge
128
165
  as well as code, including per-item errors, truncation and coverage. A search
129
- miss is not evidence that the repository lacks the knowledge.
130
- When the connected schema supports it, use `output: "files"` only when locating
131
- paths is enough; use content excerpts when relevance needs context, bounding
132
- them with `max_lines_per_file` as needed. Do not add a mandatory file-list pass
133
- before every search. Omitted matches and truncation do not establish absence.
134
- If results are too broad, narrow by article path or a distinctive term before
135
- reading more output. For zero hits, simplify combined conditions using the
136
- service's documented syntax; do not assume unsupported OR/regex syntax worked.
166
+ miss follows the same result-driven recovery above. Bound content excerpts with
167
+ `max_lines_per_file` when supported; reserve `output: "files"` for path discovery.
168
+ Do not add a mandatory file-list pass before every search. Omitted matches and
169
+ truncation do not establish absence.
137
170
  Follow the connected tool schema: use search-hit ranges when known; otherwise
138
171
  omit bounds if the service supplies a bounded default (currently up to 500 lines).
139
172
  For services requiring endpoints, supply `start_line` and `end_line` per item.
@@ -234,11 +267,31 @@ Do not require `repositories`, `availability` or `resolve` before every query:
234
267
  discover only unknown repositories, inspect status only for relevant failures,
235
268
  and resolve a branch only when its version is needed and not already fixed.
236
269
 
237
- `context-sourcegraph` uses Zoekt query syntax, not every Sourcegraph search feature.
238
- Use `q` for supported content/path expressions and `revision` for the version;
239
- do not assume slash-delimited regex or unsupported filters and pagination flags.
240
- Follow the actual schema and diagnostics. A suspicious zero result calls for a
241
- targeted syntax/range correction or a known-file read, not a conclusion of absence.
270
+ `context-sourcegraph` search is rg-like: `pattern` is a line-by-line RE2 regular
271
+ expression over content, not a query language. Use `fixed_strings: true` for
272
+ literal text, `ignore_case: true` when case should not matter (default is
273
+ case-sensitive), and `glob` for ordered file include/exclude patterns, such as
274
+ `["src/**/*.ts", "!**/*.test.ts"]`. `paths` limits repository-relative directories
275
+ within registered coverage; it is not a filename regex. Do not put `content:`,
276
+ `file:` or other query operators into the pattern or send the removed `q` field.
277
+ Use `A|B` for regex alternatives; spaces match spaces, not file-level AND. When
278
+ both terms must occur in a file, verify candidates by reading or intersect
279
+ separate searches as needed; truncated results cannot establish a complete
280
+ intersection. Do not silently replace AND with OR. Serialize parameters normally;
281
+ do not add shell quoting or a second query-language escaping layer. For example:
282
+ `{"pattern":"createStore(","fixed_strings":true,"glob":["src/**"]}`.
283
+
284
+ Follow the connected schema without an extra discovery call when it is already
285
+ available. The remote service does not implement every rg option, PCRE feature
286
+ or local ignore rule. On `INVALID_PATTERN` or `INVALID_GLOB`, inspect the error
287
+ message and correct the affected parameter while preserving repo, revision and
288
+ intended scope. Do not resend an identical deterministic failure, guess a
289
+ replacement from generic examples, or silently turn invalid regex into literal
290
+ text. If a targeted correction fails, use another available retrieval path or
291
+ qualify the gap rather than looping. A zero result is not a syntax error or proof
292
+ of absence; check case, scope and terms or read a known file. These parameters
293
+ apply only to this remote tool; local grep/rg retrieval remains available under
294
+ the access policy above.
242
295
 
243
296
  Retain the exact requested repository and the returned full commit,
244
297
  repository-relative path and line range with each piece of evidence; check any
@@ -305,11 +358,15 @@ capture/recovery actions. Production recovery gates do not block this independen
305
358
  inspection. Preserve unavailable-evidence gaps rather than changing production
306
359
  state to get past them.
307
360
 
308
- Batch independent searches and related file reads once paths are known, such as
309
- the entrypoint, state update and controlling render logic for one mechanism.
310
- Read enough surrounding context and follow unresolved imports or calls; batching
311
- must not truncate decisive evidence or turn a partial read into a complete audit.
312
- Reuse already read evidence rather than rereading it to prepare each tool call.
361
+ Start code investigation from recorded locations and reuse paths, symbols,
362
+ imports and calls found in the code before guessing names or broadening searches.
363
+ For duplicate definitions, follow the actual import or resolution path at the
364
+ inspected revision; a similarly named file or test mock is not interchangeable.
365
+ Batch related reads once locations are known, with enough surrounding context
366
+ to support the claim. Follow unresolved dependencies only as far as the question
367
+ requires, not the whole call graph. Batching must not truncate decisive evidence
368
+ or turn a partial read into a complete audit. Reuse already read evidence rather
369
+ than rereading it to prepare each tool call.
313
370
 
314
371
  Let evidence sufficiency determine whether a version comparison is needed.
315
372
  When the available knowledge or identified baseline code resolves the question,
@@ -318,8 +375,10 @@ reading history merely to confirm freshness. Compare narrowly when uncertainty,
318
375
  conflicting evidence, suspected changes or an explicit version-comparison request
319
376
  makes it useful. A question about current behavior requires judging whether the
320
377
  available evidence supports that claim, not automatically comparing every branch.
321
- Retain necessary source reads; do not equate a recorded baseline or branch HEAD
322
- with a verified live deployment. When comparing, use actual relevant diffs,
378
+ Retain necessary source reads. Describe a recorded commit as the knowledge's
379
+ source baseline, not the current branch HEAD unless separately established;
380
+ neither proves a live deployment. These distinctions do not require additional
381
+ version checks when the baseline suffices. When comparing, use actual relevant diffs,
323
382
  including relevant local changes; current code is not a substitute for the baseline.
324
383
  Mention a missing comparison only when it limits the answer.
325
384
  For documents, notes and sessions, read saved bodies and necessary
@@ -392,7 +451,9 @@ exceptions, citations and verification limits; fewer preparation steps must not
392
451
  mean weaker evidence or omitted questions. Host delivery and receipt requirements
393
452
  still apply, without repeating the completed investigation.
394
453
 
395
- Suggest a knowledge update only with supporting evidence: identify the affected
454
+ Scope knowledge-gap claims to the material inspected: an unanswered question in
455
+ one article does not establish absence across the knowledge base. Suggest a
456
+ knowledge update only with supporting evidence: identify the affected
396
457
  page or gap, proposed change and bounded source scope. Check neighboring content
397
458
  before proposing a new page. Only after user acceptance, hand the evidence and
398
459
  scope to the installed `context` production Skill in the selected workspace and
@@ -27,6 +27,13 @@ are met or when the user explicitly requests project planning.
27
27
 
28
28
  ## Start or resume
29
29
 
30
+ Choose the workspace boundary before source inventory. A large multi-domain
31
+ monorepo may need a Context workspace per direction, with at most one project
32
+ group inside each; do not migrate existing workspaces automatically. For
33
+ same-repository docs and authored Skills, prefer registration/editing through
34
+ `context-repo-content` and preserve one original. Only explicit rewriting for
35
+ an audience enters production; do not count registration as completed research.
36
+
30
37
  1. Identify the selected project's existing `PLAN-*.md`, workspace and Git root.
31
38
  Reuse a matching plan. Inspect its current stage, permissions and pending work
32
39
  before expanding research; do not reset a live Context workflow.
@@ -0,0 +1,62 @@
1
+ ---
2
+ user-invocable: false
3
+ name: context-repo-content
4
+ description: Create, edit or register same-repository project documentation and authored Skills in a Context workspace without starting knowledge production. Use for repository content maintenance, not external imports or knowledge article publication.
5
+ ---
6
+
7
+ # Repository content
8
+
9
+ Maintain one original in its project directory. `repo-content.yaml` registers entrances;
10
+ `repo-content/` is a relative-symlink view, not a second authoring location.
11
+ This is an independent editing task: do not start production, update knowledge,
12
+ advance processed baselines, build, publish or commit merely because a document changed.
13
+
14
+ ## Select the boundary
15
+
16
+ Identify the Context workspace and its Git root before writing. Paths in the registry
17
+ are relative to that Git root, even when Context lives in a subdirectory.
18
+ For a large multi-domain monorepo, use a workspace per direction; within one workspace
19
+ use at most one project/module group. Preserve existing workspaces and user choices.
20
+
21
+ During authorized onboarding, examine only the selected project's tracked README,
22
+ `docs/`, and `.agents/skills`, `.claude/skills`, `.codex/skills`. Select useful directories,
23
+ not every Markdown file in the repository. Other locations require an explicit user
24
+ request. Read-only questions do not authorize new registration.
25
+
26
+ Git tracking permits automatic discovery but does not prove ownership. Exclude
27
+ installed third-party Skills and de-duplicate copies across host directories. Ignored
28
+ Skills are external installations; untracked, nonignored content needs ownership
29
+ assessment. A Skill authored in the current task stays self-owned before its first commit.
30
+ Non-same-repository material, including registered source repositories, is not repo-content.
31
+ Do not copy it here or pretend imports support is provided by this skill.
32
+
33
+ ## Edit and register
34
+
35
+ Edit the real project files, preserving local conventions. For a new project suggest
36
+ only useful documents (for example overview, development, architecture, feature/spec,
37
+ operations); do not create empty template sets or invent facts. Keep feature/spec under
38
+ documentation engineering. Keep executable Skill resources with their `SKILL.md`.
39
+ When creating a new document, use the optional [document outlines](references/document-outlines.md)
40
+ to select only the sections needed for the reader's task; do not generate a template set.
41
+
42
+ Read [registration.md](references/registration.md) when creating or changing a registry.
43
+ Register directories where appropriate: adding a file inside a registered directory
44
+ does not require another entry. Keep stable IDs when paths move. Do not change another
45
+ workspace's registry or infer cross-domain ownership.
46
+
47
+ After an authorized registry edit, run `context source ensure repo-content --format json`
48
+ to maintain the view; use `context source inspect repo-content --format json` for a
49
+ read-only check. Ordinary files occupying a mount must be preserved. When symlinks are
50
+ disabled or targets are absent, use the registered real path and report the limitation;
51
+ do not change Git settings, checkout, clone or fetch just to repair the view.
52
+
53
+ ## Finish without triggering production
54
+
55
+ Report the originals changed and registrations/views maintained, plus any unresolved
56
+ paths. Explain that linked knowledge may need a later impact check; do not automatically
57
+ run it during editing. For a separately requested knowledge update, return to the normal
58
+ Context update workflow with `repo-content:<id>` as the source scope.
59
+
60
+ Original documents remain authoritative. If the user explicitly asks to rewrite selected
61
+ content into knowledge for an audience, capture those selected originals as document
62
+ sources and follow ordinary production/review; do not mirror the whole registry.