@1aboveio/skills 0.10.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/LICENSE +3 -0
- package/README.md +90 -0
- package/bin/1aboveio-skills.mjs +18 -0
- package/package.json +28 -0
- package/runtime/skills/distribution/generated/recipes.json +1189 -0
- package/runtime/skills/distribution/scripts/bundles.mjs +280 -0
- package/runtime/skills/engineering/engineering-runtime/scripts/main-module.mjs +80 -0
- package/skills/backend/airflow-dag-develop/LICENSE +3 -0
- package/skills/backend/airflow-dag-develop/SKILL.md +111 -0
- package/skills/backend/app-debug/LICENSE +3 -0
- package/skills/backend/app-debug/SKILL.md +109 -0
- package/skills/backend/app-debug/references/common-errors.md +128 -0
- package/skills/backend/python-backend/LICENSE +3 -0
- package/skills/backend/python-backend/SKILL.md +326 -0
- package/skills/cicd-pipeline/cloud-build/LICENSE +3 -0
- package/skills/cicd-pipeline/cloud-build/SKILL.md +707 -0
- package/skills/cicd-pipeline/cloud-debug/LICENSE +3 -0
- package/skills/cicd-pipeline/cloud-debug/SKILL.md +316 -0
- package/skills/cicd-pipeline/cloud-debug/references/build-failures.md +238 -0
- package/skills/cicd-pipeline/cloud-debug/references/deploy-failures.md +376 -0
- package/skills/cicd-pipeline/cloud-debug/references/pipeline-failures.md +378 -0
- package/skills/cicd-pipeline/cloud-deploy/LICENSE +3 -0
- package/skills/cicd-pipeline/cloud-deploy/SKILL.md +229 -0
- package/skills/cicd-pipeline/cloud-deploy/references/config-templates.md +257 -0
- package/skills/cicd-pipeline/docker/LICENSE +3 -0
- package/skills/cicd-pipeline/docker/SKILL.md +126 -0
- package/skills/cicd-pipeline/google-cloud/LICENSE +3 -0
- package/skills/cicd-pipeline/google-cloud/SKILL.md +118 -0
- package/skills/cicd-pipeline/google-cloud/references/gcs.md +469 -0
- package/skills/cicd-pipeline/google-cloud/references/iam.md +451 -0
- package/skills/cicd-pipeline/google-cloud/references/project.md +349 -0
- package/skills/cicd-pipeline/google-cloud/references/secrets.md +336 -0
- package/skills/cicd-pipeline/google-cloud/references/vpc.md +312 -0
- package/skills/cicd-pipeline/google-cloud/scripts/create-sa.sh +36 -0
- package/skills/cicd-pipeline/google-cloud/scripts/gcp-config.sh +31 -0
- package/skills/cicd-pipeline/google-cloud/scripts/grant-iap.sh +41 -0
- package/skills/cicd-pipeline/google-cloud/scripts/setup-secrets.sh +48 -0
- package/skills/cicd-pipeline/mergify/LICENSE +3 -0
- package/skills/cicd-pipeline/mergify/SKILL.md +138 -0
- package/skills/cicd-pipeline/mergify/assets/templates/mergify.yml +237 -0
- package/skills/cicd-pipeline/mergify/assets/templates/ruleset.json +46 -0
- package/skills/cicd-pipeline/mergify/references/branch-protection.md +277 -0
- package/skills/cicd-pipeline/mergify/references/configuration.md +183 -0
- package/skills/cicd-pipeline/mergify/references/diagnosis.md +73 -0
- package/skills/cicd-pipeline/mergify/references/traps.md +78 -0
- package/skills/cicd-pipeline/mergify/references/watch-contract.md +218 -0
- package/skills/cicd-pipeline/mergify/scripts/audit-core.mjs +131 -0
- package/skills/cicd-pipeline/mergify/scripts/audit.mjs +4 -0
- package/skills/cicd-pipeline/mergify/scripts/watch-pr-delivery-core.mjs +663 -0
- package/skills/cicd-pipeline/mergify/scripts/watch-pr-delivery.mjs +4 -0
- package/skills/cicd-pipeline/podman/LICENSE +3 -0
- package/skills/cicd-pipeline/podman/SKILL.md +70 -0
- package/skills/cicd-pipeline/podman/agents/openai.yaml +4 -0
- package/skills/cicd-pipeline/podman/assets/templates/podman-compose-socket-directory.yml +6 -0
- package/skills/cicd-pipeline/podman/assets/templates/podman-service-override.conf +3 -0
- package/skills/cicd-pipeline/podman/references/compose-compatibility.md +70 -0
- package/skills/cicd-pipeline/podman/references/networking-and-ports.md +74 -0
- package/skills/cicd-pipeline/podman/references/rootless-services-and-sockets.md +156 -0
- package/skills/cicd-pipeline/podman/references/troubleshooting.md +98 -0
- package/skills/engineering/e2e-test/LICENSE +3 -0
- package/skills/engineering/e2e-test/SKILL.md +156 -0
- package/skills/engineering/e2e-test/assets/ci-gates.cloudbuild.yaml +272 -0
- package/skills/engineering/e2e-test/assets/ci-gates.github.yml +451 -0
- package/skills/engineering/e2e-test/assets/e2e-workflow.yml +282 -0
- package/skills/engineering/e2e-test/references/authoring/auth-flows.md +159 -0
- package/skills/engineering/e2e-test/references/authoring/playwright-config.md +71 -0
- package/skills/engineering/e2e-test/references/authoring/playwright-patterns.md +219 -0
- package/skills/engineering/e2e-test/references/authoring/test-skipping.md +44 -0
- package/skills/engineering/e2e-test/references/ci-integration.md +121 -0
- package/skills/engineering/e2e-test/references/ci-playwright-container.md +280 -0
- package/skills/engineering/e2e-test/references/debugging.md +36 -0
- package/skills/engineering/e2e-test/references/presentation-sweep.md +131 -0
- package/skills/engineering/e2e-test/references/reviewing.md +39 -0
- package/skills/engineering/e2e-test/references/route-discovery.md +50 -0
- package/skills/engineering/e2e-test/references/route-manifest.md +44 -0
- package/skills/engineering/e2e-test/scripts/detect-routes-fastapi.py +290 -0
- package/skills/engineering/e2e-test/scripts/detect-routes-nextjs.mjs +200 -0
- package/skills/engineering/e2e-test/scripts/post-visual-evidence.mjs +158 -0
- package/skills/engineering/e2e-test/scripts/presentation-checks.mjs +171 -0
- package/skills/engineering/e2e-test/scripts/presentation-perceivability.mjs +179 -0
- package/skills/engineering/e2e-test/scripts/presentation-reachability.mjs +154 -0
- package/skills/engineering/e2e-test/scripts/presentation-render-health.mjs +141 -0
- package/skills/engineering/e2e-test/scripts/presentation-sweep.mjs +148 -0
- package/skills/engineering/e2e-test/scripts/presentation-temporal.mjs +127 -0
- package/skills/engineering/e2e-test/scripts/presentation-visual.mjs +84 -0
- package/skills/engineering/e2e-test/scripts/project-route-manifest.mjs +75 -0
- package/skills/engineering/e2e-test/scripts/validate-manifest.mjs +106 -0
- package/skills/engineering/engineering-runtime/LICENSE +3 -0
- package/skills/engineering/engineering-runtime/SKILL.md +10 -0
- package/skills/engineering/engineering-runtime/agents/openai.yaml +6 -0
- package/skills/engineering/engineering-runtime/coherence/workflow.json +553 -0
- package/skills/engineering/engineering-runtime/scripts/exact-head-artifact.mjs +131 -0
- package/skills/engineering/engineering-runtime/scripts/head-check-set.mjs +398 -0
- package/skills/engineering/engineering-runtime/scripts/main-module.mjs +80 -0
- package/skills/engineering/engineering-runtime/scripts/mergify-yaml.mjs +11 -0
- package/skills/engineering/engineering-runtime/scripts/package-lock.json +43 -0
- package/skills/engineering/engineering-runtime/scripts/package.json +10 -0
- package/skills/engineering/engineering-runtime/scripts/required-check-plan.mjs +223 -0
- package/skills/engineering/engineering-runtime/scripts/workflow-coherence.mjs +576 -0
- package/skills/engineering/engineering-runtime/scripts/workflow-policy.mjs +166 -0
- package/skills/engineering/ensure-coverage/LICENSE +3 -0
- package/skills/engineering/ensure-coverage/SKILL.md +136 -0
- package/skills/engineering/ensure-coverage/evals/evals.json +125 -0
- package/skills/engineering/ensure-coverage/references/breadth/coverage-ledger.md +91 -0
- package/skills/engineering/ensure-coverage/references/breadth/inventory-contract.md +83 -0
- package/skills/engineering/ensure-coverage/references/breadth/surface-baseline.md +44 -0
- package/skills/engineering/ensure-coverage/references/breadth/surface-discovery.md +16 -0
- package/skills/engineering/ensure-coverage/references/depth/characterization.md +68 -0
- package/skills/engineering/ensure-coverage/references/depth/coverage.config.example.json +25 -0
- package/skills/engineering/ensure-coverage/references/depth/grading.md +35 -0
- package/skills/engineering/ensure-coverage/references/depth/mock-policy.md +87 -0
- package/skills/engineering/ensure-coverage/references/depth/test-smells.md +23 -0
- package/skills/engineering/ensure-coverage/references/enforcement/ci-contract.md +164 -0
- package/skills/engineering/ensure-coverage/references/enforcement/hooks.md +85 -0
- package/skills/engineering/ensure-coverage/references/examples/coverage-ledger.md +109 -0
- package/skills/engineering/ensure-coverage/references/examples/refund-flow.md +33 -0
- package/skills/engineering/ensure-coverage/references/presentation/axis.md +78 -0
- package/skills/engineering/ensure-coverage/references/presentation/runner-contract.md +74 -0
- package/skills/engineering/ensure-coverage/references/process/audit-mode.md +33 -0
- package/skills/engineering/ensure-coverage/references/process/output-template.md +139 -0
- package/skills/engineering/ensure-coverage/references/process/review-contract-template.md +119 -0
- package/skills/engineering/ensure-coverage/references/process/scope-class.md +178 -0
- package/skills/engineering/ensure-coverage/references/process/test-strategy.md +55 -0
- package/skills/engineering/ensure-coverage/schemas/coverage-config.schema.json +45 -0
- package/skills/engineering/ensure-coverage/schemas/coverage-file.schema.json +93 -0
- package/skills/engineering/ensure-coverage/scripts/adapters/nextjs-inventory.mjs +178 -0
- package/skills/engineering/ensure-coverage/scripts/check-quarantine-expiry.mjs +101 -0
- package/skills/engineering/ensure-coverage/scripts/ci-audit.mjs +358 -0
- package/skills/engineering/ensure-coverage/scripts/coverage-checklist.mjs +494 -0
- package/skills/engineering/ensure-coverage/scripts/coverage-ledger.mjs +663 -0
- package/skills/engineering/ensure-coverage/scripts/design-parity.mjs +591 -0
- package/skills/engineering/ensure-coverage/scripts/evidence-block.mjs +367 -0
- package/skills/engineering/ensure-coverage/scripts/lint-tests.mjs +269 -0
- package/skills/engineering/ensure-coverage/scripts/mock-policy-config.mjs +176 -0
- package/skills/engineering/ensure-coverage/scripts/package-lock.json +76 -0
- package/skills/engineering/ensure-coverage/scripts/package.json +19 -0
- package/skills/engineering/ensure-coverage/scripts/scope-class.mjs +554 -0
- package/skills/engineering/harness-runtime/LICENSE +3 -0
- package/skills/engineering/harness-runtime/SKILL.md +18 -0
- package/skills/engineering/harness-runtime/agents/openai.yaml +6 -0
- package/skills/engineering/harness-runtime/bin/discover-models.mjs +4 -0
- package/skills/engineering/harness-runtime/bin/model-catalog.mjs +4 -0
- package/skills/engineering/harness-runtime/contracts.md +15 -0
- package/skills/engineering/harness-runtime/discover-models.mjs +392 -0
- package/skills/engineering/harness-runtime/fixtures/native-question-schemas.json +33 -0
- package/skills/engineering/harness-runtime/fixtures/question-responses.json +54 -0
- package/skills/engineering/harness-runtime/index.mjs +767 -0
- package/skills/engineering/harness-runtime/model-catalog.mjs +787 -0
- package/skills/engineering/harness-runtime/native-question-contracts.md +37 -0
- package/skills/engineering/harness-runtime/references/model-catalog-seed.json +159 -0
- package/skills/engineering/harness-runtime/references/model-catalog.md +57 -0
- package/skills/engineering/implement-and-pr/LICENSE +3 -0
- package/skills/engineering/implement-and-pr/SKILL.md +176 -0
- package/skills/engineering/implement-and-pr/references/ci-iteration.md +10 -0
- package/skills/engineering/implement-and-pr/references/closeout.md +27 -0
- package/skills/engineering/implement-and-pr/references/contract-complete-fix-rounds.md +34 -0
- package/skills/engineering/implement-and-pr/references/evidence-rules.md +39 -0
- package/skills/engineering/implement-and-pr/references/incremental-plan.md +16 -0
- package/skills/engineering/implement-and-pr/references/self-review.md +23 -0
- package/skills/engineering/implement-and-pr/references/tdd-mode.md +18 -0
- package/skills/engineering/resolve-issues/LICENSE +3 -0
- package/skills/engineering/resolve-issues/SKILL.md +167 -0
- package/skills/engineering/resolve-issues/generated/workflow-repair-policy.json +448 -0
- package/skills/engineering/resolve-issues/references/breaker.md +82 -0
- package/skills/engineering/resolve-issues/references/deliverables.md +27 -0
- package/skills/engineering/resolve-issues/references/delivery.md +108 -0
- package/skills/engineering/resolve-issues/references/evidence-lane.md +21 -0
- package/skills/engineering/resolve-issues/references/exact-head-ci.md +287 -0
- package/skills/engineering/resolve-issues/references/fan-out.md +33 -0
- package/skills/engineering/resolve-issues/references/finalization.md +68 -0
- package/skills/engineering/resolve-issues/references/guarantees.md +10 -0
- package/skills/engineering/resolve-issues/references/high-risk.md +29 -0
- package/skills/engineering/resolve-issues/references/incidents/848/README.md +156 -0
- package/skills/engineering/resolve-issues/references/intake.md +86 -0
- package/skills/engineering/resolve-issues/references/integration-gate.md +53 -0
- package/skills/engineering/resolve-issues/references/interference.md +87 -0
- package/skills/engineering/resolve-issues/references/loop.md +134 -0
- package/skills/engineering/resolve-issues/references/model-catalog.md +9 -0
- package/skills/engineering/resolve-issues/references/postmortem.md +27 -0
- package/skills/engineering/resolve-issues/references/pre-flight-model-slots.md +41 -0
- package/skills/engineering/resolve-issues/references/pre-flight-recording-and-checkout.md +48 -0
- package/skills/engineering/resolve-issues/references/pre-flight.md +41 -0
- package/skills/engineering/resolve-issues/references/regression-checklist.md +26 -0
- package/skills/engineering/resolve-issues/references/run-state.md +288 -0
- package/skills/engineering/resolve-issues/references/sandboxed-testing.md +48 -0
- package/skills/engineering/resolve-issues/references/spawn-contract.md +96 -0
- package/skills/engineering/resolve-issues/references/terminal-evidence-journal.md +40 -0
- package/skills/engineering/resolve-issues/references/why.md +653 -0
- package/skills/engineering/resolve-issues/schemas/fix-round.schema.json +49 -0
- package/skills/engineering/resolve-issues/scripts/combine-and-verify.mjs +721 -0
- package/skills/engineering/resolve-issues/scripts/component-candidate.mjs +962 -0
- package/skills/engineering/resolve-issues/scripts/contract-revision.mjs +220 -0
- package/skills/engineering/resolve-issues/scripts/detect-delivery-mode.mjs +420 -0
- package/skills/engineering/resolve-issues/scripts/detect-target-branch.mjs +256 -0
- package/skills/engineering/resolve-issues/scripts/detect-workspace-mode.mjs +168 -0
- package/skills/engineering/resolve-issues/scripts/discover-models.mjs +9 -0
- package/skills/engineering/resolve-issues/scripts/doctrine.mjs +62 -0
- package/skills/engineering/resolve-issues/scripts/evidence-lifecycle-contract.mjs +191 -0
- package/skills/engineering/resolve-issues/scripts/exact-head-ci.mjs +413 -0
- package/skills/engineering/resolve-issues/scripts/exact-head-github-provider.mjs +332 -0
- package/skills/engineering/resolve-issues/scripts/finalize.mjs +488 -0
- package/skills/engineering/resolve-issues/scripts/fix-rounds.mjs +3307 -0
- package/skills/engineering/resolve-issues/scripts/fixtures/evidence-lifecycle-circular-1001.json +16 -0
- package/skills/engineering/resolve-issues/scripts/fixtures/evidence-lifecycle-valid-sequencing.json +51 -0
- package/skills/engineering/resolve-issues/scripts/fixtures/fmm-express-830-component-candidate.json +17 -0
- package/skills/engineering/resolve-issues/scripts/fixtures/head-check-set-1081.json +166 -0
- package/skills/engineering/resolve-issues/scripts/gate-value-series.mjs +92 -0
- package/skills/engineering/resolve-issues/scripts/guide-index.mjs +73 -0
- package/skills/engineering/resolve-issues/scripts/head-check-set.mjs +159 -0
- package/skills/engineering/resolve-issues/scripts/interference.mjs +427 -0
- package/skills/engineering/resolve-issues/scripts/model-catalog.mjs +9 -0
- package/skills/engineering/resolve-issues/scripts/next-operations.mjs +419 -0
- package/skills/engineering/resolve-issues/scripts/postmortem.mjs +909 -0
- package/skills/engineering/resolve-issues/scripts/preflight-questions.mjs +322 -0
- package/skills/engineering/resolve-issues/scripts/reconcile-contained-unit-prs.mjs +415 -0
- package/skills/engineering/resolve-issues/scripts/release-state-contract.mjs +697 -0
- package/skills/engineering/resolve-issues/scripts/report.mjs +494 -0
- package/skills/engineering/resolve-issues/scripts/required-check-plan.mjs +172 -0
- package/skills/engineering/resolve-issues/scripts/round-metadata.mjs +79 -0
- package/skills/engineering/resolve-issues/scripts/run-state-review6-cases.mjs +334 -0
- package/skills/engineering/resolve-issues/scripts/run-state.mjs +4784 -0
- package/skills/engineering/resolve-issues/scripts/sandbox-selftest.mjs +395 -0
- package/skills/engineering/resolve-issues/scripts/spawn-contract.mjs +290 -0
- package/skills/engineering/resolve-issues/scripts/terminal-dispositions.mjs +170 -0
- package/skills/engineering/resolve-issues/scripts/terminal-evidence-journal.mjs +293 -0
- package/skills/engineering/resolve-issues/scripts/unit-kind.mjs +197 -0
- package/skills/engineering/resolve-issues/scripts/unit-lifecycle.mjs +127 -0
- package/skills/engineering/resolve-issues/scripts/watch-delivery.mjs +893 -0
- package/skills/engineering/resolve-issues/scripts/workspaces.mjs +829 -0
- package/skills/engineering/resolve-issues/workflows/independent-review.workflow.js +290 -0
- package/skills/engineering/resolve-issues/workflows/prior-art-scan.workflow.js +80 -0
- package/skills/engineering/resolve-issues/workflows/workflow-smoke.mjs +102 -0
- package/skills/engineering/resolve-release/LICENSE +3 -0
- package/skills/engineering/resolve-release/SKILL.md +112 -0
- package/skills/engineering/resolve-release/references/assembly.md +137 -0
- package/skills/engineering/resolve-release/references/auto-when-green.md +56 -0
- package/skills/engineering/resolve-release/references/candidate.md +167 -0
- package/skills/engineering/resolve-release/references/exposure.md +178 -0
- package/skills/engineering/resolve-release/references/handoff.md +24 -0
- package/skills/engineering/resolve-release/references/postmortem.md +230 -0
- package/skills/engineering/resolve-release/references/preflight.md +207 -0
- package/skills/engineering/resolve-release/references/principles.md +94 -0
- package/skills/engineering/resolve-release/references/regression-checklist.md +36 -0
- package/skills/engineering/resolve-release/references/related-skills.md +12 -0
- package/skills/engineering/resolve-release/references/routing.md +149 -0
- package/skills/engineering/resolve-release/references/verified-sha-github-flow.md +285 -0
- package/skills/engineering/resolve-release/references/versioning.md +202 -0
- package/skills/engineering/resolve-release/references/why.md +53 -0
- package/skills/engineering/resolve-release/scripts/adapter-completion-artifact.mjs +389 -0
- package/skills/engineering/resolve-release/scripts/build-changes.mjs +209 -0
- package/skills/engineering/resolve-release/scripts/candidate-hygiene.mjs +407 -0
- package/skills/engineering/resolve-release/scripts/candidate-identity.mjs +904 -0
- package/skills/engineering/resolve-release/scripts/candidate-traffic.mjs +81 -0
- package/skills/engineering/resolve-release/scripts/checked-adapter-loader.mjs +612 -0
- package/skills/engineering/resolve-release/scripts/close-attempt.mjs +135 -0
- package/skills/engineering/resolve-release/scripts/closeout-release.mjs +161 -0
- package/skills/engineering/resolve-release/scripts/doctrine.mjs +106 -0
- package/skills/engineering/resolve-release/scripts/durable-processing.mjs +522 -0
- package/skills/engineering/resolve-release/scripts/ensure-target-green.mjs +659 -0
- package/skills/engineering/resolve-release/scripts/evidence-bundle.mjs +1014 -0
- package/skills/engineering/resolve-release/scripts/finalize-release.mjs +526 -0
- package/skills/engineering/resolve-release/scripts/fixtures/durable-processing-adapter.mjs +169 -0
- package/skills/engineering/resolve-release/scripts/green-gate.mjs +599 -0
- package/skills/engineering/resolve-release/scripts/isolated-adapter-evaluator.mjs +752 -0
- package/skills/engineering/resolve-release/scripts/metadata-pr-status.mjs +56 -0
- package/skills/engineering/resolve-release/scripts/metadata-sync.mjs +1538 -0
- package/skills/engineering/resolve-release/scripts/postmortem.mjs +381 -0
- package/skills/engineering/resolve-release/scripts/preflight-probes.mjs +498 -0
- package/skills/engineering/resolve-release/scripts/production-endpoints.mjs +326 -0
- package/skills/engineering/resolve-release/scripts/rc-circuit-breaker.mjs +272 -0
- package/skills/engineering/resolve-release/scripts/report.mjs +417 -0
- package/skills/engineering/resolve-release/scripts/reprobe-credentials.mjs +114 -0
- package/skills/engineering/resolve-release/scripts/revalidate-candidate.mjs +238 -0
- package/skills/engineering/resolve-release/scripts/review-packet.mjs +503 -0
- package/skills/engineering/resolve-release/scripts/rollback-floor.mjs +263 -0
- package/skills/engineering/resolve-release/scripts/version-assert.mjs +339 -0
- package/skills/engineering/resolve-release/scripts/version-postmortem.mjs +485 -0
- package/skills/engineering/resolve-release/scripts/version.mjs +1199 -0
- package/skills/engineering/resolve-release/scripts/watch-candidate-delivery.mjs +449 -0
- package/skills/engineering/resolve-release/vendor/ACORN-LICENSE +21 -0
- package/skills/engineering/resolve-release/vendor/README.md +60 -0
- package/skills/engineering/resolve-release/vendor/acorn.mjs +6233 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/LICENSE +21 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/README.md +341 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/README.template.md +70 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/chunk-TAV5CUKK.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/chunk-TAV5CUKK.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/chunk-V2S4ZYJR.mjs +7 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/chunk-V2S4ZYJR.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/index.d.mts +2033 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/index.d.ts +2033 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/index.js +7 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/index.js.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/index.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/index.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/module-ES6BEMUI.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/module-ES6BEMUI.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/module-asyncify-2EFITU5U.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/dist/module-asyncify-2EFITU5U.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/core/package.json +49 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/LICENSE +21 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/README.md +5 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/dist/index.d.mts +549 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/dist/index.d.ts +549 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/dist/index.js +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/dist/index.js.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/dist/index.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/dist/index.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/ffi-types/package.json +36 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/LICENSE +47 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/README.md +82 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.browser.d.ts +11 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.browser.mjs +22 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.cjs +21 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.cloudflare.cjs +21 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.cloudflare.d.ts +11 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.d.ts +11 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.mjs +25 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/emscripten-module.wasm +0 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/ffi.d.mts +85 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/ffi.d.ts +85 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/ffi.js +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/ffi.js.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/ffi.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/ffi.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/index.d.mts +20 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/index.d.ts +20 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/index.js +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/index.js.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/index.mjs +2 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/dist/index.mjs.map +1 -0
- package/skills/engineering/resolve-release/vendor/quickjs/release-sync/package.json +61 -0
- package/skills/engineering/review-pr/LICENSE +3 -0
- package/skills/engineering/review-pr/SKILL.md +123 -0
- package/skills/engineering/review-pr/references/adversarial-reviewer-prompt.md +42 -0
- package/skills/engineering/review-pr/references/code-correctness.md +5 -0
- package/skills/engineering/review-pr/references/contract-freshness.md +9 -0
- package/skills/engineering/review-pr/references/coordination.md +18 -0
- package/skills/engineering/review-pr/references/domain-hazards.md +123 -0
- package/skills/engineering/review-pr/references/finding-themes.md +7 -0
- package/skills/engineering/review-pr/references/github-posting.md +98 -0
- package/skills/engineering/review-pr/references/golden-path-smoke.md +5 -0
- package/skills/engineering/review-pr/references/incremental-output.md +16 -0
- package/skills/engineering/review-pr/references/inputs-and-discovery.md +31 -0
- package/skills/engineering/review-pr/references/output-format.md +99 -0
- package/skills/engineering/review-pr/references/over-mock-screen.md +7 -0
- package/skills/engineering/review-pr/references/promotion-prs.md +16 -0
- package/skills/engineering/review-pr/references/re-review.md +18 -0
- package/skills/engineering/review-pr/references/review-method.md +199 -0
- package/skills/engineering/review-pr/references/review-mode.md +30 -0
- package/skills/engineering/review-pr/references/review-posture.md +53 -0
- package/skills/engineering/review-pr/references/round1-depth.md +62 -0
- package/skills/engineering/review-pr/references/scripts.md +17 -0
- package/skills/engineering/review-pr/references/workflow.md +16 -0
- package/skills/engineering/review-pr/schemas/findings.schema.json +282 -0
- package/skills/engineering/review-pr/scripts/finding-contract.mjs +285 -0
- package/skills/engineering/review-pr/scripts/post-review.mjs +405 -0
- package/skills/engineering/review-pr/scripts/pr-context.mjs +207 -0
- package/skills/engineering/review-pr/scripts/scan-diff.mjs +365 -0
- package/skills/engineering/review-pr/scripts/theme-contract.mjs +57 -0
- package/skills/engineering/smoke/LICENSE +3 -0
- package/skills/engineering/smoke/SKILL.md +131 -0
- package/skills/engineering/smoke/assets/smoke.manifest.example.json +53 -0
- package/skills/engineering/smoke/references/manifest.md +192 -0
- package/skills/engineering/smoke/scripts/smoke.mjs +713 -0
- package/skills/fullstack/better-auth/LICENSE +3 -0
- package/skills/fullstack/better-auth/SKILL.md +601 -0
- package/skills/fullstack/better-auth/references/feishu-api.md +270 -0
- package/skills/fullstack/monorepo/LICENSE +3 -0
- package/skills/fullstack/monorepo/SKILL.md +465 -0
- package/skills/fullstack/nextjs-fullstack/LICENSE +3 -0
- package/skills/fullstack/nextjs-fullstack/SKILL.md +210 -0
- package/skills/fullstack/nextjs-fullstack/conventions.md +318 -0
- package/skills/fullstack/nextjs-fullstack/frontend-conventions.md +61 -0
- package/skills/fullstack/nextjs-fullstack/nextjs16.md +287 -0
- package/skills/fullstack/nextjs-fullstack/server-actions.md +409 -0
- package/skills/fullstack/prisma-setup/LICENSE +3 -0
- package/skills/fullstack/prisma-setup/SKILL.md +180 -0
- package/skills/fullstack/prisma-setup/nextjs.md +258 -0
- package/skills/fullstack/prisma-setup/turborepo.md +301 -0
- package/skills/fullstack/shadcn/LICENSE +3 -0
- package/skills/fullstack/shadcn/SKILL.md +119 -0
- package/skills/fullstack/shadcn/assets/shadcn-small.png +0 -0
- package/skills/fullstack/shadcn/assets/shadcn.png +0 -0
- package/skills/fullstack/shadcn/cli.md +411 -0
- package/skills/fullstack/shadcn/customization.md +224 -0
- package/skills/fullstack/shadcn/evals/evals.json +90 -0
- package/skills/fullstack/shadcn/mcp.md +101 -0
- package/skills/fullstack/shadcn/rules/base-vs-radix.md +323 -0
- package/skills/fullstack/shadcn/rules/component-selection.md +67 -0
- package/skills/fullstack/shadcn/rules/composition.md +195 -0
- package/skills/fullstack/shadcn/rules/data-table.md +201 -0
- package/skills/fullstack/shadcn/rules/forms.md +255 -0
- package/skills/fullstack/shadcn/rules/icons.md +103 -0
- package/skills/fullstack/shadcn/rules/styling.md +167 -0
- package/skills/fullstack/zod-v4/LICENSE +3 -0
- package/skills/fullstack/zod-v4/SKILL.md +287 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
# shadcn CLI Reference
|
|
2
|
+
|
|
3
|
+
Configuration is read from `components.json`.
|
|
4
|
+
|
|
5
|
+
> **IMPORTANT:** Always run commands using the project's package runner: `npx shadcn@latest`, `pnpm dlx shadcn@latest`, or `bunx --bun shadcn@latest`. Choose the right one from the project's lockfile or the `packageManager` key in `package.json` — `shadcn info` does not report it. Examples below use `npx shadcn@latest` but substitute the correct runner for the project.
|
|
6
|
+
|
|
7
|
+
> **IMPORTANT:** Only use the flags documented below. Do not invent or guess flags — if a flag isn't listed here, it doesn't exist. The CLI auto-detects the package manager from the project's lockfile; there is no `--package-manager` flag.
|
|
8
|
+
|
|
9
|
+
## Contents
|
|
10
|
+
|
|
11
|
+
- Commands: init, apply, add (dry-run, smart merge), search, view, docs, info, build, migrate, eject, registry, preset, mcp
|
|
12
|
+
- Templates: next, vite, start, react-router, astro, laravel
|
|
13
|
+
- Presets: named, code, URL formats and fields
|
|
14
|
+
- Switching presets
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Commands
|
|
19
|
+
|
|
20
|
+
### `init` — Initialize or create a project
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx shadcn@latest init [components...] [options]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Initializes shadcn/ui in an existing project or creates a new project (when `--name` is provided). Optionally installs components in the same step.
|
|
27
|
+
|
|
28
|
+
| Flag | Short | Description | Default |
|
|
29
|
+
| ----------------------- | ----- | -------------------------------------------------------------------- | ------- |
|
|
30
|
+
| `--template <template>` | `-t` | Template (next, start, vite, react-router, laravel, astro) | — |
|
|
31
|
+
| `--base <base>` | `-b` | Primitive library: `base`, `radix`, or `aria` | — |
|
|
32
|
+
| `--preset [name]` | `-p` | Preset configuration (named, code, or URL) | — |
|
|
33
|
+
| `--yes` | `-y` | Skip confirmation prompt | `true` |
|
|
34
|
+
| `--defaults` | `-d` | Use defaults (`--template=next --preset=base-nova`) | `false` |
|
|
35
|
+
| `--force` | `-f` | Force overwrite existing configuration | `false` |
|
|
36
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
37
|
+
| `--name <name>` | `-n` | Name for new project | — |
|
|
38
|
+
| `--silent` | `-s` | Mute output | `false` |
|
|
39
|
+
| `--css-variables` | | Use CSS variables for theming | `true` |
|
|
40
|
+
| `--no-css-variables` | | Do not use CSS variables for theming | — |
|
|
41
|
+
| `--rtl` / `--no-rtl` | | Enable / disable RTL support | — |
|
|
42
|
+
| `--pointer` | | Enable pointer cursor for buttons | — |
|
|
43
|
+
| `--no-pointer` | | Disable pointer cursor for buttons | — |
|
|
44
|
+
| `--reinstall` | | Re-install existing UI components | `false` |
|
|
45
|
+
| `--no-reinstall` | | Do not re-install existing UI components | — |
|
|
46
|
+
| `--monorepo` | | Scaffold a monorepo project | — |
|
|
47
|
+
| `--no-monorepo` | | Skip the monorepo prompt | — |
|
|
48
|
+
|
|
49
|
+
`npx shadcn@latest create` is an alias for `npx shadcn@latest init`.
|
|
50
|
+
|
|
51
|
+
> `--template` takes the plain framework name. There is no `next-monorepo` template *value* — pass `--monorepo` alongside `--template next` and the CLI selects the monorepo template directory itself.
|
|
52
|
+
|
|
53
|
+
### `apply` — Apply a preset to an existing project
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx shadcn@latest apply [preset] [options]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Applies a preset to an existing project, overwriting preset-driven config, fonts, CSS variables, and detected UI components.
|
|
60
|
+
|
|
61
|
+
| Flag | Short | Description | Default |
|
|
62
|
+
| ------------------- | ----- | -------------------------------------------------- | ------- |
|
|
63
|
+
| `--preset <preset>` | — | Preset configuration (named, code, or URL) | — |
|
|
64
|
+
| `--only [parts]` | — | Apply only parts of a preset: `theme`, `font` | — |
|
|
65
|
+
| `--yes` | `-y` | Skip confirmation prompt | `false` |
|
|
66
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
67
|
+
| `--silent` | `-s` | Mute output | `false` |
|
|
68
|
+
|
|
69
|
+
Use `--only theme` / `--only font` to re-theme without touching component files — the narrow alternative to the full overwrite/merge/skip decision below.
|
|
70
|
+
|
|
71
|
+
`[preset]` is a shorthand for `--preset <preset>`. If both are provided, they must match.
|
|
72
|
+
If no preset is provided, the CLI offers to open the custom preset builder on `ui.shadcn.com/create`.
|
|
73
|
+
|
|
74
|
+
### `add` — Add components
|
|
75
|
+
|
|
76
|
+
> **IMPORTANT:** To compare local components against upstream or to preview changes, ALWAYS use `npx shadcn@latest add <component> --dry-run`, `--diff`, or `--view`. NEVER fetch raw files from GitHub or other sources manually. The CLI handles registry resolution, file paths, and CSS diffing automatically.
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx shadcn@latest add [components...] [options]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Accepts component names, registry-prefixed names (`@magicui/shimmer-button`), URLs, or local paths.
|
|
83
|
+
|
|
84
|
+
| Flag | Short | Description | Default |
|
|
85
|
+
| --------------- | ----- | -------------------------------------------------------------------------------------------------------------------- | ------- |
|
|
86
|
+
| `--yes` | `-y` | Skip confirmation prompt | `false` |
|
|
87
|
+
| `--overwrite` | `-o` | Overwrite existing files | `false` |
|
|
88
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
89
|
+
| `--all` | `-a` | Add all available components | `false` |
|
|
90
|
+
| `--path <path>` | `-p` | Target path for the component | — |
|
|
91
|
+
| `--silent` | `-s` | Mute output | `false` |
|
|
92
|
+
| `--dry-run` | | Preview all changes without writing files | `false` |
|
|
93
|
+
| `--diff [path]` | | Show diffs. Without a path, shows the first 5 files. With a path, shows that file only (implies `--dry-run`) | — |
|
|
94
|
+
| `--view [path]` | | Show file contents. Without a path, shows the first 5 files. With a path, shows that file only (implies `--dry-run`) | — |
|
|
95
|
+
|
|
96
|
+
#### Dry-Run Mode
|
|
97
|
+
|
|
98
|
+
Use `--dry-run` to preview what `add` would do without writing any files. `--diff` and `--view` both imply `--dry-run`.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Preview all changes.
|
|
102
|
+
npx shadcn@latest add button --dry-run
|
|
103
|
+
|
|
104
|
+
# Show diffs for all files (top 5).
|
|
105
|
+
npx shadcn@latest add button --diff
|
|
106
|
+
|
|
107
|
+
# Show the diff for a specific file.
|
|
108
|
+
npx shadcn@latest add button --diff button.tsx
|
|
109
|
+
|
|
110
|
+
# Show contents for all files (top 5).
|
|
111
|
+
npx shadcn@latest add button --view
|
|
112
|
+
|
|
113
|
+
# Show the full content of a specific file.
|
|
114
|
+
npx shadcn@latest add button --view button.tsx
|
|
115
|
+
|
|
116
|
+
# Works with URLs too.
|
|
117
|
+
npx shadcn@latest add https://api.npoint.io/abc123 --dry-run
|
|
118
|
+
|
|
119
|
+
# CSS diffs.
|
|
120
|
+
npx shadcn@latest add button --diff globals.css
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**When to use dry-run:**
|
|
124
|
+
|
|
125
|
+
- When the user asks "what files will this add?" or "what will this change?" — use `--dry-run`.
|
|
126
|
+
- Before overwriting existing components — use `--diff` to preview the changes first.
|
|
127
|
+
- When the user wants to inspect component source code without installing — use `--view`.
|
|
128
|
+
- When checking what CSS changes would be made to `globals.css` — use `--diff globals.css`.
|
|
129
|
+
- When the user asks to review or audit third-party registry code before installing — use `--view` to inspect the source.
|
|
130
|
+
|
|
131
|
+
> **`npx shadcn@latest add --dry-run` vs `npx shadcn@latest view`:** Prefer `npx shadcn@latest add --dry-run/--diff/--view` over `npx shadcn@latest view` when the user wants to preview changes to their project. `npx shadcn@latest view` only shows raw registry metadata. `npx shadcn@latest add --dry-run` shows exactly what would happen in the user's project: resolved file paths, diffs against existing files, and CSS updates. Use `npx shadcn@latest view` only when the user wants to browse registry info without a project context.
|
|
132
|
+
|
|
133
|
+
#### Smart Merge from Upstream
|
|
134
|
+
|
|
135
|
+
When the user asks to update a component from upstream while keeping their local changes, use `--dry-run` and `--diff` to merge intelligently. **Never fetch raw files from GitHub — always use the CLI**, which resolves the registry, the file paths, and the CSS diff for you.
|
|
136
|
+
|
|
137
|
+
1. Run `npx shadcn@latest add <component> --dry-run` to see every file that would be affected.
|
|
138
|
+
2. For each file, run `npx shadcn@latest add <component> --diff <file>` to see upstream vs local.
|
|
139
|
+
3. Decide per file from the diff:
|
|
140
|
+
- No local changes → safe to overwrite.
|
|
141
|
+
- Has local changes → read the local file, then apply the upstream updates while preserving the local modifications.
|
|
142
|
+
- User says "just update everything" → `--overwrite`, but confirm first.
|
|
143
|
+
4. **Never use `--overwrite` without explicit approval.** It is the one flag here that destroys work, and the customizations it discards are usually invisible in the diff summary.
|
|
144
|
+
|
|
145
|
+
#### Installing everything up front
|
|
146
|
+
|
|
147
|
+
The house setup installs the full library at init (`npx shadcn@latest add --all`) rather than adding components on demand, so feature work never blocks on a missing component. Two things follow from that, and both bite later rather than at install time:
|
|
148
|
+
|
|
149
|
+
**`--all` is not an update path.** Re-running it with `--overwrite` to "refresh" the library discards every local customization at once, silently and across ~60 files. When upstream moves, update the components you have actually edited, one at a time, via [smart merge](#smart-merge-from-upstream). For untouched components an overwrite is safe — but establish which are untouched from the diff, not from memory.
|
|
150
|
+
|
|
151
|
+
**The dependency footprint is permanent and larger than the component count suggests.** Unused component *files* are inert — a bundler only ships what is imported — but their npm dependencies are not: they stay in `package.json`, the lockfile, install time, and the audit surface whether or not anything imports them. On `base-nova` the components that each drag in their own runtime library are:
|
|
152
|
+
|
|
153
|
+
| Component | Brings |
|
|
154
|
+
|---|---|
|
|
155
|
+
| `chart` | `recharts` |
|
|
156
|
+
| `calendar` | `react-day-picker`, `date-fns` |
|
|
157
|
+
| `carousel` | `embla-carousel-react` |
|
|
158
|
+
| `command` | `cmdk` |
|
|
159
|
+
| `resizable` | `react-resizable-panels` |
|
|
160
|
+
| `input-otp` | `input-otp` |
|
|
161
|
+
| `sonner` | `sonner`, `next-themes` |
|
|
162
|
+
|
|
163
|
+
Everything else resolves to `@base-ui/react`, which the base already requires — including `drawer`, which on a radix base would instead pull `vaul`. So the extra surface is roughly the seven rows above, not sixty. Expect dependency-bot traffic for libraries no feature uses; that is the accepted cost of the setup, not a sign something went wrong.
|
|
164
|
+
|
|
165
|
+
Land the `--all` install as its own commit. Sixty components nobody hand-picked are impossible to review meaningfully inside a feature diff, and keeping them separate preserves the ability to tell a deliberate component choice from the bulk install.
|
|
166
|
+
|
|
167
|
+
#### Working with third-party registries
|
|
168
|
+
|
|
169
|
+
Two habits that prevent most registry damage, both of which cost far less than the cleanup:
|
|
170
|
+
|
|
171
|
+
**Ask which registry when the user doesn't name one.** "Add a login block" is ambiguous across `@shadcn`, `@tailark`, `@magicui` and the rest. Guessing installs a different design system into the project, and because the result compiles and looks plausible, the mistake usually isn't caught until review — by which point it has been styled around. Never pick a registry on the user's behalf.
|
|
172
|
+
|
|
173
|
+
**Read every file a registry adds.** Registry code is community-published, not pre-verified, so treat `add` as "downloaded" rather than "correct". The recurring problems:
|
|
174
|
+
|
|
175
|
+
- **Hardcoded import paths.** The CLI rewrites imports for its own UI files, but third-party items often ship `@/components/ui/...`, which silently misses a project whose alias is `@workspace/ui/components`. Check `config.aliases` and rewrite.
|
|
176
|
+
- **The wrong icon library.** Most registries assume `lucide-react`. If `config.iconLibrary` is anything else, `npx shadcn@latest migrate icons --from lucide --to <lib>` converts them; swapping by hand is where icon names get mistranslated.
|
|
177
|
+
- **Undeclared dependencies.** An item's `dependencies` list is only as good as its author — a file can import a package the registry never declares, and the gap surfaces as a build error after an install that reported success.
|
|
178
|
+
- **Composition that violates this skill's rules** — a `SelectItem` outside a `SelectGroup`, an error in a `FieldDescription`, sizing classes on icons.
|
|
179
|
+
|
|
180
|
+
Use `--view` to audit the source *before* installing when the registry is unfamiliar.
|
|
181
|
+
|
|
182
|
+
### `search` — Search registries
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
npx shadcn@latest search [registries...] [options]
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Fuzzy search across registries. Also aliased as `npx shadcn@latest list`. Without `-q`, lists all items. **Registries are optional** — omit them and the CLI searches every registry configured in `components.json`. Accepts namespaces, GitHub sources, and URLs.
|
|
189
|
+
|
|
190
|
+
| Flag | Short | Description | Default |
|
|
191
|
+
| ------------------- | ----- | ------------------------------------------------------ | ------- |
|
|
192
|
+
| `--query <query>` | `-q` | Search query | — |
|
|
193
|
+
| `--type <type>` | `-t` | Filter by item type (`ui`, `block`, `hook`, …). Comma-separated for multiple | — |
|
|
194
|
+
| `--limit <number>` | `-l` | Max items per registry | `100` |
|
|
195
|
+
| `--offset <number>` | `-o` | Items to skip | `0` |
|
|
196
|
+
| `--json` | | Output as JSON | `false` |
|
|
197
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
198
|
+
|
|
199
|
+
### `view` — View item details
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
npx shadcn@latest view <items...> [options]
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Displays item info including file contents. Example: `npx shadcn@latest view @shadcn/button`.
|
|
206
|
+
|
|
207
|
+
### `docs` — Get component documentation URLs
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
npx shadcn@latest docs <components...> [options]
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Outputs resolved URLs for component documentation, examples, and API references. Accepts one or more component names. Fetch the URLs to get the actual content.
|
|
214
|
+
|
|
215
|
+
| Flag | Short | Description | Default |
|
|
216
|
+
| ----------------- | ----- | -------------------------------------------------------------- | -------------- |
|
|
217
|
+
| `--base <base>` | `-b` | Resolve URLs for `base`, `radix`, or `aria` instead of the project base | project base |
|
|
218
|
+
| `--json` | | Output as JSON | `false` |
|
|
219
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
220
|
+
|
|
221
|
+
URLs are **base-scoped** — the base is a path segment in both the docs and the examples URL. Example output for `npx shadcn@latest docs input button`:
|
|
222
|
+
|
|
223
|
+
```
|
|
224
|
+
input
|
|
225
|
+
- docs https://ui.shadcn.com/docs/components/radix/input
|
|
226
|
+
- examples https://ui.shadcn.com/code/apps/v4/registry/bases/radix/examples/input-example.tsx
|
|
227
|
+
|
|
228
|
+
button
|
|
229
|
+
- docs https://ui.shadcn.com/docs/components/radix/button
|
|
230
|
+
- examples https://ui.shadcn.com/code/apps/v4/registry/bases/radix/examples/button-example.tsx
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Some components include an `api` link to the underlying library — e.g. `https://base-ui.com/react/components/select.md` for base, `https://react-aria.adobe.com/Button#api` for aria, `cmdk` for the command component.
|
|
234
|
+
|
|
235
|
+
### `diff` — Check for updates
|
|
236
|
+
|
|
237
|
+
Do not use this command. Use `npx shadcn@latest add --diff` instead.
|
|
238
|
+
|
|
239
|
+
### `info` — Project information
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
npx shadcn@latest info [options]
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Displays project info and `components.json` configuration. Run this first to discover the project's framework, aliases, Tailwind version, and resolved paths.
|
|
246
|
+
|
|
247
|
+
| Flag | Short | Description | Default |
|
|
248
|
+
| ------------- | ----- | ----------------- | ------- |
|
|
249
|
+
| `--json` | | Output as JSON | `false` |
|
|
250
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
251
|
+
|
|
252
|
+
`--json` returns five top-level blocks: `project`, `config`, `preset`, `components`, `links`. **Field names below are exact — read them from the right block.**
|
|
253
|
+
|
|
254
|
+
**`project` — detected from the filesystem:**
|
|
255
|
+
|
|
256
|
+
| Field | Type | Meaning |
|
|
257
|
+
| ------------------ | --------- | ------------------------------------------------------------------ |
|
|
258
|
+
| `framework` | `string` | Display name of the detected framework (`Next.js`, `Vite`, `Manual`, …) |
|
|
259
|
+
| `frameworkName` | `string` | Machine name (`next`, `vite`, `react-router`, `start`, `manual`) |
|
|
260
|
+
| `frameworkVersion` | `string` | Framework version (e.g. `15.2.4`), or `null` |
|
|
261
|
+
| `srcDirectory` | `boolean` | Whether the project uses a `src/` directory |
|
|
262
|
+
| `rsc` | `boolean` | Whether React Server Components are enabled |
|
|
263
|
+
| `typescript` | `boolean` | Whether the project uses TypeScript |
|
|
264
|
+
| `tailwindVersion` | `string` | `"v3"` or `"v4"` |
|
|
265
|
+
| `tailwindConfig` | `string` | Path to the Tailwind config file (`null` on v4) |
|
|
266
|
+
| `tailwindCss` | `string` | Path to the global CSS file |
|
|
267
|
+
| `importAlias` | `string` | Import alias prefix (e.g. `@`, `~`) |
|
|
268
|
+
|
|
269
|
+
> There is **no `packageManager` field** in `info` output. The CLI detects the package manager from the lockfile for its own installs; to pick a runner yourself, read the lockfile or `packageManager` in `package.json`.
|
|
270
|
+
|
|
271
|
+
**`config` — from `components.json`:**
|
|
272
|
+
|
|
273
|
+
| Field | Type | Meaning |
|
|
274
|
+
| -------------------- | --------- | ------------------------------------------------------------------------------------------ |
|
|
275
|
+
| `style` | `string` | Combined `<base>-<preset>` (e.g. `radix-nova`, `base-lyra`, `aria-vega`) |
|
|
276
|
+
| `base` | `string` | Primitive library (`radix`, `base`, or `aria`), derived from `style` — determines component APIs |
|
|
277
|
+
| `rsc` | `boolean` | RSC flag from config |
|
|
278
|
+
| `typescript` | `boolean` | TypeScript flag |
|
|
279
|
+
| `iconLibrary` | `string` | Icon library key (`lucide`, `tabler`, `hugeicons`, `phosphor`, `remixicon`) |
|
|
280
|
+
| `rtl` | `boolean` | RTL support flag |
|
|
281
|
+
| `menuColor` | `string` | `default`, `inverted`, `default-translucent`, `inverted-translucent`, or `null` |
|
|
282
|
+
| `menuAccent` | `string` | `subtle`, `bold`, or `null` |
|
|
283
|
+
| `aliases.components` | `string` | Component import alias (e.g. `@/components`) |
|
|
284
|
+
| `aliases.utils` | `string` | Utils import alias (e.g. `@/lib/utils`) |
|
|
285
|
+
| `aliases.ui` | `string` | UI component alias (e.g. `@/components/ui`) |
|
|
286
|
+
| `aliases.lib` | `string` | Lib alias (e.g. `@/lib`) |
|
|
287
|
+
| `aliases.hooks` | `string` | Hooks alias (e.g. `@/hooks`) |
|
|
288
|
+
| `resolvedPaths` | `object` | Absolute paths per alias, plus `cwd`, `tailwindConfig`, `tailwindCss` |
|
|
289
|
+
| `registries` | `object` | Configured registries, including the built-in `@shadcn` (`https://ui.shadcn.com/r/styles/{style}/{name}.json`) |
|
|
290
|
+
|
|
291
|
+
**`preset`, `components`, `links`:**
|
|
292
|
+
|
|
293
|
+
- `preset` — `{ code, fallbacks, values }`. `code` is the current project's preset code; `values` holds the resolved `style`, `baseColor`, `theme`, `chartColor`, `iconLibrary`, `font`, `fontHeading`, `radius`, `menuAccent`, `menuColor`.
|
|
294
|
+
- `components` — the list of installed registry items. **Check this before running `add`.**
|
|
295
|
+
- `links` — templated URLs (`docs`, `components`, `ui`, `examples`, `schema`) with a `[component]` placeholder. For resolved URLs, use `npx shadcn@latest docs <component>` instead.
|
|
296
|
+
|
|
297
|
+
### `build` — Build a custom registry
|
|
298
|
+
|
|
299
|
+
```bash
|
|
300
|
+
npx shadcn@latest build [registry] [options]
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Builds `registry.json` into individual JSON files for distribution. Default input: `./registry.json`, default output: `./public/r`.
|
|
304
|
+
|
|
305
|
+
| Flag | Short | Description | Default |
|
|
306
|
+
| ----------------- | ----- | ----------------- | ------------ |
|
|
307
|
+
| `--output <path>` | `-o` | Output directory | `./public/r` |
|
|
308
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
309
|
+
|
|
310
|
+
### `migrate` — Run a codemod
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
npx shadcn@latest migrate [migration] [path] [options]
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Rewrites existing source files. `[path]` optionally narrows the scope to a path or glob.
|
|
317
|
+
|
|
318
|
+
| Flag | Short | Description | Default |
|
|
319
|
+
| ------------------- | ----- | ----------------------------------------------- | ------- |
|
|
320
|
+
| `--list` | `-l` | List all migrations | `false` |
|
|
321
|
+
| `--from <library>` | `-f` | Icon library to migrate from (`icons` only) | — |
|
|
322
|
+
| `--to <library>` | `-t` | Icon library to migrate to (`icons` only) | — |
|
|
323
|
+
| `--yes` | `-y` | Skip confirmation prompt | `false` |
|
|
324
|
+
| `--cwd <cwd>` | `-c` | Working directory | current |
|
|
325
|
+
|
|
326
|
+
Available migrations (`npx shadcn@latest migrate --list`):
|
|
327
|
+
|
|
328
|
+
| Migration | What it does |
|
|
329
|
+
| --------- | ---------------------------------------------------------------- |
|
|
330
|
+
| `icons` | Switch components to a different icon library (`--from` / `--to`) |
|
|
331
|
+
| `radix` | Migrate individual `@radix-ui/react-*` packages to unified `radix-ui` |
|
|
332
|
+
| `rtl` | Add RTL (right-to-left) support to components |
|
|
333
|
+
|
|
334
|
+
Prefer `migrate icons` over hand-editing imports when swapping icon libraries across a codebase.
|
|
335
|
+
|
|
336
|
+
### `eject` — Remove the shadcn runtime dependency
|
|
337
|
+
|
|
338
|
+
```bash
|
|
339
|
+
npx shadcn@latest eject [options]
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
Inlines `shadcn/tailwind.css` and drops the `shadcn` package dependency. One-way — confirm with the user first. Flags: `--yes` / `-y`, `--silent` / `-s`, `--cwd` / `-c`.
|
|
343
|
+
|
|
344
|
+
### `registry` — Manage registries
|
|
345
|
+
|
|
346
|
+
```bash
|
|
347
|
+
npx shadcn@latest registry add [registries...] # @namespace, or @namespace=url
|
|
348
|
+
npx shadcn@latest registry validate [registry]
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
`registry add` writes entries into `components.json` for you — prefer it over hand-editing the `registries` object. A bare `@namespace` is looked up in the community index; `@namespace=https://…/{name}.json` sets an explicit URL. `registry validate` checks a registry's items against the schema.
|
|
352
|
+
|
|
353
|
+
### `preset` — Inspect preset codes
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
npx shadcn@latest preset decode <code> # show the values a code encodes
|
|
357
|
+
npx shadcn@latest preset resolve # the current project's preset (alias: info)
|
|
358
|
+
npx shadcn@latest preset url <code> # https://ui.shadcn.com/create?preset=<code>
|
|
359
|
+
npx shadcn@latest preset open <code> # open that URL in the browser
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
`decode` and `resolve` accept `--json`. Preset codes stay opaque to *you* — use these commands rather than decoding, fetching, or hand-parsing a code.
|
|
363
|
+
|
|
364
|
+
### `mcp` — MCP server
|
|
365
|
+
|
|
366
|
+
```bash
|
|
367
|
+
npx shadcn@latest mcp # run the server (stdio)
|
|
368
|
+
npx shadcn@latest mcp init --client <claude|cursor|vscode|codex|opencode>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
See [mcp.md](./mcp.md) for the tool list.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Templates
|
|
376
|
+
|
|
377
|
+
| Value | Framework | Monorepo support |
|
|
378
|
+
| -------------- | -------------- | ---------------- |
|
|
379
|
+
| `next` | Next.js | Yes |
|
|
380
|
+
| `vite` | Vite | Yes |
|
|
381
|
+
| `start` | TanStack Start | Yes |
|
|
382
|
+
| `react-router` | React Router | Yes |
|
|
383
|
+
| `astro` | Astro | Yes |
|
|
384
|
+
| `laravel` | Laravel | No |
|
|
385
|
+
|
|
386
|
+
All templates support monorepo scaffolding via the `--monorepo` flag. When passed, the CLI uses a monorepo-specific template directory (e.g. `next-monorepo`, `vite-monorepo`). When neither `--monorepo` nor `--no-monorepo` is passed, the CLI prompts interactively. Laravel does not support monorepo scaffolding.
|
|
387
|
+
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## Presets
|
|
391
|
+
|
|
392
|
+
Three ways to specify a preset via `--preset`:
|
|
393
|
+
|
|
394
|
+
1. **Named:** `--preset nova` or `--preset lyra`. The full set is `nova`, `vega`, `maia`, `lyra`, `mira`, `luma`, `sera`, `rhea`. Also accepted base-qualified: `base-nova`, `radix-lyra`, `aria-vega`.
|
|
395
|
+
2. **Code:** `--preset a2r6bw` (version-prefixed base62 string, e.g. `a2r6bw` or `b0`)
|
|
396
|
+
3. **URL:** `--preset "https://ui.shadcn.com/init?base=radix&style=nova&iconLibrary=lucide&..."` — the `/init` endpoint requires a complete parameter set; the shareable form the CLI itself emits is `https://ui.shadcn.com/create?preset=<code>` (see `preset url`).
|
|
397
|
+
|
|
398
|
+
> **IMPORTANT:** Never try to decode, fetch, or resolve preset codes by hand or by fetching URLs. Preset codes are opaque — pass them directly to `npx shadcn@latest init --preset <code>` and let the CLI handle resolution. If you need to *see* what a code encodes, run `npx shadcn@latest preset decode <code>`.
|
|
399
|
+
> Use `npx shadcn@latest apply --preset <code>` when overwriting an existing project's preset.
|
|
400
|
+
|
|
401
|
+
A preset is only the *theme* half. The **base** (`base` / `radix` / `aria`) is a separate axis, set by `--base` at init and stored inside `components.json`'s `style` field as `<base>-<preset>` (e.g. `radix-nova`). Codes do not encode the base.
|
|
402
|
+
|
|
403
|
+
## Switching Presets
|
|
404
|
+
|
|
405
|
+
Ask the user first: **overwrite**, **merge**, or **skip** existing components?
|
|
406
|
+
|
|
407
|
+
- **Overwrite / Re-install** → `npx shadcn@latest apply --preset <code>`. Overwrites all detected component files with the new preset styles. Use when the user hasn't customized components.
|
|
408
|
+
- **Merge** → `npx shadcn@latest init --preset <code> --force --no-reinstall`, then run `npx shadcn@latest info` to get the list of installed components and use the [smart merge workflow](#smart-merge-from-upstream) to update them one by one, preserving local changes. Use when the user has customized components.
|
|
409
|
+
- **Skip** → `npx shadcn@latest init --preset <code> --force --no-reinstall`. Only updates config and CSS variables, leaves existing components as-is.
|
|
410
|
+
|
|
411
|
+
Always run preset commands inside the user's project directory. `apply` only works in an existing project with a `components.json` file. The CLI automatically preserves the current base (`base` vs `radix`) from `components.json`. If you must use a scratch/temp directory (e.g. for `--dry-run` comparisons), pass `--base <current-base>` explicitly — preset codes do not encode the base.
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Customization & Theming
|
|
2
|
+
|
|
3
|
+
Components reference semantic CSS variable tokens. Change the variables to change every component.
|
|
4
|
+
|
|
5
|
+
## Contents
|
|
6
|
+
|
|
7
|
+
- How it works (CSS variables → Tailwind utilities → components)
|
|
8
|
+
- Color variables and OKLCH format
|
|
9
|
+
- Dark mode setup
|
|
10
|
+
- Changing the theme (presets, CSS variables)
|
|
11
|
+
- Adding custom colors (Tailwind v3 and v4)
|
|
12
|
+
- Border radius
|
|
13
|
+
- Customizing components (variants, className, wrappers)
|
|
14
|
+
- Checking for updates
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## How It Works
|
|
19
|
+
|
|
20
|
+
1. CSS variables defined in `:root` (light) and `.dark` (dark mode).
|
|
21
|
+
2. Tailwind maps them to utilities: `bg-primary`, `text-muted-foreground`, etc.
|
|
22
|
+
3. Components use these utilities — changing a variable changes all components that reference it.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Color Variables
|
|
27
|
+
|
|
28
|
+
Most colors follow the `name` / `name-foreground` convention — the base variable is the background, `-foreground` is the text/icons on it. This is the complete set a preset defines (32 variables); anything not on this list doesn't exist, and a Tailwind utility built from a non-existent token silently produces no styling.
|
|
29
|
+
|
|
30
|
+
| Variable | Purpose |
|
|
31
|
+
| ---------------------------------------- | --------------------------------------------- |
|
|
32
|
+
| `--background` / `--foreground` | Page background and default text |
|
|
33
|
+
| `--card` / `--card-foreground` | Card surfaces |
|
|
34
|
+
| `--popover` / `--popover-foreground` | Floating surfaces — Popover, Dropdown, Select, Tooltip content |
|
|
35
|
+
| `--primary` / `--primary-foreground` | Primary buttons and actions |
|
|
36
|
+
| `--secondary` / `--secondary-foreground` | Secondary actions |
|
|
37
|
+
| `--muted` / `--muted-foreground` | Muted surfaces and secondary text |
|
|
38
|
+
| `--accent` / `--accent-foreground` | Hover and accent states |
|
|
39
|
+
| `--destructive` | Error and destructive actions — **no `-foreground` pair** |
|
|
40
|
+
| `--border` | Default border color |
|
|
41
|
+
| `--input` | Form input borders |
|
|
42
|
+
| `--ring` | Focus ring color |
|
|
43
|
+
| `--chart-1` … `--chart-5` | Chart/data visualization |
|
|
44
|
+
| `--sidebar`, `--sidebar-foreground`, `--sidebar-primary`, `--sidebar-primary-foreground`, `--sidebar-accent`, `--sidebar-accent-foreground`, `--sidebar-border`, `--sidebar-ring` | Sidebar-specific colors |
|
|
45
|
+
| `--radius` | Base border radius (see below) |
|
|
46
|
+
|
|
47
|
+
**`--destructive` is deliberately unpaired.** The destructive variants are tinted rather than solid — `bg-destructive/10 text-destructive` — so there's no "text on a solid destructive fill" to name. `text-destructive-foreground` is not a real utility; write `text-destructive` on a tinted or transparent background instead.
|
|
48
|
+
|
|
49
|
+
**There is no `--surface`, `--success`, or `--warning`.** If a design needs them, add them as custom variables (below) rather than assuming they're already in the theme.
|
|
50
|
+
|
|
51
|
+
Colors use OKLCH: `--primary: oklch(0.205 0 0)` where values are lightness (0–1), chroma (0 = gray), and hue (0–360).
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Dark Mode
|
|
56
|
+
|
|
57
|
+
Class-based toggle via `.dark` on the root element. In Next.js, use `next-themes`:
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { ThemeProvider } from "next-themes"
|
|
61
|
+
|
|
62
|
+
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
|
63
|
+
{children}
|
|
64
|
+
</ThemeProvider>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Changing the Theme
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Apply a preset code from ui.shadcn.com.
|
|
73
|
+
npx shadcn@latest apply --preset a2r6bw
|
|
74
|
+
|
|
75
|
+
# Positional shorthand also works.
|
|
76
|
+
npx shadcn@latest apply a2r6bw
|
|
77
|
+
|
|
78
|
+
# Switch to a named preset and overwrite existing components.
|
|
79
|
+
npx shadcn@latest apply --preset nova
|
|
80
|
+
|
|
81
|
+
# Re-theme only — leaves component files untouched. Narrower than the overwrite/merge/skip choice.
|
|
82
|
+
npx shadcn@latest apply --preset a2r6bw --only theme
|
|
83
|
+
npx shadcn@latest apply --preset a2r6bw --only font
|
|
84
|
+
|
|
85
|
+
# Preserve existing components instead.
|
|
86
|
+
npx shadcn@latest init --preset nova --force --no-reinstall
|
|
87
|
+
|
|
88
|
+
# Use a custom theme URL (the /init endpoint needs a complete parameter set).
|
|
89
|
+
npx shadcn@latest apply --preset "https://ui.shadcn.com/init?base=radix&style=nova&theme=blue&iconLibrary=lucide&..."
|
|
90
|
+
|
|
91
|
+
# See what a code encodes, or what the project currently uses.
|
|
92
|
+
npx shadcn@latest preset decode a2r6bw
|
|
93
|
+
npx shadcn@latest preset resolve
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Named presets: `nova`, `vega`, `maia`, `lyra`, `mira`, `luma`, `sera`, `rhea`.
|
|
97
|
+
|
|
98
|
+
Or edit CSS variables directly in `globals.css`.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Adding Custom Colors
|
|
103
|
+
|
|
104
|
+
Add variables to the file at `project.tailwindCss` (absolute path: `config.resolvedPaths.tailwindCss`) from `npx shadcn@latest info` — typically `globals.css`. Never create a new CSS file for this.
|
|
105
|
+
|
|
106
|
+
```css
|
|
107
|
+
/* 1. Define in the global CSS file. */
|
|
108
|
+
:root {
|
|
109
|
+
--warning: oklch(0.84 0.16 84);
|
|
110
|
+
--warning-foreground: oklch(0.28 0.07 46);
|
|
111
|
+
}
|
|
112
|
+
.dark {
|
|
113
|
+
--warning: oklch(0.41 0.11 46);
|
|
114
|
+
--warning-foreground: oklch(0.99 0.02 95);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```css
|
|
119
|
+
/* 2a. Register with Tailwind v4 (@theme inline). */
|
|
120
|
+
@theme inline {
|
|
121
|
+
--color-warning: var(--warning);
|
|
122
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
When `tailwindVersion` is `"v3"` (check via `npx shadcn@latest info`), register in `tailwind.config.js` instead:
|
|
127
|
+
|
|
128
|
+
```js
|
|
129
|
+
// 2b. Register with Tailwind v3 (tailwind.config.js).
|
|
130
|
+
module.exports = {
|
|
131
|
+
theme: {
|
|
132
|
+
extend: {
|
|
133
|
+
colors: {
|
|
134
|
+
warning: "oklch(var(--warning) / <alpha-value>)",
|
|
135
|
+
"warning-foreground":
|
|
136
|
+
"oklch(var(--warning-foreground) / <alpha-value>)",
|
|
137
|
+
},
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
// 3. Use in components.
|
|
145
|
+
<div className="bg-warning text-warning-foreground">Warning</div>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Border Radius
|
|
151
|
+
|
|
152
|
+
`--radius` controls border radius globally. Components derive values from it (`rounded-lg` = `var(--radius)`, `rounded-md` = `calc(var(--radius) - 2px)`).
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Customizing Components
|
|
157
|
+
|
|
158
|
+
See also: [rules/styling.md](./rules/styling.md) for Incorrect/Correct examples.
|
|
159
|
+
|
|
160
|
+
Prefer these approaches in order:
|
|
161
|
+
|
|
162
|
+
### 1. Built-in variants
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
<Button variant="outline" size="sm">
|
|
166
|
+
Click
|
|
167
|
+
</Button>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### 2. Tailwind classes via `className`
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
<Card className="mx-auto max-w-md">...</Card>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### 3. Add a new variant
|
|
177
|
+
|
|
178
|
+
Edit the component source to add a variant via `cva`:
|
|
179
|
+
|
|
180
|
+
```tsx
|
|
181
|
+
// components/ui/button.tsx
|
|
182
|
+
warning: "bg-warning text-warning-foreground hover:bg-warning/90",
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
### 4. Wrapper components
|
|
186
|
+
|
|
187
|
+
Compose shadcn/ui primitives into higher-level components:
|
|
188
|
+
|
|
189
|
+
```tsx
|
|
190
|
+
export function ConfirmDialog({ title, description, onConfirm, children }) {
|
|
191
|
+
return (
|
|
192
|
+
<AlertDialog>
|
|
193
|
+
<AlertDialogTrigger asChild>{children}</AlertDialogTrigger>
|
|
194
|
+
<AlertDialogContent>
|
|
195
|
+
<AlertDialogHeader>
|
|
196
|
+
<AlertDialogTitle>{title}</AlertDialogTitle>
|
|
197
|
+
<AlertDialogDescription>{description}</AlertDialogDescription>
|
|
198
|
+
</AlertDialogHeader>
|
|
199
|
+
<AlertDialogFooter>
|
|
200
|
+
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
201
|
+
<AlertDialogAction onClick={onConfirm}>Confirm</AlertDialogAction>
|
|
202
|
+
</AlertDialogFooter>
|
|
203
|
+
</AlertDialogContent>
|
|
204
|
+
</AlertDialog>
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## Checking for Updates
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx shadcn@latest add button --diff
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
To preview exactly what would change before updating, use `--dry-run` and `--diff`:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
npx shadcn@latest add button --dry-run # see all affected files
|
|
221
|
+
npx shadcn@latest add button --diff button.tsx # see the diff for a specific file
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
See [Smart Merge from Upstream](./cli.md#smart-merge-from-upstream) for the full smart merge workflow.
|