@hellraisercenobit/ai-engineering-gate 0.8.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/README.md +82 -0
- package/agents/design-pattern-reviewer.md +40 -0
- package/agents/modern-typescript-reviewer.md +24 -0
- package/agents/testing-pattern-reviewer.md +23 -0
- package/bin/ai-engineering-gate.mjs +6 -0
- package/contracts/axi/axi-standard.md +273 -0
- package/contracts/axi/pin.json +36 -0
- package/contracts/members.json +58 -0
- package/contracts/schemas/arbitration.schema.json +45 -0
- package/contracts/schemas/decision-envelope.schema.json +215 -0
- package/contracts/schemas/declaration.schema.json +190 -0
- package/contracts/schemas/dispute.schema.json +67 -0
- package/contracts/schemas/evidence-append.schema.json +72 -0
- package/contracts/schemas/gate-output.schema.json +296 -0
- package/contracts/schemas/marker.schema.json +75 -0
- package/contracts/schemas/review-envelope.schema.json +378 -0
- package/contracts/schemas/verdict-record.schema.json +191 -0
- package/contracts/suite-contract.md +270 -0
- package/dist/ai-engineering-gate.mjs +2762 -0
- package/package.json +47 -0
- package/skills/engineering/review-design-patterns/LICENSE +6 -0
- package/skills/engineering/review-design-patterns/SKILL.md +196 -0
- package/skills/engineering/review-design-patterns/agents/openai.yaml +3 -0
- package/skills/engineering/review-design-patterns/references/smell-signatures.md +117 -0
- package/skills/engineering/review-design-patterns/review-design-patterns.yaml +25 -0
- package/skills/engineering/review-modern-typescript/LICENSE +21 -0
- package/skills/engineering/review-modern-typescript/SKILL.md +88 -0
- package/skills/engineering/review-modern-typescript/agents/openai.yaml +3 -0
- package/skills/engineering/review-modern-typescript/references/smell-signatures.md +36 -0
- package/skills/engineering/review-modern-typescript/review-modern-typescript.yaml +22 -0
- package/skills/engineering/review-testing-patterns/SKILL.md +108 -0
- package/skills/engineering/review-testing-patterns/agents/openai.yaml +4 -0
- package/skills/engineering/review-testing-patterns/references/compiler-profile.mjs +103 -0
- package/skills/engineering/review-testing-patterns/references/smell-signatures.md +30 -0
- package/skills/engineering/review-testing-patterns/review-testing-patterns.yaml +23 -0
- package/skills/engineering/transpose-design-patterns/LICENSE +6 -0
- package/skills/engineering/transpose-design-patterns/SKILL.md +231 -0
- package/skills/engineering/transpose-design-patterns/agents/openai.yaml +3 -0
- package/skills/engineering/transpose-design-patterns/references/arbitration.schema.json +45 -0
- package/skills/engineering/transpose-design-patterns/references/decision-envelope.schema.json +215 -0
- package/skills/engineering/transpose-design-patterns/references/declaration.schema.json +190 -0
- package/skills/engineering/transpose-design-patterns/references/design-decision-record.schema.json +731 -0
- package/skills/engineering/transpose-design-patterns/references/dispute.schema.json +67 -0
- package/skills/engineering/transpose-design-patterns/references/evidence-append.schema.json +72 -0
- package/skills/engineering/transpose-design-patterns/references/marker.schema.json +75 -0
- package/skills/engineering/transpose-design-patterns/references/pattern-catalog.md +305 -0
- package/skills/engineering/transpose-design-patterns/references/record.example.json +120 -0
- package/skills/engineering/transpose-design-patterns/references/review-envelope.schema.json +378 -0
- package/skills/engineering/transpose-design-patterns/references/suite-contract.md +270 -0
- package/skills/engineering/transpose-design-patterns/references/transpose-angular.md +224 -0
- package/skills/engineering/transpose-design-patterns/references/transpose-php.md +561 -0
- package/skills/engineering/transpose-design-patterns/references/transpose-quarkus.md +283 -0
- package/skills/engineering/transpose-design-patterns/references/transpose-react.md +256 -0
- package/skills/engineering/transpose-design-patterns/references/transpose-vanilla.md +204 -0
- package/skills/engineering/transpose-design-patterns/references/transpose-vue.md +234 -0
- package/skills/engineering/transpose-design-patterns/transpose-design-patterns.yaml +24 -0
- package/skills/engineering/transpose-modern-typescript/LICENSE +21 -0
- package/skills/engineering/transpose-modern-typescript/SKILL.md +90 -0
- package/skills/engineering/transpose-modern-typescript/agents/openai.yaml +3 -0
- package/skills/engineering/transpose-modern-typescript/references/arbitration.schema.json +45 -0
- package/skills/engineering/transpose-modern-typescript/references/catalog.md +38 -0
- package/skills/engineering/transpose-modern-typescript/references/collections.md +50 -0
- package/skills/engineering/transpose-modern-typescript/references/compatibility.md +61 -0
- package/skills/engineering/transpose-modern-typescript/references/decision-envelope.schema.json +215 -0
- package/skills/engineering/transpose-modern-typescript/references/decision-record.schema.json +830 -0
- package/skills/engineering/transpose-modern-typescript/references/declaration.schema.json +190 -0
- package/skills/engineering/transpose-modern-typescript/references/dispute.schema.json +67 -0
- package/skills/engineering/transpose-modern-typescript/references/evidence-append.schema.json +72 -0
- package/skills/engineering/transpose-modern-typescript/references/idioms.md +74 -0
- package/skills/engineering/transpose-modern-typescript/references/marker.schema.json +75 -0
- package/skills/engineering/transpose-modern-typescript/references/platform.md +147 -0
- package/skills/engineering/transpose-modern-typescript/references/record.example.json +172 -0
- package/skills/engineering/transpose-modern-typescript/references/record.md +37 -0
- package/skills/engineering/transpose-modern-typescript/references/review-envelope.schema.json +378 -0
- package/skills/engineering/transpose-modern-typescript/references/suite-contract.md +270 -0
- package/skills/engineering/transpose-modern-typescript/references/types.md +97 -0
- package/skills/engineering/transpose-modern-typescript/transpose-modern-typescript.yaml +22 -0
- package/skills/engineering/transpose-testing-patterns/SKILL.md +96 -0
- package/skills/engineering/transpose-testing-patterns/agents/openai.yaml +4 -0
- package/skills/engineering/transpose-testing-patterns/references/arbitration.schema.json +45 -0
- package/skills/engineering/transpose-testing-patterns/references/catalog.md +218 -0
- package/skills/engineering/transpose-testing-patterns/references/decision-envelope.schema.json +215 -0
- package/skills/engineering/transpose-testing-patterns/references/decision-record.schema.json +857 -0
- package/skills/engineering/transpose-testing-patterns/references/declaration.schema.json +190 -0
- package/skills/engineering/transpose-testing-patterns/references/detect-adapter.mjs +98 -0
- package/skills/engineering/transpose-testing-patterns/references/dispute.schema.json +67 -0
- package/skills/engineering/transpose-testing-patterns/references/doubles-data.md +45 -0
- package/skills/engineering/transpose-testing-patterns/references/evidence-append.schema.json +72 -0
- package/skills/engineering/transpose-testing-patterns/references/journal-event.schema.json +115 -0
- package/skills/engineering/transpose-testing-patterns/references/marker.schema.json +75 -0
- package/skills/engineering/transpose-testing-patterns/references/record.example.json +230 -0
- package/skills/engineering/transpose-testing-patterns/references/record.md +25 -0
- package/skills/engineering/transpose-testing-patterns/references/review-envelope.schema.json +378 -0
- package/skills/engineering/transpose-testing-patterns/references/suite-contract.md +270 -0
- package/skills/engineering/transpose-testing-patterns/references/tdd.md +62 -0
- package/skills/engineering/transpose-testing-patterns/references/transpose-codeception.md +84 -0
- package/skills/engineering/transpose-testing-patterns/references/transpose-karma-jasmine-angular.md +73 -0
- package/skills/engineering/transpose-testing-patterns/references/transpose-vitest.md +111 -0
- package/skills/engineering/transpose-testing-patterns/references/typescript.md +42 -0
- package/skills/engineering/transpose-testing-patterns/transpose-testing-patterns.yaml +23 -0
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
# Transpose/review contract 1.1.0
|
|
2
|
+
|
|
3
|
+
Canonical source: `contracts/suite-contract.md` in hellraisercenobit/skills. Copies in
|
|
4
|
+
transpose bundles are generated by `npm run sync:contract`; never edit them by hand.
|
|
5
|
+
The repository maintainer owns this contract. Domain catalogs and record schemas remain
|
|
6
|
+
owned by their transpose skill. Read this contract once per execution.
|
|
7
|
+
|
|
8
|
+
1.1.0 adds clauses to 1.0.0 and changes none of its guarantees. Each member declares the
|
|
9
|
+
contract versions it supports in the member manifest. A workflow that runs on records,
|
|
10
|
+
checks and independent reports without any gate stays valid under 1.1.0: the clauses below
|
|
11
|
+
describe what enforcement derives, never a new obligation on prose.
|
|
12
|
+
|
|
13
|
+
## Guarantees
|
|
14
|
+
|
|
15
|
+
| ID | Requirement | Evidence |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| C01 | One normative catalog per dimension, owned by transpose and read by review. | Resolved local references and identified versions or content hashes. |
|
|
18
|
+
| C02 | Explicit scope and comparison base. | Files and sites, including relevant uncommitted and untracked files. |
|
|
19
|
+
| C03 | Inventory every relevant site, including retained choices. | Domain criteria, alternatives and observable invariants. |
|
|
20
|
+
| C04 | Record each decision before the first affected implementation write. | Schema-valid records outside the repository; preserve previous revisions and reasons. |
|
|
21
|
+
| C05 | Separate deterministic checks from semantic judgment. | Schema/catalog membership and applicable type, runtime, lint and build checks. |
|
|
22
|
+
| C06 | Independent reviewer with a neutral brief. | Fresh context without builder history or rationale; original request and factual constraints only. |
|
|
23
|
+
| C07 | Freeze expectations before reading records or author justification. | Immutable expected matrix in the review transcript; no `git log`, PR rationale or author analysis. |
|
|
24
|
+
| C08 | Compare every site; steelman every candidate finding. | Expected/recorded/actual, exact rule, evidence, strongest defense and refutation. |
|
|
25
|
+
| C09 | Reviewer changes no files and delegates no review. | Report in its response; the builder fixes and dispatches a new fresh reviewer. |
|
|
26
|
+
| C10 | Only a current `SOUND` completes transposition. | Complete audit, zero confirmed findings, passing applicable checks and no unresolved dispute. |
|
|
27
|
+
| C11 | Only the reviewer attests; scope changes invalidate its verdict. | Examined state identified; the gate computes the fingerprints a verdict binds to. |
|
|
28
|
+
| C12 | Missing prerequisites and limits are explicit. | No invented rules, support, independence or attestation. |
|
|
29
|
+
|
|
30
|
+
## Shared execution rules
|
|
31
|
+
|
|
32
|
+
Resolve companions, schema, catalog, this contract and any **required** guides first. Pin
|
|
33
|
+
their versions or hashes for the execution. A missing optional guide is acceptable only
|
|
34
|
+
when the domain permits catalog-only decisions. Conflicting installed contract/catalog
|
|
35
|
+
versions are an incomplete prerequisite; do not silently download another version.
|
|
36
|
+
|
|
37
|
+
The builder inventories scope, compares alternatives including the current implementation,
|
|
38
|
+
records, then writes and checks. Coherent local choices can share a record if every site
|
|
39
|
+
remains identifiable. `none` has the domain's explicit meaning; it is not a shortcut around
|
|
40
|
+
evaluation. No applicable site is a justified non-applicable dimension, not an artificial
|
|
41
|
+
`SOUND`. Do not add common fields to a domain schema that forbids them: coordination
|
|
42
|
+
metadata belongs in an external execution index.
|
|
43
|
+
|
|
44
|
+
The reviewer reads independent requirements and factual constraints, inventories the scope
|
|
45
|
+
and freezes a matrix of expected acceptable choices, rules and invariants **in its response
|
|
46
|
+
before the next tool call that opens records**. It then compares expected, recorded and
|
|
47
|
+
actual. Record absence is not a retrospective code defect in a standalone audit; a claimed
|
|
48
|
+
completed transposition requires its records. State significant exposure to author
|
|
49
|
+
justification. A contaminated brief requires a new reviewer before completion; do not
|
|
50
|
+
rewrite the frozen matrix to match the builder. Verified new facts that change premises
|
|
51
|
+
require a new framing and fresh review, retaining the old matrix.
|
|
52
|
+
|
|
53
|
+
For each candidate, construct the strongest defense (compatibility, public contract, domain
|
|
54
|
+
meaning, framework semantics, proven cost or legitimate simplicity). Drop it if that defense
|
|
55
|
+
holds. Confirm only with an applicable catalog rule and evidence. Report catalog gaps
|
|
56
|
+
separately, without severity or verdict impact. A gap is not permission to invent a rule.
|
|
57
|
+
|
|
58
|
+
Reports identify scope/base/state, reference versions, coverage, frozen matrix, comparison,
|
|
59
|
+
confirmed findings, defended choices, gaps and check evidence. Each finding identifies
|
|
60
|
+
location, rule, expected/recorded/actual, impact, defense, refutation and proposed correction.
|
|
61
|
+
Severity: `Blocker` for concrete correctness/support failures, `Major` for demonstrated
|
|
62
|
+
structural costs or missing guarantees, `Minor` for evidenced idiomatic drift after defense.
|
|
63
|
+
Age or taste alone is never evidence. This clause owns the severity tiers; a domain skill
|
|
64
|
+
references it instead of restating them.
|
|
65
|
+
|
|
66
|
+
| Verdict | Meaning |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| SOUND | Complete audit, zero confirmed findings. |
|
|
69
|
+
| SMELLS | Confirmed findings, no Blocker. |
|
|
70
|
+
| VIOLATIONS | At least one Blocker. |
|
|
71
|
+
|
|
72
|
+
An incomplete execution reports the missing prerequisite and has no attestable quality
|
|
73
|
+
verdict; it is not a fourth verdict. The reviewer edits neither code, records, catalogs nor
|
|
74
|
+
fixtures. Its report is a response that the harness can save externally. Its sole permitted
|
|
75
|
+
external mutations are the gate's attestation and report operations, when supported;
|
|
76
|
+
attestation accepts `SOUND` only. A dispute goes to the user and remains unresolved until
|
|
77
|
+
decided; it is not a fix.
|
|
78
|
+
|
|
79
|
+
## Dimension registry
|
|
80
|
+
|
|
81
|
+
The member manifest `contracts/members.json` is the registry. It owns, per member: the
|
|
82
|
+
dimension identifier, the transpose and review skill locations, the reviewer agent, the
|
|
83
|
+
decision schema, the evidence schemas the dimension owns, the reference bundle, the contract
|
|
84
|
+
versions the member supports, and a status, `implemented` or `qualified`. Nothing else
|
|
85
|
+
defines a dimension identifier, and no other file lists the dimensions.
|
|
86
|
+
|
|
87
|
+
The registry holds orchestration metadata and schema locations only: never a rule, a pattern
|
|
88
|
+
name, an idiom or a test form. Adding a dimension is a registration plus a qualification. It
|
|
89
|
+
never changes enforcement logic and never adds a hook.
|
|
90
|
+
|
|
91
|
+
## State and evidence
|
|
92
|
+
|
|
93
|
+
Store evidence, derive state. Every durable fact is a schema-valid document on disk: a
|
|
94
|
+
declaration, a decision record, an evidence append, an attestation, a report, a dispute or
|
|
95
|
+
an arbitration. No implementation persists a workflow boolean such as "reviewed" or
|
|
96
|
+
"fresh"; state is recomputed from those documents and from the code they cover.
|
|
97
|
+
|
|
98
|
+
A project opts in with one committed marker at its repository root, which also carries the
|
|
99
|
+
project's dimension selection and its evidence and export locations. Without that marker,
|
|
100
|
+
enforcement is silent and every workflow stays portable. Evidence lives outside the
|
|
101
|
+
checkout, under a task key derived from the branch.
|
|
102
|
+
|
|
103
|
+
### Declaration
|
|
104
|
+
|
|
105
|
+
Before the first record, a task declares each registered dimension applicable or
|
|
106
|
+
non-applicable, with a reason, the requester's wording of the request and the factual
|
|
107
|
+
constraints. An applicable declaration also names its scope, as repository-relative file
|
|
108
|
+
paths or directory prefixes, and the relevant configuration files. A non-applicable
|
|
109
|
+
dimension has a declaration and nothing else: skipping a dimension is a recorded decision,
|
|
110
|
+
never a default, and an undeclared registered dimension is an incomplete task.
|
|
111
|
+
|
|
112
|
+
The declaration is what protects the scope and what a neutral brief is rendered from. It is
|
|
113
|
+
revisioned like a record, and it locks once a record, report, review window or dispute
|
|
114
|
+
depends on it, unless the revision only widens scope or adds constraints.
|
|
115
|
+
|
|
116
|
+
### Fingerprints
|
|
117
|
+
|
|
118
|
+
"Current" means three fingerprints.
|
|
119
|
+
|
|
120
|
+
- **Source**: the content hashes of the union of the declared scope paths, the declared
|
|
121
|
+
configuration files and the change set. The change set is the tracked diff between the
|
|
122
|
+
merge-base of the recorded base and HEAD, plus staged, unstaged and untracked files, minus
|
|
123
|
+
the export directory, the gate-owned paths and the marker's ignore patterns. Content
|
|
124
|
+
hashes only: the base revision is recorded and not hashed, so a content-neutral rebase
|
|
125
|
+
does not expire a verdict, and a clean HEAD never identifies a dirty worktree. Change-set
|
|
126
|
+
paths outside every applicable declaration are reported as undeclared changes.
|
|
127
|
+
- **Reference**: the content hashes of the dimension's reference bundle as distributed —
|
|
128
|
+
catalog, decision schema, evidence schemas, guides, the review skill's references and the
|
|
129
|
+
generated copy of this contract — plus the contract version and the gate version.
|
|
130
|
+
- **Decision**: the ordered hash of the dimension's declaration and of every decision record
|
|
131
|
+
of the dimension for the task, each with its revision number.
|
|
132
|
+
|
|
133
|
+
A verdict is current only while all three fingerprints it was bound to still match. Any
|
|
134
|
+
mismatch is stale. Eager marking by a PostToolUse hook is an optimization and is never
|
|
135
|
+
authoritative: a skipped hook, a crash or an editor outside the harness must never leave a
|
|
136
|
+
stale verdict looking current, so expiry is always derived from the fingerprints.
|
|
137
|
+
|
|
138
|
+
### Envelopes
|
|
139
|
+
|
|
140
|
+
Every decision record carries a common outer envelope: dimension, schema version, catalog
|
|
141
|
+
version, the contract versions it supports, need, scope as an array of paths, base, revision
|
|
142
|
+
as number, previous and reason, and two typed lists — `cites`, artifacts and evidence
|
|
143
|
+
sources that exist when the record is validated, and `plans`, artifacts the record commits
|
|
144
|
+
to produce, each with its dimension-defined role. The dimension-specific body stays owned by
|
|
145
|
+
the dimension schema. Applicability is not a record field; it lives in the declaration.
|
|
146
|
+
|
|
147
|
+
`cites` carries referential integrity. A cited path that does not exist refuses the record.
|
|
148
|
+
A claim of unknown about a checkable fact — targets, runtimes, environments, configuration —
|
|
149
|
+
is accepted only with the sources consulted cited, or with the paths searched and not found.
|
|
150
|
+
A revision that announces a correction is refused when no cited artifact changed: a record
|
|
151
|
+
describes what was done, not what should have been. `plans` are not checked when the record
|
|
152
|
+
is written, so a record that precedes the first affected write stays valid under C04; every
|
|
153
|
+
planned artifact must exist before a review begins, is filed or is dispatched.
|
|
154
|
+
|
|
155
|
+
Every review emits a common review envelope: dimension, the supported contract version, the
|
|
156
|
+
verdict, the records examined, the checks it saw executed, a reviewer object with an
|
|
157
|
+
independence claim and a declared identity, the confirmed findings and the
|
|
158
|
+
challenged-survived list. Each finding has an identifier and a kind, `evidence` or
|
|
159
|
+
`judgment`; an evidence finding carries a typed remedy, a judgment finding the proposed
|
|
160
|
+
correction C08 already requires. The envelope carries no fingerprint: a fingerprint a
|
|
161
|
+
builder or a reviewer writes anywhere is ignored.
|
|
162
|
+
|
|
163
|
+
### Attestation and report
|
|
164
|
+
|
|
165
|
+
The gate writes both, and they are the reviewer's only permitted external mutations. An
|
|
166
|
+
attestation stores a `SOUND` envelope together with the three fingerprints of the reviewer's
|
|
167
|
+
window and its captured identity. A report stores a `SMELLS` or `VIOLATIONS` envelope bound
|
|
168
|
+
the same way; it blocks completion until a `SOUND` attestation on a later state, or an
|
|
169
|
+
arbitration closing its last open finding, supersedes it. No other verdict is attestable and
|
|
170
|
+
no verdict is a score.
|
|
171
|
+
|
|
172
|
+
### Findings, disputes and arbitration
|
|
173
|
+
|
|
174
|
+
A finding admits two responses: address it — the remedy executed and the artifact appended,
|
|
175
|
+
or the record revised and the state moved — or dispute it with a pointer to existing
|
|
176
|
+
counter-evidence. An answer in prose is neither, and a changed fingerprint alone addresses
|
|
177
|
+
nothing. Findings about evidence say evidence not on file, never false claim: the builder is
|
|
178
|
+
asked to file, not to confess.
|
|
179
|
+
|
|
180
|
+
While any finding of the last report is pending, no new review of that dimension begins, so
|
|
181
|
+
the same finding is never re-litigated with a fresh reviewer. A valid dispute blocks
|
|
182
|
+
completion and goes to the user; it never goes to another reviewer on the same state. Its
|
|
183
|
+
only exit is an arbitration that only a human hand writes: `uphold` closes the finding,
|
|
184
|
+
`reject` puts its remedy or correction back to pending.
|
|
185
|
+
|
|
186
|
+
### Reviewer identity
|
|
187
|
+
|
|
188
|
+
Every gate call carries the harness session identifier. A reviewer's calls carry an agent
|
|
189
|
+
identifier that must differ from the builder's. This checks consistency, not independence.
|
|
190
|
+
Where a harness provides no agent identifier, the attestation is stored unverified, the state
|
|
191
|
+
says so, and a pipeline may require verified identity.
|
|
192
|
+
|
|
193
|
+
### Completion
|
|
194
|
+
|
|
195
|
+
For each registered dimension: a non-applicable declaration needs its reason; an applicable
|
|
196
|
+
one needs at least one validated record, every planned artifact produced, a current `SOUND`
|
|
197
|
+
attestation, no current report with an open finding and no unresolved dispute. An undeclared
|
|
198
|
+
registered dimension is incomplete. Any incomplete dimension blocks completion whatever the
|
|
199
|
+
others say. Requirements combine; they never average, and there is no score.
|
|
200
|
+
|
|
201
|
+
Deterministic checks stay the reviewer's responsibility under C10 and appear in the review
|
|
202
|
+
envelope as the checks it saw executed. Enforcement validates their presence, never their
|
|
203
|
+
result.
|
|
204
|
+
|
|
205
|
+
## Neutral brief
|
|
206
|
+
|
|
207
|
+
Send only the filled fields below to the named reviewer or a fresh general subagent with
|
|
208
|
+
no inherited conversation. Keep test expectations and other reviewers' conclusions out.
|
|
209
|
+
|
|
210
|
+
```text
|
|
211
|
+
You are the fresh <dimension> reviewer. Run /<review-skill> yourself; do not delegate.
|
|
212
|
+
Read-only: do not modify any file, including code, records, catalogs or fixtures.
|
|
213
|
+
Scope: <exact paths/symbols>; repository: <absolute path>.
|
|
214
|
+
Base: <ref/commit or standalone>; include relevant uncommitted and new files.
|
|
215
|
+
Use git diff and file reads, never git log or PR descriptions.
|
|
216
|
+
Original request: <requester wording, without builder choices or rationale>.
|
|
217
|
+
Factual constraints: <project targets, public contracts, independent sources>.
|
|
218
|
+
Records: <paths; check existence only until the expected matrix is frozen>.
|
|
219
|
+
Check evidence: <paths; read results after freezing, not implementation rationale>.
|
|
220
|
+
Undeclared changes: <change-set paths outside every declaration>.
|
|
221
|
+
Report your frozen matrix before opening the records. End with the domain report
|
|
222
|
+
and one verdict, or explain incomplete execution without attestation.
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
## Composition and expiry
|
|
226
|
+
|
|
227
|
+
One builder coordinates all applicable dimensions. Keep their records and verdicts distinct.
|
|
228
|
+
Historical transforming reviews run before final reviews. Independent reviewers can run in
|
|
229
|
+
parallel on one frozen final state, without exchanging rationale. Completion requires all
|
|
230
|
+
applicable dimensions `SOUND` on that same state; one verdict cannot compensate for another.
|
|
231
|
+
|
|
232
|
+
Any change to a file in a review's scope invalidates it, including prose. Shared files
|
|
233
|
+
invalidate all covering reviews. Without precise scope tracking, invalidate the whole
|
|
234
|
+
change's reviews. Identify the state with a commit plus the staged/unstaged diff and
|
|
235
|
+
untracked file contents or hashes; a clean HEAD alone does not identify a dirty worktree.
|
|
236
|
+
Record/schema/catalog changes also reopen the affected review. No generic orchestrator
|
|
237
|
+
is implied. An external index of scopes, hashes, record paths, checks and responses is enough.
|
|
238
|
+
|
|
239
|
+
A correction for one dimension moves the change set and therefore expires every verdict of
|
|
240
|
+
the task, because every reviewer's brief covers the whole diff. Corrections are therefore
|
|
241
|
+
batched: address every pending finding of every dimension, then reopen all applicable
|
|
242
|
+
reviews together on one state, frozen while they are in flight so no verdict binds to code
|
|
243
|
+
its reviewer never read. A review filed on a state that moved since it began is void.
|
|
244
|
+
|
|
245
|
+
If domain requests conflict, identify the incompatible invariants and reopen decisions
|
|
246
|
+
before writing. A dimension that turns non-`SOUND` on a state produced by correcting another
|
|
247
|
+
is a cross-dimension conflict, which the next briefs carry. Stop a repeating conflict for
|
|
248
|
+
user arbitration; never force a verdict. Bound the conflict rounds and the total rounds, and
|
|
249
|
+
send a task that reaches either bound to the user rather than looping.
|
|
250
|
+
|
|
251
|
+
## Gate and portable execution
|
|
252
|
+
|
|
253
|
+
Inspect the installed gate's help/capabilities before using a dimension. Never invent CLI
|
|
254
|
+
flags, reuse a different dimension or treat a refused record as an absent gate. A gate
|
|
255
|
+
validates shape, membership and referential integrity; the reviewer owns semantic judgment
|
|
256
|
+
and only attests SOUND. The gate computes its own fingerprints and accepts none. Fix a
|
|
257
|
+
refused record before continuing that workflow.
|
|
258
|
+
|
|
259
|
+
The suite's own gate is `ai-engineering-gate`, generic by construction: it derives state from
|
|
260
|
+
evidence and holds no domain rule. Enforcement it applies covers omission, drift and stale
|
|
261
|
+
evidence, not a deliberately forged evidence index. A harness Stop hook is advisory by design
|
|
262
|
+
of the harnesses; the lock on publication is the gate's exit code, consumed by a delivery
|
|
263
|
+
pipeline gate or a CI check.
|
|
264
|
+
|
|
265
|
+
Without a compatible gate, portable completion consists of validated records, successful
|
|
266
|
+
checks and an independent report tied to the examined state. It provides no automatic
|
|
267
|
+
enforcement or lock. If the project's workflow requires gate attestation, an absent or
|
|
268
|
+
unsupported gate leaves that workflow incomplete; portable evidence cannot replace it.
|
|
269
|
+
Keep evidence available through review/correction; do not reconstruct missing historical
|
|
270
|
+
decisions as if they preceded implementation.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# Types and abstractions
|
|
2
|
+
|
|
3
|
+
## MT-17 - Preserve useful inference and verify contracts
|
|
4
|
+
|
|
5
|
+
**Intent/use:** use inference for local values, satisfies to check assignability while
|
|
6
|
+
retaining useful inferred information, as const for literal/readonly intent, and const type
|
|
7
|
+
parameters where a reusable generic needs literal inference.
|
|
8
|
+
**Alternatives/trade-offs:** an annotation can deliberately expose a stable public shape;
|
|
9
|
+
ordinary generics often suffice. Contextual typing still affects inferred expressions with
|
|
10
|
+
satisfies. An identity helper can carry real constraints, not just old compiler workarounds.
|
|
11
|
+
**Avoid:** assertions posing as checks, readonly tuples where callers need mutation, or
|
|
12
|
+
advanced types solely to display modern syntax.
|
|
13
|
+
**Invariants:** valid examples compile; invalid contract examples fail for the intended
|
|
14
|
+
reason; callers retain the useful inferred distinctions without undocumented casts.
|
|
15
|
+
**Sources/support:** [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html),
|
|
16
|
+
[const type parameters](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html).
|
|
17
|
+
Use the project's actual stable compiler, not a version prescribed by this catalog.
|
|
18
|
+
|
|
19
|
+
## MT-18 - Represent states and narrow truthfully
|
|
20
|
+
|
|
21
|
+
**Intent/use:** discriminated unions model mutually exclusive states; narrow with real
|
|
22
|
+
runtime checks and use never/exhaustiveness when every closed variant must be handled.
|
|
23
|
+
**Alternatives/trade-offs:** independent flags represent independent facts; plain branches
|
|
24
|
+
can be the simplest closed-set implementation. Public wire formats may need adaptation.
|
|
25
|
+
**Avoid:** non-null assertions hiding absence, predicates that lie, truthiness dropping
|
|
26
|
+
valid zero/empty-string values, or a default swallowing a new required variant.
|
|
27
|
+
**Invariants:** impossible combinations rejected, all required variants covered, optional
|
|
28
|
+
and falsy values distinguished; runtime guards agree with their type claim.
|
|
29
|
+
**Source/support:** [narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html);
|
|
30
|
+
check strictNullChecks and actual compiler behavior.
|
|
31
|
+
|
|
32
|
+
## MT-19 - Remove mechanisms only when their contract is redundant
|
|
33
|
+
|
|
34
|
+
**Intent/use:** compare transparent wrappers/polyfills/identity helpers with supported
|
|
35
|
+
native constructs. Remove avoidable code when the native expresses the full contract.
|
|
36
|
+
**Alternatives/trade-offs:** retain a business abstraction, stable public facade, observability,
|
|
37
|
+
validation or compatibility boundary even if its body is short; consider an existing
|
|
38
|
+
library before rebuilding its guarantees.
|
|
39
|
+
**Avoid:** deleting a helper merely because it wraps a native; automatic dependency bans
|
|
40
|
+
or polyfills; forcing reduce/loops/classes/enums into a single preferred style.
|
|
41
|
+
**Invariants:** callers, public types, domain meaning, errors, security and runtime targets
|
|
42
|
+
remain valid. A retained helper explains its extra contract; a replacement demonstrates
|
|
43
|
+
semantic equivalence at the public seam.
|
|
44
|
+
**Sources/support:** the selected native's exact reference, plus the actual helper's public
|
|
45
|
+
contract and package/runtime support. For pure syntax, see MT-01..05; for types, MT-17.
|
|
46
|
+
|
|
47
|
+
## MT-20 - Validate external facts before trusting types
|
|
48
|
+
|
|
49
|
+
**Intent/use:** unknown at untrusted boundaries, followed by runtime validation/narrowing.
|
|
50
|
+
Use a proven schema library or small truthful guard according to the payload complexity.
|
|
51
|
+
Brands distinguish otherwise interchangeable domain identities after construction/validation.
|
|
52
|
+
**Alternatives/trade-offs:** existing trusted decoders can establish proof; localized
|
|
53
|
+
assertions can express a fact the compiler cannot carry, with that proof identified.
|
|
54
|
+
**Avoid:** JSON.parse/fetch cast directly to a domain type, double casts, unvalidated brands,
|
|
55
|
+
any erasing obligations, or a brand claimed as authentication/runtime protection.
|
|
56
|
+
**Invariants:** representative malformed input is rejected; valid data reaches a correctly
|
|
57
|
+
typed domain value; validation and type claims agree.
|
|
58
|
+
**Sources/support:** [unknown](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-0.html),
|
|
59
|
+
[narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html).
|
|
60
|
+
Static annotations and brands are erased; they do not install runtime validation.
|
|
61
|
+
|
|
62
|
+
## MT-21 - Derive types without hiding the contract
|
|
63
|
+
|
|
64
|
+
**Intent/use:** readonly inputs prevent accidental writes through that type; standard
|
|
65
|
+
utility types and template literal types can derive meaningful keys/contracts.
|
|
66
|
+
**Alternatives/trade-offs:** named simple types often communicate better; explicit stable
|
|
67
|
+
public types can avoid leaking implementation details. Track inference/editor/compiler cost.
|
|
68
|
+
**Avoid:** claiming deep runtime immutability from readonly/as const, recursive type puzzles
|
|
69
|
+
without useful guarantees, or turning two meaningful IDs into one unbranded string API.
|
|
70
|
+
**Invariants:** required readonly restrictions and derived keys checked by the compiler;
|
|
71
|
+
runtime mutation/freeze claims verified separately; public types remain understandable.
|
|
72
|
+
**Sources/support:** [object types](https://www.typescriptlang.org/docs/handbook/2/objects.html),
|
|
73
|
+
[template literals](https://www.typescriptlang.org/docs/handbook/2/template-literal-types.html),
|
|
74
|
+
[utility types](https://www.typescriptlang.org/docs/handbook/utility-types.html).
|
|
75
|
+
|
|
76
|
+
## MT-24 - Keep the type information the change already carries
|
|
77
|
+
|
|
78
|
+
**Intent/use:** a transposition that keeps a call's runtime behavior can still lose what the
|
|
79
|
+
compiler knew about it. Compare the type before and after: a literal or template-literal type
|
|
80
|
+
widened to `string`, a discriminated union collapsed to its base object, a tuple flattened to
|
|
81
|
+
an array, a `readonly` dropped, a generic parameter erased, an inferred key set replaced by
|
|
82
|
+
`string`, or an assertion standing in for a narrowing the compiler could have done.
|
|
83
|
+
**Alternatives/trade-offs:** losing type information can be the right call - a simpler public
|
|
84
|
+
type, a boundary that must accept unvalidated input, a native API whose declarations are
|
|
85
|
+
looser than the helper it replaces. Then it is a named trade-off with the guarantee it costs,
|
|
86
|
+
not an unmentioned side effect. `satisfies` often keeps the narrow type while checking the
|
|
87
|
+
wide contract; an overload or a generic can carry a relation a widened signature drops.
|
|
88
|
+
**Avoid:** an `as` that restores by assertion what the change widened, a signature whose
|
|
89
|
+
callers now need their own casts, exhaustiveness that stops being checked because the
|
|
90
|
+
discriminant is gone, and a record that claims the contract is unchanged when a consumer's
|
|
91
|
+
compile-time guarantee is gone.
|
|
92
|
+
**Invariants:** the record names each type-information change and the guarantee it trades;
|
|
93
|
+
consumer-facing narrowing that survives is verified by the compiler, on consumer code where
|
|
94
|
+
one exists, not asserted in prose.
|
|
95
|
+
**Sources/support:** [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-9.html#the-satisfies-operator),
|
|
96
|
+
[narrowing](https://www.typescriptlang.org/docs/handbook/2/narrowing.html),
|
|
97
|
+
[type assertions](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-assertions).
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
name: transpose-modern-typescript
|
|
2
|
+
type: skill
|
|
3
|
+
tools:
|
|
4
|
+
- claude-code
|
|
5
|
+
- cursor
|
|
6
|
+
- github-copilot
|
|
7
|
+
description: "Record and implement modern TS/JS decisions, then obtain an independent review."
|
|
8
|
+
label: "Transpose Modern TypeScript"
|
|
9
|
+
author: "Guillaume Mongin (@hellraisercenobit)"
|
|
10
|
+
license: "MIT"
|
|
11
|
+
copyright: "Copyright (c) 2026 Guillaume Mongin (@hellraisercenobit)"
|
|
12
|
+
homepage: "https://github.com/hellraisercenobit/skills/tree/main/skills/engineering/transpose-modern-typescript"
|
|
13
|
+
version: "1.0.0"
|
|
14
|
+
tags:
|
|
15
|
+
- software-engineering
|
|
16
|
+
- typescript
|
|
17
|
+
- javascript
|
|
18
|
+
content: SKILL.md
|
|
19
|
+
installPaths:
|
|
20
|
+
claude-code: .claude/skills/transpose-modern-typescript/SKILL.md
|
|
21
|
+
cursor: .cursor/skills/transpose-modern-typescript/SKILL.md
|
|
22
|
+
github-copilot: .github/instructions/transpose-modern-typescript.instructions.md
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: transpose-testing-patterns
|
|
3
|
+
description: "Choose and record a testing strategy before writing tests or affected implementation, then guide observable RED/GREEN/refactor and independent review. Use for behavior changes, regression tests, test doubles, testability seams, static TypeScript contracts or unreliable tests. Runner-neutral catalog with a qualified Vitest adapter, an implemented Karma + jasmine-core + Angular TestBed adapter and an implemented Codeception adapter. Companion to review-testing-patterns. Excludes prose-only and formatting-only changes."
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: Guillaume Mongin (@hellraisercenobit)
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Transpose testing patterns
|
|
10
|
+
|
|
11
|
+
Choose tests that discriminate a plausible defect and survive a legitimate internal
|
|
12
|
+
refactor. A direct test, an existing factory or no new abstraction can be the best choice.
|
|
13
|
+
|
|
14
|
+
## Resolve first
|
|
15
|
+
|
|
16
|
+
Read [contract 1.1.0](references/suite-contract.md), [catalog 1.0.0](references/catalog.md)
|
|
17
|
+
and [record guidance](references/record.md). Resolve /review-testing-patterns and the
|
|
18
|
+
[schema 2.0.0](references/decision-record.schema.json). Detect the runner family from
|
|
19
|
+
lockfile and project signals ([detect-adapter](references/detect-adapter.mjs)), then load
|
|
20
|
+
that family's adapter. Neighbouring majors that still use the same runner shape stay on
|
|
21
|
+
the same adapter; exact patches are reference profiles, not the routing key. SOUND does
|
|
22
|
+
not uniquely require Vitest.
|
|
23
|
+
|
|
24
|
+
| Family | Detect | Adapter |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `vitest` | `vitest` in npm packages, without Karma + Angular TestBed or Codeception | [adapter 1.0.0](references/transpose-vitest.md) |
|
|
27
|
+
| `karma-jasmine-angular` | `karma` + `jasmine-core` + `@angular/core`, karma config and Angular project | [adapter 1.0.0](references/transpose-karma-jasmine-angular.md) |
|
|
28
|
+
| `codeception` | `codeception/codeception` in composer packages | [adapter 1.0.0](references/transpose-codeception.md) |
|
|
29
|
+
| `unknown` | missing required signals | catalog analysis only |
|
|
30
|
+
|
|
31
|
+
Check installed capabilities on the selected adapter. The shared shapes sit beside the
|
|
32
|
+
contract: [declaration](references/declaration.schema.json),
|
|
33
|
+
[decision envelope](references/decision-envelope.schema.json),
|
|
34
|
+
[evidence append](references/evidence-append.schema.json),
|
|
35
|
+
[journal event](references/journal-event.schema.json) and [dispute](references/dispute.schema.json).
|
|
36
|
+
Missing/conflicting required references leave execution incomplete. Other runners permit
|
|
37
|
+
catalog analysis only; do not claim qualified transposition or silently migrate them to
|
|
38
|
+
Vitest.
|
|
39
|
+
|
|
40
|
+
## Procedure
|
|
41
|
+
|
|
42
|
+
0. **Declare.** Pipe a [declaration](references/declaration.schema.json) to
|
|
43
|
+
`ai-engineering-gate declare --dimension testing-patterns --stdin` before any record: applicability
|
|
44
|
+
and its reason, the requester's own wording, the factual constraints, the base and the protected
|
|
45
|
+
paths. When tests are TypeScript, `constraints` must name the ES/compiler target as a factual
|
|
46
|
+
string (example: `compiler: TypeScript 4.0.5, target ES2015, lib es2015, strict off`). A tsconfig
|
|
47
|
+
path in `scope.configuration` is not a substitute. PHP and other non-TypeScript suites omit this
|
|
48
|
+
constraint rather than invent one. `non-applicable` with its reason is a complete answer, and the
|
|
49
|
+
reviewer's brief is rendered from this document alone.
|
|
50
|
+
1. **Frame.** Establish raw need, scope/base, public contracts, actual runner/compiler,
|
|
51
|
+
configuration and runtimes. When tests are TypeScript, name the ES/compiler target in
|
|
52
|
+
`constraints`; do not leave it only in tsconfig. Include relevant tests, production, helpers
|
|
53
|
+
and new files. Select TDD, characterization, existing coverage or audit mode honestly.
|
|
54
|
+
2. **Inventory and compare.** Walk every catalog axis, including retained choices and
|
|
55
|
+
uncovered risks. For each site name behavior, risk, public seam and independent oracle.
|
|
56
|
+
Compare current tests, direct tests and plausible alternatives. Family, level, double
|
|
57
|
+
and arrangement are separate decisions. Read [doubles/data](references/doubles-data.md),
|
|
58
|
+
[TDD](references/tdd.md) and [TypeScript](references/typescript.md) where applicable.
|
|
59
|
+
Testing owns observation; use /transpose-design-patterns for a real architectural
|
|
60
|
+
response and /transpose-modern-typescript for substantial language/platform choices.
|
|
61
|
+
3. **Record before writing.** File it with
|
|
62
|
+
`ai-engineering-gate record --dimension testing-patterns --stdin` before the first affected test,
|
|
63
|
+
helper, configuration or production write. Every site whose action applies a test change names its
|
|
64
|
+
`oracle` - kind, independence and the statement itself - and the `plausibleDefect` the test
|
|
65
|
+
discriminates; a `retain` action is the only exemption. Name in `plans` what the record will produce,
|
|
66
|
+
with the `test` and `production` roles, which is what makes a replay possible later. `none` means no
|
|
67
|
+
specialized pattern helps; `retain` is an independent action. Group coherent scenarios without hiding
|
|
68
|
+
their identity.
|
|
69
|
+
4. **Execute vertical slices.** Follow the TDD guide when claiming TDD. Observe the intended failure,
|
|
70
|
+
freeze the oracle through GREEN and name pressure before refactoring. File each cycle as a
|
|
71
|
+
[journal event](references/journal-event.schema.json) through
|
|
72
|
+
`ai-engineering-gate evidence append --dimension testing-patterns --stdin`: the phase, the command,
|
|
73
|
+
the exit code, the raw output and, for a red, its cause and its `failureClass`. The gate stamps every
|
|
74
|
+
append with the content hashes of the planned test and production artifacts, which is what turns a
|
|
75
|
+
claimed red into an inspectable one. Run runtime, compilation and relevant consumer-type checks
|
|
76
|
+
separately. Match required scenarios to tests actually run; disclose skips, expected failures and
|
|
77
|
+
retries.
|
|
78
|
+
5. **Dispatch fresh review.** Run `ai-engineering-gate status --full` for the dispatch plan and the
|
|
79
|
+
neutral brief. Use `testing-pattern-reviewer` or a fresh general subagent without inherited
|
|
80
|
+
conversation. Send the brief as printed - raw request, exact scope and base, factual constraints,
|
|
81
|
+
record and evidence paths - and no builder rationale, expected verdict or harness oracle. It runs
|
|
82
|
+
/review-testing-patterns itself in read-only mode. Without an independent context, report incomplete
|
|
83
|
+
execution.
|
|
84
|
+
6. **Close the loop.** Corrections are batched across dimensions, then all applicable reviews reopen
|
|
85
|
+
together on one state. A missing red is an evidence finding whose remedy is a replay the gate runs
|
|
86
|
+
itself - `ai-engineering-gate replay --dimension testing-patterns --record <ref> --scenario <name>
|
|
87
|
+
--command <command>` - never a transcript you supply. A finding you contest goes to
|
|
88
|
+
`ai-engineering-gate dispute --dimension testing-patterns --stdin` with counter-evidence, and only
|
|
89
|
+
the user arbitrates it. Prior reports are preserved. Complete when `ai-engineering-gate can-stop`
|
|
90
|
+
exits 0; covered edits or changed records and references expire affected verdicts.
|
|
91
|
+
|
|
92
|
+
## Deliverable
|
|
93
|
+
|
|
94
|
+
Report profile, scope/base/state, decisions and trade-offs, artifacts, observed cycles,
|
|
95
|
+
commands/results, scenario coverage, independent report and limitations. Portable evidence
|
|
96
|
+
provides no automatic lock. Do not infer process history from final code or commit messages.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://github.com/hellraisercenobit/skills/blob/main/contracts/schemas/arbitration.schema.json",
|
|
4
|
+
"title": "Arbitration 1.0.0",
|
|
5
|
+
"description": "A dispute's only exit, and only a human hand writes it. `arbitrate` is refused whenever an identity handoff exists for the call, which is the case for every agent tool call a hook saw.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": [
|
|
9
|
+
"document",
|
|
10
|
+
"documentVersion",
|
|
11
|
+
"dimension",
|
|
12
|
+
"dispute",
|
|
13
|
+
"decision",
|
|
14
|
+
"words"
|
|
15
|
+
],
|
|
16
|
+
"properties": {
|
|
17
|
+
"document": {
|
|
18
|
+
"const": "arbitration"
|
|
19
|
+
},
|
|
20
|
+
"documentVersion": {
|
|
21
|
+
"const": "1.0.0"
|
|
22
|
+
},
|
|
23
|
+
"dimension": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"minLength": 1
|
|
26
|
+
},
|
|
27
|
+
"dispute": {
|
|
28
|
+
"description": "The identifier of the dispute being arbitrated.",
|
|
29
|
+
"type": "string",
|
|
30
|
+
"minLength": 1
|
|
31
|
+
},
|
|
32
|
+
"decision": {
|
|
33
|
+
"description": "`uphold` closes the finding by arbitration and allows one fresh review on the same state; `reject` puts its remedy or correction back to pending.",
|
|
34
|
+
"enum": [
|
|
35
|
+
"uphold",
|
|
36
|
+
"reject"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"words": {
|
|
40
|
+
"description": "The user's own words.",
|
|
41
|
+
"type": "string",
|
|
42
|
+
"minLength": 1
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|