@c4a/context-cli 0.6.8 → 0.6.10
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 +156 -220
- package/README.zh-CN.md +120 -160
- package/cli.js +265 -58
- package/docs/quickstart.md +57 -70
- package/docs/quickstart.zh-CN.md +79 -0
- package/package.json +4 -4
- package/plugins/.agents/plugins/marketplace.json +1 -1
- package/plugins/.claude-plugin/marketplace.json +2 -2
- package/plugins/.cursor-plugin/marketplace.json +2 -2
- package/plugins/README.md +79 -66
- package/plugins/README_CN.md +62 -57
- package/plugins/VERSION +1 -1
- package/plugins/claude/.claude-plugin/plugin.json +3 -3
- package/plugins/claude/commands/context.md +121 -0
- package/plugins/codex/.codex-plugin/plugin.json +4 -4
- package/plugins/codex/skills/context/SKILL.md +133 -0
- package/plugins/cursor/.cursor-plugin/plugin.json +3 -3
- package/plugins/cursor/README.md +2 -2
- package/plugins/cursor/commands/c4a-context.md +125 -0
- package/plugins/skills/c4a-context/SKILL.md +133 -0
- package/providers/context/graphs/workspace.yaml +40 -1
- package/providers/context/manifest.json +27 -9
- package/providers/context/provider.yaml +2 -2
- package/providers/context/resources/dialogue/workflow-mode-after-capture.md +22 -0
- package/providers/context/resources/dialogue/workflow-mode-after-creation.md +25 -0
- package/providers/context/resources/manuals/guides/package-outputs.md +1 -1
- package/providers/context/resources/manuals/reference/package-templates.md +1 -1
- package/plugins/claude/commands/continue.md +0 -109
- package/plugins/claude/commands/init.md +0 -36
- package/plugins/codex/skills/continue/SKILL.md +0 -121
- package/plugins/codex/skills/init/SKILL.md +0 -48
- package/plugins/cursor/commands/context-continue.md +0 -113
- package/plugins/cursor/commands/context-init.md +0 -40
- package/plugins/skills/context-continue/SKILL.md +0 -121
- package/plugins/skills/context-init/SKILL.md +0 -48
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.6.
|
|
2
|
+
"name": "c4a",
|
|
3
|
+
"description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
|
|
4
|
+
"version": "0.6.10",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "c4a"
|
|
7
7
|
},
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Build or continue structured, traceable Agent knowledge from documents and code."
|
|
3
|
+
argument-hint: "[project-dir or user intent]"
|
|
4
|
+
allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Your Task
|
|
8
|
+
|
|
9
|
+
Context is a knowledge management tool built for Agent knowledge workflows. It
|
|
10
|
+
compiles Feishu/Lark documents, local Markdown, repository code, and manually
|
|
11
|
+
curated business material into structured, traceable knowledge, then produces
|
|
12
|
+
knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
|
|
13
|
+
workflow guidance, knowledge-building procedures, and code-indexing capabilities
|
|
14
|
+
needed to produce that knowledge; follow its returned commands and resources
|
|
15
|
+
for the next action.
|
|
16
|
+
|
|
17
|
+
Use this as the single conversational entry for Context. Let the CLI locate an
|
|
18
|
+
existing workspace, relocate into it, initialize a requested workspace, or
|
|
19
|
+
evaluate its current workflow. Do not infer the workspace state yourself.
|
|
20
|
+
|
|
21
|
+
### Enter the workspace
|
|
22
|
+
|
|
23
|
+
Run:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
context entry [project-dir] --language <language> --format json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
30
|
+
for a Chinese conversation and `en` for an English conversation. Pass
|
|
31
|
+
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
32
|
+
requested that initialization choice. Pass `--managed` only after the user
|
|
33
|
+
explicitly authorizes fully managed operation in this conversation.
|
|
34
|
+
|
|
35
|
+
If the `context` process itself cannot start because the command is missing
|
|
36
|
+
(`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
|
|
37
|
+
command, such as `command not found: context` or `context: command not found`),
|
|
38
|
+
explain that the global CLI is not installed and ask the user to install or
|
|
39
|
+
authorize installation with:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm install -g @c4a/context-cli@latest
|
|
43
|
+
context plugin install
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Stop after giving that recovery. Do not run an installation preflight, install
|
|
47
|
+
automatically, or mistake a normal Context `not found` diagnostic for a missing
|
|
48
|
+
executable.
|
|
49
|
+
|
|
50
|
+
Execute only `next_action.command` returned by `context entry`:
|
|
51
|
+
|
|
52
|
+
- `initialize-workspace` writes a new workspace. Execute it immediately only
|
|
53
|
+
when the user explicitly requested initialization through this entry;
|
|
54
|
+
otherwise explain the target root and ask for confirmation. Preserve the
|
|
55
|
+
`init-target-nonempty` confirmation.
|
|
56
|
+
- `enter-workspace` and `evaluate-workflow` are read-only and need no additional
|
|
57
|
+
confirmation.
|
|
58
|
+
- After initialization, execute the exact setup command returned by `context
|
|
59
|
+
init`, enter the project root, read the generated `AGENTS.md`, and run this
|
|
60
|
+
entry again.
|
|
61
|
+
|
|
62
|
+
### Conversation modes
|
|
63
|
+
|
|
64
|
+
Enable debugging only when the user explicitly requests it. Run `context debug
|
|
65
|
+
enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
|
|
66
|
+
does not grant workflow authority or provide source evidence.
|
|
67
|
+
|
|
68
|
+
For explicitly authorized fully managed operation, use:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
context run --managed --until blocked-or-complete --format json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Use `--managed` for every resumed workflow evaluation in the same active
|
|
75
|
+
request. Never persist or reuse that authority in another conversation, and
|
|
76
|
+
stop using it when the conversation ends or the user revokes it. Pass any
|
|
77
|
+
additional `--authority` only when the user explicitly grants that authority in
|
|
78
|
+
this conversation.
|
|
79
|
+
|
|
80
|
+
The managed loop executes only Route-selected work and returns the current
|
|
81
|
+
`workflow.current` whenever Agent reading, project configuration, a human Gate,
|
|
82
|
+
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
83
|
+
that returned Route; never reconstruct a command from an earlier step.
|
|
84
|
+
|
|
85
|
+
### Follow the current Route
|
|
86
|
+
|
|
87
|
+
Treat `workflow.current` as the current-step authority:
|
|
88
|
+
|
|
89
|
+
1. Read every `resources.required` item whose `read_state` is `read-required`.
|
|
90
|
+
Read a returned `path` completely, or execute a returned resource `command`
|
|
91
|
+
and read its complete output file. Materializing a resource is not reading
|
|
92
|
+
it. Keep the merged receipts only in this conversation and submit them with
|
|
93
|
+
the exact returned `context status --resource-receipts @<file>` command. Use
|
|
94
|
+
`after_read_receipts` only after the full resource has been read. The exact
|
|
95
|
+
`resources.after_read.command` already returns the re-evaluated
|
|
96
|
+
`workflow.current`; continue from it without an additional status call.
|
|
97
|
+
2. At a Gate, keep inspection and resolution phase-local. Read an
|
|
98
|
+
`inspection_action` resource only while inspecting the decision, and read a
|
|
99
|
+
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
100
|
+
replaces ordinary required resources.
|
|
101
|
+
3. Execute only `commands` returned by the Route, preserving revision and
|
|
102
|
+
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
103
|
+
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
104
|
+
as an exact top-level host action with the required host access,
|
|
105
|
+
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
106
|
+
for its audit and approval contract; never invent a payload, destination, or
|
|
107
|
+
substitute command.
|
|
108
|
+
4. If `configuration` is present, edit only the named project file and use the
|
|
109
|
+
selected resources as its contract.
|
|
110
|
+
5. After every action or configuration change, run status again. The managed
|
|
111
|
+
loop performs this re-evaluation internally. A phase-local `next_action` can
|
|
112
|
+
continue that operation but never replaces the workspace Route.
|
|
113
|
+
|
|
114
|
+
Explain, ask, confirm, and summarize in the user's current conversation
|
|
115
|
+
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
116
|
+
`source_ref` values, and copied CLI tokens unchanged.
|
|
117
|
+
|
|
118
|
+
Do not infer repo sources, extraction scope, review decisions, or package output
|
|
119
|
+
choices from surrounding files. Do not call source-repo operations such as
|
|
120
|
+
clone, checkout, reset, fetch, install, build, or test without explicit user
|
|
121
|
+
approval.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"description": "
|
|
2
|
+
"name": "c4a",
|
|
3
|
+
"version": "0.6.10",
|
|
4
|
+
"description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "c4a"
|
|
7
7
|
},
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"skills": "./skills/",
|
|
19
19
|
"interface": {
|
|
20
20
|
"displayName": "C4A Context",
|
|
21
|
-
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.
|
|
21
|
+
"shortDescription": "Initialize and advance a local, source-linked project knowledge workspace.\nv0.6.10",
|
|
22
22
|
"longDescription": "Create a Context workspace and use agent-guided next steps to register sources, run extraction, review candidates, build package outputs, and verify health without silently mutating source repositories.",
|
|
23
23
|
"developerName": "c4a",
|
|
24
24
|
"category": "Productivity",
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context
|
|
3
|
+
description: >
|
|
4
|
+
Build or continue structured, traceable Agent knowledge from documents and code. Use the local `context` CLI for workspace writes.
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Context
|
|
10
|
+
|
|
11
|
+
Public Context entry for agents that expose skills instead of slash commands.
|
|
12
|
+
|
|
13
|
+
- Public entry: `context`
|
|
14
|
+
- Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
|
|
15
|
+
- CLI primitive prefix: `context ...`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
Context is a knowledge management tool built for Agent knowledge workflows. It
|
|
22
|
+
compiles Feishu/Lark documents, local Markdown, repository code, and manually
|
|
23
|
+
curated business material into structured, traceable knowledge, then produces
|
|
24
|
+
knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
|
|
25
|
+
workflow guidance, knowledge-building procedures, and code-indexing capabilities
|
|
26
|
+
needed to produce that knowledge; follow its returned commands and resources
|
|
27
|
+
for the next action.
|
|
28
|
+
|
|
29
|
+
Use this as the single conversational entry for Context. Let the CLI locate an
|
|
30
|
+
existing workspace, relocate into it, initialize a requested workspace, or
|
|
31
|
+
evaluate its current workflow. Do not infer the workspace state yourself.
|
|
32
|
+
|
|
33
|
+
### Enter the workspace
|
|
34
|
+
|
|
35
|
+
Run:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
context entry [project-dir] --language <language> --format json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
42
|
+
for a Chinese conversation and `en` for an English conversation. Pass
|
|
43
|
+
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
44
|
+
requested that initialization choice. Pass `--managed` only after the user
|
|
45
|
+
explicitly authorizes fully managed operation in this conversation.
|
|
46
|
+
|
|
47
|
+
If the `context` process itself cannot start because the command is missing
|
|
48
|
+
(`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
|
|
49
|
+
command, such as `command not found: context` or `context: command not found`),
|
|
50
|
+
explain that the global CLI is not installed and ask the user to install or
|
|
51
|
+
authorize installation with:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g @c4a/context-cli@latest
|
|
55
|
+
context plugin install
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Stop after giving that recovery. Do not run an installation preflight, install
|
|
59
|
+
automatically, or mistake a normal Context `not found` diagnostic for a missing
|
|
60
|
+
executable.
|
|
61
|
+
|
|
62
|
+
Execute only `next_action.command` returned by `context entry`:
|
|
63
|
+
|
|
64
|
+
- `initialize-workspace` writes a new workspace. Execute it immediately only
|
|
65
|
+
when the user explicitly requested initialization through this entry;
|
|
66
|
+
otherwise explain the target root and ask for confirmation. Preserve the
|
|
67
|
+
`init-target-nonempty` confirmation.
|
|
68
|
+
- `enter-workspace` and `evaluate-workflow` are read-only and need no additional
|
|
69
|
+
confirmation.
|
|
70
|
+
- After initialization, execute the exact setup command returned by `context
|
|
71
|
+
init`, enter the project root, read the generated `AGENTS.md`, and run this
|
|
72
|
+
entry again.
|
|
73
|
+
|
|
74
|
+
### Conversation modes
|
|
75
|
+
|
|
76
|
+
Enable debugging only when the user explicitly requests it. Run `context debug
|
|
77
|
+
enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
|
|
78
|
+
does not grant workflow authority or provide source evidence.
|
|
79
|
+
|
|
80
|
+
For explicitly authorized fully managed operation, use:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
context run --managed --until blocked-or-complete --format json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Use `--managed` for every resumed workflow evaluation in the same active
|
|
87
|
+
request. Never persist or reuse that authority in another conversation, and
|
|
88
|
+
stop using it when the conversation ends or the user revokes it. Pass any
|
|
89
|
+
additional `--authority` only when the user explicitly grants that authority in
|
|
90
|
+
this conversation.
|
|
91
|
+
|
|
92
|
+
The managed loop executes only Route-selected work and returns the current
|
|
93
|
+
`workflow.current` whenever Agent reading, project configuration, a human Gate,
|
|
94
|
+
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
95
|
+
that returned Route; never reconstruct a command from an earlier step.
|
|
96
|
+
|
|
97
|
+
### Follow the current Route
|
|
98
|
+
|
|
99
|
+
Treat `workflow.current` as the current-step authority:
|
|
100
|
+
|
|
101
|
+
1. Read every `resources.required` item whose `read_state` is `read-required`.
|
|
102
|
+
Read a returned `path` completely, or execute a returned resource `command`
|
|
103
|
+
and read its complete output file. Materializing a resource is not reading
|
|
104
|
+
it. Keep the merged receipts only in this conversation and submit them with
|
|
105
|
+
the exact returned `context status --resource-receipts @<file>` command. Use
|
|
106
|
+
`after_read_receipts` only after the full resource has been read. The exact
|
|
107
|
+
`resources.after_read.command` already returns the re-evaluated
|
|
108
|
+
`workflow.current`; continue from it without an additional status call.
|
|
109
|
+
2. At a Gate, keep inspection and resolution phase-local. Read an
|
|
110
|
+
`inspection_action` resource only while inspecting the decision, and read a
|
|
111
|
+
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
112
|
+
replaces ordinary required resources.
|
|
113
|
+
3. Execute only `commands` returned by the Route, preserving revision and
|
|
114
|
+
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
115
|
+
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
116
|
+
as an exact top-level host action with the required host access,
|
|
117
|
+
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
118
|
+
for its audit and approval contract; never invent a payload, destination, or
|
|
119
|
+
substitute command.
|
|
120
|
+
4. If `configuration` is present, edit only the named project file and use the
|
|
121
|
+
selected resources as its contract.
|
|
122
|
+
5. After every action or configuration change, run status again. The managed
|
|
123
|
+
loop performs this re-evaluation internally. A phase-local `next_action` can
|
|
124
|
+
continue that operation but never replaces the workspace Route.
|
|
125
|
+
|
|
126
|
+
Explain, ask, confirm, and summarize in the user's current conversation
|
|
127
|
+
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
128
|
+
`source_ref` values, and copied CLI tokens unchanged.
|
|
129
|
+
|
|
130
|
+
Do not infer repo sources, extraction scope, review decisions, or package output
|
|
131
|
+
choices from surrounding files. Do not call source-repo operations such as
|
|
132
|
+
clone, checkout, reset, fetch, install, build, or test without explicit user
|
|
133
|
+
approval.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "
|
|
2
|
+
"name": "c4a",
|
|
3
3
|
"displayName": "C4A Context",
|
|
4
|
-
"version": "0.6.
|
|
5
|
-
"description": "
|
|
4
|
+
"version": "0.6.10",
|
|
5
|
+
"description": "Start or continue a project-local knowledge workspace through one graph-routed entry.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Context4AI",
|
|
8
8
|
"email": "support@context4ai.dev"
|
package/plugins/cursor/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Edit `packages/context-cli/plugin/` and rerun the build instead.
|
|
|
7
7
|
Install shape:
|
|
8
8
|
|
|
9
9
|
- Marketplace/GitHub plugin shape: this directory is a plugin root with `.cursor-plugin/plugin.json` and `commands/`.
|
|
10
|
-
- User entries are under `commands/`; Cursor command files are prefixed as `
|
|
11
|
-
- Local plugin fallback: symlink or copy this directory to `~/.cursor/plugins/local/
|
|
10
|
+
- User entries are under `commands/`; Cursor command files are prefixed as `c4a-*` to avoid global slash-command collisions.
|
|
11
|
+
- Local plugin fallback: symlink or copy this directory to `~/.cursor/plugins/local/c4a/` only when Marketplace import is unavailable.
|
|
12
12
|
|
|
13
13
|
Cursor Marketplace installs this plugin root directly.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Build or continue structured, traceable Agent knowledge from documents and code."
|
|
3
|
+
argument-hint: "[project-dir or user intent]"
|
|
4
|
+
allowed-tools: Bash(context:*), Bash(bun:*), Bash(cd *)
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Start or continue a C4A Context knowledge workspace.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
Context is a knowledge management tool built for Agent knowledge workflows. It
|
|
14
|
+
compiles Feishu/Lark documents, local Markdown, repository code, and manually
|
|
15
|
+
curated business material into structured, traceable knowledge, then produces
|
|
16
|
+
knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
|
|
17
|
+
workflow guidance, knowledge-building procedures, and code-indexing capabilities
|
|
18
|
+
needed to produce that knowledge; follow its returned commands and resources
|
|
19
|
+
for the next action.
|
|
20
|
+
|
|
21
|
+
Use this as the single conversational entry for Context. Let the CLI locate an
|
|
22
|
+
existing workspace, relocate into it, initialize a requested workspace, or
|
|
23
|
+
evaluate its current workflow. Do not infer the workspace state yourself.
|
|
24
|
+
|
|
25
|
+
### Enter the workspace
|
|
26
|
+
|
|
27
|
+
Run:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
context entry [project-dir] --language <language> --format json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
34
|
+
for a Chinese conversation and `en` for an English conversation. Pass
|
|
35
|
+
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
36
|
+
requested that initialization choice. Pass `--managed` only after the user
|
|
37
|
+
explicitly authorizes fully managed operation in this conversation.
|
|
38
|
+
|
|
39
|
+
If the `context` process itself cannot start because the command is missing
|
|
40
|
+
(`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
|
|
41
|
+
command, such as `command not found: context` or `context: command not found`),
|
|
42
|
+
explain that the global CLI is not installed and ask the user to install or
|
|
43
|
+
authorize installation with:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @c4a/context-cli@latest
|
|
47
|
+
context plugin install
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Stop after giving that recovery. Do not run an installation preflight, install
|
|
51
|
+
automatically, or mistake a normal Context `not found` diagnostic for a missing
|
|
52
|
+
executable.
|
|
53
|
+
|
|
54
|
+
Execute only `next_action.command` returned by `context entry`:
|
|
55
|
+
|
|
56
|
+
- `initialize-workspace` writes a new workspace. Execute it immediately only
|
|
57
|
+
when the user explicitly requested initialization through this entry;
|
|
58
|
+
otherwise explain the target root and ask for confirmation. Preserve the
|
|
59
|
+
`init-target-nonempty` confirmation.
|
|
60
|
+
- `enter-workspace` and `evaluate-workflow` are read-only and need no additional
|
|
61
|
+
confirmation.
|
|
62
|
+
- After initialization, execute the exact setup command returned by `context
|
|
63
|
+
init`, enter the project root, read the generated `AGENTS.md`, and run this
|
|
64
|
+
entry again.
|
|
65
|
+
|
|
66
|
+
### Conversation modes
|
|
67
|
+
|
|
68
|
+
Enable debugging only when the user explicitly requests it. Run `context debug
|
|
69
|
+
enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
|
|
70
|
+
does not grant workflow authority or provide source evidence.
|
|
71
|
+
|
|
72
|
+
For explicitly authorized fully managed operation, use:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
context run --managed --until blocked-or-complete --format json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Use `--managed` for every resumed workflow evaluation in the same active
|
|
79
|
+
request. Never persist or reuse that authority in another conversation, and
|
|
80
|
+
stop using it when the conversation ends or the user revokes it. Pass any
|
|
81
|
+
additional `--authority` only when the user explicitly grants that authority in
|
|
82
|
+
this conversation.
|
|
83
|
+
|
|
84
|
+
The managed loop executes only Route-selected work and returns the current
|
|
85
|
+
`workflow.current` whenever Agent reading, project configuration, a human Gate,
|
|
86
|
+
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
87
|
+
that returned Route; never reconstruct a command from an earlier step.
|
|
88
|
+
|
|
89
|
+
### Follow the current Route
|
|
90
|
+
|
|
91
|
+
Treat `workflow.current` as the current-step authority:
|
|
92
|
+
|
|
93
|
+
1. Read every `resources.required` item whose `read_state` is `read-required`.
|
|
94
|
+
Read a returned `path` completely, or execute a returned resource `command`
|
|
95
|
+
and read its complete output file. Materializing a resource is not reading
|
|
96
|
+
it. Keep the merged receipts only in this conversation and submit them with
|
|
97
|
+
the exact returned `context status --resource-receipts @<file>` command. Use
|
|
98
|
+
`after_read_receipts` only after the full resource has been read. The exact
|
|
99
|
+
`resources.after_read.command` already returns the re-evaluated
|
|
100
|
+
`workflow.current`; continue from it without an additional status call.
|
|
101
|
+
2. At a Gate, keep inspection and resolution phase-local. Read an
|
|
102
|
+
`inspection_action` resource only while inspecting the decision, and read a
|
|
103
|
+
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
104
|
+
replaces ordinary required resources.
|
|
105
|
+
3. Execute only `commands` returned by the Route, preserving revision and
|
|
106
|
+
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
107
|
+
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
108
|
+
as an exact top-level host action with the required host access,
|
|
109
|
+
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
110
|
+
for its audit and approval contract; never invent a payload, destination, or
|
|
111
|
+
substitute command.
|
|
112
|
+
4. If `configuration` is present, edit only the named project file and use the
|
|
113
|
+
selected resources as its contract.
|
|
114
|
+
5. After every action or configuration change, run status again. The managed
|
|
115
|
+
loop performs this re-evaluation internally. A phase-local `next_action` can
|
|
116
|
+
continue that operation but never replaces the workspace Route.
|
|
117
|
+
|
|
118
|
+
Explain, ask, confirm, and summarize in the user's current conversation
|
|
119
|
+
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
120
|
+
`source_ref` values, and copied CLI tokens unchanged.
|
|
121
|
+
|
|
122
|
+
Do not infer repo sources, extraction scope, review decisions, or package output
|
|
123
|
+
choices from surrounding files. Do not call source-repo operations such as
|
|
124
|
+
clone, checkout, reset, fetch, install, build, or test without explicit user
|
|
125
|
+
approval.
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: c4a-context
|
|
3
|
+
description: >
|
|
4
|
+
Build or continue structured, traceable Agent knowledge from documents and code. Use the local `context` CLI for workspace writes.
|
|
5
|
+
tools:
|
|
6
|
+
- Bash
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Context
|
|
10
|
+
|
|
11
|
+
Public Context entry for agents that expose skills instead of slash commands.
|
|
12
|
+
|
|
13
|
+
- Public entry: `c4a-context`
|
|
14
|
+
- Host command names are installation-specific; use the command or skill surfaced by the current host instead of deriving a filesystem path from an example name.
|
|
15
|
+
- CLI primitive prefix: `context ...`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Workflow
|
|
20
|
+
|
|
21
|
+
Context is a knowledge management tool built for Agent knowledge workflows. It
|
|
22
|
+
compiles Feishu/Lark documents, local Markdown, repository code, and manually
|
|
23
|
+
curated business material into structured, traceable knowledge, then produces
|
|
24
|
+
knowledge packages, LLM-ready documents, or Agent Skills. The CLI packages all
|
|
25
|
+
workflow guidance, knowledge-building procedures, and code-indexing capabilities
|
|
26
|
+
needed to produce that knowledge; follow its returned commands and resources
|
|
27
|
+
for the next action.
|
|
28
|
+
|
|
29
|
+
Use this as the single conversational entry for Context. Let the CLI locate an
|
|
30
|
+
existing workspace, relocate into it, initialize a requested workspace, or
|
|
31
|
+
evaluate its current workflow. Do not infer the workspace state yourself.
|
|
32
|
+
|
|
33
|
+
### Enter the workspace
|
|
34
|
+
|
|
35
|
+
Run:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
context entry [project-dir] --language <language> --format json
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Use the user's explicit language choice when present; otherwise pass `zh-CN`
|
|
42
|
+
for a Chinese conversation and `en` for an English conversation. Pass
|
|
43
|
+
`project-dir`, `--name`, `--dev`, or `--debug` only when the user explicitly
|
|
44
|
+
requested that initialization choice. Pass `--managed` only after the user
|
|
45
|
+
explicitly authorizes fully managed operation in this conversation.
|
|
46
|
+
|
|
47
|
+
If the `context` process itself cannot start because the command is missing
|
|
48
|
+
(`ENOENT`, or shell exit 127 explicitly identifying `context` as the missing
|
|
49
|
+
command, such as `command not found: context` or `context: command not found`),
|
|
50
|
+
explain that the global CLI is not installed and ask the user to install or
|
|
51
|
+
authorize installation with:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm install -g @c4a/context-cli@latest
|
|
55
|
+
context plugin install
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Stop after giving that recovery. Do not run an installation preflight, install
|
|
59
|
+
automatically, or mistake a normal Context `not found` diagnostic for a missing
|
|
60
|
+
executable.
|
|
61
|
+
|
|
62
|
+
Execute only `next_action.command` returned by `context entry`:
|
|
63
|
+
|
|
64
|
+
- `initialize-workspace` writes a new workspace. Execute it immediately only
|
|
65
|
+
when the user explicitly requested initialization through this entry;
|
|
66
|
+
otherwise explain the target root and ask for confirmation. Preserve the
|
|
67
|
+
`init-target-nonempty` confirmation.
|
|
68
|
+
- `enter-workspace` and `evaluate-workflow` are read-only and need no additional
|
|
69
|
+
confirmation.
|
|
70
|
+
- After initialization, execute the exact setup command returned by `context
|
|
71
|
+
init`, enter the project root, read the generated `AGENTS.md`, and run this
|
|
72
|
+
entry again.
|
|
73
|
+
|
|
74
|
+
### Conversation modes
|
|
75
|
+
|
|
76
|
+
Enable debugging only when the user explicitly requests it. Run `context debug
|
|
77
|
+
enable` first; debugging records traces below `.tmp/context-runtime/debug/` but
|
|
78
|
+
does not grant workflow authority or provide source evidence.
|
|
79
|
+
|
|
80
|
+
For explicitly authorized fully managed operation, use:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
context run --managed --until blocked-or-complete --format json
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Use `--managed` for every resumed workflow evaluation in the same active
|
|
87
|
+
request. Never persist or reuse that authority in another conversation, and
|
|
88
|
+
stop using it when the conversation ends or the user revokes it. Pass any
|
|
89
|
+
additional `--authority` only when the user explicitly grants that authority in
|
|
90
|
+
this conversation.
|
|
91
|
+
|
|
92
|
+
The managed loop executes only Route-selected work and returns the current
|
|
93
|
+
`workflow.current` whenever Agent reading, project configuration, a human Gate,
|
|
94
|
+
host execution, diagnostics, or a non-unique plan needs attention. Resume from
|
|
95
|
+
that returned Route; never reconstruct a command from an earlier step.
|
|
96
|
+
|
|
97
|
+
### Follow the current Route
|
|
98
|
+
|
|
99
|
+
Treat `workflow.current` as the current-step authority:
|
|
100
|
+
|
|
101
|
+
1. Read every `resources.required` item whose `read_state` is `read-required`.
|
|
102
|
+
Read a returned `path` completely, or execute a returned resource `command`
|
|
103
|
+
and read its complete output file. Materializing a resource is not reading
|
|
104
|
+
it. Keep the merged receipts only in this conversation and submit them with
|
|
105
|
+
the exact returned `context status --resource-receipts @<file>` command. Use
|
|
106
|
+
`after_read_receipts` only after the full resource has been read. The exact
|
|
107
|
+
`resources.after_read.command` already returns the re-evaluated
|
|
108
|
+
`workflow.current`; continue from it without an additional status call.
|
|
109
|
+
2. At a Gate, keep inspection and resolution phase-local. Read an
|
|
110
|
+
`inspection_action` resource only while inspecting the decision, and read a
|
|
111
|
+
`resolution_action` resource only after the user confirms the Gate. Neither
|
|
112
|
+
replaces ordinary required resources.
|
|
113
|
+
3. Execute only `commands` returned by the Route, preserving revision and
|
|
114
|
+
authority flags exactly. A command marked `after-human-confirmation` waits
|
|
115
|
+
for the current Gate decision. Run a command whose `execution.target` is `agent-host`
|
|
116
|
+
as an exact top-level host action with the required host access,
|
|
117
|
+
not inside a restricted child sandbox. Follow the Route-selected procedure
|
|
118
|
+
for its audit and approval contract; never invent a payload, destination, or
|
|
119
|
+
substitute command.
|
|
120
|
+
4. If `configuration` is present, edit only the named project file and use the
|
|
121
|
+
selected resources as its contract.
|
|
122
|
+
5. After every action or configuration change, run status again. The managed
|
|
123
|
+
loop performs this re-evaluation internally. A phase-local `next_action` can
|
|
124
|
+
continue that operation but never replaces the workspace Route.
|
|
125
|
+
|
|
126
|
+
Explain, ask, confirm, and summarize in the user's current conversation
|
|
127
|
+
language. Keep commands, flags, paths, ids, status values, JSONL keys,
|
|
128
|
+
`source_ref` values, and copied CLI tokens unchanged.
|
|
129
|
+
|
|
130
|
+
Do not infer repo sources, extraction scope, review decisions, or package output
|
|
131
|
+
choices from surrounding files. Do not call source-repo operations such as
|
|
132
|
+
clone, checkout, reset, fetch, install, build, or test without explicit user
|
|
133
|
+
approval.
|
|
@@ -2,7 +2,7 @@ schema: agent-graph.graph.v1
|
|
|
2
2
|
id: workspace
|
|
3
3
|
description: Fact-grounded lifecycle for a Context knowledge workspace.
|
|
4
4
|
entrypoints:
|
|
5
|
-
|
|
5
|
+
context: repair-project-entry
|
|
6
6
|
nodes:
|
|
7
7
|
- id: repair-project-entry
|
|
8
8
|
kind: action
|
|
@@ -92,6 +92,12 @@ nodes:
|
|
|
92
92
|
kind: gate
|
|
93
93
|
reasonCode: route.structure.confirmation-required
|
|
94
94
|
inspectionAction: actions/inspect-structure.yaml
|
|
95
|
+
resolutionAction: actions/apply-structure-confirmation.yaml
|
|
96
|
+
delegated:
|
|
97
|
+
inspection: skip
|
|
98
|
+
resources:
|
|
99
|
+
required: []
|
|
100
|
+
recommended: []
|
|
95
101
|
gate:
|
|
96
102
|
id: structure-confirmation
|
|
97
103
|
prompt: Confirm the proposed knowledge structure before candidates are compiled.
|
|
@@ -166,6 +172,12 @@ nodes:
|
|
|
166
172
|
kind: gate
|
|
167
173
|
reasonCode: route.review.decision-required
|
|
168
174
|
inspectionAction: actions/inspect-review.yaml
|
|
175
|
+
delegated:
|
|
176
|
+
inspection: skip
|
|
177
|
+
resolutionAction: actions/apply-managed-review.yaml
|
|
178
|
+
resources:
|
|
179
|
+
required: []
|
|
180
|
+
recommended: []
|
|
169
181
|
gate:
|
|
170
182
|
id: knowledge-review
|
|
171
183
|
prompt: Review the complete current document candidate batch before it enters approved knowledge.
|
|
@@ -210,6 +222,7 @@ nodes:
|
|
|
210
222
|
- resources/procedures/source-boundary.md
|
|
211
223
|
- resources/dialogue/human-gates.md
|
|
212
224
|
- resources/dialogue/source-boundary.md
|
|
225
|
+
- resources/dialogue/workflow-mode-after-creation.md
|
|
213
226
|
- resources/views/source-current.yaml
|
|
214
227
|
recommended:
|
|
215
228
|
- resources/procedures/source-capture-detailed.md
|
|
@@ -290,6 +303,14 @@ nodes:
|
|
|
290
303
|
kind: gate
|
|
291
304
|
reasonCode: route.extract.scope-required
|
|
292
305
|
inspectionAction: actions/inspect-code-extraction.yaml
|
|
306
|
+
delegated:
|
|
307
|
+
resources:
|
|
308
|
+
required:
|
|
309
|
+
- resources/procedures/code-extraction.md
|
|
310
|
+
- resources/dialogue/code-extraction.md
|
|
311
|
+
- resources/views/source-current.yaml
|
|
312
|
+
recommended:
|
|
313
|
+
- resources/procedures/source-capture-detailed.md
|
|
293
314
|
gate:
|
|
294
315
|
id: extraction-scope
|
|
295
316
|
prompt: Confirm which registered code modules and symbol boundaries should enter code knowledge.
|
|
@@ -303,6 +324,7 @@ nodes:
|
|
|
303
324
|
- resources/procedures/code-extraction.md
|
|
304
325
|
- resources/dialogue/human-gates.md
|
|
305
326
|
- resources/dialogue/code-extraction.md
|
|
327
|
+
- resources/dialogue/workflow-mode-after-capture.md
|
|
306
328
|
- resources/views/source-current.yaml
|
|
307
329
|
recommended:
|
|
308
330
|
- resources/procedures/source-capture-detailed.md
|
|
@@ -337,6 +359,12 @@ nodes:
|
|
|
337
359
|
kind: gate
|
|
338
360
|
reasonCode: route.document.classification-required
|
|
339
361
|
inspectionAction: actions/inspect-document-classification.yaml
|
|
362
|
+
delegated:
|
|
363
|
+
resources:
|
|
364
|
+
required:
|
|
365
|
+
- resources/procedures/document-classification.md
|
|
366
|
+
- resources/dialogue/document-classification.md
|
|
367
|
+
- resources/views/source-current.yaml
|
|
340
368
|
gate:
|
|
341
369
|
id: document-classification
|
|
342
370
|
prompt: Confirm the evidence-backed knowledge collection for the next captured document.
|
|
@@ -350,6 +378,7 @@ nodes:
|
|
|
350
378
|
- resources/procedures/document-classification.md
|
|
351
379
|
- resources/dialogue/human-gates.md
|
|
352
380
|
- resources/dialogue/document-classification.md
|
|
381
|
+
- resources/dialogue/workflow-mode-after-capture.md
|
|
353
382
|
- resources/views/source-current.yaml
|
|
354
383
|
|
|
355
384
|
- id: configure-prose-lifecycle
|
|
@@ -387,6 +416,12 @@ nodes:
|
|
|
387
416
|
kind: gate
|
|
388
417
|
reasonCode: route.review.decision-required
|
|
389
418
|
inspectionAction: actions/inspect-review.yaml
|
|
419
|
+
delegated:
|
|
420
|
+
inspection: skip
|
|
421
|
+
resolutionAction: actions/apply-managed-review.yaml
|
|
422
|
+
resources:
|
|
423
|
+
required: []
|
|
424
|
+
recommended: []
|
|
390
425
|
gate:
|
|
391
426
|
id: knowledge-review
|
|
392
427
|
prompt: Review the complete current candidate batch before it enters approved knowledge.
|
|
@@ -484,6 +519,10 @@ nodes:
|
|
|
484
519
|
kind: gate
|
|
485
520
|
reasonCode: route.package.template-review-required
|
|
486
521
|
resolutionAction: actions/accept-package-templates.yaml
|
|
522
|
+
delegated:
|
|
523
|
+
resources:
|
|
524
|
+
required: []
|
|
525
|
+
recommended: []
|
|
487
526
|
gate:
|
|
488
527
|
id: package-template-review
|
|
489
528
|
prompt: Replace or edit the declared package templates, or explicitly accept the unchanged generic defaults.
|