Skip to content

Conversation

@eamonnfaherty
Copy link

@eamonnfaherty eamonnfaherty commented Jan 23, 2026

Changes required to support architectural decision records that would help users manage decisions that cross multiple specs.

Summary by CodeRabbit

  • New Features

    • Adds Architectural Decision Records (ADRs) as first-class documents alongside specs
    • CLI support to list, show (summary/full), validate, and archive ADRs
    • ADRs integrated into AI agent context and cross-referenced with specs
    • Support for customizable ADR templates via project configuration
  • Documentation

    • Comprehensive ADR workflow, templates, validation, migration, and agent guidance added
  • Chores

    • Migration path and tooling guidance provided for adopting ADRs

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 23, 2026

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

📝 Walkthrough

Walkthrough

Adds first-class support for Architectural Decision Records (ADRs): a two-file ADR format (decision.md + adr.md), parallel adrs/ directory and delta workflows, template resolution and config, CLI commands (list/show/validate/archive) extended for ADRs, AI/instruction-loader context integration, migration plan, and proactive ADR detection.

Changes

Cohort / File(s) Summary
Design & Roadmap
openspec/changes/add-architectural-decision-records/design.md, .../proposal.md, .../tasks.md
Adds ADR design, CLI/agent integration strategy, implementation task list, migration phases, risk notes, and proactive ADR detection heuristics.
ADR Governance & Formats
openspec/changes/add-architectural-decision-records/specs/adr-management/spec.md, specs/openspec-conventions/spec.md, specs/change-creation/spec.md
Defines two-file ADR structure, directory/naming conventions, delta-based ADR change model (ADDED/MODIFIED/REMOVED/RENAMED), template semantics, cross-referencing rules, lifecycle and validation rules.
CLI Extensions & Config
specs/cli-list/spec.md, specs/cli-show/spec.md, specs/cli-validate/spec.md, specs/cli-archive/spec.md, specs/cli-config/spec.md
Specifies CLI behavior for listing, showing (summary/full/JSON), validating, archiving ADRs, template config resolution via openspec/config.yaml, and error/edge-case handling.
AI / Instruction Loader Integration
specs/instruction-loader/spec.md, specs/docs-agent-instructions/spec.md
Specifies loading ADR summaries into AI context, on-demand full rationale loading, agent heuristics for proactive ADR creation, and guidance for referencing ADRs in proposals.
Change Processing Rules
specs/cli-archive/spec.md, specs/change-creation/spec.md
Defines ordered delta application (RENAMED → REMOVED → MODIFIED → ADDED), atomic/rollback semantics, conflict detection, and scaffolding rules for ADR deltas in change proposals.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant User as User
  participant CLI as "openspec CLI"
  participant FS as "Repository (specs/, adrs/, templates/)"
  participant Instr as "Instruction-loader / AI"
  participant Repo as "Change Processor / Archive"

  rect rgba(200,230,255,0.5)
    User->>CLI: run command (list/show/validate/archive)
    CLI->>FS: read adrs/ and openspec/config.yaml
    CLI->>Instr: request ADR context (decision.md)
    Instr->>FS: load decision.md (on-demand adr.md)
  end

  rect rgba(200,255,200,0.5)
    CLI->>Repo: apply change deltas (RENAMED→REMOVED→MODIFIED→ADDED)
    Repo->>FS: create/update/archive adrs/[decision]/{decision.md,adr.md}
    Repo-->>CLI: report result / errors
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • TabishB

Poem

🐰 I nibble at decisions, neat and small,
A short note hops (decision.md), then the full tale calls.
Templates tumble—project, global, built-in thrall,
Agents sniff the crumbs and craft ADRs for all,
Deltas dance: ADDED, MODIFIED, REMOVED—spring’s call. 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main objective of the changeset: introducing Architectural Decision Records (ADRs) as a new system to manage cross-cutting architectural decisions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link

greptile-apps bot commented Jan 23, 2026

Greptile Summary

This PR adds comprehensive Architectural Decision Records (ADRs) support to OpenSpec, introducing a two-file structure (decision.md for summaries and adr.md for full rationale) to efficiently document cross-cutting architectural decisions that affect multiple specs.

Key Changes:

  • Adds parallel openspec/adrs/ directory structure alongside specs/ to reflect ADRs' one-to-many relationship with specs
  • Implements two-file ADR format optimized for AI context efficiency (~200 tokens per summary vs ~1000+ for full ADRs)
  • Extends all CLI commands (list, show, validate, archive) with ADR support using consistent delta-based workflow
  • Adds customizable template system with three-tier resolution (project → global → built-in default)
  • Integrates ADRs into AI agent context for architectural consistency across proposals
  • Creates comprehensive specs covering ADR management, CLI integration, and conventions

Issues Found:

  • change-creation/spec.md:10 - Path reference incomplete (should mention both files)
  • cli-validate/spec.md:18 - Section name mismatch ("Decision" should be "Decision Rationale")

Confidence Score: 4/5

  • Safe to merge after fixing two minor syntax issues in spec files
  • Well-designed feature with comprehensive documentation and clear rationale. The two issues found are minor specification inconsistencies that don't affect the core design - just need text corrections to align terminology across specs. The proposal follows OpenSpec conventions properly with delta format, scenarios, and proper documentation structure.
  • change-creation/spec.md and cli-validate/spec.md need minor corrections for consistency

Important Files Changed

Filename Overview
openspec/changes/add-architectural-decision-records/design.md Thorough design decisions with clear rationale for two-file structure, parallel directory structure, and template system
openspec/changes/add-architectural-decision-records/specs/adr-management/spec.md Comprehensive spec defining ADR structure, two-file format, templates, change proposals, and AI context integration
openspec/changes/add-architectural-decision-records/specs/change-creation/spec.md Defines ADR change workflow with one path inconsistency on line 10 that needs correction
openspec/changes/add-architectural-decision-records/specs/cli-validate/spec.md Comprehensive validation spec with one section name mismatch on line 18 that needs fixing
openspec/changes/add-architectural-decision-records/specs/openspec-conventions/spec.md Comprehensive conventions update with clear distinction between specs and ADRs, format structure, and cross-referencing

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI
    participant Parser
    participant Validator
    participant FileSystem
    participant AIAgent

    Note over User,AIAgent: Creating ADR Change Proposal
    User->>CLI: openspec create change add-auth-decision
    CLI->>FileSystem: Create changes/add-auth-decision/
    CLI->>FileSystem: Create adrs/auth-strategy/decision.md
    CLI->>FileSystem: Create adrs/auth-strategy/adr.md
    FileSystem-->>User: ADR scaffold created

    Note over User,AIAgent: Validating ADR Change
    User->>CLI: openspec validate add-auth-decision --strict
    CLI->>Parser: Parse ADR deltas
    Parser->>Parser: Extract ADDED/MODIFIED/REMOVED Decisions
    Parser-->>CLI: Parsed deltas
    CLI->>Validator: Validate ADR format
    Validator->>Validator: Check required sections (Context, Options, Decision Rationale, Consequences)
    Validator->>Validator: Verify no conflicts with existing ADRs
    Validator-->>CLI: Validation results
    CLI-->>User: Validation passed

    Note over User,AIAgent: Archiving ADR Change
    User->>CLI: openspec archive add-auth-decision
    CLI->>Validator: Pre-archive validation
    Validator-->>CLI: Valid
    CLI->>Parser: Process ADR deltas in order
    Parser->>FileSystem: Apply RENAMED decisions
    Parser->>FileSystem: Apply REMOVED decisions
    Parser->>FileSystem: Apply MODIFIED decisions (update files)
    Parser->>FileSystem: Apply ADDED decisions (create directories and both files)
    FileSystem-->>CLI: ADRs updated
    CLI->>FileSystem: Move change to archive/
    CLI-->>User: Archive complete

    Note over User,AIAgent: AI Agent Using ADRs
    AIAgent->>CLI: Request project context
    CLI->>FileSystem: Load all decision.md files (~200 tokens each)
    FileSystem-->>CLI: ADR summaries
    CLI-->>AIAgent: Context with ADR summaries
    AIAgent->>AIAgent: Create proposal referencing relevant ADRs
    AIAgent->>CLI: Need full rationale for auth-strategy
    CLI->>FileSystem: Load adrs/auth-strategy/adr.md
    FileSystem-->>CLI: Full ADR content
    CLI-->>AIAgent: Full rationale provided
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

12 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

#### Scenario: Creating change with ADR deltas

- **WHEN** creating a change proposal that includes architectural decisions
- **THEN** create ADR delta files under `openspec/changes/[change-name]/adrs/[decision-name]/adr.md`
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Path should reference both files in the ADR, not just adr.md. The two-file structure requires both decision.md and adr.md.

Suggested change
- **THEN** create ADR delta files under `openspec/changes/[change-name]/adrs/[decision-name]/adr.md`
- **THEN** create ADR delta files under `openspec/changes/[change-name]/adrs/[decision-name]/` with both `decision.md` and `adr.md`
Prompt To Fix With AI
This is a comment left during a code review.
Path: openspec/changes/add-architectural-decision-records/specs/change-creation/spec.md
Line: 10:10

Comment:
**syntax:** Path should reference both files in the ADR, not just `adr.md`. The two-file structure requires both `decision.md` and `adr.md`.

```suggestion
- **THEN** create ADR delta files under `openspec/changes/[change-name]/adrs/[decision-name]/` with both `decision.md` and `adr.md`
```

How can I resolve this? If you propose a fix, please make it concise.

#### Scenario: Validating ADR format

- **WHEN** validating an ADR delta
- **THEN** the command SHALL check for required sections: Context, Decision, Options Considered, Consequences
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: Listed section name Decision doesn't match the actual adr.md format which uses Decision Rationale (per adr-management/spec.md:56 and openspec-conventions/spec.md:149).

Suggested change
- **THEN** the command SHALL check for required sections: Context, Decision, Options Considered, Consequences
- **THEN** the command SHALL check for required sections: Context, Options Considered, Decision Rationale, Consequences
Prompt To Fix With AI
This is a comment left during a code review.
Path: openspec/changes/add-architectural-decision-records/specs/cli-validate/spec.md
Line: 18:18

Comment:
**syntax:** Listed section name `Decision` doesn't match the actual `adr.md` format which uses `Decision Rationale` (per `adr-management/spec.md:56` and `openspec-conventions/spec.md:149`).

```suggestion
- **THEN** the command SHALL check for required sections: Context, Options Considered, Decision Rationale, Consequences
```

How can I resolve this? If you propose a fix, please make it concise.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@openspec/changes/add-architectural-decision-records/design.md`:
- Around line 36-171: The document has conflicting guidance about ADR file
layout and the Status field: Decision 1 describes a single-file adr.md, while
Decision 4 mandates a two-file layout (decision.md + adr.md) and includes a
Status field that Open Question `#1` argues against; reconcile by choosing one
canonical layout and updating all sections to match it (either adopt the
two-file approach and add the Status field everywhere and remove the single-file
references in Decision 1 and Open Question `#1`, or adopt the single-file approach
and remove decision.md/Status references in Decision 4), and ensure the
examples, directory listing (e.g., adrs/database-strategy/), and template paths
(templates.adr) consistently reflect that choice across Decision 1, Decision 4,
Open Question `#1`, and lines ~280-285.

In
`@openspec/changes/add-architectural-decision-records/specs/cli-validate/spec.md`:
- Around line 58-63: The scenario "Validating standalone ADR" introduces an
undocumented CLI pattern by using `openspec validate [decision-name] --type
adr`; update this by either adding the `--type adr` validate pattern to the CLI
Commands section in proposal.md (documenting `openspec validate [decision-name]
--type adr` and its behavior to validate files under `openspec/adrs/`) or change
the scenario to match the existing documented validate behavior (use `openspec
validate [change] --strict` to validate ADR deltas within changes); refer to the
scenario title "Validating standalone ADR", the command examples `openspec
validate [decision-name] --type adr`, `openspec validate [change] --strict`, and
`openspec show [adr-name] --type adr` when making the edit so the spec and
proposal.md remain consistent.
🧹 Nitpick comments (5)
openspec/changes/add-architectural-decision-records/specs/cli-show/spec.md (1)

7-47: Align scenario step formatting with spec conventions.

Spec guidance requires #### Scenario: headers with WHEN/THEN step lines (no bullets or bold) and avoids AND-only steps. Please reformat these scenarios accordingly to keep the delta spec consistent. As per coding guidelines, use WHEN/THEN structure without bullets/bold.

openspec/changes/add-architectural-decision-records/specs/change-creation/spec.md (1)

7-77: Reformat scenario steps to the required WHEN/THEN style.

Delta spec files should avoid bullets/bold and use plain WHEN/THEN lines under #### Scenario: headers. Please convert the bulleted WHEN/THEN/AND steps accordingly. As per coding guidelines, avoid bullets/bold in scenarios.

openspec/changes/add-architectural-decision-records/specs/openspec-conventions/spec.md (2)

7-179: Scenario steps need the required WHEN/THEN plain-line format.

This spec uses bulleted WHEN/THEN/AND steps; spec conventions require plain WHEN/THEN lines under #### Scenario: and no bullets/bold. Please reformat throughout. As per coding guidelines, use WHEN/THEN structure without bullets/bold.


11-40: Add a language tag to the fenced code block.

Markdownlint flags the project structure block because it lacks a language identifier. Use text (or markdown) to satisfy MD040.

openspec/changes/add-architectural-decision-records/specs/adr-management/spec.md (1)

7-283: Normalize scenario steps to the required WHEN/THEN format.

This spec uses bulleted WHEN/THEN/AND steps. Spec conventions require plain WHEN/THEN lines (no bullets/bold) under #### Scenario: headers. Please reformat to comply. As per coding guidelines, use WHEN/THEN structure without bullets/bold.

Comment on lines +36 to +171
**What**: Create `adrs/` directory at the same level as `specs/`, with similar structure:
```
openspec/
├── specs/ # Functional specifications
│ └── [capability]/
│ └── spec.md
├── adrs/ # Architectural decisions
│ └── [decision-name]/
│ └── adr.md
└── changes/
└── [change-name]/
├── specs/ # Spec deltas
└── adrs/ # ADR deltas
```

**Why**:
- **Cross-cutting nature**: ADRs affect multiple specs, so they can't be nested within a single spec
- Example: "Use DynamoDB for non-SQL storage" affects user-auth, session-management, analytics, etc.
- Placing ADRs at the top level (parallel to specs) reflects their one-to-many relationship
- Clear separation of concerns (functional vs architectural)
- Familiar structure for users already using specs
- Easy to understand which documents serve which purpose
- Each ADR declares its scope (which specs it affects) rather than being owned by one spec

**Alternatives considered**:
- ADRs nested within specs → Rejected: ADRs are cross-cutting; they don't belong to one spec
- Single unified document type with metadata tags → Rejected: Too complex, loses clarity
- ADRs as metadata within specs → Rejected: Pollutes functional specs with architectural details
- Separate repo for ADRs → Rejected: Breaks cohesion, harder to keep in sync
- Multiple ADR copies (one per affected spec) → Rejected: Duplication, inconsistency risk

### Decision 2: Delta-Based Change Workflow for ADRs

**What**: ADR changes follow the same pattern as spec changes:
```markdown
## ADDED Decisions
### Decision: Technology Choice
...

## MODIFIED Decisions
### Decision: Existing Decision
...

## REMOVED Decisions
### Decision: Deprecated Pattern
...
```

**Why**:
- Consistency with existing workflow reduces cognitive load
- Reuse existing validation and archiving infrastructure
- AI agents already understand delta format

**Alternatives considered**:
- Immutable ADRs (new ADR supersedes old) → Rejected: Doesn't match OpenSpec's delta approach
- Freeform ADR updates without deltas → Rejected: Loses traceability and validation

### Decision 3: Template System

**What**: Three-tier template resolution:
1. Project-specific template: `openspec/templates/adr.md`
2. Global config template (future): `~/.openspec/templates/adr.md`
3. Built-in default template: `src/core/templates/adr.md`

Template configuration in `openspec/config.yaml`:
```yaml
templates:
adr: ./templates/adr.md # Optional override
```

**Why**:
- Projects have different ADR needs (microservices vs monolith, security-focused vs startup)
- Default template provides good starting point
- Gradual adoption - templates are optional

**Alternatives considered**:
- No templates, freeform ADRs → Rejected: Loses structure, harder to validate
- Only built-in template → Rejected: Inflexible for diverse projects
- Multiple template types → Rejected: Over-engineering for v1

### Decision 4: Two-File ADR Structure

**What**: Split ADRs into two files for context efficiency:

**File 1: decision.md** (Concise summary, always loaded)
```markdown
# Decision: [Name]

**Status:** Accepted | Proposed | Superseded

**Scope:** [Pattern-based description, not exhaustive list]
Examples: "All capabilities requiring non-relational data storage"

**What:** [One-sentence summary of the decision]

**Key Trade-offs:**
- ✓ Managed service, scales automatically
- ✓ Proven at scale
- ✗ Vendor lock-in
- ✗ Higher cost at low scale

**See:** [Full ADR](./adr.md) for detailed context and analysis.
```

**File 2: adr.md** (Full rationale, loaded on-demand)
```markdown
# ADR: [Decision Name]

## Context
[Detailed background, problem statement, constraints, stakeholders]

## Options Considered
### Option 1: [Name]
- Pros: [Comprehensive list]
- Cons: [Comprehensive list]
- Cost analysis: [Details]

### Option 2: [Name]
[Full analysis...]

## Decision Rationale
[Detailed explanation of why this option was chosen]

## Consequences
[Detailed impacts, migration considerations, rollback strategy]

## References
- [Related specs, ADRs, external resources]
```

**Directory structure:**
```
adrs/database-strategy/
├── decision.md # ~200 tokens - always in context
└── adr.md # ~800-1500 tokens - reference/on-demand
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Resolve internal inconsistencies on ADR file layout and status fields.

Decision 1’s structure shows only adr.md, while Decision 4 requires both decision.md and adr.md. Also, Open Question #1 leans against status fields even though Decision 4 mandates Status in decision.md. Please reconcile these to avoid conflicting guidance.

Also applies to: 280-285

🤖 Prompt for AI Agents
In `@openspec/changes/add-architectural-decision-records/design.md` around lines
36 - 171, The document has conflicting guidance about ADR file layout and the
Status field: Decision 1 describes a single-file adr.md, while Decision 4
mandates a two-file layout (decision.md + adr.md) and includes a Status field
that Open Question `#1` argues against; reconcile by choosing one canonical layout
and updating all sections to match it (either adopt the two-file approach and
add the Status field everywhere and remove the single-file references in
Decision 1 and Open Question `#1`, or adopt the single-file approach and remove
decision.md/Status references in Decision 4), and ensure the examples, directory
listing (e.g., adrs/database-strategy/), and template paths (templates.adr)
consistently reflect that choice across Decision 1, Decision 4, Open Question
`#1`, and lines ~280-285.

Comment on lines +58 to +63
#### Scenario: Validating standalone ADR

- **WHEN** running `openspec validate [decision-name] --type adr`
- **THEN** the command SHALL validate the ADR file directly in `openspec/adrs/`
- **AND** check for required sections and proper format
- **AND** report any format or structural issues
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, read the spec file to understand the requirement structure and context
echo "=== Reading spec file structure ==="
cat -n openspec/changes/add-architectural-decision-records/specs/cli-validate/spec.md

Repository: Fission-AI/OpenSpec

Length of output: 3748


🏁 Script executed:

#!/bin/bash
# Check proposal.md for CLI command documentation
echo "=== Checking proposal.md for CLI documentation ==="
cat -n openspec/changes/add-architectural-decision-records/proposal.md

Repository: Fission-AI/OpenSpec

Length of output: 6547


🏁 Script executed:

#!/bin/bash
# Search for existing validate command patterns in spec files
echo "=== Searching for validate command patterns ==="
rg -n 'validate' openspec/changes/add-architectural-decision-records/specs --glob '*.md' -B2 -A2

Repository: Fission-AI/OpenSpec

Length of output: 10859


The "Validating standalone ADR" scenario uses an undocumented CLI pattern.

The scenario requires openspec validate [decision-name] --type adr to validate ADRs directly in openspec/adrs/, but this pattern is not documented in proposal.md. The proposal documents:

  • openspec validate [change] --strict for validating ADR deltas within changes (line 47)
  • openspec show [adr-name] --type adr for showing ADRs (lines 45-46)

The --type adr flag is only documented for the show command, not validate. Either add this pattern to proposal.md's CLI Commands section, or modify the scenario to align with the documented validate behavior (change-scoped only).

🤖 Prompt for AI Agents
In
`@openspec/changes/add-architectural-decision-records/specs/cli-validate/spec.md`
around lines 58 - 63, The scenario "Validating standalone ADR" introduces an
undocumented CLI pattern by using `openspec validate [decision-name] --type
adr`; update this by either adding the `--type adr` validate pattern to the CLI
Commands section in proposal.md (documenting `openspec validate [decision-name]
--type adr` and its behavior to validate files under `openspec/adrs/`) or change
the scenario to match the existing documented validate behavior (use `openspec
validate [change] --strict` to validate ADR deltas within changes); refer to the
scenario title "Validating standalone ADR", the command examples `openspec
validate [decision-name] --type adr`, `openspec validate [change] --strict`, and
`openspec show [adr-name] --type adr` when making the edit so the spec and
proposal.md remain consistent.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Fix all issues with AI agents
In `@openspec/changes/add-architectural-decision-records/design.md`:
- Around line 37-49: The markdown code fence showing the directory tree (the
triple-backtick block containing openspec/, specs/, adrs/, changes/) is missing
a language tag and triggers markdownlint MD040; update that fenced code block
and all other fenced blocks referenced (lines ~70-82, 101-105, 121-165, 167-171,
206-211, 229-244) to include an appropriate language identifier (e.g., use
"text" for plain trees, "markdown" for markdown snippets, or "yaml" where
applicable) so each triple-backtick block becomes ```text or ```markdown or
```yaml as appropriate.

In `@openspec/changes/add-architectural-decision-records/proposal.md`:
- Around line 97-113: The fenced code block in proposal.md is missing a language
tag causing markdownlint MD040; update the triple-backtick fence that wraps the
example block (the block starting with 'User: "Create a login feature with
session storage"') to include a language identifier (e.g., change ``` to
```text) so the block is properly recognized by markdownlint and renders
consistently.

In
`@openspec/changes/add-architectural-decision-records/specs/docs-agent-instructions/spec.md`:
- Around line 57-69: The fenced code block containing the ADR checklist is
missing a language tag which triggers markdownlint MD040; update the
triple-backtick fence in specs/docs-agent-instructions/spec.md to include a
language tag (e.g., change "```" to "```text") so the block is explicitly marked
as plaintext; ensure only the opening fence is changed and no content inside the
checklist is altered.

In
`@openspec/changes/add-architectural-decision-records/specs/instruction-loader/spec.md`:
- Around line 17-20: Update the scenario line wording to be clearer by changing
“an AI agent needs detailed rationale for a specific ADR” to a tighter phrasing
such as “an AI agent needs a detailed rationale for a specific ADR” or “an AI
agent needs detailed rationale to be loaded for a specific ADR”; modify the line
in the spec block that currently starts with “**WHEN** an AI agent needs
detailed rationale for a specific ADR” to use one of these suggested
alternatives so the intent reads naturally.
♻️ Duplicate comments (1)
openspec/changes/add-architectural-decision-records/specs/change-creation/spec.md (1)

9-11: Align path with the two-file ADR structure.

Line 10 mentions only adr.md; the ADR format requires both decision.md and adr.md.

Comment on lines +37 to +49
```
openspec/
├── specs/ # Functional specifications
│ └── [capability]/
│ └── spec.md
├── adrs/ # Architectural decisions
│ └── [decision-name]/
│ └── adr.md
└── changes/
└── [change-name]/
├── specs/ # Spec deltas
└── adrs/ # ADR deltas
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add language tags to fenced code blocks.

markdownlint MD040 flags these blocks; add a language like text, markdown, or yaml as appropriate.

Also applies to: 70-82, 101-105, 121-165, 167-171, 206-211, 229-244

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

37-37: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@openspec/changes/add-architectural-decision-records/design.md` around lines
37 - 49, The markdown code fence showing the directory tree (the triple-backtick
block containing openspec/, specs/, adrs/, changes/) is missing a language tag
and triggers markdownlint MD040; update that fenced code block and all other
fenced blocks referenced (lines ~70-82, 101-105, 121-165, 167-171, 206-211,
229-244) to include an appropriate language identifier (e.g., use "text" for
plain trees, "markdown" for markdown snippets, or "yaml" where applicable) so
each triple-backtick block becomes ```text or ```markdown or ```yaml as
appropriate.

Comment on lines +97 to +113
```
User: "Create a login feature with session storage"

AI detects:
- "Login feature" → Functional spec needed
- "Session storage" → Architectural decision (database choice)

AI checks:
- Is there an ADR for data storage? No → Create one

AI creates change with BOTH:
├── adrs/database-strategy/ # NEW ADR for database choice
│ ├── decision.md
│ └── adr.md
└── specs/user-auth/ # Spec references the ADR
└── spec.md
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language tag to the fenced block.

markdownlint MD040 flags missing language.

✅ Proposed fix
-   ```
+   ```text
    User: "Create a login feature with session storage"

    AI detects:
    - "Login feature" → Functional spec needed
    - "Session storage" → Architectural decision (database choice)

    AI checks:
    - Is there an ADR for data storage? No → Create one

    AI creates change with BOTH:
    ├── adrs/database-strategy/     # NEW ADR for database choice
    │   ├── decision.md
    │   └── adr.md
    └── specs/user-auth/            # Spec references the ADR
        └── spec.md
    ```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
User: "Create a login feature with session storage"
AI detects:
- "Login feature" → Functional spec needed
- "Session storage" → Architectural decision (database choice)
AI checks:
- Is there an ADR for data storage? No → Create one
AI creates change with BOTH:
├── adrs/database-strategy/ # NEW ADR for database choice
│ ├── decision.md
│ └── adr.md
└── specs/user-auth/ # Spec references the ADR
└── spec.md
```
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

97-97: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In `@openspec/changes/add-architectural-decision-records/proposal.md` around lines
97 - 113, The fenced code block in proposal.md is missing a language tag causing
markdownlint MD040; update the triple-backtick fence that wraps the example
block (the block starting with 'User: "Create a login feature with session
storage"') to include a language identifier (e.g., change ``` to ```text) so the
block is properly recognized by markdownlint and renders consistently.

Comment on lines +57 to +69
```
Does this request involve:
☐ Technology selection? (database, framework, library)
☐ Infrastructure choice? (hosting, deployment, CI/CD)
☐ Security approach? (auth method, encryption)
☐ Cross-cutting concern? (logging, monitoring, error handling)
☐ Decision affecting multiple specs?

If YES to any → Check for existing ADR
- ADR exists and applies → Reference it
- ADR exists but needs update → Modify it
- No ADR exists → Create new ADR in same change
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a language tag to the fenced block.

markdownlint MD040 flags missing language.

✅ Proposed fix
-  ```
+  ```text
   Does this request involve:
   ☐ Technology selection? (database, framework, library)
   ☐ Infrastructure choice? (hosting, deployment, CI/CD)
   ☐ Security approach? (auth method, encryption)
   ☐ Cross-cutting concern? (logging, monitoring, error handling)
   ☐ Decision affecting multiple specs?

   If YES to any → Check for existing ADR
     - ADR exists and applies → Reference it
     - ADR exists but needs update → Modify it
     - No ADR exists → Create new ADR in same change
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

57-57: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
In
`@openspec/changes/add-architectural-decision-records/specs/docs-agent-instructions/spec.md`
around lines 57 - 69, The fenced code block containing the ADR checklist is
missing a language tag which triggers markdownlint MD040; update the
triple-backtick fence in specs/docs-agent-instructions/spec.md to include a
language tag (e.g., change "```" to "```text") so the block is explicitly marked
as plaintext; ensure only the opening fence is changed and no content inside the
checklist is altered.

Comment on lines +17 to +20
- **WHEN** an AI agent needs detailed rationale for a specific ADR
- **THEN** the instruction loader MAY load the full adr.md file
- **AND** provide complete context, options analysis, and consequences
- **AND** load only when explicitly needed (e.g., when modifying an ADR or resolving conflicts)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Tighten wording in the scenario line.

“needs detailed rationale” reads awkwardly; consider “needs detailed rationale to be loaded” or “needs a detailed rationale.”

🧰 Tools
🪛 LanguageTool

[style] ~17-~17: The double modal “needs detailed” is nonstandard (only accepted in certain dialects). Consider “to be detailed”.
Context: ...on demand - WHEN an AI agent needs detailed rationale for a specific ADR - THEN...

(NEEDS_FIXED)

🤖 Prompt for AI Agents
In
`@openspec/changes/add-architectural-decision-records/specs/instruction-loader/spec.md`
around lines 17 - 20, Update the scenario line wording to be clearer by changing
“an AI agent needs detailed rationale for a specific ADR” to a tighter phrasing
such as “an AI agent needs a detailed rationale for a specific ADR” or “an AI
agent needs detailed rationale to be loaded for a specific ADR”; modify the line
in the spec block that currently starts with “**WHEN** an AI agent needs
detailed rationale for a specific ADR” to use one of these suggested
alternatives so the intent reads naturally.

@TabishB
Copy link
Contributor

TabishB commented Jan 23, 2026

Have addressed this proposal in here: #557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants