Skip to content

Commit 85bcb8c

Browse files
committed
docs(diagrams): add design system, logo, OG card, and AGENTS guidance
Establish the visual system as a documented, contributable asset: - diagrams/STYLE.md — palette, type, shape language, light/dark pattern, naming, and the contribution flow for new diagrams. Shared with sister project AICertify so the two repos visually echo each other. Hand-authored SVG only; no automated generator. - diagrams/logo_{light,dark}.svg — standalone square mark, the hexagon + {} curly braces signalling "policy as code". Distinct from AICertify's hexagon + checkmark but in the same family. - diagrams/og_card_{light,dark}.svg + og_card.png — 1200×630 social preview card. PNG must be uploaded via GitHub Settings → General → Social preview; it cannot be set automatically. - AGENTS.md — new "Diagrams and visual assets" section pointing future agents at STYLE.md and explicitly retiring the matplotlib generator. - CHANGELOG.md — Unreleased section now documents the visual refresh, brand assets, and removed generator.
1 parent df36b13 commit 85bcb8c

8 files changed

Lines changed: 222 additions & 5 deletions

File tree

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ If Regal flags an issue, look it up in the [Regal rule catalog](https://docs.sty
136136

137137
Each framework lives under `v1/`. When the upstream regulation changes materially, add `v2/` alongside — don't mutate `v1/` in place. See [COMPATIBILITY.md](COMPATIBILITY.md).
138138

139+
## Diagrams and visual assets
140+
141+
All README diagrams live in [`diagrams/`](diagrams/) as paired **light and dark SVGs**, embedded via `<picture>` for GitHub theme switching. The full design system (palette, type, shape language, naming, contribution flow) is documented in [`diagrams/STYLE.md`](diagrams/STYLE.md). Read it before adding or modifying any diagram.
142+
143+
- **Edit existing diagrams in place** — they are hand-authored SVGs, not generated. Open the file, change it, validate with `python3 -c "import xml.etree.ElementTree as ET; ET.parse('<path>')"`.
144+
- **Do not reintroduce a matplotlib generator** — the previous `generate_diagrams.py` was deliberately removed. Hand-authored SVGs are the source of truth.
145+
- **New diagrams must ship both `_light.svg` and `_dark.svg` variants.** Use `<picture>` markup; verify GitHub theme switching by viewing the rendered README on both light and dark settings.
146+
- **Rego syntax-coloured text** in `diagram3_policy_anatomy` uses `<tspan>` with `xml:space="preserve"` on the parent — without that attribute Inkscape and some browsers normalise whitespace and keywords run into the next token.
147+
139148
## What NOT to do
140149

141150
- Don't edit policies under `custom/` — that's a local-only space for downstream consumers.

CHANGELOG.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Added
11-
- Centered HTML hero, ordered badge wall, three big-number value-prop cards, and 5 programmatically-generated marketing diagrams in the README (hero numbers, directory tree, policy anatomy, framework grid, evaluation flow).
12-
- `AGENTS.md` and `CLAUDE.md` — operational instructions for AI coding agents working in this repository. `GEMINI.md` refreshed to inherit from `AGENTS.md` while preserving the author's working principles.
13-
- `skills/` directory with 3 Claude Code skills: `draft-rego-policy`, `explain-framework`, `add-framework`. Each ships as a slash command once installed into `~/.claude/skills/`.
14-
- Comparison table vs generic OPA bundles and vendor governance SaaS in the README.
15-
- `diagrams/generate_diagrams.py` — reproducible matplotlib script that regenerates every marketing PNG.
11+
- **Hand-authored, theme-aware SVG diagrams** under [`diagrams/`](diagrams/) — paired `_light.svg` + `_dark.svg` for hero banner, hero numbers, directory tree, policy anatomy, and evaluation flow. Embedded via `<picture>` so GitHub light- and dark-theme readers each see the matching variant.
12+
- **Brand assets** — standalone `logo_{light,dark}.svg` (hexagon + `{}` curly braces, signalling policy-as-code), `og_card_{light,dark}.svg` + a 1200×630 `og_card.png` for GitHub Settings → Social preview.
13+
- **[`diagrams/STYLE.md`](diagrams/STYLE.md)** — design-system reference (palette, typography, shape language, light/dark pattern, contribution flow) shared with sister project AICertify.
14+
- **[`CONTRIBUTING.md`](CONTRIBUTING.md)** — policy-authoring conventions, local-checks recipe, PR review criteria, and a "adding a new framework" guide. Resolves the broken link the README had been carrying.
15+
- **[`SECURITY.md`](SECURITY.md)** — private vulnerability-disclosure flow at `security@principledevolution.ai`, 5-business-day acknowledgement, coordinated disclosure. Explicitly distinguishes security issues from policy-correctness disputes.
16+
- **`AGENTS.md`** — new "Diagrams and visual assets" section pointing future agents at the SVG system and explicitly retiring the matplotlib generator.
17+
- Previously (still in this Unreleased line): `AGENTS.md`, `CLAUDE.md`, `GEMINI.md` operational instructions for AI coding agents; `skills/` directory with 3 Claude Code skills (`draft-rego-policy`, `explain-framework`, `add-framework`); comparison table vs generic OPA bundles and vendor governance SaaS in the README.
1618

1719
### Changed
20+
- **Top of README** — replaced the `<h1>GOPAL</h1>` + bold tagline with a hero banner SVG that bakes in the wordmark and value prop, tightening the top fold across all 5 language READMEs (en, zh-CN, ja-JP, ko-KR, hi-IN).
1821
- README rewritten for product-page clarity: hero numbers, then quick start, then differentiation, then directory map.
1922

23+
### Removed
24+
- **`diagrams/generate_diagrams.py`** — matplotlib generator retired. Hand-authored SVGs are now the source of truth; see [`diagrams/STYLE.md`](diagrams/STYLE.md) for how to add new ones.
25+
- **`diagram4_framework_grid.png`** — the markdown comparison table directly below it does the same job; the embedded image was redundant.
26+
2027
## [1.0.0] — 2025-07
2128

2229
### Added

diagrams/STYLE.md

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
# GOPAL diagram style
2+
3+
A short, opinionated reference so future diagrams (yours, mine, or a contributor's) stay visually coherent with the existing set. If you can read [diagram5_evaluation_flow_light.svg](diagram5_evaluation_flow_light.svg) and the matching `_dark.svg`, you have already seen the whole system applied.
4+
5+
GOPAL and its sister project [AICertify](https://github.com/Principled-Evolution/aicertify) share this design system on purpose — readers seeing both repos should recognise a family resemblance.
6+
7+
## The principle
8+
9+
Two colors with intent, flat fills, no animation, no shadows. The polish is in restraint and consistency, not effects.
10+
11+
## Palette
12+
13+
| Token | Light | Dark | Used for |
14+
|---|---|---|---|
15+
| **Indigo (primary)** | `#4f46e5` | `#6366f1` | Process, structure, the "happy path" |
16+
| **Indigo (light fill)** | `#eef2ff` | `#312e81` | Card backgrounds for indigo elements |
17+
| **Indigo (text on fill)** | `#4338ca` | `#c7d2fe` | Text inside indigo chips/badges |
18+
| **Amber (accent)** | `#d97706` | `#fbbf24` | The **deliverable** — verdict, report, the thing the reader walks away with |
19+
| **Amber (light fill)** | `#fffbeb` / `#fef3c7` | `#2a1f06` / `#533404` | Card / chip backgrounds for amber elements |
20+
| **Amber (text on fill)** | `#92400e` / `#b45309` | `#fcd34d` / `#fde68a` | Text inside amber chips |
21+
| **Foreground (text)** | `#0f172a` | `#f0f6fc` | Primary body / heading text |
22+
| **Foreground (muted)** | `#64748b` | `#8b949e` | Secondary captions, labels |
23+
| **Border** | `#e2e8f0` | `#30363d` | Card outlines, dividers |
24+
| **Card surface** | `#ffffff` | `#161b22` | Card backgrounds |
25+
| **Arrow / line** | `#94a3b8` | `#6e7681` | Connectors |
26+
27+
**Amber is precious.** Reserve it for the deliverable in a flow (the verdict, the report) and never use it decoratively. If everything is highlighted, nothing is highlighted.
28+
29+
## Typography
30+
31+
- Single stack, declared on every `<svg>`: `font-family="system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif"`. No webfont hosting, no licensing, picks up the reader's OS font.
32+
- **Monospace** (for Rego code, package paths, directory names): `font-family="ui-monospace, SFMono-Regular, Menlo, monospace"`.
33+
- **Headings inside cards**: 13–15px, `font-weight="500"`.
34+
- **Body / captions**: 10–12px, `font-weight="400"`.
35+
- **Stat numerals** (e.g. "94"): 36px, `font-weight="500"`, amber.
36+
- Wordmark on the hero banner / OG card uses `letter-spacing="-0.025em"` for tightness at large sizes.
37+
38+
**On multi-coloured text** (e.g. Rego syntax highlighting in `diagram3_policy_anatomy`): use `<tspan>` inside `<text>` and set `xml:space="preserve"` on the containing element — without it, Inkscape and some browsers normalise whitespace between tspans and your colored keywords run together.
39+
40+
## Shape language
41+
42+
- **Cards / chips**: rounded rectangles. Corner radius `rx="10"` for cards, `rx="12"` (or larger) for chip pills.
43+
- **Card stroke**: `1px` border in the border token, no shadows, no gradients.
44+
- **Arrows**: `1.5px` line in the muted line color, with the marker defined per-file in `<defs>`. Don't reuse `id="al"` etc. across files in case both are inlined.
45+
- **Icons inside cards**: `1.5px` stroke in the indigo (or dark variant) color, `stroke-linecap="round"`, `stroke-linejoin="round"`. Compact (~24×24 unit) line icons, no fills unless intentional.
46+
47+
## Light/dark pattern
48+
49+
Diagrams ship as **paired files** with matching `_light.svg` and `_dark.svg`. README markup uses `<picture>`:
50+
51+
```html
52+
<picture>
53+
<source media="(prefers-color-scheme: dark)" srcset="diagrams/<name>_dark.svg">
54+
<img src="diagrams/<name>_light.svg" alt="<descriptive alt text>" width="85%">
55+
</picture>
56+
```
57+
58+
That gives GitHub-light readers the light variant and GitHub-dark readers the dark variant — same on mobile, on PR previews, and anywhere else `<picture>` is honored.
59+
60+
- Light variants use white card surfaces, slate text.
61+
- Dark variants use `#161b22` cards (GitHub's `--color-canvas-subtle`) and `#30363d` borders so cards sit into the page rather than floating on top of it.
62+
- Don't bake in a background `<rect>` filling the viewBox unless the asset is meant to be self-contained (e.g. OG cards). Otherwise let GitHub's page color show through.
63+
64+
## Files and naming
65+
66+
```
67+
diagrams/
68+
├── STYLE.md (this file)
69+
├── hero_banner_{light,dark}.svg top-of-README banner
70+
├── logo_{light,dark}.svg standalone square mark
71+
├── og_card_{light,dark}.svg 1200×630 social-preview card
72+
├── og_card.png rasterized light variant, for GitHub Settings → Social preview
73+
├── diagram1_hero_numbers_{light,dark}.svg 94 / 15+ / 5 stats + 4 category cards
74+
├── diagram2_directory_tree_{light,dark}.svg 4 top-level directories with policy counts
75+
├── diagram3_policy_anatomy_{light,dark}.svg Rego policy mockup with callouts
76+
└── diagram5_evaluation_flow_{light,dark}.svg input → policy → OPA → verdict
77+
```
78+
79+
A previous `diagram4_framework_grid` was retired — the markdown comparison table in the README is the single source of truth.
80+
81+
## Adding a new diagram
82+
83+
1. Sketch the content first in markdown (what does the reader need to understand?). Cut anything that is also said in nearby text.
84+
2. Pick a layout that mirrors an existing diagram if you can — most additions are variations of "flow", "accordion", "stats + cards", or "mockup + callouts".
85+
3. Hand-author the SVG. Use the existing files as templates; copy a card definition, swap the content.
86+
4. Validate XML: `python3 -c "import xml.etree.ElementTree as ET; ET.parse('diagrams/<name>_light.svg')"`. Repeat for the dark variant.
87+
5. Embed with the `<picture>` snippet above in every README that should reference it (en + 4 translated).
88+
6. **No automation, no matplotlib, no Python generator.** The old `generate_diagrams.py` was retired because hand-authored SVGs are easier to read, edit, and review than rendered raster output. Keep them hand-authored.
89+
90+
## Rasterizing (only when needed)
91+
92+
The only raster output we keep in the repo is `og_card.png` — GitHub's Social Preview upload requires PNG/JPG. To regenerate:
93+
94+
```bash
95+
inkscape --export-type=png --export-width=1200 --export-height=630 \
96+
--export-filename=diagrams/og_card.png diagrams/og_card_light.svg
97+
```
98+
99+
GitHub social preview is uploaded manually at: **Settings → General → Social preview → Edit → Upload an image**. The repo's checked-in `og_card.png` is the source artifact.

diagrams/logo_dark.svg

Lines changed: 10 additions & 0 deletions
Loading

diagrams/logo_light.svg

Lines changed: 10 additions & 0 deletions
Loading

diagrams/og_card.png

68.5 KB
Loading

diagrams/og_card_dark.svg

Lines changed: 41 additions & 0 deletions
Loading

diagrams/og_card_light.svg

Lines changed: 41 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)