the-grimoire-cli 0.3.2 → 0.4.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/.agents/AGENTS.md +112 -112
- package/.agents/NAVIGATOR.md +188 -168
- package/.agents/VERSION +4 -4
- package/.agents/agents/INDEX.md +7 -7
- package/.agents/agents/verifier.md +50 -50
- package/.agents/commands/INDEX.md +11 -11
- package/.agents/commands/checkpoint.md +15 -15
- package/.agents/commands/grimoire.md +14 -14
- package/.agents/commands/onboard.md +56 -56
- package/.agents/commands/present.md +23 -23
- package/.agents/commands/verify.md +20 -20
- package/.agents/grimoire.manifest +18 -18
- package/.agents/rules/00-always.md +42 -42
- package/.agents/rules/05-code-quality.md +28 -28
- package/.agents/rules/10-working-process.md +31 -31
- package/.agents/rules/15-skills.md +27 -27
- package/.agents/rules/20-modes.md +41 -41
- package/.agents/rules/25-surgical-changes.md +29 -29
- package/.agents/rules/30-verification.md +36 -36
- package/.agents/rules/35-context-economy.md +41 -41
- package/.agents/rules/40-handoff.md +25 -25
- package/.agents/rules/45-presentation.md +35 -35
- package/.agents/rules/50-security.md +30 -30
- package/.agents/rules/60-commit-style.md +14 -14
- package/.agents/rules/INDEX.md +18 -18
- package/.agents/skills/INDEX.md +8 -8
- package/.agents/skills/README.md +1 -1
- package/.agents/skills/catalog.md +106 -106
- package/.agents/skills/find-skills/SKILL.md +142 -142
- package/.agents/stack/README.md +69 -66
- package/.agents/stack/desktop.md +36 -36
- package/.agents/stack/library.md +1 -1
- package/.agents/stack/web-app.md +32 -32
- package/.agents/standards/INDEX.md +23 -23
- package/.agents/standards/accessibility.md +50 -50
- package/.agents/standards/architecture.md +39 -39
- package/.agents/standards/attribution.md +39 -39
- package/.agents/standards/clean-code.md +121 -121
- package/.agents/standards/codex.md +69 -69
- package/.agents/standards/error-codes.md +41 -41
- package/.agents/standards/general.md +46 -46
- package/.agents/standards/guardrail-tests.md +40 -40
- package/.agents/standards/knowledge-management.md +35 -35
- package/.agents/standards/launch-security-checklist.md +45 -45
- package/.agents/standards/observability.md +35 -35
- package/.agents/standards/release-versioning.md +53 -53
- package/.agents/standards/requirements.md +75 -75
- package/.agents/standards/security-scanners.md +42 -42
- package/.agents/standards/testing-strategy.md +61 -61
- package/.agents/standards/typescript.md +19 -19
- package/.agents/standards/writing.md +58 -58
- package/.agents/tooling.json +19 -19
- package/LICENSE +1 -1
- package/README.md +139 -139
- package/bin/grimoire.mjs +630 -598
- package/package.json +32 -32
- package/templates/CLAUDE.md +7 -7
- package/templates/ci/ci.yml +49 -49
- package/templates/ci/sast.yml +44 -44
- package/templates/codex/INDEX.md +18 -18
- package/templates/codex/README.md +28 -28
- package/templates/codex/decisions/0000-template.md +36 -36
- package/templates/codex/decisions/INDEX.md +11 -11
- package/templates/codex/decisions/README.md +25 -25
- package/templates/codex/domain/INDEX.md +14 -14
- package/templates/codex/domain/README.md +10 -10
- package/templates/codex/evidence/0000-extraction-template.md +36 -36
- package/templates/codex/evidence/INDEX.md +11 -11
- package/templates/codex/evidence/README.md +15 -15
- package/templates/codex/reference/INDEX.md +11 -11
- package/templates/codex/reference/README.md +15 -15
- package/templates/codex/reference/confirmed-values.md +18 -18
- package/templates/codex/requirements/INDEX.md +11 -11
- package/templates/codex/requirements/README.md +22 -22
- package/templates/codex/requirements/addons/0000-template.md +35 -35
- package/templates/codex/requirements/base.md +36 -36
- package/templates/codex/requirements/changes/0000-template.md +39 -39
- package/templates/codex/resources/INDEX.md +11 -11
- package/templates/codex/resources/README.md +17 -17
- package/templates/codex/resources/manifest.md +11 -11
- package/templates/codex/runbooks/INDEX.md +9 -9
- package/templates/codex/runbooks/README.md +8 -8
- package/templates/codex/runbooks/incident-runbook-template.md +58 -58
- package/templates/gitignore-snippet.txt +10 -12
- package/templates/journal/backlog/README.md +18 -18
- package/templates/journal/memory/MEMORY.md +15 -15
- package/templates/journal/session/archive/.gitkeep +1 -1
- package/templates/journal/session/artifacts/.gitkeep +1 -1
- package/templates/journal/session/current.md +12 -12
- package/templates/lint/README.md +25 -25
- package/templates/lint/eslint.config.mjs +33 -33
- package/templates/lint/tsconfig.base.json +11 -11
- package/templates/local/AGENTS.local.md +33 -33
- package/templates/local/README.md +55 -55
- package/templates/tests/guardrail.invariants.test.ts +59 -59
package/package.json
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "the-grimoire-cli",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "A reusable, tool-agnostic AI-agent operating system. Init it into any project; sync template updates without clobbering local customization.",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"grimoire": "bin/grimoire.mjs"
|
|
8
|
-
},
|
|
9
|
-
"repository": {
|
|
10
|
-
"type": "git",
|
|
11
|
-
"url": "git+https://github.com/nuttchanon/the-grimoire.git"
|
|
12
|
-
},
|
|
13
|
-
"homepage": "https://github.com/nuttchanon/the-grimoire#readme",
|
|
14
|
-
"bugs": "https://github.com/nuttchanon/the-grimoire/issues",
|
|
15
|
-
"keywords": ["ai", "agent", "claude", "claude-code", "scaffold", "template", "cli", "agents.md"],
|
|
16
|
-
"files": [
|
|
17
|
-
"bin/",
|
|
18
|
-
".agents/",
|
|
19
|
-
"templates/",
|
|
20
|
-
"README.md",
|
|
21
|
-
"LICENSE"
|
|
22
|
-
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "node --test \"test/**/*.test.mjs\"",
|
|
25
|
-
"index:check": "node bin/grimoire.mjs index --dir . --check"
|
|
26
|
-
},
|
|
27
|
-
"engines": {
|
|
28
|
-
"node": ">=18"
|
|
29
|
-
},
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"author": "Nutt"
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "the-grimoire-cli",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "A reusable, tool-agnostic AI-agent operating system. Init it into any project; sync template updates without clobbering local customization.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"grimoire": "bin/grimoire.mjs"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/nuttchanon/the-grimoire.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/nuttchanon/the-grimoire#readme",
|
|
14
|
+
"bugs": "https://github.com/nuttchanon/the-grimoire/issues",
|
|
15
|
+
"keywords": ["ai", "agent", "claude", "claude-code", "scaffold", "template", "cli", "agents.md"],
|
|
16
|
+
"files": [
|
|
17
|
+
"bin/",
|
|
18
|
+
".agents/",
|
|
19
|
+
"templates/",
|
|
20
|
+
"README.md",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "node --test \"test/**/*.test.mjs\"",
|
|
25
|
+
"index:check": "node bin/grimoire.mjs index --dir . --check"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=18"
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"author": "Nutt"
|
|
32
|
+
}
|
package/templates/CLAUDE.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This project uses **Grimoire**. The canonical agent contract is `.agents/AGENTS.md`.
|
|
4
|
-
Read it first, then follow its load order.
|
|
5
|
-
|
|
6
|
-
@.agents/AGENTS.md
|
|
7
|
-
@local/AGENTS.local.md
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This project uses **Grimoire**. The canonical agent contract is `.agents/AGENTS.md`.
|
|
4
|
+
Read it first, then follow its load order.
|
|
5
|
+
|
|
6
|
+
@.agents/AGENTS.md
|
|
7
|
+
@local/AGENTS.local.md
|
package/templates/ci/ci.yml
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
# CI — lint, typecheck, test, build. Copy to .github/workflows/ci.yml.
|
|
2
|
-
# This is the correctness gate; security scanning lives in the sibling sast.yml.
|
|
3
|
-
# Commands here must match the active stack profile's `verify` (.agents/stack/<profile>.md) —
|
|
4
|
-
# keep them in sync so local `verify` and CI run the same checks.
|
|
5
|
-
name: ci
|
|
6
|
-
|
|
7
|
-
on:
|
|
8
|
-
pull_request:
|
|
9
|
-
push:
|
|
10
|
-
branches: [main, master]
|
|
11
|
-
|
|
12
|
-
permissions:
|
|
13
|
-
contents: read
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
verify:
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
steps:
|
|
19
|
-
- uses: actions/checkout@v4
|
|
20
|
-
- uses: actions/setup-node@v4
|
|
21
|
-
with:
|
|
22
|
-
node-version: "20"
|
|
23
|
-
cache: npm # change to pnpm/yarn to match the project
|
|
24
|
-
|
|
25
|
-
- run: npm ci
|
|
26
|
-
|
|
27
|
-
# --- The four gates. Drop any line a profile doesn't have; order is cheapest-first. ---
|
|
28
|
-
- name: Lint
|
|
29
|
-
run: npm run lint
|
|
30
|
-
|
|
31
|
-
- name: Typecheck
|
|
32
|
-
run: npx tsc --noEmit
|
|
33
|
-
|
|
34
|
-
- name: Test
|
|
35
|
-
run: npm test # node --test / vitest / jest per profile
|
|
36
|
-
|
|
37
|
-
- name: Build
|
|
38
|
-
run: npm run build
|
|
39
|
-
|
|
40
|
-
# --- Contract guard: agent docs/index must not drift (.agents/) ---
|
|
41
|
-
- name: Grimoire index check
|
|
42
|
-
run: npx github:nuttchanon/the-grimoire index --check
|
|
43
|
-
# Remove this step if the project does not vendor Grimoire's INDEX.md generation.
|
|
44
|
-
|
|
45
|
-
# Per stack profile (.agents/stack/):
|
|
46
|
-
# web-app : lint + typecheck + test (vitest) + build (next build). Add the e2e job when present.
|
|
47
|
-
# desktop : lint + typecheck + test + build (electron-builder --dir for PR; full pack on release).
|
|
48
|
-
# library : lint + typecheck + test + build (tsup/unbuild) + a changesets status check on PRs.
|
|
49
|
-
# Accessibility: add an axe/Lighthouse job for user-facing apps (.agents/standards/accessibility.md).
|
|
1
|
+
# CI — lint, typecheck, test, build. Copy to .github/workflows/ci.yml.
|
|
2
|
+
# This is the correctness gate; security scanning lives in the sibling sast.yml.
|
|
3
|
+
# Commands here must match the active stack profile's `verify` (.agents/stack/<profile>.md) —
|
|
4
|
+
# keep them in sync so local `verify` and CI run the same checks.
|
|
5
|
+
name: ci
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
push:
|
|
10
|
+
branches: [main, master]
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
verify:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
- uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: "20"
|
|
23
|
+
cache: npm # change to pnpm/yarn to match the project
|
|
24
|
+
|
|
25
|
+
- run: npm ci
|
|
26
|
+
|
|
27
|
+
# --- The four gates. Drop any line a profile doesn't have; order is cheapest-first. ---
|
|
28
|
+
- name: Lint
|
|
29
|
+
run: npm run lint
|
|
30
|
+
|
|
31
|
+
- name: Typecheck
|
|
32
|
+
run: npx tsc --noEmit
|
|
33
|
+
|
|
34
|
+
- name: Test
|
|
35
|
+
run: npm test # node --test / vitest / jest per profile
|
|
36
|
+
|
|
37
|
+
- name: Build
|
|
38
|
+
run: npm run build
|
|
39
|
+
|
|
40
|
+
# --- Contract guard: agent docs/index must not drift (.agents/) ---
|
|
41
|
+
- name: Grimoire index check
|
|
42
|
+
run: npx github:nuttchanon/the-grimoire index --check
|
|
43
|
+
# Remove this step if the project does not vendor Grimoire's INDEX.md generation.
|
|
44
|
+
|
|
45
|
+
# Per stack profile (.agents/stack/):
|
|
46
|
+
# web-app : lint + typecheck + test (vitest) + build (next build). Add the e2e job when present.
|
|
47
|
+
# desktop : lint + typecheck + test + build (electron-builder --dir for PR; full pack on release).
|
|
48
|
+
# library : lint + typecheck + test + build (tsup/unbuild) + a changesets status check on PRs.
|
|
49
|
+
# Accessibility: add an axe/Lighthouse job for user-facing apps (.agents/standards/accessibility.md).
|
package/templates/ci/sast.yml
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# SAST — static application security testing. Copy to .github/workflows/sast.yml.
|
|
2
|
-
# Linters find what is ugly; SAST finds what is exploitable (SQLi, XSS, RCE, secrets, weak crypto).
|
|
3
|
-
# Fail the build on High/Critical. Scanner choice is per stack profile — see notes at the bottom.
|
|
4
|
-
name: sast
|
|
5
|
-
|
|
6
|
-
on:
|
|
7
|
-
pull_request:
|
|
8
|
-
push:
|
|
9
|
-
branches: [main, master]
|
|
10
|
-
|
|
11
|
-
permissions:
|
|
12
|
-
contents: read
|
|
13
|
-
security-events: write # for SARIF upload to GitHub code scanning
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
semgrep:
|
|
17
|
-
# Pattern-based, 30+ languages. Default for every profile.
|
|
18
|
-
runs-on: ubuntu-latest
|
|
19
|
-
container: { image: semgrep/semgrep }
|
|
20
|
-
steps:
|
|
21
|
-
- uses: actions/checkout@v4
|
|
22
|
-
- run: semgrep ci --config auto --error
|
|
23
|
-
env:
|
|
24
|
-
# Optional: set SEMGREP_APP_TOKEN to use org rules + the Semgrep dashboard.
|
|
25
|
-
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
|
26
|
-
|
|
27
|
-
njsscan:
|
|
28
|
-
# JS / Node / React / React Native / Electron. Drop this job for non-JS profiles.
|
|
29
|
-
runs-on: ubuntu-latest
|
|
30
|
-
steps:
|
|
31
|
-
- uses: actions/checkout@v4
|
|
32
|
-
- uses: actions/setup-python@v5
|
|
33
|
-
with: { python-version: "3.12" }
|
|
34
|
-
- run: pip install njsscan
|
|
35
|
-
- run: njsscan --exit-on-warn .
|
|
36
|
-
|
|
37
|
-
# Per stack profile (standards/security-scanners.md):
|
|
38
|
-
# web-app (Next.js) : semgrep + njsscan here, AND enable CodeQL code scanning (js/ts).
|
|
39
|
-
# desktop (Electron) : semgrep + njsscan here (njsscan flags Electron sinks), AND CodeQL.
|
|
40
|
-
# library : semgrep here; add the language's native scanner (bandit/gosec/…) if not JS/TS.
|
|
41
|
-
# any Python service : add a bandit job (pip install bandit; bandit -r src -ll).
|
|
42
|
-
#
|
|
43
|
-
# CodeQL is configured separately — GitHub → Security → Code scanning → enable default setup,
|
|
44
|
-
# or add github/codeql-action via its own workflow. It is free for public repos.
|
|
1
|
+
# SAST — static application security testing. Copy to .github/workflows/sast.yml.
|
|
2
|
+
# Linters find what is ugly; SAST finds what is exploitable (SQLi, XSS, RCE, secrets, weak crypto).
|
|
3
|
+
# Fail the build on High/Critical. Scanner choice is per stack profile — see notes at the bottom.
|
|
4
|
+
name: sast
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main, master]
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: read
|
|
13
|
+
security-events: write # for SARIF upload to GitHub code scanning
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
semgrep:
|
|
17
|
+
# Pattern-based, 30+ languages. Default for every profile.
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
container: { image: semgrep/semgrep }
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- run: semgrep ci --config auto --error
|
|
23
|
+
env:
|
|
24
|
+
# Optional: set SEMGREP_APP_TOKEN to use org rules + the Semgrep dashboard.
|
|
25
|
+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
|
|
26
|
+
|
|
27
|
+
njsscan:
|
|
28
|
+
# JS / Node / React / React Native / Electron. Drop this job for non-JS profiles.
|
|
29
|
+
runs-on: ubuntu-latest
|
|
30
|
+
steps:
|
|
31
|
+
- uses: actions/checkout@v4
|
|
32
|
+
- uses: actions/setup-python@v5
|
|
33
|
+
with: { python-version: "3.12" }
|
|
34
|
+
- run: pip install njsscan
|
|
35
|
+
- run: njsscan --exit-on-warn .
|
|
36
|
+
|
|
37
|
+
# Per stack profile (standards/security-scanners.md):
|
|
38
|
+
# web-app (Next.js) : semgrep + njsscan here, AND enable CodeQL code scanning (js/ts).
|
|
39
|
+
# desktop (Electron) : semgrep + njsscan here (njsscan flags Electron sinks), AND CodeQL.
|
|
40
|
+
# library : semgrep here; add the language's native scanner (bandit/gosec/…) if not JS/TS.
|
|
41
|
+
# any Python service : add a bandit job (pip install bandit; bandit -r src -ll).
|
|
42
|
+
#
|
|
43
|
+
# CodeQL is configured separately — GitHub → Security → Code scanning → enable default setup,
|
|
44
|
+
# or add github/codeql-action via its own workflow. It is free for public repos.
|
package/templates/codex/INDEX.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
# codex — index (read this first)
|
|
2
|
-
|
|
3
|
-
The project's **knowledge / resource root**. Read this signpost before touching any domain reference,
|
|
4
|
-
then open the matching subfolder's own `INDEX.md`. Project-owned: `grimoire sync` never touches
|
|
5
|
-
`codex/`; the base holds only a pointer to it. Every folder below keeps its own `INDEX.md`.
|
|
6
|
-
|
|
7
|
-
| Folder | What it holds |
|
|
8
|
-
|---|---|
|
|
9
|
-
| `domain/` | What the system **is** — glossary, context, business rules, capabilities. |
|
|
10
|
-
| `requirements/` | What it must **do** — IDed, versioned base + addons + change requests. |
|
|
11
|
-
| `decisions/` | **Why** it is built this way — ADRs (one file per decision). |
|
|
12
|
-
| `evidence/` | Investigation / reverse-engineering / extraction outputs, each fact sourced. |
|
|
13
|
-
| `resources/` | Raw materials — datasets, vendor specs, dumps, external artifacts/snapshots. |
|
|
14
|
-
| `reference/` | Confirmed-value tables, API/IPC catalogs, big contracts the code reads back. |
|
|
15
|
-
| `runbooks/` | The on-call answer to "production is broken — what now." |
|
|
16
|
-
|
|
17
|
-
Protocol: `.agents/standards/codex.md`. The structure is **extensible** — add a folder when a new
|
|
18
|
-
kind of knowledge appears; give it an `INDEX.md` and list it here.
|
|
1
|
+
# codex — index (read this first)
|
|
2
|
+
|
|
3
|
+
The project's **knowledge / resource root**. Read this signpost before touching any domain reference,
|
|
4
|
+
then open the matching subfolder's own `INDEX.md`. Project-owned: `grimoire sync` never touches
|
|
5
|
+
`codex/`; the base holds only a pointer to it. Every folder below keeps its own `INDEX.md`.
|
|
6
|
+
|
|
7
|
+
| Folder | What it holds |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `domain/` | What the system **is** — glossary, context, business rules, capabilities. |
|
|
10
|
+
| `requirements/` | What it must **do** — IDed, versioned base + addons + change requests. |
|
|
11
|
+
| `decisions/` | **Why** it is built this way — ADRs (one file per decision). |
|
|
12
|
+
| `evidence/` | Investigation / reverse-engineering / extraction outputs, each fact sourced. |
|
|
13
|
+
| `resources/` | Raw materials — datasets, vendor specs, dumps, external artifacts/snapshots. |
|
|
14
|
+
| `reference/` | Confirmed-value tables, API/IPC catalogs, big contracts the code reads back. |
|
|
15
|
+
| `runbooks/` | The on-call answer to "production is broken — what now." |
|
|
16
|
+
|
|
17
|
+
Protocol: `.agents/standards/codex.md`. The structure is **extensible** — add a folder when a new
|
|
18
|
+
kind of knowledge appears; give it an `INDEX.md` and list it here.
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
# codex
|
|
2
|
-
|
|
3
|
-
The project's **knowledge and resource root**, at the repo root (not under `.agents/`). It is the
|
|
4
|
-
rebuild's source of truth: what the system is, what it must do, why it's built that way, and the raw
|
|
5
|
-
materials and evidence behind those claims. Project-owned — `grimoire sync` never touches it; the
|
|
6
|
-
base contract only points here. Full protocol: `.agents/standards/codex.md`.
|
|
7
|
-
|
|
8
|
-
## Read-first rule
|
|
9
|
-
|
|
10
|
-
Any domain reference starts at `codex/INDEX.md`, then the relevant subfolder's `INDEX.md`. New work
|
|
11
|
-
reads the matching INDEX **before** acting — don't start a task blind to recorded knowledge.
|
|
12
|
-
|
|
13
|
-
## Provenance discipline
|
|
14
|
-
|
|
15
|
-
Every recorded fact cites its **source** (file + offset/record) and a **CONFIRMED | INFERRED** tag.
|
|
16
|
-
Unsupported claims are removed or demoted to "not recovered" — no unsourced guesses. Pre-existing
|
|
17
|
-
docs are not trusted until audited to this standard (carry `audited: <date>`).
|
|
18
|
-
|
|
19
|
-
## How to add a folder
|
|
20
|
-
|
|
21
|
-
codex is extensible. When a new kind of knowledge appears, add a folder, give it an `INDEX.md`
|
|
22
|
-
(signpost table) and a short `README.md`, and list it in the master `codex/INDEX.md`. Keep every
|
|
23
|
-
file lean (context economy).
|
|
24
|
-
|
|
25
|
-
## Secrets
|
|
26
|
-
|
|
27
|
-
Real secrets / PHI never go in tracked knowledge docs — see `resources/README.md` and
|
|
28
|
-
`.agents/standards/codex.md`. The chat is the leak boundary: never echo a secret or PHI into output.
|
|
1
|
+
# codex
|
|
2
|
+
|
|
3
|
+
The project's **knowledge and resource root**, at the repo root (not under `.agents/`). It is the
|
|
4
|
+
rebuild's source of truth: what the system is, what it must do, why it's built that way, and the raw
|
|
5
|
+
materials and evidence behind those claims. Project-owned — `grimoire sync` never touches it; the
|
|
6
|
+
base contract only points here. Full protocol: `.agents/standards/codex.md`.
|
|
7
|
+
|
|
8
|
+
## Read-first rule
|
|
9
|
+
|
|
10
|
+
Any domain reference starts at `codex/INDEX.md`, then the relevant subfolder's `INDEX.md`. New work
|
|
11
|
+
reads the matching INDEX **before** acting — don't start a task blind to recorded knowledge.
|
|
12
|
+
|
|
13
|
+
## Provenance discipline
|
|
14
|
+
|
|
15
|
+
Every recorded fact cites its **source** (file + offset/record) and a **CONFIRMED | INFERRED** tag.
|
|
16
|
+
Unsupported claims are removed or demoted to "not recovered" — no unsourced guesses. Pre-existing
|
|
17
|
+
docs are not trusted until audited to this standard (carry `audited: <date>`).
|
|
18
|
+
|
|
19
|
+
## How to add a folder
|
|
20
|
+
|
|
21
|
+
codex is extensible. When a new kind of knowledge appears, add a folder, give it an `INDEX.md`
|
|
22
|
+
(signpost table) and a short `README.md`, and list it in the master `codex/INDEX.md`. Keep every
|
|
23
|
+
file lean (context economy).
|
|
24
|
+
|
|
25
|
+
## Secrets
|
|
26
|
+
|
|
27
|
+
Real secrets / PHI never go in tracked knowledge docs — see `resources/README.md` and
|
|
28
|
+
`.agents/standards/codex.md`. The chat is the leak boundary: never echo a secret or PHI into output.
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: 0000
|
|
3
|
-
title: <short decision title>
|
|
4
|
-
status: proposed # proposed | accepted | superseded | deprecated
|
|
5
|
-
date: <YYYY-MM-DD>
|
|
6
|
-
updates-confirmed-values: no # yes | no — see "Confirmed values" below
|
|
7
|
-
supersedes: # ADR id(s) this replaces, if any
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# ADR 0000 — <short decision title>
|
|
11
|
-
|
|
12
|
-
## Context
|
|
13
|
-
|
|
14
|
-
What forces this decision? The problem, constraints, and the options actually on the table. Keep it
|
|
15
|
-
factual — no solution yet.
|
|
16
|
-
|
|
17
|
-
## Decision
|
|
18
|
-
|
|
19
|
-
The choice, stated as one sentence in active voice ("We will …"). Then the *why* in a few lines.
|
|
20
|
-
|
|
21
|
-
## Consequences
|
|
22
|
-
|
|
23
|
-
What becomes easier, what becomes harder, what we now owe (migrations, follow-ups, risks).
|
|
24
|
-
|
|
25
|
-
## Confirmed values
|
|
26
|
-
|
|
27
|
-
> Set `updates-confirmed-values: yes` in the frontmatter **only if this decision changes a value the
|
|
28
|
-
> code treats as ground truth** — an IPC channel name, an error code, a permission key, a hospital/
|
|
29
|
-
> tenant config, an enum the UI and server both depend on.
|
|
30
|
-
|
|
31
|
-
If `yes`: list each value below **and** update the project's confirmed-values table
|
|
32
|
-
(`codex/reference/`) in the same PR (the PR checklist enforces this). If `no`, delete this section.
|
|
33
|
-
|
|
34
|
-
| Value | Old | New | Where it lives |
|
|
35
|
-
|---|---|---|---|
|
|
36
|
-
| | | | |
|
|
1
|
+
---
|
|
2
|
+
id: 0000
|
|
3
|
+
title: <short decision title>
|
|
4
|
+
status: proposed # proposed | accepted | superseded | deprecated
|
|
5
|
+
date: <YYYY-MM-DD>
|
|
6
|
+
updates-confirmed-values: no # yes | no — see "Confirmed values" below
|
|
7
|
+
supersedes: # ADR id(s) this replaces, if any
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# ADR 0000 — <short decision title>
|
|
11
|
+
|
|
12
|
+
## Context
|
|
13
|
+
|
|
14
|
+
What forces this decision? The problem, constraints, and the options actually on the table. Keep it
|
|
15
|
+
factual — no solution yet.
|
|
16
|
+
|
|
17
|
+
## Decision
|
|
18
|
+
|
|
19
|
+
The choice, stated as one sentence in active voice ("We will …"). Then the *why* in a few lines.
|
|
20
|
+
|
|
21
|
+
## Consequences
|
|
22
|
+
|
|
23
|
+
What becomes easier, what becomes harder, what we now owe (migrations, follow-ups, risks).
|
|
24
|
+
|
|
25
|
+
## Confirmed values
|
|
26
|
+
|
|
27
|
+
> Set `updates-confirmed-values: yes` in the frontmatter **only if this decision changes a value the
|
|
28
|
+
> code treats as ground truth** — an IPC channel name, an error code, a permission key, a hospital/
|
|
29
|
+
> tenant config, an enum the UI and server both depend on.
|
|
30
|
+
|
|
31
|
+
If `yes`: list each value below **and** update the project's confirmed-values table
|
|
32
|
+
(`codex/reference/`) in the same PR (the PR checklist enforces this). If `no`, delete this section.
|
|
33
|
+
|
|
34
|
+
| Value | Old | New | Where it lives |
|
|
35
|
+
|---|---|---|---|
|
|
36
|
+
| | | | |
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# decisions — index
|
|
2
|
-
|
|
3
|
-
**Why** the system is built the way it is: Architecture Decision Records, one file per decision.
|
|
4
|
-
Requirements say *what*; decisions say *how* and *why*.
|
|
5
|
-
|
|
6
|
-
| Entry | What it holds |
|
|
7
|
-
|---|---|
|
|
8
|
-
| `README.md` | When to write an ADR, the `updates-confirmed-values` field, the status lifecycle. |
|
|
9
|
-
| `0000-template.md` | Copy this for each new decision: `NNNN-kebab-title.md`. |
|
|
10
|
-
|
|
11
|
-
<!-- ADRs accumulate here as NNNN-kebab-title.md; number sequentially, never renumber. -->
|
|
1
|
+
# decisions — index
|
|
2
|
+
|
|
3
|
+
**Why** the system is built the way it is: Architecture Decision Records, one file per decision.
|
|
4
|
+
Requirements say *what*; decisions say *how* and *why*.
|
|
5
|
+
|
|
6
|
+
| Entry | What it holds |
|
|
7
|
+
|---|---|
|
|
8
|
+
| `README.md` | When to write an ADR, the `updates-confirmed-values` field, the status lifecycle. |
|
|
9
|
+
| `0000-template.md` | Copy this for each new decision: `NNNN-kebab-title.md`. |
|
|
10
|
+
|
|
11
|
+
<!-- ADRs accumulate here as NNNN-kebab-title.md; number sequentially, never renumber. -->
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# Architecture Decision Records
|
|
2
|
-
|
|
3
|
-
One file per decision: `codex/decisions/NNNN-kebab-title.md`, copied from `0000-template.md`. ADRs are
|
|
4
|
-
**project-owned** — `grimoire sync` never touches this folder. Number sequentially; never renumber.
|
|
5
|
-
|
|
6
|
-
## When to write one
|
|
7
|
-
|
|
8
|
-
- A choice with lasting consequences (framework, data model, auth model, module boundaries).
|
|
9
|
-
- A trade-off a future reader would otherwise relitigate.
|
|
10
|
-
- **No test suite for a unit of work.** Absence of tests is a *recorded decision*, not a silent
|
|
11
|
-
omission: open an ADR stating why (spike/throwaway, external constraint) and the conditions under
|
|
12
|
-
which tests get backfilled. A missing test suite with no ADR is a defect.
|
|
13
|
-
|
|
14
|
-
## The `updates-confirmed-values` field
|
|
15
|
-
|
|
16
|
-
Some values are **ground truth** the code reads back — IPC channel names, error codes, permission
|
|
17
|
-
keys, tenant/hospital configs, shared enums. When an ADR changes one of these, set
|
|
18
|
-
`updates-confirmed-values: yes` and, **in the same PR**, update the project's confirmed-values table
|
|
19
|
-
(`codex/reference/`). The PR checklist must verify the table was updated; a `yes` ADR without a
|
|
20
|
-
matching table change does not merge.
|
|
21
|
-
|
|
22
|
-
## Status lifecycle
|
|
23
|
-
|
|
24
|
-
`proposed` → `accepted` (merged) → later `superseded` (point the new ADR's `supersedes:` at it) or
|
|
25
|
-
`deprecated`. Never delete an accepted ADR; supersede it so the history stays legible.
|
|
1
|
+
# Architecture Decision Records
|
|
2
|
+
|
|
3
|
+
One file per decision: `codex/decisions/NNNN-kebab-title.md`, copied from `0000-template.md`. ADRs are
|
|
4
|
+
**project-owned** — `grimoire sync` never touches this folder. Number sequentially; never renumber.
|
|
5
|
+
|
|
6
|
+
## When to write one
|
|
7
|
+
|
|
8
|
+
- A choice with lasting consequences (framework, data model, auth model, module boundaries).
|
|
9
|
+
- A trade-off a future reader would otherwise relitigate.
|
|
10
|
+
- **No test suite for a unit of work.** Absence of tests is a *recorded decision*, not a silent
|
|
11
|
+
omission: open an ADR stating why (spike/throwaway, external constraint) and the conditions under
|
|
12
|
+
which tests get backfilled. A missing test suite with no ADR is a defect.
|
|
13
|
+
|
|
14
|
+
## The `updates-confirmed-values` field
|
|
15
|
+
|
|
16
|
+
Some values are **ground truth** the code reads back — IPC channel names, error codes, permission
|
|
17
|
+
keys, tenant/hospital configs, shared enums. When an ADR changes one of these, set
|
|
18
|
+
`updates-confirmed-values: yes` and, **in the same PR**, update the project's confirmed-values table
|
|
19
|
+
(`codex/reference/`). The PR checklist must verify the table was updated; a `yes` ADR without a
|
|
20
|
+
matching table change does not merge.
|
|
21
|
+
|
|
22
|
+
## Status lifecycle
|
|
23
|
+
|
|
24
|
+
`proposed` → `accepted` (merged) → later `superseded` (point the new ADR's `supersedes:` at it) or
|
|
25
|
+
`deprecated`. Never delete an accepted ADR; supersede it so the history stays legible.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# domain — index
|
|
2
|
-
|
|
3
|
-
What the system **is**: the shared language and rules that everything else cites. Read before
|
|
4
|
-
writing requirements or code in an unfamiliar area.
|
|
5
|
-
|
|
6
|
-
| Entry | What it holds |
|
|
7
|
-
|---|---|
|
|
8
|
-
| `README.md` | What belongs in `domain/` and how to keep it sourced. |
|
|
9
|
-
| `glossary.md` | Domain terms → precise definitions (add as the language stabilizes). |
|
|
10
|
-
| `context.md` | The business/system context: actors, boundaries, why the system exists. |
|
|
11
|
-
| `business-rules.md` | The rules the system must enforce, each cited to its source. |
|
|
12
|
-
| `capabilities.md` | What the system can do, at the capability (not requirement) level. |
|
|
13
|
-
|
|
14
|
-
<!-- Seed these files as the domain takes shape; delete rows you don't use yet. -->
|
|
1
|
+
# domain — index
|
|
2
|
+
|
|
3
|
+
What the system **is**: the shared language and rules that everything else cites. Read before
|
|
4
|
+
writing requirements or code in an unfamiliar area.
|
|
5
|
+
|
|
6
|
+
| Entry | What it holds |
|
|
7
|
+
|---|---|
|
|
8
|
+
| `README.md` | What belongs in `domain/` and how to keep it sourced. |
|
|
9
|
+
| `glossary.md` | Domain terms → precise definitions (add as the language stabilizes). |
|
|
10
|
+
| `context.md` | The business/system context: actors, boundaries, why the system exists. |
|
|
11
|
+
| `business-rules.md` | The rules the system must enforce, each cited to its source. |
|
|
12
|
+
| `capabilities.md` | What the system can do, at the capability (not requirement) level. |
|
|
13
|
+
|
|
14
|
+
<!-- Seed these files as the domain takes shape; delete rows you don't use yet. -->
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
# domain
|
|
2
|
-
|
|
3
|
-
What the system **is** — the shared vocabulary and the business rules that requirements, decisions,
|
|
4
|
-
and code all refer back to. This is where you fix the language so two people (or agents) mean the
|
|
5
|
-
same thing by the same word. Glossary, business/system context, enforced business rules, and the
|
|
6
|
-
high-level capability map live here.
|
|
7
|
-
|
|
8
|
-
Hold to the codex provenance discipline: each rule or definition that comes from a source artifact
|
|
9
|
-
cites it (file + offset, `CONFIRMED | INFERRED`). A definition you invented for convenience is
|
|
10
|
-
`INFERRED` until confirmed. See `.agents/standards/codex.md`.
|
|
1
|
+
# domain
|
|
2
|
+
|
|
3
|
+
What the system **is** — the shared vocabulary and the business rules that requirements, decisions,
|
|
4
|
+
and code all refer back to. This is where you fix the language so two people (or agents) mean the
|
|
5
|
+
same thing by the same word. Glossary, business/system context, enforced business rules, and the
|
|
6
|
+
high-level capability map live here.
|
|
7
|
+
|
|
8
|
+
Hold to the codex provenance discipline: each rule or definition that comes from a source artifact
|
|
9
|
+
cites it (file + offset, `CONFIRMED | INFERRED`). A definition you invented for convenience is
|
|
10
|
+
`INFERRED` until confirmed. See `.agents/standards/codex.md`.
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: 0000
|
|
3
|
-
title: <what was extracted / investigated>
|
|
4
|
-
status: draft # draft | reviewed
|
|
5
|
-
date: <YYYY-MM-DD>
|
|
6
|
-
audited: <YYYY-MM-DD> # date this doc was checked to the provenance standard
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Extraction 0000 — <what was extracted / investigated>
|
|
10
|
-
|
|
11
|
-
## Source artifact
|
|
12
|
-
|
|
13
|
-
What you investigated: file path / binary / dump / vendor doc, version or hash if known. One artifact
|
|
14
|
-
per doc where possible.
|
|
15
|
-
|
|
16
|
-
## Method / tool
|
|
17
|
-
|
|
18
|
-
How you extracted it — the tool, command, decompiler, query, or manual read. Enough that someone
|
|
19
|
-
could repeat it and get the same result.
|
|
20
|
-
|
|
21
|
-
## Findings
|
|
22
|
-
|
|
23
|
-
| item | source (file + offset/record) | CONFIRMED \| INFERRED | purpose |
|
|
24
|
-
|---|---|---|---|
|
|
25
|
-
| <value / rule / field> | `<file>:<offset>` or `<table>:<row>` | CONFIRMED | <what it's for> |
|
|
26
|
-
|
|
27
|
-
## Not recovered
|
|
28
|
-
|
|
29
|
-
What you looked for and could **not** establish, and why (encrypted, stripped, absent). This bounds
|
|
30
|
-
the claim — don't let a gap pass as settled.
|
|
31
|
-
|
|
32
|
-
## Security / redaction note
|
|
33
|
-
|
|
34
|
-
Confirm no real secret / PHI is recorded above. If the artifact contained any, record only its
|
|
35
|
-
**location + purpose** here for rotate/revoke; the value goes in the gitignored inventory
|
|
36
|
-
(`resources/`), never in this tracked doc.
|
|
1
|
+
---
|
|
2
|
+
id: 0000
|
|
3
|
+
title: <what was extracted / investigated>
|
|
4
|
+
status: draft # draft | reviewed
|
|
5
|
+
date: <YYYY-MM-DD>
|
|
6
|
+
audited: <YYYY-MM-DD> # date this doc was checked to the provenance standard
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Extraction 0000 — <what was extracted / investigated>
|
|
10
|
+
|
|
11
|
+
## Source artifact
|
|
12
|
+
|
|
13
|
+
What you investigated: file path / binary / dump / vendor doc, version or hash if known. One artifact
|
|
14
|
+
per doc where possible.
|
|
15
|
+
|
|
16
|
+
## Method / tool
|
|
17
|
+
|
|
18
|
+
How you extracted it — the tool, command, decompiler, query, or manual read. Enough that someone
|
|
19
|
+
could repeat it and get the same result.
|
|
20
|
+
|
|
21
|
+
## Findings
|
|
22
|
+
|
|
23
|
+
| item | source (file + offset/record) | CONFIRMED \| INFERRED | purpose |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| <value / rule / field> | `<file>:<offset>` or `<table>:<row>` | CONFIRMED | <what it's for> |
|
|
26
|
+
|
|
27
|
+
## Not recovered
|
|
28
|
+
|
|
29
|
+
What you looked for and could **not** establish, and why (encrypted, stripped, absent). This bounds
|
|
30
|
+
the claim — don't let a gap pass as settled.
|
|
31
|
+
|
|
32
|
+
## Security / redaction note
|
|
33
|
+
|
|
34
|
+
Confirm no real secret / PHI is recorded above. If the artifact contained any, record only its
|
|
35
|
+
**location + purpose** here for rotate/revoke; the value goes in the gitignored inventory
|
|
36
|
+
(`resources/`), never in this tracked doc.
|