connore 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -8
- package/package.json +2 -1
- package/packs/base/planning/START.md +29 -28
- package/packs/base/planning/blueprint-template.md +46 -46
- package/packs/base/planning/plan-template.md +46 -45
- package/packs/base/rules/anti-patterns.md +19 -16
- package/packs/base/rules/code-style.md +19 -16
- package/packs/base/rules/dependency-policy.md +19 -16
- package/packs/base/rules/error-handling.md +19 -16
- package/packs/base/rules/security-audit.md +47 -0
- package/packs/base/rules/security-baseline.md +19 -16
- package/packs/base/templates/bug-report.md +19 -16
- package/packs/base/templates/feature-spec.md +19 -16
- package/packs/base/templates/handoff.md +19 -16
- package/packs/base/templates/project-brief.md +19 -16
- package/packs/base/workflow/code-review.md +19 -16
- package/packs/base/workflow/debugging.md +18 -14
- package/packs/base/workflow/git-and-commits.md +19 -16
- package/packs/base/workflow/idea-to-spec.md +19 -16
- package/packs/base/workflow/session-handoff.md +19 -16
- package/packs/base/workflow/spec-to-plan.md +19 -16
- package/packs/knowledge/backend/api/conventions.md +21 -0
- package/packs/knowledge/backend/architecture/local-sqlite.md +20 -0
- package/packs/knowledge/backend/authentication/session-and-engine.md +24 -0
- package/packs/knowledge/backend/database/schema.md +21 -0
- package/packs/knowledge/components/custom/ambient-background.md +26 -0
- package/packs/knowledge/components/custom/ambient-background.tsx +12 -0
- package/packs/knowledge/components/custom/corner-frame.md +26 -0
- package/packs/knowledge/components/custom/corner-frame.tsx +48 -0
- package/packs/knowledge/components/custom/cta-button.md +26 -0
- package/packs/knowledge/components/custom/cta-button.tsx +10 -0
- package/packs/knowledge/components/custom/page-transition.md +26 -0
- package/packs/knowledge/components/custom/page-transition.tsx +10 -0
- package/packs/knowledge/components/custom/smooth-scroll.md +26 -0
- package/packs/knowledge/components/custom/smooth-scroll.tsx +32 -0
- package/packs/knowledge/components/motion-effects/README.md +30 -0
- package/packs/knowledge/components/ui-primitives/LICENSE +21 -0
- package/packs/knowledge/components/ui-primitives/README.md +22 -0
- package/packs/knowledge/components/ui-primitives/badge.md +26 -0
- package/packs/knowledge/components/ui-primitives/badge.tsx +48 -0
- package/packs/knowledge/components/ui-primitives/button.md +27 -0
- package/packs/knowledge/components/ui-primitives/button.tsx +66 -0
- package/packs/knowledge/components/ui-primitives/card.md +26 -0
- package/packs/knowledge/components/ui-primitives/card.tsx +102 -0
- package/packs/knowledge/components/ui-primitives/checkbox.md +26 -0
- package/packs/knowledge/components/ui-primitives/checkbox.tsx +32 -0
- package/packs/knowledge/components/ui-primitives/dialog.md +26 -0
- package/packs/knowledge/components/ui-primitives/dialog.tsx +168 -0
- package/packs/knowledge/components/ui-primitives/dropdown-menu.md +26 -0
- package/packs/knowledge/components/ui-primitives/dropdown-menu.tsx +268 -0
- package/packs/knowledge/components/ui-primitives/input.md +27 -0
- package/packs/knowledge/components/ui-primitives/input.tsx +18 -0
- package/packs/knowledge/components/ui-primitives/label.md +26 -0
- package/packs/knowledge/components/ui-primitives/label.tsx +23 -0
- package/packs/knowledge/components/ui-primitives/progress.md +26 -0
- package/packs/knowledge/components/ui-primitives/progress.tsx +30 -0
- package/packs/knowledge/components/ui-primitives/scroll-area.md +26 -0
- package/packs/knowledge/components/ui-primitives/scroll-area.tsx +54 -0
- package/packs/knowledge/components/ui-primitives/select.md +26 -0
- package/packs/knowledge/components/ui-primitives/select.tsx +191 -0
- package/packs/knowledge/components/ui-primitives/separator.md +26 -0
- package/packs/knowledge/components/ui-primitives/separator.tsx +27 -0
- package/packs/knowledge/components/ui-primitives/sonner.md +26 -0
- package/packs/knowledge/components/ui-primitives/sonner.tsx +49 -0
- package/packs/knowledge/components/ui-primitives/switch.md +26 -0
- package/packs/knowledge/components/ui-primitives/switch.tsx +32 -0
- package/packs/knowledge/components/ui-primitives/tabs.md +26 -0
- package/packs/knowledge/components/ui-primitives/tabs.tsx +89 -0
- package/packs/knowledge/components/ui-primitives/textarea.md +26 -0
- package/packs/knowledge/components/ui-primitives/textarea.tsx +17 -0
- package/packs/knowledge/components/ui-primitives/tooltip.md +26 -0
- package/packs/knowledge/components/ui-primitives/tooltip.tsx +56 -0
- package/packs/knowledge/design/aesthetics/app-shell.md +41 -0
- package/packs/knowledge/design/aesthetics/code-neutral.md +40 -0
- package/packs/knowledge/design/aesthetics/match.md +46 -0
- package/packs/knowledge/design/aesthetics/ruled-outline.md +40 -0
- package/packs/knowledge/design/aesthetics/solid-accent.md +43 -0
- package/packs/knowledge/design/animations/motion.md +40 -0
- package/packs/knowledge/design/project-style.md +50 -0
- package/packs/knowledge/design/references/benefit-card-grid.md +27 -0
- package/packs/knowledge/design/references/benefit-card-grid.png +0 -0
- package/packs/knowledge/design/references/cta-centered.md +27 -0
- package/packs/knowledge/design/references/cta-centered.png +0 -0
- package/packs/knowledge/design/references/cta-split-media.md +27 -0
- package/packs/knowledge/design/references/cta-split-media.png +0 -0
- package/packs/knowledge/design/references/dashboard-overview.md +31 -0
- package/packs/knowledge/design/references/dashboard-overview.png +0 -0
- package/packs/knowledge/design/references/faq-split-accordion.md +27 -0
- package/packs/knowledge/design/references/faq-split-accordion.png +0 -0
- package/packs/knowledge/design/references/feature-split-checklist.md +27 -0
- package/packs/knowledge/design/references/feature-split-checklist.png +0 -0
- package/packs/knowledge/design/references/footer-four-column.md +27 -0
- package/packs/knowledge/design/references/footer-four-column.png +0 -0
- package/packs/knowledge/design/references/footer-two-column.md +27 -0
- package/packs/knowledge/design/references/footer-two-column.png +0 -0
- package/packs/knowledge/design/references/hero-accent-curtain.md +27 -0
- package/packs/knowledge/design/references/hero-accent-curtain.png +0 -0
- package/packs/knowledge/design/references/hero-split-media.md +27 -0
- package/packs/knowledge/design/references/hero-split-media.png +0 -0
- package/packs/knowledge/design/references/logo-cloud-grid.md +27 -0
- package/packs/knowledge/design/references/logo-cloud-grid.png +0 -0
- package/packs/knowledge/design/references/logo-row-ruled.md +27 -0
- package/packs/knowledge/design/references/logo-row-ruled.png +0 -0
- package/packs/knowledge/design/references/pricing-three-card.md +27 -0
- package/packs/knowledge/design/references/pricing-three-card.png +0 -0
- package/packs/knowledge/design/references/steps-ruled-grid.md +27 -0
- package/packs/knowledge/design/references/steps-ruled-grid.png +0 -0
- package/packs/knowledge/design/rules.md +35 -0
- package/packs/knowledge/design/token-structure.md +46 -0
- package/packs/knowledge/design/tokens.md +55 -0
- package/packs/knowledge/frontend/README.md +50 -0
- package/packs/knowledge/frontend/SOURCES.md +40 -0
- package/packs/knowledge/frontend/accessibility/focus-and-dialogs.md +47 -0
- package/packs/knowledge/frontend/accessibility/semantics-and-keyboard.md +45 -0
- package/packs/knowledge/frontend/accessibility/wcag-targets.md +43 -0
- package/packs/knowledge/frontend/architecture/agent-context-files.md +43 -0
- package/packs/knowledge/frontend/architecture/app-foundations.md +43 -0
- package/packs/knowledge/frontend/architecture/error-handling.md +47 -0
- package/packs/knowledge/frontend/architecture/feature-modules.md +49 -0
- package/packs/knowledge/frontend/architecture/import-boundaries.md +44 -0
- package/packs/knowledge/frontend/architecture/naming.md +43 -0
- package/packs/knowledge/frontend/architecture/project-structure.md +48 -0
- package/packs/knowledge/frontend/architecture/routing.md +45 -0
- package/packs/knowledge/frontend/architecture/security.md +44 -0
- package/packs/knowledge/frontend/architecture/typescript.md +44 -0
- package/packs/knowledge/frontend/components/composition.md +45 -0
- package/packs/knowledge/frontend/components/data-display.md +47 -0
- package/packs/knowledge/frontend/components/library-choice.md +45 -0
- package/packs/knowledge/frontend/components/variants.md +44 -0
- package/packs/knowledge/frontend/forms/form-architecture.md +49 -0
- package/packs/knowledge/frontend/forms/multi-step.md +43 -0
- package/packs/knowledge/frontend/forms/validation.md +47 -0
- package/packs/knowledge/frontend/layout/responsive.md +41 -0
- package/packs/knowledge/frontend/page-blueprints/app-shell.md +16 -0
- package/packs/knowledge/frontend/page-blueprints/faq-footer.md +22 -0
- package/packs/knowledge/frontend/page-blueprints/feature-grid.md +22 -0
- package/packs/knowledge/frontend/page-blueprints/pricing.md +16 -0
- package/packs/knowledge/frontend/page-blueprints/saas-hero.md +24 -0
- package/packs/knowledge/frontend/patterns/dark-marketing.md +18 -0
- package/packs/knowledge/frontend/patterns/status-pill.md +19 -0
- package/packs/knowledge/frontend/performance/code-splitting.md +47 -0
- package/packs/knowledge/frontend/performance/images-and-vitals.md +44 -0
- package/packs/knowledge/frontend/performance/rendering.md +40 -0
- package/packs/knowledge/frontend/rendering/server-and-client.md +50 -0
- package/packs/knowledge/frontend/state/api-layer.md +49 -0
- package/packs/knowledge/frontend/state/async-ui-states.md +43 -0
- package/packs/knowledge/frontend/state/client-store.md +46 -0
- package/packs/knowledge/frontend/state/server-cache.md +42 -0
- package/packs/knowledge/frontend/state/state-categories.md +50 -0
- package/packs/knowledge/frontend/testing/component-tests.md +44 -0
- package/packs/knowledge/frontend/testing/strategy.md +46 -0
- package/packs/knowledge/inbox/README.md +14 -0
- package/packs/knowledge/workflows/authentication.md +18 -0
- package/packs/knowledge/workflows/crud.md +20 -0
- package/packs/knowledge/workflows/dashboard.md +22 -0
- package/packs/nextjs-fullstack/backend/auth-and-roles.md +19 -16
- package/packs/nextjs-fullstack/backend/background-jobs.md +19 -16
- package/packs/nextjs-fullstack/backend/caching.md +17 -14
- package/packs/nextjs-fullstack/backend/database.md +19 -16
- package/packs/nextjs-fullstack/backend/file-uploads.md +19 -16
- package/packs/nextjs-fullstack/backend/logging.md +17 -14
- package/packs/nextjs-fullstack/backend/migrations.md +17 -14
- package/packs/nextjs-fullstack/backend/rate-limiting.md +19 -16
- package/packs/nextjs-fullstack/backend/secrets-and-env.md +19 -16
- package/packs/nextjs-fullstack/backend/validation.md +19 -16
- package/packs/nextjs-fullstack/blueprints/ai-app.md +1 -1
- package/packs/nextjs-fullstack/blueprints/internal-tool.md +1 -1
- package/packs/nextjs-fullstack/blueprints/saas-app.md +1 -1
- package/packs/nextjs-fullstack/build-deploy/ci.md +18 -16
- package/packs/nextjs-fullstack/build-deploy/deploy.md +19 -16
- package/packs/nextjs-fullstack/build-deploy/monitoring.md +16 -14
- package/packs/nextjs-fullstack/build-deploy/performance.md +17 -14
- package/packs/nextjs-fullstack/build-deploy/project-structure.md +18 -16
- package/packs/nextjs-fullstack/build-deploy/release-checklist.md +20 -16
- package/packs/nextjs-fullstack/build-deploy/testing.md +19 -16
- package/packs/nextjs-fullstack/evals/README.md +18 -15
- package/packs/nextjs-fullstack/examples/golden-app/README.md +18 -16
- package/packs/nextjs-fullstack/frontend/accessibility.md +17 -14
- package/packs/nextjs-fullstack/frontend/components.md +19 -16
- package/packs/nextjs-fullstack/frontend/copy.md +46 -0
- package/packs/nextjs-fullstack/frontend/data-fetching.md +46 -0
- package/packs/nextjs-fullstack/frontend/forms.md +17 -14
- package/packs/nextjs-fullstack/frontend/layout.md +19 -16
- package/packs/nextjs-fullstack/frontend/loading-empty-error.md +19 -16
- package/packs/nextjs-fullstack/frontend/motion.md +17 -14
- package/packs/nextjs-fullstack/frontend/responsive.md +19 -16
- package/packs/nextjs-fullstack/frontend/seo.md +20 -16
- package/packs/nextjs-fullstack/frontend/tables.md +17 -14
- package/packs/nextjs-fullstack/frontend/tokens.md +18 -16
- package/packs/nextjs-fullstack/integrations/analytics.md +17 -14
- package/packs/nextjs-fullstack/integrations/email.md +17 -14
- package/packs/nextjs-fullstack/integrations/llm-apis.md +19 -16
- package/packs/nextjs-fullstack/integrations/oauth.md +19 -16
- package/packs/nextjs-fullstack/integrations/object-storage.md +19 -16
- package/packs/nextjs-fullstack/integrations/payments.md +17 -14
- package/packs/nextjs-fullstack/integrations/queues.md +17 -14
- package/packs/nextjs-fullstack/integrations/search.md +19 -16
- package/packs/nextjs-fullstack/integrations/webhooks.md +17 -14
- package/packs/nextjs-fullstack/playbooks/add-ai-feature.md +19 -16
- package/packs/nextjs-fullstack/playbooks/add-auth.md +19 -16
- package/packs/nextjs-fullstack/playbooks/add-crud.md +19 -16
- package/packs/nextjs-fullstack/playbooks/add-email.md +19 -16
- package/packs/nextjs-fullstack/playbooks/add-file-upload.md +19 -16
- package/packs/nextjs-fullstack/playbooks/add-webhook.md +19 -16
- package/packs/nextjs-fullstack/playbooks/ship-to-prod.md +20 -16
- package/plugins/connore/.claude-plugin/plugin.json +10 -0
- package/plugins/connore/hooks/hooks.json +16 -0
- package/plugins/connore/skills/connore-backend/SKILL.md +32 -0
- package/plugins/connore/skills/connore-handoff/SKILL.md +15 -0
- package/plugins/connore/skills/connore-routes/SKILL.md +16 -0
- package/plugins/connore/skills/connore-validate/SKILL.md +15 -0
- package/src/cli.js +110 -21
- package/src/commands/doctor.js +2 -0
- package/src/commands/edit.js +88 -0
- package/src/commands/graph.js +20 -0
- package/src/commands/handoff.js +45 -0
- package/src/commands/init.js +8 -3
- package/src/commands/lint.js +13 -5
- package/src/commands/log.js +49 -25
- package/src/commands/packs.js +21 -0
- package/src/commands/routes.js +13 -0
- package/src/commands/search.js +7 -2
- package/src/commands/update.js +5 -1
- package/src/lib/config.js +67 -64
- package/src/lib/graph.js +96 -0
- package/src/lib/index.js +88 -72
- package/src/lib/lessons.js +173 -173
- package/src/lib/lint.js +185 -67
- package/src/lib/mutate.js +26 -24
- package/src/lib/packs.js +25 -10
- package/src/lib/paths.js +1 -1
- package/src/lib/prompts.js +66 -0
- package/src/lib/report.js +41 -33
- package/src/lib/routes.js +59 -0
- package/src/lib/run.js +116 -73
- package/src/lib/search.js +24 -0
- package/src/lib/tokens.js +8 -0
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Logging
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [logs]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before adding a log line.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Logging
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A failure or a write should be traceable.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Log the route, the status, a request id, and the ids of the rows you touched.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A success path that already returns the resource. Do not log the body to be sure.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never log secrets, cookies, or the raw body.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
Logs become a second copy of private data.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Add a request id at the boundary.
|
|
30
|
+
2. Log handled errors with the id.
|
|
31
|
+
3. Keep the line free of credentials.
|
|
32
|
+
4. Use the same shape in the worker.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
A failed write can be found by the request id, and the line has no secret.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
500 on refund logs the order id and the code.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
console.log of the session cookie. A log of the full prompt.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack. Original wording. No vendor text copied.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Migrations
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [database, migrations]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before changing the database shape.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Migrations
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A table or column must change.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Add a new migration file. Apply it from an empty database in the check suite. Do not edit a migration that has already shipped.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A change you can express in the application without a schema change.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never edit production by hand and forget the file. Never change a shipped migration to fix a typo.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
The next environment will not match production.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Add one file with the change.
|
|
30
|
+
2. Run it on empty.
|
|
31
|
+
3. Run it on a copy of the current shape.
|
|
32
|
+
4. Ship the file with the code that needs it.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
A new database ends on the same shape as production.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
Adding organization_id is a new file, and old rows get a backfill in that file.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
Editing the first migration after release. A manual ALTER with no file.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack. Original wording. No vendor text copied.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Rate
|
|
2
|
+
title: Rate limiting
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [abuse, limits]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before a public or expensive route.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# Rate
|
|
11
|
+
# Rate limiting
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A route can be called in a loop: sign-in, a model call, or a password reset.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Limit by the caller and the route. Return 429 when the limit is hit. Keep the limit out of the success path's logic.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
An internal job you control. Limit the worker's concurrency instead.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never limit only in the UI. Never use the limit as a substitute for authorization.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
A missing limit is how a key or a mailbox gets burned.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Name the route and the budget with the user.
|
|
30
|
+
2. Count by user id when signed in, otherwise by address.
|
|
31
|
+
3. Return 429 with a short retry hint.
|
|
32
|
+
4. Do not log the credential that was attempted.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
The extra call after the budget returns 429, and a normal user is unaffected.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
Sign-in allows a small burst, then 429.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
A global limit that locks the whole product. Limiting only the button.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack. Original wording. No vendor text copied.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Secrets
|
|
2
|
+
title: Secrets and environment
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [secrets, env]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before adding a key, a url, or an example env file.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# Secrets
|
|
11
|
+
# Secrets and environment
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
The app needs a credential or a per-environment setting.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Read it from the environment on the server. Commit an example file with obvious placeholders only.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A public value such as the site name. It can live in the client.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never commit a real key. Never prefix a secret so the client bundle includes it.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
The example file is how keys leak, one placeholder that was a real value.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Add the name to the example file with a placeholder like YOUR_KEY_HERE.
|
|
30
|
+
2. Read it on the server.
|
|
31
|
+
3. Fail the boot or the request with a generic error when it is missing.
|
|
32
|
+
4. Keep production values only on the host.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
The repo has the name and not the value. The client bundle does not contain it.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
PAYMENT_SECRET is read in the webhook route and the example file says YOUR_KEY_HERE.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
A real key in .env that was committed. A secret in a NEXT_PUBLIC variable.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack. Original wording. No vendor text copied.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Validation
|
|
2
|
+
title: Validation and errors
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [validation, errors]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before trusting a request body or showing a failure.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# Validation
|
|
11
|
+
# Validation and errors
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A handler accepts input, or a failure must be shown to the caller.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Validate type, range, and length on the server. Return one error object the client can show. Log the real cause on the server only.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A generated file download with no user input. Still check the query id belongs to the caller.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never return a stack, a query, or a secret in the response. Never accept a string where a number is required and coerce it quietly.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
The client can send any JSON. The response is also what an attacker reads.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Parse JSON. Bad JSON is 400.
|
|
30
|
+
2. Check each field. Name the field in the error.
|
|
31
|
+
3. Map a known failure to 400, 401, 403, or 404.
|
|
32
|
+
4. On an unexpected failure, log it and return a generic 500.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
A bad field names itself, and the response body has no stack.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
quantity 0 returns 400 with the field name. A database timeout returns 500 and a generic sentence.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
200 with an ok false flag. Returning the driver error to the browser.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack. Pairs with the API conventions entry.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: Continuous integration
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [ci, tests]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before adding or changing the check that runs on every push.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Continuous integration
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A change should be rejected when tests or types fail.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
One workflow runs install, typecheck, and the test suite on every push.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A local script the user runs by hand. Do not add a second remote that does the same job.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never skip the suite with a flag to get a green mark. Never store a token in the workflow file.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
The check is the only thing that stops a broken branch from looking finished.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Run the same commands a developer can run locally.
|
|
30
|
+
2. Fail the job when any command exits non-zero.
|
|
31
|
+
3. Cache dependencies. Do not cache the test result.
|
|
30
32
|
|
|
31
33
|
## Done when
|
|
32
|
-
|
|
34
|
+
A commit that breaks a test does not go green.
|
|
33
35
|
|
|
34
36
|
## Example
|
|
35
|
-
|
|
37
|
+
A pull request with a failing test stays blocked.
|
|
36
38
|
|
|
37
39
|
## Common mistakes
|
|
38
|
-
|
|
40
|
+
A badge that is always green because the job was disabled.
|
|
39
41
|
|
|
40
42
|
## Sources
|
|
41
|
-
|
|
43
|
+
Connore pack. Original wording. No vendor text copied.
|
|
42
44
|
|
|
43
45
|
License: MIT
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
2
|
+
title: Deployment
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [deploy]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before the first production deploy or a change to how it ships.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
#
|
|
11
|
+
# Deployment
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
The app needs a public environment.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
The host runs the build from a clean install. Env vars are set on the host. The database migration runs as its own step before traffic moves.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A preview for one branch. Same rules, with a separate database.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never point a preview at the production database. Never commit the host token. Never skip the migration and fix it by hand in production.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
The machine that built it locally is not the machine that serves it.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Pick the host with the user.
|
|
30
|
+
2. Set the env vars from the example file's names, with real values only on the host.
|
|
31
|
+
3. Run migrations before the new version takes traffic.
|
|
32
|
+
4. Confirm one signed-in request against production, then watch errors.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
A new environment can be created from the repo and the env names alone.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
The example file lists DATABASE_URL with a placeholder. Production has the real url only in the host.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
Building on a laptop and uploading the folder. Sharing one database between preview and production.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Monitoring
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [logs, errors]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before a production deploy or when asked how failures will be seen.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Monitoring
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
The user needs to know when production breaks.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Log a request id, the route, and the status. Alert on an error spike, not on a single 404.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A local project with no users. Say there is nothing to watch yet.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never log a password, a token, a card number, or a full request body.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
Without a signal, the first report is a user.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Name the log line for a handled error and an unhandled one.
|
|
30
|
+
2. Keep secrets out of the line.
|
|
31
|
+
3. Tell the user where to look after deploy.
|
|
30
32
|
|
|
31
33
|
## Done when
|
|
32
|
-
|
|
34
|
+
A forced 500 produces one log line and no secret.
|
|
33
35
|
|
|
34
36
|
## Example
|
|
35
|
-
|
|
37
|
+
The refund failure logs the order id and the status, not the card.
|
|
36
38
|
|
|
37
39
|
## Common mistakes
|
|
38
|
-
|
|
40
|
+
Logging the whole JSON body. An alert on every 404.
|
|
39
41
|
|
|
40
42
|
## Sources
|
|
41
|
-
|
|
43
|
+
Connore pack. Original wording. No vendor text copied.
|
|
42
44
|
|
|
43
45
|
License: MIT
|
|
@@ -1,43 +1,46 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Performance
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [performance, bundle]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load when a page is slow or a dependency is large.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
# Performance
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A screen feels slow, or a heavy library is about to join the first load.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Measure before changing. Split a route that most sessions never open. Do not lazy-load the thing the user sees first.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A state update that re-renders too often. Fix where the state lives before splitting code.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never add a memo wrapper as the first response. Never lazy-load the hero.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
Agents add libraries and then every page downloads them.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Note what is slow: first paint, a click, or a list.
|
|
30
|
+
2. Keep the heavy editor, chart, or map behind the interaction that opens it.
|
|
31
|
+
3. Set width and height on images so the page does not jump.
|
|
32
|
+
4. Compare the bundle before and after. A guess is not a result.
|
|
30
33
|
|
|
31
34
|
## Done when
|
|
32
|
-
|
|
35
|
+
The change has a before and after, and the first screen did not get slower.
|
|
33
36
|
|
|
34
37
|
## Example
|
|
35
|
-
|
|
38
|
+
A chart library loads when the user opens the report, not on the dashboard shell.
|
|
36
39
|
|
|
37
40
|
## Common mistakes
|
|
38
|
-
|
|
41
|
+
Lazy-loading the header. Optimising a component that was not in the slow path.
|
|
39
42
|
|
|
40
43
|
## Sources
|
|
41
|
-
|
|
44
|
+
Connore pack. No benchmark number is claimed.
|
|
42
45
|
|
|
43
46
|
License: MIT
|
|
@@ -1,43 +1,45 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: Project
|
|
2
|
+
title: Project structure
|
|
3
3
|
type: doc
|
|
4
|
-
tags: [
|
|
4
|
+
tags: [structure, folders]
|
|
5
5
|
stack: nextjs
|
|
6
|
-
status:
|
|
7
|
-
verified:
|
|
8
|
-
description:
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-12-07
|
|
8
|
+
description: Load before creating folders or a new route.
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
# Project
|
|
11
|
+
# Project structure
|
|
12
12
|
|
|
13
13
|
## Use when
|
|
14
|
-
|
|
14
|
+
A new app, or a file that does not have an obvious home.
|
|
15
15
|
|
|
16
16
|
## Default
|
|
17
|
-
|
|
17
|
+
Routes live in app/. Shared UI in components/. One folder per feature under features/. Server-only code stays out of client components.
|
|
18
18
|
|
|
19
19
|
## Use instead when
|
|
20
|
-
|
|
20
|
+
A one-file script. Keep it flat until a second feature needs the split.
|
|
21
21
|
|
|
22
22
|
## Never
|
|
23
|
-
|
|
23
|
+
Never import a server secret into a file marked with use client. Never let one feature import another feature's internals.
|
|
24
24
|
|
|
25
25
|
## Why
|
|
26
|
-
|
|
26
|
+
Agents invent a new folder per file. A stable split is what later tasks search.
|
|
27
27
|
|
|
28
28
|
## Steps
|
|
29
|
-
1.
|
|
29
|
+
1. Put a route, layout, and loading file only in app/.
|
|
30
|
+
2. Colocate a feature's components, actions, and schema in features/<name>/.
|
|
31
|
+
3. Share a component only after a second feature uses it.
|
|
30
32
|
|
|
31
33
|
## Done when
|
|
32
|
-
|
|
34
|
+
A newcomer can guess the folder from the kind of change.
|
|
33
35
|
|
|
34
36
|
## Example
|
|
35
|
-
|
|
37
|
+
A billing form lives in features/billing/, and app/billing/page.js only renders it.
|
|
36
38
|
|
|
37
39
|
## Common mistakes
|
|
38
|
-
|
|
40
|
+
A components/ folder of 80 unrelated files. A utils.js that every feature imports.
|
|
39
41
|
|
|
40
42
|
## Sources
|
|
41
|
-
|
|
43
|
+
Connore pack. Folder roles summarised, no framework snippet copied.
|
|
42
44
|
|
|
43
45
|
License: MIT
|