agent-profile-kit 0.204.1 → 0.237.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.
@@ -0,0 +1,502 @@
1
+ # The Agent Profile Kit Workspace contract
2
+
3
+ The Workspace is the single canonical source Agent Profile Kit installs from:
4
+ plain files you own in one folder. This document is the complete contract for
5
+ that folder — every rule below is enforced by Workspace validation, and every
6
+ rule Workspace validation enforces is stated here. Read it before building a
7
+ Workspace so you or your agent can author valid material first, without
8
+ installing apkit.
9
+
10
+ View this contract any time with `apkit guide --contract`. For authoring
11
+ workflows and agent delivery behavior, see the complete Workspace guide
12
+ (`apkit guide --full`).
13
+
14
+ ## Workspace structure
15
+
16
+ A Workspace is a folder containing a `workspace.yaml` Manifest and the three
17
+ artifact folders `context/`, `skills/`, and `profiles/`. `apkit init <path>`
18
+ adds exactly these parts, and nothing else, to a folder you name.
19
+
20
+ - A Workspace root must contain a `workspace.yaml` file, and
21
+ `workspace.yaml` must be a file, not a folder.
22
+ - `workspace.yaml` must be valid YAML, and it must declare
23
+ `schema_version: 1`. The current Workspace schema version is 1; other
24
+ versions are not supported. `schema_version` must be a positive integer,
25
+ and `workspace.yaml` contains only `schema_version` — no other fields.
26
+ - `context/`, `skills/`, and `profiles/` must be directories, not files.
27
+ Each must be a real directory: a dangling symlink is invalid.
28
+ - A missing artifact folder is treated as an empty collection.
29
+ - Hidden files and folders — names starting with `.` — are ignored
30
+ everywhere: validation never reports them and never looks inside them.
31
+ Outside a Skill package they are not Workspace source: a hidden file is
32
+ never a Context Module, a Skill, or a Profile, and a Profile naming one
33
+ reports it missing. A hidden file inside a Skill package stays ordinary
34
+ package content.
35
+ - Every non-hidden entry under the artifact folders must be a real file or
36
+ directory. Outside a Skill package, a symlink is a violation, because
37
+ validation never follows links; inside a Skill package a symlink stays
38
+ ordinary package content.
39
+ - Empty folders violate nothing: the rules below bind files.
40
+
41
+ ## Context Modules
42
+
43
+ - Every `.md` file under `context/`, at any depth, is a Context Module.
44
+ - Under `context/`, every non-hidden file must be Markdown (`.md`) — anything
45
+ else is a violation. Give the file a `.md` extension or move it out of
46
+ `context/`.
47
+ - A Context Module's ID is its path under `context/` without `.md`, with `/`
48
+ between folders (for example `engineering/review-findings`). Moving or
49
+ renaming the file changes its ID by design.
50
+ - Every folder and file name under `context/` must be a lowercase kebab-case
51
+ name, because together they form the Context Module ID.
52
+ - A Context Module file must not be empty.
53
+ - apkit reads no Context frontmatter and requires none: each file's bytes are
54
+ delivered as written, after the generated Context header, so frontmatter
55
+ keys such as `id` or `dependencies` have no effect.
56
+
57
+ ## Skills
58
+
59
+ A Skill is a standard Agent Skills package: a folder under `skills/` (folders
60
+ may group packages) rooted at a `SKILL.md` file. Supporting scripts,
61
+ references, and assets stay ordinary package files.
62
+
63
+ - Under `skills/`, every non-hidden file must belong to a Skill package (a
64
+ folder with a `SKILL.md`); folders may group Skill packages. A file outside
65
+ a Skill package is a violation — move it into a package as a Skill
66
+ Resource, give it its own package, or move it out of `skills/`.
67
+
68
+ - A Skill's `SKILL.md` must open with YAML frontmatter, and it must close its
69
+ YAML frontmatter. Profile files are YAML mappings, and `SKILL.md`
70
+ frontmatter is a YAML mapping. Profile files and `SKILL.md` frontmatter
71
+ must be valid YAML.
72
+ - The frontmatter requires a `name` and a `description`. Required Skill
73
+ fields must be non-empty strings within the Agent Skills length limits:
74
+ `name` at most 64 characters, `description` at most 1024. The `name` is the
75
+ Skill's ID, and it is stable: Artifact IDs are lowercase kebab-case names:
76
+ lowercase letters and digits joined by single hyphens.
77
+ - Optional top-level fields keep their standard types when present:
78
+ `license` and `allowed-tools` must be strings, `compatibility` must be a
79
+ string of at most 500 characters, and `metadata`, when present, must be a
80
+ YAML mapping.
81
+ - Two Skill packages must not declare the same `name`.
82
+ - By default, an agent may invoke a Skill when the model matches its
83
+ description. To require explicit invocation instead, set the standard
84
+ top-level field `disable-model-invocation: true` in `SKILL.md`.
85
+ `disable-model-invocation` must be a boolean: `true` disables model
86
+ invocation; absent or `false` allows it.
87
+ - The retired `metadata.agent-profile-kit.model-invocation` key is a
88
+ violation; the standard top-level `disable-model-invocation` field is its
89
+ replacement.
90
+ - Other top-level frontmatter fields beyond those apkit reads are accepted
91
+ and ignored — agent-specific fields reach each agent as written, so standard
92
+ Skill packages validate and install unchanged.
93
+ - A Skill package must not contain an `agent-profile-kit.yaml` sidecar. The
94
+ sidecar is retired: delete it and list what it declared in a Profile's
95
+ `context` and `skills` lists.
96
+
97
+ ## Profiles
98
+
99
+ A Profile is the one apkit-specific file and the only place that says what
100
+ gets installed together.
101
+
102
+ - A Profile is a `.yaml` file directly under `profiles/`. Profile files live
103
+ directly in `profiles/`; a `.yaml` file inside a `profiles/` subfolder is a
104
+ violation (move the file up; its file name becomes its ID).
105
+ - Under `profiles/`, every non-hidden file must be a `.yaml` Profile directly
106
+ in `profiles/` — a non-`.yaml` file anywhere under `profiles/`, including
107
+ inside a subfolder, is a violation; a `.yml` extension is not accepted.
108
+ Rename the file with a `.yaml` extension or move it out of `profiles/`.
109
+ - A Profile's file name, without `.yaml`, must be a lowercase kebab-case
110
+ name; that name is the Profile's ID. A Profile carries no `id` field: its
111
+ ID is its file name without `.yaml` — remove the field, and rename the file
112
+ to change the ID.
113
+ - A Profile file contains exactly its `context` and `skills` lists — no other
114
+ fields — and it contains both lists: `context` and `skills`. `context` and
115
+ `skills` are lists of names. The `agents`, `hooks`, and `tools` fields are
116
+ not supported in a Profile.
117
+ - A Profile list must not select a name more than once. Every name in a
118
+ Profile's `context` list must be an existing Context Module ID. Every name
119
+ in a Profile's `skills` list must be an existing Skill `name`.
120
+ - A Profile must select at least one artifact: its `context` list, its
121
+ `skills` list, or both must be non-empty. Context-only, Skills-only, and
122
+ combined Profiles are all valid.
123
+
124
+ ## Local Configuration
125
+
126
+ The file `~/.agents/agent-profile-kit/config.yaml` is where this machine
127
+ records the selected Workspace path and its Project Bindings (each binding
128
+ names one project root, one Profile, and the agents to install for). Local
129
+ Configuration is machine-local, untracked, and never part of the Workspace.
130
+
131
+ ## Examples
132
+
133
+ ### Valid: a minimal valid Workspace
134
+
135
+ These four files form a complete, valid Workspace.
136
+
137
+ <!-- workspace.yaml -->
138
+ ```yaml
139
+ schema_version: 1
140
+ ```
141
+
142
+ <!-- context/example-context.md -->
143
+ ```markdown
144
+ Keep project-specific instructions in the project repository.
145
+ ```
146
+
147
+ <!-- skills/example-skill/SKILL.md -->
148
+ ```markdown
149
+ ---
150
+ name: "example-skill"
151
+ description: Summarize a change. Use when asked for a concise change summary.
152
+ ---
153
+
154
+ # Summarize a change
155
+
156
+ Describe what changed, how it was verified, and any follow-up work.
157
+ ```
158
+
159
+ <!-- profiles/example.yaml -->
160
+ ```yaml
161
+ context:
162
+ - "example-context"
163
+ skills:
164
+ - "example-skill"
165
+ ```
166
+
167
+ ### Pattern: a Skill that needs specific Context
168
+
169
+ A Skill that only works with particular Context should say so and stop when
170
+ the Context is missing. In the Skill's `SKILL.md` body:
171
+
172
+ ```markdown
173
+ # Review a pull request
174
+
175
+ Requires the Context Module `engineering/review-findings`. If this project's
176
+ installed Context does not include it, stop and tell the user to add it to
177
+ their Profile instead of proceeding without it.
178
+ ```
179
+
180
+ ### Invalid: a Workspace without the required Manifest
181
+
182
+ <!-- expects violations: workspace-missing-manifest -->
183
+ A folder whose root has no `workspace.yaml` is not a Workspace; apkit reports
184
+ the missing Manifest.
185
+
186
+ <!-- context/notes.md -->
187
+ ```markdown
188
+ Some notes.
189
+ ```
190
+
191
+ ### Invalid: an unsupported Manifest schema version
192
+
193
+ <!-- expects violations: workspace-manifest/unsupported-schema-version -->
194
+ Only schema version 1 is supported.
195
+
196
+ <!-- workspace.yaml -->
197
+ ```yaml
198
+ schema_version: 2
199
+ ```
200
+
201
+ ### Invalid: a Profile carrying an `id` field
202
+
203
+ <!-- expects violations: workspace-artifact/profile-id-field -->
204
+ A Profile's ID is its file name without `.yaml`; remove the `id` field.
205
+
206
+ <!-- workspace.yaml -->
207
+ ```yaml
208
+ schema_version: 1
209
+ ```
210
+
211
+ <!-- context/example-context.md -->
212
+ ```markdown
213
+ Keep project-specific instructions in the project repository.
214
+ ```
215
+
216
+ <!-- profiles/legacy.yaml -->
217
+ ```yaml
218
+ id: "legacy"
219
+ context:
220
+ - "example-context"
221
+ skills: []
222
+ ```
223
+
224
+ ### Invalid: a Profile naming a Context Module that does not exist
225
+
226
+ <!-- expects violations: missing-context-reference -->
227
+ The Profile's `context` list names `missing-notes`, and no Context Module has
228
+ that ID.
229
+
230
+ <!-- workspace.yaml -->
231
+ ```yaml
232
+ schema_version: 1
233
+ ```
234
+
235
+ <!-- profiles/draft.yaml -->
236
+ ```yaml
237
+ context:
238
+ - "missing-notes"
239
+ skills: []
240
+ ```
241
+
242
+ ### Invalid: a Profile naming a Skill that does not exist
243
+
244
+ <!-- expects violations: missing-skill-reference -->
245
+ The Profile's `skills` list names `missing-skill`, and no Skill package
246
+ declares that `name`.
247
+
248
+ <!-- workspace.yaml -->
249
+ ```yaml
250
+ schema_version: 1
251
+ ```
252
+
253
+ <!-- profiles/draft.yaml -->
254
+ ```yaml
255
+ context: []
256
+ skills:
257
+ - "missing-skill"
258
+ ```
259
+
260
+ ### Invalid: a Profile inside a nested folder
261
+
262
+ <!-- expects violations: nested-profile -->
263
+ Profiles live directly in `profiles/`; move `profiles/team/coding.yaml` up so
264
+ its file name becomes its ID.
265
+
266
+ <!-- workspace.yaml -->
267
+ ```yaml
268
+ schema_version: 1
269
+ ```
270
+
271
+ <!-- skills/example-skill/SKILL.md -->
272
+ ```markdown
273
+ ---
274
+ name: "example-skill"
275
+ description: Summarize a change. Use when asked for a concise change summary.
276
+ ---
277
+ ```
278
+
279
+ <!-- profiles/team/coding.yaml -->
280
+ ```yaml
281
+ context: []
282
+ skills:
283
+ - "example-skill"
284
+ ```
285
+
286
+ ### Invalid: a Profile that selects nothing
287
+
288
+ <!-- expects violations: profile-without-artifacts -->
289
+ A Profile with both lists empty selects no material.
290
+
291
+ <!-- workspace.yaml -->
292
+ ```yaml
293
+ schema_version: 1
294
+ ```
295
+
296
+ <!-- profiles/empty.yaml -->
297
+ ```yaml
298
+ context: []
299
+ skills: []
300
+ ```
301
+
302
+ ### Invalid: two Skills with the same name
303
+
304
+ <!-- expects violations: duplicate-artifact-name -->
305
+ Two Skill packages declare the same `name`; Skill names are unique.
306
+
307
+ <!-- workspace.yaml -->
308
+ ```yaml
309
+ schema_version: 1
310
+ ```
311
+
312
+ <!-- skills/alpha/SKILL.md -->
313
+ ```markdown
314
+ ---
315
+ name: "summarize-change"
316
+ description: Summarize a change. Use when asked for a concise change summary.
317
+ ---
318
+ ```
319
+
320
+ <!-- skills/beta/SKILL.md -->
321
+ ```markdown
322
+ ---
323
+ name: "summarize-change"
324
+ description: Another summary workflow.
325
+ ---
326
+ ```
327
+
328
+ ### Invalid: a leftover Skill sidecar
329
+
330
+ <!-- expects violations: leftover-skill-sidecar -->
331
+ `agent-profile-kit.yaml` is retired and no longer read; delete it and list its
332
+ content in a Profile's `context` and `skills` lists.
333
+
334
+ <!-- workspace.yaml -->
335
+ ```yaml
336
+ schema_version: 1
337
+ ```
338
+
339
+ <!-- skills/example-skill/SKILL.md -->
340
+ ```markdown
341
+ ---
342
+ name: "example-skill"
343
+ description: Summarize a change. Use when asked for a concise change summary.
344
+ ---
345
+ ```
346
+
347
+ <!-- skills/example-skill/agent-profile-kit.yaml -->
348
+ ```yaml
349
+ dependencies: []
350
+ ```
351
+
352
+ ### Invalid: the retired model-invocation metadata key
353
+
354
+ <!-- expects violations: workspace-artifact/leftover-model-invocation-metadata -->
355
+ The `metadata.agent-profile-kit.model-invocation` key is no longer read; move
356
+ the policy to the standard top-level `disable-model-invocation` field.
357
+
358
+ <!-- workspace.yaml -->
359
+ ```yaml
360
+ schema_version: 1
361
+ ```
362
+
363
+ <!-- skills/pinned/SKILL.md -->
364
+ ```markdown
365
+ ---
366
+ name: "pinned-skill"
367
+ description: Review a change on request only.
368
+ metadata:
369
+ agent-profile-kit.model-invocation: true
370
+ ---
371
+ ```
372
+
373
+ ### Invalid: a non-boolean disable-model-invocation
374
+
375
+ <!-- expects violations: workspace-artifact/invalid-model-invocation -->
376
+ `disable-model-invocation` must be a boolean, not a quoted string.
377
+
378
+ <!-- workspace.yaml -->
379
+ ```yaml
380
+ schema_version: 1
381
+ ```
382
+
383
+ <!-- skills/pinned/SKILL.md -->
384
+ ```markdown
385
+ ---
386
+ name: "pinned-skill"
387
+ description: Summarize a change on request only.
388
+ disable-model-invocation: "true"
389
+ ---
390
+ ```
391
+
392
+ ### Invalid: a Skill without a description
393
+
394
+ <!-- expects violations: workspace-artifact/invalid-field -->
395
+ The frontmatter requires a non-empty `description`.
396
+
397
+ <!-- workspace.yaml -->
398
+ ```yaml
399
+ schema_version: 1
400
+ ```
401
+
402
+ <!-- skills/brief/SKILL.md -->
403
+ ```markdown
404
+ ---
405
+ name: "brief-skill"
406
+ ---
407
+ ```
408
+
409
+ ### Invalid: a Context file name that cannot form a valid Context Module ID
410
+
411
+ <!-- expects violations: workspace-artifact/context-module-file-name -->
412
+ `My Notes.md` contains a space and an uppercase letter; the file name must be
413
+ a lowercase kebab-case name.
414
+
415
+ <!-- workspace.yaml -->
416
+ ```yaml
417
+ schema_version: 1
418
+ ```
419
+
420
+ <!-- context/My Notes.md -->
421
+ ```markdown
422
+ Some notes.
423
+ ```
424
+
425
+ ### Invalid: an empty Context Module
426
+
427
+ <!-- expects violations: workspace-artifact/empty-content -->
428
+ A Context Module file must not be empty.
429
+
430
+ <!-- workspace.yaml -->
431
+ ```yaml
432
+ schema_version: 1
433
+ ```
434
+
435
+ <!-- context/empty.md -->
436
+ ```markdown
437
+ ```
438
+
439
+ ### Invalid: a non-Markdown file under `context/`
440
+
441
+ <!-- expects violations: stray-context-file -->
442
+ Under `context/`, every non-hidden file must be Markdown (`.md`).
443
+
444
+ <!-- workspace.yaml -->
445
+ ```yaml
446
+ schema_version: 1
447
+ ```
448
+
449
+ <!-- context/notes.txt -->
450
+ ```text
451
+ Some notes.
452
+ ```
453
+
454
+ ### Invalid: a file under `skills/` outside a Skill package
455
+
456
+ <!-- expects violations: stray-skill-file -->
457
+ Under `skills/`, every non-hidden file must belong to a Skill package (a
458
+ folder with a `SKILL.md`).
459
+
460
+ <!-- workspace.yaml -->
461
+ ```yaml
462
+ schema_version: 1
463
+ ```
464
+
465
+ <!-- skills/README.md -->
466
+ ```markdown
467
+ Notes about the Skills in this Workspace.
468
+ ```
469
+
470
+ ### Invalid: a Profile file with a `.yml` extension
471
+
472
+ <!-- expects violations: stray-profile-file -->
473
+ Under `profiles/`, every non-hidden file must be a `.yaml` Profile directly
474
+ in `profiles/` — a `.yml` extension is not accepted.
475
+
476
+ <!-- workspace.yaml -->
477
+ ```yaml
478
+ schema_version: 1
479
+ ```
480
+
481
+ <!-- profiles/team.yml -->
482
+ ```yaml
483
+ context: []
484
+ skills: []
485
+ ```
486
+
487
+ ### Invalid: a non-`.yaml` file inside a `profiles/` subfolder
488
+
489
+ <!-- expects violations: stray-profile-file -->
490
+ Under `profiles/`, every non-hidden file must be a `.yaml` Profile directly
491
+ in `profiles/` — a non-`.yaml` file anywhere under `profiles/`, including
492
+ inside a subfolder, is a violation.
493
+
494
+ <!-- workspace.yaml -->
495
+ ```yaml
496
+ schema_version: 1
497
+ ```
498
+
499
+ <!-- profiles/archive/notes.txt -->
500
+ ```text
501
+ Some notes.
502
+ ```