Edit one existing document

Type: types/instruction.md

Target and requested change: $ARGUMENTS

Make the requested change without silently changing the commission, losing evidence, or invalidating a dependent document. For a new document use cp-skill-write. Route automated passes, triage and source rewrites on reviewable notes to cp-skill-revise.

  1. Read the incumbent. Retain its exact bytes for report application. Read its collection's COLLECTION.md and its declared type spec (global types/... under the library root; collection-local paths under the project's KB root). Stop for a missing contract or typed frontmatter without a type. Frontmatter-free text stays untyped. Follow the collection's permitted link destinations and labels. Do not edit immutable snapshots, generated artifacts, or workflow-owned records in place; follow the owning procedure.
  2. Read the sibling named by brief:, if any. A write brief has no brief of its own. Run one backlinks lookup on the incumbent path. Settle the intended change from the request, incumbent and brief; ask if they leave the contribution unclear. Treat a declared brief as authoritative for intent until the operator amends it. Current operator direction prevails; clarify any unresolved conflict before writing. On operator direction, amend or create a paired sibling <stem>.brief.md and its target pointer together under the write-brief contract. Keep lasting intent there, never raw search results. Report which brief item changed.
  3. For local or claim-preserving changes, read linked targets touched by the edit. For refinements within existing linked claims, read the implicated links. Neither requires a KB-wide search. This judgment can miss a constraint outside the neighborhood. If the edit adds a substantive claim or materially changes scope or attribution, reuse only an orientation report covering that change. If the change requires orientation and no matching report exists, follow Orient before writing before saving: supply the governing claim, scope and exclusions, premises and attributions, kind of move, workspace, target collection, incumbent and known links. Supply any connect-report leads as background only. Use a fresh read-only reporter if available; if delegation is unavailable or fails, perform its searches yourself. Stop if required orientation cannot complete. Incorporate authoritative constraints within the commission; ask before changing a contradicted or already covered commission. Recheck if the candidate changes those premises. For unsettled synthesis offer multistage writing; an explicit request for external-literature disposition authorizes that handoff.
  4. A missing connected: date is not a search trigger. During local polish or iteration with matching orientation, edit without interruption and suggest connecting once the draft settles. A connect report is link context, never orientation for a new claim. For a small settling edit, if the current report digest matches and the date is absent or older than the report, offer once to incorporate it. Neither date proves application. Apply only on explicit authorization for that report and target. For a digest mismatch or major reshaping, edit first and recommend rediscovery or explicit re-review afterward.
  5. Preserve existing links and metadata unless the edit requires changing them. Remove connected: on major scope changes. Remove user-verified for substantive changes; preserve it on an authorized mechanical trivial change or a change that only sets connected:. On an ingest, report application must leave capture metadata and Quotes unchanged.

Apply a connect report interactively

Decide which, if any, of the report's connections to add to one existing, editable target. Use this branch only when the user authorizes applying the report to that target. Discovery, review-only requests, and ordinary writing do not authorize application. Do not edit neighbors, indexes, the report, or any other artifact based on its recommendations. Do not combine application with a major scope shift or rewrite; discover connections for the revised artifact separately.

  1. Resolve one report from the request or the current connect-report path for the target. Read it in full. Require type: types/connect-report.md and a source that identifies the exact workspace-relative target, not merely a matching basename. If the report is missing, ambiguous, unreadable, incomplete, or for a different source, stop and report the problem. Handle missing or malformed digests separately below. A report on an immutable snapshot is not the report on its authored companion.
  2. Use the exact bytes retained when you first read the incumbent. Run commonplace-note-hash <target-path> and compare the output to the report's source_sha256 before considering any candidate for application, whether or not the target already has connected:. If hashing fails or the live bytes no longer match the incumbent, stop and report the problem. A digest match means the hashed source text is unchanged, not that the connections are current. Neither date identifies a report or proves it was applied, even when the dates differ.
  3. If the digest is missing, malformed, or mismatched, do not apply the report as-is. Report the reason and request rediscovery or explicit authorization to re-review it against the current target. In a re-review, use the old report only as leads and independently reassess candidates on the current text. In either case, check the candidates against the current artifacts, collection rules, and target type. Keep only authorized, useful, nonduplicate outbound links; resolve links from the target's path, not the report's.
  4. Complete and report the decision, including an explicit decision to add no links. When the loaded target type permits connected:, set it to the application date as a quoted "YYYY-MM-DD", even on a completed zero-link decision. Do not copy the report's date. If the user's scope excludes that metadata edit, clarify scope before applying. For an ineligible type, never add the field; if no links are selected, leave the file unchanged. Do not stamp an incomplete, blocked, or review-only result.
  5. Before saving, require the live target to still have the exact bytes you reviewed. If it changed, stop without writing and repeat the check and review against the new incumbent before applying. If the candidate is identical to the incumbent, do not rewrite it. After validation, tell the user which report was reviewed, what changed, and whether connected: was set.

Save and validate

Draft the candidate before writing. 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. Compare against the incumbent; unchanged source-dependent wording does not retrigger the guard. After the guard passes, save the candidate. Validate the target and any changed brief with commonplace-validate <path>; fix structural failures. After ordinary edits suggest cp-skill-connect for discovery, not automatic application.

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.