forgecraft-mcp 1.2.0 → 1.3.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/README.md +525 -525
- package/dist/cli/help.js +44 -44
- package/dist/registry/renderer-skeletons.js +92 -92
- package/dist/shared/gs-score-logger.js +6 -6
- package/dist/tools/add-module.js +123 -123
- package/dist/tools/advice-registry.js +18 -18
- package/dist/tools/check-cascade-report.js +64 -64
- package/dist/tools/configure-mcp.d.ts +3 -0
- package/dist/tools/configure-mcp.d.ts.map +1 -1
- package/dist/tools/configure-mcp.js +10 -0
- package/dist/tools/configure-mcp.js.map +1 -1
- package/dist/tools/forgecraft-dispatch.d.ts.map +1 -1
- package/dist/tools/forgecraft-dispatch.js +3 -0
- package/dist/tools/forgecraft-dispatch.js.map +1 -1
- package/dist/tools/forgecraft-schema-params.d.ts +9 -0
- package/dist/tools/forgecraft-schema-params.d.ts.map +1 -1
- package/dist/tools/forgecraft-schema-params.js +21 -0
- package/dist/tools/forgecraft-schema-params.js.map +1 -1
- package/dist/tools/forgecraft-schema.d.ts +9 -0
- package/dist/tools/forgecraft-schema.d.ts.map +1 -1
- package/dist/tools/refresh-output.js +14 -14
- package/dist/tools/scaffold-spec-stubs.js +115 -115
- package/dist/tools/scaffold-templates.js +62 -62
- package/dist/tools/setup-artifact-writers.d.ts +30 -0
- package/dist/tools/setup-artifact-writers.d.ts.map +1 -1
- package/dist/tools/setup-artifact-writers.js +120 -8
- package/dist/tools/setup-artifact-writers.js.map +1 -1
- package/dist/tools/setup-phase1.d.ts +3 -0
- package/dist/tools/setup-phase1.d.ts.map +1 -1
- package/dist/tools/setup-phase1.js +79 -35
- package/dist/tools/setup-phase1.js.map +1 -1
- package/dist/tools/setup-phase2.d.ts +2 -0
- package/dist/tools/setup-phase2.d.ts.map +1 -1
- package/dist/tools/setup-phase2.js +10 -1
- package/dist/tools/setup-phase2.js.map +1 -1
- package/dist/tools/setup-project.d.ts +18 -0
- package/dist/tools/setup-project.d.ts.map +1 -1
- package/dist/tools/setup-project.js +77 -1
- package/dist/tools/setup-project.js.map +1 -1
- package/dist/tools/spec-parser-tags.d.ts +9 -0
- package/dist/tools/spec-parser-tags.d.ts.map +1 -1
- package/dist/tools/spec-parser-tags.js +92 -0
- package/dist/tools/spec-parser-tags.js.map +1 -1
- package/package.json +89 -86
- package/templates/analytics/instructions.yaml +37 -37
- package/templates/analytics/mcp-servers.yaml +11 -11
- package/templates/analytics/structure.yaml +25 -25
- package/templates/api/instructions.yaml +231 -231
- package/templates/api/mcp-servers.yaml +22 -13
- package/templates/api/nfr.yaml +23 -23
- package/templates/api/review.yaml +103 -103
- package/templates/api/structure.yaml +34 -34
- package/templates/api/verification.yaml +132 -132
- package/templates/cli/instructions.yaml +31 -31
- package/templates/cli/mcp-servers.yaml +11 -11
- package/templates/cli/review.yaml +53 -53
- package/templates/cli/structure.yaml +16 -16
- package/templates/data-lineage/instructions.yaml +28 -28
- package/templates/data-lineage/mcp-servers.yaml +22 -22
- package/templates/data-pipeline/instructions.yaml +84 -84
- package/templates/data-pipeline/mcp-servers.yaml +13 -13
- package/templates/data-pipeline/nfr.yaml +39 -39
- package/templates/data-pipeline/structure.yaml +23 -23
- package/templates/fintech/hooks.yaml +55 -55
- package/templates/fintech/instructions.yaml +112 -112
- package/templates/fintech/mcp-servers.yaml +13 -13
- package/templates/fintech/nfr.yaml +46 -46
- package/templates/fintech/playbook.yaml +210 -210
- package/templates/fintech/verification.yaml +239 -239
- package/templates/game/instructions.yaml +289 -289
- package/templates/game/mcp-servers.yaml +38 -38
- package/templates/game/nfr.yaml +64 -64
- package/templates/game/playbook.yaml +214 -214
- package/templates/game/review.yaml +97 -97
- package/templates/game/structure.yaml +67 -67
- package/templates/game/verification.yaml +174 -174
- package/templates/healthcare/instructions.yaml +42 -42
- package/templates/healthcare/mcp-servers.yaml +13 -13
- package/templates/healthcare/nfr.yaml +47 -47
- package/templates/hipaa/instructions.yaml +41 -41
- package/templates/hipaa/mcp-servers.yaml +13 -13
- package/templates/infra/instructions.yaml +104 -104
- package/templates/infra/mcp-servers.yaml +20 -20
- package/templates/infra/nfr.yaml +46 -46
- package/templates/infra/review.yaml +65 -65
- package/templates/infra/structure.yaml +25 -25
- package/templates/library/instructions.yaml +36 -36
- package/templates/library/mcp-servers.yaml +20 -20
- package/templates/library/review.yaml +56 -56
- package/templates/library/structure.yaml +19 -19
- package/templates/medallion-architecture/instructions.yaml +41 -41
- package/templates/medallion-architecture/mcp-servers.yaml +22 -22
- package/templates/ml/instructions.yaml +85 -85
- package/templates/ml/mcp-servers.yaml +11 -11
- package/templates/ml/nfr.yaml +39 -39
- package/templates/ml/structure.yaml +25 -25
- package/templates/ml/verification.yaml +156 -156
- package/templates/mobile/instructions.yaml +44 -44
- package/templates/mobile/mcp-servers.yaml +11 -11
- package/templates/mobile/nfr.yaml +49 -49
- package/templates/mobile/structure.yaml +27 -27
- package/templates/mobile/verification.yaml +121 -121
- package/templates/observability-xray/instructions.yaml +40 -40
- package/templates/observability-xray/mcp-servers.yaml +15 -15
- package/templates/realtime/instructions.yaml +42 -42
- package/templates/realtime/mcp-servers.yaml +13 -13
- package/templates/soc2/instructions.yaml +41 -41
- package/templates/soc2/mcp-servers.yaml +24 -24
- package/templates/social/instructions.yaml +43 -43
- package/templates/social/mcp-servers.yaml +24 -24
- package/templates/state-machine/instructions.yaml +42 -42
- package/templates/state-machine/mcp-servers.yaml +11 -11
- package/templates/tools-registry.yaml +164 -164
- package/templates/universal/hooks.yaml +531 -531
- package/templates/universal/instructions.yaml +1692 -1692
- package/templates/universal/mcp-servers.yaml +50 -50
- package/templates/universal/nfr.yaml +197 -197
- package/templates/universal/reference.yaml +326 -326
- package/templates/universal/review.yaml +204 -204
- package/templates/universal/skills.yaml +262 -262
- package/templates/universal/structure.yaml +67 -67
- package/templates/universal/verification.yaml +416 -416
- package/templates/web-react/hooks.yaml +44 -44
- package/templates/web-react/instructions.yaml +207 -207
- package/templates/web-react/mcp-servers.yaml +20 -20
- package/templates/web-react/nfr.yaml +27 -27
- package/templates/web-react/review.yaml +94 -94
- package/templates/web-react/structure.yaml +46 -46
- package/templates/web-react/verification.yaml +126 -126
- package/templates/web-static/instructions.yaml +115 -115
- package/templates/web-static/mcp-servers.yaml +20 -20
- package/templates/web3/instructions.yaml +44 -44
- package/templates/web3/mcp-servers.yaml +11 -11
- package/templates/web3/verification.yaml +159 -159
- package/templates/zero-trust/instructions.yaml +41 -41
- package/templates/zero-trust/mcp-servers.yaml +15 -15
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
tag: MOBILE
|
|
2
|
-
section: nfr
|
|
3
|
-
blocks:
|
|
4
|
-
- id: mobile-performance
|
|
5
|
-
tier: recommended
|
|
6
|
-
title: "Mobile Performance"
|
|
7
|
-
content: |
|
|
8
|
-
## NFR: Mobile Performance
|
|
9
|
-
|
|
10
|
-
### App Size
|
|
11
|
-
- Initial download: < {{app_size_mb | default: 30}} MB.
|
|
12
|
-
- On-demand asset downloading for heavy content (maps, ML models, media packs).
|
|
13
|
-
- Monitor app size in CI — PRs that increase binary > 5% require justification.
|
|
14
|
-
|
|
15
|
-
### Startup
|
|
16
|
-
- Cold start to interactive: < {{cold_start_ms | default: 2000}} ms.
|
|
17
|
-
- Lazy-initialize non-critical services. Show skeleton UI immediately.
|
|
18
|
-
- Splash screen is not a crutch — measure time-to-interactive, not time-to-splash.
|
|
19
|
-
|
|
20
|
-
### Battery & Network
|
|
21
|
-
- Background work budgeted. No unnecessary wake-locks, polling, or GPS.
|
|
22
|
-
- Network requests batched where possible. Respect low-data mode settings.
|
|
23
|
-
- Offline-first: core features work without connectivity. Sync on reconnect.
|
|
24
|
-
|
|
25
|
-
### Runtime
|
|
26
|
-
- 60 FPS for scrolling and animations. Profile and fix jank.
|
|
27
|
-
- Memory budget per screen. Monitor for leaks (LeakCanary, Instruments).
|
|
28
|
-
- No main-thread blocking operations > 16ms.
|
|
29
|
-
|
|
30
|
-
- id: mobile-ux
|
|
31
|
-
tier: recommended
|
|
32
|
-
title: "Mobile UX Quality"
|
|
33
|
-
content: |
|
|
34
|
-
## NFR: Mobile UX Quality
|
|
35
|
-
|
|
36
|
-
### Platform Compliance
|
|
37
|
-
- Follow platform guidelines: Material Design (Android), Human Interface Guidelines (iOS).
|
|
38
|
-
- Support system dark mode, dynamic type / font scaling, and accessibility features.
|
|
39
|
-
- Deep links and universal links configured and tested.
|
|
40
|
-
|
|
41
|
-
### Crash Rate
|
|
42
|
-
- Target crash-free rate: ≥ {{crash_free_target | default: 99.5%}}.
|
|
43
|
-
- Crash reporting (Crashlytics, Sentry) integrated. Crashes triaged within 24 hours.
|
|
44
|
-
- ANR (Application Not Responding) rate: < 0.5%.
|
|
45
|
-
|
|
46
|
-
### Updates
|
|
47
|
-
- Over-the-air updates for JS layer (CodePush, Expo Updates) where appropriate.
|
|
48
|
-
- Force-update mechanism for critical security patches.
|
|
49
|
-
- Backward-compatible API versioning — old app versions must gracefully degrade.
|
|
1
|
+
tag: MOBILE
|
|
2
|
+
section: nfr
|
|
3
|
+
blocks:
|
|
4
|
+
- id: mobile-performance
|
|
5
|
+
tier: recommended
|
|
6
|
+
title: "Mobile Performance"
|
|
7
|
+
content: |
|
|
8
|
+
## NFR: Mobile Performance
|
|
9
|
+
|
|
10
|
+
### App Size
|
|
11
|
+
- Initial download: < {{app_size_mb | default: 30}} MB.
|
|
12
|
+
- On-demand asset downloading for heavy content (maps, ML models, media packs).
|
|
13
|
+
- Monitor app size in CI — PRs that increase binary > 5% require justification.
|
|
14
|
+
|
|
15
|
+
### Startup
|
|
16
|
+
- Cold start to interactive: < {{cold_start_ms | default: 2000}} ms.
|
|
17
|
+
- Lazy-initialize non-critical services. Show skeleton UI immediately.
|
|
18
|
+
- Splash screen is not a crutch — measure time-to-interactive, not time-to-splash.
|
|
19
|
+
|
|
20
|
+
### Battery & Network
|
|
21
|
+
- Background work budgeted. No unnecessary wake-locks, polling, or GPS.
|
|
22
|
+
- Network requests batched where possible. Respect low-data mode settings.
|
|
23
|
+
- Offline-first: core features work without connectivity. Sync on reconnect.
|
|
24
|
+
|
|
25
|
+
### Runtime
|
|
26
|
+
- 60 FPS for scrolling and animations. Profile and fix jank.
|
|
27
|
+
- Memory budget per screen. Monitor for leaks (LeakCanary, Instruments).
|
|
28
|
+
- No main-thread blocking operations > 16ms.
|
|
29
|
+
|
|
30
|
+
- id: mobile-ux
|
|
31
|
+
tier: recommended
|
|
32
|
+
title: "Mobile UX Quality"
|
|
33
|
+
content: |
|
|
34
|
+
## NFR: Mobile UX Quality
|
|
35
|
+
|
|
36
|
+
### Platform Compliance
|
|
37
|
+
- Follow platform guidelines: Material Design (Android), Human Interface Guidelines (iOS).
|
|
38
|
+
- Support system dark mode, dynamic type / font scaling, and accessibility features.
|
|
39
|
+
- Deep links and universal links configured and tested.
|
|
40
|
+
|
|
41
|
+
### Crash Rate
|
|
42
|
+
- Target crash-free rate: ≥ {{crash_free_target | default: 99.5%}}.
|
|
43
|
+
- Crash reporting (Crashlytics, Sentry) integrated. Crashes triaged within 24 hours.
|
|
44
|
+
- ANR (Application Not Responding) rate: < 0.5%.
|
|
45
|
+
|
|
46
|
+
### Updates
|
|
47
|
+
- Over-the-air updates for JS layer (CodePush, Expo Updates) where appropriate.
|
|
48
|
+
- Force-update mechanism for critical security patches.
|
|
49
|
+
- Backward-compatible API versioning — old app versions must gracefully degrade.
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
tag: MOBILE
|
|
2
|
-
section: structure
|
|
3
|
-
entries:
|
|
4
|
-
- path: src/screens/
|
|
5
|
-
description: "Screen-level components — one directory per screen"
|
|
6
|
-
- path: src/components/
|
|
7
|
-
description: "Shared UI components: buttons, cards, inputs, modals"
|
|
8
|
-
- path: src/navigation/
|
|
9
|
-
description: "Navigation configuration: stack, tab, drawer navigators"
|
|
10
|
-
- path: src/services/
|
|
11
|
-
description: "API client, storage, auth, push notifications, analytics"
|
|
12
|
-
- path: src/hooks/
|
|
13
|
-
description: "Custom React Native hooks"
|
|
14
|
-
- path: src/store/
|
|
15
|
-
description: "State management: slices, selectors, async thunks"
|
|
16
|
-
- path: src/utils/
|
|
17
|
-
description: "Platform-agnostic utilities and helpers"
|
|
18
|
-
- path: src/theme/
|
|
19
|
-
description: "Design tokens, colors, typography, spacing"
|
|
20
|
-
- path: src/locales/
|
|
21
|
-
description: "Translation JSON files per locale"
|
|
22
|
-
- path: assets/
|
|
23
|
-
description: "Images, fonts, animations (Lottie)"
|
|
24
|
-
- path: __tests__/
|
|
25
|
-
description: "Unit and integration tests"
|
|
26
|
-
- path: e2e/
|
|
27
|
-
description: "End-to-end tests (Detox, Maestro, or Appium)"
|
|
1
|
+
tag: MOBILE
|
|
2
|
+
section: structure
|
|
3
|
+
entries:
|
|
4
|
+
- path: src/screens/
|
|
5
|
+
description: "Screen-level components — one directory per screen"
|
|
6
|
+
- path: src/components/
|
|
7
|
+
description: "Shared UI components: buttons, cards, inputs, modals"
|
|
8
|
+
- path: src/navigation/
|
|
9
|
+
description: "Navigation configuration: stack, tab, drawer navigators"
|
|
10
|
+
- path: src/services/
|
|
11
|
+
description: "API client, storage, auth, push notifications, analytics"
|
|
12
|
+
- path: src/hooks/
|
|
13
|
+
description: "Custom React Native hooks"
|
|
14
|
+
- path: src/store/
|
|
15
|
+
description: "State management: slices, selectors, async thunks"
|
|
16
|
+
- path: src/utils/
|
|
17
|
+
description: "Platform-agnostic utilities and helpers"
|
|
18
|
+
- path: src/theme/
|
|
19
|
+
description: "Design tokens, colors, typography, spacing"
|
|
20
|
+
- path: src/locales/
|
|
21
|
+
description: "Translation JSON files per locale"
|
|
22
|
+
- path: assets/
|
|
23
|
+
description: "Images, fonts, animations (Lottie)"
|
|
24
|
+
- path: __tests__/
|
|
25
|
+
description: "Unit and integration tests"
|
|
26
|
+
- path: e2e/
|
|
27
|
+
description: "End-to-end tests (Detox, Maestro, or Appium)"
|
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
tag: MOBILE
|
|
2
|
-
section: verification
|
|
3
|
-
title: "Mobile Navigational Path + Screenshot Verification"
|
|
4
|
-
description: >
|
|
5
|
-
Mobile UI behavior has the same behavioral uncertainty as WEB-REACT but adds
|
|
6
|
-
platform-specific dimensions: touch targets, safe areas, OS permission dialogs,
|
|
7
|
-
hardware back button, deep links, and push notification appearance.
|
|
8
|
-
This strategy uses Playwright for React Native Web or Appium for native,
|
|
9
|
-
with Claude Vision assertions for screenshot-based behavioral contracts.
|
|
10
|
-
uncertainty_levels:
|
|
11
|
-
- behavioral
|
|
12
|
-
completeness_ceiling: 0.80
|
|
13
|
-
|
|
14
|
-
phases:
|
|
15
|
-
|
|
16
|
-
- id: contract-definition
|
|
17
|
-
title: "Define Mobile Navigation Contracts"
|
|
18
|
-
rationale: >
|
|
19
|
-
Mobile UX contracts must account for both platforms (iOS + Android) and
|
|
20
|
-
at minimum two viewport sizes (phone + tablet). Navigation paths must account
|
|
21
|
-
for OS-level interruptions: permission dialogs, push notifications, app backgrounding.
|
|
22
|
-
steps:
|
|
23
|
-
- id: define-use-case-paths
|
|
24
|
-
instruction: >
|
|
25
|
-
For each screen flow, define a numbered navigational path:
|
|
26
|
-
1. Starting screen and initial state
|
|
27
|
-
2. User gestures (tap, swipe, long-press, pinch) in order
|
|
28
|
-
3. Expected screen and visible elements after each gesture
|
|
29
|
-
4. Platform-specific branches (iOS vs Android where behavior diverges)
|
|
30
|
-
5. Terminal state (e.g., "payment confirmation screen with order summary visible")
|
|
31
|
-
Store in docs/use-cases/{feature}-mobile.md.
|
|
32
|
-
contract: >
|
|
33
|
-
docs/use-cases/ has *-mobile.md files.
|
|
34
|
-
Each file documents iOS and Android paths separately where they diverge.
|
|
35
|
-
tools: ["filesystem"]
|
|
36
|
-
expected_output: "docs/use-cases/checkout-mobile.md with iOS and Android sections"
|
|
37
|
-
pass_criterion: "File count in docs/use-cases/ matching *-mobile.md ≥ number of screen flows"
|
|
38
|
-
|
|
39
|
-
- id: define-touch-target-contracts
|
|
40
|
-
instruction: >
|
|
41
|
-
For every interactive element, define:
|
|
42
|
-
- Minimum tap target size (Apple HIG: 44x44pt, Material: 48x48dp)
|
|
43
|
-
- Minimum spacing between adjacent targets (Apple: 8pt, Material: 8dp)
|
|
44
|
-
- Label text for accessibility (VoiceOver / TalkBack)
|
|
45
|
-
Store in docs/mobile-accessibility-contracts.md.
|
|
46
|
-
contract: "docs/mobile-accessibility-contracts.md with ≥1 row per interactive element type"
|
|
47
|
-
tools: ["filesystem"]
|
|
48
|
-
expected_output: "| primary-button | 44x44pt | 8pt | 'Submit order' |"
|
|
49
|
-
pass_criterion: "File exists with tap target sizes and accessibility labels"
|
|
50
|
-
|
|
51
|
-
- id: execution
|
|
52
|
-
title: "Run Automated Tests + Screenshot Assertions"
|
|
53
|
-
rationale: >
|
|
54
|
-
Playwright for RN Web or Appium for native drives real gestures on emulators.
|
|
55
|
-
Screenshots at each step are asserted via Claude Vision against the contracts.
|
|
56
|
-
Touch target sizes are measured programmatically — no manual measurement.
|
|
57
|
-
steps:
|
|
58
|
-
- id: run-navigation-tests
|
|
59
|
-
instruction: >
|
|
60
|
-
Write and execute one test per use-case path. Use Playwright (RN Web) or Appium (native).
|
|
61
|
-
Each test:
|
|
62
|
-
1. Launches the app in the correct initial state
|
|
63
|
-
2. Executes gestures in the contracted order
|
|
64
|
-
3. Takes a screenshot after each state transition
|
|
65
|
-
4. Asserts DOM/hierarchy elements visible at each step
|
|
66
|
-
Run on iOS Simulator + Android Emulator.
|
|
67
|
-
contract: >
|
|
68
|
-
Test files present per use case. All tests pass on both platforms.
|
|
69
|
-
Screenshots saved per step in test-results/mobile/screenshots/.
|
|
70
|
-
tools: ["npx playwright test", "appium", "xcrun simctl", "emulator -avd"]
|
|
71
|
-
expected_output: "Test results + screenshots in test-results/mobile/"
|
|
72
|
-
pass_criterion: "All tests pass on both platforms; 0 failing navigation assertions"
|
|
73
|
-
|
|
74
|
-
- id: assert-screenshots-with-vision
|
|
75
|
-
instruction: >
|
|
76
|
-
For each screenshot, call Claude Vision with:
|
|
77
|
-
- The screenshot
|
|
78
|
-
- The platform (iOS/Android) and viewport (phone/tablet)
|
|
79
|
-
- The visual contract for that state
|
|
80
|
-
- Prompt: "Assert this mobile screenshot against the contract. List any FAILS. If all pass: PASS."
|
|
81
|
-
Run on all platform + viewport combinations.
|
|
82
|
-
contract: "All vision assertions return PASS on both platforms and both viewports"
|
|
83
|
-
tools: ["claude --vision", "anthropic vision API"]
|
|
84
|
-
expected_output: "vision-results.json: [{platform, viewport, screen, result}]"
|
|
85
|
-
pass_criterion: "All result = PASS"
|
|
86
|
-
requires_human_review: true
|
|
87
|
-
|
|
88
|
-
- id: measure-touch-targets
|
|
89
|
-
instruction: >
|
|
90
|
-
Using the accessibility tree (iOS Accessibility Inspector or Android UIAutomator),
|
|
91
|
-
retrieve the bounding rect of every interactive element. Assert that each element
|
|
92
|
-
meets the tap target size in docs/mobile-accessibility-contracts.md.
|
|
93
|
-
contract: "All interactive elements meet minimum tap target size on both platforms"
|
|
94
|
-
tools: ["XCTest accessibilityFrame", "UIAutomator getBounds", "accessibility-inspector"]
|
|
95
|
-
expected_output: "touch-target-report.json: [{element, platform, size_pt, passes_contract}]"
|
|
96
|
-
pass_criterion: "All passes_contract = true"
|
|
97
|
-
|
|
98
|
-
- id: evidence
|
|
99
|
-
title: "Persist Screenshots and Platform Test Reports"
|
|
100
|
-
rationale: >
|
|
101
|
-
Mobile screenshots are the only reliable evidence of cross-platform visual fidelity.
|
|
102
|
-
They must be committed or archived per release so regressions are detectable.
|
|
103
|
-
steps:
|
|
104
|
-
- id: persist-screenshots
|
|
105
|
-
instruction: >
|
|
106
|
-
Save one screenshot per step per platform to test-results/mobile/screenshots/{platform}/{test}/{step}.png.
|
|
107
|
-
Compress to <500KB per screenshot. Include platform, OS version, and app version in filename.
|
|
108
|
-
contract: "Screenshots exist for all tests on all platforms"
|
|
109
|
-
tools: ["playwright screenshot", "appium driver.saveScreenshot"]
|
|
110
|
-
expected_output: "test-results/mobile/screenshots/ios/checkout/step-3-confirm.png"
|
|
111
|
-
pass_criterion: "Screenshot count matches steps × platforms"
|
|
112
|
-
|
|
113
|
-
- id: persist-platform-reports
|
|
114
|
-
instruction: >
|
|
115
|
-
Save the JUnit XML report from Playwright/Appium to test-results/mobile/.
|
|
116
|
-
Save vision-results.json and touch-target-report.json to the same directory.
|
|
117
|
-
Record platform and OS versions tested in test-results/mobile/environment.json.
|
|
118
|
-
contract: "test-results/mobile/ has report, vision-results, touch-target-report, environment"
|
|
119
|
-
tools: ["playwright --reporter=junit", "appium --reporter"]
|
|
120
|
-
expected_output: "All 4 files present in test-results/mobile/"
|
|
121
|
-
pass_criterion: "Files exist and parse as valid JSON/XML"
|
|
1
|
+
tag: MOBILE
|
|
2
|
+
section: verification
|
|
3
|
+
title: "Mobile Navigational Path + Screenshot Verification"
|
|
4
|
+
description: >
|
|
5
|
+
Mobile UI behavior has the same behavioral uncertainty as WEB-REACT but adds
|
|
6
|
+
platform-specific dimensions: touch targets, safe areas, OS permission dialogs,
|
|
7
|
+
hardware back button, deep links, and push notification appearance.
|
|
8
|
+
This strategy uses Playwright for React Native Web or Appium for native,
|
|
9
|
+
with Claude Vision assertions for screenshot-based behavioral contracts.
|
|
10
|
+
uncertainty_levels:
|
|
11
|
+
- behavioral
|
|
12
|
+
completeness_ceiling: 0.80
|
|
13
|
+
|
|
14
|
+
phases:
|
|
15
|
+
|
|
16
|
+
- id: contract-definition
|
|
17
|
+
title: "Define Mobile Navigation Contracts"
|
|
18
|
+
rationale: >
|
|
19
|
+
Mobile UX contracts must account for both platforms (iOS + Android) and
|
|
20
|
+
at minimum two viewport sizes (phone + tablet). Navigation paths must account
|
|
21
|
+
for OS-level interruptions: permission dialogs, push notifications, app backgrounding.
|
|
22
|
+
steps:
|
|
23
|
+
- id: define-use-case-paths
|
|
24
|
+
instruction: >
|
|
25
|
+
For each screen flow, define a numbered navigational path:
|
|
26
|
+
1. Starting screen and initial state
|
|
27
|
+
2. User gestures (tap, swipe, long-press, pinch) in order
|
|
28
|
+
3. Expected screen and visible elements after each gesture
|
|
29
|
+
4. Platform-specific branches (iOS vs Android where behavior diverges)
|
|
30
|
+
5. Terminal state (e.g., "payment confirmation screen with order summary visible")
|
|
31
|
+
Store in docs/use-cases/{feature}-mobile.md.
|
|
32
|
+
contract: >
|
|
33
|
+
docs/use-cases/ has *-mobile.md files.
|
|
34
|
+
Each file documents iOS and Android paths separately where they diverge.
|
|
35
|
+
tools: ["filesystem"]
|
|
36
|
+
expected_output: "docs/use-cases/checkout-mobile.md with iOS and Android sections"
|
|
37
|
+
pass_criterion: "File count in docs/use-cases/ matching *-mobile.md ≥ number of screen flows"
|
|
38
|
+
|
|
39
|
+
- id: define-touch-target-contracts
|
|
40
|
+
instruction: >
|
|
41
|
+
For every interactive element, define:
|
|
42
|
+
- Minimum tap target size (Apple HIG: 44x44pt, Material: 48x48dp)
|
|
43
|
+
- Minimum spacing between adjacent targets (Apple: 8pt, Material: 8dp)
|
|
44
|
+
- Label text for accessibility (VoiceOver / TalkBack)
|
|
45
|
+
Store in docs/mobile-accessibility-contracts.md.
|
|
46
|
+
contract: "docs/mobile-accessibility-contracts.md with ≥1 row per interactive element type"
|
|
47
|
+
tools: ["filesystem"]
|
|
48
|
+
expected_output: "| primary-button | 44x44pt | 8pt | 'Submit order' |"
|
|
49
|
+
pass_criterion: "File exists with tap target sizes and accessibility labels"
|
|
50
|
+
|
|
51
|
+
- id: execution
|
|
52
|
+
title: "Run Automated Tests + Screenshot Assertions"
|
|
53
|
+
rationale: >
|
|
54
|
+
Playwright for RN Web or Appium for native drives real gestures on emulators.
|
|
55
|
+
Screenshots at each step are asserted via Claude Vision against the contracts.
|
|
56
|
+
Touch target sizes are measured programmatically — no manual measurement.
|
|
57
|
+
steps:
|
|
58
|
+
- id: run-navigation-tests
|
|
59
|
+
instruction: >
|
|
60
|
+
Write and execute one test per use-case path. Use Playwright (RN Web) or Appium (native).
|
|
61
|
+
Each test:
|
|
62
|
+
1. Launches the app in the correct initial state
|
|
63
|
+
2. Executes gestures in the contracted order
|
|
64
|
+
3. Takes a screenshot after each state transition
|
|
65
|
+
4. Asserts DOM/hierarchy elements visible at each step
|
|
66
|
+
Run on iOS Simulator + Android Emulator.
|
|
67
|
+
contract: >
|
|
68
|
+
Test files present per use case. All tests pass on both platforms.
|
|
69
|
+
Screenshots saved per step in test-results/mobile/screenshots/.
|
|
70
|
+
tools: ["npx playwright test", "appium", "xcrun simctl", "emulator -avd"]
|
|
71
|
+
expected_output: "Test results + screenshots in test-results/mobile/"
|
|
72
|
+
pass_criterion: "All tests pass on both platforms; 0 failing navigation assertions"
|
|
73
|
+
|
|
74
|
+
- id: assert-screenshots-with-vision
|
|
75
|
+
instruction: >
|
|
76
|
+
For each screenshot, call Claude Vision with:
|
|
77
|
+
- The screenshot
|
|
78
|
+
- The platform (iOS/Android) and viewport (phone/tablet)
|
|
79
|
+
- The visual contract for that state
|
|
80
|
+
- Prompt: "Assert this mobile screenshot against the contract. List any FAILS. If all pass: PASS."
|
|
81
|
+
Run on all platform + viewport combinations.
|
|
82
|
+
contract: "All vision assertions return PASS on both platforms and both viewports"
|
|
83
|
+
tools: ["claude --vision", "anthropic vision API"]
|
|
84
|
+
expected_output: "vision-results.json: [{platform, viewport, screen, result}]"
|
|
85
|
+
pass_criterion: "All result = PASS"
|
|
86
|
+
requires_human_review: true
|
|
87
|
+
|
|
88
|
+
- id: measure-touch-targets
|
|
89
|
+
instruction: >
|
|
90
|
+
Using the accessibility tree (iOS Accessibility Inspector or Android UIAutomator),
|
|
91
|
+
retrieve the bounding rect of every interactive element. Assert that each element
|
|
92
|
+
meets the tap target size in docs/mobile-accessibility-contracts.md.
|
|
93
|
+
contract: "All interactive elements meet minimum tap target size on both platforms"
|
|
94
|
+
tools: ["XCTest accessibilityFrame", "UIAutomator getBounds", "accessibility-inspector"]
|
|
95
|
+
expected_output: "touch-target-report.json: [{element, platform, size_pt, passes_contract}]"
|
|
96
|
+
pass_criterion: "All passes_contract = true"
|
|
97
|
+
|
|
98
|
+
- id: evidence
|
|
99
|
+
title: "Persist Screenshots and Platform Test Reports"
|
|
100
|
+
rationale: >
|
|
101
|
+
Mobile screenshots are the only reliable evidence of cross-platform visual fidelity.
|
|
102
|
+
They must be committed or archived per release so regressions are detectable.
|
|
103
|
+
steps:
|
|
104
|
+
- id: persist-screenshots
|
|
105
|
+
instruction: >
|
|
106
|
+
Save one screenshot per step per platform to test-results/mobile/screenshots/{platform}/{test}/{step}.png.
|
|
107
|
+
Compress to <500KB per screenshot. Include platform, OS version, and app version in filename.
|
|
108
|
+
contract: "Screenshots exist for all tests on all platforms"
|
|
109
|
+
tools: ["playwright screenshot", "appium driver.saveScreenshot"]
|
|
110
|
+
expected_output: "test-results/mobile/screenshots/ios/checkout/step-3-confirm.png"
|
|
111
|
+
pass_criterion: "Screenshot count matches steps × platforms"
|
|
112
|
+
|
|
113
|
+
- id: persist-platform-reports
|
|
114
|
+
instruction: >
|
|
115
|
+
Save the JUnit XML report from Playwright/Appium to test-results/mobile/.
|
|
116
|
+
Save vision-results.json and touch-target-report.json to the same directory.
|
|
117
|
+
Record platform and OS versions tested in test-results/mobile/environment.json.
|
|
118
|
+
contract: "test-results/mobile/ has report, vision-results, touch-target-report, environment"
|
|
119
|
+
tools: ["playwright --reporter=junit", "appium --reporter"]
|
|
120
|
+
expected_output: "All 4 files present in test-results/mobile/"
|
|
121
|
+
pass_criterion: "Files exist and parse as valid JSON/XML"
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
tag: OBSERVABILITY-XRAY
|
|
2
|
-
section: instructions
|
|
3
|
-
blocks:
|
|
4
|
-
- id: xray-lambda-instrumentation
|
|
5
|
-
tier: recommended
|
|
6
|
-
title: "Auto-Add X-Ray Instrumentation to Lambdas"
|
|
7
|
-
content: |
|
|
8
|
-
## Auto-Add X-Ray Instrumentation to Lambdas
|
|
9
|
-
|
|
10
|
-
- Enable X-Ray active tracing on every Lambda function by default. Set `tracing: Active` in SAM/CloudFormation or `tracing_config { mode = "Active" }` in Terraform.
|
|
11
|
-
- Wrap the AWS SDK client with the X-Ray SDK to automatically trace all downstream AWS service calls (DynamoDB, S3, SQS, SNS).
|
|
12
|
-
- Add X-Ray middleware or decorators to every Lambda handler. No handler should execute without producing a trace segment.
|
|
13
|
-
- Include custom subsegments for business-critical operations: database queries, external API calls, heavy computations.
|
|
14
|
-
- Propagate trace headers across service boundaries: ensure `X-Amzn-Trace-Id` is forwarded in HTTP headers and SQS message attributes.
|
|
15
|
-
- Set sampling rules appropriate to traffic volume: 100% for low-traffic, reservoir-based for high-traffic. Document sampling decisions.
|
|
16
|
-
|
|
17
|
-
- id: xray-annotations-metadata
|
|
18
|
-
tier: recommended
|
|
19
|
-
title: "X-Ray Annotations & Metadata Standards"
|
|
20
|
-
content: |
|
|
21
|
-
## X-Ray Annotations & Metadata Standards
|
|
22
|
-
|
|
23
|
-
- Add annotations for every trace: `service`, `environment`, `version`, `userId` (hashed), `correlationId`. Annotations are indexed and searchable.
|
|
24
|
-
- Use metadata for non-indexed debug data: request/response sizes, feature flags, cache hit/miss ratios.
|
|
25
|
-
- Define a standard annotation taxonomy across all services. No ad-hoc annotation keys — use a shared enum or constant file.
|
|
26
|
-
- Create X-Ray groups for critical paths: user-facing APIs, payment flows, data pipelines. Monitor group error rates and latency.
|
|
27
|
-
- Set up X-Ray insights for automated anomaly detection on critical service groups.
|
|
28
|
-
- Include X-Ray trace IDs in error responses and log entries for cross-referencing between traces and logs.
|
|
29
|
-
|
|
30
|
-
- id: xray-alerting
|
|
31
|
-
tier: optional
|
|
32
|
-
title: "X-Ray-Based Alerting & SLOs"
|
|
33
|
-
content: |
|
|
34
|
-
## X-Ray-Based Alerting & SLOs
|
|
35
|
-
|
|
36
|
-
- Define SLOs per service using X-Ray latency and error rate data: p50, p95, p99 latency targets and error budget thresholds.
|
|
37
|
-
- Create CloudWatch alarms from X-Ray service maps: alert on elevated fault rates, latency spikes, or throttling.
|
|
38
|
-
- Monitor cold start impact via X-Ray initialization subsegments. Alert if cold start percentage exceeds threshold.
|
|
39
|
-
- Build dashboards combining X-Ray service map data with CloudWatch metrics for a unified observability view.
|
|
40
|
-
- Review X-Ray traces weekly for optimization opportunities: unnecessary downstream calls, serial-when-could-be-parallel patterns.
|
|
1
|
+
tag: OBSERVABILITY-XRAY
|
|
2
|
+
section: instructions
|
|
3
|
+
blocks:
|
|
4
|
+
- id: xray-lambda-instrumentation
|
|
5
|
+
tier: recommended
|
|
6
|
+
title: "Auto-Add X-Ray Instrumentation to Lambdas"
|
|
7
|
+
content: |
|
|
8
|
+
## Auto-Add X-Ray Instrumentation to Lambdas
|
|
9
|
+
|
|
10
|
+
- Enable X-Ray active tracing on every Lambda function by default. Set `tracing: Active` in SAM/CloudFormation or `tracing_config { mode = "Active" }` in Terraform.
|
|
11
|
+
- Wrap the AWS SDK client with the X-Ray SDK to automatically trace all downstream AWS service calls (DynamoDB, S3, SQS, SNS).
|
|
12
|
+
- Add X-Ray middleware or decorators to every Lambda handler. No handler should execute without producing a trace segment.
|
|
13
|
+
- Include custom subsegments for business-critical operations: database queries, external API calls, heavy computations.
|
|
14
|
+
- Propagate trace headers across service boundaries: ensure `X-Amzn-Trace-Id` is forwarded in HTTP headers and SQS message attributes.
|
|
15
|
+
- Set sampling rules appropriate to traffic volume: 100% for low-traffic, reservoir-based for high-traffic. Document sampling decisions.
|
|
16
|
+
|
|
17
|
+
- id: xray-annotations-metadata
|
|
18
|
+
tier: recommended
|
|
19
|
+
title: "X-Ray Annotations & Metadata Standards"
|
|
20
|
+
content: |
|
|
21
|
+
## X-Ray Annotations & Metadata Standards
|
|
22
|
+
|
|
23
|
+
- Add annotations for every trace: `service`, `environment`, `version`, `userId` (hashed), `correlationId`. Annotations are indexed and searchable.
|
|
24
|
+
- Use metadata for non-indexed debug data: request/response sizes, feature flags, cache hit/miss ratios.
|
|
25
|
+
- Define a standard annotation taxonomy across all services. No ad-hoc annotation keys — use a shared enum or constant file.
|
|
26
|
+
- Create X-Ray groups for critical paths: user-facing APIs, payment flows, data pipelines. Monitor group error rates and latency.
|
|
27
|
+
- Set up X-Ray insights for automated anomaly detection on critical service groups.
|
|
28
|
+
- Include X-Ray trace IDs in error responses and log entries for cross-referencing between traces and logs.
|
|
29
|
+
|
|
30
|
+
- id: xray-alerting
|
|
31
|
+
tier: optional
|
|
32
|
+
title: "X-Ray-Based Alerting & SLOs"
|
|
33
|
+
content: |
|
|
34
|
+
## X-Ray-Based Alerting & SLOs
|
|
35
|
+
|
|
36
|
+
- Define SLOs per service using X-Ray latency and error rate data: p50, p95, p99 latency targets and error budget thresholds.
|
|
37
|
+
- Create CloudWatch alarms from X-Ray service maps: alert on elevated fault rates, latency spikes, or throttling.
|
|
38
|
+
- Monitor cold start impact via X-Ray initialization subsegments. Alert if cold start percentage exceeds threshold.
|
|
39
|
+
- Build dashboards combining X-Ray service map data with CloudWatch metrics for a unified observability view.
|
|
40
|
+
- Review X-Ray traces weekly for optimization opportunities: unnecessary downstream calls, serial-when-could-be-parallel patterns.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
tag: OBSERVABILITY-XRAY
|
|
2
|
-
section: mcp-servers
|
|
3
|
-
servers:
|
|
4
|
-
- name: aws-cloudwatch
|
|
5
|
-
description: "AWS CloudWatch logs and metrics — query X-Ray traces, view Lambda logs, monitor alarms"
|
|
6
|
-
command: npx
|
|
7
|
-
args: ["-y", "mcp-server-cloudwatch"]
|
|
8
|
-
tags: [OBSERVABILITY-XRAY, INFRA]
|
|
9
|
-
category: monitoring
|
|
10
|
-
tier: recommended
|
|
11
|
-
env:
|
|
12
|
-
AWS_REGION: ""
|
|
13
|
-
AWS_ACCESS_KEY_ID: ""
|
|
14
|
-
AWS_SECRET_ACCESS_KEY: ""
|
|
15
|
-
url: "https://github.com/modelcontextprotocol/servers"
|
|
1
|
+
tag: OBSERVABILITY-XRAY
|
|
2
|
+
section: mcp-servers
|
|
3
|
+
servers:
|
|
4
|
+
- name: aws-cloudwatch
|
|
5
|
+
description: "AWS CloudWatch logs and metrics — query X-Ray traces, view Lambda logs, monitor alarms"
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["-y", "mcp-server-cloudwatch"]
|
|
8
|
+
tags: [OBSERVABILITY-XRAY, INFRA]
|
|
9
|
+
category: monitoring
|
|
10
|
+
tier: recommended
|
|
11
|
+
env:
|
|
12
|
+
AWS_REGION: ""
|
|
13
|
+
AWS_ACCESS_KEY_ID: ""
|
|
14
|
+
AWS_SECRET_ACCESS_KEY: ""
|
|
15
|
+
url: "https://github.com/modelcontextprotocol/servers"
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
tag: REALTIME
|
|
2
|
-
section: instructions
|
|
3
|
-
blocks:
|
|
4
|
-
- id: websocket-patterns
|
|
5
|
-
tier: recommended
|
|
6
|
-
title: "WebSocket & Connection Management"
|
|
7
|
-
content: |
|
|
8
|
-
## WebSocket & Connection Lifecycle
|
|
9
|
-
|
|
10
|
-
- Implement automatic reconnection with exponential backoff and jitter (base 1s, max 30s). Track connection state (connecting, open, closing, closed) and expose it to the UI.
|
|
11
|
-
- Use heartbeat/ping-pong frames at regular intervals (every 30s) to detect dead connections. Close and reconnect if a pong is not received within the timeout window.
|
|
12
|
-
- Authenticate WebSocket connections during the handshake (via token in query param or first message). Reject unauthenticated connections immediately—do not allow message exchange before auth.
|
|
13
|
-
- Assign each connection a unique session ID. Map sessions to user identities server-side for targeted messaging, presence tracking, and connection auditing.
|
|
14
|
-
- Support graceful degradation: if WebSocket connections fail (corporate proxies, firewalls), fall back to Server-Sent Events or long polling automatically.
|
|
15
|
-
- Implement connection rate limiting per IP and per user to prevent resource exhaustion from misbehaving clients or attacks.
|
|
16
|
-
- Buffer outbound messages on the client during disconnection and replay them in order upon reconnection to avoid data loss.
|
|
17
|
-
|
|
18
|
-
- id: event-driven-architecture
|
|
19
|
-
tier: recommended
|
|
20
|
-
title: "Event-Driven Architecture"
|
|
21
|
-
content: |
|
|
22
|
-
## Event-Driven & Pub/Sub Patterns
|
|
23
|
-
|
|
24
|
-
- Use a message broker (Redis Pub/Sub, NATS, Kafka) to fan out events across multiple server instances. Never rely on in-process state for multi-node real-time systems.
|
|
25
|
-
- Define a clear event schema with versioning. Every event must include: event type, version, timestamp, producer ID, correlation ID, and payload.
|
|
26
|
-
- Implement topic-based or channel-based subscriptions. Clients should subscribe only to the channels they need to minimize unnecessary message delivery.
|
|
27
|
-
- Use message acknowledgment for critical events: the consumer must explicitly ack after processing. Unacked messages are redelivered after a timeout.
|
|
28
|
-
- Deduplicate events on the consumer side using the event ID. Network retries and broker redelivery can produce duplicates that must not cause double-processing.
|
|
29
|
-
- Separate command messages (requests to change state) from event messages (notifications of state changes). Commands go to a single handler; events fan out to many subscribers.
|
|
30
|
-
|
|
31
|
-
- id: backpressure-scaling
|
|
32
|
-
tier: recommended
|
|
33
|
-
title: "Backpressure & Scaling"
|
|
34
|
-
content: |
|
|
35
|
-
## Backpressure, Flow Control & Scaling
|
|
36
|
-
|
|
37
|
-
- Implement backpressure at every layer. If a consumer cannot keep up, signal the producer to slow down rather than buffering unboundedly and risking OOM.
|
|
38
|
-
- Set maximum buffer sizes for outbound message queues per connection. If the buffer fills (slow client), drop non-critical messages or disconnect the client with a warning.
|
|
39
|
-
- Use rate limiting on inbound messages per client (e.g., max 100 messages/second). Reject excess messages with an error code rather than silently dropping them.
|
|
40
|
-
- Design for horizontal scaling: use sticky sessions or a shared session store so that any server node can handle any client's messages after a reconnection.
|
|
41
|
-
- Monitor key metrics: active connections, messages per second (in/out), message latency p50/p95/p99, buffer utilization, and reconnection rate. Alert on anomalies.
|
|
42
|
-
- Load-test real-time features with realistic connection counts (10x expected peak) and message rates to identify bottlenecks before they appear in production.
|
|
1
|
+
tag: REALTIME
|
|
2
|
+
section: instructions
|
|
3
|
+
blocks:
|
|
4
|
+
- id: websocket-patterns
|
|
5
|
+
tier: recommended
|
|
6
|
+
title: "WebSocket & Connection Management"
|
|
7
|
+
content: |
|
|
8
|
+
## WebSocket & Connection Lifecycle
|
|
9
|
+
|
|
10
|
+
- Implement automatic reconnection with exponential backoff and jitter (base 1s, max 30s). Track connection state (connecting, open, closing, closed) and expose it to the UI.
|
|
11
|
+
- Use heartbeat/ping-pong frames at regular intervals (every 30s) to detect dead connections. Close and reconnect if a pong is not received within the timeout window.
|
|
12
|
+
- Authenticate WebSocket connections during the handshake (via token in query param or first message). Reject unauthenticated connections immediately—do not allow message exchange before auth.
|
|
13
|
+
- Assign each connection a unique session ID. Map sessions to user identities server-side for targeted messaging, presence tracking, and connection auditing.
|
|
14
|
+
- Support graceful degradation: if WebSocket connections fail (corporate proxies, firewalls), fall back to Server-Sent Events or long polling automatically.
|
|
15
|
+
- Implement connection rate limiting per IP and per user to prevent resource exhaustion from misbehaving clients or attacks.
|
|
16
|
+
- Buffer outbound messages on the client during disconnection and replay them in order upon reconnection to avoid data loss.
|
|
17
|
+
|
|
18
|
+
- id: event-driven-architecture
|
|
19
|
+
tier: recommended
|
|
20
|
+
title: "Event-Driven Architecture"
|
|
21
|
+
content: |
|
|
22
|
+
## Event-Driven & Pub/Sub Patterns
|
|
23
|
+
|
|
24
|
+
- Use a message broker (Redis Pub/Sub, NATS, Kafka) to fan out events across multiple server instances. Never rely on in-process state for multi-node real-time systems.
|
|
25
|
+
- Define a clear event schema with versioning. Every event must include: event type, version, timestamp, producer ID, correlation ID, and payload.
|
|
26
|
+
- Implement topic-based or channel-based subscriptions. Clients should subscribe only to the channels they need to minimize unnecessary message delivery.
|
|
27
|
+
- Use message acknowledgment for critical events: the consumer must explicitly ack after processing. Unacked messages are redelivered after a timeout.
|
|
28
|
+
- Deduplicate events on the consumer side using the event ID. Network retries and broker redelivery can produce duplicates that must not cause double-processing.
|
|
29
|
+
- Separate command messages (requests to change state) from event messages (notifications of state changes). Commands go to a single handler; events fan out to many subscribers.
|
|
30
|
+
|
|
31
|
+
- id: backpressure-scaling
|
|
32
|
+
tier: recommended
|
|
33
|
+
title: "Backpressure & Scaling"
|
|
34
|
+
content: |
|
|
35
|
+
## Backpressure, Flow Control & Scaling
|
|
36
|
+
|
|
37
|
+
- Implement backpressure at every layer. If a consumer cannot keep up, signal the producer to slow down rather than buffering unboundedly and risking OOM.
|
|
38
|
+
- Set maximum buffer sizes for outbound message queues per connection. If the buffer fills (slow client), drop non-critical messages or disconnect the client with a warning.
|
|
39
|
+
- Use rate limiting on inbound messages per client (e.g., max 100 messages/second). Reject excess messages with an error code rather than silently dropping them.
|
|
40
|
+
- Design for horizontal scaling: use sticky sessions or a shared session store so that any server node can handle any client's messages after a reconnection.
|
|
41
|
+
- Monitor key metrics: active connections, messages per second (in/out), message latency p50/p95/p99, buffer utilization, and reconnection rate. Alert on anomalies.
|
|
42
|
+
- Load-test real-time features with realistic connection counts (10x expected peak) and message rates to identify bottlenecks before they appear in production.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
tag: REALTIME
|
|
2
|
-
section: mcp-servers
|
|
3
|
-
servers:
|
|
4
|
-
- name: redis
|
|
5
|
-
description: "Redis key-value store management — pub/sub, streams, caching, and session management"
|
|
6
|
-
command: npx
|
|
7
|
-
args: ["-y", "mcp-server-redis"]
|
|
8
|
-
tags: [REALTIME]
|
|
9
|
-
category: database
|
|
10
|
-
tier: recommended
|
|
11
|
-
env:
|
|
12
|
-
REDIS_URL: "redis://localhost:6379"
|
|
13
|
-
url: "https://github.com/nicholasgriffintn/redis-mcp-server"
|
|
1
|
+
tag: REALTIME
|
|
2
|
+
section: mcp-servers
|
|
3
|
+
servers:
|
|
4
|
+
- name: redis
|
|
5
|
+
description: "Redis key-value store management — pub/sub, streams, caching, and session management"
|
|
6
|
+
command: npx
|
|
7
|
+
args: ["-y", "mcp-server-redis"]
|
|
8
|
+
tags: [REALTIME]
|
|
9
|
+
category: database
|
|
10
|
+
tier: recommended
|
|
11
|
+
env:
|
|
12
|
+
REDIS_URL: "redis://localhost:6379"
|
|
13
|
+
url: "https://github.com/nicholasgriffintn/redis-mcp-server"
|