agent-profile-kit 0.204.1

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.
@@ -0,0 +1,635 @@
1
+ # Agent Profile Kit Workspace guide
2
+
3
+ Agent Profile Kit keeps your reusable, cross-project agent material in one
4
+ Workspace. The Workspace is the single canonical source. Profiles select a flat
5
+ set of portable artifacts for a kind of work. The Installer installs each bound
6
+ Profile into explicitly bound projects as disposable, Host-native output.
7
+ Supported Hosts then load that material through ordinary project discovery.
8
+
9
+ Keep project facts in the relevant project repository. Keep Host preferences,
10
+ authentication, credentials, and machine-specific values outside the Workspace.
11
+ Edit Workspace files and Local Configuration directly.
12
+
13
+ ## Universal Workspace material
14
+
15
+ Source ownership and managed delivery are separate:
16
+
17
+ - The **Workspace** may canonically own both Profile-selected artifacts and
18
+ **unselected universal** artifacts (material useful across every directory or
19
+ kind of work, not only one Profile’s selection). Leaving an artifact unselected
20
+ by every Profile does not make it invalid and does not move its canonical
21
+ source into Host configuration.
22
+ - **Profiles** select the artifacts scoped to a kind of work for Agent Profile
23
+ Kit–managed project-bound delivery. A Project Binding selects a project root,
24
+ one Profile, and Hosts; only selected (and Dependency-resolved) artifacts from
25
+ that Profile enter Installation Receipts and the managed lifecycle
26
+ (`status`, `update`, and `uninstall`).
27
+ - Agent Profile Kit v1 does not install, project, synchronize, or remove material in
28
+ personal/global Host roots. Global Host delivery is not APK-owned state: it is
29
+ outside Project Bindings and Installation Receipts, and `update` / `uninstall`
30
+ never adopt, record as managed output, or mutate those paths. `status` does not
31
+ treat global roots as managed output.
32
+ - You may still manage native global delivery yourself—for example by symlinking
33
+ a Host Skill root entry to canonical Workspace source—but that delivery is
34
+ user-managed Host configuration, not Agent Profile Kit–owned state. Agent
35
+ Profile Kit never adopts, tracks, or uninstalls those global paths.
36
+ - A Skill may be both universally delivered through Host configuration and
37
+ selected into a bound Profile. The Host owns discovery, precedence,
38
+ deduplication, collision diagnostics, and resolution between those sources.
39
+ Agent Profile Kit blocks only an exact planned destination it cannot safely
40
+ own, not same-identity material elsewhere.
41
+
42
+ ## Initialize
43
+
44
+ `apkit init` creates an empty, schema-versioned Workspace at the
45
+ fixed default path `~/.agents/agent-profile-kit/workspace/` and a version-2
46
+ machine-local Local Configuration at `~/.agents/agent-profile-kit/config.yaml`
47
+ that explicitly records that path when Local Configuration is absent. Pass one
48
+ explicit absolute or home-relative path to choose another destination:
49
+
50
+ ```sh
51
+ apkit init ~/projects/agent-profile-workspace
52
+ ```
53
+
54
+ When Local Configuration is absent, an explicit missing or empty non-symlink
55
+ destination is fully scaffolded and recorded. A valid existing Workspace,
56
+ including a symlink alias, is adopted without changing its source. Rerunning is
57
+ safe: it never overwrites the Workspace or current configuration, and it does
58
+ not restore optional scaffolding that you removed from a valid Workspace.
59
+
60
+ To keep the Workspace as an independent Git repository elsewhere, set the
61
+ required `workspace` field in Local Configuration to one existing absolute or
62
+ home-relative path that already contains a valid `workspace.yaml`:
63
+
64
+ ```yaml
65
+ schema_version: 2
66
+ workspace: ~/projects/agent-profile-workspace
67
+ bindings: []
68
+ ```
69
+
70
+ Symlinks are supported; relative paths and wildcards are not. When Local
71
+ Configuration already selects a Workspace, an explicit `init <workspace>` path
72
+ must resolve to that same canonical directory, including through an alias;
73
+ otherwise initialization fails closed without changing either source or
74
+ configuration. Zero-argument `init` validates the selected custom path and does
75
+ not create, move, copy, adopt, or repair it. Initialization never migrates
76
+ Workspace source automatically.
77
+
78
+ The current Workspace schema version is 1. Its root `workspace.yaml` contains
79
+ only `schema_version: 1`. Local Configuration schema version is 2 and its
80
+ `workspace` field is required.
81
+
82
+ ### Legacy Local Configuration migration and version compatibility
83
+
84
+ Version-1 Local Configuration without `workspace` is supported only as migration
85
+ input. Run `apkit init` to upgrade it before using `validate`, `status`, `update`,
86
+ `install`, or `uninstall`. Those commands never migrate
87
+ the file implicitly: they fail closed with actionable `apkit init`
88
+ guidance while leaving migration to the explicit `init` command.
89
+
90
+ For a legacy file that omitted `workspace`, migration records the conventional
91
+ default `~/.agents/agent-profile-kit/workspace/`. For a legacy file with an
92
+ authored path, migration preserves that path. `init` validates the selected
93
+ Workspace before atomically replacing only Local Configuration, preserving
94
+ Project Bindings, comments, line endings, and file mode; it never moves or
95
+ rewrites Workspace source. If validation fails, the configuration remains
96
+ unchanged.
97
+
98
+ Before migrating, make and retain a copy of the version-1 Local Configuration:
99
+
100
+ ```sh
101
+ config_dir="$HOME/.agents/agent-profile-kit"
102
+ cp -p "$config_dir/config.yaml" "$config_dir/config.yaml.before-schema-v2"
103
+ ```
104
+
105
+ Keep this backup until the current CLI has been validated in normal use.
106
+ To roll back to an older binary that understands only version-1 configuration,
107
+ stop using the current CLI, restore the copy, and run that older binary:
108
+
109
+ <!-- historical-command-excerpts:start -->
110
+ ```sh
111
+ config_dir="$HOME/.agents/agent-profile-kit"
112
+ cp -p "$config_dir/config.yaml.before-schema-v2" "$config_dir/config.yaml"
113
+ agent-profile-kit validate
114
+ ```
115
+ <!-- historical-command-excerpts:end -->
116
+
117
+ The restored file preserves the pre-migration Workspace selection and Project
118
+ Bindings. This reverses only the Local Configuration schema transition; it does
119
+ not undo later Workspace content changes.
120
+
121
+ ### Required structure vs initialization scaffolding
122
+
123
+ A valid Workspace needs only a supported `workspace.yaml`. That Manifest is the
124
+ Workspace marker. Missing artifact directories are treated as empty categories;
125
+ present ones are validated and ingested normally. `README.md`, `AGENTS.md`, and
126
+ `.gitignore` are optional user-owned files that the engine never requires.
127
+
128
+ When creating a **new** Workspace, `init` still scaffolds a friendly layout so
129
+ you can discover where material belongs:
130
+
131
+ - artifact directories `profiles/`, `context/`, `skills/`, `agents/`, `hooks/`,
132
+ and `tools/` (with `.gitkeep` placeholders)
133
+ - a bindable `profiles/example.yaml` and its `context/example-context.md`
134
+ - short bootstrap `README.md` and `AGENTS.md` pointers to the current guides
135
+ - a starter `.gitignore`
136
+
137
+ The example gives a new user one complete `install` → `status` → `update` path.
138
+ Delete both `profiles/example.yaml` and `context/example-context.md` together,
139
+ unused empty directories, or bootstrap docs if you prefer a minimal tree;
140
+ later `init` runs do not restore removed optional scaffolding; validation,
141
+ status, update, and uninstall keep working. Do not treat generated Host
142
+ output as source material.
143
+
144
+ ## Author the Workspace
145
+
146
+ This release supports Profile Context and Context Modules for Antigravity,
147
+ Codex, Claude Code, Grok, OpenCode, and Pi, and portable Skills for Antigravity,
148
+ Codex, Claude Code, Grok, OpenCode, and Pi. Antigravity Context uses `.agents/rules/`;
149
+ Antigravity, Codex, OpenCode, and Pi Skills install through the qualified shared
150
+ `.agents/skills/<Artifact ID>/` projection after project-surface capability checks;
151
+ Pi and OpenCode resolve other Skills, extensions, and packages through native
152
+ Host behavior.
153
+ Disabled model-invocation Skills are projected with the shared
154
+ `disable-model-invocation: true` field while explicit `/skill:<Artifact ID>`
155
+ activation (or OpenCode `/<Artifact ID>` command activation) remains available.
156
+ Profiles contain only `id`, `context`, and `skills`; Agents, Hooks, and Tools
157
+ are not delivered by this release. A Profile must select at least one supported
158
+ artifact overall (Context Module, Skill, or both); no individual category is
159
+ mandatory. Context-only, Skills-only, and combined Profiles are valid.
160
+
161
+ A Context Module is a Markdown file under `context/` with frontmatter containing
162
+ one stable, lowercase kebab-case `id`; the Markdown body is the Context. A Skill
163
+ is a standard Agent Skills package under `skills/`, rooted at `SKILL.md`; its
164
+ standard `name` is its stable Artifact ID. The frontmatter needs a lowercase
165
+ hyphenated `name` and a non-empty `description`. Scripts, references, and assets
166
+ remain ordinary standard Skill content. If a Skill needs Agent Profile Kit-only
167
+ dependency metadata, put it in an optional `agent-profile-kit.yaml` sidecar.
168
+
169
+ ### Skill model-invocation policy
170
+
171
+ By default, Hosts may invoke a Skill implicitly when the model matches its
172
+ description. To require explicit user invocation while keeping the Skill
173
+ available on request, set optional standard namespaced metadata:
174
+
175
+ ```yaml
176
+ metadata:
177
+ agent-profile-kit.model-invocation: disabled
178
+ ```
179
+
180
+ Accepted values are the strings `allowed` and `disabled`. Absence normalizes to
181
+ `allowed`. Invalid types or values fail at Workspace ingestion.
182
+
183
+ This is the only portable spelling. Host-native top-level
184
+ `disable-model-invocation` and Codex-only `agents/openai.yaml` policy are not
185
+ canonical source fields for Agent Profile Kit: migrate Host-shaped Skills to
186
+ the namespaced metadata key above rather than relying on Host-specific
187
+ frontmatter. The Installer never rewrites Workspace `SKILL.md` during
188
+ validate, status, or update.
189
+
190
+ Adapters translate the trusted policy only in generated Host output:
191
+
192
+ | Canonical policy | Claude / Grok generated output | Antigravity / Codex / OpenCode / Pi shared output |
193
+ | --- | --- | --- |
194
+ | `allowed` (default) | No Host restriction field | No Host restriction field |
195
+ | `disabled` | `disable-model-invocation: true` in generated `SKILL.md` | `disable-model-invocation: true` in generated `SKILL.md` plus `policy.allow_implicit_invocation: false` in generated `agents/openai.yaml` and `"permission": { "skill": { "<id>": "deny" } }` in generated `.opencode/opencode.jsonc` |
196
+
197
+ Existing source `agents/openai.yaml` content is preserved. An equivalent
198
+ invocation policy coalesces; malformed, wrong-type, or conflicting policy
199
+ produces one structured project Blocker naming the Workspace and shared
200
+ Host-policy authorities with a Workspace repair remedy before any project write. Generated
201
+ policy fields carry short deterministic comments. When any selected Skill
202
+ disables model invocation, update-time capability probing checks each selected
203
+ Host's enforcement floor: Claude Code CLI
204
+ `2.0.64+` (same floor as unscoped rules and native Skill discovery, which
205
+ honors `disable-model-invocation`), Grok CLI `0.2.0+` (same floor as project
206
+ rules and native Skill discovery, which honors `disable-model-invocation`),
207
+ Codex CLI `0.99.0+` (first stable release with `agents/openai.yaml`
208
+ `policy.allow_implicit_invocation`; see openai/codex#11244 / rust-v0.99.0),
209
+ OpenCode CLI `1.18.23+` (filters denied Skills from model inventory while
210
+ leaving native command activation available), and Pi CLI `0.82.1+` (honors
211
+ `disable-model-invocation: true` in `SKILL.md`).
212
+ OpenCode records `native-project-instructions-skills-invocation-v1` for
213
+ explicit-only Skill enforcement or `native-project-instructions-skills-v1` for
214
+ baseline allowed Skills. Pi records `native-project-shared-skills-invocation-v1`
215
+ for Skills-only or `native-project-append-system-shared-skills-invocation-v1`
216
+ for combined Profiles. Antigravity records `native-project-shared-skills-invocation-v1`
217
+ or `native-project-always-on-rules-shared-skills-invocation-v1` for the same two
218
+ shapes. Probing is advisory: an older, missing, or unreadable CLI produces a
219
+ warning, and the planned policy fields are written regardless — the Adapter
220
+ never silently omits or weakens what it plans.
221
+
222
+ Artifacts may declare required Dependencies with explicit typed references. Put
223
+ Context Module Dependencies in their frontmatter and Skill Dependencies in each
224
+ Skill's Agent Profile Kit sidecar. Each reference contains `type` (`context` or
225
+ `skill`) and its stable `id`. Dependencies are resolved transitively and every resolved reason remains
226
+ available in live planning. Inclusion reasons are not
227
+ persisted in Installation State.
228
+
229
+ A Profile is a YAML file under `profiles/` with exactly an `id`, a `context`
230
+ array, and a `skills` array. At least one of `context` or `skills` must be
231
+ non-empty. A Skills-only Profile installs only selected Skill packages for Hosts that
232
+ support them and Installer lifecycle metadata—no Context snapshot, Codex
233
+ SessionStart hooks, or Claude Context rule. Antigravity Skills-only bindings
234
+ check only the shared `.agents` and `.agents/skills` surfaces. Host capability
235
+ probing is scoped to the selected categories (Skills-only does not require Context
236
+ machinery). Profiles do not inherit, use wildcards, or carry Host settings.
237
+
238
+ ```md
239
+ ---
240
+ id: engineering-rules
241
+ dependencies:
242
+ - type: context
243
+ id: security-rules
244
+ ---
245
+ Keep project facts in the project repository.
246
+ ```
247
+
248
+ ```yaml
249
+ # skills/review-pr/agent-profile-kit.yaml
250
+ dependencies:
251
+ - type: skill
252
+ id: write-release-notes
253
+ ```
254
+
255
+ ```yaml
256
+ id: coding
257
+ context:
258
+ - engineering-rules
259
+ skills:
260
+ - review-pr
261
+ ```
262
+
263
+ ```md
264
+ <!-- skills/review-pr/SKILL.md -->
265
+ ---
266
+ name: review-pr
267
+ description: Review a pull request. Use when asked to review code changes.
268
+ ---
269
+
270
+ # Review a pull request
271
+ ```
272
+
273
+ ```md
274
+ <!-- skills/to-spec/SKILL.md — explicit-only invocation -->
275
+ ---
276
+ name: to-spec
277
+ description: Turn the current conversation into a spec.
278
+ metadata:
279
+ agent-profile-kit.model-invocation: disabled
280
+ ---
281
+
282
+ # To spec
283
+ ```
284
+
285
+ ## Bind projects in Local Configuration
286
+
287
+ Project Bindings live only in machine-local
288
+ `~/.agents/agent-profile-kit/config.yaml`. Each binding names exactly one
289
+ existing absolute or home-relative project root, one Profile, and a non-empty set
290
+ of supported Hosts (`antigravity`, `codex`, `claude`, `grok`, `opencode`, `pi`). Host order
291
+ and duplicate entries normalize at ingestion. There are no wildcards, recursive scans,
292
+ hidden default projects, Host auto-detection, per-session Profile selection, or
293
+ Profile version pins. A project root may appear in only one binding.
294
+
295
+ Hand-edit `config.yaml`, or record one binding and install it in one action
296
+ with `apkit install` (confirms interactively; `--auto-confirm` answers it):
297
+
298
+ ```sh
299
+ apkit install coding --host codex --auto-confirm
300
+ apkit install coding ~/projects/tools/agent-profile-kit --host antigravity --host codex --host claude --host grok --host opencode --host pi --auto-confirm
301
+ ```
302
+
303
+ Omit the project argument to use the current working directory. At least one
304
+ `--host` flag is required. An identical installation is left unchanged; a different
305
+ Profile or Host set for the same project replaces the installation in the same
306
+ action. Do not
307
+ hand-edit `config.yaml` while `install` is running: cooperating lifecycle commands
308
+ serialize, but a text editor does not participate in that lock. Installing a
309
+ Profile also verifies its generated output; run `validate` for Workspace checks
310
+ and `status` to review installation state.
311
+
312
+ Remove one installation and forget its recorded selection with an explicit scope:
313
+
314
+ ```sh
315
+ apkit uninstall --here --auto-confirm
316
+ apkit uninstall --project ~/projects/tools/agent-profile-kit --auto-confirm
317
+ ```
318
+
319
+ Scope is explicit (`--here`, `--project <path>`, or `--all`, mutually exclusive); add `--profile <name>` to intersect, `--remove-changed` to authorize deletion of independently changed generated files, and `--auto-confirm` to answer the confirmation non-interactively. Existing
320
+ paths use the same canonical-root rules as bindings, including symlink aliases.
321
+ When a project no longer exists, `uninstall --project` still forgets its selection only when the
322
+ argument exactly matches its authored `project` spelling; it never guesses an
323
+ alias. A fully removed Project is forgotten only after its output removal succeeds, so a later `update` does not reinstall it. Cooperating lifecycle commands
324
+ serialize; do not hand-edit the file concurrently.
325
+
326
+ ```yaml
327
+ schema_version: 1
328
+ bindings:
329
+ - project: ~/projects/tools/agent-profile-kit
330
+ profile: coding
331
+ hosts:
332
+ - codex
333
+ - claude
334
+ - project: /Users/you/work/customer-portal
335
+ profile: coding
336
+ hosts:
337
+ - claude
338
+ ```
339
+
340
+ ## Validate, status, and update
341
+
342
+ For Codex bindings that select Context, the Adapter requires Codex CLI 0.145.0 or
343
+ newer so the generated SessionStart handler can deliver the complete Context
344
+ envelope without Codex's default head-and-tail spill. Host capability probing is
345
+ advisory: during `update`, an older, missing, or unreadable Codex CLI produces a
346
+ warning while the planned project and Installation State writes proceed
347
+ regardless. `status` performs no Agent Host process execution and no capability
348
+ probing; a Project-scoped `status` or `update` plans only its
349
+ selected binding. `update --all` writes every selected Project including any with
350
+ Host capability warnings; global Blockers still stop every fleet write.
351
+ Skills-only Codex bindings do
352
+ not require this floor. Review and trust the generated project SessionStart hook
353
+ in Codex for each bound project. Lifecycle hooks are enabled by default. Agent Profile Kit checks the effective global and project configuration
354
+ during update and warns when hooks are explicitly disabled, when relevant
355
+ configuration is malformed or unreadable, or when `hooks` or the deprecated
356
+ `codex_hooks` alias is not a boolean. These warnings do not block installation,
357
+ but generated Context may not load until the setting is corrected. Project configuration takes
358
+ precedence over global configuration. If `CODEX_HOME` is set, Codex reads its
359
+ global configuration from `CODEX_HOME/config.toml`; otherwise it uses
360
+ `~/.codex/config.toml`. Skills-only Codex bindings do not require hooks.
361
+
362
+ Run `apkit validate` to check the Workspace and every Project Binding.
363
+ Review the concise read-only reconciliation outcome with
364
+ `apkit status`. It leads with whether reconciliation can proceed,
365
+ groups changes and blockers by Profile Installation, and summarizes
366
+ changed file paths with `+`, `~`, `-`, or `!` markers without listing unchanged
367
+ output. Long lists are capped with an overflow pointer to `--verbose`.
368
+ Non-current Profile Installation states such as `stale source`, `blocked`, or
369
+ `removal` get a short explanation when present (once per distinct state across
370
+ installations). Pending Git exclusion work appears as one concise clause; exact
371
+ targets and path changes are reserved for `--verbose`. When action is
372
+ useful, concise results end with one next-action line derived from the same
373
+ attention surface as the report body: actionable `status` points directly to the
374
+ matching update command; a ready fleet `status --all` recommends `update --all`; a
375
+ blocked result tells you to resolve the reported blocker and retry the same
376
+ command you just ran; current status and completed or no-op `update` results omit
377
+ a next step. `status` and `update` target the complete fleet by default. Narrow
378
+ the scope with `--here` for the bound Project containing the current working
379
+ directory, one explicit existing absolute or home-relative bound Project root,
380
+ or `--project <path>`; `--all` states the fleet scope explicitly. Scoped
381
+ planning, Git and ownership inspection, reconciliation, reports,
382
+ and writes exclude unrelated Projects; a shared Git exclusion file changes only
383
+ through the selected installation's contribution-aware union. Host capability
384
+ probing is advisory and happens only during `update`: a missing or outdated Host
385
+ CLI produces a warning and the planned output is written regardless; capability
386
+ problems never block application and do not mark generated files as drifted.
387
+
388
+ `apkit update` refreshes the installed Context and Skills in your Projects from
389
+ the Workspace; it does not upgrade the `apkit` executable itself.
390
+
391
+ For focused per-output and state diagnostics, append `--verbose` to `status` or `update`. Warnings, blockers, drift reasons, and removal
392
+ intent remain visible in the concise view. Git-tracked-path blockers explain
393
+ that repository-owned content is not replaced because generated Profile
394
+ Installation output must be exclusively Installer-owned.
395
+
396
+ Git is optional. For a Git binding, `update` installs only into the exact bound
397
+ project directory. The Installer uses Git for tracked-path protection and local
398
+ exclusions but does not inspect or report worktree topology. Bind any additional
399
+ root explicitly only when Hosts must be launched directly from that root; it
400
+ then follows the same lifecycle as any other binding.
401
+
402
+ For every bound project root, the ordinary removal order is:
403
+
404
+ ```sh
405
+ apkit uninstall --project /path/to/project --auto-confirm
406
+ # Now delete the project directory.
407
+ ```
408
+
409
+ If the project directory was deleted first, run `uninstall --project` with its exact authored
410
+ path. That explicit action confirms the deletion was intentional; it forgets the machine-local selection without attempting
411
+ project filesystem deletion and cleans any separately surviving local Git
412
+ exclusions whose ownership was recorded. Restoring the project later requires a
413
+ new `install`.
414
+
415
+ Generated output is owned whole: complete files and artifact directories whose
416
+ Installation Receipt proves Agent Profile Kit ownership, with the receipt's
417
+ recorded hashes providing the continuity evidence that extant material is what
418
+ Agent Profile Kit last published. Generated instructions open with a short
419
+ notice stating that apkit generated them, that lasting edits belong in the
420
+ Workspace, and that `install`, `update`, and `uninstall` replace or remove an
421
+ independently changed generated file only with your explicit consent. The
422
+ claimed OpenCode configuration file carries the same generated-source notice
423
+ with project-file guidance instead of the Workspace pointer. Supporting Skill
424
+ resources keep their bytes. See ADR-0041. Unrelated project files,
425
+ repository-owned instructions, global Host configuration, authentication, trust,
426
+ approvals, plugins, and sessions remain untouched. Agent Profile Kit does not
427
+ merge selected fields into Host or repository configuration, install a watcher or
428
+ Git hook, or modify shared `.gitignore` files.
429
+
430
+ For a currently bound installation, `update` recreates a
431
+ recorded output that is completely missing when normal path-conflict checks
432
+ pass. Modified output is ordinary refresh work while at least one recorded root
433
+ still matches its recorded hash; when no recorded root matches, ownership
434
+ continuity cannot be proven and `status` blocks until you restore or remove the
435
+ generated files. Unexpected directory members are never overwritten.
436
+
437
+ ## Use Hosts natively
438
+
439
+ After `update`, launch Antigravity, Codex, Claude Code, Grok, OpenCode, or Pi from the
440
+ bound project the way you normally would. Agent Profile Kit does not manage their
441
+ authentication, trust, approvals, plugins, or sessions, and does not launch
442
+ Hosts.
443
+
444
+ ### Antigravity
445
+
446
+ Antigravity receives Profile Context through deterministic always-on rules under
447
+ `.agents/rules/`. The Adapter requires `agy` CLI 1.1.13 or newer and writes one
448
+ rule for the Profile envelope followed by one complete rule per Context Module.
449
+ Each generated rule contains `trigger: always_on` frontmatter and must stay at or
450
+ below 12,000 characters. If one Context Module is too large, status reports a
451
+ structured blocker instead of truncating it.
452
+
453
+ Antigravity discovers the rules from the current bound project; you do not need
454
+ to create or select an Antigravity Project. Trust is Host-owned: after `update`,
455
+ trust the bound project in Antigravity if it asks. Agent Profile Kit does not
456
+ read or change trust, settings, authentication, plugins, Project records,
457
+ `AGENTS.md`, or `GEMINI.md`. A standing trust reminder appears for every
458
+ non-empty Antigravity plan, but unproven trust never blocks safe writes.
459
+
460
+ Antigravity also discovers selected Skills through the qualified shared
461
+ `.agents/skills/<Artifact ID>/` projection used by Codex and Pi. The complete
462
+ package preserves standard members — with the generated-source notice opening
463
+ each `SKILL.md` body after frontmatter (ADR-0041) — and, for disabled Skills,
464
+ both the generated `disable-model-invocation: true` field and Codex
465
+ `agents/openai.yaml` policy.
466
+ Antigravity's native discovery, trust, settings, and effective inventory remain
467
+ Host-owned.
468
+
469
+ ### Codex
470
+
471
+ Codex receives the complete Profile Context through a native project SessionStart hook and
472
+ discovers selected Skills under `.agents/skills/<Artifact ID>/`. When Context is
473
+ installed, Codex asks you to review the generated hook: review its contents and
474
+ approve it when they match the expected SessionStart behavior, because declining
475
+ it prevents Profile Context from loading. Before launching Codex,
476
+ trust each bound project in Codex — project trust is Host-owned and is not
477
+ configured by Agent Profile Kit.
478
+ Ordinary launches from a Git project's bound directory or its descendants receive
479
+ that material. For a non-Git project, launch Codex from the exact bound root;
480
+ launching from a descendant prevents Profile Context from loading. Skills-only
481
+ Codex Profiles generate no hook and require no hook approval.
482
+
483
+ ### Claude Code
484
+
485
+ Claude Code receives Profile Context as an unscoped owned project rule under
486
+ `.claude/rules/` and discovers selected Skills under
487
+ `.claude/skills/<Artifact ID>/`. Ordinary Claude launches in the bound project
488
+ load that material. Claude project rules do not depend on Git.
489
+
490
+ ### Pi
491
+
492
+ Pi receives Profile Context through the owned project file
493
+ `.pi/APPEND_SYSTEM.md`. The Pi Adapter requires CLI 0.82.1 or newer and
494
+ proves that `.pi` and the append-system destination are compatible before
495
+ Context writes; Skill-bearing Profiles instead prove the shared `.agents` and
496
+ `.agents/skills` surfaces. Profiles with portable Skills receive one shared
497
+ package per resolved Artifact ID under `.agents/skills/<Artifact ID>/`;
498
+ standard package bytes and modes are preserved apart from the generated-source
499
+ notice that opens each projected `SKILL.md` body (ADR-0041), and
500
+ `agent-profile-kit.yaml` is omitted. Codex and Pi co-own one normalized package when both are selected;
501
+ the package carries every required Host policy field without adding consumer
502
+ metadata to Skill source. Pi owns Skill resolution across personal, project,
503
+ ancestor, package, extension, and configured sources. Disabled
504
+ model-invocation Skills receive top-level `disable-model-invocation: true` in
505
+ generated `SKILL.md` while the canonical Workspace source remains unchanged
506
+ and explicit `/skill:<Artifact ID>` activation remains available. Malformed or
507
+ unreadable relevant settings warn without blocking. Pi's native project trust,
508
+ authentication, settings, prompt files, and per-session overrides remain
509
+ Host-owned.
510
+
511
+ ### OpenCode
512
+
513
+ OpenCode receives Profile Context through the owned composed Context document
514
+ at `.agent-profile-kit/opencode/context.md` and references it through the
515
+ additive `instructions` list inside the claimed configuration file at
516
+ `.opencode/opencode.jsonc`. OpenCode combines this configuration with
517
+ user-authored slots via native additive merging, and the Project-relative
518
+ reference continues to load Context when OpenCode is launched from any subdirectory.
519
+ The OpenCode Adapter requires CLI 1.18.23 or newer. When configuration is planned
520
+ (Context or disabled Skills), the Adapter emits one transition launch-constraint
521
+ Host Setup Step tied to `.opencode/opencode.jsonc` reminding you to restart
522
+ running OpenCode sessions.
523
+
524
+ OpenCode discovers selected Skills through the qualified shared
525
+ `.agents/skills/<Artifact ID>/` projection used by Antigravity, Codex, and Pi.
526
+ When trusted model-invocation policy is `disabled`, the OpenCode Adapter
527
+ configures an Artifact-ID-keyed global Skill permission rule with action `deny`
528
+ inside `.opencode/opencode.jsonc`. OpenCode filters denied Skills from the
529
+ model-facing inventory while native Command activation (`/<Artifact ID>`)
530
+ remains available. When Claude and OpenCode are co-selected in a Project Binding
531
+ with Skills, OpenCode natively discovers Skills under both `.claude/skills` and
532
+ `.agents/skills` and reports duplicate Skill names; the OpenCode Adapter emits
533
+ one non-blocking diagnostic warning naming both roots. OpenCode's native
534
+ discovery, configuration slots, and session commands remain Host-owned.
535
+
536
+ ### Precedence and conflicts
537
+
538
+ Repository-owned project instructions take precedence over Profile Context on
539
+ conflict. Agent Profile Kit does not detect or resolve contradictions in prose;
540
+ conflicting guidance remains visible to you and the Host. Global Host
541
+ configuration and repository-owned files stay live and unchanged.
542
+
543
+ ### Installation State compatibility and recovery
544
+
545
+ Installation State is durable machine-local ownership evidence at
546
+ `~/.agents/agent-profile-kit/state/manifest.json`. It is not Workspace source,
547
+ but lifecycle safety depends on it for movement, repair, uninstall, Temporary
548
+ Profile Installation recovery, and repository-local exclusion cleanup. Do not
549
+ edit it by hand or reconstruct it from generated project output.
550
+
551
+ Agent Profile Kit reads strict JSON at Ownership State schema versions 6 through
552
+ 9 and writes schema version 9. The writer validates
553
+ the exact serialized bytes through the production reader before atomic rename.
554
+ Active ordinary and temporary installations use one minimal receipt shape;
555
+ removed temporary identities retain only the compact ID needed for idempotent
556
+ retry. Directory receipts retain one aggregate root hash, not complete member
557
+ trees.
558
+
559
+ The pre-1.0 YAML migration window is closed. If `state/manifest.yaml` remains,
560
+ install the shipped Agent Profile Kit 0.95.0 release, run a successful
561
+ state-writing lifecycle command to publish `manifest.json`, and then retry with
562
+ the current release. Current commands reject the YAML file without parsing,
563
+ changing, or removing it.
564
+
565
+ Back up current `manifest.json` with ordinary machine backup tooling. If the
566
+ current state is missing or malformed, restore a known-good backup and retry.
567
+ Agent Profile Kit never adopts surviving generated output or reconstructs
568
+ ownership from it.
569
+
570
+ Without a backup, stop the CLI and manually remove only project output whose
571
+ ownership you independently verify, including any
572
+ `.agent-profile-kit/installation.json` file left by an older version. In each affected
573
+ `.git/info/exclude`, remove only the marked block between
574
+ `# BEGIN Agent Profile Kit generated paths` and
575
+ `# END Agent Profile Kit generated paths`; preserve every unrelated byte. Then
576
+ recreate the desired Project Bindings and run `apkit update` to establish fresh
577
+ ownership receipts. This manual path is intentionally fail-closed.
578
+
579
+ ### Host Resolution and project-bound Profiles
580
+
581
+ This section is the Host-path detail for the
582
+ [Universal Workspace material](#universal-workspace-material) boundary.
583
+
584
+ Agent Profile Kit installs selected Skills only into the bound **project**
585
+ (`.agents/skills/<Artifact ID>/` for Antigravity, Codex, OpenCode, and Pi,
586
+ `.claude/skills/<Artifact ID>/` for Claude, `.grok/skills/<Artifact ID>/` for
587
+ Grok). Antigravity Profile Context uses `.agents/rules/` alongside its shared
588
+ Skill packages. It never installs into, adopts, disables, or removes
589
+ personal/global Host Skill folders. Unselected Workspace
590
+ Skills are not installed into projects either; they may remain valid Workspace
591
+ source without any APK-managed delivery.
592
+
593
+ Those global folders remain Host-owned:
594
+
595
+ - Codex: `~/.agents/skills/` and `~/.codex/skills/`
596
+ - Claude Code: `~/.claude/skills/`
597
+ - Grok: `~/.grok/skills/` (plus enabled compatibility roots and configured
598
+ `[skills].paths`; see `grok inspect`)
599
+ - OpenCode: personal/global configured directories
600
+ - Pi: `~/.pi/skills/` (plus configured sources)
601
+
602
+ Selected Skills may share an identity with material from these roots, packages,
603
+ plugins, extensions, compatibility sources, or other Host-native locations.
604
+ The Host owns discovery, precedence, deduplication, collision diagnostics, and
605
+ resolution across those sources. Agent Profile Kit neither scans an effective
606
+ inventory nor asks you to remove same-identity material.
607
+
608
+ Where a disable is detectable without reconstructing Host Resolution, the
609
+ Adapter warns: Codex checks SessionStart hooks and Grok checks
610
+ `[skills].disabled` and `[skills].ignore`. Malformed or unreadable
611
+ configuration that an Adapter reads for planned output also warns; Pi's
612
+ settings rule is described in its Adapter section above. Capability failures,
613
+ unrepresentable portable semantics, and exact Output Ownership Conflicts at the
614
+ planned project destination remain blockers.
615
+
616
+ ## Status and uninstall
617
+
618
+ Use `apkit status` for the bound Project containing the current directory, pass
619
+ one explicit Project root, or use `apkit status --all` to inspect every binding.
620
+ It reports current, not installed, stale source, drifted output (including wholly absent
621
+ owned output), malformed ownership, and blocked installations, while keeping Host
622
+ configuration warnings visible.
623
+
624
+ Use `apkit uninstall --here`, `uninstall --project <path>`, or `uninstall --all` (with `--auto-confirm` non-interactively, plus `--profile <name>`, `--host <host>`, and `--remove-changed` as needed) to remove selected installations and forget their recorded selection. `--host <host>` (repeatable) removes only those Hosts within the scope while the remaining Hosts keep working. It removes only Installation Receipt-proven output and preserves the Workspace and unselected Projects. It writes no teardown provenance. Because a fully removed Project is forgotten, the next `status` no longer selects it, rather than reporting it as unsafe unexplained missing output.
625
+
626
+ To stop managing a Project but keep its Git-owned files in place, remove its entry from `~/.agents/agent-profile-kit/config.yaml` by hand; the next `update` reconciles the leftovers. Neither path modifies personal/global Host configuration or repository-owned files.
627
+
628
+ Review personal content before publishing this Workspace. Agent Profile Kit does
629
+ not classify private material, and credential values do not belong in a Workspace
630
+ regardless of whether you publish it.
631
+
632
+ For the complete human guide, run `apkit guide --full`.
633
+ For help authoring with an agent, run `apkit guide --agent`.
634
+ For a short copyable example, run `apkit guide profile`, `apkit guide context`,
635
+ or `apkit guide skill`.
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "agent-profile-kit",
3
+ "version": "0.204.1",
4
+ "description": "Compose portable agent material into host-native profiles.",
5
+ "type": "module",
6
+ "bin": {
7
+ "apkit": "./dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist/cli.js",
11
+ "docs/guides",
12
+ "README.md"
13
+ ],
14
+ "scripts": {
15
+ "build": "bun run typecheck && bun run build:bundle",
16
+ "build:bundle": "bun build cli/index.ts --target=node --packages=bundle --outfile=dist/cli.js --silent",
17
+ "test": "bun run test/support/suite-supervisor.ts full",
18
+ "test:focused": "bun run test/support/suite-supervisor.ts focused",
19
+ "test:fleet": "bun run test/support/suite-supervisor.ts focused test/fleet-qualification.test.ts",
20
+ "test:stress": "bun run test/support/suite-supervisor.ts stress",
21
+ "typecheck": "tsc -p tsconfig.json --noEmit",
22
+ "prepack": "bun run build"
23
+ },
24
+ "engines": {
25
+ "node": ">=22 <23",
26
+ "bun": "1.4.0"
27
+ },
28
+ "os": [
29
+ "darwin"
30
+ ],
31
+ "devDependencies": {
32
+ "@types/bun": "^1.4.0",
33
+ "@types/node": "^26",
34
+ "@types/prompts": "^2.4.9",
35
+ "prompts": "^2.4.2",
36
+ "smol-toml": "^1.8.0",
37
+ "typescript": "^7.0.2",
38
+ "yaml": "^2.9.0"
39
+ }
40
+ }