@ryuenn3123/agentic-senior-core 1.9.0 → 1.9.2
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/.agent-context/blueprints/mobile-app.md +21 -21
- package/.agent-context/policies/llm-judge-threshold.json +29 -20
- package/.agent-context/profiles/platform.md +13 -13
- package/.agent-context/profiles/regulated.md +13 -13
- package/.agent-context/profiles/startup.md +13 -13
- package/.agent-context/review-checklists/frontend-skill-parity.md +28 -28
- package/.agent-context/review-checklists/frontend-usability.md +33 -33
- package/.agent-context/review-checklists/release-operations.md +29 -29
- package/.agent-context/rules/security.md +92 -0
- package/.agent-context/skills/README.md +62 -62
- package/.agent-context/skills/backend/README.md +67 -67
- package/.agent-context/skills/backend/architecture.md +360 -360
- package/.agent-context/skills/backend/data-access.md +230 -230
- package/.agent-context/skills/backend/errors.md +137 -137
- package/.agent-context/skills/backend/validation.md +116 -116
- package/.agent-context/skills/backend.md +28 -28
- package/.agent-context/skills/cli/README.md +49 -49
- package/.agent-context/skills/cli/init.md +37 -37
- package/.agent-context/skills/cli/output.md +35 -35
- package/.agent-context/skills/cli/upgrade.md +37 -37
- package/.agent-context/skills/cli.md +28 -28
- package/.agent-context/skills/distribution/README.md +18 -18
- package/.agent-context/skills/distribution/compatibility.md +31 -31
- package/.agent-context/skills/distribution/publish.md +36 -36
- package/.agent-context/skills/distribution/rollback.md +31 -31
- package/.agent-context/skills/distribution.md +28 -28
- package/.agent-context/skills/frontend/README.md +35 -35
- package/.agent-context/skills/frontend/accessibility.md +107 -107
- package/.agent-context/skills/frontend/motion.md +66 -66
- package/.agent-context/skills/frontend/performance.md +62 -62
- package/.agent-context/skills/frontend/ui-architecture.md +128 -128
- package/.agent-context/skills/frontend.md +29 -29
- package/.agent-context/skills/fullstack/README.md +18 -18
- package/.agent-context/skills/fullstack/contracts.md +52 -52
- package/.agent-context/skills/fullstack/end-to-end.md +41 -41
- package/.agent-context/skills/fullstack/feature-slicing.md +64 -64
- package/.agent-context/skills/fullstack.md +26 -26
- package/.agent-context/skills/index.json +107 -107
- package/.agent-context/skills/review-quality/README.md +18 -18
- package/.agent-context/skills/review-quality/benchmark.md +29 -29
- package/.agent-context/skills/review-quality/planning.md +37 -37
- package/.agent-context/skills/review-quality/security.md +33 -33
- package/.agent-context/skills/review-quality.md +27 -27
- package/.agent-context/stacks/flutter.md +16 -16
- package/.agent-context/stacks/react-native.md +16 -16
- package/.agent-context/state/architecture-map.md +25 -25
- package/.agent-context/state/benchmark-analysis.json +431 -431
- package/.agent-context/state/benchmark-thresholds.json +10 -10
- package/.agent-context/state/benchmark-watchlist.json +19 -19
- package/.agent-context/state/dependency-map.md +32 -32
- package/.agent-context/state/onboarding-report.json +39 -0
- package/.agent-context/state/skill-platform.json +38 -38
- package/.agent-override.md +36 -36
- package/.cursorrules +3718 -140
- package/.github/ISSUE_TEMPLATE/v1.7-frontend-work-item.yml +54 -54
- package/.github/workflows/benchmark-detection.yml +38 -38
- package/.github/workflows/benchmark-intelligence.yml +50 -50
- package/.github/workflows/frontend-usability-gate.yml +36 -36
- package/.github/workflows/publish.yml +32 -0
- package/.github/workflows/release-gate.yml +32 -32
- package/.github/workflows/sbom-compliance.yml +32 -32
- package/.windsurfrules +3718 -106
- package/AGENTS.md +181 -181
- package/README.md +318 -318
- package/bin/agentic-senior-core.js +61 -1556
- package/lib/cli/commands/init.mjs +339 -0
- package/lib/cli/commands/launch.mjs +81 -0
- package/lib/cli/commands/upgrade.mjs +165 -0
- package/lib/cli/compiler.mjs +204 -0
- package/lib/cli/constants.mjs +136 -0
- package/lib/cli/detector.mjs +211 -0
- package/lib/cli/profile-packs.mjs +94 -0
- package/lib/cli/skill-selector.mjs +210 -0
- package/lib/cli/utils.mjs +227 -0
- package/mcp.json +92 -92
- package/package.json +3 -1
- package/scripts/benchmark-gate.mjs +121 -121
- package/scripts/benchmark-intelligence.mjs +140 -140
- package/scripts/detection-benchmark.mjs +138 -138
- package/scripts/frontend-usability-audit.mjs +87 -87
- package/scripts/generate-sbom.mjs +61 -61
- package/scripts/init-project.ps1 +104 -104
- package/scripts/llm-judge.mjs +664 -664
- package/scripts/release-gate.mjs +116 -116
- package/scripts/skill-tier-policy.mjs +75 -75
- package/scripts/validate.mjs +636 -636
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
# Component Architecture and State Management
|
|
2
|
-
|
|
3
|
-
**Tier:** EXPERT | **Source:** awesome-copilot (smart/dumb) + minimax (design systems) + antigravity (React patterns)
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
|
|
7
|
-
UI architecture decides how state, behavior, and presentation are split. Good structure reduces re-render churn, keeps component boundaries stable, and makes features easier to test.
|
|
8
|
-
|
|
9
|
-
## Part 1: Smart and Dumb Separation
|
|
10
|
-
|
|
11
|
-
A smart component owns data flow, side effects, and orchestration. A dumb component renders input and emits events.
|
|
12
|
-
|
|
13
|
-
```javascript
|
|
14
|
-
function PaymentFormContainer() {
|
|
15
|
-
const [amount, setAmount] = useState('');
|
|
16
|
-
const [status, setStatus] = useState('idle');
|
|
17
|
-
const [errorMessage, setErrorMessage] = useState(null);
|
|
18
|
-
|
|
19
|
-
const handleSubmit = async (submittedAmount) => {
|
|
20
|
-
setStatus('loading');
|
|
21
|
-
try {
|
|
22
|
-
const response = await fetch('/api/payments', {
|
|
23
|
-
method: 'POST',
|
|
24
|
-
body: JSON.stringify({ amount: submittedAmount })
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
if (!response.ok) {
|
|
28
|
-
throw new Error('Payment request failed');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
setStatus('success');
|
|
32
|
-
} catch (caughtError) {
|
|
33
|
-
setErrorMessage(caughtError.message);
|
|
34
|
-
setStatus('error');
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<PaymentFormView
|
|
40
|
-
amount={amount}
|
|
41
|
-
isLoading={status === 'loading'}
|
|
42
|
-
errorMessage={errorMessage}
|
|
43
|
-
onAmountChange={setAmount}
|
|
44
|
-
onSubmit={handleSubmit}
|
|
45
|
-
/>
|
|
46
|
-
);
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
```javascript
|
|
51
|
-
function PaymentFormView({ amount, isLoading, errorMessage, onAmountChange, onSubmit }) {
|
|
52
|
-
return (
|
|
53
|
-
<form onSubmit={(event) => { event.preventDefault(); onSubmit(amount); }}>
|
|
54
|
-
<input
|
|
55
|
-
value={amount}
|
|
56
|
-
onChange={(event) => onAmountChange(event.target.value)}
|
|
57
|
-
disabled={isLoading}
|
|
58
|
-
/>
|
|
59
|
-
<button disabled={isLoading}>
|
|
60
|
-
{isLoading ? 'Processing' : 'Pay'}
|
|
61
|
-
</button>
|
|
62
|
-
{errorMessage ? <p>{errorMessage}</p> : null}
|
|
63
|
-
</form>
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## Part 2: State Ownership Rules
|
|
69
|
-
|
|
70
|
-
Use the smallest useful state scope.
|
|
71
|
-
|
|
72
|
-
- Local component state: form fields, toggles, ephemeral UI state.
|
|
73
|
-
- Shared UI state: theme, sidebar state, modal visibility.
|
|
74
|
-
- Server state: remote data, caching, invalidation, refetching.
|
|
75
|
-
- Derived state: compute from existing data instead of duplicating it.
|
|
76
|
-
|
|
77
|
-
Recommended mapping:
|
|
78
|
-
- `useState` for local state.
|
|
79
|
-
- `Zustand` or context for global UI state.
|
|
80
|
-
- `TanStack Query` for server state.
|
|
81
|
-
- Avoid context for high-frequency server data when query caching is the better fit.
|
|
82
|
-
|
|
83
|
-
## Part 3: Composition and Contracts
|
|
84
|
-
|
|
85
|
-
A component contract should define what it accepts, what it renders, and what events it emits.
|
|
86
|
-
|
|
87
|
-
```javascript
|
|
88
|
-
interface ButtonProps {
|
|
89
|
-
variant?: 'primary' | 'secondary' | 'danger';
|
|
90
|
-
size?: 'small' | 'medium' | 'large';
|
|
91
|
-
disabled?: boolean;
|
|
92
|
-
loading?: boolean;
|
|
93
|
-
onClick: () => void;
|
|
94
|
-
children: React.ReactNode;
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
Keep public component APIs stable. If the component grows many optional props, split it into smaller feature-specific components instead of adding more flags.
|
|
99
|
-
|
|
100
|
-
## Part 4: Anti-Patterns
|
|
101
|
-
|
|
102
|
-
- Prop drilling across many levels.
|
|
103
|
-
- Global context for everything.
|
|
104
|
-
- Mixing network calls into presentational views.
|
|
105
|
-
- Repeating derived values in both state and render.
|
|
106
|
-
- Reaching into another feature's internals instead of using the feature public API.
|
|
107
|
-
|
|
108
|
-
## Part 5: Design System Integration
|
|
109
|
-
|
|
110
|
-
Design tokens should drive spacing, color, and sizing. Avoid one-off values unless the design system explicitly allows them.
|
|
111
|
-
|
|
112
|
-
```javascript
|
|
113
|
-
const buttonStyles = {
|
|
114
|
-
primary: 'bg-primary text-on-primary',
|
|
115
|
-
secondary: 'bg-surface text-primary',
|
|
116
|
-
danger: 'bg-danger text-on-danger'
|
|
117
|
-
};
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
## Review Checklist
|
|
121
|
-
|
|
122
|
-
- [ ] Smart and dumb layers are separated.
|
|
123
|
-
- [ ] State ownership is minimal and deliberate.
|
|
124
|
-
- [ ] Server state uses a cache-aware tool.
|
|
125
|
-
- [ ] Component contracts are explicit and stable.
|
|
126
|
-
- [ ] Feature boundaries are respected.
|
|
127
|
-
- [ ] Design tokens are used consistently.
|
|
128
|
-
- [ ] Prop drilling does not replace composition or shared state.
|
|
1
|
+
# Component Architecture and State Management
|
|
2
|
+
|
|
3
|
+
**Tier:** EXPERT | **Source:** awesome-copilot (smart/dumb) + minimax (design systems) + antigravity (React patterns)
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
UI architecture decides how state, behavior, and presentation are split. Good structure reduces re-render churn, keeps component boundaries stable, and makes features easier to test.
|
|
8
|
+
|
|
9
|
+
## Part 1: Smart and Dumb Separation
|
|
10
|
+
|
|
11
|
+
A smart component owns data flow, side effects, and orchestration. A dumb component renders input and emits events.
|
|
12
|
+
|
|
13
|
+
```javascript
|
|
14
|
+
function PaymentFormContainer() {
|
|
15
|
+
const [amount, setAmount] = useState('');
|
|
16
|
+
const [status, setStatus] = useState('idle');
|
|
17
|
+
const [errorMessage, setErrorMessage] = useState(null);
|
|
18
|
+
|
|
19
|
+
const handleSubmit = async (submittedAmount) => {
|
|
20
|
+
setStatus('loading');
|
|
21
|
+
try {
|
|
22
|
+
const response = await fetch('/api/payments', {
|
|
23
|
+
method: 'POST',
|
|
24
|
+
body: JSON.stringify({ amount: submittedAmount })
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
if (!response.ok) {
|
|
28
|
+
throw new Error('Payment request failed');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
setStatus('success');
|
|
32
|
+
} catch (caughtError) {
|
|
33
|
+
setErrorMessage(caughtError.message);
|
|
34
|
+
setStatus('error');
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<PaymentFormView
|
|
40
|
+
amount={amount}
|
|
41
|
+
isLoading={status === 'loading'}
|
|
42
|
+
errorMessage={errorMessage}
|
|
43
|
+
onAmountChange={setAmount}
|
|
44
|
+
onSubmit={handleSubmit}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
function PaymentFormView({ amount, isLoading, errorMessage, onAmountChange, onSubmit }) {
|
|
52
|
+
return (
|
|
53
|
+
<form onSubmit={(event) => { event.preventDefault(); onSubmit(amount); }}>
|
|
54
|
+
<input
|
|
55
|
+
value={amount}
|
|
56
|
+
onChange={(event) => onAmountChange(event.target.value)}
|
|
57
|
+
disabled={isLoading}
|
|
58
|
+
/>
|
|
59
|
+
<button disabled={isLoading}>
|
|
60
|
+
{isLoading ? 'Processing' : 'Pay'}
|
|
61
|
+
</button>
|
|
62
|
+
{errorMessage ? <p>{errorMessage}</p> : null}
|
|
63
|
+
</form>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Part 2: State Ownership Rules
|
|
69
|
+
|
|
70
|
+
Use the smallest useful state scope.
|
|
71
|
+
|
|
72
|
+
- Local component state: form fields, toggles, ephemeral UI state.
|
|
73
|
+
- Shared UI state: theme, sidebar state, modal visibility.
|
|
74
|
+
- Server state: remote data, caching, invalidation, refetching.
|
|
75
|
+
- Derived state: compute from existing data instead of duplicating it.
|
|
76
|
+
|
|
77
|
+
Recommended mapping:
|
|
78
|
+
- `useState` for local state.
|
|
79
|
+
- `Zustand` or context for global UI state.
|
|
80
|
+
- `TanStack Query` for server state.
|
|
81
|
+
- Avoid context for high-frequency server data when query caching is the better fit.
|
|
82
|
+
|
|
83
|
+
## Part 3: Composition and Contracts
|
|
84
|
+
|
|
85
|
+
A component contract should define what it accepts, what it renders, and what events it emits.
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
interface ButtonProps {
|
|
89
|
+
variant?: 'primary' | 'secondary' | 'danger';
|
|
90
|
+
size?: 'small' | 'medium' | 'large';
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
loading?: boolean;
|
|
93
|
+
onClick: () => void;
|
|
94
|
+
children: React.ReactNode;
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Keep public component APIs stable. If the component grows many optional props, split it into smaller feature-specific components instead of adding more flags.
|
|
99
|
+
|
|
100
|
+
## Part 4: Anti-Patterns
|
|
101
|
+
|
|
102
|
+
- Prop drilling across many levels.
|
|
103
|
+
- Global context for everything.
|
|
104
|
+
- Mixing network calls into presentational views.
|
|
105
|
+
- Repeating derived values in both state and render.
|
|
106
|
+
- Reaching into another feature's internals instead of using the feature public API.
|
|
107
|
+
|
|
108
|
+
## Part 5: Design System Integration
|
|
109
|
+
|
|
110
|
+
Design tokens should drive spacing, color, and sizing. Avoid one-off values unless the design system explicitly allows them.
|
|
111
|
+
|
|
112
|
+
```javascript
|
|
113
|
+
const buttonStyles = {
|
|
114
|
+
primary: 'bg-primary text-on-primary',
|
|
115
|
+
secondary: 'bg-surface text-primary',
|
|
116
|
+
danger: 'bg-danger text-on-danger'
|
|
117
|
+
};
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Review Checklist
|
|
121
|
+
|
|
122
|
+
- [ ] Smart and dumb layers are separated.
|
|
123
|
+
- [ ] State ownership is minimal and deliberate.
|
|
124
|
+
- [ ] Server state uses a cache-aware tool.
|
|
125
|
+
- [ ] Component contracts are explicit and stable.
|
|
126
|
+
- [ ] Feature boundaries are respected.
|
|
127
|
+
- [ ] Design tokens are used consistently.
|
|
128
|
+
- [ ] Prop drilling does not replace composition or shared state.
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
# Frontend Skill Pack
|
|
2
|
-
|
|
3
|
-
Default tier: `advance`
|
|
4
|
-
|
|
5
|
-
## Purpose
|
|
6
|
-
Deliver frontend experiences that are visually intentional, accessible, and efficient.
|
|
7
|
-
|
|
8
|
-
## In Scope
|
|
9
|
-
- UI architecture and component composition
|
|
10
|
-
- Responsive layouts and breakpoints
|
|
11
|
-
- Motion, animation, and interaction polish
|
|
12
|
-
- Accessibility and keyboard flows
|
|
13
|
-
- Conversion clarity and onboarding flow
|
|
14
|
-
|
|
15
|
-
## Must-Have Checks
|
|
16
|
-
- Feature-driven folder structure
|
|
17
|
-
- Smart and dumb component separation
|
|
18
|
-
- Server state and client state separation
|
|
19
|
-
- Reduced-motion fallback
|
|
20
|
-
- Accessibility baseline pass
|
|
21
|
-
- Responsive behavior verified on mobile and desktop
|
|
22
|
-
|
|
23
|
-
## Evidence
|
|
24
|
-
- Usability audit result
|
|
25
|
-
- Visual regression output
|
|
26
|
-
- Accessibility checklist result
|
|
27
|
-
- Release notes for motion and interaction changes
|
|
28
|
-
|
|
29
|
-
## Fallback
|
|
1
|
+
# Frontend Skill Pack
|
|
2
|
+
|
|
3
|
+
Default tier: `advance`
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
Deliver frontend experiences that are visually intentional, accessible, and efficient.
|
|
7
|
+
|
|
8
|
+
## In Scope
|
|
9
|
+
- UI architecture and component composition
|
|
10
|
+
- Responsive layouts and breakpoints
|
|
11
|
+
- Motion, animation, and interaction polish
|
|
12
|
+
- Accessibility and keyboard flows
|
|
13
|
+
- Conversion clarity and onboarding flow
|
|
14
|
+
|
|
15
|
+
## Must-Have Checks
|
|
16
|
+
- Feature-driven folder structure
|
|
17
|
+
- Smart and dumb component separation
|
|
18
|
+
- Server state and client state separation
|
|
19
|
+
- Reduced-motion fallback
|
|
20
|
+
- Accessibility baseline pass
|
|
21
|
+
- Responsive behavior verified on mobile and desktop
|
|
22
|
+
|
|
23
|
+
## Evidence
|
|
24
|
+
- Usability audit result
|
|
25
|
+
- Visual regression output
|
|
26
|
+
- Accessibility checklist result
|
|
27
|
+
- Release notes for motion and interaction changes
|
|
28
|
+
|
|
29
|
+
## Fallback
|
|
30
30
|
- If a feature cannot meet the advance tier, ship standard mode only as a temporary compatibility path.
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# Fullstack Engineering Skills
|
|
2
|
-
|
|
3
|
-
Default tier: `advance`
|
|
4
|
-
|
|
5
|
-
This domain connects frontend and backend implementation into a single feature-delivery workflow. The guidance combines architecture patterns from awesome-copilot, operational checklists from MiniMax, and practical delivery patterns from antigravity.
|
|
6
|
-
|
|
7
|
-
## Topics
|
|
8
|
-
- [Feature Slicing](feature-slicing.md) - Organize UI, service, repository, and tests around one business capability
|
|
9
|
-
- [Contracts](contracts.md) - Keep API schemas, DTOs, and frontend types synchronized
|
|
10
|
-
- [End-to-End](end-to-end.md) - Release readiness by verified user journeys and operational gates
|
|
11
|
-
|
|
12
|
-
## Operating Model
|
|
13
|
-
- Use `advance` for normal feature development.
|
|
14
|
-
- Escalate to `expert` when a feature crosses multiple bounded contexts or service boundaries.
|
|
15
|
-
|
|
16
|
-
## Above-Line Additions
|
|
17
|
-
- Contract drift detection in CI before merge.
|
|
18
|
-
- Backward-compatibility checks for API changes.
|
|
1
|
+
# Fullstack Engineering Skills
|
|
2
|
+
|
|
3
|
+
Default tier: `advance`
|
|
4
|
+
|
|
5
|
+
This domain connects frontend and backend implementation into a single feature-delivery workflow. The guidance combines architecture patterns from awesome-copilot, operational checklists from MiniMax, and practical delivery patterns from antigravity.
|
|
6
|
+
|
|
7
|
+
## Topics
|
|
8
|
+
- [Feature Slicing](feature-slicing.md) - Organize UI, service, repository, and tests around one business capability
|
|
9
|
+
- [Contracts](contracts.md) - Keep API schemas, DTOs, and frontend types synchronized
|
|
10
|
+
- [End-to-End](end-to-end.md) - Release readiness by verified user journeys and operational gates
|
|
11
|
+
|
|
12
|
+
## Operating Model
|
|
13
|
+
- Use `advance` for normal feature development.
|
|
14
|
+
- Escalate to `expert` when a feature crosses multiple bounded contexts or service boundaries.
|
|
15
|
+
|
|
16
|
+
## Above-Line Additions
|
|
17
|
+
- Contract drift detection in CI before merge.
|
|
18
|
+
- Backward-compatibility checks for API changes.
|
|
19
19
|
- Release evidence bundle for end-to-end readiness.
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
# Contracts
|
|
2
|
-
|
|
3
|
-
Tier: EXPERT
|
|
4
|
-
|
|
5
|
-
Contracts keep frontend expectations and backend behavior aligned through explicit schemas. A contract is not documentation only; it is an executable guardrail.
|
|
6
|
-
|
|
7
|
-
## Contract Sources
|
|
8
|
-
|
|
9
|
-
- API specification: OpenAPI 3.1 for HTTP boundaries.
|
|
10
|
-
- Runtime validation: Zod/Pydantic at service edges.
|
|
11
|
-
- Type generation: frontend types generated from server contract.
|
|
12
|
-
|
|
13
|
-
## Required Pipeline
|
|
14
|
-
|
|
15
|
-
1. Define or update schema in contract source.
|
|
16
|
-
2. Regenerate consumer types.
|
|
17
|
-
3. Run contract tests against provider and consumer.
|
|
18
|
-
4. Fail CI if drift is detected.
|
|
19
|
-
|
|
20
|
-
## Drift Prevention
|
|
21
|
-
|
|
22
|
-
Common drift scenarios:
|
|
23
|
-
- Backend renames field but frontend still expects old key.
|
|
24
|
-
- Enum expands or changes values without consumer handling.
|
|
25
|
-
- Response shape changes silently in minor release.
|
|
26
|
-
|
|
27
|
-
Control strategy:
|
|
28
|
-
- Pin contract artifact version.
|
|
29
|
-
- Require schema diff check in pull request.
|
|
30
|
-
- Block merge on unreviewed breaking changes.
|
|
31
|
-
|
|
32
|
-
## Breaking Change Policy
|
|
33
|
-
|
|
34
|
-
- Additive changes: allowed in minor version if backward-compatible.
|
|
35
|
-
- Behavioral changes: require release note and migration note.
|
|
36
|
-
- Breaking schema changes: major version bump with compatibility plan.
|
|
37
|
-
|
|
38
|
-
## Example Workflow
|
|
39
|
-
|
|
40
|
-
```text
|
|
41
|
-
contracts/openapi.yaml updated
|
|
42
|
-
-> generate frontend types
|
|
43
|
-
-> run provider contract tests
|
|
44
|
-
-> run consumer compatibility tests
|
|
45
|
-
-> publish artifact only if all checks pass
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## Review Checklist
|
|
49
|
-
|
|
50
|
-
- [ ] Contract source is versioned and reviewed.
|
|
51
|
-
- [ ] Provider and consumer tests both pass.
|
|
52
|
-
- [ ] Breaking changes are tagged and documented.
|
|
1
|
+
# Contracts
|
|
2
|
+
|
|
3
|
+
Tier: EXPERT
|
|
4
|
+
|
|
5
|
+
Contracts keep frontend expectations and backend behavior aligned through explicit schemas. A contract is not documentation only; it is an executable guardrail.
|
|
6
|
+
|
|
7
|
+
## Contract Sources
|
|
8
|
+
|
|
9
|
+
- API specification: OpenAPI 3.1 for HTTP boundaries.
|
|
10
|
+
- Runtime validation: Zod/Pydantic at service edges.
|
|
11
|
+
- Type generation: frontend types generated from server contract.
|
|
12
|
+
|
|
13
|
+
## Required Pipeline
|
|
14
|
+
|
|
15
|
+
1. Define or update schema in contract source.
|
|
16
|
+
2. Regenerate consumer types.
|
|
17
|
+
3. Run contract tests against provider and consumer.
|
|
18
|
+
4. Fail CI if drift is detected.
|
|
19
|
+
|
|
20
|
+
## Drift Prevention
|
|
21
|
+
|
|
22
|
+
Common drift scenarios:
|
|
23
|
+
- Backend renames field but frontend still expects old key.
|
|
24
|
+
- Enum expands or changes values without consumer handling.
|
|
25
|
+
- Response shape changes silently in minor release.
|
|
26
|
+
|
|
27
|
+
Control strategy:
|
|
28
|
+
- Pin contract artifact version.
|
|
29
|
+
- Require schema diff check in pull request.
|
|
30
|
+
- Block merge on unreviewed breaking changes.
|
|
31
|
+
|
|
32
|
+
## Breaking Change Policy
|
|
33
|
+
|
|
34
|
+
- Additive changes: allowed in minor version if backward-compatible.
|
|
35
|
+
- Behavioral changes: require release note and migration note.
|
|
36
|
+
- Breaking schema changes: major version bump with compatibility plan.
|
|
37
|
+
|
|
38
|
+
## Example Workflow
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
contracts/openapi.yaml updated
|
|
42
|
+
-> generate frontend types
|
|
43
|
+
-> run provider contract tests
|
|
44
|
+
-> run consumer compatibility tests
|
|
45
|
+
-> publish artifact only if all checks pass
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Review Checklist
|
|
49
|
+
|
|
50
|
+
- [ ] Contract source is versioned and reviewed.
|
|
51
|
+
- [ ] Provider and consumer tests both pass.
|
|
52
|
+
- [ ] Breaking changes are tagged and documented.
|
|
53
53
|
- [ ] Migration path is included before release.
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
# End-to-End
|
|
2
|
-
|
|
3
|
-
Tier: ADVANCE
|
|
4
|
-
|
|
5
|
-
End-to-end validation is the final quality gate that confirms critical user behavior across UI, API, persistence, and integrations.
|
|
6
|
-
|
|
7
|
-
## Critical Paths First
|
|
8
|
-
|
|
9
|
-
Always cover:
|
|
10
|
-
- Authentication and session lifecycle.
|
|
11
|
-
- Primary revenue path (example: checkout, payment, order completion).
|
|
12
|
-
- Error recovery paths (timeouts, retries, invalid input).
|
|
13
|
-
- Role-based authorization boundaries.
|
|
14
|
-
|
|
15
|
-
## Test Strategy
|
|
16
|
-
|
|
17
|
-
- Unit tests: fast local confidence.
|
|
18
|
-
- Integration tests: service and repository behavior.
|
|
19
|
-
- End-to-end tests: user-visible workflows in realistic environment.
|
|
20
|
-
|
|
21
|
-
End-to-end tests should be selective and high signal. Avoid using them to test every internal branch.
|
|
22
|
-
|
|
23
|
-
## Release Evidence Bundle
|
|
24
|
-
|
|
25
|
-
For each release candidate, publish:
|
|
26
|
-
- End-to-end test report for critical journeys.
|
|
27
|
-
- Contract validation report.
|
|
28
|
-
- Benchmark delta report for performance-sensitive flows.
|
|
29
|
-
- Known risk summary and mitigation owner.
|
|
30
|
-
|
|
31
|
-
## Failure Policy
|
|
32
|
-
|
|
33
|
-
- Block release on failed critical journey tests.
|
|
34
|
-
- Block release when test environment is inconsistent with target runtime.
|
|
35
|
-
- Allow non-critical failures only with explicit risk acceptance and owner.
|
|
36
|
-
|
|
37
|
-
## Review Checklist
|
|
38
|
-
|
|
39
|
-
- [ ] Critical user journeys are covered.
|
|
40
|
-
- [ ] End-to-end tests run in CI on release candidate.
|
|
41
|
-
- [ ] Reports are archived as release artifacts.
|
|
1
|
+
# End-to-End
|
|
2
|
+
|
|
3
|
+
Tier: ADVANCE
|
|
4
|
+
|
|
5
|
+
End-to-end validation is the final quality gate that confirms critical user behavior across UI, API, persistence, and integrations.
|
|
6
|
+
|
|
7
|
+
## Critical Paths First
|
|
8
|
+
|
|
9
|
+
Always cover:
|
|
10
|
+
- Authentication and session lifecycle.
|
|
11
|
+
- Primary revenue path (example: checkout, payment, order completion).
|
|
12
|
+
- Error recovery paths (timeouts, retries, invalid input).
|
|
13
|
+
- Role-based authorization boundaries.
|
|
14
|
+
|
|
15
|
+
## Test Strategy
|
|
16
|
+
|
|
17
|
+
- Unit tests: fast local confidence.
|
|
18
|
+
- Integration tests: service and repository behavior.
|
|
19
|
+
- End-to-end tests: user-visible workflows in realistic environment.
|
|
20
|
+
|
|
21
|
+
End-to-end tests should be selective and high signal. Avoid using them to test every internal branch.
|
|
22
|
+
|
|
23
|
+
## Release Evidence Bundle
|
|
24
|
+
|
|
25
|
+
For each release candidate, publish:
|
|
26
|
+
- End-to-end test report for critical journeys.
|
|
27
|
+
- Contract validation report.
|
|
28
|
+
- Benchmark delta report for performance-sensitive flows.
|
|
29
|
+
- Known risk summary and mitigation owner.
|
|
30
|
+
|
|
31
|
+
## Failure Policy
|
|
32
|
+
|
|
33
|
+
- Block release on failed critical journey tests.
|
|
34
|
+
- Block release when test environment is inconsistent with target runtime.
|
|
35
|
+
- Allow non-critical failures only with explicit risk acceptance and owner.
|
|
36
|
+
|
|
37
|
+
## Review Checklist
|
|
38
|
+
|
|
39
|
+
- [ ] Critical user journeys are covered.
|
|
40
|
+
- [ ] End-to-end tests run in CI on release candidate.
|
|
41
|
+
- [ ] Reports are archived as release artifacts.
|
|
42
42
|
- [ ] Failures are triaged with owner and deadline.
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
# Feature Slicing
|
|
2
|
-
|
|
3
|
-
Tier: ADVANCE
|
|
4
|
-
|
|
5
|
-
Feature slicing organizes implementation around business capabilities instead of technical file types. A single feature owns its UI, service orchestration, persistence adapters, and tests.
|
|
6
|
-
|
|
7
|
-
## Why It Matters
|
|
8
|
-
|
|
9
|
-
- Improves ownership: one team can ship and maintain a feature end to end.
|
|
10
|
-
- Reduces coupling: changes stay local to one capability.
|
|
11
|
-
- Speeds delivery: less coordination across unrelated folders.
|
|
12
|
-
|
|
13
|
-
## Recommended Layout
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
src/
|
|
17
|
-
features/
|
|
18
|
-
checkout/
|
|
19
|
-
ui/
|
|
20
|
-
service/
|
|
21
|
-
repository/
|
|
22
|
-
contracts/
|
|
23
|
-
tests/
|
|
24
|
-
index.ts
|
|
25
|
-
orders/
|
|
26
|
-
ui/
|
|
27
|
-
service/
|
|
28
|
-
repository/
|
|
29
|
-
contracts/
|
|
30
|
-
tests/
|
|
31
|
-
index.ts
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Module Boundary Rules
|
|
35
|
-
|
|
36
|
-
- Expose only through `index.ts` as the feature public API.
|
|
37
|
-
- Do not import private files across feature folders.
|
|
38
|
-
- Keep shared utilities in a neutral shared module; avoid feature-to-feature deep imports.
|
|
39
|
-
|
|
40
|
-
## Anti-Patterns
|
|
41
|
-
|
|
42
|
-
Bad:
|
|
43
|
-
- `src/components`, `src/services`, `src/repositories` global buckets for all features.
|
|
44
|
-
- Shared folder becoming a dumping ground for feature-specific code.
|
|
45
|
-
- One feature mutating another feature's database entities directly.
|
|
46
|
-
|
|
47
|
-
Good:
|
|
48
|
-
- Feature package exposes explicit use-cases and UI entrypoints.
|
|
49
|
-
- Cross-feature communication uses contracts and events.
|
|
50
|
-
- Shared module limited to stateless primitives and infrastructure adapters.
|
|
51
|
-
|
|
52
|
-
## Integration Workflow
|
|
53
|
-
|
|
54
|
-
1. Define capability and boundary (example: checkout).
|
|
55
|
-
2. Define public API for the feature module.
|
|
56
|
-
3. Implement UI and service logic inside the feature.
|
|
57
|
-
4. Add repository and contract definitions.
|
|
58
|
-
5. Add unit/integration/end-to-end tests within the feature.
|
|
59
|
-
|
|
60
|
-
## Review Checklist
|
|
61
|
-
|
|
62
|
-
- [ ] Feature can be understood without reading unrelated modules.
|
|
63
|
-
- [ ] No deep import across feature boundaries.
|
|
64
|
-
- [ ] Public API is explicit and stable.
|
|
1
|
+
# Feature Slicing
|
|
2
|
+
|
|
3
|
+
Tier: ADVANCE
|
|
4
|
+
|
|
5
|
+
Feature slicing organizes implementation around business capabilities instead of technical file types. A single feature owns its UI, service orchestration, persistence adapters, and tests.
|
|
6
|
+
|
|
7
|
+
## Why It Matters
|
|
8
|
+
|
|
9
|
+
- Improves ownership: one team can ship and maintain a feature end to end.
|
|
10
|
+
- Reduces coupling: changes stay local to one capability.
|
|
11
|
+
- Speeds delivery: less coordination across unrelated folders.
|
|
12
|
+
|
|
13
|
+
## Recommended Layout
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
src/
|
|
17
|
+
features/
|
|
18
|
+
checkout/
|
|
19
|
+
ui/
|
|
20
|
+
service/
|
|
21
|
+
repository/
|
|
22
|
+
contracts/
|
|
23
|
+
tests/
|
|
24
|
+
index.ts
|
|
25
|
+
orders/
|
|
26
|
+
ui/
|
|
27
|
+
service/
|
|
28
|
+
repository/
|
|
29
|
+
contracts/
|
|
30
|
+
tests/
|
|
31
|
+
index.ts
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Module Boundary Rules
|
|
35
|
+
|
|
36
|
+
- Expose only through `index.ts` as the feature public API.
|
|
37
|
+
- Do not import private files across feature folders.
|
|
38
|
+
- Keep shared utilities in a neutral shared module; avoid feature-to-feature deep imports.
|
|
39
|
+
|
|
40
|
+
## Anti-Patterns
|
|
41
|
+
|
|
42
|
+
Bad:
|
|
43
|
+
- `src/components`, `src/services`, `src/repositories` global buckets for all features.
|
|
44
|
+
- Shared folder becoming a dumping ground for feature-specific code.
|
|
45
|
+
- One feature mutating another feature's database entities directly.
|
|
46
|
+
|
|
47
|
+
Good:
|
|
48
|
+
- Feature package exposes explicit use-cases and UI entrypoints.
|
|
49
|
+
- Cross-feature communication uses contracts and events.
|
|
50
|
+
- Shared module limited to stateless primitives and infrastructure adapters.
|
|
51
|
+
|
|
52
|
+
## Integration Workflow
|
|
53
|
+
|
|
54
|
+
1. Define capability and boundary (example: checkout).
|
|
55
|
+
2. Define public API for the feature module.
|
|
56
|
+
3. Implement UI and service logic inside the feature.
|
|
57
|
+
4. Add repository and contract definitions.
|
|
58
|
+
5. Add unit/integration/end-to-end tests within the feature.
|
|
59
|
+
|
|
60
|
+
## Review Checklist
|
|
61
|
+
|
|
62
|
+
- [ ] Feature can be understood without reading unrelated modules.
|
|
63
|
+
- [ ] No deep import across feature boundaries.
|
|
64
|
+
- [ ] Public API is explicit and stable.
|
|
65
65
|
- [ ] Tests live with the feature and cover core behavior.
|