arey-pi 0.1.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/LICENSE +21 -0
- package/README.md +159 -0
- package/agents/README.md +313 -0
- package/agents/engineering-reviewer.md +78 -0
- package/agents/project-evaluator.md +136 -0
- package/agents/spec-author.md +82 -0
- package/agents/spec-syncer.md +88 -0
- package/agents/tdd-implementer.md +81 -0
- package/agents/tech-lead.md +92 -0
- package/package.json +48 -0
- package/prompts/assess-project.md +38 -0
- package/rules/README.md +57 -0
- package/rules/architecture/adrs.md +257 -0
- package/rules/architecture/architecture-memory.md +55 -0
- package/rules/assessment/project-readiness.md +224 -0
- package/rules/core/change-modes.md +63 -0
- package/rules/core/conflict-resolution.md +56 -0
- package/rules/core/definition-of-done.md +67 -0
- package/rules/core/principles.md +63 -0
- package/rules/engineering/engineering-quality.md +285 -0
- package/rules/engineering/quality-tooling.md +137 -0
- package/rules/engineering/rebuildability.md +49 -0
- package/rules/engineering/tdd.md +86 -0
- package/rules/engineering/test-quality.md +159 -0
- package/rules/specs/canonical-specs.md +62 -0
- package/rules/specs/database-specs.md +142 -0
- package/rules/specs/gherkin-authoring.md +121 -0
- package/rules/specs/language-style.md +106 -0
- package/rules/specs/spec-sync.md +70 -0
- package/rules/workflow/agent-workflows.md +70 -0
- package/rules/workflow/ai-harness.md +177 -0
- package/rules/workflow/incremental-commits.md +88 -0
- package/skills/project-readiness/SKILL.md +96 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Test Quality
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
TDD only works when tests meaningfully constrain behaviour.
|
|
6
|
+
|
|
7
|
+
This policy defines how agents should assess whether generated or modified tests are valuable, behaviour-focused, and capable of catching real regressions.
|
|
8
|
+
|
|
9
|
+
## Core Rule
|
|
10
|
+
|
|
11
|
+
A test is not good because it exists, passes, or increases coverage.
|
|
12
|
+
|
|
13
|
+
A good test fails when the intended behaviour is broken and passes for the right reason when the behaviour is implemented correctly.
|
|
14
|
+
|
|
15
|
+
## Quality Dimensions
|
|
16
|
+
|
|
17
|
+
Agents should assess test quality across these dimensions:
|
|
18
|
+
|
|
19
|
+
1. **Behavioural relevance:** the test validates behaviour that matters to users, domain rules, APIs, CLIs, integrations, or important internal contracts.
|
|
20
|
+
2. **Spec traceability:** the test can be connected to a Gherkin scenario, regression, ADR, or explicit requirement.
|
|
21
|
+
3. **Failure quality:** the test would fail for a meaningful behavioural regression, not only for incidental implementation changes.
|
|
22
|
+
4. **Assertion strength:** the test asserts outcomes, state changes, side effects, errors, or contracts clearly enough to catch wrong implementations.
|
|
23
|
+
5. **Minimal coupling:** the test avoids depending on private implementation details unless intentionally characterizing legacy code before refactor.
|
|
24
|
+
6. **Maintainability:** the test is readable, focused, deterministic, and not overly broad.
|
|
25
|
+
7. **Regression value:** for bug fixes, the test would have failed before the fix.
|
|
26
|
+
|
|
27
|
+
## Coverage
|
|
28
|
+
|
|
29
|
+
Coverage is useful but insufficient.
|
|
30
|
+
|
|
31
|
+
Agents may use coverage to detect untested areas, but they must not treat high coverage as proof of quality.
|
|
32
|
+
|
|
33
|
+
Coverage is most useful for:
|
|
34
|
+
|
|
35
|
+
- identifying unexecuted branches in changed code;
|
|
36
|
+
- finding missing edge case tests;
|
|
37
|
+
- detecting untested error paths;
|
|
38
|
+
- guiding review after refactors or rewrites.
|
|
39
|
+
|
|
40
|
+
Coverage is weak when:
|
|
41
|
+
|
|
42
|
+
- assertions are shallow;
|
|
43
|
+
- tests execute code without validating outcomes;
|
|
44
|
+
- tests only mirror implementation details;
|
|
45
|
+
- generated tests assert mocks rather than behaviour;
|
|
46
|
+
- coverage increases without mutation or failure evidence.
|
|
47
|
+
|
|
48
|
+
## Mutation Testing
|
|
49
|
+
|
|
50
|
+
Mutation testing is the preferred evidence for test strength when practical.
|
|
51
|
+
|
|
52
|
+
A useful test suite should kill meaningful mutants in changed behaviour.
|
|
53
|
+
|
|
54
|
+
Agents should consider mutation testing especially for:
|
|
55
|
+
|
|
56
|
+
- domain rules;
|
|
57
|
+
- validation logic;
|
|
58
|
+
- permissions and security-sensitive code;
|
|
59
|
+
- financial or billing logic;
|
|
60
|
+
- complex conditionals;
|
|
61
|
+
- bug fixes;
|
|
62
|
+
- rewrites;
|
|
63
|
+
- modules intended to be rebuildable from specs/tests.
|
|
64
|
+
|
|
65
|
+
Mutation testing is not required for every tiny change, but Arey Pi should prefer it for critical or high-risk behaviour.
|
|
66
|
+
|
|
67
|
+
## Mutation Score
|
|
68
|
+
|
|
69
|
+
Mutation score thresholds are project-specific, but agents should report mutation results when available.
|
|
70
|
+
|
|
71
|
+
Suggested defaults:
|
|
72
|
+
|
|
73
|
+
- **Critical domain/security logic:** 90%+ mutation score for touched code, or explicit justification.
|
|
74
|
+
- **Normal behaviour changes:** 75%+ mutation score for touched code, or explicit justification.
|
|
75
|
+
- **Exploratory/legacy characterization:** no fixed score, but surviving meaningful mutants should be reviewed.
|
|
76
|
+
|
|
77
|
+
The score alone is not enough. Surviving mutants must be triaged for whether they represent real test gaps, equivalent mutants, or irrelevant implementation details.
|
|
78
|
+
|
|
79
|
+
## Surviving Mutants
|
|
80
|
+
|
|
81
|
+
When mutation testing finds surviving mutants, agents should classify them as:
|
|
82
|
+
|
|
83
|
+
- **test gap:** add or strengthen tests;
|
|
84
|
+
- **equivalent mutant:** behaviour is unchanged, document why;
|
|
85
|
+
- **irrelevant mutant:** not tied to durable behaviour, document why;
|
|
86
|
+
- **spec gap:** update Gherkin/specs because intended behaviour is unclear;
|
|
87
|
+
- **design smell:** implementation is too hard to specify or validate.
|
|
88
|
+
|
|
89
|
+
Do not ignore surviving mutants silently.
|
|
90
|
+
|
|
91
|
+
## Generated Test Review
|
|
92
|
+
|
|
93
|
+
Generated tests require extra scrutiny.
|
|
94
|
+
|
|
95
|
+
Agents must reject or improve tests that:
|
|
96
|
+
|
|
97
|
+
- only assert that a function was called;
|
|
98
|
+
- duplicate implementation logic instead of asserting behaviour;
|
|
99
|
+
- snapshot large outputs without explaining what matters;
|
|
100
|
+
- depend on arbitrary timing;
|
|
101
|
+
- over-mock collaborators so the real contract is not exercised;
|
|
102
|
+
- assert private structure instead of observable behaviour;
|
|
103
|
+
- pass even if important logic is removed;
|
|
104
|
+
- lack a clear connection to a spec, bug, or requirement.
|
|
105
|
+
|
|
106
|
+
## Negative and Edge Cases
|
|
107
|
+
|
|
108
|
+
For behaviour changes, agents should consider whether tests cover:
|
|
109
|
+
|
|
110
|
+
- happy path;
|
|
111
|
+
- invalid input;
|
|
112
|
+
- boundary values;
|
|
113
|
+
- missing permissions;
|
|
114
|
+
- error handling;
|
|
115
|
+
- idempotency or repeated actions;
|
|
116
|
+
- persistence/integration side effects;
|
|
117
|
+
- backwards compatibility where relevant.
|
|
118
|
+
|
|
119
|
+
Not every change needs all categories, but omitted important categories should be intentional.
|
|
120
|
+
|
|
121
|
+
## Test Review Heuristic
|
|
122
|
+
|
|
123
|
+
Before accepting a test, ask:
|
|
124
|
+
|
|
125
|
+
> If I intentionally broke the behaviour in the simplest realistic way, would this test fail?
|
|
126
|
+
|
|
127
|
+
If the answer is no, the test is probably weak.
|
|
128
|
+
|
|
129
|
+
## Required Evidence
|
|
130
|
+
|
|
131
|
+
For non-trivial production changes, agents should report:
|
|
132
|
+
|
|
133
|
+
- tests added or modified;
|
|
134
|
+
- related Gherkin scenarios or requirements;
|
|
135
|
+
- Red evidence;
|
|
136
|
+
- Green evidence;
|
|
137
|
+
- coverage results when run;
|
|
138
|
+
- mutation testing results when run;
|
|
139
|
+
- surviving mutants and their classification;
|
|
140
|
+
- test quality concerns or residual risks.
|
|
141
|
+
|
|
142
|
+
## When Mutation Testing Is Not Available
|
|
143
|
+
|
|
144
|
+
If mutation testing is not configured or practical, agents should report that explicitly and use alternative evidence:
|
|
145
|
+
|
|
146
|
+
- focused manual test review;
|
|
147
|
+
- branch/line coverage for touched code;
|
|
148
|
+
- deliberate failure checks;
|
|
149
|
+
- regression reproduction;
|
|
150
|
+
- edge case analysis;
|
|
151
|
+
- reviewer validation.
|
|
152
|
+
|
|
153
|
+
This should be reported as weaker evidence than mutation testing.
|
|
154
|
+
|
|
155
|
+
## Acceptance Rule
|
|
156
|
+
|
|
157
|
+
A change with weak tests is not complete merely because tests pass.
|
|
158
|
+
|
|
159
|
+
If tests do not meaningfully protect the intended behaviour, agents must strengthen them, report the gap as a blocker, or ask for approval to proceed with residual risk.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Canonical Specs
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Canonical specs are the source of truth for intended project behaviour and durable project knowledge.
|
|
6
|
+
|
|
7
|
+
They are not secondary documentation. They are the contract that allows the implementation to be safely changed, discarded, or rebuilt.
|
|
8
|
+
|
|
9
|
+
## Canonical Sources
|
|
10
|
+
|
|
11
|
+
Arey Pi recognises these canonical sources:
|
|
12
|
+
|
|
13
|
+
| Source | Purpose |
|
|
14
|
+
| --- | --- |
|
|
15
|
+
| Gherkin feature specs | Observable behaviour, workflows, business rules, API/CLI contracts, important edge cases |
|
|
16
|
+
| Tests | Executable verification of the specs and regression protection |
|
|
17
|
+
| Architecture docs | System boundaries, constraints, major components, integration models |
|
|
18
|
+
| DBML database specs | Canonical database structure for projects with persistent storage |
|
|
19
|
+
| ADRs | Important technical decisions, tradeoffs, accepted consequences |
|
|
20
|
+
| Glossary | Domain language, concepts, meanings, aliases, and forbidden terms |
|
|
21
|
+
| Project rules | Non-negotiable engineering policies and local conventions |
|
|
22
|
+
|
|
23
|
+
## Authority
|
|
24
|
+
|
|
25
|
+
Canonical specs define intended behaviour by default.
|
|
26
|
+
|
|
27
|
+
If existing code disagrees with canonical specs, agents must not assume the code is correct. They must either:
|
|
28
|
+
|
|
29
|
+
- align the implementation with the specs;
|
|
30
|
+
- update the specs if the user explicitly approves the new behaviour;
|
|
31
|
+
- or stop and ask for clarification when intent is unclear.
|
|
32
|
+
|
|
33
|
+
## Required Persistence
|
|
34
|
+
|
|
35
|
+
A behaviour, rule, decision, or constraint should be persisted canonically when it is:
|
|
36
|
+
|
|
37
|
+
- user-visible;
|
|
38
|
+
- externally observable;
|
|
39
|
+
- part of a public or internal contract;
|
|
40
|
+
- a business or domain rule;
|
|
41
|
+
- relevant to validation, permissions, errors, security, or persistence;
|
|
42
|
+
- important for future rebuilds;
|
|
43
|
+
- likely to surprise future implementers;
|
|
44
|
+
- needed to understand why the system is shaped a certain way.
|
|
45
|
+
|
|
46
|
+
## Non-Canonical Knowledge
|
|
47
|
+
|
|
48
|
+
The following are not sufficient as durable sources of truth by themselves:
|
|
49
|
+
|
|
50
|
+
- implementation code;
|
|
51
|
+
- inline comments;
|
|
52
|
+
- chat history;
|
|
53
|
+
- temporary plans;
|
|
54
|
+
- stale README prose;
|
|
55
|
+
- agent assumptions;
|
|
56
|
+
- inferred behaviour from current implementation.
|
|
57
|
+
|
|
58
|
+
They may inform updates, but durable knowledge must be promoted into canonical specs, tests, DBML database specs, ADRs, architecture docs, or glossary entries.
|
|
59
|
+
|
|
60
|
+
## Acceptance Rule
|
|
61
|
+
|
|
62
|
+
A change is not complete until canonical specs are either updated or explicitly confirmed unaffected.
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Database Specs
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Projects with a database must persist their data model as a canonical spec.
|
|
6
|
+
|
|
7
|
+
Arey Pi uses DBML as the default canonical format for database structure because it is readable, diffable, tool-friendly, and independent of a specific ORM or migration tool.
|
|
8
|
+
|
|
9
|
+
## Core Rule
|
|
10
|
+
|
|
11
|
+
If a project has a database, it must have a DBML spec that is kept precisely synchronised with the real database model.
|
|
12
|
+
|
|
13
|
+
The DBML spec is not optional documentation. It is a canonical source of truth for the intended database schema and must be maintained with the same care as Gherkin behaviour specs, tests, ADRs, and architecture docs.
|
|
14
|
+
|
|
15
|
+
## Default Location
|
|
16
|
+
|
|
17
|
+
The default location is:
|
|
18
|
+
|
|
19
|
+
```txt
|
|
20
|
+
specs/database/schema.dbml
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Large systems may split DBML by bounded context or database, for example:
|
|
24
|
+
|
|
25
|
+
```txt
|
|
26
|
+
specs/database/main.dbml
|
|
27
|
+
specs/database/analytics.dbml
|
|
28
|
+
specs/database/billing.dbml
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If multiple files are used, the project must document how they relate to deployed databases, schemas, services, or bounded contexts.
|
|
32
|
+
|
|
33
|
+
## What Belongs in DBML
|
|
34
|
+
|
|
35
|
+
DBML should describe the durable intended database structure, including:
|
|
36
|
+
|
|
37
|
+
- tables;
|
|
38
|
+
- columns;
|
|
39
|
+
- data types;
|
|
40
|
+
- nullability;
|
|
41
|
+
- primary keys;
|
|
42
|
+
- foreign keys;
|
|
43
|
+
- unique constraints;
|
|
44
|
+
- indexes when behaviourally or operationally relevant;
|
|
45
|
+
- enums or constrained values where applicable;
|
|
46
|
+
- join tables;
|
|
47
|
+
- relationship cardinality;
|
|
48
|
+
- important column notes;
|
|
49
|
+
- table ownership or bounded context notes where useful.
|
|
50
|
+
|
|
51
|
+
## What Does Not Belong in DBML
|
|
52
|
+
|
|
53
|
+
Avoid encoding incidental implementation details that are not part of the durable data model, such as:
|
|
54
|
+
|
|
55
|
+
- temporary migration mechanics;
|
|
56
|
+
- one-off backfill scripts;
|
|
57
|
+
- ORM-only helper fields that do not exist in storage;
|
|
58
|
+
- environment-specific physical tuning unless it is a durable constraint;
|
|
59
|
+
- generated naming noise that does not clarify the model.
|
|
60
|
+
|
|
61
|
+
## Synchronisation Rule
|
|
62
|
+
|
|
63
|
+
Every database-affecting change must update DBML in the same change set.
|
|
64
|
+
|
|
65
|
+
This includes changes to:
|
|
66
|
+
|
|
67
|
+
- migrations;
|
|
68
|
+
- ORM models;
|
|
69
|
+
- schema definitions;
|
|
70
|
+
- SQL DDL;
|
|
71
|
+
- persistence code that implies a schema change;
|
|
72
|
+
- indexes or constraints;
|
|
73
|
+
- relationship cardinality;
|
|
74
|
+
- enum values;
|
|
75
|
+
- data ownership boundaries;
|
|
76
|
+
- soft-delete, audit, tenancy, or versioning fields;
|
|
77
|
+
- database-specific behaviour that affects product or operational guarantees.
|
|
78
|
+
|
|
79
|
+
If a change touches persistence code but does not alter the schema, agents must explicitly state that the DBML spec is unaffected and why.
|
|
80
|
+
|
|
81
|
+
## Precision Requirement
|
|
82
|
+
|
|
83
|
+
DBML must be synchronised to the millimetre.
|
|
84
|
+
|
|
85
|
+
Agents must not leave approximate, stale, partial, or aspirational database specs. The DBML should match the intended schema represented by migrations and deployed database contracts.
|
|
86
|
+
|
|
87
|
+
If the current database, migrations, ORM models, and DBML disagree, agents must report the drift and ask for clarification unless the intended source of truth is explicit.
|
|
88
|
+
|
|
89
|
+
## Relationship to Migrations
|
|
90
|
+
|
|
91
|
+
Migrations are executable change history. DBML is the canonical current model.
|
|
92
|
+
|
|
93
|
+
Both matter:
|
|
94
|
+
|
|
95
|
+
- migrations explain how the database changes over time;
|
|
96
|
+
- DBML explains what the database is intended to look like now.
|
|
97
|
+
|
|
98
|
+
A migration-only schema change is not complete without DBML synchronisation.
|
|
99
|
+
|
|
100
|
+
## Relationship to Gherkin
|
|
101
|
+
|
|
102
|
+
Gherkin describes observable behaviour. DBML describes persistent data structure.
|
|
103
|
+
|
|
104
|
+
When a behaviour change introduces or changes persisted concepts, agents should update both:
|
|
105
|
+
|
|
106
|
+
- Gherkin for the behaviour;
|
|
107
|
+
- DBML for the data model;
|
|
108
|
+
- glossary for domain terminology;
|
|
109
|
+
- ADR/architecture docs for non-trivial data decisions.
|
|
110
|
+
|
|
111
|
+
## Validation
|
|
112
|
+
|
|
113
|
+
When tooling exists, agents should validate DBML using the project's chosen DBML tooling or generated diagrams/checks.
|
|
114
|
+
|
|
115
|
+
When DBML validation tooling is absent, agents should still review the DBML manually and recommend adding tooling if database work is significant.
|
|
116
|
+
|
|
117
|
+
Possible validation includes:
|
|
118
|
+
|
|
119
|
+
- DBML parser/check command;
|
|
120
|
+
- diagram generation;
|
|
121
|
+
- comparison against ORM schema;
|
|
122
|
+
- comparison against migration output;
|
|
123
|
+
- database introspection in safe environments;
|
|
124
|
+
- review by a database-aware agent or human.
|
|
125
|
+
|
|
126
|
+
## Agent Behaviour
|
|
127
|
+
|
|
128
|
+
Before completing database-related work, agents must inspect relevant DBML specs when they exist.
|
|
129
|
+
|
|
130
|
+
If database code exists but DBML specs are missing, agents must surface the gap and propose adding DBML. For database-affecting work, adding the initial DBML spec should be treated as part of making the project Arey Pi-aligned unless the user explicitly defers it.
|
|
131
|
+
|
|
132
|
+
Agents must not silently make schema changes without DBML synchronisation.
|
|
133
|
+
|
|
134
|
+
## Acceptance Rule
|
|
135
|
+
|
|
136
|
+
A database-affecting change is not done until:
|
|
137
|
+
|
|
138
|
+
- DBML exists for the affected database;
|
|
139
|
+
- DBML reflects the intended schema precisely;
|
|
140
|
+
- migrations/schema/ORM/database code and DBML agree;
|
|
141
|
+
- relevant Gherkin, glossary, ADRs, and architecture docs are updated when the data model change affects behaviour or durable design;
|
|
142
|
+
- DBML validation has run or limitations are reported.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Gherkin Authoring
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Gherkin feature specs persist canonical behaviour in a format that is readable by humans, usable by agents, and traceable to tests.
|
|
6
|
+
|
|
7
|
+
Gherkin is the default format for functional and behavioural specs.
|
|
8
|
+
|
|
9
|
+
## Location
|
|
10
|
+
|
|
11
|
+
Canonical Gherkin specs live under:
|
|
12
|
+
|
|
13
|
+
```txt
|
|
14
|
+
specs/features/
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Recommended organisation is by domain or capability:
|
|
18
|
+
|
|
19
|
+
```txt
|
|
20
|
+
specs/features/auth/login.feature
|
|
21
|
+
specs/features/billing/subscription.feature
|
|
22
|
+
specs/features/api/users.feature
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## What Belongs in Gherkin
|
|
26
|
+
|
|
27
|
+
Use Gherkin for:
|
|
28
|
+
|
|
29
|
+
- user-visible behaviour;
|
|
30
|
+
- business rules;
|
|
31
|
+
- domain workflows;
|
|
32
|
+
- API behaviour;
|
|
33
|
+
- CLI behaviour;
|
|
34
|
+
- validation rules;
|
|
35
|
+
- permission rules;
|
|
36
|
+
- error states;
|
|
37
|
+
- externally observable side effects;
|
|
38
|
+
- important edge cases;
|
|
39
|
+
- bug regressions when they clarify intended behaviour.
|
|
40
|
+
|
|
41
|
+
## What Does Not Belong in Gherkin
|
|
42
|
+
|
|
43
|
+
Avoid encoding incidental implementation details such as:
|
|
44
|
+
|
|
45
|
+
- class names;
|
|
46
|
+
- private function names;
|
|
47
|
+
- internal file structure;
|
|
48
|
+
- database queries unless externally contractual;
|
|
49
|
+
- framework mechanics;
|
|
50
|
+
- low-level algorithms unless they are part of the domain contract;
|
|
51
|
+
- temporary implementation workarounds.
|
|
52
|
+
|
|
53
|
+
## Style
|
|
54
|
+
|
|
55
|
+
Gherkin should be written in domain language.
|
|
56
|
+
|
|
57
|
+
Gherkin specs must use semantic line breaks.
|
|
58
|
+
Each step should express one clear condition, action, outcome, or coherent idea.
|
|
59
|
+
Avoid long multi-clause steps when separate semantic steps would be clearer.
|
|
60
|
+
|
|
61
|
+
Prefer clear behavioural structure:
|
|
62
|
+
|
|
63
|
+
```gherkin
|
|
64
|
+
Feature: Account login
|
|
65
|
+
|
|
66
|
+
Rule: Registered users can authenticate with valid credentials
|
|
67
|
+
|
|
68
|
+
Scenario: Successful login with valid credentials
|
|
69
|
+
Given a registered user exists
|
|
70
|
+
When the user submits valid credentials
|
|
71
|
+
Then the system creates an authenticated session
|
|
72
|
+
And the user can access their account
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Use `Rule` when it makes business rules clearer. Use `Scenario Outline` when examples express the rule better than prose.
|
|
76
|
+
|
|
77
|
+
## Scenario Quality
|
|
78
|
+
|
|
79
|
+
A good scenario is:
|
|
80
|
+
|
|
81
|
+
- observable;
|
|
82
|
+
- testable;
|
|
83
|
+
- specific;
|
|
84
|
+
- written in business/domain language;
|
|
85
|
+
- focused on one behaviour or rule;
|
|
86
|
+
- free of incidental implementation detail.
|
|
87
|
+
|
|
88
|
+
A scenario should be easy to map to one or more tests.
|
|
89
|
+
|
|
90
|
+
## Coverage Expectations
|
|
91
|
+
|
|
92
|
+
Feature specs should normally include:
|
|
93
|
+
|
|
94
|
+
- a happy path;
|
|
95
|
+
- relevant failure paths;
|
|
96
|
+
- important edge cases;
|
|
97
|
+
- permission or validation boundaries when applicable.
|
|
98
|
+
|
|
99
|
+
Do not add scenarios only for quantity. Each scenario should clarify intended behaviour.
|
|
100
|
+
|
|
101
|
+
## Traceability
|
|
102
|
+
|
|
103
|
+
Tests should reference related features/scenarios where practical.
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
// Feature: Account login
|
|
109
|
+
// Scenario: Successful login with valid credentials
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
or equivalent test naming.
|
|
113
|
+
|
|
114
|
+
## Update Rule
|
|
115
|
+
|
|
116
|
+
Every observable behaviour change must either:
|
|
117
|
+
|
|
118
|
+
1. add a Gherkin scenario;
|
|
119
|
+
2. update an existing scenario;
|
|
120
|
+
3. explicitly state that existing scenarios already cover the behaviour;
|
|
121
|
+
4. stop for clarification if the change conflicts with existing Gherkin.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Language Style
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Arey Pi projects should communicate in the language style expected by their users, customers, and maintainers.
|
|
6
|
+
|
|
7
|
+
For Arey Pi, the default written English standard is UK English.
|
|
8
|
+
|
|
9
|
+
## Core Rule
|
|
10
|
+
|
|
11
|
+
Use UK English for all project-facing writing unless the project explicitly defines a different language standard.
|
|
12
|
+
|
|
13
|
+
This applies to:
|
|
14
|
+
|
|
15
|
+
- Gherkin specs;
|
|
16
|
+
- DBML notes and database spec prose;
|
|
17
|
+
- documentation;
|
|
18
|
+
- ADRs;
|
|
19
|
+
- glossary entries;
|
|
20
|
+
- README files;
|
|
21
|
+
- AGENTS.md and AI harness instructions;
|
|
22
|
+
- skills and prompts;
|
|
23
|
+
- user-facing messages;
|
|
24
|
+
- error messages;
|
|
25
|
+
- comments intended to explain durable behaviour;
|
|
26
|
+
- agent summaries and reports.
|
|
27
|
+
|
|
28
|
+
## Semantic Line Breaks
|
|
29
|
+
|
|
30
|
+
Specs must always use semantic line breaks.
|
|
31
|
+
|
|
32
|
+
This applies especially to:
|
|
33
|
+
|
|
34
|
+
- Gherkin feature files;
|
|
35
|
+
- DBML notes and documentation comments;
|
|
36
|
+
- ADRs;
|
|
37
|
+
- architecture docs;
|
|
38
|
+
- glossary entries;
|
|
39
|
+
- Markdown specs and project rules.
|
|
40
|
+
|
|
41
|
+
Use one sentence, clause, or coherent idea per line where practical.
|
|
42
|
+
Break lines at semantic boundaries rather than arbitrary wrapping widths.
|
|
43
|
+
|
|
44
|
+
Semantic line breaks improve:
|
|
45
|
+
|
|
46
|
+
- git diffs;
|
|
47
|
+
- code review;
|
|
48
|
+
- agent edits;
|
|
49
|
+
- proofreading;
|
|
50
|
+
- localisation;
|
|
51
|
+
- focused updates to canonical specs.
|
|
52
|
+
|
|
53
|
+
Do not reflow entire documents just for formatting unless requested.
|
|
54
|
+
When editing specs or docs, preserve or improve semantic line breaks in the touched sections.
|
|
55
|
+
|
|
56
|
+
## UK English Expectations
|
|
57
|
+
|
|
58
|
+
Prefer UK spellings and phrasing.
|
|
59
|
+
For example, use:
|
|
60
|
+
|
|
61
|
+
- behaviour, not the US spelling `behavior`;
|
|
62
|
+
- colour, not the US spelling `color`;
|
|
63
|
+
- organise, not the US spelling `organize`;
|
|
64
|
+
- analyse, not the US spelling `analyze`;
|
|
65
|
+
- centre, not the US spelling `center`;
|
|
66
|
+
- licence as a noun in British usage, and license as a verb;
|
|
67
|
+
- modelling, not the US spelling `modeling`.
|
|
68
|
+
|
|
69
|
+
Agents should be consistent within a project and should not mix US and UK spelling casually.
|
|
70
|
+
|
|
71
|
+
## Exceptions
|
|
72
|
+
|
|
73
|
+
Do not rewrite language when it would break or distort:
|
|
74
|
+
|
|
75
|
+
- code identifiers;
|
|
76
|
+
- public APIs;
|
|
77
|
+
- package names;
|
|
78
|
+
- external protocol names;
|
|
79
|
+
- quoted material;
|
|
80
|
+
- third-party documentation references;
|
|
81
|
+
- generated code where spelling is dictated by tooling;
|
|
82
|
+
- established domain terms used by the customer.
|
|
83
|
+
|
|
84
|
+
If an existing codebase uses US spelling in identifiers or APIs, preserve compatibility.
|
|
85
|
+
Prefer UK English in prose around it.
|
|
86
|
+
|
|
87
|
+
## Gherkin and Product Text
|
|
88
|
+
|
|
89
|
+
Gherkin specs should use UK English unless the product or domain requires a different spelling.
|
|
90
|
+
|
|
91
|
+
Because specs are customer-facing durable knowledge, agents should treat language consistency and semantic line breaks as part of spec quality.
|
|
92
|
+
|
|
93
|
+
## Agent Behaviour
|
|
94
|
+
|
|
95
|
+
Agents should write final answers, reports, docs, specs, and project instructions in UK English by default.
|
|
96
|
+
|
|
97
|
+
When editing existing prose, agents should avoid large spelling-only rewrites unless requested.
|
|
98
|
+
For touched text, prefer UK English, preserve semantic line breaks, and flag widespread inconsistency as a follow-up.
|
|
99
|
+
|
|
100
|
+
## Acceptance Rule
|
|
101
|
+
|
|
102
|
+
Project-facing prose is not fully polished if it mixes UK and US English without a reason.
|
|
103
|
+
|
|
104
|
+
Specs are not style-compliant if they do not use semantic line breaks.
|
|
105
|
+
|
|
106
|
+
For important specs, docs, prompts, and harness instructions, language style consistency and semantic line breaks are part of quality review.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Spec Sync
|
|
2
|
+
|
|
3
|
+
## Purpose
|
|
4
|
+
|
|
5
|
+
Spec sync guarantees that specs, tests, and code agree at the end of every task.
|
|
6
|
+
|
|
7
|
+
It applies whether the work started with Spec-Driven Mode or Direct Change Mode.
|
|
8
|
+
|
|
9
|
+
## Core Rule
|
|
10
|
+
|
|
11
|
+
Every completed change must end with canonical specs synchronised or explicitly confirmed unaffected.
|
|
12
|
+
|
|
13
|
+
The final result must be one of:
|
|
14
|
+
|
|
15
|
+
```txt
|
|
16
|
+
Specs updated
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
or:
|
|
20
|
+
|
|
21
|
+
```txt
|
|
22
|
+
Specs unaffected: <reason>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Sync Dimensions
|
|
26
|
+
|
|
27
|
+
At task completion, agents must consider each canonical dimension:
|
|
28
|
+
|
|
29
|
+
- **Gherkin:** Did observable behaviour, API/CLI contracts, rules, errors, permissions, or edge cases change?
|
|
30
|
+
- **Tests:** Do tests represent the intended behaviour and trace to relevant specs where practical?
|
|
31
|
+
- **Architecture:** Did boundaries, dependencies, storage, integrations, or system constraints change?
|
|
32
|
+
- **Database/DBML:** Did migrations, ORM models, SQL DDL, schema definitions, indexes, constraints, relationships, or persistence contracts change?
|
|
33
|
+
- **ADRs:** Was a meaningful technical decision made that future agents/developers need to understand, and is it important enough for a high-quality ADR rather than process noise?
|
|
34
|
+
- **Glossary:** Was a new domain term introduced or an existing meaning changed?
|
|
35
|
+
|
|
36
|
+
## Required Behaviour
|
|
37
|
+
|
|
38
|
+
If behaviour changed, update Gherkin.
|
|
39
|
+
|
|
40
|
+
If architecture changed, update architecture docs or create/update a high-quality ADR when the decision has durable impact.
|
|
41
|
+
|
|
42
|
+
If database structure changed, update the canonical DBML spec precisely.
|
|
43
|
+
|
|
44
|
+
If durable domain language changed, update the glossary.
|
|
45
|
+
|
|
46
|
+
If only implementation changed and behaviour stayed the same, explain why specs are unaffected and name the coverage relied on where practical.
|
|
47
|
+
|
|
48
|
+
## Conflict Handling
|
|
49
|
+
|
|
50
|
+
If specs, tests, and code disagree, agents must not silently pick the current implementation.
|
|
51
|
+
|
|
52
|
+
They must resolve the disagreement by:
|
|
53
|
+
|
|
54
|
+
- implementing the canonical spec;
|
|
55
|
+
- updating the spec with explicit user approval;
|
|
56
|
+
- or stopping for clarification.
|
|
57
|
+
|
|
58
|
+
## Final Report Format
|
|
59
|
+
|
|
60
|
+
Agents should close with a compact sync report:
|
|
61
|
+
|
|
62
|
+
```txt
|
|
63
|
+
Spec sync:
|
|
64
|
+
- Gherkin:
|
|
65
|
+
- Tests:
|
|
66
|
+
- Architecture/ADR:
|
|
67
|
+
- Database/DBML:
|
|
68
|
+
- Glossary:
|
|
69
|
+
- Status:
|
|
70
|
+
```
|