Skip to content

Add authoring conventions guidance for agents #880

Description

@williamthorsen

Problem

The authoring contract for CodeAssembly artifacts (the dependencies: block, frontmatter fields, the collection members: model, and naming) is documented only in packages/agents/README.md, which agents never load. An agent authoring or planning a new skill, subagent, rulebook, or collection has nothing in context pointing it at the declarative mechanisms, so it flags an inter-artifact dependency as a manual "X must be present" risk instead of recommending a dependencies: block.

Context

  • Match the frontmatter format of the existing content/guidance/rulebooks/shell-conventions.md.
  • A delivery: skill rulebook ships as the on-demand consult-<slug> skill, invoked when needed, with zero always-on context cost.
  • The deploy field and the unconditional-install path were retired in Retire unconditional install; ship the default catalog through a computed all collection #878 (#878 Retire unconditional install #894): every rulebook, skill, and subagent is now declarable and deploys only through codeassembly.yaml. The rulebook documents the current model and must not mention deploy: declared or an install path.
  • Collections declare their constituents under members: (#887 Add collection members key with computed @library membership #889), either a per-type block or the computed '@library' token; dependencies: carries prerequisite edges on rulebooks, skills, and subagents. The two keys resolve identically but are not interchangeable.
  • "authoring" deliberately avoids "artifact": in CodeAssembly that denotes an output (a review, devlog, plan), not a skill/subagent/rulebook/collection.

Proposed solution

Add content/guidance/rulebooks/authoring-guidance.md as a delivery: skill rulebook (shipped as consult-authoring-guidance), the single self-contained source of truth for authoring conventions. A rulebook, not a PROJECT.md block or bare skill: conventions are what rulebooks are for, and skill delivery keeps the always-on cost at zero. Declared only in this repo's .agents/codeassembly.yaml, so it deploys here without being foisted on consumers.

It covers four areas, self-contained enough that an agent authors correctly from this file alone:

  • Declaring dependencies — the frontmatter dependencies: block grouped by type, resolved transitively; prefer a declared edge over a prose "must be present" note.
  • Collections — the members: block (a per-type list or the computed '@library' token) versus dependencies:; mixing them is an error.
  • Frontmatter fields — per artifact type (skills, subagents, rulebooks, collections), including the subagent-specific tools, maxTurns, and skills fields.
  • Namingconsult-<slug> for skill-delivery rulebooks, verb-led skill names, alphabetical ordering.

packages/agents/README.md references the rulebook for authoring conventions rather than restating them. #878 and #889 already removed the standalone deploy section and reworked the dependencies and collections sections, so this reduces to adding a pointer from the README's authoring-relevant sections to the rulebook. The source-of-truth direction is README → rulebook (the rulebook must stand alone because agents never load the README). .agents/PROJECT.md carries a one-line pointer under #### Content authoring so a planning agent discovers the rulebook.

Acceptance criteria

Must have

  • content/guidance/rulebooks/authoring-guidance.md exists with delivery: skill, self-contained, covering the dependencies: declaration rule, the collection members:/@library model, per-type frontmatter fields, and naming.
  • The rulebook names the members: (collections) versus dependencies: (rulebooks, skills, subagents) split and states that mixing them (a dependencies: block on a collection, or members: on any other type) is an error. It does not mention the retired deploy field or an install path.
  • Per-type frontmatter fields are accurate: subagents list tools, maxTurns, and skills (not user-invocable); skills list user-invocable.
  • The rulebook is declared in this repo's .agents/codeassembly.yaml.
  • .agents/PROJECT.md carries a one-line pointer to the rulebook.
  • packages/agents/README.md carries a pointer to the rulebook from its authoring-relevant sections and does not restate the rulebook's authoring conventions (frontmatter fields, naming, the prefer-declared-edge guidance). Resolver-mechanism text that overlaps in subject — such as the members:/dependencies: split and its validation errors — may stay, since it serves the README's human/maintainer audience, which never loads the rulebook.

Metadata

Metadata

Labels

featureAdded or improved external functionalityscope:agents

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions