@sabaiway/agent-workflow-kit 1.5.2 → 1.7.0
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/CHANGELOG.md +67 -0
- package/README.md +12 -5
- package/SKILL.md +48 -20
- package/bin/install.mjs +33 -50
- package/bin/install.test.mjs +30 -1
- package/bridges/antigravity-cli-bridge/SKILL.md +178 -0
- package/bridges/antigravity-cli-bridge/bin/agy.sh +133 -0
- package/bridges/antigravity-cli-bridge/bin/agy.test.mjs +59 -0
- package/bridges/antigravity-cli-bridge/capability.json +22 -0
- package/bridges/antigravity-cli-bridge/references/driving-agy.md +108 -0
- package/bridges/antigravity-cli-bridge/references/models-and-flags.md +93 -0
- package/bridges/antigravity-cli-bridge/references/review-prompt.md +51 -0
- package/bridges/antigravity-cli-bridge/setup/README.md +65 -0
- package/bridges/codex-cli-bridge/SKILL.md +148 -0
- package/bridges/codex-cli-bridge/bin/codex-exec.sh +143 -0
- package/bridges/codex-cli-bridge/bin/codex-review.sh +84 -0
- package/bridges/codex-cli-bridge/capability.json +22 -0
- package/bridges/codex-cli-bridge/references/driving-codex.md +97 -0
- package/bridges/codex-cli-bridge/references/sandbox-and-flags.md +105 -0
- package/bridges/codex-cli-bridge/setup/README.md +78 -0
- package/capability.json +1 -1
- package/migrations/README.md +1 -1
- package/package.json +3 -2
- package/references/templates/AGENTS.md +2 -1
- package/tools/delegation.mjs +4 -4
- package/tools/delegation.test.mjs +4 -3
- package/tools/detect-backends.mjs +36 -0
- package/tools/detect-backends.test.mjs +102 -0
- package/tools/fs-safe.mjs +129 -0
- package/tools/fs-safe.test.mjs +200 -0
- package/tools/inject-methodology.mjs +131 -23
- package/tools/inject-methodology.test.mjs +232 -1
- package/tools/setup-backends.mjs +468 -0
- package/tools/setup-backends.test.mjs +500 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,73 @@ Semantically versioned ([semver](https://semver.org)), newest first. The `versio
|
|
|
4
4
|
is the current release. `upgrade` mode reads a project's `docs/ai/.workflow-version` and applies
|
|
5
5
|
every `migrations/<version>-<slug>.md` newer than it, in semver order.
|
|
6
6
|
|
|
7
|
+
## 1.7.0 — Link-only backend auto-setup; bridges bundled in the tarball
|
|
8
|
+
|
|
9
|
+
The optional execution-backend bridges (`codex-cli-bridge` → `codex`, `antigravity-cli-bridge` →
|
|
10
|
+
`agy`) can now be set up from the kit itself, via a new **opt-in, in-agent** mode —
|
|
11
|
+
**`/agent-workflow-kit setup [backend]`** (`tools/setup-backends.mjs`). It owns only the two
|
|
12
|
+
**deterministic, secret-free** steps and **guides** the rest (AD-011):
|
|
13
|
+
|
|
14
|
+
- **Bridges are bundled in the kit's npm tarball** under `bridges/<name>/` — a **byte-identical
|
|
15
|
+
mirror** of the repo-root bridges, pinned by `test/bridges-mirror.test.mjs` (the same drift-guard
|
|
16
|
+
pattern as the methodology mirror). So `setup` places a bridge from local files, with **no network
|
|
17
|
+
fetch**. `init` (npx) bundles them but still **does not place** them — that stays the opt-in
|
|
18
|
+
`setup` job (preserving the honest `init` ≠ deploy claim).
|
|
19
|
+
- **`setup` places/refreshes the bundled bridge skill**, but only into a dir that is **absent /
|
|
20
|
+
empty / proven-managed** (valid manifest, matching `name`+`kind`); a stub/foreign/invalid/
|
|
21
|
+
unsupported manifest, a marker fs-error, a non-empty unknown dir, or a symlinked dir → **STOP**,
|
|
22
|
+
never overwritten. Refresh re-runs on a managed dir so re-running `setup` delivers bundled fixes.
|
|
23
|
+
- **It links the wrappers** (`codex-exec` / `codex-review`; `agy-run`) onto `PATH` (`~/.local/bin`,
|
|
24
|
+
override with `--bindir`) via **managed symlinks** — replacing only a symlink already pointing at
|
|
25
|
+
our source. It **preflights every target first**, so a conflict on one wrapper makes **zero**
|
|
26
|
+
changes; a non-symlink or a foreign symlink → STOP. Wrapper presence is judged **per-bindir**, not
|
|
27
|
+
PATH-wide. `--dry-run` prints the plan and changes nothing.
|
|
28
|
+
- **The binary install + the interactive subscription login stay manual** — `setup` prints the exact
|
|
29
|
+
commands (the detector's axis-aware `guideFor`), never runs a subscription CLI, never commits. On
|
|
30
|
+
**Windows** it reports *unsupported — use WSL* and mutates nothing (the wrappers are POSIX `.sh`).
|
|
31
|
+
- Internal: the symlink-traversal-safe copy/link primitives are now shared in `tools/fs-safe.mjs`
|
|
32
|
+
(the npx installer consumes them and gained an `isDirectRun` guard so importing it runs nothing).
|
|
33
|
+
The per-package publish workflow now gates the kit on its **whole** test suite, not just the
|
|
34
|
+
shipped enforcement scripts.
|
|
35
|
+
|
|
36
|
+
No `docs/ai` structural change → the deployment-lineage head stays **`1.3.0`**; no migration.
|
|
37
|
+
|
|
38
|
+
## 1.6.0 — Methodology slot reconciliation; engine becomes the canonical methodology home
|
|
39
|
+
|
|
40
|
+
The workflow methodology now has a **single canonical home** in `agent-workflow-engine`
|
|
41
|
+
(`available:false` — content only, not yet published or wired live), and the kit keeps
|
|
42
|
+
**byte-identical mirror copies** so the existing injection + fallback keep working with **no new
|
|
43
|
+
runtime dependency**. A drift-guard test (`tools/methodology-mirror.test.mjs`) pins the mirrors to
|
|
44
|
+
the engine canon: `references/planning.md` and `tools/methodology-slot.md` must equal their engine
|
|
45
|
+
counterparts byte-for-byte.
|
|
46
|
+
|
|
47
|
+
The user-facing win is **stamp-independent slot reconciliation**. A single atomic, idempotent kit
|
|
48
|
+
operation now **ensures the `workflow:methodology` slot exists and is filled** in a deployed
|
|
49
|
+
`AGENTS.md`, on **bootstrap** and on **every upgrade**:
|
|
50
|
+
|
|
51
|
+
- **`tools/inject-methodology.mjs`** gains `METHODOLOGY_ANCHOR`, `EMPTY_SLOT`, `ensureSlot`, and
|
|
52
|
+
`reconcileSlot` (reusing the existing `findSlot` / `injectMethodology` / `extractSlot` marker
|
|
53
|
+
parser — no second parser). `reconcileSlot` = **ensure the slot exists** (insert an empty marker
|
|
54
|
+
pair right after the Session-Protocols anchor when a legacy entry point lacks one) → **inject the
|
|
55
|
+
bounded fragment ONLY IF the slot is empty** (a filled / user-customized slot is preserved
|
|
56
|
+
verbatim) → **cap-check** (`AGENTS.md` ≤ 100 lines). On a malformed slot or a missing / duplicate
|
|
57
|
+
anchor it **STOPs with an error and never edits** — the file is left byte-for-byte unchanged.
|
|
58
|
+
- A new CLI mode — `inject-methodology.mjs reconcile <AGENTS.md>` — runs that policy as **one
|
|
59
|
+
atomic write** (temp + rename); there is no partial state where markers exist but the fill failed.
|
|
60
|
+
- The kit **fallback** entry-point template (`references/templates/AGENTS.md`) now ships the **empty
|
|
61
|
+
methodology slot** (matching memory's template) instead of an inline methodology line, so a fresh
|
|
62
|
+
fallback bootstrap gets a slot the kit fills. A new test (`test/fallback-template-cap.test.mjs`)
|
|
63
|
+
pins that template — empty and filled — under the 100-line cap.
|
|
64
|
+
- **Bootstrap** and **upgrade** (`SKILL.md`) now run `reconcile`. On upgrade it runs
|
|
65
|
+
**before** the lineage short-circuit, so the slot is reconciled on every upgrade — reaching even
|
|
66
|
+
legacy **`1.3.0`** deployments — **without bumping the deployment-lineage head**.
|
|
67
|
+
|
|
68
|
+
The deployment-lineage head **stays `1.3.0`** and `agent-workflow-memory` is **untouched** (no code,
|
|
69
|
+
version, or migration change): reconciliation is stamp-independent, so it needs no head bump (which
|
|
70
|
+
would have forced a memory republish, since the head is hard-coded in memory's stamp module).
|
|
71
|
+
Additive — no user-facing break. The engine's npm packaging, `available:true`, and the live
|
|
72
|
+
`kit → engine` read selector are deferred to the next plan.
|
|
73
|
+
|
|
7
74
|
## 1.5.2 — README uplift to front-door grade (docs)
|
|
8
75
|
|
|
9
76
|
Docs-only patch. The npm-facing `README.md` is uplifted to match the GitHub family front door's
|
package/README.md
CHANGED
|
@@ -216,6 +216,7 @@ command is printed).
|
|
|
216
216
|
| `/agent-workflow-kit` | new / empty project | recon → **asks visible-or-hidden** + **conversational language** + **agent attribution** (default off) → deploys `AGENTS.md` + `docs/ai/` filled with real recon data → installs enforcement → **asks before committing** |
|
|
217
217
|
| `/agent-workflow-kit upgrade` | existing deployment | reads `docs/ai/.workflow-version`, shows the changelog diff, preserves your authored memory, applies migrations, re-stamps |
|
|
218
218
|
| `/agent-workflow-kit backends` | any time | **read-only** check of the optional execution-backends (the `codex` / `agy` bridges): what's set up vs missing and the next step. Never writes, never commits, never runs a subscription CLI (credentials = marker-file presence, not a live login). |
|
|
219
|
+
| `/agent-workflow-kit setup [backend]` | opt-in, any time | **link-only** auto-setup of a bridge: places the bundled bridge skill (only into an absent / empty / managed dir — never overwrites an unmanaged one) + links its wrappers onto `PATH` via managed symlinks (idempotent; refuses to clobber a non-symlink; try `--dry-run` to preview). The binary install + the one-time subscription login stay **manual**: it prints the exact **login** command and points the binary install at each bridge's `setup/README.md`. POSIX wrappers — on Windows use WSL. Never commits, never runs a subscription CLI. |
|
|
219
220
|
|
|
220
221
|
It **never auto-commits** and **never overwrites** an existing `AGENTS.md` without asking.
|
|
221
222
|
|
|
@@ -248,17 +249,20 @@ agent-workflow-kit — the composition root (installed via npx … init)
|
|
|
248
249
|
├─ delegates ─▶ memory substrate (healthy copy, else bundled fallback)
|
|
249
250
|
├─ injects ─▶ workflow methodology (engine = future supplier; stub)
|
|
250
251
|
├─ deploys ─▶ AGENTS.md + docs/ai/ + Node scripts + pre-commit hook
|
|
251
|
-
|
|
252
|
+
├─ detects ─▶ optional backends (codex / agy, read-only)
|
|
253
|
+
└─ sets up ─▶ a bridge (opt-in) (place skill + link wrappers)
|
|
252
254
|
```
|
|
253
255
|
|
|
254
256
|
- **Delegates** substrate deployment to **`@sabaiway/agent-workflow-memory`** when a healthy
|
|
255
257
|
standalone copy is present, else uses its **bundled fallback** — same `docs/ai/` either way.
|
|
256
258
|
- **Injects** the bounded workflow methodology into the deployed `AGENTS.md`. Its *future* home is
|
|
257
259
|
**`agent-workflow-engine`** — today an `available: false` stub, never one of the shipped backends.
|
|
258
|
-
- **Detects** the optional `codex` / `agy` **bridges** — agent skills
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
- **Detects & (opt-in) sets up** the optional `codex` / `agy` **bridges** — agent skills (not npm, not
|
|
261
|
+
installed by `init`). `/agent-workflow-kit backends` reports readiness **read-only**;
|
|
262
|
+
`/agent-workflow-kit setup` does the **link-only** part (place the bundled bridge skill + link its
|
|
263
|
+
wrappers), while the binary install + the subscription login stay manual. A bridge reads the deployed
|
|
264
|
+
memory only if it wins that tool's context-file priority, and the bridges call third-party services
|
|
265
|
+
(so "no telemetry" covers family code, not those).
|
|
262
266
|
|
|
263
267
|
> Full member-by-member map + the whole-family story: the
|
|
264
268
|
> **[family front door](https://github.com/sabaiway/agent-workflow#readme)** — this page stays the
|
|
@@ -295,7 +299,10 @@ agent-workflow-kit/
|
|
|
295
299
|
│ ├── delegation.mjs ← detect substrate · delegate-or-fall-back
|
|
296
300
|
│ ├── inject-methodology.mjs ← write the methodology slot
|
|
297
301
|
│ ├── detect-backends.mjs ← read-only backend detector
|
|
302
|
+
│ ├── setup-backends.mjs ← link-only backend setup
|
|
303
|
+
│ ├── fs-safe.mjs ← symlink-safe copy/link
|
|
298
304
|
│ └── release-scan.mjs ← attribution / release gate
|
|
305
|
+
├── bridges/ ← bundled bridge skill mirrors (codex / antigravity)
|
|
299
306
|
├── launchers/ ← Codex / Devin Desktop / Cursor entries
|
|
300
307
|
└── migrations/ ← per-version upgrade steps
|
|
301
308
|
```
|
package/SKILL.md
CHANGED
|
@@ -3,7 +3,7 @@ name: agent-workflow-kit
|
|
|
3
3
|
description: Deploy or upgrade a portable AI-agent memory-and-workflow system in any project. Use when the user wants to bootstrap `docs/ai/` + an entry-point `AGENTS.md` (+ `CLAUDE.md` alias) + cap/archive/index enforcement in a new or existing repo, set up the Memory Map and session protocols, install the docs-rotation pre-commit hook, or run `/agent-workflow-kit` / `/agent-workflow-kit upgrade`. Triggers on phrases like "set up the memory system", "deploy the AI workflow here", "bootstrap docs/ai", "upgrade the workflow".
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
metadata:
|
|
6
|
-
version: '1.
|
|
6
|
+
version: '1.7.0'
|
|
7
7
|
---
|
|
8
8
|
|
|
9
9
|
# agent-workflow-kit
|
|
@@ -49,21 +49,25 @@ made: a partial/broken memory install discovered mid-flow must not disable the w
|
|
|
49
49
|
**Hand-off contract (explicit; tested independent of agent interpretation).**
|
|
50
50
|
- **Delegated** (memory valid): the kit passes the **target project dir** + the **three setup
|
|
51
51
|
answers** (visibility / language / attribution) to `agent-workflow-memory`, which writes
|
|
52
|
-
`docs/ai/` + `AGENTS.md` + **`.memory-version`**. The kit then
|
|
53
|
-
methodology slot** (below) and writes the kit-fallback
|
|
54
|
-
stamps** present.
|
|
52
|
+
`docs/ai/` + `AGENTS.md` (with the empty slot) + **`.memory-version`**. The kit then
|
|
53
|
+
**reconciles the bounded methodology slot** (below) and writes the kit-fallback
|
|
54
|
+
**`.workflow-version`**. → **both stamps** present.
|
|
55
55
|
- **Fallback** (memory absent/invalid): the kit runs the bootstrap procedure below from its own
|
|
56
|
-
bundled assets
|
|
56
|
+
bundled assets — whose entry-point template now ships the **empty methodology slot** the kit
|
|
57
|
+
reconciles + fills — and writes **`.workflow-version`** only. Softly suggest installing
|
|
57
58
|
`agent-workflow-memory` — never a prerequisite.
|
|
58
59
|
|
|
59
|
-
**Methodology
|
|
60
|
-
exists,
|
|
61
|
-
`node ${CLAUDE_SKILL_DIR}/tools/inject-methodology.mjs <project>/AGENTS.md`.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
60
|
+
**Methodology slot reconciliation (the kit is the ONLY writer of memory's slot).** After
|
|
61
|
+
`AGENTS.md` exists, reconcile its `workflow:methodology` slot:
|
|
62
|
+
`node ${CLAUDE_SKILL_DIR}/tools/inject-methodology.mjs reconcile <project>/AGENTS.md`. Reconcile is
|
|
63
|
+
**one atomic operation**: **ensure the slot exists** (insert an empty marker pair right after the
|
|
64
|
+
Session-Protocols anchor when a legacy entry point lacks one) → **inject the bounded fragment ONLY
|
|
65
|
+
IF the slot is empty** (a filled / user-customized slot is preserved verbatim) → **cap-check**
|
|
66
|
+
(keeps `AGENTS.md` ≤100 lines). The fragment is a short summary + pointer (source: the kit's bundled
|
|
67
|
+
`tools/methodology-slot.md`, a **byte-identical mirror of the `agent-workflow-engine` canon**) —
|
|
68
|
+
**not** the full `references/planning.md`. Contract: exactly one ordered `start → end` pair; a
|
|
69
|
+
malformed slot (single, reversed, nested, duplicate) or a missing / duplicate anchor → **STOP with
|
|
70
|
+
an error**, never edit (the file is left byte-for-byte unchanged).
|
|
67
71
|
|
|
68
72
|
**One composition-level commit gate.** The delegated memory mode performs **no** commit and
|
|
69
73
|
raises **no** "ask to commit". There is exactly **one** gate, owned by the kit, **after**
|
|
@@ -79,6 +83,7 @@ Pick the mode from the user's invocation. Auto-detect an existing `docs/ai/` to
|
|
|
79
83
|
- **`/agent-workflow-kit`** (default) — bootstrap a new or empty project. If `docs/ai/` already exists, stop and ask whether they meant `upgrade`.
|
|
80
84
|
- **`/agent-workflow-kit upgrade`** — upgrade an existing deployment to the skill's current `version`.
|
|
81
85
|
- **`/agent-workflow-kit backends`** — read-only environment check: which optional **execution-backends** (the `codex` / `agy` bridges) are set up vs missing. Never writes, never commits, never runs a subscription CLI.
|
|
86
|
+
- **`/agent-workflow-kit setup [backend]`** — the **link-only**, opt-in companion to `backends`: place the bundled bridge skill + link its wrappers onto `PATH`. **In-agent only** — `init` (npx) never places bridges. The binary install + the interactive subscription login stay **manual** (it prints the exact commands); idempotent; refuses to clobber a non-symlink; never commits, never runs a subscription CLI.
|
|
82
87
|
|
|
83
88
|
### Mode: bootstrap
|
|
84
89
|
|
|
@@ -103,7 +108,8 @@ Pick the mode from the user's invocation. Auto-detect an existing `docs/ai/` to
|
|
|
103
108
|
9. **Wire / hide** per visibility (see contract). Install the pre-commit hook (Node projects): `node scripts/install-git-hooks.mjs`. If the installer reports a pre-existing non-marker hook, stop and ask the user to merge it manually rather than overwriting.
|
|
104
109
|
10. **Stamp the deployment lineage.** Write the **deployment-lineage head** into
|
|
105
110
|
`docs/ai/.workflow-version` (one semver line). The lineage head is **`1.3.0`** — the shared
|
|
106
|
-
`agent-workflow` deployment lineage, **NOT** this kit's package version (
|
|
111
|
+
`agent-workflow` deployment lineage, **NOT** this kit's npm package version (see
|
|
112
|
+
`package.json` / `CHANGELOG.md`). The two are
|
|
107
113
|
independent axes: a packaging-only release bumps the package but leaves the lineage head until a
|
|
108
114
|
migration actually changes the deployed `docs/ai` structure. A stamp greater than the head →
|
|
109
115
|
STOP (never downgrade).
|
|
@@ -122,11 +128,13 @@ Fill strategy:
|
|
|
122
128
|
### Mode: upgrade
|
|
123
129
|
|
|
124
130
|
1. Read `docs/ai/.workflow-version` (the project's stamped lineage). If missing, treat as a pre-versioned deployment and offer to re-bootstrap conservatively.
|
|
125
|
-
2. Compare to the **deployment-lineage head** (`1.3.0` — NOT this kit's package version). If
|
|
126
|
-
3.
|
|
127
|
-
4.
|
|
128
|
-
5.
|
|
129
|
-
6.
|
|
131
|
+
2. **Never-downgrade gate — FIRST, before any write.** Compare the stamp to the **deployment-lineage head** (`1.3.0` — NOT this kit's package version). If the stamp is **greater than the head** or unparseable → **STOP and report**; do not touch a newer / unknown deployment at all (not even the methodology slot).
|
|
132
|
+
3. **Reconcile the methodology slot — stamp-independent, BEFORE the equal-head short-circuit.** Reached only when the stamp **≤ head**. Run `node ${CLAUDE_SKILL_DIR}/tools/inject-methodology.mjs reconcile <project>/AGENTS.md`. This ensures the `workflow:methodology` slot exists and is filled on **every** upgrade, idempotently (zero-diff when already present + filled) — so even a legacy / current **`1.3.0`** deployment gains the slot **without a lineage-head bump** (the head stays `1.3.0`; **no `agent-workflow-memory` change**). It inserts an empty slot at the Session-Protocols anchor if absent, preserves a customized slot verbatim, and STOPs (never edits) on a malformed slot or a missing / duplicate anchor. No-Node project: open `AGENTS.md`, and if there is no `<!-- workflow:methodology:start/end -->` pair, paste it right after the *Read it before any code change.* line and fill it from `tools/methodology-slot.md`.
|
|
133
|
+
4. **Equal-head short-circuit.** If the stamp **equals** the head → the lineage is up to date: **stop here** (the slot was already reconciled in step 3).
|
|
134
|
+
5. Show the relevant `${CLAUDE_SKILL_DIR}/CHANGELOG.md` diff (entries newer than the project's stamp).
|
|
135
|
+
6. Apply `${CLAUDE_SKILL_DIR}/migrations/<version>-<slug>.md` in **semver order**, only those newer than the project's stamp. Migrations are **idempotent** — safe to re-run.
|
|
136
|
+
7. Reconcile drift: add any kernel files/scripts the project is missing; never clobber project-authored content (their `decisions.md`, `known_issues.md`, page specs stay). Any user question a migration raises follows the same rule as bootstrap — **structured multiple-choice where supported** (`AskUserQuestion` in Claude Code), otherwise prose. If `AGENTS.md` has no *Communication language* block (pre-1.1.0 deployment), **ask the user their conversational language** and insert the block — see `migrations/1.1.0-communication-language.md`. If it has no *Attribution* block (pre-1.2.0 deployment), **ask whether the agent may attribute work to itself / AI** and insert the block (defaulting to `off`) — see `migrations/1.2.0-agent-attribution.md`.
|
|
137
|
+
8. Re-stamp `docs/ai/.workflow-version` to the **deployment-lineage head** (`1.3.0`, not the package version). Report changes; **ask before committing**.
|
|
130
138
|
|
|
131
139
|
### Mode: backends
|
|
132
140
|
|
|
@@ -138,6 +146,26 @@ Read-only. Answers *"which optional execution-backends are set up vs missing, an
|
|
|
138
146
|
- **"credentials present"** means the credential-marker **file** exists — it is **not** a live login check. The detector never runs `codex login status` / `agy` (that would spawn a paid, slow, networked subscription CLI).
|
|
139
147
|
- The bridges' wrappers are **POSIX `.sh`** scripts. On Windows the detector still works, but the bridges themselves are **not promised to run** — say so rather than implying they will.
|
|
140
148
|
|
|
149
|
+
### Mode: setup
|
|
150
|
+
|
|
151
|
+
The **only writer** among the backend modes, and **opt-in / in-agent only** — it is **never** part of `init`. The npx installer deploys the *kit* and bundles the bridge skills in its tarball, but **does not place** them (that honesty claim is load-bearing — see `decisions.md` AD-009 / AD-011). `setup` owns exactly the two deterministic, secret-free steps and **guides** the rest. It **never commits and never runs a subscription CLI**.
|
|
152
|
+
|
|
153
|
+
Run `node ${CLAUDE_SKILL_DIR}/tools/setup-backends.mjs [<backend>] [--bindir <path>] [--dry-run]`:
|
|
154
|
+
|
|
155
|
+
- `<backend>` — `codex` | `agy` | `antigravity` | `codex-cli-bridge` | `antigravity-cli-bridge`; omit for **all**.
|
|
156
|
+
- `--bindir <path>` — where to link the wrappers (default `~/.local/bin`).
|
|
157
|
+
- `--dry-run` — print the per-backend plan and change **nothing** (run this first).
|
|
158
|
+
- `--help`, `-h` — usage.
|
|
159
|
+
|
|
160
|
+
For each backend it:
|
|
161
|
+
1. **Places / refreshes the bundled bridge skill** (from the kit's `bridges/<name>/` mirror) into its canonical dir — but only when that dir is **absent / empty / proven-managed** (valid manifest, matching `name`+`kind`). A `stub` / `foreign` / `invalid` / `unsupported` dir, a marker fs-error, or a symlinked dir → **STOP**, never overwritten. Refresh re-runs on a proven-managed dir so re-running `setup` delivers bundled fixes.
|
|
162
|
+
2. **Links its wrappers** (`codex-exec` / `codex-review`; `agy-run`) onto `--bindir` via **managed symlinks** — replacing only a symlink that already points at our source. A non-symlink or a foreign symlink → **STOP**; it **preflights every target first**, so a conflict on one wrapper makes **zero** changes. If `--bindir` is not on `PATH`, it prints the one-line `export PATH=…` to add — it never edits a shell rc.
|
|
163
|
+
3. **Guides the manual, secret-bearing steps it will NOT automate** — the binary install (each bridge's `setup/README.md` §1) and the one-time interactive subscription login (`codex login` / `agy`) — printing the exact command for whichever axis is still missing (axis-aware: it can ask for both the CLI and the login at once).
|
|
164
|
+
|
|
165
|
+
**Windows:** the wrappers are POSIX `.sh`; on `win32` it reports *unsupported — use WSL* and mutates nothing.
|
|
166
|
+
|
|
167
|
+
**Exit codes:** `0` = done / already set up / only manual steps remain (guidance is never a failure); **non-zero** = a STOP (a dir/symlink it refuses to clobber), a bad argument, a missing bundle, or a native fs error (the underlying reason is preserved in the message).
|
|
168
|
+
|
|
141
169
|
---
|
|
142
170
|
|
|
143
171
|
## Gotchas
|
|
@@ -207,6 +235,6 @@ Deploy these into `AGENTS.md`; remove rows that don't apply to the stack.
|
|
|
207
235
|
- [`references/scripts/`](references/scripts/) — the Node enforcement scripts (caps + staleness + index-freshness gate, 3-tier archive, hook installer) and their unit tests.
|
|
208
236
|
- [`migrations/`](migrations/) — per-version upgrade steps; see `migrations/README.md`.
|
|
209
237
|
- [`launchers/`](launchers/) — run the bootstrapper from non-Claude agents (`SKILL.md` is a native Codex skill; a Devin Desktop workflow launcher + install script). See `launchers/README.md`.
|
|
210
|
-
- [`tools/`](tools/) — the family-wide tooling the kit **owns and ships**: `manifest/{schema.md,validate.mjs}` (the `capability.json` schema + the validator the kit runs as the memory detector, and root CI invokes), `delegation.mjs` (the executable delegate/fallback decision + hand-off plan), `inject-methodology.mjs` + `methodology-slot.md` (the bounded slot
|
|
238
|
+
- [`tools/`](tools/) — the family-wide tooling the kit **owns and ships**: `manifest/{schema.md,validate.mjs}` (the `capability.json` schema + the validator the kit runs as the memory detector, and root CI invokes), `delegation.mjs` (the executable delegate/fallback decision + hand-off plan), `inject-methodology.mjs` + `methodology-slot.md` (the bounded slot reconciliation — ensure-slot / inject-if-empty / cap; the fragment is a byte-identical mirror of the `agent-workflow-engine` canon, pinned by `methodology-mirror.test.mjs`), `detect-backends.mjs` (the read-only **backend detector** behind `/agent-workflow-kit backends`, plus the axis-aware `guideFor`), `setup-backends.mjs` (the **link-only** backend setup behind `/agent-workflow-kit setup` — place the bundled bridge + link wrappers), `fs-safe.mjs` (the shared symlink-traversal-safe copy/link primitives both `setup-backends` and the npx installer use), and `release-scan.mjs` (the attribution-off release gate). The bundled bridge skill mirrors live under [`bridges/`](bridges/) (byte-identical to the repo-root bridges, pinned by `test/bridges-mirror.test.mjs`). See [`tools/manifest/schema.md`](tools/manifest/schema.md).
|
|
211
239
|
- [`capability.json`](capability.json) — the kit's own `agent-workflow` family manifest (`kind: composition-root`).
|
|
212
240
|
- [`CHANGELOG.md`](CHANGELOG.md) — version history of this kernel.
|
package/bin/install.mjs
CHANGED
|
@@ -18,19 +18,22 @@
|
|
|
18
18
|
//
|
|
19
19
|
// Dependency-free, Node >= 18.
|
|
20
20
|
|
|
21
|
-
import { readFile, mkdir
|
|
21
|
+
import { readFile, mkdir } from 'node:fs/promises';
|
|
22
22
|
import { existsSync, lstatSync } from 'node:fs';
|
|
23
|
-
import { dirname,
|
|
24
|
-
import { fileURLToPath } from 'node:url';
|
|
23
|
+
import { dirname, resolve } from 'node:path';
|
|
24
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
25
25
|
import { homedir } from 'node:os';
|
|
26
26
|
import { spawnSync } from 'node:child_process';
|
|
27
|
+
import { copyTreeRefresh } from '../tools/fs-safe.mjs';
|
|
27
28
|
|
|
28
29
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
29
30
|
const PKG_ROOT = resolve(__dirname, '..');
|
|
30
31
|
|
|
31
32
|
// The deployable skill = everything except the npm wrapper (package.json, bin/).
|
|
32
33
|
// capability.json (the family manifest) + tools/ (the family schema + validator the kit runs
|
|
33
|
-
// as the memory detector) must land in the installed skill dir too.
|
|
34
|
+
// as the memory detector) must land in the installed skill dir too. bridges/ carries the
|
|
35
|
+
// byte-identical execution-backend skill mirrors (codex/antigravity) so `setup` can place a bridge
|
|
36
|
+
// from the installed kit, with no network fetch (Plan B / AD-011).
|
|
34
37
|
const PAYLOAD = [
|
|
35
38
|
'SKILL.md',
|
|
36
39
|
'README.md',
|
|
@@ -40,6 +43,7 @@ const PAYLOAD = [
|
|
|
40
43
|
'launchers',
|
|
41
44
|
'migrations',
|
|
42
45
|
'tools',
|
|
46
|
+
'bridges',
|
|
43
47
|
];
|
|
44
48
|
|
|
45
49
|
const tildify = (path) => path.replace(homedir(), '~');
|
|
@@ -64,42 +68,10 @@ const lstatNoFollow = (path) => {
|
|
|
64
68
|
}
|
|
65
69
|
};
|
|
66
70
|
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if (rel.startsWith('..') || isAbsolute(rel)) {
|
|
72
|
-
throw new Error(`[agent-workflow-kit] refusing to write outside the target dir: ${dest}`);
|
|
73
|
-
}
|
|
74
|
-
if (lstatNoFollow(root)?.isSymbolicLink()) {
|
|
75
|
-
throw new Error(`[agent-workflow-kit] refusing to install into a symlinked target dir: ${root}`);
|
|
76
|
-
}
|
|
77
|
-
const walk = (acc, part) => {
|
|
78
|
-
const cur = join(acc, part);
|
|
79
|
-
if (lstatNoFollow(cur)?.isSymbolicLink()) {
|
|
80
|
-
throw new Error(`[agent-workflow-kit] refusing to write through a symlink at ${cur} (would escape ${root}).`);
|
|
81
|
-
}
|
|
82
|
-
return cur;
|
|
83
|
-
};
|
|
84
|
-
rel.split(sep).filter(Boolean).reduce(walk, root);
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
const copyRecursive = async (src, dest, root) => {
|
|
88
|
-
assertContainedRealPath(root, dest); // never write through a dest symlink (root/intermediate/leaf)
|
|
89
|
-
const stat = await lstat(src);
|
|
90
|
-
if (stat.isSymbolicLink()) {
|
|
91
|
-
if (existsSync(dest)) return; // additive: never delete/replace an existing entry
|
|
92
|
-
const linkTarget = await readlink(src);
|
|
93
|
-
await symlink(linkTarget, dest);
|
|
94
|
-
} else if (stat.isDirectory()) {
|
|
95
|
-
await mkdir(dest, { recursive: true });
|
|
96
|
-
const entries = await readdir(src);
|
|
97
|
-
await Promise.all(entries.map((entry) => copyRecursive(join(src, entry), join(dest, entry), root)));
|
|
98
|
-
} else {
|
|
99
|
-
await mkdir(dirname(dest), { recursive: true });
|
|
100
|
-
await copyFile(src, dest);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
71
|
+
// The symlink-traversal guard + the recursive refresh copy now live in tools/fs-safe.mjs (shared,
|
|
72
|
+
// dependency-injectable, unit-tested in isolation). install.mjs consumes copyTreeRefresh, which guards
|
|
73
|
+
// every dest via assertContainedRealPath internally. The local lstatNoFollow above stays for the
|
|
74
|
+
// pre-flight check on the target root itself (a nicer error than letting the copy throw).
|
|
103
75
|
|
|
104
76
|
const parseArgs = (argv) => {
|
|
105
77
|
const dirFlag = argv.indexOf('--dir');
|
|
@@ -150,7 +122,15 @@ const main = async () => {
|
|
|
150
122
|
|
|
151
123
|
// Critical payload must be present, or the install would silently ship a kit that can't run
|
|
152
124
|
// its own detector (tools/) or family contract (capability.json). Fail loudly, don't filter away.
|
|
153
|
-
const REQUIRED = [
|
|
125
|
+
const REQUIRED = [
|
|
126
|
+
'SKILL.md',
|
|
127
|
+
'capability.json',
|
|
128
|
+
'references',
|
|
129
|
+
'tools',
|
|
130
|
+
'migrations',
|
|
131
|
+
'bridges/codex-cli-bridge',
|
|
132
|
+
'bridges/antigravity-cli-bridge',
|
|
133
|
+
];
|
|
154
134
|
const missing = REQUIRED.filter((entry) => !existsSync(resolve(PKG_ROOT, entry)));
|
|
155
135
|
if (missing.length > 0) {
|
|
156
136
|
console.error(`[agent-workflow-kit] package payload incomplete — missing: ${missing.join(', ')} (corrupt install?)`);
|
|
@@ -164,11 +144,9 @@ const main = async () => {
|
|
|
164
144
|
process.exit(1);
|
|
165
145
|
}
|
|
166
146
|
await mkdir(target, { recursive: true });
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
),
|
|
171
|
-
);
|
|
147
|
+
for (const entry of PAYLOAD.filter((e) => existsSync(resolve(PKG_ROOT, e)))) {
|
|
148
|
+
copyTreeRefresh(resolve(PKG_ROOT, entry), resolve(target, entry), target);
|
|
149
|
+
}
|
|
172
150
|
console.log(`[agent-workflow-kit] ${wasPresent ? 'updated the kit to' : 'installed'} v${version} -> ${tildify(target)}`);
|
|
173
151
|
|
|
174
152
|
// Wire non-Claude agents — best-effort; the launcher only touches tools you have.
|
|
@@ -198,7 +176,12 @@ This command only installs/updates the kit itself (in ${tildify(target)}).
|
|
|
198
176
|
To update the kit later, re-run: npx @sabaiway/agent-workflow-kit@latest init`);
|
|
199
177
|
};
|
|
200
178
|
|
|
201
|
-
main().
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
179
|
+
// Run main() only when executed directly (npx / node bin/install.mjs), never on import — so tests
|
|
180
|
+
// can import this module to assert it has no side effects. Same idiom as tools/detect-backends.mjs.
|
|
181
|
+
const isDirectRun = process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
182
|
+
if (isDirectRun) {
|
|
183
|
+
main().catch((err) => {
|
|
184
|
+
console.error(err);
|
|
185
|
+
process.exit(1);
|
|
186
|
+
});
|
|
187
|
+
}
|
package/bin/install.test.mjs
CHANGED
|
@@ -5,9 +5,10 @@ import { mkdtemp, rm, mkdir, symlink, readdir } from 'node:fs/promises';
|
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import { tmpdir } from 'node:os';
|
|
7
7
|
import { dirname, join } from 'node:path';
|
|
8
|
-
import { fileURLToPath } from 'node:url';
|
|
8
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
9
9
|
|
|
10
10
|
const INSTALLER = join(dirname(fileURLToPath(import.meta.url)), 'install.mjs');
|
|
11
|
+
const KIT_ROOT = dirname(dirname(INSTALLER));
|
|
11
12
|
// --no-launchers so the test never wires Codex/Devin on the host.
|
|
12
13
|
const runInstaller = (target) =>
|
|
13
14
|
spawnSync(process.execPath, [INSTALLER, '--dir', target, '--no-launchers'], { encoding: 'utf8' });
|
|
@@ -64,3 +65,31 @@ describe('kit installer — payload + symlink-traversal hardening', () => {
|
|
|
64
65
|
assert.deepEqual(await readdir(real), []);
|
|
65
66
|
});
|
|
66
67
|
});
|
|
68
|
+
|
|
69
|
+
describe('kit installer — module hygiene', () => {
|
|
70
|
+
it('importing install.mjs runs nothing (main() is guarded by isDirectRun)', () => {
|
|
71
|
+
// `node -e` has no argv[1], so isDirectRun is false → importing must not run main()
|
|
72
|
+
// (no FS writes, no exit). A child process keeps the assertion off the test runner's own state.
|
|
73
|
+
const url = JSON.stringify(pathToFileURL(INSTALLER).href);
|
|
74
|
+
const res = spawnSync(
|
|
75
|
+
process.execPath,
|
|
76
|
+
['--input-type=module', '-e', `import(${url}).then(() => console.log('IMPORT_OK'));`],
|
|
77
|
+
{ encoding: 'utf8' },
|
|
78
|
+
);
|
|
79
|
+
assert.equal(res.status, 0, res.stderr);
|
|
80
|
+
assert.match(res.stdout, /IMPORT_OK/);
|
|
81
|
+
assert.doesNotMatch(res.stdout, /installed v|updated the kit/);
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
describe('kit installer — published tarball bundles the bridges', () => {
|
|
86
|
+
it('npm pack ships bridges/<name>/ (the execution-backend skill mirrors)', () => {
|
|
87
|
+
// The real `files` whitelist decides what publishes — assert against `npm pack`, not the source
|
|
88
|
+
// tree, so a dropped `bridges/` entry in package.json fails here (not silently at install time).
|
|
89
|
+
const res = spawnSync('npm', ['pack', '--dry-run', '--json'], { cwd: KIT_ROOT, encoding: 'utf8' });
|
|
90
|
+
assert.equal(res.status, 0, res.stderr || res.error?.message);
|
|
91
|
+
const paths = JSON.parse(res.stdout)[0].files.map((f) => f.path);
|
|
92
|
+
assert.ok(paths.includes('bridges/codex-cli-bridge/SKILL.md'), 'codex bridge SKILL.md not packed');
|
|
93
|
+
assert.ok(paths.includes('bridges/antigravity-cli-bridge/bin/agy.sh'), 'antigravity agy.sh not packed');
|
|
94
|
+
});
|
|
95
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: antigravity-cli-bridge
|
|
3
|
+
description: Delegate work to Google's Antigravity CLI (`agy`) — the successor to Gemini CLI — to reach Gemini, Claude, and GPT-OSS models under a Google AI Pro/Ultra subscription from the terminal. Use when the user wants to run a headless `agy` prompt, hand a focused task or second-opinion review to `agy`, install or authenticate Antigravity CLI, check or economise its quota/models, bridge project context into `agy`, set up a second delegated-execution backend beside Codex, or troubleshoot `agy` flags, models, auth, conversations, or its no-JSON headless behaviour.
|
|
4
|
+
metadata:
|
|
5
|
+
version: '1.0.0'
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# antigravity-cli-bridge
|
|
9
|
+
|
|
10
|
+
Bridges the main agent to **Antigravity CLI** (`agy`), Google's successor to Gemini CLI. As of
|
|
11
|
+
2026-06-18 the old Gemini CLI stopped serving Google AI Pro / Ultra / free tiers; terminal access to
|
|
12
|
+
Google's models moved to `agy`. This is a **delegated-execution backend** beside Codex: the main
|
|
13
|
+
agent stays the orchestrator — owning decisions, edits, verification, and user-facing claims — and
|
|
14
|
+
hands `agy` a bounded, self-contained sub-task answered from the **subscription** quota (no
|
|
15
|
+
pay-as-you-go billing). `agy` reaches Gemini, Claude, and GPT-OSS through one subscription, so it
|
|
16
|
+
serves as both a cheap probe engine (Flash) and a strong second opinion (Pro / Claude Thinking).
|
|
17
|
+
|
|
18
|
+
## Overview / when to use
|
|
19
|
+
|
|
20
|
+
Use this skill when the user wants to:
|
|
21
|
+
|
|
22
|
+
- Delegate a focused prompt to `agy` in headless mode.
|
|
23
|
+
- Use Gemini, Claude, or GPT-OSS access available through a Google AI Pro/Ultra subscription.
|
|
24
|
+
- Ask a second model to review a plan, summarise project context, or critique a diff supplied in the
|
|
25
|
+
prompt.
|
|
26
|
+
- Install, authenticate, smoke-test, or troubleshoot `agy`, or understand its models/flags/quota.
|
|
27
|
+
|
|
28
|
+
Do **not** use it to bundle secrets, bypass subscription auth, or hand uncontrolled repository
|
|
29
|
+
mutations to `agy`.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
Clean-machine setup is in [`setup/README.md`](setup/README.md). In short: the binary is **`agy`**
|
|
34
|
+
(not `antigravity`), installs to `~/.local/bin/agy`, and must be on `PATH`; expose this skill's
|
|
35
|
+
wrapper [`bin/agy.sh`](bin/agy.sh) on `PATH` as `agy-run`.
|
|
36
|
+
|
|
37
|
+
## Auth — subscription only (invariant)
|
|
38
|
+
|
|
39
|
+
`agy` authenticates with a cached **OAuth token** from a **Google AI Pro/Ultra** sign-in:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
~/.gemini/antigravity-cli/antigravity-oauth-token
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Never read, print, copy, commit, or package that token — it is personal and is **never bundled** with
|
|
46
|
+
this skill. The wrapper [`bin/agy.sh`](bin/agy.sh) **unsets every `*_API_KEY`** (`ANTIGRAVITY_API_KEY`,
|
|
47
|
+
`GEMINI_API_KEY`, `GOOGLE_API_KEY`, `GOOGLE_GENAI_API_KEY`) before invoking `agy`, so a stray key can
|
|
48
|
+
never silently switch you to pay-as-you-go billing.
|
|
49
|
+
|
|
50
|
+
**Caveat:** the subscription has a finite quota. Prefer the cheapest model that fits the task, and
|
|
51
|
+
keep probes short (see *How the main agent drives agy*).
|
|
52
|
+
|
|
53
|
+
## Models
|
|
54
|
+
|
|
55
|
+
Pass the **exact display string** to `--model` (or set `AGY_MODEL`). The wrapper defaults to
|
|
56
|
+
`Gemini 3.1 Pro (High)`. Run `agy models` for the live list — if it differs from this table, the live
|
|
57
|
+
list wins.
|
|
58
|
+
|
|
59
|
+
| Model string | Use it for |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `Gemini 3.5 Flash (Low)` | cheapest; reachability checks, smoke tests, simple transforms |
|
|
62
|
+
| `Gemini 3.5 Flash (Medium)` | cheap probes, context-reachability checks, quick summaries |
|
|
63
|
+
| `Gemini 3.5 Flash (High)` | fast drafting / review when a little more effort helps |
|
|
64
|
+
| `Gemini 3.1 Pro (Low)` | cheaper Pro pass for medium reasoning |
|
|
65
|
+
| `Gemini 3.1 Pro (High)` | wrapper default; hard reasoning, plan critique, architecture review |
|
|
66
|
+
| `Claude Sonnet 4.6 (Thinking)` | a Claude second opinion through the same subscription |
|
|
67
|
+
| `Claude Opus 4.6 (Thinking)` | strongest Claude reasoning available via `agy` |
|
|
68
|
+
| `GPT-OSS 120B (Medium)` | an open-weights cross-check / diversity pass |
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
Drive `agy` only through the wrapper [`bin/agy.sh`](bin/agy.sh) (installed on `PATH` as `agy-run`):
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
agy-run "your prompt" # prompt as an argument
|
|
76
|
+
echo "your prompt" | agy-run - # prompt from stdin
|
|
77
|
+
agy-run @path/to/prompt.md # prompt from a file
|
|
78
|
+
AGY_MODEL="Claude Opus 4.6 (Thinking)" agy-run "..." # pick a model
|
|
79
|
+
AGY_TIMEOUT=10m agy-run "..." # agy's soft --print-timeout
|
|
80
|
+
AGY_HARD_TIMEOUT=8m agy-run "..." # hard wall-clock cap via timeout(1)
|
|
81
|
+
agy-run "..." -- --add-dir . --dangerously-skip-permissions # passthrough agy flags
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
`agy` is **headless-only** here (`-p`/`--print`) and there is **no JSON output mode** in v1.0.10 — you
|
|
85
|
+
get plain text. If you need structure, ask for Markdown with explicit headings and validate it
|
|
86
|
+
yourself. Wrapper inputs: first argument is the prompt (`text`, `-` for stdin, or `@file`);
|
|
87
|
+
`AGY_MODEL` (default `Gemini 3.1 Pro (High)`); `AGY_TIMEOUT` → `--print-timeout` (default `5m`);
|
|
88
|
+
`AGY_HARD_TIMEOUT` → hard `timeout(1)` wall-clock cap (default = `AGY_TIMEOUT`); extra `agy` flags
|
|
89
|
+
after `--`. Full detail: [`references/models-and-flags.md`](references/models-and-flags.md).
|
|
90
|
+
|
|
91
|
+
## Project context (how `agy` sees the repo)
|
|
92
|
+
|
|
93
|
+
From its **current working directory** `agy` reads one root context file by priority, plus
|
|
94
|
+
per-workspace skills:
|
|
95
|
+
|
|
96
|
+
```text
|
|
97
|
+
.antigravity.md > GEMINI.md > AGENTS.md
|
|
98
|
+
.agents/skills/
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
So when you run `agy-run` from a project root, `agy` loads the **highest-priority context file that
|
|
102
|
+
exists** — in most repos that is `AGENTS.md`, so its Hard Constraints are available — plus the
|
|
103
|
+
project's `.agents/skills/`, with no wiring needed. **A `.antigravity.md` or `GEMINI.md`, if present,
|
|
104
|
+
shadows `AGENTS.md`** (only the winning file is read), so put cross-cutting rules in whichever file
|
|
105
|
+
wins, or include them in the prompt. Probe results in a real repo confirmed `agy` read the root
|
|
106
|
+
`AGENTS.md` (returning the dialogue language + a Hard Constraint) and cited
|
|
107
|
+
`.agents/skills/<skill>/SKILL.md` by path.
|
|
108
|
+
|
|
109
|
+
**Honest scope:** these probes prove *reachability* — `agy` surfaces the cwd context file and
|
|
110
|
+
per-workspace skills by directory scan. In testing it also **named a project-specific skill without
|
|
111
|
+
being pointed at any file** (auto-discovery), but that is `agy`'s own mechanism, not a guaranteed
|
|
112
|
+
Claude-style description-dispatch engine; don't promise more than the probe shows in a given repo.
|
|
113
|
+
Re-runnable from a project root (use a cheap model):
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
AGY_MODEL="Gemini 3.5 Flash (Low)" agy-run \
|
|
117
|
+
"Read the cwd context file and state the dialogue language plus one Hard Constraint, in two lines."
|
|
118
|
+
AGY_MODEL="Gemini 3.5 Flash (Low)" agy-run \
|
|
119
|
+
"Without me pointing you at any file, name a project-specific skill under .agents/skills/ here and cite its path."
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## How the main agent drives `agy` efficiently
|
|
123
|
+
|
|
124
|
+
See [`references/driving-agy.md`](references/driving-agy.md) for the full playbook (delegation
|
|
125
|
+
checklist, prompt templates, output handling). Essentials:
|
|
126
|
+
|
|
127
|
+
- **Pick the cheapest model that fits.** Flash (Low/Medium) for reachability/probes; Pro (High) for
|
|
128
|
+
reasoning; `Claude Sonnet 4.6 (Thinking)`, `Claude Opus 4.6 (Thinking)`, or `GPT-OSS 120B (Medium)`
|
|
129
|
+
for a different engine's opinion (exact strings — see the Models table) — all on the same
|
|
130
|
+
subscription. Quota is finite, so don't reach for Pro by reflex.
|
|
131
|
+
- **Hand `agy` a self-contained prompt.** It cannot see your conversation — embed the goal,
|
|
132
|
+
constraints, relevant excerpts, and the expected output shape; nothing more.
|
|
133
|
+
- **Continue a thread** with `-- --continue` (most recent) or `-- --conversation <id>` (by id) instead
|
|
134
|
+
of re-sending context.
|
|
135
|
+
- **Treat output as advisory** and verify before acting — check claims against local files, re-run
|
|
136
|
+
tests/linters yourself, reject advice that conflicts with user instructions or repo rules.
|
|
137
|
+
- **Escalations are done by hand, not by `agy`.** The wrapper passes no `--add-dir`, no
|
|
138
|
+
`--dangerously-skip-permissions`, and no `--sandbox` — but that is a **policy boundary you state in
|
|
139
|
+
the prompt, not an enforced sandbox**. Keep repo edits, new dependencies/network installs, and git
|
|
140
|
+
writes (branch/add/commit/stash/reset/rewrite) with the orchestrator, and tell `agy` in the prompt
|
|
141
|
+
to return findings only. Add `-- --sandbox` when delegating anything that could trigger
|
|
142
|
+
terminal/tool work; opt into `-- --add-dir . --dangerously-skip-permissions` only for a flow that
|
|
143
|
+
genuinely needs writes, then review the diff afterwards.
|
|
144
|
+
|
|
145
|
+
## Complementary skills (optional, standalone-first)
|
|
146
|
+
|
|
147
|
+
`agy-run` works in any directory where `agy` is installed and authenticated. The two skills below are
|
|
148
|
+
**not required** to use `agy` — surface them only when they actually help.
|
|
149
|
+
|
|
150
|
+
- **`agent-workflow-memory`** (family **context provider**) — if the current project has **no**
|
|
151
|
+
`AGENTS.md` + `docs/ai/`, `agy` has no per-workspace context to read. The memory substrate creates
|
|
152
|
+
it. Soft-recommend it (only when the user wants the memory workflow):
|
|
153
|
+
`npx @sabaiway/agent-workflow-memory init`, then `/agent-workflow-memory` in the project — or
|
|
154
|
+
bootstrap the whole family via the **`agent-workflow-kit`** orchestrator
|
|
155
|
+
(`npx @sabaiway/agent-workflow-kit init`), which delegates substrate deployment to memory. Never a
|
|
156
|
+
prerequisite for using `agy`.
|
|
157
|
+
- **`codex-cli-bridge`** (sibling backend, OpenAI Codex) — recommend **by actual presence**: if
|
|
158
|
+
`~/.claude/skills/codex-cli-bridge/` exists you have a **second delegated engine** (Codex for
|
|
159
|
+
sandboxed repo edits with gates; `agy` for subscription-quota Gemini/Claude reasoning). If it is
|
|
160
|
+
**not** installed, treat it as a **planned sibling** — don't assume it exists.
|
|
161
|
+
|
|
162
|
+
## Known limitations
|
|
163
|
+
|
|
164
|
+
- Subdirectory `CLAUDE.md` files are **not** auto-loaded by `agy` (only the cwd context file +
|
|
165
|
+
`.agents/skills/`). Put cross-cutting rules in the root context file, or include local rules in the
|
|
166
|
+
prompt when they matter.
|
|
167
|
+
- **No JSON output** and **no `agy inspect`** in v1.0.10 — parse text; there is no machine-readable
|
|
168
|
+
introspection.
|
|
169
|
+
- Model names must match the `agy models` display strings **exactly**.
|
|
170
|
+
- **Quota is finite.** Heavy use of Pro/Claude models can exhaust the subscription; prefer Flash for
|
|
171
|
+
cheap work.
|
|
172
|
+
- **A run can't hang forever.** The wrapper caps `agy` with `timeout(1)` (`AGY_HARD_TIMEOUT`,
|
|
173
|
+
default = `AGY_TIMEOUT`) because `agy`'s own `--print-timeout` is **not** a reliable wall-clock
|
|
174
|
+
kill (a run was seen surviving 32 min past a 10m `--print-timeout`). A heavy `--add-dir` agentic
|
|
175
|
+
prompt on the slowest model (`Gemini 3.1 Pro (High)`) can run unbounded — prefer a faster model or
|
|
176
|
+
a **self-contained prompt** (no `--add-dir`); an "exceeded the hard cap" error is the guard firing.
|
|
177
|
+
- `agy` output is plain text and may be incomplete or out of date — treat it as advisory until the
|
|
178
|
+
main agent verifies it.
|