@lvlup-sw/axiom 0.2.6 → 0.3.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/.claude-plugin/plugin.json +2 -2
- package/package.json +2 -1
- package/skills/audit/SKILL.md +24 -0
- package/skills/backend-quality/SKILL.md +4 -0
- package/skills/backend-quality/references/dimensions.md +56 -0
- package/skills/backend-quality/references/pairing-contract.md +78 -0
- package/skills/design/SKILL.md +68 -0
- package/skills/scaffold-invariants/SKILL.md +103 -0
- package/skills/scaffold-invariants/templates/INV.template.md +37 -0
- package/skills/scaffold-invariants/templates/SKILL.template.md +65 -0
- package/skills/scaffold-invariants/templates/deterministic-checks.template.md +28 -0
- package/vendor/skill-creator/LICENSE +202 -0
- package/vendor/skill-creator/SKILL.md +485 -0
- package/vendor/skill-creator/UPSTREAM.md +58 -0
- package/vendor/skill-creator/agents/analyzer.md +274 -0
- package/vendor/skill-creator/agents/comparator.md +202 -0
- package/vendor/skill-creator/agents/grader.md +223 -0
- package/vendor/skill-creator/assets/eval_review.html +146 -0
- package/vendor/skill-creator/eval-viewer/generate_review.py +471 -0
- package/vendor/skill-creator/eval-viewer/viewer.html +1325 -0
- package/vendor/skill-creator/references/schemas.md +430 -0
- package/vendor/skill-creator/scripts/__init__.py +0 -0
- package/vendor/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/vendor/skill-creator/scripts/generate_report.py +326 -0
- package/vendor/skill-creator/scripts/improve_description.py +247 -0
- package/vendor/skill-creator/scripts/package_skill.py +136 -0
- package/vendor/skill-creator/scripts/quick_validate.py +103 -0
- package/vendor/skill-creator/scripts/run_eval.py +310 -0
- package/vendor/skill-creator/scripts/run_loop.py +328 -0
- package/vendor/skill-creator/scripts/utils.py +47 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "axiom",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Backend code quality skills for Claude Code.
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Backend code quality skills for Claude Code. Nine skills that audit, critique, harden, simplify, humanize, and design-constrain your architecture — the backend half of impeccable.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "LevelUp Software"
|
|
7
7
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lvlup-sw/axiom",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Backend code quality skills for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
".claude-plugin",
|
|
12
12
|
"skills",
|
|
13
|
+
"vendor",
|
|
13
14
|
"CLAUDE.md"
|
|
14
15
|
],
|
|
15
16
|
"keywords": [
|
package/skills/audit/SKILL.md
CHANGED
|
@@ -109,6 +109,29 @@ Output the structured report per the template in `@skills/backend-quality/refere
|
|
|
109
109
|
[Top 3-5 prioritized action items]
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
## Pairing Contract Check
|
|
113
|
+
|
|
114
|
+
When the assessed scope contains a project-specific invariants skill (any loaded skill with frontmatter `pairs-with: axiom:design`), audit runs an advisory check against the pairing contract documented at `@skills/backend-quality/references/pairing-contract.md`.
|
|
115
|
+
|
|
116
|
+
**Two checks, both LOW severity, both advisory only:**
|
|
117
|
+
|
|
118
|
+
1. **Overlap declaration.** The paired skill must declare `axiom_overlap: DIM-N` for at least one of its invariants. A paired skill with zero overlap declarations is technically compliant (axiom_overlap is optional per the contract) but suggests the pairing isn't specializing axiom dimensions in any documented way — likely a documentation gap.
|
|
119
|
+
2. **Overlap validity.** Each declared `axiom_overlap` value must reference a real dimension (`DIM-1` through `DIM-8`). Typos like `DIM-9` or `DIM-1A` are flagged.
|
|
120
|
+
|
|
121
|
+
**Severity rationale.** Pairing-contract violations don't break functionality; they erode the design-time interleaving experience over time. LOW severity reflects that. These findings never escalate the audit verdict beyond `NEEDS_ATTENTION` and never produce HIGH/MEDIUM unless other findings independently warrant them.
|
|
122
|
+
|
|
123
|
+
**Output format.** Findings carry `dimension: pairing-contract` (a meta dimension distinct from DIM-1..DIM-8) so reviewers can filter them when desired:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"severity": "LOW",
|
|
128
|
+
"dimension": "pairing-contract",
|
|
129
|
+
"skill": "exarchos:design-invariants",
|
|
130
|
+
"description": "Paired skill declares pairs-with: axiom:design but no invariant has an axiom_overlap declaration.",
|
|
131
|
+
"required_fix": "Add axiom_overlap: DIM-N to at least one invariant, or update the pairing-contract declaration to reflect that this skill is project-specific without dimension overlap."
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
112
135
|
## Error Handling
|
|
113
136
|
|
|
114
137
|
- **Empty scope (no files to assess):** Return "Nothing to assess — no files found in scope" with verdict CLEAN
|
|
@@ -125,3 +148,4 @@ For details on how audit discovers skills, handles deduplication, and formats re
|
|
|
125
148
|
- Finding format: `@skills/backend-quality/references/findings-format.md`
|
|
126
149
|
- Scoring model: `@skills/backend-quality/references/scoring-model.md`
|
|
127
150
|
- Composition details: `@skills/audit/references/composition-guide.md`
|
|
151
|
+
- Pairing contract: `@skills/backend-quality/references/pairing-contract.md`
|
|
@@ -39,3 +39,7 @@ Verdict computation and health thresholds: `@skills/backend-quality/references/s
|
|
|
39
39
|
## Deterministic Checks
|
|
40
40
|
|
|
41
41
|
Grep patterns and structural checks per dimension: `@skills/backend-quality/references/deterministic-checks.md`
|
|
42
|
+
|
|
43
|
+
## Pairing Contract
|
|
44
|
+
|
|
45
|
+
How `axiom:design` composes with project-specific invariants skills via the `pairs-with` frontmatter slot: `@skills/backend-quality/references/pairing-contract.md`
|
|
@@ -27,6 +27,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
27
27
|
- Violation: `getStore()` silently creates an in-memory store when the real store wasn't wired, causing events to be invisible across modules
|
|
28
28
|
- Healthy: Constructor injection where the absence of a dependency is a startup error, not a silent fallback
|
|
29
29
|
|
|
30
|
+
### Design questions
|
|
31
|
+
|
|
32
|
+
- **Lifecycle ownership.** For every shared resource the design introduces, who creates it, who owns it, and where is the single source of truth?
|
|
33
|
+
- **Dependency injection.** Are all dependencies passed as parameters or constructor arguments? If any are module globals, what justifies the ambient state?
|
|
34
|
+
- **Fallback policy.** If a dependency isn't wired, does the system fail loud (startup error) or fall back silently? Loud is the default.
|
|
35
|
+
- **Graph shape.** Sketch the dependency graph for the new code. Are there cycles? If so, justify or break them.
|
|
36
|
+
|
|
30
37
|
---
|
|
31
38
|
|
|
32
39
|
## DIM-2: Observability
|
|
@@ -54,6 +61,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
54
61
|
- Violation: `catch { mutableState._events = [] }` — silently resets state on error, hiding the failure
|
|
55
62
|
- Healthy: `catch (e) { throw new Error('Failed to load events from store', { cause: e }) }`
|
|
56
63
|
|
|
64
|
+
### Design questions
|
|
65
|
+
|
|
66
|
+
- **Catch posture.** For every catch block the design will introduce, what action does it take: re-throw, log with context, or document why it swallows? "Swallow silently" is never the answer.
|
|
67
|
+
- **Error context.** When the new code raises an error, does the message include what failed, why, and what the caller should do? Generic messages are debt.
|
|
68
|
+
- **Fallback visibility.** If the design has a fallback path, how does it announce itself (log, metric, event)? An undetectable fallback is a silent failure waiting to happen.
|
|
69
|
+
- **Promise discipline.** For every `.catch()` or async error path, what's the recovery plan? Empty `.catch(() => {})` is forbidden.
|
|
70
|
+
|
|
57
71
|
---
|
|
58
72
|
|
|
59
73
|
## DIM-3: Contracts
|
|
@@ -81,6 +95,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
81
95
|
- Violation: `_events` removed from Zod schema but guard code still reads `state._events`, silently getting `undefined`
|
|
82
96
|
- Healthy: Schema changes accompanied by grep for all field references, with type system enforcing the change
|
|
83
97
|
|
|
98
|
+
### Design questions
|
|
99
|
+
|
|
100
|
+
- **Schema boundaries.** Where do the new types/schemas live? Is each runtime read of a field guaranteed by the schema, or is there a gap?
|
|
101
|
+
- **Versioning posture.** Does this design make a breaking API change? If yes, what's the versioning or migration path? If no, what makes the change backward-compatible?
|
|
102
|
+
- **Type assertions.** Will the implementation use `as` or `!` to bypass the type system? Each instance needs a documented runtime guard (`typeof`, `instanceof`, schema parse).
|
|
103
|
+
- **Cross-boundary contracts.** For every interface across module/service boundaries, who validates the contract — caller, callee, or both?
|
|
104
|
+
|
|
84
105
|
---
|
|
85
106
|
|
|
86
107
|
## DIM-4: Test Fidelity
|
|
@@ -109,6 +130,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
109
130
|
- Violation: All tests use the same EventStore instance for producer and consumer, but production has two separate instances that were never connected — 4192 tests pass, system is broken
|
|
110
131
|
- Healthy: Test creates the same wiring as production startup, catching initialization bugs
|
|
111
132
|
|
|
133
|
+
### Design questions
|
|
134
|
+
|
|
135
|
+
- **Wiring parity.** Will the tests construct the new code's collaborators the same way production does? Where the tests diverge from production wiring, what's the rationale?
|
|
136
|
+
- **Mock boundary.** What's the mocking boundary for this design — only true infrastructure (HTTP, DB, filesystem), or also internal collaborators? Internal mocking should be the exception, not the default.
|
|
137
|
+
- **Integration coverage.** For every cross-cutting behavior in the design, is there at least one integration test that exercises the seam, not just unit tests on each side?
|
|
138
|
+
- **Skip discipline.** Will any test be marked `.skip` during this work? If yes, what's the issue link and removal date?
|
|
139
|
+
|
|
112
140
|
---
|
|
113
141
|
|
|
114
142
|
## DIM-5: Hygiene
|
|
@@ -137,6 +165,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
137
165
|
- Violation: `registerEventTools()` exists but is never called in production — vestigial from an earlier design that was refactored
|
|
138
166
|
- Healthy: Unused code removed, version history preserves it if needed
|
|
139
167
|
|
|
168
|
+
### Design questions
|
|
169
|
+
|
|
170
|
+
- **Single implementation.** Does the design introduce a behavior that already exists elsewhere? If yes, is it consolidating or forking?
|
|
171
|
+
- **Reachability.** For every export the new code adds, who calls it? Unused exports should be removed before the design is done.
|
|
172
|
+
- **Comment policy.** Will any commented-out code be left behind? Use git history instead.
|
|
173
|
+
- **Feature-flag horizon.** If the design introduces a flag, what's the removal date or condition? A flag without a sunset is debt.
|
|
174
|
+
|
|
140
175
|
---
|
|
141
176
|
|
|
142
177
|
## DIM-6: Architecture
|
|
@@ -165,6 +200,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
165
200
|
- Violation: Event store module imports from CLI module, creating a circular dependency that constrains refactoring
|
|
166
201
|
- Healthy: Event store depends on interfaces; CLI implements those interfaces
|
|
167
202
|
|
|
203
|
+
### Design questions
|
|
204
|
+
|
|
205
|
+
- **Dependency direction.** Do the new modules depend inward (toward the domain) or outward (toward infrastructure)? Outward dependencies in the core are a smell.
|
|
206
|
+
- **Module responsibility.** Each new module: state its single responsibility in one sentence. If you need "and" or a list, split it.
|
|
207
|
+
- **Interface placement.** Where do the interfaces live — at the domain boundary the consumer owns, or inside the producer's module? Domain-boundary placement is the default.
|
|
208
|
+
- **Change surface.** For a representative change to this design, how many files would need editing? More than five suggests shotgun surgery.
|
|
209
|
+
|
|
168
210
|
---
|
|
169
211
|
|
|
170
212
|
## DIM-7: Resilience
|
|
@@ -194,6 +236,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
194
236
|
- Violation: In-memory cache grows without limit as events are processed, eventually exhausting heap
|
|
195
237
|
- Healthy: LRU cache with configurable max size, eviction logged for observability
|
|
196
238
|
|
|
239
|
+
### Design questions
|
|
240
|
+
|
|
241
|
+
- **Cache bounds.** Does the design introduce any cache, map, or buffer? What's its maximum size and eviction policy?
|
|
242
|
+
- **Timeout coverage.** For every external call (HTTP, DB, file I/O), what's the timeout? "None" means hung-forever-on-failure.
|
|
243
|
+
- **Retry shape.** If the design retries, what's the maximum attempt count and backoff strategy? Unbounded retry is a fork bomb.
|
|
244
|
+
- **Resource lifecycle.** For every resource the design opens (file handle, connection, lock), where is the matching close, and does it run on the error path too?
|
|
245
|
+
|
|
197
246
|
---
|
|
198
247
|
|
|
199
248
|
## DIM-8: Prose Quality
|
|
@@ -222,6 +271,13 @@ Eight canonical dimensions for assessing backend architectural health. Each dime
|
|
|
222
271
|
- Violation: "This crucial module serves as a testament to the team's commitment to fostering robust architecture. It delves into the intricate tapestry of event-sourced workflows."
|
|
223
272
|
- Healthy: "This module handles event-sourced workflow state. It stores events in SQLite and rebuilds state on read."
|
|
224
273
|
|
|
274
|
+
### Design questions
|
|
275
|
+
|
|
276
|
+
- **Audience and tone.** Who reads the new docs/comments — domain experts, new hires, future maintainers? Calibrate language accordingly; avoid generic AI register.
|
|
277
|
+
- **Specificity check.** Will the writing name concrete things (file paths, function names, exact behaviors) or hedge with abstractions ("various", "many", "robust")? Concrete wins.
|
|
278
|
+
- **Voice ownership.** Does the prose sound like someone on this team wrote it, or like a chatbot summary? If a sentence could appear in any project's docs unchanged, rewrite it.
|
|
279
|
+
- **Removal threshold.** For every comment the design adds, would a future reader be confused without it? If no, delete; rely on identifiers and types instead.
|
|
280
|
+
|
|
225
281
|
---
|
|
226
282
|
|
|
227
283
|
## Dimension Independence
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Pairing Contract
|
|
2
|
+
|
|
3
|
+
The protocol that lets `axiom:design` (the generic design-mode skill) compose with project-specific invariants skills (e.g., `exarchos:design-invariants`).
|
|
4
|
+
|
|
5
|
+
This contract is the seam between the cross-domain dimension taxonomy and any one project's architectural specifics. It is documentation-and-frontmatter-only — there's no runtime registry. Skills self-describe via their frontmatter, and `axiom:design` discovers paired skills by enumerating loaded skills' frontmatter slots.
|
|
6
|
+
|
|
7
|
+
## Frontmatter slots
|
|
8
|
+
|
|
9
|
+
| Slot | Where (canonical position) | Type | Required | Meaning |
|
|
10
|
+
|------|---------------------------|------|----------|---------|
|
|
11
|
+
| `pairs-with` | project skill frontmatter, **nested under `metadata:`** | string | yes | Names the axiom skill this pairs with. Currently the only valid value is `axiom:design`. Future axiom skills may add their own pairing namespaces. Example: `metadata.pairs-with: axiom:design`. |
|
|
12
|
+
| `pairs-with-pattern` | axiom skill frontmatter, **nested under `metadata:`** | glob | optional | Pattern axiom recognizes for paired project skills. Example: `metadata.pairs-with-pattern: <project>:*-invariants`. Documentation hint, not enforced. |
|
|
13
|
+
| `axiom_overlap` | per-invariant in project skill body or per-finding in output | `DIM-N` (one of `DIM-1`..`DIM-8`) | optional | Names the axiom dimension this invariant specializes. Multiple overlaps are permitted (an INV may specialize both DIM-1 Topology and DIM-2 Observability). Omit when an invariant has no generic counterpart. |
|
|
14
|
+
|
|
15
|
+
**Canonical position note.** All `pairs-with` and `pairs-with-pattern` slots live nested under `metadata:` in the frontmatter, matching the existing `exarchos:design-invariants` archetype. Top-level placement (`pairs-with:` directly under `---`) is **not** the canonical form and discovery implementations may not honor it.
|
|
16
|
+
|
|
17
|
+
## Ordering rule
|
|
18
|
+
|
|
19
|
+
When project-specific guidance and generic guidance conflict, **project-specific takes precedence semantically**.
|
|
20
|
+
|
|
21
|
+
Example: DIM-1 Topology says "module-global mutable state requires documented rationale". A project's INV declares "module-global state is forbidden in this codebase". The project rule wins; the design surfaces the prohibition, not the conditional permission.
|
|
22
|
+
|
|
23
|
+
This mirrors ESLint's `extends` array-order override (later entries win) and ATAM's utility-tree convention (leaves are authoritative for their scenarios).
|
|
24
|
+
|
|
25
|
+
Visually, however, generic content renders first within each dimension. Generic is the broader frame; specific is the specialization. The visual order is generic → specific; the semantic order is the reverse.
|
|
26
|
+
|
|
27
|
+
## Cross-reference convention
|
|
28
|
+
|
|
29
|
+
Project invariants point *up* to axiom dimensions via `axiom_overlap: DIM-N`.
|
|
30
|
+
|
|
31
|
+
Axiom dimensions do **not** point *down* to project invariants. The generic layer doesn't know which projects pair with it — that knowledge would be unbounded and brittle.
|
|
32
|
+
|
|
33
|
+
This mirrors ATAM's utility tree: leaves reference the branch they specialize; branches don't enumerate their leaves.
|
|
34
|
+
|
|
35
|
+
## Worked example
|
|
36
|
+
|
|
37
|
+
`exarchos:design-invariants` is the canonical compliant project skill. Its frontmatter declares the pairing under `metadata`:
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
---
|
|
41
|
+
name: design-invariants
|
|
42
|
+
description: "Audit a design proposal or diff against Exarchos's architectural invariants ..."
|
|
43
|
+
metadata:
|
|
44
|
+
author: exarchos
|
|
45
|
+
version: 0.1.0
|
|
46
|
+
category: review
|
|
47
|
+
pairs-with: axiom:design
|
|
48
|
+
---
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
> **Migration note (2026-05-09).** As of this contract's authoring, `exarchos:design-invariants` declares `metadata.pairs-with: axiom:backend-quality` (the foundation reference, pre-rename). The migration to `metadata.pairs-with: axiom:design` is tracked as a coordination PR against the exarchos repo (see this design's Definition of Done) and is **out of scope for axiom alone**. Until that PR lands, `axiom:design` discovery falls back to generic-only output for exarchos.
|
|
52
|
+
|
|
53
|
+
Its complementarity matrix declares per-invariant overlap with axiom dimensions:
|
|
54
|
+
|
|
55
|
+
| Finding | Axiom dimension | Design invariant |
|
|
56
|
+
|---------|-----------------|------------------|
|
|
57
|
+
| Lazy fallback that creates degraded EventStore | DIM-1 Topology | INV-1 (silent loss of event integrity) |
|
|
58
|
+
| `console.log`-only catch in projection apply | DIM-2 Observability | INV-1 |
|
|
59
|
+
| Adapter-local mutable cache for projection state | DIM-1 Topology | INV-1 + INV-2 |
|
|
60
|
+
| Schema field removed but still read | DIM-3 Contracts | INV-1 if it's an event field |
|
|
61
|
+
|
|
62
|
+
When `axiom:design` runs in a session with `exarchos:design-invariants` loaded, the discovered pairing causes the design conversation to interleave per-dimension generic questions with project-specific INV-N constraints — with project specifics taking precedence on conflict.
|
|
63
|
+
|
|
64
|
+
## Compliance
|
|
65
|
+
|
|
66
|
+
A project-specific invariants skill is **compliant** if:
|
|
67
|
+
|
|
68
|
+
1. Its frontmatter declares `metadata.pairs-with: axiom:design` (nested under `metadata:`, per the canonical position above — top-level `pairs-with:` does not satisfy this rule).
|
|
69
|
+
2. At least one of its invariants declares an `axiom_overlap: DIM-N` field referencing a real axiom dimension (DIM-1..DIM-8).
|
|
70
|
+
3. Its structure follows the archetype: `SKILL.md` + `references/INV-N-<slug>.md` per invariant + `references/deterministic-checks.md` (per `axiom:scaffold-invariants` emit shape).
|
|
71
|
+
|
|
72
|
+
`axiom:audit` may emit advisory LOW-severity findings against compliance violations. These never block the audit verdict — the contract is meant to detect drift, not enforce it.
|
|
73
|
+
|
|
74
|
+
## See also
|
|
75
|
+
|
|
76
|
+
- `axiom:design` skill: `@skills/design/SKILL.md`
|
|
77
|
+
- `axiom:scaffold-invariants` skill: `@skills/scaffold-invariants/SKILL.md`
|
|
78
|
+
- Exarchos's compliant archetype: `exarchos/.claude/skills/design-invariants/SKILL.md`
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design
|
|
3
|
+
description: "Apply backend quality dimensions as design constraints during ideation. The design-mode counterpart to axiom:audit — surfaces DIM-1..DIM-8 as questions to ask while shaping a system, not as findings to report after. Pairs with project-specific invariants skills via the pairs-with frontmatter slot. Use when running /exarchos:ideate or any pre-implementation conversation. Triggers: 'apply axiom dimensions to design', 'constrain design space', 'design with quality in mind', or /axiom:design. Do NOT use for review of existing code — use axiom:audit instead."
|
|
4
|
+
user-invokable: true
|
|
5
|
+
metadata:
|
|
6
|
+
author: lvlup-sw
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
category: design
|
|
9
|
+
pairs-with-pattern: <project>:*-invariants
|
|
10
|
+
dimensions:
|
|
11
|
+
- all
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Design — Backend Quality as Design Constraint
|
|
15
|
+
|
|
16
|
+
The design-mode entry point to axiom's dimension taxonomy. Where `axiom:audit` evaluates code that exists, `axiom:design` constrains code that's being shaped.
|
|
17
|
+
|
|
18
|
+
## Triggers
|
|
19
|
+
|
|
20
|
+
**Use when:**
|
|
21
|
+
- Running `/exarchos:ideate` or any pre-implementation conversation
|
|
22
|
+
- Sketching a new module, service, or subsystem
|
|
23
|
+
- Reviewing a design proposal before commitment
|
|
24
|
+
- Pairing with a project-specific invariants skill (e.g., `exarchos:design-invariants`)
|
|
25
|
+
|
|
26
|
+
**Do NOT use when:**
|
|
27
|
+
- Auditing existing code — use `axiom:audit` for that.
|
|
28
|
+
- Targeting one specific dimension — use the specialized review skill (`axiom:critique`, `axiom:harden`, etc.).
|
|
29
|
+
|
|
30
|
+
## Process
|
|
31
|
+
|
|
32
|
+
1. **Read** the augmented dimension taxonomy: `@skills/backend-quality/references/dimensions.md`. Each dimension has a `### Design questions` block written for design-mode use.
|
|
33
|
+
2. **Discover** any paired project-specific invariants skill loaded in this context (see Pairing Discovery below).
|
|
34
|
+
3. **Render** the design conversation by walking the eight dimensions in order, surfacing the design questions and — if a paired skill is loaded — interleaving its project-specific invariants where they overlap.
|
|
35
|
+
|
|
36
|
+
## Pairing Discovery
|
|
37
|
+
|
|
38
|
+
`axiom:design` looks for any loaded skill whose frontmatter declares `pairs-with: axiom:design`. The lookup is by frontmatter slot, not by filename or convention path. The pairing contract is documented at: `@skills/backend-quality/references/pairing-contract.md`.
|
|
39
|
+
|
|
40
|
+
Three operating modes:
|
|
41
|
+
|
|
42
|
+
- **No paired skill loaded.** Run generic-only: present DIM-1..DIM-8 design questions. End with the line `No paired invariants skill detected. Run /axiom:scaffold-invariants to create one.` so the user knows the bootstrap path.
|
|
43
|
+
- **One paired skill loaded.** Interleave. For each dimension, render the generic design questions first, then any project-specific invariants whose `axiom_overlap: DIM-N` matches the current dimension. Project invariants without `axiom_overlap` declarations render in a final "Project-specific only" section.
|
|
44
|
+
- **Multiple paired skills loaded.** Render each under a named subsection (one per skill). The user can scope-narrow with an arg if needed.
|
|
45
|
+
|
|
46
|
+
## Output Composition
|
|
47
|
+
|
|
48
|
+
The dimension is the organizing axis. Within a dimension:
|
|
49
|
+
|
|
50
|
+
1. Generic axiom design questions render first.
|
|
51
|
+
2. Project-specific invariants (matched by `axiom_overlap`) render after.
|
|
52
|
+
|
|
53
|
+
This ordering is *visual* — generic comes first because it's the broader frame. *Semantically* the precedence is reversed: when project-specific guidance and generic guidance conflict, the project-specific rule wins. This mirrors ESLint's array-order override (later `extends` entry wins) and ATAM's utility-tree convention (leaves are authoritative for their scenarios).
|
|
54
|
+
|
|
55
|
+
The full ordering rule is documented in the pairing contract.
|
|
56
|
+
|
|
57
|
+
## Failure Modes
|
|
58
|
+
|
|
59
|
+
- **No paired skill loaded** → generic-only output, ends with: `No paired invariants skill detected. Run /axiom:scaffold-invariants to create one.`
|
|
60
|
+
- **Multiple paired skills loaded** → render each under a named subsection.
|
|
61
|
+
- **Paired skill declares `pairs-with: axiom:design` but has no invariants** → generic-only with: `Paired skill <name> declares pairing but has no invariants.`
|
|
62
|
+
|
|
63
|
+
## References
|
|
64
|
+
|
|
65
|
+
- Dimension taxonomy (dual-mode): `@skills/backend-quality/references/dimensions.md`
|
|
66
|
+
- Pairing contract: `@skills/backend-quality/references/pairing-contract.md`
|
|
67
|
+
- Foundation reference: `@skills/backend-quality/SKILL.md`
|
|
68
|
+
- Project-specific archetype: `exarchos/.claude/skills/design-invariants/SKILL.md`
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scaffold-invariants
|
|
3
|
+
description: "Bootstrap a project-specific invariants skill that pairs with axiom:design. Interviews the user about the project's domain (one-line characterization, non-obvious commitments, dimension overlap, failure modes, mechanical checks) and emits a SKILL.md plus references files modeled on the design-invariants archetype. Use when starting a new project or formalizing existing architectural invariants. Triggers: 'scaffold invariants skill', 'bootstrap design skill', 'create invariants for this project', or /axiom:scaffold-invariants. Do NOT use to apply invariants — use axiom:design after scaffolding."
|
|
4
|
+
user-invokable: true
|
|
5
|
+
metadata:
|
|
6
|
+
author: lvlup-sw
|
|
7
|
+
version: 0.1.0
|
|
8
|
+
category: meta-authoring
|
|
9
|
+
dimensions:
|
|
10
|
+
- all
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Scaffold Invariants — Project-Specific Skill Bootstrap
|
|
14
|
+
|
|
15
|
+
Specialized skill scaffolder. Produces a project-specific invariants skill (`<project>:design-invariants` by convention) that pairs with `axiom:design` via the pairing contract.
|
|
16
|
+
|
|
17
|
+
## Triggers
|
|
18
|
+
|
|
19
|
+
**Use when:**
|
|
20
|
+
- Starting a new project that needs its own architectural invariants formalized
|
|
21
|
+
- Migrating from a verbal "we always do X" rule to a documented, testable invariant
|
|
22
|
+
- Establishing the project-specific half of an `axiom:design` pairing for the first time
|
|
23
|
+
|
|
24
|
+
**Do NOT use when:**
|
|
25
|
+
- Updating an existing invariants skill — edit it directly.
|
|
26
|
+
- Authoring a generic skill — use Anthropic's `skill-creator` (or its vendored copy if installed) for unconstrained skill creation.
|
|
27
|
+
|
|
28
|
+
## Interview
|
|
29
|
+
|
|
30
|
+
Five categories of questions, asked one at a time. The output of each shapes the generated skill.
|
|
31
|
+
|
|
32
|
+
### 1. One-line characterization
|
|
33
|
+
|
|
34
|
+
> "If you had to describe this project's runtime in one sentence, what would it be?"
|
|
35
|
+
|
|
36
|
+
The answer becomes the skill's framing line. Example from Exarchos: *"a single-machine event-sourced process manager with cooperative agents."* This sentence governs every downstream invariant — if a candidate INV doesn't follow from this characterization, it doesn't belong.
|
|
37
|
+
|
|
38
|
+
### 2. Non-obvious commitments
|
|
39
|
+
|
|
40
|
+
> "What architectural decisions has this project committed to that aren't obvious from reading the code?"
|
|
41
|
+
|
|
42
|
+
Each answer is an INV-N candidate. Examples: *"the event store is the source of truth, never state files"*, *"all phase transitions go through one HSM module"*, *"no MCP-second-class assumptions in any design"*. Aim for 3–7 invariants — fewer feels under-codified, more becomes hard to remember.
|
|
43
|
+
|
|
44
|
+
### 3. Dimension overlap
|
|
45
|
+
|
|
46
|
+
For each candidate INV, ask:
|
|
47
|
+
|
|
48
|
+
> "Which of axiom's dimensions (DIM-1 Topology / DIM-2 Observability / DIM-3 Contracts / DIM-4 Test Fidelity / DIM-5 Hygiene / DIM-6 Architecture / DIM-7 Resilience / DIM-8 Prose) does this specialize?"
|
|
49
|
+
|
|
50
|
+
The answer seeds the `axiom_overlap: DIM-N` field. An INV may overlap zero, one, or multiple dimensions. Zero means it's project-specific without a generic counterpart — valid but rarer.
|
|
51
|
+
|
|
52
|
+
### 4. Failure mode
|
|
53
|
+
|
|
54
|
+
For each candidate INV, ask:
|
|
55
|
+
|
|
56
|
+
> "What's the failure mode if this is violated? What does the system look like when this rule breaks?"
|
|
57
|
+
|
|
58
|
+
The answer seeds the severity guide. Map: *catastrophic / data-loss / silent corruption* → HIGH; *misleading / hard to debug* → MEDIUM; *cosmetic / mild* → LOW.
|
|
59
|
+
|
|
60
|
+
### 5. Mechanical checks
|
|
61
|
+
|
|
62
|
+
For each candidate INV, ask:
|
|
63
|
+
|
|
64
|
+
> "Is there a mechanical way to detect a violation — a grep pattern, lint rule, type check, or static analysis?"
|
|
65
|
+
|
|
66
|
+
The answer seeds `references/deterministic-checks.md`. If no mechanical check exists, that's fine — record "reasoning-driven; no automated check" so the human reviewer knows.
|
|
67
|
+
|
|
68
|
+
## Emit
|
|
69
|
+
|
|
70
|
+
After the interview completes, emit the project-specific skill structure. Default output path: `.claude/skills/<project>-design-invariants/`.
|
|
71
|
+
|
|
72
|
+
Files emitted:
|
|
73
|
+
|
|
74
|
+
- **`SKILL.md`** — frontmatter + body. Frontmatter includes `pairs-with: axiom:design`. Body lists the invariants with their severities, axiom-overlap declarations, and links to per-INV reference files.
|
|
75
|
+
- **`references/INV-N-<slug>.md`** per invariant — one file per INV. Each file contains: framing, acceptance questions, repo-grounded checks, severity guide, worked example (violation + fix). Modeled on `exarchos/.claude/skills/design-invariants/references/INV-1-event-sourcing.md`.
|
|
76
|
+
- **`references/deterministic-checks.md`** — the grep / structural / lint patterns, organized by INV-N. Modeled on `exarchos/.claude/skills/design-invariants/references/deterministic-checks.md`.
|
|
77
|
+
|
|
78
|
+
Templates live at `templates/` in this skill's directory:
|
|
79
|
+
- `templates/SKILL.template.md`
|
|
80
|
+
- `templates/INV.template.md`
|
|
81
|
+
- `templates/deterministic-checks.template.md`
|
|
82
|
+
|
|
83
|
+
Each template uses `{{TOKEN}}` placeholders that are filled from interview answers.
|
|
84
|
+
|
|
85
|
+
### Emit-correctness properties
|
|
86
|
+
|
|
87
|
+
The generated skill must be well-formed:
|
|
88
|
+
|
|
89
|
+
- Generated `SKILL.md` declares `pairs-with: axiom:design` in frontmatter (so `axiom:design` discovers it).
|
|
90
|
+
- Each invariant entry declares `axiom_overlap: DIM-N` if the user named one in the interview (Q3); omits the field otherwise.
|
|
91
|
+
- Generated structure mirrors `exarchos:design-invariants` exactly: `SKILL.md` + `references/INV-N-<slug>.md` per invariant + `references/deterministic-checks.md`.
|
|
92
|
+
|
|
93
|
+
## Failure Modes
|
|
94
|
+
|
|
95
|
+
- **Vendored skill-creator missing or stale** (`vendor/skill-creator/UPSTREAM.md` older than 30 days, or `vendor/skill-creator/` directory absent) → fall back to bundled templates only (no description tuning, no eval-prompt suggestions). Emit a one-line warning: `Vendored skill-creator not available; emitted scaffold uses bundled templates only. Sync vendor and re-run for description tuning.`
|
|
96
|
+
- **Output directory already exists with content** → prompt before overwriting; default action is abort.
|
|
97
|
+
- **Interview yields zero invariants** → emit a SKILL.md with empty INV section and a one-line note: `No invariants surfaced from interview. Re-run when project commitments are clearer.`
|
|
98
|
+
|
|
99
|
+
## References
|
|
100
|
+
|
|
101
|
+
- Pairing contract: `@skills/backend-quality/references/pairing-contract.md`
|
|
102
|
+
- Project archetype: `exarchos/.claude/skills/design-invariants/SKILL.md`
|
|
103
|
+
- Vendored upstream tooling: `vendor/skill-creator/SKILL.md` (full directory copy from `anthropics/skills`; reference only, not loaded as a triggerable skill)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# {{INV_ID}}: {{INV_NAME}}
|
|
2
|
+
|
|
3
|
+
{{INV_FRAMING}}
|
|
4
|
+
|
|
5
|
+
## Acceptance questions
|
|
6
|
+
|
|
7
|
+
{{ACCEPTANCE_QUESTIONS_LIST}}
|
|
8
|
+
|
|
9
|
+
## Repo-grounded checks
|
|
10
|
+
|
|
11
|
+
{{REPO_GROUNDED_CHECKS_LIST}}
|
|
12
|
+
|
|
13
|
+
## Cross-cutting overlap
|
|
14
|
+
|
|
15
|
+
**axiom_overlap:** `{{AXIOM_OVERLAP}}`
|
|
16
|
+
|
|
17
|
+
This invariant specializes the named axiom dimension(s). When `axiom:design` runs in a paired session, this invariant renders alongside the dimension's generic Design questions.
|
|
18
|
+
|
|
19
|
+
## External grounding
|
|
20
|
+
|
|
21
|
+
{{EXTERNAL_GROUNDING_LIST}}
|
|
22
|
+
|
|
23
|
+
## Severity guide
|
|
24
|
+
|
|
25
|
+
- **HIGH:** {{SEVERITY_HIGH_DESCRIPTION}}
|
|
26
|
+
- **MEDIUM:** {{SEVERITY_MEDIUM_DESCRIPTION}}
|
|
27
|
+
- **LOW:** {{SEVERITY_LOW_DESCRIPTION}}
|
|
28
|
+
|
|
29
|
+
## Worked example
|
|
30
|
+
|
|
31
|
+
**Violation:**
|
|
32
|
+
|
|
33
|
+
{{VIOLATION_EXAMPLE}}
|
|
34
|
+
|
|
35
|
+
**Fix:**
|
|
36
|
+
|
|
37
|
+
{{FIX_EXAMPLE}}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: design-invariants
|
|
3
|
+
description: "Audit a design proposal or diff against {{PROJECT_NAME}}'s architectural invariants — {{INVARIANT_SUMMARY_LINE}}. Pairs with /axiom:design — this skill is project-specific (axiom is generic). Triggers: 'check invariants', 'design conformance', or /design-invariants."
|
|
4
|
+
metadata:
|
|
5
|
+
author: {{PROJECT_NAME}}
|
|
6
|
+
version: 0.1.0
|
|
7
|
+
category: review
|
|
8
|
+
pairs-with: axiom:design
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# {{PROJECT_NAME}} Design Invariants
|
|
12
|
+
|
|
13
|
+
Audits a design proposal or diff against {{PROJECT_NAME}}-specific architectural invariants. Project-scoped — these invariants govern {{PROJECT_NAME}} itself, not consumers of it.
|
|
14
|
+
|
|
15
|
+
## Project framing
|
|
16
|
+
|
|
17
|
+
> {{ONE_LINE_CHARACTERIZATION}}
|
|
18
|
+
|
|
19
|
+
This sentence governs every invariant below. When a candidate constraint imports framework that doesn't follow from this characterization, the framing rejects it.
|
|
20
|
+
|
|
21
|
+
## When to use
|
|
22
|
+
|
|
23
|
+
- During design (`/exarchos:ideate`, RFC drafting), before committing.
|
|
24
|
+
- During review (`/exarchos:review`), alongside `/axiom:audit`.
|
|
25
|
+
- When reviewing a PR that touches {{LOAD_BEARING_SUBSYSTEMS}}.
|
|
26
|
+
|
|
27
|
+
## When NOT to use
|
|
28
|
+
|
|
29
|
+
- For generic backend quality — use `/axiom:*` skills.
|
|
30
|
+
- For TDD / spec compliance — use the workflow's `review` skill.
|
|
31
|
+
|
|
32
|
+
## Invariant references
|
|
33
|
+
|
|
34
|
+
{{INVARIANT_REFERENCES_LIST}}
|
|
35
|
+
|
|
36
|
+
## Finding format
|
|
37
|
+
|
|
38
|
+
Match axiom's vocabulary (HIGH / MEDIUM / LOW) so reviewers don't context-switch:
|
|
39
|
+
|
|
40
|
+
```json
|
|
41
|
+
{
|
|
42
|
+
"verdict": "pass | conditional | fail",
|
|
43
|
+
"findings": [
|
|
44
|
+
{
|
|
45
|
+
"invariant": "INV-1",
|
|
46
|
+
"severity": "HIGH",
|
|
47
|
+
"file": "path/to/file.ts",
|
|
48
|
+
"line": 42,
|
|
49
|
+
"description": "...",
|
|
50
|
+
"required_fix": "...",
|
|
51
|
+
"axiom_overlap": "DIM-N"
|
|
52
|
+
}
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Pairing with axiom
|
|
58
|
+
|
|
59
|
+
The seam: axiom asks *"is this code well-engineered?"*; this skill asks *"does this design respect {{PROJECT_NAME}}'s load-bearing invariants?"* A design can be axiom-clean and still violate a project invariant.
|
|
60
|
+
|
|
61
|
+
For the full pairing protocol, see the axiom plugin's pairing contract at [`@skills/backend-quality/references/pairing-contract.md`](https://github.com/lvlup-sw/axiom/blob/main/skills/backend-quality/references/pairing-contract.md) (GitHub link; resolves regardless of where this generated skill is installed).
|
|
62
|
+
|
|
63
|
+
## Source
|
|
64
|
+
|
|
65
|
+
This skill was generated by `/axiom:scaffold-invariants` on {{GENERATION_DATE}}. Amend it directly when invariants change.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Deterministic Checks
|
|
2
|
+
|
|
3
|
+
Mechanical grep / structural patterns that this skill can run against the diff or working tree to surface candidate findings. These are starting points for human or agent reasoning, not verdicts. A pattern match is a *signal*, not a conclusion — confirm by reading context.
|
|
4
|
+
|
|
5
|
+
Coverage is limited to invariants where mechanical detection adds value. The remaining invariants are reasoning-driven; their checks live in the corresponding `INV-N-*.md` reference files.
|
|
6
|
+
|
|
7
|
+
{{DETERMINISTIC_CHECKS_PER_INV}}
|
|
8
|
+
|
|
9
|
+
<!--
|
|
10
|
+
Section template (per invariant with mechanical checks):
|
|
11
|
+
|
|
12
|
+
## {{INV_ID}}: {{INV_NAME}}
|
|
13
|
+
|
|
14
|
+
### Check {{INV_NUMBER}}.1: {{CHECK_NAME}}
|
|
15
|
+
|
|
16
|
+
{{CHECK_DESCRIPTION}}
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
{{CHECK_COMMAND}}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
(Add additional checks {{INV_NUMBER}}.2, {{INV_NUMBER}}.3, ... as needed.)
|
|
23
|
+
-->
|
|
24
|
+
|
|
25
|
+
<!--
|
|
26
|
+
For invariants without mechanical checks, omit the section and rely on the
|
|
27
|
+
reasoning-driven checks documented in `INV-N-*.md`.
|
|
28
|
+
-->
|