@c4a/context 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 +17 -6
- package/README.zh-CN.md +121 -0
- package/contracts.d.ts +5 -0
- package/docs/README.md +11 -8
- package/docs/getting-started.md +63 -28
- package/docs/guides/agent-dialogue.md +38 -350
- package/docs/guides/agent-guide.md +143 -93
- package/docs/guides/package-outputs.md +87 -25
- package/docs/reference/package-templates.md +121 -32
- package/docs/reference/project-api.md +225 -84
- package/docs/reference/template-variables.md +32 -15
- package/index.d.ts +13 -5
- package/index.js +99 -28
- package/package.json +1 -1
- package/phases.d.ts +65 -6
- package/templates/package-templates/kb/AGENTS.md +13 -16
- package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +101 -177
- package/templates/package-templates/kb/skills/knowledge-query/scripts/search.mjs +264 -0
- package/templates/package-templates/kb/wikis/index.md +8 -8
- package/templates/package-templates.zh-CN/kb/AGENTS.md +30 -0
- package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +99 -0
- package/templates/package-templates.zh-CN/kb/skills/knowledge-query/scripts/search.mjs +264 -0
- package/templates/package-templates.zh-CN/kb/wikis/index.md +39 -0
- package/templates/package-templates.zh-CN/llms/llms.txt +8 -0
package/README.md
CHANGED
|
@@ -44,8 +44,9 @@ export default defineProject({
|
|
|
44
44
|
|
|
45
45
|
`src/index.ts` is similar to a Webpack configuration for knowledge. It defines
|
|
46
46
|
what enters the project, which transformations and gates run, and what is built
|
|
47
|
-
at the end. The installed Agent plugin
|
|
48
|
-
|
|
47
|
+
at the end. The installed Agent plugin provides thin entries; the current
|
|
48
|
+
workflow route selects the procedures and manuals needed to maintain this
|
|
49
|
+
configuration from a user's requirements.
|
|
49
50
|
|
|
50
51
|
## Public Surface
|
|
51
52
|
|
|
@@ -54,15 +55,17 @@ needed to maintain this configuration from a user's requirements.
|
|
|
54
55
|
| `defineProject()` | Declares the complete project graph. |
|
|
55
56
|
| `source()` and `allSources()` | References registered repo, file, or Lark source boundaries. |
|
|
56
57
|
| `extractTs()` | Extracts TypeScript/TSX symbols and relationships into `codegraph` candidates. |
|
|
58
|
+
| `extractCustom()` | Runs a project-owned code extractor while Context owns candidate, evidence, freshness, and Review state. |
|
|
57
59
|
| `alignProse()` and `compileProse()` | Structures document evidence and compiles source-bound knowledge candidates. |
|
|
58
60
|
| `reviewValidity()` | Declares the review gate for one collection or the project. |
|
|
59
61
|
| `customPhase()` | Adds project-specific orchestration when built-in phase factories are not enough. |
|
|
60
62
|
| `kbPackage()` | Builds an Agent knowledge-base package from approved knowledge and templates. |
|
|
61
63
|
| `llmsPackage()` | Builds a single text bundle for model context or RAG import. |
|
|
62
64
|
|
|
63
|
-
Use
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
Use `extractCustom()` when a repository needs a non-TypeScript or aggregated
|
|
66
|
+
code extractor. Use `customPhase()` only for orchestration that does not publish
|
|
67
|
+
knowledge candidates; it is not a replacement for source, extraction, Review,
|
|
68
|
+
and package lifecycle rules.
|
|
66
69
|
|
|
67
70
|
## Knowledge Collections
|
|
68
71
|
|
|
@@ -116,6 +119,13 @@ include `{{packageName}}`, `{{displayName}}`, `{{knowledgeCount}}`,
|
|
|
116
119
|
`{{knowledgeGroups}}`, `{{knowledgeItems}}`, `{{knowledgeTree}}`, and
|
|
117
120
|
`{{buildInventory}}`.
|
|
118
121
|
|
|
122
|
+
Every KB package emits flat roots such as `wikis/`, `guides/`, `rules/`, and
|
|
123
|
+
`feats/`. The package `name` defines only the `dist/<package-name>/` boundary;
|
|
124
|
+
it is not repeated inside knowledge paths. Context still accepts
|
|
125
|
+
`distribution.knowledgeNamespace` from older workspaces, but the legacy value
|
|
126
|
+
no longer changes build output and new declarations do not need it. Skill names
|
|
127
|
+
remain author-maintained and independent.
|
|
128
|
+
|
|
119
129
|
For advanced routing and retrieval, a template may carry a local script such as
|
|
120
130
|
`query.ts`, with a Skill describing when and how an Agent should call it. The
|
|
121
131
|
Skill can also route the Agent to MCP servers, CLI commands, or other tools to
|
|
@@ -127,7 +137,8 @@ The SDK stays declarative. It may describe reads, writes, phases, review, and
|
|
|
127
137
|
package selection, but the CLI owns source materialization, capture, extraction,
|
|
128
138
|
review application, approved Markdown materialization, verification, and build.
|
|
129
139
|
Do not replace CLI lifecycle operations with direct edits to `sources/`,
|
|
130
|
-
`
|
|
140
|
+
`knowledge/`, `dist/`, or the ignored `.tmp/context-runtime/lifecycle/` runtime
|
|
141
|
+
state. The CLI owns that runtime state and removes it after a successful close.
|
|
131
142
|
|
|
132
143
|
## Documentation
|
|
133
144
|
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Context SDK
|
|
2
|
+
|
|
3
|
+
[English](./README.md)
|
|
4
|
+
|
|
5
|
+
`@c4a/context` 是 Context workspace 使用的声明式 SDK。它为 `src/index.ts` 提供类型化 API,用来描述知识来源、处理阶段、审核门禁和知识包输出。SDK 本身不写入工作区,也不执行流程;这些操作由 [Context CLI](../context-cli/README.zh-CN.md) 负责。
|
|
6
|
+
|
|
7
|
+
## 项目模型
|
|
8
|
+
|
|
9
|
+
Context 项目使用“来源 → 阶段 → 知识包”的声明模型:
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import {
|
|
13
|
+
defineProject,
|
|
14
|
+
extractTs,
|
|
15
|
+
kbPackage,
|
|
16
|
+
reviewValidity,
|
|
17
|
+
source,
|
|
18
|
+
} from "@c4a/context";
|
|
19
|
+
|
|
20
|
+
const sampleLib = source("20260712", "sample-lib");
|
|
21
|
+
|
|
22
|
+
export default defineProject({
|
|
23
|
+
sources: [sampleLib],
|
|
24
|
+
phases: [
|
|
25
|
+
extractTs({ source: sampleLib, collection: "codegraph" }),
|
|
26
|
+
reviewValidity({ collection: "codegraph" }),
|
|
27
|
+
],
|
|
28
|
+
packages: [
|
|
29
|
+
kbPackage({
|
|
30
|
+
name: "sample-lib-kb",
|
|
31
|
+
template: {
|
|
32
|
+
path: "src/package-templates/kb",
|
|
33
|
+
vars: { displayName: "Sample Library KB" },
|
|
34
|
+
},
|
|
35
|
+
select: { collections: ["codegraph"], okfRoots: ["wikis"] },
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
`src/index.ts` 有点像知识项目的 Webpack 配置:它定义哪些内容进入项目、经过哪些转换和门禁,以及最终构建什么产物。安装好的 Agent 插件只提供薄入口,当前工作流路由会按需选择维护这份配置所需的流程资源和 SDK 文档。
|
|
42
|
+
|
|
43
|
+
## 主要 API
|
|
44
|
+
|
|
45
|
+
| API | 用途 |
|
|
46
|
+
|---|---|
|
|
47
|
+
| `defineProject()` | 声明完整的项目处理图。 |
|
|
48
|
+
| `source()` 和 `allSources()` | 引用已经登记的代码仓库、本地文件或飞书来源边界。 |
|
|
49
|
+
| `extractTs()` | 从 TypeScript/TSX 中提取符号和关系,生成 `codegraph` 候选。 |
|
|
50
|
+
| `extractCustom()` | 运行项目自有代码提取器,同时由 Context 维护候选、证据、新鲜度和审核状态。 |
|
|
51
|
+
| `alignProse()` 和 `compileProse()` | 整理文档证据,并生成与来源绑定的知识候选。 |
|
|
52
|
+
| `reviewValidity()` | 声明单个知识类型或整个项目的审核门禁。 |
|
|
53
|
+
| `customPhase()` | 在内置阶段无法覆盖时增加项目专用编排。 |
|
|
54
|
+
| `kbPackage()` | 使用审核通过的知识和模板构建 Agent 知识库。 |
|
|
55
|
+
| `llmsPackage()` | 构建供模型上下文或 RAG 导入使用的单文件文本包。 |
|
|
56
|
+
|
|
57
|
+
非 TypeScript 或需要聚合代码事实时使用 `extractCustom()`。`customPhase()`
|
|
58
|
+
只用于不发布知识候选的项目专用编排,不能绕开来源、提取、审核和打包生命周期。
|
|
59
|
+
|
|
60
|
+
## 知识分类
|
|
61
|
+
|
|
62
|
+
审核通过的 Markdown 会存放在 `knowledge/<collection>/`:
|
|
63
|
+
|
|
64
|
+
| 知识类型 | 主要内容 | 常见来源 |
|
|
65
|
+
|---|---|---|
|
|
66
|
+
| `codegraph` | 代码符号、模块和调用关系 | 代码仓库 |
|
|
67
|
+
| `business` | 业务概念、角色和业务关系 | 业务文档、飞书文档 |
|
|
68
|
+
| `product` | 产品能力、功能行为和产品关系 | 产品文档、需求文档 |
|
|
69
|
+
| `architecture` | 系统结构、模块职责和设计说明 | 架构文档、设计文档 |
|
|
70
|
+
| `sop` | 操作流程、运行手册和处理步骤 | 操作手册、值班文档 |
|
|
71
|
+
| `faq` | 常见问题、解释和排障方法 | FAQ、支持文档、经验记录 |
|
|
72
|
+
| `decision` | 方案选择、取舍和决策背景 | 设计评审、决策记录 |
|
|
73
|
+
| `incident` | 故障过程、处置方式和后续行动 | 故障复盘、事故报告 |
|
|
74
|
+
| `standards` | 必须遵守的规范和约束 | 研发规范、业务规则 |
|
|
75
|
+
| `test` | 验证规则、测试场景和验收标准 | 测试文档、验收说明 |
|
|
76
|
+
| `feats` | 面向具体场景整理的能力记录 | 项目自定义处理和已确认知识 |
|
|
77
|
+
|
|
78
|
+
知识类型是语义分类,不是最终知识包目录。构建时会把选中的类型映射到 `wikis/`、`guides/`、`rules/`、`feats/` 等 OKF 目录。同一份来源可能贡献多种知识,分类应该依据证据和用户确认,而不是文件名。
|
|
79
|
+
|
|
80
|
+
## 知识包模板
|
|
81
|
+
|
|
82
|
+
知识包声明会引用 `src/package-templates/` 下的可编辑模板。安装后的示例位于:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
node_modules/@c4a/context/templates/package-templates/
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
默认 KB 模板包含:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
kb/
|
|
92
|
+
|-- AGENTS.md
|
|
93
|
+
|-- skills/
|
|
94
|
+
| `-- knowledge-query/SKILL.md
|
|
95
|
+
`-- wikis/index.md
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`knowledge-query` Skill 会告诉消费知识包的 Agent 如何浏览索引、读取审核通过的知识并引用证据。项目还可以增加更多 Skills,或者在 `wikis/`、`guides/`、`rules/` 等目录中加入模板文件。
|
|
99
|
+
|
|
100
|
+
模板使用 Handlebars 变量,可以作用于文件内容和路径。常用变量包括 `{{packageName}}`、`{{displayName}}`、`{{knowledgeCount}}`、`{{knowledgeGroups}}`、`{{knowledgeItems}}`、`{{knowledgeTree}}` 和 `{{buildInventory}}`。
|
|
101
|
+
|
|
102
|
+
每个 KB 包直接输出扁平的 `wikis/`、`guides/`、`rules/`、`feats/` 等根目录;包 `name`
|
|
103
|
+
只用于确定 `dist/<package-name>/` 边界,不会再次写入知识路径。旧工作区中的
|
|
104
|
+
`distribution.knowledgeNamespace` 仍可被读取,但不再改变构建结果;新声明无需配置它。
|
|
105
|
+
Skill 名称继续由作者独立维护。
|
|
106
|
+
|
|
107
|
+
如果需要更强的路由和检索能力,模板可以携带 `query.ts` 一类本地脚本,再由 Skill 约定 Agent 何时、如何调用。Skill 也可以把 Agent 路由到 MCP、CLI 或其他工具,组成适合当前知识包的 Agentic Search 流程。
|
|
108
|
+
|
|
109
|
+
## 状态边界
|
|
110
|
+
|
|
111
|
+
SDK 只负责声明。它可以描述读取、写入、阶段、审核和知识包选择,但来源物化、内容读取、代码提取、审核应用、正式知识写入、质量验证和构建都由 CLI 负责。不要通过直接编辑 `sources/`、`knowledge/`、`dist/` 或被忽略的 `.tmp/context-runtime/lifecycle/` 运行态来替代 CLI 生命周期操作;成功 close 后 CLI 会清理该运行态。
|
|
112
|
+
|
|
113
|
+
## 参考文档
|
|
114
|
+
|
|
115
|
+
- [文档索引](./docs/README.md)
|
|
116
|
+
- [快速开始](./docs/getting-started.md)
|
|
117
|
+
- [Agent 指南](./docs/guides/agent-guide.md)
|
|
118
|
+
- [项目 API](./docs/reference/project-api.md)
|
|
119
|
+
- [知识包输出](./docs/guides/package-outputs.md)
|
|
120
|
+
- [知识包模板](./docs/reference/package-templates.md)
|
|
121
|
+
- [模板变量](./docs/reference/template-variables.md)
|
package/contracts.d.ts
CHANGED
|
@@ -19,6 +19,11 @@ export type PackageSelectDefinition = {
|
|
|
19
19
|
include?: readonly string[];
|
|
20
20
|
exclude?: readonly string[];
|
|
21
21
|
};
|
|
22
|
+
export type PackageNavigationDefinition = {
|
|
23
|
+
foldDirectoryIndexes: boolean;
|
|
24
|
+
maxInlineEntries: number;
|
|
25
|
+
};
|
|
26
|
+
export declare const DEFAULT_PACKAGE_NAVIGATION: Readonly<PackageNavigationDefinition>;
|
|
22
27
|
export declare const DOC_MAINLINE_COLLECTIONS: readonly DocumentMainlineCollection[];
|
|
23
28
|
export declare const MAINLINE_COLLECTIONS: readonly MainlineCollection[];
|
|
24
29
|
export declare const TOP_LEVEL_NAMESPACES: readonly TopLevelNamespace[];
|
package/docs/README.md
CHANGED
|
@@ -6,24 +6,27 @@ These docs ship inside the installed SDK package at:
|
|
|
6
6
|
node_modules/@c4a/context/docs/
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
For lifecycle work, Agents should first consume the resources selected by
|
|
10
|
+
`context status --format json` `workflow.current`. Read these SDK manuals when
|
|
11
|
+
the selected route requires project configuration, package templates, or
|
|
12
|
+
general reference; do not preload the whole manual set.
|
|
11
13
|
|
|
12
14
|
## Read First
|
|
13
15
|
|
|
14
16
|
- [Getting Started](./getting-started.md) — end-to-end component-library flow.
|
|
15
17
|
- [Agent Guide](./guides/agent-guide.md) — what an agent should do, and what it should not inspect manually.
|
|
16
|
-
- [Agent Dialogue](./guides/agent-dialogue.md) —
|
|
18
|
+
- [Agent Dialogue](./guides/agent-dialogue.md) — stable dialogue principles and how route-selected gate resources are discovered.
|
|
17
19
|
- [Package Outputs](./guides/package-outputs.md) — how to choose between an agent knowledge-base package, LLM text, or no package output.
|
|
18
20
|
- [Project API](./reference/project-api.md) — `defineProject`, sources, phases, review, and packages.
|
|
19
21
|
- [Package Templates](./reference/package-templates.md) — `kbPackage`, `llmsPackage`, template variables, and examples.
|
|
20
22
|
- [Template Variables](./reference/template-variables.md) — Handlebars variables, loops, comments, and default knowledge inventories.
|
|
21
23
|
|
|
22
|
-
Approved Markdown
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
Approved Markdown follows the complete Context production profile. Package
|
|
25
|
+
knowledge pages use a smaller consumer projection containing only reader-facing
|
|
26
|
+
metadata and content. Node identity, provenance, section evidence, review
|
|
27
|
+
fingerprints, symbol lists, generated-child records, and relationships remain in
|
|
28
|
+
the production workspace or `context-build-inventory.json`. The inventory maps
|
|
29
|
+
each distributed path back to its approved knowledge path. The kb package root may contain agent files; the
|
|
27
30
|
OKF-compatible surface is its selected `wikis/`, `guides/`, `rules/`, and
|
|
28
31
|
`feats/` subtrees.
|
|
29
32
|
|
package/docs/getting-started.md
CHANGED
|
@@ -10,14 +10,29 @@ source boundary, then declare the matching phases in `src/index.ts`.
|
|
|
10
10
|
context init context --dev
|
|
11
11
|
cd context
|
|
12
12
|
bun install
|
|
13
|
-
context status
|
|
13
|
+
context status --format json
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
+
Use `--language zh-CN` (or `--language en`) during initialization when the
|
|
17
|
+
generated README, AGENTS contract, and package starter templates should use a
|
|
18
|
+
specific language. Context stores this choice in `package.json`; it does not
|
|
19
|
+
guess from the shell locale or Agent conversation.
|
|
20
|
+
|
|
16
21
|
Use `--dev` when testing a local link or prepared pack before the matching SDK
|
|
17
22
|
version is published. It writes a `file:` dependency to the SDK resolved beside
|
|
18
23
|
the active CLI. Published users can omit it and install the versioned SDK from
|
|
19
24
|
the registry.
|
|
20
|
-
|
|
25
|
+
|
|
26
|
+
Without `project-dir`, init uses the dedicated `context/` directory. Initializing
|
|
27
|
+
inside a non-empty directory that is not already a Context workspace is blocked
|
|
28
|
+
before any files are written; use the returned `--allow-nonempty` command only
|
|
29
|
+
after confirming that the existing files should share the workspace root.
|
|
30
|
+
|
|
31
|
+
When operating through an Agent plugin, use the installed Context continuation
|
|
32
|
+
entry from the project root after initialization. It consumes
|
|
33
|
+
`workflow.current`, loads only the selected resources, and calls lower-level
|
|
34
|
+
CLI primitives as needed. The exact slash command or skill name is
|
|
35
|
+
host-specific.
|
|
21
36
|
|
|
22
37
|
## 2. Choose And Register A Source Boundary
|
|
23
38
|
|
|
@@ -30,7 +45,8 @@ suffixes from prose or content. ViewRef/NodeRef are identity fields, not path
|
|
|
30
45
|
strings:
|
|
31
46
|
|
|
32
47
|
```text
|
|
33
|
-
knowledge/<collection>/<
|
|
48
|
+
knowledge/<collection>/<slug>.md
|
|
49
|
+
knowledge/<collection>/<containment>/<slug>.md # intentional hierarchy only
|
|
34
50
|
repo:<date>/<module>#symbol:...
|
|
35
51
|
file:<source-name>/<document>#span:...
|
|
36
52
|
lark:<source-name>/<document>#span:...
|
|
@@ -98,21 +114,27 @@ module first. An explicit request to capture/read those exact paths or URLs is
|
|
|
98
114
|
the read confirmation for that requested batch; do not ask again after
|
|
99
115
|
registration. Merely mentioning a possible source is not permission.
|
|
100
116
|
`context status --format json` returns all remaining capture phases in
|
|
101
|
-
`
|
|
102
|
-
|
|
103
|
-
pausing for another date name or
|
|
104
|
-
|
|
105
|
-
`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
117
|
+
`workflow.current.commands`. Every item requiring the confirmed read scope is
|
|
118
|
+
marked `after-human-confirmation`, so one explicit confirmation can authorize
|
|
119
|
+
the complete requested batch without pausing for another date name or
|
|
120
|
+
collection choice between modules. If any module lacks a declaration,
|
|
121
|
+
`workflow.current.configuration` identifies the precise project change instead
|
|
122
|
+
of returning an unexecutable command. Read every
|
|
123
|
+
`workflow.current.resources.required` item before acting; long procedures and
|
|
124
|
+
semantic rules remain available as files and are loaded only for the route that
|
|
125
|
+
needs them.
|
|
126
|
+
|
|
127
|
+
After capture, status selects `route.document.classification-required` for
|
|
128
|
+
document modules without an align declaration. Run the Gate's returned
|
|
129
|
+
collection-neutral inspection commands first; only then propose a mainline
|
|
130
|
+
collection and ask for confirmation. Batch read permission does not choose a
|
|
131
|
+
collection.
|
|
111
132
|
|
|
112
133
|
When the workspace also contains repo sources, Context prioritizes untouched
|
|
113
|
-
code after all document captures finish:
|
|
114
|
-
until the code extraction round is current,
|
|
115
|
-
investigation. An existing document
|
|
134
|
+
code after all document captures finish: the current reason is
|
|
135
|
+
`route.extract.pending-target` until the code extraction round is current,
|
|
136
|
+
then routing returns to document investigation. An existing document
|
|
137
|
+
structure/compile gate is never interrupted.
|
|
116
138
|
|
|
117
139
|
For a single component package, use the package directory as the repo source
|
|
118
140
|
boundary:
|
|
@@ -173,8 +195,8 @@ the wrong ref, ask the user before running repo operations outside the CLI.
|
|
|
173
195
|
### Document Source Flow
|
|
174
196
|
|
|
175
197
|
For source documents, keep the project declaration small and let the CLI guide
|
|
176
|
-
the evidence views, structure confirmation, compile
|
|
177
|
-
close steps:
|
|
198
|
+
the evidence views, structure confirmation, deterministic compile projection,
|
|
199
|
+
review, and close steps:
|
|
178
200
|
|
|
179
201
|
```ts
|
|
180
202
|
import {
|
|
@@ -200,11 +222,12 @@ export default defineProject({
|
|
|
200
222
|
});
|
|
201
223
|
```
|
|
202
224
|
|
|
203
|
-
Then start from `context status` or the installed Context
|
|
225
|
+
Then start from `context status` or the installed host-specific Context
|
|
226
|
+
continuation entry. The
|
|
204
227
|
normal sequence is:
|
|
205
228
|
|
|
206
229
|
1. capture the source into committed snapshots;
|
|
207
|
-
2. investigate evidence and confirm
|
|
230
|
+
2. investigate evidence and confirm the CLI-managed lifecycle structure;
|
|
208
231
|
3. compile every source-bound View from confirmed structure;
|
|
209
232
|
4. review/apply the complete candidate batch once;
|
|
210
233
|
5. run close once, then verify and build when packages are declared.
|
|
@@ -242,8 +265,11 @@ context run extract:20260712/component-lib:codegraph
|
|
|
242
265
|
When operating through an Agent, use `--dry-run --format json` as the CLI
|
|
243
266
|
implementation for a no-write preview. For extract phases it returns a
|
|
244
267
|
`preview` block with resolved sources, modules, file counts, symbol counts,
|
|
245
|
-
|
|
246
|
-
|
|
268
|
+
resolved entry files, exported/internal counts, symbol-kind counts, candidate
|
|
269
|
+
estimates, `knowledgeTree`, `knowledgePathExamples`, and module-level hints.
|
|
270
|
+
Treat that preview as a structural scope check before producing draft
|
|
271
|
+
candidates; the CLI does not decide which symbols are important to a business
|
|
272
|
+
or audience.
|
|
247
273
|
|
|
248
274
|
The codegraph path keeps the stable module identity. The date stays in the repo
|
|
249
275
|
source ref and phase id, not in the knowledge path:
|
|
@@ -272,18 +298,21 @@ context review html architecture --open
|
|
|
272
298
|
Use the generated HTML page to approve or reject candidates. If the browser does
|
|
273
299
|
not open automatically, use the emitted `file://` URL. When
|
|
274
300
|
finished, open `Payload` and copy the review decision Payload into the agent chat.
|
|
275
|
-
Uniform decisions use one JSON line; exceptions add JSONL lines. The
|
|
276
|
-
|
|
277
|
-
`.tmp
|
|
301
|
+
Uniform decisions use one JSON line; exceptions add JSONL lines. The agent
|
|
302
|
+
writes that pasted payload to the recommended workspace scratch area,
|
|
303
|
+
`.tmp/agent-payloads/`, and runs:
|
|
278
304
|
|
|
279
305
|
```bash
|
|
280
306
|
context review apply <payload-file>
|
|
281
307
|
```
|
|
282
308
|
|
|
283
309
|
Do not hand-write approved Markdown. `context review apply` owns materialization
|
|
284
|
-
from
|
|
285
|
-
|
|
286
|
-
|
|
310
|
+
from the CLI-managed lifecycle candidate ledger into `knowledge/`. The runtime
|
|
311
|
+
ledger is ignored and is removed after a successful close; durable rejected
|
|
312
|
+
candidate fingerprints, when any, are kept in `knowledge/decisions.json`.
|
|
313
|
+
The location is a recommendation rather than a CLI restriction. Do not create a
|
|
314
|
+
top-level scratch directory or edit workspace config merely to retain a review
|
|
315
|
+
payload.
|
|
287
316
|
|
|
288
317
|
## 5. Build Packages
|
|
289
318
|
|
|
@@ -311,6 +340,12 @@ Choose an agent knowledge-base package when agents should consume the reviewed
|
|
|
311
340
|
knowledge as a reusable package. After the user chooses this output shape,
|
|
312
341
|
declare it with `kbPackage()`.
|
|
313
342
|
|
|
343
|
+
The package name already identifies the surrounding `dist/` directory. The OKF
|
|
344
|
+
roots inside it stay flat (`wikis/`, `guides/`, `rules/`, and `feats/`), so do
|
|
345
|
+
not ask for a second distribution namespace. Ask separately whether the author
|
|
346
|
+
wants a short Skill prefix, then maintain the complete final Skill directory
|
|
347
|
+
name in the template.
|
|
348
|
+
|
|
314
349
|
The default `knowledge-query` skill teaches agents how to query copied OKF root
|
|
315
350
|
directories structure-first, starting with `wikis/`, cite
|
|
316
351
|
page/section evidence, inspect structure/build metadata when present, and report
|