Skip to content

Commit bff76dd

Browse files
committed
mcaf skills
1 parent 5bd3eb2 commit bff76dd

File tree

128 files changed

+9772
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+9772
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
name: mcaf-adr-writing
3+
description: "Create or update an ADR under `docs/ADR/` for architectural decisions, dependency changes, data-model changes, or cross-cutting policy shifts. Use when the user asks to write, update, or document an ADR, record a design decision, capture architecture trade-offs, or justify a repo-wide technical policy."
4+
compatibility: "Requires repository write access; produces Markdown ADRs with Mermaid diagrams."
5+
---
6+
7+
# MCAF: ADR Writing
8+
9+
## Trigger On
10+
11+
- a dependency, boundary, platform, contract, or data model is changing
12+
- a design decision has meaningful trade-offs that should be recorded
13+
- a repo-wide engineering policy needs a durable rationale
14+
15+
## Value
16+
17+
- produce a concrete project delta: code, docs, config, tests, CI, or review artifact
18+
- reduce ambiguity through explicit planning, verification, and final validation skills
19+
- leave reusable project context so future tasks are faster and safer
20+
21+
## Do Not Use For
22+
23+
- feature-level behaviour details without an architecture decision
24+
- generic architecture overview content
25+
26+
## Inputs
27+
28+
- `docs/Architecture.md`
29+
- related feature docs
30+
- the nearest `AGENTS.md`
31+
- current constraints, options, and risks
32+
33+
## Quick Start
34+
35+
1. Read the nearest `AGENTS.md` and confirm scope and constraints.
36+
2. Run this skill's `Workflow` through the `Ralph Loop` until outcomes are acceptable.
37+
3. Return the `Required Result Format` with concrete artifacts and verification evidence.
38+
39+
## Workflow
40+
41+
1. Start from the concrete decision that must be made now.
42+
2. If the ADR is missing, scaffold it from `references/adr-template.md`.
43+
3. Record:
44+
- context and problem
45+
- chosen decision
46+
- alternatives considered
47+
- trade-offs and consequences
48+
- implementation plan
49+
4. Add diagrams only when they remove ambiguity.
50+
5. Link the ADR to affected feature docs and `docs/Architecture.md`.
51+
52+
## Deliver
53+
54+
- `docs/ADR/ADR-XXXX-short-title.md`
55+
- linked updates to architecture docs when the decision changes boundaries
56+
57+
## Validate
58+
59+
- the decision and rejected alternatives are explicit
60+
- trade-offs are concrete, not hand-wavy
61+
- implementation impact is clear
62+
- a future engineer can understand why this path was chosen
63+
64+
## Ralph Loop
65+
66+
Use the Ralph Loop for every task, including docs, architecture, testing, and tooling work.
67+
68+
1. Plan first (mandatory):
69+
- analyze current state
70+
- define target outcome, constraints, and risks
71+
- write a detailed execution plan
72+
- list final validation skills to run at the end, with order and reason
73+
2. Execute one planned step and produce a concrete delta.
74+
3. Review the result and capture findings with actionable next fixes.
75+
4. Apply fixes in small batches and rerun the relevant checks or review steps.
76+
5. Update the plan after each iteration.
77+
6. Repeat until outcomes are acceptable or only explicit exceptions remain.
78+
7. If a dependency is missing, bootstrap it or return `status: not_applicable` with explicit reason and fallback path.
79+
80+
### Required Result Format
81+
82+
- `status`: `complete` | `clean` | `improved` | `configured` | `not_applicable` | `blocked`
83+
- `plan`: concise plan and current iteration step
84+
- `actions_taken`: concrete changes made
85+
- `validation_skills`: final skills run, or skipped with reasons
86+
- `verification`: commands, checks, or review evidence summary
87+
- `remaining`: top unresolved items or `none`
88+
89+
For setup-only requests with no execution, return `status: configured` and exact next commands.
90+
91+
## Load References
92+
93+
- start with `references/adr-template.md`
94+
- use `references/ADR-FORMATS.md` only for numbering or formatting conventions
95+
96+
## Example Requests
97+
98+
- "Write an ADR for moving to event-driven notifications."
99+
- "Document why we are adding PostgreSQL instead of keeping SQLite."
100+
- "Capture the policy decision behind local project AGENTS files."
Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
# ADR Formats (templates)
2+
3+
This file is for **copy/paste**. Pick one of the templates below and fill it with real repo facts.
4+
5+
Rules (MCAF):
6+
7+
- ADRs are self-contained (no “as discussed”).
8+
- At least one Mermaid diagram is mandatory.
9+
- ADRs define testable invariants + verification commands (not vibes).
10+
11+
---
12+
13+
## Template 1: MCAF ADR (full)
14+
15+
Use this as the default template. Save as `docs/ADR/ADR-XXXX-title-in-kebab-case.md`.
16+
17+
````md
18+
# ADR-XXXX: Title
19+
20+
Status: Proposed | Accepted | Implemented | Rejected | Superseded
21+
Date: YYYY-MM-DD
22+
Related Features: `docs/Features/...` (recommended)
23+
Supersedes: `docs/ADR/ADR-....md` (delete if none)
24+
Superseded by: `docs/ADR/ADR-....md` (delete if none)
25+
26+
Rules:
27+
28+
- This ADR is **self-contained** — avoid “as discussed”; include all critical context and links.
29+
- At least **one Mermaid diagram is mandatory** (boundaries/modules/interactions for this decision).
30+
31+
---
32+
33+
## Context
34+
35+
- Current situation (what exists today).
36+
- Constraints (tech/legal/time/org constraints that matter).
37+
- Problem statement (what is failing / what you must enable).
38+
- Goals (what success looks like).
39+
- Non-goals (what this ADR is not trying to solve).
40+
41+
---
42+
43+
## Stakeholders (who needs this to be clear)
44+
45+
| Role | What they need to know | Questions this ADR must answer |
46+
| --- | --- | --- |
47+
| Product / Owner | User/business impact, scope, rollout risk | What changes for users? What’s out of scope? |
48+
| Engineering | Boundaries/modules, data/contract changes, edge cases | What do we change, where, and why? |
49+
| DevOps / SRE | Deployability, config, monitoring, rollback | How do we ship safely and observe it? |
50+
| QA | Test scenarios + environment assumptions | What must be proven by automated tests? |
51+
52+
---
53+
54+
## Decision
55+
56+
- One sentence decision statement.
57+
58+
Key points:
59+
60+
- Key point 1
61+
- Key point 2
62+
63+
---
64+
65+
## Diagram (Mandatory)
66+
67+
```mermaid
68+
%% Show the boundaries/modules that change, and how they interact.
69+
%% Prefer 1 clear diagram over many noisy ones.
70+
```
71+
72+
---
73+
74+
## Alternatives considered
75+
76+
### Option A
77+
78+
- Pros:
79+
- Cons:
80+
- Rejected because:
81+
82+
### Option B
83+
84+
- Pros:
85+
- Cons:
86+
- Rejected because:
87+
88+
---
89+
90+
## Consequences
91+
92+
### Positive
93+
94+
- Benefit
95+
96+
### Negative / risks
97+
98+
- Risk
99+
- Mitigation:
100+
101+
---
102+
103+
## Impact
104+
105+
### Code
106+
107+
- Affected modules / services:
108+
- New boundaries / responsibilities:
109+
- Feature flags / toggles (names, defaults, removal plan):
110+
111+
### Data / configuration
112+
113+
- Data model / schema changes:
114+
- Config changes (keys, defaults, secrets handling):
115+
- Backwards compatibility strategy:
116+
117+
### Documentation
118+
119+
- Feature docs to update:
120+
- Testing docs to update:
121+
- Architecture docs to update:
122+
- `docs/Architecture.md` updates (what must change):
123+
- Notes for `AGENTS.md` (new rules/patterns):
124+
125+
---
126+
127+
## Verification (Mandatory: describe how to test this decision)
128+
129+
### Objectives
130+
131+
- What behaviour / qualities must be proven.
132+
- Which invariants from this ADR must be encoded as tests (happy path + negative/forbidden + edge cases).
133+
- Link each objective/scenario to the specific automated test(s) that prove it.
134+
135+
### Test environment
136+
137+
- Environment (local compose / staging / prod-like):
138+
- Data and reset strategy (seed data, migrations, rollback plan):
139+
- External dependencies (real / sandbox / test environment required):
140+
141+
### Test commands
142+
143+
- build: (paste from `AGENTS.md`)
144+
- test: (paste from `AGENTS.md`)
145+
- format: (paste from `AGENTS.md`)
146+
- coverage: (paste from `AGENTS.md` if separate; otherwise delete)
147+
148+
### New or changed tests
149+
150+
| ID | Scenario | Level (Unit / Int / API / UI) | Expected result | Notes / Data |
151+
| --- | --- | --- | --- | --- |
152+
| TST-001 | Happy path / negative / edge | Integration | Observable outcome | Fixtures / seed data |
153+
154+
### Regression and analysis
155+
156+
- Regression suites to run (must stay green):
157+
- Static analysis (tools/configs that must pass):
158+
- Monitoring during rollout (logs/metrics/alerts to watch):
159+
160+
---
161+
162+
## Rollout and migration
163+
164+
- Migration steps:
165+
- Backwards compatibility:
166+
- Rollback:
167+
168+
---
169+
170+
## References
171+
172+
- Issues / tickets:
173+
- External docs / specs:
174+
- Related ADRs:
175+
176+
---
177+
178+
## Filing checklist
179+
180+
- [ ] File saved under `docs/ADR/ADR-XXXX-title-in-kebab-case.md` (not in `docs/templates/`).
181+
- [ ] Status reflects real state (`Proposed`, `Accepted`, `Rejected`, `Superseded`).
182+
- [ ] Links to related features, tests, and ADRs are filled in.
183+
- [ ] Diagram section contains at least one Mermaid diagram.
184+
- [ ] `docs/Architecture.md` updated if module boundaries or interactions changed.
185+
````
186+
187+
---
188+
189+
## Template 2: Mini ADR (small, safe decision)
190+
191+
Use this when the decision is real but the scope is contained (still needs a diagram + verification).
192+
193+
````md
194+
# ADR-XXXX: Title
195+
196+
Status: Proposed | Accepted | Implemented | Rejected | Superseded
197+
Date: YYYY-MM-DD
198+
Related Features: `docs/Features/...` (delete if none)
199+
200+
## Decision
201+
202+
- One sentence.
203+
204+
## Why (context + constraints)
205+
206+
- Why now:
207+
- Constraints:
208+
209+
## Diagram (Mandatory)
210+
211+
```mermaid
212+
%% Boundaries/modules that change + their interaction.
213+
```
214+
215+
## Alternatives (at least one)
216+
217+
- Alternative A (why not):
218+
219+
## Consequences
220+
221+
- Positive:
222+
- Negative / risks + mitigations:
223+
224+
## Verification (Mandatory)
225+
226+
- Invariants to test:
227+
- Tests to add/update:
228+
- Commands to run (from `AGENTS.md`):
229+
````
230+
231+
---
232+
233+
## Template 3: Options Matrix ADR (when choosing between 2–4 options)
234+
235+
Use this when you need to evaluate trade-offs explicitly and keep the decision auditable.
236+
237+
````md
238+
# ADR-XXXX: Title
239+
240+
Status: Proposed | Accepted | Implemented | Rejected | Superseded
241+
Date: YYYY-MM-DD
242+
243+
## Decision
244+
245+
- One sentence.
246+
247+
## Decision drivers (what matters)
248+
249+
- Driver 1:
250+
- Driver 2:
251+
252+
## Options
253+
254+
| Option | Summary | Pros | Cons | Risk | Why/why not |
255+
| --- | --- | --- | --- | --- | --- |
256+
| A | | | | | |
257+
| B | | | | | |
258+
259+
## Diagram (Mandatory)
260+
261+
```mermaid
262+
%% Diagram the chosen option (and the most important alternative if helpful).
263+
```
264+
265+
## Verification (Mandatory)
266+
267+
- Invariants to protect:
268+
- Test plan:
269+
````

0 commit comments

Comments
 (0)