@c4a/context-cli 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +48 -10
- package/README.zh-CN.md +176 -0
- package/cli.js +60700 -35477
- package/docs/quickstart.md +23 -5
- package/package.json +4 -2
- package/plugins/README.md +60 -118
- package/plugins/README_CN.md +51 -102
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/commands/continue.md +56 -10
- package/plugins/claude/commands/init.md +24 -11
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/continue/SKILL.md +56 -11
- package/plugins/codex/skills/init/SKILL.md +23 -11
- package/plugins/cursor/.cursor-plugin/plugin.json +2 -3
- package/plugins/cursor/README.md +2 -2
- package/plugins/cursor/commands/context-continue.md +56 -10
- package/plugins/cursor/commands/context-init.md +24 -11
- package/plugins/skills/context-continue/SKILL.md +56 -11
- package/plugins/skills/context-init/SKILL.md +23 -11
- package/providers/context/actions/accept-package-templates.yaml +5 -0
- package/providers/context/actions/align-next.yaml +6 -0
- package/providers/context/actions/apply-managed-review.yaml +5 -0
- package/providers/context/actions/apply-structure-confirmation.yaml +5 -0
- package/providers/context/actions/build-next.yaml +5 -0
- package/providers/context/actions/capture-next.yaml +5 -0
- package/providers/context/actions/close-approved-knowledge.yaml +5 -0
- package/providers/context/actions/compile-next.yaml +5 -0
- package/providers/context/actions/configure-code-extraction.yaml +5 -0
- package/providers/context/actions/configure-document-capture.yaml +5 -0
- package/providers/context/actions/configure-package-output.yaml +5 -0
- package/providers/context/actions/configure-prose-lifecycle.yaml +5 -0
- package/providers/context/actions/ensure-repository-sources.yaml +5 -0
- package/providers/context/actions/extract-next.yaml +5 -0
- package/providers/context/actions/inspect-document-classification.yaml +5 -0
- package/providers/context/actions/inspect-review.yaml +5 -0
- package/providers/context/actions/inspect-structure.yaml +5 -0
- package/providers/context/actions/maintain-evidence.yaml +6 -0
- package/providers/context/actions/materialize-context-view.yaml +8 -0
- package/providers/context/actions/register-source-batch.yaml +7 -0
- package/providers/context/actions/repair-project-entry.yaml +5 -0
- package/providers/context/actions/repair-verification.yaml +5 -0
- package/providers/context/actions/repair-workspace-state.yaml +5 -0
- package/providers/context/codes.yaml +40 -0
- package/providers/context/graphs/workspace.yaml +494 -0
- package/providers/context/manifest.json +637 -0
- package/providers/context/provider.yaml +12 -0
- package/providers/context/resources/diagnostics/projection-stale.md +13 -0
- package/providers/context/resources/diagnostics/verification.md +21 -0
- package/providers/context/resources/diagnostics/workspace-state.md +27 -0
- package/providers/context/resources/dialogue/code-extraction.md +34 -0
- package/providers/context/resources/dialogue/document-capture.md +29 -0
- package/providers/context/resources/dialogue/document-classification.md +33 -0
- package/providers/context/resources/dialogue/evidence-maintenance.md +26 -0
- package/providers/context/resources/dialogue/human-gates.md +34 -0
- package/providers/context/resources/dialogue/knowledge-review.md +27 -0
- package/providers/context/resources/dialogue/package-output.md +30 -0
- package/providers/context/resources/dialogue/source-boundary.md +29 -0
- package/providers/context/resources/dialogue/structure-confirmation.md +44 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +259 -0
- package/providers/context/resources/manuals/reference/package-templates.md +378 -0
- package/providers/context/resources/manuals/reference/project-api.md +789 -0
- package/providers/context/resources/manuals/reference/template-variables.md +248 -0
- package/providers/context/resources/procedures/close-and-build.md +21 -0
- package/providers/context/resources/procedures/code-extraction.md +50 -0
- package/providers/context/resources/procedures/document-capture.md +45 -0
- package/providers/context/resources/procedures/document-classification.md +22 -0
- package/providers/context/resources/procedures/evidence-maintenance.md +20 -0
- package/providers/context/resources/procedures/knowledge-review.md +24 -0
- package/providers/context/resources/procedures/package-output.md +37 -0
- package/providers/context/resources/procedures/project-configuration.md +21 -0
- package/providers/context/resources/procedures/prose-align.md +68 -0
- package/providers/context/resources/procedures/prose-compile.md +23 -0
- package/providers/context/resources/procedures/source-boundary.md +48 -0
- package/{plugins/codex/skills/init/references/internal-procedures/skill-source-scope/references/capture-source.md → providers/context/resources/procedures/source-capture-detailed.md} +41 -19
- package/providers/context/resources/procedures/verify-and-repair.md +19 -0
- package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/candidate-resolution.md +17 -2
- package/{plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/density-profile.md +11 -0
- package/{plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references → providers/context/resources/semantic/align}/gates.md +13 -0
- package/{plugins/cursor/skills/skill-prose-align/references/internal-procedures → providers/context/resources/semantic/align}/structure-planning.md +62 -12
- package/providers/context/resources/semantic/compile/index.md +31 -0
- package/providers/context/resources/views/package-current.yaml +6 -0
- package/providers/context/resources/views/review-current.yaml +6 -0
- package/providers/context/resources/views/source-current.yaml +6 -0
- package/providers/context/resources/views/structure-current.yaml +6 -0
- package/providers/context/resources/views/verification-current.yaml +6 -0
- package/providers/context/resources/views/workspace-current.yaml +6 -0
- package/providers/context/schemas/evidence-maintenance-input.schema.json +30 -0
- package/providers/context/schemas/prose-structure-batch.schema.json +35 -0
- package/providers/context/schemas/source-batch-input.schema.json +189 -0
- package/providers/context/scripts/render-context-view.mjs +21 -0
- package/plugins/claude/skills/skill-continue-workflow/SKILL.md +0 -235
- package/plugins/claude/skills/skill-init-workspace/SKILL.md +0 -74
- package/plugins/claude/skills/skill-package-output/SKILL.md +0 -180
- package/plugins/claude/skills/skill-prose-align/SKILL.md +0 -322
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/claude/skills/skill-prose-compile/SKILL.md +0 -287
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/claude/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/claude/skills/skill-review-gate/SKILL.md +0 -138
- package/plugins/claude/skills/skill-source-scope/SKILL.md +0 -525
- package/plugins/claude/skills/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/codex/skills/continue/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +0 -138
- package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +0 -525
- package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/codex/skills/init/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +0 -138
- package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +0 -525
- package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +0 -235
- package/plugins/cursor/skills/skill-init-workspace/SKILL.md +0 -74
- package/plugins/cursor/skills/skill-package-output/SKILL.md +0 -180
- package/plugins/cursor/skills/skill-prose-align/SKILL.md +0 -322
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/cursor/skills/skill-prose-compile/SKILL.md +0 -287
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/cursor/skills/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/cursor/skills/skill-review-gate/SKILL.md +0 -138
- package/plugins/cursor/skills/skill-source-scope/SKILL.md +0 -525
- package/plugins/cursor/skills/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/skills/context-continue/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +0 -138
- package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +0 -525
- package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +0 -235
- package/plugins/skills/context-init/references/internal-procedures/skill-init-workspace.md +0 -74
- package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +0 -180
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/candidate-resolution.md +0 -91
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/density-profile.md +0 -30
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +0 -263
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +0 -282
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +0 -322
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/close-gate.md +0 -132
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/action-domain-gates.md +0 -52
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/notes.md +0 -48
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/refresh-and-update.md +0 -85
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions/references/structural-challenges.md +0 -73
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-actions.md +0 -413
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/compile-judgment.md +0 -123
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/disposition-semantics.md +0 -81
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/leakage-and-ownership.md +0 -55
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/scope-review-and-omit.md +0 -93
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/temporal-and-evidence.md +0 -79
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment/references/user-confirmation.md +0 -111
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile/references/internal-procedures/semantic-judgment.md +0 -194
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +0 -287
- package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +0 -138
- package/plugins/skills/context-init/references/internal-procedures/skill-source-scope/references/capture-source.md +0 -201
- package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +0 -525
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: context.sdk.template-variables
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Template Variables
|
|
8
|
+
|
|
9
|
+
Context package templates are rendered with Handlebars during `context build`.
|
|
10
|
+
|
|
11
|
+
This reference covers the template variables available to files under
|
|
12
|
+
`src/package-templates/**`. Templates can render values, loop over arrays,
|
|
13
|
+
branch with conditionals, and use template-only comments. They cannot run
|
|
14
|
+
JavaScript.
|
|
15
|
+
|
|
16
|
+
## Syntax
|
|
17
|
+
|
|
18
|
+
### Value
|
|
19
|
+
|
|
20
|
+
```md
|
|
21
|
+
Package: {{packageName}}
|
|
22
|
+
Approved pages: {{knowledgeCount}}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Values support dotted paths:
|
|
26
|
+
|
|
27
|
+
```md
|
|
28
|
+
{{context.package}}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Loop
|
|
32
|
+
|
|
33
|
+
```md
|
|
34
|
+
{{#each knowledgeItems}}
|
|
35
|
+
- [{{title}}]({{href}}) - {{type}}
|
|
36
|
+
{{/each}}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Nested loops are supported:
|
|
40
|
+
|
|
41
|
+
```md
|
|
42
|
+
{{#each knowledgeGroups}}
|
|
43
|
+
## {{title}}
|
|
44
|
+
|
|
45
|
+
{{#each items}}
|
|
46
|
+
- [{{title}}]({{href}})
|
|
47
|
+
{{/each}}
|
|
48
|
+
{{/each}}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Inside a loop, `{{@index}}` is zero-based. Use the built-in `inc` helper when
|
|
52
|
+
you need a one-based number:
|
|
53
|
+
|
|
54
|
+
```md
|
|
55
|
+
{{#each knowledgeItems}}
|
|
56
|
+
{{inc @index}}. [{{title}}]({{href}})
|
|
57
|
+
{{/each}}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Conditional
|
|
61
|
+
|
|
62
|
+
```md
|
|
63
|
+
{{#if description}}
|
|
64
|
+
Description: {{description}}
|
|
65
|
+
{{/if}}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
The block renders when the value exists, is not `false`, and is not an empty
|
|
69
|
+
string or empty array.
|
|
70
|
+
|
|
71
|
+
### Template-only Comments
|
|
72
|
+
|
|
73
|
+
Use Handlebars comments, or HTML comments that start with `context:template`,
|
|
74
|
+
for guidance that should not appear in the generated package:
|
|
75
|
+
|
|
76
|
+
```md
|
|
77
|
+
{{! This comment is removed by Handlebars. }}
|
|
78
|
+
|
|
79
|
+
<!-- context:template
|
|
80
|
+
Explain why this section exists and where to edit it.
|
|
81
|
+
Read node_modules/@c4a/context/docs/reference/template-variables.md.
|
|
82
|
+
-->
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`context build` strips these comments from rendered output.
|
|
86
|
+
|
|
87
|
+
## Helpers
|
|
88
|
+
|
|
89
|
+
| Helper | Example | Meaning |
|
|
90
|
+
|---|---|---|
|
|
91
|
+
| `inc` | `{{inc @index}}` | Adds 1 to a numeric value. Useful for numbered lists. |
|
|
92
|
+
| `json` | `{{json knowledgeGroups}}` | Renders a value as formatted JSON for debugging or machine-readable docs. |
|
|
93
|
+
|
|
94
|
+
## Built-in Variables
|
|
95
|
+
|
|
96
|
+
| Variable | Type | Meaning |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `packageName` | string | Package name from `kbPackage()` / `llmsPackage()`. |
|
|
99
|
+
| `packageKind` | string | `kb` or `llms`. |
|
|
100
|
+
| `knowledgeNamespace` | string | Legacy configured namespace when an older workspace still declares one; otherwise empty. It does not change output paths. |
|
|
101
|
+
| `namespacedKnowledge` | boolean | Always `false`; retained so older templates remain renderable. |
|
|
102
|
+
| `skillsRoot` | string | Skills root, currently `skills`. |
|
|
103
|
+
| `wikisRoot` | string | Final wikis root: `wikis`. |
|
|
104
|
+
| `guidesRoot` | string | Final guides root: `guides`. |
|
|
105
|
+
| `rulesRoot` | string | Final rules root: `rules`. |
|
|
106
|
+
| `featsRoot` | string | Final feats root: `feats`. |
|
|
107
|
+
| `skillName` | string | Author-maintained name of the Skill currently being rendered. Empty outside a `skills/<name>/...` template. |
|
|
108
|
+
| `skillPath` | string | Final package-relative `SKILL.md` path for the Skill currently being rendered. Empty outside a Skill template. |
|
|
109
|
+
| `knowledgeCount` | number | Selected approved Markdown file count. |
|
|
110
|
+
| `knowledgeTimestamp` | string | Latest selected approved Markdown `timestamp`, or epoch when empty. |
|
|
111
|
+
| `knowledge` | string | Concatenated selected approved Markdown bundle. Use carefully; it can be large. |
|
|
112
|
+
| `approvedKnowledge` | string | Alias for `knowledge`. |
|
|
113
|
+
| `knowledgeItems` | array | One record per selected approved Markdown page. |
|
|
114
|
+
| `knowledgeGroups` | array | Selected pages grouped by OKF root and the first directory segment under that root; each item also exposes `internal_collection`. |
|
|
115
|
+
| `knowledgeTreeNodes` | array | Nested path tree for selected pages. Useful for custom navigation. |
|
|
116
|
+
| `knowledgeTree` | string | Markdown tree preview of selected pages. |
|
|
117
|
+
| `knowledgeItemsMarkdown` | string | Markdown list of up to 50 selected pages. |
|
|
118
|
+
| `knowledgeGroupsMarkdown` | string | Markdown navigation for the current index. Folded directories render direct page links; expanded directories render links to generated indexes. |
|
|
119
|
+
| `buildInventory` | object | Deterministic package build inventory, including selected files, selected-by reasons, collection summaries, and package-visible edge records. |
|
|
120
|
+
| `buildInventoryJson` | string | Pretty JSON form of `buildInventory`. |
|
|
121
|
+
| `buildInventoryPath` | string | Package-relative inventory path, currently `context-build-inventory.json`. |
|
|
122
|
+
| `knowledgeStructure` | object or null | Selected-package projection derived from workspace `knowledge/structure.yaml` at build time. It contains only selected views, their nodes, and package-visible edges. Templates may inspect it, but the default package consumer should rely on `context-build-inventory.json`. |
|
|
123
|
+
| `knowledgeStructureJson` | string | Pretty JSON form of `knowledgeStructure`, or `null`. |
|
|
124
|
+
| `knowledgeStructurePath` | string | Workspace source structure path, currently `knowledge/structure.yaml`; the variable itself is not copied into the package unless a template renders selected structure data. |
|
|
125
|
+
|
|
126
|
+
Custom variables from `template.vars` are also available.
|
|
127
|
+
|
|
128
|
+
`buildInventory.structure.edge_records` contains typed edge records whose
|
|
129
|
+
endpoints are visible in the selected package. Use those records when a
|
|
130
|
+
template or generated skill needs package-local relationship evidence. The
|
|
131
|
+
workspace `knowledge/structure.yaml` is not automatically copied into the
|
|
132
|
+
package unless a project-specific template explicitly renders it.
|
|
133
|
+
|
|
134
|
+
## `knowledgeItems`
|
|
135
|
+
|
|
136
|
+
Each item contains:
|
|
137
|
+
|
|
138
|
+
| Field | Meaning |
|
|
139
|
+
|---|---|
|
|
140
|
+
| `path` | Package-relative OKF path, for example `wikis/component-lib/symbol/button.md`. |
|
|
141
|
+
| `sourcePath` | Approved knowledge path before OKF output mapping, for example `architecture/entity/button.md`. |
|
|
142
|
+
| `approved_path` | Alias for `sourcePath`. |
|
|
143
|
+
| `dist_path` | Alias for `path`. |
|
|
144
|
+
| `internalCollection` | Internal approved collection, for example `architecture`. |
|
|
145
|
+
| `internal_collection` | Alias for `internalCollection`. |
|
|
146
|
+
| `collection` | Internal approved collection; alias for `internalCollection`. |
|
|
147
|
+
| `okf_root` | OKF output root, for example `wikis`, `guides`, `rules`, or `feats`. |
|
|
148
|
+
| `okf_root_path` | Final flat package-relative OKF root. |
|
|
149
|
+
| `node_ref` | Stable NodeRef from approved frontmatter, for example `entity/button`. |
|
|
150
|
+
| `view_ref` | Stable ViewRef from approved frontmatter, for example `architecture:entity/button`. |
|
|
151
|
+
| `pathWithinCollection` | Path below the OKF root, for example `component-lib/symbol/button.md`. |
|
|
152
|
+
| `href` | Link relative to the template file currently being rendered. Use this in custom templates. |
|
|
153
|
+
| `hrefFromTemplate` | Alias for `href`. |
|
|
154
|
+
| `hrefFromPackageRoot` | Link from a package-root file such as `AGENTS.md`, for example `./wikis/component-lib/symbol/button.md`. |
|
|
155
|
+
| `hrefFromCollectionIndex` | Link from the current OKF root index, for example `./component-lib/symbol/button.md` for a `wikis` item. |
|
|
156
|
+
| `title` | Page title from frontmatter, or a title derived from the file name. |
|
|
157
|
+
| `type` | OKF `type` from frontmatter. |
|
|
158
|
+
| `description` | OKF `description` from frontmatter, when present. |
|
|
159
|
+
| `timestamp` | OKF `timestamp` from frontmatter, when present. |
|
|
160
|
+
| `source` | First top-level `sources` entry without the `repo:` prefix, or the group name. |
|
|
161
|
+
| `group` | First path segment under the OKF root. |
|
|
162
|
+
| `parentPath` | Parent path below the OKF root. |
|
|
163
|
+
| `depth` | Segment count below the OKF root. |
|
|
164
|
+
| `segments` | Path segments below the OKF root. |
|
|
165
|
+
| `tags` | Comma-separated tags from frontmatter. |
|
|
166
|
+
|
|
167
|
+
Example:
|
|
168
|
+
|
|
169
|
+
```md
|
|
170
|
+
{{#each knowledgeItems}}
|
|
171
|
+
- [{{title}}]({{href}}) — {{type}}{{#if description}}: {{description}}{{/if}}
|
|
172
|
+
{{/each}}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## `knowledgeGroups`
|
|
176
|
+
|
|
177
|
+
Each group contains:
|
|
178
|
+
|
|
179
|
+
| Field | Meaning |
|
|
180
|
+
|---|---|
|
|
181
|
+
| `name` | First directory segment under the OKF root, or `root` for pages directly under the OKF root. |
|
|
182
|
+
| `collection` | Internal approved collection for this group. |
|
|
183
|
+
| `internalCollection` | Internal approved collection; alias for `collection`. |
|
|
184
|
+
| `internal_collection` | Alias for `internalCollection`. |
|
|
185
|
+
| `okf_root` | OKF output root for this group, for example `wikis`, `guides`, `rules`, or `feats`. |
|
|
186
|
+
| `okf_root_path` | Final flat package-relative OKF root. |
|
|
187
|
+
| `title` | Display title; defaults to `name`, or the OKF root title for a root group. |
|
|
188
|
+
| `count` | Number of selected pages in this group. |
|
|
189
|
+
| `hasIndex` | Whether the active package navigation policy generates `indexPath`. |
|
|
190
|
+
| `has_index` | Alias for `hasIndex`. |
|
|
191
|
+
| `indexPath` | OKF-root-aware index path, for example `wikis/component-lib/index.md`, `guides/component-lib/index.md`, or `rules/index.md` for a root group. |
|
|
192
|
+
| `indexHrefFromTemplate` | Link from the template file currently being rendered to `indexPath`. Check `hasIndex` before rendering it. |
|
|
193
|
+
| `indexHrefFromCollectionIndex` | Link from the OKF root index to `indexPath`. |
|
|
194
|
+
| `items` | `knowledgeItems` in the group. |
|
|
195
|
+
|
|
196
|
+
Example:
|
|
197
|
+
|
|
198
|
+
```md
|
|
199
|
+
{{#each knowledgeGroups}}
|
|
200
|
+
## {{title}} ({{count}})
|
|
201
|
+
|
|
202
|
+
{{#if hasIndex}}
|
|
203
|
+
[Open directory index]({{indexHrefFromTemplate}})
|
|
204
|
+
{{/if}}
|
|
205
|
+
{{#each items}}
|
|
206
|
+
- [{{title}}]({{href}}) - {{type}}
|
|
207
|
+
{{/each}}
|
|
208
|
+
{{/each}}
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## `knowledgeTreeNodes`
|
|
212
|
+
|
|
213
|
+
`knowledgeTreeNodes` is a nested representation of selected pages. Each node
|
|
214
|
+
contains:
|
|
215
|
+
|
|
216
|
+
| Field | Meaning |
|
|
217
|
+
|---|---|
|
|
218
|
+
| `name` | Path segment name. |
|
|
219
|
+
| `title` | Display title derived from `name`. |
|
|
220
|
+
| `path` | Path below the OKF root. |
|
|
221
|
+
| `depth` | Depth below the OKF root. |
|
|
222
|
+
| `count` | Number of pages under this node. |
|
|
223
|
+
| `items` | Pages directly under this node. |
|
|
224
|
+
| `children` | Child nodes. |
|
|
225
|
+
|
|
226
|
+
Use it when a package needs navigation by source, module, category, or symbol
|
|
227
|
+
folder. Handlebars does not include recursive partials by default, so keep
|
|
228
|
+
starter templates shallow or add project-specific sections for the levels you
|
|
229
|
+
care about.
|
|
230
|
+
|
|
231
|
+
## Starter `wikis/index.md`
|
|
232
|
+
|
|
233
|
+
The default KB template uses the variables above to generate a starter index:
|
|
234
|
+
|
|
235
|
+
- bundle count and timestamp in OKF frontmatter;
|
|
236
|
+
- direct page links for directories folded by the active navigation policy;
|
|
237
|
+
- links to generated directory indexes when a directory exceeds the configured
|
|
238
|
+
inline-entry threshold.
|
|
239
|
+
|
|
240
|
+
`context build` always provides selected OKF root indexes. By default, a
|
|
241
|
+
non-root directory gets its own index only when it contains more than 50
|
|
242
|
+
descendant knowledge pages. Configure this with
|
|
243
|
+
`kbPackage({ navigation: { foldDirectoryIndexes, maxInlineEntries } })`.
|
|
244
|
+
|
|
245
|
+
The output is only a starter. Edit the files under
|
|
246
|
+
`src/package-templates/kb/` when the package needs different reading paths or
|
|
247
|
+
navigation before `context build`. An unchanged generated starter must instead
|
|
248
|
+
be explicitly accepted through the current package-template Review Route.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.close-and-build
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Close and build
|
|
8
|
+
|
|
9
|
+
Close deterministically derives `knowledge/structure.yaml` from approved
|
|
10
|
+
Markdown and the confirmed structure snapshots. It validates the rebuilt
|
|
11
|
+
projection; it does not rewrite approved page bodies. Before removing the
|
|
12
|
+
transient snapshots, it retains only each closed prose target's source,
|
|
13
|
+
collection, and consumed snapshot hash under `source_inputs`.
|
|
14
|
+
|
|
15
|
+
Build runs only after close and verification are current. It writes declared
|
|
16
|
+
packages under `dist/` and records an inventory receipt with added, updated,
|
|
17
|
+
removed, and index changes.
|
|
18
|
+
|
|
19
|
+
Run only the current route command, then evaluate again. A successful build
|
|
20
|
+
means the currently declared scope is current; newly captured or newly declared
|
|
21
|
+
targets can reopen earlier graph nodes.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.code-extraction
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Code extraction
|
|
8
|
+
|
|
9
|
+
Code extraction operates on user-confirmed repository modules and source
|
|
10
|
+
patterns. A source registration identifies the repository or module; the
|
|
11
|
+
extraction declaration defines the code scope inside it.
|
|
12
|
+
|
|
13
|
+
`include` filters files inside a selected source; it is not a package/module
|
|
14
|
+
selector. Use source declarations to select repository modules. Use configured
|
|
15
|
+
entry patterns when entry-led traversal is meaningful, or scan mode when the
|
|
16
|
+
selected module intentionally has no package entry. Do not require source-code
|
|
17
|
+
rewrites merely to create an extraction entry.
|
|
18
|
+
|
|
19
|
+
Use a dry-run when the current route requests scope inspection. Report
|
|
20
|
+
discovered files, AST-analyzed files, skipped files, symbols, and relations
|
|
21
|
+
separately. Use resolved entry files, exported/internal counts, and symbol-kind
|
|
22
|
+
counts as structural scope evidence only. Resolve TypeScript/JavaScript
|
|
23
|
+
configuration and aliases through the extractor rather than guessing paths
|
|
24
|
+
from imports. Explain the scope without treating filenames or symbol kinds as
|
|
25
|
+
semantic knowledge. After confirmation, process exactly one pending extraction
|
|
26
|
+
target and evaluate again.
|
|
27
|
+
|
|
28
|
+
Do not open Review while another extraction target in the same batch remains.
|
|
29
|
+
Unchanged approved or rejected symbols do not need another decision; new or
|
|
30
|
+
changed candidates remain subject to the current Review policy.
|
|
31
|
+
|
|
32
|
+
For TypeScript sources, Context also carries extractor-reported AST relations
|
|
33
|
+
between selected symbols. A relation is projected only when both endpoints
|
|
34
|
+
resolve uniquely inside the selected module; external, unselected, and
|
|
35
|
+
ambiguous endpoints are counted as omissions instead of guessed. The extract
|
|
36
|
+
receipt reports `relationships.detected`, `emitted`, and omission counts.
|
|
37
|
+
Review materializes those source-backed relations with the approved symbol,
|
|
38
|
+
and deterministic close refreshes the typed edge projection.
|
|
39
|
+
|
|
40
|
+
Zero edges remain a valid result. Read `close.relationshipCoverage` or the
|
|
41
|
+
package inventory's `structure.relationship_coverage` to distinguish a current
|
|
42
|
+
source-backed extraction that found no approved edges from an older or
|
|
43
|
+
otherwise unknown relationship mode. Never infer missing edges from symbol
|
|
44
|
+
co-occurrence, filenames, or package size.
|
|
45
|
+
|
|
46
|
+
When the built-in TypeScript extractor cannot represent the code source, use a
|
|
47
|
+
declared `extractCustom` phase. The project-owned callback returns candidate
|
|
48
|
+
semantics plus structured source evidence; Context owns canonical refs,
|
|
49
|
+
fingerprints, candidate storage, Review snapshots, freshness, and rerun cleanup.
|
|
50
|
+
Do not use a generic `customPhase` callback to write lifecycle files directly.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.document-capture
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Document capture
|
|
8
|
+
|
|
9
|
+
Capture creates a reproducible local snapshot of a registered document source.
|
|
10
|
+
It does not classify, summarize, approve, or build knowledge.
|
|
11
|
+
|
|
12
|
+
Before capture:
|
|
13
|
+
|
|
14
|
+
1. every registered document module must have a matching capture declaration;
|
|
15
|
+
2. the user must have allowed the external read in the current conversation;
|
|
16
|
+
3. execute only the current route command.
|
|
17
|
+
|
|
18
|
+
An explicit request to capture, ingest, fetch, or read named file/remote
|
|
19
|
+
documents grants source-read permission for those named modules. A mention,
|
|
20
|
+
possible-source discussion, or register-only request does not. An explicit
|
|
21
|
+
refusal always wins.
|
|
22
|
+
|
|
23
|
+
When that permission is already present in the conversation, execute the
|
|
24
|
+
Gate's returned authority-carrying command. In managed mode it runs the
|
|
25
|
+
deterministic capture batch until the next real blocker; in ordinary mode it
|
|
26
|
+
reevaluates status with `context.source-read`. The authority remains in the
|
|
27
|
+
current command chain and is never persisted in the project. Never bypass the
|
|
28
|
+
Route by running a bare capture phase.
|
|
29
|
+
|
|
30
|
+
Document capture is an external action. Execute a returned command with
|
|
31
|
+
`execution.target: agent-host` through the Agent host so its network and
|
|
32
|
+
credential-store access remain available; do not nest it inside a restricted
|
|
33
|
+
child sandbox. If the CLI reports an external-environment requirement, retry
|
|
34
|
+
the same returned command through the host. Never downgrade credential
|
|
35
|
+
protection as a recovery step.
|
|
36
|
+
|
|
37
|
+
Capture targets are a batch. Process one current target, evaluate status again,
|
|
38
|
+
and continue until the graph reports the batch complete. Never treat one
|
|
39
|
+
successful module as completion of the whole batch.
|
|
40
|
+
|
|
41
|
+
The CLI owns normalization, snapshot identity, hashes, manifests, and
|
|
42
|
+
idempotency. Never hand-write or repair captured snapshots. If a selected local
|
|
43
|
+
boundary is a documentation site rather than plain Markdown, use the
|
|
44
|
+
Context-provided processor/configuration diagnostic; do not invent rendered
|
|
45
|
+
text or scan outside the confirmed boundary.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.document-classification
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Document classification
|
|
8
|
+
|
|
9
|
+
Classification chooses the main knowledge collection for a captured document.
|
|
10
|
+
The choice must follow evidence investigation, not the URL, file name, a user
|
|
11
|
+
example, or a fixed content-specific prompt.
|
|
12
|
+
|
|
13
|
+
Read the current collection-neutral evidence view, explain a short
|
|
14
|
+
evidence-backed recommendation and its output implications, then obtain the
|
|
15
|
+
user decision unless the current session explicitly delegates this gate.
|
|
16
|
+
Read every Route-selected `context.source-body/*` resource in full. Index and
|
|
17
|
+
heading metadata support navigation but are not evidence that the document
|
|
18
|
+
body was read.
|
|
19
|
+
|
|
20
|
+
After the decision, declare the complete align, compile, and review lifecycle
|
|
21
|
+
for the same canonical source and collection. Re-evaluate instead of assuming
|
|
22
|
+
the declaration closed every document target.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.evidence-maintenance
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Evidence maintenance
|
|
8
|
+
|
|
9
|
+
Approved knowledge can outlive a moved or temporarily unavailable source, but
|
|
10
|
+
the resulting evidence state must stay explicit.
|
|
11
|
+
|
|
12
|
+
- Re-pin only when the approved body still matches current source content and
|
|
13
|
+
only the evidence location changed.
|
|
14
|
+
- Create a new candidate when source content changed.
|
|
15
|
+
- Deprecate knowledge that should no longer be used.
|
|
16
|
+
- Keep source-orphaned knowledge only after an explicit user decision and retain
|
|
17
|
+
the evidence warning.
|
|
18
|
+
|
|
19
|
+
Use the affected `view_ref` values from the current diagnostic resource. Do not
|
|
20
|
+
target maintenance by guessed paths or node names.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.knowledge-review
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Knowledge Review
|
|
8
|
+
|
|
9
|
+
Review is the authority boundary between candidates and approved knowledge.
|
|
10
|
+
Open one report for the complete current candidate set and apply only a payload
|
|
11
|
+
that matches its collection scope and candidate-set digest.
|
|
12
|
+
|
|
13
|
+
Without explicit session-managed authority:
|
|
14
|
+
|
|
15
|
+
- open the report returned by the route;
|
|
16
|
+
- let the user approve or reject candidates;
|
|
17
|
+
- apply the exact returned decision payload.
|
|
18
|
+
|
|
19
|
+
With explicit session-managed authority, Context may approve the complete
|
|
20
|
+
current batch atomically. The authority exists only in the current
|
|
21
|
+
conversation. It does not bypass source permission, validation, close, or
|
|
22
|
+
verify.
|
|
23
|
+
|
|
24
|
+
After apply, re-evaluate. Do not infer that close or package output is current.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.package-output
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Package output
|
|
8
|
+
|
|
9
|
+
Package selection decides how approved knowledge is presented to downstream
|
|
10
|
+
agents or text consumers. Explain the available Context package kinds and their
|
|
11
|
+
directory shape before asking the user to choose.
|
|
12
|
+
|
|
13
|
+
After confirmation, declare the package in `src/index.ts` using the SDK schema
|
|
14
|
+
resource. The current Route's `configuration.contract` lists the supported
|
|
15
|
+
output choices, required fields, mechanical defaults, and follow-up status
|
|
16
|
+
command; do not infer another factory or hidden default. Templates may customize presentation, but they must not overwrite
|
|
17
|
+
approved knowledge paths or remove required indexes.
|
|
18
|
+
|
|
19
|
+
Generated generic templates carry a mechanical digest marker. Before the first
|
|
20
|
+
build, replace or edit the declared template source, or explicitly accept the
|
|
21
|
+
unchanged generic default through the current Route. Editing the template
|
|
22
|
+
changes its digest and resolves the review without a separate command.
|
|
23
|
+
Acceptance records only that decision; Context does not judge template prose
|
|
24
|
+
or infer audience, scope, or navigation semantics.
|
|
25
|
+
|
|
26
|
+
An Agent knowledge-base package writes flat package-relative roots such as
|
|
27
|
+
`wikis/`, `guides/`, `rules/`, and `feats/`. The package name already provides
|
|
28
|
+
the surrounding `dist/<package-name>/` boundary. Do not ask the user for a
|
|
29
|
+
distribution namespace or add `distribution.knowledgeNamespace` to a new
|
|
30
|
+
declaration.
|
|
31
|
+
|
|
32
|
+
Ask whether the author wants a short optional Skill prefix. If so,
|
|
33
|
+
maintain the complete final Skill directory name in the template, such as
|
|
34
|
+
`skills/android-query/`. Package-root layout never renames Skills.
|
|
35
|
+
|
|
36
|
+
Package output is incremental: a built package is current only for the approved
|
|
37
|
+
knowledge and template digests recorded by its receipt.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.project-configuration
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Project configuration
|
|
8
|
+
|
|
9
|
+
Use the current route facts and Context SDK documentation to make only the
|
|
10
|
+
declaration requested by the route in `src/index.ts`.
|
|
11
|
+
|
|
12
|
+
- Do not invent sources, modules, collections, or output types.
|
|
13
|
+
- Ask for a user decision when the route is gated and no current-session
|
|
14
|
+
authority is present.
|
|
15
|
+
- Keep source registration, capture, extraction, align, compile, review, and
|
|
16
|
+
package declarations paired by their canonical source and collection.
|
|
17
|
+
- After editing, run `context status --format json` again. The workspace facts,
|
|
18
|
+
not the edit itself, determine whether the route is complete.
|
|
19
|
+
|
|
20
|
+
The Context SDK API reference is a discoverable resource. Do not guess an API
|
|
21
|
+
shape from older prompts or cached plugin text.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.prose-align
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Prose structure alignment
|
|
8
|
+
|
|
9
|
+
Alignment proposes source-bound knowledge structure. It does not write approved
|
|
10
|
+
knowledge.
|
|
11
|
+
|
|
12
|
+
Follow the current route's evidence view and input schema. Prefer source heading
|
|
13
|
+
and block boundaries when they preserve coherent reading units; fixed line
|
|
14
|
+
windows are only a fallback for unstructured text. A page may contain multiple
|
|
15
|
+
sections, each with its own continuous evidence span.
|
|
16
|
+
|
|
17
|
+
The default `read-plan` is the authoring packet for ordinary documents. It
|
|
18
|
+
includes the payload contract, a compact canonical source-ref map, exact source
|
|
19
|
+
body resources, the recommended scratch path, and the direct stage command.
|
|
20
|
+
Do not separately request `schema`, `source-index`, or `existing-knowledge`
|
|
21
|
+
unless the packet reports truncation or the task specifically needs an existing
|
|
22
|
+
approved identity. Those views are diagnostics and large-source fallbacks, not
|
|
23
|
+
mandatory workflow steps.
|
|
24
|
+
|
|
25
|
+
Every `context.source-body/*` item selected in `workflow.current.resources`
|
|
26
|
+
is source evidence, not supporting metadata. Read the complete Markdown file
|
|
27
|
+
when its `read_state` is `read-required`. A source index, heading tree, token
|
|
28
|
+
count, or successful capture never substitutes for body reading. A matching
|
|
29
|
+
content digest receipt may be reused only while that text remains available in
|
|
30
|
+
the current conversation. After reading every selected direct path, execute the
|
|
31
|
+
single `resources.after_read.command`. For a generated Context View, execute
|
|
32
|
+
its materialization command, read its complete file, then execute its exact
|
|
33
|
+
`next_action.command`. Context carries the merged receipt file forward. A Route
|
|
34
|
+
revision change does not invalidate unchanged bytes, but every lifecycle
|
|
35
|
+
command remains revision-bound.
|
|
36
|
+
|
|
37
|
+
When the route returns `payload_target`, write the Agent-authored structure input
|
|
38
|
+
to its recommended `.tmp/agent-payloads/` path. This scratch area is separate
|
|
39
|
+
from CLI-owned `.tmp/context-runtime/` and can be discarded after a successful
|
|
40
|
+
stage. The recommendation does not restrict an explicit user-selected path.
|
|
41
|
+
|
|
42
|
+
Stage all required source/collection slots before batch Review. Structure
|
|
43
|
+
confirmation is an explicit gate. A confirmation applies only to the staged
|
|
44
|
+
slot digest shown by the route; if the digest changes, confirm again.
|
|
45
|
+
|
|
46
|
+
When the current Route exposes `batch`, author every listed target payload in
|
|
47
|
+
one Agent planning pass, then write the small batch manifest to `batch.input`.
|
|
48
|
+
Use `batch.validate.command` for a read-only all-target check or
|
|
49
|
+
`batch.stage.command` to validate every target before any stage begins and then
|
|
50
|
+
write the ready slots serially. The manifest contains only each `phase_id` and
|
|
51
|
+
its structure payload `input` path; it does not merge document semantics or let
|
|
52
|
+
the CLI choose page structure. A failed preflight writes no slot. If a later
|
|
53
|
+
filesystem write fails, the result identifies completed slots and the Route
|
|
54
|
+
remains recoverable.
|
|
55
|
+
|
|
56
|
+
`--stage` performs the same validation and deterministic self-repair as
|
|
57
|
+
`--validate`; use the separate validation command only for a diagnostics-only
|
|
58
|
+
pass. In a managed conversation, a valid stage also records structure
|
|
59
|
+
confirmation in the same write. Validation states are literal: `ready` may
|
|
60
|
+
stage, `repair-required` may not, and `invalid` contains errors. `valid` is true
|
|
61
|
+
only for `ready`; `error_free` distinguishes a blocker-only result from one
|
|
62
|
+
containing errors. `self_healed` reports the input and output Section counts,
|
|
63
|
+
how many original Sections were split, and the structural reason codes used by
|
|
64
|
+
the repair.
|
|
65
|
+
|
|
66
|
+
Independent read-only evidence views may run in parallel. Structure stage,
|
|
67
|
+
confirmation, compile writes, and Review application are serial lifecycle
|
|
68
|
+
mutations; execute them in the order selected by `workflow.current`.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.prose-compile
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Source-bound prose compilation
|
|
8
|
+
|
|
9
|
+
Compile materializes review candidates from confirmed structure and source
|
|
10
|
+
evidence. It never writes directly to approved knowledge.
|
|
11
|
+
|
|
12
|
+
The CLI derives this projection mechanically from the confirmed section ids,
|
|
13
|
+
kinds, and source spans. Run only the revision-bound compile command returned
|
|
14
|
+
by the current Route. Do not create compile-action payloads or rewrite source
|
|
15
|
+
content.
|
|
16
|
+
|
|
17
|
+
One compile command validates every owned view first, then atomically
|
|
18
|
+
materializes the source/collection candidate batch. In an explicitly managed
|
|
19
|
+
conversation, the host loop may continue across the remaining deterministic
|
|
20
|
+
compile slots after this procedure has been read; it re-evaluates revision and
|
|
21
|
+
validation state after every write. The current structure view is optional
|
|
22
|
+
inspection context because the CLI consumes the confirmed structure directly.
|
|
23
|
+
Do not open a partial Review while planned views remain.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: procedure.source-boundary
|
|
3
|
+
kind: procedure
|
|
4
|
+
mediaType: text/markdown
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Source boundary
|
|
8
|
+
|
|
9
|
+
A source boundary is a user decision about which repositories, modules, or
|
|
10
|
+
documents may become approved knowledge. It affects extraction scope,
|
|
11
|
+
provenance, output paths, and freshness checks.
|
|
12
|
+
|
|
13
|
+
Do not infer this boundary from the current directory, monorepo layout, package
|
|
14
|
+
names, or Git remotes. Explain the decision in the user's language, obtain the
|
|
15
|
+
specific paths or documents, then use the Context source schema and conditional
|
|
16
|
+
registration command selected by the route. The command uses `--input -`; after
|
|
17
|
+
the current conversation contains the required confirmation, send one YAML or
|
|
18
|
+
JSON payload matching the selected schema to its standard input. Do not run the
|
|
19
|
+
command before confirmation and do not replace it with a command remembered
|
|
20
|
+
from another route.
|
|
21
|
+
|
|
22
|
+
Context source identity has two parts:
|
|
23
|
+
|
|
24
|
+
- a calendar date identifies one capture batch and directory;
|
|
25
|
+
- a module identifies one concrete repository, local document boundary, or
|
|
26
|
+
remote document inside that batch.
|
|
27
|
+
|
|
28
|
+
Several modules may share one date. Do not invent date suffixes to separate
|
|
29
|
+
them. A date-only inspection addresses the batch; `<date>/<module>` addresses
|
|
30
|
+
one source. Register a confirmed multi-source request as one serial batch
|
|
31
|
+
mutation instead of running registry writes in parallel.
|
|
32
|
+
|
|
33
|
+
To retire a registered source, first run `context source remove <source-id>
|
|
34
|
+
--format json`. This is a read-only preview that lists every project, candidate,
|
|
35
|
+
or approved-knowledge reference. Only after those references are intentionally
|
|
36
|
+
resolved may the route use `--yes`; the CLI never silently deletes referenced
|
|
37
|
+
knowledge or another source's materialized files. Execute the exact
|
|
38
|
+
digest-bound command returned by the preview. For a shared document batch, the
|
|
39
|
+
manifest entry is the ownership boundary: removal deletes only that entry and
|
|
40
|
+
its explicitly listed files/assets. An uncaptured module has no manifest entry,
|
|
41
|
+
so removal is registry-only; the shared date directory is never inferred as
|
|
42
|
+
module-owned.
|
|
43
|
+
|
|
44
|
+
Repository readiness checks are mechanical and may run after the boundary is
|
|
45
|
+
registered. Clone, fetch, checkout, install, build, test, and other external
|
|
46
|
+
repository operations need separate authority. File and remote-document
|
|
47
|
+
registration records metadata only; reading their bodies requires source-read
|
|
48
|
+
permission for the exact pending modules.
|