connore 0.1.0 → 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 +58 -46
- package/package.json +36 -33
- 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 +29 -0
- package/packs/base/planning/blueprint-template.md +46 -0
- package/packs/base/planning/plan-template.md +46 -0
- package/packs/base/rules/anti-patterns.md +46 -0
- package/packs/base/rules/code-style.md +46 -0
- package/packs/base/rules/definition-of-done.md +47 -0
- package/packs/base/rules/dependency-policy.md +46 -0
- package/packs/base/rules/error-handling.md +46 -0
- package/packs/base/rules/security-audit.md +47 -0
- package/packs/base/rules/security-baseline.md +46 -0
- package/packs/base/templates/bug-report.md +46 -0
- package/packs/base/templates/feature-spec.md +46 -0
- package/packs/base/templates/handoff.md +46 -0
- package/packs/base/templates/project-brief.md +46 -0
- package/packs/base/workflow/build-loop.md +48 -0
- package/packs/base/workflow/code-review.md +46 -0
- package/packs/base/workflow/debugging.md +47 -0
- package/packs/base/workflow/git-and-commits.md +46 -0
- package/packs/base/workflow/idea-to-spec.md +46 -0
- package/packs/base/workflow/session-handoff.md +46 -0
- package/packs/base/workflow/spec-to-plan.md +46 -0
- 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/api-conventions.md +48 -0
- package/packs/nextjs-fullstack/backend/auth-and-roles.md +46 -0
- package/packs/nextjs-fullstack/backend/background-jobs.md +46 -0
- package/packs/nextjs-fullstack/backend/caching.md +46 -0
- package/packs/nextjs-fullstack/backend/database.md +46 -0
- package/packs/nextjs-fullstack/backend/file-uploads.md +46 -0
- package/packs/nextjs-fullstack/backend/logging.md +46 -0
- package/packs/nextjs-fullstack/backend/migrations.md +46 -0
- package/packs/nextjs-fullstack/backend/rate-limiting.md +46 -0
- package/packs/nextjs-fullstack/backend/secrets-and-env.md +46 -0
- package/packs/nextjs-fullstack/backend/validation.md +46 -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 +45 -0
- package/packs/nextjs-fullstack/build-deploy/deploy.md +46 -0
- package/packs/nextjs-fullstack/build-deploy/monitoring.md +45 -0
- package/packs/nextjs-fullstack/build-deploy/performance.md +46 -0
- package/packs/nextjs-fullstack/build-deploy/project-structure.md +45 -0
- package/packs/nextjs-fullstack/build-deploy/release-checklist.md +47 -0
- package/packs/nextjs-fullstack/build-deploy/testing.md +46 -0
- package/packs/nextjs-fullstack/evals/README.md +46 -0
- package/packs/nextjs-fullstack/examples/golden-app/README.md +45 -0
- package/packs/nextjs-fullstack/frontend/accessibility.md +46 -0
- package/packs/nextjs-fullstack/frontend/components.md +46 -0
- 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 +46 -0
- package/packs/nextjs-fullstack/frontend/layout.md +46 -0
- package/packs/nextjs-fullstack/frontend/loading-empty-error.md +46 -0
- package/packs/nextjs-fullstack/frontend/motion.md +46 -0
- package/packs/nextjs-fullstack/frontend/responsive.md +46 -0
- package/packs/nextjs-fullstack/frontend/seo.md +47 -0
- package/packs/nextjs-fullstack/frontend/tables.md +46 -0
- package/packs/nextjs-fullstack/frontend/tokens.md +45 -0
- package/packs/nextjs-fullstack/integrations/analytics.md +46 -0
- package/packs/nextjs-fullstack/integrations/email.md +46 -0
- package/packs/nextjs-fullstack/integrations/llm-apis.md +46 -0
- package/packs/nextjs-fullstack/integrations/oauth.md +46 -0
- package/packs/nextjs-fullstack/integrations/object-storage.md +46 -0
- package/packs/nextjs-fullstack/integrations/payments.md +46 -0
- package/packs/nextjs-fullstack/integrations/queues.md +46 -0
- package/packs/nextjs-fullstack/integrations/search.md +46 -0
- package/packs/nextjs-fullstack/integrations/webhooks.md +46 -0
- package/packs/nextjs-fullstack/playbooks/add-ai-feature.md +46 -0
- package/packs/nextjs-fullstack/playbooks/add-auth.md +46 -0
- package/packs/nextjs-fullstack/playbooks/add-billing.md +50 -0
- package/packs/nextjs-fullstack/playbooks/add-crud.md +46 -0
- package/packs/nextjs-fullstack/playbooks/add-email.md +46 -0
- package/packs/nextjs-fullstack/playbooks/add-file-upload.md +46 -0
- package/packs/nextjs-fullstack/playbooks/add-webhook.md +46 -0
- package/packs/nextjs-fullstack/playbooks/ship-to-prod.md +47 -0
- 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 +377 -90
- package/src/commands/add.js +61 -57
- package/src/commands/catalog.js +21 -0
- package/src/commands/doctor.js +44 -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/hook.js +67 -50
- package/src/commands/init.js +74 -55
- package/src/commands/learn.js +39 -0
- package/src/commands/lint.js +13 -0
- package/src/commands/list.js +10 -10
- package/src/commands/log.js +49 -0
- package/src/commands/memory.js +14 -0
- package/src/commands/packs.js +21 -0
- package/src/commands/plan.js +41 -0
- package/src/commands/reindex.js +8 -8
- package/src/commands/review.js +31 -0
- package/src/commands/routes.js +13 -0
- package/src/commands/search.js +26 -0
- package/src/commands/stats.js +35 -0
- package/src/commands/undo.js +7 -0
- package/src/commands/update.js +20 -14
- package/src/lib/catalog.js +32 -0
- package/src/lib/config.js +67 -0
- package/src/lib/fs-safe.js +36 -11
- package/src/lib/gitlog.js +75 -0
- package/src/lib/graph.js +96 -0
- package/src/lib/ignore.js +47 -0
- package/src/lib/index.js +88 -57
- package/src/lib/lessons.js +173 -0
- package/src/lib/lint.js +185 -0
- package/src/lib/lock.js +47 -0
- package/src/lib/memory.js +49 -0
- package/src/lib/mutate.js +26 -0
- package/src/lib/packs.js +25 -0
- package/src/lib/paths.js +6 -2
- package/src/lib/plan.js +156 -0
- package/src/lib/pointers.js +3 -3
- package/src/lib/prompts.js +66 -0
- package/src/lib/provider.js +27 -0
- package/src/lib/report.js +41 -17
- package/src/lib/routes.js +59 -0
- package/src/lib/run.js +116 -0
- package/src/lib/search.js +64 -0
- package/src/lib/secrets.js +25 -0
- package/src/lib/signals.js +55 -0
- package/src/lib/sync.js +20 -12
- package/src/lib/tokens.js +8 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Ruled logo row
|
|
3
|
+
type: screenshot
|
|
4
|
+
tags: [logo-cloud, landing, ruled, social-proof]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: A single ruled row of six logos, then the start of a features section.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Ruled logo row
|
|
11
|
+
|
|
12
|
+
Frame is 1920×1080 and includes browser chrome and the taskbar. Those are not part of the UI. Exact padding in px is TODO unless a number below was measured from pixels. File `logo-row-ruled.png`.
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
Logo strip, then the opening of a "what it does" section.
|
|
16
|
+
|
|
17
|
+
## Layout
|
|
18
|
+
A short kicker sits on the rule above a single row of six logo cells. Vertical lines divide the cells. Below, left column: a small accent square, a section label, a headline, a gray paragraph, then the start of a numbered item. A halftone image occupies the lower right. Exact cell width: TODO.
|
|
19
|
+
|
|
20
|
+
## Color
|
|
21
|
+
Dominant bucket: `#080808`. Logos are white. The section marker is a small accent square. Exact accent hex: TODO (too few pixels for a stable median). Body text matches the split hero's gray `#707070` closely, but this frame was not re-sampled for text.
|
|
22
|
+
|
|
23
|
+
## Type, radius, shadow, motion
|
|
24
|
+
Headline is large, bold, left aligned. The numbered label is small and mono-like. Exact px: TODO. Logo cells are square-cornered. Shadow: none visible. Motion: TODO.
|
|
25
|
+
|
|
26
|
+
## Components
|
|
27
|
+
Ruled logo row, section marker, headline, numbered feature start, halftone image.
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Three-card pricing
|
|
3
|
+
type: screenshot
|
|
4
|
+
tags: [pricing, cards, landing, dark]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Three pricing cards with a monthly/yearly switch and one filled CTA.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Three-card pricing
|
|
11
|
+
|
|
12
|
+
Frame is 1920×1080 and includes browser chrome and the taskbar. Those are not part of the UI. Exact padding in px is TODO unless a number below was measured from pixels. File `pricing-three-card.png`.
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
Compare three tiers, entry, middle and enterprise, with the middle tier emphasised.
|
|
16
|
+
|
|
17
|
+
## Layout
|
|
18
|
+
Bracketed accent section label, two-line headline, then a left-aligned control group: a monthly label, a small switch, a yearly label, and an accent outline pill showing the annual discount. Three equal cards in one row. Each card: name, price, one sentence, a link or button, a features label, then check rows. The middle card carries a small accent pill at the top right and a filled accent button. The other two CTAs are text links. Exact padding: TODO.
|
|
19
|
+
|
|
20
|
+
## Color
|
|
21
|
+
Page buckets: `#080808`, `#101010`. Saturated-accent median: `#06e27a`. That is the best button sample in the set. The emphasis pill and the middle button use that accent. Prices are white. Feature text is gray.
|
|
22
|
+
|
|
23
|
+
## Type, radius, shadow, motion
|
|
24
|
+
Price is larger than the plan name. Exact px: TODO. Cards share one radius. Exact value: TODO. The emphasised card is not a different color; the filled accent button is what marks it. Switch motion: TODO.
|
|
25
|
+
|
|
26
|
+
## Components
|
|
27
|
+
Section label, headline, switch, outline pill, three cards, text links, one solid button, checklist.
|
|
Binary file
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Ruled step grid
|
|
3
|
+
type: screenshot
|
|
4
|
+
tags: [steps, grid, ruled, landing]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Three numbered steps in a ruled grid, with a terminal image in the last cell.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Ruled step grid
|
|
11
|
+
|
|
12
|
+
Frame is 1920×1080 and includes browser chrome and the taskbar. Those are not part of the UI. Exact padding in px is TODO unless a number below was measured from pixels. File `steps-ruled-grid.png`.
|
|
13
|
+
|
|
14
|
+
## Purpose
|
|
15
|
+
Three-step setup. The fourth cell is an image, not a fourth step.
|
|
16
|
+
|
|
17
|
+
## Layout
|
|
18
|
+
Header stays. A section label with a small accent square, then a one-line headline. A 2×2 grid of ruled cells. The first three cells each have a number, a three-dot mark, a title, and one sentence. The bottom-right cell is a halftone image with an accent terminal line. Exact cell padding: TODO.
|
|
19
|
+
|
|
20
|
+
## Color
|
|
21
|
+
Page buckets: `#080808`, `#101010`. Numbers and titles are white. Sentences are gray. Terminal text is accent green on the image. Exact terminal hex: TODO.
|
|
22
|
+
|
|
23
|
+
## Type, radius, shadow, motion
|
|
24
|
+
Step titles are smaller than the section headline and larger than the body. Exact px: TODO. Cells meet at hairline rules rather than as floating cards. Radius looks square. Exact radius: TODO. Motion: TODO.
|
|
25
|
+
|
|
26
|
+
## Components
|
|
27
|
+
Section label, headline, three text cells, one media cell. No buttons in the grid.
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Design rules
|
|
3
|
+
type: rule
|
|
4
|
+
tags: [always, never, contrast, motion, type]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Visual rules that hold for any palette. They do not choose the palette.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Rules
|
|
11
|
+
|
|
12
|
+
Colour, type family and aesthetic come from the owner, then from one profile in `design/aesthetics/`. Nothing below picks a hue.
|
|
13
|
+
|
|
14
|
+
## Always
|
|
15
|
+
|
|
16
|
+
1. Use one accent per screen. A second hue is a different design, not a highlight.
|
|
17
|
+
2. Keep the headline much larger than the body, and keep body copy off pure black and pure white when it sits on a tinted field.
|
|
18
|
+
3. Give the primary action one clear treatment. Secondaries stay quieter: text, outline, or brackets.
|
|
19
|
+
4. Use hairline borders on dark cards. Skip heavy gray drop shadows.
|
|
20
|
+
5. Honor `prefers-reduced-motion`.
|
|
21
|
+
6. Meet the contrast, focus and target-size floors in `frontend/accessibility/wcag-targets.md` for whatever colours were chosen.
|
|
22
|
+
|
|
23
|
+
## Never
|
|
24
|
+
|
|
25
|
+
1. Never choose a background, accent or font before `design/aesthetics/match.md` has run.
|
|
26
|
+
2. Never treat two recorded greens as the same green. Name the profile the value came from.
|
|
27
|
+
3. Never set a type family by guessing a reference frame. If it is TODO, ask.
|
|
28
|
+
4. Never invent pixel padding. Spacing in the frames is TODO; use the project's spacing scale.
|
|
29
|
+
5. Never leave motion running when the user asks for reduced motion, and never swap in bounce easing.
|
|
30
|
+
6. Never recolor a dark reference onto a light canvas. If the owner asked for light, that profile does not apply.
|
|
31
|
+
7. Never copy third-party effect source into this folder when its licence forbids redistribution. See `components/motion-effects/README.md`.
|
|
32
|
+
|
|
33
|
+
## Source
|
|
34
|
+
|
|
35
|
+
Split out of the earlier reference-specific rules so those values live in `design/aesthetics/` instead of applying to every project.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Design token structure
|
|
3
|
+
type: design-token
|
|
4
|
+
tags: [tokens, naming, structure, dtcg]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when naming tokens or defining a token file, not for this project's values.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Design token structure
|
|
11
|
+
|
|
12
|
+
How to structure tokens. The project's actual values live in `design/tokens.md`, and conflicts there are recorded, never averaged.
|
|
13
|
+
|
|
14
|
+
## A token
|
|
15
|
+
|
|
16
|
+
An object with a `$value` property is a token. The parent object's key is its name. A token needs a name and a value; `$type` declares what kind of value it is.
|
|
17
|
+
|
|
18
|
+
Names are case-sensitive strings. `$value` is reserved and cannot be used as a name.
|
|
19
|
+
|
|
20
|
+
## Groups
|
|
21
|
+
|
|
22
|
+
Nest tokens in groups to express hierarchy. A group is any object without `$value`. Group properties such as `$type` apply to the tokens inside, so a colour group declares `$type` once.
|
|
23
|
+
|
|
24
|
+
## Types
|
|
25
|
+
|
|
26
|
+
The specification defines colour, dimension, font family, font weight, duration, cubic Bézier and number, and allows composite types built from them. A colour value records its colour space and components rather than a single hex string, so the same token can target wider gamuts.
|
|
27
|
+
|
|
28
|
+
## Aliases
|
|
29
|
+
|
|
30
|
+
A token may reference another token instead of holding a literal. Use an alias for every semantic token: `color.surface.default` points at a palette entry. Changing a theme then edits the palette, not every usage.
|
|
31
|
+
|
|
32
|
+
## Rules
|
|
33
|
+
|
|
34
|
+
- Name tokens by role, not appearance. `color.text.muted` survives a redesign; `color.gray-500` does not.
|
|
35
|
+
- Keep one primitive layer of raw values and one semantic layer of aliases above it.
|
|
36
|
+
- Do not encode the component in a primitive token. `color.button.bg` belongs in the semantic layer.
|
|
37
|
+
- When two sources disagree on a value, record both with their contexts. Never average them.
|
|
38
|
+
|
|
39
|
+
## Common mistakes
|
|
40
|
+
|
|
41
|
+
- Semantic tokens that hold literals, so a theme change means a find and replace.
|
|
42
|
+
- Tokens named after a figure in a design file, which breaks when the file changes.
|
|
43
|
+
|
|
44
|
+
## Source
|
|
45
|
+
|
|
46
|
+
Design Tokens Community Group technical reports, `format/design-token.md`, `format/groups.md` and `format/types.md`, under the W3C Software and Document License. Summarised. See `frontend/SOURCES.md`.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Design tokens
|
|
3
|
+
type: design-token
|
|
4
|
+
tags: [color, type, spacing, radius, shadow, motion]
|
|
5
|
+
updated: 2026-11-19
|
|
6
|
+
description: Context101 code tokens plus colors measured from the reference layouts. Conflicts are listed, not merged.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Tokens
|
|
11
|
+
|
|
12
|
+
Two sources. Keep them separate.
|
|
13
|
+
|
|
14
|
+
## Code palette
|
|
15
|
+
|
|
16
|
+
From `globals.css`. Hex values are converted from the oklch (chroma 0, so they are neutral).
|
|
17
|
+
|
|
18
|
+
| Token | Light | Dark |
|
|
19
|
+
| --- | --- | --- |
|
|
20
|
+
| background | `#ffffff` | `#0a0a0a` |
|
|
21
|
+
| foreground | `#0a0a0a` | `#fafafa` |
|
|
22
|
+
| card, popover | `#ffffff` | `#171717` |
|
|
23
|
+
| primary | `#171717` | `#e5e5e5` |
|
|
24
|
+
| secondary, muted | `#f5f5f5` | `#262626` |
|
|
25
|
+
| muted-foreground | `#737373` | `#a1a1a1` |
|
|
26
|
+
| border, input | `#e5e5e5` | white at 10% / 15% |
|
|
27
|
+
| destructive | `#e7000b` | `#ff6467` |
|
|
28
|
+
|
|
29
|
+
Mint accent, both themes: `#9ff2c4`. `--mint-dim` mixes that at 12%. `themeColor` is `#000000`.
|
|
30
|
+
|
|
31
|
+
## Reference palette
|
|
32
|
+
|
|
33
|
+
Pixel samples from `design/references/`, content area, buckets of 8:
|
|
34
|
+
|
|
35
|
+
- Landing page field, both sets: `#080808`, then `#101010`.
|
|
36
|
+
- Solid-accent button, saturated-pixel median on the pricing frame: `#06e27a`. Feature frame: `#06e37b`.
|
|
37
|
+
- Hero median `#08c56e` is the accent curtain, not a clean button sample.
|
|
38
|
+
- Dashboard sidebar `#04100c`. Dashboard main `#0c1010`.
|
|
39
|
+
- Ruled-set body text `#707070`. Headline hex: TODO.
|
|
40
|
+
|
|
41
|
+
## Conflict
|
|
42
|
+
|
|
43
|
+
Code mint `#9ff2c4` and the reference accent `#06e27a` are different greens. The dashboard reference is a darker green-black. Use one accent per screen.
|
|
44
|
+
|
|
45
|
+
## Type, space, radius
|
|
46
|
+
|
|
47
|
+
Code fonts: Geist sans, Geist Mono. Reference font names: TODO. Code control sizes: button `h-8` / `text-sm`, `xs` `h-6`, `sm` `h-7`, `lg` `h-9`. Badge `h-5` / `text-xs`. Input `h-8`. No full type scale is declared. Reference px: TODO.
|
|
48
|
+
|
|
49
|
+
No custom spacing scale. Tailwind steps only. Reference gaps: TODO.
|
|
50
|
+
|
|
51
|
+
`--radius: 0.625rem` (10px). sm 6, md 8, lg 10, xl 14, 2xl 18, 3xl 22, 4xl 26. Checkbox radius `4px`. Reference radii: TODO.
|
|
52
|
+
|
|
53
|
+
## Shadow and motion
|
|
54
|
+
|
|
55
|
+
Hover shadows are white at low alpha, not gray. Button: `0 10px 30px -10px rgba(255,255,255,0.35)`. Card lift: `0 24px 60px -30px rgba(255,255,255,0.18)`. Easing and durations: `design/animations/motion.md`.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Frontend layer
|
|
3
|
+
type: doc
|
|
4
|
+
tags: [index, load-order, frontend, architecture]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load first on any frontend task. Mechanics apply immediately; colour waits for the owner.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Frontend layer
|
|
11
|
+
|
|
12
|
+
Two passes. Do them in this order.
|
|
13
|
+
|
|
14
|
+
## 1. Function, before any pixels
|
|
15
|
+
|
|
16
|
+
These improve structure and output on every project. Apply them without asking. They say nothing about colour.
|
|
17
|
+
|
|
18
|
+
| Task | Load |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Where a file goes | `architecture/project-structure.md`, `architecture/naming.md` |
|
|
21
|
+
| A new feature | `architecture/feature-modules.md`, `architecture/import-boundaries.md` |
|
|
22
|
+
| A route or layout shell | `architecture/routing.md`, `layout/responsive.md` |
|
|
23
|
+
| State, fetch, or a mutation | `state/state-categories.md`, `state/api-layer.md`, `state/server-cache.md` |
|
|
24
|
+
| A component | `components/composition.md`, `components/variants.md` |
|
|
25
|
+
| A form | `forms/form-architecture.md`, `forms/validation.md` |
|
|
26
|
+
| Anything interactive | `accessibility/semantics-and-keyboard.md` |
|
|
27
|
+
| Auth, roles, user input | `architecture/security.md` |
|
|
28
|
+
| A slow view | `performance/rendering.md` |
|
|
29
|
+
| Tests | `testing/strategy.md` |
|
|
30
|
+
|
|
31
|
+
For a new screen, load the first row plus state, composition and accessibility even when the task does not name them. That is the default layer.
|
|
32
|
+
|
|
33
|
+
## 2. Colour and aesthetic, after the owner speaks
|
|
34
|
+
|
|
35
|
+
Do not open `design/references/` or copy a hex out of `design/tokens.md` yet.
|
|
36
|
+
|
|
37
|
+
1. Ask mode, accent, feel and page type.
|
|
38
|
+
2. Write the answers in `design/project-style.md`.
|
|
39
|
+
3. Follow `design/aesthetics/match.md` and load the one profile it names.
|
|
40
|
+
4. That profile is what supplies the specific colours, button style and which reference specs to open.
|
|
41
|
+
|
|
42
|
+
If nothing in the dataset matches, say so and build from the owner's values. Do not fall back to the dark green profiles.
|
|
43
|
+
|
|
44
|
+
## Holds for every palette
|
|
45
|
+
|
|
46
|
+
Contrast, focus and target size: `accessibility/wcag-targets.md`. One accent per screen, no invented pixel padding: `design/rules.md`.
|
|
47
|
+
|
|
48
|
+
## Source
|
|
49
|
+
|
|
50
|
+
This project's own load order. The profiles cite measurements already in `.ctx`.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Frontend sources and licences
|
|
3
|
+
type: doc
|
|
4
|
+
tags: [licensing, sources, attribution, frontend]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load before adding or editing a frontend entry, to record its source.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Frontend sources and licences
|
|
11
|
+
|
|
12
|
+
Every entry under `frontend/` and `design/token-structure.md` summarises one of the sources below. All wording in the pack is original; no source text, code or screenshot is reproduced.
|
|
13
|
+
|
|
14
|
+
Only openly licensed sources are named here. Anything whose licence restricts redistribution or commercial reuse is recorded in `PROVENANCE.md` at the root of `.ctx/`, which is internal and not part of a distributable pack. Those names do not appear in any entry.
|
|
15
|
+
|
|
16
|
+
| Source | Licence | Used by |
|
|
17
|
+
| --- | --- | --- |
|
|
18
|
+
| Bulletproof React | MIT, (c) 2024 Alan Alickovic | architecture, state, forms, components, performance |
|
|
19
|
+
| shadcn/ui | MIT, (c) 2023 shadcn | `frontend/components/library-choice.md`, `frontend/components/variants.md` |
|
|
20
|
+
| Design Tokens Community Group reports | W3C Software and Document License | `design/token-structure.md` |
|
|
21
|
+
| WCAG 2.2, W3C Recommendation 12 December 2024 | (c) 2020-2024 W3C, W3C document use rules | all three accessibility entries, `frontend/layout/responsive.md` |
|
|
22
|
+
| Zustand reference index | MIT library docs, index page only | `frontend/state/client-store.md` |
|
|
23
|
+
| web.dev performance overview | navigation page only | `frontend/performance/images-and-vitals.md` |
|
|
24
|
+
| Owner's own notes | owned by this project | `frontend/architecture/agent-context-files.md` |
|
|
25
|
+
|
|
26
|
+
## Named as subject, not as source
|
|
27
|
+
|
|
28
|
+
`frontend/rendering/server-and-client.md` and `frontend/architecture/app-foundations.md` name Next.js and react.dev because those entries are about those tools. Naming a tool in order to describe how to use it needs no licence. Neither entry reproduces their text.
|
|
29
|
+
|
|
30
|
+
## Excluded as unusable
|
|
31
|
+
|
|
32
|
+
The two screenshot folders in the raw set hold 467 UI captures. They are not in the pack: measurements cannot be read reliably from an image, so every derived entry would be TODO, and the files total roughly a gigabyte.
|
|
33
|
+
|
|
34
|
+
## Rules for new entries
|
|
35
|
+
|
|
36
|
+
1. Name the source and its licence in a `## Source` section, but only when the licence permits redistribution and commercial use.
|
|
37
|
+
2. If it does not, describe the idea generically, leave the name out, and add a row to `PROVENANCE.md`.
|
|
38
|
+
3. Summarise in your own words. Do not paste passages, config blocks or component code.
|
|
39
|
+
4. Record a version when the source states one. If it does not, say so rather than guessing.
|
|
40
|
+
5. Never add a paid or gallery source.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Focus, dialogs and menus
|
|
3
|
+
type: guide
|
|
4
|
+
tags: [accessibility, focus, dialog, menu, keyboard]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when building a modal, drawer, menu or anything that moves focus.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Focus, dialogs and menus
|
|
11
|
+
|
|
12
|
+
Anything that opens over the page owns focus while it is open, and must give it back.
|
|
13
|
+
|
|
14
|
+
## Dialogs
|
|
15
|
+
|
|
16
|
+
- Move focus into the dialog on open, to the first control or the dialog itself.
|
|
17
|
+
- Trap Tab inside it while open.
|
|
18
|
+
- Escape closes it.
|
|
19
|
+
- Return focus to the element that opened it on close, or the user loses their place.
|
|
20
|
+
- Make the rest of the page inert, so a screen reader does not read behind the overlay.
|
|
21
|
+
- Give the dialog an accessible name from its visible title.
|
|
22
|
+
|
|
23
|
+
## Menus
|
|
24
|
+
|
|
25
|
+
- Arrow keys move between items, Escape closes, Enter or Space activates.
|
|
26
|
+
- Focus the trigger again after close.
|
|
27
|
+
- A menu of links is navigation; a menu of actions is a menu. The roles differ.
|
|
28
|
+
|
|
29
|
+
## Focus visibility
|
|
30
|
+
|
|
31
|
+
- Keep a focus indicator that is visible against its background.
|
|
32
|
+
- Focus must not be hidden behind a sticky header or footer. A control scrolled under a fixed bar is a failure, not a cosmetic issue (WCAG 2.2 adds Focus Not Obscured, 2.4.11, at AA).
|
|
33
|
+
- Test with the keyboard at a scrolled position, not only at the top of the page.
|
|
34
|
+
|
|
35
|
+
## Prefer the library
|
|
36
|
+
|
|
37
|
+
Radix, React Aria and Headless UI implement all of the above. The components already in `components/ui-primitives` are built on Radix, so `dialog`, `dropdown-menu`, `select` and `tooltip` have this behaviour. Reimplementing it by hand almost always loses the restore and the inert background.
|
|
38
|
+
|
|
39
|
+
## Common mistakes
|
|
40
|
+
|
|
41
|
+
- Trapping focus but never restoring it, stranding the user at the top of the document.
|
|
42
|
+
- Closing on Escape but leaving the background scrollable, so the page moves under the dialog.
|
|
43
|
+
- A custom tooltip that only appears on hover, unreachable by keyboard.
|
|
44
|
+
|
|
45
|
+
## Source
|
|
46
|
+
|
|
47
|
+
WCAG 2.2, W3C Recommendation 12 December 2024, plus the Radix-based component set in `components/ui-primitives`. Summarised. See `frontend/SOURCES.md`.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Semantics and keyboard
|
|
3
|
+
type: rule
|
|
4
|
+
tags: [accessibility, semantics, keyboard, aria, forms]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when writing markup, a control, or an accessible form field.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Semantics and keyboard
|
|
11
|
+
|
|
12
|
+
The element you choose is the accessibility work. ARIA patches markup; it does not replace it.
|
|
13
|
+
|
|
14
|
+
## Always
|
|
15
|
+
|
|
16
|
+
1. Use the element that means what you want: `button` for actions, `a` for navigation, `ul` for lists, one `h1` per page with headings in order.
|
|
17
|
+
2. Give every input a `label` bound by `for` and `id`. A placeholder disappears on type and is not a label.
|
|
18
|
+
3. Link a field's error and hint to the input with `aria-describedby`, and mark the invalid field with `aria-invalid`.
|
|
19
|
+
4. Keep every interactive element reachable by Tab, and make Enter and Space activate it.
|
|
20
|
+
5. Keep the DOM order the same as the visual order. Tab follows the DOM.
|
|
21
|
+
6. Give icon-only controls an accessible name.
|
|
22
|
+
|
|
23
|
+
## Never
|
|
24
|
+
|
|
25
|
+
1. Never attach a click handler to a `div` and call it a button.
|
|
26
|
+
2. Never set `tabindex` above 0. It reorders the whole page.
|
|
27
|
+
3. Never remove the focus outline without replacing it with a visible one.
|
|
28
|
+
4. Never use ARIA to describe an element that already has the right role.
|
|
29
|
+
5. Never convey state by colour alone. Pair it with text or a shape.
|
|
30
|
+
|
|
31
|
+
## Grouping
|
|
32
|
+
|
|
33
|
+
Group related radios and checkboxes in a `fieldset` with a `legend`. Screen readers announce the legend with each option, which is the only way the group's question is heard.
|
|
34
|
+
|
|
35
|
+
## Checking it
|
|
36
|
+
|
|
37
|
+
Tab through the whole screen with no mouse. If you cannot reach a control, or cannot see where focus is, it is broken. Automated checks do not catch either problem.
|
|
38
|
+
|
|
39
|
+
## Related
|
|
40
|
+
|
|
41
|
+
`frontend/accessibility/focus-and-dialogs.md`, `frontend/accessibility/wcag-targets.md`, `frontend/forms/validation.md`.
|
|
42
|
+
|
|
43
|
+
## Source
|
|
44
|
+
|
|
45
|
+
WCAG 2.2, W3C Recommendation 12 December 2024. Summarised in our own words. See `frontend/SOURCES.md`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: WCAG thresholds
|
|
3
|
+
type: rule
|
|
4
|
+
tags: [accessibility, wcag, contrast, target-size]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when checking contrast, hit areas or zoom against a conformance level.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# WCAG thresholds
|
|
11
|
+
|
|
12
|
+
Numbers from WCAG 2.2. Each is a minimum, not a target. Cited criteria are named so they can be checked against the specification.
|
|
13
|
+
|
|
14
|
+
## Contrast
|
|
15
|
+
|
|
16
|
+
- Body text: at least 4.5:1 against its background (1.4.3 Contrast Minimum, AA).
|
|
17
|
+
- Large text: at least 3:1 (same criterion). Large means roughly 18pt, or 14pt bold.
|
|
18
|
+
- AAA raises these to 7:1 for body text and 4.5:1 for large text (1.4.6).
|
|
19
|
+
- Incidental text, disabled controls, logos and pure decoration are exempt.
|
|
20
|
+
|
|
21
|
+
Dark themes fail this most often on muted grey body copy. Measure it; do not judge by eye.
|
|
22
|
+
|
|
23
|
+
## Target size
|
|
24
|
+
|
|
25
|
+
- Pointer targets are at least 24 by 24 CSS pixels (2.5.8 Target Size Minimum, AA).
|
|
26
|
+
- A smaller target passes only if a 24 pixel circle centred on it does not overlap the circle of any neighbouring target, or if an equivalent larger control exists elsewhere.
|
|
27
|
+
- Inline links in a sentence are exempt.
|
|
28
|
+
|
|
29
|
+
## Reflow and zoom
|
|
30
|
+
|
|
31
|
+
- Content reflows at 320 CSS pixels wide without horizontal scrolling. That width is a 1280 pixel viewport at 400% zoom.
|
|
32
|
+
|
|
33
|
+
## Focus
|
|
34
|
+
|
|
35
|
+
- Focused elements must not be entirely hidden by other content (2.4.11 Focus Not Obscured Minimum, AA).
|
|
36
|
+
|
|
37
|
+
## How to use this
|
|
38
|
+
|
|
39
|
+
Treat these as gates before a screen ships. Record the measured values rather than asserting the screen passes. If a brand colour cannot meet contrast, record the conflict in `design/tokens.md` instead of averaging toward something that fails.
|
|
40
|
+
|
|
41
|
+
## Source
|
|
42
|
+
|
|
43
|
+
WCAG 2.2, W3C Recommendation 12 December 2024. Copyright 2020-2024 World Wide Web Consortium; W3C document use rules apply. Thresholds and criterion numbers are quoted as facts; wording is ours. See `frontend/SOURCES.md`.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Agent context files
|
|
3
|
+
type: guide
|
|
4
|
+
tags: [architecture, agents, context, conventions]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when deciding where project instructions for an agent should live.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Agent context files
|
|
11
|
+
|
|
12
|
+
Put an `AGENTS.md` at the repo root, and one in any subfolder that needs extra context. Many agents read this filename on their own.
|
|
13
|
+
|
|
14
|
+
Each file answers two things: where the agent is, and where it can go next.
|
|
15
|
+
|
|
16
|
+
## Shape
|
|
17
|
+
|
|
18
|
+
- Root: stack, conventions, what to never touch, and pointers to the folders that have their own file.
|
|
19
|
+
- Module, such as `backend/auth`: the rules that apply inside that module only.
|
|
20
|
+
- Keep each file short. It is read on every task, so every line costs context.
|
|
21
|
+
|
|
22
|
+
## Reading order for an agent
|
|
23
|
+
|
|
24
|
+
1. Root `AGENTS.md` for project-level context.
|
|
25
|
+
2. Locate the files or folder for the task.
|
|
26
|
+
3. The module `AGENTS.md`, if one exists.
|
|
27
|
+
4. The parent folder's `AGENTS.md`, for the layer above the module.
|
|
28
|
+
|
|
29
|
+
## Rules
|
|
30
|
+
|
|
31
|
+
- Record decisions and their reasons as they are made, and never delete earlier entries. The next session starts from them.
|
|
32
|
+
- State the stack, the component source and the icon set explicitly, so the agent does not guess.
|
|
33
|
+
- Say which existing components must be reused before new ones are written.
|
|
34
|
+
- Scope each rule to where it applies. A root file full of module details stops being read.
|
|
35
|
+
|
|
36
|
+
## Common mistakes
|
|
37
|
+
|
|
38
|
+
- One enormous root file that repeats every module's rules.
|
|
39
|
+
- Instructions that conflict with the code, which teach the agent to ignore the file.
|
|
40
|
+
|
|
41
|
+
## Source
|
|
42
|
+
|
|
43
|
+
The owner's own project note and project-context template from the raw frontend set.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Build tool and rendering strategy
|
|
3
|
+
type: guide
|
|
4
|
+
tags: [architecture, build, vite, rendering, ssr]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when starting an app or choosing between SPA, SSR, SSG and RSC.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Build tool and rendering strategy
|
|
11
|
+
|
|
12
|
+
Starting from scratch means building your own framework over time. That is a valid choice, but make it deliberately.
|
|
13
|
+
|
|
14
|
+
## Build tools
|
|
15
|
+
|
|
16
|
+
Vite, Parcel and Rsbuild all give a dev server, a production build, fast refresh, JSX and TypeScript. Each starts you with a client-only single-page app. Metro is the bundler for React Native and lacks much of what these offer, so use it only when the project targets native.
|
|
17
|
+
|
|
18
|
+
A build tool does not give you routing, data fetching, styling or a rendering strategy. Those are separate decisions.
|
|
19
|
+
|
|
20
|
+
## Rendering strategies
|
|
21
|
+
|
|
22
|
+
- **SPA** loads one HTML page and updates it as the user interacts. Simplest to start, slowest first load. This is the default for every build tool above.
|
|
23
|
+
- **Streaming SSR** renders on the server and sends rendered HTML. Faster, substantially more to set up and maintain.
|
|
24
|
+
- **SSG** generates HTML at build time. Fast, but more moving parts than SSR for content that changes.
|
|
25
|
+
- **RSC** mixes build-time, server-only and interactive components in one tree. Currently needs deep expertise.
|
|
26
|
+
|
|
27
|
+
Choose per route, not per app. A marketing page suits SSG while a feed suits SSR, and the router is what makes that possible, so pick a router that supports it.
|
|
28
|
+
|
|
29
|
+
## Waterfalls
|
|
30
|
+
|
|
31
|
+
Fetching data inside a component after it renders creates a waterfall: the code loads, then the data loads, in sequence. Prefetch in a route loader or on the server so both happen at once. This is the most common reason a technically correct page feels slow.
|
|
32
|
+
|
|
33
|
+
## When to use a framework instead
|
|
34
|
+
|
|
35
|
+
If the app will plausibly need SSR, SSG or RSC, a framework already solves it. Rolling your own also makes help harder to find, because your routing and fetching are unique to you.
|
|
36
|
+
|
|
37
|
+
## Related
|
|
38
|
+
|
|
39
|
+
`frontend/performance/code-splitting.md`, `frontend/rendering/server-and-client.md`.
|
|
40
|
+
|
|
41
|
+
## Source
|
|
42
|
+
|
|
43
|
+
react.dev, "Build a React app from Scratch". The saved file carries no licence header; attribute react.dev and keep wording original. See `frontend/SOURCES.md`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Error handling
|
|
3
|
+
type: guide
|
|
4
|
+
tags: [errors, boundaries, api, tracking]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when handling a failed request, adding a boundary, or reporting a crash.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Error handling
|
|
11
|
+
|
|
12
|
+
Three layers, each with a different job: the request, the render tree, and production reporting.
|
|
13
|
+
|
|
14
|
+
## API errors
|
|
15
|
+
|
|
16
|
+
Handle them once, in an interceptor on the shared client, rather than at every call site. That one place can raise a notification, sign out a user whose session expired, and refresh a token.
|
|
17
|
+
|
|
18
|
+
- Distinguish expected failures from unexpected ones. A 422 is a form result and belongs beside the field; a 500 is an incident.
|
|
19
|
+
- Never show a raw error object to a user. Map it to a sentence they can act on.
|
|
20
|
+
- Keep the technical detail: log it, or attach it to the report, so the useful version is not lost.
|
|
21
|
+
|
|
22
|
+
## In-app errors
|
|
23
|
+
|
|
24
|
+
Use error boundaries, and use several. One boundary around the whole app turns any component fault into a blank page. A boundary per region contains the fault, so the rest of the screen keeps working.
|
|
25
|
+
|
|
26
|
+
- Put a boundary around each route, and around any panel that renders third-party or user-generated content.
|
|
27
|
+
- Give the fallback a retry and enough context to say what failed.
|
|
28
|
+
- Error boundaries have to be client components in an App Router project.
|
|
29
|
+
- A boundary does not catch errors in event handlers or async code. Handle those where they happen.
|
|
30
|
+
|
|
31
|
+
## Error tracking
|
|
32
|
+
|
|
33
|
+
Track production errors with a dedicated tool rather than a homegrown logger, so you get the platform, browser and stack with each report. Upload source maps, or every stack trace points at minified output.
|
|
34
|
+
|
|
35
|
+
## Common mistakes
|
|
36
|
+
|
|
37
|
+
- A single top-level boundary, so one bad chart blanks the dashboard.
|
|
38
|
+
- Swallowing an error in a `catch` that only logs, leaving the UI stuck in loading.
|
|
39
|
+
- Treating every failure as a toast, so the user sees a flash and no longer has any idea what state the page is in.
|
|
40
|
+
|
|
41
|
+
## Related
|
|
42
|
+
|
|
43
|
+
`frontend/state/async-ui-states.md` covers what the user sees while a request is in flight or has failed.
|
|
44
|
+
|
|
45
|
+
## Source
|
|
46
|
+
|
|
47
|
+
Bulletproof React `docs/error-handling.md`, MIT. Summarised. See `frontend/SOURCES.md`.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Feature modules
|
|
3
|
+
type: guide
|
|
4
|
+
tags: [architecture, features, modules, react]
|
|
5
|
+
updated: 2026-12-06
|
|
6
|
+
description: Load when adding a feature or deciding what belongs inside one.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
# Feature modules
|
|
11
|
+
|
|
12
|
+
A feature is a vertical slice of the product, such as auth, billing or discussions. It owns its own code.
|
|
13
|
+
|
|
14
|
+
A feature folder may contain:
|
|
15
|
+
|
|
16
|
+
- `api/` request declarations and the hooks that consume them
|
|
17
|
+
- `components/` components used only by this feature
|
|
18
|
+
- `hooks/` hooks scoped to this feature
|
|
19
|
+
- `stores/` state for this feature
|
|
20
|
+
- `types/` types used inside this feature
|
|
21
|
+
- `utils/` helpers for this feature
|
|
22
|
+
- `assets/` static files for this feature
|
|
23
|
+
|
|
24
|
+
Include only the folders the feature actually needs.
|
|
25
|
+
|
|
26
|
+
## When
|
|
27
|
+
|
|
28
|
+
Use for anything a user would name as a capability. Do not create a feature for a single shared button.
|
|
29
|
+
|
|
30
|
+
## Rules
|
|
31
|
+
|
|
32
|
+
- Do not import from one feature into another. Compose features at the application layer instead.
|
|
33
|
+
- A feature that needs another feature's data should receive it as props or read it from a shared store.
|
|
34
|
+
- Export what the app needs from explicit file paths. Barrel files that re-export a whole feature break tree shaking in Vite and are not recommended.
|
|
35
|
+
- When two features keep needing the same code, move that code to the shared layer rather than importing sideways.
|
|
36
|
+
|
|
37
|
+
## Common mistakes
|
|
38
|
+
|
|
39
|
+
- Treating `features/` as a second `components/` folder.
|
|
40
|
+
- One giant feature that covers half the product.
|
|
41
|
+
- Cross-feature imports that quietly couple two slices, so neither can be deleted.
|
|
42
|
+
|
|
43
|
+
## Related
|
|
44
|
+
|
|
45
|
+
`frontend/architecture/import-boundaries.md` has the lint rules that enforce this.
|
|
46
|
+
|
|
47
|
+
## Source
|
|
48
|
+
|
|
49
|
+
Bulletproof React `docs/project-structure.md`, MIT. Summarised. See `frontend/SOURCES.md`.
|