Contract framework with markdown-native contracts utilizing fenced YAML blocks

This commit is contained in:
2026-05-03 22:51:13 +02:00
parent 3cfda33bc9
commit e3e13ee45a
36 changed files with 2877 additions and 13 deletions

View File

@@ -0,0 +1,52 @@
---
title: ADR Contract
version: "1.0"
---
# ADR Contract
```yaml contract
id: adr-contract-v1
document:
type: adr
title: Architecture Decision Record
fields:
status:
type: string
required: true
enum: [proposed, accepted, superseded]
metrics:
document:
words:
min: 40
max: 900
severity: warning
sections:
- id: context
title: Context
presence: required
level: 2
order:
before: decision
assertions:
- id: context-names-problem
contains_any: [problem, motivation, constraint]
severity: warning
guidance: Explain why the decision exists.
- id: decision
title: Decision
presence: required
level: 2
assertions:
- id: decision-commits
matches: "\\b(choose|adopt|use|will)\\b"
severity: error
guidance: State the actual decision, not only background.
- id: consequences
title: Consequences
presence: recommended
level: 2
- id: deprecated
title: Deprecated Approach
presence: forbidden
```

View File

@@ -0,0 +1,43 @@
---
title: Business Letter Contract
version: "0.1"
---
# Business Letter Contract
```yaml contract
id: business-letter-contract-v1
document:
type: business-letter
fields:
recipient_name:
type: string
required: true
source: context.recipient.name
sender_name:
type: string
required: true
source: context.sender.name
sections:
- id: greeting
title: Greeting
presence: required
level: 2
- id: body
title: Body
presence: required
level: 2
metrics:
words:
min: 40
max: 350
severity: warning
- id: closing
title: Closing
presence: required
level: 2
rubrics:
- id: tone-fit
scope: section.body
criteria: The body should match the relationship and communication purpose.
```

View File

@@ -0,0 +1,43 @@
---
title: Concept Note Contract
version: "0.1"
---
# Concept Note Contract
```yaml contract
id: concept-note-contract-v1
document:
type: concept-note
fields:
concept_id:
type: string
required: true
status:
type: string
required: true
enum: [draft, reviewed, accepted, archived]
sections:
- id: definition
title: Definition
presence: required
level: 2
- id: assertions
title: Assertions
presence: required
level: 2
assertions:
- id: assertions-use-claims
contains_any: [claim, evidence, assumption]
severity: warning
- id: relationships
title: Relationships
presence: recommended
level: 2
metrics:
document:
words:
min: 120
max: 1200
severity: warning
```

View File

@@ -0,0 +1,49 @@
---
title: PRD and FRS Contract
version: "0.1"
---
# PRD And FRS Contract
```yaml contract
id: prd-frs-contract-v1
document:
type: prd-frs
fields:
product:
type: string
required: true
owner:
type: string
required: true
metrics:
document:
words:
min: 300
max: 4000
severity: warning
sections:
- id: problem
title: Problem
presence: required
level: 2
- id: goals
title: Goals
presence: required
level: 2
assertions:
- id: goals-are-testable
contains_any: [measure, metric, success]
severity: warning
- id: functional-requirements
title: Functional Requirements
presence: required
level: 2
- id: non-goals
title: Non-Goals
presence: recommended
level: 2
- id: implementation-plan
title: Implementation Plan
presence: discouraged
```

View File

@@ -0,0 +1,43 @@
---
title: Workplan Contract
version: "0.1"
---
# Workplan Contract
```yaml contract
id: workplan-contract-v1
document:
type: workplan
fields:
id:
type: string
required: true
status:
type: string
required: true
enum: [proposed, active, done, deferred]
sections:
- id: purpose
title: Purpose
presence: required
level: 2
- id: tasks
title: Tasks
presence: required
level: 2
assertions:
- id: tasks-have-task-blocks
contains: "status:"
severity: error
- id: decision-point
title: Decision Point
presence: recommended
level: 2
metrics:
document:
sections:
min: 2
max: 12
severity: warning
```