@rasensio/aidlc-content 2.26.0 → 2.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/templates.d.ts +7 -0
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +9 -0
- package/dist/templates.js.map +1 -1
- package/docs/cost-tracking.md +25 -3
- package/docs/hygiene-and-compliance.md +48 -5
- package/docs/index.yaml +6 -0
- package/docs/knowledge-graph.md +2 -2
- package/docs/lifecycle.md +22 -0
- package/docs/reviews-and-guidance.md +4 -2
- package/docs/roadmap.md +61 -15
- package/docs/skills-and-platforms.md +29 -11
- package/guidance/index.yaml +5 -0
- package/guidance/mermaid-diagrams.md +219 -0
- package/howto/make-a-custom-template.md +78 -0
- package/package.json +1 -1
- package/packs/aspice/controls.yaml +561 -0
- package/packs/aspice/guidance/aspice-constraints.md +109 -0
- package/packs/aspice/pack.yaml +30 -0
- package/packs/gdpr/controls.yaml +287 -0
- package/packs/gdpr/guidance/gdpr-constraints.md +141 -0
- package/packs/gdpr/pack.yaml +24 -0
- package/packs/gxp/controls.yaml +479 -0
- package/packs/gxp/guidance/gxp-constraints.md +159 -0
- package/packs/gxp/pack.yaml +35 -0
- package/packs/sox/controls.yaml +229 -0
- package/packs/sox/guidance/sox-constraints.md +100 -0
- package/packs/sox/pack.yaml +30 -0
- package/resources/rules/decision-register.md +3 -3
- package/resources/rules/departures.md +3 -1
- package/resources/rules/fresh-main.md +25 -0
- package/resources/rules/unattended.md +1 -1
- package/skills/00-overview.md +3 -4
- package/skills/03-entry-point.md +1 -0
- package/skills/20-requirements.md +4 -2
- package/skills/30-design.md +16 -3
- package/skills/50-testing.md +15 -0
- package/skills/60-deployment.md +38 -4
- package/skills/81-continue.md +2 -1
- package/skills/84-autopilot.md +1 -1
- package/skills/90-retrospective.md +1 -1
- package/templates/quick-feature.yaml +3 -0
- package/templates/system.md +39 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mermaid-diagrams
|
|
3
|
+
description: Mermaid diagram type selection, syntax, layout and checking a diagram before commit. Read only when a diagram is drawn or changed.
|
|
4
|
+
---
|
|
5
|
+
# Mermaid diagrams
|
|
6
|
+
|
|
7
|
+
General rules for every Mermaid diagram in this project. Read this layer only when you draw or
|
|
8
|
+
change a diagram; no phase reads it on entry.
|
|
9
|
+
|
|
10
|
+
Mermaid is the only diagram format. Diagrams live as fenced ```mermaid blocks in Markdown, not as
|
|
11
|
+
committed images: a text diagram is reviewable in a diff, an exported PNG is not. An agent can add
|
|
12
|
+
one node or one edge to Mermaid without disturbing the rest, and the diff reads as the change it
|
|
13
|
+
is.
|
|
14
|
+
|
|
15
|
+
## Where diagrams land
|
|
16
|
+
|
|
17
|
+
- `architecture-diagram.md`, in the instance's state directory, is drawn by design for one change.
|
|
18
|
+
It is drawn only when the change adds or removes a service or a store, adds a data flow between
|
|
19
|
+
components, or moves a boundary (account, network, tenant or trust).
|
|
20
|
+
- `.aidlc/architecture/system.md` is the system as it stands: one `##` section per diagram. The
|
|
21
|
+
instance that drew `architecture-diagram.md` updates it in its own branch, before merge, to match
|
|
22
|
+
what was built. Edit only the diagrams the work touched; never regenerate the whole file.
|
|
23
|
+
|
|
24
|
+
## Choosing the diagram type
|
|
25
|
+
|
|
26
|
+
| Diagram type | Use for | Mermaid header |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| Flowchart | Components and the data flowing between them; process or decision flow | `flowchart TD` (or `LR`) |
|
|
29
|
+
| Sequence | Ordered messages between actors over time | `sequenceDiagram` |
|
|
30
|
+
| State | Lifecycle or state machine | `stateDiagram-v2` |
|
|
31
|
+
| Class | Type structure and relationships | `classDiagram` |
|
|
32
|
+
| ER | Database entities and relationships | `erDiagram` |
|
|
33
|
+
| Gantt | Schedule | `gantt` |
|
|
34
|
+
| Timeline | Chronological events | `timeline` |
|
|
35
|
+
| Mindmap | Hierarchical breakdown | `mindmap` |
|
|
36
|
+
| Journey | User journey with sentiment scores | `journey` |
|
|
37
|
+
| Pie | Proportion of categorical data | `pie` |
|
|
38
|
+
|
|
39
|
+
If unsure, a flowchart with action nodes is rarely wrong. Sequence is for ordered communication;
|
|
40
|
+
state is for what state a thing can be in; ER is for data models, not behaviour.
|
|
41
|
+
|
|
42
|
+
## Authoring workflow
|
|
43
|
+
|
|
44
|
+
1. Draft in a standalone `.mmd` file in a scratch directory **outside the repository**. A fenced
|
|
45
|
+
block inside Markdown cannot be checked directly, and a scratch `.mmd` left in the tree is
|
|
46
|
+
clutter someone has to clean up.
|
|
47
|
+
2. Write the diagram.
|
|
48
|
+
3. Check it before pasting it anywhere — see below.
|
|
49
|
+
4. Copy the checked contents into the target Markdown file as a fenced ```mermaid block.
|
|
50
|
+
|
|
51
|
+
## Checking a diagram before commit
|
|
52
|
+
|
|
53
|
+
Checking is not optional. Markdown renderers fail Mermaid blocks silently in some setups: the
|
|
54
|
+
block looks fine in a local preview and breaks on the published page, and review will not catch it
|
|
55
|
+
because the source diff reads as plausible Mermaid. `$SCRATCH` below is that scratch directory,
|
|
56
|
+
for example `SCRATCH="$(mktemp -d)"`.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx -y @mermaid-js/mermaid-cli -i "$SCRATCH/diagram.mmd" -o "$SCRATCH/diagram.svg" -q
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
A non-zero exit means invalid syntax. Keep the SVG only if you want to look at it; it is a
|
|
63
|
+
by-product, not an artifact to commit.
|
|
64
|
+
|
|
65
|
+
**First-run cost.** The Mermaid CLI drives Puppeteer, which downloads a headless Chromium on first
|
|
66
|
+
run (about 100 MB, one time). Where that download is blocked — CI sandboxes, restricted networks —
|
|
67
|
+
set `PUPPETEER_EXECUTABLE_PATH` to an existing Chrome or Chromium binary rather than skipping the
|
|
68
|
+
check.
|
|
69
|
+
|
|
70
|
+
To check every block already in a Markdown file, extract them first:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
awk -v d="$SCRATCH" '/^```mermaid$/{f=1;n++;o=d"/d-"n".mmd";next} /^```$/{f=0;next} f{print > o}' doc.md
|
|
74
|
+
for f in "$SCRATCH"/d-*.mmd; do npx -y @mermaid-js/mermaid-cli -i "$f" -o "${f%.mmd}.svg" -q || echo "FAILED: $f"; done
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Labels
|
|
78
|
+
|
|
79
|
+
Label nodes, participants and subgraphs with the project's own names for its components — the
|
|
80
|
+
names its code, its context documents and its people use. A diagram that invents a second name for
|
|
81
|
+
a component teaches the wrong model faster than prose does.
|
|
82
|
+
|
|
83
|
+
## Syntax cheatsheets
|
|
84
|
+
|
|
85
|
+
### Flowchart
|
|
86
|
+
|
|
87
|
+
```mermaid
|
|
88
|
+
flowchart TD
|
|
89
|
+
Start([Start]) --> Decide{Has account?}
|
|
90
|
+
Decide -->|Yes| Login[Login]
|
|
91
|
+
Decide -->|No| Signup[Signup]
|
|
92
|
+
Login --> Dashboard[Dashboard]
|
|
93
|
+
Signup --> Dashboard
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Direction: `TD` (top-down), `BT`, `LR`, `RL`. Edges: `-->` solid, `-.->` dotted, `==>` thick,
|
|
97
|
+
`~~~` invisible (for layout ordering only).
|
|
98
|
+
|
|
99
|
+
### Sequence
|
|
100
|
+
|
|
101
|
+
```mermaid
|
|
102
|
+
sequenceDiagram
|
|
103
|
+
participant User
|
|
104
|
+
participant Browser
|
|
105
|
+
participant API
|
|
106
|
+
participant DB
|
|
107
|
+
User->>Browser: Click "Sign in"
|
|
108
|
+
Browser->>API: POST /auth/login
|
|
109
|
+
API->>DB: SELECT user WHERE email=?
|
|
110
|
+
DB-->>API: user row
|
|
111
|
+
API-->>Browser: 200 + session cookie
|
|
112
|
+
Browser-->>User: Dashboard
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`->>` solid arrow, `-->>` dashed (response), `->` open arrow, `--)` async.
|
|
116
|
+
`Note over A,B: text` for annotations. `loop`, `alt/else`, `opt`, `par` for control flow.
|
|
117
|
+
|
|
118
|
+
### State
|
|
119
|
+
|
|
120
|
+
```mermaid
|
|
121
|
+
stateDiagram-v2
|
|
122
|
+
[*] --> Draft
|
|
123
|
+
Draft --> Submitted: submit
|
|
124
|
+
Submitted --> Approved: approve
|
|
125
|
+
Submitted --> Rejected: reject
|
|
126
|
+
Approved --> [*]
|
|
127
|
+
Rejected --> Draft: revise
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
`[*]` is the start/end pseudo-state. Use `state X { ... }` for nested composite states.
|
|
131
|
+
|
|
132
|
+
### Class
|
|
133
|
+
|
|
134
|
+
```mermaid
|
|
135
|
+
classDiagram
|
|
136
|
+
class Animal {
|
|
137
|
+
+String name
|
|
138
|
+
+int age
|
|
139
|
+
+makeSound() void
|
|
140
|
+
}
|
|
141
|
+
class Dog {
|
|
142
|
+
+String breed
|
|
143
|
+
+bark() void
|
|
144
|
+
}
|
|
145
|
+
Animal <|-- Dog
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Relationships: `<|--` inheritance, `*--` composition, `o--` aggregation, `-->` association,
|
|
149
|
+
`..>` dependency.
|
|
150
|
+
|
|
151
|
+
### ER
|
|
152
|
+
|
|
153
|
+
```mermaid
|
|
154
|
+
erDiagram
|
|
155
|
+
USER ||--o{ ORDER : places
|
|
156
|
+
ORDER ||--|{ LINE_ITEM : contains
|
|
157
|
+
USER {
|
|
158
|
+
uuid id PK
|
|
159
|
+
string email
|
|
160
|
+
timestamp created_at
|
|
161
|
+
}
|
|
162
|
+
ORDER {
|
|
163
|
+
uuid id PK
|
|
164
|
+
uuid user_id FK
|
|
165
|
+
decimal total
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Cardinality: `||` exactly one, `}o` zero or many, `}|` one or many, `o|` zero or one — mirrored on
|
|
170
|
+
the other side of the relation.
|
|
171
|
+
|
|
172
|
+
### Gantt
|
|
173
|
+
|
|
174
|
+
```mermaid
|
|
175
|
+
gantt
|
|
176
|
+
title Release schedule
|
|
177
|
+
dateFormat YYYY-MM-DD
|
|
178
|
+
section Backend
|
|
179
|
+
API rewrite :a1, 2026-01-01, 14d
|
|
180
|
+
Migration :after a1, 7d
|
|
181
|
+
section Frontend
|
|
182
|
+
Component refresh:2026-01-08, 21d
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Layout gotchas
|
|
186
|
+
|
|
187
|
+
- **Linear chains in subgraphs** sometimes render horizontally even under `flowchart TD`. Force
|
|
188
|
+
vertical with `direction TB` inside the subgraph.
|
|
189
|
+
- **Long labels** truncate in some renderers. Keep node and subgraph labels short and push detail
|
|
190
|
+
into the prose around the diagram.
|
|
191
|
+
- **HTML in labels** requires the label be quoted: `id("text<br/>more text")`. An unquoted label
|
|
192
|
+
cannot contain `<`, `>`, `(`, `)` or `,`.
|
|
193
|
+
- **Reserved words.** `end`, `class`, `style` and `linkStyle` are keywords. Prefix a colliding node
|
|
194
|
+
id (`n_end`, not `end`).
|
|
195
|
+
|
|
196
|
+
## Anti-patterns
|
|
197
|
+
|
|
198
|
+
- **Wrong diagram type.** A flowchart of states is usually a state diagram; force-fitting it loses
|
|
199
|
+
the implicit time semantics. A sequence diagram of components is usually a class diagram.
|
|
200
|
+
- **All-rectangle flowcharts.** Mermaid's shape vocabulary is a free communication channel — rounded
|
|
201
|
+
boxes for processes, diamonds for decisions, stadiums for start, end and external systems,
|
|
202
|
+
cylinders for data stores.
|
|
203
|
+
- **Colour as the only channel.** Shape must carry the same distinction colour does, per
|
|
204
|
+
`.aidlc/guidance/accessibility.md`. A reader with a colour-vision deficiency, or anyone reading a
|
|
205
|
+
greyscale print, gets the diagram from shape alone or not at all.
|
|
206
|
+
- **Skipping the check.** See above.
|
|
207
|
+
- **Committing a rendered image beside the source.** The two drift, and the image is the one readers
|
|
208
|
+
trust. Keep the Mermaid source as the single definition.
|
|
209
|
+
- **Regenerating the living document.** Redrawing `.aidlc/architecture/system.md` whole turns a
|
|
210
|
+
one-edge change into a diff nobody reads. Edit the diagrams the work touched.
|
|
211
|
+
|
|
212
|
+
## References
|
|
213
|
+
|
|
214
|
+
- Mermaid syntax: https://mermaid.js.org/syntax/
|
|
215
|
+
- Mermaid CLI: https://github.com/mermaid-js/mermaid-cli
|
|
216
|
+
- Live editor, for ad-hoc tweaks: https://mermaid.live/
|
|
217
|
+
- Imported and adapted from [`sontek/sontek-skills`](https://github.com/sontek/sontek-skills) —
|
|
218
|
+
`skills/draw-mermaid-diagram`, itself adapted from
|
|
219
|
+
[`mitsuhiko/agent-stuff`](https://github.com/mitsuhiko/agent-stuff/tree/main/skills/mermaid).
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Make a custom template
|
|
3
|
+
description: Start from a built-in template and change it — add a document to a step, or add a whole new step.
|
|
4
|
+
order: 90
|
|
5
|
+
slug: make-a-custom-template
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## What you'll do
|
|
9
|
+
|
|
10
|
+
Write a template of your own in `.aidlc/templates/`, built on a template AIDLC already ships.
|
|
11
|
+
You name the parent with `extends:`, then say only what is different. First you add a
|
|
12
|
+
document to a step that already exists. Then you add a new step.
|
|
13
|
+
|
|
14
|
+
## Steps
|
|
15
|
+
|
|
16
|
+
1. Pick the parent. See the templates you can build on:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
aidlc templates list
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The examples below build on `quick-feature`, which runs requirements, design,
|
|
23
|
+
implementation, testing and deployment.
|
|
24
|
+
|
|
25
|
+
2. Add a document to a step that already exists, with `override:`. Save this as
|
|
26
|
+
`.aidlc/templates/feature-with-runbook.yaml`:
|
|
27
|
+
|
|
28
|
+
```yaml
|
|
29
|
+
name: feature-with-runbook
|
|
30
|
+
description: quick-feature, plus a runbook before release.
|
|
31
|
+
extends: quick-feature
|
|
32
|
+
scope: standard
|
|
33
|
+
override:
|
|
34
|
+
deployment:
|
|
35
|
+
required_artifacts:
|
|
36
|
+
- name: deployment-record.md
|
|
37
|
+
- name: runbook.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`override:` replaces the step's whole document list. So list the documents the step
|
|
41
|
+
already needs, then the new one. Leave `deployment-record.md` out and deployment stops
|
|
42
|
+
asking for it.
|
|
43
|
+
|
|
44
|
+
3. Add a new step, with `add:`. Save this as
|
|
45
|
+
`.aidlc/templates/feature-with-security-review.yaml`:
|
|
46
|
+
|
|
47
|
+
```yaml
|
|
48
|
+
name: feature-with-security-review
|
|
49
|
+
description: quick-feature, plus a security review after testing.
|
|
50
|
+
extends: quick-feature
|
|
51
|
+
scope: standard
|
|
52
|
+
add:
|
|
53
|
+
- after: testing
|
|
54
|
+
phase:
|
|
55
|
+
name: security-review
|
|
56
|
+
required_artifacts:
|
|
57
|
+
- name: security-review.md
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The new step sits under `phase:`, with its own `name` and `required_artifacts`. Use
|
|
61
|
+
`before:` instead of `after:` to put it earlier. To drop a step from the parent, list
|
|
62
|
+
it under `remove:`.
|
|
63
|
+
|
|
64
|
+
4. Start work with your template:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
aidlc start feature-with-security-review --name <instance>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
A template with `extends:` does not read its own `phases:` list. Leave `phases:` out, or
|
|
71
|
+
write `phases: []`. If you get the shape wrong, AIDLC skips the template and prints one
|
|
72
|
+
`warning: failed to load template` line that shows what to write instead.
|
|
73
|
+
|
|
74
|
+
## Check it worked
|
|
75
|
+
|
|
76
|
+
Run `aidlc templates show feature-with-security-review`. You should see `security-review`
|
|
77
|
+
listed between `testing` and `deployment`. Run `aidlc templates show feature-with-runbook`.
|
|
78
|
+
Deployment should list both `deployment-record.md` and `runbook.md`.
|