/nanook:create-equivalence-class-tablefrom nanook
Creates formatted Excel decision tables (equivalence classes, test cases, CASCADE coverage) for forms, pages or APIs using @xhubio/nanook-table. Generates test data and checks coverage.
Ships in nanook. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Creates formatted Excel files with nanook.xhub decision tables for any test object (pages, APIs, forms). Includes colour formatting, formulas, correct marker logic and 100% coverage.
ImporterXlsx reads the generated file — so the structure must match the ParserDecision format exactly@xhubio/nanook-table (3.1.0 or later, ESM; 3.0.1 works, but without the scripts in the package) and exceljs as a devDependency
(npm install -D exceljs) — exceljs is not a dependency of Nanook..ts/.mts directly; older 22.x need
--experimental-strip-types, npx tsx works everywhere.scripts/create-<name>-table.ts, resources/<name>-tests.xlsx,
fixtures/<name>/. If the user names other folders, use theirs.Two finished, tested scripts are in the scripts/ folder next to this SKILL.md — and,
from @xhubio/nanook-table 3.1.0, in the project under
node_modules/@xhubio/nanook-table/skills/create-equivalence-class-table/scripts/.
Copy them from there: that folder is inside the project, the plugin folder is often outside it and
then not readable. Run them only inside the project: Node resolves imports relative to the script and
does not strip TypeScript types under node_modules. If cp is not allowed, read the file
and write it into the project unchanged. Never rewrite them: the scripts are
tested, a rewrite is not. If neither source can be found, tell the user
so instead of building a substitute.
cp node_modules/@xhubio/nanook-table/skills/create-equivalence-class-table/scripts/*.mts scripts/
node scripts/check-classes.mts resources/<name>-tests.xlsx
node scripts/generate-fixtures.mts resources/<name>-tests.xlsx fixtures/<name>
| Script | What it does | Exit 1 if |
|---|---|---|
check-classes.mts | reads the markers from the cells (not the formula values), recomputes combinations, column products and coverage, reports every class without its own x | coverage < 100 %, class without x, field without marker, no decision table |
generate-fixtures.mts | Nanook reads the workbook, generators faker and text and the filter processors SimpleArrayFilter and SimpleArrayIgnoreFilter are registered, one JSON per test case, count per table | Nanook logged errors (Nanook does not throw, it logs and carries on) |
The text generator (in generate-fixtures.mts) provides the edge cases faker cannot:
gen::text:empty (empty string), gen::text:spaces:N, gen::text:alpha:N,
gen::text:email:N (N letters + @example.com).
total = product of all EqClass counts
TCs needed for 100% CASCADE = (sum of all non-preferred EqClasses) + 1 happy
generate-test-data skill covers that part| Column | Content |
|---|---|
| A (1) | Name / field name |
| B (2) | Section type (FieldSection, FieldSubSection, ExecuteSection, ...) |
| C (3) | Equivalence class name / count (in FieldSubSection header) |
| D (4) | Generator / TDG |
| E (5) | Comment |
| F+ (6+) | Test case columns |
<DECISION_TABLE> ← header with TC names in column F+
Execute ← ExecuteSection: T/F per TC
NeverExecute ← NeverExecuteSection: T/F (optional)
Multiply ← MultiplicitySection: 1 per TC
FieldSection ← group header (e.g. "Billing Address")
FieldSubSection ← field header (e.g. "billingName"), C=COUNTA formula
EqClass rows ← equivalence classes with markers
FieldSubSection ← next field
...
GeneratorSwitch ← GeneratorSwitchSection (optional)
Filter ← FilterSection (optional)
Summary ← SummarySection with coverage formulas
Expected Result ← MultiRowSection (error codes as rows, see below)
Category ← TagSection with "negative"/"valid" rows
<END>
| Section | Type | Rows | Description |
|---|---|---|---|
| FieldSection | Multi-Row | 1+ FSS | Groups fields (e.g. "Billing Address") |
| FieldSubSection | Multi-Row | 1+ EqClass | One field with its equivalence classes |
| ExecuteSection | Single-Row | 1 | T=generate, F=usable only via reference |
| MultiplicitySection | Single-Row | 1 | How often to generate the TC (default: 1) |
| SummarySection | Single-Row | 1 | Coverage calculation (max. 1 per table) |
| MultiRowSection | Multi-Row | 1+ | Expected results, error messages, actions |
| TagSection | Multi-Row | 1+ | Labels/tags for TCs (happy-path, smoke, etc.) |
| Section | Type | Description |
|---|---|---|
| NeverExecuteSection | Single-Row | Opposite of ExecuteSection: T=do not generate when referenced |
| FilterSection | Multi-Row | Filter expressions for conditional TC inclusion. Only on master TCs, not on referenced ones |
| GeneratorSwitchSection | Multi-Row | Switch off specific generators per TC |
T, 1, y, j, yes, ja, si, true, ok (case-insensitive)F or any other valuex is recognised as FALSE! Write T for tables that generate, F for sub-tables| Marker | Meaning | COUNTA | Data generation |
|---|---|---|---|
x | Selected (only value) | Yes | Is used |
a | Preferred (among several) | Yes | Is chosen preferentially |
e | Fallback (among several) | Yes | Only if there is no a |
i | Impossible (logically impossible) | Yes | Is NOT used |
| empty | Not marked | No | Is not used |
a on the VALID classThe obvious reading is "doesn't matter, something already goes wrong above". It is the wrong way round. The reason is sharper:
The other fields get
aon the valid class so that the EXPECTED error message becomes visible and is not masked by another.
If arbitrary values stood there, another field's error might come first — the test would be red and still not check what it claims.
Example: a test case expects rejection at the field because of a password that is
too long, but Password too long comes from the server — both messages are
true, but the second belongs to a different boundary and masks the first.
e in the valid case means "I don't care what's in it" — and that is allowedIf a page has properties that are irrelevant to
the object under test, all their valid classes go on e in the valid case.
That satisfies coverage, and at the same time the table states
something true:
Not "I have tested all combinations", but "here I have explicitly declared that I don't care."
🔵 That is the real gain: the indifference is written down. If the property later becomes meaningful — a field moves into a PDF, an export, an invoice — the row shows immediately where you did without it, and you give it its own column. A table without these markers hides the decision; later nobody knows whether someone tested or forgot.
🔴 Never on an error class. "I don't care" applies to permitted values. An
e on an error class claims an invalid value still leads to the
good result.
Two constraints, so that it does not go wrong:
The preferred class needs its x elsewhere | If you open up the happy path itself, it loses it — for a field at the very end, no test case is then left at all. check-classes.mts reports this |
e produces NO variation | e means "only if there is no a" — with an a in the field, the a wins every time. Anyone who really wants to vary needs a field without a; whether the library then switches per run is untested |
⚪ And if it does: a test that takes different data on every run no longer reproduces a failure. Variation is a trade-off of its own, not a side effect of coverage.
The telescoping identity Σ_i (n_i − 1)·Π_{j>i} n_j = C − 1 assumes that
every class except the preferred one is an error target. Only an error column
may open its successors on all classes — it may do so because something
already goes wrong above.
As soon as a field has a valid alternative (logo: none|png|svg,
measurementSystem: metric|imperial), the arithmetic breaks: a valid-case column
may only open the valid classes, never the faulty ones — otherwise it would claim
that an invalid value leads to the good result. Its contribution is therefore
smaller than the full product, and the sum stays below 100 %.
🔴 This does NOT mean 100 % is unreachable. What fails is the shortcut, not the goal. Coverage remains reachable, you just pay for it with columns instead of an identity:
| Way | Cost |
|---|---|
| Cascade | (n−1) columns per field — cheap, but only if every alternative is an error target |
| Field order | Fields with valid alternatives go to the BACK; if such a field is last, Π of the successors = 1 and the valid-case column counts in full again |
| Enumerate | the missing combinations as their own columns — in the limit one per combination. Always possible, sometimes a lot of work |
⚪ A table below 100 % is then a decision about effort, not a limit of the method — and it should be made deliberately, not by accident.
💡 As long as you are not enumerating, the better question is not "what percentage", but "does every class have its own test case". That is what
check-classes.mtsis for — it counts onlyx, becausea/eare a choice and not a guarantee.
1. Target field (the field this TC tests):
x2. Happy-path TC, non-target field:
x (COUNTA = 1)e (see "e in the valid case")a/e on invalid values (logically wrong: "all valid" cannot cover an error value)3. Error TC, non-target field:
a (chosen preferentially)e (count towards coverage)4. Impossible (i):
xIf only ONE EqClass is marked for a field in a TC, x must be used (not a).
=COUNTA(C_eqStart:C_eqEnd)
Counts the EqClass names → gives the number of equivalence classes.
=COUNTA(F_eqStart:F_eqEnd)
Counts the markers per TC → gives how many EqClasses this TC covers.
=C_fss1 * C_fss2 * C_fss3 * ...
Product of all FieldSubSection C values = total number of possible combinations.
=F_fss1 * F_fss2 * F_fss3 * ...
Product of all FieldSubSection COUNTA values for this TC.
=SUM(F_summary:lastTC_summary)
=E_summary / C_summary
Format: 0.00%
| Row type | Background | Font |
|---|---|---|
<DECISION_TABLE> header | Dark blue #0070C0 | White, bold |
| ExecuteSection | Blue #4472C4 | White |
| MultiplicitySection | Blue #4472C4 | White |
| FieldSection header | Blue #4472C4 | White |
| FieldSubSection header | Blue #4472C4 | White |
| EqClass data rows | No fill | Default |
| SummarySection | Green #00B050 | White, bold |
| MultiRowSection header | Green #00B050 | Blue |
| MultiRowSection data | No fill | Default |
| TagSection header | Blue #4472C4 | White |
| TagSection data | No fill | Default |
<END> | Blue #4472C4 | White |
🔴 The built-in faker generator takes only a path, no arguments.
gen::faker:string.alpha(300) or gen:1:faker:string.alpha:255 fail; Nanook logs
the error and drops the test case (fewer cases than columns). So produce lengths, empty values and
spaces via the text generator (see above) or a generator of your own.
Empty cells and pure spaces are no good as values: the importer trims cells.
Invalid EqClasses should always have errorCode and errorMessage. These are shown as
separate rows in the expected-result area (see "Expected Result — error code rows").
Valid variants (e.g. credit_note as an alternative type) have no errorCode.
| EqClass | Generator | Comment | errorCode | errorMessage |
|---|---|---|---|---|
| valid | gen:N:faker:person.fullName | Valid value | — | — |
| empty | gen::text:empty | Required field empty | NAME_EMPTY | Name is required |
| whitespace | gen::text:spaces:3 | Spaces only | NAME_WHITESPACE | Name must not be only spaces |
| tooLong | gen::text:alpha:300 | Over max. length | NAME_TOO_LONG | Name exceeds max. length |
| EqClass | Generator | Comment | errorCode |
|---|---|---|---|
| valid | gen:N:faker:lorem.paragraph | Valid value | — |
| empty | gen::text:empty | Optional, empty (valid!) | — (no error!) |
| EqClass | Generator | Comment | errorCode | errorMessage |
|---|---|---|---|---|
| valid | gen:N:faker:internet.email | Valid email | — | — |
| invalid | not-an-email | Wrong format | EMAIL_FORMAT | Email has wrong format |
| empty | gen::text:empty | Empty (required=error, optional=valid) | EMAIL_EMPTY | Email is required |
| EqClass | Generator | Comment | errorCode | errorMessage |
|---|---|---|---|---|
| valid | 100 | Valid value | — | — |
| zero | 0 | Zero value (depending on context) | QTY_ZERO | Quantity must not be zero |
| negative | -1 | Negative value | QTY_NEGATIVE | Quantity must not be negative |
| tooHigh | 999999 | Over maximum | QTY_TOO_HIGH | Quantity exceeds maximum |
| EqClass | Generator | Comment | errorCode | errorMessage |
|---|---|---|---|---|
| valid | 2026-03-01 | Valid date | — | — |
| empty | gen::text:empty | No date | DATE_EMPTY | Date is required |
| invalid | not-a-date | Not a valid date | DATE_FORMAT | Date has wrong format |
| past | 2020-01-01 | Date in the past | — (often valid) | — |
| future | 2030-12-31 | Date in the future | — (often valid) | — |
| EqClass | Generator | Comment | errorCode | errorMessage |
|---|---|---|---|---|
| valid | DE | Valid value | — | — |
| invalid | INVALID | Not in the list | COUNTRY_INVALID | Invalid country code |
| empty | gen::text:empty | No selection | COUNTRY_EMPTY | Country code is required |
| EqClass | Generator | Comment | errorCode |
|---|---|---|---|
| true | true | Enabled | — |
| false | false | Disabled | — |
i (impossible) for logically impossible combinations (e.g. the UI hides the field)Any value that does NOT start with gen: or ref: is taken directly as test data.
DE ← used as the string "DE"
100 ← used as the string "100"
not-an-email ← used as a string
gen:<instanceId>:<generatorName>:<parameter>
| Part | Description |
|---|---|
| instanceId | Groups related generations. Same ID = same data |
| generatorName | Name of the registered generator (e.g. "faker") |
| parameter | Generator-specific (e.g. faker function) |
Instance ID reuse — related fields:
gen:1:faker:person.fullName ← person 1
gen:1:faker:internet.email ← email of person 1 (same instance!)
gen:2:faker:person.fullName ← person 2 (different instance)
Common faker functions (path only, no arguments):
person.fullName, person.firstName, person.lastName
internet.email, internet.url
location.street, location.city, location.zipCode, location.country
lorem.paragraph, lorem.sentence, lorem.word
commerce.productName, commerce.price
string.uuid
date.recent, date.future, date.past
phone.number
References another field in the same test case:
ref:::fieldName: ← value of "fieldName" in the same TC
Useful when one field depends on the value of another.
🔴 Version 2.1.3 or later. If the self-reference is in a table that is itself referenced from outside (which normally means every data table), the field used to stay silently empty before that — no error message, just a missing value. The cause was two defects: an unchecked instance during resolution and a target node that got redirected to the collecting table while the directives were being collected. The symptom that gives it away: a test case table produces fewer cases than columns (in practice: 3 of 7).
Each test case needs:
invalid_1, valid_1) in sub-tables, descriptive in main tablesx marker (or valid row)negative or valid row with x marker| Table type | Naming | Example | Reason |
|---|---|---|---|
| Sub-table (Execute=F) | Sequential | invalid_1, invalid_2, ..., valid_1 | Range references [invalid_1-N] need consecutive numbers |
| Main table (Execute=T) | Descriptive | format_xrechnung, sellerData_invalid | Not referenced by range, readability matters more |
interface EqClass {
name: string // EqClass name (e.g. "valid", "empty")
generator: string // Generator/value (e.g. "gen:1:faker:person.fullName")
comment: string // Description
targetTcs: string[] // Which TCs choose this EqClass as target
preferred: boolean // Is this the valid/preferred value?
errorCode?: string // Expected error code if this EqClass triggers an error
errorMessage?: string // Human-readable error description for the expected-result row
}
interface FieldDef {
name: string // Field name
eqClasses: EqClass[] // Equivalence classes
targetTcs: string[] // Which TCs test this field
}
interface SectionDef {
name: string // Section name (e.g. "Billing Address")
fields: FieldDef[] // Fields in this section
}
Instead of generic "valid"/"error" values, error codes are shown as separate rows. That is more readable, because error codes and error descriptions get more space.
Expected Result | MultiRowSection | | | TC1 | TC2 | ... | valid_1
| | valid | Data is valid, no error | | | | x
| | NAME_EMPTY | Name is required | x | | |
| | NAME_WHITESPACE | Name must not be only spaces | | x | |
| | EMAIL_FORMAT | Email has wrong format | | | x |
| | valid_variant | Valid variant, no error | | | |
valid: x on all TCs that expect no error (happy path)errorCode from the EqClasses
NAME_EMPTY)errorMessage)x on the TC that triggers this errorvalid_variant: x on TCs whose target EqClass has no errorCode
(e.g. credit_note as an alternative invoice type — valid, but not preferred)errorCode property of the TC's target EqClassx (or valid/valid_variant)Instead of a single "category" row with values, negative and valid are shown as
separate rows, each with x markers.
Category | TagSection | | | TC1 | TC2 | ... | valid_1
| | negative | | x | x | x |
| | valid | | | | | x
Category, column B = TagSectionnegative: x on all TCs whose target EqClass has an errorCodevalid: x on happy-path TCs and TCs without errorCode (valid variants)x in exactly one of the two rowsnode scripts/create-<name>-table.ts — generate the Excel filenode scripts/check-classes.mts resources/<name>-tests.xlsx — coverage and own x per classnode scripts/generate-fixtures.mts resources/<name>-tests.xlsx fixtures/<name> — Nanook parses and generatesExecute = T, one case per test case column, plus one for each
further element of a range reference. Fewer means: a generator failed.generate-test-data skill.A main table can refer to sub-tables. The reference is written as a generator value in an EqClass row (column D).
ref:InstanceId:TableName:FieldName:TestcaseName
CAUTION: FieldName comes BEFORE TestcaseName! (Code: parts[3]=targetFieldName, parts[4]=targetTestcaseName)
| Part | Required | Description |
|---|---|---|
ref | Yes | Keyword (parts[0]) |
| InstanceId | No | Groups related references (parts[1]) |
| TableName | No | Target table, empty = same table (parts[2]) |
| FieldName | No | Specific field, empty = no data value (parts[3]) |
| TestcaseName | Yes | Target test case (parts[4]) |
ref:1:BillingAddress:billingName:validAddress ← field billingName from validAddress in BillingAddress
ref:1:BillingAddress:street:validAddress ← same instance, different field
ref:1:BillingAddress::validAddress ← without FieldName (only create the instance)
ref:::password: ← self-reference (same table)
ref::TableName::[tc_prefix_1-N]
[prefix_1-N] reference several TCs (prefix_1, prefix_2, ..., prefix_N)processRanges)[invalid_1-7] → invalid_1, invalid_2, ..., invalid_7
[valid_1-2] → valid_1, valid_2
[T3-4] → T3, T4
[a1-3,b1-2] → a1, a2, a3, b1, b2 (comma-separated ranges)
Regex: /(\D*)(\d+)-(\d+)$/ — non-digit prefix + start number + end number
Name sub-table TCs following the scheme valid_N and invalid_N.
The main table then has only 2 EqClasses per reference field:
billingScenario (FieldSubSection)
valid | ref::BillingAddress::valid_1 | single ref (1 fixture)
invalid | ref::BillingAddress::[invalid_1-7] | range ref (7 fixtures)
Why "valid" as a single ref, "invalid" as a range:
Naming convention for sub-tables (sequential!):
invalid_1 ← first error case (error-first!)
invalid_2 ← second error case
...
invalid_N ← last error case
valid_1 ← default happy path (all fields valid)
valid_2 ← variant (e.g. minimal required fields)
Why sequential numbers in sub-tables:
[invalid_1-N] need consecutive numbersref::SellerData::[invalid_1-17] → expands to invalid_1, invalid_2, ..., invalid_17seller.name_empty) would make range references impossibleNaming convention for the main table (descriptive):
format_xrechnung ← descriptive name (no range ref to the main table)
sellerData_invalid ← references the sub-table by range
buyerData_invalid ← references the sub-table by range
valid_1 ← happy path
Main tables are not referenced by range, so descriptive names can be used.
<name>-tests.xlsx
├── Sheet "MainTable" ← main table (execute=T), CASCADE, 100%
│ subTableAScenario ← valid (single ref) + invalid (range ref)
│ subTableBScenario ← valid (single ref) + invalid (range ref)
│ directField1, field2 ← direct fields (valid/empty)
├── Sheet "SubTableA" ← sub-table (execute=F), CASCADE, 100%
├── Sheet "SubTableB" ← sub-table (execute=F), CASCADE, 100%
└── ...
The table structure mirrors the test object — not the other way round:
1. Identify field groups: Divide fields that belong together in business terms into groups.
2. Each group becomes a self-contained sheet:
<DECISION_TABLE> header3. The main table references the sub-sheets:
4. Example main table (valid/invalid with ranges):
<DECISION_TABLE> | billingInvalid | datesInvalid | validAll
FieldSection "Billing"
billingScenario (FSS) | COUNTA
valid | ref::SubA::valid_1 | | x | x
invalid | ref::SubA::[invalid_1-7] | x | e |
FieldSection "Dates"
dateScenario (FSS) | COUNTA
valid | ref::SubB::valid_1 | a | x | x
invalid | ref::SubB::[invalid_1-4] | e | |
The multi-sheet strategy above breaks one large table into parts. Alongside it there is a second, independent interplay: entities and flows. Anyone who confuses the two rewrites the same field definitions in every table.
Execute | What it describes | Example | |
|---|---|---|---|
| Data table | F | an entity: its fields and their EqClasses | User, CompanyDE |
| Test case table | T | a flow: which situations exist | Registration, Login |
A data table produces nothing on its own; it is only ever referenced.
The same User table serves registration, login and later customer creation — the
EqClasses for email exist once in the world.
🔴 The tables must be sheets of ONE workbook. References do not resolve across
file boundaries; a reference to another file reports
The targetTable 'User' does not exists. Separate files per table are fine for editing,
but must be merged before generating.
The most common beginner's mistake (and the most expensive one): writing all the fields into the test case table again. It contains almost no field definitions. It names the situations of the flow and pulls in the classes by reference.
Registration, complete — three fields, four test cases, 1 × 2 × 2 = 4 combinations, 100 %:
FieldSection "Secondary data"
session (FSS)
loggedOut | | x | x | x | x
existingUser (FSS)
no | | x | x | |
yes | ref:1:User::OK_1 | | | x | x
FieldSection "Primary data"
user (FSS)
valid | ref:1:User::OK_1 | x | | x |
invalid | ref::User::[E_1-16] | | x | | x
An empty generator cell means: the field gets no value (Nanook only logs an
info). For pure states like loggedOut that is right — the row names the
state, it needs no data. Column 3 is "user already exists, the same one is being
registered" (the same instance id 1), column 4 "user exists, input invalid".
The 16 invalid cases are in one cell. If a 17th error case were added to User,
nothing changes here.
The generalisation that makes the suite writer possible in the first place:
So the writer does not have to guess it, it reads it off:
| Secondary data field | Value | Base state |
|---|---|---|
session | loggedOut | nobody logged in |
existingUser | (empty) | nothing to prepare |
existingUser | ref:1:User::OK_1 | create entity User via the API |
🔵 The reference says both: which entity and which data. What it does not say is the how — which API route creates a user. That lives once per entity in the runner, not in the table. A new entity means one more row, no change to the generator.
ref:1:User::OK_1 in two cells of the same test case yields one user, not
two — the 1 is the instance id. That is exactly how you build "the user already exists":
create it once as the base state, type it in once as input.
Without an instance id (ref::User::OK_1) you get two independent records.
Sometimes the error message is the actual subject of the test — "this email already exists" is something different from "invalid input". That is worth an additional column rather than a branch in an existing one.
To keep the sum right, the subsequent fields in this column get x
on the preferred value and i on the rest: i counts for COUNTA but produces nothing.
That way the column costs no double coverage.
⚪ Additional columns that do not belong to the combinatorics go at the end and out of the sum — and their name should show that.
Fields may be built from other fields, via self-reference in the generator expression.
template and mail are a project's own generators, not in the package — the example
shows the pattern; anyone using it writes them themselves (extend DataGeneratorBase and register it):
firstName | gen::faker:person.firstName
lastName | gen::faker:person.lastName
name | gen::template:{firstName} {lastName}
email | gen::mail:example.com ← builds firstname.lastname@…, guaranteed unique
🔴 A guarantee that never kicks in cannot be told apart from a broken one. If faker draws nothing but distinct names, the uniqueness logic never runs. The test for it must force the collision (fixed names, three calls, three different results).
Data table and test case table are enough as long as an entity has one flow. As soon as there are two (create and edit), the split no longer holds — and you notice too late:
| Sheet | Execute | describes |
|---|---|---|
CompanyCommon | F | what is the same in every country |
CompanyDE · CompanyES | F | the fields of one country, including its legal consequences |
CreateCompanyDE · …ES | T | the execution: base state and cases |
🔴 The base state does NOT belong in the field table, even if it is the same for every case. Writing it there ties the entity to a flow — and with the second flow someone starts over. The execution sheet, on the other hand, is cheap: base state, two or three cases, the rest by reference.
🔵 A data table may reference another data table:
CompanyDE pulls the shared master data from CompanyCommon, and
CreateCompanyDE pulls in CompanyDE. The chain can be arbitrarily deep — only at the top
is there exactly one sheet with Execute = T.
Not "master data versus country data", but: are the equivalence classes the same?
That is why postalCode and timezone move into the country even though they look like master
data — their classes are the same (valid/empty/wrongFormat/…), their
valid values are not. And phone stays shared even though the dialling code
depends on the country: it is not validated, so nothing differs.
💡 How you can tell the split pays off: after separating into shared and country tables, each further country costs only its own columns.
The real reason countries need separate tables is not
the value list of businessType. It is what follows from the choice:
DE legal form × § 19 → bookkeeping type AND document form (2×2 matrix)
ES no § 19 (there is none) → instead: who owns the tax identifier?
Spain has no small-business regime — the German axis does not exist there at all. Instead it has one that DE does not: a company holds its own identifier, a sole trader their personal one (which may be foreign).
⚪ Such cases get their own columns at the end, outside the coverage sum: they do not test another field, but a coincidence of conditions.
If the application assembles a value itself, it belongs in the expectation, not in the primary data — otherwise the table describes an input that does not exist.
Example: the Spanish VAT ID is ES + NIF/CIF, is calculated
and is readOnly in the form. Two fields with their own classes would simply be
wrong there. Germany is the special case, not the norm: there the
VAT ID and the tax number are two different numbers from two authorities.
💡 The question that decides it: Can a human type in this value? If not, it is an effect.
A generator that takes classes[1] breaks the moment someone inserts a
class before it — and does so silently: the reference points to the wrong
class, the range reference disappears, and 32 test cases become 18, without
anything turning red.
Looking up by name gives you an error message on rename instead of a silent data loss.
Execute = F) — the entities the flow needs.With the CASCADE technique, a/e markers are set only on fields that come after the target field in field order. Fields before the target field get only x on the preferred value (as in the happy path).
Each TC covers less than the previous one. The products form a decreasing series:
TC1 (field 1): 1 × 2 × 2 × 2 × 2 = 16 (a/e on fields 2-5)
TC2 (field 2): 1 × 1 × 2 × 2 × 2 = 8 (a/e on fields 3-5)
TC3 (field 3): 1 × 1 × 1 × 2 × 2 = 4 (a/e on fields 4-5)
TC4 (field 4): 1 × 1 × 1 × 1 × 2 = 2 (a/e on field 5)
TC5 (field 5): 1 × 1 × 1 × 1 × 1 = 1 (no field after it)
TC6 (happy): 1 × 1 × 1 × 1 × 1 = 1
──
Sum: 32 = 2^5 = total
Every non-preferred EqClass needs its own error TC. Then the sum of the products equals the total exactly.
Special case: all fields have 2 EqClasses:
total = 2^n (n = number of fields)
sum = 2^(n-1) + 2^(n-2) + ... + 2^0 + 1 = 2^n
General: fields with different EqClass counts (e.g. 3, 2, 2, 2, 3, 3): Works too! Each non-preferred EqClass gives a TC with product:
product(TC) = 1^(fields before) × product(EqClass counts of the fields after)
All products + happy path(1) = total.
Example BillingAddress (3x2x2x2x3x3 = 216):
billingName: empty(72) + whitespace(72) = 144
street: empty(36) = 36
postalCode: empty(18) = 18
city: empty(9) = 9
country: invalid_3chars(3) + empty(3) = 6
customerEmail: invalid(1) + empty(1) = 2
happy: = 1
Sum: 216 = 100%
Every non-happy TC needs a target field (the field it tests). The fields must have a fixed order.
Marker logic per TC:
x on preferred → product = 1x on target EqClass → COUNTA = 1x on preferred → COUNTA = 1a on preferred, e on the rest → COUNTA = nMore readable for humans: error TCs first, valid TCs last. The CASCADE staircase pattern (a/e markers from left to right) becomes visible immediately.
| inv_1 | inv_2 | inv_3 | inv_4 | valid_1
field1 valid | | x | x | x | x
empty | x | | | |
field2 valid | a | | x | x | x
empty | e | x | | |
field3 valid | a | a | | x | x
empty | e | e | x | |
field4 valid | a | a | a | | x
empty | e | e | e | x |
The a/e markers form a triangle — you can see at once whether the pattern is right.
exceljs is 1-based (column 1 = A, row 1 = first row){ formula: '...' }, NOT as a stringnumFmt: '0.00%'row.commit() after changesnotes.md next to this file (not needed for the work)What SKILL.md sets; muted values are Claude Code's defaults
2 skills in this plugin
npx claudepluginhub xhubio/nanook-table --plugin nanookOther plugins' skills for the same job