@superblocksteam/vite-plugin-file-sync 2.0.119-next.1 → 2.0.120-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-service/agent/middleware.d.ts.map +1 -1
- package/dist/ai-service/agent/middleware.js +2 -5
- package/dist/ai-service/agent/middleware.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.d.ts.map +1 -1
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js +17 -11
- package/dist/ai-service/agent/prompts/build-base-system-prompt.js.map +1 -1
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts +17 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.d.ts.map +1 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js +219 -0
- package/dist/ai-service/agent/prompts/build-security-scan-prompt.js.map +1 -0
- package/dist/ai-service/agent/tool-message-utils.d.ts.map +1 -1
- package/dist/ai-service/agent/tool-message-utils.js +64 -6
- package/dist/ai-service/agent/tool-message-utils.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts +36 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js +369 -0
- package/dist/ai-service/agent/tools/apis/api-comparator.js.map +1 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts +4 -0
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js +16 -5
- package/dist/ai-service/agent/tools/apis/api-validation-orchestrator.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts +1 -0
- package/dist/ai-service/agent/tools/apis/build-api-artifact.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js +17 -2
- package/dist/ai-service/agent/tools/apis/build-api-artifact.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/build-api.js +17 -15
- package/dist/ai-service/agent/tools/apis/build-api.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-api-docs.d.ts +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js +18 -13
- package/dist/ai-service/agent/tools/apis/get-sdk-api-docs.js.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/apis/test-api.js +138 -2
- package/dist/ai-service/agent/tools/apis/test-api.js.map +1 -1
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts +12 -0
- package/dist/ai-service/agent/tools/build-copy-directory.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-directory.js +51 -0
- package/dist/ai-service/agent/tools/build-copy-directory.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-file.d.ts +12 -0
- package/dist/ai-service/agent/tools/build-copy-file.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-file.js +52 -0
- package/dist/ai-service/agent/tools/build-copy-file.js.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts +57 -0
- package/dist/ai-service/agent/tools/build-copy-utils.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/build-copy-utils.js +37 -0
- package/dist/ai-service/agent/tools/build-copy-utils.js.map +1 -0
- package/dist/ai-service/agent/tools/build-debug.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-debug.js +17 -5
- package/dist/ai-service/agent/tools/build-debug.js.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-finalize.js +42 -50
- package/dist/ai-service/agent/tools/build-finalize.js.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts +7 -5
- package/dist/ai-service/agent/tools/build-manage-checklist.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/build-manage-checklist.js +54 -108
- package/dist/ai-service/agent/tools/build-manage-checklist.js.map +1 -1
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts +103 -0
- package/dist/ai-service/agent/tools/databases/dev-database.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/databases/dev-database.js +117 -0
- package/dist/ai-service/agent/tools/databases/dev-database.js.map +1 -0
- package/dist/ai-service/agent/tools/get-logs.d.ts +1 -1
- package/dist/ai-service/agent/tools/index.d.ts +4 -0
- package/dist/ai-service/agent/tools/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/index.js +4 -0
- package/dist/ai-service/agent/tools/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts +18 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js +99 -0
- package/dist/ai-service/agent/tools/integrations/delete-integration.js.map +1 -0
- package/dist/ai-service/agent/tools/integrations/execute-request.d.ts +1 -1
- package/dist/ai-service/agent/tools/integrations/index.d.ts +1 -0
- package/dist/ai-service/agent/tools/integrations/index.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/index.js +1 -0
- package/dist/ai-service/agent/tools/integrations/index.js.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.d.ts.map +1 -1
- package/dist/ai-service/agent/tools/integrations/metadata.js +30 -4
- package/dist/ai-service/agent/tools/integrations/metadata.js.map +1 -1
- package/dist/ai-service/agent/tools/report-security-findings.d.ts +163 -0
- package/dist/ai-service/agent/tools/report-security-findings.d.ts.map +1 -0
- package/dist/ai-service/agent/tools/report-security-findings.js +52 -0
- package/dist/ai-service/agent/tools/report-security-findings.js.map +1 -0
- package/dist/ai-service/agent/tools.d.ts +2 -0
- package/dist/ai-service/agent/tools.d.ts.map +1 -1
- package/dist/ai-service/agent/tools.js +74 -6
- package/dist/ai-service/agent/tools.js.map +1 -1
- package/dist/ai-service/agent/tools2/example.js +1 -1
- package/dist/ai-service/agent/tools2/example.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts +7 -0
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js +11 -1
- package/dist/ai-service/agent/tools2/tools/ask-multi-choice.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts +7 -0
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js +3 -1
- package/dist/ai-service/agent/tools2/tools/ask-searchable-dropdown.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/download-attachments.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/download-attachments.js +4 -3
- package/dist/ai-service/agent/tools2/tools/download-attachments.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts +9 -0
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js +15 -1
- package/dist/ai-service/agent/tools2/tools/exit-plan-mode.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/list-attachments.js +8 -4
- package/dist/ai-service/agent/tools2/tools/list-attachments.js.map +1 -1
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts +21 -4
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js +87 -11
- package/dist/ai-service/agent/tools2/tools/spawn-coding-subagents.js.map +1 -1
- package/dist/ai-service/agent/tools2/types.d.ts +10 -2
- package/dist/ai-service/agent/tools2/types.d.ts.map +1 -1
- package/dist/ai-service/agent/tools2/types.js.map +1 -1
- package/dist/ai-service/agent/utils.d.ts.map +1 -1
- package/dist/ai-service/agent/utils.js +2 -0
- package/dist/ai-service/agent/utils.js.map +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.d.ts.map +1 -1
- package/dist/ai-service/app-interface/filesystem/draft-manager.js.map +1 -1
- package/dist/ai-service/app-interface/npm-registry.d.ts +137 -0
- package/dist/ai-service/app-interface/npm-registry.d.ts.map +1 -0
- package/dist/ai-service/app-interface/npm-registry.js +415 -0
- package/dist/ai-service/app-interface/npm-registry.js.map +1 -0
- package/dist/ai-service/app-interface/shell.d.ts +38 -0
- package/dist/ai-service/app-interface/shell.d.ts.map +1 -1
- package/dist/ai-service/app-interface/shell.js +222 -1
- package/dist/ai-service/app-interface/shell.js.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.d.ts +5 -0
- package/dist/ai-service/attachments/uploaded-content-part.d.ts.map +1 -1
- package/dist/ai-service/attachments/uploaded-content-part.js +31 -21
- package/dist/ai-service/attachments/uploaded-content-part.js.map +1 -1
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts +105 -0
- package/dist/ai-service/checklist/persisted-checklist-store.d.ts.map +1 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js +498 -0
- package/dist/ai-service/checklist/persisted-checklist-store.js.map +1 -0
- package/dist/ai-service/context-download.d.ts +14 -1
- package/dist/ai-service/context-download.d.ts.map +1 -1
- package/dist/ai-service/context-download.js +80 -0
- package/dist/ai-service/context-download.js.map +1 -1
- package/dist/ai-service/dev-database-client.d.ts +90 -0
- package/dist/ai-service/dev-database-client.d.ts.map +1 -0
- package/dist/ai-service/dev-database-client.js +166 -0
- package/dist/ai-service/dev-database-client.js.map +1 -0
- package/dist/ai-service/features.d.ts +16 -0
- package/dist/ai-service/features.d.ts.map +1 -1
- package/dist/ai-service/features.js +10 -0
- package/dist/ai-service/features.js.map +1 -1
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts +6 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.d.ts.map +1 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js +35 -0
- package/dist/ai-service/filter-disabled-tools-for-migration.js.map +1 -0
- package/dist/ai-service/index.d.ts +11 -1
- package/dist/ai-service/index.d.ts.map +1 -1
- package/dist/ai-service/index.js +86 -37
- package/dist/ai-service/index.js.map +1 -1
- package/dist/ai-service/integrations/store.d.ts +5 -0
- package/dist/ai-service/integrations/store.d.ts.map +1 -1
- package/dist/ai-service/integrations/store.js +19 -2
- package/dist/ai-service/integrations/store.js.map +1 -1
- package/dist/ai-service/judge/tools/submit-feedback.d.ts +1 -1
- package/dist/ai-service/llm/context-v2/context.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/context.js +6 -2
- package/dist/ai-service/llm/context-v2/context.js.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts +8 -1
- package/dist/ai-service/llm/context-v2/manager.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/manager.js +17 -1
- package/dist/ai-service/llm/context-v2/manager.js.map +1 -1
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts +1 -1
- package/dist/ai-service/llm/context-v2/prompts/compaction.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/prompts/compaction.js +3 -3
- package/dist/ai-service/llm/context-v2/types.d.ts +7 -0
- package/dist/ai-service/llm/context-v2/types.d.ts.map +1 -1
- package/dist/ai-service/llm/context-v2/types.js +33 -0
- package/dist/ai-service/llm/context-v2/types.js.map +1 -1
- package/dist/ai-service/llm/impl/clark.d.ts.map +1 -1
- package/dist/ai-service/llm/impl/clark.js +3 -3
- package/dist/ai-service/llm/impl/clark.js.map +1 -1
- package/dist/ai-service/llm/provider.d.ts.map +1 -1
- package/dist/ai-service/llm/provider.js +22 -7
- package/dist/ai-service/llm/provider.js.map +1 -1
- package/dist/ai-service/llm/types.d.ts +14 -1
- package/dist/ai-service/llm/types.d.ts.map +1 -1
- package/dist/ai-service/llmobs/context-registry.d.ts +62 -0
- package/dist/ai-service/llmobs/context-registry.d.ts.map +1 -0
- package/dist/ai-service/llmobs/context-registry.js +115 -0
- package/dist/ai-service/llmobs/context-registry.js.map +1 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts +23 -0
- package/dist/ai-service/llmobs/otel-exporter.d.ts.map +1 -1
- package/dist/ai-service/llmobs/otel-exporter.js +112 -10
- package/dist/ai-service/llmobs/otel-exporter.js.map +1 -1
- package/dist/ai-service/llmobs/tracer.d.ts +7 -0
- package/dist/ai-service/llmobs/tracer.d.ts.map +1 -1
- package/dist/ai-service/llmobs/tracer.js +38 -0
- package/dist/ai-service/llmobs/tracer.js.map +1 -1
- package/dist/ai-service/skills/system/_registry.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/_registry.generated.js +2 -0
- package/dist/ai-service/skills/system/_registry.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js +2 -0
- package/dist/ai-service/skills/system/superblocks-frontend/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js +3 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/focused-debug.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js +29 -0
- package/dist/ai-service/skills/system/superblocks-migration/references/yaml-block-mapping.generated.js.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js +139 -7
- package/dist/ai-service/skills/system/superblocks-migration/skill.generated.js.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts +2 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.d.ts.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js +107 -0
- package/dist/ai-service/skills/system/third-party-migration/claude-design.generated.js.map +1 -0
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.d.ts.map +1 -1
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js +33 -3
- package/dist/ai-service/skills/system/third-party-migration/skill.generated.js.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.d.ts +21 -0
- package/dist/ai-service/state-machine/clark-fsm.d.ts.map +1 -1
- package/dist/ai-service/state-machine/clark-fsm.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/agent-planning.js +79 -6
- package/dist/ai-service/state-machine/handlers/agent-planning.js.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts +10 -0
- package/dist/ai-service/state-machine/handlers/llm-generating.d.ts.map +1 -1
- package/dist/ai-service/state-machine/handlers/llm-generating.js +69 -41
- package/dist/ai-service/state-machine/handlers/llm-generating.js.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.d.ts +35 -7
- package/dist/ai-service/state-machine/helpers/peer.d.ts.map +1 -1
- package/dist/ai-service/state-machine/helpers/peer.js +81 -15
- package/dist/ai-service/state-machine/helpers/peer.js.map +1 -1
- package/dist/ai-service/template-renderer.d.ts +14 -1
- package/dist/ai-service/template-renderer.d.ts.map +1 -1
- package/dist/ai-service/template-renderer.js +144 -41
- package/dist/ai-service/template-renderer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js +2 -2
- package/dist/ai-service/transform/api-builder/to-sdk-transformer.js.map +1 -1
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js +2 -2
- package/dist/ai-service/transform/api-builder/to-yaml-transformer.js.map +1 -1
- package/dist/draft-interface.d.ts +1 -1
- package/dist/draft-interface.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.d.ts.map +1 -1
- package/dist/file-sync-vite-plugin.js +34 -27
- package/dist/file-sync-vite-plugin.js.map +1 -1
- package/dist/file-system-helpers.d.ts +4 -0
- package/dist/file-system-helpers.d.ts.map +1 -1
- package/dist/file-system-helpers.js +13 -0
- package/dist/file-system-helpers.js.map +1 -1
- package/dist/inject-index-vite-plugin.d.ts.map +1 -1
- package/dist/inject-index-vite-plugin.js +15 -1
- package/dist/inject-index-vite-plugin.js.map +1 -1
- package/dist/injected-index.d.ts.map +1 -1
- package/dist/injected-index.js +15 -1
- package/dist/injected-index.js.map +1 -1
- package/dist/lock-service/index.d.ts.map +1 -1
- package/dist/lock-service/index.js +8 -10
- package/dist/lock-service/index.js.map +1 -1
- package/dist/migration/migration-checklist.d.ts +51 -2
- package/dist/migration/migration-checklist.d.ts.map +1 -1
- package/dist/migration/migration-checklist.js +79 -151
- package/dist/migration/migration-checklist.js.map +1 -1
- package/dist/migration/migration-routes.d.ts.map +1 -1
- package/dist/migration/migration-routes.js +290 -30
- package/dist/migration/migration-routes.js.map +1 -1
- package/dist/migration/migration-verification.d.ts +206 -0
- package/dist/migration/migration-verification.d.ts.map +1 -0
- package/dist/migration/migration-verification.js +1006 -0
- package/dist/migration/migration-verification.js.map +1 -0
- package/dist/migration/recommended-user-deps.d.ts +39 -0
- package/dist/migration/recommended-user-deps.d.ts.map +1 -0
- package/dist/migration/recommended-user-deps.js +209 -0
- package/dist/migration/recommended-user-deps.js.map +1 -0
- package/dist/migration/restructure.d.ts +29 -2
- package/dist/migration/restructure.d.ts.map +1 -1
- package/dist/migration/restructure.js +145 -6
- package/dist/migration/restructure.js.map +1 -1
- package/dist/migration/scan-imports.d.ts +7 -0
- package/dist/migration/scan-imports.d.ts.map +1 -0
- package/dist/migration/scan-imports.js +178 -0
- package/dist/migration/scan-imports.js.map +1 -0
- package/dist/migration/translation-prompt.d.ts.map +1 -1
- package/dist/migration/translation-prompt.js +2 -0
- package/dist/migration/translation-prompt.js.map +1 -1
- package/dist/migration/unsupported-integrations.d.ts.map +1 -1
- package/dist/migration/unsupported-integrations.js +9 -0
- package/dist/migration/unsupported-integrations.js.map +1 -1
- package/dist/migration/yaml-walk.d.ts +18 -0
- package/dist/migration/yaml-walk.d.ts.map +1 -0
- package/dist/migration/yaml-walk.js +45 -0
- package/dist/migration/yaml-walk.js.map +1 -0
- package/dist/migration-templates/app-fullstack/client/components/hooks/use-mobile.ts +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/accordion.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/avatar.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/breadcrumb.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/button.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/calendar.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/chart.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/file-dropzone.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/file-input.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/hover-card.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/image.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/input.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/label.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/navigation-menu.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/pagination.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/popover.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/progress.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/select.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/sheet.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/sidebar.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/slider.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/switch.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/table.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/tabs.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle-group.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/toggle.tsx +1 -1
- package/dist/migration-templates/app-fullstack/client/components/ui/tooltip.tsx +1 -1
- package/dist/socket-manager.d.ts.map +1 -1
- package/dist/socket-manager.js +8 -0
- package/dist/socket-manager.js.map +1 -1
- package/dist/sync-service/hash-dir-tree.d.ts +1 -1
- package/dist/sync-service/hash-dir-tree.d.ts.map +1 -1
- package/dist/sync-service/hash-dir-tree.js +3 -3
- package/dist/sync-service/hash-dir-tree.js.map +1 -1
- package/dist/sync-service/index.d.ts +0 -14
- package/dist/sync-service/index.d.ts.map +1 -1
- package/dist/sync-service/index.js +1 -44
- package/dist/sync-service/index.js.map +1 -1
- package/dist/sync-service/list-dir.d.ts +1 -1
- package/dist/sync-service/list-dir.d.ts.map +1 -1
- package/dist/sync-service/list-dir.js +36 -3
- package/dist/sync-service/list-dir.js.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.d.ts +1 -1
- package/dist/sync-service/snapshot/take-snapshot.d.ts.map +1 -1
- package/dist/sync-service/snapshot/take-snapshot.js +4 -8
- package/dist/sync-service/snapshot/take-snapshot.js.map +1 -1
- package/dist/util/log-sanitizer.d.ts +6 -5
- package/dist/util/log-sanitizer.d.ts.map +1 -1
- package/dist/util/log-sanitizer.js +21 -6
- package/dist/util/log-sanitizer.js.map +1 -1
- package/package.json +9 -8
|
@@ -21,11 +21,13 @@ If any situation below is not resolved deterministically by this document, **STO
|
|
|
21
21
|
|
|
22
22
|
Corollary: do not add \`// TODO\` comments that silently ship. Unresolved items live only as \`failed\` checklist entries.
|
|
23
23
|
|
|
24
|
+
Corollary for \`migration_page_route_verification_*\`: see the _Page route verification_ section below — screenshot timeout/error → \`failed\`, never \`completed\`, never "verified via router/source inspection." The full rule (including the hard-rule restatements) lives there to avoid drift.
|
|
25
|
+
|
|
24
26
|
## Inputs and outputs
|
|
25
27
|
|
|
26
28
|
- **Source tree:** \`scratch/v2-backup/apis/<ApiName>/api.yaml\`. Discover the actual set by listing the directory — do not hardcode a count or list.
|
|
27
29
|
- **Target tree:** \`server/apis/<ApiName>/api.ts\`. Do not create scaffolding trees that do not already exist (see "Registry registration" below).
|
|
28
|
-
- **Checklist:** the migration checklist has already been seeded with one item per API (id \`api_<ApiName>\`, origin \`
|
|
30
|
+
- **Checklist:** the migration checklist has already been seeded with one item per API (id \`api_<ApiName>\`, origin \`2.0-upgrade\`, status \`pending\`, \`clearOnFinalize: false\`). Legacy in-flight runs may still have \`origin: "seed_api"\` for these API items. Pull the live set by calling \`build_manageChecklist\` with \`action: "get"\` and filtering to \`status: "pending"\` plus API-migration origins (\`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`) — that is your authoritative API list and count for this turn.
|
|
29
31
|
|
|
30
32
|
## Required reading (read these BEFORE writing any output)
|
|
31
33
|
|
|
@@ -38,13 +40,35 @@ Authoritative. If a rule here conflicts with your priors, these win.
|
|
|
38
40
|
- If a vendor-specific factory exists for the target service (e.g., a dedicated one for a given LLM provider), prefer it over a generic HTTP one.
|
|
39
41
|
4. \`skills/system/superblocks-migration/references/yaml-block-mapping.md\` — full YAML → TS mapping for each legacy block type.
|
|
40
42
|
|
|
41
|
-
There is **no \`javascript\` integration** in sdk-api — inline JS/TS lives directly inside \`run(ctx, input)\`. Any block whose YAML key is \`javascript:\` becomes plain TypeScript in \`run()\`.
|
|
43
|
+
There is **no \`javascript\` integration** in sdk-api — inline JS/TS lives directly inside \`run(ctx, input)\`. Any block whose YAML key is \`javascript:\` becomes plain TypeScript in \`run()\`. The same applies to **\`python:\` blocks**: there is no \`python\` integration in sdk-api, so port the body to inline TypeScript inside \`run(ctx, input)\` (see "Substituting unsupported integrations" below and the Python section in \`yaml-block-mapping.md\`).
|
|
44
|
+
|
|
45
|
+
## Substituting unsupported integrations
|
|
46
|
+
|
|
47
|
+
The pre-migration UI warns the user when an app references integrations whose v2 plugin is not present in sdk-api. The migration is **not** aborted on those APIs — they are still in your \`seed_api\` checklist and you are expected to make a best-effort port rather than immediately marking them \`failed\`.
|
|
48
|
+
|
|
49
|
+
Substitution rules (apply in order; first match wins):
|
|
50
|
+
|
|
51
|
+
1. **\`python:\` step → inline TypeScript.** Re-write the Python body as equivalent TypeScript inside \`run(ctx, input)\`, exactly the way \`javascript:\` blocks are inlined. Translate Python idioms to JS/TS (e.g. \`requests.get(...)\` → \`fetch(...)\`, list comprehensions → \`array.map\`/\`filter\`, \`len(x)\` → \`x.length\`, dict access → object property access, \`os.environ[...]\` → \`process.env[...]\`, raise/except → \`throw\`/\`try…catch\`). If the Python relied on a third-party PyPI package with no obvious JS equivalent, mark that one API \`failed\` with a \`failureReason\` naming the package — do not ship a guess.
|
|
52
|
+
2. **HTTP-shaped vendor plugin → REST.** If an unsupported integration was effectively making REST calls (e.g. a thin wrapper around an HTTP API) and you can read the request shape from the YAML, port it to the \`restApi\` factory from sdk-api (or the dedicated vendor factory if one exists in the barrel — check \`node_modules/@superblocksteam/sdk-api/src/index.ts\`).
|
|
53
|
+
3. **Otherwise, mark \`failed\`.** Per the meta-rule, do not invent a factory or fabricate behavior. Use \`build_manageChecklist\` with \`status: "failed"\` and a concrete \`failureReason\` (e.g. \`"unsupported integration <pluginId> with no JS-equivalent path"\`).
|
|
54
|
+
|
|
55
|
+
Do **not** silently skip a step or replace it with a \`// TODO\` — every API still needs a deterministic outcome (\`completed\` or \`failed\`) on the checklist.
|
|
42
56
|
|
|
43
57
|
## Preflight gate (MUST pass before any file edits)
|
|
44
58
|
|
|
45
59
|
Complete this orientation sequence before writing or modifying any API file:
|
|
46
60
|
|
|
47
|
-
|
|
61
|
+
0. **Install recommended user dependencies (before API work).** The platform restructure already computed exactly which v2 user-added packages the migrated client/server code imports, and persisted them at \`scratch/migration-state.json\` → \`recommendedUserDeps\` (each entry has \`name\`, \`version\`, and \`dev\`). Your job is to install that list — not to recompute it.
|
|
62
|
+
- Mark \`migration_dependency_verification\` as \`in_progress\` via \`build_manageChecklist\`.
|
|
63
|
+
- Read \`scratch/migration-state.json\` and extract \`recommendedUserDeps\`.
|
|
64
|
+
- If \`recommendedUserDeps\` is missing or empty, mark \`migration_dependency_verification\` as \`completed\` and continue to step 1.
|
|
65
|
+
- Otherwise, call \`build_installPackages\` **once** with every entry from \`recommendedUserDeps\` (passing \`name\`, \`version\`, and \`dev\` through unchanged). Do **not** skip because \`node_modules\` exists on disk; the platform never wrote these packages into \`package.json\`.
|
|
66
|
+
- **Failure semantics (covers every non-success outcome — no judgment calls):**
|
|
67
|
+
- On full success → mark \`migration_dependency_verification\` as \`completed\`.
|
|
68
|
+
- On **any** failure — full, partial (some packages installed, others did not), structured registry error (\`not_in_registry\`, \`registry_auth_failed\`, \`registry_unreachable\`), or unstructured error — mark \`migration_dependency_verification\` as \`failed\` with a \`failureReason\` that lists the affected package names and the tool's verbatim error code or message. Treat partial success the same as full failure for checklist purposes; do not split into multiple checklist items. Then continue to step 1 so API translation can still proceed. The user/operator will repair the registry/packages and re-trigger the migration turn.
|
|
69
|
+
- If \`scratch/migration-state.json\` also contains \`recommendedUserDepsPinnedToLatest\` (a string array of package names), include those names in the \`failureReason\` of \`migration_dependency_verification\` even on full success — phrased as "pinned to latest, may need user confirmation: <names>" — so the user can downgrade them before runtime if the latest major is incompatible. Use status \`completed\` in this case (the install succeeded), but the surfaced reason gives the user a checkpoint to act on.
|
|
70
|
+
- Do **not** scan imports yourself, edit \`package.json\`, or add packages outside \`recommendedUserDeps\`. If you believe a package is missing from the list, that is a platform bug: mark \`migration_dependency_verification\` as \`failed\` with \`failureReason: "platform bug: <pkg> imported by <file> but absent from recommendedUserDeps"\` and continue with API work using the packages that did install. (\`build_manageChecklist\` has no \`note\` action — \`failed\` with a structured \`failureReason\` is the only way to record this.)
|
|
71
|
+
1. Call \`build_manageChecklist\` with \`action: "get"\` and filter to \`status: "pending"\` and API-migration origins (\`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`) — this is your authoritative API list and count for this turn.
|
|
48
72
|
2. Read \`node_modules/@superblocksteam/sdk-api/src/index.ts\` and treat it as the **only** source of truth for sdk-api export/factory names.
|
|
49
73
|
3. Read \`node_modules/@superblocksteam/sdk-api/README.md\`.
|
|
50
74
|
4. For each API, read only the integration README(s) needed for that API right before migrating it (just-in-time). Do **not** preload every integration README for the entire app.
|
|
@@ -52,7 +76,7 @@ Complete this orientation sequence before writing or modifying any API file:
|
|
|
52
76
|
Hard constraints:
|
|
53
77
|
|
|
54
78
|
- Do **not** rely on prior conversation memory, "knowledge" summaries, or inferred export names.
|
|
55
|
-
- Do **not** start editing API files until preflight steps
|
|
79
|
+
- Do **not** start editing API files until preflight steps 0–3 are complete.
|
|
56
80
|
- If a required file cannot be read, mark that API's checklist item \`failed\` with a concrete \`failureReason\` that names the missing path.
|
|
57
81
|
|
|
58
82
|
## File layout & exports
|
|
@@ -94,6 +118,38 @@ Runtime verification (required):
|
|
|
94
118
|
2. Use risk-based runtime checks: run \`testApi\` for APIs with integrations (REST/vendor/SQL), multi-step control flow, transformed outputs, or any uncertainty. For obviously simple APIs, you may skip \`testApi\`.
|
|
95
119
|
3. If \`testApi\` output appears stale or mismatched, run \`build_reloadFile\` once and re-test. If runtime still fails after documented-method verification + one reload/retest cycle, record a concrete \`failureReason\` and continue.
|
|
96
120
|
|
|
121
|
+
Page route verification (required once per migration run):
|
|
122
|
+
|
|
123
|
+
**Hard rule:** A route is verified only with **runtime visual evidence on that exact path**. Reading \`client/router.tsx\`, page source, or backup artifacts is orientation only — it **never** satisfies verification.
|
|
124
|
+
|
|
125
|
+
**Hard rule:** \`build_debug\` passing and \`get_runtime_errors\` returning \`count: 0\` are **not sufficient** for route verification. Do not mark routes \`completed\` because "only APIs changed" or "the frontend files are unchanged."
|
|
126
|
+
|
|
127
|
+
**Hard rule:** If \`build_captureScreenshot\` errors or times out for a route, mark that \`migration_page_route_verification_*\` item \`failed\` with \`failureReason\` naming the path and outcome (prefix \`page_route_screenshot_timeout:\` or \`page_route_screenshot_error:\`). Do **not** mark \`completed\`. Do **not** substitute router/source inspection.
|
|
128
|
+
|
|
129
|
+
### Evidence required per route
|
|
130
|
+
|
|
131
|
+
Mark \`completed\` only when **all** are true:
|
|
132
|
+
|
|
133
|
+
1. The app preview is on **that route's path** (not merely the default route).
|
|
134
|
+
2. \`build_captureScreenshot\` **succeeds** and returns an image you inspect.
|
|
135
|
+
3. You **describe** what you see and confirm it is not a loading-only view (follow the screenshot tool's skeleton/spinner retry procedure first).
|
|
136
|
+
4. Any route-specific runtime errors are resolved (re-check after fixes).
|
|
137
|
+
|
|
138
|
+
### Procedure (one route at a time)
|
|
139
|
+
|
|
140
|
+
1. Enumerate checklist items whose IDs start with \`migration_page_route_verification_\`.
|
|
141
|
+
2. Enumerate paths from \`scratch/v2-backup/router.tsx\` (fallback: \`scratch/v2-backup/pages/**/index.tsx\` confirmed against \`client/router.tsx\`).
|
|
142
|
+
3. For each route: set the matching item \`in_progress\` → navigate the preview to that path (\`browser_playwright_action\` when available; otherwise use the editor route picker / navigation mechanism — **do not** screenshot whatever route happens to be visible) → \`build_captureScreenshot\` → on success, \`completed\`.
|
|
143
|
+
4. If the preview looks stale, \`build_reloadFile\` **once**, then retry screenshot. If capture still fails, \`failed\` with \`failureReason\` as above.
|
|
144
|
+
5. Fix import/lazy-load/runtime failures, then repeat from step 3 for that route.
|
|
145
|
+
|
|
146
|
+
### Forbidden shortcuts
|
|
147
|
+
|
|
148
|
+
- Marking \`completed\` because \`client/router.tsx\` lists the path
|
|
149
|
+
- Marking \`completed\` because the page module exists under \`client/pages/\`
|
|
150
|
+
- Marking \`completed\` after screenshot timeout/error
|
|
151
|
+
- Batch-marking all route items without per-route screenshot evidence
|
|
152
|
+
|
|
97
153
|
For each converted API, self-check:
|
|
98
154
|
|
|
99
155
|
1. File default-exports exactly one \`api({...})\`; \`name\` matches \`metadata.name\`.
|
|
@@ -106,7 +162,7 @@ For each converted API, self-check:
|
|
|
106
162
|
|
|
107
163
|
## Parallelization policy
|
|
108
164
|
|
|
109
|
-
Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"\`, filter \`origin: "
|
|
165
|
+
Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"\`, filter \`status: "pending"\` and API-migration origins: \`origin: "2.0-upgrade"\` or legacy \`origin: "seed_api"\`).
|
|
110
166
|
|
|
111
167
|
- **If the pending count is \`< 8\`:** migrate the APIs yourself, sequentially. Do NOT call \`spawnCodingSubagents\`. Work through each API using the per-API procedure below.
|
|
112
168
|
- **If the pending count is \`>= 8\`:** you **MUST spawn sub-agents** to migrate these APIs in parallel. There are too many APIs to migrate sequentially yourself. Do NOT attempt to migrate APIs yourself in this run — use \`spawnCodingSubagents\`.
|
|
@@ -115,6 +171,7 @@ Count pending APIs from the checklist (\`build_manageChecklist\` \`action: "get"
|
|
|
115
171
|
- Names the exact \`<ApiName>\` values that sub-agent owns, verbatim, as a bulleted list.
|
|
116
172
|
- Restates the per-API procedure below so the sub-agent is self-contained.
|
|
117
173
|
- Reminds the sub-agent to update the shared checklist (id \`api_<ApiName>\`) for every item it owns.
|
|
174
|
+
- **Also pass \`apiNames: ["<ApiName1>", "<ApiName2>", …]\` for every sub-agent**, listing the same names that appear in its \`instructions\`. The spawn tool stamps each \`api_<ApiName>\` checklist item with that sub-agent's \`id\` as \`workerId\` BEFORE fan-out, which lets the migration UI render one batch row per sub-agent in the chat sidebar. Forgetting \`apiNames\` is non-fatal (the sub-agents still run) but the sidebar checklist will fall back to one row per API instead of one per batch.
|
|
118
175
|
- **Call \`spawnCodingSubagents\` as the ONLY tool call in that turn.** Do not emit any other tool calls alongside it — no reads, no writes, no checklist updates. The tool blocks until every sub-agent finishes; you cannot do migration work "while waiting" because there is no waiting from your perspective — your next turn only begins after the tool returns. If you emit other tool calls in the same turn, you and the sub-agents will race on the shared checklist and corrupt state.
|
|
119
176
|
- **After \`spawnCodingSubagents\` returns** — only in a subsequent turn — read the checklist via \`build_manageChecklist\` with \`action: "get"\`. For any \`failed\` items, review the \`failureReason\`. Retry small numbers of recoverable failures yourself (sequentially, using the per-API procedure below). Leave deterministic failures as \`failed\`.
|
|
120
177
|
|
|
@@ -126,12 +183,87 @@ For APIs you migrate yourself, or that you embed in a sub-agent's \`instructions
|
|
|
126
183
|
2. Read \`scratch/v2-backup/apis/<ApiName>/api.yaml\` and any sibling files the blocks reference.
|
|
127
184
|
3. Produce the TypeScript module at \`server/apis/<ApiName>/api.ts\`, overwriting the stub. Use the YAML block → TS mapping in \`skills/system/superblocks-migration/references/yaml-block-mapping.md\`.
|
|
128
185
|
4. If \`server/apis/index.ts\` exists, update it to register the new module.
|
|
129
|
-
5.
|
|
130
|
-
6.
|
|
186
|
+
5. Call \`build_debug\`. If it fails, fix and repeat until it passes. Do not proceed to step 6 until \`build_debug\` succeeds.
|
|
187
|
+
6. **Call \`runMigrationVerification({ apiName: "<ApiName>", inputs: <inputs> })\` and resolve every divergence in this same chat.** The tool's response includes \`attempt\` and \`maxAttempts\` so you don't need to track an attempt counter yourself — the server reads it from on-disk history per API.
|
|
188
|
+
|
|
189
|
+
Your job is to make v3 produce the same response as v2 — not to "try a few times and punt to the user". The user already lived with this API working on v2 with their real data; if v3 doesn't match, that's a regression you introduced, and you fix it here. NEVER leave a \`diverged\` API for the user to "Accept divergence" or "Try one more attempt" via the API calls panel — those buttons exist as escape hatches for situations the policy gate requires (mutations, denied integrations), not as a way for you to skip work.
|
|
190
|
+
|
|
191
|
+
Synthesize \`inputs\` the same way you would for \`testApi\`: inspect the v2 YAML from step 2 and the v3 TS from step 3, enumerate every binding the API references that isn't produced by an earlier block (component values like \`Input1.value\`/\`Select1.selectedItem.id\`, table selections like \`Table1.selectedRow\`, state variables, workflow \`body\`/\`params\`), and pick a realistic mock value for each matching the binding's expected type. Both v2 and v3 receive the same \`inputs\`, so this is what makes the diff meaningful — \`{}\` for an API with bindings produces a vacuous \`both_failed\` that tells you nothing.
|
|
192
|
+
|
|
193
|
+
Outcomes and how to resolve them:
|
|
194
|
+
- **\`passed\`**: call \`build_manageChecklist\` with \`status: "completed"\`. Done.
|
|
195
|
+
|
|
196
|
+
- **\`skipped_mutation\`**: this is a policy gate, not a deterministic pass. Do **NOT** mark the checklist item \`completed\` yet. Leave it unresolved (keep \`in_progress\`), continue processing other APIs, and resolve all skipped items in one grouped decision at the end of the run (see "Mutation policy follow-up" below).
|
|
197
|
+
|
|
198
|
+
- **\`v2_unrunnable\`**: the v2 backup itself couldn't execute, so there is no baseline to match. Call \`build_manageChecklist\` with \`status: "completed"\` and continue.
|
|
199
|
+
|
|
200
|
+
- **\`both_failed\`**:
|
|
201
|
+
- If you passed \`inputs: {}\` and the API references bindings: synthesize real \`inputs\` (per the bullet above) and retry. Do NOT mark completed here — empty inputs caused this, not a real failure.
|
|
202
|
+
- If you passed real inputs and v2 still failed: read v2's error. If it is environmental (auth/credentials/integration-unavailable: "no integration configured", "401", "ECONNREFUSED", "missing API key"), v2 cannot run in this verification context regardless of what you do — call \`build_manageChecklist\` with \`status: "completed"\` and continue; the user will verify manually. If it's a v2 runtime error that v3 also reproduces, treat as \`diverged\` (your inputs are wrong, or the API expects state that isn't reproducible here — revise inputs and retry).
|
|
203
|
+
|
|
204
|
+
- **\`error\`**: a system error in the verification flow itself (cannot read v3 source, etc.). Fix what you can; if it persists across one retry, mark the item \`failed\` with \`failureReason: "<error detail>"\` and continue.
|
|
205
|
+
|
|
206
|
+
- **\`diverged\`**: the API ran on both sides and the outputs differ. **Iterate until v3 matches v2 byte-for-byte (modulo the normalizations api-comparator already applies: identical ISO timestamps, near-now ISO timestamps within ±60s of each other and ±5min of "now", UUIDs, monotonic integer IDs differing by ≤1 on fields whose leaf ends with "id", floats within 1e-9 relative tolerance, and per-request opaque identifiers at leaves named \`requestId\`/\`traceId\`/\`spanId\`/\`correlationId\`/\`sessionId\`/\`nonce\`/\`csrfToken\`/\`_id\` — note: a bare leaf named \`token\` is intentionally NOT normalized, since auth/access-token divergence is a security-relevant signal we want to surface).**
|
|
207
|
+
|
|
208
|
+
There is one bounded judgment exception: if both v2 and v3 executions succeeded, the output shape/types are equivalent, and the remaining diffs are value-level fields you reasonably infer are inherently non-deterministic outputs for this API, treat the migration as semantically complete for this run. In that case, mark the checklist item \`completed\` and continue.
|
|
209
|
+
|
|
210
|
+
Use this exception only when all of the following are true:
|
|
211
|
+
- The divergence is not structural (no missing/extra fields, no type mismatch, no changed nesting/cardinality, no changed error/status behavior).
|
|
212
|
+
- The differing fields are expected to vary per invocation and do not change control flow decisions.
|
|
213
|
+
- The API's functional contract remains intact for downstream consumers.
|
|
214
|
+
|
|
215
|
+
If any of those conditions are not met, the divergence is semantic and must be fixed — do NOT add code purely to mask values the comparator already tolerates.
|
|
216
|
+
|
|
217
|
+
For each \`summaryForAgent\` entry — every entry names the JSON path that diverged and the v2/v3 values — find the block in \`server/apis/<ApiName>/api.ts\` that produces that path and fix the discrepancy. Common causes, in rough order of frequency:
|
|
218
|
+
- wrong column projection or missing field in a SELECT
|
|
219
|
+
- missing transform / output shape mismatch (array vs object wrapper, single vs list)
|
|
220
|
+
- off-by-one or wrong placeholder in a SQL parameter
|
|
221
|
+
- mistyped binding key (case, plural, dotted path)
|
|
222
|
+
- type coercion (string vs number, null vs undefined, boolean vs "true")
|
|
223
|
+
- missing default value when the binding is undefined
|
|
224
|
+
- wrong join order or implicit ordering of rows
|
|
225
|
+
- filter/where condition different from v2
|
|
226
|
+
- missing \`LIMIT\`, \`OFFSET\`, or pagination handling
|
|
227
|
+
|
|
228
|
+
If a divergence stems from the \`inputs\` you passed (e.g. v2 echoes the input one way and v3 a different way because they normalize it differently), revise the inputs alongside the source.
|
|
229
|
+
|
|
230
|
+
Then call \`build_debug\` (fix any failures), then \`runMigrationVerification\` again with the revised source/inputs.
|
|
231
|
+
|
|
232
|
+
**There is no fixed retry budget — iterate until \`passed\` or until you have firm structural evidence that no v3 source change can reconcile v2 and v3.** Acceptable evidence for stopping: v2 references a YAML construct with no v3 SDK equivalent and the divergence is in that construct; v2 derives a value from runtime state v3 cannot observe (e.g. an env var that differs by environment). When you stop on structural grounds, mark the item \`failed\` with \`failureReason: "verification_diverged_irreconcilable: <one-paragraph reason naming the specific summaryForAgent entry and the structural reason> | summary: <JSON.stringify(summaryForAgent)>"\`.
|
|
233
|
+
|
|
234
|
+
Guardrail against infinite loops (NOT a retry budget): if you have iterated 8 times on the same API and the set of divergences has not materially changed across the last 3 attempts (i.e. you are flailing, not converging), stop and mark \`failed\` with the same \`failureReason\` shape. If you ARE converging — fewer divergences each attempt, or the remaining ones look smaller — keep going past 8.
|
|
131
235
|
|
|
132
236
|
## Run-level rules
|
|
133
237
|
|
|
134
238
|
- Do NOT emit a free-text UNRESOLVED report — every unresolved item must be a \`failed\` checklist entry with a \`failureReason\`.
|
|
135
239
|
- Do NOT stop the run because one API failed. Only stop once every API is either \`completed\` or \`failed\`.
|
|
240
|
+
|
|
241
|
+
## Mutation policy follow-up (required once per run if any API returned \`skipped_mutation\`)
|
|
242
|
+
|
|
243
|
+
After you've done everything deterministic (all non-skipped APIs settled), if one or more APIs ended with \`skipped_mutation\`, call **one** grouped \`askMultiChoice\` with exactly these options:
|
|
244
|
+
|
|
245
|
+
- \`Mark all untested APIs as complete\`
|
|
246
|
+
- \`Test them, and you'll be prompted for permission\`
|
|
247
|
+
|
|
248
|
+
Then:
|
|
249
|
+
|
|
250
|
+
1. If user picks **\`Mark all untested APIs as complete\`**:
|
|
251
|
+
- For each skipped API checklist item, call \`build_manageChecklist\` update → \`status: "completed"\`.
|
|
252
|
+
2. If user picks **\`Test them, and you'll be prompted for permission\`**:
|
|
253
|
+
- Clear persisted write-policy first so \`deny\`/\`ask\` modal state does not keep forcing \`skipped_mutation\`:
|
|
254
|
+
- read \`scratch/migration-state.json\`
|
|
255
|
+
- remove the \`integrationWritePolicy\` field
|
|
256
|
+
- write the file back
|
|
257
|
+
- Then run \`testApi\` for each skipped API so the runtime can prompt the user for write approval in-context.
|
|
258
|
+
- After user approvals and tests settle, update checklist status accordingly (\`completed\` on success, \`failed\` with concrete \`failureReason\` on deterministic blockers).
|
|
259
|
+
|
|
260
|
+
## Post-batch re-verification
|
|
261
|
+
|
|
262
|
+
After \`spawnCodingSubagents\` returns (or after all sequential APIs are settled), before updating the checklist overall status:
|
|
263
|
+
|
|
264
|
+
1. Call \`build_manageChecklist\` with \`action: "get"\` and read all items.
|
|
265
|
+
2. For any item where \`verificationOutcome === "auto_passed"\` and \`lastVerificationAt\` is older than any sibling item's \`updatedAt\` minus 60 seconds: this item may have drifted due to registry edits made by later sub-agents. Re-run \`runMigrationVerification({ apiName, inputs: <inputs> })\` for each such item — synthesize \`inputs\` the same way as in step 6 of the per-API procedure.
|
|
266
|
+
3. If any re-verification produces \`diverged\`, apply the normal per-API diverge→retry loop (no fixed retry budget; iterate until \`passed\` or firm structural-irreconcilability evidence, with the anti-flail guardrail at 8 iterations without convergence).
|
|
267
|
+
4. Proceed to mark overall checklist completed/failed only after all re-verifications settle.
|
|
136
268
|
`;
|
|
137
269
|
//# sourceMappingURL=skill.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/superblocks-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyQtB,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const content = "# Claude Design-specific mapping\n\nThis is a per-platform reference loaded from `SKILL.md`. The framework \u2014 target layout, universal mapping, non-negotiables, workflow, code-emission rules \u2014 lives there. This file documents only what is specific to a Claude Design source.\n\n> Claude Design is a prototype-design tool from Anthropic. Its \"Download project as .zip\" output is a tiny, self-contained, **frontend-only** prototype: a single `<Name>.html` shell that loads React, ReactDOM, and Babel from a CDN and `<script type=\"text/babel\" src=\"...\">` files that compile in the browser at run time. There is **no backend, no `package.json`, no build step, and no module system** \u2014 every helper is hung off `window.*` or pulled from globals. Treat the export as design-quality intent (layout, typography, color, interactions, copy) that needs to be re-expressed inside the Superblocks fullstack template (Vite + React + react-router v7 + Tailwind v4 + shadcn/ui). The framework's \"Don't fabricate a backend\" rule applies \u2014 if the source is purely UI driven by inline mock data, the migrated app stays frontend-only unless the user explicitly asks for one.\n\n## Where the source lives\n\nDefinitive marker: a flat archive (no nested project folder) containing exactly one top-level `<Name>.html` file plus sibling JSX/JS files, with the HTML loading React, ReactDOM, and `@babel/standalone` from `unpkg.com` and using `<script type=\"text/babel\" src=\"...\">` for the JSX files. No `package.json`, no `node_modules`, no `vite.config.*`, no `tsconfig.json`.\n\nStrong supporting signals:\n\n- The HTML root tag is `<html lang=\"...\" data-theme=\"light\">` (or `\"dark\"`); theme switching happens by mutating `data-theme` on `<html>` and CSS variables defined under `:root[data-theme=\"light\"]` / `:root[data-theme=\"dark\"]`.\n- A `tweaks-panel.jsx` sibling that defines a draggable in-canvas controls panel and exposes `useTweaks`, `TweaksPanel`, `TweakSection`, `TweakSlider`, `TweakRadio`, `TweakColor`, `TweakToggle` as window globals. The host protocol is `__activate_edit_mode` / `__deactivate_edit_mode` postMessage handshakes plus `__edit_mode_available` / `__edit_mode_set_keys` / `__edit_mode_dismissed` responses.\n- An `app.jsx` whose top has `const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ ... }/*EDITMODE-END*/;` \u2014 the `EDITMODE-BEGIN` / `EDITMODE-END` markers are how the Claude Design canvas locates and rewrites the defaults block.\n- A `data.js` (or similarly named sibling) that hangs sample data off `window.*`: e.g. `window.ORDERS = [...]; window.KPIS = [...];`. Components consume the globals directly (`/* global React, ReactDOM, ORDERS, KPIS, useTweaks, ... */` at the top of `app.jsx`).\n- Mounting happens at the bottom of `app.jsx` via `ReactDOM.createRoot(document.getElementById(\"root\")).render(<App />);` against a single `<div id=\"root\"></div>` in the HTML body.\n- Inline `<style>` block in `<head>` defines the entire visual system: a light + dark token palette under `:root[data-theme=\"...\"]`, body typography (commonly DM Sans + JetBrains Mono via Google Fonts), all component styles by hand-rolled BEM-ish class names (`.topbar`, `.brand`, `.kpi`, `.orders-table`, etc.). No Tailwind, no shadcn primitives in the source.\n\nIf the user gave a path, use it. Otherwise look for the markers above in the working tree. If you see a flat archive with `EDITMODE-BEGIN` markers and a CDN-loaded React shell, it is a Claude Design export. If anything is ambiguous (e.g. someone hand-built a similar HTML+JSX shell), ask before assuming Claude Design conventions.\n\n## Typical shape (hints, not rules)\n\nUse these as starting points; re-verify against the actual source tree on every migration.\n\n- **Frontend**: One HTML shell + one or more `.jsx` files compiled in-browser by `@babel/standalone`. Components are plain functions (`function App()`, `function KpiCard({ k, theme })`) that consume `React.useState` / `useMemo` / `useEffect` from a `const { useState, useMemo, useEffect } = React;` destructure. No imports, no JSX modules, no TypeScript.\n- **Styling**: Inline `<style>` in `<head>` with hand-written CSS, custom properties, and media queries. CSS variables drive the theme: `--bg`, `--surface`, `--ink`, `--accent`, `--line`, `--muted`, `--shadow-{sm,md,lg}`, etc. Dark mode flips the variable values under `:root[data-theme=\"dark\"]`.\n- **Fonts**: Google Fonts loaded via `<link>` in `<head>`; commonly DM Sans (UI) + JetBrains Mono (mono).\n- **Tweaks**: `tweaks-panel.jsx` is a self-contained controls overlay used during prototyping. The `useTweaks(TWEAK_DEFAULTS)` hook returns `[t, setTweak]`; `<TweaksPanel>` renders the floating controls inside the canvas. Every tweak control posts `__edit_mode_set_keys` to the parent frame so the Claude Design host can persist values.\n- **Data**: `data.js` defines synthetic sample data on `window.*`. Treat as fixtures, not production data.\n- **Backend**: None. There are no API calls, no `fetch`, no auth, no DB access in a typical export.\n- **Routing**: None. Single-page prototype; no `react-router` or hashes.\n- **Assets**: Inlined SVGs in JSX or referenced from inline `<style>` background-images. No `public/`, no separate image files in the typical export.\n\n## Discovery checklist\n\nIn addition to the framework's discovery requirements, for a Claude Design source enumerate:\n\n- The HTML shell file (`<Name>.html`) and the `<title>` it sets \u2014 that is the prototype's name and should anchor your `<PageName>`.\n- Every sibling `.jsx` / `.js` file and its purpose: which one is the entry (`app.jsx`), which is the tweaks shell (`tweaks-panel.jsx`), which holds data fixtures (`data.js` or similar).\n- The full `TWEAK_DEFAULTS` object between `/*EDITMODE-BEGIN*/` and `/*EDITMODE-END*/` \u2014 every key here corresponds to a runtime control; preserve every one in the migrated app or call out which you are dropping and why.\n- The full set of CSS variables defined under `:root[data-theme=\"light\"]` and `:root[data-theme=\"dark\"]` \u2014 these are the theme tokens to port.\n- Every Google Fonts family loaded in `<head>` and which CSS rules consume them.\n- Every `window.*` global the JSX files read (look for the `/* global ... */` comment at the top of `app.jsx`) \u2014 these are the data fixtures to recreate.\n- Every top-level component function in `app.jsx` and its responsibility (KPI tile, table, modal, toast, etc.). The migrated app keeps the same component breakdown.\n- Every inline SVG and its role (icons, sparklines, chart paths) \u2014 these go straight into the migrated JSX unchanged.\n- Whether the tweaks panel is purely visual (color, density, font size) or carries semantic state (filters, modes). Visual tweaks usually drop after migration; semantic tweaks become real React state on the page.\n\nIf the discovery summary doesn't tell you which CSS variables drive the theme, what every tweak controls, and what each component renders, you haven't discovered enough.\n\n## Core mapping\n\n- **The HTML shell + `app.jsx` \u2192 one Superblocks page** at `client/pages/<Name>/index.tsx`, wired into `client/router.tsx` (commonly as the `index: true` route). The page name comes from the HTML `<title>` or the `<Name>.html` filename \u2014 pick one shape and stay consistent.\n- **Drop the CDN script tags entirely.** React, ReactDOM, and `@babel/standalone` from `unpkg` have no role in the migrated app \u2014 the Vite template ships React via `node_modules` and compiles JSX at build time. Likewise drop the `<script type=\"text/babel\" src=\"...\">` references.\n- **Drop the `<html>` / `<body>` shell.** The Superblocks template owns the document. Mounting via `ReactDOM.createRoot(...)` also drops; the platform handles render.\n- **Translate the inline `<style>` block into Tailwind v4 + `client/index.css`:**\n - The CSS variables under `:root[data-theme=\"light\"]` / `:root[data-theme=\"dark\"]` move into `client/index.css`'s `:root` and `.dark` blocks **as-is** (CSS Color Level 4 values stay as-is \u2014 do not convert to OKLCH; see the framework's \"Theme port\" rule). Wire them into Tailwind v4 via `@theme inline` so `bg-bg`, `text-ink`, `border-line` etc. resolve to the source tokens.\n - The Google Fonts `<link>` tags become `@import url('https://fonts.googleapis.com/...')` at the top of `client/index.css`, with `@theme { --font-sans: 'DM Sans', ...; --font-mono: 'JetBrains Mono', ...; }` so `font-sans` / `font-mono` keep working. (See v0.md's font-port checklist for the three-step pattern.)\n - Hand-rolled component CSS (`.topbar`, `.kpi`, `.orders-table`, etc.) translates into Tailwind utility classes on the corresponding JSX. Preserve spacing, sizing, color, shadow, and breakpoint behavior **exactly**. If a rule is too gnarly to express in utilities (complex animations, pseudo-element trickery), keep it in `client/index.css` under a scoped class \u2014 do not invent a new design.\n- **Theme switching.** The source toggles theme by mutating `<html data-theme=\"...\">`. Translate to a small custom provider that toggles `class=\"dark\"` on `document.documentElement` and persists to `localStorage` (mirroring the v0 `next-themes` translation). Preserve the source's CSS variable scheme (`:root` / `.dark` blocks) \u2014 only the JS toggle changes.\n- **Tweaks panel.** The Claude Design `tweaks-panel.jsx` is **canvas-only tooling** for the Claude Design host. It does not belong in the migrated app. Drop `tweaks-panel.jsx`, the `useTweaks` import, the `<TweaksPanel>` element, the `__activate_edit_mode` / `__deactivate_edit_mode` postMessage protocol, and the `EDITMODE-BEGIN` / `EDITMODE-END` markers entirely.\n - **But preserve what the tweaks controlled.** For each tweak in `TWEAK_DEFAULTS`:\n - **Visual-only tweaks** (theme, accent color, density, font size) \u2192 either drop and pin to the default value, or surface as a real settings UI if the user wants it. Ask before keeping; visual tweaks are usually prototype affordances, not product features.\n - **Semantic tweaks** (active tab, selected filter, sort order, \"show kpis\" toggles) \u2192 become real React state on the page (`useState` defaulted to the value from `TWEAK_DEFAULTS`). The user's interactions drive them; there is no edit-mode panel.\n - Surface the full list of tweaks and your decision per tweak in the discovery summary so the user can override.\n- **`data.js` / `window.*` globals.** These are mock fixtures, not real data. Two paths:\n - **Default: keep as inline mock data inside the migrated page** (e.g., a `const ORDERS = [...]` at module scope, or a small `client/data/<name>.ts` module). The migrated app stays frontend-only and behaves like the prototype.\n - **If the user wants a real backend**: surface the data shape in the discovery summary and ask before fabricating APIs. Per the framework's \"Don't fabricate a backend\" rule, do not invent server-side endpoints unless the user opts in. If they do, each `window.*` collection becomes one Superblocks API returning the same shape, and the page calls `useApiData(\"<ApiName>\")` instead of reading the global.\n- **Components.** Each top-level function in `app.jsx` (`KpiCard`, `OrdersTable`, `Checkbox`, `TrackingModal`, `BulkBar`, `Toast`, ...) becomes a sibling component file under `client/pages/<Name>/components/<Name>.tsx` (or stays inline if small). Function bodies, JSX structure, prop shapes, and event handlers transfer **unchanged** \u2014 only imports change (pull `useState` / `useMemo` / `useEffect` from `react` instead of destructuring from a `React` global, and add explicit `import React from \"react\"` only if JSX runtime requires it).\n- **Inline SVGs** (sparklines, icons, chart paths) move into the migrated JSX **verbatim**. Do not swap for `lucide-react` icons or other libraries unless the user asks; the source's SVGs are part of the design.\n- **Modals, toasts, and overlays.** Source uses raw `<div>` + CSS for these. Keep as-is in the migrated page \u2014 do not silently swap for shadcn `Dialog` / `Sonner` unless the user explicitly opts in. shadcn primitives change visual behavior (focus rings, animation, scrim color) and that is a design regression.\n- **Responsive breakpoints.** The source defines `@media (max-width: 900px)` rules in the inline `<style>`. Translate to Tailwind responsive prefixes (`sm:` / `md:` / `lg:`) on the corresponding utilities, matching the source's breakpoint values exactly.\n\n## Ask-before-guessing \u2014 Claude Design specifics\n\n- \"The export has no backend. I'll keep the data as inline mocks under `client/pages/<Name>/data.ts`. Want me to fabricate APIs for it instead, or leave it frontend-only?\"\n- \"The tweaks panel exposes `<list of tweaks>`. Visual tweaks (theme, accent, density) typically drop on migration; semantic tweaks become real page state. Confirm which to keep, drop, or surface as a settings UI.\"\n- \"The source uses Google Fonts `<list>` via CDN `<link>`. I'll re-load them via `@import` in `client/index.css` and bind via `@theme`. OK, or do you want self-hosted fonts?\"\n- \"The source switches themes by toggling `<html data-theme>`. I'll translate to a provider that toggles `class='dark'` on `document.documentElement`. Acceptable, or do you want a different theme-toggle shape?\"\n- \"The export ships hand-rolled UI components (modal, toast, table). I'll keep them as-is rather than swapping in shadcn primitives, since shadcn would change the visual behavior. Confirm, or override per-component?\"\n\n## Page port \u2014 what changes vs. what doesn't\n\nFor each Claude Design page, only these change:\n\n- **Module system**: `<script type=\"text/babel\">` + `window.*` globals \u2192 ESM imports between `client/pages/...` files; `data.js` becomes a `.ts` module (or inline `const`).\n- **React acquisition**: `const { useState, ... } = React;` \u2192 `import { useState, ... } from \"react\";`\n- **Mounting**: `ReactDOM.createRoot(...).render(<App />)` \u2192 page is mounted by `client/router.tsx` via the standard route binding.\n- **Styling pipeline**: inline `<style>` + hand-rolled CSS classes \u2192 CSS variables in `client/index.css` under `@theme inline` + Tailwind utilities on JSX.\n- **Theme toggle**: `<html data-theme>` mutation \u2192 `document.documentElement` class toggle.\n- **Tweaks**: `useTweaks` / `<TweaksPanel>` \u2192 real React state for semantic tweaks; visual tweaks drop or move to a settings UI.\n- **Edit-mode protocol**: `__activate_edit_mode` / `__deactivate_edit_mode` postMessage handshakes \u2192 drop entirely.\n\nEverything else \u2014 JSX structure, component breakdown, prop shapes, event handlers, copy, layout, spacing, color, shadow, animation, breakpoints \u2014 transfers **unchanged** from the source. If the diff between source and target page goes beyond the bullets above, you are over-editing \u2014 back out the cosmetic changes.\n\n## Done \u2014 Claude Design specifics\n\nIn the final report, additionally surface:\n\n- The full list of tweaks from `TWEAK_DEFAULTS` and what happened to each (kept as state, dropped, surfaced as settings).\n- Whether the data stayed as inline mocks or was promoted to APIs (and which integration backs each, if so).\n- Any hand-rolled UI primitives (modal, toast, popover) you preserved verbatim, so the user can choose whether to standardize on shadcn later.\n- The list of Google Fonts re-loaded and the `@theme` font tokens bound.\n";
|
|
2
|
+
//# sourceMappingURL=claude-design.generated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-design.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/claude-design.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,kqeAuGnB,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Auto-generated from src/ai-service/skills/system/third-party-migration/claude-design.md
|
|
2
|
+
// Do not edit directly - edit the .md file instead
|
|
3
|
+
export const content = `# Claude Design-specific mapping
|
|
4
|
+
|
|
5
|
+
This is a per-platform reference loaded from \`SKILL.md\`. The framework — target layout, universal mapping, non-negotiables, workflow, code-emission rules — lives there. This file documents only what is specific to a Claude Design source.
|
|
6
|
+
|
|
7
|
+
> Claude Design is a prototype-design tool from Anthropic. Its "Download project as .zip" output is a tiny, self-contained, **frontend-only** prototype: a single \`<Name>.html\` shell that loads React, ReactDOM, and Babel from a CDN and \`<script type="text/babel" src="...">\` files that compile in the browser at run time. There is **no backend, no \`package.json\`, no build step, and no module system** — every helper is hung off \`window.*\` or pulled from globals. Treat the export as design-quality intent (layout, typography, color, interactions, copy) that needs to be re-expressed inside the Superblocks fullstack template (Vite + React + react-router v7 + Tailwind v4 + shadcn/ui). The framework's "Don't fabricate a backend" rule applies — if the source is purely UI driven by inline mock data, the migrated app stays frontend-only unless the user explicitly asks for one.
|
|
8
|
+
|
|
9
|
+
## Where the source lives
|
|
10
|
+
|
|
11
|
+
Definitive marker: a flat archive (no nested project folder) containing exactly one top-level \`<Name>.html\` file plus sibling JSX/JS files, with the HTML loading React, ReactDOM, and \`@babel/standalone\` from \`unpkg.com\` and using \`<script type="text/babel" src="...">\` for the JSX files. No \`package.json\`, no \`node_modules\`, no \`vite.config.*\`, no \`tsconfig.json\`.
|
|
12
|
+
|
|
13
|
+
Strong supporting signals:
|
|
14
|
+
|
|
15
|
+
- The HTML root tag is \`<html lang="..." data-theme="light">\` (or \`"dark"\`); theme switching happens by mutating \`data-theme\` on \`<html>\` and CSS variables defined under \`:root[data-theme="light"]\` / \`:root[data-theme="dark"]\`.
|
|
16
|
+
- A \`tweaks-panel.jsx\` sibling that defines a draggable in-canvas controls panel and exposes \`useTweaks\`, \`TweaksPanel\`, \`TweakSection\`, \`TweakSlider\`, \`TweakRadio\`, \`TweakColor\`, \`TweakToggle\` as window globals. The host protocol is \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage handshakes plus \`__edit_mode_available\` / \`__edit_mode_set_keys\` / \`__edit_mode_dismissed\` responses.
|
|
17
|
+
- An \`app.jsx\` whose top has \`const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{ ... }/*EDITMODE-END*/;\` — the \`EDITMODE-BEGIN\` / \`EDITMODE-END\` markers are how the Claude Design canvas locates and rewrites the defaults block.
|
|
18
|
+
- A \`data.js\` (or similarly named sibling) that hangs sample data off \`window.*\`: e.g. \`window.ORDERS = [...]; window.KPIS = [...];\`. Components consume the globals directly (\`/* global React, ReactDOM, ORDERS, KPIS, useTweaks, ... */\` at the top of \`app.jsx\`).
|
|
19
|
+
- Mounting happens at the bottom of \`app.jsx\` via \`ReactDOM.createRoot(document.getElementById("root")).render(<App />);\` against a single \`<div id="root"></div>\` in the HTML body.
|
|
20
|
+
- Inline \`<style>\` block in \`<head>\` defines the entire visual system: a light + dark token palette under \`:root[data-theme="..."]\`, body typography (commonly DM Sans + JetBrains Mono via Google Fonts), all component styles by hand-rolled BEM-ish class names (\`.topbar\`, \`.brand\`, \`.kpi\`, \`.orders-table\`, etc.). No Tailwind, no shadcn primitives in the source.
|
|
21
|
+
|
|
22
|
+
If the user gave a path, use it. Otherwise look for the markers above in the working tree. If you see a flat archive with \`EDITMODE-BEGIN\` markers and a CDN-loaded React shell, it is a Claude Design export. If anything is ambiguous (e.g. someone hand-built a similar HTML+JSX shell), ask before assuming Claude Design conventions.
|
|
23
|
+
|
|
24
|
+
## Typical shape (hints, not rules)
|
|
25
|
+
|
|
26
|
+
Use these as starting points; re-verify against the actual source tree on every migration.
|
|
27
|
+
|
|
28
|
+
- **Frontend**: One HTML shell + one or more \`.jsx\` files compiled in-browser by \`@babel/standalone\`. Components are plain functions (\`function App()\`, \`function KpiCard({ k, theme })\`) that consume \`React.useState\` / \`useMemo\` / \`useEffect\` from a \`const { useState, useMemo, useEffect } = React;\` destructure. No imports, no JSX modules, no TypeScript.
|
|
29
|
+
- **Styling**: Inline \`<style>\` in \`<head>\` with hand-written CSS, custom properties, and media queries. CSS variables drive the theme: \`--bg\`, \`--surface\`, \`--ink\`, \`--accent\`, \`--line\`, \`--muted\`, \`--shadow-{sm,md,lg}\`, etc. Dark mode flips the variable values under \`:root[data-theme="dark"]\`.
|
|
30
|
+
- **Fonts**: Google Fonts loaded via \`<link>\` in \`<head>\`; commonly DM Sans (UI) + JetBrains Mono (mono).
|
|
31
|
+
- **Tweaks**: \`tweaks-panel.jsx\` is a self-contained controls overlay used during prototyping. The \`useTweaks(TWEAK_DEFAULTS)\` hook returns \`[t, setTweak]\`; \`<TweaksPanel>\` renders the floating controls inside the canvas. Every tweak control posts \`__edit_mode_set_keys\` to the parent frame so the Claude Design host can persist values.
|
|
32
|
+
- **Data**: \`data.js\` defines synthetic sample data on \`window.*\`. Treat as fixtures, not production data.
|
|
33
|
+
- **Backend**: None. There are no API calls, no \`fetch\`, no auth, no DB access in a typical export.
|
|
34
|
+
- **Routing**: None. Single-page prototype; no \`react-router\` or hashes.
|
|
35
|
+
- **Assets**: Inlined SVGs in JSX or referenced from inline \`<style>\` background-images. No \`public/\`, no separate image files in the typical export.
|
|
36
|
+
|
|
37
|
+
## Discovery checklist
|
|
38
|
+
|
|
39
|
+
In addition to the framework's discovery requirements, for a Claude Design source enumerate:
|
|
40
|
+
|
|
41
|
+
- The HTML shell file (\`<Name>.html\`) and the \`<title>\` it sets — that is the prototype's name and should anchor your \`<PageName>\`.
|
|
42
|
+
- Every sibling \`.jsx\` / \`.js\` file and its purpose: which one is the entry (\`app.jsx\`), which is the tweaks shell (\`tweaks-panel.jsx\`), which holds data fixtures (\`data.js\` or similar).
|
|
43
|
+
- The full \`TWEAK_DEFAULTS\` object between \`/*EDITMODE-BEGIN*/\` and \`/*EDITMODE-END*/\` — every key here corresponds to a runtime control; preserve every one in the migrated app or call out which you are dropping and why.
|
|
44
|
+
- The full set of CSS variables defined under \`:root[data-theme="light"]\` and \`:root[data-theme="dark"]\` — these are the theme tokens to port.
|
|
45
|
+
- Every Google Fonts family loaded in \`<head>\` and which CSS rules consume them.
|
|
46
|
+
- Every \`window.*\` global the JSX files read (look for the \`/* global ... */\` comment at the top of \`app.jsx\`) — these are the data fixtures to recreate.
|
|
47
|
+
- Every top-level component function in \`app.jsx\` and its responsibility (KPI tile, table, modal, toast, etc.). The migrated app keeps the same component breakdown.
|
|
48
|
+
- Every inline SVG and its role (icons, sparklines, chart paths) — these go straight into the migrated JSX unchanged.
|
|
49
|
+
- Whether the tweaks panel is purely visual (color, density, font size) or carries semantic state (filters, modes). Visual tweaks usually drop after migration; semantic tweaks become real React state on the page.
|
|
50
|
+
|
|
51
|
+
If the discovery summary doesn't tell you which CSS variables drive the theme, what every tweak controls, and what each component renders, you haven't discovered enough.
|
|
52
|
+
|
|
53
|
+
## Core mapping
|
|
54
|
+
|
|
55
|
+
- **The HTML shell + \`app.jsx\` → one Superblocks page** at \`client/pages/<Name>/index.tsx\`, wired into \`client/router.tsx\` (commonly as the \`index: true\` route). The page name comes from the HTML \`<title>\` or the \`<Name>.html\` filename — pick one shape and stay consistent.
|
|
56
|
+
- **Drop the CDN script tags entirely.** React, ReactDOM, and \`@babel/standalone\` from \`unpkg\` have no role in the migrated app — the Vite template ships React via \`node_modules\` and compiles JSX at build time. Likewise drop the \`<script type="text/babel" src="...">\` references.
|
|
57
|
+
- **Drop the \`<html>\` / \`<body>\` shell.** The Superblocks template owns the document. Mounting via \`ReactDOM.createRoot(...)\` also drops; the platform handles render.
|
|
58
|
+
- **Translate the inline \`<style>\` block into Tailwind v4 + \`client/index.css\`:**
|
|
59
|
+
- The CSS variables under \`:root[data-theme="light"]\` / \`:root[data-theme="dark"]\` move into \`client/index.css\`'s \`:root\` and \`.dark\` blocks **as-is** (CSS Color Level 4 values stay as-is — do not convert to OKLCH; see the framework's "Theme port" rule). Wire them into Tailwind v4 via \`@theme inline\` so \`bg-bg\`, \`text-ink\`, \`border-line\` etc. resolve to the source tokens.
|
|
60
|
+
- The Google Fonts \`<link>\` tags become \`@import url('https://fonts.googleapis.com/...')\` at the top of \`client/index.css\`, with \`@theme { --font-sans: 'DM Sans', ...; --font-mono: 'JetBrains Mono', ...; }\` so \`font-sans\` / \`font-mono\` keep working. (See v0.md's font-port checklist for the three-step pattern.)
|
|
61
|
+
- Hand-rolled component CSS (\`.topbar\`, \`.kpi\`, \`.orders-table\`, etc.) translates into Tailwind utility classes on the corresponding JSX. Preserve spacing, sizing, color, shadow, and breakpoint behavior **exactly**. If a rule is too gnarly to express in utilities (complex animations, pseudo-element trickery), keep it in \`client/index.css\` under a scoped class — do not invent a new design.
|
|
62
|
+
- **Theme switching.** The source toggles theme by mutating \`<html data-theme="...">\`. Translate to a small custom provider that toggles \`class="dark"\` on \`document.documentElement\` and persists to \`localStorage\` (mirroring the v0 \`next-themes\` translation). Preserve the source's CSS variable scheme (\`:root\` / \`.dark\` blocks) — only the JS toggle changes.
|
|
63
|
+
- **Tweaks panel.** The Claude Design \`tweaks-panel.jsx\` is **canvas-only tooling** for the Claude Design host. It does not belong in the migrated app. Drop \`tweaks-panel.jsx\`, the \`useTweaks\` import, the \`<TweaksPanel>\` element, the \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage protocol, and the \`EDITMODE-BEGIN\` / \`EDITMODE-END\` markers entirely.
|
|
64
|
+
- **But preserve what the tweaks controlled.** For each tweak in \`TWEAK_DEFAULTS\`:
|
|
65
|
+
- **Visual-only tweaks** (theme, accent color, density, font size) → either drop and pin to the default value, or surface as a real settings UI if the user wants it. Ask before keeping; visual tweaks are usually prototype affordances, not product features.
|
|
66
|
+
- **Semantic tweaks** (active tab, selected filter, sort order, "show kpis" toggles) → become real React state on the page (\`useState\` defaulted to the value from \`TWEAK_DEFAULTS\`). The user's interactions drive them; there is no edit-mode panel.
|
|
67
|
+
- Surface the full list of tweaks and your decision per tweak in the discovery summary so the user can override.
|
|
68
|
+
- **\`data.js\` / \`window.*\` globals.** These are mock fixtures, not real data. Two paths:
|
|
69
|
+
- **Default: keep as inline mock data inside the migrated page** (e.g., a \`const ORDERS = [...]\` at module scope, or a small \`client/data/<name>.ts\` module). The migrated app stays frontend-only and behaves like the prototype.
|
|
70
|
+
- **If the user wants a real backend**: surface the data shape in the discovery summary and ask before fabricating APIs. Per the framework's "Don't fabricate a backend" rule, do not invent server-side endpoints unless the user opts in. If they do, each \`window.*\` collection becomes one Superblocks API returning the same shape, and the page calls \`useApiData("<ApiName>")\` instead of reading the global.
|
|
71
|
+
- **Components.** Each top-level function in \`app.jsx\` (\`KpiCard\`, \`OrdersTable\`, \`Checkbox\`, \`TrackingModal\`, \`BulkBar\`, \`Toast\`, ...) becomes a sibling component file under \`client/pages/<Name>/components/<Name>.tsx\` (or stays inline if small). Function bodies, JSX structure, prop shapes, and event handlers transfer **unchanged** — only imports change (pull \`useState\` / \`useMemo\` / \`useEffect\` from \`react\` instead of destructuring from a \`React\` global, and add explicit \`import React from "react"\` only if JSX runtime requires it).
|
|
72
|
+
- **Inline SVGs** (sparklines, icons, chart paths) move into the migrated JSX **verbatim**. Do not swap for \`lucide-react\` icons or other libraries unless the user asks; the source's SVGs are part of the design.
|
|
73
|
+
- **Modals, toasts, and overlays.** Source uses raw \`<div>\` + CSS for these. Keep as-is in the migrated page — do not silently swap for shadcn \`Dialog\` / \`Sonner\` unless the user explicitly opts in. shadcn primitives change visual behavior (focus rings, animation, scrim color) and that is a design regression.
|
|
74
|
+
- **Responsive breakpoints.** The source defines \`@media (max-width: 900px)\` rules in the inline \`<style>\`. Translate to Tailwind responsive prefixes (\`sm:\` / \`md:\` / \`lg:\`) on the corresponding utilities, matching the source's breakpoint values exactly.
|
|
75
|
+
|
|
76
|
+
## Ask-before-guessing — Claude Design specifics
|
|
77
|
+
|
|
78
|
+
- "The export has no backend. I'll keep the data as inline mocks under \`client/pages/<Name>/data.ts\`. Want me to fabricate APIs for it instead, or leave it frontend-only?"
|
|
79
|
+
- "The tweaks panel exposes \`<list of tweaks>\`. Visual tweaks (theme, accent, density) typically drop on migration; semantic tweaks become real page state. Confirm which to keep, drop, or surface as a settings UI."
|
|
80
|
+
- "The source uses Google Fonts \`<list>\` via CDN \`<link>\`. I'll re-load them via \`@import\` in \`client/index.css\` and bind via \`@theme\`. OK, or do you want self-hosted fonts?"
|
|
81
|
+
- "The source switches themes by toggling \`<html data-theme>\`. I'll translate to a provider that toggles \`class='dark'\` on \`document.documentElement\`. Acceptable, or do you want a different theme-toggle shape?"
|
|
82
|
+
- "The export ships hand-rolled UI components (modal, toast, table). I'll keep them as-is rather than swapping in shadcn primitives, since shadcn would change the visual behavior. Confirm, or override per-component?"
|
|
83
|
+
|
|
84
|
+
## Page port — what changes vs. what doesn't
|
|
85
|
+
|
|
86
|
+
For each Claude Design page, only these change:
|
|
87
|
+
|
|
88
|
+
- **Module system**: \`<script type="text/babel">\` + \`window.*\` globals → ESM imports between \`client/pages/...\` files; \`data.js\` becomes a \`.ts\` module (or inline \`const\`).
|
|
89
|
+
- **React acquisition**: \`const { useState, ... } = React;\` → \`import { useState, ... } from "react";\`
|
|
90
|
+
- **Mounting**: \`ReactDOM.createRoot(...).render(<App />)\` → page is mounted by \`client/router.tsx\` via the standard route binding.
|
|
91
|
+
- **Styling pipeline**: inline \`<style>\` + hand-rolled CSS classes → CSS variables in \`client/index.css\` under \`@theme inline\` + Tailwind utilities on JSX.
|
|
92
|
+
- **Theme toggle**: \`<html data-theme>\` mutation → \`document.documentElement\` class toggle.
|
|
93
|
+
- **Tweaks**: \`useTweaks\` / \`<TweaksPanel>\` → real React state for semantic tweaks; visual tweaks drop or move to a settings UI.
|
|
94
|
+
- **Edit-mode protocol**: \`__activate_edit_mode\` / \`__deactivate_edit_mode\` postMessage handshakes → drop entirely.
|
|
95
|
+
|
|
96
|
+
Everything else — JSX structure, component breakdown, prop shapes, event handlers, copy, layout, spacing, color, shadow, animation, breakpoints — transfers **unchanged** from the source. If the diff between source and target page goes beyond the bullets above, you are over-editing — back out the cosmetic changes.
|
|
97
|
+
|
|
98
|
+
## Done — Claude Design specifics
|
|
99
|
+
|
|
100
|
+
In the final report, additionally surface:
|
|
101
|
+
|
|
102
|
+
- The full list of tweaks from \`TWEAK_DEFAULTS\` and what happened to each (kept as state, dropped, surfaced as settings).
|
|
103
|
+
- Whether the data stayed as inline mocks or was promoted to APIs (and which integration backs each, if so).
|
|
104
|
+
- Any hand-rolled UI primitives (modal, toast, popover) you preserved verbatim, so the user can choose whether to standardize on shadcn later.
|
|
105
|
+
- The list of Google Fonts re-loaded and the \`@theme\` font tokens bound.
|
|
106
|
+
`;
|
|
107
|
+
//# sourceMappingURL=claude-design.generated.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-design.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/claude-design.generated.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuGtB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const content = "---\nname: third-party-migration\ndescription: |\n Migrate a third-party app (Replit, Lovable, v0, or similar) into a Superblocks 3.0 full-stack app.\n Load when the user asks to migrate, import, or port an external app \u2014 or when the source tree contains hallmarks of a supported platform (`replit.md` / `.replit`, `src/integrations/supabase/`, `supabase/functions/`, `lovable-tagger`, an `app/` directory with `next.config.*` and `\"use client\"` / `\"use server\"` directives, etc.) and the user wants it turned into a Superblocks app.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Third-Party App \u2192 Superblocks 3.0 Migration\n\nPort a user-provided external app into the Superblocks fullstack app you are running inside (template: `app-fullstack`). The source tree is **read-only material**. All edits land in the target app under `server/` and `client/`.\n\nThis file is the migration framework. **Per-platform mapping rules live in sibling files** \u2014 load the right one before you start mapping.\n\n## Identify the source platform\n\nMatch the source tree against these signals, then read the matching reference file in this folder. Read it once, up-front \u2014 it tells you what shapes to look for and how each maps to Superblocks.\n\n- **Replit** \u2014 `replit.md`, `.replit`, `artifacts/`, an Express server with an Orval-generated client. \u2192 load `replit.md`.\n- **Lovable** \u2014 `src/integrations/supabase/client.ts`, `supabase/config.toml`, `supabase/functions/`, `supabase/migrations/`, `lovable-tagger` in `vite.config.ts`. \u2192 load `lovable.md`.\n- **v0** \u2014 `app/<segment>/page.tsx` (Next.js App Router) plus `next.config.{js,mjs,ts}` and `next` in `package.json`, files with `\"use client\"` / `\"use server\"` directives, `next/link` / `next/navigation` imports, `components/ui/` with shadcn primitives. \u2192 load `v0.md`.\n- **Ambiguous or neither** \u2014 stop and ask the user which platform the source came from. Do not guess. It is possible that it is No Platform. In this case, follow the general guidelines in this document and ask user questions for any ambiguity.\n\nThe framework below applies to every platform; the platform file fills in the source-specific mapping.\n\n## Target layout\n\nThe app you are running inside looks like this. Do not invent new top-level directories.\n\n```\nclient/\n App.tsx \u2014 root with <AppProvider> + <Outlet />\n router.tsx \u2014 react-router v7 data mode (`createBrowserRouter`); see Router shape below\n index.css \u2014 Tailwind v4 + theme tokens\n hooks/\n useApi.ts \u2014 typed wrapper around useTypedApi<ApiRegistry>\n useApiData.ts \u2014 typed wrapper around useTypedApiData<ApiRegistry>\n lib/executeApi.ts \u2014 non-React typed executeApi\n pages/<Name>/index.tsx\n components/ui/ \u2014 shadcn primitives (do not modify)\nserver/\n apis/\n index.ts \u2014 registry: `const apis = { ApiName: ... } as const;`\n <ApiName>/api.ts\n```\n\n## Universal mapping (applies to every source)\n\nThese hold regardless of source platform. Per-platform specifics layer on top.\n\n- APIs are addressed by `name` via the registry \u2014 there is no URL path. Within `api()`:\n - All inputs (whatever shape the source had \u2014 body, query, params, function args) \u2192 one unified `input` Zod schema; destructure inside `run(ctx, { ... })`.\n - The handler's response \u2192 `return { ... }` from `run`. The `output` schema validates it automatically; do not `safeParse` by hand.\n - Auth \u2192 `ctx.user` (`userId`, `email`, `name`, `groups`, `customClaims`). Auth is platform-managed; drop the source's auth flows entirely.\n - Errors \u2192 throw the `SdkError` subtypes the sdk-api README documents (`InputValidationError`, `OutputValidationError`, `IntegrationError`, `ExecutionError`). Never invent error classes or return HTTP status codes.\n - DB clients (`pg`, `knex`, `prisma`, Drizzle, `supabase.from(...)`) \u2192 declare in `integrations: { db: postgres(DB_INTEGRATION_ID) }` and call `ctx.integrations.db.query(sql, ZodSchema, params, { label: \"...\" })` / `.execute(...)`. Parameterized SQL only. Hold integration UUIDs in module-level `const`s, not literals scattered through `run`.\n - External HTTP (`axios`, `fetch`, third-party SDKs) \u2192 declared integration + `ctx.integrations.<name>.apiRequest({ method, path, body }, { response: ZodSchema })`.\n - `process.env.*` / `import.meta.env.*` / `Deno.env.get(...)` \u2192 `ctx.env`. Logging \u2192 `ctx.log.info/warn/error/debug(msg, data?)`.\n - Server bootstrapping (`app.listen`, CORS, route grouping, middleware setup, `Deno.serve`) \u2192 drop entirely. The platform handles it.\n- **Each frontend page \u2192 one Superblocks page** at `client/pages/<Name>/index.tsx`, wired into `client/router.tsx`.\n- **Each backend data source (DB, REST client, S3, ...) \u2192 one Superblocks integration** referenced by UUID. Credentials live on the integration, never in code.\n\n### Router shape (`client/router.tsx`)\n\nThe editor parses this file statically to build the page list and route table. **Use one of the supported page-component bindings \u2014 anything else silently drops every route and the editor shows a \"404 / route has been deleted\" overlay.**\n\nSupported page bindings (mix freely):\n\n```tsx\n// 1. Inline lazy on the route object (preferred \u2014 matches the template):\n{ path: \"about\", lazy: () => import(\"./pages/About/index.tsx\").then(m => ({ Component: m.default })) }\n\n// 2. Static default import + Component / element:\nimport About from \"./pages/About/index.tsx\";\n{ path: \"about\", Component: About }\n{ path: \"about\", element: <About /> }\n\n// 3. Top-level `const` bound to React.lazy + Component / element:\nconst About = lazy(() => import(\"./pages/About/index.tsx\"));\n{ path: \"about\", Component: About }\n```\n\nDo **not**: assign `Component` / `element` to identifiers bound by anything other than a static import or `lazy(() => import(\"...\"))` (no IIFEs, no helper wrappers, no conditional `lazy(...)`, no objects whose keys are computed from a loop). The parser only resolves the shapes above.\n\n## Authoritative references (read just-in-time, not up front)\n\n- `node_modules/@superblocksteam/sdk-api/README.md` and `src/index.ts` \u2014 the server `api()` contract and the full list of factory names. **Never invent factory names.** If a required file is missing, mark the affected checklist item `failed` with the missing path as the reason.\n- Per-integration READMEs under `node_modules/@superblocksteam/sdk-api/src/integrations/<kind>/` \u2014 read once, when you first emit an API that uses that integration.\n- `skills/system/superblocks-frontend/SKILL.md` \u2014 the client contract (`useApi` / `useApiData` / `executeApi` from `@superblocksteam/library`).\n\n> \u26A0\uFE0F **Never** load `skills/system/superblocks-api/SKILL.md`. It describes a different, block-based API pattern that is incompatible with the fullstack template's `sdk-api`. Mixing them produces code that does not compile.\n\n## Non-negotiables\n\n1. **Track everything in the checklist.** The **first tool call after exiting plan mode** or **during build mode, before building** is `build_manageChecklist` to seed. Before every per-item edit, `update <itemId> in_progress`; after, `update <itemId> completed` (or `failed` with a concrete `failureReason`). If you are about to write code and the checklist is empty, stale, or missing the item you are working on, **stop and fix the checklist first** \u2014 the orchestration depends on it. Free-text status reports are not a substitute.\n2. **Discover before you edit.** Inventory routes, pages, data sources, env vars, _and visual surface_ (theme tokens, `index.css`, custom CSS, font setup, layout shells) across the entire source tree before writing any code. The platform file tells you what shapes to look for.\n3. **Ask before guessing.** Multiple integrations of the same kind, missing integrations, unsupported data sources, or any platform-specific ambiguity \u2192 stop and `askMultiChoice`. Never pick for the user. The platform file lists ambiguities specific to that source.\n4. **Preserve visual identity.** The migrated app must look and feel like the source. Carry over Tailwind config, shadcn theme tokens, `index.css` / `globals.css`, custom CSS modules, fonts, spacing, color palette, and layout shells (header/sidebar/grid). shadcn/ui components stay as-is. Do **not** redesign, restyle, or \"clean up\" while porting \u2014 visual regressions are bugs, not improvements. If the user wants a redesign, that is a separate task after migration.\n5. **Never copy secrets.** DSN strings, API keys, anon/service-role keys, JWT secrets, env-var lookups for credentials \u2014 none move into the target tree. Integration UUIDs replace them. Surface every leaked secret you find (especially client-side `VITE_*` / `NEXT_PUBLIC_*` keys) in the discovery summary so the user can rotate them.\n6. **No `// TODO`s.** Anything you can't finish deterministically becomes a `failed` checklist item with a concrete `failureReason`.\n7. **Don't scaffold.** If `server/apis/index.ts` or `client/router.tsx` doesn't already exist, you're in the wrong app \u2014 stop and surface this.\n8. **Don't fabricate a backend.** If the source is genuinely frontend-only, the migrated app should also be frontend-only. Don't invent APIs to \"complete\" the architecture.\n\n## Workflow\n\n1. **Locate the source.** If the user gave a path, use it. Otherwise look in the working tree for the platform signals listed above. If ambiguous, ask.\n2. **Load the platform guide.** Read `replit.md`, `lovable.md`, or `v0.md` based on what you found. Do not start mapping before you've read it \u2014 it documents the source's shape and how each piece translates.\n3. **Inventory.** Following the platform guide's discovery checklist, enumerate every route/handler, page, data source, env var, secret, and visual asset in the source tree. Surface a one-paragraph summary plus an itemized list of integrations and unsupported features before writing anything. If the source has bespoke styling, seed a `setup_theme` checklist item to port it.\n4. **Resolve integrations.** For each data source kind: call `searchIntegrations` (filter by `type`). One match \u2192 bind it. Multiple \u2192 ask the user which. Zero \u2192 ask whether to create one; if yes, use `listAvailableIntegrationTypes` (if needed) and `openIntegrationSetup`, then ask the user explicitly whether they saved or cancelled before re-searching. Resolution is **blocking** \u2014 the checklist cannot be seeded until every kind maps to a UUID, is explicitly deferred, or has been confirmed unsupported.\n5. **Seed the checklist** via `build_manageChecklist`. One `api_<ApiName>` per backend interaction, one `frontend_<PageName>` per page, plus `setup_router`, `setup_registry`, `setup_cleanup`, and any `setup_theme` / `setup_storage` / `unsupported_<feature>` items the platform guide tells you to add. Print the count as a sanity check; if it looks wrong, re-check discovery.\n6. **Execute.** Every item follows the same ritual \u2014 no exceptions:\n - **Before touching files:** `build_manageChecklist update <itemId> in_progress`.\n - **Emit / edit the files** for that item.\n - **After the edit lands:** `build_manageChecklist update <itemId> completed` (or `failed` with a concrete `failureReason`).\n - You are not done with an item until its checklist entry has moved to a terminal state. Do not batch updates at the end; update as you go.\n - **For parallelizable work:** call `spawnCodingSubagents` with batches of tasks. Each batch's `instructions` names exact `itemId`s, includes the integration-UUID map and source path, any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tells the sub-agent to follow the same `in_progress` \u2192 `completed`/`failed` ritual for every item it owns.\n - `spawnCodingSubagents` **must be the only tool call in that turn.** It blocks until every sub-agent finishes; there is no \"while waiting\" from your perspective. Other tool calls in the same turn race on the shared checklist and corrupt state. After it returns, read the checklist and handle `failed` items sequentially. If the tool itself errors, surface it and fall back to sequential \u2014 or fail the affected items with `sub-agent orchestration failed: <error>`.\n\n## When emitting code\n\n- **Server.** Default-export one `api({ name, integrations, input, output, run })` from `@superblocksteam/sdk-api`. The `name` and the registry key in `server/apis/index.ts` must equal `<ApiName>` verbatim \u2014 the client calls `useApi(\"<ApiName>\")` by that exact string. Preserve the external response shape exactly so the migrated frontend keeps working. Use parameterized SQL only (`$N`); zero string interpolations. Throw the error classes the sdk-api README documents instead of returning HTTP status codes.\n- **Client.** Replace the source's data hooks with `useApiData` (reads) or `useApi` (mutations) keyed by `<ApiName>`. **Import the typed wrappers from the template, not the library directly:** `import { useApi } from \"@/hooks/useApi.js\"`, `import { useApiData } from \"@/hooks/useApiData.js\"`, `import { executeApi } from \"@/lib/executeApi.js\"`. They give compile-time inference from `ApiRegistry`. Drop the source's generated client packages, `QueryClientProvider`, base-URL or auth-token getters, and any auth-context plumbing \u2014 Superblocks handles all of that. shadcn/form + react-hook-form + zod stays. Follow the loading-state guidance in `superblocks-frontend/SKILL.md`.\n- **ESM imports.** Every relative import in emitted code uses an explicit `.js` extension (`./api.js`, `../hooks/useApi.js`) \u2014 even though the source is `.ts`. The template is ESM; bare specifiers fail at runtime.\n- **Theme port.** When carrying over the source's theme, copy the existing color values **as-is** into `client/index.css`'s `:root` block. HSL values written `hsl(222 47% 11%)` (CSS Color Level 4 space-separated form) work directly with the `@theme inline` mapping in Tailwind v4. **Do not convert to OKLCH** unless the source already uses OKLCH \u2014 converting introduces drift and is a common visual-regression source.\n- **Visual fidelity.** JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, and layout containers must transfer over **unchanged** from the source page. The only things that change in a page port are the data hooks, the auth touchpoints, and the router primitives. Do not \"improve\" markup, swap class names, or substitute components. If the diff between source and target page goes beyond data + auth + routing, you are over-editing \u2014 back out the cosmetic changes.\n- **Sub-agents must not** call `searchIntegrations`, `openIntegrationSetup`, or any integration-resolution tool. If they hit a kind missing from the map, fail the item with `unresolved integration kind: <kind>` and let the main agent handle it on return.\n\n## Done\n\nStop only when every checklist item is `completed` or `failed`. Report the counts plus any platform-specific findings the per-platform guide asks you to surface (e.g. leaked secrets, replaced RLS policies, unsupported realtime features). Do not claim success \u2014 defer verification to the user running the app.\n";
|
|
1
|
+
export declare const content = "---\nname: third-party-migration\ndescription: |\n Migrate a third-party app (Replit, Lovable, v0, or similar) into a Superblocks 3.0 full-stack app.\n Load when the user asks to migrate, import, or port an external app \u2014 or when the source tree contains hallmarks of a supported platform (`replit.md` / `.replit`, `src/integrations/supabase/`, `supabase/functions/`, `lovable-tagger`, an `app/` directory with `next.config.*` and `\"use client\"` / `\"use server\"` directives, etc.) and the user wants it turned into a Superblocks app.\nreadOnly: true\nmetadata:\n author: superblocks\n version: \"1.0\"\n---\n\n# Third-Party App \u2192 Superblocks 3.0 Migration\n\nPort a user-provided external app into the Superblocks fullstack app you are running inside (template: `app-fullstack`). The source tree is **read-only material**. All edits land in the target app under `server/` and `client/`.\n\nThis file is the migration framework. **Per-platform mapping rules live in sibling files** \u2014 load the right one before you start mapping.\n\n## Checklist is mandatory\n\nChecklist discipline is required for every migration run:\n\n- Before any file edits, ensure migration checklist items are seeded via `build_manageChecklist`.\n- Before editing an item, mark it `in_progress`.\n- After the edit lands, mark it `completed`, or `failed` with a concrete `failureReason` if deterministic completion is impossible.\n- When you need an item to survive `build_finalize`, set `clearOnFinalize: false` on add/update. Use this only for migration-tracking items that must persist until explicit migration completion.\n- Do not continue implementation if checklist state is missing, stale, or inconsistent with the work you are doing. Fix checklist state first.\n- Free-text progress updates are never a substitute for checklist updates.\n\n## Identify the source platform\n\nMatch the source tree against these signals, then read the matching reference file in this folder. Read it once, up-front \u2014 it tells you what shapes to look for and how each maps to Superblocks.\n\n- **Replit** \u2014 `replit.md`, `.replit`, `artifacts/`, an Express server with an Orval-generated client. \u2192 load `replit.md`.\n- **Lovable** \u2014 `src/integrations/supabase/client.ts`, `supabase/config.toml`, `supabase/functions/`, `supabase/migrations/`, `lovable-tagger` in `vite.config.ts`. \u2192 load `lovable.md`.\n- **v0** \u2014 `app/<segment>/page.tsx` (Next.js App Router) plus `next.config.{js,mjs,ts}` and `next` in `package.json`, files with `\"use client\"` / `\"use server\"` directives, `next/link` / `next/navigation` imports, `components/ui/` with shadcn primitives. \u2192 load `v0.md`.\n- **Claude Design** \u2014 a small flat archive (no `package.json`, no `node_modules`, no build config) with one top-level `<Name>.html` plus sibling `app.jsx`, `data.js`, and `tweaks-panel.jsx`. The HTML loads React + ReactDOM + Babel from a CDN, uses `<html data-theme=\"...\">`, and references `var(--accent)` / `var(--ink)` CSS variables. The `.jsx` files contain `/*EDITMODE-BEGIN*/ ... /*EDITMODE-END*/` markers around defaults and use `useTweaks` / `TweaksPanel` / `TweakSection` / `TweakToggle` globals. \u2192 load `claude-design.md`.\n- **Ambiguous or neither** \u2014 stop and ask the user which platform the source came from. Do not guess. It is possible that it is No Platform. In this case, follow the general guidelines in this document and ask user questions for any ambiguity.\n\nThe framework below applies to every platform; the platform file fills in the source-specific mapping.\n\n## Target layout\n\nThe app you are running inside looks like this. Do not invent new top-level directories.\n\n```\nclient/\n App.tsx \u2014 root with <AppProvider> + <Outlet />\n router.tsx \u2014 react-router v7 data mode (`createBrowserRouter`); see Router shape below\n index.css \u2014 Tailwind v4 + theme tokens\n hooks/\n useApi.ts \u2014 typed wrapper around useTypedApi<ApiRegistry>\n useApiData.ts \u2014 typed wrapper around useTypedApiData<ApiRegistry>\n lib/executeApi.ts \u2014 non-React typed executeApi\n pages/<Name>/index.tsx\n components/ui/ \u2014 shadcn primitives (do not modify)\nserver/\n apis/\n index.ts \u2014 registry: `const apis = { ApiName: ... } as const;`\n <ApiName>/api.ts\n```\n\n## Universal mapping (applies to every source)\n\nThese hold regardless of source platform. Per-platform specifics layer on top.\n\n- APIs are addressed by `name` via the registry \u2014 there is no URL path. Within `api()`:\n - All inputs (whatever shape the source had \u2014 body, query, params, function args) \u2192 one unified `input` Zod schema; destructure inside `run(ctx, { ... })`.\n - The handler's response \u2192 `return { ... }` from `run`. The `output` schema validates it automatically; do not `safeParse` by hand.\n - Auth \u2192 `ctx.user` (`userId`, `email`, `name`, `groups`, `customClaims`). Auth is platform-managed; drop the source's auth flows entirely.\n - Errors \u2192 throw the `SdkError` subtypes the sdk-api README documents (`InputValidationError`, `OutputValidationError`, `IntegrationError`, `ExecutionError`). Never invent error classes or return HTTP status codes.\n - DB clients (`pg`, `knex`, `prisma`, Drizzle, `supabase.from(...)`) \u2192 declare in `integrations: { db: postgres(DB_INTEGRATION_ID) }` and call `ctx.integrations.db.query(sql, ZodSchema, params, { label: \"...\" })` / `.execute(...)`. Parameterized SQL only. Hold integration UUIDs in module-level `const`s, not literals scattered through `run`.\n - External HTTP (`axios`, `fetch`, third-party SDKs) \u2192 declared integration + `ctx.integrations.<name>.apiRequest({ method, path, body }, { response: ZodSchema })`.\n - `process.env.*` / `import.meta.env.*` / `Deno.env.get(...)` \u2192 `ctx.env`. Logging \u2192 `ctx.log.info/warn/error/debug(msg, data?)`.\n - Server bootstrapping (`app.listen`, CORS, route grouping, middleware setup, `Deno.serve`) \u2192 drop entirely. The platform handles it.\n- **Each frontend page \u2192 one Superblocks page** at `client/pages/<Name>/index.tsx`, wired into `client/router.tsx`.\n- **Each backend data source (DB, REST client, S3, ...) \u2192 one Superblocks integration** referenced by UUID. Credentials live on the integration, never in code.\n\n### Router shape (`client/router.tsx`)\n\nThe editor parses this file statically to build the page list and route table. **Use one of the supported page-component bindings \u2014 anything else silently drops every route and the editor shows a \"404 / route has been deleted\" overlay.**\n\nSupported page bindings (mix freely):\n\n```tsx\n// 1. Inline lazy on the route object (preferred \u2014 matches the template):\n{ path: \"about\", lazy: () => import(\"./pages/About/index.tsx\").then(m => ({ Component: m.default })) }\n\n// 2. Static default import + Component / element:\nimport About from \"./pages/About/index.tsx\";\n{ path: \"about\", Component: About }\n{ path: \"about\", element: <About /> }\n\n// 3. Top-level `const` bound to React.lazy + Component / element:\nconst About = lazy(() => import(\"./pages/About/index.tsx\"));\n{ path: \"about\", Component: About }\n```\n\nDo **not**: assign `Component` / `element` to identifiers bound by anything other than a static import or `lazy(() => import(\"...\"))` (no IIFEs, no helper wrappers, no conditional `lazy(...)`, no objects whose keys are computed from a loop). The parser only resolves the shapes above.\n\n## Authoritative references (read just-in-time, not up front)\n\n- `node_modules/@superblocksteam/sdk-api/README.md` and `src/index.ts` \u2014 the server `api()` contract and the full list of factory names. **Never invent factory names.** If a required file is missing, mark the affected checklist item `failed` with the missing path as the reason.\n- Per-integration READMEs under `node_modules/@superblocksteam/sdk-api/src/integrations/<kind>/` \u2014 read once, when you first emit an API that uses that integration.\n- `skills/system/superblocks-frontend/SKILL.md` \u2014 the client contract (`useApi` / `useApiData` / `executeApi` from `@superblocksteam/library`).\n\n> \u26A0\uFE0F **Never** load `skills/system/superblocks-api/SKILL.md`. It describes a different, block-based API pattern that is incompatible with the fullstack template's `sdk-api`. Mixing them produces code that does not compile.\n\n## Non-negotiables\n\n1. **Track everything in the checklist.** The **first tool call after exiting plan mode** or **during build mode, before building** is `build_manageChecklist` to seed. Before every per-item edit, `update <itemId> in_progress`; after, `update <itemId> completed` (or `failed` with a concrete `failureReason`). If you are about to write code and the checklist is empty, stale, or missing the item you are working on, **stop and fix the checklist first** \u2014 the orchestration depends on it. Free-text status reports are not a substitute.\n2. **Discover before you edit.** Inventory routes, pages, data sources, env vars, _and visual surface_ (theme tokens, `index.css`, custom CSS, font setup, layout shells) across the entire source tree before writing any code. The platform file tells you what shapes to look for.\n3. **Ask before guessing.** Multiple integrations of the same kind, missing integrations, unsupported data sources, or any platform-specific ambiguity \u2192 stop and `askMultiChoice`. Never pick for the user. The platform file lists ambiguities specific to that source.\n4. **Preserve visual identity.** The migrated app must be pixel-faithful to the source. Transfer these source details verbatim: copy strings (every label, heading, placeholder, helper text, button, empty state, error, alt text, tooltip, and aria-label), Tailwind class lists, CSS custom properties with original units and color space (no HSL\u2194OKLCH conversion), border-radius, spacing / padding / margin / gap, width / height literals including arbitrary values such as `w-[280px]` and `rounded-[14px]`, shadow tokens and values, typography (family, weight, size, line-height, and letter-spacing), icon identity (same lucide name or same inline SVG), inline SVG and image assets, breakpoints and responsive prefixes, animations and transitions, component breakdown, and JSX nesting. shadcn/ui components stay as-is. Do **not** redesign, restyle, or \"clean up\" while porting. A diff that goes beyond data hooks + auth + routing + framework directives is a regression \u2014 back it out.\n5. **Never copy secrets.** DSN strings, API keys, anon/service-role keys, JWT secrets, env-var lookups for credentials \u2014 none move into the target tree. Integration UUIDs replace them. Surface every leaked secret you find (especially client-side `VITE_*` / `NEXT_PUBLIC_*` keys) in the discovery summary so the user can rotate them.\n6. **No `// TODO`s.** Anything you can't finish deterministically becomes a `failed` checklist item with a concrete `failureReason`.\n7. **Don't scaffold.** If `server/apis/index.ts` or `client/router.tsx` doesn't already exist, you're in the wrong app \u2014 stop and surface this.\n8. **Don't fabricate a backend.** If the source is genuinely frontend-only, the migrated app should also be frontend-only. Don't invent APIs to \"complete\" the architecture.\n\n## Workflow\n\n1. **Locate the source.** If the user gave a path, use it. Otherwise look in the working tree for the platform signals listed above. If ambiguous, ask.\n2. **Load the platform guide.** Read `replit.md`, `lovable.md`, or `v0.md` based on what you found. Do not start mapping before you've read it \u2014 it documents the source's shape and how each piece translates.\n3. **Inventory.** Following the platform guide's discovery checklist, enumerate every route/handler, page, data source, env var, secret, and visual asset in the source tree. Surface a one-paragraph summary plus an itemized list of integrations and unsupported features before writing anything. If the source has bespoke styling, seed a `setup_theme` checklist item to port it.\n4. **Resolve integrations.** For each data source kind: call `searchIntegrations` (filter by `type`). One match \u2192 bind it. Multiple \u2192 ask the user which. Zero \u2192 ask whether to create one; if yes, use `listAvailableIntegrationTypes` (if needed) and `openIntegrationSetup`, then ask the user explicitly whether they saved or cancelled before re-searching. Resolution is **blocking** \u2014 the checklist cannot be seeded until every kind maps to a UUID, is explicitly deferred, or has been confirmed unsupported.\n5. **Seed the checklist** via `build_manageChecklist`. One `api_<ApiName>` per backend interaction, one `frontend_<PageName>` per page, plus `setup_router`, `setup_registry`, `setup_cleanup`, and any `setup_theme` / `setup_storage` / `unsupported_<feature>` items the platform guide tells you to add. Print the count as a sanity check; if it looks wrong, re-check discovery.\n6. **Execute.** Every item follows the same ritual \u2014 no exceptions:\n - **Before touching files:** `build_manageChecklist update <itemId> in_progress`.\n - **Classify the work** per _Before emitting code_ below \u2014 pick the right tool (copy / copy+edit / write) before you start typing.\n - **Emit / edit the files** for that item using the tool the classification selected.\n - **After the edit lands:** `build_manageChecklist update <itemId> completed` (or `failed` with a concrete `failureReason`).\n - You are not done with an item until its checklist entry has moved to a terminal state. Do not batch updates at the end; update as you go.\n - **For parallelizable work:** call `spawnCodingSubagents` with batches of tasks. Each batch's `instructions` must direct the sub-agent to `build_readFile` `skills/system/third-party-migration/SKILL.md` and the matching platform file (for example, `v0.md`) before touching any files. Do not inline the fidelity contract; keep a single source of truth. The instructions also name exact `itemId`s, include the integration-UUID map and source path, include any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tell the sub-agent to follow the same `in_progress` \u2192 `completed`/`failed` ritual for every item it owns.\n - `spawnCodingSubagents` **must be the only tool call in that turn.** It blocks until every sub-agent finishes; there is no \"while waiting\" from your perspective. Other tool calls in the same turn race on the shared checklist and corrupt state. After it returns, read the checklist and handle `failed` items sequentially. If the tool itself errors, surface it and fall back to sequential \u2014 or fail the affected items with `sub-agent orchestration failed: <error>`.\n\n## Before emitting code\n\nPick the right tool **before** you start typing. The source tree is the source of truth; preserve it byte-for-byte wherever you can. `build_writeFile` is an escalation, not the primary tool \u2014 a rewritten file is only as faithful as the model's attention, while a copied file is faithful by construction.\n\nFor each checklist item, classify the target file(s) into the **lowest bucket that fits** and use the tool for that bucket:\n\n| Source vs. target needs | Tool | Examples |\n| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |\n| **Directory** of non-source files | `build_copyDirectory` \u2014 never per-file | `public/`, `static/`, `assets/`, `src/assets/`, fonts, image bundles |\n| **Identical** \u2014 byte-for-byte | `build_copyFile` | data modules, type files, JSON, fixtures, vendored utils, content/copy modules, shadcn primitives the source has already customized |\n| **Trivial edits only** \u2014 \u2264 3 distinct edit sites | `build_copyFile` then `build_editFile` per site | import-path swaps (`react-router-dom` \u2192 `react-router`), single hook rename, one-line constant fix, removing a single `\"use client\"` directive |\n| **Structural changes** \u2014 different component APIs, framework wrappers, routing overhaul, data-hook replacement | `build_writeFile` | page components whose data layer is being rewritten, server handlers being reshaped to `api(...)`, router file being regenerated |\n\n**Heuristic:** if you cannot name the specific lines that need to change before reading the file, you have not earned `build_writeFile` yet \u2014 `build_readFile` first, then re-classify.\n\n**Asset directories never get a per-file ruling.** If `public/` (or the platform's equivalent \u2014 see the per-platform guide) exists in the source, it ships as a single `build_copyDirectory` regardless of contents. Do not enumerate, do not skip, do not selectively copy \"the ones you think you'll need.\"\n\n## When emitting code\n\n- **Server.** Default-export one `api({ name, integrations, input, output, run })` from `@superblocksteam/sdk-api`. The `name` and the registry key in `server/apis/index.ts` must equal `<ApiName>` verbatim \u2014 the client calls `useApi(\"<ApiName>\")` by that exact string. Preserve the external response shape exactly so the migrated frontend keeps working. Use parameterized SQL only (`$N`); zero string interpolations. Throw the error classes the sdk-api README documents instead of returning HTTP status codes.\n- **Client.** Replace the source's data hooks with `useApiData` (reads) or `useApi` (mutations) keyed by `<ApiName>`. **Import the typed wrappers from the template, not the library directly:** `import { useApi } from \"@/hooks/useApi.js\"`, `import { useApiData } from \"@/hooks/useApiData.js\"`, `import { executeApi } from \"@/lib/executeApi.js\"`. They give compile-time inference from `ApiRegistry`. Drop the source's generated client packages, `QueryClientProvider`, base-URL or auth-token getters, and any auth-context plumbing \u2014 Superblocks handles all of that. shadcn/form + react-hook-form + zod stays. Follow the loading-state guidance in `superblocks-frontend/SKILL.md`.\n- **ESM imports.** Every relative import in emitted code uses an explicit `.js` extension (`./api.js`, `../hooks/useApi.js`) \u2014 even though the source is `.ts`. The template is ESM; bare specifiers fail at runtime.\n- **Theme port.** When carrying over the source's theme, copy the existing color values **as-is** into `client/index.css`'s `:root` block. HSL values written `hsl(222 47% 11%)` (CSS Color Level 4 space-separated form) work directly with the `@theme inline` mapping in Tailwind v4. **Do not convert to OKLCH** unless the source already uses OKLCH \u2014 converting introduces drift and is a common visual-regression source.\n- **Visual fidelity.** JSX structure, Tailwind classes, shadcn variants, custom CSS, theme tokens, fonts, and layout containers must transfer over **unchanged** from the source page. The only things that change in a page port are the data hooks, the auth touchpoints, and the router primitives. Do not \"improve\" markup, swap class names, or substitute components. If the diff between source and target page goes beyond data + auth + routing, you are over-editing \u2014 back out the cosmetic changes.\n- **Sub-agents must not** call `searchIntegrations`, `openIntegrationSetup`, or any integration-resolution tool. If they hit a kind missing from the map, fail the item with `unresolved integration kind: <kind>` and let the main agent handle it on return.\n\n## Done\n\nStop only when every checklist item is `completed` or `failed`. Report the counts plus any platform-specific findings the per-platform guide asks you to surface (e.g. leaked secrets, replaced RLS policies, unsupported realtime features). Do not claim success \u2014 defer verification to the user running the app.\n";
|
|
2
2
|
//# sourceMappingURL=skill.generated.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"skill.generated.d.ts","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,OAAO,otoBAmKnB,CAAC"}
|
|
@@ -17,6 +17,17 @@ Port a user-provided external app into the Superblocks fullstack app you are run
|
|
|
17
17
|
|
|
18
18
|
This file is the migration framework. **Per-platform mapping rules live in sibling files** — load the right one before you start mapping.
|
|
19
19
|
|
|
20
|
+
## Checklist is mandatory
|
|
21
|
+
|
|
22
|
+
Checklist discipline is required for every migration run:
|
|
23
|
+
|
|
24
|
+
- Before any file edits, ensure migration checklist items are seeded via \`build_manageChecklist\`.
|
|
25
|
+
- Before editing an item, mark it \`in_progress\`.
|
|
26
|
+
- After the edit lands, mark it \`completed\`, or \`failed\` with a concrete \`failureReason\` if deterministic completion is impossible.
|
|
27
|
+
- When you need an item to survive \`build_finalize\`, set \`clearOnFinalize: false\` on add/update. Use this only for migration-tracking items that must persist until explicit migration completion.
|
|
28
|
+
- Do not continue implementation if checklist state is missing, stale, or inconsistent with the work you are doing. Fix checklist state first.
|
|
29
|
+
- Free-text progress updates are never a substitute for checklist updates.
|
|
30
|
+
|
|
20
31
|
## Identify the source platform
|
|
21
32
|
|
|
22
33
|
Match the source tree against these signals, then read the matching reference file in this folder. Read it once, up-front — it tells you what shapes to look for and how each maps to Superblocks.
|
|
@@ -24,6 +35,7 @@ Match the source tree against these signals, then read the matching reference fi
|
|
|
24
35
|
- **Replit** — \`replit.md\`, \`.replit\`, \`artifacts/\`, an Express server with an Orval-generated client. → load \`replit.md\`.
|
|
25
36
|
- **Lovable** — \`src/integrations/supabase/client.ts\`, \`supabase/config.toml\`, \`supabase/functions/\`, \`supabase/migrations/\`, \`lovable-tagger\` in \`vite.config.ts\`. → load \`lovable.md\`.
|
|
26
37
|
- **v0** — \`app/<segment>/page.tsx\` (Next.js App Router) plus \`next.config.{js,mjs,ts}\` and \`next\` in \`package.json\`, files with \`"use client"\` / \`"use server"\` directives, \`next/link\` / \`next/navigation\` imports, \`components/ui/\` with shadcn primitives. → load \`v0.md\`.
|
|
38
|
+
- **Claude Design** — a small flat archive (no \`package.json\`, no \`node_modules\`, no build config) with one top-level \`<Name>.html\` plus sibling \`app.jsx\`, \`data.js\`, and \`tweaks-panel.jsx\`. The HTML loads React + ReactDOM + Babel from a CDN, uses \`<html data-theme="...">\`, and references \`var(--accent)\` / \`var(--ink)\` CSS variables. The \`.jsx\` files contain \`/*EDITMODE-BEGIN*/ ... /*EDITMODE-END*/\` markers around defaults and use \`useTweaks\` / \`TweaksPanel\` / \`TweakSection\` / \`TweakToggle\` globals. → load \`claude-design.md\`.
|
|
27
39
|
- **Ambiguous or neither** — stop and ask the user which platform the source came from. Do not guess. It is possible that it is No Platform. In this case, follow the general guidelines in this document and ask user questions for any ambiguity.
|
|
28
40
|
|
|
29
41
|
The framework below applies to every platform; the platform file fills in the source-specific mapping.
|
|
@@ -100,7 +112,7 @@ Do **not**: assign \`Component\` / \`element\` to identifiers bound by anything
|
|
|
100
112
|
1. **Track everything in the checklist.** The **first tool call after exiting plan mode** or **during build mode, before building** is \`build_manageChecklist\` to seed. Before every per-item edit, \`update <itemId> in_progress\`; after, \`update <itemId> completed\` (or \`failed\` with a concrete \`failureReason\`). If you are about to write code and the checklist is empty, stale, or missing the item you are working on, **stop and fix the checklist first** — the orchestration depends on it. Free-text status reports are not a substitute.
|
|
101
113
|
2. **Discover before you edit.** Inventory routes, pages, data sources, env vars, _and visual surface_ (theme tokens, \`index.css\`, custom CSS, font setup, layout shells) across the entire source tree before writing any code. The platform file tells you what shapes to look for.
|
|
102
114
|
3. **Ask before guessing.** Multiple integrations of the same kind, missing integrations, unsupported data sources, or any platform-specific ambiguity → stop and \`askMultiChoice\`. Never pick for the user. The platform file lists ambiguities specific to that source.
|
|
103
|
-
4. **Preserve visual identity.** The migrated app must
|
|
115
|
+
4. **Preserve visual identity.** The migrated app must be pixel-faithful to the source. Transfer these source details verbatim: copy strings (every label, heading, placeholder, helper text, button, empty state, error, alt text, tooltip, and aria-label), Tailwind class lists, CSS custom properties with original units and color space (no HSL↔OKLCH conversion), border-radius, spacing / padding / margin / gap, width / height literals including arbitrary values such as \`w-[280px]\` and \`rounded-[14px]\`, shadow tokens and values, typography (family, weight, size, line-height, and letter-spacing), icon identity (same lucide name or same inline SVG), inline SVG and image assets, breakpoints and responsive prefixes, animations and transitions, component breakdown, and JSX nesting. shadcn/ui components stay as-is. Do **not** redesign, restyle, or "clean up" while porting. A diff that goes beyond data hooks + auth + routing + framework directives is a regression — back it out.
|
|
104
116
|
5. **Never copy secrets.** DSN strings, API keys, anon/service-role keys, JWT secrets, env-var lookups for credentials — none move into the target tree. Integration UUIDs replace them. Surface every leaked secret you find (especially client-side \`VITE_*\` / \`NEXT_PUBLIC_*\` keys) in the discovery summary so the user can rotate them.
|
|
105
117
|
6. **No \`// TODO\`s.** Anything you can't finish deterministically becomes a \`failed\` checklist item with a concrete \`failureReason\`.
|
|
106
118
|
7. **Don't scaffold.** If \`server/apis/index.ts\` or \`client/router.tsx\` doesn't already exist, you're in the wrong app — stop and surface this.
|
|
@@ -115,12 +127,30 @@ Do **not**: assign \`Component\` / \`element\` to identifiers bound by anything
|
|
|
115
127
|
5. **Seed the checklist** via \`build_manageChecklist\`. One \`api_<ApiName>\` per backend interaction, one \`frontend_<PageName>\` per page, plus \`setup_router\`, \`setup_registry\`, \`setup_cleanup\`, and any \`setup_theme\` / \`setup_storage\` / \`unsupported_<feature>\` items the platform guide tells you to add. Print the count as a sanity check; if it looks wrong, re-check discovery.
|
|
116
128
|
6. **Execute.** Every item follows the same ritual — no exceptions:
|
|
117
129
|
- **Before touching files:** \`build_manageChecklist update <itemId> in_progress\`.
|
|
118
|
-
- **
|
|
130
|
+
- **Classify the work** per _Before emitting code_ below — pick the right tool (copy / copy+edit / write) before you start typing.
|
|
131
|
+
- **Emit / edit the files** for that item using the tool the classification selected.
|
|
119
132
|
- **After the edit lands:** \`build_manageChecklist update <itemId> completed\` (or \`failed\` with a concrete \`failureReason\`).
|
|
120
133
|
- You are not done with an item until its checklist entry has moved to a terminal state. Do not batch updates at the end; update as you go.
|
|
121
|
-
- **For parallelizable work:** call \`spawnCodingSubagents\` with batches of tasks. Each batch's \`instructions\`
|
|
134
|
+
- **For parallelizable work:** call \`spawnCodingSubagents\` with batches of tasks. Each batch's \`instructions\` must direct the sub-agent to \`build_readFile\` \`skills/system/third-party-migration/SKILL.md\` and the matching platform file (for example, \`v0.md\`) before touching any files. Do not inline the fidelity contract; keep a single source of truth. The instructions also name exact \`itemId\`s, include the integration-UUID map and source path, include any platform-specific context the sub-agent needs (e.g. RLS-replacement clauses for Lovable), and tell the sub-agent to follow the same \`in_progress\` → \`completed\`/\`failed\` ritual for every item it owns.
|
|
122
135
|
- \`spawnCodingSubagents\` **must be the only tool call in that turn.** It blocks until every sub-agent finishes; there is no "while waiting" from your perspective. Other tool calls in the same turn race on the shared checklist and corrupt state. After it returns, read the checklist and handle \`failed\` items sequentially. If the tool itself errors, surface it and fall back to sequential — or fail the affected items with \`sub-agent orchestration failed: <error>\`.
|
|
123
136
|
|
|
137
|
+
## Before emitting code
|
|
138
|
+
|
|
139
|
+
Pick the right tool **before** you start typing. The source tree is the source of truth; preserve it byte-for-byte wherever you can. \`build_writeFile\` is an escalation, not the primary tool — a rewritten file is only as faithful as the model's attention, while a copied file is faithful by construction.
|
|
140
|
+
|
|
141
|
+
For each checklist item, classify the target file(s) into the **lowest bucket that fits** and use the tool for that bucket:
|
|
142
|
+
|
|
143
|
+
| Source vs. target needs | Tool | Examples |
|
|
144
|
+
| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
145
|
+
| **Directory** of non-source files | \`build_copyDirectory\` — never per-file | \`public/\`, \`static/\`, \`assets/\`, \`src/assets/\`, fonts, image bundles |
|
|
146
|
+
| **Identical** — byte-for-byte | \`build_copyFile\` | data modules, type files, JSON, fixtures, vendored utils, content/copy modules, shadcn primitives the source has already customized |
|
|
147
|
+
| **Trivial edits only** — ≤ 3 distinct edit sites | \`build_copyFile\` then \`build_editFile\` per site | import-path swaps (\`react-router-dom\` → \`react-router\`), single hook rename, one-line constant fix, removing a single \`"use client"\` directive |
|
|
148
|
+
| **Structural changes** — different component APIs, framework wrappers, routing overhaul, data-hook replacement | \`build_writeFile\` | page components whose data layer is being rewritten, server handlers being reshaped to \`api(...)\`, router file being regenerated |
|
|
149
|
+
|
|
150
|
+
**Heuristic:** if you cannot name the specific lines that need to change before reading the file, you have not earned \`build_writeFile\` yet — \`build_readFile\` first, then re-classify.
|
|
151
|
+
|
|
152
|
+
**Asset directories never get a per-file ruling.** If \`public/\` (or the platform's equivalent — see the per-platform guide) exists in the source, it ships as a single \`build_copyDirectory\` regardless of contents. Do not enumerate, do not skip, do not selectively copy "the ones you think you'll need."
|
|
153
|
+
|
|
124
154
|
## When emitting code
|
|
125
155
|
|
|
126
156
|
- **Server.** Default-export one \`api({ name, integrations, input, output, run })\` from \`@superblocksteam/sdk-api\`. The \`name\` and the registry key in \`server/apis/index.ts\` must equal \`<ApiName>\` verbatim — the client calls \`useApi("<ApiName>")\` by that exact string. Preserve the external response shape exactly so the migrated frontend keeps working. Use parameterized SQL only (\`$N\`); zero string interpolations. Throw the error classes the sdk-api README documents instead of returning HTTP status codes.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG
|
|
1
|
+
{"version":3,"file":"skill.generated.js","sourceRoot":"","sources":["../../../../../src/ai-service/skills/system/third-party-migration/skill.generated.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,mDAAmD;AAEnD,MAAM,CAAC,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmKtB,CAAC"}
|