@aiwg/cli 2026.7.19 → 2026.7.20
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 +397 -385
- package/dist/src/artifacts/cli.js +59 -5
- package/dist/src/artifacts/discover-facets.js +15 -0
- package/dist/src/artifacts/discovery-eval.js +290 -0
- package/dist/src/artifacts/fortemi-core-query-adapter.js +1 -1
- package/dist/src/artifacts/fortemi-shard-export.js +1 -1
- package/dist/src/artifacts/query-engine.js +10 -6
- package/dist/src/cli/handlers/help.js +2 -1
- package/dist/src/cli/handlers/index.js +3 -1
- package/dist/src/cli/handlers/resource-versions.js +247 -0
- package/dist/src/cli/handlers/subcommands.js +55 -3
- package/dist/src/cli/handlers/use.js +15 -3
- package/dist/src/cli/handlers/utilities.js +27 -26
- package/dist/src/config/cli.js +13 -9
- package/dist/src/config/project-artifacts-runtime.mjs +68 -0
- package/dist/src/config/project-artifacts.js +1 -68
- package/dist/src/extensions/commands/definitions.js +36 -2
- package/dist/src/extensions/project-local-discovery.js +86 -2
- package/dist/src/extensions/project-local-remove.js +52 -56
- package/dist/src/extensions/shadow-resolver.js +3 -1
- package/dist/src/plugins/standalone-packager.js +143 -0
- package/dist/src/resources/cache-cleanup.js +67 -0
- package/dist/src/resources/doctor.js +107 -0
- package/dist/src/resources/lockfile.js +125 -0
- package/dist/src/resources/resolver.js +133 -0
- package/dist/src/resources/web-release.d.ts +8 -0
- package/dist/src/resources/web-release.js +159 -1
- package/dist/src/smiths/context-pipeline/aiwg-md.js +5 -1
- package/dist/src/smiths/context-pipeline/claude-hook.js +21 -1
- package/dist/src/smiths/context-pipeline/finalization.js +5 -3
- package/dist/src/smiths/context-pipeline/generator.js +4 -1
- package/dist/src/smiths/context-pipeline/parallelism-section.js +34 -1
- package/dist/src/smiths/context-pipeline/workspace-context.js +15 -3
- package/dist/src/smiths/mcpsmith/example.js +3 -1
- package/dist/src/smiths/mcpsmith/generator.js +3 -1
- package/dist/src/smiths/toolsmith/runtime-discovery.mjs +2 -1
- package/dist/src/storage/cli.js +3 -2
- package/dist/src/storage/subsystem-cli.js +7 -2
- package/dist/src/update/notifier.mjs +1 -1
- package/dist/src/update/service.mjs +123 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
|
|
5
5
|
# @aiwg/cli
|
|
6
6
|
|
|
7
|
-
**The
|
|
7
|
+
**The agent-optimized execution layer for AIWG**
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
AIWG skills and agents use this CLI to perform common operations with
|
|
10
|
+
predictable, structured calls instead of spending context on shell discovery,
|
|
11
|
+
filesystem traversal, command reconstruction, and repeated tool output.
|
|
11
12
|
|
|
12
13
|
```bash
|
|
13
14
|
npm install --global @aiwg/cli
|
|
14
15
|
|
|
15
|
-
aiwg
|
|
16
|
-
aiwg show skill architecture-evolution
|
|
16
|
+
aiwg doctor
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
[](https://www.npmjs.com/package/@aiwg/cli)
|
|
@@ -24,7 +24,7 @@ aiwg show skill architecture-evolution
|
|
|
24
24
|
[](https://www.typescriptlang.org)
|
|
25
25
|
[](https://releases.aiwg.io/)
|
|
26
26
|
|
|
27
|
-
[**Quick Start**](#quick-start) · [**
|
|
27
|
+
[**Quick Start**](#quick-start) · [**Agentic Model**](#the-agentic-use-model) · [**Token Economy**](#why-this-reduces-agent-token-use) · [**How It Works**](#how-it-works) · [**Security**](#security-model) · [**Troubleshooting**](#installation-troubleshooting)
|
|
28
28
|
|
|
29
29
|
</div>
|
|
30
30
|
|
|
@@ -32,32 +32,167 @@ aiwg show skill architecture-evolution
|
|
|
32
32
|
|
|
33
33
|
## What This Package Is
|
|
34
34
|
|
|
35
|
-
`@aiwg/cli` is the executable
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
`@aiwg/cli` is the small executable runtime beneath AIWG's skills, agents,
|
|
36
|
+
rules, and workflows. It is primarily an **agent tool**, even though an
|
|
37
|
+
operator can run it from a terminal.
|
|
38
|
+
|
|
39
|
+
The important product surface is not a long list of commands. The important
|
|
40
|
+
surface is the AIWG capability graph:
|
|
41
|
+
|
|
42
|
+
- skills carry task-specific instructions, gates, preservation logic, and
|
|
43
|
+
recovery guidance;
|
|
44
|
+
- agents supply roles, judgment, and orchestration;
|
|
45
|
+
- rules supply policy that remains in force across tasks;
|
|
46
|
+
- the CLI supplies deterministic lookup, validation, deployment, health,
|
|
47
|
+
indexing, configuration, and execution primitives;
|
|
48
|
+
- signed web releases let the runtime reach the capability graph without
|
|
49
|
+
bundling the complete corpus into this npm package.
|
|
50
|
+
|
|
51
|
+
An agent should normally enter through a skill or an AIWG agent and let that
|
|
52
|
+
resource call `aiwg` when an imperative operation is needed. This keeps the
|
|
53
|
+
reasoning layer focused on the user's objective while the CLI handles the
|
|
54
|
+
mechanical work.
|
|
55
|
+
|
|
56
|
+
The package includes the `aiwg` executable, its routing and validation runtime,
|
|
57
|
+
the Fortemi Core query client, signed web-release verification, verified
|
|
58
|
+
caching, and provider metadata needed by agentic integrations. It intentionally
|
|
59
|
+
does not carry the complete `agentic/code` source tree, project artifacts, or
|
|
60
|
+
Cockpit.
|
|
61
|
+
|
|
62
|
+
In practice, this means an agent can:
|
|
63
|
+
|
|
64
|
+
1. identify the narrow AIWG capability that matches the request;
|
|
65
|
+
2. retrieve only that skill or agent definition;
|
|
66
|
+
3. follow its gates and call the CLI steps it specifies;
|
|
67
|
+
4. consume stable structured output instead of parsing exploratory shell
|
|
68
|
+
transcripts;
|
|
69
|
+
5. leave the project with fewer temporary files, copied resources, and
|
|
70
|
+
provider-specific assumptions.
|
|
39
71
|
|
|
40
|
-
|
|
72
|
+
Signed resources are available from
|
|
73
|
+
[`releases.aiwg.io`](https://releases.aiwg.io/). A clean installation can use
|
|
74
|
+
the published capability graph without first copying the full framework corpus
|
|
75
|
+
into every project.
|
|
41
76
|
|
|
42
|
-
|
|
43
|
-
- the supported JavaScript API used by the executable;
|
|
44
|
-
- signed web-release verification and cache logic;
|
|
45
|
-
- the Fortemi Core query runtime;
|
|
46
|
-
- provider capability and model metadata required by the CLI;
|
|
47
|
-
- command routing, configuration, and runtime support code.
|
|
77
|
+
## The Agentic Use Model
|
|
48
78
|
|
|
49
|
-
|
|
79
|
+
AIWG follows a skills-first hierarchy:
|
|
50
80
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
81
|
+
```text
|
|
82
|
+
user intent
|
|
83
|
+
|
|
|
84
|
+
v
|
|
85
|
+
AIWG skill or agent
|
|
86
|
+
| task knowledge, policy, gates, recovery
|
|
87
|
+
v
|
|
88
|
+
small CLI operation
|
|
89
|
+
| deterministic lookup, validation, mutation, or status
|
|
90
|
+
v
|
|
91
|
+
structured result
|
|
92
|
+
|
|
|
93
|
+
v
|
|
94
|
+
agent judgment and user-facing outcome
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The preferred routing order is:
|
|
98
|
+
|
|
99
|
+
1. **Use an already available AIWG skill or agent.** This is the cheapest and
|
|
100
|
+
best-primed route. The resource already knows the relevant workflow and
|
|
101
|
+
calls the CLI only where needed.
|
|
102
|
+
2. **Discover the right AIWG capability.** If the resource is not already in
|
|
103
|
+
context, the agent performs an indexed lookup and retrieves the single best
|
|
104
|
+
match. It does not recursively browse provider directories or read the
|
|
105
|
+
whole corpus.
|
|
106
|
+
3. **Use a raw CLI command only for a basic operator operation, for discovery
|
|
107
|
+
and status, or as a step inside a skill.** Raw action commands lack the
|
|
108
|
+
task-specific priming carried by skills.
|
|
109
|
+
|
|
110
|
+
This distinction matters. Running an action command directly may perform the
|
|
111
|
+
mechanical operation, but the paired skill also explains preconditions,
|
|
112
|
+
preservation requirements, review gates, failure recovery, and what evidence
|
|
113
|
+
must be retained. The skill is the workflow; the CLI is its execution
|
|
114
|
+
substrate.
|
|
115
|
+
|
|
116
|
+
Examples of the intended pairing:
|
|
117
|
+
|
|
118
|
+
| Intent | Preferred agentic entry | CLI role |
|
|
119
|
+
|---|---|---|
|
|
120
|
+
| Deploy an AIWG framework | `use` skill | Calls `aiwg use` with validated provider and project context |
|
|
121
|
+
| Diagnose an installation | `aiwg-doctor` skill | Calls `aiwg doctor`, interprets failures, and guides remediation |
|
|
122
|
+
| Refresh an installation | `aiwg-refresh` skill | Previews and invokes refresh safely |
|
|
123
|
+
| Regenerate provider context | `aiwg-regenerate` skill family | Preserves operator content while invoking regeneration |
|
|
124
|
+
| Find a specialized workflow | AIWG capability discovery | Queries the precomputed index and retrieves one matching resource |
|
|
125
|
+
| Run an executable skill | The selected skill | Dispatches its declared script through the runtime registry |
|
|
126
|
+
|
|
127
|
+
Operators can still use `aiwg use` and `aiwg doctor` directly for basic setup
|
|
128
|
+
and diagnostics. Agentic systems should prefer the paired skills because they
|
|
129
|
+
carry the context that a bare command cannot.
|
|
130
|
+
|
|
131
|
+
## Why This Reduces Agent Token Use
|
|
132
|
+
|
|
133
|
+
General-purpose shell access is flexible, but flexibility is expensive for an
|
|
134
|
+
agent. Without a purpose-built interface, a session often has to:
|
|
135
|
+
|
|
136
|
+
- determine where a package was installed;
|
|
137
|
+
- enumerate directories and guess which provider copy is authoritative;
|
|
138
|
+
- search hundreds or thousands of files;
|
|
139
|
+
- read several near-matching documents before finding the right one;
|
|
140
|
+
- reconstruct command syntax from help text;
|
|
141
|
+
- parse prose-oriented terminal output;
|
|
142
|
+
- rediscover safety checks and recovery steps;
|
|
143
|
+
- repeat the same investigation in every project or new session.
|
|
144
|
+
|
|
145
|
+
Each step adds tool calls and returns text that competes with the actual task
|
|
146
|
+
for context. Recursive listings and broad text searches are especially costly:
|
|
147
|
+
they describe the storage layout instead of answering the user's intent.
|
|
148
|
+
|
|
149
|
+
AIWG changes that interaction:
|
|
150
|
+
|
|
151
|
+
```text
|
|
152
|
+
traditional shell-oriented path
|
|
153
|
+
|
|
154
|
+
locate install
|
|
155
|
+
-> list directories
|
|
156
|
+
-> search filenames
|
|
157
|
+
-> grep many documents
|
|
158
|
+
-> read several candidates
|
|
159
|
+
-> infer the workflow
|
|
160
|
+
-> reconstruct command flags
|
|
161
|
+
-> parse terminal output
|
|
162
|
+
|
|
163
|
+
AIWG agentic path
|
|
164
|
+
|
|
165
|
+
intent
|
|
166
|
+
-> indexed capability selection
|
|
167
|
+
-> one relevant skill or agent
|
|
168
|
+
-> bounded CLI operation
|
|
169
|
+
-> structured result
|
|
170
|
+
```
|
|
56
171
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
172
|
+
The token advantage comes from reducing irrelevant material, not from hiding
|
|
173
|
+
important instructions:
|
|
174
|
+
|
|
175
|
+
- **Precomputed indices replace broad filesystem searches.** The agent asks by
|
|
176
|
+
intent and receives ranked capability metadata.
|
|
177
|
+
- **Selective retrieval replaces corpus loading.** Only the chosen skill,
|
|
178
|
+
agent, command, or rule enters context.
|
|
179
|
+
- **Skills preserve procedural knowledge.** Sessions do not have to regenerate
|
|
180
|
+
the same checklist, safety gates, and recovery process from first
|
|
181
|
+
principles.
|
|
182
|
+
- **Structured output reduces parsing.** Machine-facing operations can return
|
|
183
|
+
stable fields rather than decorated terminal prose.
|
|
184
|
+
- **Stable identifiers reduce rediscovery.** Agents can pass capability IDs
|
|
185
|
+
and names between workers without passing installation-specific paths.
|
|
186
|
+
- **Provider abstraction reduces branching.** The runtime handles supported
|
|
187
|
+
provider paths and configuration so each skill does not need a separate
|
|
188
|
+
shell recipe for every agentic platform.
|
|
189
|
+
- **Signed web resources reduce setup narration.** An agent does not need to
|
|
190
|
+
clone or explain a large local corpus before it can retrieve guidance.
|
|
191
|
+
|
|
192
|
+
No fixed token-saving percentage is promised: savings depend on the task,
|
|
193
|
+
provider, and whether the needed skill is already loaded. The design goal is
|
|
194
|
+
measurable in simpler terms—fewer exploratory calls, less unrelated output,
|
|
195
|
+
smaller context payloads, and less duplicated procedural reasoning.
|
|
61
196
|
|
|
62
197
|
## Choose the Right AIWG Distribution
|
|
63
198
|
|
|
@@ -65,14 +200,14 @@ AIWG publishes three packages in exact CalVer lockstep:
|
|
|
65
200
|
|
|
66
201
|
| Package | Best for | Resource model | Install |
|
|
67
202
|
|---|---|---|---|
|
|
68
|
-
| `@aiwg/cli` |
|
|
203
|
+
| `@aiwg/cli` | Agentic runtimes, web-connected sessions, CI, and lightweight global use | Signed release host by default | `npm i -g @aiwg/cli` |
|
|
69
204
|
| `aiwg` | Full local operation, framework deployment, authoring, offline-first projects | Bundled local corpus by default; web mode optional | `npm i -g aiwg` |
|
|
70
205
|
| `@aiwg/cockpit` | Optional local control plane and operator UI | Installed separately or through the full CLI | `npm i -g @aiwg/cockpit` |
|
|
71
206
|
|
|
72
|
-
Choose `@aiwg/cli` when
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
207
|
+
Choose `@aiwg/cli` when AIWG skills and agents need a small, globally available
|
|
208
|
+
execution layer and can obtain resources from the signed web release. Choose
|
|
209
|
+
`aiwg` when local authoring, the full bundled corpus, or completely cold
|
|
210
|
+
offline operation is required.
|
|
76
211
|
|
|
77
212
|
Both CLI packages expose the same `aiwg` executable name. Install one globally
|
|
78
213
|
at a time unless you deliberately manage separate npm prefixes.
|
|
@@ -84,6 +219,7 @@ at a time unless you deliberately manage separate npm prefixes.
|
|
|
84
219
|
```bash
|
|
85
220
|
npm install --global @aiwg/cli
|
|
86
221
|
aiwg --version
|
|
222
|
+
aiwg doctor
|
|
87
223
|
```
|
|
88
224
|
|
|
89
225
|
AIWG uses npm-compatible Calendar Versioning:
|
|
@@ -95,76 +231,23 @@ YYYY.M.PATCH
|
|
|
95
231
|
The lightweight package version always matches the corresponding full `aiwg`
|
|
96
232
|
release exactly.
|
|
97
233
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Discovery searches the precomputed Fortemi Core index published with the signed
|
|
105
|
-
AIWG release. Results may include skills, agents, commands, rules, flows,
|
|
106
|
-
templates, and supporting documentation.
|
|
107
|
-
|
|
108
|
-
Use structured output for scripts or agent tooling:
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
aiwg discover "release publication verification" \
|
|
112
|
-
--format json \
|
|
113
|
-
--pretty
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Limit or filter results:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
aiwg discover "incident response timeline" \
|
|
120
|
-
--type skill,agent \
|
|
121
|
-
--limit 5 \
|
|
122
|
-
--format json
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### Read a resource
|
|
126
|
-
|
|
127
|
-
Take the type and name from discovery, then fetch the full verified body:
|
|
234
|
+
For a basic operator-managed framework deployment, invoke the `use` skill in
|
|
235
|
+
your agentic environment. It validates the target and calls the equivalent
|
|
236
|
+
`aiwg use` operation. If you are intentionally working at a terminal, the
|
|
237
|
+
direct form is:
|
|
128
238
|
|
|
129
239
|
```bash
|
|
130
|
-
aiwg
|
|
240
|
+
aiwg use <framework-or-addon>
|
|
131
241
|
```
|
|
132
242
|
|
|
133
|
-
|
|
243
|
+
Run `aiwg doctor` after installation or deployment. In an agent session,
|
|
244
|
+
prefer the `aiwg-doctor` skill so the result is interpreted and remediated
|
|
245
|
+
rather than merely printed.
|
|
134
246
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
The downloaded body is verified against the signed release manifest before it
|
|
142
|
-
is returned or stored in the cache.
|
|
143
|
-
|
|
144
|
-
### Pin a release for one call
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
aiwg discover "deployment rollback" --aiwg-version 2026.7.19
|
|
148
|
-
aiwg show skill flow-deploy-to-production --aiwg-version 2026.7.19
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
An exact version does not follow later channel updates. This is useful for
|
|
152
|
-
reproducible automation, audits, and long-running agent sessions.
|
|
153
|
-
|
|
154
|
-
### Warm the cache, then work offline
|
|
155
|
-
|
|
156
|
-
```bash
|
|
157
|
-
# Online: verifies and caches signed metadata, index, and the selected body.
|
|
158
|
-
aiwg discover "architecture evolution"
|
|
159
|
-
aiwg show skill architecture-evolution
|
|
160
|
-
|
|
161
|
-
# Offline: performs no network fetch and fails closed if required bytes are absent.
|
|
162
|
-
aiwg discover "architecture evolution" --offline
|
|
163
|
-
aiwg show skill architecture-evolution --offline
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
Offline mode is intentionally strict. It never treats an incomplete or corrupt
|
|
167
|
-
cache as trusted data.
|
|
247
|
+
Agents do not need to memorize the remaining command surface. AIWG discovery
|
|
248
|
+
finds the relevant skill, and the skill supplies the right CLI step. Operators
|
|
249
|
+
who need the complete syntax and examples can use the
|
|
250
|
+
[AIWG CLI reference](https://docs.aiwg.io/pages/cli-reference.html).
|
|
168
251
|
|
|
169
252
|
## How It Works
|
|
170
253
|
|
|
@@ -232,275 +315,185 @@ This is not a hosted command-execution service. Search and resource delivery
|
|
|
232
315
|
move to the web; project mutation and provider deployment remain local
|
|
233
316
|
operations.
|
|
234
317
|
|
|
235
|
-
##
|
|
236
|
-
|
|
237
|
-
### `aiwg discover`
|
|
238
|
-
|
|
239
|
-
Find resources by intent rather than filename:
|
|
240
|
-
|
|
241
|
-
```bash
|
|
242
|
-
aiwg discover "<phrase>" [options]
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
Common options:
|
|
246
|
-
|
|
247
|
-
| Option | Meaning |
|
|
248
|
-
|---|---|
|
|
249
|
-
| `--type <kinds>` | Comma-separated result types such as `skill,agent,command,rule` |
|
|
250
|
-
| `--limit <n>` | Maximum number of results |
|
|
251
|
-
| `--format json\|text` | Machine-readable or human-readable output |
|
|
252
|
-
| `--json` | JSON output shorthand |
|
|
253
|
-
| `--pretty` / `--compact` | JSON presentation |
|
|
254
|
-
| `--resource-source local\|web\|auto` | Override package-aware source selection |
|
|
255
|
-
| `--aiwg-version <selector>` | Signed channel name or exact CalVer |
|
|
256
|
-
| `--offline` | Read only previously verified cache content |
|
|
257
|
-
| `--backend fortemi-core` | Explicitly select the web-compatible query backend |
|
|
258
|
-
|
|
259
|
-
Examples:
|
|
260
|
-
|
|
261
|
-
```bash
|
|
262
|
-
aiwg discover "requirements review"
|
|
263
|
-
aiwg discover "forensics evidence preservation" --type skill,agent
|
|
264
|
-
aiwg discover "marketing campaign intake" --limit 3 --json --pretty
|
|
265
|
-
aiwg discover "release flow" --aiwg-version stable
|
|
266
|
-
aiwg discover "release flow" --aiwg-version 2026.7.19
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### `aiwg show`
|
|
270
|
-
|
|
271
|
-
Stream the full body of a discovered resource:
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
aiwg show <type> <name> [options]
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
Examples:
|
|
278
|
-
|
|
279
|
-
```bash
|
|
280
|
-
aiwg show skill release-publication-verify
|
|
281
|
-
aiwg show agent security-architect
|
|
282
|
-
aiwg show command address-issues
|
|
283
|
-
aiwg show rule delivery-policy
|
|
284
|
-
```
|
|
285
|
-
|
|
286
|
-
When names are ambiguous, use the stable identifier or exact path returned by
|
|
287
|
-
JSON discovery:
|
|
288
|
-
|
|
289
|
-
```bash
|
|
290
|
-
result=$(aiwg discover "deployment" --json --compact)
|
|
291
|
-
echo "$result"
|
|
292
|
-
aiwg show skill flow-deploy-to-production --json
|
|
293
|
-
```
|
|
318
|
+
## How Skills and Agents Use the Runtime
|
|
294
319
|
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
320
|
+
The CLI is deliberately narrow at the point where it meets an agent. A skill
|
|
321
|
+
should ask it to do one bounded thing, verify the result, and return control to
|
|
322
|
+
the reasoning layer.
|
|
298
323
|
|
|
299
|
-
###
|
|
324
|
+
### Capability selection
|
|
300
325
|
|
|
301
|
-
|
|
326
|
+
Most AIWG capabilities are not loaded into every prompt. Loading hundreds of
|
|
327
|
+
skills would consume context before the user's task even began. Instead, AIWG
|
|
328
|
+
keeps a small kernel available and retrieves specialized capabilities on
|
|
329
|
+
demand.
|
|
302
330
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
| `aiwg` | `local` |
|
|
331
|
+
The runtime queries a precomputed Fortemi Core index using the user's intent.
|
|
332
|
+
It returns ranked metadata rather than dumping files. The agent selects the
|
|
333
|
+
best candidate and retrieves that resource alone.
|
|
307
334
|
|
|
308
|
-
|
|
335
|
+
This mechanism is exposed through `discover` and `show`, but those names are
|
|
336
|
+
implementation details for most users. The practical behavior is:
|
|
309
337
|
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
338
|
+
```text
|
|
339
|
+
"prepare a production rollback"
|
|
340
|
+
|
|
|
341
|
+
v
|
|
342
|
+
ranked AIWG capabilities
|
|
343
|
+
|
|
|
344
|
+
v
|
|
345
|
+
one selected deployment skill
|
|
346
|
+
|
|
|
347
|
+
v
|
|
348
|
+
skill-directed checks and execution
|
|
314
349
|
```
|
|
315
350
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
Because `@aiwg/cli` intentionally contains no corpus, forcing `local` requires
|
|
320
|
-
an independently configured local AIWG root. If none exists, use web mode or
|
|
321
|
-
install the full `aiwg` package.
|
|
351
|
+
Stable IDs make the result portable between a conductor and sub-agents. A
|
|
352
|
+
worker receives the capability identity and body it needs, not a transcript of
|
|
353
|
+
the conductor's directory search.
|
|
322
354
|
|
|
323
|
-
###
|
|
355
|
+
### Execution through skills
|
|
324
356
|
|
|
325
|
-
|
|
357
|
+
Skills use CLI operations for mechanics such as:
|
|
326
358
|
|
|
327
|
-
-
|
|
328
|
-
-
|
|
359
|
+
- validating installation and workspace health;
|
|
360
|
+
- deploying a framework or addon to supported providers;
|
|
361
|
+
- resolving project and user configuration;
|
|
362
|
+
- maintaining indexes and normalized metadata;
|
|
363
|
+
- running a script declared by a skill;
|
|
364
|
+
- generating or refreshing provider adapters;
|
|
365
|
+
- moving or validating the configured AIWG data store;
|
|
366
|
+
- producing structured status and evidence;
|
|
367
|
+
- selecting a signed resource version for reproducible work.
|
|
329
368
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
aiwg discover "test strategy" --aiwg-version 2026.7.19
|
|
333
|
-
```
|
|
369
|
+
The skill remains responsible for sequencing and interpretation. For example,
|
|
370
|
+
a deployment skill may:
|
|
334
371
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
372
|
+
1. inspect provider support;
|
|
373
|
+
2. validate the requested framework;
|
|
374
|
+
3. preview changes;
|
|
375
|
+
4. call the deployment primitive;
|
|
376
|
+
5. verify generated files;
|
|
377
|
+
6. explain any provider-specific follow-up.
|
|
338
378
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
aiwg help
|
|
343
|
-
aiwg --version
|
|
344
|
-
aiwg version
|
|
345
|
-
aiwg doctor
|
|
346
|
-
aiwg runtime-info
|
|
347
|
-
```
|
|
379
|
+
A bare deployment command would perform only part of that workflow. Keeping the
|
|
380
|
+
orchestration in the skill makes behavior reviewable and lets AIWG improve the
|
|
381
|
+
workflow without teaching every agent a new shell recipe.
|
|
348
382
|
|
|
349
|
-
|
|
350
|
-
command surface. Commands that require the local framework corpus, templates,
|
|
351
|
-
or deployment source files are not made web-capable merely by installing the
|
|
352
|
-
lightweight package. See [Current Scope](#current-scope-and-limitations).
|
|
383
|
+
### Structured subprocess behavior
|
|
353
384
|
|
|
354
|
-
|
|
385
|
+
Agent integrations should prefer machine-readable output when they need to
|
|
386
|
+
consume results programmatically. Stable fields are cheaper and safer to parse
|
|
387
|
+
than ANSI-decorated tables or prose intended for a person.
|
|
355
388
|
|
|
356
|
-
|
|
389
|
+
Good agent-facing calls have these properties:
|
|
357
390
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
391
|
+
- explicit working directory;
|
|
392
|
+
- bounded timeout or abort signal;
|
|
393
|
+
- nonzero exit treated as a failure;
|
|
394
|
+
- structured output where available;
|
|
395
|
+
- no shell interpolation of untrusted user text;
|
|
396
|
+
- exact resource version when reproducibility matters;
|
|
397
|
+
- the smallest output needed for the next decision.
|
|
361
398
|
|
|
362
|
-
The
|
|
363
|
-
|
|
399
|
+
The CLI's command router is also exported for integrations that need in-process
|
|
400
|
+
execution. That API exists to support agent runtimes and AIWG tooling; this
|
|
401
|
+
README intentionally does not duplicate the full programming reference.
|
|
364
402
|
|
|
365
|
-
###
|
|
403
|
+
### Recovery and diagnosis
|
|
366
404
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
405
|
+
When an operation fails, the agent should not immediately improvise a sequence
|
|
406
|
+
of destructive shell commands. It should route through the relevant AIWG
|
|
407
|
+
health or recovery skill.
|
|
370
408
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
409
|
+
The `aiwg-doctor` skill wraps `aiwg doctor` with interpretation and remediation
|
|
410
|
+
guidance. It can distinguish installation damage, missing package content,
|
|
411
|
+
provider deployment drift, bad configuration, and unavailable optional
|
|
412
|
+
features. That distinction prevents an agent from treating every missing file
|
|
413
|
+
as a reason to reinstall or overwrite project state.
|
|
374
414
|
|
|
375
|
-
|
|
415
|
+
Similarly, refresh and regeneration skills preserve operator-authored content
|
|
416
|
+
and use dry-run or transactional behavior where the workflow requires it.
|
|
417
|
+
Those safeguards live above the raw command and are a core reason to keep
|
|
418
|
+
agents skill-first.
|
|
376
419
|
|
|
377
|
-
|
|
378
|
-
aiwg discover "risk management" --json --compact \
|
|
379
|
-
| jq '.results[] | {type, name, path, score}'
|
|
380
|
-
```
|
|
420
|
+
## When Direct CLI Use Is Appropriate
|
|
381
421
|
|
|
382
|
-
|
|
422
|
+
Direct CLI use remains useful in a few bounded situations:
|
|
383
423
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
```
|
|
424
|
+
- an operator is installing AIWG and runs `aiwg doctor`;
|
|
425
|
+
- an operator intentionally deploys a known framework with `aiwg use`;
|
|
426
|
+
- an agent performs capability discovery or retrieves a selected resource;
|
|
427
|
+
- a skill calls its documented CLI step;
|
|
428
|
+
- CI invokes a deterministic validation command;
|
|
429
|
+
- a maintainer is debugging the runtime itself.
|
|
391
430
|
|
|
392
|
-
|
|
431
|
+
Direct CLI use is usually the wrong starting point when the task is expressed
|
|
432
|
+
as a goal such as "review this architecture," "prepare a release," "investigate
|
|
433
|
+
this incident," or "build a research corpus." Those are capability requests.
|
|
434
|
+
The agent should select the corresponding AIWG skill or agent and let that
|
|
435
|
+
resource decide which CLI operations are needed.
|
|
393
436
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
check the exit code before consuming output.
|
|
437
|
+
This README therefore documents the operating model, package boundary, trust
|
|
438
|
+
model, and troubleshooting path instead of duplicating every command and flag.
|
|
439
|
+
The complete operator reference is maintained at:
|
|
398
440
|
|
|
399
|
-
|
|
441
|
+
**[AIWG CLI Reference — every command and example](https://docs.aiwg.io/pages/cli-reference.html)**
|
|
400
442
|
|
|
401
|
-
|
|
402
|
-
|
|
443
|
+
Keeping the command catalog in one canonical location prevents package
|
|
444
|
+
documentation from drifting as the runtime grows.
|
|
403
445
|
|
|
404
|
-
|
|
446
|
+
## Agent Integration Guidance
|
|
405
447
|
|
|
406
|
-
|
|
407
|
-
import { run } from '@aiwg/cli';
|
|
448
|
+
An agent harness integrating AIWG should establish a few simple policies.
|
|
408
449
|
|
|
409
|
-
|
|
410
|
-
'discover',
|
|
411
|
-
'architecture evolution',
|
|
412
|
-
'--format',
|
|
413
|
-
'json',
|
|
414
|
-
'--pretty',
|
|
415
|
-
]);
|
|
416
|
-
```
|
|
450
|
+
### Prefer semantic intent over filenames
|
|
417
451
|
|
|
418
|
-
|
|
452
|
+
Ask for the capability in the user's language. Do not guess that a workflow
|
|
453
|
+
must live under a particular framework directory. The same intent may be
|
|
454
|
+
served by a framework skill, an addon skill, an agent, or a project-local
|
|
455
|
+
extension.
|
|
419
456
|
|
|
420
|
-
|
|
421
|
-
import { run } from '@aiwg/cli';
|
|
457
|
+
### Load the minimum relevant resource
|
|
422
458
|
|
|
423
|
-
|
|
459
|
+
Retrieve the selected skill or agent body, plus any directly referenced rule
|
|
460
|
+
needed to execute it. Avoid loading an entire framework merely because one
|
|
461
|
+
skill belongs to it. This is the primary context-management advantage of the
|
|
462
|
+
web-first package.
|
|
424
463
|
|
|
425
|
-
|
|
426
|
-
['show', 'skill', 'architecture-evolution'],
|
|
427
|
-
{
|
|
428
|
-
cwd: process.cwd(),
|
|
429
|
-
signal: controller.signal,
|
|
430
|
-
},
|
|
431
|
-
);
|
|
432
|
-
```
|
|
464
|
+
### Keep paths out of inter-agent contracts
|
|
433
465
|
|
|
434
|
-
|
|
435
|
-
|
|
466
|
+
Pass stable capability IDs, names, release versions, and structured results.
|
|
467
|
+
Do not make one worker depend on another worker's npm prefix, home directory,
|
|
468
|
+
cache location, or provider deployment path.
|
|
436
469
|
|
|
437
|
-
###
|
|
470
|
+
### Preserve skill priming
|
|
438
471
|
|
|
439
|
-
|
|
440
|
-
|
|
472
|
+
When forwarding work to a sub-agent, include the selected skill content or let
|
|
473
|
+
that worker retrieve it through AIWG. Passing only the final CLI command loses
|
|
474
|
+
the gates and reasoning instructions that made the operation safe.
|
|
441
475
|
|
|
442
|
-
|
|
443
|
-
selector: 'stable',
|
|
444
|
-
});
|
|
476
|
+
### Separate judgment from mechanics
|
|
445
477
|
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
});
|
|
451
|
-
```
|
|
478
|
+
The agent decides what the user means, which capability applies, and whether
|
|
479
|
+
the result satisfies the objective. The CLI resolves paths, validates data,
|
|
480
|
+
executes bounded operations, and reports facts. This separation makes both
|
|
481
|
+
layers easier to test.
|
|
452
482
|
|
|
453
|
-
|
|
483
|
+
### Fail closed on trust errors
|
|
454
484
|
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
```
|
|
485
|
+
Signature failures, digest mismatches, unsafe paths, incompatible release
|
|
486
|
+
metadata, and corrupt offline cache entries are not warnings to bypass. The
|
|
487
|
+
agent should stop, preserve useful evidence, and route through diagnosis or
|
|
488
|
+
security guidance.
|
|
460
489
|
|
|
461
|
-
|
|
490
|
+
### Avoid help-text ingestion
|
|
462
491
|
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
```
|
|
469
|
-
|
|
470
|
-
### Fetch a committed raw resource
|
|
471
|
-
|
|
472
|
-
```js
|
|
473
|
-
import {
|
|
474
|
-
fetchVerifiedRawResource,
|
|
475
|
-
resolveWebRelease,
|
|
476
|
-
} from '@aiwg/cli/resources';
|
|
477
|
-
|
|
478
|
-
const release = await resolveWebRelease({ selector: 'stable' });
|
|
479
|
-
const bytes = await fetchVerifiedRawResource(
|
|
480
|
-
release,
|
|
481
|
-
'raw/agentic/code/frameworks/sdlc-complete/skills/architecture-evolution/SKILL.md',
|
|
482
|
-
);
|
|
483
|
-
|
|
484
|
-
process.stdout.write(bytes);
|
|
485
|
-
```
|
|
486
|
-
|
|
487
|
-
The raw path must be safe, relative, begin with `raw/`, and exist in the signed
|
|
488
|
-
release descriptor map.
|
|
489
|
-
|
|
490
|
-
### TypeScript
|
|
491
|
-
|
|
492
|
-
The package ships declarations for:
|
|
493
|
-
|
|
494
|
-
- the main `@aiwg/cli` entry point;
|
|
495
|
-
- `@aiwg/cli/resources`;
|
|
496
|
-
- signed web-release descriptors and options.
|
|
497
|
-
|
|
498
|
-
```ts
|
|
499
|
-
import type {
|
|
500
|
-
VerifiedWebRelease,
|
|
501
|
-
WebReleaseOptions,
|
|
502
|
-
} from '@aiwg/cli/resources';
|
|
503
|
-
```
|
|
492
|
+
Do not routinely call `aiwg help` and place the full output in the model
|
|
493
|
+
context. If a skill exists, use it. If a maintainer or operator needs an
|
|
494
|
+
unfamiliar command, link to the canonical
|
|
495
|
+
[CLI reference](https://docs.aiwg.io/pages/cli-reference.html) or retrieve only
|
|
496
|
+
the relevant section.
|
|
504
497
|
|
|
505
498
|
## Using AIWG from a Web-Connected Chat
|
|
506
499
|
|
|
@@ -694,97 +687,115 @@ Consumer verification guidance:
|
|
|
694
687
|
|
|
695
688
|
## Current Scope and Limitations
|
|
696
689
|
|
|
697
|
-
The lightweight package
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
- the corresponding supported JavaScript API;
|
|
702
|
-
- signed release selection, verification, caching, and offline reads.
|
|
690
|
+
The lightweight package is an agentic execution and resource-access layer. Its
|
|
691
|
+
web-backed path provides production support for capability selection, resource
|
|
692
|
+
retrieval, signed release selection, verification, caching, and warm offline
|
|
693
|
+
reads.
|
|
703
694
|
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
project
|
|
707
|
-
|
|
695
|
+
It does not turn every AIWG action into a hosted service. Operations that
|
|
696
|
+
modify a project still run locally under the operator's permissions. A skill
|
|
697
|
+
may direct the CLI to write project artifacts or provider adapters, but the
|
|
698
|
+
release host never receives authority to mutate the project.
|
|
708
699
|
|
|
709
|
-
|
|
700
|
+
Some skills require the full local corpus, source templates, or authoring
|
|
701
|
+
assets. When a selected workflow reports that requirement, install the full
|
|
702
|
+
distribution:
|
|
710
703
|
|
|
711
704
|
```bash
|
|
712
705
|
npm uninstall --global @aiwg/cli
|
|
713
706
|
npm install --global aiwg
|
|
714
707
|
|
|
715
|
-
aiwg
|
|
716
|
-
aiwg regenerate
|
|
708
|
+
aiwg doctor
|
|
717
709
|
```
|
|
718
710
|
|
|
719
|
-
|
|
720
|
-
|
|
711
|
+
The package exposes the shared runtime, so help output may mention operations
|
|
712
|
+
whose complete inputs exist only in the full distribution. Agents should treat
|
|
713
|
+
an explicit "local corpus required" result as a package-boundary signal, not as
|
|
714
|
+
an invitation to search random filesystem locations.
|
|
715
|
+
|
|
716
|
+
## Common Agentic Patterns
|
|
717
|
+
|
|
718
|
+
### Turn a broad request into one bounded workflow
|
|
719
|
+
|
|
720
|
+
A user may ask, "Can you prepare this service for production?" The agent should
|
|
721
|
+
not start by enumerating every deployment command. It should:
|
|
721
722
|
|
|
722
|
-
|
|
723
|
+
1. classify the request as an SDLC/deployment capability;
|
|
724
|
+
2. select the relevant AIWG skill;
|
|
725
|
+
3. read the skill's prerequisites and evidence requirements;
|
|
726
|
+
4. invoke only the CLI operations called for by that skill;
|
|
727
|
+
5. return the outcome and unresolved gates to the user.
|
|
723
728
|
|
|
724
|
-
|
|
729
|
+
This pattern keeps the conversation about production readiness rather than
|
|
730
|
+
about command syntax.
|
|
731
|
+
|
|
732
|
+
### Hand work to a specialized agent
|
|
733
|
+
|
|
734
|
+
A conductor may discover that an architecture decision requires a security
|
|
735
|
+
review. It can pass the selected security skill and the relevant project
|
|
736
|
+
artifact to a security agent. It does not need to pass a recursive listing of
|
|
737
|
+
AIWG's security framework or explain where npm installed it.
|
|
738
|
+
|
|
739
|
+
The receiving agent works from the same signed capability identity and can use
|
|
740
|
+
the CLI for any deterministic checks specified by the skill.
|
|
741
|
+
|
|
742
|
+
### Diagnose before repairing
|
|
743
|
+
|
|
744
|
+
When AIWG appears broken, invoke the `aiwg-doctor` skill. The skill runs the
|
|
745
|
+
health primitive, classifies the finding, and chooses a remediation path. This
|
|
746
|
+
is less error-prone than having every agent invent an npm reinstall, delete
|
|
747
|
+
provider directories, or rewrite configuration on the first failure.
|
|
748
|
+
|
|
749
|
+
For a person at a terminal, the basic entry remains:
|
|
725
750
|
|
|
726
751
|
```bash
|
|
727
|
-
|
|
728
|
-
name=$(
|
|
729
|
-
aiwg discover "$query" --type skill --limit 1 --json --compact \
|
|
730
|
-
| jq -r '.results[0].name'
|
|
731
|
-
)
|
|
732
|
-
aiwg show skill "$name"
|
|
752
|
+
aiwg doctor
|
|
733
753
|
```
|
|
734
754
|
|
|
735
|
-
###
|
|
755
|
+
### Deploy through the `use` skill
|
|
736
756
|
|
|
737
|
-
|
|
738
|
-
|
|
757
|
+
The `use` skill is the normal agentic entry for framework and addon deployment.
|
|
758
|
+
It knows how to validate the requested bundle and supported provider before
|
|
759
|
+
calling the CLI. A human who already knows the exact target may use:
|
|
739
760
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
--format json \
|
|
743
|
-
--compact
|
|
761
|
+
```bash
|
|
762
|
+
aiwg use <framework-or-addon>
|
|
744
763
|
```
|
|
745
764
|
|
|
746
|
-
|
|
765
|
+
The skill-first route is preferred because deployment can involve provider
|
|
766
|
+
capabilities, project-local customizations, stale-file handling, and
|
|
767
|
+
post-deployment checks that are not conveyed by the command name alone.
|
|
747
768
|
|
|
748
|
-
|
|
749
|
-
export AIWG_RESOURCE_CACHE_ROOT="$PWD/.cache/aiwg/resources"
|
|
769
|
+
### Pin a capability graph for reproducible work
|
|
750
770
|
|
|
751
|
-
|
|
752
|
-
|
|
771
|
+
Long-running missions, release audits, and regulated workflows may bind the
|
|
772
|
+
runtime to an exact AIWG CalVer. Every worker can then retrieve capabilities
|
|
773
|
+
from the same immutable release instead of following a channel that may move
|
|
774
|
+
during the job.
|
|
753
775
|
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
```
|
|
776
|
+
The version belongs in mission or CI configuration. Individual agents should
|
|
777
|
+
inherit it rather than independently selecting different versions.
|
|
757
778
|
|
|
758
|
-
###
|
|
779
|
+
### Warm resources before network isolation
|
|
759
780
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
781
|
+
An online preparation step can retrieve the small set of skills, rules, and
|
|
782
|
+
indices needed by a later isolated job. Offline execution then uses only
|
|
783
|
+
previously verified cache generations and fails closed if required bytes are
|
|
784
|
+
missing.
|
|
764
785
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
786
|
+
This is preferable to copying the entire framework corpus into every isolated
|
|
787
|
+
worker. It keeps the payload task-specific and leaves a clear record of which
|
|
788
|
+
AIWG release supplied the guidance.
|
|
768
789
|
|
|
769
|
-
|
|
770
|
-
```
|
|
790
|
+
### Use the web surface when the agent cannot run tools
|
|
771
791
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
'incident evidence preservation',
|
|
780
|
-
'--type',
|
|
781
|
-
'skill,agent',
|
|
782
|
-
'--limit',
|
|
783
|
-
'5',
|
|
784
|
-
'--json',
|
|
785
|
-
'--pretty',
|
|
786
|
-
]);
|
|
787
|
-
```
|
|
792
|
+
Browser-only chat agents can navigate the linked release manifests and HTML
|
|
793
|
+
fallback pages at `releases.aiwg.io`. Tool-capable agents should use the CLI
|
|
794
|
+
because it verifies signatures, digests, channel sequence, and cache state
|
|
795
|
+
automatically.
|
|
796
|
+
|
|
797
|
+
Both paths expose the same capability graph. The difference is the access
|
|
798
|
+
mechanism, not a separate set of AIWG instructions.
|
|
788
799
|
|
|
789
800
|
## Installation Troubleshooting
|
|
790
801
|
|
|
@@ -1009,9 +1020,10 @@ Package invariants include:
|
|
|
1009
1020
|
|
|
1010
1021
|
## Documentation
|
|
1011
1022
|
|
|
1023
|
+
- [Complete AIWG CLI reference](https://docs.aiwg.io/pages/cli-reference.html)
|
|
1024
|
+
- [AIWG documentation](https://docs.aiwg.io/)
|
|
1012
1025
|
- [AIWG project README](https://github.com/jmagly/aiwg#readme)
|
|
1013
1026
|
- [Web-backed resources guide](https://github.com/jmagly/aiwg/blob/main/docs/install/web-backed-resources.md)
|
|
1014
|
-
- [CLI reference](https://github.com/jmagly/aiwg/blob/main/docs/cli-reference.md)
|
|
1015
1027
|
- [Release verification](https://github.com/jmagly/aiwg/blob/main/docs/releases/verifying.md)
|
|
1016
1028
|
- [Supply-chain overview](https://github.com/jmagly/aiwg/blob/main/docs/security/supply-chain-overview.md)
|
|
1017
1029
|
- [Agentic install runbook](https://github.com/jmagly/aiwg/blob/main/docs/agentic-install-runbook.md)
|