Skip to content

Document Format

An Archcore document is a Markdown file with YAML frontmatter and a <slug>.<type>.md filename. The parser requires title and status, accepts tags, and retains every other frontmatter key without interpreting or validating it. From CLI v0.8.3, update_document writes those retained keys back after title, status, and tags, so a key you add by hand survives an update through the MCP tool.

Every document follows the <slug>.<type>.md pattern. See Documents & Layout for full naming rules, valid types, and directory organization.

Every document requires YAML frontmatter with title and status:

---
title: Use PostgreSQL as Primary Database
status: accepted
---
FieldTypeDescription
titlestringHuman-readable document title. Must not be empty
statusstringDocument status: draft, accepted, or rejected
StatusMeaning
draftWork in progress (default for new documents)
acceptedFinalized or approved
rejectedSuperseded, abandoned, or declined (preserves history)

Tags are cross-cutting labels. They categorize a document by team, domain, or topic, which the directory structure alone cannot express.

---
title: E2E Auth Flow Testing
status: accepted
tags:
- frontend
- team:backend
- payment_flow
---

Tags must match ^[a-z][a-z0-9_:|-]*$: lowercase, with hyphens, underscores, colons, and pipes allowed. Colons enable namespace-like conventions (e.g., team:payments). Tags are stored sorted and deduplicated. Invalid tags are rejected with a “did you mean?” hint.

When tags are absent, the field is omitted from output. Documents without tags parse and work normally.

tags is the only optional frontmatter field. The parser interprets exactly three keys: title, status, and tags. Any other key (for example, an arbitrary meta: block) is retained as written: Archcore does not interpret or validate it, and update_document writes it back after the three owned keys.

After the frontmatter, the content is standard Markdown. Each document type has sections generated by the template.

Only the frontmatter is validated when a document is written: title must be present and non-empty, and status must be draft, accepted, or rejected. The body is measured separately by the precision checks, which report a missing section, a vague word, or a misplaced requirement after the write. Those findings are advisory and never reject a document.

Documents may reference source code using @-notation:

See the implementation at @cmd/init.go and @internal/config/config.go.

This is optional but helps agents navigate between documentation and code.

The Archcore plugin loads shared writing rules and the selected document type’s content contract before composing a document. The contract defines what the document needs to say; the prose profile defines how to say it. A Markdown body remains editable text, but the plugin does not treat it as an unrestricted essay.

JobHow to write itExample types
State an obligationOne requirement, a named actor, one uppercase BCP 14 modal; put a condition before the obligationspec, rule
Give a procedureOne action per step, written as an imperative without a requirement modalguide, task-type, tasks in a plan
Explain a decision or findingState the claim, its reasons, evidence, and trade-offs; do not turn the argument into obligationsadr, rfc, research
Record reference informationUse named fields or tables for enumerable facts, with brief explanations where neededdoc, evidence

For example, a requirement can say:

When a token has expired, the API MUST reject the request with HTTP 401.

A procedure instead says:

Run archcore --version to check the installed version.

A decision record explains why the choice was made and which alternatives were rejected. It does not require MUST in every sentence. These examples illustrate prose forms, not rules your project must adopt.

Lead with the result or conclusion. Use one term consistently, separate facts from assumptions, and name current versus planned behavior. Replace claims such as “fast” or “scalable” with evidence and measurement context; mark an ungrounded technical claim [assumption] rather than presenting it as established behavior.

Reference implementation through @path/to/file instead of copying function bodies. Preserve literal examples when their exact form is the point, such as commands in a guide or before-and-after code in a cpat. Connect Archcore documents through relations rather than maintaining a second related-document list in the body.

The sentence-focused profile uses clauses of at most 25 words and procedure steps of at most 20 words. The argument-focused profile preserves reasoning and evidence rather than forcing every statement into a short requirement. The profile table lists the assignment for every type.

These are internal profiles inspired by ASD-STE100 and ISO plain-language principles, not a claim of standards certification. The plugin writing rules describe the authoring conventions.

The plugin applies the conventions before a write. The CLI’s precision checks report a mechanical subset afterwards. They can identify a missing heading or a long clause; they cannot establish whether an argument is sound or a factual claim is true.

A successful write does not mean that every writing rule passed. Findings are advisory, and accepting a document remains your decision. The reference below distinguishes measured checks from the broader authoring guidance.

When you create a document through the create_document MCP tool without providing content, Archcore generates a template with all required and recommended sections for that type.

For example, an ADR template includes:

## Context
[Describe the situation and problem]
## Decision
[What was decided and why]
## Alternatives Considered
[Other options that were evaluated]
## Consequences
### Positive
- [Benefit 1]
### Negative
- [Trade-off 1]
### Risks
- [Risk 1]
## Implementation Notes
[Key implementation details]

Precision checks report document structure and writing findings. They are advisory; they do not establish factual accuracy.

Every document type carries one of two profiles. The profile decides which checks may report on the type, so an adr is never measured by a step’s word cap and a guide is never graded for a modal it does not owe.

ProfileMeaningTypes
STELines instruct or obligatespec, rule, guide, task-type, brs, strs, syrs, srs
ISOLines argue or describeadr, rfc, doc, evidence, scenario, prd, plan, idea, rnd, research, journey, cpat, mrd, brd, urd

Two further tables decide which numbered items a check may read at all.

TableTypes and sectionsWhat the items are
Graded clausesspec: Normative Behavior, Failure Behavior. rule: RuleRequirements graded with a BCP 14 modal
Procedure stepsguide: Steps. task-type: Steps. plan: TasksActions the reader takes
Actor-subject stepsscenario: Flows, Examples. journey: JourneysActions an actor takes, or Given/When/Then observations

A numbered item outside these sections is prose. In an actor-subject section, a line that opens with Given, When, Then, And, or But is a step whether or not it carries a number. An adr enumerates its alternatives without owing them a modal, and the four ISO 29148 types carry their requirements as identified table rows rather than numbered clauses, so neither is graded as a clause.

FindingFires when
Vague wordingThe body uses a word or phrase from the vagueness lexicon. Headings are excluded. Up to 5 offenders are named
Missing sectionA required ## section for the type is absent. See Checked sections
Foreign sectionThe body carries a heading whose content another type owns. See Content ownership
Frontmattertitle is missing or empty, or status is missing or invalid
Placeholder bodyThe body is under 200 characters, counted in characters so a short non-ASCII document is flagged the same way
Cross-document linksThe body links other .archcore/ documents instead of using add_relation. Up to 3 are named
Long code blockA code block of 5 or more lines in a type that argues rather than instructs: adr, rfc, doc, prd, idea, plan, mrd, brd, urd, brs, strs, syrs, and srs. Other types are exempt. A rule, a guide, a cpat, and an evidence need the literal text, because that text is the artifact
RestatementA statement survived a move from a linked document nearly word for word. See Restatement

The vagueness lexicon covers English (appropriate, robust, scalable, modern, various, optimal, efficient, flexible, convenient, seamless, streamlined), Russian stems (оптимальн, удобн, правильн, надёжн, надежн, гибк, современн, передов, эффективн, масштабируем), and the phrases best practices, as needed, world class, and cutting edge.

These read the graded clauses and the procedure steps of the type, so a type outside both tables never receives them.

FindingFires when
Requirement over 25 wordsA graded clause runs past the word cap
Step over 20 wordsA procedure step or an actor-subject step runs past the word cap
Compound requirementA graded clause carries two modals. MUST NOT counts once
Condition after the obligationA graded clause states its trigger after the response instead of opening with WHEN, WHILE, or IF
Open-ended listA clause or step ends with etc., and so on, и т.д., or и т.п.
Ambiguous alternativeA clause or step uses and/or or и/или
BCP 14 modal in a stepA procedure step or an actor-subject step carries MUST, SHOULD, SHALL, or MAY
BCP 14 modal in a claimA numbered item of an ISO-profile type carries a modal. The graded behavior belongs in a linked spec or rule

Modals are matched case-sensitively. A lowercase must in prose is not a graded obligation and is not reported.

TypeFindingFires when
specSHALL notationThe body uses SHALL instead of MUST, SHOULD, or MAY
spec, scenario, journeyOversized bodyThe body exceeds 120 lines. The finding names the line count and the cap
specSubjectless passiveA graded clause states an obligation with no obligated component as its subject. Up to 3 are named
prdEARS clause in a requirementA numbered requirement opens with WHEN, WHILE, or IF. A prd requirement states an outcome, and the trigger and response form belongs in a spec
ruleNo file targetNo graded clause names a path or a glob, so the code-alignment injection can never match the rule to an edited file
ruleEnforcement names no verifierThe Enforcement section names no hook, lint rule, CI step, or test, and does not say manual review
adrBullets in ContextThe Context section uses a bullet list. Fenced blocks are excluded
adrOne alternative recordedAlternatives Considered holds a single item
adrAlternative with no stated reasonAn alternative does not say what ruled it out. Up to 5 are named
cpatBefore or After holds no code blockThe section describes the form that changed instead of showing it
scenarioFlow without an Anchors lineA ### subsection under Flows has no line that opens with Anchors:
scenario, journeyStep opens with no actorA step under Flows or Journeys opens with neither an actor from the Actors table nor Given, When, Then, And, or But. Skipped when the Actors table is absent
ThresholdValue
Findings per report12
Minimum body length200 characters
Graded clause length25 words
Procedure step length20 words
spec, scenario, and journey body length120 lines each
Code block length in an ISO-profile type5 lines
Restatement overlap0.85
Documents read per restatement check5

The missing-section check reads this table. It is narrower than the generated template: a template offers sections the author may fill, and this table lists the ones the type owes its reader.

A heading matches by prefix, followed by whitespace or the end of the line. ## Purpose & Scope therefore satisfies Purpose, and ## Purposeful does not.

TypeChecked sections
adrContext, Decision, Alternatives Considered, Consequences
rfcSummary, Motivation, Detailed Design, Drawbacks, Alternatives
ruleRule, Rationale, Enforcement
guidePrerequisites, Steps, Verification
specPurpose, Surface, Normative Behavior, Conformance
docOverview
prdVision, Problem, Goals, Requirements
ideaIdea, Value, Risks and Constraints
rndApproach, Findings, Recommendation, Next Action
researchGoal, Scope, Coverage, Sources, Findings, Synthesis, Open Gaps
evidenceLocator, Extract, Notes
planGoal, Tasks, Acceptance Criteria
mrdMarket Landscape, Competitive Analysis, Market Needs
brdBusiness Objectives, Stakeholders, Success Metrics and ROI
urdUser Personas, User Requirements, Acceptance Criteria
brsBusiness Purpose and Scope, Mission, Goals and Objectives, Business Constraints, Success Criteria
strsPurpose and Scope, Stakeholder Classes, Stakeholder Requirements, Operational Concept
syrsSystem Purpose and Scope, System Requirements, System Interfaces, Verification Approach
srsPurpose and Scope, Software Requirements, External Interfaces, Verification Matrix
task-typeWhen to Use, Steps
cpatWhy, Before, After, Scope
scenarioSubject, Actors, Flows, Examples, Open Questions
journeyIntent, Actors, Journeys, Open Questions

Several sections accept an older spelling so a rename does not turn existing documents into findings. Alternatives satisfies Alternatives Considered, Procedure satisfies Steps, Contract Surface satisfies Surface, Rationale satisfies a cpat’s Why, ConOps satisfies Operational Concept, and Verification satisfies both Verification Approach and Verification Matrix.

Each kind of content has one owning document type and one section inside it. A track produces several documents on one topic and links them with implements, so the boundary decides which document a statement belongs in.

Content kindOwnerSection
Wanted outcome, beneficiary, thresholdprdRequirements
Measured goal with units and a target valueprdGoals and Success Metrics
Graded behavior: EARS clauses, BCP 14 modalsspecNormative Behavior
Interfaces, signatures, states, field-driven rulesspecSurface
Error, edge, and degradation handlingspecFailure Behavior
Phases, tasks, milestones, delivery datesplanTasks
Rejected alternative and the reason it was rejectedadrAlternatives Considered
Intended user path before a spec existsjourneyJourneys
User flow anchored to codescenarioFlows
Concrete example with data that illustrates a spec clausescenarioExamples

The foreign-section check names a heading whose content another type owns, and names that type:

section ## Normative Behavior in a prd — a spec owns that content; link the two documents instead

Seven types carry an ownership table:

TypeHeadings it must not carryOwner
prdSurface, Normative Behavior, Failure Behavior, Conformance, Solution Overview, Technical Considerationsspec
prdTasks, Timeline, Milestones, Phases, Acceptance Criteriaplan
prdAlternatives Consideredadr
prd, specFlows, Examplesscenario
prd, specJourneysjourney
scenario, journeySurface, Normative Behavior, Failure Behaviorspec
scenario, journeyRequirementsprd
mrd, brd, urdMission, Goals and Objectivesbrs
mrd, brd, urdOperational Concept, Stakeholder Requirementsstrs
mrd, brd, urdSystem Requirements, Verification Approachsyrs
mrd, brd, urdSoftware Requirements, Verification Matrixsrs

Only unambiguous headings carry an owner. A prd names a business constraint inside its Problem Statement without owing the reader a Constraints section, so Constraints is deliberately absent and produces no finding. A rule and a doc have their own Examples section, so the Examples row applies only to prd and spec.

The restatement check compares the written document against the documents its content flows from or into, and names a statement that survived the move nearly word for word.

  • Which documents it reads. Neighbours across implements and extends, in both directions, sorted then capped at 5. related and depends_on are excluded: an association implies no content flow, and a dependency orders two documents without moving text between them.
  • What it compares. List items only, at least 6 content-carrying words long. Prose paragraphs and fenced blocks are skipped, because a paragraph restates by summarizing and this comparison would report those at random.
  • What counts as a restatement. Token overlap at or above 0.85. A copied line scores 1.0; a prd requirement and the spec behavior that grades it score well under the threshold.
  • What it reports. At most 3 findings, one per statement however many neighbours carry it.

The check is deliberately restricted to near-verbatim copies. Two documents on one topic share vocabulary, and paraphrase detection would report exactly the pairs that are meant to differ.

If the sync manifest cannot be loaded, the check returns nothing rather than guessing. A missed finding costs a glance; a wrong one costs trust in the report.