@c4a/context 0.6.1-beta.2 → 0.6.1-beta.4
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 +8 -6
- package/README.zh-CN.md +5 -4
- package/docs/getting-started.md +26 -15
- package/docs/guides/agent-guide.md +39 -20
- package/docs/guides/package-outputs.md +40 -37
- package/docs/reference/package-templates.md +36 -48
- package/docs/reference/project-api.md +95 -12
- package/docs/reference/template-variables.md +12 -11
- package/index.d.ts +1 -0
- package/index.js +34 -43
- package/package.json +1 -1
- package/phases.d.ts +8 -5
- package/templates/package-templates/kb/AGENTS.md +7 -10
- package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +88 -180
- package/templates/package-templates/kb/wikis/index.md +1 -1
- package/templates/package-templates.zh-CN/kb/AGENTS.md +30 -0
- package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +91 -0
- package/templates/package-templates.zh-CN/kb/wikis/index.md +39 -0
- package/templates/package-templates.zh-CN/llms/llms.txt +8 -0
|
@@ -1,209 +1,117 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: {{skillName}}
|
|
3
|
-
description: Query the approved knowledge bundled with {{displayName}}.
|
|
3
|
+
description: Query the approved, source-linked knowledge bundled with {{displayName}}. Use for questions about included entities, APIs, behavior, procedures, constraints, decisions, troubleshooting, relationships, and package coverage.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Knowledge Query
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Treat each opened knowledge page or package artifact as an evidence card:
|
|
32
|
-
|
|
33
|
-
| Evidence field | Use |
|
|
8
|
+
Answer from the approved knowledge bundled with this package. Navigate through
|
|
9
|
+
its indexes before opening individual pages, and treat the visible section body
|
|
10
|
+
as evidence rather than relying on memory or frontmatter summaries.
|
|
11
|
+
|
|
12
|
+
## Query Procedure
|
|
13
|
+
|
|
14
|
+
1. Classify the request as entity lookup, explanation, procedure, rule,
|
|
15
|
+
relationship, detail, or coverage audit.
|
|
16
|
+
2. Open the most relevant root index, such as `{{wikisRoot}}/index.md`, then
|
|
17
|
+
follow its links to a likely page.
|
|
18
|
+
3. Read only the sections needed for the question. Use frontmatter to select
|
|
19
|
+
scope, not to support factual claims.
|
|
20
|
+
4. For relationship or impact questions, inspect
|
|
21
|
+
`context-build-inventory.json` `structure.edge_records` before reading the
|
|
22
|
+
endpoint pages.
|
|
23
|
+
5. Answer only from reader-visible section content and source-backed edge
|
|
24
|
+
records. Cite the supporting page or section.
|
|
25
|
+
6. If the package lacks evidence, report the gap and what was checked instead
|
|
26
|
+
of inferring from nearby content.
|
|
27
|
+
|
|
28
|
+
## Package Roots
|
|
29
|
+
|
|
30
|
+
| Root | Use |
|
|
34
31
|
|---|---|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
| `
|
|
38
|
-
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
Frontmatter and indexes orient the search; reader-visible section content and
|
|
43
|
-
source-backed edge records support claims. If a source_ref points to evidence
|
|
44
|
-
that is not bundled, cite the approved knowledge section that reviewed it and avoid expanding
|
|
45
|
-
beyond the packaged content.
|
|
32
|
+
| `{{wikisRoot}}/` | Structured entities and relationships from codegraph, business, and product knowledge. |
|
|
33
|
+
| `{{guidesRoot}}/` | Architecture, procedures, FAQs, decisions, incidents, and troubleshooting. |
|
|
34
|
+
| `{{rulesRoot}}/` | Standards, constraints, acceptance criteria, and test scenarios. |
|
|
35
|
+
| `{{featsRoot}}/` | Feature knowledge when selected into the package. |
|
|
36
|
+
|
|
37
|
+
Start from the root that matches the request. A missing root means that category
|
|
38
|
+
was not selected into this package.
|
|
46
39
|
|
|
47
40
|
## Route By Intent
|
|
48
41
|
|
|
49
|
-
|
|
|
50
|
-
|
|
51
|
-
| Vague topic or unknown name | Open the
|
|
52
|
-
|
|
|
53
|
-
|
|
|
54
|
-
| Standard, constraint, acceptance, or test
|
|
55
|
-
|
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
| Coverage, gaps, or package scope | Check indexes and `context-build-inventory.json`. | Cite those package artifacts plus relevant pages. |
|
|
59
|
-
|
|
60
|
-
Classify the user's question before opening pages. Structure queries take
|
|
61
|
-
priority over keyword search:
|
|
62
|
-
|
|
63
|
-
- Vague problem: show the relevant package structure first, then choose or ask
|
|
64
|
-
for a page/group scope. Do not answer from a package-wide text hit before
|
|
65
|
-
choosing the likely Node/page.
|
|
66
|
-
- Explicit Node/page name: open the matching page or nearest group index. If
|
|
67
|
-
several pages normalize to the same name, show the candidates instead of
|
|
68
|
-
guessing.
|
|
69
|
-
- Relationship/impact: inspect typed edges first, then read both endpoint
|
|
70
|
-
pages. If an edge is absent, page co-occurrence is not relationship evidence.
|
|
71
|
-
- Detail inside a chosen scope: open only the relevant page sections. Use
|
|
72
|
-
search only to locate the section inside that page or group.
|
|
73
|
-
- Coverage/gap/audit: use package artifacts first, then supporting pages.
|
|
74
|
-
|
|
75
|
-
If the package structure returns multiple plausible pages, ask the user to pick
|
|
76
|
-
or state the selection basis before answering. If no page or edge supports the
|
|
77
|
-
requested fact, report a gap; do not broaden search until something vaguely
|
|
78
|
-
matches.
|
|
79
|
-
|
|
80
|
-
## Workflow
|
|
81
|
-
|
|
82
|
-
1. Start with the relevant OKF root index, usually `{{wikisRoot}}/index.md`, to
|
|
83
|
-
understand the package scope.
|
|
84
|
-
2. Follow the links exposed by that index. Small directories may link directly
|
|
85
|
-
to pages; larger directories may expose their own `index.md`. If the package
|
|
86
|
-
includes other selected OKF roots, inspect their root indexes the same way.
|
|
87
|
-
3. Open only the candidate pages needed for the question; avoid workspace-wide
|
|
88
|
-
reading unless the user asks for an inventory.
|
|
89
|
-
4. Inspect frontmatter `node_type`, `sources`, and `context:section` comments to
|
|
90
|
-
confirm evidence boundaries.
|
|
91
|
-
5. Answer from reader-visible section content. Use source_ref metadata as
|
|
92
|
-
citation and freshness context, not as a license to invent missing facts.
|
|
93
|
-
6. Cite source-linked facts from the knowledge page when the answer depends on
|
|
94
|
-
code or reviewed knowledge.
|
|
95
|
-
7. If the indexes and matching pages do not cover the request, return a
|
|
96
|
-
structured gap: requested topic, indexes/pages checked, and missing source
|
|
97
|
-
span or source_ref.
|
|
98
|
-
|
|
99
|
-
For follow-up exploration, stay within the package boundary:
|
|
100
|
-
|
|
101
|
-
- User asks about dependencies or impact: inspect `context-build-inventory.json`
|
|
102
|
-
`structure.edge_records` and the endpoint pages.
|
|
103
|
-
- User asks for full detail after a partial answer: continue within the same
|
|
104
|
-
page or its child index before expanding outward.
|
|
105
|
-
- User asks for a specific feature or behavior: use exact terminology,
|
|
106
|
-
bilingual terms, product aliases, API names, flags, and error strings from the
|
|
107
|
-
question to locate a section, then answer from the section body.
|
|
108
|
-
- User mentions another page through a referenced edge or section link: open it
|
|
109
|
-
only if the relationship question requires it or the user asks to drill down.
|
|
110
|
-
- Do not auto-open every related page, edge endpoint, or search hit just because
|
|
111
|
-
it is present.
|
|
42
|
+
| Intent | First move |
|
|
43
|
+
|---|---|
|
|
44
|
+
| Vague topic or unknown name | Open the likely root index and choose a page from its grouping. |
|
|
45
|
+
| Named entity, API, domain, or action | Open the matching page or nearest group index. Show candidates if names are ambiguous. |
|
|
46
|
+
| Architecture, procedure, FAQ, decision, or incident | Start from `{{guidesRoot}}/index.md`. |
|
|
47
|
+
| Standard, constraint, acceptance, or test question | Start from `{{rulesRoot}}/index.md`. |
|
|
48
|
+
| Relationship or impact | Inspect typed edges, then read both endpoint pages. |
|
|
49
|
+
| Detail inside a known page | Read the relevant `context:section` block. |
|
|
50
|
+
| Coverage, gap, or inventory | Inspect the root indexes and `context-build-inventory.json`. |
|
|
112
51
|
|
|
113
|
-
##
|
|
52
|
+
## Evidence Contract
|
|
114
53
|
|
|
115
|
-
Use
|
|
54
|
+
Use each opened page or package artifact as an evidence card:
|
|
116
55
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
|
|
56
|
+
| Evidence | Valid use |
|
|
57
|
+
|---|---|
|
|
58
|
+
| Page path | Page identity and citation handle. |
|
|
59
|
+
| Frontmatter title, description, node type, and tags | Navigation and scope selection only. |
|
|
60
|
+
| `context:section` id, kind, and `source_ref` | Section identity, citation, and source boundary. |
|
|
61
|
+
| Reader-visible section body | Primary support for factual claims. |
|
|
62
|
+
| `context-build-inventory.json` edge records | Typed relationship evidence. |
|
|
63
|
+
| Root indexes and build inventory | Package scope and coverage evidence. |
|
|
124
64
|
|
|
125
|
-
|
|
65
|
+
Do not infer a relationship from page co-occurrence. If a `source_ref` points to
|
|
66
|
+
source material that is not bundled, cite the approved section that reviewed it
|
|
67
|
+
and do not expand beyond its visible content.
|
|
126
68
|
|
|
127
|
-
|
|
128
|
-
- include version numbers, API names, config keys, command flags, and exact
|
|
129
|
-
error strings when the user provides them;
|
|
130
|
-
- try aliases and synonyms only to locate a candidate page, not to justify a
|
|
131
|
-
claim;
|
|
132
|
-
- after a search hit, return to structure: identify the page, section, and
|
|
133
|
-
evidence boundary before answering.
|
|
69
|
+
## Search Fallback
|
|
134
70
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
71
|
+
Use text search only when indexes and page structure do not identify a useful
|
|
72
|
+
scope. Search exact names, aliases, API names, configuration keys, flags,
|
|
73
|
+
versions, or error strings from the request. Treat a hit as a lead: open its
|
|
74
|
+
page and section before answering. Search cannot replace typed edge evidence
|
|
75
|
+
for relationship claims.
|
|
138
76
|
|
|
139
|
-
##
|
|
77
|
+
## Citations And Gaps
|
|
140
78
|
|
|
141
|
-
Use compact citations
|
|
79
|
+
Use compact citations tied to claims:
|
|
142
80
|
|
|
143
81
|
```text
|
|
144
|
-
Page
|
|
145
|
-
Section
|
|
146
|
-
Source-
|
|
147
|
-
Relationship
|
|
148
|
-
|
|
82
|
+
Page: <claim> [<root>/path/page.md]
|
|
83
|
+
Section: <claim> [<root>/path/page.md#section-id]
|
|
84
|
+
Source-bound: <claim> [<root>/path/page.md#section-id, source_ref]
|
|
85
|
+
Relationship: <claim> [context-build-inventory.json#structure.edge_records edge:<type>]
|
|
86
|
+
Coverage: <claim> [context-build-inventory.json]
|
|
149
87
|
```
|
|
150
88
|
|
|
151
|
-
|
|
152
|
-
explain what each supports. Do not list citations without tying them to claims.
|
|
153
|
-
|
|
154
|
-
For relationship answers, cite the typed edge when present and then cite endpoint
|
|
155
|
-
sections for the facts about each endpoint. If no edge exists, do not infer a relationship from co-occurrence; say that the package lacks a source-backed relationship edge and cite any weaker page-level evidence separately.
|
|
89
|
+
When evidence is missing, return:
|
|
156
90
|
|
|
157
|
-
|
|
91
|
+
```text
|
|
92
|
+
Gap: this package does not contain evidence for <missing point>.
|
|
93
|
+
Checked: <indexes, pages, or artifacts>.
|
|
94
|
+
Next useful source: <source, page, or source_ref if known>.
|
|
95
|
+
```
|
|
158
96
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
`context:section` citation when available.
|
|
162
|
-
- Package coverage or known-limit claims need `context-build-inventory.json`
|
|
163
|
-
and/or the checked indexes/pages.
|
|
164
|
-
- `source_ref` metadata names the reviewed evidence boundary, but the source
|
|
165
|
-
body may not be bundled. Do not invent source text that is not present in the
|
|
166
|
-
packaged knowledge page.
|
|
97
|
+
Distinguish “not evidenced by this package” from “not true.” Do not fill gaps
|
|
98
|
+
from memory, previous conversations, or source files outside the package.
|
|
167
99
|
|
|
168
|
-
##
|
|
100
|
+
## Package Boundary
|
|
169
101
|
|
|
170
|
-
|
|
102
|
+
- The bundled OKF-compatible roots are the source of truth for this Skill.
|
|
103
|
+
- The package contains approved knowledge selected by its Context workspace; it
|
|
104
|
+
does not claim complete coverage of the underlying product or codebase.
|
|
105
|
+
- Do not scan every page or edge when a narrower indexed scope answers the
|
|
106
|
+
request.
|
|
171
107
|
|
|
172
|
-
|
|
173
|
-
Gap: this package did not return evidence for <missing point>.
|
|
174
|
-
Checked: <indexes/pages/artifacts>.
|
|
175
|
-
Next useful source need: <source, page, or source_ref if known>.
|
|
176
|
-
```
|
|
108
|
+
Approved knowledge files: `{{knowledgeCount}}`
|
|
177
109
|
|
|
178
|
-
|
|
179
|
-
raw source files outside this package.
|
|
180
|
-
|
|
181
|
-
If the likely cause is that source material was captured but not approved into
|
|
182
|
-
this package, say that the packaged knowledge does not include it. Do not tell
|
|
183
|
-
the user it is false; distinguish "not evidenced here" from "not true."
|
|
184
|
-
|
|
185
|
-
## Knowledge Boundary
|
|
186
|
-
|
|
187
|
-
- The bundled OKF root directories, usually including `{{wikisRoot}}/`, are the source
|
|
188
|
-
of truth for this skill.
|
|
189
|
-
- OKF root mapping: `{{wikisRoot}}/` maps from the structured `codegraph`,
|
|
190
|
-
`business`, and `product` collections; `{{guidesRoot}}/` maps from
|
|
191
|
-
`architecture`, `sop`, `faq`, `decision`, and `incident`;
|
|
192
|
-
`{{rulesRoot}}/` maps from `standards` and `test`; `{{featsRoot}}/` maps from
|
|
193
|
-
`feats`.
|
|
194
|
-
- Treat `{{wikisRoot}}/` as the primary entity-and-relationship layer. Guides and rules
|
|
195
|
-
may explain, operationalize, or constrain that structured knowledge, but
|
|
196
|
-
directory co-location alone is not relationship evidence.
|
|
197
|
-
- Bundled OKF root directories follow the C4A OKF Profile.
|
|
198
|
-
- Prefer OKF indexes, `context-build-inventory.json`, package manifests when
|
|
199
|
-
present, build inventory, and page source span metadata over raw text search.
|
|
200
|
-
- Do not rely on memory when a knowledge page exists.
|
|
201
|
-
- Do not claim the package is complete; it only contains approved knowledge that
|
|
202
|
-
was selected by the Context workspace.
|
|
203
|
-
- If the package lacks project-specific instructions, state that the default
|
|
204
|
-
skill is a generic query entry and report gaps instead of inventing workflow
|
|
205
|
-
guidance.
|
|
206
|
-
|
|
207
|
-
## Included Knowledge
|
|
110
|
+
## Template Author Recommendation
|
|
208
111
|
|
|
209
|
-
|
|
112
|
+
This is a complete generic query Skill, but package authors should replace or
|
|
113
|
+
edit it before publishing when the package has project-specific terminology,
|
|
114
|
+
common user intents, preferred entry pages, known limits, or task workflows.
|
|
115
|
+
Update the description, routing table, and package-boundary guidance to match
|
|
116
|
+
the actual package. If the generic behavior is intentionally sufficient,
|
|
117
|
+
explicitly accept the unchanged default during Context package-template review.
|
|
@@ -40,4 +40,4 @@ Use this index as the entry point, then open the linked knowledge pages for sour
|
|
|
40
40
|
|
|
41
41
|
- Start from the navigation above, then open linked pages or child indexes for source-linked details.
|
|
42
42
|
- Use the bundled knowledge-query Skill when this bundle is installed as an agent knowledge package.
|
|
43
|
-
-
|
|
43
|
+
- Package authors should replace or edit this generic index before publishing when the package needs bundle scope, known gaps, project-specific reading paths, or task entry points; otherwise explicitly accept the unchanged default during Context package-template review.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# {{displayName}}
|
|
2
|
+
|
|
3
|
+
本知识包由 Context 工作区生成。
|
|
4
|
+
|
|
5
|
+
- 包名:`{{packageName}}`
|
|
6
|
+
- 类型:`{{packageKind}}`
|
|
7
|
+
- 已批准知识文件:`{{knowledgeCount}}`
|
|
8
|
+
|
|
9
|
+
## 使用方式
|
|
10
|
+
|
|
11
|
+
将包内 Markdown 作为经过审核、可追溯来源的产品与代码知识。回答问题时优先使用知识页中的可见正文,不要依赖记忆补全。
|
|
12
|
+
|
|
13
|
+
随包提供的 knowledge-query Skill 会指导 Agent 从 `{{wikisRoot}}/` 等 OKF 索引开始导航,并引用实际读取的知识页。
|
|
14
|
+
|
|
15
|
+
包内可能包含以下 OKF 根目录:
|
|
16
|
+
|
|
17
|
+
- `{{wikisRoot}}/`:结构化实体和关系,对应 codegraph、business、product。
|
|
18
|
+
- `{{guidesRoot}}/`:架构、流程、FAQ、决策和故障记录。
|
|
19
|
+
- `{{rulesRoot}}/`:标准、约束、验收条件和测试场景。
|
|
20
|
+
- `{{featsRoot}}/`:被选择进入包内的功能知识。
|
|
21
|
+
|
|
22
|
+
这些目录使用兼容 OKF 的 Context profile:OKF 字段和 Context 扩展字段保持在顶层,不生成额外的 `context` 或 `schema` 包装字段。`{{wikisRoot}}/` 是实体与关系层,guides 和 rules 可以围绕其中内容进行解释或约束。
|
|
23
|
+
|
|
24
|
+
## 包含的知识
|
|
25
|
+
|
|
26
|
+
`context build` 会把已批准且被当前包选择的 Markdown 复制到这里。目录索引和 `context-build-inventory.json` 用于导航、覆盖检查与关系查询。
|
|
27
|
+
|
|
28
|
+
## 模板作者建议
|
|
29
|
+
|
|
30
|
+
这是可直接工作的通用模板。正式发布前,如果知识包存在专用术语、常见用户意图、推荐入口、已知边界或固定任务流程,作者应替换或编辑本文件及 knowledge-query Skill;如果通用行为已经足够,应在 Context 的包模板 Review 中明确接受未修改模板。
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: {{skillName}}
|
|
3
|
+
description: 查询 {{displayName}} 中经过审核、可追溯来源的知识。用于查找包内实体、API、行为、流程、约束、决策、排障信息、关系和覆盖范围。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 知识查询
|
|
7
|
+
|
|
8
|
+
只根据本包包含的已批准知识回答。先通过索引缩小范围,再打开具体页面;正文是事实证据,frontmatter 摘要只用于导航。
|
|
9
|
+
|
|
10
|
+
## 查询步骤
|
|
11
|
+
|
|
12
|
+
1. 判断请求属于实体查找、解释、流程、规则、关系、细节还是覆盖检查。
|
|
13
|
+
2. 从最相关的根索引开始,例如 `{{wikisRoot}}/index.md`,再沿链接进入具体页面。
|
|
14
|
+
3. 只读取回答所需的章节;frontmatter 用来选择范围,不作为事实依据。
|
|
15
|
+
4. 查询关系或影响范围时,先检查 `context-build-inventory.json` 中的 `structure.edge_records`,再读取两端页面。
|
|
16
|
+
5. 结论只能来自可见章节正文和来源支持的边记录,并引用对应页面或章节。
|
|
17
|
+
6. 如果包内没有证据,明确报告缺口和已经检查的范围,不要根据邻近内容推断。
|
|
18
|
+
|
|
19
|
+
## 知识根目录
|
|
20
|
+
|
|
21
|
+
| 根目录 | 用途 |
|
|
22
|
+
|---|---|
|
|
23
|
+
| `{{wikisRoot}}/` | 来自 codegraph、business、product 的结构化实体和关系。 |
|
|
24
|
+
| `{{guidesRoot}}/` | 架构、流程、FAQ、决策、故障和排障说明。 |
|
|
25
|
+
| `{{rulesRoot}}/` | 标准、约束、验收条件和测试场景。 |
|
|
26
|
+
| `{{featsRoot}}/` | 被选择进入包内的功能知识。 |
|
|
27
|
+
|
|
28
|
+
缺少某个根目录表示当前知识包没有选择该类别。
|
|
29
|
+
|
|
30
|
+
## 按意图导航
|
|
31
|
+
|
|
32
|
+
| 意图 | 第一步 |
|
|
33
|
+
|---|---|
|
|
34
|
+
| 模糊主题或未知名称 | 打开可能相关的根索引,从分组中选择候选页面。 |
|
|
35
|
+
| 指定实体、API、领域或动作 | 打开匹配页面或最近的分组索引;有歧义时列出候选。 |
|
|
36
|
+
| 架构、流程、FAQ、决策或故障 | 从 `{{guidesRoot}}/index.md` 开始。 |
|
|
37
|
+
| 标准、约束、验收或测试 | 从 `{{rulesRoot}}/index.md` 开始。 |
|
|
38
|
+
| 关系或影响范围 | 检查类型化边,再读取两端页面。 |
|
|
39
|
+
| 已知页面中的细节 | 读取对应 `context:section`。 |
|
|
40
|
+
| 覆盖范围或缺口 | 检查根索引和 `context-build-inventory.json`。 |
|
|
41
|
+
|
|
42
|
+
## 证据契约
|
|
43
|
+
|
|
44
|
+
| 证据 | 可支持的内容 |
|
|
45
|
+
|---|---|
|
|
46
|
+
| 页面路径 | 页面身份和引用位置。 |
|
|
47
|
+
| frontmatter 的标题、描述、节点类型和标签 | 导航和范围选择。 |
|
|
48
|
+
| `context:section` 的 id、kind、`source_ref` | 章节身份、引用位置和来源边界。 |
|
|
49
|
+
| 读者可见的章节正文 | 事实结论的主要依据。 |
|
|
50
|
+
| `context-build-inventory.json` 的边记录 | 类型化关系证据。 |
|
|
51
|
+
| 根索引和构建清单 | 包的范围和覆盖情况。 |
|
|
52
|
+
|
|
53
|
+
不要根据页面同时出现来推断关系。如果 `source_ref` 指向未随包分发的来源,只能引用已经过审核的可见章节,不能扩展到正文没有表达的内容。
|
|
54
|
+
|
|
55
|
+
## 搜索兜底
|
|
56
|
+
|
|
57
|
+
只有索引和页面结构无法确定范围时才使用文本搜索。优先搜索请求中的精确名称、别名、API、配置键、参数、版本或错误字符串。搜索命中只是线索,回答前仍需打开对应页面和章节。文本搜索不能代替关系边证据。
|
|
58
|
+
|
|
59
|
+
## 引用与缺口
|
|
60
|
+
|
|
61
|
+
引用应紧跟结论:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
页面: <结论> [<root>/path/page.md]
|
|
65
|
+
章节: <结论> [<root>/path/page.md#section-id]
|
|
66
|
+
来源绑定: <结论> [<root>/path/page.md#section-id, source_ref]
|
|
67
|
+
关系: <结论> [context-build-inventory.json#structure.edge_records edge:<type>]
|
|
68
|
+
覆盖: <结论> [context-build-inventory.json]
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
没有证据时返回:
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
缺口:本知识包没有包含 <缺失点> 的证据。
|
|
75
|
+
已检查:<索引、页面或构建产物>。
|
|
76
|
+
下一步来源:<已知时填写来源、页面或 source_ref>。
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
“本包没有证据”不等于“事实不成立”。禁止使用模型记忆、旧对话或包外源码填补缺口。
|
|
80
|
+
|
|
81
|
+
## 包边界
|
|
82
|
+
|
|
83
|
+
- 包内兼容 OKF 的根目录是本 Skill 的事实来源。
|
|
84
|
+
- 本包只包含 Context 工作区选择并批准的知识,不声明完整覆盖底层产品或代码库。
|
|
85
|
+
- 已有更窄索引范围可以回答时,不要扫描所有页面或关系边。
|
|
86
|
+
|
|
87
|
+
已批准知识文件:`{{knowledgeCount}}`
|
|
88
|
+
|
|
89
|
+
## 模板作者建议
|
|
90
|
+
|
|
91
|
+
这是可直接工作的通用查询 Skill。正式发布前,如果知识包存在专用术语、常见用户意图、推荐入口、已知边界或固定任务流程,作者应修改 description、路由表和包边界说明;如果通用行为已经足够,应在 Context 的包模板 Review 中明确接受未修改模板。
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Knowledge Bundle
|
|
3
|
+
title: "{{displayName}}"
|
|
4
|
+
description: "由 Context 工作区生成的已批准知识包。"
|
|
5
|
+
tags:
|
|
6
|
+
- context
|
|
7
|
+
- knowledge-base
|
|
8
|
+
timestamp: "{{knowledgeTimestamp}}"
|
|
9
|
+
resource: "context://package/{{packageName}}/{{wikisRoot}}"
|
|
10
|
+
package: "{{packageName}}"
|
|
11
|
+
package_kind: "{{packageKind}}"
|
|
12
|
+
knowledge_count: {{knowledgeCount}}
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
<!-- context:template
|
|
16
|
+
这是一个起始模板。`context build` 渲染后会将其复制到
|
|
17
|
+
`dist/<package-name>/{{wikisRoot}}/index.md`。
|
|
18
|
+
|
|
19
|
+
以 context:template 开头的模板注释不会进入构建产物。
|
|
20
|
+
修改前请阅读模板变量手册:
|
|
21
|
+
node_modules/@c4a/context/docs/reference/template-variables.md
|
|
22
|
+
|
|
23
|
+
正式发布前,应补充知识包范围、目标读者、推荐阅读顺序、已知缺口、使用场景或任务入口。
|
|
24
|
+
小目录会直接列出内容,超过导航阈值时会链接到子目录 index.md。
|
|
25
|
+
-->
|
|
26
|
+
|
|
27
|
+
# {{displayName}}
|
|
28
|
+
|
|
29
|
+
本知识包包含 `{{knowledgeCount}}` 个已批准知识页面。请先使用本索引定位范围,再打开具体知识页获取可追溯来源的细节。
|
|
30
|
+
|
|
31
|
+
## 内容
|
|
32
|
+
|
|
33
|
+
{{knowledgeGroupsMarkdown}}
|
|
34
|
+
|
|
35
|
+
## 使用方式
|
|
36
|
+
|
|
37
|
+
- 从上方导航开始,再进入知识页或子目录索引。
|
|
38
|
+
- 安装为 Agent 知识包后,可以使用随包提供的 knowledge-query Skill。
|
|
39
|
+
- 如果包需要专用范围、已知缺口、阅读路径或任务入口,作者应替换或编辑本通用索引;否则应在 Context 包模板 Review 中明确接受未修改模板。
|