@c4a/context-cli 0.6.18 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. package/README.md +73 -8
  2. package/README.zh-CN.md +47 -7
  3. package/cli.js +89881 -53821
  4. package/docs/document-optimization.md +35 -11
  5. package/docs/document-optimization.zh-CN.md +29 -9
  6. package/indexers/bundles/context-code-indexer/SKILL.md +20 -0
  7. package/indexers/bundles/context-code-indexer/context-indexer.yaml +230 -0
  8. package/indexers/bundles/context-code-indexer/references/composers/contracts-and-chains.md +23 -0
  9. package/indexers/bundles/context-code-indexer/references/composers/cross-module-chain.md +22 -0
  10. package/indexers/bundles/context-code-indexer/references/composers/development-and-delivery.md +22 -0
  11. package/indexers/bundles/context-code-indexer/references/composers/event-flow.md +21 -0
  12. package/indexers/bundles/context-code-indexer/references/composers/examples-and-documentation.md +22 -0
  13. package/indexers/bundles/context-code-indexer/references/composers/persistence-boundary.md +21 -0
  14. package/indexers/bundles/context-code-indexer/references/composers/protocol-boundary.md +22 -0
  15. package/indexers/bundles/context-code-indexer/references/composers/public-contract.md +23 -0
  16. package/indexers/bundles/context-code-indexer/references/indexer.md +49 -0
  17. package/indexers/bundles/context-code-indexer/references/metrics.md +201 -0
  18. package/indexers/bundles/context-code-indexer/templates/adapter-integration.md +119 -0
  19. package/indexers/bundles/context-code-indexer/templates/api-service.md +118 -0
  20. package/indexers/bundles/context-code-indexer/templates/background-runtime.md +109 -0
  21. package/indexers/bundles/context-code-indexer/templates/cli-tool.md +129 -0
  22. package/indexers/bundles/context-code-indexer/templates/component-library.md +99 -0
  23. package/indexers/bundles/context-code-indexer/templates/contract-source.md +73 -0
  24. package/indexers/bundles/context-code-indexer/templates/data-sync-reconciliation.md +77 -0
  25. package/indexers/bundles/context-code-indexer/templates/derived-generated-source.md +117 -0
  26. package/indexers/bundles/context-code-indexer/templates/domain-service.md +109 -0
  27. package/indexers/bundles/context-code-indexer/templates/event-consumer.md +62 -0
  28. package/indexers/bundles/context-code-indexer/templates/gateway-facade.md +89 -0
  29. package/indexers/bundles/context-code-indexer/templates/monorepo-container.md +124 -0
  30. package/indexers/bundles/context-code-indexer/templates/plugin-extension.md +52 -0
  31. package/indexers/bundles/context-code-indexer/templates/sdk-library.md +132 -0
  32. package/indexers/bundles/context-code-indexer/templates/storage-repository.md +56 -0
  33. package/indexers/bundles/context-code-indexer/templates/web-application.md +146 -0
  34. package/indexers/bundles/context-code-indexer/tests/fixtures/chapters.json +226 -0
  35. package/indexers/bundles/context-code-indexer/tests/fixtures/composers.json +82 -0
  36. package/indexers/bundles/context-code-indexer/tests/fixtures/profiles.json +210 -0
  37. package/indexers/bundles/context-code-indexer/tests/fixtures/scenarios.json +122 -0
  38. package/indexers/bundles/context-markdown-indexer/SKILL.md +20 -0
  39. package/indexers/bundles/context-markdown-indexer/context-indexer.yaml +147 -0
  40. package/indexers/bundles/context-markdown-indexer/references/classification.md +63 -0
  41. package/indexers/bundles/context-markdown-indexer/references/editorial-policy.md +106 -0
  42. package/indexers/bundles/context-markdown-indexer/references/indexer.md +23 -0
  43. package/indexers/bundles/context-markdown-indexer/references/semantic-planning.md +146 -0
  44. package/indexers/bundles/context-markdown-indexer/references/structure-and-artifacts.md +109 -0
  45. package/indexers/bundles/context-markdown-indexer/tests/fixtures/anonymous.json +31 -0
  46. package/indexers/bundles/context-markdown-indexer/tests/fixtures/editorial.json +309 -0
  47. package/indexers/bundles/context-markdown-indexer/tests/fixtures/migration-equivalence.json +186 -0
  48. package/indexers/bundles/context-markdown-indexer/tests/fixtures/profiles.json +171 -0
  49. package/indexers/bundles/context-markdown-indexer/tests/fixtures/routing.json +151 -0
  50. package/indexers/capability-manifest.json +40 -0
  51. package/indexers/contracts/hard-rule-conformance.json +2644 -0
  52. package/indexers/contracts/operator-contract.json +35 -0
  53. package/indexers/contracts/profile-contract.json +10162 -0
  54. package/indexers/release-manifest.json +208 -0
  55. package/package.json +5 -4
  56. package/plugins/README.md +17 -109
  57. package/plugins/README_CN.md +11 -89
  58. package/plugins/VERSION +1 -1
  59. package/plugins/claude/.claude-plugin/plugin.json +3 -11
  60. package/plugins/claude/CLAUDE.md +1 -1
  61. package/plugins/claude/README.md +1 -1
  62. package/plugins/claude/commands/context.md +112 -7
  63. package/plugins/codex/.codex-plugin/plugin.json +6 -17
  64. package/plugins/codex/AGENTS.md +1 -1
  65. package/plugins/codex/README.md +1 -1
  66. package/plugins/codex/skills/context/SKILL.md +113 -19
  67. package/plugins/cursor/.cursor-plugin/plugin.json +4 -17
  68. package/plugins/cursor/AGENTS.md +1 -1
  69. package/plugins/cursor/README.md +3 -2
  70. package/plugins/cursor/commands/c4a-context.md +112 -9
  71. package/plugins/skills/{c4a-context → context}/SKILL.md +114 -20
  72. package/plugins/skills/context-code-indexer/SKILL.md +20 -0
  73. package/plugins/skills/context-code-indexer/context-indexer.yaml +230 -0
  74. package/plugins/skills/context-code-indexer/references/composers/contracts-and-chains.md +23 -0
  75. package/plugins/skills/context-code-indexer/references/composers/cross-module-chain.md +22 -0
  76. package/plugins/skills/context-code-indexer/references/composers/development-and-delivery.md +22 -0
  77. package/plugins/skills/context-code-indexer/references/composers/event-flow.md +21 -0
  78. package/plugins/skills/context-code-indexer/references/composers/examples-and-documentation.md +22 -0
  79. package/plugins/skills/context-code-indexer/references/composers/persistence-boundary.md +21 -0
  80. package/plugins/skills/context-code-indexer/references/composers/protocol-boundary.md +22 -0
  81. package/plugins/skills/context-code-indexer/references/composers/public-contract.md +23 -0
  82. package/plugins/skills/context-code-indexer/references/indexer.md +49 -0
  83. package/plugins/skills/context-code-indexer/references/metrics.md +201 -0
  84. package/plugins/skills/context-code-indexer/templates/adapter-integration.md +119 -0
  85. package/plugins/skills/context-code-indexer/templates/api-service.md +118 -0
  86. package/plugins/skills/context-code-indexer/templates/background-runtime.md +109 -0
  87. package/plugins/skills/context-code-indexer/templates/cli-tool.md +129 -0
  88. package/plugins/skills/context-code-indexer/templates/component-library.md +99 -0
  89. package/plugins/skills/context-code-indexer/templates/contract-source.md +73 -0
  90. package/plugins/skills/context-code-indexer/templates/data-sync-reconciliation.md +77 -0
  91. package/plugins/skills/context-code-indexer/templates/derived-generated-source.md +117 -0
  92. package/plugins/skills/context-code-indexer/templates/domain-service.md +109 -0
  93. package/plugins/skills/context-code-indexer/templates/event-consumer.md +62 -0
  94. package/plugins/skills/context-code-indexer/templates/gateway-facade.md +89 -0
  95. package/plugins/skills/context-code-indexer/templates/monorepo-container.md +124 -0
  96. package/plugins/skills/context-code-indexer/templates/plugin-extension.md +52 -0
  97. package/plugins/skills/context-code-indexer/templates/sdk-library.md +132 -0
  98. package/plugins/skills/context-code-indexer/templates/storage-repository.md +56 -0
  99. package/plugins/skills/context-code-indexer/templates/web-application.md +146 -0
  100. package/plugins/skills/context-code-indexer/tests/fixtures/chapters.json +226 -0
  101. package/plugins/skills/context-code-indexer/tests/fixtures/composers.json +82 -0
  102. package/plugins/skills/context-code-indexer/tests/fixtures/profiles.json +210 -0
  103. package/plugins/skills/context-code-indexer/tests/fixtures/scenarios.json +122 -0
  104. package/plugins/skills/context-markdown-indexer/SKILL.md +20 -0
  105. package/plugins/skills/context-markdown-indexer/context-indexer.yaml +147 -0
  106. package/plugins/skills/context-markdown-indexer/references/classification.md +63 -0
  107. package/plugins/skills/context-markdown-indexer/references/editorial-policy.md +106 -0
  108. package/plugins/skills/context-markdown-indexer/references/indexer.md +23 -0
  109. package/plugins/skills/context-markdown-indexer/references/semantic-planning.md +146 -0
  110. package/plugins/skills/context-markdown-indexer/references/structure-and-artifacts.md +109 -0
  111. package/plugins/skills/context-markdown-indexer/tests/fixtures/anonymous.json +31 -0
  112. package/plugins/skills/context-markdown-indexer/tests/fixtures/editorial.json +309 -0
  113. package/plugins/skills/context-markdown-indexer/tests/fixtures/migration-equivalence.json +186 -0
  114. package/plugins/skills/context-markdown-indexer/tests/fixtures/profiles.json +171 -0
  115. package/plugins/skills/context-markdown-indexer/tests/fixtures/routing.json +151 -0
  116. package/providers/context/actions/accept-main-index-run.yaml +7 -0
  117. package/providers/context/actions/accept-material-answer-run.yaml +7 -0
  118. package/providers/context/actions/accept-post-author-composer-run.yaml +7 -0
  119. package/providers/context/actions/actualize-material-answer-bindings.yaml +8 -0
  120. package/providers/context/actions/apply-code-index-guidance.yaml +5 -0
  121. package/providers/context/actions/apply-document-optimization-guidance.yaml +5 -0
  122. package/providers/context/actions/apply-indexer-project.yaml +7 -0
  123. package/providers/context/actions/audit-material-gap-state.yaml +8 -0
  124. package/providers/context/actions/audit-projected-artifact-fan-out.yaml +8 -0
  125. package/providers/context/actions/authorize-indexer-contract-overlay.yaml +7 -0
  126. package/providers/context/actions/authorize-indexer-dependencies.yaml +7 -0
  127. package/providers/context/actions/authorize-indexer-program-execution.yaml +7 -0
  128. package/providers/context/actions/build-main-index-author-worksets.yaml +7 -0
  129. package/providers/context/actions/build-main-index-catalog-fallback.yaml +7 -0
  130. package/providers/context/actions/build-main-index-partition-worksets.yaml +7 -0
  131. package/providers/context/actions/build-material-question-workset.yaml +7 -0
  132. package/providers/context/actions/build-post-author-composer-worksets.yaml +7 -0
  133. package/providers/context/actions/build-question-target-inventory.yaml +7 -0
  134. package/providers/context/actions/build-subject-catalog.yaml +7 -0
  135. package/providers/context/actions/build-target-resolution-views.yaml +7 -0
  136. package/providers/context/actions/checkpoint-material-answer-review.yaml +8 -0
  137. package/providers/context/actions/checkpoint-material-gaps.yaml +8 -0
  138. package/providers/context/actions/close-indexer-approved-knowledge.yaml +8 -0
  139. package/providers/context/actions/compile-indexer-candidates.yaml +8 -0
  140. package/providers/context/actions/compose-indexer-post-author-fragments.yaml +7 -0
  141. package/providers/context/actions/configure-community-indexer-fallback.yaml +6 -0
  142. package/providers/context/actions/configure-indexer-providers.yaml +6 -0
  143. package/providers/context/actions/confirm-index-requirement-workset.yaml +8 -0
  144. package/providers/context/actions/confirm-subject-reidentification.yaml +8 -0
  145. package/providers/context/actions/converge-main-index-partition-run.yaml +7 -0
  146. package/providers/context/actions/discover-markdown-indexer-providers.yaml +6 -0
  147. package/providers/context/actions/evaluate-material-gaps.yaml +8 -0
  148. package/providers/context/actions/fail-main-index-run.yaml +7 -0
  149. package/providers/context/actions/fail-material-answer-run.yaml +7 -0
  150. package/providers/context/actions/fail-post-author-composer-run.yaml +7 -0
  151. package/providers/context/actions/inspect-index-candidate-review-readiness.yaml +8 -0
  152. package/providers/context/actions/inspect-index-profile-failure.yaml +7 -0
  153. package/providers/context/actions/inspect-indexer-dependencies.yaml +7 -0
  154. package/providers/context/actions/inspect-indexer-program-execution.yaml +7 -0
  155. package/providers/context/actions/inspect-indexer-project-proposal.yaml +7 -0
  156. package/providers/context/actions/inspect-markdown-provider-capture.yaml +7 -0
  157. package/providers/context/actions/inspect-material-answer-review.yaml +8 -0
  158. package/providers/context/actions/maintain-evidence.yaml +1 -1
  159. package/providers/context/actions/materialize-indexer-instructions.yaml +7 -0
  160. package/providers/context/actions/migrate-codeindex.yaml +5 -0
  161. package/providers/context/actions/observe-indexer-project.yaml +7 -0
  162. package/providers/context/actions/observe-main-index-run-ledger.yaml +7 -0
  163. package/providers/context/actions/observe-material-answer-runs.yaml +7 -0
  164. package/providers/context/actions/observe-post-author-composer-worksets.yaml +7 -0
  165. package/providers/context/actions/override-index-profile-audit.yaml +7 -0
  166. package/providers/context/actions/prepare-indexer-customization-project.yaml +7 -0
  167. package/providers/context/actions/prepare-main-index-run-ledger.yaml +7 -0
  168. package/providers/context/actions/prepare-material-answer-runs.yaml +7 -0
  169. package/providers/context/actions/propose-indexer-customization.yaml +7 -0
  170. package/providers/context/actions/propose-overlay-question-amendment.yaml +7 -0
  171. package/providers/context/actions/rebind-indexer-selection-to-requirement.yaml +7 -0
  172. package/providers/context/actions/reconcile-indexer-results.yaml +7 -0
  173. package/providers/context/actions/record-index-profile-revision.yaml +7 -0
  174. package/providers/context/actions/register-source-batch.yaml +1 -1
  175. package/providers/context/actions/report-index-profile-failure.yaml +7 -0
  176. package/providers/context/actions/report-indexer-incremental-impact.yaml +8 -0
  177. package/providers/context/actions/resolve-effective-composers.yaml +7 -0
  178. package/providers/context/actions/restore-repository-sources.yaml +1 -1
  179. package/providers/context/actions/review-material-answer-candidate.yaml +8 -0
  180. package/providers/context/actions/revise-index-output.yaml +7 -0
  181. package/providers/context/actions/route-index-requirement-confirmation.yaml +8 -0
  182. package/providers/context/actions/route-indexer-provider-selection.yaml +7 -0
  183. package/providers/context/actions/run-indexer-agent-step.yaml +7 -0
  184. package/providers/context/actions/run-indexer-post-author-composer.yaml +7 -0
  185. package/providers/context/actions/run-material-answer-indexers.yaml +7 -0
  186. package/providers/context/actions/start-main-index-run.yaml +7 -0
  187. package/providers/context/actions/start-material-answer-run.yaml +7 -0
  188. package/providers/context/actions/start-post-author-composer-run.yaml +7 -0
  189. package/providers/context/actions/validate-indexer-contract-overlays.yaml +7 -0
  190. package/providers/context/actions/validate-indexer-customization.yaml +7 -0
  191. package/providers/context/actions/validate-indexer-selection-proposal.yaml +7 -0
  192. package/providers/context/actions/validate-main-index-run.yaml +7 -0
  193. package/providers/context/actions/validate-markdown-provider-selection.yaml +7 -0
  194. package/providers/context/actions/validate-subject-key-schemas.yaml +8 -0
  195. package/providers/context/codes.yaml +72 -0
  196. package/providers/context/graphs/indexer.yaml +1068 -0
  197. package/providers/context/graphs/workspace.yaml +52 -3
  198. package/providers/context/manifest.json +1487 -157
  199. package/providers/context/provider.yaml +3 -2
  200. package/providers/context/resources/dialogue/code-extraction.md +12 -0
  201. package/providers/context/resources/dialogue/document-classification.md +1 -1
  202. package/providers/context/resources/dialogue/knowledge-review.md +7 -1
  203. package/providers/context/resources/dialogue/source-boundary.md +9 -1
  204. package/providers/context/resources/dialogue/workflow-mode-after-capture.md +11 -8
  205. package/providers/context/resources/dialogue/workflow-mode-after-creation.md +6 -4
  206. package/providers/context/resources/manuals/guides/lark-resources.md +7 -0
  207. package/providers/context/resources/manuals/guides/package-outputs.md +3 -3
  208. package/providers/context/resources/manuals/reference/code-extractors.md +7 -6
  209. package/providers/context/resources/manuals/reference/package-templates.md +18 -10
  210. package/providers/context/resources/manuals/reference/project-api.md +49 -24
  211. package/providers/context/resources/procedures/close-and-build.md +24 -9
  212. package/providers/context/resources/procedures/code-extraction.md +41 -13
  213. package/providers/context/resources/procedures/code-index-audit.md +83 -13
  214. package/providers/context/resources/procedures/document-capture.md +9 -0
  215. package/providers/context/resources/procedures/document-optimization.md +88 -21
  216. package/providers/context/resources/procedures/document-revision.md +11 -6
  217. package/providers/context/resources/procedures/knowledge-review.md +4 -1
  218. package/providers/context/resources/procedures/source-boundary.md +20 -8
  219. package/providers/context/resources/semantic/align/structure-planning.md +4 -4
  220. package/providers/context/resources/semantic/code-index/classification.md +8 -5
  221. package/providers/context/resources/semantic/code-index/templates/adapter.md +9 -0
  222. package/providers/context/resources/semantic/code-index/templates/contracts-and-chains.md +81 -0
  223. package/providers/context/resources/views/resolved-indexer-instructions.yaml +23 -0
  224. package/providers/context/schemas/document-optimization-decisions.schema.json +29 -6
  225. package/providers/context/schemas/indexer-agent-step-input.schema.json +30 -0
  226. package/providers/context/schemas/indexer-agent-step-result.schema.json +47 -0
  227. package/providers/context/schemas/indexer-candidate-compile-input.schema.json +57 -0
  228. package/providers/context/schemas/indexer-candidate-compile-output.schema.json +38 -0
  229. package/providers/context/schemas/indexer-candidate-review-readiness-input.schema.json +46 -0
  230. package/providers/context/schemas/indexer-candidate-review-readiness-output.schema.json +104 -0
  231. package/providers/context/schemas/indexer-contract-overlay-authorization-input.schema.json +32 -0
  232. package/providers/context/schemas/indexer-contract-overlay-authorization-result.schema.json +121 -0
  233. package/providers/context/schemas/indexer-contract-overlay-validation-input.schema.json +90 -0
  234. package/providers/context/schemas/indexer-contract-overlay-validation-result.schema.json +158 -0
  235. package/providers/context/schemas/indexer-customization-project-preparation-result.schema.json +44 -0
  236. package/providers/context/schemas/indexer-customization-proposal-draft.schema.json +83 -0
  237. package/providers/context/schemas/indexer-customization-validation-result.schema.json +36 -0
  238. package/providers/context/schemas/indexer-dependency-authorization-input.schema.json +71 -0
  239. package/providers/context/schemas/indexer-dependency-authorization-result.schema.json +138 -0
  240. package/providers/context/schemas/indexer-incremental-impact-input.schema.json +31 -0
  241. package/providers/context/schemas/indexer-incremental-impact-output.schema.json +52 -0
  242. package/providers/context/schemas/indexer-main-lifecycle-input.schema.json +187 -0
  243. package/providers/context/schemas/indexer-main-lifecycle-output.schema.json +180 -0
  244. package/providers/context/schemas/indexer-markdown-provider-capture-input.schema.json +17 -0
  245. package/providers/context/schemas/indexer-markdown-provider-capture-output.schema.json +54 -0
  246. package/providers/context/schemas/indexer-markdown-provider-validation-input.schema.json +34 -0
  247. package/providers/context/schemas/indexer-markdown-provider-validation-output.schema.json +75 -0
  248. package/providers/context/schemas/indexer-material-answer-lifecycle-input.schema.json +90 -0
  249. package/providers/context/schemas/indexer-material-answer-lifecycle-output.schema.json +80 -0
  250. package/providers/context/schemas/indexer-material-answer-review-inspection-input.schema.json +32 -0
  251. package/providers/context/schemas/indexer-material-answer-review-inspection-output.schema.json +32 -0
  252. package/providers/context/schemas/indexer-material-answer-review-resolution-input.schema.json +19 -0
  253. package/providers/context/schemas/indexer-material-answer-review-resolution-output.schema.json +87 -0
  254. package/providers/context/schemas/indexer-material-gap-lifecycle-input.schema.json +86 -0
  255. package/providers/context/schemas/indexer-material-gap-lifecycle-output.schema.json +19 -0
  256. package/providers/context/schemas/indexer-materialize-request.schema.json +53 -0
  257. package/providers/context/schemas/indexer-materialized-resource.schema.json +57 -0
  258. package/providers/context/schemas/indexer-overlay-question-amendment.schema.json +13 -0
  259. package/providers/context/schemas/indexer-overlay-question-proposal-input.schema.json +40 -0
  260. package/providers/context/schemas/indexer-overlay-question-rebind-input.schema.json +35 -0
  261. package/providers/context/schemas/indexer-overlay-question-rebind-result.schema.json +25 -0
  262. package/providers/context/schemas/indexer-post-author-fragment-request.schema.json +26 -0
  263. package/providers/context/schemas/indexer-post-author-fragment-result.schema.json +18 -0
  264. package/providers/context/schemas/indexer-post-author-lifecycle-input.schema.json +94 -0
  265. package/providers/context/schemas/indexer-post-author-lifecycle-output.schema.json +72 -0
  266. package/providers/context/schemas/indexer-profile-failure-inspection-input.schema.json +13 -0
  267. package/providers/context/schemas/indexer-profile-failure-inspection-result.schema.json +19 -0
  268. package/providers/context/schemas/indexer-profile-failure-report-input.schema.json +22 -0
  269. package/providers/context/schemas/indexer-profile-failure-report-result.schema.json +49 -0
  270. package/providers/context/schemas/indexer-profile-override-decision.schema.json +20 -0
  271. package/providers/context/schemas/indexer-profile-override-result.schema.json +49 -0
  272. package/providers/context/schemas/indexer-profile-revision-agent-input.schema.json +18 -0
  273. package/providers/context/schemas/indexer-profile-revision-record-input.schema.json +31 -0
  274. package/providers/context/schemas/indexer-profile-revision-record-result.schema.json +45 -0
  275. package/providers/context/schemas/indexer-program-execution-authorization-input.schema.json +145 -0
  276. package/providers/context/schemas/indexer-program-execution-authorization-result.schema.json +60 -0
  277. package/providers/context/schemas/indexer-project-action-result.schema.json +19 -0
  278. package/providers/context/schemas/indexer-project-gate-input.schema.json +100 -0
  279. package/providers/context/schemas/indexer-project-observation-input.schema.json +16 -0
  280. package/providers/context/schemas/indexer-project-observation-result.schema.json +42 -0
  281. package/providers/context/schemas/indexer-provider-route-input.schema.json +55 -0
  282. package/providers/context/schemas/indexer-provider-route-report.schema.json +188 -0
  283. package/providers/context/schemas/indexer-requirement-confirmation-input.schema.json +27 -0
  284. package/providers/context/schemas/indexer-requirement-confirmation-output.schema.json +24 -0
  285. package/providers/context/schemas/indexer-result-reconciliation-input.schema.json +59 -0
  286. package/providers/context/schemas/indexer-result-reconciliation-output.schema.json +43 -0
  287. package/providers/context/schemas/indexer-selection-proposal-input.schema.json +12 -0
  288. package/providers/context/schemas/indexer-selection-proposal-validation.schema.json +23 -0
  289. package/providers/context/schemas/indexer-subject-reidentification-input.schema.json +37 -0
  290. package/providers/context/schemas/indexer-subject-reidentification-output.schema.json +31 -0
  291. package/providers/context/schemas/source-batch-input.schema.json +18 -3
  292. package/providers/context/skills/configure-indexer-providers/SKILL.md +58 -0
  293. package/providers/context/skills/prepare-indexer-customization-project/SKILL.md +31 -0
  294. package/providers/context/skills/propose-indexer-customization/SKILL.md +40 -0
  295. package/providers/context/skills/revise-index-output/SKILL.md +12 -0
  296. package/providers/context/skills/run-indexer-agent-step/SKILL.md +20 -0
  297. package/providers/context/skills/run-indexer-post-author-composer/SKILL.md +21 -0
@@ -0,0 +1,119 @@
1
+ ---
2
+ id: context.code-indexer.template.adapter-integration
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Adapter, bridge, and integration template
8
+
9
+ Use for `adapter-integration`: BFFs, protocol bridges, host integrations, plugin adapters,
10
+ compatibility layers, gateways, and translators whose stable responsibility is
11
+ to connect two boundaries. An ordinary internal helper that converts one object
12
+ is not automatically an adapter module.
13
+
14
+ Use the exact profile and Artifact policy variant supplied by the workset. For
15
+ an inbound operation surface, combine this template with the selected gateway
16
+ or protocol evidence without creating a second operation registry.
17
+
18
+ ## Evidence pass
19
+
20
+ Locate both sides of the boundary and the code that joins them:
21
+
22
+ - inbound operation, event, command, host hook, or extension registration;
23
+ - outbound operation, client, plugin contribution, or runtime capability;
24
+ - authoritative input and output contract locations;
25
+ - identity, field, enum, version, and lifecycle mappings;
26
+ - authentication, authorization, credential, and context propagation;
27
+ - validation, normalization, batching, caching, fallback, and compatibility;
28
+ - timeout, retry, partial failure, and error/status translation;
29
+ - configuration, feature selection, ownership, and release entrypoints;
30
+ - generated DTOs/clients and converter helpers that should remain evidence.
31
+
32
+ Sample representative paths from each mapping family. Do not claim a mapping
33
+ from matching field names alone.
34
+
35
+ ## Questions the knowledge must answer
36
+
37
+ 1. Which two boundaries does the adapter connect, and who owns each one?
38
+ 2. What triggers the mapping and where is it registered?
39
+ 3. Which fields, identities, versions, or lifecycle states are transformed?
40
+ 4. Which values pass through unchanged, default, or intentionally disappear?
41
+ 5. How are credentials, context, errors, retries, and fallbacks translated?
42
+ 6. Which contracts are authoritative and which artifacts are generated?
43
+ 7. What compatibility obligation makes the adapter stable knowledge?
44
+
45
+ ## Suggested knowledge units
46
+
47
+ - **Adapter contract**: responsibility, inbound/outbound boundaries,
48
+ registration, ownership, and authoritative contracts.
49
+ - **Operation mapping registry**: use the canonical operation record from
50
+ `protocol-boundary.md` and add only adapter-specific transformation fields.
51
+ - **Data or identity mapping**: only stable, non-trivial mappings that readers
52
+ must understand; summarize generated field copies.
53
+ - **Lifecycle and failure translation**: when activation, cancellation,
54
+ retries, partial failure, or compatibility behavior is material.
55
+ - **Cross-module execution path**: when both connected modules are registered
56
+ sources and the chain is source-backed.
57
+
58
+ ## Chapter blueprints
59
+
60
+ ```markdown
61
+ # <Adapter> contract
62
+ ## Responsibility and connected boundaries
63
+ ## Activation or registration
64
+ ## Inbound contracts
65
+ ## Outbound contracts
66
+ ## Data, identity, and lifecycle mapping
67
+ ## Authentication and context propagation
68
+ ## Error, retry, fallback, and compatibility behavior
69
+ ## Configuration, ownership, and release
70
+ ## Evidence and exclusions
71
+ ```
72
+
73
+ For adapter-specific detail attached to a canonical operation record:
74
+
75
+ ```markdown
76
+ ## Adapter transformation
77
+ - Mapper/handler entry:
78
+ - Field/identity/default transformations:
79
+ - Context and credential propagation:
80
+ - Error and fallback mapping:
81
+ ```
82
+
83
+ ## Granularity and relationships
84
+
85
+ Group mappings that share the same boundary pair and transformation policy.
86
+ Split when protocol authority, ownership, lifecycle, or failure semantics
87
+ differ. Do not publish every DTO, converter, generated client, or transport
88
+ helper separately.
89
+
90
+ Add structured edges only for concrete registration and call paths. Keep a
91
+ narrative locator when dynamic dispatch prevents an unambiguous edge.
92
+
93
+ Return `identityGroups` when several target identities share one explained
94
+ adapter responsibility. Return every source-backed adjacency in
95
+ `chainCandidates`, then provide one `chainCandidateDecisions` record for each
96
+ candidate. A documented decision names the reader-facing view and emits its
97
+ structured edge; an equivalent candidate merges into that canonical candidate;
98
+ false positives and missing external material use `exclude` or `request-input`
99
+ with a concrete reason. Read `contracts-and-chains.md` for the complete generic
100
+ contract.
101
+
102
+ ## Template composition examples
103
+
104
+ - An HTTP endpoint backed by an RPC client is `api-service` + `adapter-integration`; combine
105
+ one operation registry with one mapping contract rather than duplicating the
106
+ route facts.
107
+ - A host plugin bridge reads `plugin-extension.md` and may also be `sdk-library`
108
+ when consumers import
109
+ a supported extension API.
110
+ - A compatibility wrapper over generated clients also reads
111
+ `derived-generated-source.md` and identifies the authoritative schemas.
112
+
113
+ ## Revise or stop when
114
+
115
+ - either side of the adapter cannot be identified;
116
+ - mappings are inferred only from same-named types or fields;
117
+ - credential, identity, or error behavior would be guessed;
118
+ - generated DTOs are replacing authoritative contracts in the plan;
119
+ - the adapter page would merely say that one module “calls” another.
@@ -0,0 +1,118 @@
1
+ ---
2
+ id: context.code-indexer.template.api-service
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # API service and gateway template
8
+
9
+ Use after classifying an inbound HTTP, RPC, GraphQL, message-request, or similar
10
+ surface as `api-service`. A module that only calls a remote API is a protocol
11
+ consumer, not automatically an API service. Gateways that translate to another
12
+ protocol normally also selects `adapter-integration`.
13
+
14
+ Use the exact profile and Artifact policy variant supplied by the workset. If
15
+ the reader goal is primarily the transformation between inbound and outbound
16
+ boundaries, use the selected adapter-integration profile and retain one
17
+ canonical operation registry.
18
+
19
+ ## Evidence pass
20
+
21
+ Locate and connect:
22
+
23
+ - process/server entry and service startup;
24
+ - route, method, resolver, or service registration;
25
+ - middleware, authentication, authorization, validation, and request context;
26
+ - handler dispatch and the first stable domain/downstream boundary;
27
+ - authoritative IDL, OpenAPI, schema, service definition, or registration;
28
+ - response/error mapping, retry, timeout, and compatibility behavior;
29
+ - configuration, local run, test, deployment, and release entrypoints;
30
+ - generated models or clients and their actual source of truth.
31
+
32
+ Prefer explicit registrations over handler filenames. Sample enough operations
33
+ from each registration family to verify that the proposed aggregation is real.
34
+
35
+ ## Questions the knowledge must answer
36
+
37
+ 1. What protocol does the module provide, and where is it registered?
38
+ 2. Which operations are stable and who handles each one?
39
+ 3. What authentication, validation, middleware, or request context applies?
40
+ 4. Where does each operation hand off to domain logic or a downstream system?
41
+ 5. How are successful responses and failures translated?
42
+ 6. Which schema is authoritative, and which files are generated projections?
43
+ 7. How is the service run, configured, observed, and released?
44
+
45
+ ## Suggested knowledge units
46
+
47
+ - **Service boundary**: responsibility, startup, supported protocols,
48
+ middleware order, downstream systems, and ownership.
49
+ - **Operation registry**: use the canonical operation record from
50
+ `protocol-boundary.md`, adding handler and middleware detail from this
51
+ template rather than creating a second registry.
52
+ - **Dispatch and dependency map**: route/service registration to handler to
53
+ domain/RPC/repository boundary, grouped by coherent operation family.
54
+ - **Error and compatibility contract**: only when status/error mapping,
55
+ versioning, fallback, or compatibility is stable and source-backed.
56
+ - **Runtime and delivery guide**: configuration, startup, diagnostics,
57
+ deployment, and release entrypoints owned by this service.
58
+
59
+ Do not create a page per generated request/response model, constant, converter,
60
+ pack/unpack helper, or handler-local function.
61
+
62
+ ## Chapter blueprints
63
+
64
+ A service-boundary page may use:
65
+
66
+ ```markdown
67
+ # <Service> boundary
68
+ ## Responsibility and consumers
69
+ ## Startup and protocol registration
70
+ ## Middleware and request lifecycle
71
+ ## Operation families
72
+ ## Domain and downstream dependencies
73
+ ## Error, timeout, and compatibility behavior
74
+ ## Configuration, observability, and release
75
+ ## Exclusions and authoritative schemas
76
+ ```
77
+
78
+ A focused execution-path page may use:
79
+
80
+ ```markdown
81
+ # <Operation> execution path
82
+ ## Inbound contract
83
+ ## Middleware and validation
84
+ ## Handler orchestration
85
+ ## Domain/downstream handoff
86
+ ## Response and error mapping
87
+ ## Source-backed edges
88
+ ```
89
+
90
+ ## Granularity and relationships
91
+
92
+ Aggregate operations that share registration, middleware, handler family, and
93
+ downstream ownership. Split when operation families have different contracts,
94
+ owners, or execution paths—not merely because they are separate methods.
95
+
96
+ Record a route-to-handler or handler-to-downstream edge only when the route
97
+ table, registration, call site, or parser evidence is unambiguous. Generated
98
+ types can locate fields but do not prove runtime behavior.
99
+
100
+ ## Template composition examples
101
+
102
+ - A gateway that receives HTTP and calls RPC reads `adapter-integration.md` and
103
+ `protocol-boundary.md` in addition to this template.
104
+ - An RPC service containing stable domain orchestration also reads
105
+ `domain-service.md`.
106
+ - An event-triggered endpoint may require `event-flow.md`; background consumers
107
+ use `background-runtime.md`.
108
+
109
+ ## Revise or stop when
110
+
111
+ - no registration or authoritative operation identity is available;
112
+ - the plan lists handlers without connecting them to provided operations;
113
+ - the only contract source is generated code with an unknown upstream schema;
114
+ - security or error behavior would be guessed from names;
115
+ - scan mode would expand models and helpers into hundreds of pages.
116
+
117
+ Return a `request-material` disposition tied to a blocking material-question
118
+ proposal when required protocol semantics remain unavailable before preview.
@@ -0,0 +1,109 @@
1
+ ---
2
+ id: context.code-indexer.template.background-runtime
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Background runtime template
8
+
9
+ Use for `background-runtime`: queue or stream consumers, scheduled jobs,
10
+ pipelines, functions, controllers, watchers, and long-running agents activated
11
+ by a trigger instead of an interactive request.
12
+
13
+ Use the exact profile and Artifact policy variant supplied by the workset.
14
+
15
+ ## Evidence pass
16
+
17
+ Locate:
18
+
19
+ - process/runtime bootstrap and worker/job registration;
20
+ - trigger identity: topic, queue, schedule, hook, file, controller event, or
21
+ platform invocation;
22
+ - payload/schema locator and producer when available;
23
+ - handler dispatch, concurrency, partitioning, ordering, and state changes;
24
+ - downstream services, persistence, emitted events, and side effects;
25
+ - retry, timeout, checkpoint, idempotency, dead-letter, and recovery behavior;
26
+ - configuration, scaling, health, observability, deployment, and ownership;
27
+ - replay/test fixtures and generated payload types that are not authoritative.
28
+
29
+ Distinguish code defaults from runtime configuration. Do not describe delivery
30
+ guarantees unless registration, framework configuration, or maintained
31
+ documentation proves them.
32
+
33
+ ## Questions the knowledge must answer
34
+
35
+ 1. What activates the runtime and where is that trigger registered?
36
+ 2. What input contract is consumed, and who produces it?
37
+ 3. How does work move from dispatch through orchestration and side effects?
38
+ 4. What are the concurrency, ordering, retry, and idempotency boundaries?
39
+ 5. How does the runtime checkpoint, recover, or surface failed work?
40
+ 6. How is it configured, operated, observed, scaled, and deployed?
41
+
42
+ ## Suggested knowledge units
43
+
44
+ - **Runtime map**: bootstrap, trigger families, handler registry, dependencies,
45
+ state boundaries, and operating model.
46
+ - **Trigger/workflow registry**: stable trigger identity, input contract,
47
+ handler, downstream effects, retry/idempotency, and source locator.
48
+ - **Processing flow**: focused end-to-end path for a high-value workflow family.
49
+ - **Recovery and operations guide**: checkpointing, failed work, observability,
50
+ configuration, local execution, deployment, and safe replay where evidenced.
51
+ - **Producer-consumer chain**: only when both registered modules and the event
52
+ identity are source-backed.
53
+
54
+ ## Chapter blueprints
55
+
56
+ ```markdown
57
+ # <Background runtime> map
58
+ ## Responsibility and activation model
59
+ ## Bootstrap and trigger registration
60
+ ## Workflow or handler families
61
+ ## State and downstream side effects
62
+ ## Concurrency, ordering, retry, and idempotency
63
+ ## Failure recovery and observability
64
+ ## Configuration, scaling, and deployment
65
+ ## Contract sources and exclusions
66
+ ```
67
+
68
+ For a trigger family:
69
+
70
+ ```markdown
71
+ ## <Trigger or workflow>
72
+ - Trigger identity and registration:
73
+ - Input contract and producer:
74
+ - Dispatch and handler:
75
+ - State changes and downstream effects:
76
+ - Retry/idempotency/checkpoint behavior:
77
+ - Failure destination and operator action:
78
+ - Source evidence:
79
+ ```
80
+
81
+ ## Granularity and relationships
82
+
83
+ Prefer one record per stable trigger or coherent workflow family. Do not create
84
+ one page per handler helper, event field, retry branch, or generated payload
85
+ type. Split a page when triggers have different contracts, ownership, delivery,
86
+ or recovery semantics.
87
+
88
+ Every retained page must name concrete trigger, handler, state, side-effect,
89
+ and recovery identities with source locators. A runtime page that only lists
90
+ directories or says a worker “processes events” is too thin.
91
+
92
+ Connect producers and consumers only through a concrete topic/trigger/schema
93
+ identity. A shared type name or import is insufficient.
94
+
95
+ ## Template composition examples
96
+
97
+ - A consumer that invokes a domain boundary reads `domain-service.md`.
98
+ - A scheduler that calls external APIs selects `adapter-integration` and reads
99
+ `protocol-boundary.md`.
100
+ - A controller exposing administrative commands may combine this template with
101
+ `cli-tool.md` or `api-service.md`, but should still produce one runtime map.
102
+
103
+ ## Revise or stop when
104
+
105
+ - no trigger registry or executable worker entry can be found;
106
+ - delivery, ordering, retry, or idempotency would be guessed;
107
+ - the producer or authoritative payload contract is required but unavailable;
108
+ - the plan expands generated event structures or helpers one symbol per page;
109
+ - runtime configuration cannot be distinguished from test setup.
@@ -0,0 +1,129 @@
1
+ ---
2
+ id: context.code-indexer.template.cli-tool
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # CLI and developer tool template
8
+
9
+ Use for `cli-tool`: command-line applications, developer tools, administrative
10
+ executables, generators, and command-driven plugin hosts. A build script used
11
+ only internally does not need a CLI knowledge unit unless it is a supported
12
+ operator or contributor surface.
13
+
14
+ Use the exact profile and Artifact policy variant supplied by the workset.
15
+
16
+ ## Evidence pass
17
+
18
+ Locate:
19
+
20
+ - executable/bin entry, runtime requirement, and command parser;
21
+ - root and nested command registration;
22
+ - positional arguments, flags, defaults, mutually exclusive options, and input
23
+ schemas;
24
+ - configuration files, environment variables, profiles, credential sources,
25
+ and precedence;
26
+ - interactive prompts versus non-interactive/automation behavior;
27
+ - filesystem, repository, network, platform, and plugin side effects;
28
+ - output formats, stdout/stderr behavior, exit codes, polling, and recovery;
29
+ - local development, packaging, installation, compatibility, and release;
30
+ - deprecated commands, aliases, parser helpers, and formatters to exclude.
31
+
32
+ Inspect actual command registration and representative execution paths. Help
33
+ text is useful evidence but may not describe hidden preconditions or effects.
34
+
35
+ ## Questions the knowledge must answer
36
+
37
+ 1. How is the CLI installed or invoked, and what runtime does it require?
38
+ 2. What stable command families exist and what user outcomes do they produce?
39
+ 3. What inputs, configuration, credentials, and precedence rules apply?
40
+ 4. Which commands mutate files, repositories, remote services, or user state?
41
+ 5. What output and exit behavior supports automation and diagnosis?
42
+ 6. Which plugin or extension points change the command surface?
43
+ 7. How does a user recover from common source-backed failure states?
44
+
45
+ ## Suggested knowledge units
46
+
47
+ - **Command map**: invocation model, command families, configuration,
48
+ credentials, side effects, output formats, and extension points.
49
+ - **Task workflow**: an end-to-end supported user goal spanning several
50
+ commands, with preconditions, state transitions, and recovery.
51
+ - **Command-family reference**: coherent subcommands with inputs, outputs,
52
+ side effects, and examples.
53
+ - **Configuration and credentials**: when precedence or environment behavior is
54
+ complex and stable enough for a dedicated page.
55
+ - **Plugin/extension contract**: use the single complete blueprint in
56
+ `plugin-extension.md`; the command map only links commands and configuration
57
+ to that contract.
58
+ - **Development and release guide**: only source-backed contributor workflows
59
+ owned by this module.
60
+
61
+ ## Chapter blueprints
62
+
63
+ ```markdown
64
+ # <CLI> command map
65
+ ## Purpose, installation, and invocation
66
+ ## Command families
67
+ ## Configuration and precedence
68
+ ## Credentials and external dependencies
69
+ ## Filesystem/repository/remote side effects
70
+ ## Output formats and exit semantics
71
+ ## Plugins, compatibility, and release
72
+ ## Diagnostics, recovery, and exclusions
73
+ ```
74
+
75
+ For a command family:
76
+
77
+ ```markdown
78
+ # <Command family>
79
+ ## User outcomes and preconditions
80
+ ## Commands and arguments
81
+ ## Configuration and credential requirements
82
+ ## Execution and side effects
83
+ ## Output and exit behavior
84
+ ## Failure recovery
85
+ ## Source-backed examples
86
+ ```
87
+
88
+ A workflow page may use:
89
+
90
+ ```markdown
91
+ # <User task>
92
+ ## Starting state
93
+ ## Command sequence
94
+ ## State and artifact changes
95
+ ## Remote operations
96
+ ## Success checks
97
+ ## Recovery and rollback boundaries
98
+ ```
99
+
100
+ ## Granularity and relationships
101
+
102
+ Prefer command families and user tasks over one page per parser node, flag,
103
+ prompt, formatter, or implementation function. Split only when commands have
104
+ different state ownership, external systems, or safety/recovery contracts.
105
+
106
+ Every retained page must name real commands, task outcomes, state changes, or
107
+ extension identities with source locators. A list of command directories or
108
+ parser nodes is not a command map.
109
+
110
+ Connect commands to configuration, package/file outputs, plugin providers, and
111
+ platform operations only when source registrations or call sites prove them.
112
+
113
+ ## Template composition examples
114
+
115
+ - A CLI with installable providers also reads `adapter-integration.md` and
116
+ `plugin-extension.md`.
117
+ - A CLI that primarily wraps a remote protocol selects `adapter-integration` and
118
+ reads `protocol-boundary.md`.
119
+ - A monorepo release tool may combine this template with
120
+ `monorepo-container.md` and the `development-and-delivery.md` composer
121
+ contract without duplicating its command registry.
122
+
123
+ ## Revise or stop when
124
+
125
+ - no stable command registry or executable entry is found;
126
+ - examples require inventing flags or commands not present in source;
127
+ - side effects or credential behavior are unclear but material to safe use;
128
+ - every option/parser helper is becoming an independent page;
129
+ - deprecated or hidden implementation commands are presented as supported.
@@ -0,0 +1,99 @@
1
+ ---
2
+ id: context.code-indexer.template.component-library
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Component library template
8
+
9
+ Use for `component-library`: a supported collection of UI components, tokens,
10
+ hooks, primitives, or design-system packages consumed through documented
11
+ imports and component contracts. A web application that happens to contain
12
+ shared components remains a `web-application` unless the component surface is
13
+ published as an independent consumer boundary.
14
+
15
+ Use the exact profile and Artifact policy variant supplied by the workset.
16
+
17
+ ## Evidence pass
18
+
19
+ Locate:
20
+
21
+ - public package exports, component registries, barrels, or documented imports;
22
+ - component props, slots, events, variants, composition, and lifecycle rules;
23
+ - theme, token, styling, accessibility, locale, and provider requirements;
24
+ - maintained examples, stories, visual tests, and consumer integration tests;
25
+ - compatibility, peer dependency, platform, and release constraints;
26
+ - generated declarations, documentation sites, demos, and internal primitives
27
+ that must not become independent reader pages without a public contract.
28
+
29
+ Treat stories and examples as usage evidence, not as authority for unsupported
30
+ props or behavior. When generated declarations disagree with source, identify
31
+ the authoritative source and record the gap.
32
+
33
+ ## Questions the knowledge must answer
34
+
35
+ 1. Which component families are public, and how are they imported?
36
+ 2. What props, events, variants, slots, and composition rules are supported?
37
+ 3. Which providers, themes, tokens, runtimes, or peer packages are required?
38
+ 4. What accessibility, state, lifecycle, and failure constraints apply?
39
+ 5. Which examples demonstrate supported use and important combinations?
40
+ 6. Which implementation primitives or demo-only components are excluded?
41
+
42
+ ## Suggested knowledge units
43
+
44
+ - **Library map**: purpose, supported entrypoints, providers, component
45
+ families, compatibility, and navigation.
46
+ - **Component-family guide**: shared concepts, composition, variants,
47
+ accessibility, and representative source-backed examples.
48
+ - **Granular component reference**: only when consumers search for the exact
49
+ public component and its contract contains meaningful behavior.
50
+ - **Tokens and theming**: only the stable consumer contract, including scope,
51
+ defaults, override order, and compatibility.
52
+ - **Migration or compatibility guide**: only when maintained sources describe
53
+ version transitions or supported platform constraints.
54
+
55
+ ## Chapter blueprints
56
+
57
+ ```markdown
58
+ # <Component library> map
59
+ ## Purpose and intended consumers
60
+ ## Supported imports and providers
61
+ ## Component and token families
62
+ ## Composition and state model
63
+ ## Accessibility and localization
64
+ ## Theming and customization
65
+ ## Compatibility and release constraints
66
+ ## Examples, evidence, and exclusions
67
+ ```
68
+
69
+ For a component family:
70
+
71
+ ```markdown
72
+ # <Component family>
73
+ ## When to use it
74
+ ## Supported components and imports
75
+ ## Props, events, slots, and variants
76
+ ## Composition and state
77
+ ## Accessibility and interaction
78
+ ## Source-backed examples
79
+ ## Related families and evidence
80
+ ```
81
+
82
+ ## Granularity and relationships
83
+
84
+ Prefer component families over one page per export. Use a granular page only
85
+ when the exact public identity has a stable consumer contract beyond a type
86
+ signature. Relate components to providers, tokens, accessibility behavior,
87
+ examples, and compatible peers only when source evidence supports the link.
88
+
89
+ Do not copy implementation bodies, generated declarations, every story, or
90
+ every styling variant into reader-facing content. Do not use ordinal batches
91
+ to disguise an enumeration-heavy index.
92
+
93
+ ## Revise or stop when
94
+
95
+ - public components cannot be distinguished from internal or demo-only code;
96
+ - component behavior is inferred only from screenshots or names;
97
+ - examples invent combinations that maintained usage does not support;
98
+ - accessibility or provider requirements are asserted without evidence;
99
+ - one-page-per-component expansion has no consumer-navigation justification.
@@ -0,0 +1,73 @@
1
+ ---
2
+ id: context.code-indexer.template.contract-source
3
+ kind: procedure
4
+ media-type: text/markdown
5
+ ---
6
+
7
+ # Authoritative contract source template
8
+
9
+ Use for `contract-source`: a module whose maintained value is an authoritative
10
+ IDL, OpenAPI document, schema registry, message contract, or equivalent
11
+ machine-readable interface definition. It defines contracts consumed by other
12
+ modules but does not need to execute or dispatch them itself.
13
+
14
+ Use the exact profile and Artifact policy variant supplied by the workset.
15
+ Generated projections must point back to this authority and remain supporting
16
+ evidence rather than a second contract authority.
17
+
18
+ ## Evidence pass
19
+
20
+ Locate:
21
+
22
+ - schema roots, namespaces/packages, service or message registries, and imports;
23
+ - operation, event, request, response, and error identities;
24
+ - versioning, compatibility, deprecation, and evolution rules;
25
+ - generator configuration, target languages/packages, and generated output
26
+ boundaries;
27
+ - known provider and consumer registrations when those modules are registered;
28
+ - ownership, validation, publication, and release entrypoints.
29
+
30
+ ## Questions the knowledge must answer
31
+
32
+ 1. Which contracts are authoritative in this module?
33
+ 2. How are operations/messages grouped and identified?
34
+ 3. What versioning and compatibility rules are declared?
35
+ 4. Which generated artifacts and consumers derive from this source?
36
+ 5. How is the contract validated, published, and changed?
37
+
38
+ ## Suggested knowledge units
39
+
40
+ - **Contract registry**: namespaces, service/message families, authority,
41
+ versions, owners, and navigation.
42
+ - **Operation or message-family reference**: exact identities, payload roles,
43
+ errors, compatibility, and generated targets.
44
+ - **Generation and publication map**: generator inputs/outputs, validation,
45
+ versioning, and release boundary.
46
+ - **Provider-consumer flow**: only when both runtime endpoints are registered
47
+ and source-backed; use the cross-module template.
48
+
49
+ ## Chapter blueprint
50
+
51
+ ```markdown
52
+ # <Contract module> registry
53
+ ## Authority, ownership, and schema roots
54
+ ## Namespaces and contract families
55
+ ## Operations, messages, and error identities
56
+ ## Versioning, compatibility, and deprecation
57
+ ## Generated targets and active consumers
58
+ ## Validation, publication, and release
59
+ ## Evidence and exclusions
60
+ ```
61
+
62
+ Use the canonical operation record from `protocol-boundary.md` for detailed
63
+ families. Do not duplicate every generated language binding or claim runtime
64
+ behavior from the schema alone.
65
+
66
+ ## Granularity and stop conditions
67
+
68
+ Aggregate related operations/messages by authoritative family. Split when
69
+ namespace, owner, version policy, or compatibility behavior differs. Every page
70
+ must contain exact contract identities and source locators, not just filenames.
71
+
72
+ Revise or stop when authority cannot be distinguished from a generated copy,
73
+ imports or versions are unresolved, or compatibility claims are not declared.