skillfullstack 0.0.0-stage → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.skillsRegistry/catalog.json +231 -0
- package/AGENTS.md +89 -0
- package/README.md +210 -2
- package/bin/index.js +508 -0
- package/package.json +57 -4
- package/skills/backend/apiEngineering/SKILL.md +102 -0
- package/skills/backend/apiEngineering/evals/evalApiEngineering.py +81 -0
- package/skills/backend/apiEngineering/evals/fixtures/invalid/sampleInvalidOpenApi.json +40 -0
- package/skills/backend/apiEngineering/evals/fixtures/valid/sampleValidOpenApi.json +47 -0
- package/skills/backend/apiEngineering/policies/compatibility.md +42 -0
- package/skills/backend/apiEngineering/policies/mandatory.md +48 -0
- package/skills/backend/apiEngineering/policies/performance.md +39 -0
- package/skills/backend/apiEngineering/policies/security.md +36 -0
- package/skills/backend/apiEngineering/references/apiObservability.md +39 -0
- package/skills/backend/apiEngineering/references/apiReference.md +3 -0
- package/skills/backend/apiEngineering/references/apiSecurityOwasp.md +47 -0
- package/skills/backend/apiEngineering/references/contractCompatibility.md +26 -0
- package/skills/backend/apiEngineering/references/databaseTransactions.md +40 -0
- package/skills/backend/apiEngineering/references/distributedReliability.md +26 -0
- package/skills/backend/apiEngineering/references/multiTenancy.md +27 -0
- package/skills/backend/apiEngineering/references/openApi32Standards.md +58 -0
- package/skills/backend/apiEngineering/references/paginationVersioning.md +57 -0
- package/skills/backend/apiEngineering/references/responseStandards.md +94 -0
- package/skills/backend/apiEngineering/scripts/auditApiContract.py +123 -0
- package/skills/backend/apiEngineering/scripts/checkBreakingChanges.py +77 -0
- package/skills/backend/apiEngineering/scripts/generateResponseEnvelope.py +88 -0
- package/skills/backend/apiEngineering/templates/apiChecklist.md +27 -0
- package/skills/backend/apiEngineering/templates/openapi.yaml +125 -0
- package/skills/backend/apiEngineering/templates/problemDetails.json +44 -0
- package/skills/backend/databaseArchitecture/SKILL.md +118 -0
- package/skills/backend/databaseArchitecture/evals/evalDatabaseArchitecture.py +85 -0
- package/skills/backend/databaseArchitecture/evals/fixtures/dangerousMigration.sql +4 -0
- package/skills/backend/databaseArchitecture/evals/fixtures/invalidSchema.sql +23 -0
- package/skills/backend/databaseArchitecture/evals/fixtures/safeMigration.sql +3 -0
- package/skills/backend/databaseArchitecture/evals/fixtures/validSchema.sql +37 -0
- package/skills/backend/databaseArchitecture/policies/integrity.md +25 -0
- package/skills/backend/databaseArchitecture/policies/mandatory.md +32 -0
- package/skills/backend/databaseArchitecture/policies/migration.md +22 -0
- package/skills/backend/databaseArchitecture/policies/normalization.md +25 -0
- package/skills/backend/databaseArchitecture/policies/performance.md +26 -0
- package/skills/backend/databaseArchitecture/policies/recovery.md +23 -0
- package/skills/backend/databaseArchitecture/policies/security.md +26 -0
- package/skills/backend/databaseArchitecture/policies/tableCreationChecklist.md +70 -0
- package/skills/backend/databaseArchitecture/references/analyticsWarehousing.md +32 -0
- package/skills/backend/databaseArchitecture/references/apiReference.md +3 -0
- package/skills/backend/databaseArchitecture/references/backupDisasterRecovery.md +27 -0
- package/skills/backend/databaseArchitecture/references/dataModelingLifecycle.md +30 -0
- package/skills/backend/databaseArchitecture/references/databaseTaxonomy.md +32 -0
- package/skills/backend/databaseArchitecture/references/indexingOptimization.md +32 -0
- package/skills/backend/databaseArchitecture/references/normalizationTheory.md +61 -0
- package/skills/backend/databaseArchitecture/references/scalabilitySharding.md +37 -0
- package/skills/backend/databaseArchitecture/references/transactionConcurrency.md +39 -0
- package/skills/backend/databaseArchitecture/scripts/analyzeMigration.py +99 -0
- package/skills/backend/databaseArchitecture/scripts/auditDatabaseSchema.py +177 -0
- package/skills/backend/databaseArchitecture/scripts/inspectDatabaseIndexes.py +149 -0
- package/skills/backend/databaseArchitecture/templates/adrTemplate.md +32 -0
- package/skills/backend/databaseArchitecture/templates/databaseChecklist.md +29 -0
- package/skills/backend/databaseArchitecture/templates/migrationPlan.md +40 -0
- package/skills/backend/durableBackgroundJobs/SKILL.md +112 -0
- package/skills/backend/durableBackgroundJobs/evals/durableJobVerification.json +14 -0
- package/skills/backend/durableBackgroundJobs/references/apiReference.md +3 -0
- package/skills/backend/durableBackgroundJobs/references/durableStepPatterns.md +6 -0
- package/skills/backend/durableBackgroundJobs/references/idempotencyKeys.md +5 -0
- package/skills/backend/durableBackgroundJobs/scripts/testWorkflowDispatch.py +24 -0
- package/skills/backend/golangStandard/SKILL.md +155 -0
- package/skills/backend/golangStandard/evals/goVerification.json +14 -0
- package/skills/backend/golangStandard/references/apiReference.md +3 -0
- package/skills/backend/golangStandard/references/layoutGuide.md +26 -0
- package/skills/backend/golangStandard/references/slogPatterns.md +26 -0
- package/skills/backend/golangStandard/scripts/scaffoldGoModule.py +105 -0
- package/skills/backend/pythonStandard/SKILL.md +138 -0
- package/skills/backend/pythonStandard/evals/pythonVerification.json +14 -0
- package/skills/backend/pythonStandard/references/apiReference.md +3 -0
- package/skills/backend/pythonStandard/references/pydanticPatterns.md +16 -0
- package/skills/backend/pythonStandard/references/pyprojectSpecs.md +37 -0
- package/skills/backend/pythonStandard/scripts/scaffoldUvProject.py +79 -0
- package/skills/backend/upstash/SKILL.md +98 -0
- package/skills/backend/upstash/evals/upstashVerification.json +14 -0
- package/skills/backend/upstash/references/apiReference.md +3 -0
- package/skills/backend/upstash/references/qstashFlowControl.md +34 -0
- package/skills/backend/upstash/references/ratelimitPatterns.md +53 -0
- package/skills/backend/upstash/references/workflowPatterns.md +35 -0
- package/skills/backend/upstash/scripts/testRedisConnection.py +36 -0
- package/skills/cicdDevops/cicdPipeline/SKILL.md +148 -0
- package/skills/cicdDevops/cicdPipeline/evals/evalCicd.py +37 -0
- package/skills/cicdDevops/cicdPipeline/references/apiReference.md +3 -0
- package/skills/cicdDevops/cicdPipeline/references/cicdDeploymentPatterns.md +27 -0
- package/skills/cicdDevops/cicdPipeline/scripts/auditDockerfileSecurity.py +56 -0
- package/skills/dataAi/mcpServerDevelopment/SKILL.md +123 -0
- package/skills/dataAi/mcpServerDevelopment/evals/mcpVerification.json +14 -0
- package/skills/dataAi/mcpServerDevelopment/references/apiReference.md +3 -0
- package/skills/dataAi/mcpServerDevelopment/references/mcpClientConfigs.md +38 -0
- package/skills/dataAi/mcpServerDevelopment/references/toolSchemaDesign.md +6 -0
- package/skills/dataAi/mcpServerDevelopment/scripts/runFastMcpBoilerplate.py +36 -0
- package/skills/dataAi/ragPipelineProduction/SKILL.md +113 -0
- package/skills/dataAi/ragPipelineProduction/evals/ragVerification.json +14 -0
- package/skills/dataAi/ragPipelineProduction/references/apiReference.md +3 -0
- package/skills/dataAi/ragPipelineProduction/references/chunkingStrategies.md +10 -0
- package/skills/dataAi/ragPipelineProduction/references/rrfAlgorithm.md +13 -0
- package/skills/dataAi/ragPipelineProduction/scripts/runHybridRrfSearch.py +33 -0
- package/skills/devopsCloud/cloudflare/SKILL.md +282 -0
- package/skills/devopsCloud/cloudflare/assets/README.md +48 -0
- package/skills/devopsCloud/cloudflare/assets/ai/agents-sdk.md +118 -0
- package/skills/devopsCloud/cloudflare/assets/ai/ai-gateway.md +105 -0
- package/skills/devopsCloud/cloudflare/assets/ai/ai-search.md +129 -0
- package/skills/devopsCloud/cloudflare/assets/ai/workers-ai.md +127 -0
- package/skills/devopsCloud/cloudflare/assets/cli/c3.md +292 -0
- package/skills/devopsCloud/cloudflare/assets/cli/cf-cli.md +90 -0
- package/skills/devopsCloud/cloudflare/assets/cli/wrangler.md +43 -0
- package/skills/devopsCloud/cloudflare/assets/compute/cron-triggers.md +486 -0
- package/skills/devopsCloud/cloudflare/assets/compute/service-bindings.md +251 -0
- package/skills/devopsCloud/cloudflare/assets/compute/smart-placement.md +435 -0
- package/skills/devopsCloud/cloudflare/assets/compute/static-assets.md +220 -0
- package/skills/devopsCloud/cloudflare/assets/compute/workers.md +129 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/d1.md +105 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/durable-objects.md +122 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/hyperdrive.md +210 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/kv.md +198 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/queues.md +105 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/r2.md +105 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/vectorize.md +97 -0
- package/skills/devopsCloud/cloudflare/assets/database-storage/workflows.md +141 -0
- package/skills/devopsCloud/cloudflare/assets/llms.txt +143 -0
- package/skills/devopsCloud/cloudflare/assets/networking-security/cache-cdn.md +109 -0
- package/skills/devopsCloud/cloudflare/assets/networking-security/dns.md +71 -0
- package/skills/devopsCloud/cloudflare/assets/networking-security/rate-limiting.md +130 -0
- package/skills/devopsCloud/cloudflare/assets/networking-security/tunnels.md +57 -0
- package/skills/devopsCloud/cloudflare/assets/networking-security/waf.md +143 -0
- package/skills/devopsCloud/cloudflare/assets/troubleshooting/1xxx-errors.md +209 -0
- package/skills/devopsCloud/cloudflare/assets/troubleshooting/5xx-errors.md +111 -0
- package/skills/devopsCloud/cloudflare/assets/troubleshooting/http-status-codes.md +38 -0
- package/skills/devopsCloud/cloudflare/evals/evals.json +75 -0
- package/skills/devopsCloud/cloudflare/references/ai-gateway/README.md +27 -0
- package/skills/devopsCloud/cloudflare/references/ai-gateway/configuration.md +18 -0
- package/skills/devopsCloud/cloudflare/references/ai-gateway/dynamic-routing.md +15 -0
- package/skills/devopsCloud/cloudflare/references/ai-gateway/features.md +22 -0
- package/skills/devopsCloud/cloudflare/references/ai-gateway/sdk-integration.md +19 -0
- package/skills/devopsCloud/cloudflare/references/ai-gateway/troubleshooting.md +16 -0
- package/skills/devopsCloud/cloudflare/references/ai-search/README.md +25 -0
- package/skills/devopsCloud/cloudflare/references/ai-search/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/ai-search/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/ai-search/gotchas.md +13 -0
- package/skills/devopsCloud/cloudflare/references/ai-search/patterns.md +15 -0
- package/skills/devopsCloud/cloudflare/references/bindings/README.md +16 -0
- package/skills/devopsCloud/cloudflare/references/bindings/api.md +19 -0
- package/skills/devopsCloud/cloudflare/references/bindings/configuration.md +20 -0
- package/skills/devopsCloud/cloudflare/references/bindings/gotchas.md +18 -0
- package/skills/devopsCloud/cloudflare/references/bindings/patterns.md +20 -0
- package/skills/devopsCloud/cloudflare/references/browser-rendering/README.md +18 -0
- package/skills/devopsCloud/cloudflare/references/browser-rendering/api.md +12 -0
- package/skills/devopsCloud/cloudflare/references/browser-rendering/configuration.md +12 -0
- package/skills/devopsCloud/cloudflare/references/browser-rendering/gotchas.md +15 -0
- package/skills/devopsCloud/cloudflare/references/browser-rendering/patterns.md +12 -0
- package/skills/devopsCloud/cloudflare/references/cliComparison.md +93 -0
- package/skills/devopsCloud/cloudflare/references/containers/README.md +23 -0
- package/skills/devopsCloud/cloudflare/references/containers/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/containers/configuration.md +15 -0
- package/skills/devopsCloud/cloudflare/references/containers/gotchas.md +16 -0
- package/skills/devopsCloud/cloudflare/references/containers/patterns.md +18 -0
- package/skills/devopsCloud/cloudflare/references/cron-triggers/README.md +20 -0
- package/skills/devopsCloud/cloudflare/references/cron-triggers/api.md +16 -0
- package/skills/devopsCloud/cloudflare/references/cron-triggers/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/cron-triggers/gotchas.md +17 -0
- package/skills/devopsCloud/cloudflare/references/cron-triggers/patterns.md +18 -0
- package/skills/devopsCloud/cloudflare/references/d1/README.md +15 -0
- package/skills/devopsCloud/cloudflare/references/d1/api.md +18 -0
- package/skills/devopsCloud/cloudflare/references/d1/configuration.md +18 -0
- package/skills/devopsCloud/cloudflare/references/d1/gotchas.md +18 -0
- package/skills/devopsCloud/cloudflare/references/d1/patterns.md +21 -0
- package/skills/devopsCloud/cloudflare/references/frameworkCompatibility.md +110 -0
- package/skills/devopsCloud/cloudflare/references/hyperdrive/README.md +28 -0
- package/skills/devopsCloud/cloudflare/references/hyperdrive/api.md +26 -0
- package/skills/devopsCloud/cloudflare/references/hyperdrive/configuration.md +34 -0
- package/skills/devopsCloud/cloudflare/references/hyperdrive/gotchas.md +20 -0
- package/skills/devopsCloud/cloudflare/references/hyperdrive/patterns.md +15 -0
- package/skills/devopsCloud/cloudflare/references/images/README.md +12 -0
- package/skills/devopsCloud/cloudflare/references/images/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/images/configuration.md +17 -0
- package/skills/devopsCloud/cloudflare/references/images/gotchas.md +16 -0
- package/skills/devopsCloud/cloudflare/references/images/patterns.md +16 -0
- package/skills/devopsCloud/cloudflare/references/kv/README.md +15 -0
- package/skills/devopsCloud/cloudflare/references/kv/api.md +18 -0
- package/skills/devopsCloud/cloudflare/references/kv/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/kv/gotchas.md +17 -0
- package/skills/devopsCloud/cloudflare/references/kv/patterns.md +21 -0
- package/skills/devopsCloud/cloudflare/references/miniflare/README.md +22 -0
- package/skills/devopsCloud/cloudflare/references/miniflare/api.md +16 -0
- package/skills/devopsCloud/cloudflare/references/miniflare/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/miniflare/gotchas.md +15 -0
- package/skills/devopsCloud/cloudflare/references/miniflare/patterns.md +19 -0
- package/skills/devopsCloud/cloudflare/references/observability/README.md +27 -0
- package/skills/devopsCloud/cloudflare/references/observability/api.md +20 -0
- package/skills/devopsCloud/cloudflare/references/observability/configuration.md +23 -0
- package/skills/devopsCloud/cloudflare/references/observability/gotchas.md +25 -0
- package/skills/devopsCloud/cloudflare/references/observability/patterns.md +14 -0
- package/skills/devopsCloud/cloudflare/references/pages/README.md +20 -0
- package/skills/devopsCloud/cloudflare/references/pages/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/pages/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/pages/gotchas.md +19 -0
- package/skills/devopsCloud/cloudflare/references/pages/patterns.md +15 -0
- package/skills/devopsCloud/cloudflare/references/pages-functions/README.md +20 -0
- package/skills/devopsCloud/cloudflare/references/pages-functions/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/pages-functions/configuration.md +14 -0
- package/skills/devopsCloud/cloudflare/references/pages-functions/gotchas.md +17 -0
- package/skills/devopsCloud/cloudflare/references/pages-functions/patterns.md +16 -0
- package/skills/devopsCloud/cloudflare/references/productSelectionMatrix.md +54 -0
- package/skills/devopsCloud/cloudflare/references/queues/README.md +24 -0
- package/skills/devopsCloud/cloudflare/references/queues/api.md +16 -0
- package/skills/devopsCloud/cloudflare/references/queues/configuration.md +20 -0
- package/skills/devopsCloud/cloudflare/references/queues/gotchas.md +18 -0
- package/skills/devopsCloud/cloudflare/references/queues/patterns.md +21 -0
- package/skills/devopsCloud/cloudflare/references/r2/README.md +26 -0
- package/skills/devopsCloud/cloudflare/references/r2/api.md +16 -0
- package/skills/devopsCloud/cloudflare/references/r2/configuration.md +19 -0
- package/skills/devopsCloud/cloudflare/references/r2/gotchas.md +17 -0
- package/skills/devopsCloud/cloudflare/references/r2/patterns.md +18 -0
- package/skills/devopsCloud/cloudflare/references/secrets-store/README.md +22 -0
- package/skills/devopsCloud/cloudflare/references/secrets-store/api.md +21 -0
- package/skills/devopsCloud/cloudflare/references/secrets-store/configuration.md +25 -0
- package/skills/devopsCloud/cloudflare/references/secrets-store/gotchas.md +19 -0
- package/skills/devopsCloud/cloudflare/references/secrets-store/patterns.md +27 -0
- package/skills/devopsCloud/cloudflare/references/skill-feedback.md +41 -0
- package/skills/devopsCloud/cloudflare/references/static-assets/README.md +21 -0
- package/skills/devopsCloud/cloudflare/references/static-assets/api.md +16 -0
- package/skills/devopsCloud/cloudflare/references/static-assets/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/static-assets/gotchas.md +18 -0
- package/skills/devopsCloud/cloudflare/references/static-assets/patterns.md +17 -0
- package/skills/devopsCloud/cloudflare/references/stream/README.md +22 -0
- package/skills/devopsCloud/cloudflare/references/stream/api-live.md +18 -0
- package/skills/devopsCloud/cloudflare/references/stream/api.md +21 -0
- package/skills/devopsCloud/cloudflare/references/stream/configuration.md +18 -0
- package/skills/devopsCloud/cloudflare/references/stream/gotchas.md +18 -0
- package/skills/devopsCloud/cloudflare/references/stream/patterns.md +22 -0
- package/skills/devopsCloud/cloudflare/references/tail-workers/README.md +21 -0
- package/skills/devopsCloud/cloudflare/references/tail-workers/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/tail-workers/configuration.md +15 -0
- package/skills/devopsCloud/cloudflare/references/tail-workers/gotchas.md +16 -0
- package/skills/devopsCloud/cloudflare/references/tail-workers/patterns.md +15 -0
- package/skills/devopsCloud/cloudflare/references/tunnel/README.md +20 -0
- package/skills/devopsCloud/cloudflare/references/tunnel/api.md +14 -0
- package/skills/devopsCloud/cloudflare/references/tunnel/configuration.md +14 -0
- package/skills/devopsCloud/cloudflare/references/tunnel/gotchas.md +15 -0
- package/skills/devopsCloud/cloudflare/references/tunnel/networking.md +14 -0
- package/skills/devopsCloud/cloudflare/references/tunnel/patterns.md +15 -0
- package/skills/devopsCloud/cloudflare/references/vectorize/README.md +22 -0
- package/skills/devopsCloud/cloudflare/references/vectorize/api.md +18 -0
- package/skills/devopsCloud/cloudflare/references/vectorize/configuration.md +19 -0
- package/skills/devopsCloud/cloudflare/references/vectorize/gotchas.md +15 -0
- package/skills/devopsCloud/cloudflare/references/vectorize/patterns.md +24 -0
- package/skills/devopsCloud/cloudflare/references/waf/README.md +21 -0
- package/skills/devopsCloud/cloudflare/references/waf/api.md +17 -0
- package/skills/devopsCloud/cloudflare/references/waf/configuration.md +18 -0
- package/skills/devopsCloud/cloudflare/references/waf/gotchas.md +19 -0
- package/skills/devopsCloud/cloudflare/references/waf/patterns.md +17 -0
- package/skills/devopsCloud/cloudflare/references/workers-ai/README.md +24 -0
- package/skills/devopsCloud/cloudflare/references/workers-ai/api.md +13 -0
- package/skills/devopsCloud/cloudflare/references/workers-ai/configuration.md +16 -0
- package/skills/devopsCloud/cloudflare/references/workers-ai/gotchas.md +15 -0
- package/skills/devopsCloud/cloudflare/references/workers-ai/patterns.md +14 -0
- package/skills/devopsCloud/cloudflare/references/workflows/README.md +23 -0
- package/skills/devopsCloud/cloudflare/references/workflows/api.md +17 -0
- package/skills/devopsCloud/cloudflare/references/workflows/configuration.md +18 -0
- package/skills/devopsCloud/cloudflare/references/workflows/gotchas.md +19 -0
- package/skills/devopsCloud/cloudflare/references/workflows/patterns.md +30 -0
- package/skills/devopsCloud/cloudflare/scripts/auditCloudflareProduction.py +95 -0
- package/skills/foundation/promptEvalTesting/SKILL.md +114 -0
- package/skills/foundation/promptEvalTesting/evals/promptEvalVerification.json +14 -0
- package/skills/foundation/promptEvalTesting/references/apiReference.md +3 -0
- package/skills/foundation/promptEvalTesting/references/evalMetricsCatalog.md +7 -0
- package/skills/foundation/promptEvalTesting/references/promptfooConfigSpecs.md +16 -0
- package/skills/foundation/promptEvalTesting/scripts/runPromptEvalSuite.py +29 -0
- package/skills/frontend/astro/SKILL.md +327 -0
- package/skills/frontend/astro/assets/README.md +71 -0
- package/skills/frontend/astro/assets/add-content-to-your-site/content-collections.md +1061 -0
- package/skills/frontend/astro/assets/add-content-to-your-site/data-fetching.md +109 -0
- package/skills/frontend/astro/assets/add-content-to-your-site/images.md +719 -0
- package/skills/frontend/astro/assets/add-content-to-your-site/markdown.md +725 -0
- package/skills/frontend/astro/assets/build-your-ui/components.md +402 -0
- package/skills/frontend/astro/assets/build-your-ui/fonts.md +437 -0
- package/skills/frontend/astro/assets/build-your-ui/front-end-frameworks.md +245 -0
- package/skills/frontend/astro/assets/build-your-ui/layouts.md +267 -0
- package/skills/frontend/astro/assets/build-your-ui/scripts-and-event-handling.md +229 -0
- package/skills/frontend/astro/assets/build-your-ui/styles-and-css.md +782 -0
- package/skills/frontend/astro/assets/build-your-ui/syntax-highlighting.md +269 -0
- package/skills/frontend/astro/assets/configuration/build-with-ai.md +389 -0
- package/skills/frontend/astro/assets/configuration/configuration-overview.md +122 -0
- package/skills/frontend/astro/assets/configuration/dev-toolbar.md +86 -0
- package/skills/frontend/astro/assets/configuration/editor-setup.md +166 -0
- package/skills/frontend/astro/assets/configuration/environment-variables.md +352 -0
- package/skills/frontend/astro/assets/configuration/typescript.md +379 -0
- package/skills/frontend/astro/assets/configuration/working-with-integrations.md +606 -0
- package/skills/frontend/astro/assets/reference/adapter-reference.md +1242 -0
- package/skills/frontend/astro/assets/reference/cli-reference.md +575 -0
- package/skills/frontend/astro/assets/reference/configuration-reference.md +3144 -0
- package/skills/frontend/astro/assets/reference/content-loader-reference.md +1682 -0
- package/skills/frontend/astro/assets/reference/directives-reference.md +324 -0
- package/skills/frontend/astro/assets/reference/image-service-reference.md +346 -0
- package/skills/frontend/astro/assets/reference/integrations-reference.md +2813 -0
- package/skills/frontend/astro/assets/reference/modules/astro-actions.md +604 -0
- package/skills/frontend/astro/assets/reference/modules/astro-app.md +460 -0
- package/skills/frontend/astro/assets/reference/modules/astro-assets.md +1657 -0
- package/skills/frontend/astro/assets/reference/modules/astro-config.md +395 -0
- package/skills/frontend/astro/assets/reference/modules/astro-content.md +720 -0
- package/skills/frontend/astro/assets/reference/modules/astro-env.md +46 -0
- package/skills/frontend/astro/assets/reference/modules/astro-fetch.md +346 -0
- package/skills/frontend/astro/assets/reference/modules/astro-hono.md +37 -0
- package/skills/frontend/astro/assets/reference/modules/astro-i18n.md +462 -0
- package/skills/frontend/astro/assets/reference/modules/astro-middleware.md +292 -0
- package/skills/frontend/astro/assets/reference/modules/astro-static-paths.md +74 -0
- package/skills/frontend/astro/assets/reference/modules/astro-transitions.md +595 -0
- package/skills/frontend/astro/assets/reference/modules/astro-zod.md +120 -0
- package/skills/frontend/astro/assets/reference/session-driver-reference.md +205 -0
- package/skills/frontend/astro/assets/routing-and-navigation/endpoints.md +251 -0
- package/skills/frontend/astro/assets/routing-and-navigation/internationalization.md +374 -0
- package/skills/frontend/astro/assets/routing-and-navigation/middleware.md +288 -0
- package/skills/frontend/astro/assets/routing-and-navigation/pages.md +205 -0
- package/skills/frontend/astro/assets/routing-and-navigation/prefetch.md +273 -0
- package/skills/frontend/astro/assets/routing-and-navigation/routing.md +760 -0
- package/skills/frontend/astro/assets/routing-and-navigation/view-transitions.md +792 -0
- package/skills/frontend/astro/assets/server-rendering/actions.md +770 -0
- package/skills/frontend/astro/assets/server-rendering/caching.md +255 -0
- package/skills/frontend/astro/assets/server-rendering/on-demand-rendering.md +289 -0
- package/skills/frontend/astro/assets/server-rendering/server-islands.md +126 -0
- package/skills/frontend/astro/assets/server-rendering/sessions.md +270 -0
- package/skills/frontend/astro/assets/start-a-new-project/develop-and-build.md +147 -0
- package/skills/frontend/astro/assets/start-a-new-project/installation.md +342 -0
- package/skills/frontend/astro/assets/start-a-new-project/project-structure.md +137 -0
- package/skills/frontend/astro/assets/upgrade-and-troubleshooting/testing.md +412 -0
- package/skills/frontend/astro/assets/upgrade-and-troubleshooting/troubleshooting.md +229 -0
- package/skills/frontend/astro/assets/upgrade-and-troubleshooting/upgrade-astro.md +205 -0
- package/skills/frontend/astro/assets/welcome/courses.md +46 -0
- package/skills/frontend/astro/assets/welcome/islands-architecture.md +135 -0
- package/skills/frontend/astro/assets/welcome/why-astro.md +90 -0
- package/skills/frontend/astro/evals/evals.json +66 -0
- package/skills/frontend/astro/references/contentCollections.md +164 -0
- package/skills/frontend/astro/references/islandsArchitecture.md +128 -0
- package/skills/frontend/astro/references/serverIslandsAndActions.md +187 -0
- package/skills/frontend/astro/scripts/auditAstroProduction.py +78 -0
- package/skills/frontend/generativeUi/SKILL.md +128 -0
- package/skills/frontend/generativeUi/evals/generativeUiVerification.json +14 -0
- package/skills/frontend/generativeUi/references/apiReference.md +3 -0
- package/skills/frontend/generativeUi/references/clientToolComponentMapping.md +8 -0
- package/skills/frontend/generativeUi/references/dataStreamProtocol.md +10 -0
- package/skills/frontend/generativeUi/scripts/generateUiComponentStub.py +46 -0
- package/skills/frontend/nextjs/SKILL.md +138 -0
- package/skills/frontend/nextjs/assets/README.md +67 -0
- package/skills/frontend/nextjs/assets/api-reference/cli/create-next-app.md +210 -0
- package/skills/frontend/nextjs/assets/api-reference/cli/next.md +484 -0
- package/skills/frontend/nextjs/assets/api-reference/components/font.md +952 -0
- package/skills/frontend/nextjs/assets/api-reference/components/form.md +387 -0
- package/skills/frontend/nextjs/assets/api-reference/components/image.md +1372 -0
- package/skills/frontend/nextjs/assets/api-reference/components/link.md +954 -0
- package/skills/frontend/nextjs/assets/api-reference/components/script.md +421 -0
- package/skills/frontend/nextjs/assets/api-reference/directives/use-cache-private.md +211 -0
- package/skills/frontend/nextjs/assets/api-reference/directives/use-cache-remote.md +652 -0
- package/skills/frontend/nextjs/assets/api-reference/directives/use-cache.md +848 -0
- package/skills/frontend/nextjs/assets/api-reference/directives/use-client.md +149 -0
- package/skills/frontend/nextjs/assets/api-reference/directives/use-server.md +234 -0
- package/skills/frontend/nextjs/assets/api-reference/edge-runtime.md +188 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/default.md +80 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/dynamic-routes.md +417 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/error.md +361 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/forbidden.md +75 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/instrumentation-client.md +308 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/instrumentation.md +177 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/intercepting-routes.md +78 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/layout.md +803 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/loading.md +209 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/mdx-components.md +84 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/app-icons.md +302 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/manifest.md +90 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/opengraph-image.md +580 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/robots.md +234 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/metadata/sitemap.md +459 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/not-found.md +278 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/page.md +283 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/parallel-routes.md +517 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/proxy.md +857 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/public-folder.md +47 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-groups.md +40 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/dynamicParams.md +40 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/ensureStatic.md +195 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/instant.md +204 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/maxDuration.md +42 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/preferredRegion.md +55 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/prefetch.md +113 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route-segment-config/runtime.md +43 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/route.md +772 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/src-folder.md +42 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/template.md +174 -0
- package/skills/frontend/nextjs/assets/api-reference/file-conventions/unauthorized.md +143 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/after.md +332 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/cacheLife.md +642 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/cacheTag.md +272 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/catchError.md +267 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/connection.md +114 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/cookies.md +349 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/draft-mode.md +173 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/fetch.md +141 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/forbidden.md +327 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/generate-image-metadata.md +311 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/generate-metadata.md +1510 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/generate-sitemaps.md +102 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/generate-static-params.md +606 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/generate-viewport.md +347 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/headers.md +92 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/image-response.md +225 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/io.md +131 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/navigation.md +220 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/next-request.md +116 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/next-response.md +219 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/next-root-params.md +479 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/not-found.md +269 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/permanentRedirect.md +92 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/prefetch.md +202 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/redirect.md +255 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/refresh.md +91 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/revalidatePath.md +248 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/revalidateTag.md +175 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/unauthorized.md +389 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/unstable_cache.md +131 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/unstable_noStore.md +61 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/unstable_rethrow.md +79 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/updateTag.md +173 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-link-status.md +268 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-offline.md +222 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-params.md +102 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-pathname.md +189 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-report-web-vitals.md +175 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-router.md +214 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-search-params.md +416 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-selected-layout-segment.md +214 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-selected-layout-segments.md +116 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/use-server-inserted-html.md +145 -0
- package/skills/frontend/nextjs/assets/api-reference/functions/userAgent.md +95 -0
- package/skills/frontend/nextjs/assets/api-reference/turbopack.md +552 -0
- package/skills/frontend/nextjs/assets/architecture/accessibility.md +47 -0
- package/skills/frontend/nextjs/assets/architecture/fast-refresh.md +122 -0
- package/skills/frontend/nextjs/assets/architecture/nextjs-compiler.md +376 -0
- package/skills/frontend/nextjs/assets/architecture/supported-browsers.md +146 -0
- package/skills/frontend/nextjs/assets/community/contribution-guide.md +459 -0
- package/skills/frontend/nextjs/assets/community/rspack.md +25 -0
- package/skills/frontend/nextjs/assets/getting-started/caching.md +626 -0
- package/skills/frontend/nextjs/assets/getting-started/css.md +336 -0
- package/skills/frontend/nextjs/assets/getting-started/deploying.md +115 -0
- package/skills/frontend/nextjs/assets/getting-started/error-handling.md +485 -0
- package/skills/frontend/nextjs/assets/getting-started/fetching-data.md +743 -0
- package/skills/frontend/nextjs/assets/getting-started/fonts.md +232 -0
- package/skills/frontend/nextjs/assets/getting-started/images.md +272 -0
- package/skills/frontend/nextjs/assets/getting-started/installation.md +446 -0
- package/skills/frontend/nextjs/assets/getting-started/layouts-and-pages.md +386 -0
- package/skills/frontend/nextjs/assets/getting-started/linking-and-navigating.md +475 -0
- package/skills/frontend/nextjs/assets/getting-started/metadata-and-og-images.md +370 -0
- package/skills/frontend/nextjs/assets/getting-started/mutating-data.md +679 -0
- package/skills/frontend/nextjs/assets/getting-started/project-structure.md +290 -0
- package/skills/frontend/nextjs/assets/getting-started/proxy.md +107 -0
- package/skills/frontend/nextjs/assets/getting-started/revalidating.md +241 -0
- package/skills/frontend/nextjs/assets/getting-started/route-handlers.md +233 -0
- package/skills/frontend/nextjs/assets/getting-started/server-and-client-components.md +683 -0
- package/skills/frontend/nextjs/assets/getting-started/upgrading.md +137 -0
- package/skills/frontend/nextjs/assets/glossary.md +315 -0
- package/skills/frontend/nextjs/evals/nextjsVerification.json +14 -0
- package/skills/frontend/nextjs/references/apiReference.md +3 -0
- package/skills/frontend/nextjs/references/dataAccessLayer.md +39 -0
- package/skills/frontend/nextjs/references/nextjsFeatureMap.md +276 -0
- package/skills/frontend/nextjs/references/productionChecklist.md +49 -0
- package/skills/frontend/nextjs/references/securityHeadersCsp.md +44 -0
- package/skills/frontend/nextjs/scripts/auditProductionReadiness.py +85 -0
- package/skills/frontend/shadcn-ui/SKILL.md +102 -0
- package/skills/frontend/shadcn-ui/assets/README.md +82 -0
- package/skills/frontend/shadcn-ui/assets/advanced/javascript.md +44 -0
- package/skills/frontend/shadcn-ui/assets/advanced/monorepo.md +254 -0
- package/skills/frontend/shadcn-ui/assets/advanced/react-19.md +166 -0
- package/skills/frontend/shadcn-ui/assets/advanced/tailwind-v4.md +333 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/chain-of-thought.md +519 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/chat.md +581 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/checkpoint.md +243 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/confirmation.md +382 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/context.md +188 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/file-tree.md +248 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/index.md +307 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/inline-citation.md +219 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/message.md +298 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/model-selector.md +368 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/plan.md +398 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/prompt-input.md +403 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/queue.md +517 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/reasoning.md +349 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/sources.md +303 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/stack-trace.md +514 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/subagent.md +551 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/suggestion.md +246 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/task.md +380 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/terminal.md +463 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/test-results.md +641 -0
- package/skills/frontend/shadcn-ui/assets/ai-elements/tool.md +915 -0
- package/skills/frontend/shadcn-ui/assets/components/accordion.md +490 -0
- package/skills/frontend/shadcn-ui/assets/components/alert-dialog.md +520 -0
- package/skills/frontend/shadcn-ui/assets/components/alert.md +351 -0
- package/skills/frontend/shadcn-ui/assets/components/aspect-ratio.md +206 -0
- package/skills/frontend/shadcn-ui/assets/components/attachment.md +715 -0
- package/skills/frontend/shadcn-ui/assets/components/avatar.md +581 -0
- package/skills/frontend/shadcn-ui/assets/components/badge.md +276 -0
- package/skills/frontend/shadcn-ui/assets/components/breadcrumb.md +556 -0
- package/skills/frontend/shadcn-ui/assets/components/bubble.md +706 -0
- package/skills/frontend/shadcn-ui/assets/components/button-group.md +969 -0
- package/skills/frontend/shadcn-ui/assets/components/button.md +523 -0
- package/skills/frontend/shadcn-ui/assets/components/calendar.md +959 -0
- package/skills/frontend/shadcn-ui/assets/components/card.md +684 -0
- package/skills/frontend/shadcn-ui/assets/components/carousel.md +643 -0
- package/skills/frontend/shadcn-ui/assets/components/chart.md +1295 -0
- package/skills/frontend/shadcn-ui/assets/components/checkbox.md +553 -0
- package/skills/frontend/shadcn-ui/assets/components/code-block.md +2041 -0
- package/skills/frontend/shadcn-ui/assets/components/collapsible.md +504 -0
- package/skills/frontend/shadcn-ui/assets/components/combobox.md +1102 -0
- package/skills/frontend/shadcn-ui/assets/components/command.md +682 -0
- package/skills/frontend/shadcn-ui/assets/components/context-menu.md +949 -0
- package/skills/frontend/shadcn-ui/assets/components/data-table.md +1667 -0
- package/skills/frontend/shadcn-ui/assets/components/date-picker.md +698 -0
- package/skills/frontend/shadcn-ui/assets/components/dialog.md +454 -0
- package/skills/frontend/shadcn-ui/assets/components/direction.md +205 -0
- package/skills/frontend/shadcn-ui/assets/components/drawer.md +806 -0
- package/skills/frontend/shadcn-ui/assets/components/dropdown-menu.md +1315 -0
- package/skills/frontend/shadcn-ui/assets/components/empty.md +562 -0
- package/skills/frontend/shadcn-ui/assets/components/field.md +1321 -0
- package/skills/frontend/shadcn-ui/assets/components/hover-card.md +342 -0
- package/skills/frontend/shadcn-ui/assets/components/index.md +82 -0
- package/skills/frontend/shadcn-ui/assets/components/input-group.md +980 -0
- package/skills/frontend/shadcn-ui/assets/components/input-otp.md +551 -0
- package/skills/frontend/shadcn-ui/assets/components/input.md +555 -0
- package/skills/frontend/shadcn-ui/assets/components/item.md +937 -0
- package/skills/frontend/shadcn-ui/assets/components/kbd.md +290 -0
- package/skills/frontend/shadcn-ui/assets/components/label.md +327 -0
- package/skills/frontend/shadcn-ui/assets/components/marker.md +445 -0
- package/skills/frontend/shadcn-ui/assets/components/menubar.md +804 -0
- package/skills/frontend/shadcn-ui/assets/components/message-scroller.md +2770 -0
- package/skills/frontend/shadcn-ui/assets/components/message.md +618 -0
- package/skills/frontend/shadcn-ui/assets/components/native-select.md +321 -0
- package/skills/frontend/shadcn-ui/assets/components/navigation-menu.md +568 -0
- package/skills/frontend/shadcn-ui/assets/components/pagination.md +425 -0
- package/skills/frontend/shadcn-ui/assets/components/popover.md +402 -0
- package/skills/frontend/shadcn-ui/assets/components/progress.md +240 -0
- package/skills/frontend/shadcn-ui/assets/components/questionnaire.md +2055 -0
- package/skills/frontend/shadcn-ui/assets/components/radio-group.md +440 -0
- package/skills/frontend/shadcn-ui/assets/components/resizable.md +302 -0
- package/skills/frontend/shadcn-ui/assets/components/scroll-area.md +226 -0
- package/skills/frontend/shadcn-ui/assets/components/select.md +647 -0
- package/skills/frontend/shadcn-ui/assets/components/separator.md +235 -0
- package/skills/frontend/shadcn-ui/assets/components/sheet.md +354 -0
- package/skills/frontend/shadcn-ui/assets/components/sidebar.md +1156 -0
- package/skills/frontend/shadcn-ui/assets/components/skeleton.md +217 -0
- package/skills/frontend/shadcn-ui/assets/components/slider.md +253 -0
- package/skills/frontend/shadcn-ui/assets/components/spinner.md +352 -0
- package/skills/frontend/shadcn-ui/assets/components/switch.md +296 -0
- package/skills/frontend/shadcn-ui/assets/components/table.md +572 -0
- package/skills/frontend/shadcn-ui/assets/components/tabs.md +425 -0
- package/skills/frontend/shadcn-ui/assets/components/textarea.md +218 -0
- package/skills/frontend/shadcn-ui/assets/components/toast.md +260 -0
- package/skills/frontend/shadcn-ui/assets/components/toggle-group.md +419 -0
- package/skills/frontend/shadcn-ui/assets/components/toggle.md +220 -0
- package/skills/frontend/shadcn-ui/assets/components/tooltip.md +332 -0
- package/skills/frontend/shadcn-ui/assets/components/trace.md +1890 -0
- package/skills/frontend/shadcn-ui/assets/components/typography.md +561 -0
- package/skills/frontend/shadcn-ui/assets/dark-mode/next.md +108 -0
- package/skills/frontend/shadcn-ui/assets/dark-mode/overview.md +75 -0
- package/skills/frontend/shadcn-ui/assets/dark-mode/vite.md +144 -0
- package/skills/frontend/shadcn-ui/assets/forms/next.md +716 -0
- package/skills/frontend/shadcn-ui/assets/forms/overview.md +60 -0
- package/skills/frontend/shadcn-ui/assets/forms/react-hook-form.md +2055 -0
- package/skills/frontend/shadcn-ui/assets/forms/tanstack-form.md +2236 -0
- package/skills/frontend/shadcn-ui/assets/installation/astro.md +252 -0
- package/skills/frontend/shadcn-ui/assets/installation/manual.md +255 -0
- package/skills/frontend/shadcn-ui/assets/installation/next.md +256 -0
- package/skills/frontend/shadcn-ui/assets/installation/react-router.md +226 -0
- package/skills/frontend/shadcn-ui/assets/installation/remix.md +52 -0
- package/skills/frontend/shadcn-ui/assets/installation/vite.md +314 -0
- package/skills/frontend/shadcn-ui/assets/mcp/mcp.md +338 -0
- package/skills/frontend/shadcn-ui/assets/overview/changelog.md +6 -0
- package/skills/frontend/shadcn-ui/assets/overview/cli.md +738 -0
- package/skills/frontend/shadcn-ui/assets/overview/components-json.md +379 -0
- package/skills/frontend/shadcn-ui/assets/overview/directory.md +74 -0
- package/skills/frontend/shadcn-ui/assets/overview/introduction.md +77 -0
- package/skills/frontend/shadcn-ui/assets/overview/skills.md +71 -0
- package/skills/frontend/shadcn-ui/assets/overview/theming.md +304 -0
- package/skills/frontend/shadcn-ui/assets/overview/typeset.md +242 -0
- package/skills/frontend/shadcn-ui/assets/registry/getting-started.md +648 -0
- package/skills/frontend/shadcn-ui/assets/registry/overview.md +90 -0
- package/skills/frontend/shadcn-ui/assets/registry/registry-item-json.md +483 -0
- package/skills/frontend/shadcn-ui/assets/registry/registry-json.md +178 -0
- package/skills/frontend/shadcn-ui/evals/componentVerification.json +19 -0
- package/skills/frontend/shadcn-ui/references/aiComponentsCatalog.md +51 -0
- package/skills/frontend/shadcn-ui/references/apiReference.md +3 -0
- package/skills/frontend/shadcn-ui/references/blocksCatalog.md +32 -0
- package/skills/frontend/shadcn-ui/references/cliCommands.md +47 -0
- package/skills/frontend/shadcn-ui/references/componentMarkdownSources.md +48 -0
- package/skills/frontend/shadcn-ui/scripts/fetchComponentDocs.py +43 -0
- package/skills/frontend/tsxReactStandard/SKILL.md +150 -0
- package/skills/frontend/tsxReactStandard/evals/tsxVerification.json +14 -0
- package/skills/frontend/tsxReactStandard/references/apiReference.md +3 -0
- package/skills/frontend/tsxReactStandard/references/discriminatedUnions.md +31 -0
- package/skills/frontend/tsxReactStandard/references/tsconfigStrict.md +36 -0
- package/skills/frontend/tsxReactStandard/scripts/validateTsxTypes.py +44 -0
- package/skills/gitVersionControl/gitWorkflow/SKILL.md +128 -0
- package/skills/gitVersionControl/gitWorkflow/assets/README.md +23 -0
- package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-environment.md +87 -0
- package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-formatting.md +156 -0
- package/skills/gitVersionControl/gitWorkflow/assets/cli/gh-reference.md +2363 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/about-git.md +156 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/about-remote-repositories.md +65 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/associating-text-editors-with-git.md +93 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/caching-your-github-credentials.md +115 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/getting-changes-from-a-remote-repository.md +76 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/ignoring-files.md +51 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/managing-remote-repositories.md +231 -0
- package/skills/gitVersionControl/gitWorkflow/assets/using-git/pushing-commits-to-a-remote-repository.md +119 -0
- package/skills/gitVersionControl/gitWorkflow/evals/evalGitWorkflow.py +43 -0
- package/skills/gitVersionControl/gitWorkflow/references/apiReference.md +3 -0
- package/skills/gitVersionControl/gitWorkflow/references/branchingModels.md +32 -0
- package/skills/gitVersionControl/gitWorkflow/scripts/diagnoseGitGraph.py +68 -0
- package/skills/github/assets/README.md +39 -0
- package/skills/github/assets/cli/gh-environment.md +87 -0
- package/skills/github/assets/cli/gh-formatting.md +156 -0
- package/skills/github/assets/cli/gh-reference.md +2363 -0
- package/skills/github/assets/docs-api/github-docs-api.md +60 -0
- package/skills/github/assets/rest-api/actions-secrets.md +1272 -0
- package/skills/github/assets/rest-api/actions-variables.md +1247 -0
- package/skills/github/assets/rest-api/actions-workflow-runs.md +1697 -0
- package/skills/github/assets/rest-api/actions-workflows.md +348 -0
- package/skills/github/assets/rest-api/authenticating.md +174 -0
- package/skills/github/assets/rest-api/branches.md +727 -0
- package/skills/github/assets/rest-api/checks-runs.md +1013 -0
- package/skills/github/assets/rest-api/checks-suites.md +1142 -0
- package/skills/github/assets/rest-api/code-scanning.md +2957 -0
- package/skills/github/assets/rest-api/collaborators.md +547 -0
- package/skills/github/assets/rest-api/commits.md +957 -0
- package/skills/github/assets/rest-api/dependabot-alerts.md +895 -0
- package/skills/github/assets/rest-api/orgs.md +1172 -0
- package/skills/github/assets/rest-api/overview.md +875 -0
- package/skills/github/assets/rest-api/pull-reviews.md +722 -0
- package/skills/github/assets/rest-api/pulls.md +1605 -0
- package/skills/github/assets/rest-api/quickstart.md +344 -0
- package/skills/github/assets/rest-api/releases.md +650 -0
- package/skills/github/assets/rest-api/repos.md +2957 -0
- package/skills/github/assets/rest-api/rules.md +1507 -0
- package/skills/github/assets/rest-api/secret-scanning.md +947 -0
- package/skills/github/assets/rest-api/teams.md +1690 -0
- package/skills/github/githubAction/SKILL.md +159 -0
- package/skills/github/githubAction/assets/README.md +38 -0
- package/skills/github/githubAction/assets/reference/contexts.md +918 -0
- package/skills/github/githubAction/assets/reference/dependency-caching.md +393 -0
- package/skills/github/githubAction/assets/reference/events-that-trigger-workflows.md +1348 -0
- package/skills/github/githubAction/assets/reference/expressions.md +441 -0
- package/skills/github/githubAction/assets/reference/metadata-syntax.md +803 -0
- package/skills/github/githubAction/assets/reference/variables.md +149 -0
- package/skills/github/githubAction/assets/reference/workflow-cancellation.md +22 -0
- package/skills/github/githubAction/assets/reference/workflow-commands.md +1056 -0
- package/skills/github/githubAction/assets/reference/workflow-syntax.md +1721 -0
- package/skills/github/githubAction/assets/rest-api/secrets.md +1272 -0
- package/skills/github/githubAction/assets/rest-api/workflow-runs.md +1697 -0
- package/skills/github/githubAction/assets/rest-api/workflows.md +348 -0
- package/skills/github/githubAction/assets/starter-workflows/automation/stale.yml +27 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/blank.yml +36 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/docker-image.yml +18 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/go.yml +28 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/maven.yml +35 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/node.js.yml +31 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/python-app.yml +39 -0
- package/skills/github/githubAction/assets/starter-workflows/ci/rust.yml +22 -0
- package/skills/github/githubAction/assets/starter-workflows/code-scanning/codeql.yml +97 -0
- package/skills/github/githubAction/evals/actionVerification.json +14 -0
- package/skills/github/githubAction/references/apiReference.md +3 -0
- package/skills/github/githubAction/references/workflowPatterns.md +81 -0
- package/skills/github/githubAction/scripts/validateWorkflowYaml.py +53 -0
- package/skills/github/githubQuality/SKILL.md +136 -0
- package/skills/github/githubQuality/assets/README.md +24 -0
- package/skills/github/githubQuality/assets/pull-requests/about-code-owners.md +178 -0
- package/skills/github/githubQuality/assets/pull-requests/about-merge-methods.md +48 -0
- package/skills/github/githubQuality/assets/pull-requests/creating-a-pull-request.md +170 -0
- package/skills/github/githubQuality/assets/pull-requests/giving-reviews.md +48 -0
- package/skills/github/githubQuality/assets/pull-requests/managing-a-merge-queue.md +134 -0
- package/skills/github/githubQuality/assets/pull-requests/merging-a-pull-request.md +101 -0
- package/skills/github/githubQuality/assets/pull-requests/resolving-reviews.md +59 -0
- package/skills/github/githubQuality/assets/pull-requests/status-checks.md +135 -0
- package/skills/github/githubQuality/assets/rest-api/checks-runs.md +1013 -0
- package/skills/github/githubQuality/assets/rest-api/checks-suites.md +1142 -0
- package/skills/github/githubQuality/assets/rest-api/commits.md +957 -0
- package/skills/github/githubQuality/assets/rest-api/pulls.md +1605 -0
- package/skills/github/githubQuality/assets/rest-api/reviews.md +722 -0
- package/skills/github/githubQuality/evals/qualityVerification.json +14 -0
- package/skills/github/githubQuality/references/apiReference.md +3 -0
- package/skills/github/githubQuality/references/codeownersExample.md +26 -0
- package/skills/github/githubQuality/references/prTemplate.md +20 -0
- package/skills/github/githubQuality/scripts/auditPrQuality.py +52 -0
- package/skills/github/githubSecurity/SKILL.md +170 -0
- package/skills/github/githubSecurity/assets/README.md +32 -0
- package/skills/github/githubSecurity/assets/code-scanning/code-scanning-alerts.md +133 -0
- package/skills/github/githubSecurity/assets/code-scanning/code-scanning.md +67 -0
- package/skills/github/githubSecurity/assets/code-scanning/codeql-code-scanning.md +79 -0
- package/skills/github/githubSecurity/assets/code-scanning/configure-code-scanning.md +121 -0
- package/skills/github/githubSecurity/assets/dependabot/about-the-dependabot-yml-file.md +74 -0
- package/skills/github/githubSecurity/assets/dependabot/dependabot-alerts.md +133 -0
- package/skills/github/githubSecurity/assets/dependabot/dependabot-security-updates.md +95 -0
- package/skills/github/githubSecurity/assets/dependabot/dependabot-version-updates.md +80 -0
- package/skills/github/githubSecurity/assets/rest-api/code-scanning.md +2957 -0
- package/skills/github/githubSecurity/assets/rest-api/dependabot-alerts.md +895 -0
- package/skills/github/githubSecurity/assets/rest-api/secret-scanning.md +947 -0
- package/skills/github/githubSecurity/assets/secret-scanning/enable-secret-scanning.md +59 -0
- package/skills/github/githubSecurity/assets/secret-scanning/secret-scanning.md +105 -0
- package/skills/github/githubSecurity/assets/security-advisories/github-advisory-database.md +148 -0
- package/skills/github/githubSecurity/evals/securityVerification.json +14 -0
- package/skills/github/githubSecurity/references/apiReference.md +3 -0
- package/skills/github/githubSecurity/references/codeqlAnalysis.yml +42 -0
- package/skills/github/githubSecurity/references/dependabotConfig.yml +27 -0
- package/skills/github/githubSecurity/scripts/auditRepoSecurity.py +47 -0
- package/skills/github/githubSetup/SKILL.md +137 -0
- package/skills/github/githubSetup/assets/README.md +40 -0
- package/skills/github/githubSetup/assets/branches/about-protected-branches.md +198 -0
- package/skills/github/githubSetup/assets/branches/changing-the-default-branch.md +49 -0
- package/skills/github/githubSetup/assets/branches/deleting-and-restoring-branches.md +44 -0
- package/skills/github/githubSetup/assets/branches/managing-a-branch-protection-rule.md +115 -0
- package/skills/github/githubSetup/assets/branches/renaming-a-branch.md +74 -0
- package/skills/github/githubSetup/assets/branches/viewing-branches-in-your-repository.md +30 -0
- package/skills/github/githubSetup/assets/repositories/about-repositories.md +127 -0
- package/skills/github/githubSetup/assets/repositories/cloning-a-repository.md +114 -0
- package/skills/github/githubSetup/assets/repositories/creating-a-new-repository.md +82 -0
- package/skills/github/githubSetup/assets/repositories/creating-a-repository-from-a-template.md +51 -0
- package/skills/github/githubSetup/assets/repositories/deleting-a-repository.md +34 -0
- package/skills/github/githubSetup/assets/repositories/managing-teams-and-people-with-access.md +69 -0
- package/skills/github/githubSetup/assets/repositories/renaming-a-repository.md +47 -0
- package/skills/github/githubSetup/assets/repositories/restoring-a-deleted-repository.md +61 -0
- package/skills/github/githubSetup/assets/repositories/setting-repository-visibility.md +137 -0
- package/skills/github/githubSetup/assets/rest-api/branches.md +727 -0
- package/skills/github/githubSetup/assets/rest-api/quickstart.md +344 -0
- package/skills/github/githubSetup/assets/rest-api/repos.md +2957 -0
- package/skills/github/githubSetup/assets/rulesets/about-rulesets.md +72 -0
- package/skills/github/githubSetup/assets/rulesets/available-rules-for-rulesets.md +383 -0
- package/skills/github/githubSetup/assets/rulesets/converting-branch-protections-to-rulesets.md +92 -0
- package/skills/github/githubSetup/assets/rulesets/creating-rulesets-for-a-repository.md +108 -0
- package/skills/github/githubSetup/assets/rulesets/managing-rulesets-for-a-repository.md +149 -0
- package/skills/github/githubSetup/assets/rulesets/troubleshooting-rules.md +122 -0
- package/skills/github/githubSetup/evals/setupVerification.json +14 -0
- package/skills/github/githubSetup/references/apiReference.md +3 -0
- package/skills/github/githubSetup/references/repoSettingsBlueprint.md +13 -0
- package/skills/github/githubSetup/references/rulesetTemplates.json +42 -0
- package/skills/github/githubSetup/scripts/configureRepoBaseline.py +46 -0
- package/skills/github/githubTeam/SKILL.md +115 -0
- package/skills/github/githubTeam/assets/README.md +21 -0
- package/skills/github/githubTeam/assets/organizations/about-organizations.md +69 -0
- package/skills/github/githubTeam/assets/organizations/repository-roles-for-an-organization.md +94 -0
- package/skills/github/githubTeam/assets/rest-api/collaborators.md +547 -0
- package/skills/github/githubTeam/assets/rest-api/orgs.md +1172 -0
- package/skills/github/githubTeam/assets/rest-api/teams.md +1690 -0
- package/skills/github/githubTeam/assets/teams/about-teams.md +82 -0
- package/skills/github/githubTeam/assets/teams/adding-members-to-a-team.md +55 -0
- package/skills/github/githubTeam/evals/teamVerification.json +14 -0
- package/skills/github/githubTeam/references/apiReference.md +3 -0
- package/skills/github/githubTeam/references/permissionMatrix.md +17 -0
- package/skills/github/githubTeam/references/reviewAssignment.md +17 -0
- package/skills/github/githubTeam/scripts/manageTeamSync.py +31 -0
- package/skills/securityQa/llmSecurityRedteaming/SKILL.md +86 -0
- package/skills/securityQa/llmSecurityRedteaming/evals/securityRedteamVerification.json +14 -0
- package/skills/securityQa/llmSecurityRedteaming/references/apiReference.md +3 -0
- package/skills/securityQa/llmSecurityRedteaming/references/jailbreakTaxonomy.md +6 -0
- package/skills/securityQa/llmSecurityRedteaming/references/owaspLlmTopTen.md +12 -0
- package/skills/securityQa/llmSecurityRedteaming/scripts/testPromptInjection.py +34 -0
- package/skills/softwareDevelopment/requirementsEngineering/SKILL.md +110 -0
- package/skills/softwareDevelopment/requirementsEngineering/evals/evalRequirements.py +33 -0
- package/skills/softwareDevelopment/requirementsEngineering/references/apiReference.md +3 -0
- package/skills/softwareDevelopment/requirementsEngineering/references/requirementsAnalysisModels.md +34 -0
- package/skills/softwareDevelopment/requirementsEngineering/scripts/validateUserStories.py +49 -0
- package/skills/testing/testDrivenDevelopment/SKILL.md +122 -0
- package/skills/testing/testDrivenDevelopment/evals/evalTdd.py +25 -0
- package/skills/testing/testDrivenDevelopment/references/apiReference.md +3 -0
- package/skills/testing/testDrivenDevelopment/references/testPyramidDoubles.md +35 -0
- package/skills/testing/testDrivenDevelopment/scripts/auditTestPyramid.py +58 -0
|
@@ -0,0 +1,2055 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Questionnaire
|
|
3
|
+
description: A multi-step questionnaire with single-choice, multiple-choice, freeform, and skippable questions.
|
|
4
|
+
base: base
|
|
5
|
+
component: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
"use client"
|
|
10
|
+
|
|
11
|
+
import * as React from "react"
|
|
12
|
+
import { toast } from "sonner"
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
Questionnaire,
|
|
16
|
+
QuestionnaireActions,
|
|
17
|
+
QuestionnaireChoice,
|
|
18
|
+
QuestionnaireChoices,
|
|
19
|
+
QuestionnaireDescription,
|
|
20
|
+
QuestionnaireError,
|
|
21
|
+
QuestionnaireInput,
|
|
22
|
+
QuestionnaireItem,
|
|
23
|
+
QuestionnaireNext,
|
|
24
|
+
QuestionnairePrevious,
|
|
25
|
+
QuestionnaireProgress,
|
|
26
|
+
QuestionnaireSkip,
|
|
27
|
+
QuestionnaireSubmit,
|
|
28
|
+
QuestionnaireTitle,
|
|
29
|
+
} from "@/components/ui/questionnaire"
|
|
30
|
+
|
|
31
|
+
const questionnaireItems = [
|
|
32
|
+
{
|
|
33
|
+
choices: [
|
|
34
|
+
{
|
|
35
|
+
description: "Show what the agent ran and what came back.",
|
|
36
|
+
label: "Tool call timeline",
|
|
37
|
+
value: "tool-calls",
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
description: "Ask before sensitive or destructive actions.",
|
|
41
|
+
label: "Approval checkpoints",
|
|
42
|
+
value: "approvals",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
description: "Make delegated work and results easier to follow.",
|
|
46
|
+
label: "Sub-agent handoffs",
|
|
47
|
+
value: "handoffs",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
description: "Choose a direction or describe another task.",
|
|
51
|
+
input: {
|
|
52
|
+
label: "Another agent feature",
|
|
53
|
+
placeholder: "Describe another feature…",
|
|
54
|
+
},
|
|
55
|
+
name: "direction",
|
|
56
|
+
required: true,
|
|
57
|
+
title: "What should the agent build next?",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
choices: [
|
|
61
|
+
{ label: "Progress", value: "progress" },
|
|
62
|
+
{ label: "Decisions", value: "decisions" },
|
|
63
|
+
{ label: "Risks", value: "risks" },
|
|
64
|
+
{ label: "Next step", value: "next-step" },
|
|
65
|
+
],
|
|
66
|
+
description: "Select all that apply, or skip this question.",
|
|
67
|
+
multiple: true,
|
|
68
|
+
name: "signals",
|
|
69
|
+
required: false,
|
|
70
|
+
title: "What should every progress update include?",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
choices: [
|
|
74
|
+
{ label: "Start now", value: "now" },
|
|
75
|
+
{ label: "Next development cycle", value: "next-cycle" },
|
|
76
|
+
{ label: "Add it to the backlog", value: "backlog" },
|
|
77
|
+
],
|
|
78
|
+
description: "Choose when the agent should begin the work.",
|
|
79
|
+
name: "timing",
|
|
80
|
+
required: true,
|
|
81
|
+
title: "When should work begin?",
|
|
82
|
+
},
|
|
83
|
+
] as const
|
|
84
|
+
|
|
85
|
+
export function QuestionnaireDemo() {
|
|
86
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
87
|
+
event.preventDefault()
|
|
88
|
+
|
|
89
|
+
const formData = new FormData(event.currentTarget)
|
|
90
|
+
const answers = {
|
|
91
|
+
direction: formData.get("direction"),
|
|
92
|
+
signals: formData.getAll("signals"),
|
|
93
|
+
timing: formData.get("timing"),
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
toast("Agent plan saved", {
|
|
97
|
+
description: `Direction: ${answers.direction ?? "None"} · Progress signals: ${answers.signals.join(", ") || "None"} · Timing: ${answers.timing ?? "None"}`,
|
|
98
|
+
})
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return (
|
|
102
|
+
<Questionnaire
|
|
103
|
+
className="mx-auto max-w-md"
|
|
104
|
+
defaultItem="direction"
|
|
105
|
+
items={questionnaireItems}
|
|
106
|
+
shortcuts="letters"
|
|
107
|
+
onSubmit={handleSubmit}
|
|
108
|
+
>
|
|
109
|
+
<QuestionnaireProgress />
|
|
110
|
+
{questionnaireItems.map((question) => (
|
|
111
|
+
<QuestionnaireItem
|
|
112
|
+
key={question.name}
|
|
113
|
+
multiple={"multiple" in question && question.multiple}
|
|
114
|
+
name={question.name}
|
|
115
|
+
required={question.required}
|
|
116
|
+
>
|
|
117
|
+
<QuestionnaireTitle>{question.title}</QuestionnaireTitle>
|
|
118
|
+
<QuestionnaireDescription>
|
|
119
|
+
{question.description}
|
|
120
|
+
</QuestionnaireDescription>
|
|
121
|
+
<QuestionnaireChoices>
|
|
122
|
+
{question.choices.map((choice) => (
|
|
123
|
+
<QuestionnaireChoice key={choice.value} value={choice.value}>
|
|
124
|
+
<span className="font-medium">{choice.label}</span>
|
|
125
|
+
{"description" in choice ? (
|
|
126
|
+
<span className="text-muted-foreground">
|
|
127
|
+
{choice.description}
|
|
128
|
+
</span>
|
|
129
|
+
) : null}
|
|
130
|
+
</QuestionnaireChoice>
|
|
131
|
+
))}
|
|
132
|
+
{"input" in question ? (
|
|
133
|
+
<QuestionnaireInput
|
|
134
|
+
aria-label={question.input.label}
|
|
135
|
+
placeholder={question.input.placeholder}
|
|
136
|
+
/>
|
|
137
|
+
) : null}
|
|
138
|
+
</QuestionnaireChoices>
|
|
139
|
+
<QuestionnaireError />
|
|
140
|
+
</QuestionnaireItem>
|
|
141
|
+
))}
|
|
142
|
+
<QuestionnaireActions>
|
|
143
|
+
<QuestionnairePrevious />
|
|
144
|
+
<QuestionnaireSkip />
|
|
145
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
146
|
+
<QuestionnaireSubmit>Save plan</QuestionnaireSubmit>
|
|
147
|
+
</QuestionnaireActions>
|
|
148
|
+
</Questionnaire>
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Installation
|
|
155
|
+
|
|
156
|
+
<CodeTabs>
|
|
157
|
+
|
|
158
|
+
<TabsList>
|
|
159
|
+
<TabsTrigger value="cli">Command</TabsTrigger>
|
|
160
|
+
<TabsTrigger value="manual">Manual</TabsTrigger>
|
|
161
|
+
</TabsList>
|
|
162
|
+
<TabsContent value="cli">
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
npx shadcn@latest add questionnaire
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
</TabsContent>
|
|
169
|
+
|
|
170
|
+
<TabsContent value="manual">
|
|
171
|
+
|
|
172
|
+
<Steps className="mb-0 pt-2">
|
|
173
|
+
|
|
174
|
+
<Step>Install the following dependency:</Step>
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm install @shadcn/react
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
<Step>Copy and paste the following code into your project.</Step>
|
|
181
|
+
|
|
182
|
+
<ComponentSource
|
|
183
|
+
name="questionnaire"
|
|
184
|
+
title="components/ui/questionnaire.tsx"
|
|
185
|
+
styleName="base-nova"
|
|
186
|
+
/>
|
|
187
|
+
|
|
188
|
+
<Step>Update the import paths to match your project setup.</Step>
|
|
189
|
+
|
|
190
|
+
</Steps>
|
|
191
|
+
|
|
192
|
+
</TabsContent>
|
|
193
|
+
|
|
194
|
+
</CodeTabs>
|
|
195
|
+
|
|
196
|
+
## Usage
|
|
197
|
+
|
|
198
|
+
```tsx
|
|
199
|
+
import {
|
|
200
|
+
Questionnaire,
|
|
201
|
+
QuestionnaireActions,
|
|
202
|
+
QuestionnaireChoice,
|
|
203
|
+
QuestionnaireChoices,
|
|
204
|
+
QuestionnaireDescription,
|
|
205
|
+
QuestionnaireError,
|
|
206
|
+
QuestionnaireInput,
|
|
207
|
+
QuestionnaireItem,
|
|
208
|
+
QuestionnaireNext,
|
|
209
|
+
QuestionnairePrevious,
|
|
210
|
+
QuestionnaireProgress,
|
|
211
|
+
QuestionnaireSkip,
|
|
212
|
+
QuestionnaireSubmit,
|
|
213
|
+
QuestionnaireTitle,
|
|
214
|
+
} from "@/components/ui/questionnaire"
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
```tsx
|
|
218
|
+
const items = [
|
|
219
|
+
{
|
|
220
|
+
name: "direction",
|
|
221
|
+
required: true,
|
|
222
|
+
prompt: "What should we prototype next?",
|
|
223
|
+
description: "Choose a direction or write your own.",
|
|
224
|
+
choices: [
|
|
225
|
+
{
|
|
226
|
+
value: "delegation",
|
|
227
|
+
label: "Delegation",
|
|
228
|
+
description: "Show how work moves to a specialist.",
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
value: "questions",
|
|
232
|
+
label: "Question prompts",
|
|
233
|
+
description: "Show choices while the interface waits.",
|
|
234
|
+
},
|
|
235
|
+
{ value: "both", label: "Both together" },
|
|
236
|
+
],
|
|
237
|
+
input: { label: "Another answer", placeholder: "Type another answer…" },
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "detail",
|
|
241
|
+
required: false,
|
|
242
|
+
prompt: "How much detail should it include?",
|
|
243
|
+
description: "Skip this if you are not sure yet.",
|
|
244
|
+
choices: [
|
|
245
|
+
{ value: "focused", label: "Focused" },
|
|
246
|
+
{ value: "complete", label: "Complete flow" },
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
] as const
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Define the collection once: pass it to `Questionnaire` for server-rendered
|
|
253
|
+
progress, actions, and shortcuts, then map it into the parts.
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
<Questionnaire items={items} onSubmit={handleSubmit}>
|
|
257
|
+
<QuestionnaireProgress />
|
|
258
|
+
{items.map((question) => (
|
|
259
|
+
<QuestionnaireItem
|
|
260
|
+
key={question.name}
|
|
261
|
+
name={question.name}
|
|
262
|
+
required={question.required}
|
|
263
|
+
>
|
|
264
|
+
<QuestionnaireTitle>{question.prompt}</QuestionnaireTitle>
|
|
265
|
+
<QuestionnaireDescription>
|
|
266
|
+
{question.description}
|
|
267
|
+
</QuestionnaireDescription>
|
|
268
|
+
<QuestionnaireChoices>
|
|
269
|
+
{question.choices.map((choice) => (
|
|
270
|
+
<QuestionnaireChoice key={choice.value} value={choice.value}>
|
|
271
|
+
<span className="font-medium">{choice.label}</span>
|
|
272
|
+
{"description" in choice ? (
|
|
273
|
+
<span className="text-muted-foreground">
|
|
274
|
+
{choice.description}
|
|
275
|
+
</span>
|
|
276
|
+
) : null}
|
|
277
|
+
</QuestionnaireChoice>
|
|
278
|
+
))}
|
|
279
|
+
{"input" in question ? (
|
|
280
|
+
<QuestionnaireInput
|
|
281
|
+
aria-label={question.input.label}
|
|
282
|
+
placeholder={question.input.placeholder}
|
|
283
|
+
/>
|
|
284
|
+
) : null}
|
|
285
|
+
</QuestionnaireChoices>
|
|
286
|
+
<QuestionnaireError />
|
|
287
|
+
</QuestionnaireItem>
|
|
288
|
+
))}
|
|
289
|
+
<QuestionnaireActions>
|
|
290
|
+
<QuestionnairePrevious />
|
|
291
|
+
<QuestionnaireSkip />
|
|
292
|
+
<QuestionnaireNext />
|
|
293
|
+
<QuestionnaireSubmit />
|
|
294
|
+
</QuestionnaireActions>
|
|
295
|
+
</Questionnaire>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
```tsx
|
|
299
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
300
|
+
event.preventDefault()
|
|
301
|
+
const answers = new FormData(event.currentTarget)
|
|
302
|
+
// answers.get("direction"), answers.getAll(...) for multiple items.
|
|
303
|
+
}
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
## Composition
|
|
307
|
+
|
|
308
|
+
```text
|
|
309
|
+
Questionnaire
|
|
310
|
+
├── QuestionnaireProgress
|
|
311
|
+
├── QuestionnaireItem
|
|
312
|
+
│ ├── QuestionnaireTitle
|
|
313
|
+
│ ├── QuestionnaireDescription
|
|
314
|
+
│ ├── QuestionnaireChoices
|
|
315
|
+
│ │ ├── QuestionnaireChoice
|
|
316
|
+
│ │ └── QuestionnaireInput
|
|
317
|
+
│ └── QuestionnaireError
|
|
318
|
+
└── QuestionnaireActions
|
|
319
|
+
├── QuestionnairePrevious
|
|
320
|
+
├── QuestionnaireSkip
|
|
321
|
+
├── QuestionnaireNext
|
|
322
|
+
└── QuestionnaireSubmit
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
Questionnaire owns the ordered items, active item, answer state, validation,
|
|
326
|
+
progress, and navigation. The containing page, card, dialog, or drawer owns
|
|
327
|
+
close and cancellation behavior, persistence, transport, and branching.
|
|
328
|
+
|
|
329
|
+
## Server Rendering
|
|
330
|
+
|
|
331
|
+
Pass `items` to server-render the active item, progress, actions, and answer
|
|
332
|
+
shortcuts. See the
|
|
333
|
+
[headless Questionnaire](/docs/react/questionnaire) for the complete behavior.
|
|
334
|
+
|
|
335
|
+
## Multiple Selection
|
|
336
|
+
|
|
337
|
+
Use `multiple` for an item that accepts more than one fixed answer.
|
|
338
|
+
|
|
339
|
+
```tsx
|
|
340
|
+
"use client"
|
|
341
|
+
|
|
342
|
+
import * as React from "react"
|
|
343
|
+
import { toast } from "sonner"
|
|
344
|
+
|
|
345
|
+
import {
|
|
346
|
+
Questionnaire,
|
|
347
|
+
QuestionnaireActions,
|
|
348
|
+
QuestionnaireChoice,
|
|
349
|
+
QuestionnaireChoices,
|
|
350
|
+
QuestionnaireDescription,
|
|
351
|
+
QuestionnaireError,
|
|
352
|
+
QuestionnaireItem,
|
|
353
|
+
QuestionnaireSubmit,
|
|
354
|
+
QuestionnaireTitle,
|
|
355
|
+
} from "@/components/ui/questionnaire"
|
|
356
|
+
|
|
357
|
+
const items = [
|
|
358
|
+
{
|
|
359
|
+
choices: [
|
|
360
|
+
{ value: "source" },
|
|
361
|
+
{ value: "tests" },
|
|
362
|
+
{ value: "docs" },
|
|
363
|
+
{ value: "history" },
|
|
364
|
+
],
|
|
365
|
+
name: "context",
|
|
366
|
+
required: true,
|
|
367
|
+
},
|
|
368
|
+
] as const
|
|
369
|
+
|
|
370
|
+
export function QuestionnaireMultiple() {
|
|
371
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
372
|
+
event.preventDefault()
|
|
373
|
+
|
|
374
|
+
const context = new FormData(event.currentTarget).getAll("context")
|
|
375
|
+
|
|
376
|
+
toast("Context selected", {
|
|
377
|
+
description: `Context: ${context.join(", ") || "None"}`,
|
|
378
|
+
})
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return (
|
|
382
|
+
<Questionnaire
|
|
383
|
+
className="mx-auto max-w-md"
|
|
384
|
+
items={items}
|
|
385
|
+
shortcuts="letters"
|
|
386
|
+
onSubmit={handleSubmit}
|
|
387
|
+
>
|
|
388
|
+
<QuestionnaireItem name="context" multiple required>
|
|
389
|
+
<QuestionnaireTitle>
|
|
390
|
+
What context should the agent inspect?
|
|
391
|
+
</QuestionnaireTitle>
|
|
392
|
+
<QuestionnaireDescription>
|
|
393
|
+
Select every source that may affect the implementation.
|
|
394
|
+
</QuestionnaireDescription>
|
|
395
|
+
<QuestionnaireChoices>
|
|
396
|
+
<QuestionnaireChoice value="source">
|
|
397
|
+
Relevant source files
|
|
398
|
+
</QuestionnaireChoice>
|
|
399
|
+
<QuestionnaireChoice value="tests">
|
|
400
|
+
Existing tests
|
|
401
|
+
</QuestionnaireChoice>
|
|
402
|
+
<QuestionnaireChoice value="docs">
|
|
403
|
+
Architecture documentation
|
|
404
|
+
</QuestionnaireChoice>
|
|
405
|
+
<QuestionnaireChoice value="history">
|
|
406
|
+
Recent commit history
|
|
407
|
+
</QuestionnaireChoice>
|
|
408
|
+
</QuestionnaireChoices>
|
|
409
|
+
<QuestionnaireError />
|
|
410
|
+
</QuestionnaireItem>
|
|
411
|
+
|
|
412
|
+
<QuestionnaireActions>
|
|
413
|
+
<QuestionnaireSubmit>Share context</QuestionnaireSubmit>
|
|
414
|
+
</QuestionnaireActions>
|
|
415
|
+
</Questionnaire>
|
|
416
|
+
)
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
## Freeform Answer
|
|
422
|
+
|
|
423
|
+
Compose `QuestionnaireInput` with fixed choices when the user can provide another answer.
|
|
424
|
+
|
|
425
|
+
```tsx
|
|
426
|
+
"use client"
|
|
427
|
+
|
|
428
|
+
import * as React from "react"
|
|
429
|
+
import { toast } from "sonner"
|
|
430
|
+
|
|
431
|
+
import {
|
|
432
|
+
Questionnaire,
|
|
433
|
+
QuestionnaireActions,
|
|
434
|
+
QuestionnaireChoice,
|
|
435
|
+
QuestionnaireChoices,
|
|
436
|
+
QuestionnaireDescription,
|
|
437
|
+
QuestionnaireError,
|
|
438
|
+
QuestionnaireInput,
|
|
439
|
+
QuestionnaireItem,
|
|
440
|
+
QuestionnaireSubmit,
|
|
441
|
+
QuestionnaireTitle,
|
|
442
|
+
} from "@/components/ui/questionnaire"
|
|
443
|
+
|
|
444
|
+
const items = [
|
|
445
|
+
{
|
|
446
|
+
choices: [
|
|
447
|
+
{ value: "incremental" },
|
|
448
|
+
{ value: "module" },
|
|
449
|
+
{ value: "rewrite" },
|
|
450
|
+
],
|
|
451
|
+
name: "approach",
|
|
452
|
+
required: true,
|
|
453
|
+
},
|
|
454
|
+
] as const
|
|
455
|
+
|
|
456
|
+
export function QuestionnaireFreeform() {
|
|
457
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
458
|
+
event.preventDefault()
|
|
459
|
+
|
|
460
|
+
const approach = new FormData(event.currentTarget).get("approach")
|
|
461
|
+
|
|
462
|
+
toast("Approach selected", {
|
|
463
|
+
description: `Approach: ${approach ?? "None"}`,
|
|
464
|
+
})
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return (
|
|
468
|
+
<Questionnaire
|
|
469
|
+
className="mx-auto max-w-md"
|
|
470
|
+
items={items}
|
|
471
|
+
shortcuts="letters"
|
|
472
|
+
onSubmit={handleSubmit}
|
|
473
|
+
>
|
|
474
|
+
<QuestionnaireItem name="approach" required>
|
|
475
|
+
<QuestionnaireTitle>
|
|
476
|
+
How should the agent approach this refactor?
|
|
477
|
+
</QuestionnaireTitle>
|
|
478
|
+
<QuestionnaireDescription>
|
|
479
|
+
Choose a strategy or write a more specific instruction.
|
|
480
|
+
</QuestionnaireDescription>
|
|
481
|
+
<QuestionnaireChoices>
|
|
482
|
+
<QuestionnaireChoice value="incremental">
|
|
483
|
+
Make the smallest safe change
|
|
484
|
+
</QuestionnaireChoice>
|
|
485
|
+
<QuestionnaireChoice value="module">
|
|
486
|
+
Refactor one module at a time
|
|
487
|
+
</QuestionnaireChoice>
|
|
488
|
+
<QuestionnaireChoice value="rewrite">
|
|
489
|
+
Replace the implementation completely
|
|
490
|
+
</QuestionnaireChoice>
|
|
491
|
+
<QuestionnaireInput
|
|
492
|
+
aria-label="Another refactoring approach"
|
|
493
|
+
placeholder="Describe another approach…"
|
|
494
|
+
/>
|
|
495
|
+
</QuestionnaireChoices>
|
|
496
|
+
<QuestionnaireError />
|
|
497
|
+
</QuestionnaireItem>
|
|
498
|
+
|
|
499
|
+
<QuestionnaireActions>
|
|
500
|
+
<QuestionnaireSubmit>Use this approach</QuestionnaireSubmit>
|
|
501
|
+
</QuestionnaireActions>
|
|
502
|
+
</Questionnaire>
|
|
503
|
+
)
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
## Explicit Skip
|
|
509
|
+
|
|
510
|
+
Add `QuestionnaireSkip` when an optional item may be intentionally left unanswered.
|
|
511
|
+
|
|
512
|
+
```tsx
|
|
513
|
+
"use client"
|
|
514
|
+
|
|
515
|
+
import * as React from "react"
|
|
516
|
+
import type { QuestionnaireItemStatus } from "@shadcn/react/questionnaire"
|
|
517
|
+
import { toast } from "sonner"
|
|
518
|
+
|
|
519
|
+
import {
|
|
520
|
+
Questionnaire,
|
|
521
|
+
QuestionnaireActions,
|
|
522
|
+
QuestionnaireChoice,
|
|
523
|
+
QuestionnaireChoices,
|
|
524
|
+
QuestionnaireDescription,
|
|
525
|
+
QuestionnaireError,
|
|
526
|
+
QuestionnaireInput,
|
|
527
|
+
QuestionnaireItem,
|
|
528
|
+
QuestionnaireNext,
|
|
529
|
+
QuestionnairePrevious,
|
|
530
|
+
QuestionnaireProgress,
|
|
531
|
+
QuestionnaireSkip,
|
|
532
|
+
QuestionnaireSubmit,
|
|
533
|
+
QuestionnaireTitle,
|
|
534
|
+
} from "@/components/ui/questionnaire"
|
|
535
|
+
|
|
536
|
+
const items = [
|
|
537
|
+
{ name: "task", required: true },
|
|
538
|
+
{ name: "constraints" },
|
|
539
|
+
{ name: "review", required: true },
|
|
540
|
+
] as const
|
|
541
|
+
|
|
542
|
+
export function QuestionnaireSkipExample() {
|
|
543
|
+
const [constraintStatus, setConstraintStatus] =
|
|
544
|
+
React.useState<QuestionnaireItemStatus>("unanswered")
|
|
545
|
+
|
|
546
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
547
|
+
event.preventDefault()
|
|
548
|
+
|
|
549
|
+
const formData = new FormData(event.currentTarget)
|
|
550
|
+
const answers = {
|
|
551
|
+
task: formData.get("task"),
|
|
552
|
+
constraints: formData.get("constraints"),
|
|
553
|
+
constraintStatus,
|
|
554
|
+
review: formData.get("review"),
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
toast("Agent brief submitted", {
|
|
558
|
+
description: `Task: ${answers.task ?? "None"} · Constraints: ${
|
|
559
|
+
answers.constraintStatus === "skipped"
|
|
560
|
+
? "Skipped"
|
|
561
|
+
: (answers.constraints ?? "None")
|
|
562
|
+
} · Review: ${answers.review ?? "None"}`,
|
|
563
|
+
})
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
return (
|
|
567
|
+
<Questionnaire
|
|
568
|
+
className="mx-auto max-w-md"
|
|
569
|
+
defaultItem="task"
|
|
570
|
+
items={items}
|
|
571
|
+
onSubmit={handleSubmit}
|
|
572
|
+
>
|
|
573
|
+
<QuestionnaireProgress />
|
|
574
|
+
|
|
575
|
+
<QuestionnaireItem name="task" required>
|
|
576
|
+
<QuestionnaireTitle>What kind of change is this?</QuestionnaireTitle>
|
|
577
|
+
<QuestionnaireDescription>
|
|
578
|
+
Choose the category that best describes the work.
|
|
579
|
+
</QuestionnaireDescription>
|
|
580
|
+
<QuestionnaireChoices>
|
|
581
|
+
<QuestionnaireChoice value="feature">New feature</QuestionnaireChoice>
|
|
582
|
+
<QuestionnaireChoice value="fix">Bug fix</QuestionnaireChoice>
|
|
583
|
+
<QuestionnaireChoice value="refactor">Refactor</QuestionnaireChoice>
|
|
584
|
+
</QuestionnaireChoices>
|
|
585
|
+
<QuestionnaireError />
|
|
586
|
+
</QuestionnaireItem>
|
|
587
|
+
|
|
588
|
+
<QuestionnaireItem
|
|
589
|
+
name="constraints"
|
|
590
|
+
onStatusChange={setConstraintStatus}
|
|
591
|
+
>
|
|
592
|
+
<QuestionnaireTitle>
|
|
593
|
+
Are there any implementation constraints?
|
|
594
|
+
</QuestionnaireTitle>
|
|
595
|
+
<QuestionnaireDescription>
|
|
596
|
+
Answer if needed, or intentionally skip this question.
|
|
597
|
+
</QuestionnaireDescription>
|
|
598
|
+
<QuestionnaireChoices>
|
|
599
|
+
<QuestionnaireChoice value="no-dependencies">
|
|
600
|
+
Do not add dependencies
|
|
601
|
+
</QuestionnaireChoice>
|
|
602
|
+
<QuestionnaireChoice value="no-migrations">
|
|
603
|
+
Do not change the database
|
|
604
|
+
</QuestionnaireChoice>
|
|
605
|
+
<QuestionnaireChoice value="preserve-api">
|
|
606
|
+
Preserve the public API
|
|
607
|
+
</QuestionnaireChoice>
|
|
608
|
+
<QuestionnaireInput
|
|
609
|
+
aria-label="Another implementation constraint"
|
|
610
|
+
placeholder="Describe another constraint…"
|
|
611
|
+
/>
|
|
612
|
+
</QuestionnaireChoices>
|
|
613
|
+
</QuestionnaireItem>
|
|
614
|
+
|
|
615
|
+
<QuestionnaireItem name="review" required>
|
|
616
|
+
<QuestionnaireTitle>
|
|
617
|
+
How should the work be reviewed?
|
|
618
|
+
</QuestionnaireTitle>
|
|
619
|
+
<QuestionnaireDescription>
|
|
620
|
+
Choose the checks the agent should complete before handoff.
|
|
621
|
+
</QuestionnaireDescription>
|
|
622
|
+
<QuestionnaireChoices>
|
|
623
|
+
<QuestionnaireChoice value="tests">
|
|
624
|
+
Run the test suite
|
|
625
|
+
</QuestionnaireChoice>
|
|
626
|
+
<QuestionnaireChoice value="diff">
|
|
627
|
+
Review the final diff
|
|
628
|
+
</QuestionnaireChoice>
|
|
629
|
+
<QuestionnaireChoice value="both">
|
|
630
|
+
Tests and diff review
|
|
631
|
+
</QuestionnaireChoice>
|
|
632
|
+
</QuestionnaireChoices>
|
|
633
|
+
<QuestionnaireError />
|
|
634
|
+
</QuestionnaireItem>
|
|
635
|
+
|
|
636
|
+
<QuestionnaireActions>
|
|
637
|
+
<QuestionnairePrevious />
|
|
638
|
+
<QuestionnaireSkip />
|
|
639
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
640
|
+
<QuestionnaireSubmit>Submit brief</QuestionnaireSubmit>
|
|
641
|
+
</QuestionnaireActions>
|
|
642
|
+
</Questionnaire>
|
|
643
|
+
)
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
## Shortcuts
|
|
649
|
+
|
|
650
|
+
Assign a letter or number key to each answer with `shortcuts`.
|
|
651
|
+
|
|
652
|
+
```tsx
|
|
653
|
+
"use client"
|
|
654
|
+
|
|
655
|
+
import * as React from "react"
|
|
656
|
+
import { toast } from "sonner"
|
|
657
|
+
|
|
658
|
+
import {
|
|
659
|
+
NativeSelect,
|
|
660
|
+
NativeSelectOption,
|
|
661
|
+
} from "@/components/ui/native-select"
|
|
662
|
+
import {
|
|
663
|
+
Questionnaire,
|
|
664
|
+
QuestionnaireActions,
|
|
665
|
+
QuestionnaireChoice,
|
|
666
|
+
QuestionnaireChoices,
|
|
667
|
+
QuestionnaireDescription,
|
|
668
|
+
QuestionnaireError,
|
|
669
|
+
QuestionnaireItem,
|
|
670
|
+
QuestionnaireSubmit,
|
|
671
|
+
QuestionnaireTitle,
|
|
672
|
+
} from "@/components/ui/questionnaire"
|
|
673
|
+
|
|
674
|
+
const items = [
|
|
675
|
+
{
|
|
676
|
+
choices: [{ value: "inspect" }, { value: "tests" }, { value: "patch" }],
|
|
677
|
+
name: "action",
|
|
678
|
+
required: true,
|
|
679
|
+
},
|
|
680
|
+
] as const
|
|
681
|
+
|
|
682
|
+
type ShortcutMode = React.ComponentProps<typeof Questionnaire>["shortcuts"]
|
|
683
|
+
|
|
684
|
+
export function QuestionnaireShortcuts() {
|
|
685
|
+
const [shortcuts, setShortcuts] = React.useState<ShortcutMode>("letters")
|
|
686
|
+
|
|
687
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
688
|
+
event.preventDefault()
|
|
689
|
+
|
|
690
|
+
const action = new FormData(event.currentTarget).get("action")
|
|
691
|
+
|
|
692
|
+
toast("Next action selected", {
|
|
693
|
+
description: `Action: ${action ?? "None"} · Shortcuts: ${shortcuts ?? "none"}`,
|
|
694
|
+
})
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
return (
|
|
698
|
+
<div className="relative mx-auto flex h-full w-full max-w-md flex-col">
|
|
699
|
+
<NativeSelect
|
|
700
|
+
aria-label="Shortcut style"
|
|
701
|
+
className="absolute end-0 top-0"
|
|
702
|
+
value={shortcuts ?? "none"}
|
|
703
|
+
onChange={(event) => {
|
|
704
|
+
const value = event.target.value
|
|
705
|
+
setShortcuts(
|
|
706
|
+
value === "letters" || value === "numbers" ? value : undefined
|
|
707
|
+
)
|
|
708
|
+
}}
|
|
709
|
+
>
|
|
710
|
+
<NativeSelectOption value="none">No shortcuts</NativeSelectOption>
|
|
711
|
+
<NativeSelectOption value="letters">Letters</NativeSelectOption>
|
|
712
|
+
<NativeSelectOption value="numbers">Numbers</NativeSelectOption>
|
|
713
|
+
</NativeSelect>
|
|
714
|
+
|
|
715
|
+
<Questionnaire
|
|
716
|
+
className="mt-auto"
|
|
717
|
+
items={items}
|
|
718
|
+
shortcuts={shortcuts}
|
|
719
|
+
onSubmit={handleSubmit}
|
|
720
|
+
>
|
|
721
|
+
<QuestionnaireItem name="action" required>
|
|
722
|
+
<QuestionnaireTitle>
|
|
723
|
+
What should the agent do next?
|
|
724
|
+
</QuestionnaireTitle>
|
|
725
|
+
<QuestionnaireDescription>
|
|
726
|
+
Use the displayed shortcut or navigate with the keyboard.
|
|
727
|
+
</QuestionnaireDescription>
|
|
728
|
+
<QuestionnaireChoices>
|
|
729
|
+
<QuestionnaireChoice value="inspect">
|
|
730
|
+
Inspect the implementation
|
|
731
|
+
</QuestionnaireChoice>
|
|
732
|
+
<QuestionnaireChoice value="tests">
|
|
733
|
+
Run the relevant tests
|
|
734
|
+
</QuestionnaireChoice>
|
|
735
|
+
<QuestionnaireChoice value="patch">
|
|
736
|
+
Prepare the patch
|
|
737
|
+
</QuestionnaireChoice>
|
|
738
|
+
</QuestionnaireChoices>
|
|
739
|
+
<QuestionnaireError />
|
|
740
|
+
</QuestionnaireItem>
|
|
741
|
+
|
|
742
|
+
<QuestionnaireActions>
|
|
743
|
+
<QuestionnaireSubmit>Confirm action</QuestionnaireSubmit>
|
|
744
|
+
</QuestionnaireActions>
|
|
745
|
+
</Questionnaire>
|
|
746
|
+
</div>
|
|
747
|
+
)
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
```
|
|
751
|
+
|
|
752
|
+
## Custom Validation
|
|
753
|
+
|
|
754
|
+
Combine controlled navigation with an external schema such as Zod to return to an invalid item and present its error.
|
|
755
|
+
|
|
756
|
+
```tsx
|
|
757
|
+
"use client"
|
|
758
|
+
|
|
759
|
+
import * as React from "react"
|
|
760
|
+
import { toast } from "sonner"
|
|
761
|
+
import { z } from "zod"
|
|
762
|
+
|
|
763
|
+
import {
|
|
764
|
+
Card,
|
|
765
|
+
CardAction,
|
|
766
|
+
CardContent,
|
|
767
|
+
CardFooter,
|
|
768
|
+
CardHeader,
|
|
769
|
+
} from "@/components/ui/card"
|
|
770
|
+
import {
|
|
771
|
+
Questionnaire,
|
|
772
|
+
QuestionnaireActions,
|
|
773
|
+
QuestionnaireChoice,
|
|
774
|
+
QuestionnaireChoices,
|
|
775
|
+
QuestionnaireDescription,
|
|
776
|
+
QuestionnaireError,
|
|
777
|
+
QuestionnaireItem,
|
|
778
|
+
QuestionnaireNext,
|
|
779
|
+
QuestionnairePrevious,
|
|
780
|
+
QuestionnaireProgress,
|
|
781
|
+
QuestionnaireSubmit,
|
|
782
|
+
QuestionnaireTitle,
|
|
783
|
+
} from "@/components/ui/questionnaire"
|
|
784
|
+
|
|
785
|
+
const items = [
|
|
786
|
+
{ name: "detail", required: true },
|
|
787
|
+
{ name: "audience", required: true },
|
|
788
|
+
] as const
|
|
789
|
+
|
|
790
|
+
const questionnaireSchema = z
|
|
791
|
+
.object({
|
|
792
|
+
detail: z.enum(["summary", "complete"]),
|
|
793
|
+
audience: z.enum(["team", "public"]),
|
|
794
|
+
})
|
|
795
|
+
.superRefine((answers, context) => {
|
|
796
|
+
if (answers.audience === "public" && answers.detail === "summary") {
|
|
797
|
+
context.addIssue({
|
|
798
|
+
code: z.ZodIssueCode.custom,
|
|
799
|
+
message:
|
|
800
|
+
"Public answers need enough context. Choose a complete answer.",
|
|
801
|
+
path: ["detail"],
|
|
802
|
+
})
|
|
803
|
+
}
|
|
804
|
+
})
|
|
805
|
+
|
|
806
|
+
type QuestionnaireItemName = keyof z.infer<typeof questionnaireSchema>
|
|
807
|
+
type QuestionnaireErrors = Partial<Record<QuestionnaireItemName, string>>
|
|
808
|
+
|
|
809
|
+
function ValidationProgress() {
|
|
810
|
+
return (
|
|
811
|
+
<QuestionnaireProgress
|
|
812
|
+
className="min-w-0"
|
|
813
|
+
render={(props, state) => (
|
|
814
|
+
<div {...props}>
|
|
815
|
+
{state.current} / {state.total}
|
|
816
|
+
</div>
|
|
817
|
+
)}
|
|
818
|
+
/>
|
|
819
|
+
)
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
export function QuestionnaireValidation() {
|
|
823
|
+
const [item, setItem] = React.useState("detail")
|
|
824
|
+
const [errors, setErrors] = React.useState<QuestionnaireErrors>({})
|
|
825
|
+
|
|
826
|
+
function clearError(name: QuestionnaireItemName) {
|
|
827
|
+
setErrors((currentErrors) => {
|
|
828
|
+
if (!currentErrors[name]) {
|
|
829
|
+
return currentErrors
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
const nextErrors = { ...currentErrors }
|
|
833
|
+
delete nextErrors[name]
|
|
834
|
+
return nextErrors
|
|
835
|
+
})
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
839
|
+
event.preventDefault()
|
|
840
|
+
|
|
841
|
+
const result = questionnaireSchema.safeParse(
|
|
842
|
+
Object.fromEntries(new FormData(event.currentTarget))
|
|
843
|
+
)
|
|
844
|
+
|
|
845
|
+
if (result.success) {
|
|
846
|
+
setErrors({})
|
|
847
|
+
toast("Agent response configured", {
|
|
848
|
+
description: `Detail: ${result.data.detail} · Audience: ${result.data.audience}`,
|
|
849
|
+
})
|
|
850
|
+
return
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
const nextErrors: QuestionnaireErrors = {}
|
|
854
|
+
|
|
855
|
+
for (const issue of result.error.issues) {
|
|
856
|
+
const name = issue.path[0]
|
|
857
|
+
|
|
858
|
+
if ((name === "detail" || name === "audience") && !nextErrors[name]) {
|
|
859
|
+
nextErrors[name] = issue.message
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
const firstInvalidItem = result.error.issues[0]?.path[0]
|
|
864
|
+
|
|
865
|
+
setErrors(nextErrors)
|
|
866
|
+
|
|
867
|
+
if (firstInvalidItem === "detail" || firstInvalidItem === "audience") {
|
|
868
|
+
setItem(firstInvalidItem)
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
return (
|
|
873
|
+
<Questionnaire
|
|
874
|
+
className="mx-auto max-w-md"
|
|
875
|
+
item={item}
|
|
876
|
+
items={items}
|
|
877
|
+
onItemChange={setItem}
|
|
878
|
+
onSubmit={handleSubmit}
|
|
879
|
+
>
|
|
880
|
+
<Card className="w-full">
|
|
881
|
+
<QuestionnaireItem
|
|
882
|
+
invalid={Boolean(errors.detail)}
|
|
883
|
+
name="detail"
|
|
884
|
+
required
|
|
885
|
+
>
|
|
886
|
+
<CardHeader>
|
|
887
|
+
<QuestionnaireTitle>
|
|
888
|
+
How much detail should the answer include?
|
|
889
|
+
</QuestionnaireTitle>
|
|
890
|
+
<QuestionnaireDescription>
|
|
891
|
+
Choose the response depth.
|
|
892
|
+
</QuestionnaireDescription>
|
|
893
|
+
<CardAction>
|
|
894
|
+
<ValidationProgress />
|
|
895
|
+
</CardAction>
|
|
896
|
+
</CardHeader>
|
|
897
|
+
<CardContent>
|
|
898
|
+
<QuestionnaireChoices>
|
|
899
|
+
<QuestionnaireChoice
|
|
900
|
+
value="summary"
|
|
901
|
+
onChange={() => clearError("detail")}
|
|
902
|
+
>
|
|
903
|
+
Concise summary
|
|
904
|
+
</QuestionnaireChoice>
|
|
905
|
+
<QuestionnaireChoice
|
|
906
|
+
value="complete"
|
|
907
|
+
onChange={() => clearError("detail")}
|
|
908
|
+
>
|
|
909
|
+
Complete answer
|
|
910
|
+
</QuestionnaireChoice>
|
|
911
|
+
</QuestionnaireChoices>
|
|
912
|
+
<QuestionnaireError>{errors.detail}</QuestionnaireError>
|
|
913
|
+
</CardContent>
|
|
914
|
+
</QuestionnaireItem>
|
|
915
|
+
|
|
916
|
+
<QuestionnaireItem
|
|
917
|
+
invalid={Boolean(errors.audience)}
|
|
918
|
+
name="audience"
|
|
919
|
+
required
|
|
920
|
+
>
|
|
921
|
+
<CardHeader>
|
|
922
|
+
<QuestionnaireTitle>Who will read the answer?</QuestionnaireTitle>
|
|
923
|
+
<QuestionnaireDescription>
|
|
924
|
+
Public answers require complete context.
|
|
925
|
+
</QuestionnaireDescription>
|
|
926
|
+
<CardAction>
|
|
927
|
+
<ValidationProgress />
|
|
928
|
+
</CardAction>
|
|
929
|
+
</CardHeader>
|
|
930
|
+
<CardContent>
|
|
931
|
+
<QuestionnaireChoices>
|
|
932
|
+
<QuestionnaireChoice
|
|
933
|
+
value="team"
|
|
934
|
+
onChange={() => clearError("audience")}
|
|
935
|
+
>
|
|
936
|
+
My team
|
|
937
|
+
</QuestionnaireChoice>
|
|
938
|
+
<QuestionnaireChoice
|
|
939
|
+
value="public"
|
|
940
|
+
onChange={() => clearError("audience")}
|
|
941
|
+
>
|
|
942
|
+
Public audience
|
|
943
|
+
</QuestionnaireChoice>
|
|
944
|
+
</QuestionnaireChoices>
|
|
945
|
+
<QuestionnaireError>{errors.audience}</QuestionnaireError>
|
|
946
|
+
</CardContent>
|
|
947
|
+
</QuestionnaireItem>
|
|
948
|
+
|
|
949
|
+
<CardFooter>
|
|
950
|
+
<QuestionnaireActions>
|
|
951
|
+
<QuestionnairePrevious />
|
|
952
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
953
|
+
<QuestionnaireSubmit>Validate answers</QuestionnaireSubmit>
|
|
954
|
+
</QuestionnaireActions>
|
|
955
|
+
</CardFooter>
|
|
956
|
+
</Card>
|
|
957
|
+
</Questionnaire>
|
|
958
|
+
)
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
```
|
|
962
|
+
|
|
963
|
+
## Controlled
|
|
964
|
+
|
|
965
|
+
Control the active item from host state, such as returning to an invalid step.
|
|
966
|
+
|
|
967
|
+
```tsx
|
|
968
|
+
"use client"
|
|
969
|
+
|
|
970
|
+
import * as React from "react"
|
|
971
|
+
import { toast } from "sonner"
|
|
972
|
+
|
|
973
|
+
import {
|
|
974
|
+
Questionnaire,
|
|
975
|
+
QuestionnaireActions,
|
|
976
|
+
QuestionnaireChoice,
|
|
977
|
+
QuestionnaireChoices,
|
|
978
|
+
QuestionnaireDescription,
|
|
979
|
+
QuestionnaireError,
|
|
980
|
+
QuestionnaireItem,
|
|
981
|
+
QuestionnaireNext,
|
|
982
|
+
QuestionnairePrevious,
|
|
983
|
+
QuestionnaireProgress,
|
|
984
|
+
QuestionnaireSubmit,
|
|
985
|
+
QuestionnaireTitle,
|
|
986
|
+
} from "@/components/ui/questionnaire"
|
|
987
|
+
|
|
988
|
+
const items = [
|
|
989
|
+
{ name: "scope", required: true },
|
|
990
|
+
{ name: "checks", required: true },
|
|
991
|
+
{ name: "output", required: true },
|
|
992
|
+
] as const
|
|
993
|
+
|
|
994
|
+
const itemLabels: Record<string, string> = {
|
|
995
|
+
scope: "Change scope",
|
|
996
|
+
checks: "Verification",
|
|
997
|
+
output: "Final output",
|
|
998
|
+
}
|
|
999
|
+
|
|
1000
|
+
export function QuestionnaireControlled() {
|
|
1001
|
+
const [item, setItem] = React.useState("scope")
|
|
1002
|
+
|
|
1003
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1004
|
+
event.preventDefault()
|
|
1005
|
+
|
|
1006
|
+
const formData = new FormData(event.currentTarget)
|
|
1007
|
+
|
|
1008
|
+
toast("Agent workflow configured", {
|
|
1009
|
+
description: `Scope: ${formData.get("scope") ?? "None"} · Verification: ${formData.get("checks") ?? "None"} · Output: ${formData.get("output") ?? "None"}`,
|
|
1010
|
+
})
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
return (
|
|
1014
|
+
<div className="relative mx-auto flex h-full w-full max-w-md flex-col">
|
|
1015
|
+
<p
|
|
1016
|
+
className="absolute end-0 top-0 text-sm text-muted-foreground"
|
|
1017
|
+
role="status"
|
|
1018
|
+
>
|
|
1019
|
+
Current checkpoint: {itemLabels[item]}
|
|
1020
|
+
</p>
|
|
1021
|
+
|
|
1022
|
+
<Questionnaire
|
|
1023
|
+
className="mt-auto"
|
|
1024
|
+
item={item}
|
|
1025
|
+
items={items}
|
|
1026
|
+
onItemChange={setItem}
|
|
1027
|
+
onSubmit={handleSubmit}
|
|
1028
|
+
>
|
|
1029
|
+
<QuestionnaireProgress />
|
|
1030
|
+
|
|
1031
|
+
<QuestionnaireItem name="scope" required>
|
|
1032
|
+
<QuestionnaireTitle>What may the agent change?</QuestionnaireTitle>
|
|
1033
|
+
<QuestionnaireDescription>
|
|
1034
|
+
The host stores the active checkpoint while Questionnaire navigates.
|
|
1035
|
+
</QuestionnaireDescription>
|
|
1036
|
+
<QuestionnaireChoices>
|
|
1037
|
+
<QuestionnaireChoice value="component">
|
|
1038
|
+
Only the target component
|
|
1039
|
+
</QuestionnaireChoice>
|
|
1040
|
+
<QuestionnaireChoice value="tests">
|
|
1041
|
+
Component and related tests
|
|
1042
|
+
</QuestionnaireChoice>
|
|
1043
|
+
<QuestionnaireChoice value="feature">
|
|
1044
|
+
The complete feature area
|
|
1045
|
+
</QuestionnaireChoice>
|
|
1046
|
+
</QuestionnaireChoices>
|
|
1047
|
+
<QuestionnaireError />
|
|
1048
|
+
</QuestionnaireItem>
|
|
1049
|
+
|
|
1050
|
+
<QuestionnaireItem name="checks" required>
|
|
1051
|
+
<QuestionnaireTitle>
|
|
1052
|
+
Which verification level should it use?
|
|
1053
|
+
</QuestionnaireTitle>
|
|
1054
|
+
<QuestionnaireChoices>
|
|
1055
|
+
<QuestionnaireChoice value="targeted">
|
|
1056
|
+
Targeted tests
|
|
1057
|
+
</QuestionnaireChoice>
|
|
1058
|
+
<QuestionnaireChoice value="package">
|
|
1059
|
+
Package tests and typecheck
|
|
1060
|
+
</QuestionnaireChoice>
|
|
1061
|
+
<QuestionnaireChoice value="full">
|
|
1062
|
+
Full workspace verification
|
|
1063
|
+
</QuestionnaireChoice>
|
|
1064
|
+
</QuestionnaireChoices>
|
|
1065
|
+
<QuestionnaireError />
|
|
1066
|
+
</QuestionnaireItem>
|
|
1067
|
+
|
|
1068
|
+
<QuestionnaireItem name="output" required>
|
|
1069
|
+
<QuestionnaireTitle>
|
|
1070
|
+
What should the agent return when finished?
|
|
1071
|
+
</QuestionnaireTitle>
|
|
1072
|
+
<QuestionnaireChoices>
|
|
1073
|
+
<QuestionnaireChoice value="summary">
|
|
1074
|
+
Concise summary
|
|
1075
|
+
</QuestionnaireChoice>
|
|
1076
|
+
<QuestionnaireChoice value="diff">
|
|
1077
|
+
Summary with changed files
|
|
1078
|
+
</QuestionnaireChoice>
|
|
1079
|
+
<QuestionnaireChoice value="handoff">
|
|
1080
|
+
Detailed implementation handoff
|
|
1081
|
+
</QuestionnaireChoice>
|
|
1082
|
+
</QuestionnaireChoices>
|
|
1083
|
+
<QuestionnaireError />
|
|
1084
|
+
</QuestionnaireItem>
|
|
1085
|
+
|
|
1086
|
+
<QuestionnaireActions>
|
|
1087
|
+
<QuestionnairePrevious />
|
|
1088
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
1089
|
+
<QuestionnaireSubmit>Save workflow</QuestionnaireSubmit>
|
|
1090
|
+
</QuestionnaireActions>
|
|
1091
|
+
</Questionnaire>
|
|
1092
|
+
</div>
|
|
1093
|
+
)
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
## Resume
|
|
1099
|
+
|
|
1100
|
+
Restore a saved active item and default answers, then reset changes back to that saved state.
|
|
1101
|
+
|
|
1102
|
+
```tsx
|
|
1103
|
+
"use client"
|
|
1104
|
+
|
|
1105
|
+
import * as React from "react"
|
|
1106
|
+
import { toast } from "sonner"
|
|
1107
|
+
|
|
1108
|
+
import { Button } from "@/components/ui/button"
|
|
1109
|
+
import {
|
|
1110
|
+
Questionnaire,
|
|
1111
|
+
QuestionnaireActions,
|
|
1112
|
+
QuestionnaireChoice,
|
|
1113
|
+
QuestionnaireChoices,
|
|
1114
|
+
QuestionnaireDescription,
|
|
1115
|
+
QuestionnaireError,
|
|
1116
|
+
QuestionnaireInput,
|
|
1117
|
+
QuestionnaireItem,
|
|
1118
|
+
QuestionnaireNext,
|
|
1119
|
+
QuestionnairePrevious,
|
|
1120
|
+
QuestionnaireProgress,
|
|
1121
|
+
QuestionnaireSubmit,
|
|
1122
|
+
QuestionnaireTitle,
|
|
1123
|
+
} from "@/components/ui/questionnaire"
|
|
1124
|
+
|
|
1125
|
+
const items = [
|
|
1126
|
+
{ name: "change", required: true },
|
|
1127
|
+
{ name: "verification", required: true },
|
|
1128
|
+
{ name: "notes" },
|
|
1129
|
+
] as const
|
|
1130
|
+
|
|
1131
|
+
export function QuestionnaireResume() {
|
|
1132
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1133
|
+
event.preventDefault()
|
|
1134
|
+
|
|
1135
|
+
const formData = new FormData(event.currentTarget)
|
|
1136
|
+
const answers = {
|
|
1137
|
+
change: formData.get("change"),
|
|
1138
|
+
verification: formData.getAll("verification"),
|
|
1139
|
+
notes: formData.get("notes"),
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
toast("Draft updated", {
|
|
1143
|
+
description: `Migration: ${answers.change ?? "None"} · Verification: ${answers.verification.join(", ") || "None"} · Notes: ${answers.notes || "None"}`,
|
|
1144
|
+
})
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
return (
|
|
1148
|
+
<Questionnaire
|
|
1149
|
+
className="mx-auto max-w-md"
|
|
1150
|
+
defaultItem="verification"
|
|
1151
|
+
items={items}
|
|
1152
|
+
onReset={() => toast("Saved answers restored")}
|
|
1153
|
+
onSubmit={handleSubmit}
|
|
1154
|
+
>
|
|
1155
|
+
<QuestionnaireProgress />
|
|
1156
|
+
|
|
1157
|
+
<QuestionnaireItem name="change" required>
|
|
1158
|
+
<QuestionnaireTitle>What kind of migration is this?</QuestionnaireTitle>
|
|
1159
|
+
<QuestionnaireDescription>
|
|
1160
|
+
This answer was saved during the previous session.
|
|
1161
|
+
</QuestionnaireDescription>
|
|
1162
|
+
<QuestionnaireChoices>
|
|
1163
|
+
<QuestionnaireChoice value="incremental" defaultChecked>
|
|
1164
|
+
Incremental migration
|
|
1165
|
+
</QuestionnaireChoice>
|
|
1166
|
+
<QuestionnaireChoice value="cutover">
|
|
1167
|
+
Single cutover
|
|
1168
|
+
</QuestionnaireChoice>
|
|
1169
|
+
</QuestionnaireChoices>
|
|
1170
|
+
<QuestionnaireError />
|
|
1171
|
+
</QuestionnaireItem>
|
|
1172
|
+
|
|
1173
|
+
<QuestionnaireItem name="verification" multiple required>
|
|
1174
|
+
<QuestionnaireTitle>
|
|
1175
|
+
How should the migration be verified?
|
|
1176
|
+
</QuestionnaireTitle>
|
|
1177
|
+
<QuestionnaireDescription>
|
|
1178
|
+
These checks were selected during the previous session.
|
|
1179
|
+
</QuestionnaireDescription>
|
|
1180
|
+
<QuestionnaireChoices>
|
|
1181
|
+
<QuestionnaireChoice value="tests" defaultChecked>
|
|
1182
|
+
Run migration tests
|
|
1183
|
+
</QuestionnaireChoice>
|
|
1184
|
+
<QuestionnaireChoice value="typecheck" defaultChecked>
|
|
1185
|
+
Run the typecheck
|
|
1186
|
+
</QuestionnaireChoice>
|
|
1187
|
+
<QuestionnaireChoice value="manual">
|
|
1188
|
+
Perform a manual smoke test
|
|
1189
|
+
</QuestionnaireChoice>
|
|
1190
|
+
</QuestionnaireChoices>
|
|
1191
|
+
<QuestionnaireError />
|
|
1192
|
+
</QuestionnaireItem>
|
|
1193
|
+
|
|
1194
|
+
<QuestionnaireItem name="notes">
|
|
1195
|
+
<QuestionnaireTitle>
|
|
1196
|
+
Anything else the agent should remember?
|
|
1197
|
+
</QuestionnaireTitle>
|
|
1198
|
+
<QuestionnaireDescription>
|
|
1199
|
+
This note was saved with the draft.
|
|
1200
|
+
</QuestionnaireDescription>
|
|
1201
|
+
<QuestionnaireInput
|
|
1202
|
+
aria-label="Saved migration note"
|
|
1203
|
+
defaultValue="Keep the existing public API stable."
|
|
1204
|
+
/>
|
|
1205
|
+
</QuestionnaireItem>
|
|
1206
|
+
|
|
1207
|
+
<QuestionnaireActions>
|
|
1208
|
+
<Button type="reset" variant="outline">
|
|
1209
|
+
Reset changes
|
|
1210
|
+
</Button>
|
|
1211
|
+
<QuestionnairePrevious />
|
|
1212
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
1213
|
+
<QuestionnaireSubmit>Update draft</QuestionnaireSubmit>
|
|
1214
|
+
</QuestionnaireActions>
|
|
1215
|
+
</Questionnaire>
|
|
1216
|
+
)
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
```
|
|
1220
|
+
|
|
1221
|
+
## Conditional Items
|
|
1222
|
+
|
|
1223
|
+
Disable items that do not apply to the user's earlier answers.
|
|
1224
|
+
|
|
1225
|
+
```tsx
|
|
1226
|
+
"use client"
|
|
1227
|
+
|
|
1228
|
+
import * as React from "react"
|
|
1229
|
+
import { toast } from "sonner"
|
|
1230
|
+
|
|
1231
|
+
import {
|
|
1232
|
+
Questionnaire,
|
|
1233
|
+
QuestionnaireActions,
|
|
1234
|
+
QuestionnaireChoice,
|
|
1235
|
+
QuestionnaireChoices,
|
|
1236
|
+
QuestionnaireDescription,
|
|
1237
|
+
QuestionnaireError,
|
|
1238
|
+
QuestionnaireItem,
|
|
1239
|
+
QuestionnaireNext,
|
|
1240
|
+
QuestionnairePrevious,
|
|
1241
|
+
QuestionnaireProgress,
|
|
1242
|
+
QuestionnaireSubmit,
|
|
1243
|
+
QuestionnaireTitle,
|
|
1244
|
+
} from "@/components/ui/questionnaire"
|
|
1245
|
+
|
|
1246
|
+
export function QuestionnaireConditional() {
|
|
1247
|
+
const [runtime, setRuntime] = React.useState("local")
|
|
1248
|
+
const items = React.useMemo(
|
|
1249
|
+
() => [
|
|
1250
|
+
{ name: "runtime", required: true },
|
|
1251
|
+
{
|
|
1252
|
+
disabled: runtime !== "cloud",
|
|
1253
|
+
name: "environment",
|
|
1254
|
+
required: true,
|
|
1255
|
+
},
|
|
1256
|
+
{ name: "approval", required: true },
|
|
1257
|
+
],
|
|
1258
|
+
[runtime]
|
|
1259
|
+
)
|
|
1260
|
+
|
|
1261
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1262
|
+
event.preventDefault()
|
|
1263
|
+
|
|
1264
|
+
const formData = new FormData(event.currentTarget)
|
|
1265
|
+
|
|
1266
|
+
toast("Execution plan saved", {
|
|
1267
|
+
description: `Runtime: ${formData.get("runtime") ?? "None"} · Environment: ${formData.get("environment") ?? "Not applicable"} · Approval: ${formData.get("approval") ?? "None"}`,
|
|
1268
|
+
})
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
return (
|
|
1272
|
+
<Questionnaire
|
|
1273
|
+
className="mx-auto max-w-md"
|
|
1274
|
+
defaultItem="runtime"
|
|
1275
|
+
items={items}
|
|
1276
|
+
onSubmit={handleSubmit}
|
|
1277
|
+
>
|
|
1278
|
+
<QuestionnaireProgress />
|
|
1279
|
+
|
|
1280
|
+
<QuestionnaireItem name="runtime" required>
|
|
1281
|
+
<QuestionnaireTitle>Where should the agent run?</QuestionnaireTitle>
|
|
1282
|
+
<QuestionnaireDescription>
|
|
1283
|
+
Cloud runs add an environment question to this flow.
|
|
1284
|
+
</QuestionnaireDescription>
|
|
1285
|
+
<QuestionnaireChoices>
|
|
1286
|
+
<QuestionnaireChoice
|
|
1287
|
+
checked={runtime === "local"}
|
|
1288
|
+
value="local"
|
|
1289
|
+
onChange={() => setRuntime("local")}
|
|
1290
|
+
>
|
|
1291
|
+
Local workspace
|
|
1292
|
+
</QuestionnaireChoice>
|
|
1293
|
+
<QuestionnaireChoice
|
|
1294
|
+
checked={runtime === "cloud"}
|
|
1295
|
+
value="cloud"
|
|
1296
|
+
onChange={() => setRuntime("cloud")}
|
|
1297
|
+
>
|
|
1298
|
+
Cloud workspace
|
|
1299
|
+
</QuestionnaireChoice>
|
|
1300
|
+
</QuestionnaireChoices>
|
|
1301
|
+
<QuestionnaireError />
|
|
1302
|
+
</QuestionnaireItem>
|
|
1303
|
+
|
|
1304
|
+
<QuestionnaireItem
|
|
1305
|
+
disabled={runtime !== "cloud"}
|
|
1306
|
+
name="environment"
|
|
1307
|
+
required
|
|
1308
|
+
>
|
|
1309
|
+
<QuestionnaireTitle>
|
|
1310
|
+
Which cloud environment should it use?
|
|
1311
|
+
</QuestionnaireTitle>
|
|
1312
|
+
<QuestionnaireChoices>
|
|
1313
|
+
<QuestionnaireChoice value="preview">Preview</QuestionnaireChoice>
|
|
1314
|
+
<QuestionnaireChoice value="staging">Staging</QuestionnaireChoice>
|
|
1315
|
+
<QuestionnaireChoice value="isolated">
|
|
1316
|
+
Isolated sandbox
|
|
1317
|
+
</QuestionnaireChoice>
|
|
1318
|
+
</QuestionnaireChoices>
|
|
1319
|
+
<QuestionnaireError />
|
|
1320
|
+
</QuestionnaireItem>
|
|
1321
|
+
|
|
1322
|
+
<QuestionnaireItem name="approval" required>
|
|
1323
|
+
<QuestionnaireTitle>
|
|
1324
|
+
When should the agent request approval?
|
|
1325
|
+
</QuestionnaireTitle>
|
|
1326
|
+
<QuestionnaireChoices>
|
|
1327
|
+
<QuestionnaireChoice value="writes">
|
|
1328
|
+
Before writing files
|
|
1329
|
+
</QuestionnaireChoice>
|
|
1330
|
+
<QuestionnaireChoice value="commands">
|
|
1331
|
+
Before running commands
|
|
1332
|
+
</QuestionnaireChoice>
|
|
1333
|
+
<QuestionnaireChoice value="sensitive">
|
|
1334
|
+
Only for sensitive actions
|
|
1335
|
+
</QuestionnaireChoice>
|
|
1336
|
+
</QuestionnaireChoices>
|
|
1337
|
+
<QuestionnaireError />
|
|
1338
|
+
</QuestionnaireItem>
|
|
1339
|
+
|
|
1340
|
+
<QuestionnaireActions>
|
|
1341
|
+
<QuestionnairePrevious />
|
|
1342
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
1343
|
+
<QuestionnaireSubmit>Save execution plan</QuestionnaireSubmit>
|
|
1344
|
+
</QuestionnaireActions>
|
|
1345
|
+
</Questionnaire>
|
|
1346
|
+
)
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
```
|
|
1350
|
+
|
|
1351
|
+
## Navigation State
|
|
1352
|
+
|
|
1353
|
+
Read item status to opt into disabled navigation and custom action styling.
|
|
1354
|
+
|
|
1355
|
+
```tsx
|
|
1356
|
+
"use client"
|
|
1357
|
+
|
|
1358
|
+
import * as React from "react"
|
|
1359
|
+
import type { QuestionnaireItemStatus } from "@shadcn/react/questionnaire"
|
|
1360
|
+
import { toast } from "sonner"
|
|
1361
|
+
|
|
1362
|
+
import {
|
|
1363
|
+
Questionnaire,
|
|
1364
|
+
QuestionnaireActions,
|
|
1365
|
+
QuestionnaireChoice,
|
|
1366
|
+
QuestionnaireChoices,
|
|
1367
|
+
QuestionnaireDescription,
|
|
1368
|
+
QuestionnaireError,
|
|
1369
|
+
QuestionnaireItem,
|
|
1370
|
+
QuestionnaireNext,
|
|
1371
|
+
QuestionnairePrevious,
|
|
1372
|
+
QuestionnaireProgress,
|
|
1373
|
+
QuestionnaireSubmit,
|
|
1374
|
+
QuestionnaireTitle,
|
|
1375
|
+
} from "@/components/ui/questionnaire"
|
|
1376
|
+
|
|
1377
|
+
const items = [
|
|
1378
|
+
{ name: "permission", required: true },
|
|
1379
|
+
{ name: "verification", required: true },
|
|
1380
|
+
] as const
|
|
1381
|
+
|
|
1382
|
+
type ItemName = "permission" | "verification"
|
|
1383
|
+
|
|
1384
|
+
export function QuestionnaireNavigationState() {
|
|
1385
|
+
const [item, setItem] = React.useState<ItemName>("permission")
|
|
1386
|
+
const [statuses, setStatuses] = React.useState<
|
|
1387
|
+
Record<ItemName, QuestionnaireItemStatus>
|
|
1388
|
+
>({
|
|
1389
|
+
permission: "unanswered",
|
|
1390
|
+
verification: "unanswered",
|
|
1391
|
+
})
|
|
1392
|
+
const unanswered = statuses[item] === "unanswered"
|
|
1393
|
+
|
|
1394
|
+
function setStatus(name: ItemName, status: QuestionnaireItemStatus) {
|
|
1395
|
+
setStatuses((current) => ({ ...current, [name]: status }))
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1399
|
+
event.preventDefault()
|
|
1400
|
+
|
|
1401
|
+
const formData = new FormData(event.currentTarget)
|
|
1402
|
+
|
|
1403
|
+
toast("Permissions saved", {
|
|
1404
|
+
description: `Permission: ${formData.get("permission") ?? "None"} · Verification: ${formData.get("verification") ?? "None"}`,
|
|
1405
|
+
})
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
return (
|
|
1409
|
+
<Questionnaire
|
|
1410
|
+
className="mx-auto max-w-md"
|
|
1411
|
+
item={item}
|
|
1412
|
+
items={items}
|
|
1413
|
+
onItemChange={(nextItem) => setItem(nextItem as ItemName)}
|
|
1414
|
+
onSubmit={handleSubmit}
|
|
1415
|
+
>
|
|
1416
|
+
<QuestionnaireProgress />
|
|
1417
|
+
|
|
1418
|
+
<QuestionnaireItem
|
|
1419
|
+
name="permission"
|
|
1420
|
+
required
|
|
1421
|
+
onStatusChange={(status) => setStatus("permission", status)}
|
|
1422
|
+
>
|
|
1423
|
+
<QuestionnaireTitle>What may the agent modify?</QuestionnaireTitle>
|
|
1424
|
+
<QuestionnaireDescription>
|
|
1425
|
+
Next is intentionally disabled until an answer is selected.
|
|
1426
|
+
</QuestionnaireDescription>
|
|
1427
|
+
<QuestionnaireChoices>
|
|
1428
|
+
<QuestionnaireChoice value="files">Project files</QuestionnaireChoice>
|
|
1429
|
+
<QuestionnaireChoice value="tests">
|
|
1430
|
+
Project files and tests
|
|
1431
|
+
</QuestionnaireChoice>
|
|
1432
|
+
<QuestionnaireChoice value="config">
|
|
1433
|
+
Files, tests, and configuration
|
|
1434
|
+
</QuestionnaireChoice>
|
|
1435
|
+
</QuestionnaireChoices>
|
|
1436
|
+
<QuestionnaireError />
|
|
1437
|
+
</QuestionnaireItem>
|
|
1438
|
+
|
|
1439
|
+
<QuestionnaireItem
|
|
1440
|
+
name="verification"
|
|
1441
|
+
required
|
|
1442
|
+
onStatusChange={(status) => setStatus("verification", status)}
|
|
1443
|
+
>
|
|
1444
|
+
<QuestionnaireTitle>
|
|
1445
|
+
What must pass before completion?
|
|
1446
|
+
</QuestionnaireTitle>
|
|
1447
|
+
<QuestionnaireChoices>
|
|
1448
|
+
<QuestionnaireChoice value="tests">Tests</QuestionnaireChoice>
|
|
1449
|
+
<QuestionnaireChoice value="types">
|
|
1450
|
+
Tests and types
|
|
1451
|
+
</QuestionnaireChoice>
|
|
1452
|
+
<QuestionnaireChoice value="all">
|
|
1453
|
+
Tests, types, and visual QA
|
|
1454
|
+
</QuestionnaireChoice>
|
|
1455
|
+
</QuestionnaireChoices>
|
|
1456
|
+
<QuestionnaireError />
|
|
1457
|
+
</QuestionnaireItem>
|
|
1458
|
+
|
|
1459
|
+
<QuestionnaireActions>
|
|
1460
|
+
<QuestionnairePrevious />
|
|
1461
|
+
<QuestionnaireNext
|
|
1462
|
+
className="data-[status=unanswered]:opacity-50"
|
|
1463
|
+
disabled={unanswered}
|
|
1464
|
+
variant="secondary"
|
|
1465
|
+
>
|
|
1466
|
+
Next
|
|
1467
|
+
</QuestionnaireNext>
|
|
1468
|
+
<QuestionnaireSubmit disabled={unanswered}>
|
|
1469
|
+
Save permissions
|
|
1470
|
+
</QuestionnaireSubmit>
|
|
1471
|
+
</QuestionnaireActions>
|
|
1472
|
+
</Questionnaire>
|
|
1473
|
+
)
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
```
|
|
1477
|
+
|
|
1478
|
+
## Custom Progress
|
|
1479
|
+
|
|
1480
|
+
Use the Progress render state to build a custom progress indicator.
|
|
1481
|
+
|
|
1482
|
+
```tsx
|
|
1483
|
+
"use client"
|
|
1484
|
+
|
|
1485
|
+
import * as React from "react"
|
|
1486
|
+
import { toast } from "sonner"
|
|
1487
|
+
|
|
1488
|
+
import {
|
|
1489
|
+
Questionnaire,
|
|
1490
|
+
QuestionnaireActions,
|
|
1491
|
+
QuestionnaireChoice,
|
|
1492
|
+
QuestionnaireChoices,
|
|
1493
|
+
QuestionnaireError,
|
|
1494
|
+
QuestionnaireItem,
|
|
1495
|
+
QuestionnaireNext,
|
|
1496
|
+
QuestionnairePrevious,
|
|
1497
|
+
QuestionnaireProgress,
|
|
1498
|
+
QuestionnaireSubmit,
|
|
1499
|
+
QuestionnaireTitle,
|
|
1500
|
+
} from "@/components/ui/questionnaire"
|
|
1501
|
+
|
|
1502
|
+
const items = [
|
|
1503
|
+
{ name: "scope", required: true },
|
|
1504
|
+
{ name: "strategy", required: true },
|
|
1505
|
+
{ name: "tests", required: true },
|
|
1506
|
+
{ name: "delivery", required: true },
|
|
1507
|
+
] as const
|
|
1508
|
+
|
|
1509
|
+
export function QuestionnaireProgressExample() {
|
|
1510
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1511
|
+
event.preventDefault()
|
|
1512
|
+
|
|
1513
|
+
const formData = new FormData(event.currentTarget)
|
|
1514
|
+
|
|
1515
|
+
toast("Pull request plan ready", {
|
|
1516
|
+
description: `Scope: ${formData.get("scope") ?? "None"} · Commits: ${formData.get("strategy") ?? "None"} · Tests: ${formData.get("tests") ?? "None"} · Delivery: ${formData.get("delivery") ?? "None"}`,
|
|
1517
|
+
})
|
|
1518
|
+
}
|
|
1519
|
+
|
|
1520
|
+
return (
|
|
1521
|
+
<Questionnaire
|
|
1522
|
+
className="mx-auto max-w-md"
|
|
1523
|
+
defaultItem="scope"
|
|
1524
|
+
items={items}
|
|
1525
|
+
onSubmit={handleSubmit}
|
|
1526
|
+
>
|
|
1527
|
+
<QuestionnaireProgress
|
|
1528
|
+
className="w-full"
|
|
1529
|
+
render={(props, state) => (
|
|
1530
|
+
<div {...props}>
|
|
1531
|
+
<div className="mb-2 flex gap-1.5" aria-hidden="true">
|
|
1532
|
+
{Array.from({ length: state.total }, (_, index) => (
|
|
1533
|
+
<span
|
|
1534
|
+
key={index}
|
|
1535
|
+
className={
|
|
1536
|
+
index < state.current
|
|
1537
|
+
? "h-1.5 flex-1 rounded-full bg-primary"
|
|
1538
|
+
: "h-1.5 flex-1 rounded-full bg-muted"
|
|
1539
|
+
}
|
|
1540
|
+
/>
|
|
1541
|
+
))}
|
|
1542
|
+
</div>
|
|
1543
|
+
<span>
|
|
1544
|
+
Checkpoint {state.current} of {state.total}
|
|
1545
|
+
</span>
|
|
1546
|
+
</div>
|
|
1547
|
+
)}
|
|
1548
|
+
/>
|
|
1549
|
+
|
|
1550
|
+
<QuestionnaireItem name="scope" required>
|
|
1551
|
+
<QuestionnaireTitle>How large is the change?</QuestionnaireTitle>
|
|
1552
|
+
<QuestionnaireChoices>
|
|
1553
|
+
<QuestionnaireChoice value="small">Small patch</QuestionnaireChoice>
|
|
1554
|
+
<QuestionnaireChoice value="medium">
|
|
1555
|
+
Feature-sized change
|
|
1556
|
+
</QuestionnaireChoice>
|
|
1557
|
+
<QuestionnaireChoice value="large">
|
|
1558
|
+
Cross-package change
|
|
1559
|
+
</QuestionnaireChoice>
|
|
1560
|
+
</QuestionnaireChoices>
|
|
1561
|
+
<QuestionnaireError />
|
|
1562
|
+
</QuestionnaireItem>
|
|
1563
|
+
|
|
1564
|
+
<QuestionnaireItem name="strategy" required>
|
|
1565
|
+
<QuestionnaireTitle>
|
|
1566
|
+
How should commits be organized?
|
|
1567
|
+
</QuestionnaireTitle>
|
|
1568
|
+
<QuestionnaireChoices>
|
|
1569
|
+
<QuestionnaireChoice value="single">
|
|
1570
|
+
Single commit
|
|
1571
|
+
</QuestionnaireChoice>
|
|
1572
|
+
<QuestionnaireChoice value="logical">
|
|
1573
|
+
Logical commits
|
|
1574
|
+
</QuestionnaireChoice>
|
|
1575
|
+
<QuestionnaireChoice value="squash">
|
|
1576
|
+
Squash before review
|
|
1577
|
+
</QuestionnaireChoice>
|
|
1578
|
+
</QuestionnaireChoices>
|
|
1579
|
+
<QuestionnaireError />
|
|
1580
|
+
</QuestionnaireItem>
|
|
1581
|
+
|
|
1582
|
+
<QuestionnaireItem name="tests" required>
|
|
1583
|
+
<QuestionnaireTitle>Which tests should run?</QuestionnaireTitle>
|
|
1584
|
+
<QuestionnaireChoices>
|
|
1585
|
+
<QuestionnaireChoice value="targeted">
|
|
1586
|
+
Targeted tests
|
|
1587
|
+
</QuestionnaireChoice>
|
|
1588
|
+
<QuestionnaireChoice value="package">
|
|
1589
|
+
Package suite
|
|
1590
|
+
</QuestionnaireChoice>
|
|
1591
|
+
<QuestionnaireChoice value="workspace">
|
|
1592
|
+
Full workspace
|
|
1593
|
+
</QuestionnaireChoice>
|
|
1594
|
+
</QuestionnaireChoices>
|
|
1595
|
+
<QuestionnaireError />
|
|
1596
|
+
</QuestionnaireItem>
|
|
1597
|
+
|
|
1598
|
+
<QuestionnaireItem name="delivery" required>
|
|
1599
|
+
<QuestionnaireTitle>
|
|
1600
|
+
How should the work be delivered?
|
|
1601
|
+
</QuestionnaireTitle>
|
|
1602
|
+
<QuestionnaireChoices>
|
|
1603
|
+
<QuestionnaireChoice value="patch">Patch only</QuestionnaireChoice>
|
|
1604
|
+
<QuestionnaireChoice value="commit">
|
|
1605
|
+
Committed locally
|
|
1606
|
+
</QuestionnaireChoice>
|
|
1607
|
+
<QuestionnaireChoice value="branch">
|
|
1608
|
+
Push a review branch
|
|
1609
|
+
</QuestionnaireChoice>
|
|
1610
|
+
</QuestionnaireChoices>
|
|
1611
|
+
<QuestionnaireError />
|
|
1612
|
+
</QuestionnaireItem>
|
|
1613
|
+
|
|
1614
|
+
<QuestionnaireActions>
|
|
1615
|
+
<QuestionnairePrevious />
|
|
1616
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
1617
|
+
<QuestionnaireSubmit>Finish plan</QuestionnaireSubmit>
|
|
1618
|
+
</QuestionnaireActions>
|
|
1619
|
+
</Questionnaire>
|
|
1620
|
+
)
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1623
|
+
```
|
|
1624
|
+
|
|
1625
|
+
## Animated Items
|
|
1626
|
+
|
|
1627
|
+
Animate the active item while keeping progress and navigation stationary.
|
|
1628
|
+
|
|
1629
|
+
```tsx
|
|
1630
|
+
"use client"
|
|
1631
|
+
|
|
1632
|
+
import * as React from "react"
|
|
1633
|
+
import { toast } from "sonner"
|
|
1634
|
+
|
|
1635
|
+
import {
|
|
1636
|
+
Questionnaire,
|
|
1637
|
+
QuestionnaireActions,
|
|
1638
|
+
QuestionnaireChoice,
|
|
1639
|
+
QuestionnaireChoices,
|
|
1640
|
+
QuestionnaireDescription,
|
|
1641
|
+
QuestionnaireError,
|
|
1642
|
+
QuestionnaireItem,
|
|
1643
|
+
QuestionnaireNext,
|
|
1644
|
+
QuestionnairePrevious,
|
|
1645
|
+
QuestionnaireProgress,
|
|
1646
|
+
QuestionnaireSubmit,
|
|
1647
|
+
QuestionnaireTitle,
|
|
1648
|
+
} from "@/components/ui/questionnaire"
|
|
1649
|
+
|
|
1650
|
+
const items = [
|
|
1651
|
+
{ name: "task", required: true },
|
|
1652
|
+
{ name: "review", required: true },
|
|
1653
|
+
{ name: "delivery", required: true },
|
|
1654
|
+
] as const
|
|
1655
|
+
|
|
1656
|
+
const itemClassName =
|
|
1657
|
+
"data-active:animate-in data-active:fade-in-0 data-active:slide-in-from-bottom-2 data-active:duration-300 motion-reduce:animate-none"
|
|
1658
|
+
|
|
1659
|
+
export function QuestionnaireAnimated() {
|
|
1660
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1661
|
+
event.preventDefault()
|
|
1662
|
+
|
|
1663
|
+
const formData = new FormData(event.currentTarget)
|
|
1664
|
+
|
|
1665
|
+
toast("Agent workflow saved", {
|
|
1666
|
+
description: `Task: ${formData.get("task") ?? "None"} · Review: ${formData.get("review") ?? "None"} · Delivery: ${formData.get("delivery") ?? "None"}`,
|
|
1667
|
+
})
|
|
1668
|
+
}
|
|
1669
|
+
|
|
1670
|
+
return (
|
|
1671
|
+
<Questionnaire
|
|
1672
|
+
className="mx-auto max-w-md"
|
|
1673
|
+
defaultItem="task"
|
|
1674
|
+
items={items}
|
|
1675
|
+
onSubmit={handleSubmit}
|
|
1676
|
+
>
|
|
1677
|
+
<QuestionnaireProgress />
|
|
1678
|
+
|
|
1679
|
+
<QuestionnaireItem className={itemClassName} name="task" required>
|
|
1680
|
+
<QuestionnaireTitle>What should the agent do?</QuestionnaireTitle>
|
|
1681
|
+
<QuestionnaireDescription>
|
|
1682
|
+
Choose the task for this run.
|
|
1683
|
+
</QuestionnaireDescription>
|
|
1684
|
+
<QuestionnaireChoices>
|
|
1685
|
+
<QuestionnaireChoice value="implement">
|
|
1686
|
+
Implement the requested change
|
|
1687
|
+
</QuestionnaireChoice>
|
|
1688
|
+
<QuestionnaireChoice value="debug">
|
|
1689
|
+
Debug the current behavior
|
|
1690
|
+
</QuestionnaireChoice>
|
|
1691
|
+
<QuestionnaireChoice value="review">
|
|
1692
|
+
Review the implementation
|
|
1693
|
+
</QuestionnaireChoice>
|
|
1694
|
+
</QuestionnaireChoices>
|
|
1695
|
+
<QuestionnaireError />
|
|
1696
|
+
</QuestionnaireItem>
|
|
1697
|
+
|
|
1698
|
+
<QuestionnaireItem className={itemClassName} name="review" required>
|
|
1699
|
+
<QuestionnaireTitle>
|
|
1700
|
+
How should the work be reviewed?
|
|
1701
|
+
</QuestionnaireTitle>
|
|
1702
|
+
<QuestionnaireDescription>
|
|
1703
|
+
Select the verification depth.
|
|
1704
|
+
</QuestionnaireDescription>
|
|
1705
|
+
<QuestionnaireChoices>
|
|
1706
|
+
<QuestionnaireChoice value="targeted">
|
|
1707
|
+
Targeted checks
|
|
1708
|
+
</QuestionnaireChoice>
|
|
1709
|
+
<QuestionnaireChoice value="complete">
|
|
1710
|
+
Complete test suite
|
|
1711
|
+
</QuestionnaireChoice>
|
|
1712
|
+
<QuestionnaireChoice value="manual">
|
|
1713
|
+
Tests and manual QA
|
|
1714
|
+
</QuestionnaireChoice>
|
|
1715
|
+
</QuestionnaireChoices>
|
|
1716
|
+
<QuestionnaireError />
|
|
1717
|
+
</QuestionnaireItem>
|
|
1718
|
+
|
|
1719
|
+
<QuestionnaireItem className={itemClassName} name="delivery" required>
|
|
1720
|
+
<QuestionnaireTitle>
|
|
1721
|
+
How should the result be delivered?
|
|
1722
|
+
</QuestionnaireTitle>
|
|
1723
|
+
<QuestionnaireDescription>
|
|
1724
|
+
Choose the final handoff format.
|
|
1725
|
+
</QuestionnaireDescription>
|
|
1726
|
+
<QuestionnaireChoices>
|
|
1727
|
+
<QuestionnaireChoice value="summary">
|
|
1728
|
+
Concise summary
|
|
1729
|
+
</QuestionnaireChoice>
|
|
1730
|
+
<QuestionnaireChoice value="diff">
|
|
1731
|
+
Summary and changed files
|
|
1732
|
+
</QuestionnaireChoice>
|
|
1733
|
+
<QuestionnaireChoice value="handoff">
|
|
1734
|
+
Detailed review handoff
|
|
1735
|
+
</QuestionnaireChoice>
|
|
1736
|
+
</QuestionnaireChoices>
|
|
1737
|
+
<QuestionnaireError />
|
|
1738
|
+
</QuestionnaireItem>
|
|
1739
|
+
|
|
1740
|
+
<QuestionnaireActions>
|
|
1741
|
+
<QuestionnairePrevious />
|
|
1742
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
1743
|
+
<QuestionnaireSubmit>Save workflow</QuestionnaireSubmit>
|
|
1744
|
+
</QuestionnaireActions>
|
|
1745
|
+
</Questionnaire>
|
|
1746
|
+
)
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
```
|
|
1750
|
+
|
|
1751
|
+
## Card
|
|
1752
|
+
|
|
1753
|
+
Compose Questionnaire with Card slots while keeping the question title and description semantic.
|
|
1754
|
+
|
|
1755
|
+
```tsx
|
|
1756
|
+
"use client"
|
|
1757
|
+
|
|
1758
|
+
import * as React from "react"
|
|
1759
|
+
import { toast } from "sonner"
|
|
1760
|
+
|
|
1761
|
+
import {
|
|
1762
|
+
Card,
|
|
1763
|
+
CardAction,
|
|
1764
|
+
CardContent,
|
|
1765
|
+
CardDescription,
|
|
1766
|
+
CardFooter,
|
|
1767
|
+
CardHeader,
|
|
1768
|
+
CardTitle,
|
|
1769
|
+
} from "@/components/ui/card"
|
|
1770
|
+
import {
|
|
1771
|
+
Questionnaire,
|
|
1772
|
+
QuestionnaireActions,
|
|
1773
|
+
QuestionnaireChoice,
|
|
1774
|
+
QuestionnaireChoices,
|
|
1775
|
+
QuestionnaireDescription,
|
|
1776
|
+
QuestionnaireError,
|
|
1777
|
+
QuestionnaireItem,
|
|
1778
|
+
QuestionnaireNext,
|
|
1779
|
+
QuestionnairePrevious,
|
|
1780
|
+
QuestionnaireProgress,
|
|
1781
|
+
QuestionnaireSubmit,
|
|
1782
|
+
QuestionnaireTitle,
|
|
1783
|
+
} from "@/components/ui/questionnaire"
|
|
1784
|
+
|
|
1785
|
+
const items = [
|
|
1786
|
+
{
|
|
1787
|
+
choices: [{ value: "fix" }, { value: "refactor" }, { value: "docs" }],
|
|
1788
|
+
name: "task",
|
|
1789
|
+
required: true,
|
|
1790
|
+
},
|
|
1791
|
+
{
|
|
1792
|
+
choices: [{ value: "summary" }, { value: "files" }, { value: "review" }],
|
|
1793
|
+
name: "output",
|
|
1794
|
+
required: true,
|
|
1795
|
+
},
|
|
1796
|
+
] as const
|
|
1797
|
+
|
|
1798
|
+
export function QuestionnaireCard() {
|
|
1799
|
+
const taskTitleId = React.useId()
|
|
1800
|
+
const outputTitleId = React.useId()
|
|
1801
|
+
|
|
1802
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1803
|
+
event.preventDefault()
|
|
1804
|
+
|
|
1805
|
+
const formData = new FormData(event.currentTarget)
|
|
1806
|
+
|
|
1807
|
+
toast("Agent task created", {
|
|
1808
|
+
description: `Task: ${formData.get("task") ?? "None"} · Handoff: ${formData.get("output") ?? "None"}`,
|
|
1809
|
+
})
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
return (
|
|
1813
|
+
<Questionnaire
|
|
1814
|
+
className="mx-auto max-w-md"
|
|
1815
|
+
defaultItem="task"
|
|
1816
|
+
items={items}
|
|
1817
|
+
shortcuts="numbers"
|
|
1818
|
+
onSubmit={handleSubmit}
|
|
1819
|
+
>
|
|
1820
|
+
<Card>
|
|
1821
|
+
<QuestionnaireItem aria-labelledby={taskTitleId} name="task" required>
|
|
1822
|
+
<CardHeader>
|
|
1823
|
+
<QuestionnaireTitle id={taskTitleId} render={<CardTitle />}>
|
|
1824
|
+
What should the agent work on?
|
|
1825
|
+
</QuestionnaireTitle>
|
|
1826
|
+
<QuestionnaireDescription render={<CardDescription />}>
|
|
1827
|
+
Choose the task that should be handled next.
|
|
1828
|
+
</QuestionnaireDescription>
|
|
1829
|
+
<CardAction>
|
|
1830
|
+
<QuestionnaireProgress />
|
|
1831
|
+
</CardAction>
|
|
1832
|
+
</CardHeader>
|
|
1833
|
+
<CardContent>
|
|
1834
|
+
<QuestionnaireChoices>
|
|
1835
|
+
<QuestionnaireChoice value="fix">
|
|
1836
|
+
Fix the failing tests
|
|
1837
|
+
</QuestionnaireChoice>
|
|
1838
|
+
<QuestionnaireChoice value="refactor">
|
|
1839
|
+
Refactor the data layer
|
|
1840
|
+
</QuestionnaireChoice>
|
|
1841
|
+
<QuestionnaireChoice value="docs">
|
|
1842
|
+
Update the integration guide
|
|
1843
|
+
</QuestionnaireChoice>
|
|
1844
|
+
</QuestionnaireChoices>
|
|
1845
|
+
<QuestionnaireError />
|
|
1846
|
+
</CardContent>
|
|
1847
|
+
</QuestionnaireItem>
|
|
1848
|
+
|
|
1849
|
+
<QuestionnaireItem
|
|
1850
|
+
aria-labelledby={outputTitleId}
|
|
1851
|
+
name="output"
|
|
1852
|
+
required
|
|
1853
|
+
>
|
|
1854
|
+
<CardHeader>
|
|
1855
|
+
<QuestionnaireTitle id={outputTitleId} render={<CardTitle />}>
|
|
1856
|
+
What should the final handoff include?
|
|
1857
|
+
</QuestionnaireTitle>
|
|
1858
|
+
<QuestionnaireDescription render={<CardDescription />}>
|
|
1859
|
+
Pick the level of detail needed for review.
|
|
1860
|
+
</QuestionnaireDescription>
|
|
1861
|
+
<CardAction>
|
|
1862
|
+
<QuestionnaireProgress />
|
|
1863
|
+
</CardAction>
|
|
1864
|
+
</CardHeader>
|
|
1865
|
+
<CardContent>
|
|
1866
|
+
<QuestionnaireChoices>
|
|
1867
|
+
<QuestionnaireChoice value="summary">
|
|
1868
|
+
Summary only
|
|
1869
|
+
</QuestionnaireChoice>
|
|
1870
|
+
<QuestionnaireChoice value="files">
|
|
1871
|
+
Summary and changed files
|
|
1872
|
+
</QuestionnaireChoice>
|
|
1873
|
+
<QuestionnaireChoice value="review">
|
|
1874
|
+
Full review handoff
|
|
1875
|
+
</QuestionnaireChoice>
|
|
1876
|
+
</QuestionnaireChoices>
|
|
1877
|
+
<QuestionnaireError />
|
|
1878
|
+
</CardContent>
|
|
1879
|
+
</QuestionnaireItem>
|
|
1880
|
+
|
|
1881
|
+
<CardFooter>
|
|
1882
|
+
<QuestionnaireActions className="w-full">
|
|
1883
|
+
<QuestionnairePrevious />
|
|
1884
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
1885
|
+
<QuestionnaireSubmit>Create task</QuestionnaireSubmit>
|
|
1886
|
+
</QuestionnaireActions>
|
|
1887
|
+
</CardFooter>
|
|
1888
|
+
</Card>
|
|
1889
|
+
</Questionnaire>
|
|
1890
|
+
)
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
```
|
|
1894
|
+
|
|
1895
|
+
## Dialog
|
|
1896
|
+
|
|
1897
|
+
Compose Questionnaire inside a Dialog while keeping cancellation and dismissal host-owned.
|
|
1898
|
+
|
|
1899
|
+
```tsx
|
|
1900
|
+
"use client"
|
|
1901
|
+
|
|
1902
|
+
import * as React from "react"
|
|
1903
|
+
import { toast } from "sonner"
|
|
1904
|
+
|
|
1905
|
+
import { Button } from "@/components/ui/button"
|
|
1906
|
+
import {
|
|
1907
|
+
Dialog,
|
|
1908
|
+
DialogClose,
|
|
1909
|
+
DialogContent,
|
|
1910
|
+
DialogDescription,
|
|
1911
|
+
DialogFooter,
|
|
1912
|
+
DialogHeader,
|
|
1913
|
+
DialogTitle,
|
|
1914
|
+
DialogTrigger,
|
|
1915
|
+
} from "@/components/ui/dialog"
|
|
1916
|
+
import {
|
|
1917
|
+
Questionnaire,
|
|
1918
|
+
QuestionnaireActions,
|
|
1919
|
+
QuestionnaireChoice,
|
|
1920
|
+
QuestionnaireChoices,
|
|
1921
|
+
QuestionnaireDescription,
|
|
1922
|
+
QuestionnaireError,
|
|
1923
|
+
QuestionnaireItem,
|
|
1924
|
+
QuestionnaireNext,
|
|
1925
|
+
QuestionnairePrevious,
|
|
1926
|
+
QuestionnaireProgress,
|
|
1927
|
+
QuestionnaireSubmit,
|
|
1928
|
+
QuestionnaireTitle,
|
|
1929
|
+
} from "@/components/ui/questionnaire"
|
|
1930
|
+
|
|
1931
|
+
const items = [
|
|
1932
|
+
{ name: "scope", required: true },
|
|
1933
|
+
{ name: "tests", required: true },
|
|
1934
|
+
] as const
|
|
1935
|
+
|
|
1936
|
+
export function QuestionnaireDialog() {
|
|
1937
|
+
const [open, setOpen] = React.useState(false)
|
|
1938
|
+
|
|
1939
|
+
function handleSubmit(event: React.FormEvent<HTMLFormElement>) {
|
|
1940
|
+
event.preventDefault()
|
|
1941
|
+
|
|
1942
|
+
const formData = new FormData(event.currentTarget)
|
|
1943
|
+
|
|
1944
|
+
setOpen(false)
|
|
1945
|
+
toast("Clarification sent", {
|
|
1946
|
+
description: `Scope: ${formData.get("scope") ?? "None"} · Verification: ${formData.get("tests") ?? "None"}`,
|
|
1947
|
+
})
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
return (
|
|
1951
|
+
<Dialog open={open} onOpenChange={setOpen}>
|
|
1952
|
+
<DialogTrigger render={<Button variant="outline" />}>
|
|
1953
|
+
Open clarification
|
|
1954
|
+
</DialogTrigger>
|
|
1955
|
+
<DialogContent>
|
|
1956
|
+
<Questionnaire
|
|
1957
|
+
defaultItem="scope"
|
|
1958
|
+
items={items}
|
|
1959
|
+
onSubmit={handleSubmit}
|
|
1960
|
+
>
|
|
1961
|
+
<QuestionnaireItem name="scope" required>
|
|
1962
|
+
<DialogHeader>
|
|
1963
|
+
<QuestionnaireProgress />
|
|
1964
|
+
<QuestionnaireTitle render={<DialogTitle />}>
|
|
1965
|
+
Which files are in scope?
|
|
1966
|
+
</QuestionnaireTitle>
|
|
1967
|
+
<QuestionnaireDescription render={<DialogDescription />}>
|
|
1968
|
+
Choose how broadly the agent can update the workspace.
|
|
1969
|
+
</QuestionnaireDescription>
|
|
1970
|
+
</DialogHeader>
|
|
1971
|
+
<QuestionnaireChoices>
|
|
1972
|
+
<QuestionnaireChoice value="component">
|
|
1973
|
+
Component only
|
|
1974
|
+
</QuestionnaireChoice>
|
|
1975
|
+
<QuestionnaireChoice value="feature">
|
|
1976
|
+
Complete feature directory
|
|
1977
|
+
</QuestionnaireChoice>
|
|
1978
|
+
<QuestionnaireChoice value="workspace">
|
|
1979
|
+
Any related workspace file
|
|
1980
|
+
</QuestionnaireChoice>
|
|
1981
|
+
</QuestionnaireChoices>
|
|
1982
|
+
<QuestionnaireError />
|
|
1983
|
+
</QuestionnaireItem>
|
|
1984
|
+
|
|
1985
|
+
<QuestionnaireItem name="tests" required>
|
|
1986
|
+
<DialogHeader>
|
|
1987
|
+
<QuestionnaireProgress />
|
|
1988
|
+
<QuestionnaireTitle render={<DialogTitle />}>
|
|
1989
|
+
How much verification is needed?
|
|
1990
|
+
</QuestionnaireTitle>
|
|
1991
|
+
<QuestionnaireDescription render={<DialogDescription />}>
|
|
1992
|
+
Choose the checks the agent should run before handoff.
|
|
1993
|
+
</QuestionnaireDescription>
|
|
1994
|
+
</DialogHeader>
|
|
1995
|
+
<QuestionnaireChoices>
|
|
1996
|
+
<QuestionnaireChoice value="targeted">
|
|
1997
|
+
Targeted tests
|
|
1998
|
+
</QuestionnaireChoice>
|
|
1999
|
+
<QuestionnaireChoice value="package">
|
|
2000
|
+
Package tests
|
|
2001
|
+
</QuestionnaireChoice>
|
|
2002
|
+
<QuestionnaireChoice value="full">
|
|
2003
|
+
Full workspace verification
|
|
2004
|
+
</QuestionnaireChoice>
|
|
2005
|
+
</QuestionnaireChoices>
|
|
2006
|
+
<QuestionnaireError />
|
|
2007
|
+
</QuestionnaireItem>
|
|
2008
|
+
|
|
2009
|
+
<DialogFooter>
|
|
2010
|
+
<DialogClose render={<Button type="button" variant="outline" />}>
|
|
2011
|
+
Cancel
|
|
2012
|
+
</DialogClose>
|
|
2013
|
+
<QuestionnaireActions>
|
|
2014
|
+
<QuestionnairePrevious />
|
|
2015
|
+
<QuestionnaireNext>Next</QuestionnaireNext>
|
|
2016
|
+
<QuestionnaireSubmit>Send answer</QuestionnaireSubmit>
|
|
2017
|
+
</QuestionnaireActions>
|
|
2018
|
+
</DialogFooter>
|
|
2019
|
+
</Questionnaire>
|
|
2020
|
+
</DialogContent>
|
|
2021
|
+
</Dialog>
|
|
2022
|
+
)
|
|
2023
|
+
}
|
|
2024
|
+
|
|
2025
|
+
```
|
|
2026
|
+
|
|
2027
|
+
## Accessibility
|
|
2028
|
+
|
|
2029
|
+
`QuestionnaireItem` renders a `fieldset`, and `QuestionnaireTitle` renders its
|
|
2030
|
+
`legend`. Descriptions and active errors are associated with the current item,
|
|
2031
|
+
and invalid items and answer controls expose `aria-invalid`.
|
|
2032
|
+
|
|
2033
|
+
Fixed choices preserve native radio and checkbox behavior. Progress is exposed
|
|
2034
|
+
as a named progressbar, navigation uses real buttons, and inactive items and
|
|
2035
|
+
actions are hidden and inert. Successful navigation focuses the newly active
|
|
2036
|
+
item; failed validation focuses an available answer control.
|
|
2037
|
+
|
|
2038
|
+
Always give `QuestionnaireInput` an accessible name with a visible label,
|
|
2039
|
+
`aria-label`, or `aria-labelledby`. A placeholder is not a label. See the
|
|
2040
|
+
[Questionnaire accessibility guide](/docs/react/questionnaire#accessibility)
|
|
2041
|
+
for labeling custom compositions and the complete keyboard behavior.
|
|
2042
|
+
|
|
2043
|
+
## Unstyled
|
|
2044
|
+
|
|
2045
|
+
The behavior in `Questionnaire` comes from the `@shadcn/react` package. To use
|
|
2046
|
+
it directly with your own markup and styles, see
|
|
2047
|
+
[Questionnaire](/docs/react/questionnaire) under @shadcn/react.
|
|
2048
|
+
|
|
2049
|
+
## API Reference
|
|
2050
|
+
|
|
2051
|
+
The props, data attributes, and render states for every part are documented on
|
|
2052
|
+
the [@shadcn/react Questionnaire](/docs/react/questionnaire#api-reference) page.
|
|
2053
|
+
The styled components inherit the corresponding unstyled props. Navigation
|
|
2054
|
+
components also accept Button `size` and `variant` props, and
|
|
2055
|
+
`QuestionnaireActions` is a styled-only layout helper.
|