Skip to content

Name skill-delivered rulebooks with a consult- prefix #830

Description

@williamthorsen

Parent: #576 · Relates to: #732 (introduced renderSkillFile)

Problem

A rulebook delivered as a skill materializes into a directory named after its bare slug, and the invocable command is derived from that directory name — so the command is /<slug>. A bare slug reads as a noun (a request to display the content) rather than the act of bringing the guidance to bear, and nothing distinguishes guidance skills from capability skills sharing the same directory.

Context

The invocation lever is the directory name, not the frontmatter name field: Claude Code treats name only as a display label, and the codeassembly harness's prompts.yml generator reads the directory name and never the frontmatter name. renderSkillFile currently stamps both the directory and name with the slug, and sync keys retraction off the directory name (== slug). The sync ownership marker <!-- codeassembly-rulebook:<slug> --> carries the slug and identifies a directory as sync-owned. shell-conventions is currently the only skill-delivery rulebook, and no prose documentation references rulebook invocation or frontmatter fields.

Proposed solution

Resolve each skill-delivery rulebook's skill name as consult-<slug> by default (shell-conventions/consult-shell-conventions), or a per-rulebook skill-name frontmatter override used verbatim when present. consult- reads evenly across rulebook noun-types (conventions, preferences, rules, guidance, anti-patterns) and signals the stance — load the guidance to inform future work, not transform existing code (which apply- would imply).

The resolved skill name becomes both the on-disk skill directory (the lever that sets the / command in both harnesses) and the frontmatter name (display label, kept consistent). The slug is unchanged as the declaration identifier (rulebooks.yaml) and neutral-file name (.agents/rulebooks/<slug>.md).

The ownership marker stays slug-based, decoupling stable identity from the renamable directory. Retraction is reworked to recover each owned directory's slug from its marker, so it keeps working when the directory differs from the slug — and retracts a stale directory when a rulebook's resolved skill name changes, leaving no duplicate behind.

A skill-name override is validated as kebab-case (same shape as a slug), since it becomes a directory and a command. If two skill-delivery rulebooks resolve to the same skill name, sync fails with a readable error rather than letting one clobber the other.

Acceptance criteria

Must have

  • A skill-delivery rulebook materializes into directory consult-<slug> with frontmatter name: consult-<slug>; the slug is unchanged as the declaration identifier and neutral-file name.
  • A skill-name frontmatter override, when present, is used verbatim as both the directory and the frontmatter name; it is validated as kebab-case, and an invalid value fails the sync with a readable error.
  • The ownership marker remains slug-based; retraction recovers the slug from the marker, works when the directory differs from the slug, and retracts a stale directory when a rulebook's resolved skill name changes.
  • Two skill-delivery rulebooks resolving to the same skill name fails the sync with a readable error.
  • New and changed behavior is covered by tests.

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