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,164 @@
|
|
|
1
|
+
# Astro Content Collections & Content Layer Architecture
|
|
2
|
+
|
|
3
|
+
Astro Content Collections provide a robust, build-time validated data management system for Markdown, MDX, JSON, YAML, and remote headless CMS data.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Content Layer Overview (Astro 5)
|
|
8
|
+
|
|
9
|
+
In Astro 5, Content Collections utilize the unified **Content Layer API**. Collections can be populated from:
|
|
10
|
+
1. **Local Files**: Markdown (`.md`), MDX (`.mdx`), JSON, and YAML files using the `glob()` loader.
|
|
11
|
+
2. **Remote Data**: Headless CMSs (Contentful, Sanity, Strapi), database queries, or REST APIs using custom or official loaders (e.g. `feedLoader`, `gitHubLoader`).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Defining Schemas (`src/content.config.ts`)
|
|
16
|
+
|
|
17
|
+
Schemas ensure every content entry matches strict validation rules during `astro build`.
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
// src/content.config.ts
|
|
21
|
+
import { defineCollection, z } from 'astro:content';
|
|
22
|
+
import { glob, file } from 'astro/loaders';
|
|
23
|
+
|
|
24
|
+
// 1. Markdown/MDX Blog Collection
|
|
25
|
+
const blog = defineCollection({
|
|
26
|
+
loader: glob({ pattern: '**/[^_]*.{md,mdx}', base: './src/data/blog' }),
|
|
27
|
+
schema: ({ image }) =>
|
|
28
|
+
z.object({
|
|
29
|
+
title: z.string().max(100),
|
|
30
|
+
description: z.string(),
|
|
31
|
+
pubDate: z.coerce.date(),
|
|
32
|
+
updatedDate: z.coerce.date().optional(),
|
|
33
|
+
draft: z.boolean().default(false),
|
|
34
|
+
featured: z.boolean().default(false),
|
|
35
|
+
author: z.string(),
|
|
36
|
+
coverImage: image(), // Validates local image paths and exposes optimized dimensions
|
|
37
|
+
tags: z.array(z.string()).min(1),
|
|
38
|
+
}),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// 2. Structured JSON Documentation Collection
|
|
42
|
+
const docs = defineCollection({
|
|
43
|
+
loader: glob({ pattern: '**/*.md', base: './src/data/docs' }),
|
|
44
|
+
schema: z.object({
|
|
45
|
+
title: z.string(),
|
|
46
|
+
section: z.enum(['getting-started', 'guides', 'api-reference']),
|
|
47
|
+
order: z.number().int(),
|
|
48
|
+
}),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Export all collections
|
|
52
|
+
export const collections = { blog, docs };
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 3. Querying Collections
|
|
58
|
+
|
|
59
|
+
Astro provides type-safe utility functions via `astro:content`:
|
|
60
|
+
|
|
61
|
+
### `getCollection()`
|
|
62
|
+
Retrieves all entries in a collection with optional filter predicates:
|
|
63
|
+
```astro
|
|
64
|
+
---
|
|
65
|
+
// src/pages/blog/index.astro
|
|
66
|
+
import { getCollection } from 'astro:content';
|
|
67
|
+
|
|
68
|
+
// Fetch non-draft posts sorted by date
|
|
69
|
+
const posts = await getCollection('blog', ({ data }) => !data.draft);
|
|
70
|
+
posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime());
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
<Layout title="Engineering Blog">
|
|
74
|
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
|
75
|
+
{posts.map((post) => (
|
|
76
|
+
<article>
|
|
77
|
+
<h2>{post.data.title}</h2>
|
|
78
|
+
<p>{post.data.description}</p>
|
|
79
|
+
<a href={`/blog/${post.id}/`}>Read post</a>
|
|
80
|
+
</article>
|
|
81
|
+
))}
|
|
82
|
+
</div>
|
|
83
|
+
</Layout>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### `getEntry()`
|
|
87
|
+
Retrieves a single entry by its collection name and ID:
|
|
88
|
+
```astro
|
|
89
|
+
---
|
|
90
|
+
// src/pages/about.astro
|
|
91
|
+
import { getEntry } from 'astro:content';
|
|
92
|
+
|
|
93
|
+
const aboutPage = await getEntry('pages', 'about');
|
|
94
|
+
if (!aboutPage) {
|
|
95
|
+
return Astro.redirect('/404');
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const { Content } = await aboutPage.render();
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
<Layout title={aboutPage.data.title}>
|
|
102
|
+
<Content />
|
|
103
|
+
</Layout>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## 4. Dynamic Routing with `getStaticPaths()`
|
|
109
|
+
|
|
110
|
+
Generate static HTML pages for all collection entries during build:
|
|
111
|
+
|
|
112
|
+
```astro
|
|
113
|
+
---
|
|
114
|
+
// src/pages/blog/[...slug].astro
|
|
115
|
+
import { getCollection, render } from 'astro:content';
|
|
116
|
+
import { Image } from 'astro:assets';
|
|
117
|
+
import BaseLayout from '../../layouts/BaseLayout.astro';
|
|
118
|
+
|
|
119
|
+
export async function getStaticPaths() {
|
|
120
|
+
const posts = await getCollection('blog');
|
|
121
|
+
return posts.map((post) => ({
|
|
122
|
+
params: { slug: post.id },
|
|
123
|
+
props: { post },
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const { post } = Astro.props;
|
|
128
|
+
const { Content, headings } = await render(post);
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
<BaseLayout title={post.data.title} description={post.data.description}>
|
|
132
|
+
<article class="prose max-w-3xl mx-auto py-8">
|
|
133
|
+
<Image src={post.data.coverImage} alt={post.data.title} width={1200} height={630} />
|
|
134
|
+
<h1>{post.data.title}</h1>
|
|
135
|
+
<time datetime={post.data.pubDate.toISOString()}>
|
|
136
|
+
{post.data.pubDate.toLocaleDateString('en-US', { dateStyle: 'long' })}
|
|
137
|
+
</time>
|
|
138
|
+
|
|
139
|
+
<!-- Render compiled Markdown/MDX content -->
|
|
140
|
+
<Content />
|
|
141
|
+
</article>
|
|
142
|
+
</BaseLayout>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 5. Local Image Optimization with Content Collections
|
|
148
|
+
|
|
149
|
+
When using `({ image }) => z.object({ coverImage: image() })`, Astro validates that the referenced image exists at compile time. It automatically derives width, height, and format, allowing seamless integration with `<Image />`:
|
|
150
|
+
|
|
151
|
+
```astro
|
|
152
|
+
---
|
|
153
|
+
import { Image } from 'astro:assets';
|
|
154
|
+
---
|
|
155
|
+
<!-- Outputs WebP/AVIF with precise intrinsic aspect ratio to prevent CLS -->
|
|
156
|
+
<Image
|
|
157
|
+
src={post.data.coverImage}
|
|
158
|
+
alt={post.data.title}
|
|
159
|
+
widths={[400, 800, 1200]}
|
|
160
|
+
sizes="(max-width: 640px) 100vw, (max-width: 1024px) 50vw, 800px"
|
|
161
|
+
loading="lazy"
|
|
162
|
+
decoding="async"
|
|
163
|
+
/>
|
|
164
|
+
```
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Astro Islands Architecture Deep Dive
|
|
2
|
+
|
|
3
|
+
The **Islands Architecture** (coined by L. Dover and pioneered by Astro) represents a fundamental paradigm shift from traditional Single Page Application (SPA) architectures and monolithic Server-Side Rendering (SSR) frameworks.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Traditional SPAs vs Monolithic SSR vs Astro Islands
|
|
8
|
+
|
|
9
|
+
| Architecture | HTML Payload | Client-Side JS Runtime | Hydration Strategy | Time to Interactive (TTI) |
|
|
10
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
11
|
+
| **Traditional SPA** (Vite / CRA) | Empty `div#root` shell | Entire application bundle | Full client-side render | Slow (Waits for all JS) |
|
|
12
|
+
| **Monolithic SSR** (Next.js / Nuxt) | Full pre-rendered HTML | Entire application bundle | Full page hydration | Moderate to Slow (Main-thread lockup) |
|
|
13
|
+
| **Astro Islands** | Full pre-rendered HTML | **Only interactive islands** | Independent, surgical hydration | **Instant (Zero JS baseline)** |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## 2. Anatomy of an Astro Island
|
|
18
|
+
|
|
19
|
+
In Astro, the default component extension is `.astro`. Astro components run **only during build or request time on the server**. Their output is pure HTML and scoped CSS.
|
|
20
|
+
|
|
21
|
+
When interactive state or browser events (`onClick`, `useState`, `createSignal`) are required, an interactive UI component (React, Preact, Svelte, Vue, Solid, Web Components) is embedded inside an `.astro` template with a `client:*` directive.
|
|
22
|
+
|
|
23
|
+
```astro
|
|
24
|
+
---
|
|
25
|
+
// Server-Side Frontmatter (Runs on Node/Edge/Build)
|
|
26
|
+
import StaticHero from '../components/StaticHero.astro';
|
|
27
|
+
import StaticFooter from '../components/StaticFooter.astro';
|
|
28
|
+
|
|
29
|
+
import InteractiveSearch from '../components/SearchModal.tsx'; // React
|
|
30
|
+
import InteractiveCart from '../components/CartWidget.svelte'; // Svelte
|
|
31
|
+
import InteractiveThemeToggle from '../components/ThemeToggle.vue'; // Vue
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<html lang="en">
|
|
35
|
+
<head>
|
|
36
|
+
<title>Astro Multi-Framework Islands</title>
|
|
37
|
+
</head>
|
|
38
|
+
<body>
|
|
39
|
+
<!-- 0 KB JavaScript -->
|
|
40
|
+
<StaticHero />
|
|
41
|
+
|
|
42
|
+
<!-- React Island hydrated when idle -->
|
|
43
|
+
<InteractiveSearch client:idle />
|
|
44
|
+
|
|
45
|
+
<!-- Svelte Island hydrated immediately for shopping cart -->
|
|
46
|
+
<InteractiveCart client:load />
|
|
47
|
+
|
|
48
|
+
<!-- Vue Island hydrated only when scrolled into view -->
|
|
49
|
+
<InteractiveThemeToggle client:visible />
|
|
50
|
+
|
|
51
|
+
<!-- 0 KB JavaScript -->
|
|
52
|
+
<StaticFooter />
|
|
53
|
+
</body>
|
|
54
|
+
</html>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 3. Hydration Directives Reference
|
|
60
|
+
|
|
61
|
+
### `client:load`
|
|
62
|
+
- **When to use**: High-priority interactive elements immediately visible above the fold that the user might interact with in the first millisecond (e.g. global search input, primary mobile navigation drawer).
|
|
63
|
+
- **Execution**: Hydrated as soon as the JavaScript bundle arrives.
|
|
64
|
+
|
|
65
|
+
### `client:idle`
|
|
66
|
+
- **When to use**: Lower priority interactive elements that do not block initial rendering or critical user actions (e.g. newsletter signups, notifications banner, dark/light theme switchers).
|
|
67
|
+
- **Execution**: Uses `requestIdleCallback` to defer hydration until the main browser thread is idle.
|
|
68
|
+
|
|
69
|
+
### `client:visible`
|
|
70
|
+
- **When to use**: Any below-the-fold interactive component (e.g. image carousel, user review accordion, embedded video player, complex interactive charts).
|
|
71
|
+
- **Execution**: Uses an internal `IntersectionObserver` instance. JavaScript is not loaded or executed until the element scrolls into view.
|
|
72
|
+
|
|
73
|
+
### `client:media="(media query)"`
|
|
74
|
+
- **When to use**: Components that are only functional or visible at certain viewport dimensions (e.g. mobile drawer menu on `(max-width: 768px)`, desktop mega menu on `(min-width: 1024px)`).
|
|
75
|
+
- **Execution**: Uses `window.matchMedia`. If the query does not match, zero JavaScript is fetched.
|
|
76
|
+
|
|
77
|
+
### `client:only="framework"`
|
|
78
|
+
- **When to use**: Components that cannot run on the server because they depend strictly on browser-only APIs (WebGL, Canvas, `navigator.bluetooth`, Web Audio, local storage synchronization).
|
|
79
|
+
- **Execution**: Skips server-side rendering entirely and renders only on the client.
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 4. Multi-Framework Interoperability & State Sharing
|
|
84
|
+
|
|
85
|
+
Astro enables multi-framework composition on the same page. To share state between independent islands across different frameworks (e.g. a React Cart button updating from a Svelte Product card), use lightweight framework-agnostic stores like **Nanostores**:
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
// src/stores/cartStore.ts
|
|
89
|
+
import { atom, map } from 'nanostores';
|
|
90
|
+
|
|
91
|
+
export interface CartItem {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
price: number;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export const $cart = map<Record<string, CartItem>>({});
|
|
98
|
+
|
|
99
|
+
export function addToCart(item: CartItem) {
|
|
100
|
+
const existing = $cart.get()[item.id];
|
|
101
|
+
$cart.setKey(item.id, item);
|
|
102
|
+
}
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
In a Svelte Island:
|
|
106
|
+
```svelte
|
|
107
|
+
<!-- src/components/AddToCart.svelte -->
|
|
108
|
+
<script>
|
|
109
|
+
import { addToCart } from '../stores/cartStore';
|
|
110
|
+
export let product;
|
|
111
|
+
</script>
|
|
112
|
+
|
|
113
|
+
<button on:click={() => addToCart(product)}>Add to Cart</button>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
In a React Island:
|
|
117
|
+
```tsx
|
|
118
|
+
// src/components/CartCounter.tsx
|
|
119
|
+
import { useStore } from '@nanostores/react';
|
|
120
|
+
import { $cart } from '../stores/cartStore';
|
|
121
|
+
|
|
122
|
+
export function CartCounter() {
|
|
123
|
+
const cart = useStore($cart);
|
|
124
|
+
const count = Object.keys(cart).length;
|
|
125
|
+
|
|
126
|
+
return <span className="cart-badge">{count}</span>;
|
|
127
|
+
}
|
|
128
|
+
```
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# Astro 5 Server Islands & Type-Safe Actions
|
|
2
|
+
|
|
3
|
+
Astro 5 introduces two transformative features for dynamic full-stack web applications:
|
|
4
|
+
1. **Server Islands (`server:defer`)**: Deferred dynamic rendering with static CDN caching.
|
|
5
|
+
2. **Astro Actions (`astro:actions`)**: End-to-end type-safe RPC endpoints for backend mutations.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 1. Server Islands (`server:defer`)
|
|
10
|
+
|
|
11
|
+
### The Problem with Traditional SSR vs SSG
|
|
12
|
+
- **Static Site Generation (SSG)**: Blazing fast TTFB from edge CDN, but cannot personalize content (e.g. user avatar, cart count, personalized recommendations).
|
|
13
|
+
- **Server-Side Rendering (SSR)**: Personalized content, but TTFB is bottlenecked by the slowest database or 3rd-party API call.
|
|
14
|
+
|
|
15
|
+
### How Server Islands Solve This
|
|
16
|
+
Server Islands decouple static page generation from dynamic personalization. The static shell is served instantly with an empty placeholder or skeleton fallback. The server island is fetched in the background and injected into the DOM as HTML, with zero client-side React/Vue runtime required.
|
|
17
|
+
|
|
18
|
+
```astro
|
|
19
|
+
---
|
|
20
|
+
// src/pages/product/[id].astro
|
|
21
|
+
import ProductDetails from '../../components/ProductDetails.astro';
|
|
22
|
+
import DynamicPricing from '../../components/DynamicPricing.astro';
|
|
23
|
+
import PriceSkeleton from '../../components/PriceSkeleton.astro';
|
|
24
|
+
|
|
25
|
+
export const prerender = true; // Static CDN Cache
|
|
26
|
+
const { id } = Astro.params;
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
<Layout>
|
|
30
|
+
<!-- Rendered statically at build time -->
|
|
31
|
+
<ProductDetails productId={id} />
|
|
32
|
+
|
|
33
|
+
<!-- Deferred server-rendered dynamic island -->
|
|
34
|
+
<DynamicPricing productId={id} server:defer>
|
|
35
|
+
<PriceSkeleton slot="fallback" />
|
|
36
|
+
</DynamicPricing>
|
|
37
|
+
</Layout>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Component Implementation
|
|
41
|
+
Inside `DynamicPricing.astro`:
|
|
42
|
+
```astro
|
|
43
|
+
---
|
|
44
|
+
// src/components/DynamicPricing.astro
|
|
45
|
+
interface Props {
|
|
46
|
+
productId: string;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const { productId } = Astro.props;
|
|
50
|
+
|
|
51
|
+
// Access request headers, cookies, or database per-request
|
|
52
|
+
const currency = Astro.cookies.get('user_currency')?.value ?? 'USD';
|
|
53
|
+
const price = await db.fetchPrice(productId, currency);
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
<div class="pricing-badge">
|
|
57
|
+
<span>{price.formatted}</span>
|
|
58
|
+
<small>Includes localized tax for {currency}</small>
|
|
59
|
+
</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 2. Astro Actions (`astro:actions`)
|
|
65
|
+
|
|
66
|
+
Astro Actions provide RPC-style type-safe server mutations without manually configuring REST or GraphQL endpoints.
|
|
67
|
+
|
|
68
|
+
### Defining Actions
|
|
69
|
+
Create action handlers inside `src/actions/index.ts`:
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// src/actions/index.ts
|
|
73
|
+
import { defineAction, ActionError } from 'astro:actions';
|
|
74
|
+
import { z } from 'astro:schema';
|
|
75
|
+
|
|
76
|
+
export const server = {
|
|
77
|
+
createPost: defineAction({
|
|
78
|
+
accept: 'form', // Accepts FormData or 'json'
|
|
79
|
+
input: z.object({
|
|
80
|
+
title: z.string().min(5).max(120),
|
|
81
|
+
content: z.string().min(20),
|
|
82
|
+
published: z.boolean().default(false),
|
|
83
|
+
}),
|
|
84
|
+
handler: async (input, context) => {
|
|
85
|
+
// Access context.cookies, context.session, context.request
|
|
86
|
+
const session = await context.session?.get('user');
|
|
87
|
+
if (!session) {
|
|
88
|
+
throw new ActionError({
|
|
89
|
+
code: 'UNAUTHORIZED',
|
|
90
|
+
message: 'You must be logged in to create a post.',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
try {
|
|
95
|
+
const post = await db.posts.insert({
|
|
96
|
+
...input,
|
|
97
|
+
authorId: session.id,
|
|
98
|
+
createdAt: new Date(),
|
|
99
|
+
});
|
|
100
|
+
return { success: true, post };
|
|
101
|
+
} catch (err) {
|
|
102
|
+
throw new ActionError({
|
|
103
|
+
code: 'INTERNAL_SERVER_ERROR',
|
|
104
|
+
message: 'Failed to persist post to database.',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
};
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Consuming Actions in Pure Astro (Progressive Enhancement)
|
|
113
|
+
Zero client-side JavaScript required:
|
|
114
|
+
```astro
|
|
115
|
+
---
|
|
116
|
+
// src/pages/posts/new.astro
|
|
117
|
+
import { actions } from 'astro:actions';
|
|
118
|
+
|
|
119
|
+
const result = Astro.getActionResult(actions.createPost);
|
|
120
|
+
if (result?.data?.success) {
|
|
121
|
+
return Astro.redirect(`/posts/${result.data.post.id}`);
|
|
122
|
+
}
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
<form method="POST" action={actions.createPost}>
|
|
126
|
+
<label>
|
|
127
|
+
Title
|
|
128
|
+
<input type="text" name="title" required />
|
|
129
|
+
</label>
|
|
130
|
+
<label>
|
|
131
|
+
Content
|
|
132
|
+
<textarea name="content" required></textarea>
|
|
133
|
+
</label>
|
|
134
|
+
<button type="submit">Publish</button>
|
|
135
|
+
|
|
136
|
+
{result?.error && (
|
|
137
|
+
<div class="alert-error">
|
|
138
|
+
<p>{result.error.message}</p>
|
|
139
|
+
{result.error.fields && (
|
|
140
|
+
<ul>
|
|
141
|
+
{Object.entries(result.error.fields).map(([field, issues]) => (
|
|
142
|
+
<li>{field}: {issues?.join(', ')}</li>
|
|
143
|
+
))}
|
|
144
|
+
</ul>
|
|
145
|
+
)}
|
|
146
|
+
</div>
|
|
147
|
+
)}
|
|
148
|
+
</form>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Consuming Actions in Interactive Client Islands
|
|
152
|
+
Directly invoke actions with end-to-end type safety:
|
|
153
|
+
```tsx
|
|
154
|
+
// src/components/NewPostForm.tsx
|
|
155
|
+
import React, { useState } from 'react';
|
|
156
|
+
import { actions } from 'astro:actions';
|
|
157
|
+
|
|
158
|
+
export function NewPostForm() {
|
|
159
|
+
const [loading, setLoading] = useState(false);
|
|
160
|
+
const [errorMsg, setErrorMsg] = useState<string | null>(null);
|
|
161
|
+
|
|
162
|
+
const handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
|
|
163
|
+
e.preventDefault();
|
|
164
|
+
setLoading(true);
|
|
165
|
+
setErrorMsg(null);
|
|
166
|
+
|
|
167
|
+
const formData = new FormData(e.currentTarget);
|
|
168
|
+
const { data, error } = await actions.createPost(formData);
|
|
169
|
+
|
|
170
|
+
setLoading(false);
|
|
171
|
+
if (error) {
|
|
172
|
+
setErrorMsg(error.message);
|
|
173
|
+
} else {
|
|
174
|
+
window.location.href = `/posts/${data.post.id}`;
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
<form onSubmit={handleSubmit}>
|
|
180
|
+
{errorMsg && <p className="error">{errorMsg}</p>}
|
|
181
|
+
<button type="submit" disabled={loading}>
|
|
182
|
+
{loading ? 'Submitting...' : 'Submit'}
|
|
183
|
+
</button>
|
|
184
|
+
</form>
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Astro Production Architecture & Best Practices Auditor
|
|
4
|
+
Validates Astro 5.x projects for:
|
|
5
|
+
- Island hydration directives optimization
|
|
6
|
+
- Server island fallback implementations
|
|
7
|
+
- Image optimization via astro:assets
|
|
8
|
+
- Content collection definitions
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
import sys
|
|
12
|
+
import os
|
|
13
|
+
import re
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
def audit_file(filepath: Path):
|
|
17
|
+
issues = []
|
|
18
|
+
content = filepath.read_text(encoding="utf-8", errors="ignore")
|
|
19
|
+
rel_path = filepath.name
|
|
20
|
+
|
|
21
|
+
# 1. Check for unoptimized <img> tags
|
|
22
|
+
if filepath.suffix in [".astro", ".mdx", ".tsx", ".jsx", ".vue", ".svelte"]:
|
|
23
|
+
raw_img_matches = re.findall(r'<img\s+[^>]*src=[^>]*>', content)
|
|
24
|
+
for match in raw_img_matches:
|
|
25
|
+
if "astro:assets" not in content and "alt=" in match:
|
|
26
|
+
issues.append(f"[{rel_path}] Found raw <img> tag. Prefer `<Image />` from 'astro:assets' for automated AVIF/WebP conversion and CLS prevention.")
|
|
27
|
+
|
|
28
|
+
# 2. Check for over-eager hydration (client:load on carousels or comments)
|
|
29
|
+
if filepath.suffix == ".astro":
|
|
30
|
+
eager_hydration = re.findall(r'<([A-Z][a-zA-Z0-9]+)[^>]*client:load[^>]*>', content)
|
|
31
|
+
for comp in eager_hydration:
|
|
32
|
+
comp_lower = comp.lower()
|
|
33
|
+
if any(term in comp_lower for term in ["carousel", "comment", "review", "footer", "modal", "drawer"]):
|
|
34
|
+
issues.append(f"[{rel_path}] Eager hydration `client:load` detected on `<{comp}>`. Consider `client:visible` or `client:idle` to eliminate TTI lockup.")
|
|
35
|
+
|
|
36
|
+
# 3. Check for server:defer missing fallback
|
|
37
|
+
if "server:defer" in content and "slot=\"fallback\"" not in content:
|
|
38
|
+
issues.append(f"[{rel_path}] Server Island `server:defer` detected without a designated `slot=\"fallback\"` component.")
|
|
39
|
+
|
|
40
|
+
return issues
|
|
41
|
+
|
|
42
|
+
def audit_directory(root_dir: str):
|
|
43
|
+
root = Path(root_dir)
|
|
44
|
+
print(f"π Scanning Astro project at: {root.resolve()}")
|
|
45
|
+
all_issues = []
|
|
46
|
+
|
|
47
|
+
src_dir = root / "src"
|
|
48
|
+
if not src_dir.exists():
|
|
49
|
+
print(f"β οΈ No 'src' directory found at {root}. Running in standalone mode.")
|
|
50
|
+
src_dir = root
|
|
51
|
+
|
|
52
|
+
for ext in ["*.astro", "*.tsx", "*.jsx", "*.svelte", "*.vue", "*.mdx"]:
|
|
53
|
+
for file in src_dir.rglob(ext):
|
|
54
|
+
issues = audit_file(file)
|
|
55
|
+
all_issues.extend(issues)
|
|
56
|
+
|
|
57
|
+
# Check for content configuration
|
|
58
|
+
has_astro5_content = (root / "src" / "content.config.ts").exists()
|
|
59
|
+
has_astro4_content = (root / "src" / "content" / "config.ts").exists()
|
|
60
|
+
if not has_astro5_content and not has_astro4_content and (root / "src" / "content").exists():
|
|
61
|
+
all_issues.append("No Content Collections schema file found (`src/content.config.ts` or `src/content/config.ts`).")
|
|
62
|
+
|
|
63
|
+
print("\n" + "=" * 60)
|
|
64
|
+
print("π ASTRO PRODUCTION AUDIT REPORT")
|
|
65
|
+
print("=" * 60)
|
|
66
|
+
if not all_issues:
|
|
67
|
+
print("β
No Astro architectural anti-patterns detected! Production ready.")
|
|
68
|
+
return 0
|
|
69
|
+
else:
|
|
70
|
+
print(f"β οΈ Found {len(all_issues)} architectural suggestion(s):")
|
|
71
|
+
for idx, issue in enumerate(all_issues, 1):
|
|
72
|
+
print(f" {idx}. {issue}")
|
|
73
|
+
print("=" * 60)
|
|
74
|
+
return 1
|
|
75
|
+
|
|
76
|
+
if __name__ == "__main__":
|
|
77
|
+
target = sys.argv[1] if len(sys.argv) > 1 else "."
|
|
78
|
+
sys.exit(audit_directory(target))
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: generativeUi
|
|
3
|
+
description: Stream interactive React components from LLMs using Vercel AI SDK, tool invocations, and createDataStreamResponse. Use when replacing text-only chat with dynamic charts, cards, confirmation forms, and interactive UI widgets.
|
|
4
|
+
version: v4
|
|
5
|
+
last-verified: 2026-11-15
|
|
6
|
+
compatibility: Next.js 14/15, React 18/19, Vercel AI SDK v4+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Generative UI Engineering Guide
|
|
10
|
+
|
|
11
|
+
## 1. Core Architecture (Tool-Driven Component Streaming)
|
|
12
|
+
Generative UI replaces plain markdown text by allowing the LLM to trigger typed tools whose arguments and outputs map directly to interactive React client components.
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
ββββββββββββββββββββββββββββββββββ
|
|
16
|
+
β LLM triggers tool call β
|
|
17
|
+
β e.g. showWeather({ city }) β
|
|
18
|
+
ββββββββββββββββ¬ββββββββββββββββββ
|
|
19
|
+
β Streams via DataStream Protocol
|
|
20
|
+
βΌ
|
|
21
|
+
ββββββββββββββββββββββββββββββββββ
|
|
22
|
+
β Client intercepts toolCall β
|
|
23
|
+
β state: 'call' | 'result' β
|
|
24
|
+
ββββββββββββββββ¬ββββββββββββββββββ
|
|
25
|
+
β
|
|
26
|
+
ββββββββββ΄βββββββββ
|
|
27
|
+
βΌ βΌ
|
|
28
|
+
ββββββββββββββββ ββββββββββββββββ
|
|
29
|
+
β Pending Stateβ β Result State β
|
|
30
|
+
β <Skeleton/> β β <WeatherCard>β
|
|
31
|
+
ββββββββββββββββ ββββββββββββββββ
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## 2. Server Implementation (`app/api/chat/route.ts`)
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { openai } from "@ai-sdk/openai";
|
|
40
|
+
import { createDataStreamResponse, streamText, tool } from "ai";
|
|
41
|
+
import { z } from "zod";
|
|
42
|
+
|
|
43
|
+
export const runtime = "edge";
|
|
44
|
+
|
|
45
|
+
export async function POST(req: Request) {
|
|
46
|
+
const { messages } = await req.json();
|
|
47
|
+
|
|
48
|
+
return createDataStreamResponse({
|
|
49
|
+
execute: async (dataStream) => {
|
|
50
|
+
const result = streamText({
|
|
51
|
+
model: openai("gpt-4o"),
|
|
52
|
+
messages,
|
|
53
|
+
tools: {
|
|
54
|
+
displayFlightBooking: tool({
|
|
55
|
+
description: "Display an interactive flight booking card with confirmation controls",
|
|
56
|
+
parameters: z.object({
|
|
57
|
+
flightNumber: z.string(),
|
|
58
|
+
origin: z.string(),
|
|
59
|
+
destination: z.string(),
|
|
60
|
+
price: z.number(),
|
|
61
|
+
}),
|
|
62
|
+
execute: async (flightData) => {
|
|
63
|
+
// Server executes confirmation validation or DB fetch
|
|
64
|
+
return { status: "ready_to_book", ...flightData };
|
|
65
|
+
},
|
|
66
|
+
}),
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
result.mergeIntoDataStream(dataStream);
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## 3. Client Component Mapping (`components/Chat.tsx`)
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
"use client";
|
|
82
|
+
|
|
83
|
+
import { useChat } from "ai/react";
|
|
84
|
+
import { FlightCard } from "@/components/FlightCard";
|
|
85
|
+
import { FlightSkeleton } from "@/components/FlightSkeleton";
|
|
86
|
+
|
|
87
|
+
export function Chat() {
|
|
88
|
+
const { messages, input, handleInputChange, handleSubmit } = useChat();
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<div className="flex flex-col gap-4">
|
|
92
|
+
{messages.map((m) => (
|
|
93
|
+
<div key={m.id} className="space-y-2">
|
|
94
|
+
<p className="font-semibold">{m.role === "user" ? "You" : "AI"}:</p>
|
|
95
|
+
<div>{m.content}</div>
|
|
96
|
+
|
|
97
|
+
{/* Map tool invocations directly to interactive components */}
|
|
98
|
+
{m.toolInvocations?.map((toolInvocation) => {
|
|
99
|
+
const { toolName, toolCallId, state } = toolInvocation;
|
|
100
|
+
|
|
101
|
+
if (toolName === "displayFlightBooking") {
|
|
102
|
+
if (state === "result") {
|
|
103
|
+
return <FlightCard key={toolCallId} data={toolInvocation.result} />;
|
|
104
|
+
}
|
|
105
|
+
return <FlightSkeleton key={toolCallId} />;
|
|
106
|
+
}
|
|
107
|
+
return null;
|
|
108
|
+
})}
|
|
109
|
+
</div>
|
|
110
|
+
))}
|
|
111
|
+
</div>
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 4. Anti-Patterns & Critical Traps
|
|
119
|
+
- β **Dumping Code Strings**: Never have the model output raw JSX/TSX as a string to be `eval()`'d on the client. Always use typed tools that map to existing client components.
|
|
120
|
+
- β **Missing Pending State**: Forgetting to handle `state === 'call'` leaves the UI blank while the server or user executes the tool. Always show a loading skeleton or active card.
|
|
121
|
+
- β **Breaking DataStream Merging**: Forgetting `result.mergeIntoDataStream(dataStream)` prevents tool call arguments from reaching client components.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 5. References & Bundled Utilities
|
|
126
|
+
- Client component tool mapping patterns: [references/clientToolComponentMapping.md](references/clientToolComponentMapping.md)
|
|
127
|
+
- Data stream protocol lifecycle: [references/dataStreamProtocol.md](references/dataStreamProtocol.md)
|
|
128
|
+
- Component generator script: [scripts/generateUiComponentStub.py](scripts/generateUiComponentStub.py)
|