zby/commonplace/kb/instructions/cp-skill-write/SKILL.md
cp-skill-write
Write one KB note under its collection and type contracts, validate it, and hand broader graph discovery to cp-skill-connect.
- Source repository stars
- 80
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-08-04
- Source checked
- 2026-08-04
Decision brief
What it does—and where it fits
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 reg…
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/zby/commonplace --skill "kb/instructions/cp-skill-write"Inspect the Agent Skill "cp-skill-write" from https://github.com/zby/commonplace/blob/890692ef3ee51c9bd3e4a5284ad833b1aec5aee3/kb/instructions/cp-skill-write/SKILL.md at commit 890692ef3ee51c9bd3e4a5284ad833b1aec5aee3. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
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…
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 be…New-write mode: everything else. Extract collection, type, and topic from the arguments. Defaults: collection notes, type kb/types/note.md. If the requested type is an instruction and no collection is explicit, use coll…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/. Read that collection's Types section and pick one listed type path. If the… - 02
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…
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 lab…Hard fail if the target collection has no COLLECTION.md. Every collection that accepts writes must have a COLLECTION.md; its register, quality goal, and linking rules are what distinguish collections. Do not proceed wit… - 03
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.
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 st…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. - 04
Step 4 - Search Before Writing
Write does not run active discovery — that is cp-skill-connect's job. Write authors one note and commits only links the author already has in hand, plus a cheap duplicate guard:
Near-duplicate check. Search the target collection for the new note's distinctive title terms with rg (e.g. rg -i "key term" kb/notes/ --glob ".md"). This is a targeted term search — do not enumerate the whole collectio…Context already loaded. Notes, sources, and ingests pulled into the session for this write are first-class link candidates. If it was worth reading, it is worth considering as a link.User-named targets. Link targets the user mentions in the prompt. - 05
Step 5 - Draft And Save
Follow the type-spec doc and collection conventions. Derive a lowercase-hyphenated filename from Title unless editing an existing file. For typed artifacts, set type: to the exact repo-relative type-spec path, not the type name.
Follow the type-spec doc and collection conventions. Derive a lowercase-hyphenated filename from Title unless editing an existing file. For typed artifacts, set type: to the exact repo-relative type-spec path, not the t…Set traits only when clearly warranted. The available traits and their meanings are defined in the target type's spec (e.g. the traits table in kb/types/note.md) — take the vocabulary from there, not from a remembered l…Preserve existing frontmatter and links during edits unless the requested change requires changing them.
Permission review
Static risk signals and limitations
Reads files
The documentation asks the agent to read local files, directories, or repositories.
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/`. Read that collection's `## Types` section and pick one listed type path. If the requestEvidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 84/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 80 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- zby/commonplace
- Skill path
- kb/instructions/cp-skill-write/SKILL.md
- Commit
- 890692ef3ee51c9bd3e4a5284ad833b1aec5aee3
- License
- CC-BY-4.0
- Collected
- 2026-08-04
- Default branch
- main
View the original SKILL.md
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 register, quality goal, type offerings, 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. Defaults: collection notes, type 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/. Read that collection's ## Types section and pick one listed type path. If the requested type is not listed and the user did not give an explicit path, stop and list the available types. If the user gives an explicit kb/.../*.md type path, open that file and verify it is a type-spec doc before using it.
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 register, 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 - Search Before Writing
Write does not run active discovery — that is cp-skill-connect's job. Write authors one note and commits only links the author already has in hand, plus a cheap duplicate guard:
- Near-duplicate check. Search the target collection for the new note's distinctive title terms with
rg(e.g.rg -i "key term" kb/notes/ --glob "*.md"). This is a targeted term search — do not enumerate the whole collection; a complete listing costs linear context and is the wrong tool for a single note's duplicate check. If a near-duplicate already exists, prefer editing it to creating a second note. - Context already loaded. Notes, sources, and ingests pulled into the session for this write are first-class link candidates. If it was worth reading, it is worth considering as a link.
- User-named targets. Link targets the user mentions in the prompt.
In edit mode, also run a backlinks lookup on the target note — one query, no body search — so edits don't orphan dependents.
All discovery beyond this — collection-wide description scans, cross-destination prospecting, body search, tag traversal, link-following, reverse-edge reasoning — belongs to cp-skill-connect, not here. Write stays focused on authoring one note.
Step 5 - Draft And Save
Follow the type-spec doc and collection conventions. Derive a lowercase-hyphenated filename from # Title unless editing an existing file. For typed artifacts, set type: to the exact repo-relative type-spec path, not the type name.
Set traits only when clearly warranted. The available traits and their meanings are defined in the target type's spec (e.g. the traits table in kb/types/note.md) — take the vocabulary from there, not from a remembered list.
Preserve existing frontmatter and links during edits unless the requested change requires changing them.
Before saving a substantive edit, remove user-verified if present. Verification attests to the prior substantive contents and must be granted again explicitly by a human. Preserve it only when the user has explicitly authorized a mechanical trivial-change workflow.
Step 6 - Validate
Validate the note you wrote or edited:
commonplace-validate path/to/file.md
Fix structural failures before stopping.
Then suggest cp-skill-connect as the next step. Step 4 commits only links the author already had in hand (loaded context, user-named) plus a duplicate guard; the rest of the note's share of the graph — collection-wide description scans, cross-destination candidates, body-search hits, tag-traversal, link-following, reverse-edge candidates — only surfaces under the connect skill. The suggestion is not optional polish.
Universal Mechanics
These apply to all typed artifacts regardless of collection.
Frontmatter makes notes queryable. No frontmatter means implicit text; any file with frontmatter must include a path-valued type:. Most library notes also need description (double-quoted, 50-250 chars), plus optional traits, tags, and user-verified. Never grant user verification implicitly.
Descriptions are retrieval filters, not summaries. The test: if an agent searched for this note's concept and got 5 results, would this description help pick this one? Paraphrasing the title adds zero retrieval value.
Vocabulary. Use the active vocabulary declared in root AGENTS.md. When writing or materially editing prose, gloss and link active vocabulary on first meaningful mention when the reader may not know the term. Do not churn untouched passages only to add vocabulary links.
Links. Use relative markdown paths from the source file. Every link must point to a real file.
Position encodes commitment. Inline prose connectors (since [X](./x.md), because [X](./x.md), but [X](./x.md)) are strongest — the target is a premise of the current argument. Footer links carry an explicit label and context phrase: - [title](./path.md) — label: context phrase.
The collection's COLLECTION.md authorises labels per destination and names the reader-need each label serves. Pick a label whose reader-need matches the link's purpose; write the context phrase to answer "[source] connects to [target] because [specific reason]." If no authorised label fits, the candidate is off-scope for this collection — drop the link or raise it to the collection author to extend the authorisation.
Filenames are lowercase, hyphenated, .md, derived from # Title, max 70 chars.
Lineage tracking: when a focused artifact is worked up from a source, record the dependency in the source's footer — Derived into:, Abstracted into:, Operationalized into:, or Adapted into:, whichever the source collection authorizes and link-vocabulary.md's test fits; never stack more than one for the same edge. The produced artifact does not link back.
Renames: never rename manually. Use commonplace-relocate-note to update backlinks.