EXECUTE NOW
Target: $ARGUMENTS
Intent. Produce a document that is aligned with this KB's doctrine: the standing rules in the root AGENTS.md, the target collection's COLLECTION.md, the document's type spec, and the Universal Mechanics below. Together they fix what the document may contribute, its quality bar, structure, vocabulary, and links. When done, the document is saved at its resolved path, meets those rules, has its source-dependent claims grounded, and passes commonplace-validate. This skill orients qualifying claims before drafting. Post-write connection discovery belongs to cp-skill-connect. Use cp-skill-edit for existing documents and connect-report application. Source records belong to cp-skill-ingest, and verification to a human. The step order binds where it protects the target: the source guard (Step 7) finishes before the first write (Step 8). Wording, and structure within the type contract, are the writer's choice.
All documents in the KB live in a collection: a directory under kb/ with a local COLLECTION.md, such as kb/theory/, kb/reference/, or kb/instructions/. Each collection that accepts writes has a COLLECTION.md with its purpose, intended contribution, quality goal, and linking conventions.
Documents with frontmatter carry a type: that names a type-spec doc. The value is the spec's path under a KB root, with .md. A global type, defined in the Commonplace library's types/ directory, is named by its path under the library root, for example type: types/note.md. A collection-local type is named by its path under the KB root, starting with its collection, for example type: reference/types/adr.md. Bare names and values starting with ./, ../, or kb/ are invalid. Files with no frontmatter are implicit text. The library's global types are at ../../types/, resolved from this skill's real location.
Step 1 - Resolve the new document
If the requested target exists, stop and offer cp-skill-edit. Extract collection, type, and topic from the arguments. Default an unspecified type to types/note.md. Use the collection supplied by the caller or selected by the project's authored routing for this contribution; in this KB, theoretical notes go to theory, while scaffold projects commonly use notes. If routing does not select one collection, ask. 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 theory mean kb/theory/, while notes means kb/notes/ when that collection exists. Do not treat either as an alias for the other. Resolve the type independently of the collection contract:
- If the user or calling workflow supplied a type value, open the file it names and verify that its own frontmatter identifies it as a type-spec doc. A global value
types/<name>.mdnames../../types/<name>.mdfrom this skill's real location; a local value names a file under the project'skb/. - If the user supplied a shorthand type name, look for it among the library's global types (
../../types/<name>.md) and in every collectiontypes/directory belowkb/. Inspect each candidate's own opening frontmatter and require exactly one type-spec doc whosename:equals the shorthand. Write the match as its path under its root:types/<name>.mdfor a global type,<collection>/types/<name>.mdfor a local one. If none or several match, stop and report the matches; do not guess or apply collection-specific precedence. - If no type was supplied, use
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.
Load the contracts (Steps 2–3), then follow the new-document procedure.
Shared contracts
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: types/type-spec.md, name, description, and schema. Its body supplies the document 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 note.
Create the document
- Resolve the intended contribution (Step 4) and identify the target directory or caller-supplied path. Finalize the default filename from the candidate's title in Step 6.
- Orient qualifying new claims using Step 5 — new substantive claims in claim-bearing collections (such as
theory,reference, or a project'snotescollection). Skip orientation for unstructuredtext,types/write-brief.md, and trivial index or stub captures. A completed orientation covering the target collection also serves as the near-duplicate guard. When orientation is skipped, run a targetedrgfor the new document's distinctive title terms in the target collection (e.g.rg -i "key term" kb/<collection>/ --glob "*.md"). Keep this check to distinctive terms; do not enumerate the whole collection. If a near-duplicate already exists, stop and offercp-skill-edit; do not change the commission. - Draft the candidate (Step 6) without
connected:. Drafting links into a new document is not a connect-report application. Guard named source dependencies, save, and validate (Steps 7–9).
Step 4 - Resolve The Intended Contribution
Before drafting, identify from the user's request:
- the intended audience, using the collection default when the task does not narrow it;
- the governing question, target claim, or practical purpose (for a document that directs someone to act, this becomes the intent that opens it; see "Directive text" under Universal Mechanics);
- what the reader should understand, infer, or do because this document exists; and
- any scope or angle needed to distinguish it from materially different documents 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 a document-specific claim or purpose. Resolve that choice from the task 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 another applicable input and no explicit precedence resolves the conflict, ask the user rather than silently amending the commission.
When the request fixes boundaries a later writer could not infer from the finished document (passages another artifact relies on, deliberate exclusions, a claim that must not be expanded, decisions reserved for the user), write a brief for it: the sibling <stem>.brief.md under the write-brief type, and brief: <stem>.brief.md in the target's frontmatter. Write the brief from the request, not from your draft. Skip it when the commission is only a claim and its reader update; the title and opening carry that.
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 materially different contributions still fit, treat that as a specification gap rather than something a stronger model should guess: ask one focused question, or use an exploratory workshop when determining the contribution is itself the work. When the contribution is determined but its claims still need substantial grounding or synthesis, stop and explain why the ordinary path is insufficient. Offer the multistage writing procedure and follow it only after explicit confirmation.
External-literature boundary. Pre-write search in Step 5 is intra-KB only. Do not search the external literature for missing prior art and do not infer novelty from the absence of a named source. If the user explicitly asks whether a document duplicates, restates, or is subsumed by external literature, or asks for a literature disposition of the document on that basis, follow the multistage writing procedure with the same target and request. That explicit request supplies the confirmation required above; do not ask the user to authorize the handoff again. The multistage skill loads the specialised literature-disposition procedure.
Step 5 - Orient Before Writing
- Reuse a matching report. Check loaded context, including input from the calling session, for a completed orientation report covering the current claim, scope, and key attributions. Verify that it scanned the target collection. Rerun orientation when the claim, scope, or key attributions materially shift, including when drafting introduces a key attribution absent from the handoff.
- Prepare the handoff. After settling the commission, assemble the four-part input specified in Orient before writing: (a) governing question or target claim, (b) scope and explicit exclusions, (c) key premises and proposed attributions (sketch the thesis in three to five bullets first when that helps expose its premises and attributions), and (d) kind of move. Omit raw source prose and keyword lists. Supply the invoking workspace and target collection as routing information.
- Run orientation if needed. Invoke Orient before writing in a fresh read-only worker when the harness supports delegation at this depth. A calling session may instead resolve the commission, run orientation first, and pass the handoff and report into this forked writer. If nested delegation is unavailable or a worker launch fails, fall back to running the reporter's claim-title scan and concept search directly in your own context. If orientation still cannot complete, report the gap and stop before saving.
- Apply the findings. Check each consequential match's status and authority (for example, an accepted ADR versus a competing live proposal). Open one or two matched notes when the quoted passages leave bearing or authority unclear. Incorporate authoritative constraints that narrow or qualify the claim within the settled commission. If an authoritative match directly contradicts the user's stated claim or already covers the commissioned contribution, stop and report the match. Offer
cp-skill-editfor an existing target; do not edit it. - Keep the report transient. Keep raw reports in working context. Never store orientation quotes or search traces in
<stem>.brief.md. Promote only operator-agreed, lasting boundary rulings into## Must keepor## Must exclude, under Step 4's write-brief rules.
Use orientation matches, relevant documents already loaded for the write (including sources and ingests), and user-named targets as link candidates. Cite constraining notes where the source document's COLLECTION.md authorizes the destination and an appropriate label. Leave broader post-write graph placement to cp-skill-connect.
Step 6 - Draft The Candidate
Follow the type-spec doc and collection conventions. Derive a lowercase-hyphenated filename from # Title. For typed documents, write the type as its spec's path under a KB root, such as types/note.md or reference/types/adr.md.
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 the note type) — take the vocabulary from there, not from a remembered list.
Draft the complete candidate in working context without creating or changing the target file. The source-dependency guard in Step 7 must finish before the first durable target write.
Step 7 - Guard Named Source Dependencies
Before saving, if the request, brief, finding, or candidate adds or materially changes a claim supported by a named external source, follow Guard named source dependencies. A passing mention is not support.
Step 8 - Save
If the resolved filename is already occupied, stop without overwriting it. Only after Step 7 passes, write the complete candidate to the resolved target path. This is the first durable target write.
Step 9 - Validate
Validate the new document, and its brief if you wrote or changed one:
commonplace-validate path/to/file.md
Fix structural failures before stopping.
After writing, suggest cp-skill-connect as the next step for the post-write graph discovery that Step 5 leaves to it. The suggestion is required; it does not authorize applying a report.
Universal Mechanics
These apply to every document regardless of collection; the frontmatter rules apply to typed documents.
Frontmatter makes documents queryable. No frontmatter means implicit text; any file with frontmatter must include a path-valued type:. Most library documents also need description (double-quoted, 50-250 chars), plus optional traits, tags (write tags: [a, b] on one line so lexical by-tag rg searches match it), and user-verified. Never grant user verification implicitly.
Descriptions are retrieval filters, not summaries. The test: if an agent searched for this document's concept and got 5 results, would this description help pick this one? Paraphrasing the title adds zero retrieval value.
Directive text. Apply this whenever a document, or a section of one, directs someone else to act: a procedure, skill, plan, request, test protocol, handoff, or message.
- State the intent before any particular instruction. Say what the result is for or what decision it feeds, what end state counts as done, and which boundaries bind every route.
- Then give the particular instructions as a supported route. Fix a step, its order, or its method only when a binding reason requires it, such as a dependency, an external commitment, a coordination need, or results that must compare across executors. Otherwise, say that the executor may take another route to the same end state.
- Expect partial execution. Say which parts matter most, accept a partial or coarse answer, and state what a missing or negative answer changes.
- When the answer comes from someone outside your control, ask for the detail the decision needs and no more. Let them withhold the rest, and ask for cost as well as outcome when a costly success would change the decision.
This borrows one idea from Auftragstaktik (mission command): when execution will meet conditions the author cannot foresee, give the executor the intent and the boundaries, and leave the means to them. Only that idea applies here. Command hierarchy, obedience, and the adversarial setting of the military doctrine do not (rationale: intent-framed delegation).
Literal language. Prefer literal wording when a metaphor or idiom would mainly add flourish, interpretation work, or unintended connotations. Keep figurative wording when it is conventional and precise or clarifies the explanation; an available literal alternative alone does not make a metaphor a problem.
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 edit otherwise untouched passages only to add vocabulary links. Keep one term for one concept through the document: do not vary a word for variety, because in technical prose a changed word reads as a changed referent.
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 document is worked up from a source, classify the edge in order — (1) if the source only motivated or corroborated it, use a non-lineage label; (2) if substantive claims are reconstructible from the source plus stated premises, derived-from / Derived into:; (3) if it generalizes beyond the source, abstracted-from / Abstracted into:; (4) if it adds executable ordering/defaults/stops without new substantive claims, operationalized-from / Operationalized into: (where authorized); (5) otherwise, if reshaped from the source for a new use, adapted-from / Adapted into: (where authorized). Label mixed artifacts by their dominant regime, never stack two lineage edges on the same pair, and record the forward pointer in a dedicated footer section below Relevant Notes: at the source (Distilled into: is retired; details in link-vocabulary.md). The produced document does not link back merely to mirror the edge.
Renames: never rename manually. Use commonplace-relocate-note to update backlinks.