claude-code-superkit 0.0.0-stage → 1.5.3
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 +374 -2
- package/bin/cli.js +153 -0
- package/bin/inject-tokens.js +224 -0
- package/bin/measure-tokens.js +17 -0
- package/bin/superkit-counts-verify.sh +30 -0
- package/lib/codex.js +246 -0
- package/lib/docs-scaffold.js +147 -0
- package/lib/installer.js +499 -0
- package/lib/prompts.js +51 -0
- package/lib/settings-builder.js +51 -0
- package/lib/superpowers.js +99 -0
- package/lib/utils.js +117 -0
- package/lib/validator.js +84 -0
- package/package.json +49 -4
- package/packages/codex/AGENTS.md +396 -0
- package/packages/codex/INSTALL.md +342 -0
- package/packages/codex/config.toml +22 -0
- package/packages/codex/hooks/superkit.mjs +203 -0
- package/packages/codex/hooks.json +30 -0
- package/packages/codex/legacy-baseline.json +88 -0
- package/packages/codex/native-skills.txt +65 -0
- package/packages/codex/rules/default.rules +565 -0
- package/packages/codex/skills/ai-slop-cleaner/SKILL.md +44 -0
- package/packages/codex/skills/api-contract-sync/SKILL.md +96 -0
- package/packages/codex/skills/architect/SKILL.md +49 -0
- package/packages/codex/skills/audit-backend/SKILL.md +80 -0
- package/packages/codex/skills/audit-frontend/SKILL.md +82 -0
- package/packages/codex/skills/audit-infra/SKILL.md +87 -0
- package/packages/codex/skills/audit-orchestrator/SKILL.md +114 -0
- package/packages/codex/skills/behavioral-nudge-engine/SKILL.md +110 -0
- package/packages/codex/skills/benchmark/SKILL.md +49 -0
- package/packages/codex/skills/bot-reviewer/SKILL.md +94 -0
- package/packages/codex/skills/code-reviewer/SKILL.md +67 -0
- package/packages/codex/skills/codebase-onboarding-engineer/SKILL.md +46 -0
- package/packages/codex/skills/comment-rot-analyzer/SKILL.md +75 -0
- package/packages/codex/skills/commit-helper/SKILL.md +101 -0
- package/packages/codex/skills/critic/SKILL.md +56 -0
- package/packages/codex/skills/database-reviewer/SKILL.md +79 -0
- package/packages/codex/skills/debug-observer/SKILL.md +107 -0
- package/packages/codex/skills/dependency-checker/SKILL.md +69 -0
- package/packages/codex/skills/design-system-reviewer/SKILL.md +121 -0
- package/packages/codex/skills/dev-orchestrator/SKILL.md +304 -0
- package/packages/codex/skills/docs-reviewer/SKILL.md +86 -0
- package/packages/codex/skills/drizzle-orm-expert/SKILL.md +246 -0
- package/packages/codex/skills/e2e-test-generator/SKILL.md +95 -0
- package/packages/codex/skills/evaluator/SKILL.md +63 -0
- package/packages/codex/skills/frontend-perf-reviewer/SKILL.md +95 -0
- package/packages/codex/skills/frontend-ui-color-reviewer/SKILL.md +68 -0
- package/packages/codex/skills/frontend-ui-design-critic/SKILL.md +99 -0
- package/packages/codex/skills/frontend-ui-interaction-reviewer/SKILL.md +102 -0
- package/packages/codex/skills/frontend-ui-motion-reviewer/SKILL.md +85 -0
- package/packages/codex/skills/frontend-ui-reviewer/SKILL.md +81 -0
- package/packages/codex/skills/frontend-ui-typography-reviewer/SKILL.md +62 -0
- package/packages/codex/skills/gltf-debugging/SKILL.md +128 -0
- package/packages/codex/skills/go-benchmark/SKILL.md +217 -0
- package/packages/codex/skills/go-concurrency-reviewer/SKILL.md +113 -0
- package/packages/codex/skills/go-error-reviewer/SKILL.md +107 -0
- package/packages/codex/skills/go-grpc-patterns/SKILL.md +285 -0
- package/packages/codex/skills/go-modernizer/SKILL.md +111 -0
- package/packages/codex/skills/go-observability-reviewer/SKILL.md +121 -0
- package/packages/codex/skills/go-performance-reviewer/SKILL.md +112 -0
- package/packages/codex/skills/go-reviewer/SKILL.md +109 -0
- package/packages/codex/skills/go-samber-do/SKILL.md +158 -0
- package/packages/codex/skills/go-samber-lo/SKILL.md +178 -0
- package/packages/codex/skills/go-samber-oops/SKILL.md +174 -0
- package/packages/codex/skills/goal-verifier/SKILL.md +53 -0
- package/packages/codex/skills/health-checker/SKILL.md +109 -0
- package/packages/codex/skills/html-to-3d-texture/SKILL.md +153 -0
- package/packages/codex/skills/impeccable-craft/SKILL.md +101 -0
- package/packages/codex/skills/lint-runner/SKILL.md +85 -0
- package/packages/codex/skills/migrate/SKILL.md +60 -0
- package/packages/codex/skills/migration-reviewer/SKILL.md +88 -0
- package/packages/codex/skills/minimal-change-engineer/SKILL.md +44 -0
- package/packages/codex/skills/new-migration/SKILL.md +59 -0
- package/packages/codex/skills/nextjs-supabase-auth/SKILL.md +227 -0
- package/packages/codex/skills/output-enforcement/SKILL.md +71 -0
- package/packages/codex/skills/plan-checker/SKILL.md +53 -0
- package/packages/codex/skills/postgresql-optimization/SKILL.md +159 -0
- package/packages/codex/skills/pre-deploy-validator/SKILL.md +111 -0
- package/packages/codex/skills/presentation-reviewer/SKILL.md +88 -0
- package/packages/codex/skills/product-3d-lighting/SKILL.md +137 -0
- package/packages/codex/skills/project-architecture/SKILL.md +52 -0
- package/packages/codex/skills/py-reviewer/SKILL.md +100 -0
- package/packages/codex/skills/r3f-scene-reviewer/SKILL.md +88 -0
- package/packages/codex/skills/r3f-scroll-driven-3d/SKILL.md +162 -0
- package/packages/codex/skills/reality-checker/SKILL.md +61 -0
- package/packages/codex/skills/redis-patterns/SKILL.md +260 -0
- package/packages/codex/skills/review-orchestrator/SKILL.md +151 -0
- package/packages/codex/skills/rs-reviewer/SKILL.md +98 -0
- package/packages/codex/skills/ru-text/SKILL.md +132 -0
- package/packages/codex/skills/scaffold-endpoint/SKILL.md +44 -0
- package/packages/codex/skills/security-scanner/SKILL.md +94 -0
- package/packages/codex/skills/silent-failure-hunter/SKILL.md +176 -0
- package/packages/codex/skills/telegram-bot-builder/SKILL.md +120 -0
- package/packages/codex/skills/test-generator/SKILL.md +79 -0
- package/packages/codex/skills/test-runner/SKILL.md +101 -0
- package/packages/codex/skills/threejs-color-management/SKILL.md +97 -0
- package/packages/codex/skills/tree-generator/SKILL.md +63 -0
- package/packages/codex/skills/ts-reviewer/SKILL.md +90 -0
- package/packages/codex/skills/ui-design-reviewer/SKILL.md +89 -0
- package/packages/codex/skills/ui-reviewer/SKILL.md +103 -0
- package/packages/codex/skills/visual-reviewer/SKILL.md +85 -0
- package/packages/codex/skills/writing-agents/SKILL.md +165 -0
- package/packages/codex/skills/writing-commands/SKILL.md +173 -0
- package/packages/core/CLAUDE.md +118 -0
- package/packages/core/INTERNAL-FILES +16 -0
- package/packages/core/agents/ai-slop-cleaner.md +187 -0
- package/packages/core/agents/api-contract-sync.md +127 -0
- package/packages/core/agents/architect.md +205 -0
- package/packages/core/agents/audit-backend.md +137 -0
- package/packages/core/agents/audit-frontend.md +129 -0
- package/packages/core/agents/audit-infra.md +182 -0
- package/packages/core/agents/behavioral-nudge-engine.md +170 -0
- package/packages/core/agents/code-reviewer.md +195 -0
- package/packages/core/agents/codebase-onboarding-engineer.md +172 -0
- package/packages/core/agents/comment-rot-analyzer.md +115 -0
- package/packages/core/agents/critic.md +172 -0
- package/packages/core/agents/database-reviewer.md +201 -0
- package/packages/core/agents/debug-observer.md +261 -0
- package/packages/core/agents/dependency-checker.md +199 -0
- package/packages/core/agents/docs-reviewer.md +206 -0
- package/packages/core/agents/e2e-test-generator.md +261 -0
- package/packages/core/agents/evaluator.md +141 -0
- package/packages/core/agents/goal-verifier.md +130 -0
- package/packages/core/agents/health-checker.md +194 -0
- package/packages/core/agents/migration-reviewer.md +161 -0
- package/packages/core/agents/minimal-change-engineer.md +219 -0
- package/packages/core/agents/plan-checker.md +139 -0
- package/packages/core/agents/pre-deploy-validator.md +189 -0
- package/packages/core/agents/reality-checker.md +175 -0
- package/packages/core/agents/scaffold-endpoint.md +162 -0
- package/packages/core/agents/security-scanner.md +236 -0
- package/packages/core/agents/silent-failure-hunter.md +276 -0
- package/packages/core/agents/test-generator.md +146 -0
- package/packages/core/agents/tree-generator.md +141 -0
- package/packages/core/agents/ui-reviewer.md +172 -0
- package/packages/core/agents/visual-reviewer.md +211 -0
- package/packages/core/commands/audit.md +166 -0
- package/packages/core/commands/benchmark.md +130 -0
- package/packages/core/commands/commit.md +148 -0
- package/packages/core/commands/dev.md +302 -0
- package/packages/core/commands/docs-init.md +75 -0
- package/packages/core/commands/lint.md +137 -0
- package/packages/core/commands/migrate.md +146 -0
- package/packages/core/commands/new-migration.md +182 -0
- package/packages/core/commands/pair.md +209 -0
- package/packages/core/commands/review.md +195 -0
- package/packages/core/commands/security-scan.md +142 -0
- package/packages/core/commands/superkit-evolve.md +231 -0
- package/packages/core/commands/superkit-init.md +274 -0
- package/packages/core/commands/test.md +108 -0
- package/packages/core/commands/workflow.md +150 -0
- package/packages/core/docs/guide/01-getting-started.md +41 -0
- package/packages/core/docs-templates/README.md +33 -0
- package/packages/core/docs-templates/adr-template.md +62 -0
- package/packages/core/docs-templates/architecture/api-contracts.md +26 -0
- package/packages/core/docs-templates/architecture/api-reference.md +48 -0
- package/packages/core/docs-templates/architecture/auth-and-sessions.md +38 -0
- package/packages/core/docs-templates/architecture/backend-layers.md +42 -0
- package/packages/core/docs-templates/architecture/data-flow.md +26 -0
- package/packages/core/docs-templates/architecture/database-schema.md +51 -0
- package/packages/core/docs-templates/architecture/deployment.md +41 -0
- package/packages/core/docs-templates/architecture/frontend-state.md +46 -0
- package/packages/core/helpers/statusline.cjs +370 -0
- package/packages/core/hooks/CHAIN-SEMANTICS.md +84 -0
- package/packages/core/hooks/audit-settings-source.sh +98 -0
- package/packages/core/hooks/audit-trail.sh +120 -0
- package/packages/core/hooks/block-dangerous-git.sh +189 -0
- package/packages/core/hooks/bundle-import-check.sh +64 -0
- package/packages/core/hooks/compact-state-inject.sh +84 -0
- package/packages/core/hooks/config-protection.sh +68 -0
- package/packages/core/hooks/console-log-warning.sh +28 -0
- package/packages/core/hooks/context-monitor.sh +35 -0
- package/packages/core/hooks/dev-edit-counter.sh +59 -0
- package/packages/core/hooks/dev-marker-set.sh +55 -0
- package/packages/core/hooks/dev-required-on-commit.sh +426 -0
- package/packages/core/hooks/doc-check-on-commit.sh +396 -0
- package/packages/core/hooks/edit-streak-check.sh +63 -0
- package/packages/core/hooks/evolve-check.sh +78 -0
- package/packages/core/hooks/gateguard-pre-edit.sh +154 -0
- package/packages/core/hooks/gateguard-record-facts.sh +37 -0
- package/packages/core/hooks/intake-classifier.py +449 -0
- package/packages/core/hooks/lib/profile.sh +141 -0
- package/packages/core/hooks/loop-guard.sh +75 -0
- package/packages/core/hooks/migration-safety.sh +56 -0
- package/packages/core/hooks/plan-completion-gate.sh +61 -0
- package/packages/core/hooks/pre-compact-save.sh +89 -0
- package/packages/core/hooks/security-patterns.sh +119 -0
- package/packages/core/hooks/session-context-restore.sh +76 -0
- package/packages/core/hooks/subagent-stop-validate.sh +73 -0
- package/packages/core/hooks/superkit-counts-verify.sh +346 -0
- package/packages/core/hooks/superkit-update.sh +367 -0
- package/packages/core/hooks/tests/README.md +42 -0
- package/packages/core/hooks/tests/audit-trail-chain_test.sh +62 -0
- package/packages/core/hooks/tests/block-dangerous-git_test.sh +144 -0
- package/packages/core/hooks/tests/chain-semantics/h1.sh +11 -0
- package/packages/core/hooks/tests/chain-semantics/h2.sh +9 -0
- package/packages/core/hooks/tests/chain-semantics/h3.sh +11 -0
- package/packages/core/hooks/tests/chain-semantics/run-experiment.sh +65 -0
- package/packages/core/hooks/tests/chain-semantics/settings-experiment.json +15 -0
- package/packages/core/hooks/tests/counts-verify_test.sh +118 -0
- package/packages/core/hooks/tests/dev-required-on-commit_test.sh +207 -0
- package/packages/core/hooks/tests/dev-required-wip-on-main_test.sh +20 -0
- package/packages/core/hooks/tests/doc-check-on-commit_test.sh +122 -0
- package/packages/core/hooks/tests/edit-streak-check_test.sh +106 -0
- package/packages/core/hooks/tests/internal-manifest_test.sh +130 -0
- package/packages/core/hooks/tests/json-path_test.sh +108 -0
- package/packages/core/hooks/tests/mirror-invariants_test.sh +139 -0
- package/packages/core/hooks/tests/nudge-throttle_test.sh +95 -0
- package/packages/core/hooks/tests/profile-helper_test.sh +21 -0
- package/packages/core/hooks/tests/run-all.sh +47 -0
- package/packages/core/hooks/tests/session-key-helper_test.sh +17 -0
- package/packages/core/hooks/tests/superkit-update_test.sh +311 -0
- package/packages/core/hooks/tests/warn-visibility_test.sh +59 -0
- package/packages/core/hooks/user-intent-detect.sh +44 -0
- package/packages/core/hooks/verify-hooks.sh +69 -0
- package/packages/core/rules/auto-commands.md +124 -0
- package/packages/core/rules/coding-style.md +68 -0
- package/packages/core/rules/dev-workflow.md +77 -0
- package/packages/core/rules/documentation.md +106 -0
- package/packages/core/rules/frontend-aesthetics.md +53 -0
- package/packages/core/rules/git-workflow.md +14 -0
- package/packages/core/rules/security.md +29 -0
- package/packages/core/rules/superkit-integrity.md +114 -0
- package/packages/core/settings.json +229 -0
- package/packages/core/skills/drizzle-orm-expert/SKILL.md +260 -0
- package/packages/core/skills/nextjs-supabase-auth/SKILL.md +259 -0
- package/packages/core/skills/postgresql-optimization/SKILL.md +150 -0
- package/packages/core/skills/project-architecture/SKILL.md +31 -0
- package/packages/core/skills/project-scanner/SKILL.md +132 -0
- package/packages/core/skills/redis-patterns/SKILL.md +261 -0
- package/packages/core/skills/ru-text/SKILL.md +156 -0
- package/packages/core/skills/telegram-bot-builder/SKILL.md +145 -0
- package/packages/core/skills/writing-agents/SKILL.md +220 -0
- package/packages/core/skills/writing-commands/SKILL.md +176 -0
- package/packages/core/skills/writing-hooks/SKILL.md +335 -0
- package/packages/extras/bot-reviewer.md +279 -0
- package/packages/extras/design-system-reviewer.md +234 -0
- package/packages/extras/red-blue-auditor/README.md +117 -0
- package/packages/extras/red-blue-auditor/agent.md +128 -0
- package/packages/extras/red-blue-auditor/patterns/agent-config.txt +4 -0
- package/packages/extras/red-blue-auditor/patterns/hook-injection.txt +8 -0
- package/packages/extras/red-blue-auditor/patterns/mcp-risk.txt +5 -0
- package/packages/extras/red-blue-auditor/patterns/permission-abuse.txt +6 -0
- package/packages/extras/red-blue-auditor/patterns/secrets.txt +17 -0
- package/packages/extras/red-blue-auditor/scan.sh +88 -0
- package/packages/extras/skillsmp-search/SKILL.md +134 -0
- package/packages/frontend-3d/README.md +62 -0
- package/packages/frontend-3d/agents/frontend-perf-reviewer.md +164 -0
- package/packages/frontend-3d/agents/presentation-reviewer.md +146 -0
- package/packages/frontend-3d/agents/r3f-scene-reviewer.md +128 -0
- package/packages/frontend-3d/agents/ui-design-reviewer.md +169 -0
- package/packages/frontend-3d/commands/capture-screen.md +166 -0
- package/packages/frontend-3d/hooks/bundle-size-warn.sh +93 -0
- package/packages/frontend-3d/hooks/gsap-pattern-check.sh +74 -0
- package/packages/frontend-3d/hooks/r3f-color-check.sh +76 -0
- package/packages/frontend-3d/hooks/tailwind-version-guard.sh +98 -0
- package/packages/frontend-3d/rules/frontend-aesthetics-3d.md +81 -0
- package/packages/frontend-3d/rules/gsap-conventions.md +129 -0
- package/packages/frontend-3d/rules/threejs-conventions.md +116 -0
- package/packages/frontend-3d/skills/gltf-debugging/SKILL.md +145 -0
- package/packages/frontend-3d/skills/html-to-3d-texture/SKILL.md +183 -0
- package/packages/frontend-3d/skills/output-enforcement/SKILL.md +79 -0
- package/packages/frontend-3d/skills/product-3d-lighting/SKILL.md +166 -0
- package/packages/frontend-3d/skills/r3f-scroll-driven-3d/SKILL.md +209 -0
- package/packages/frontend-3d/skills/threejs-color-management/SKILL.md +111 -0
- package/packages/frontend-ui/NOTICE.md +99 -0
- package/packages/frontend-ui/README.md +59 -0
- package/packages/frontend-ui/agents/ui-color-reviewer.md +174 -0
- package/packages/frontend-ui/agents/ui-design-critic.md +198 -0
- package/packages/frontend-ui/agents/ui-interaction-reviewer.md +259 -0
- package/packages/frontend-ui/agents/ui-motion-reviewer.md +266 -0
- package/packages/frontend-ui/agents/ui-reviewer.md +251 -0
- package/packages/frontend-ui/agents/ui-typography-reviewer.md +222 -0
- package/packages/frontend-ui/hooks/tests/ui-animation-easing-check_test.sh +78 -0
- package/packages/frontend-ui/hooks/tests/ui-banned-fonts-check_test.sh +77 -0
- package/packages/frontend-ui/hooks/tests/ui-color-check_test.sh +75 -0
- package/packages/frontend-ui/hooks/ui-animation-easing-check.sh +86 -0
- package/packages/frontend-ui/hooks/ui-banned-fonts-check.sh +90 -0
- package/packages/frontend-ui/hooks/ui-color-check.sh +102 -0
- package/packages/frontend-ui/rules/color-and-contrast.md +230 -0
- package/packages/frontend-ui/rules/frontend-design-aesthetics.md +124 -0
- package/packages/frontend-ui/rules/interaction-polish.md +335 -0
- package/packages/frontend-ui/rules/motion-and-animation.md +283 -0
- package/packages/frontend-ui/rules/spatial-and-layout.md +212 -0
- package/packages/frontend-ui/rules/typography-guidelines.md +185 -0
- package/packages/frontend-ui/rules/ui-anti-patterns.md +309 -0
- package/packages/frontend-ui/settings.json +24 -0
- package/packages/frontend-ui/skills/impeccable-craft/SKILL.md +187 -0
- package/packages/gan/README.md +232 -0
- package/packages/gan/agents/gan-evaluator.md +214 -0
- package/packages/gan/agents/gan-generator.md +171 -0
- package/packages/gan/agents/gan-planner.md +206 -0
- package/packages/gan/rubrics/functionality.md +66 -0
- package/packages/gan/rubrics/ui-quality.md +77 -0
- package/packages/gan/skills/gan-evaluator/SKILL.md +91 -0
- package/packages/gan/skills/gan-generator/SKILL.md +72 -0
- package/packages/gan/skills/gan-planner/SKILL.md +93 -0
- package/packages/stack-agents/go/go-concurrency-reviewer.md +210 -0
- package/packages/stack-agents/go/go-error-reviewer.md +187 -0
- package/packages/stack-agents/go/go-modernizer.md +160 -0
- package/packages/stack-agents/go/go-observability-reviewer.md +185 -0
- package/packages/stack-agents/go/go-performance-reviewer.md +160 -0
- package/packages/stack-agents/go/go-reviewer.md +277 -0
- package/packages/stack-agents/go/references/benchmark-methodology.md +280 -0
- package/packages/stack-agents/go/references/channel-patterns.md +384 -0
- package/packages/stack-agents/go/references/cli-cobra-viper.md +190 -0
- package/packages/stack-agents/go/references/code-style.md +262 -0
- package/packages/stack-agents/go/references/context-propagation.md +317 -0
- package/packages/stack-agents/go/references/data-structures.md +315 -0
- package/packages/stack-agents/go/references/database-patterns.md +334 -0
- package/packages/stack-agents/go/references/design-patterns.md +411 -0
- package/packages/stack-agents/go/references/di-frameworks.md +146 -0
- package/packages/stack-agents/go/references/error-creation.md +251 -0
- package/packages/stack-agents/go/references/error-inspection.md +348 -0
- package/packages/stack-agents/go/references/error-wrapping.md +230 -0
- package/packages/stack-agents/go/references/gopls-driving.md +62 -0
- package/packages/stack-agents/go/references/goroutine-lifecycle.md +351 -0
- package/packages/stack-agents/go/references/graphql-patterns.md +221 -0
- package/packages/stack-agents/go/references/grpc-patterns.md +373 -0
- package/packages/stack-agents/go/references/modernize-guide.md +522 -0
- package/packages/stack-agents/go/references/module-management.md +191 -0
- package/packages/stack-agents/go/references/naming-conventions.md +176 -0
- package/packages/stack-agents/go/references/observability-pipeline.md +352 -0
- package/packages/stack-agents/go/references/performance-profiling.md +250 -0
- package/packages/stack-agents/go/references/refactoring-mechanics.md +127 -0
- package/packages/stack-agents/go/references/rest-openapi-patterns.md +160 -0
- package/packages/stack-agents/go/references/samber-do.md +201 -0
- package/packages/stack-agents/go/references/samber-libraries.md +363 -0
- package/packages/stack-agents/go/references/samber-lo.md +260 -0
- package/packages/stack-agents/go/references/samber-oops.md +200 -0
- package/packages/stack-agents/go/references/security-checklist.md +441 -0
- package/packages/stack-agents/go/references/standard-stdlib-now.md +181 -0
- package/packages/stack-agents/go/references/stay-updated.md +147 -0
- package/packages/stack-agents/go/references/structs-interfaces.md +312 -0
- package/packages/stack-agents/go/references/sync-primitives.md +395 -0
- package/packages/stack-agents/go/references/testing-patterns.md +483 -0
- package/packages/stack-agents/go/references/troubleshooting.md +98 -0
- package/packages/stack-agents/python/py-reviewer.md +194 -0
- package/packages/stack-agents/rust/rs-reviewer.md +188 -0
- package/packages/stack-agents/typescript/ts-reviewer.md +135 -0
- package/packages/stack-hooks/go/go-context-check-on-edit.sh +56 -0
- package/packages/stack-hooks/go/go-error-check-on-edit.sh +54 -0
- package/packages/stack-hooks/go/go-format-on-edit.sh +32 -0
- package/packages/stack-hooks/go/go-safety-check-on-edit.sh +54 -0
- package/packages/stack-hooks/go/go-vet-on-edit.sh +61 -0
- package/packages/stack-hooks/go/golangci-lint-on-edit.sh +54 -0
- package/packages/stack-hooks/python/ruff-on-edit.sh +67 -0
- package/packages/stack-hooks/rust/cargo-check-on-edit.sh +64 -0
- package/packages/stack-hooks/typescript/typecheck-on-edit.sh +76 -0
- package/packages/stack-rules/go/go-conventions.md +44 -0
- package/packages/stack-rules/go/go-safety.md +35 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: frontend-design-aesthetics
|
|
3
|
+
description: "Top-level principles for producing distinctive, production-grade frontend UI. Points at deeper rules (typography, color, motion, etc.). Auto-loaded when editing UI files."
|
|
4
|
+
tokens: 1355
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
applyWhenPaths:
|
|
7
|
+
- "**/*.tsx"
|
|
8
|
+
- "**/*.jsx"
|
|
9
|
+
- "**/*.ts"
|
|
10
|
+
- "**/*.css"
|
|
11
|
+
- "**/*.scss"
|
|
12
|
+
- "**/*.html"
|
|
13
|
+
- "**/*.vue"
|
|
14
|
+
- "**/tailwind.config.*"
|
|
15
|
+
- "**/*.tokens.*"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Frontend Design Aesthetics — Principles
|
|
19
|
+
|
|
20
|
+
LLMs asked to "build a nice UI" default to a visual monoculture; this rule
|
|
21
|
+
and its six sibling rules reject that default and give you a path to a
|
|
22
|
+
distinctive, production-grade result.
|
|
23
|
+
|
|
24
|
+
## Core principles (always apply)
|
|
25
|
+
|
|
26
|
+
1. **Intentionality over intensity.** Bold maximalism and refined minimalism
|
|
27
|
+
both work; flat mediocrity does not. Commit to one clear conceptual
|
|
28
|
+
direction — for example brutally minimal, editorial/magazine,
|
|
29
|
+
retro-futuristic, organic, luxury/refined, playful/toy-like, or
|
|
30
|
+
brutalist/raw — and execute it with precision.
|
|
31
|
+
|
|
32
|
+
2. **Context over default.** The decisions that matter (dark vs light,
|
|
33
|
+
serif vs sans, tight vs airy spacing, sharp vs soft motion) follow from
|
|
34
|
+
the product's audience and use context, not from a safe default.
|
|
35
|
+
See `color-and-contrast.md` for the theme-by-context decision table and
|
|
36
|
+
`typography-guidelines.md` for the font-selection procedure.
|
|
37
|
+
|
|
38
|
+
3. **Fewer choices, more contrast.** A 5-step type scale with at least
|
|
39
|
+
1.25× between steps beats an 8-step scale at 1.1×. A 3-color palette
|
|
40
|
+
with one dominant / one secondary / one accent at 60/30/10 weight beats
|
|
41
|
+
a palette where everything shows up in equal amounts.
|
|
42
|
+
|
|
43
|
+
4. **Tint everything.** Pure black and pure white never appear in nature
|
|
44
|
+
and never look designed. Neutrals should carry a faint chroma nudge
|
|
45
|
+
toward the brand hue. See `color-and-contrast.md`.
|
|
46
|
+
|
|
47
|
+
5. **Variation creates rhythm.** Identical padding everywhere and
|
|
48
|
+
identical card grids make interfaces feel templated. Tight groupings,
|
|
49
|
+
generous separations, and intentional asymmetry make them feel
|
|
50
|
+
designed. See `spatial-and-layout.md`.
|
|
51
|
+
|
|
52
|
+
6. **Motion has a purpose or does not exist.** An animation on a keyboard
|
|
53
|
+
shortcut toggled 100× a day is a tax, not a delight. Animations on
|
|
54
|
+
rare/first-time interactions can be expressive. Everything in between
|
|
55
|
+
needs a clear "why". See `motion-and-animation.md`.
|
|
56
|
+
|
|
57
|
+
## The five rejections (applied without exception)
|
|
58
|
+
|
|
59
|
+
These are in `ui-anti-patterns.md` in detail. In short:
|
|
60
|
+
|
|
61
|
+
- **Reject the reflex fonts.** Inter, Playfair Display, and Space Grotesk
|
|
62
|
+
are three examples of the training-data defaults that produce
|
|
63
|
+
monoculture. The single canonical list lives in `ui-anti-patterns.md`,
|
|
64
|
+
section "The reflex_fonts_to_reject list" — check every candidate font
|
|
65
|
+
against it; do not rely on this rule's three examples.
|
|
66
|
+
- **Reject pure black/white** (`#000`, `#fff`). Tint toward the brand hue.
|
|
67
|
+
- **Reject gray-on-colored.** Gray body text on a colored surface looks
|
|
68
|
+
washed out. Use a shade of the surface color instead.
|
|
69
|
+
- **Reject the AI palette.** Cyan-on-black, purple-to-blue gradients, neon
|
|
70
|
+
glows on dark backgrounds. These scream "I asked the model to make
|
|
71
|
+
something futuristic."
|
|
72
|
+
- **Reject nested cards and the identical-card-grid template.** Not
|
|
73
|
+
everything needs a container. Not every section needs three identical
|
|
74
|
+
cards with icon + heading + body.
|
|
75
|
+
|
|
76
|
+
## Before writing any UI: gather design context
|
|
77
|
+
|
|
78
|
+
Design skills produce generic output without project context. Before
|
|
79
|
+
touching UI code, confirm these three things. **Do not infer from code —
|
|
80
|
+
code tells you what was built, not who it's for or how it should feel.**
|
|
81
|
+
|
|
82
|
+
1. **Target audience:** who uses this product and in what context?
|
|
83
|
+
2. **Use cases:** what jobs are they trying to get done?
|
|
84
|
+
3. **Brand personality / tone:** how should the interface feel?
|
|
85
|
+
|
|
86
|
+
### Where to find this context (in order)
|
|
87
|
+
|
|
88
|
+
1. **The user's prompt for this task.** Sometimes the answer is there.
|
|
89
|
+
2. **`CLAUDE.md` and `README.md` at project root.** Product description,
|
|
90
|
+
name of the frontend, tech stack. An app called "ONYX" with a
|
|
91
|
+
glassmorphism design system and luxury product vocabulary is not the
|
|
92
|
+
same as a "corp-dashboard" for ops engineers.
|
|
93
|
+
3. **`docs/architecture/frontend-*.md`** if present — screen structure,
|
|
94
|
+
navigation model, design token system.
|
|
95
|
+
4. **Auto-memory, only if available.** Prior sessions may have recorded
|
|
96
|
+
brand context in a `project_brand_context.md` memory entry. If
|
|
97
|
+
auto-memory is unavailable or holds no such entry, skip to source 5.
|
|
98
|
+
5. **Ask the user ONE targeted question** when sources 1–4 leave a
|
|
99
|
+
specific decision ambiguous. Ask it at the moment the decision is
|
|
100
|
+
being made, not upfront as a questionnaire. Example: "I'm about to
|
|
101
|
+
pick motion durations — is this product used in rapid trading-style
|
|
102
|
+
sessions, or contemplatively (reading, browsing)?"
|
|
103
|
+
|
|
104
|
+
After the user answers, persist the answer to auto-memory (when
|
|
105
|
+
available) so future sessions do not re-ask.
|
|
106
|
+
|
|
107
|
+
**Do not:** run a 5-question upfront survey before starting work. Do not
|
|
108
|
+
block on unknowable context — for information you cannot derive and the
|
|
109
|
+
user has not supplied, make a clear choice, state the assumption out loud,
|
|
110
|
+
and keep moving.
|
|
111
|
+
|
|
112
|
+
## How the specialist rules fit together
|
|
113
|
+
|
|
114
|
+
| If you are working on… | Consult |
|
|
115
|
+
|------------------------|---------|
|
|
116
|
+
| Choosing fonts, setting hierarchy | `typography-guidelines.md` |
|
|
117
|
+
| Palette, contrast, dark vs light | `color-and-contrast.md` |
|
|
118
|
+
| Grids, spacing, responsive | `spatial-and-layout.md` |
|
|
119
|
+
| Transitions, easings, durations, springs | `motion-and-animation.md` |
|
|
120
|
+
| Buttons, modals, drawers, forms, focus | `interaction-polish.md` |
|
|
121
|
+
| Anything the model wants to reach for | `ui-anti-patterns.md` (as a guard) |
|
|
122
|
+
|
|
123
|
+
Each rule is auto-loaded on the same file-path matchers as this one. If
|
|
124
|
+
you are reading this rule, you have all seven.
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: interaction-polish
|
|
3
|
+
description: "Interactive element polish — buttons, modals, drawers, forms, focus states, loading, UX writing. The invisible details that compound into 'feels right'. Auto-loaded when editing UI files."
|
|
4
|
+
tokens: 2837
|
|
5
|
+
alwaysApply: false
|
|
6
|
+
applyWhenPaths:
|
|
7
|
+
- "**/*.tsx"
|
|
8
|
+
- "**/*.jsx"
|
|
9
|
+
- "**/*.ts"
|
|
10
|
+
- "**/*.css"
|
|
11
|
+
- "**/*.scss"
|
|
12
|
+
- "**/*.html"
|
|
13
|
+
- "**/*.vue"
|
|
14
|
+
- "**/tailwind.config.*"
|
|
15
|
+
- "**/*.tokens.*"
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# Interaction Polish
|
|
19
|
+
|
|
20
|
+
Users never consciously notice these details — their aggregate is the
|
|
21
|
+
difference between interfaces that feel right and interfaces that feel
|
|
22
|
+
cheap.
|
|
23
|
+
|
|
24
|
+
**Token note:** CSS custom properties used below are defined in the
|
|
25
|
+
sibling frontend-ui rules — `--ease-snappy` and `--ease-drawer` in
|
|
26
|
+
`motion-and-animation.md`, `--accent-500` in `color-and-contrast.md`,
|
|
27
|
+
`--space-*` in `spatial-and-layout.md`. `--text-sm`/`--text-md` are
|
|
28
|
+
illustrative names for steps of the 5-step type scale in
|
|
29
|
+
`typography-guidelines.md` (which fixes the scale, not token names).
|
|
30
|
+
If the project defines its own tokens, substitute those names; never
|
|
31
|
+
emit a variable the project does not define.
|
|
32
|
+
|
|
33
|
+
## Hard requirements (7)
|
|
34
|
+
|
|
35
|
+
1. Every button has an `:active` state.
|
|
36
|
+
2. Every interactive element has a `:focus-visible` ring at ≥3:1
|
|
37
|
+
contrast against both the element and its background.
|
|
38
|
+
3. Touch hit targets are at least 44×44px.
|
|
39
|
+
4. Elements exit in the reverse of their entry direction (spatial
|
|
40
|
+
consistency).
|
|
41
|
+
5. Form errors render inline under the field; validate on blur or on
|
|
42
|
+
submit — never on focus.
|
|
43
|
+
6. Disabled controls look disabled: opacity 0.5 + `cursor: not-allowed`.
|
|
44
|
+
7. Opening a modal locks body scroll with `padding-right` compensation
|
|
45
|
+
for the removed scrollbar.
|
|
46
|
+
|
|
47
|
+
## Buttons
|
|
48
|
+
|
|
49
|
+
### Must respond to press
|
|
50
|
+
|
|
51
|
+
Without an `:active` state users cannot tell whether the click
|
|
52
|
+
registered before the action completes.
|
|
53
|
+
|
|
54
|
+
```css
|
|
55
|
+
.button:active {
|
|
56
|
+
transform: scale(0.97);
|
|
57
|
+
transition: transform 120ms var(--ease-snappy);
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`0.97` reads as "pressed"; `0.90` reads as "broken"; anything above
|
|
62
|
+
`0.98` is imperceptible. Duration 100–160ms.
|
|
63
|
+
|
|
64
|
+
### State lifecycle (5 states)
|
|
65
|
+
|
|
66
|
+
A submit button must not look identical before, during, and after
|
|
67
|
+
submission:
|
|
68
|
+
|
|
69
|
+
- **Idle** — shows the action text ("Sign up").
|
|
70
|
+
- **Pressed** — `:active` scale feedback (100ms).
|
|
71
|
+
- **Loading** — spinner + disabled; optionally text changes to
|
|
72
|
+
"Signing up…". Disable pointer events but keep visual identity —
|
|
73
|
+
don't grey out into invisibility.
|
|
74
|
+
- **Success** — brief affirmative state (checkmark + "Done!"), 1s max.
|
|
75
|
+
Then: if the action navigates, redirect; otherwise return to idle.
|
|
76
|
+
- **Error** — shake or subtle red flash + inline error message; keep
|
|
77
|
+
the button enabled so the user can retry.
|
|
78
|
+
|
|
79
|
+
### Size and hit target
|
|
80
|
+
|
|
81
|
+
- Minimum hit target: 44×44px (touch). Desktop-only dense tools may use
|
|
82
|
+
32×32 — an explicit tradeoff against accessibility.
|
|
83
|
+
- Primary button text one step below body size to body size
|
|
84
|
+
(`--text-sm` to `--text-md`); secondary/tertiary often one step
|
|
85
|
+
smaller.
|
|
86
|
+
- Padding: `--space-sm --space-md` is the canonical sane default.
|
|
87
|
+
- Icon-only buttons: accessible name via `aria-label` + hover tooltip
|
|
88
|
+
with delay ≥400ms.
|
|
89
|
+
|
|
90
|
+
### Disabled state
|
|
91
|
+
|
|
92
|
+
Reduce opacity to 0.5, `cursor: not-allowed` — disabled must be obvious
|
|
93
|
+
from 20 feet away. A button that looks identical when disabled gets
|
|
94
|
+
clicked repeatedly while nothing happens.
|
|
95
|
+
|
|
96
|
+
## Modals & drawers
|
|
97
|
+
|
|
98
|
+
### Spatial consistency
|
|
99
|
+
|
|
100
|
+
| Component | Entry | Exit |
|
|
101
|
+
|-----------|-------|------|
|
|
102
|
+
| Toast (bottom-right) | Slide in from right + fade | Slide out to right OR dismiss gesture direction |
|
|
103
|
+
| Modal (centered dialog) | Fade + scale from 0.95 | Fade + scale back to 0.95 |
|
|
104
|
+
| Drawer (side panel) | Slide in from the edge it's anchored to | Slide out to the same edge |
|
|
105
|
+
| Popover/dropdown | Scale-in from `transform-origin: <trigger>` | Scale-out to trigger point |
|
|
106
|
+
|
|
107
|
+
### Transform origin: modals from center, popovers from trigger
|
|
108
|
+
|
|
109
|
+
Modals are interruptions arriving at screen center; popovers are
|
|
110
|
+
extensions of their trigger and must visually grow from it.
|
|
111
|
+
|
|
112
|
+
```css
|
|
113
|
+
/* Modal — scales from center */
|
|
114
|
+
.modal { transform-origin: center; }
|
|
115
|
+
|
|
116
|
+
/* Popover — scales from trigger (Radix example) */
|
|
117
|
+
.popover {
|
|
118
|
+
transform-origin: var(--radix-popover-content-transform-origin);
|
|
119
|
+
}
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Drawer physics
|
|
123
|
+
|
|
124
|
+
iOS-style drawer uses `--ease-drawer` (defined in
|
|
125
|
+
`motion-and-animation.md`):
|
|
126
|
+
|
|
127
|
+
```css
|
|
128
|
+
.drawer {
|
|
129
|
+
transition: transform 400ms cubic-bezier(0.32, 0.72, 0, 1);
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Draggable drawers use a spring, not a duration, so the drawer keeps
|
|
134
|
+
velocity when the user flicks it.
|
|
135
|
+
|
|
136
|
+
### Overlay and scroll-lock
|
|
137
|
+
|
|
138
|
+
- Overlay behind modals/drawers: a semi-transparent surface derived
|
|
139
|
+
from the page neutral (e.g. `oklch(15% 0.01 <hue> / 0.5)`), not pure
|
|
140
|
+
`rgba(0,0,0,0.5)`. Tint even the overlay.
|
|
141
|
+
- Lock body scroll when a modal opens, with `padding-right`
|
|
142
|
+
compensation for the scrollbar — otherwise the page visibly jumps.
|
|
143
|
+
|
|
144
|
+
## Forms
|
|
145
|
+
|
|
146
|
+
### Label placement
|
|
147
|
+
|
|
148
|
+
- Top-aligned above the input — the default; best readability, easiest
|
|
149
|
+
on mobile.
|
|
150
|
+
- Left-aligned beside the input — only for dense desktop forms
|
|
151
|
+
completed repeatedly (internal tools).
|
|
152
|
+
- Floating labels — skip for serious forms: they hide context and have
|
|
153
|
+
known accessibility issues with zoom/translate.
|
|
154
|
+
|
|
155
|
+
### Validation timing
|
|
156
|
+
|
|
157
|
+
- **On submit:** most forms.
|
|
158
|
+
- **On blur:** email, phone, username — users expect feedback right
|
|
159
|
+
after finishing the field.
|
|
160
|
+
- **On typing:** password strength, slug fields — live feedback
|
|
161
|
+
actively helps.
|
|
162
|
+
- **Never on focus:** the user hasn't done anything yet.
|
|
163
|
+
|
|
164
|
+
### Error messages
|
|
165
|
+
|
|
166
|
+
- Inline, directly under the offending field — not in a banner at the
|
|
167
|
+
top of the form.
|
|
168
|
+
- Specific: "This looks like a phone number — did you mean to enter an
|
|
169
|
+
email?" beats generic "Please enter an email address". Never bare
|
|
170
|
+
"Invalid input" — say what is invalid and how to fix it. (More in UX
|
|
171
|
+
writing below.)
|
|
172
|
+
|
|
173
|
+
### Success
|
|
174
|
+
|
|
175
|
+
Small forms: redirect or toast — not a two-paragraph confirmation.
|
|
176
|
+
|
|
177
|
+
## Focus states
|
|
178
|
+
|
|
179
|
+
Required on every interactive element — missing focus styles is an
|
|
180
|
+
accessibility blocker for keyboard users.
|
|
181
|
+
|
|
182
|
+
```css
|
|
183
|
+
:focus-visible {
|
|
184
|
+
outline: 2px solid var(--accent-500);
|
|
185
|
+
outline-offset: 2px;
|
|
186
|
+
border-radius: inherit;
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
- Use `:focus-visible`, not `:focus`, so mouse clicks don't show rings
|
|
191
|
+
— only keyboard focus does.
|
|
192
|
+
- Ring contrast ≥3:1 against both the element and its surrounding
|
|
193
|
+
background. Default browser rings disappear on colored surfaces —
|
|
194
|
+
always ship your own.
|
|
195
|
+
|
|
196
|
+
## Loading patterns
|
|
197
|
+
|
|
198
|
+
### What to show
|
|
199
|
+
|
|
200
|
+
| Wait duration | Pattern |
|
|
201
|
+
|---------------|---------|
|
|
202
|
+
| < 300ms | Nothing. Users don't perceive this as a wait. |
|
|
203
|
+
| 300ms – 1s | Spinner or skeleton (spinner for actions, skeleton for content loading) |
|
|
204
|
+
| 1s – 10s | Skeleton with shimmer; informative progress if estimatable. |
|
|
205
|
+
| > 10s | Progress bar with percentage + explanation; option to cancel. |
|
|
206
|
+
|
|
207
|
+
### Skeletons for content, spinners for actions
|
|
208
|
+
|
|
209
|
+
Skeletons preview the layout before content arrives, reducing perceived
|
|
210
|
+
load time; spinners only say "it's working".
|
|
211
|
+
|
|
212
|
+
- Skeletons: lists · cards/card grids · article/post content ·
|
|
213
|
+
dashboards.
|
|
214
|
+
- Spinners: button-triggered mutations (save, delete) · full-page
|
|
215
|
+
navigation · quick <1s loads where a skeleton would flash.
|
|
216
|
+
|
|
217
|
+
### Perceived performance tricks
|
|
218
|
+
|
|
219
|
+
- **Skeletons match the real content's shape.** Headline + 3 paragraphs
|
|
220
|
+
+ image — not one generic grey box, or the swap feels jarring.
|
|
221
|
+
- **Optimistic UI for mutations:** show the new state immediately;
|
|
222
|
+
revert with a toast if the mutation fails.
|
|
223
|
+
- **Speed up the spinner:** 0.8s/rev feels faster than 1.2s/rev — same
|
|
224
|
+
load time, different perception.
|
|
225
|
+
- **Instant tooltips after the first** in the same toolbar (Radix
|
|
226
|
+
pattern) — skip both delay and animation; the whole toolbar feels
|
|
227
|
+
faster.
|
|
228
|
+
|
|
229
|
+
## Empty states
|
|
230
|
+
|
|
231
|
+
Empty states are opportunities — never a bare "No data" in 14px grey
|
|
232
|
+
text.
|
|
233
|
+
|
|
234
|
+
- **Prescriptive:** show the next step — "Create your first project" +
|
|
235
|
+
call-to-action button.
|
|
236
|
+
- **Contextual:** if a filter caused it, say so — "No items match
|
|
237
|
+
`status: archived`" + a "Clear filter" button.
|
|
238
|
+
- **Visual:** a small illustration or icon in your design language —
|
|
239
|
+
generic "sad cloud" icons are a cliché.
|
|
240
|
+
|
|
241
|
+
## UX writing
|
|
242
|
+
|
|
243
|
+
### Button labels
|
|
244
|
+
|
|
245
|
+
- Verbs with objects: "Save changes", "Create project". `[Verb Object]`
|
|
246
|
+
is the default; a bare verb ("Save", "Delete") only when context
|
|
247
|
+
makes it obvious.
|
|
248
|
+
- First-person for commitment language: "I'll decide later" reads
|
|
249
|
+
warmer than "Decide later".
|
|
250
|
+
- Replace "OK"/"Cancel" pairs with self-describing actions: "Save
|
|
251
|
+
changes" / "Discard"; "Delete project" / "Keep it" — a button that
|
|
252
|
+
describes its own action reduces mis-clicks.
|
|
253
|
+
- Destructive confirmations use the specific destructive verb
|
|
254
|
+
("Delete", "Archive", "Remove from team") — never "Confirm"; the
|
|
255
|
+
user's finger is muscle-memoried to "Confirm".
|
|
256
|
+
|
|
257
|
+
### Error messages
|
|
258
|
+
|
|
259
|
+
Lead with what went wrong from the user's point of view; offer a path
|
|
260
|
+
forward.
|
|
261
|
+
|
|
262
|
+
| ✗ | ✓ |
|
|
263
|
+
|---|---|
|
|
264
|
+
| `Error: 422 Unprocessable Entity` | `Email is already registered. Sign in, or use a different address.` |
|
|
265
|
+
| `Network error` | `We lost the connection. Retrying…` (+ retry button) |
|
|
266
|
+
| `Invalid input` | `Phone number should be in international format (+1 555…)` |
|
|
267
|
+
|
|
268
|
+
### Empty-state copy
|
|
269
|
+
|
|
270
|
+
- "You haven't created any projects yet." + `[Create your first
|
|
271
|
+
project]` — not "No projects found."
|
|
272
|
+
|
|
273
|
+
### Confirmations
|
|
274
|
+
|
|
275
|
+
- Be specific, not "Are you sure?": "Delete this project and its 24
|
|
276
|
+
files? This cannot be undone."
|
|
277
|
+
- Irrecoverable actions require typing the resource name, not just
|
|
278
|
+
clicking a button.
|
|
279
|
+
|
|
280
|
+
## Tooltips
|
|
281
|
+
|
|
282
|
+
- Delay on first hover: 400–700ms — no instant flashing when the
|
|
283
|
+
cursor enters.
|
|
284
|
+
- Subsequent tooltips in the same toolbar open instantly (Radix
|
|
285
|
+
pattern).
|
|
286
|
+
- Critical information never lives only in a tooltip — mobile and
|
|
287
|
+
keyboard users may never trigger it.
|
|
288
|
+
- Short: "Save changes (⌘S)" — not a sentence.
|
|
289
|
+
|
|
290
|
+
## Responsiveness (the UI feel, not layout)
|
|
291
|
+
|
|
292
|
+
- **Optimistic updates** for user mutations (likes, bookmarks,
|
|
293
|
+
toggles); revert quietly on failure.
|
|
294
|
+
- **Debounce, don't throttle,** user-initiated input (search, filter)
|
|
295
|
+
at 150–300ms.
|
|
296
|
+
- **Prefetch on hover** for links the user is likely to click —
|
|
297
|
+
Next.js and similar frameworks expose this.
|
|
298
|
+
- **Warm the cache** for expected next screens (after a list opens,
|
|
299
|
+
prefetch the top 3 detail views).
|
|
300
|
+
|
|
301
|
+
## Interaction rules of execution
|
|
302
|
+
|
|
303
|
+
**DO:**
|
|
304
|
+
- Give every button an `:active` state.
|
|
305
|
+
- Use `:focus-visible` for keyboard focus rings; contrast ≥3:1.
|
|
306
|
+
- Match entry direction to exit direction (spatial consistency).
|
|
307
|
+
- Scale modals from center, popovers from trigger.
|
|
308
|
+
- Inline form errors directly under the field.
|
|
309
|
+
- Use skeletons for content loading; spinners for action loading.
|
|
310
|
+
- Label buttons with the specific action (`[Delete project]`, not
|
|
311
|
+
`[Confirm]`).
|
|
312
|
+
- Provide prescriptive empty states with a call-to-action.
|
|
313
|
+
- Implement optimistic UI for user-initiated mutations.
|
|
314
|
+
|
|
315
|
+
**DO NOT:**
|
|
316
|
+
- Ship a button with no `:active` state.
|
|
317
|
+
- Rely on browser default focus rings (they disappear on colored
|
|
318
|
+
surfaces).
|
|
319
|
+
- Animate a modal from a corner if it's centered at rest — spatial
|
|
320
|
+
dissonance.
|
|
321
|
+
- Use "OK" / "Cancel" for destructive actions — use the specific verb.
|
|
322
|
+
- Show a generic spinner when you can show a shaped skeleton.
|
|
323
|
+
- Show validation errors on focus. Validate on blur or on submit.
|
|
324
|
+
- Let dark-mode modals ship with `rgba(0,0,0,0.5)` overlays — tint the
|
|
325
|
+
overlay.
|
|
326
|
+
- Forget body scroll-lock (with padding compensation) when a modal
|
|
327
|
+
opens.
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
Attribution: interaction patterns (button `:active`, modal/popover
|
|
332
|
+
transform-origin conventions, drawer easing, optimistic UI) draw from
|
|
333
|
+
Emil Kowalski's design-engineering skill (ideas only, prose independent).
|
|
334
|
+
UX writing material adapted from Impeccable's `reference/ux-writing.md`
|
|
335
|
+
+ `reference/interaction-design.md` (Apache-2.0). See `../NOTICE.md`.
|