Curate a project reference library. Import external documents with structured front-matter so other CPM skills can discover and use them as context. Triggers on "/cpm:library".
Import external documents into a curated docs/library/ directory with structured YAML front-matter. Other CPM skills automatically discover and reference these documents during planning and execution.
Parse $ARGUMENTS to determine the action:
$ARGUMENTS is exactly consolidate (no file path after it), proceed to the Batch Front-Matter Workflow below.$ARGUMENTS starts with consolidate followed by a file path (e.g. consolidate docs/library/coding-standards.md), extract the file path and proceed to the Consolidation Workflow below.$ARGUMENTS is a file path or URL, use it as the source document for intake.Import a document into the project library with generated front-matter.
State tracking: Before starting Step 1, create the progress file (see State Management below). Each step below ends with a mandatory progress file update — do not skip it. After saving the final library document, delete the file.
Read the source document:
Present a brief summary of the document to the user — what it covers, how long it is, what kind of content it contains (standards, architecture, guidelines, etc.).
Update progress file now.
Analyse the document content and generate the six required front-matter fields:
title: A clear, concise title derived from the document's heading or content.source: The original file path or URL the document was imported from.added: Today's date in YYYY-MM-DD format.last-reviewed: Same as added (first import is the first review).scope: Array of CPM skill names this document is relevant to. See Auto-Scope Suggestion below.summary: A CPM-oriented distillation of the document — actionable constraints, decisions, rules, and conventions that downstream skills need. This is NOT a human abstract; it's written for CPM skills to use during triage. Keep it to 2-5 sentences focused on what matters for planning and implementation.Analyse the document content to suggest which skills should reference it. Use these heuristics:
| Content signals | Suggested scope |
|---|---|
| Architecture decisions, system design, component boundaries, integration patterns | discover, spec, do |
| Coding standards, style guides, naming conventions, linting rules | do |
| API contracts, data models, schema definitions | spec, stories, do |
| Business rules, domain logic, workflow descriptions | discover, spec, stories |
| Security policies, compliance requirements, access control | spec, do |
| Team conventions, process guidelines, collaboration norms | all |
| Glossaries, terminology, domain language | all |
Present the suggested scope to the user with AskUserQuestion. Show the suggested values and let them adjust:
Valid scope values: discover, spec, stories, do, party, all. The value all is a shorthand that matches every skill — don't combine it with individual skill names.
Present the complete generated front-matter to the user for confirmation before proceeding.
Update progress file now.
docs/library/ directory if it doesn't exist.coding-standards.md, architecture-decisions.md, api-contracts.md.---