Skip to content
OpenAgentSkill
Browsing is open · Catalog captured 2026-11-21 · Automatic updates and account services are paused.
Productivity

cp-skill-write

Write one KB note whose intended contribution is already determined, under its collection and type contracts; validate it and hand broader graph discovery to cp-skill-connect.

zby · AI review on file

Installation

Read the source and dependencies before running a command. Copying does not install or execute anything.

npx skills add zby/commonplace --skill cp-skill-write

About this skill


name: cp-skill-write description: Write one KB note whose intended contribution is already determined, under its collection and type contracts; validate it and hand broader graph discovery to cp-skill-connect. type: kb/types/instruction.md user-invocable: true allowed-tools: Read, Write, Grep, Glob, Bash, Skill context: fork model: opus argument-hint: "[path | collection | type] [topic or claim/purpose] — a note path for editing, or a collection/type/subject for new notes"

EXECUTE NOW

Target: $ARGUMENTS

All documents in the KB live in a collection: a directory under kb/ with a local COLLECTION.md, such as kb/notes/, kb/reference/, kb/instructions/, or an installed library collection like kb/commonplace/notes/. Each collection that accepts writes has a COLLECTION.md with its purpose, intended contribution, quality goal, and linking conventions.

Documents with frontmatter carry a path-valued type: that points to a type-spec doc, for example type: kb/types/note.md or type: kb/reference/types/adr.md. Files with no frontmatter are implicit text.

Step 1 - Parse Arguments

Edit mode: first argument is a path to an existing .md file. Read it, infer collection from the path, and read its type: path from frontmatter. If it has frontmatter but no type:, stop and fix that structural problem before editing. If it has no frontmatter, treat it as implicit text. Open the type-spec doc named by type: before making structural edits.

New-write mode: everything else. Extract collection, type, and topic from the arguments. Default an unspecified collection to notes and an unspecified type to kb/types/note.md. If the requested type is an instruction and no collection is explicit, use collection instructions.

For new writes, resolve the target collection to a directory under kb/ with a local COLLECTION.md; shorthand names such as notes mean kb/notes/. Resolve the type independently of the collection contract:

  • If the user or calling workflow supplied a type path, open it and verify that its own frontmatter identifies it as a type-spec doc.
  • If the user supplied a shorthand type name, search Markdown files under kb/types/ and every collection types/ directory below kb/. Inspect each candidate's own opening frontmatter and require exactly one type-spec doc whose name: equals the shorthand. If none or several match, stop and report the matching paths; do not guess or apply collection-specific precedence.
  • If no type was supplied, use kb/types/note.md.

This lookup identifies the contract; it does not authorize the type for the target collection. Do not add collection-specific eligibility logic or a kb/work/ branch. commonplace-validate owns that decision. An explicit request for text means frontmatter-free Markdown, not a type: pointer.

Step 2 - Load Collection Conventions

Read the target collection's COLLECTION.md for the collection's writing conventions, including outbound-linking rules. Find the outbound-linking section (heading varies — look for the one that names destinations and labels) and treat it as authoritative. It tells you which local collections this source may link to, whether the reserved external destination is authorized, which destinations are excluded, which labels are authorised for which source->destination pairs, and the reader-need each label serves. The destination wildcard any includes external. Internal format varies (per-destination blocks, a single labels table with a destinations column, prose) — read it for content, not shape. There is no separate linking doc to consult.

Hard fail if the target collection has no COLLECTION.md. Every collection that accepts writes must have a COLLECTION.md; its purpose, intended contribution, quality goal, and linking rules are what distinguish collections. Do not proceed with default conventions.

Step 3 - Load The Type Spec

Read the selected type-spec doc. Its frontmatter must include type: kb/types/type-spec.md, name, description, and schema. Its body supplies the artifact shape and may include a template block. Follow that body as the structural authoring contract.

Do not fall back from a missing type path to note.

For text, write raw markdown with no frontmatter only when the user explicitly wants unstructured capture. Otherwise use kb/types/note.md.

Step 4 - Resolve The Intended Contribution

Before drafting, identify from the user's request and the target artifact in edit mode:

  • the intended audience, using the collection default when the task does not narrow it;
  • the governing question, target claim, or practical purpose;
  • what the reader should understand, infer, or do because this artifact exists; and
  • any scope or angle needed to distinguish it from materially different artifacts on the same topic.

The repository and collection contracts constrain the acceptable contribution class, quality bar, and often the default audience. They do not by themselves select an artifact-specific claim or purpose. Resolve that choice from the task, the incumbent artifact, and any retained intent supplied for this write. Treat a context block as retained intent only when it identifies its source, subject, scope, and whether its role is authoritative or advisory. Current user direction prevails. If retained intent conflicts with the incumbent or another applicable input and no explicit precedence resolves the conflict, ask the user rather than silently amending the commission.

Remembered intent may complete a bare request, but it is not meaning contained in that request, a choice licensed by model priors, or evidence that warrants factual claims. Do not add an ad hoc history search to this skill; older interaction history counts only when a memory mechanism supplies it through the retained-intent input.

When those inputs already determine the choices, proceed without a formal brief. If several mater

Read the complete source ↗