@ranimontagna/agent-toolkit 0.3.5 → 0.3.7
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/CHANGELOG.md +5 -0
- package/README.md +8 -8
- package/dist/src/installers/superpowers.js +23 -7
- package/dist/src/installers/superpowers.js.map +1 -1
- package/package.json +5 -5
- package/skills/backend/fastify-best-practices/NOTICE.md +1 -1
- package/skills/backend/fastify-best-practices/rules/authentication.md +13 -0
- package/skills/backend/fastify-best-practices/rules/configuration.md +9 -0
- package/skills/backend/fastify-best-practices/rules/content-type.md +16 -0
- package/skills/backend/fastify-best-practices/rules/cors-security.md +18 -0
- package/skills/backend/fastify-best-practices/rules/database.md +12 -0
- package/skills/backend/fastify-best-practices/rules/decorators.md +14 -0
- package/skills/backend/fastify-best-practices/rules/deployment.md +16 -0
- package/skills/backend/fastify-best-practices/rules/error-handling.md +16 -0
- package/skills/backend/fastify-best-practices/rules/hooks.md +20 -0
- package/skills/backend/fastify-best-practices/rules/http-proxy.md +11 -0
- package/skills/backend/fastify-best-practices/rules/logging.md +18 -0
- package/skills/backend/fastify-best-practices/rules/performance.md +20 -0
- package/skills/backend/fastify-best-practices/rules/plugins.md +14 -0
- package/skills/backend/fastify-best-practices/rules/routes.md +18 -0
- package/skills/backend/fastify-best-practices/rules/schemas.md +20 -0
- package/skills/backend/fastify-best-practices/rules/serialization.md +19 -0
- package/skills/backend/fastify-best-practices/rules/testing.md +17 -0
- package/skills/backend/fastify-best-practices/rules/typescript.md +15 -0
- package/skills/backend/fastify-best-practices/rules/websockets.md +15 -0
- package/skills/backend/go/golang-patterns/NOTICE.md +1 -1
- package/skills/backend/go/golang-patterns/SKILL.md +2 -1
- package/skills/devops/docker-patterns/NOTICE.md +1 -1
- package/skills/devops/docker-patterns/SKILL.md +3 -3
- package/skills/frontend/design/revenue-centric-design/NOTICE.md +1 -1
- package/skills/frontend/design/revenue-centric-design/SKILL.md +6 -4
- package/skills/frontend/design/revenue-centric-design/assets/1985681720104903142__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/1999584679247134761__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2000930776636940333__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2018693884449009956__3.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2081714430811730162__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2092692547244007852__q__1.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2092692547244007852__q__2.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/assets/2092692547244007852__q__3.jpg +0 -0
- package/skills/frontend/design/revenue-centric-design/references/checkout-and-forms.md +39 -0
- package/skills/frontend/design/revenue-centric-design/references/churn-and-retention.md +25 -0
- package/skills/frontend/design/revenue-centric-design/references/conversion-and-landing-pages.md +52 -1
- package/skills/frontend/design/revenue-centric-design/references/dashboards-and-data-viz.md +23 -0
- package/skills/frontend/design/revenue-centric-design/references/metrics-and-experimentation.md +13 -0
- package/skills/frontend/design/revenue-centric-design/references/onboarding-and-activation.md +7 -1
- package/skills/frontend/design/revenue-centric-design/references/pricing-and-monetization.md +35 -8
- package/skills/frontend/design/revenue-centric-design/references/product-strategy-and-features.md +37 -0
- package/skills/frontend/design/revenue-centric-design/references/revenue-centric-design.md +2 -2
- package/skills/frontend/design/ui-ux-pro-max/NOTICE.md +6 -4
- package/skills/frontend/design/ui-ux-pro-max/SKILL.md +103 -573
- package/skills/frontend/design/ui-ux-pro-max/data/app-interface.csv +29 -27
- package/skills/frontend/design/ui-ux-pro-max/data/catalog-summary.json +78 -0
- package/skills/frontend/design/ui-ux-pro-max/data/charts.csv +26 -26
- package/skills/frontend/design/ui-ux-pro-max/data/colors.csv +191 -160
- package/skills/frontend/design/ui-ux-pro-max/data/data-provenance.json +1348 -0
- package/skills/frontend/design/ui-ux-pro-max/data/google-font-licenses.json +20185 -0
- package/skills/frontend/design/ui-ux-pro-max/data/google-fonts.csv +1934 -1923
- package/skills/frontend/design/ui-ux-pro-max/data/icons.csv +106 -106
- package/skills/frontend/design/ui-ux-pro-max/data/landing.csv +35 -35
- package/skills/frontend/design/ui-ux-pro-max/data/motion.csv +18 -0
- package/skills/frontend/design/ui-ux-pro-max/data/phosphor-icons-upstream.json +32582 -0
- package/skills/frontend/design/ui-ux-pro-max/data/products.csv +192 -161
- package/skills/frontend/design/ui-ux-pro-max/data/react-performance.csv +37 -37
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/angular.csv +51 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/astro.csv +54 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/avalonia.csv +57 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/flutter.csv +53 -53
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/html-tailwind.csv +60 -56
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/javafx.csv +76 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -53
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/laravel.csv +51 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nextjs.csv +62 -53
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxt-ui.csv +77 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/nuxtjs.csv +68 -59
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/react-native.csv +52 -52
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/react.csv +67 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/shadcn.csv +69 -61
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/svelte.csv +56 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/swiftui.csv +51 -51
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/threejs.csv +54 -54
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/uno.csv +60 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/uwp.csv +56 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/vue.csv +50 -50
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/winui.csv +60 -0
- package/skills/frontend/design/ui-ux-pro-max/data/stacks/wpf.csv +57 -0
- package/skills/frontend/design/ui-ux-pro-max/data/styles.csv +89 -85
- package/skills/frontend/design/ui-ux-pro-max/data/typography.csv +74 -73
- package/skills/frontend/design/ui-ux-pro-max/data/ui-reasoning.csv +193 -162
- package/skills/frontend/design/ui-ux-pro-max/data/ux-guidelines.csv +30 -10
- package/skills/frontend/design/ui-ux-pro-max/references/pro-rules.md +117 -0
- package/skills/frontend/design/ui-ux-pro-max/references/quick-reference.md +256 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/core.py +800 -69
- package/skills/frontend/design/ui-ux-pro-max/scripts/design_system.py +700 -180
- package/skills/frontend/design/ui-ux-pro-max/scripts/reasoning_contract.py +123 -0
- package/skills/frontend/design/ui-ux-pro-max/scripts/search.py +105 -42
- package/skills/frontend/design/ui-ux-pro-max/scripts/validate_data.py +1095 -0
- package/skills/frontend/react-native/react-native-unistyles-v3/NOTICE.md +1 -1
- package/skills/frontend/react-native/react-native-unistyles-v3/SKILL.md +33 -24
- package/skills/frontend/react-native/react-native-unistyles-v3/references/api-reference.md +135 -78
- package/skills/frontend/react-native/react-native-unistyles-v3/references/common-issues.md +48 -31
- package/skills/frontend/react-native/react-native-unistyles-v3/references/setup-guide.md +76 -34
- package/skills/frontend/react-native/react-native-unistyles-v3/references/styling-patterns.md +145 -52
- package/skills/frontend/react-native/react-native-unistyles-v3/references/third-party-integration.md +76 -27
- package/skills/media/brag-slim/NOTICE.md +3 -3
- package/skills/media/brag-slim/SKILL.md +4 -0
- package/tools.lock.json +20 -20
- package/skills/frontend/design/revenue-centric-design/assets/2018693884449009956__1.jpg +0 -0
- package/skills/frontend/design/ui-ux-pro-max/data/_sync_all.py +0 -414
- package/skills/frontend/design/ui-ux-pro-max/data/design.csv +0 -1776
- package/skills/frontend/design/ui-ux-pro-max/data/draft.csv +0 -1779
package/CHANGELOG.md
CHANGED
|
@@ -15,7 +15,12 @@ The release entries below are based on Git tag ranges and npm publication metada
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
- Updated the bundled `revenue-centric-design` skill to upstream `heliocosta-dev/revenue-centric-design@1942760` (1.3.0, 101 → 134 principles), adding the Checkout & Forms and Dashboards & Data Visualization references and vendoring only the assets they cite.
|
|
19
|
+
- Refreshed bundled third-party skills against their upstreams: `ui-ux-pro-max` to `nextlevelbuilder/ui-ux-pro-max-skill@477bcb2` (curated data overhaul, design dials, GSAP presets and new references, with command paths kept relative to the skill directory and the upstream test suite left out), `react-native-unistyles-v3` to `jpudysz/react-native-unistyles@eef411b` (docs refresh), `fastify-best-practices` to `mcollina/skills@58b3eeb` (tables of contents in long rules), `brag-slim` to `latent-spaces/brag@069432c` (skip list and secrets rule), the `golang-patterns` golangci-lint `govet` example to `enable: [shadow]` from `affaan-m/ECC@d29cf65`, and the `docker-patterns` Node examples to `npm prune --omit=dev` with group-scoped `adduser`, following `sickn33/antigravity-awesome-skills@e0bcf88`.
|
|
20
|
+
- Fixed the Codex Superpowers install on a `CODEX_HOME` that never synced the local `openai-curated` marketplace: the installer now falls back to `superpowers@openai-curated-remote`, the account's remote catalog.
|
|
18
21
|
- Added the bundled `media/brag-slim` launch-video skill, vendored from `latent-spaces/brag@fd7de7e` with its MIT license and attribution notice.
|
|
22
|
+
- Refreshed the pinned external tools: RTK `v0.51.0` with new archive checksums, Caveman `3.2.0` at `2e08b91`, Graphify `0.9.87`, GSD Core `1.16.0`, Agent Skills CLI `1.7.2`, Agent Browser `0.39.0` with its matching `vercel-labs/agent-browser` tag commit, the `pbakaus/impeccable`, `millionco/react-doctor`, `remotion-dev/skills` and `mattpocock/skills` sources, and the Claude Code `2.1.296`, Codex `0.162.1`, OpenCode `1.19.0` and Gemini `0.63.0` runtime CLIs, after re-checking the installer and Ariadne headless flags on each.
|
|
23
|
+
- Updated `@clack/prompts` to `1.8.1` and the development dependencies `@biomejs/biome` `2.5.15`, `@types/node` `26.6.5` and `vitest` `5.0.3`.
|
|
19
24
|
- Refreshed the pinned external tools: RTK `v0.50.0` with new archive checksums, Caveman `3.0.0` at `f5d7294`, Graphify `0.9.73`, GSD Core `1.15.0`, Agent Skills CLI `1.7.0`, and the Claude Code `2.1.286`, Codex `0.159.3`, OpenCode `1.18.34` and Gemini `0.62.0` runtime CLIs, after re-checking the Ariadne headless flags on each.
|
|
20
25
|
- Refreshed the pinned Agent Skills sources: `shadcn/improve`, `pbakaus/impeccable`, `millionco/react-doctor`, `remotion-dev/skills`, `mattpocock/skills`, and Agent Browser `0.38.1` with its matching `vercel-labs/agent-browser` tag commit.
|
|
21
26
|
- Added deterministic `skills.index.json` generation, prompt-sized `BRIEF.md`
|
package/README.md
CHANGED
|
@@ -62,13 +62,13 @@ Current external sources:
|
|
|
62
62
|
|
|
63
63
|
| Tool | Locked source |
|
|
64
64
|
|---|---|
|
|
65
|
-
| RTK | `rtk-ai/rtk@v0.
|
|
66
|
-
| Caveman | `JuliusBrussee/caveman@
|
|
67
|
-
| Graphify | `graphifyy==0.9.
|
|
68
|
-
| GSD | `@opengsd/gsd-core@1.
|
|
69
|
-
| Agent Browser | `agent-browser@0.
|
|
70
|
-
| Agent Skills CLI | `skills@1.7.
|
|
71
|
-
| Runtime CLIs | `@anthropic-ai/claude-code@2.1.
|
|
65
|
+
| RTK | `rtk-ai/rtk@v0.51.0`, with a SHA-256 pin for every supported archive |
|
|
66
|
+
| Caveman | `JuliusBrussee/caveman@2e08b9177c07bb7249a8a2d1a6758e5db281d002` |
|
|
67
|
+
| Graphify | `graphifyy==0.9.87` |
|
|
68
|
+
| GSD | `@opengsd/gsd-core@1.16.0` |
|
|
69
|
+
| Agent Browser | `agent-browser@0.39.0` |
|
|
70
|
+
| Agent Skills CLI | `skills@1.7.2`, with each source repository pinned to a full commit |
|
|
71
|
+
| Runtime CLIs | `@anthropic-ai/claude-code@2.1.296`, `@openai/codex@0.162.1`, `opencode-ai@1.19.0`, and `@google/gemini-cli@0.63.0` |
|
|
72
72
|
| Ariadne adaptation provenance | `snarktank/ralph@6c53cb0b831ebe8739c6a003e22af14902d8b0b5`, with reviewed SHA-256 values for the MIT license and both adapted source skills |
|
|
73
73
|
|
|
74
74
|
The Agent Skills catalog exposes these locked bundle IDs and skill names:
|
|
@@ -109,7 +109,7 @@ workflow; toolkit tags remain `vX.Y.Z`.
|
|
|
109
109
|
|
|
110
110
|
The first-party `security` skills are defensive rewrites informed by [`uphiago/recon-skills`](https://github.com/uphiago/recon-skills), under its MIT License. They are intended for authorized, non-destructive reviews; upstream offensive infrastructure, agent instructions, scripts, and mass-scanning workflows are not included. See [`skills/security/NOTICE.md`](skills/security/NOTICE.md) for attribution.
|
|
111
111
|
|
|
112
|
-
The bundled `media/brag-slim` skill is vendored from [`latent-spaces/brag`](https://github.com/latent-spaces/brag) at commit `
|
|
112
|
+
The bundled `media/brag-slim` skill is vendored from [`latent-spaces/brag`](https://github.com/latent-spaces/brag) at commit `069432cac935ed1895859df201c31436c07fb74e` under the MIT License. It turns a project directory or website URL into a short launch video with share copy, built with tools already on the machine; the full `/brag` skill, its render scripts, and bundled music are not included. See [`skills/media/brag-slim/NOTICE.md`](skills/media/brag-slim/NOTICE.md) for attribution.
|
|
113
113
|
|
|
114
114
|
The first-party `ariadne` and `ariadne-prd` skills are Ariadne-specific adaptations of concepts from [`snarktank/ralph`](https://github.com/snarktank/ralph) under the MIT License. They install through the ordinary Custom Skills pipeline for all five runtimes; `tools.ariadne` records reviewed attribution only and is not fetched or executed during a normal Ariadne run. Each skill directory contains its source path, reviewed commit, and source hash in `NOTICE.md`.
|
|
115
115
|
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { info, ok, step, warn } from "../logger.js";
|
|
2
2
|
import { state } from "../state.js";
|
|
3
|
-
import { findCommand, run } from "../system.js";
|
|
3
|
+
import { capture, findCommand, run } from "../system.js";
|
|
4
|
+
// Codex lists Superpowers in the local `openai-curated` marketplace once it has
|
|
5
|
+
// synced that catalog. A CODEX_HOME that never synced it only has the account's
|
|
6
|
+
// remote catalog, where the same plugin is `openai-curated-remote`.
|
|
7
|
+
const CODEX_SUPERPOWERS_PLUGINS = [
|
|
8
|
+
"superpowers@openai-curated",
|
|
9
|
+
"superpowers@openai-curated-remote",
|
|
10
|
+
];
|
|
11
|
+
function addCodexSuperpowers(codex) {
|
|
12
|
+
const errors = [];
|
|
13
|
+
for (const plugin of CODEX_SUPERPOWERS_PLUGINS) {
|
|
14
|
+
const result = capture(codex, ["plugin", "add", plugin]);
|
|
15
|
+
if (result.ok)
|
|
16
|
+
return true;
|
|
17
|
+
const error = (result.stderr || result.stdout).trim();
|
|
18
|
+
if (error)
|
|
19
|
+
errors.push(error);
|
|
20
|
+
}
|
|
21
|
+
for (const error of errors)
|
|
22
|
+
warn(error);
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
4
25
|
export function installSuperpowers() {
|
|
5
26
|
step("Superpowers");
|
|
6
27
|
console.log(" Planning, TDD, debugging and delivery workflows");
|
|
@@ -29,12 +50,7 @@ export function installSuperpowers() {
|
|
|
29
50
|
const codex = findCommand("codex");
|
|
30
51
|
if (codex) {
|
|
31
52
|
info("Installing Superpowers for Codex CLI...");
|
|
32
|
-
|
|
33
|
-
"plugin",
|
|
34
|
-
"add",
|
|
35
|
-
"superpowers@openai-curated",
|
|
36
|
-
]);
|
|
37
|
-
if (result.ok)
|
|
53
|
+
if (addCodexSuperpowers(codex))
|
|
38
54
|
ok("Superpowers installed for Codex CLI");
|
|
39
55
|
else {
|
|
40
56
|
warn("Codex plugin install did not complete.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"superpowers.js","sourceRoot":"","sources":["../../../src/installers/superpowers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"superpowers.js","sourceRoot":"","sources":["../../../src/installers/superpowers.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ranimontagna/agent-toolkit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.7",
|
|
4
4
|
"description": "Personal AI agent toolkit installer for Claude Code, Codex CLI, OpenCode, Gemini CLI, Antigravity and graph-aware workflows.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -59,12 +59,12 @@
|
|
|
59
59
|
"homepage": "https://github.com/raniellimontagna/agent-toolkit#readme",
|
|
60
60
|
"license": "MIT",
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@biomejs/biome": "^2.5.
|
|
63
|
-
"@types/node": "^26.
|
|
62
|
+
"@biomejs/biome": "^2.5.15",
|
|
63
|
+
"@types/node": "^26.6.5",
|
|
64
64
|
"typescript": "^7.0.2",
|
|
65
|
-
"vitest": "^
|
|
65
|
+
"vitest": "^5.0.3"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@clack/prompts": "^1.
|
|
68
|
+
"@clack/prompts": "^1.8.1"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This skill is copied from Matteo Collina's public `mcollina/skills` repository.
|
|
4
4
|
|
|
5
5
|
- Source: https://github.com/mcollina/skills/tree/main/skills/fastify
|
|
6
|
-
- Imported from commit: `
|
|
6
|
+
- Imported from commit: `58b3eeb398d10c007988e80f73d30ebadab64754`
|
|
7
7
|
- Upstream package name: `mcollina/fastify-best-practices`
|
|
8
8
|
- License: MIT
|
|
9
9
|
- Copyright: Copyright (c) 2026 Matteo Collina
|
|
@@ -7,6 +7,19 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Authentication and Authorization
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [JWT Authentication with @fastify/jwt](#jwt-authentication-with-fastifyjwt)
|
|
13
|
+
- [Refresh Tokens](#refresh-tokens)
|
|
14
|
+
- [Role-Based Access Control](#role-based-access-control)
|
|
15
|
+
- [Permission-Based Authorization](#permission-based-authorization)
|
|
16
|
+
- [API Key / Bearer Token Authentication](#api-key--bearer-token-authentication)
|
|
17
|
+
- [OAuth 2.0 Integration](#oauth-20-integration)
|
|
18
|
+
- [Session-Based Authentication](#session-based-authentication)
|
|
19
|
+
- [Resource-Based Authorization](#resource-based-authorization)
|
|
20
|
+
- [Password Hashing](#password-hashing)
|
|
21
|
+
- [Rate Limiting for Auth Endpoints](#rate-limiting-for-auth-endpoints)
|
|
22
|
+
|
|
10
23
|
## JWT Authentication with @fastify/jwt
|
|
11
24
|
|
|
12
25
|
Use `@fastify/jwt` for JSON Web Token authentication:
|
|
@@ -7,6 +7,15 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Application Configuration
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Use env-schema for Configuration](#use-env-schema-for-configuration)
|
|
13
|
+
- [Configuration as Plugin](#configuration-as-plugin)
|
|
14
|
+
- [Secrets Management](#secrets-management)
|
|
15
|
+
- [Feature Flags](#feature-flags)
|
|
16
|
+
- [Anti-Patterns to Avoid](#anti-patterns-to-avoid)
|
|
17
|
+
- [Dynamic Configuration](#dynamic-configuration)
|
|
18
|
+
|
|
10
19
|
## Use env-schema for Configuration
|
|
11
20
|
|
|
12
21
|
**Always use `env-schema` for configuration validation.** It provides JSON Schema validation for environment variables with sensible defaults.
|
|
@@ -7,6 +7,22 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Content Type Parsing
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Default Content Type Parsers](#default-content-type-parsers)
|
|
13
|
+
- [Custom Content Type Parsers](#custom-content-type-parsers)
|
|
14
|
+
- [XML Parsing](#xml-parsing)
|
|
15
|
+
- [Multipart Form Data](#multipart-form-data)
|
|
16
|
+
- [Stream Processing](#stream-processing)
|
|
17
|
+
- [Custom JSON Parser](#custom-json-parser)
|
|
18
|
+
- [Content Type with Parameters](#content-type-with-parameters)
|
|
19
|
+
- [Catch-All Parser](#catch-all-parser)
|
|
20
|
+
- [Body Limit Configuration](#body-limit-configuration)
|
|
21
|
+
- [Protocol Buffers](#protocol-buffers)
|
|
22
|
+
- [Form Data with @fastify/formbody](#form-data-with-fastifyformbody)
|
|
23
|
+
- [Content Negotiation](#content-negotiation)
|
|
24
|
+
- [Validation After Parsing](#validation-after-parsing)
|
|
25
|
+
|
|
10
26
|
## Default Content Type Parsers
|
|
11
27
|
|
|
12
28
|
Fastify includes parsers for common content types:
|
|
@@ -7,6 +7,24 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# CORS and Security
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [CORS with @fastify/cors](#cors-with-fastifycors)
|
|
13
|
+
- [Dynamic CORS Origin](#dynamic-cors-origin)
|
|
14
|
+
- [Per-Route CORS](#per-route-cors)
|
|
15
|
+
- [Security Headers with @fastify/helmet](#security-headers-with-fastifyhelmet)
|
|
16
|
+
- [Configure Individual Headers](#configure-individual-headers)
|
|
17
|
+
- [Rate Limiting](#rate-limiting)
|
|
18
|
+
- [Redis-Based Rate Limiting](#redis-based-rate-limiting)
|
|
19
|
+
- [CSRF Protection](#csrf-protection)
|
|
20
|
+
- [Custom Security Headers](#custom-security-headers)
|
|
21
|
+
- [Secure Cookies](#secure-cookies)
|
|
22
|
+
- [Request Validation Security](#request-validation-security)
|
|
23
|
+
- [IP Filtering](#ip-filtering)
|
|
24
|
+
- [Trust Proxy](#trust-proxy)
|
|
25
|
+
- [HTTPS Redirect](#https-redirect)
|
|
26
|
+
- [Security Best Practices Summary](#security-best-practices-summary)
|
|
27
|
+
|
|
10
28
|
## CORS with @fastify/cors
|
|
11
29
|
|
|
12
30
|
Enable Cross-Origin Resource Sharing:
|
|
@@ -7,6 +7,18 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Database Integration
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Use Official Fastify Database Adapters](#use-official-fastify-database-adapters)
|
|
13
|
+
- [PostgreSQL with @fastify/postgres](#postgresql-with-fastifypostgres)
|
|
14
|
+
- [MySQL with @fastify/mysql](#mysql-with-fastifymysql)
|
|
15
|
+
- [MongoDB with @fastify/mongodb](#mongodb-with-fastifymongodb)
|
|
16
|
+
- [Redis with @fastify/redis](#redis-with-fastifyredis)
|
|
17
|
+
- [Database as Plugin](#database-as-plugin)
|
|
18
|
+
- [Repository Pattern](#repository-pattern)
|
|
19
|
+
- [Testing with Database](#testing-with-database)
|
|
20
|
+
- [Connection Pool Configuration](#connection-pool-configuration)
|
|
21
|
+
|
|
10
22
|
## Use Official Fastify Database Adapters
|
|
11
23
|
|
|
12
24
|
Always use the official Fastify database plugins from the `@fastify` organization. They provide proper connection pooling, encapsulation, and integration with Fastify's lifecycle.
|
|
@@ -7,6 +7,20 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Decorators and Extensions
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Understanding Decorators](#understanding-decorators)
|
|
13
|
+
- [Decorator Types](#decorator-types)
|
|
14
|
+
- [TypeScript Declaration Merging](#typescript-declaration-merging)
|
|
15
|
+
- [Decorator Initialization](#decorator-initialization)
|
|
16
|
+
- [Dependency Injection with Decorators](#dependency-injection-with-decorators)
|
|
17
|
+
- [Request Context Pattern](#request-context-pattern)
|
|
18
|
+
- [Reply Helpers](#reply-helpers)
|
|
19
|
+
- [Checking Decorators](#checking-decorators)
|
|
20
|
+
- [Decorator Encapsulation](#decorator-encapsulation)
|
|
21
|
+
- [Functional Decorators](#functional-decorators)
|
|
22
|
+
- [Async Decorator Initialization](#async-decorator-initialization)
|
|
23
|
+
|
|
10
24
|
## Understanding Decorators
|
|
11
25
|
|
|
12
26
|
Decorators add custom properties and methods to Fastify instances, requests, and replies:
|
|
@@ -7,6 +7,20 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Production Deployment
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Graceful Shutdown with close-with-grace](#graceful-shutdown-with-close-with-grace)
|
|
13
|
+
- [Health Check Endpoints](#health-check-endpoints)
|
|
14
|
+
- [Docker Configuration](#docker-configuration)
|
|
15
|
+
- [Kubernetes Deployment](#kubernetes-deployment)
|
|
16
|
+
- [Production Logger Configuration](#production-logger-configuration)
|
|
17
|
+
- [Request Timeouts](#request-timeouts)
|
|
18
|
+
- [Trust Proxy Settings](#trust-proxy-settings)
|
|
19
|
+
- [Static File Serving](#static-file-serving)
|
|
20
|
+
- [Compression](#compression)
|
|
21
|
+
- [Metrics and Monitoring](#metrics-and-monitoring)
|
|
22
|
+
- [Zero-Downtime Deployments](#zero-downtime-deployments)
|
|
23
|
+
|
|
10
24
|
## Graceful Shutdown with close-with-grace
|
|
11
25
|
|
|
12
26
|
Use `close-with-grace` for proper shutdown handling:
|
|
@@ -106,6 +120,7 @@ app.get('/health/details', {
|
|
|
106
120
|
};
|
|
107
121
|
});
|
|
108
122
|
```
|
|
123
|
+
|
|
109
124
|
## Docker Configuration
|
|
110
125
|
|
|
111
126
|
Create an optimized Dockerfile:
|
|
@@ -421,3 +436,4 @@ closeWithGrace({ delay: 30000 }, async ({ signal }) => {
|
|
|
421
436
|
app.log.info('Server closed');
|
|
422
437
|
});
|
|
423
438
|
```
|
|
439
|
+
|
|
@@ -7,6 +7,22 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Error Handling in Fastify
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Default Error Handler](#default-error-handler)
|
|
13
|
+
- [Custom Error Classes](#custom-error-classes)
|
|
14
|
+
- [Custom Error Handler](#custom-error-handler)
|
|
15
|
+
- [Error Response Schema](#error-response-schema)
|
|
16
|
+
- [Reply Helpers with @fastify/sensible](#reply-helpers-with-fastifysensible)
|
|
17
|
+
- [Async Error Handling](#async-error-handling)
|
|
18
|
+
- [Hook Error Handling](#hook-error-handling)
|
|
19
|
+
- [Not Found Handler](#not-found-handler)
|
|
20
|
+
- [Error Wrapping](#error-wrapping)
|
|
21
|
+
- [Validation Error Customization](#validation-error-customization)
|
|
22
|
+
- [Error Cause Chain](#error-cause-chain)
|
|
23
|
+
- [Plugin-Scoped Error Handlers](#plugin-scoped-error-handlers)
|
|
24
|
+
- [Graceful Error Recovery](#graceful-error-recovery)
|
|
25
|
+
|
|
10
26
|
## Default Error Handler
|
|
11
27
|
|
|
12
28
|
Fastify has a built-in error handler. Thrown errors automatically become HTTP responses:
|
|
@@ -7,6 +7,26 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Hooks and Request Lifecycle
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Request Lifecycle Overview](#request-lifecycle-overview)
|
|
13
|
+
- [onRequest Hook](#onrequest-hook)
|
|
14
|
+
- [preParsing Hook](#preparsing-hook)
|
|
15
|
+
- [preValidation Hook](#prevalidation-hook)
|
|
16
|
+
- [preHandler Hook](#prehandler-hook)
|
|
17
|
+
- [preSerialization Hook](#preserialization-hook)
|
|
18
|
+
- [onSend Hook](#onsend-hook)
|
|
19
|
+
- [onResponse Hook](#onresponse-hook)
|
|
20
|
+
- [onError Hook](#onerror-hook)
|
|
21
|
+
- [onTimeout Hook](#ontimeout-hook)
|
|
22
|
+
- [onRequestAbort Hook](#onrequestabort-hook)
|
|
23
|
+
- [Application Lifecycle Hooks](#application-lifecycle-hooks)
|
|
24
|
+
- [Scoped Hooks](#scoped-hooks)
|
|
25
|
+
- [Hook Execution Order](#hook-execution-order)
|
|
26
|
+
- [Stopping Hook Execution](#stopping-hook-execution)
|
|
27
|
+
- [Route-Level Hooks](#route-level-hooks)
|
|
28
|
+
- [Async Hook Patterns](#async-hook-patterns)
|
|
29
|
+
|
|
10
30
|
## Request Lifecycle Overview
|
|
11
31
|
|
|
12
32
|
Fastify executes hooks in a specific order:
|
|
@@ -7,6 +7,17 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# HTTP Proxy and Reply.from()
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [@fastify/http-proxy](#fastifyhttp-proxy)
|
|
13
|
+
- [@fastify/reply-from](#fastifyreply-from)
|
|
14
|
+
- [API Gateway Pattern](#api-gateway-pattern)
|
|
15
|
+
- [Request Body Handling](#request-body-handling)
|
|
16
|
+
- [Error Handling](#error-handling)
|
|
17
|
+
- [WebSocket Proxying](#websocket-proxying)
|
|
18
|
+
- [Timeout Configuration](#timeout-configuration)
|
|
19
|
+
- [Caching Proxied Responses](#caching-proxied-responses)
|
|
20
|
+
|
|
10
21
|
## @fastify/http-proxy
|
|
11
22
|
|
|
12
23
|
Use `@fastify/http-proxy` for simple reverse proxy scenarios:
|
|
@@ -7,6 +7,24 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Logging with Pino
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Built-in Pino Integration](#built-in-pino-integration)
|
|
13
|
+
- [Log Levels](#log-levels)
|
|
14
|
+
- [Request-Scoped Logging](#request-scoped-logging)
|
|
15
|
+
- [Structured Logging](#structured-logging)
|
|
16
|
+
- [Logging Configuration by Environment](#logging-configuration-by-environment)
|
|
17
|
+
- [Custom Serializers](#custom-serializers)
|
|
18
|
+
- [Redacting Sensitive Data](#redacting-sensitive-data)
|
|
19
|
+
- [Child Loggers](#child-loggers)
|
|
20
|
+
- [Request Logging Configuration](#request-logging-configuration)
|
|
21
|
+
- [Logging Errors](#logging-errors)
|
|
22
|
+
- [Log Destinations](#log-destinations)
|
|
23
|
+
- [Log Rotation](#log-rotation)
|
|
24
|
+
- [Log Aggregation](#log-aggregation)
|
|
25
|
+
- [Request ID Tracking](#request-id-tracking)
|
|
26
|
+
- [Performance Considerations](#performance-considerations)
|
|
27
|
+
|
|
10
28
|
## Built-in Pino Integration
|
|
11
29
|
|
|
12
30
|
Fastify uses Pino for high-performance logging:
|
|
@@ -7,6 +7,26 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Performance Optimization
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Fastify is Fast by Default](#fastify-is-fast-by-default)
|
|
13
|
+
- [Use @fastify/under-pressure for Load Shedding](#use-fastifyunder-pressure-for-load-shedding)
|
|
14
|
+
- [Always Define Response Schemas](#always-define-response-schemas)
|
|
15
|
+
- [Avoid Dynamic Schema Compilation](#avoid-dynamic-schema-compilation)
|
|
16
|
+
- [Use Logger Wisely](#use-logger-wisely)
|
|
17
|
+
- [Connection Pooling](#connection-pooling)
|
|
18
|
+
- [Avoid Blocking the Event Loop](#avoid-blocking-the-event-loop)
|
|
19
|
+
- [Stream Large Responses](#stream-large-responses)
|
|
20
|
+
- [Caching Strategies](#caching-strategies)
|
|
21
|
+
- [Request Coalescing with async-cache-dedupe](#request-coalescing-with-async-cache-dedupe)
|
|
22
|
+
- [Payload Limits](#payload-limits)
|
|
23
|
+
- [Compression](#compression)
|
|
24
|
+
- [Connection Timeouts](#connection-timeouts)
|
|
25
|
+
- [Disable Unnecessary Features](#disable-unnecessary-features)
|
|
26
|
+
- [Benchmarking](#benchmarking)
|
|
27
|
+
- [Profiling](#profiling)
|
|
28
|
+
- [Memory Management](#memory-management)
|
|
29
|
+
|
|
10
30
|
## Fastify is Fast by Default
|
|
11
31
|
|
|
12
32
|
Fastify is designed for performance. Key optimizations are built-in:
|
|
@@ -7,6 +7,20 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Plugin Development and Encapsulation
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Understanding Encapsulation](#understanding-encapsulation)
|
|
13
|
+
- [Breaking Encapsulation with fastify-plugin](#breaking-encapsulation-with-fastify-plugin)
|
|
14
|
+
- [Plugin Registration Order](#plugin-registration-order)
|
|
15
|
+
- [Plugin Options](#plugin-options)
|
|
16
|
+
- [Plugin Factory Pattern](#plugin-factory-pattern)
|
|
17
|
+
- [Plugin Dependencies](#plugin-dependencies)
|
|
18
|
+
- [Scoped Plugins for Route Groups](#scoped-plugins-for-route-groups)
|
|
19
|
+
- [Prefix Routes with Register](#prefix-routes-with-register)
|
|
20
|
+
- [Plugin Metadata](#plugin-metadata)
|
|
21
|
+
- [Autoload Plugins](#autoload-plugins)
|
|
22
|
+
- [Testing Plugins in Isolation](#testing-plugins-in-isolation)
|
|
23
|
+
|
|
10
24
|
## Understanding Encapsulation
|
|
11
25
|
|
|
12
26
|
Fastify's plugin system provides automatic encapsulation. Each plugin creates its own context, isolating decorators, hooks, and plugins registered within it:
|
|
@@ -7,6 +7,24 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Route Organization and Handlers
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Basic Route Definition](#basic-route-definition)
|
|
13
|
+
- [Route Parameters](#route-parameters)
|
|
14
|
+
- [Query String Parameters](#query-string-parameters)
|
|
15
|
+
- [Request Body](#request-body)
|
|
16
|
+
- [Headers](#headers)
|
|
17
|
+
- [Reply Methods](#reply-methods)
|
|
18
|
+
- [Route Organization by Feature](#route-organization-by-feature)
|
|
19
|
+
- [Route Constraints](#route-constraints)
|
|
20
|
+
- [Route Prefixing](#route-prefixing)
|
|
21
|
+
- [Multiple Methods](#multiple-methods)
|
|
22
|
+
- [404 Handler](#404-handler)
|
|
23
|
+
- [Method Not Allowed](#method-not-allowed)
|
|
24
|
+
- [Route-Level Configuration](#route-level-configuration)
|
|
25
|
+
- [Async Route Registration](#async-route-registration)
|
|
26
|
+
- [Auto-loading Routes with @fastify/autoload](#auto-loading-routes-with-fastifyautoload)
|
|
27
|
+
|
|
10
28
|
## Basic Route Definition
|
|
11
29
|
|
|
12
30
|
Define routes with the shorthand methods or the full route method:
|
|
@@ -7,6 +7,26 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# JSON Schema Validation
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Use TypeBox for Type-Safe Schemas](#use-typebox-for-type-safe-schemas)
|
|
13
|
+
- [TypeBox Common Patterns](#typebox-common-patterns)
|
|
14
|
+
- [Register TypeBox Schemas Globally](#register-typebox-schemas-globally)
|
|
15
|
+
- [Plain JSON Schema (Alternative)](#plain-json-schema-alternative)
|
|
16
|
+
- [Request Validation Parts](#request-validation-parts)
|
|
17
|
+
- [Shared Schemas with $id](#shared-schemas-with-id)
|
|
18
|
+
- [Array Schemas](#array-schemas)
|
|
19
|
+
- [Custom Formats](#custom-formats)
|
|
20
|
+
- [Custom Keywords](#custom-keywords)
|
|
21
|
+
- [Coercion](#coercion)
|
|
22
|
+
- [Validation Error Handling](#validation-error-handling)
|
|
23
|
+
- [Schema Compiler Options](#schema-compiler-options)
|
|
24
|
+
- [Nullable Fields](#nullable-fields)
|
|
25
|
+
- [Conditional Validation](#conditional-validation)
|
|
26
|
+
- [Schema Organization](#schema-organization)
|
|
27
|
+
- [OpenAPI/Swagger Integration](#openapiswagger-integration)
|
|
28
|
+
- [Performance Considerations](#performance-considerations)
|
|
29
|
+
|
|
10
30
|
## Use TypeBox for Type-Safe Schemas
|
|
11
31
|
|
|
12
32
|
**Prefer TypeBox for defining schemas.** It provides TypeScript types automatically and compiles to JSON Schema:
|
|
@@ -7,6 +7,25 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Response Serialization
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Use TypeBox for Type-Safe Response Schemas](#use-typebox-for-type-safe-response-schemas)
|
|
13
|
+
- [Fast JSON Stringify](#fast-json-stringify)
|
|
14
|
+
- [Response Schema Benefits](#response-schema-benefits)
|
|
15
|
+
- [Multiple Status Code Schemas](#multiple-status-code-schemas)
|
|
16
|
+
- [Default Response Schema](#default-response-schema)
|
|
17
|
+
- [Custom Serializers](#custom-serializers)
|
|
18
|
+
- [Shared Serializers](#shared-serializers)
|
|
19
|
+
- [Serialization with Type Coercion](#serialization-with-type-coercion)
|
|
20
|
+
- [Nullable Fields](#nullable-fields)
|
|
21
|
+
- [Additional Properties](#additional-properties)
|
|
22
|
+
- [Nested Objects](#nested-objects)
|
|
23
|
+
- [Date Serialization](#date-serialization)
|
|
24
|
+
- [BigInt Serialization](#bigint-serialization)
|
|
25
|
+
- [Stream Responses](#stream-responses)
|
|
26
|
+
- [Pre-Serialization Hook](#pre-serialization-hook)
|
|
27
|
+
- [Disable Serialization](#disable-serialization)
|
|
28
|
+
|
|
10
29
|
## Use TypeBox for Type-Safe Response Schemas
|
|
11
30
|
|
|
12
31
|
Define response schemas with TypeBox for automatic TypeScript types and fast serialization:
|
|
@@ -7,6 +7,23 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# Testing Fastify Applications
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Using inject() for Request Testing](#using-inject-for-request-testing)
|
|
13
|
+
- [Testing with Headers and Authentication](#testing-with-headers-and-authentication)
|
|
14
|
+
- [Testing Query Parameters](#testing-query-parameters)
|
|
15
|
+
- [Testing URL Parameters](#testing-url-parameters)
|
|
16
|
+
- [Testing Validation Errors](#testing-validation-errors)
|
|
17
|
+
- [Testing File Uploads](#testing-file-uploads)
|
|
18
|
+
- [Testing Streams](#testing-streams)
|
|
19
|
+
- [Mocking Dependencies](#mocking-dependencies)
|
|
20
|
+
- [Testing Plugins in Isolation](#testing-plugins-in-isolation)
|
|
21
|
+
- [Testing Hooks](#testing-hooks)
|
|
22
|
+
- [Test Factory Pattern](#test-factory-pattern)
|
|
23
|
+
- [Database Testing with Transactions](#database-testing-with-transactions)
|
|
24
|
+
- [Parallel Test Execution](#parallel-test-execution)
|
|
25
|
+
- [Running Tests](#running-tests)
|
|
26
|
+
|
|
10
27
|
## Using inject() for Request Testing
|
|
11
28
|
|
|
12
29
|
Fastify's `inject()` method simulates HTTP requests without network overhead:
|
|
@@ -7,6 +7,21 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# TypeScript Integration
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Type Stripping with Node.js](#type-stripping-with-nodejs)
|
|
13
|
+
- [Basic Type Safety](#basic-type-safety)
|
|
14
|
+
- [Typing Route Handlers](#typing-route-handlers)
|
|
15
|
+
- [Type Providers](#type-providers)
|
|
16
|
+
- [Typing Decorators](#typing-decorators)
|
|
17
|
+
- [Typing Plugins](#typing-plugins)
|
|
18
|
+
- [Typing Hooks](#typing-hooks)
|
|
19
|
+
- [Typing Schema Objects](#typing-schema-objects)
|
|
20
|
+
- [Shared Types](#shared-types)
|
|
21
|
+
- [Type-Safe Route Registration](#type-safe-route-registration)
|
|
22
|
+
- [Avoiding Type Gymnastics](#avoiding-type-gymnastics)
|
|
23
|
+
- [Type Checking Without Compilation](#type-checking-without-compilation)
|
|
24
|
+
|
|
10
25
|
## Type Stripping with Node.js
|
|
11
26
|
|
|
12
27
|
Use Node.js built-in type stripping (Node.js 22.6+):
|
|
@@ -7,6 +7,21 @@ metadata:
|
|
|
7
7
|
|
|
8
8
|
# WebSocket Support
|
|
9
9
|
|
|
10
|
+
## Contents
|
|
11
|
+
|
|
12
|
+
- [Using @fastify/websocket](#using-fastifywebsocket)
|
|
13
|
+
- [WebSocket with Hooks](#websocket-with-hooks)
|
|
14
|
+
- [Connection Options](#connection-options)
|
|
15
|
+
- [Broadcast to All Clients](#broadcast-to-all-clients)
|
|
16
|
+
- [Rooms/Channels Pattern](#roomschannels-pattern)
|
|
17
|
+
- [Structured Message Protocol](#structured-message-protocol)
|
|
18
|
+
- [Heartbeat/Ping-Pong](#heartbeatping-pong)
|
|
19
|
+
- [Authentication](#authentication)
|
|
20
|
+
- [Error Handling](#error-handling)
|
|
21
|
+
- [Rate Limiting WebSocket Messages](#rate-limiting-websocket-messages)
|
|
22
|
+
- [Graceful Shutdown](#graceful-shutdown)
|
|
23
|
+
- [Full-Duplex Stream Pattern](#full-duplex-stream-pattern)
|
|
24
|
+
|
|
10
25
|
## Using @fastify/websocket
|
|
11
26
|
|
|
12
27
|
Add WebSocket support to Fastify:
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
This skill was copied from Affaan Mustafa's ECC repository.
|
|
4
4
|
|
|
5
5
|
- Source: https://github.com/affaan-m/ECC/tree/main/skills/golang-patterns
|
|
6
|
-
- Source commit:
|
|
6
|
+
- Source commit: d29cf651c795869f733669c33e3d33dfd8307d10
|
|
7
7
|
- License: MIT
|
|
8
8
|
- Copyright: Copyright (c) 2026 Affaan Mustafa
|
|
9
9
|
|
|
@@ -5,7 +5,7 @@ This skill is adapted from two MIT-licensed community skills:
|
|
|
5
5
|
- ECC docker-patterns: https://github.com/affaan-m/ECC/tree/main/.kiro/skills/docker-patterns
|
|
6
6
|
- ECC source commit: 0f84c0e2796703fbda87d577b2636351418c7442
|
|
7
7
|
- Antigravity docker-expert: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/docker-expert
|
|
8
|
-
- Antigravity source commit:
|
|
8
|
+
- Antigravity source commit: e0bcf882d89316b924ed2416dd42eb4b1099ea53
|
|
9
9
|
|
|
10
10
|
The upstream MIT license texts are included in `LICENSE.ECC` and
|
|
11
11
|
`LICENSE.ANTIGRAVITY`.
|