Cp skill add collection

From zby/commonplace · View interactive version

Cp skill add collection is an AI agent skill from the GitHub repository zby/commonplace. Add one new collection under kb/ with its binding COLLECTION.md, landing README, tag assignment policy and routing, then validate it. Use when a project needs a new kind of long-lived content that no existing collection's contract fits.

How to use this skill

Skill file

Add a collection

Goal: a new directory kb/<name>/ whose COLLECTION.md binds every artifact

written there, which agents can find through the project's routing, and which

passes validation.

Inputs

in this project or supplied as a file.

Ask for the name or purpose if either is missing. Do not invent a purpose

from the name.

1. Check that a collection is the right answer

Stop and report instead of creating anything when:

belongs in a workshop, kb/work/<name>/;

there, or propose a subdirectory of it;

agentic-system-analyses. Commonplace commands rely on those locations

for system roles, so the name is not available for ordinary content.

2. Write `kb/<name>/COLLECTION.md`

Read the project's KB goals in AGENTS.md and the

collection-contract type first. Then

read the contract the caller named, or look for a kb/*/COLLECTION.md in the

project that fits the new purpose. If none fits, list the installed starting

contracts with ls "$(commonplace-source)"/_data/templates/user-*-COLLECTION.md.

Adapt a suitable contract, or draft one directly. The project owns the new

file; later changes to a template do not update the copy.

Frontmatter:

---
type: types/collection-contract.md
description: "<what the collection holds, for agents choosing where to read or write>"
---

Add unquoted-source-limit: <n> only when the collection's artifacts will

be held to a one-pass grounding review against tracked sources; validation

then fails any artifact citing more than <n> tracked sources without a

verified verbatim quotation. If you set it, read

the unquoted-source limit

for what counts and how authors discharge a source, and state those

conventions in the contract body.

The body must cover the contract's three roles. Derive each from the stated

purpose and the project's goals; do not add requirements nobody asked for.

  1. Goals: what belongs here, its scope, and which existing collection

takes nearby content instead.

  1. Quality standards: the quality goal and its tests, title and

description conventions, and any attribution or evidence requirements.

  1. Linking. In the "Outbound links" section, name the permitted destinations.

For formal links, list each label and the reader need it serves for that

destination. Consult the label catalogue before naming a formal relation. Use a listed name only for its defined meaning and direction. If none fits, define a local label under an unreserved name. In either case, authorise the label for the intended destination in the new contract.

To authorise inline citations to external, state their permitted purpose

and where they may appear. These citations need no formal label.

Do not restate which types the collection may use; validation enforces that

for every collection. Create kb/<name>/types/ only when a local type is

needed now; its artifacts then name it type: <name>/types/<type>.md.

3. Write the landing

Create kb/<name>/README.md: a heading, one sentence saying what the

collection holds, a link to COLLECTION.md, and "No artifacts have been

added yet." Do not create index.md; a collection may have only one landing.

4. Connect it to the rest of the KB

  1. Tags. State in the new contract which artifacts may carry tags. Eligible tagged artifacts appear in generated lists automatically; do not register the collection elsewhere.
  2. Routing. Add a row for kb/<name>/ to the collection table in

AGENTS.md, stating its contribution in the same style as the other rows.

If the project has a content-routing document, add the collection there

too.

  1. Neighbouring contracts. Where another collection's contract routes the

new kind of content elsewhere ("belongs in …"), or should be able to link

to it, propose the edit to the user rather than making it. Those contracts

bind other artifacts.

5. Validate

commonplace-validate <name>
commonplace-validate landings

Fix failures in the files you wrote. Report any failure in files you did not

touch without fixing it.

Do not stage or commit unless asked.

Report

State the new path, the contract you modelled on, whether its contract permits

tag assignments, the routing rows you added, the validation results, and any proposed

edits to neighbouring contracts.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.