@c4a/context-cli 0.6.0-beta.6 → 0.6.0-beta.8
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 +16 -5
- package/cli.js +15062 -13079
- package/package.json +2 -2
- package/plugin/README.md +8 -0
- package/plugin/README_CN.md +6 -0
- package/plugin/skills/skill-continue-workflow/SKILL.md +43 -3
- package/plugin/skills/skill-package-output/SKILL.md +16 -3
- package/plugin/skills/skill-prose-align/SKILL.md +29 -33
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugin/skills/skill-prose-compile/SKILL.md +29 -28
- package/plugin/skills/skill-review-gate/SKILL.md +17 -3
- package/plugin/skills/skill-source-scope/SKILL.md +10 -3
- package/plugins/README.md +8 -0
- package/plugins/README_CN.md +6 -0
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +1 -1
- package/plugins/claude/skills/skill-continue-workflow/SKILL.md +43 -3
- package/plugins/claude/skills/skill-package-output/SKILL.md +16 -3
- package/plugins/claude/skills/skill-prose-align/SKILL.md +29 -33
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugins/claude/skills/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugins/claude/skills/skill-prose-compile/SKILL.md +29 -28
- package/plugins/claude/skills/skill-review-gate/SKILL.md +17 -3
- package/plugins/claude/skills/skill-source-scope/SKILL.md +10 -3
- package/plugins/codex/.codex-plugin/plugin.json +2 -2
- package/plugins/codex/skills/continue/references/internal-procedures/skill-continue-workflow.md +43 -3
- package/plugins/codex/skills/continue/references/internal-procedures/skill-package-output.md +16 -3
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-align.md +29 -33
- package/plugins/codex/skills/continue/references/internal-procedures/skill-prose-compile.md +29 -28
- package/plugins/codex/skills/continue/references/internal-procedures/skill-review-gate.md +17 -3
- package/plugins/codex/skills/continue/references/internal-procedures/skill-source-scope.md +10 -3
- package/plugins/codex/skills/init/references/internal-procedures/skill-continue-workflow.md +43 -3
- package/plugins/codex/skills/init/references/internal-procedures/skill-package-output.md +16 -3
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-align.md +29 -33
- package/plugins/codex/skills/init/references/internal-procedures/skill-prose-compile.md +29 -28
- package/plugins/codex/skills/init/references/internal-procedures/skill-review-gate.md +17 -3
- package/plugins/codex/skills/init/references/internal-procedures/skill-source-scope.md +10 -3
- package/plugins/cursor/.cursor-plugin/plugin.json +1 -1
- package/plugins/cursor/skills/skill-continue-workflow/SKILL.md +43 -3
- package/plugins/cursor/skills/skill-package-output/SKILL.md +16 -3
- package/plugins/cursor/skills/skill-prose-align/SKILL.md +29 -33
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugins/cursor/skills/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugins/cursor/skills/skill-prose-compile/SKILL.md +29 -28
- package/plugins/cursor/skills/skill-review-gate/SKILL.md +17 -3
- package/plugins/cursor/skills/skill-source-scope/SKILL.md +10 -3
- package/plugins/skills/context-continue/references/internal-procedures/skill-continue-workflow.md +43 -3
- package/plugins/skills/context-continue/references/internal-procedures/skill-package-output.md +16 -3
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-align.md +29 -33
- package/plugins/skills/context-continue/references/internal-procedures/skill-prose-compile.md +29 -28
- package/plugins/skills/context-continue/references/internal-procedures/skill-review-gate.md +17 -3
- package/plugins/skills/context-continue/references/internal-procedures/skill-source-scope.md +10 -3
- package/plugins/skills/context-init/references/internal-procedures/skill-continue-workflow.md +43 -3
- package/plugins/skills/context-init/references/internal-procedures/skill-package-output.md +16 -3
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning/references/gates.md +6 -12
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align/references/internal-procedures/structure-planning.md +16 -10
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-align.md +29 -33
- package/plugins/skills/context-init/references/internal-procedures/skill-prose-compile.md +29 -28
- package/plugins/skills/context-init/references/internal-procedures/skill-review-gate.md +17 -3
- package/plugins/skills/context-init/references/internal-procedures/skill-source-scope.md +10 -3
- package/scripts/postinstall.mjs +68 -129
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c4a/context-cli",
|
|
3
|
-
"version": "0.6.0-beta.
|
|
3
|
+
"version": "0.6.0-beta.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"context": "./cli.js"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@c4a/context": "0.6.0-beta.
|
|
9
|
+
"@c4a/context": "0.6.0-beta.8",
|
|
10
10
|
"commander": "^11.0.0",
|
|
11
11
|
"handlebars": "^4.7.8",
|
|
12
12
|
"ink": "^5.0.0",
|
package/plugin/README.md
CHANGED
|
@@ -68,6 +68,14 @@ It uses lower-level CLI primitives only when the workspace state requires them:
|
|
|
68
68
|
- `context build`
|
|
69
69
|
- `context verify`
|
|
70
70
|
|
|
71
|
+
When the user explicitly requests fully managed operation in the current
|
|
72
|
+
conversation, continuation uses `context status --managed --format json` and
|
|
73
|
+
follows its managed commands. Eligible classification, extraction-scope,
|
|
74
|
+
structure-confirmation, Review, and package-output gates proceed automatically;
|
|
75
|
+
source boundaries, unread source permission, external operations, and
|
|
76
|
+
validation failures remain gated. No managed policy is written to the project,
|
|
77
|
+
and a new conversation returns to ordinary gates.
|
|
78
|
+
|
|
71
79
|
## SDK Manual For Agents
|
|
72
80
|
|
|
73
81
|
After `bun install`, the project has a local SDK manual under:
|
package/plugin/README_CN.md
CHANGED
|
@@ -60,6 +60,12 @@ Continuation 入口会先运行 `context status`,然后跟随 CLI 诊断。安
|
|
|
60
60
|
- `context build`
|
|
61
61
|
- `context verify`
|
|
62
62
|
|
|
63
|
+
如果用户在当前对话明确要求“全托管”,Continuation 会改用 `context status
|
|
64
|
+
--managed --format json` 并持续跟随其命令。分类、提取范围、结构确认、审阅和
|
|
65
|
+
package 输出门禁可自动完成;来源边界、尚未授权的文档读取、外部仓库/系统操作和
|
|
66
|
+
校验失败仍会停下。该授权不会写入 `defineProject` 或工作区,新对话默认恢复普通
|
|
67
|
+
人工门禁。
|
|
68
|
+
|
|
63
69
|
## Agent 可读的 SDK 手册
|
|
64
70
|
|
|
65
71
|
执行 `bun install` 后,项目内会有 SDK 手册:
|
|
@@ -24,6 +24,24 @@ Continue an existing Context workspace from its current state.
|
|
|
24
24
|
workflow; do not treat the host repository root as the workspace.
|
|
25
25
|
- There is no `context continue` CLI command. Start with `context status`.
|
|
26
26
|
- `context status` and CLI diagnostics are the source of truth.
|
|
27
|
+
- If the user explicitly authorizes fully managed operation in the current
|
|
28
|
+
conversation, start and continue that loop with `context status --managed
|
|
29
|
+
--format json`, then execute its managed `command_plan`. This authority is
|
|
30
|
+
conversation-only: do not write it into `defineProject`, project files, or
|
|
31
|
+
reuse it in a later conversation.
|
|
32
|
+
- Inspect `declarationGraph` and `configurationGaps`. Before structure
|
|
33
|
+
confirmation they are configuration warnings; after confirmation, a missing
|
|
34
|
+
compile route is a hard gate. Never substitute a compile phase from another
|
|
35
|
+
collection.
|
|
36
|
+
- Treat `unclassifiedDocumentTargets`, `pendingStructureTargets`, and nonterminal
|
|
37
|
+
`structureBatch.slots` as unfinished workspace work even when the
|
|
38
|
+
current approved package is ready. A build closes only the active snapshots;
|
|
39
|
+
it does not prevent a later captured source from entering its own structure
|
|
40
|
+
round.
|
|
41
|
+
- Confirm structure per canonical source + collection slot, but batch Review
|
|
42
|
+
across the declared round. When candidates exist and
|
|
43
|
+
`pendingStructureTargets` is non-empty, follow the pending align route before
|
|
44
|
+
opening Review; deterministic close later merges every active slot.
|
|
27
45
|
- Execute safe mechanical `next:` steps; stop at semantic choices and human
|
|
28
46
|
gates.
|
|
29
47
|
- Delegate source/scope decisions to
|
|
@@ -72,6 +90,12 @@ and an explicit refusal always overrides inferred permission.
|
|
|
72
90
|
|
|
73
91
|
## Human Gates
|
|
74
92
|
|
|
93
|
+
In ordinary mode, follow every gate below. In explicit current-conversation
|
|
94
|
+
managed mode, the CLI may resolve classification, extraction scope, structure
|
|
95
|
+
confirmation, Review, and package-output choices without pausing. It still
|
|
96
|
+
must not infer a source boundary, read an unapproved source body, perform an
|
|
97
|
+
external repository/system operation, or bypass validation/verify errors.
|
|
98
|
+
|
|
75
99
|
Stop and ask, or wait for user input, for:
|
|
76
100
|
|
|
77
101
|
- `Human gate:` in CLI output.
|
|
@@ -116,6 +140,10 @@ Run:
|
|
|
116
140
|
context status
|
|
117
141
|
```
|
|
118
142
|
|
|
143
|
+
Use `context status --managed --format json` instead only when the current
|
|
144
|
+
conversation explicitly contains fully managed authorization. Keep `--managed`
|
|
145
|
+
on commands returned by that status loop; otherwise never add it.
|
|
146
|
+
|
|
119
147
|
Use the output as evidence. Explain status and next step in the user's language;
|
|
120
148
|
do not forward a long raw transcript unless requested.
|
|
121
149
|
|
|
@@ -135,7 +163,12 @@ do not forward a long raw transcript unless requested.
|
|
|
135
163
|
document structure is untouched, and code extraction is missing, pending,
|
|
136
164
|
or stale. Explain that code is processed first, then follow the exact
|
|
137
165
|
extraction preview/rerun command.
|
|
138
|
-
2. If status says `captured-ready-to-
|
|
166
|
+
2. If status says `captured-ready-to-classify`, run every immediate
|
|
167
|
+
collection-neutral investigation command, summarize evidence across all
|
|
168
|
+
targets, and ask the user to confirm the proposed mainline collection(s)
|
|
169
|
+
before editing `src/index.ts`. If status says `needs-prose-configuration`, apply only the generic
|
|
170
|
+
`routing.configuration` change in `src/index.ts`, rerun status, and do not
|
|
171
|
+
create a new workspace. If status says `captured-ready-to-investigate` or `needs-structure`, or the
|
|
139
172
|
user asks to split, merge, classify, relate, or semantically organize
|
|
140
173
|
document evidence before draft pages exist, follow
|
|
141
174
|
`${CLAUDE_PLUGIN_ROOT}/skills/skill-prose-align/SKILL.md`.
|
|
@@ -154,6 +187,10 @@ do not forward a long raw transcript unless requested.
|
|
|
154
187
|
6. If status says `ready-to-build`, `built`, `needs-package-output`, or approved knowledge exists but
|
|
155
188
|
package output is not chosen or declared,
|
|
156
189
|
follow `${CLAUDE_PLUGIN_ROOT}/skills/skill-package-output/SKILL.md`.
|
|
190
|
+
`built` is terminal only when both `unclassifiedDocumentTargets` and
|
|
191
|
+
`pendingStructureTargets` are empty. Use `structureBatch` for the complete
|
|
192
|
+
multi-source round: evidence Views are parallel-safe; stage, confirm, Review
|
|
193
|
+
apply, and close mutations are serial.
|
|
157
194
|
7. If the next command is safe per [Safe Mechanical Commands](#safe-mechanical-commands),
|
|
158
195
|
run it and return to **Step 1**.
|
|
159
196
|
8. If the next command crosses a [Human Gate](#human-gates), ask or wait; do not
|
|
@@ -183,8 +220,11 @@ usable; inspect generated package structure when package output is involved.
|
|
|
183
220
|
|
|
184
221
|
### Step 5 — Self-verify Checklist
|
|
185
222
|
|
|
186
|
-
- [ ] `context status`
|
|
187
|
-
|
|
223
|
+
- [ ] `context status` (or explicitly authorized `context status --managed`) was
|
|
224
|
+
run first. If not, return to **Step 1**.
|
|
225
|
+
- [ ] No human gate was crossed without either direct user confirmation or the
|
|
226
|
+
current conversation's managed authorization. If not, stop and report the
|
|
227
|
+
protocol error.
|
|
188
228
|
- [ ] No ad hoc file/script probing replaced CLI views. If not, discard that
|
|
189
229
|
conclusion and use the CLI view.
|
|
190
230
|
|
|
@@ -16,6 +16,11 @@ Choose and build a package output from approved knowledge.
|
|
|
16
16
|
|
|
17
17
|
- Package output is a human choice. Do not add package builders just because an
|
|
18
18
|
example exists.
|
|
19
|
+
- In explicitly authorized current-conversation fully managed mode, resolve
|
|
20
|
+
this choice from the user's stated deliverable: use an agent knowledge-base
|
|
21
|
+
package for an Agent-facing knowledge workspace, an LLM text bundle only
|
|
22
|
+
when a text/RAG bundle was requested, and skip only when the user asked to
|
|
23
|
+
keep approved Markdown without a package. Do not persist this preference.
|
|
19
24
|
- Recommend an agent knowledge-base package first for agent consumption.
|
|
20
25
|
- Present an LLM text bundle as an alternative for a single text/RAG import
|
|
21
26
|
bundle.
|
|
@@ -86,6 +91,12 @@ Explain in the user's conversation language:
|
|
|
86
91
|
users can browse from OKF root -> group -> page; `wikis/index.md` is the
|
|
87
92
|
required default OKF root entry, while selected `guides/`, `rules/`, or
|
|
88
93
|
`feats/` roots get their own indexes too;
|
|
94
|
+
- the exact mapping is `codegraph`/`business`/`product` -> `wikis/`,
|
|
95
|
+
`architecture`/`sop`/`faq`/`decision`/`incident` -> `guides/`,
|
|
96
|
+
`standards`/`test` -> `rules/`, and `feats` -> `feats/`;
|
|
97
|
+
- `wikis/` is the structured entity-and-relationship layer; guides and rules
|
|
98
|
+
may explain, operationalize, or constrain it, but co-location does not prove
|
|
99
|
+
a relationship;
|
|
89
100
|
- an LLM text bundle creates one text/RAG import bundle under
|
|
90
101
|
`dist/<name>-llms/`;
|
|
91
102
|
- the user can customize `src/package-templates/kb/` before build;
|
|
@@ -96,8 +107,8 @@ Explain in the user's conversation language:
|
|
|
96
107
|
the structural edge contract and the evidence status from `context verify`;
|
|
97
108
|
- the user can skip package output for now and keep only `knowledge/`.
|
|
98
109
|
|
|
99
|
-
|
|
100
|
-
tool when available. Use semantic option labels:
|
|
110
|
+
Outside managed mode, ask which single output to create first using the host's
|
|
111
|
+
native multi-choice tool when available. Use semantic option labels:
|
|
101
112
|
|
|
102
113
|
- Agent knowledge-base package: for agents to query and cite approved knowledge pages.
|
|
103
114
|
- LLM text bundle: for one text/RAG import bundle.
|
|
@@ -151,7 +162,9 @@ Do not patch `dist/` as the durable fix; edit the template under
|
|
|
151
162
|
|
|
152
163
|
### Step 5 — Self-verify Checklist
|
|
153
164
|
|
|
154
|
-
- [ ]
|
|
165
|
+
- [ ] The user selected the package output, or explicit current-conversation
|
|
166
|
+
managed mode resolved it from the stated deliverable. If not, return to
|
|
167
|
+
**Step 2**.
|
|
155
168
|
- [ ] Only one output was added first. If not, ask before continuing with more.
|
|
156
169
|
- [ ] A kb package template contains `wikis/index.md` and at least one
|
|
157
170
|
`SKILL.md`.
|
|
@@ -16,6 +16,10 @@ Turn captured document evidence into confirmed structure.
|
|
|
16
16
|
|
|
17
17
|
- Use this after document capture, or when the user asks to split, merge,
|
|
18
18
|
reorganize, classify, or relate document evidence.
|
|
19
|
+
- When status is `captured-ready-to-classify`, run every returned capture-phase
|
|
20
|
+
evidence command before editing `src/index.ts`. Use the collection-neutral
|
|
21
|
+
title tree, span index, and exact text to propose a mainline collection; wait
|
|
22
|
+
for user confirmation, then declare matching align/compile/review phases.
|
|
19
23
|
- The first product output is a structure draft, not final page body.
|
|
20
24
|
- Read source material only through CLI evidence views: `read-plan`,
|
|
21
25
|
`source-index`, `span-detail`, `span-text`, `schema`, and
|
|
@@ -23,17 +27,16 @@ Turn captured document evidence into confirmed structure.
|
|
|
23
27
|
and view set returned by the CLI.
|
|
24
28
|
- Write and validate `context.structure.v1` into `unapproved/structure.yaml`.
|
|
25
29
|
Stop for user confirmation before compile.
|
|
26
|
-
- Before
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
are the current structure judgment rules, not summaries.
|
|
30
|
+
- Before semantic judgment, use the CLI `semantic-rules` View to page through
|
|
31
|
+
only `semantic_rules.required`. Use each selection `reason` to keep unrelated
|
|
32
|
+
rules out of the current judgment.
|
|
30
33
|
- Plan source evidence as Sections before promoting any heading to a Node/View.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
Promotion depends on source-backed standalone retrieval identity, not on a
|
|
35
|
+
hard-coded section kind or collection name.
|
|
36
|
+
- Do not produce or validate a structure payload from this entry file alone. A
|
|
37
|
+
ruleset already present in the active context may be reused only when both its
|
|
38
|
+
`handle` and `digest` match. If the context was compacted, the digest changed,
|
|
39
|
+
or the rule content is no longer present, resume the CLI rule-page sequence.
|
|
37
40
|
- When status reaches `structure-ready` or `needs-prose-compile`, hand off to
|
|
38
41
|
`${CLAUDE_PLUGIN_ROOT}/skills/skill-prose-compile/SKILL.md`.
|
|
39
42
|
- Compile, review, close, verify, and build remain separate gates.
|
|
@@ -46,32 +49,19 @@ Use semantic labels, not SDK function names:
|
|
|
46
49
|
|
|
47
50
|
| Gate | Say this | Do not say this first |
|
|
48
51
|
|---|---|---|
|
|
52
|
+
| Collection classification | "I have inspected the captured evidence. Based on these source characteristics, I recommend this knowledge category; please confirm before I configure compilation." | Guessing from a filename, URL, or SDK collection enum before investigation |
|
|
49
53
|
| Material investigation | "I will read the evidence index and source spans through Context, then propose a structure draft." | `alignProse`, `source-index`, `context.structure.v1` |
|
|
50
54
|
| Structure confirmation | "Confirming this structure freezes page paths, section ownership, and relationships for this compile round." | `unapproved/structure.yaml` as a raw parameter |
|
|
51
55
|
| Compile handoff | "The structure is confirmed; I will switch to source-bound compile for draft pages." | Continuing to edit structure in compile |
|
|
52
56
|
|
|
53
57
|
## Runtime Discipline
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- Use `views[].command` / `next_command` for evidence reads, prioritizing the
|
|
62
|
-
CLI-designated expected view when present.
|
|
63
|
-
- Treat `agent_hints[]` as temporary diagnostics. If an agent hint conflicts
|
|
64
|
-
with a top-level `next_action` or status route, follow the top-level route.
|
|
65
|
-
- Do not use direct file tools, shell scripts, `jq`, `sed`, `cat`, `head`,
|
|
66
|
-
`tail`, Python, or Node.js to inspect `sources/`, `unapproved/`,
|
|
67
|
-
`knowledge/`, `dist/`, or CLI-managed `.tmp` as a substitute for Context
|
|
68
|
-
views.
|
|
69
|
-
- Write digest/hash flags are stale guards. Use the value returned by the CLI;
|
|
70
|
-
do not parse stdout fragments or host tool-result files to reconstruct one.
|
|
71
|
-
- Delegated execution is only valid when the user explicitly authorizes it in
|
|
72
|
-
this conversation. Do not infer it from "continue", "继续", or general trust.
|
|
73
|
-
- Run one write at a time. Do not parallelize align stage, compile stage, review
|
|
74
|
-
apply, close, or build writes.
|
|
59
|
+
`skill-continue-workflow` owns global state routing; this Skill owns only the
|
|
60
|
+
align phase selected by that route. Use CLI evidence/rule/diagnostic Views,
|
|
61
|
+
follow their exact continuation commands, and treat hints as subordinate to
|
|
62
|
+
`next_action`. Evidence reads may be parallel; stage, confirm, Review apply,
|
|
63
|
+
close, and build writes remain serial. Never reconstruct digest values or
|
|
64
|
+
inspect CLI-managed state files as a substitute for a View.
|
|
75
65
|
- If a payload is too large for a heredoc, stage it under
|
|
76
66
|
`.tmp/agent-payloads/<run-id>/...` in the workspace root and redirect stdin
|
|
77
67
|
from that file. Never reuse fixed `/tmp/c4a-*` names, and never place agent
|
|
@@ -117,6 +107,12 @@ confirmation. Do not write `lifecycle.state: confirmed`, `confirmed_by`,
|
|
|
117
107
|
`confirmed_at`, or `structure_digest` until the user has explicitly confirmed
|
|
118
108
|
the structure proposal in the conversation.
|
|
119
109
|
|
|
110
|
+
When the current conversation explicitly authorizes fully managed operation,
|
|
111
|
+
use the CLI-returned `--stage --managed` command after successful validation.
|
|
112
|
+
The CLI records `confirmed_by: managed-session`; validation errors and unresolved
|
|
113
|
+
evidence still block confirmation. Never persist managed mode in `defineProject`
|
|
114
|
+
or reuse it in another conversation.
|
|
115
|
+
|
|
120
116
|
## Procedure References
|
|
121
117
|
|
|
122
118
|
These are current structure planning rules. They define the source-bound
|
|
@@ -199,7 +195,7 @@ Validate:
|
|
|
199
195
|
context run align:<type>:<source>:<collection> --validate --input <structure.yaml> --format json
|
|
200
196
|
```
|
|
201
197
|
|
|
202
|
-
Validation returns
|
|
198
|
+
Validation returns a compact summary and writes a temporary HTML report under
|
|
203
199
|
`.tmp/context-runtime/reports/`. A validation report with
|
|
204
200
|
`confirmation_ready=false` is an Agent repair artifact, not a user review gate:
|
|
205
201
|
do not ask the user to approve it. The staged report produced after
|
|
@@ -212,8 +208,8 @@ If the user needs a focused view, run:
|
|
|
212
208
|
context run align:<type>:<source>:<collection> --view structure-summary --input <structure.yaml> --format json
|
|
213
209
|
```
|
|
214
210
|
|
|
215
|
-
The
|
|
216
|
-
|
|
211
|
+
The explicit `structure-summary` View returns the full summary for focused
|
|
212
|
+
debugging. For user confirmation, prioritize the default first-screen fields:
|
|
217
213
|
`review_notice`, `structure_report`, and `structure_summary_compact`. A valid
|
|
218
214
|
user-facing confirmation prompt must include the report `file_url`, the absolute
|
|
219
215
|
path fallback, and a compact summary of collections/views/unresolved/diagnostics.
|
|
@@ -90,18 +90,12 @@ by source evidence:
|
|
|
90
90
|
4. The source gives it independent article identity: owner/date, lifecycle,
|
|
91
91
|
timeline, tracking record, or cross-cutting support scope.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
| Warning/failure note without incident identity | `warning` or `incident` Section under the owning View |
|
|
100
|
-
| Reference/link bucket with no body | `unresolved[]` or omit, not an Entity page |
|
|
101
|
-
| Many same-source, single-section child Entities under one parent | Merge them into parent Sections unless each child has standalone lookup identity |
|
|
102
|
-
|
|
103
|
-
The CLI treats section-like child Views as invalid unless the payload provides
|
|
104
|
-
source-backed independent identity through the surrounding structure.
|
|
93
|
+
Use one content-neutral test for every proposed child View: does cited evidence
|
|
94
|
+
support an independent subject identity, enough context to stand alone, and a
|
|
95
|
+
separate retrieval need? A heading, section kind, collection name, or contains
|
|
96
|
+
edge is not sufficient by itself. The CLI warns when many same-source,
|
|
97
|
+
single-section child Entities look mechanically fragmented, but it does not
|
|
98
|
+
reject a page merely because of its content type.
|
|
105
99
|
|
|
106
100
|
## Entity Tag Rules
|
|
107
101
|
|
package/plugin/skills/skill-prose-align/references/internal-procedures/structure-planning.md
CHANGED
|
@@ -163,11 +163,12 @@ child has an independent product/code object, atomic term, Action, or Domain
|
|
|
163
163
|
identity. Also avoid copying the parent `system` / `application` scope tag onto
|
|
164
164
|
local child aspects; tag a child by what it independently is.
|
|
165
165
|
|
|
166
|
-
Do not promote
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
Do not promote a source fragment into a child page solely because it has a
|
|
167
|
+
heading or a recognized section kind. Judge every proposed child with the same
|
|
168
|
+
source-backed criteria: independent subject identity, sufficient context, and
|
|
169
|
+
standalone retrieval value. The CLI may warn about repeated same-source thin
|
|
170
|
+
children, but page granularity remains an evidence-backed structure decision
|
|
171
|
+
for the review report rather than a content-type-specific hard gate.
|
|
171
172
|
|
|
172
173
|
For `node.title` and `node.summary`, follow the workspace/source language
|
|
173
174
|
surfaced by the current view or the user's instruction. In Chinese workspaces,
|
|
@@ -195,9 +196,11 @@ snapshot hash. Section identities are part of the structure gate: choose stable
|
|
|
195
196
|
section ids such as `overview`, `behavior`, `constraints`, or a source-backed
|
|
196
197
|
domain-specific name when the evidence supports it.
|
|
197
198
|
|
|
198
|
-
Use only CLI-provided `source_refs[]` for section and edge evidence.
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
Use only CLI-provided `source_refs[]` for section and edge evidence. Continuity
|
|
200
|
+
is a per-Section constraint, not a per-View constraint: one View may contain
|
|
201
|
+
many independently retrievable Sections, each with its own continuous mirror.
|
|
202
|
+
Do not invent heading/range/window selectors inside the structure. Treat source
|
|
203
|
+
heading changes as section-planning signals: sibling sub-headings under a shared parent
|
|
201
204
|
may stay in one Section when they form one coherent semantic topic; headings
|
|
202
205
|
with no shared parent should usually split unless you intentionally want one
|
|
203
206
|
Section to span them. If a semantic section would require non-contiguous or
|
|
@@ -216,8 +219,11 @@ material to `unresolved[]`.
|
|
|
216
219
|
|
|
217
220
|
For pure suggested-split repairs, prefer the CLI repair view before hand-editing:
|
|
218
221
|
`context run align:<type>:<source>:<collection> --repair suggested-splits --input <structure.yaml> --format json`.
|
|
219
|
-
It splits non-contiguous Section mirrors
|
|
220
|
-
|
|
222
|
+
It splits non-contiguous Section mirrors and can expand a broad cross-heading
|
|
223
|
+
Section into Markdown structural groups within the same View. Apply the
|
|
224
|
+
non-blocking repair hint when the groups should be independently retrievable;
|
|
225
|
+
otherwise keep the Section and explain the grouping in structure review.
|
|
226
|
+
Oversized Views still require the Agent to apply the returned child-View and contains-edge suggestions while
|
|
221
227
|
classifying every child Node from evidence. The repair command does not resolve
|
|
222
228
|
orphan ownership, unsupported evidence, or competing semantic groupings.
|
|
223
229
|
|
|
@@ -37,13 +37,13 @@ Compile confirmed document structure into reviewable draft knowledge.
|
|
|
37
37
|
Do not write explicit `content`. If the evidence cannot be represented as a
|
|
38
38
|
faithful mirrored continuous span, split the section or return to prose align
|
|
39
39
|
for a confirmed structure change.
|
|
40
|
-
- Before
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
- Before semantic judgment, use the CLI `semantic-rules` View to page through
|
|
41
|
+
only `semantic_rules.required`; selection `reason` explains why each rule is
|
|
42
|
+
needed for the current node.
|
|
43
|
+
- Do not produce or validate compile actions from this entry file alone. A
|
|
44
|
+
ruleset already present in the active context may be reused only when both its
|
|
45
|
+
`handle` and `digest` match. If the context was compacted, the digest changed,
|
|
46
|
+
or the rule content is no longer present, resume the CLI rule-page sequence.
|
|
47
47
|
|
|
48
48
|
<reference>
|
|
49
49
|
|
|
@@ -60,21 +60,16 @@ Use semantic labels, not SDK function names:
|
|
|
60
60
|
|
|
61
61
|
## Runtime Discipline
|
|
62
62
|
|
|
63
|
-
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
`tail`, Python, or Node.js to inspect `sources/`, `unapproved/`,
|
|
74
|
-
`knowledge/`, `dist/`, or CLI-managed `.tmp` as a substitute for Context
|
|
75
|
-
views.
|
|
76
|
-
- Run one write at a time. Do not parallelize compile stage, review apply,
|
|
77
|
-
close, or build writes.
|
|
63
|
+
`skill-continue-workflow` owns global state routing; this Skill owns only the
|
|
64
|
+
compile phase selected by that route. Use CLI context/rule/diagnostic Views and
|
|
65
|
+
their exact continuation commands. Hints are subordinate to `next_action`.
|
|
66
|
+
Never inspect CLI-managed state files as a substitute for a View.
|
|
67
|
+
- Compile `read-plan`, `blockers`, `node-context`, and `schema` Views are
|
|
68
|
+
workspace-read-only and may be fetched in parallel. `--validate`, `--stage`,
|
|
69
|
+
structure confirmation, Review apply, and close remain serial mutations.
|
|
70
|
+
- One planned Section produces one compile action. When evidence contains
|
|
71
|
+
independently retrievable units, split them into sibling Sections in align;
|
|
72
|
+
do not split one planned Section into several compile actions.
|
|
78
73
|
- One write still means one View, not one human Review. Stage every View in the
|
|
79
74
|
same confirmed structure sequentially, follow `continue_compile_batch`, and
|
|
80
75
|
open Review only after the CLI reports that the whole batch is prepared.
|
|
@@ -160,11 +155,12 @@ For each node that should become draft knowledge, run:
|
|
|
160
155
|
```bash
|
|
161
156
|
context run compile:<type>:<source>:<collection> --view node-context --source <view-ref> --format json
|
|
162
157
|
context run compile:<type>:<source>:<collection> --view schema --format json
|
|
158
|
+
context run compile:<type>:<source>:<collection> --view semantic-rules --source <view-ref> --format json
|
|
163
159
|
```
|
|
164
160
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
Follow the semantic-rules `next_action.command` pages before classifying section
|
|
162
|
+
kind, summary, support, skip/update, weak evidence, or structure repair. Do not
|
|
163
|
+
load rules outside the returned required set.
|
|
168
164
|
|
|
169
165
|
Do not treat those references as optional background. They are the current
|
|
170
166
|
compile drafting, judgment, and semantic-repair procedures.
|
|
@@ -234,16 +230,21 @@ After staging, follow `next_action` exactly:
|
|
|
234
230
|
- `continue_compile_batch` with `human_gate=false`: move to the returned next
|
|
235
231
|
View and repeat **Step 2–4**. Do not open Review yet.
|
|
236
232
|
- `review_candidates` with `human_gate=true`: every planned View in this
|
|
237
|
-
confirmed structure is prepared; return to `context status
|
|
233
|
+
confirmed structure slot is prepared; return to `context status`. If
|
|
234
|
+
`pendingStructureTargets` is non-empty, complete those slots first. Delegate
|
|
238
235
|
one collection-level Review to
|
|
239
|
-
`${CLAUDE_PLUGIN_ROOT}/skills/skill-review-gate/SKILL.md
|
|
236
|
+
`${CLAUDE_PLUGIN_ROOT}/skills/skill-review-gate/SKILL.md` only when status
|
|
237
|
+
reports the complete multi-slot round ready.
|
|
238
|
+
- Use `status.structureBatch` as the complete slot overview. Its evidence Views
|
|
239
|
+
are parallel-safe, its structure mutations are serial, and Review opens once
|
|
240
|
+
after all declared slots are prepared.
|
|
240
241
|
|
|
241
242
|
The CLI blocks Review and close while confirmed Views remain unprepared. Do not
|
|
242
243
|
turn sequential View writes into sequential user approvals.
|
|
243
244
|
|
|
244
245
|
### Step 5 — Close Handoff
|
|
245
246
|
|
|
246
|
-
After the single batch review apply, return to `context status`. If status says
|
|
247
|
+
After the single collection-level batch review apply, return to `context status`. If status says
|
|
247
248
|
`compile-close-needed`, run deterministic close:
|
|
248
249
|
|
|
249
250
|
```bash
|
|
@@ -16,6 +16,11 @@ Run the human review gate. The user decides approval or rejection.
|
|
|
16
16
|
## TL;DR
|
|
17
17
|
|
|
18
18
|
- The agent never approves or rejects candidates on the user's behalf.
|
|
19
|
+
- Exception: when the current conversation explicitly authorizes fully managed
|
|
20
|
+
operation and status routes a managed Review, run the exact
|
|
21
|
+
`context review approve-all <collection> --managed --format json` (or
|
|
22
|
+
`--all`) command. Do not open HTML, synthesize a Payload, or persist this
|
|
23
|
+
authority in project configuration.
|
|
19
24
|
- Enter this skill only when the preceding command returns
|
|
20
25
|
`next_action.human_gate=true`. A no-delta codegraph run returns false and does
|
|
21
26
|
not need Review.
|
|
@@ -45,6 +50,15 @@ Run the human review gate. The user decides approval or rejection.
|
|
|
45
50
|
|
|
46
51
|
<procedures>
|
|
47
52
|
|
|
53
|
+
### Step 0 — Resolve Managed Review
|
|
54
|
+
|
|
55
|
+
If `context status --managed --format json` returns a managed-session Review
|
|
56
|
+
command, execute that atomic `approve-all` command and return to managed status.
|
|
57
|
+
Candidate scope, ids, fingerprints, structure digests, and source refs remain
|
|
58
|
+
fully validated; any mismatch is an error, not permission to bypass the gate.
|
|
59
|
+
Without explicit current-conversation managed authorization, continue with the
|
|
60
|
+
normal HTML workflow below.
|
|
61
|
+
|
|
48
62
|
### Step 1 — Open Review
|
|
49
63
|
|
|
50
64
|
For the internal collection reported by status, run:
|
|
@@ -116,9 +130,9 @@ duplicate extract-index defect rather than running the metadata migration.
|
|
|
116
130
|
|
|
117
131
|
### Step 5 — Self-verify Checklist
|
|
118
132
|
|
|
119
|
-
- [ ] Every decision came from the user's copied payload
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
- [ ] Every decision came from the user's copied payload, an explicitly scoped
|
|
134
|
+
quick command, or the current conversation's managed `approve-all` command.
|
|
135
|
+
If not, stop and discard the agent-authored decision.
|
|
122
136
|
- [ ] Payload was applied through `context review apply`. If not, return to
|
|
123
137
|
**Step 3**.
|
|
124
138
|
- [ ] No direct edits were made to `knowledge/` or `unapproved/`. If not, report
|
|
@@ -52,6 +52,10 @@ Choose and validate what may become draft knowledge.
|
|
|
52
52
|
- Before first real extraction, generate a no-write preview and show module
|
|
53
53
|
counts plus `knowledgeTree` / `knowledgePathExamples` to the user. Use
|
|
54
54
|
`--dry-run` only in the command you execute, not as the user-facing label.
|
|
55
|
+
- In explicit current-conversation fully managed mode, an evidence-backed
|
|
56
|
+
collection recommendation and a valid no-write extraction preview may be
|
|
57
|
+
accepted without another question. This never permits inventing a source
|
|
58
|
+
boundary or reading a file/Lark body the user did not authorize.
|
|
55
59
|
- During a declared multi-module extraction round, treat
|
|
56
60
|
`next_action.human_gate=false` as mechanical continuation: finish every
|
|
57
61
|
pending extract phase before opening one combined Review page.
|
|
@@ -99,10 +103,13 @@ Ask for a knowledge source in plain language and map it to the supported path:
|
|
|
99
103
|
| Local monorepo package/module | which concrete packages/subdirs belong to this batch | Register every confirmed boundary as a module under the same date. Do not create `YYYYMMDD-A/B/C`, and do not use `extractTs.include` as a package selector. |
|
|
100
104
|
| Remote Git repo | knowledge boundary, remote URL, pinned commit/ref, desired package/subdir, and permission to clone | CLI does not clone automatically. After explicit user approval, the agent may clone/checkout to an ignored local path, then register that local checkout. Cloned source content must not be committed. |
|
|
101
105
|
| Local Markdown / document file or folder | date batch, document module boundary, local path, include glob or include-list if needed, and permission to read the source body | Register with `context source add file [YYYYMMDD] --module <module> --local <path>`; `--module` may be omitted when the path-derived name is sufficient. Documents from the same date are written as sibling files under `sources/file/YYYYMMDD/` and share that date's `manifest.json`. |
|
|
102
|
-
| Lark / Feishu document | date batch, document module, URL/token,
|
|
106
|
+
| Lark / Feishu document | date batch, document module, URL/token, and permission to read remotely | Register each document with `context source add lark [YYYYMMDD] --module <module>` plus exactly one identity flag. Documents from the same date are written as sibling files under `sources/lark/YYYYMMDD/` and share that date's `manifest.json`. Omit `--module` when the CLI-derived opaque identity is acceptable. Choose the mainline collection only after capture investigation. |
|
|
103
107
|
|
|
104
|
-
When
|
|
105
|
-
collection
|
|
108
|
+
When status reaches `captured-ready-to-classify`, run every immediate
|
|
109
|
+
collection-neutral investigation command first. Then ask for a document
|
|
110
|
+
mainline collection with an evidence-backed recommendation; do not ask only
|
|
111
|
+
"which collection?" or infer it from registration metadata. Explain relevant
|
|
112
|
+
options in product language:
|
|
106
113
|
|
|
107
114
|
| Collection | Use when the source is mainly about |
|
|
108
115
|
|---|---|
|
package/plugins/README.md
CHANGED
|
@@ -68,6 +68,14 @@ It uses lower-level CLI primitives only when the workspace state requires them:
|
|
|
68
68
|
- `context build`
|
|
69
69
|
- `context verify`
|
|
70
70
|
|
|
71
|
+
When the user explicitly requests fully managed operation in the current
|
|
72
|
+
conversation, continuation uses `context status --managed --format json` and
|
|
73
|
+
follows its managed commands. Eligible classification, extraction-scope,
|
|
74
|
+
structure-confirmation, Review, and package-output gates proceed automatically;
|
|
75
|
+
source boundaries, unread source permission, external operations, and
|
|
76
|
+
validation failures remain gated. No managed policy is written to the project,
|
|
77
|
+
and a new conversation returns to ordinary gates.
|
|
78
|
+
|
|
71
79
|
## SDK Manual For Agents
|
|
72
80
|
|
|
73
81
|
After `bun install`, the project has a local SDK manual under:
|
package/plugins/README_CN.md
CHANGED
|
@@ -60,6 +60,12 @@ Continuation 入口会先运行 `context status`,然后跟随 CLI 诊断。安
|
|
|
60
60
|
- `context build`
|
|
61
61
|
- `context verify`
|
|
62
62
|
|
|
63
|
+
如果用户在当前对话明确要求“全托管”,Continuation 会改用 `context status
|
|
64
|
+
--managed --format json` 并持续跟随其命令。分类、提取范围、结构确认、审阅和
|
|
65
|
+
package 输出门禁可自动完成;来源边界、尚未授权的文档读取、外部仓库/系统操作和
|
|
66
|
+
校验失败仍会停下。该授权不会写入 `defineProject` 或工作区,新对话默认恢复普通
|
|
67
|
+
人工门禁。
|
|
68
|
+
|
|
63
69
|
## Agent 可读的 SDK 手册
|
|
64
70
|
|
|
65
71
|
执行 `bun install` 后,项目内会有 SDK 手册:
|
package/plugins/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.6.0-beta.
|
|
1
|
+
0.6.0-beta.8
|