connore 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +52 -2
- package/bin/ctxkit.js +5 -0
- package/package.json +33 -4
- package/packs/CONTRIBUTING.md +32 -0
- package/packs/base/catalog/README.md +24 -0
- package/packs/base/catalog/api.md +46 -0
- package/packs/base/catalog/auth.md +46 -0
- package/packs/base/catalog/backend.md +46 -0
- package/packs/base/catalog/blueprints.md +46 -0
- package/packs/base/catalog/components.md +46 -0
- package/packs/base/catalog/database.md +46 -0
- package/packs/base/catalog/docs.md +46 -0
- package/packs/base/catalog/github.md +46 -0
- package/packs/base/catalog/golden.md +46 -0
- package/packs/base/catalog/motion.md +46 -0
- package/packs/base/catalog/plan.md +46 -0
- package/packs/base/catalog/screenshots.md +46 -0
- package/packs/base/catalog/skills.md +46 -0
- package/packs/base/catalog/tokens.md +47 -0
- package/packs/base/planning/START.md +28 -0
- package/packs/base/planning/blueprint-template.md +46 -0
- package/packs/base/planning/plan-template.md +45 -0
- package/packs/base/rules/anti-patterns.md +43 -0
- package/packs/base/rules/code-style.md +43 -0
- package/packs/base/rules/definition-of-done.md +47 -0
- package/packs/base/rules/dependency-policy.md +43 -0
- package/packs/base/rules/error-handling.md +43 -0
- package/packs/base/rules/security-baseline.md +43 -0
- package/packs/base/templates/bug-report.md +43 -0
- package/packs/base/templates/feature-spec.md +43 -0
- package/packs/base/templates/handoff.md +43 -0
- package/packs/base/templates/project-brief.md +43 -0
- package/packs/base/workflow/build-loop.md +48 -0
- package/packs/base/workflow/code-review.md +43 -0
- package/packs/base/workflow/debugging.md +43 -0
- package/packs/base/workflow/git-and-commits.md +43 -0
- package/packs/base/workflow/idea-to-spec.md +43 -0
- package/packs/base/workflow/session-handoff.md +43 -0
- package/packs/base/workflow/spec-to-plan.md +43 -0
- package/packs/frontend/components/button.md +25 -0
- package/packs/frontend/components/card.md +25 -0
- package/packs/frontend/components/input.md +25 -0
- package/packs/frontend/design/rules.md +24 -0
- package/packs/frontend/design/tokens.md +40 -0
- package/packs/nextjs-fullstack/backend/api-conventions.md +48 -0
- package/packs/nextjs-fullstack/backend/auth-and-roles.md +43 -0
- package/packs/nextjs-fullstack/backend/background-jobs.md +43 -0
- package/packs/nextjs-fullstack/backend/caching.md +43 -0
- package/packs/nextjs-fullstack/backend/database.md +43 -0
- package/packs/nextjs-fullstack/backend/file-uploads.md +43 -0
- package/packs/nextjs-fullstack/backend/logging.md +43 -0
- package/packs/nextjs-fullstack/backend/migrations.md +43 -0
- package/packs/nextjs-fullstack/backend/rate-limiting.md +43 -0
- package/packs/nextjs-fullstack/backend/secrets-and-env.md +43 -0
- package/packs/nextjs-fullstack/backend/validation.md +43 -0
- package/packs/nextjs-fullstack/blueprints/ai-app.md +84 -0
- package/packs/nextjs-fullstack/blueprints/internal-tool.md +83 -0
- package/packs/nextjs-fullstack/blueprints/saas-app.md +83 -0
- package/packs/nextjs-fullstack/build-deploy/ci.md +43 -0
- package/packs/nextjs-fullstack/build-deploy/deploy.md +43 -0
- package/packs/nextjs-fullstack/build-deploy/monitoring.md +43 -0
- package/packs/nextjs-fullstack/build-deploy/performance.md +43 -0
- package/packs/nextjs-fullstack/build-deploy/project-structure.md +43 -0
- package/packs/nextjs-fullstack/build-deploy/release-checklist.md +43 -0
- package/packs/nextjs-fullstack/build-deploy/testing.md +43 -0
- package/packs/nextjs-fullstack/evals/README.md +43 -0
- package/packs/nextjs-fullstack/examples/golden-app/README.md +43 -0
- package/packs/nextjs-fullstack/frontend/accessibility.md +43 -0
- package/packs/nextjs-fullstack/frontend/components.md +43 -0
- package/packs/nextjs-fullstack/frontend/forms.md +43 -0
- package/packs/nextjs-fullstack/frontend/layout.md +43 -0
- package/packs/nextjs-fullstack/frontend/loading-empty-error.md +43 -0
- package/packs/nextjs-fullstack/frontend/motion.md +43 -0
- package/packs/nextjs-fullstack/frontend/responsive.md +43 -0
- package/packs/nextjs-fullstack/frontend/seo.md +43 -0
- package/packs/nextjs-fullstack/frontend/tables.md +43 -0
- package/packs/nextjs-fullstack/frontend/tokens.md +43 -0
- package/packs/nextjs-fullstack/integrations/analytics.md +43 -0
- package/packs/nextjs-fullstack/integrations/email.md +43 -0
- package/packs/nextjs-fullstack/integrations/llm-apis.md +43 -0
- package/packs/nextjs-fullstack/integrations/oauth.md +43 -0
- package/packs/nextjs-fullstack/integrations/object-storage.md +43 -0
- package/packs/nextjs-fullstack/integrations/payments.md +43 -0
- package/packs/nextjs-fullstack/integrations/queues.md +43 -0
- package/packs/nextjs-fullstack/integrations/search.md +43 -0
- package/packs/nextjs-fullstack/integrations/webhooks.md +43 -0
- package/packs/nextjs-fullstack/playbooks/add-ai-feature.md +43 -0
- package/packs/nextjs-fullstack/playbooks/add-auth.md +43 -0
- package/packs/nextjs-fullstack/playbooks/add-billing.md +50 -0
- package/packs/nextjs-fullstack/playbooks/add-crud.md +43 -0
- package/packs/nextjs-fullstack/playbooks/add-email.md +43 -0
- package/packs/nextjs-fullstack/playbooks/add-file-upload.md +43 -0
- package/packs/nextjs-fullstack/playbooks/add-webhook.md +43 -0
- package/packs/nextjs-fullstack/playbooks/ship-to-prod.md +43 -0
- package/src/cli.js +288 -0
- package/src/commands/add.js +61 -0
- package/src/commands/catalog.js +21 -0
- package/src/commands/doctor.js +42 -0
- package/src/commands/hook.js +67 -0
- package/src/commands/init.js +69 -0
- package/src/commands/learn.js +39 -0
- package/src/commands/lint.js +5 -0
- package/src/commands/list.js +10 -0
- package/src/commands/log.js +25 -0
- package/src/commands/memory.js +14 -0
- package/src/commands/plan.js +41 -0
- package/src/commands/reindex.js +8 -0
- package/src/commands/review.js +31 -0
- package/src/commands/search.js +21 -0
- package/src/commands/stats.js +35 -0
- package/src/commands/undo.js +7 -0
- package/src/commands/update.js +16 -0
- package/src/lib/catalog.js +32 -0
- package/src/lib/config.js +64 -0
- package/src/lib/frontmatter.js +70 -0
- package/src/lib/fs-safe.js +87 -0
- package/src/lib/gitlog.js +75 -0
- package/src/lib/ignore.js +47 -0
- package/src/lib/index.js +72 -0
- package/src/lib/lessons.js +173 -0
- package/src/lib/lint.js +67 -0
- package/src/lib/lock.js +47 -0
- package/src/lib/memory.js +49 -0
- package/src/lib/mutate.js +24 -0
- package/src/lib/packs.js +10 -0
- package/src/lib/paths.js +25 -0
- package/src/lib/plan.js +156 -0
- package/src/lib/pointers.js +76 -0
- package/src/lib/provider.js +27 -0
- package/src/lib/report.js +33 -0
- package/src/lib/run.js +73 -0
- package/src/lib/search.js +40 -0
- package/src/lib/secrets.js +25 -0
- package/src/lib/signals.js +55 -0
- package/src/lib/sync.js +36 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Project Brief
|
|
3
|
+
type: template
|
|
4
|
+
tags: [template]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Project Brief.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Project Brief
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Build loop
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow, build]
|
|
5
|
+
stack: any
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-11-22
|
|
8
|
+
description: Load before writing code from a spec.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Build loop
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
A spec exists and the next step is a change in the repo.
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
One failing check, then the smallest edit that makes that check pass.
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
The spec is still one vague sentence. Write the spec before this loop.
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
Never start a second feature while the current check is failing.
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
A red check names the gap. A green check is the proof the gap closed.
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. Restate the spec in one sentence and name the files you expect to touch.
|
|
30
|
+
2. Add or pick one check that fails for the missing behavior.
|
|
31
|
+
3. Change only the files that check needs.
|
|
32
|
+
4. Re-run that check. On failure, read the first error and change one thing.
|
|
33
|
+
5. When it passes, run the full check suite once.
|
|
34
|
+
6. Record the choice with `connore log decision`.
|
|
35
|
+
|
|
36
|
+
## Done when
|
|
37
|
+
The new check passes, the full suite passes, and the spec sentence is true in the diff.
|
|
38
|
+
|
|
39
|
+
## Example
|
|
40
|
+
Spec: "POST /orders returns 400 when quantity is 0." The test asserts 400. The handler rejects 0. The test passes.
|
|
41
|
+
|
|
42
|
+
## Common mistakes
|
|
43
|
+
Rewriting the suite to match a broken handler. Editing three modules before the first check runs.
|
|
44
|
+
|
|
45
|
+
## Sources
|
|
46
|
+
connore base workflow. No vendor text.
|
|
47
|
+
|
|
48
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Code Review
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Code Review.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Code Review
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Debugging
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Debugging.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Debugging
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Git And Commits
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Git And Commits.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Git And Commits
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Idea To Spec
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Idea To Spec.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Idea To Spec
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Session Handoff
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Session Handoff.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Session Handoff
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Spec To Plan
|
|
3
|
+
type: workflow
|
|
4
|
+
tags: [workflow]
|
|
5
|
+
stack: any
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Spec To Plan.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Spec To Plan
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Button
|
|
3
|
+
type: component
|
|
4
|
+
tags: [shadcn, button]
|
|
5
|
+
source: library
|
|
6
|
+
updated: 2026-11-19
|
|
7
|
+
description: Usage note for a button. Install the real component from shadcn.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Button
|
|
11
|
+
|
|
12
|
+
Install the code in the app. This pack does not vendor it.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
npx shadcn@latest add button
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
TODO. Read the generated file for variant and size.
|
|
20
|
+
|
|
21
|
+
## When
|
|
22
|
+
The one primary action in a group. TODO: which variant is the default in this theme.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
TODO
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Card
|
|
3
|
+
type: component
|
|
4
|
+
tags: [shadcn, card]
|
|
5
|
+
source: library
|
|
6
|
+
updated: 2026-11-19
|
|
7
|
+
description: Usage note for a card. Install the real component from shadcn.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Card
|
|
11
|
+
|
|
12
|
+
Install the code in the app. This pack does not vendor it.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
npx shadcn@latest add card
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
TODO. Read the generated file for header, content, and footer slots.
|
|
20
|
+
|
|
21
|
+
## When
|
|
22
|
+
A titled group of related content. TODO: radius and border for this theme.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
TODO
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Input
|
|
3
|
+
type: component
|
|
4
|
+
tags: [shadcn, input]
|
|
5
|
+
source: library
|
|
6
|
+
updated: 2026-11-19
|
|
7
|
+
description: Usage note for an input. Install the real component from shadcn.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Input
|
|
11
|
+
|
|
12
|
+
Install the code in the app. This pack does not vendor it.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
npx shadcn@latest add input
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
TODO. Read the generated file. Pair it with a label.
|
|
20
|
+
|
|
21
|
+
## When
|
|
22
|
+
A single-line value. TODO: height, radius, and focus ring.
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
TODO
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Design rules
|
|
3
|
+
type: rule
|
|
4
|
+
tags: [always, never]
|
|
5
|
+
source: library
|
|
6
|
+
updated: 2026-11-19
|
|
7
|
+
description: Five always rules and five never rules for the starter pack.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Rules
|
|
11
|
+
|
|
12
|
+
## Always
|
|
13
|
+
1. Always read the text spec before opening a screenshot.
|
|
14
|
+
2. Always use the hex values in design/tokens.md. A TODO there means the value is unknown.
|
|
15
|
+
3. Always use one accent color per screen.
|
|
16
|
+
4. Always use the spacing scale in design/tokens.md.
|
|
17
|
+
5. Always keep motion to the duration and easing in design/tokens.md.
|
|
18
|
+
|
|
19
|
+
## Never
|
|
20
|
+
1. Never invent a color, font, radius, or shadow that is still TODO.
|
|
21
|
+
2. Never load the whole .ctx folder. Open only the index rows for the task.
|
|
22
|
+
3. Never edit files in library/. Put your own notes in mine/.
|
|
23
|
+
4. Never add a second accent hue on the same screen.
|
|
24
|
+
5. Never skip a component's usage note and paste in an unstated variant.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Design tokens
|
|
3
|
+
type: design-token
|
|
4
|
+
tags: [color, type, spacing, radius, shadow, motion]
|
|
5
|
+
source: library
|
|
6
|
+
updated: 2026-11-19
|
|
7
|
+
description: Placeholder color, type, spacing, radius, shadow, and motion tokens.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Tokens
|
|
11
|
+
|
|
12
|
+
Replace every TODO with a measured value. Do not invent one.
|
|
13
|
+
|
|
14
|
+
## Colors
|
|
15
|
+
- background: TODO
|
|
16
|
+
- foreground: TODO
|
|
17
|
+
- muted: TODO
|
|
18
|
+
- accent: TODO
|
|
19
|
+
- destructive: TODO
|
|
20
|
+
|
|
21
|
+
## Type
|
|
22
|
+
- sans: TODO
|
|
23
|
+
- mono: TODO
|
|
24
|
+
- body: TODO size
|
|
25
|
+
- heading: TODO size
|
|
26
|
+
|
|
27
|
+
## Spacing
|
|
28
|
+
TODO scale. Example steps to fill in: 4, 8, 12, 16, 24, 32.
|
|
29
|
+
|
|
30
|
+
## Radius
|
|
31
|
+
- sm: TODO
|
|
32
|
+
- md: TODO
|
|
33
|
+
- lg: TODO
|
|
34
|
+
|
|
35
|
+
## Shadows
|
|
36
|
+
TODO. Write the full CSS value, including color and blur.
|
|
37
|
+
|
|
38
|
+
## Motion
|
|
39
|
+
- duration: TODO
|
|
40
|
+
- easing: TODO
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: API conventions
|
|
3
|
+
type: doc
|
|
4
|
+
tags: [api, http]
|
|
5
|
+
stack: nextjs
|
|
6
|
+
status: reviewed
|
|
7
|
+
verified: 2026-11-22
|
|
8
|
+
description: Load before adding or changing a route handler.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# API conventions
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
You are adding a Route Handler under `app/`.
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
`route.js` returns JSON. Validate the body on the server. Use 400, 401, 403, 404, and 500 only.
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
The response is a file download. Stream the bytes and set `Content-Type`. Still validate the query on the server.
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
Never return a stack trace, SQL text, or a service key in the response body.
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
The client can send any JSON. Status codes are the contract the caller branches on.
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. Put the handler in `app/<path>/route.js` and export the verb: `GET`, `POST`, `PATCH`, or `DELETE`.
|
|
30
|
+
2. Parse the body with `request.json()`. On bad JSON, return 400 `{ "error": "Invalid JSON." }`.
|
|
31
|
+
3. Validate every field on the server. Return 400 `{ "error": "<field> <reason>" }`.
|
|
32
|
+
4. Return 401 when the session is missing, 403 when the role is wrong, 404 when the row is missing.
|
|
33
|
+
5. Return 200 with the resource, or 201 with the created resource and its id.
|
|
34
|
+
6. Log the server error. Return 500 `{ "error": "Something went wrong." }`.
|
|
35
|
+
|
|
36
|
+
## Done when
|
|
37
|
+
A missing field returns 400, a missing session returns 401, and the body has no stack.
|
|
38
|
+
|
|
39
|
+
## Example
|
|
40
|
+
`POST /api/orders` with `{ "quantity": 0 }` returns 400 `{ "error": "quantity must be at least 1" }`.
|
|
41
|
+
|
|
42
|
+
## Common mistakes
|
|
43
|
+
Trusting an id from the client to decide ownership. Returning 200 with `{ "ok": false }`.
|
|
44
|
+
|
|
45
|
+
## Sources
|
|
46
|
+
Next.js Route Handlers docs, read 2026-11-22. No vendor code.
|
|
47
|
+
|
|
48
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Auth And Roles
|
|
3
|
+
type: doc
|
|
4
|
+
tags: [doc]
|
|
5
|
+
stack: nextjs
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Auth And Roles.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Auth And Roles
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Background Jobs
|
|
3
|
+
type: doc
|
|
4
|
+
tags: [doc]
|
|
5
|
+
stack: nextjs
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Background Jobs.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Background Jobs
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Caching
|
|
3
|
+
type: doc
|
|
4
|
+
tags: [doc]
|
|
5
|
+
stack: nextjs
|
|
6
|
+
status: draft
|
|
7
|
+
verified:
|
|
8
|
+
description: Draft direction for Caching.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Caching
|
|
12
|
+
|
|
13
|
+
## Use when
|
|
14
|
+
TODO
|
|
15
|
+
|
|
16
|
+
## Default
|
|
17
|
+
TODO
|
|
18
|
+
|
|
19
|
+
## Use instead when
|
|
20
|
+
TODO
|
|
21
|
+
|
|
22
|
+
## Never
|
|
23
|
+
TODO
|
|
24
|
+
|
|
25
|
+
## Why
|
|
26
|
+
TODO
|
|
27
|
+
|
|
28
|
+
## Steps
|
|
29
|
+
1. TODO
|
|
30
|
+
|
|
31
|
+
## Done when
|
|
32
|
+
TODO
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
TODO
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
TODO
|
|
39
|
+
|
|
40
|
+
## Sources
|
|
41
|
+
TODO
|
|
42
|
+
|
|
43
|
+
License: MIT
|