Constructdocs
section · guides

Generate artifacts (PRDs, ADRs, RFCs)

Create structured documents from templates, stamp intake provenance, and keep the record clean.

3 min read·guides / cookbook / generate-artifacts

Construct supports every document class registered in specialists/artifact-manifest.json, including PRDs, ADRs, RFCs, memos, runbooks, research briefs, and project-specific registered classes. Use construct artifact workflow when the request includes review, rewriting, validation, branding, or a distribution format; unknown classes ask for classification or registration instead of silently becoming PRDs. Each class has a template under templates/docs/ and a dedicated lane under docs/.

templates/docs/PRD · ADR · RFC · memodraft artifactdocs/specs/prd/ · docs/decisions/adr/ · docs/decisions/rfc/intake packet.construct/intake/pending/<id>.jsonconstruct intake done--output=<path>construct docs:verify+ lint:comments

Set up doc lanes for a new project

construct init --with-all-docs

Creates the requested documentation lanes such as docs/specs/prd/, docs/decisions/adr/, docs/decisions/rfc/, docs/notes/memos/, and docs/operations/runbooks/. For a narrower setup, use flags such as --with-adrs, --with-rfcs, --with-runbooks, or --with-docs=adrs,rfcs. with README.md indices and starter templates under each lane's templates/ directory. Safe to re-run on an existing repo.

Generate a class the builtin manifest never registered

The builtin specialists/artifact-manifest.json stays the shipped source of truth and is never modified. To generate a document class it doesn't list, either register it or use the sanctioned adhoc type.

Register a reusable custom class (writes a project template plus a project-tier manifest overlay):

construct templates register convergence-brief \
  --description "Cross-project strategy convergence brief" \
  [--from .cx/templates/docs/convergence-brief.md]

This writes .cx/templates/docs/convergence-brief.md and adds the class to .cx/artifact-manifest.overlay.json, which merges over the builtin by three tiers (builtin → user → project). Afterward get_template("convergence-brief") resolves the project override and author_artifact {type:"convergence-brief", ...} drafts from it through the release gate.

For a one-off with no fixed shape, skip registration and author an adhoc artifact — it needs an explicit title + instructions, follows the instructions for structure, and still passes the full gate:

author_artifact {type:"adhoc", title:"Q3 strategy convergence", instructions:"..."}

adhoc is not a bypass for a registered class (naming a known type through it is redirected), and an unknown non-adhoc class still returns a classification/registration prompt rather than silently becoming a PRD.

Generate a new artifact from a template

# ADR (numbered artifact in docs/decisions/adr/)
cp docs/decisions/adr/templates/_template.md docs/decisions/adr/0045-my-decision.md

# PRD (artifact in docs/specs/prd/; starter lives in init lane templates/docs/prds/templates/)
cp templates/docs/prds/templates/_template.md docs/specs/prd/my-feature.md

Fill in the template. Each template includes a required frontmatter block with status, date, and deciders. If this artifact traces to an intake packet, see "Stamp intake provenance" below.

Stamp intake provenance

When an artifact was produced in response to an intake signal, stamp it before closing the intake:

construct intake done <id> --output=docs/specs/prd/my-feature.md

This writes three fields into the artifact's YAML frontmatter:

---
intake_id: construct-<id>
intake_confidence: 0.82
intake_rationale: Matched keywords: user-signal, churn, dashboard
---

The stamp is refused if the artifact already carries a different intake_id. For artifacts that are intentionally not intake-derived, declare it explicitly:

---
intake: none
---

construct docs:verify warns on any artifact in docs/specs/prd/**, docs/notes/research/**, or .construct/knowledge/internal/** that lacks either field. This keeps the corpus auditable: every document either traces to a source packet or consciously opted out.

Publish after validate passes

Distribution is the last step. Specialists author from templates; construct workflow invoke returns a plan only — it does not draft the document.

construct artifact validate docs/specs/prd/my-feature.md --type=prd
construct publish docs/specs/prd/my-feature.md --strict --figures

construct publish runs the release gate by default. Thin stubs exit 2 with remediation hints. Do not bypass with --no-gate for ship paths or demos.

Verify artifact stamps

construct doc verify docs/decisions/adr/adr-001-storage-backend.md

Confirms the file has a valid auditability stamp (hash, agent, task reference). Exits non-zero if the stamp is missing or corrupted.

construct doc verify docs/

Recursively verifies all markdown files under docs/.

Lint artifact prose

construct lint:comments docs/specs/prd/my-feature.md

Checks artifact prose for fabrication markers: unsupported confidence claims, unattributed numeric claims, customer mind-reading without citations, speculative projections without sources. See Integrity and trust for the full pattern bank.

Audit the mutation trail

construct audit trail

Shows every mutation logged by the system (agent, file, hash, timestamp). Useful for tracing which agent created or last modified an artifact. Supports --agent, --since, --verify, and --json.

List artifacts by type

Artifacts are plain markdown files in their lanes:

ls docs/specs/prd/
ls docs/decisions/adr/
ls docs/decisions/rfc/
ls docs/notes/memos/

Reference