@mrciphersmith/keryx 0.4.29 → 0.4.30
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/dist/cli.js +2408 -1369
- package/dist/core.js +90 -27
- package/dist/keryx-general-worker-entry.js +82 -25
- package/package.json +1 -1
- package/src/gdskills/bundled/install-manifest.json +2 -0
- package/src/gdskills/bundled/rules/core/api-contracts.mdc +21 -136
- package/src/gdskills/bundled/rules/core/async-patterns.mdc +18 -171
- package/src/gdskills/bundled/rules/core/clean-architecture.mdc +21 -3
- package/src/gdskills/bundled/rules/core/cli-interface-design.mdc +63 -194
- package/src/gdskills/bundled/rules/core/code-style-patterns.mdc +36 -49
- package/src/gdskills/bundled/rules/core/concurrency-patterns.mdc +32 -0
- package/src/gdskills/bundled/rules/core/database-patterns.mdc +26 -148
- package/src/gdskills/bundled/rules/core/error-handling.mdc +7 -8
- package/src/gdskills/bundled/rules/core/frontend-assistant.mdc +14 -29
- package/src/gdskills/bundled/rules/core/layout-rendering.mdc +51 -0
- package/src/gdskills/bundled/rules/core/mobx-store-template.mdc +69 -511
- package/src/gdskills/bundled/rules/core/nestjs-dto.mdc +18 -36
- package/src/gdskills/bundled/rules/core/playwright-testing.mdc +35 -308
- package/src/gdskills/bundled/rules/core/security-baseline.mdc +18 -140
- package/src/gdskills/bundled/rules/core/solid-principles.mdc +31 -7
- package/src/gdskills/bundled/rules/core/storybook-guidelines.mdc +20 -22
- package/src/gdskills/bundled/rules/core/tdd-workflow.mdc +37 -74
- package/src/gdskills/bundled/rules/core/ui-anti-slop.mdc +48 -37
- package/src/gdskills/bundled/skills/quality/deprecation-path/SKILL.md +1 -1
- package/src/gdskills/bundled/skills/review/review-architecture/SKILL.md +24 -60
- package/src/gdskills/bundled/skills/review/review-backend/SKILL.md +13 -65
- package/src/gdskills/bundled/skills/review/review-clean-code/SKILL.md +22 -35
- package/src/gdskills/bundled/skills/review/review-frontend/SKILL.md +16 -309
- package/src/gdskills/bundled/skills/review/review-frontend-conventions/SKILL.md +7 -21
- package/src/gdskills/bundled/skills/review/review-highload/SKILL.md +83 -227
- package/src/gdskills/bundled/skills/review/review-layout/SKILL.md +22 -28
- package/src/gdskills/bundled/skills/review/review-logic/SKILL.md +8 -8
- package/src/gdskills/bundled/skills/review/review-performance/SKILL.md +15 -37
- package/src/gdskills/bundled/skills/review/review-security-code/SKILL.md +7 -7
- package/src/gdskills/bundled/skills/review/review-style/SKILL.md +31 -66
- package/src/gdskills/bundled/skills/review/review-testing-practices/SKILL.md +21 -39
- package/src/gdskills/bundled/skills/review/review-ui-ux/SKILL.md +42 -82
- package/src/gdskills/bundled/stacks/angular/rules/coding-style.mdc +15 -57
- package/src/gdskills/bundled/stacks/angular/rules/patterns.mdc +16 -60
- package/src/gdskills/bundled/stacks/angular/rules/security.mdc +11 -49
- package/src/gdskills/bundled/stacks/angular/rules/testing.mdc +13 -52
- package/src/gdskills/bundled/stacks/c-cpp/rules/coding-style.mdc +33 -57
- package/src/gdskills/bundled/stacks/c-cpp/rules/patterns.mdc +35 -62
- package/src/gdskills/bundled/stacks/c-cpp/rules/security.mdc +35 -62
- package/src/gdskills/bundled/stacks/c-cpp/rules/testing.mdc +34 -54
- package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/patterns.mdc +27 -56
- package/src/gdskills/bundled/stacks/ci-github-gitlab/rules/security.mdc +51 -119
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/coding-style.mdc +42 -74
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/patterns.mdc +45 -84
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/security.mdc +34 -59
- package/src/gdskills/bundled/stacks/csharp-dotnet/rules/testing.mdc +33 -62
- package/src/gdskills/bundled/stacks/django/rules/coding-style.mdc +15 -56
- package/src/gdskills/bundled/stacks/django/rules/patterns.mdc +16 -68
- package/src/gdskills/bundled/stacks/django/rules/security.mdc +13 -71
- package/src/gdskills/bundled/stacks/django/rules/testing.mdc +16 -62
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/coding-style.mdc +30 -53
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/patterns.mdc +20 -56
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/security.mdc +52 -122
- package/src/gdskills/bundled/stacks/docker-k8s-terraform/rules/testing.mdc +23 -42
- package/src/gdskills/bundled/stacks/fastapi/rules/coding-style.mdc +13 -47
- package/src/gdskills/bundled/stacks/fastapi/rules/patterns.mdc +18 -81
- package/src/gdskills/bundled/stacks/fastapi/rules/security.mdc +13 -75
- package/src/gdskills/bundled/stacks/fastapi/rules/testing.mdc +14 -58
- package/src/gdskills/bundled/stacks/flutter-dart/rules/coding-style.mdc +36 -74
- package/src/gdskills/bundled/stacks/flutter-dart/rules/patterns.mdc +30 -66
- package/src/gdskills/bundled/stacks/flutter-dart/rules/security.mdc +33 -67
- package/src/gdskills/bundled/stacks/flutter-dart/rules/testing.mdc +41 -73
- package/src/gdskills/bundled/stacks/go/rules/coding-style.mdc +36 -57
- package/src/gdskills/bundled/stacks/go/rules/patterns.mdc +27 -42
- package/src/gdskills/bundled/stacks/go/rules/security.mdc +26 -43
- package/src/gdskills/bundled/stacks/go/rules/testing.mdc +23 -41
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/coding-style.mdc +18 -37
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/patterns.mdc +26 -43
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/security.mdc +25 -37
- package/src/gdskills/bundled/stacks/java-kotlin-spring/rules/testing.mdc +34 -50
- package/src/gdskills/bundled/stacks/kotlin-android/rules/coding-style.mdc +28 -65
- package/src/gdskills/bundled/stacks/kotlin-android/rules/patterns.mdc +34 -78
- package/src/gdskills/bundled/stacks/kotlin-android/rules/security.mdc +35 -68
- package/src/gdskills/bundled/stacks/kotlin-android/rules/testing.mdc +34 -68
- package/src/gdskills/bundled/stacks/mobx/rules/coding-style.mdc +18 -64
- package/src/gdskills/bundled/stacks/mobx/rules/patterns.mdc +13 -66
- package/src/gdskills/bundled/stacks/mobx/rules/security.mdc +8 -35
- package/src/gdskills/bundled/stacks/mobx/rules/testing.mdc +10 -39
- package/src/gdskills/bundled/stacks/nestjs/rules/coding-style.mdc +32 -45
- package/src/gdskills/bundled/stacks/nestjs/rules/patterns.mdc +40 -60
- package/src/gdskills/bundled/stacks/nestjs/rules/security.mdc +30 -50
- package/src/gdskills/bundled/stacks/nestjs/rules/testing.mdc +27 -47
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/coding-style.mdc +14 -48
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/patterns.mdc +15 -67
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/security.mdc +12 -50
- package/src/gdskills/bundled/stacks/nextjs-nuxt/rules/testing.mdc +11 -43
- package/src/gdskills/bundled/stacks/php-laravel/rules/coding-style.mdc +17 -58
- package/src/gdskills/bundled/stacks/php-laravel/rules/patterns.mdc +15 -56
- package/src/gdskills/bundled/stacks/php-laravel/rules/security.mdc +13 -50
- package/src/gdskills/bundled/stacks/php-laravel/rules/testing.mdc +14 -55
- package/src/gdskills/bundled/stacks/python/rules/coding-style.mdc +13 -41
- package/src/gdskills/bundled/stacks/python/rules/patterns.mdc +20 -61
- package/src/gdskills/bundled/stacks/python/rules/security.mdc +15 -57
- package/src/gdskills/bundled/stacks/python/rules/testing.mdc +16 -50
- package/src/gdskills/bundled/stacks/react/rules/coding-style.mdc +14 -40
- package/src/gdskills/bundled/stacks/react/rules/patterns.mdc +15 -55
- package/src/gdskills/bundled/stacks/react/rules/security.mdc +13 -49
- package/src/gdskills/bundled/stacks/react/rules/testing.mdc +10 -37
- package/src/gdskills/bundled/stacks/ruby-rails/rules/coding-style.mdc +12 -45
- package/src/gdskills/bundled/stacks/ruby-rails/rules/patterns.mdc +18 -67
- package/src/gdskills/bundled/stacks/ruby-rails/rules/security.mdc +11 -60
- package/src/gdskills/bundled/stacks/ruby-rails/rules/testing.mdc +14 -65
- package/src/gdskills/bundled/stacks/rust/rules/coding-style.mdc +39 -65
- package/src/gdskills/bundled/stacks/rust/rules/patterns.mdc +33 -60
- package/src/gdskills/bundled/stacks/rust/rules/security.mdc +35 -57
- package/src/gdskills/bundled/stacks/rust/rules/testing.mdc +29 -52
- package/src/gdskills/bundled/stacks/sql-db/rules/coding-style.mdc +12 -48
- package/src/gdskills/bundled/stacks/sql-db/rules/patterns.mdc +22 -113
- package/src/gdskills/bundled/stacks/sql-db/rules/security.mdc +11 -56
- package/src/gdskills/bundled/stacks/sql-db/rules/testing.mdc +14 -59
- package/src/gdskills/bundled/stacks/swift-ios/rules/coding-style.mdc +29 -65
- package/src/gdskills/bundled/stacks/swift-ios/rules/patterns.mdc +41 -88
- package/src/gdskills/bundled/stacks/swift-ios/rules/security.mdc +28 -53
- package/src/gdskills/bundled/stacks/swift-ios/rules/testing.mdc +32 -65
- package/src/gdskills/bundled/stacks/vue/rules/coding-style.mdc +17 -52
- package/src/gdskills/bundled/stacks/vue/rules/patterns.mdc +17 -63
- package/src/gdskills/bundled/stacks/vue/rules/security.mdc +11 -41
- package/src/gdskills/bundled/stacks/vue/rules/testing.mdc +16 -48
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "SOLID and function-design standard shared by code writers and the code-quality and style reviewers, with the thresholds they use: function length, parameter count, constructor dependencies, branch chains, file length, nesting, branching. Use when designing classes, modules or functions, or reviewing them."
|
|
2
|
+
description: "SOLID and function-design standard shared by code writers and the code-quality, architecture and style reviewers, with the thresholds and severities they use: function length, parameter count, constructor dependencies, branch chains, file length, nesting, branching. Use when designing classes, modules or functions, or reviewing them."
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# SOLID Principles and Function Design
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
|
-
One standard for designing and reviewing classes and functions. The thresholds below are the ones the code-quality and style reviewers apply. A writer who stays inside them gets no finding, and a reviewer reports nothing inside them.
|
|
9
|
+
One standard for designing and reviewing classes and functions. The thresholds and severities below are the ones the code-quality, architecture and style reviewers apply. A writer who stays inside them gets no finding, and a reviewer reports nothing inside them.
|
|
10
10
|
|
|
11
11
|
## When To Apply
|
|
12
12
|
Apply when creating or extending classes, services, modules or functions, and when reviewing them.
|
|
@@ -25,7 +25,7 @@ Apply when creating or extending classes, services, modules or functions, and wh
|
|
|
25
25
|
| Branch chain over a type discriminant | 4 or more branches, extended by the change | When the codebase already uses a lookup map or a strategy for the same kind of dispatch. |
|
|
26
26
|
| Duplicated block | 3 or more copies | Reported once, listing every copy. |
|
|
27
27
|
|
|
28
|
-
Under a threshold, the reviewer stays silent.
|
|
28
|
+
Under a threshold, the reviewer stays silent. When the change crosses one, the finding is rated by Review severities below.
|
|
29
29
|
|
|
30
30
|
## Readability thresholds (shared with review-style)
|
|
31
31
|
|
|
@@ -41,7 +41,11 @@ Under a threshold, the reviewer stays silent. At or over one, the finding is `mi
|
|
|
41
41
|
|
|
42
42
|
A threshold in either table counts only when the change crosses it.
|
|
43
43
|
|
|
44
|
-
A stack rule may refine a threshold for its language
|
|
44
|
+
A stack rule may refine a threshold for its language, in this table form with the row label copied exactly; for that language, writers and reviewers use the stack value.
|
|
45
|
+
|
|
46
|
+
| Row (exact label above) | Stack value | Marked |
|
|
47
|
+
|---|---|---|
|
|
48
|
+
| Function body length | the stack's own number | `override` |
|
|
45
49
|
|
|
46
50
|
---
|
|
47
51
|
|
|
@@ -52,7 +56,7 @@ A stack rule may refine a threshold for its language. It names the row it overri
|
|
|
52
56
|
- A constructor assigns. It does not perform I/O or start async work.
|
|
53
57
|
|
|
54
58
|
## O — Open/Closed
|
|
55
|
-
- Adding a variant should not mean editing a growing `if/else` or `switch
|
|
59
|
+
- Adding a variant should not mean editing a growing `if/else` or `switch`. It is a finding only at the Branch chain row: 4 or more branches over a type discriminant, extended by the change, where the codebase already dispatches that kind of thing through a map or a strategy. A chain that merely might grow is not one.
|
|
56
60
|
|
|
57
61
|
## L — Liskov Substitution
|
|
58
62
|
- An override must work wherever the base type is used. An override that throws "not supported", or rejects input the base accepts, breaks callers that hold the base type.
|
|
@@ -70,5 +74,25 @@ A stack rule may refine a threshold for its language. It names the row it overri
|
|
|
70
74
|
|
|
71
75
|
**IRON LAW 1: An override never throws where its base type would not.**
|
|
72
76
|
**IRON LAW 2: A constructor performs no I/O.**
|
|
73
|
-
**IRON LAW 3: The thresholds in this file are the standard for both writing and review. Change them here, never in a reviewer.**
|
|
74
|
-
|
|
77
|
+
**IRON LAW 3: The thresholds and severities in this file are the standard for both writing and review. Change them here, never in a reviewer.**
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Review severities (shared with reviewers)
|
|
82
|
+
|
|
83
|
+
`review-clean-code` rates SRP, OCP, LSP, ISP, duplication, magic literals and comments by this table; `review-style` rates names and the Readability thresholds; `review-architecture` rates DIP. A row counts only when the change crosses it: debt the change did not create is not a finding. Unused imports and variables, and import grouping or order, belong to the linter and are never a finding.
|
|
84
|
+
|
|
85
|
+
| Signal | A finding when | Default | Not a finding |
|
|
86
|
+
|---|---|---|---|
|
|
87
|
+
| Any Thresholds row crossed (Function body length, I/O mixed with a transform, Positional parameters, Boolean flag parameter, Constructor dependencies, Branch chain, Duplicated block) | the change crosses the row's threshold under its stated condition | `minor`; `major` only with a named trigger and outcome | under the threshold; a long linear table, serializer or test; a chain that might grow; 2 copies |
|
|
88
|
+
| Any Readability row crossed | the change crosses the threshold | the row's Default | generated code, fixtures, migrations, test files |
|
|
89
|
+
| Override throws "not supported" or rejects input the base accepts (LSP) | always | `major`; `blocker` when the broken caller is in the diff | an override the base contract documents as optional |
|
|
90
|
+
| Constructor does I/O or async work | always | `minor`; `major` only with a named defect it causes | — |
|
|
91
|
+
| Output argument | a function fills a caller-supplied argument instead of returning | `minor` | — |
|
|
92
|
+
| Two change drivers in one class or function | both can be named (validation and persistence) | `minor` | — |
|
|
93
|
+
| Interface wider than its implementers (ISP) | implementers leave stubs or no-ops | `minor` | — |
|
|
94
|
+
| Business logic constructs an I/O, network or clock dependency (DIP) | always | `minor` | a plain helper or value object built inside a module |
|
|
95
|
+
| Magic number or repeated string literal | it has business meaning and no named constant | `minor` | `0`, `1`, `100` and other neutral values |
|
|
96
|
+
| Name | it needs a comment, is generic (`data`, `temp`), gives one concept two names, or has ambiguous boolean polarity | `minor`; `major` only when it already produced a named wrong outcome at a call site | loop counters; project abbreviations |
|
|
97
|
+
| Comment | stale, contradicting, redundant, commented-out code, or compensating for a bad name | `minor` | intent, a domain constraint, a warning, a TODO with an issue |
|
|
98
|
+
| Stylistic opinion, or a future issue with no current violation | — | `info` | — |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Storybook
|
|
2
|
+
description: "Storybook standard shared by code writers and reviewers, with the severities reviewers use: typed stories, which states every component's stories cover (default and empty always, loading and error when the component has them, stress cases for lists and long text), fn() for actions, no side effects in render. Use when writing or reviewing *.stories.tsx."
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
globs:
|
|
5
5
|
- ".storybook/**"
|
|
@@ -9,29 +9,27 @@ stack_requires: "react"
|
|
|
9
9
|
|
|
10
10
|
# Storybook Guidelines
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
Standardize story creation, validation, and visual regression readiness.
|
|
12
|
+
Canon applies: the Storybook documentation (CSF 3, args, decorators, `@storybook/test`). This rule holds only this project's decisions.
|
|
14
13
|
|
|
15
|
-
##
|
|
16
|
-
Apply when creating, reviewing, or updating Storybook stories (`*.stories.tsx`).
|
|
14
|
+
## Rules
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- Static preview: `npm run storybook:preview`
|
|
16
|
+
1. **Typed CSF stories**: `*.stories.tsx` with `Meta` and `StoryObj`; state variants through `args`; providers and theme through decorators.
|
|
17
|
+
2. **States covered.** Every component has a default story, and an empty story when it can render empty. A component with a loading or error state has a story for each. A list, or a component that shows user text, has a stress story: many items, long text.
|
|
18
|
+
3. **No side effects.** Story callbacks are `fn()` from `@storybook/test`; a story never calls a real API, writes storage or logs in place of an action.
|
|
19
|
+
4. **Visual changes** update the screenshot tests in the same change.
|
|
23
20
|
|
|
24
|
-
|
|
25
|
-
- Use `*.stories.tsx` with `Meta` and `StoryObj` typing.
|
|
26
|
-
- Prefer `args` for state variants.
|
|
27
|
-
- Use `fn()` from `@storybook/test` for actions.
|
|
28
|
-
- Use decorators for providers/context.
|
|
21
|
+
Commands: `npm run storybook`, `npm run build-storybook`.
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
-
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Review severities (shared with reviewers)
|
|
26
|
+
|
|
27
|
+
`review-frontend` rates these patterns by this table. Change a row here, never in a reviewer.
|
|
35
28
|
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
| Signal | A finding when | Default | Not a finding |
|
|
30
|
+
|---|---|---|---|
|
|
31
|
+
| Missing default or empty story (Rule 2) | the component renders that state | `minor` | a component that cannot be empty |
|
|
32
|
+
| Missing loading or error story (Rule 2) | the component has that state (a prop or branch) | `minor` | a component without that state |
|
|
33
|
+
| Missing stress story (Rule 2) | a list, or user text that can be long | `minor` | fixed-length content |
|
|
34
|
+
| A story calls a real API or has another side effect (Rule 3) | always | `minor`; `major` when it writes to a real backend | `fn()` |
|
|
35
|
+
| Visual change without updated screenshot tests (Rule 4) | the project has screenshot tests | `minor` | — |
|
|
@@ -1,69 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "Testing standard shared by code writers and reviewers: red-green order, no done without green, tests colocated, new logic gets a test, mock at the boundary, no real network or clock, flaky tests fixed by waiting on a state, and the severities reviewers use. Use when implementing features, fixing bugs, writing or reviewing unit and integration tests."
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# TDD Workflow
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
Enforce Test-Driven Development: tests are written before implementation code. An agent MUST NOT claim `STATUS: DONE` unless all tests pass.
|
|
8
|
+
Canon applies: the test framework's documentation. This rule holds this project's decisions and the order an implementer works in.
|
|
10
9
|
|
|
11
|
-
##
|
|
12
|
-
Apply during any implementation task. Always loaded alongside `task-implementer` and `tests-creator` workflows.
|
|
10
|
+
## Process (implementer)
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
1. **RED.** Write the failing test first, from the task's `acceptance_criteria` (each criterion maps to at least one test; use `test_case_specs` or run `tests-creator` when none exist). Run it and confirm it fails for the right reason: a test that passes before the implementation is broken.
|
|
13
|
+
2. **GREEN.** Write the minimal code that passes it. Run the tests after each logical chunk.
|
|
14
|
+
3. **REFACTOR.** Clean up with the suite green; re-run it after every step.
|
|
15
|
+
4. **Report.** The full suite (`bun test`, `npm test`, `pytest` or the project's equivalent) passes with 0 failures before `STATUS: DONE`.
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
1. RED → Write a failing test that describes the desired behaviour
|
|
22
|
-
2. GREEN → Write the minimal code to make that test pass
|
|
23
|
-
3. REFACTOR → Clean up code without breaking the test
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**CRITICAL: Never skip RED.** Writing code before a failing test exists violates TDD. Even if the test seems trivial, it must be written first.
|
|
27
|
-
|
|
28
|
-
---
|
|
29
|
-
|
|
30
|
-
## Mandatory Steps
|
|
31
|
-
|
|
32
|
-
### Step 1: Receive Acceptance Criteria
|
|
33
|
-
- Parse `acceptance_criteria` from the task object (provided by `issue-analyzer` or `tests-creator`)
|
|
34
|
-
- Each criterion maps to ≥1 test case
|
|
35
|
-
- If no criteria exist, derive them from the task description before proceeding
|
|
36
|
-
|
|
37
|
-
### Step 2: Run tests-creator (or use pre-generated specs)
|
|
38
|
-
- If `test_case_specs` are provided in the task object → use them directly
|
|
39
|
-
- If not → invoke `tests-creator` to generate specs before writing any code
|
|
40
|
-
- **DO NOT start implementation until test specs are confirmed**
|
|
41
|
-
|
|
42
|
-
### Step 3: Write tests (RED phase)
|
|
43
|
-
- Create test file(s) at the correct location (co-located or in `__tests__/`)
|
|
44
|
-
- Run the test suite — confirm tests FAIL for the right reason
|
|
45
|
-
- A test that passes before implementation is a broken test
|
|
46
|
-
|
|
47
|
-
### Step 4: Implement (GREEN phase)
|
|
48
|
-
- Write the minimal code to satisfy each failing test
|
|
49
|
-
- Do not add features not covered by tests
|
|
50
|
-
- Run tests after each logical chunk — do not batch all implementation before running
|
|
51
|
-
|
|
52
|
-
### Step 5: Refactor
|
|
53
|
-
- Clean up code: extract helpers, rename variables, remove duplication
|
|
54
|
-
- Re-run full test suite after every refactor step
|
|
55
|
-
- Refactoring is complete only when all tests are green
|
|
56
|
-
|
|
57
|
-
### Step 6: Verify and Report
|
|
58
|
-
- Final `bun test` / `npm test` / `pytest` / equivalent must pass with 0 failures
|
|
59
|
-
- Include test output summary in the result object
|
|
60
|
-
- Report `STATUS: DONE` only when all criteria are covered by passing tests
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## Output Contract Extension
|
|
65
|
-
|
|
66
|
-
When reporting task completion, include:
|
|
17
|
+
Output contract on completion:
|
|
67
18
|
|
|
68
19
|
```
|
|
69
20
|
tests_written: <N>
|
|
@@ -72,25 +23,37 @@ tests_failing: 0
|
|
|
72
23
|
coverage_notes: "<which acceptance criteria are covered>"
|
|
73
24
|
```
|
|
74
25
|
|
|
75
|
-
|
|
26
|
+
**Iron laws.** Never claim `STATUS: DONE` with a failing test. Never write implementation before a failing test exists for that behaviour. Never delete or skip a test to make the suite green; fix the code.
|
|
76
27
|
|
|
77
|
-
##
|
|
28
|
+
## Rules
|
|
78
29
|
|
|
79
|
-
|
|
80
|
-
**IRON LAW 2: NEVER write implementation before a failing test exists for that behaviour.**
|
|
81
|
-
**IRON LAW 3: NEVER delete tests to make the suite green. Fix the code instead.**
|
|
30
|
+
A stack pack's `testing.mdc` adds its framework, layout and tools on top of these and does not repeat them.
|
|
82
31
|
|
|
83
|
-
|
|
32
|
+
1. **One toolchain.** Use the project's test framework, assertion and mocking libraries; never add a second one.
|
|
33
|
+
2. **Unit tests are colocated** with the code (`foo.test.ts` beside `foo.ts`). A separate folder is for e2e only.
|
|
34
|
+
3. **New or changed logic gets a test in the same change**: a branch, a calculation, error handling. A bug fix gets a regression test that fails before the fix. Trivial getters, pass-through and configuration need none.
|
|
35
|
+
4. **Mock at the boundary** (network, filesystem, clock, other services), never an internal collaborator of the unit under test.
|
|
36
|
+
5. **A unit test uses no real network and no wall-clock time**; fake both.
|
|
37
|
+
6. **Never wait with a sleep or a fixed delay.** Await the result, the event or the signal.
|
|
38
|
+
7. **A flaky test is fixed by waiting on the state it races**, never with a retry, a longer timeout or a skip.
|
|
84
39
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
| Rationalization | Why it's wrong |
|
|
88
|
-
|---|---|
|
|
89
|
-
| "The logic is simple, I don't need a test first" | Simplicity is never a reason to skip TDD — the cycle builds confidence, not just test coverage |
|
|
90
|
-
| "I'll add tests after to save time" | Tests written after implementation verify what the code does, not what it should do |
|
|
91
|
-
| "The tests are flaky, I'll skip them for now" | Flaky tests signal real design problems — fix the flakiness, not the test |
|
|
92
|
-
| "All the important logic is covered, a few edge tests can wait" | Untested edge cases are exactly where bugs live |
|
|
93
|
-
| "I'll mark it DONE and add tests in a follow-up PR" | STATUS: DONE means done — not "done except for tests" |
|
|
94
|
-
| "The test framework setup is complex, I'll just verify manually" | Manual verification is not reproducible and cannot be reviewed by other agents |
|
|
40
|
+
---
|
|
95
41
|
|
|
96
|
-
|
|
42
|
+
## Review severities (shared with reviewers)
|
|
43
|
+
|
|
44
|
+
`review-testing-practices` rates these patterns by this table. Change a row here, never in the reviewer.
|
|
45
|
+
|
|
46
|
+
| Signal | A finding when | Default | Not a finding |
|
|
47
|
+
|---|---|---|---|
|
|
48
|
+
| Test that passes while the behaviour it names is broken | a mutation run or a fixture that never reaches the code shows it | `blocker` | — |
|
|
49
|
+
| Real network or wall-clock dependence in a unit test (Rule 5) | a real call or a time-based assertion is reachable | `major` | a faked clock or a mocked boundary |
|
|
50
|
+
| Sleep or fixed delay for async work (Rule 6) | always | `major` | fake timers advanced by the test |
|
|
51
|
+
| Flake "fixed" by a retry, a longer timeout or a skip (Rule 7) | one of them is added to a flaky test | `major` | a wait on the proving signal |
|
|
52
|
+
| Test deleted, skipped (`.skip`, `xit`, `todo`) or its assertion weakened to go green (Iron law) | the pinned behaviour still exists and no other test covers it | `major`; `blocker` where that behaviour is now broken | the behaviour was removed in the same change |
|
|
53
|
+
| Shared state mutated across tests, or a real filesystem or service hit (Rule 4) | a named order or run breaks it | `major`; else `minor` | — |
|
|
54
|
+
| Internal collaborator mocked instead of the boundary (Rule 4) | always | `minor` | a collaborator that is itself a boundary |
|
|
55
|
+
| New or changed logic with no test (Rule 3) | the diff adds a branch, calculation or error path with no test hunk | `minor`; `major` where an acceptance criterion has no test | a trivial getter, pass-through or config |
|
|
56
|
+
| Bug fix with no regression test (Rule 3) | always | `minor`; `major` where the bug is named high-impact | — |
|
|
57
|
+
| Second test framework, assertion or mocking library (Rule 1) | always | `minor` | — |
|
|
58
|
+
| Unit test outside the code's folder (Rule 2) | always | `info` | an e2e spec |
|
|
59
|
+
| Test on a trivial getter, pass-through or config (Rule 3) | always | `info` | — |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "Shared catalog of AI-slop tells in UI (visual, copy, behavioral) with
|
|
2
|
+
description: "Shared catalog of AI-slop tells in UI (visual, copy, behavioral) with visibility tiers, the project's craft thresholds, the positive-direction principle, and the severities reviewers use. Read by ui-direction, ui-craft, and review-ui-ux."
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
globs:
|
|
5
5
|
- "**/*.tsx"
|
|
@@ -16,12 +16,21 @@ globs:
|
|
|
16
16
|
|
|
17
17
|
One vocabulary for the three UI skills: `ui-direction` (concept before code), `ui-craft`
|
|
18
18
|
(implementation), `review-ui-ux` (review). The creator and the reviewer judge by the same list.
|
|
19
|
+
Rendered geometry (sizing, overflow, reflow, RTL) is `layout-rendering.mdc`.
|
|
20
|
+
|
|
21
|
+
Canon applies: WCAG 2.2 AA, the NN/g usability heuristics and response-time limits, Practical
|
|
22
|
+
Typography, and Jakob's Law. This rule holds only this project's decisions on top of them.
|
|
23
|
+
|
|
24
|
+
**Applies to.** Marketing and content surfaces (landing, pricing, docs home, blog) use every row.
|
|
25
|
+
App screens (dashboards, admin, settings, data views) use Behavioral slop, Components & surfaces,
|
|
26
|
+
Motion, and the craft thresholds; there, body text of 14–16px is allowed when the component
|
|
27
|
+
library sets it and `DESIGN.md` says so.
|
|
19
28
|
|
|
20
29
|
## Why slop happens
|
|
21
30
|
|
|
22
31
|
- **Distributional convergence.** With no direction a model emits the most probable design:
|
|
23
32
|
Inter, indigo-on-white, centered hero, three cards, fade-up on scroll. Every "safe" default
|
|
24
|
-
is a vote for the average.
|
|
33
|
+
is a vote for the average.
|
|
25
34
|
- **A ban list alone fails.** Ban purple and the output moves to the *next* most probable look
|
|
26
35
|
("second-wave slop": cream + serif + terracotta; near-black + one neon accent; broadsheet).
|
|
27
36
|
The cure is a **positive direction derived from the subject**, with this list as a guard rail.
|
|
@@ -36,18 +45,18 @@ One vocabulary for the three UI skills: `ui-direction` (concept before code), `u
|
|
|
36
45
|
the client's own numbers and names. Not from "modern, clean, minimal".
|
|
37
46
|
2. **Spend boldness in one place.** Exactly one signature element; everything else quiet.
|
|
38
47
|
Before finishing, remove one element.
|
|
39
|
-
3. **Distinctive look, conventional behavior
|
|
40
|
-
|
|
41
|
-
4. **Structure must encode information.** Borders, numbering, eyebrows, dividers, badges exist
|
|
42
|
-
only when they carry meaning.
|
|
48
|
+
3. **Distinctive look, conventional behavior.** Navigation, links, forms and keyboard stay standard.
|
|
49
|
+
4. **Decoration carries meaning or goes.** Borders, numbering, eyebrows, dividers, badges.
|
|
43
50
|
5. **Never invent proof.** No made-up stats, logos, testimonials, customers, or "Live" chips.
|
|
44
|
-
6. **If the brief names a look, follow it** — even if that look
|
|
51
|
+
6. **If `DESIGN.md`, the brief or the job context names a look, follow it** — even if that look
|
|
52
|
+
is on the list below.
|
|
45
53
|
7. **Don't claim checks that weren't run.** No browser → say so.
|
|
46
54
|
|
|
47
55
|
## Tell catalog
|
|
48
56
|
|
|
49
|
-
Tiers
|
|
50
|
-
**
|
|
57
|
+
Tiers say how visible a tell is, not how severe a finding is; severity comes from
|
|
58
|
+
**Review severities** below. **T1** — recognizable as AI within ~3 seconds by a layperson.
|
|
59
|
+
**T2** — obvious to anyone who builds UI. **T3** — weak alone, damning in a stack.
|
|
51
60
|
|
|
52
61
|
### Color
|
|
53
62
|
| Tier | Tell | Fix |
|
|
@@ -69,7 +78,7 @@ Tiers: **T1** — recognizable as AI within ~3 seconds by a layperson (must fix)
|
|
|
69
78
|
| T2 | Accent on one headline word ("Build *faster*" — italic/colored/serif swap) | Let the sentence carry itself |
|
|
70
79
|
| T2 | Tracked ALL-CAPS eyebrow above every heading; mono for decorative meta labels | Only where it encodes information |
|
|
71
80
|
| T2 | Meta strings "A · B · C"; labels "WORD — fragment" | Plain sentence-case labels |
|
|
72
|
-
| T3 | Framework size ramp verbatim (12/14/16/18/24/30/36/48/60/72) | Modular ratio (1.2 / 1.25 / 1.333)
|
|
81
|
+
| T3 | Framework size ramp verbatim (12/14/16/18/24/30/36/48/60/72) | Modular ratio (1.2 / 1.25 / 1.333); a defined scale has ≤5 sizes |
|
|
73
82
|
| T3 | Close weights (400 vs 600); body at 600 | Extreme contrast (200–300 vs 700–900); body 400 |
|
|
74
83
|
| T3 | Headlines ≥48px with default tracking | −0.02 to −0.05em, leading 0.85–1.05 |
|
|
75
84
|
|
|
@@ -120,29 +129,23 @@ Tiers: **T1** — recognizable as AI within ~3 seconds by a layperson (must fix)
|
|
|
120
129
|
| T2 | Critical actions only visible on hover; color-only status | Always reachable; text/icon + color |
|
|
121
130
|
| T2 | No `prefers-reduced-motion` variant | Keep content, drop travel |
|
|
122
131
|
|
|
123
|
-
## Craft thresholds (
|
|
132
|
+
## Craft thresholds (project picks on top of the canon)
|
|
124
133
|
|
|
125
|
-
**Type.** 1–2 families. Body 16–20px (≥16px on mobile inputs
|
|
126
|
-
|
|
127
|
-
|
|
134
|
+
**Type.** 1–2 families. Body 16–20px (≥16px on mobile inputs; 14–16px on app screens per
|
|
135
|
+
**Applies to**). Display ≥3× body on marketing pages. A defined type scale has ≤5 sizes; one
|
|
136
|
+
dense app screen shows ≤3 of them.
|
|
128
137
|
|
|
129
|
-
**Color.**
|
|
130
|
-
≥3:1 (WCAG 1.4.3 / 1.4.11). Color never the sole carrier of meaning (1.4.1). ≤3 contrast
|
|
131
|
-
treatments per view.
|
|
138
|
+
**Color.** ≤3 contrast treatments per view.
|
|
132
139
|
|
|
133
140
|
**Space & shape.** One spacing scale (4/8/12/16/24/32/48/64/96/128). Groups separated more than
|
|
134
141
|
items within them. Radius: one scale by role, nested radius concentric.
|
|
135
142
|
|
|
136
|
-
**Targets.** ≥
|
|
143
|
+
**Targets.** ≥44px on touch, above the WCAG 24px floor.
|
|
137
144
|
|
|
138
|
-
**Motion.**
|
|
139
|
-
|
|
145
|
+
**Motion.** ~100ms for toggles, 200–300ms for dialogs, nothing ≥500ms; stagger 60–90ms;
|
|
146
|
+
travel 16–32px.
|
|
140
147
|
|
|
141
|
-
**Feedback
|
|
142
|
-
+ cancel. Loaders appear after ~150–300ms and stay ≥300ms. Skeletons match final dimensions.
|
|
143
|
-
|
|
144
|
-
**Accessibility floor.** WCAG 2.2 AA, including 2.4.11 Focus Not Obscured (sticky headers →
|
|
145
|
-
`scroll-padding`), 2.5.7 drag alternative, 1.4.10 reflow at 320px, never disable zoom.
|
|
148
|
+
**Feedback.** Loaders appear after ~150–300ms and stay ≥300ms. Skeletons match final dimensions.
|
|
146
149
|
|
|
147
150
|
## Slop score
|
|
148
151
|
|
|
@@ -151,17 +154,25 @@ Count tells by tier on the reviewed surface: `T1×3 + T2×2 + T3×1`.
|
|
|
151
154
|
- 4–8 — template-leaning; fix T1/T2 first
|
|
152
155
|
- ≥9 — reads as AI-generated; redo direction, don't patch
|
|
153
156
|
|
|
154
|
-
A tell is exempt when `DESIGN.md
|
|
157
|
+
A tell is exempt when `DESIGN.md`, the brief or the job context explicitly chooses it — record
|
|
158
|
+
the exemption and where it was read.
|
|
155
159
|
|
|
156
|
-
|
|
160
|
+
---
|
|
157
161
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
162
|
+
## Review severities (shared with reviewers)
|
|
163
|
+
|
|
164
|
+
`review-ui-ux` rates these by this table. Change a row here, never in a reviewer. A row counts
|
|
165
|
+
only when the change touches the surface, and only on the surfaces **Applies to** names. A tier
|
|
166
|
+
is visibility; the severity is this table's. Overflow and reflow at a width are rated by
|
|
167
|
+
`layout-rendering.mdc`.
|
|
168
|
+
|
|
169
|
+
| Signal | A finding when | Default | Not a finding |
|
|
170
|
+
|---|---|---|---|
|
|
171
|
+
| Invented proof shipped as fact: stats, logos, testimonials, customers (Copy T1, principle 5) | it renders in shipped copy | `major` | content marked as sample; Storybook fixtures |
|
|
172
|
+
| Primary task unreachable by keyboard, or focus invisible on the primary flow (`outline: none` with no `:focus-visible`, `div onClick`) | Tab through the flow cannot finish the task or cannot see where focus is | `major`; `minor` on a non-primary control | a `:focus-visible` replacement exists |
|
|
173
|
+
| Text contrast below 4.5:1 (3:1 large) on primary content | the pair is on shipped primary text, measured or computed from the token pair | `major` | decorative text; a pair not measured (`info`) |
|
|
174
|
+
| Missing loading, empty or error state on a primary view; destructive action with no confirm or Undo | the view or action is primary | `major`; `minor` on a secondary view | a state the component library renders by default |
|
|
175
|
+
| Other WCAG floor misses: target under 24px, color-only status, no reduced-motion branch, placeholder-as-label, paste blocked, zoom disabled, missing accessible name | always | `minor`; `major` when it blocks the primary flow | an N/A the author recorded |
|
|
176
|
+
| T1 tell, or slop score ≥9 | counted per tier on the changed surface | `minor` | a tell `DESIGN.md`, the brief or the job context chose; invented proof, focus and missing states, which the rows above rate (they still count in the score) |
|
|
177
|
+
| T2 tell, hierarchy competition, inconsistent tokens, drift from `DESIGN.md` | always | `minor` | the same exemptions |
|
|
178
|
+
| T3 tell (generic CTA labels included), polish, or a visual claim with no measurement | always | `info` | — |
|
|
@@ -42,7 +42,7 @@ dropped, the config key is skipped, the field comes back `undefined`. The
|
|
|
42
42
|
command exits 0. The caller reads success, the operator reads success, and the
|
|
43
43
|
work the flag asked for silently stopped happening. `rejectUnknownFlags` says
|
|
44
44
|
it in one line — *"a flag that is silently dropped writes nothing and reports
|
|
45
|
-
success"* (`src/commands/review.ts
|
|
45
|
+
success"* (`rejectUnknownFlags` in `src/commands/review.ts`).
|
|
46
46
|
|
|
47
47
|
`rules/core/cli-interface-design.mdc` sets the standard a surface must meet.
|
|
48
48
|
This skill is the work of getting an existing spelling from where it is to
|
|
@@ -3,7 +3,7 @@ name: review-architecture
|
|
|
3
3
|
model_tier: deep
|
|
4
4
|
description: |
|
|
5
5
|
Use when: reviewing code for architectural violations — layer violations, dependency direction
|
|
6
|
-
mistakes, module boundary coupling,
|
|
6
|
+
mistakes, module boundary coupling, dependency inversion, circular imports, NestJS module/provider structure,
|
|
7
7
|
React MVVM boundary violations, or MobX store layer misplacement.
|
|
8
8
|
Dispatched by review-orchestrator with --architecture or --backend.
|
|
9
9
|
NOT for: style/naming preferences, logic correctness bugs, or security vulnerabilities.
|
|
@@ -41,7 +41,7 @@ Architecture Review Progress:
|
|
|
41
41
|
- [ ] Step 5: Check layer assignments and dependency direction
|
|
42
42
|
- [ ] Step 6: Check module/provider boundaries
|
|
43
43
|
- [ ] Step 7: Check design pattern correctness (Repository, DI, MVVM)
|
|
44
|
-
- [ ] Step 8: Check
|
|
44
|
+
- [ ] Step 8: Check dependency inversion
|
|
45
45
|
- [ ] Step 9: Check framework-specific concerns (NestJS / React / MobX)
|
|
46
46
|
- [ ] Step 10: Emit findings in unified format
|
|
47
47
|
```
|
|
@@ -92,43 +92,30 @@ When `stack_hint` is not provided, infer from changed file paths:
|
|
|
92
92
|
|
|
93
93
|
### Layer Violations
|
|
94
94
|
|
|
95
|
-
A **layer violation** occurs when code belonging to one architectural layer is placed in another.
|
|
96
|
-
Common layers (adapt to the project's actual layering):
|
|
97
|
-
|
|
98
|
-
```
|
|
99
|
-
UI (View) → ViewModel / Store → Service → Domain → Infrastructure (DB, HTTP)
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
- [ ] API call or HTTP client import inside a React component (should be in store/service)
|
|
103
|
-
- [ ] Business logic inside a controller (should be in service/use-case)
|
|
104
|
-
- [ ] Database query directly inside a service bypassing the repository layer
|
|
105
|
-
- [ ] Domain entity mutating itself with HTTP response data (infrastructure leaking into domain)
|
|
106
|
-
- [ ] UI component computing derived state that belongs in a ViewModel or computed property
|
|
95
|
+
A **layer violation** occurs when code belonging to one architectural layer is placed in another. The layers and what each may import are `.metaproject/rules/core/clean-architecture.mdc` (backend: controller, use case, repository, domain, infrastructure, each boundary mapping its own types) and `.metaproject/rules/core/code-style-patterns.mdc` Rule 2 (frontend: component renders, store holds logic, service does I/O only; derived state is `@computed` per `.metaproject/rules/core/mobx-store-template.mdc` Rule 1). Adapt to the project's actual layering and report a placement those rules forbid.
|
|
107
96
|
|
|
108
97
|
### Dependency Direction
|
|
109
98
|
|
|
110
99
|
Dependencies must flow **inward** (from infrastructure toward domain), never outward.
|
|
111
100
|
|
|
112
|
-
- [ ] Domain module importing from infrastructure (
|
|
101
|
+
- [ ] Domain module importing from infrastructure (`.metaproject/rules/core/clean-architecture.mdc`)
|
|
113
102
|
- [ ] Core/shared module importing from feature module (inverted dependency)
|
|
114
|
-
- [ ] Circular import between modules (A imports B, B imports A)
|
|
103
|
+
- [ ] Circular import between modules (A imports B, B imports A); rated by `.metaproject/rules/core/clean-architecture.mdc` Review severities
|
|
115
104
|
- [ ] Barrel file (`index.ts`) that creates hidden circular references
|
|
116
105
|
|
|
117
106
|
### Module Boundary Violations
|
|
118
107
|
|
|
119
|
-
- [ ] Feature A
|
|
108
|
+
- [ ] Feature A reaching into feature B's internal files instead of its public exports (`.metaproject/rules/core/clean-architecture.mdc`)
|
|
120
109
|
- [ ] Shared `utils/` or `common/` module containing domain-specific business logic
|
|
121
110
|
- [ ] Cross-module data transformation happening in the wrong module
|
|
122
111
|
|
|
123
112
|
### Design Pattern Misuse
|
|
124
113
|
|
|
125
|
-
**Repository pattern
|
|
126
|
-
- [ ] Repository method containing business logic (filtering/transformation beyond simple queries)
|
|
127
|
-
- [ ] Service bypassing repository and using ORM/DB client directly
|
|
114
|
+
**Repository pattern** (`.metaproject/rules/core/clean-architecture.mdc`: the repository is the I/O boundary, business rules live in the domain):
|
|
128
115
|
- [ ] Multiple repositories doing the same data transformation independently
|
|
129
116
|
|
|
130
117
|
**Dependency Injection:**
|
|
131
|
-
- [ ] `new
|
|
118
|
+
- [ ] `new X()` for an I/O, network or clock dependency inside a class that should receive it (`.metaproject/rules/core/solid-principles.mdc` section D)
|
|
132
119
|
- [ ] Service locator pattern used instead of constructor injection
|
|
133
120
|
- [ ] Singleton service holding request-scoped state
|
|
134
121
|
|
|
@@ -136,27 +123,11 @@ Dependencies must flow **inward** (from infrastructure toward domain), never out
|
|
|
136
123
|
- [ ] Command handler performing a query and returning domain data (mixed responsibility)
|
|
137
124
|
- [ ] Use-case importing another use-case (chain via domain events instead)
|
|
138
125
|
|
|
139
|
-
###
|
|
140
|
-
|
|
141
|
-
Focus on **SRP** and **DIP** — the two most commonly violated in practice.
|
|
142
|
-
|
|
143
|
-
**SRP (Single Responsibility):**
|
|
144
|
-
- [ ] Class/module doing two unrelated things (e.g., handles auth AND sends emails)
|
|
145
|
-
- [ ] Service with >5 injected dependencies (smell: likely SRP violation)
|
|
146
|
-
- [ ] Component rendering UI AND fetching data AND computing derived state
|
|
126
|
+
### Dependency Inversion
|
|
147
127
|
|
|
148
|
-
|
|
149
|
-
- [ ] `switch`/`if-else` chain over a type discriminant that will grow (should be polymorphism or strategy)
|
|
128
|
+
This lens owns DIP, layer and dependency direction, module boundaries and circular imports; their severities are `.metaproject/rules/core/clean-architecture.mdc` Review severities. SRP, OCP, LSP and ISP are `review-clean-code`'s, rated by `.metaproject/rules/core/solid-principles.mdc` Review severities. A component that renders, fetches and derives is `.metaproject/rules/core/code-style-patterns.mdc` Rule 2.
|
|
150
129
|
|
|
151
|
-
|
|
152
|
-
- [ ] Subclass overriding a method with stronger preconditions or weaker postconditions
|
|
153
|
-
|
|
154
|
-
**ISP (Interface Segregation):**
|
|
155
|
-
- [ ] Implementing interface that forces implementing methods never used by this class
|
|
156
|
-
|
|
157
|
-
**DIP (Dependency Inversion):**
|
|
158
|
-
- [ ] High-level module importing a concrete low-level class (should import an abstraction)
|
|
159
|
-
- [ ] Infrastructure class passed directly through multiple layers instead of behind an interface
|
|
130
|
+
- DIP asks for an interface only at an I/O or substitution boundary; a single internal implementation gets none. An infrastructure class passed through several layers instead of behind an interface at that boundary is a finding.
|
|
160
131
|
|
|
161
132
|
### NestJS-Specific
|
|
162
133
|
|
|
@@ -164,24 +135,21 @@ Focus on **SRP** and **DIP** — the two most commonly violated in practice.
|
|
|
164
135
|
- [ ] `@Global()` overused — global providers for non-truly-global concerns
|
|
165
136
|
- [ ] Circular dependency between NestJS modules without `forwardRef`
|
|
166
137
|
- [ ] Provider scope mismatch: `REQUEST`-scoped service injected into `DEFAULT`-scoped service
|
|
167
|
-
- [ ] Controller
|
|
138
|
+
- [ ] Controller holding business logic or a query that belongs in the domain/use-case layer (`clean-architecture.mdc`)
|
|
168
139
|
- [ ] `@Module` imports array including modules it does not need (unnecessary coupling)
|
|
169
140
|
|
|
170
141
|
### React + MVVM (with MobX)
|
|
171
142
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
- [ ] Store method calling another store's `private` action directly (should go through public API)
|
|
143
|
+
Logic in a component, effects that orchestrate state, and cleanup are `.metaproject/rules/core/code-style-patterns.mdc` Rules 2 and 5 with `.metaproject/rules/core/mobx-store-template.mdc` Rule 8. This lens adds:
|
|
144
|
+
|
|
175
145
|
- [ ] Component subscribing to raw observable fields instead of using computed/derived values
|
|
176
146
|
- [ ] View rendering based on multiple raw observable fields instead of a single computed boolean
|
|
177
147
|
|
|
178
148
|
### MobX Store Layer
|
|
179
149
|
|
|
180
|
-
|
|
150
|
+
Mutation outside an action, async resolution without `runInAction`, and inter-store callbacks left public are `.metaproject/rules/core/mobx-store-template.mdc` Rules 2 and 3 and their rows; a store importing another store's internal file is `.metaproject/rules/core/clean-architecture.mdc` (public exports only). This lens adds:
|
|
151
|
+
|
|
181
152
|
- [ ] `@computed` with side effects (computed must be pure)
|
|
182
|
-
- [ ] Observable state mutated outside of an `@action` (MobX strict mode violation)
|
|
183
|
-
- [ ] Store importing from another store's internal file instead of its public export
|
|
184
|
-
- [ ] Inter-store callback (`onChangeX`, `handleX`, `syncX`) declared `public` when only used internally (should be `private`)
|
|
185
153
|
|
|
186
154
|
---
|
|
187
155
|
|
|
@@ -190,12 +158,13 @@ Focus on **SRP** and **DIP** — the two most commonly violated in practice.
|
|
|
190
158
|
| Concern | This skill | Use instead |
|
|
191
159
|
|---------|------------|-------------|
|
|
192
160
|
| Layer violations, dependency direction, module coupling | YES | — |
|
|
193
|
-
|
|
|
161
|
+
| Dependency inversion (DIP) | YES | — |
|
|
162
|
+
| SRP, OCP, LSP, ISP, duplication, magic literals, comments | NO | `review-clean-code` |
|
|
194
163
|
| NestJS module/provider/scope issues | YES | — |
|
|
195
164
|
| React MVVM boundary, MobX store layer | YES | — |
|
|
196
165
|
| Logic bugs, off-by-one, null safety | NO | `review-logic` |
|
|
197
166
|
| Security vulnerabilities (injection, auth bypass) | NO | `review-security-code` |
|
|
198
|
-
| Style, naming,
|
|
167
|
+
| Style, naming, readability | NO | `review-style` |
|
|
199
168
|
| Performance (bundle size, render cost, query plan) | NO | `review-performance` |
|
|
200
169
|
| MobX store internals deep-dive | surface violations only | `review-frontend` for full store audit |
|
|
201
170
|
|
|
@@ -255,16 +224,12 @@ conditions land under that rubric, not a second rubric.
|
|
|
255
224
|
|
|
256
225
|
| Condition | Severity | Why, under the canonical rubric |
|
|
257
226
|
|---|---|---|
|
|
258
|
-
| Circular dependency that fails at runtime (an import resolves to `undefined` on a path the change reaches) | `blocker` | Crash |
|
|
259
227
|
| Module scope mismatch that produces wrong data across requests | `blocker` | Data corruption |
|
|
260
|
-
| Layer violation
|
|
261
|
-
|
|
|
262
|
-
|
|
|
228
|
+
| Layer violation in the backend — business logic in a controller, domain importing infrastructure (a frontend component's layer violation is the `code-style-patterns.mdc` Rule 2 row) | `minor` — `major` only when a concrete defect it causes is named (trigger and outcome) | Structural cost lands on the next editor. Identical to `review-backend` for the same condition |
|
|
229
|
+
| Cross-module coupling; circular import (`blocker` only when it fails at runtime) | `minor` — `major` under the same condition | `clean-architecture.mdc` Review severities |
|
|
230
|
+
| A component reading several raw observables instead of a computed | `minor` | The code is correct; the cost is to whoever restructures it next |
|
|
263
231
|
| Architectural opinion with no named violation | `info` | Shared laws 1 and 2 |
|
|
264
232
|
|
|
265
|
-
This lens owns circular imports: one that resolves cleanly is `minor`, not a
|
|
266
|
-
`blocker`; `review-style` and `review-clean-code` defer to this rating.
|
|
267
|
-
|
|
268
233
|
## Iron Laws
|
|
269
234
|
|
|
270
235
|
### Shared laws (every reviewer)
|
|
@@ -283,7 +248,7 @@ boundary is the trigger-and-outcome test.
|
|
|
283
248
|
|
|
284
249
|
- Only flag actual violations found **in the diff**, not pre-existing issues untouched by the change.
|
|
285
250
|
- Every finding MUST cite a specific `file:line` from the diff.
|
|
286
|
-
- Architecture opinions without a clear, named violation (layer,
|
|
251
|
+
- Architecture opinions without a clear, named violation (layer, dependency, pattern misuse) are `info` only — never `blocker` or `major`.
|
|
287
252
|
- Do not flag correct framework usage as a violation just because an alternative exists.
|
|
288
253
|
|
|
289
254
|
---
|
|
@@ -329,7 +294,7 @@ STATUS: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
|
329
294
|
### Design Pattern Misuse
|
|
330
295
|
<[F-NNN] findings or "None detected.">
|
|
331
296
|
|
|
332
|
-
###
|
|
297
|
+
### Dependency Inversion
|
|
333
298
|
<[F-NNN] findings or "None detected.">
|
|
334
299
|
|
|
335
300
|
### Framework-Specific (NestJS / React+MobX)
|
|
@@ -351,7 +316,6 @@ When dispatched by `review-orchestrator` or `job-orchestrator`, the prompt MAY c
|
|
|
351
316
|
|
|
352
317
|
| Rationalization | Why it is wrong |
|
|
353
318
|
|----------------|-----------------|
|
|
354
|
-
| "This class is large, so it must violate SRP" | Size alone is not a violation; cite what two unrelated responsibilities it holds |
|
|
355
319
|
| "I see a potential layer violation in a file not in the diff" | Scope is diff-only; pre-existing issues are out of scope unless the diff touches them |
|
|
356
320
|
| "This architecture opinion makes things cleaner, so it's a major" | Opinions without a named violation are `info` only |
|
|
357
321
|
| "I'll flag every cross-import as a boundary violation" | Not all cross-imports violate boundaries; check whether the dependency direction is correct |
|