@agentskillkit/agent-skills 1.0.1 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agent/ARCHITECTURE.md +406 -149
- package/.agent/CONTINUOUS_EXECUTION_POLICY.md +623 -0
- package/.agent/GEMINI.md +935 -67
- package/.agent/WORKFLOW_CHAINS.md +683 -0
- package/.agent/agents/{code-archaeologist.md → analyst.md} +37 -25
- package/.agent/agents/assessor.md +186 -0
- package/.agent/agents/{backend-specialist.md → backend.md} +44 -30
- package/.agent/agents/critic.md +164 -0
- package/.agent/agents/{database-architect.md → database.md} +36 -24
- package/.agent/agents/{debugger.md → debug.md} +49 -43
- package/.agent/agents/{devops-engineer.md → devops.md} +50 -50
- package/.agent/agents/{documentation-writer.md → docs.md} +13 -13
- package/.agent/agents/{explorer-agent.md → explorer.md} +12 -6
- package/.agent/agents/{frontend-specialist.md → frontend.md} +79 -33
- package/.agent/agents/{game-developer.md → gamedev.md} +30 -30
- package/.agent/agents/lead.md +447 -0
- package/.agent/agents/learner.md +143 -0
- package/.agent/agents/mobile.md +383 -0
- package/.agent/agents/orchestrator.md +122 -339
- package/.agent/agents/pentest.md +188 -0
- package/.agent/agents/{performance-optimizer.md → perf.md} +44 -40
- package/.agent/agents/planner.md +413 -0
- package/.agent/agents/{product-manager.md → pm.md} +38 -23
- package/.agent/agents/po.md +106 -0
- package/.agent/agents/qa.md +109 -0
- package/.agent/agents/recovery.md +168 -0
- package/.agent/agents/security.md +171 -0
- package/.agent/agents/{seo-specialist.md → seo.md} +24 -24
- package/.agent/agents/{test-engineer.md → testing.md} +39 -39
- package/.agent/archive/registry.json.v1-backup +514 -0
- package/.agent/config/execution-policy.json +90 -0
- package/.agent/config/metrics-config.json +109 -0
- package/.agent/config/notification-config.json +43 -0
- package/.agent/knowledge/README.md +95 -0
- package/.agent/knowledge/_migration_backup/lessons-learned_2026-01-27T07-45-58.862Z.yaml +55 -0
- package/.agent/knowledge/_needs_review.yaml +24 -0
- package/.agent/knowledge/autopilot-metrics.json +93 -0
- package/.agent/knowledge/autopilot-runs.json +11 -0
- package/.agent/knowledge/backups/2026-01-25T17-08-04-097Z/lessons-learned.yaml +12 -0
- package/.agent/knowledge/backups/2026-01-25T17-08-04-097Z/settings.yaml +5 -0
- package/.agent/knowledge/backups/2026-01-25T17-08-08-345Z/lessons-learned.yaml +12 -0
- package/.agent/knowledge/backups/2026-01-25T17-08-08-345Z/settings.yaml +5 -0
- package/.agent/knowledge/backups/2026-01-25T17-08-09-232Z/lessons-learned.yaml +12 -0
- package/.agent/knowledge/backups/2026-01-25T17-08-09-232Z/settings.yaml +5 -0
- package/.agent/knowledge/backups/2026-01-29T15-15-32-715Z/lessons-learned.yaml +37 -0
- package/.agent/knowledge/backups/2026-01-29T15-15-32-715Z/settings.yaml +24 -0
- package/.agent/knowledge/backups/lessons-learned.yaml.archived +58 -0
- package/.agent/knowledge/backups/lessons-learned.yaml.bak-20260128-180048 +58 -0
- package/.agent/knowledge/backups/lessons.yaml.archived +2 -0
- package/.agent/knowledge/detected-errors.json +5 -0
- package/.agent/knowledge/evolution-signals.json +95 -0
- package/.agent/knowledge/improvements.yaml +68 -0
- package/.agent/knowledge/index.json +133 -0
- package/.agent/knowledge/lessons-learned.json +15 -0
- package/.agent/knowledge/lessons-learned.yaml +10 -15
- package/.agent/knowledge/metrics.json +66 -0
- package/.agent/knowledge/mistakes.yaml +74 -0
- package/.agent/knowledge/retention.yaml +165 -0
- package/.agent/knowledge/scans/scan_1769543882183.json +13 -0
- package/.agent/knowledge/scans/scan_1769543882322.json +13 -0
- package/.agent/knowledge/scans/scan_1769543882443.json +13 -0
- package/.agent/knowledge/scans/scan_1769543889157.json +13 -0
- package/.agent/knowledge/scans/scan_1769543950029.json +13 -0
- package/.agent/knowledge/scans/scan_1769696246716.json +13 -0
- package/.agent/knowledge/scans/scan_1769696247452.json +13 -0
- package/.agent/knowledge/scans/scan_1769698907767.json +13 -0
- package/.agent/knowledge/scans/scan_1769698934018.json +13 -0
- package/.agent/knowledge/scans/scan_1769699718013.json +13 -0
- package/.agent/knowledge/schema/common.schema.json +140 -0
- package/.agent/knowledge/schema/evolution-signals.schema.json +93 -0
- package/.agent/knowledge/schema/improvements.schema.json +132 -0
- package/.agent/knowledge/schema/mistakes.schema.json +138 -0
- package/.agent/knowledge/schema/settings.schema.json +102 -0
- package/.agent/knowledge/settings.yaml +5 -0
- package/.agent/knowledge/taxonomy.yaml +218 -0
- package/.agent/metrics/autopilot-metrics-schema.yaml +183 -0
- package/.agent/scripts-js/adaptive-workflow.js +504 -0
- package/.agent/scripts-js/auto_preview.js +166 -0
- package/.agent/scripts-js/autopilot-metrics.js +567 -0
- package/.agent/scripts-js/autopilot-runner.js +455 -0
- package/.agent/scripts-js/batch-skill-update.cjs +248 -0
- package/.agent/scripts-js/benchmark.cjs +147 -0
- package/.agent/scripts-js/checklist.js +174 -0
- package/.agent/scripts-js/compact-registry.cjs +79 -0
- package/.agent/scripts-js/execution-history.js +119 -0
- package/.agent/scripts-js/execution-policy.js +339 -0
- package/.agent/scripts-js/health-check.js +192 -0
- package/.agent/scripts-js/metrics-collector.js +364 -0
- package/.agent/scripts-js/metrics-dashboard.js +372 -0
- package/.agent/scripts-js/preflight-assessment.js +347 -0
- package/.agent/scripts-js/scaffold-nextjs.js +197 -0
- package/.agent/scripts-js/session_manager.js +200 -0
- package/.agent/scripts-js/skill-validator.js +318 -0
- package/.agent/scripts-js/utils/colors.js +56 -0
- package/.agent/scripts-js/utils/process-manager.js +148 -0
- package/.agent/scripts-js/utils/reporter.js +168 -0
- package/.agent/scripts-js/utils/runner.js +117 -0
- package/.agent/scripts-js/verify-skills.js +252 -0
- package/.agent/scripts-js/verify_all.js +242 -0
- package/.agent/scripts-js/workflow-engine.js +545 -0
- package/.agent/scripts-js/workflow-validator.js +417 -0
- package/.agent/skill-lock.json +343 -0
- package/.agent/skills/agent-patterns/SKILL.md +761 -0
- package/.agent/skills/auto-learner/SKILL.md +280 -0
- package/.agent/skills/auto-learner/dashboard/index.html +494 -0
- package/.agent/skills/auto-learner/references/learned-imports.md +50 -0
- package/.agent/skills/auto-learner/scripts/dashboard_server.js +224 -0
- package/.agent/skills/auto-learner/scripts/error_sensor.js +460 -0
- package/.agent/skills/auto-learner/scripts/learn_from_failure.js +225 -0
- package/.agent/skills/auto-learner/scripts/pattern_analyzer.js +594 -0
- package/.agent/skills/auto-learner/scripts/pre_execution_check.js +464 -0
- package/.agent/skills/auto-learner/scripts/user_correction_sensor.js +426 -0
- package/.agent/skills/debug-pro/SKILL.md +354 -0
- package/.agent/skills/execution-reporter/SKILL.md +195 -0
- package/.agent/skills/gitops/SKILL.md +303 -0
- package/.agent/skills/gitops/references/argocd-setup.md +134 -0
- package/.agent/skills/gitops/references/sync-policies.md +131 -0
- package/.agent/skills/lifecycle-orchestrator/SKILL.md +83 -0
- package/.agent/skills/mobile-design/SKILL.md +258 -50
- package/.agent/skills/mobile-developer/SKILL.md +205 -0
- package/.agent/skills/mobile-security-coder/SKILL.md +184 -0
- package/.agent/skills/observability/SKILL.md +397 -0
- package/.agent/skills/problem-checker/SKILL.md +195 -0
- package/.agent/skills/problem-checker/scripts/check_problems.js +261 -0
- package/.agent/skills/registry.backup.json +2251 -0
- package/.agent/skills/registry.json +940 -366
- package/.agent/skills/registry.phase1.backup.json +1278 -0
- package/.agent/skills/requirements-python.txt +25 -0
- package/.agent/skills/requirements.txt +96 -0
- package/.agent/skills/state-rollback/SKILL.md +240 -0
- package/.agent/skills/state-rollback/scripts/state_manager.js +282 -0
- package/.agent/skills/studio/SKILL.md +107 -0
- package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/styles.csv +16 -16
- package/.agent/skills/studio/scripts-js/core.js +344 -0
- package/.agent/skills/studio/scripts-js/design_system.js +952 -0
- package/.agent/skills/studio/scripts-js/jsconfig.json +27 -0
- package/.agent/skills/studio/scripts-js/search.js +191 -0
- package/.agent/skills/studio/scripts-js/types.d.ts +276 -0
- package/.agent/skills/studio/scripts-js/utils/component-specs.js +153 -0
- package/.agent/skills/studio/scripts-js/utils/config-loader.js +164 -0
- package/.agent/skills/studio/scripts-js/utils/css-templates.js +168 -0
- package/.agent/skills/studio/scripts-js/utils/css-validator.js +94 -0
- package/.agent/skills/studio/scripts-js/utils/csv-loader.js +55 -0
- package/.agent/skills/studio/scripts-js/utils/intelligent-overrides.js +128 -0
- package/.agent/skills/studio/scripts-js/utils/page-override-formatter.js +142 -0
- package/.agent/skills/studio/scripts-js/utils/page-type-detector.js +123 -0
- package/.agent/skills/studio/scripts-js/utils/search-cache.js +190 -0
- package/.agent/skills/studio/scripts-js/utils/text-utils.js +54 -0
- package/.agent/skills/typescript-expert/SKILL.md +429 -0
- package/.agent/skills/typescript-expert/references/tsconfig-strict.json +92 -0
- package/.agent/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
- package/.agent/skills/typescript-expert/references/utility-types.ts +335 -0
- package/.agent/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
- package/.agent/skills-audit-report.md +114 -0
- package/.agent/workflows/README.md +707 -0
- package/.agent/workflows/agent.md +77 -0
- package/.agent/workflows/alert.md +333 -0
- package/.agent/workflows/api.md +209 -0
- package/.agent/workflows/architect.md +148 -42
- package/.agent/workflows/auto-accept-process.md +275 -0
- package/.agent/workflows/autopilot.md +755 -92
- package/.agent/workflows/benchmark.md +221 -0
- package/.agent/workflows/boost.md +61 -26
- package/.agent/workflows/build.md +114 -54
- package/.agent/workflows/chronicle.md +19 -0
- package/.agent/workflows/diagnose.md +72 -30
- package/.agent/workflows/diagram.md +121 -0
- package/.agent/workflows/flags.md +149 -0
- package/.agent/workflows/forge.md +15 -5
- package/.agent/workflows/game.md +142 -0
- package/.agent/workflows/inspect.md +76 -40
- package/.agent/workflows/launch.md +183 -40
- package/.agent/workflows/mobile.md +106 -0
- package/.agent/workflows/monitor.md +283 -0
- package/.agent/workflows/optimize.md +220 -0
- package/.agent/workflows/pulse.md +113 -43
- package/.agent/workflows/stage.md +37 -10
- package/.agent/workflows/studio.md +35 -13
- package/.agent/workflows/think.md +19 -0
- package/.agent/workflows/validate.md +21 -1
- package/CHANGELOG.md +448 -24
- package/LICENSE +29 -7
- package/README.backup.md +540 -0
- package/README.md +870 -203
- package/docs/README.md +62 -0
- package/docs/archive/plan-v21.md +170 -0
- package/docs/getting-started.md +337 -0
- package/docs/guides/migration.md +70 -0
- package/docs/guides/publishing.md +88 -0
- package/docs/reference/python-strategy.md +393 -0
- package/docs/reference/scripts.md +56 -0
- package/docs/reference/skill-standard.md +457 -0
- package/package.json +51 -7
- package/packages/cli/.agent/knowledge/evolution-signals.json +51 -0
- package/packages/cli/.agent/knowledge/lessons-learned.yaml +25 -15
- package/packages/cli/.agent/knowledge/scans/scan_demo.json +58 -0
- package/packages/cli/README.md +21 -0
- package/packages/cli/bin/{ag-smart.js → agent.js} +37 -5
- package/packages/cli/examples/demo-violations.js +27 -0
- package/packages/cli/lib/audit.js +134 -49
- package/packages/cli/lib/audit.test.js +100 -0
- package/packages/cli/lib/auto-learn.js +1 -1
- package/packages/cli/lib/backup.js +138 -0
- package/packages/cli/lib/backup.test.js +78 -0
- package/packages/cli/lib/cognitive-lesson.js +476 -0
- package/packages/cli/lib/completion.js +149 -0
- package/packages/cli/lib/config.js +8 -2
- package/packages/cli/lib/eslint-fix.js +1 -1
- package/packages/cli/lib/evolution-signal.js +215 -0
- package/packages/cli/lib/export.js +86 -0
- package/packages/cli/lib/export.test.js +65 -0
- package/packages/cli/lib/fix.js +61 -2
- package/packages/cli/lib/fix.test.js +80 -0
- package/packages/cli/lib/gemini-export.js +83 -0
- package/packages/cli/lib/hooks/install-hooks.js +8 -32
- package/packages/cli/lib/hooks/lint-learn.js +2 -2
- package/packages/cli/lib/icons.js +93 -0
- package/packages/cli/lib/ignore.js +116 -0
- package/packages/cli/lib/ignore.test.js +58 -0
- package/packages/cli/lib/init.js +124 -0
- package/packages/cli/lib/knowledge-index.js +326 -0
- package/packages/cli/lib/knowledge-metrics.js +335 -0
- package/packages/cli/lib/knowledge-retention.js +398 -0
- package/packages/cli/lib/knowledge-validator.js +312 -0
- package/packages/cli/lib/learn.js +115 -33
- package/packages/cli/lib/migrate-to-v4.js +322 -0
- package/packages/cli/lib/proposals.js +199 -0
- package/packages/cli/lib/proposals.test.js +56 -0
- package/packages/cli/lib/recall.js +792 -41
- package/packages/cli/lib/recall.test.js +107 -0
- package/packages/cli/lib/selfevolution-bridge.js +167 -0
- package/packages/cli/lib/settings.js +203 -0
- package/packages/cli/lib/skill-learn.js +1 -1
- package/packages/cli/lib/stats.js +31 -42
- package/packages/cli/lib/stats.test.js +94 -0
- package/packages/cli/lib/ui/audit-ui.js +146 -0
- package/packages/cli/lib/ui/backup-ui.js +107 -0
- package/packages/cli/lib/ui/clack-helpers.js +317 -0
- package/packages/cli/lib/ui/common.js +83 -0
- package/packages/cli/lib/ui/completion-ui.js +126 -0
- package/packages/cli/lib/ui/custom-select.js +69 -0
- package/packages/cli/lib/ui/evolution-signals-ui.js +107 -0
- package/packages/cli/lib/ui/export-ui.js +94 -0
- package/packages/cli/lib/ui/fix-all-ui.js +191 -0
- package/packages/cli/lib/ui/help-ui.js +26 -0
- package/packages/cli/lib/ui/index.js +147 -0
- package/packages/cli/lib/ui/init-ui.js +56 -0
- package/packages/cli/lib/ui/knowledge-ui.js +55 -0
- package/packages/cli/lib/ui/learn-ui.js +706 -0
- package/packages/cli/lib/ui/lessons-ui.js +148 -0
- package/packages/cli/lib/ui/pretty.js +145 -0
- package/packages/cli/lib/ui/proposals-ui.js +99 -0
- package/packages/cli/lib/ui/recall-ui.js +342 -0
- package/packages/cli/lib/ui/routing-demo.js +79 -0
- package/packages/cli/lib/ui/routing-ui.js +325 -0
- package/packages/cli/lib/ui/settings-ui.js +103 -0
- package/packages/cli/lib/ui/stats-ui.js +73 -0
- package/packages/cli/lib/ui/watch-ui.js +236 -0
- package/packages/cli/lib/watcher.js +1 -1
- package/packages/cli/lib/watcher.test.js +85 -0
- package/packages/cli/node_modules/.package-lock.json +1529 -0
- package/packages/cli/node_modules/.vite/vitest/results.json +1 -0
- package/packages/cli/package-lock.json +1164 -688
- package/packages/cli/package.json +39 -10
- package/packages/cli/scripts/export-key.js +80 -0
- package/packages/cli/src/MIGRATION.md +418 -0
- package/packages/cli/src/README.md +367 -0
- package/packages/cli/src/core/evolution/evolution-signal.js +42 -0
- package/packages/cli/src/core/evolution/index.js +17 -0
- package/packages/cli/src/core/evolution/review-gate.js +40 -0
- package/packages/cli/src/core/evolution/signal-detector.js +137 -0
- package/packages/cli/src/core/evolution/signal-queue.js +79 -0
- package/packages/cli/src/core/evolution/threshold-checker.js +79 -0
- package/packages/cli/src/core/index.js +15 -0
- package/packages/cli/src/core/learning/cognitive-enhancer.js +282 -0
- package/packages/cli/src/core/learning/index.js +12 -0
- package/packages/cli/src/core/learning/lesson-synthesizer.js +83 -0
- package/packages/cli/src/core/scanning/index.js +14 -0
- package/packages/cli/src/data/index.js +13 -0
- package/packages/cli/src/data/repositories/index.js +8 -0
- package/packages/cli/src/data/repositories/lesson-repository.js +130 -0
- package/packages/cli/src/data/repositories/signal-repository.js +119 -0
- package/packages/cli/src/data/storage/index.js +8 -0
- package/packages/cli/src/data/storage/json-storage.js +64 -0
- package/packages/cli/src/data/storage/yaml-storage.js +66 -0
- package/packages/cli/src/infrastructure/index.js +13 -0
- package/packages/cli/src/presentation/formatters/skill-formatter.js +232 -0
- package/packages/cli/src/services/export-service.js +162 -0
- package/packages/cli/src/services/index.js +13 -0
- package/packages/cli/src/services/learning-service.js +99 -0
- package/packages/cli/tests/integration/evolution-signals.test.js +46 -0
- package/packages/cli/tests/integration/gemini-export.test.js +53 -0
- package/packages/cli/tests/integration/learning-service.test.js +33 -0
- package/packages/cli/tests/integration/signal-detector.test.js +29 -0
- package/packages/cli/tests/unit/cognitive-enhancer.test.js +56 -0
- package/packages/cli/tests/unit/lesson-synthesizer.test.js +84 -0
- package/packages/cli/tests/unit/skill-formatter.test.js +106 -0
- package/packages/cli/vitest.config.js +28 -1
- package/scripts/rebrand/README.md +472 -0
- package/scripts/rebrand/index.mjs +449 -0
- package/scripts/rebrand/v4.mjs +800 -0
- package/tests/e2e/studio-workflow.test.js +100 -0
- package/tests/e2e/validate-workflow.test.js +71 -0
- package/tests/scripts/colors.test.js +75 -0
- package/tests/scripts/component-specs.test.js +157 -0
- package/tests/scripts/config-loader.test.js +204 -0
- package/tests/scripts/core-bm25.test.js +112 -0
- package/tests/scripts/css-templates.test.js +123 -0
- package/tests/scripts/css-validator.test.js +137 -0
- package/tests/scripts/format-master-md.test.js +232 -0
- package/tests/scripts/integration/studio-integration.test.js +183 -0
- package/tests/scripts/intelligent-overrides.test.js +181 -0
- package/tests/scripts/page-override-formatter.test.js +227 -0
- package/tests/scripts/page-type-detector.test.js +141 -0
- package/tests/scripts/process-manager.test.js +79 -0
- package/tests/scripts/reporter.test.js +96 -0
- package/tests/scripts/runner.test.js +82 -0
- package/tests/scripts/search-cache.test.js +210 -0
- package/tests/scripts/text-utils.test.js +63 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +0 -258
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +0 -1067
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +0 -106
- package/.agent/agents/mobile-developer.md +0 -377
- package/.agent/agents/penetration-tester.md +0 -188
- package/.agent/agents/product-owner.md +0 -95
- package/.agent/agents/project-planner.md +0 -406
- package/.agent/agents/qa-automation-engineer.md +0 -103
- package/.agent/agents/security-auditor.md +0 -170
- package/.agent/rules/GEMINI.md +0 -253
- package/.agent/scripts/auto_preview.py +0 -148
- package/.agent/scripts/checklist.py +0 -217
- package/.agent/scripts/session_manager.py +0 -120
- package/.agent/scripts/verify_all.py +0 -327
- package/.agent/skills/aesthetic/SKILL.md +0 -121
- package/.agent/skills/aesthetic/assets/design-guideline-template.md +0 -163
- package/.agent/skills/aesthetic/assets/design-story-template.md +0 -135
- package/.agent/skills/aesthetic/references/design-principles.md +0 -62
- package/.agent/skills/aesthetic/references/design-resources.md +0 -75
- package/.agent/skills/aesthetic/references/micro-interactions.md +0 -53
- package/.agent/skills/aesthetic/references/storytelling-design.md +0 -50
- package/.agent/skills/api-patterns/SKILL.md +0 -81
- package/.agent/skills/api-patterns/rules/api-style.md +0 -42
- package/.agent/skills/api-patterns/rules/auth.md +0 -24
- package/.agent/skills/api-patterns/rules/documentation.md +0 -26
- package/.agent/skills/api-patterns/rules/graphql.md +0 -41
- package/.agent/skills/api-patterns/rules/rate-limiting.md +0 -31
- package/.agent/skills/api-patterns/rules/response.md +0 -37
- package/.agent/skills/api-patterns/rules/rest.md +0 -40
- package/.agent/skills/api-patterns/rules/security-testing.md +0 -122
- package/.agent/skills/api-patterns/rules/trpc.md +0 -41
- package/.agent/skills/api-patterns/rules/versioning.md +0 -22
- package/.agent/skills/api-patterns/scripts/api_validator.py +0 -211
- package/.agent/skills/app-builder/SKILL.md +0 -75
- package/.agent/skills/app-builder/agent-coordination.md +0 -71
- package/.agent/skills/app-builder/feature-building.md +0 -53
- package/.agent/skills/app-builder/project-detection.md +0 -34
- package/.agent/skills/app-builder/scaffolding.md +0 -118
- package/.agent/skills/app-builder/tech-stack.md +0 -40
- package/.agent/skills/app-builder/templates/SKILL.md +0 -39
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +0 -76
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +0 -92
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +0 -88
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +0 -88
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +0 -83
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +0 -90
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +0 -90
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +0 -82
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +0 -100
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +0 -106
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +0 -101
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +0 -83
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +0 -93
- package/.agent/skills/architecture/SKILL.md +0 -55
- package/.agent/skills/architecture/context-discovery.md +0 -43
- package/.agent/skills/architecture/examples.md +0 -94
- package/.agent/skills/architecture/pattern-selection.md +0 -68
- package/.agent/skills/architecture/patterns-reference.md +0 -50
- package/.agent/skills/architecture/trade-off-analysis.md +0 -77
- package/.agent/skills/bash-linux/SKILL.md +0 -199
- package/.agent/skills/behavioral-modes/SKILL.md +0 -242
- package/.agent/skills/brainstorming/SKILL.md +0 -163
- package/.agent/skills/brainstorming/dynamic-questioning.md +0 -350
- package/.agent/skills/clean-code/SKILL.md +0 -201
- package/.agent/skills/code-review-checklist/SKILL.md +0 -109
- package/.agent/skills/code-reviewer/.skill-source.json +0 -8
- package/.agent/skills/code-reviewer/SKILL.md +0 -32
- package/.agent/skills/code-reviewer/enforcement/checklists/backend-api-review-checklist.md +0 -5
- package/.agent/skills/code-reviewer/examples/approved-pr/review-output.md +0 -76
- package/.agent/skills/code-reviewer/examples/rejected-pr/review-output.md +0 -99
- package/.agent/skills/code-reviewer/examples/scenarios.md +0 -3
- package/.agent/skills/code-reviewer/metadata/doctrine-mapping.yaml +0 -167
- package/.agent/skills/code-reviewer/metadata/intent-triggers.yaml +0 -41
- package/.agent/skills/code-reviewer/resources/links.md +0 -59
- package/.agent/skills/code-reviewer/scripts/audit_pr.js +0 -8
- package/.agent/skills/code-reviewer/scripts/audit_pr.v2.js +0 -417
- package/.agent/skills/code-reviewer/scripts/validate_doctrine.js +0 -307
- package/.agent/skills/context-engineering/SKILL.md +0 -86
- package/.agent/skills/context-engineering/references/context-compression.md +0 -84
- package/.agent/skills/context-engineering/references/context-degradation.md +0 -93
- package/.agent/skills/context-engineering/references/context-fundamentals.md +0 -75
- package/.agent/skills/context-engineering/references/context-optimization.md +0 -82
- package/.agent/skills/context-engineering/references/evaluation.md +0 -89
- package/.agent/skills/context-engineering/references/memory-systems.md +0 -88
- package/.agent/skills/context-engineering/references/multi-agent-patterns.md +0 -90
- package/.agent/skills/context-engineering/references/project-development.md +0 -97
- package/.agent/skills/context-engineering/references/tool-design.md +0 -86
- package/.agent/skills/context-engineering/scripts/compression_evaluator.py +0 -329
- package/.agent/skills/context-engineering/scripts/context_analyzer.py +0 -294
- package/.agent/skills/database-design/SKILL.md +0 -52
- package/.agent/skills/database-design/database-selection.md +0 -43
- package/.agent/skills/database-design/indexing.md +0 -39
- package/.agent/skills/database-design/migrations.md +0 -48
- package/.agent/skills/database-design/optimization.md +0 -36
- package/.agent/skills/database-design/orm-selection.md +0 -30
- package/.agent/skills/database-design/schema-design.md +0 -56
- package/.agent/skills/database-design/scripts/schema_validator.py +0 -172
- package/.agent/skills/debugging/SKILL.md +0 -42
- package/.agent/skills/deployment-procedures/SKILL.md +0 -241
- package/.agent/skills/doc.md +0 -177
- package/.agent/skills/document-skills/SKILL.md +0 -49
- package/.agent/skills/document-skills/docx/LICENSE.txt +0 -30
- package/.agent/skills/document-skills/docx/SKILL.md +0 -197
- package/.agent/skills/document-skills/docx/docx-js.md +0 -350
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agent/skills/document-skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agent/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agent/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agent/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agent/skills/document-skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agent/skills/document-skills/docx/ooxml/schemas/mce/mc.xsd +0 -75
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agent/skills/document-skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agent/skills/document-skills/docx/ooxml/scripts/pack.py +0 -159
- package/.agent/skills/document-skills/docx/ooxml/scripts/unpack.py +0 -29
- package/.agent/skills/document-skills/docx/ooxml/scripts/validate.py +0 -69
- package/.agent/skills/document-skills/docx/ooxml/scripts/validation/__init__.py +0 -15
- package/.agent/skills/document-skills/docx/ooxml/scripts/validation/base.py +0 -951
- package/.agent/skills/document-skills/docx/ooxml/scripts/validation/docx.py +0 -274
- package/.agent/skills/document-skills/docx/ooxml/scripts/validation/pptx.py +0 -315
- package/.agent/skills/document-skills/docx/ooxml/scripts/validation/redlining.py +0 -279
- package/.agent/skills/document-skills/docx/ooxml.md +0 -610
- package/.agent/skills/document-skills/docx/scripts/__init__.py +0 -1
- package/.agent/skills/document-skills/docx/scripts/document.py +0 -1276
- package/.agent/skills/document-skills/docx/scripts/templates/comments.xml +0 -3
- package/.agent/skills/document-skills/docx/scripts/templates/commentsExtended.xml +0 -3
- package/.agent/skills/document-skills/docx/scripts/templates/commentsExtensible.xml +0 -3
- package/.agent/skills/document-skills/docx/scripts/templates/commentsIds.xml +0 -3
- package/.agent/skills/document-skills/docx/scripts/templates/people.xml +0 -3
- package/.agent/skills/document-skills/docx/scripts/utilities.py +0 -374
- package/.agent/skills/document-skills/pdf/LICENSE.txt +0 -30
- package/.agent/skills/document-skills/pdf/SKILL.md +0 -294
- package/.agent/skills/document-skills/pdf/forms.md +0 -205
- package/.agent/skills/document-skills/pdf/reference.md +0 -612
- package/.agent/skills/document-skills/pdf/scripts/check_bounding_boxes.py +0 -70
- package/.agent/skills/document-skills/pdf/scripts/check_bounding_boxes_test.py +0 -226
- package/.agent/skills/document-skills/pdf/scripts/check_fillable_fields.py +0 -12
- package/.agent/skills/document-skills/pdf/scripts/convert_pdf_to_images.py +0 -35
- package/.agent/skills/document-skills/pdf/scripts/create_validation_image.py +0 -41
- package/.agent/skills/document-skills/pdf/scripts/extract_form_field_info.py +0 -152
- package/.agent/skills/document-skills/pdf/scripts/fill_fillable_fields.py +0 -114
- package/.agent/skills/document-skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -108
- package/.agent/skills/document-skills/pptx/LICENSE.txt +0 -30
- package/.agent/skills/document-skills/pptx/SKILL.md +0 -484
- package/.agent/skills/document-skills/pptx/html2pptx.md +0 -625
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/.agent/skills/document-skills/pptx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/.agent/skills/document-skills/pptx/ooxml/schemas/mce/mc.xsd +0 -75
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2010.xsd +0 -560
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2012.xsd +0 -67
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-2018.xsd +0 -14
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/.agent/skills/document-skills/pptx/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/.agent/skills/document-skills/pptx/ooxml/scripts/pack.py +0 -159
- package/.agent/skills/document-skills/pptx/ooxml/scripts/unpack.py +0 -29
- package/.agent/skills/document-skills/pptx/ooxml/scripts/validate.py +0 -69
- package/.agent/skills/document-skills/pptx/ooxml/scripts/validation/__init__.py +0 -15
- package/.agent/skills/document-skills/pptx/ooxml/scripts/validation/base.py +0 -951
- package/.agent/skills/document-skills/pptx/ooxml/scripts/validation/docx.py +0 -274
- package/.agent/skills/document-skills/pptx/ooxml/scripts/validation/pptx.py +0 -315
- package/.agent/skills/document-skills/pptx/ooxml/scripts/validation/redlining.py +0 -279
- package/.agent/skills/document-skills/pptx/ooxml.md +0 -427
- package/.agent/skills/document-skills/pptx/scripts/html2pptx.js +0 -979
- package/.agent/skills/document-skills/pptx/scripts/inventory.py +0 -1020
- package/.agent/skills/document-skills/pptx/scripts/rearrange.py +0 -231
- package/.agent/skills/document-skills/pptx/scripts/replace.py +0 -385
- package/.agent/skills/document-skills/pptx/scripts/thumbnail.py +0 -450
- package/.agent/skills/document-skills/xlsx/LICENSE.txt +0 -30
- package/.agent/skills/document-skills/xlsx/SKILL.md +0 -289
- package/.agent/skills/document-skills/xlsx/recalc.py +0 -178
- package/.agent/skills/documentation-templates/SKILL.md +0 -194
- package/.agent/skills/frontend/SKILL.md +0 -38
- package/.agent/skills/frontend/rules/_sections.md +0 -46
- package/.agent/skills/frontend/rules/_template.md +0 -28
- package/.agent/skills/frontend/rules/advanced-event-handler-refs.md +0 -55
- package/.agent/skills/frontend/rules/advanced-init-once.md +0 -42
- package/.agent/skills/frontend/rules/advanced-use-latest.md +0 -39
- package/.agent/skills/frontend/rules/async-api-routes.md +0 -38
- package/.agent/skills/frontend/rules/async-defer-await.md +0 -80
- package/.agent/skills/frontend/rules/async-dependencies.md +0 -51
- package/.agent/skills/frontend/rules/async-parallel.md +0 -28
- package/.agent/skills/frontend/rules/async-suspense-boundaries.md +0 -99
- package/.agent/skills/frontend/rules/bundle-barrel-imports.md +0 -59
- package/.agent/skills/frontend/rules/bundle-conditional.md +0 -31
- package/.agent/skills/frontend/rules/bundle-defer-third-party.md +0 -49
- package/.agent/skills/frontend/rules/bundle-dynamic-imports.md +0 -35
- package/.agent/skills/frontend/rules/bundle-preload.md +0 -50
- package/.agent/skills/frontend/rules/client-event-listeners.md +0 -74
- package/.agent/skills/frontend/rules/client-localstorage-schema.md +0 -71
- package/.agent/skills/frontend/rules/client-passive-event-listeners.md +0 -48
- package/.agent/skills/frontend/rules/client-swr-dedup.md +0 -56
- package/.agent/skills/frontend/rules/js-batch-dom-css.md +0 -107
- package/.agent/skills/frontend/rules/js-cache-function-results.md +0 -80
- package/.agent/skills/frontend/rules/js-cache-property-access.md +0 -28
- package/.agent/skills/frontend/rules/js-cache-storage.md +0 -70
- package/.agent/skills/frontend/rules/js-combine-iterations.md +0 -32
- package/.agent/skills/frontend/rules/js-early-exit.md +0 -50
- package/.agent/skills/frontend/rules/js-hoist-regexp.md +0 -45
- package/.agent/skills/frontend/rules/js-index-maps.md +0 -37
- package/.agent/skills/frontend/rules/js-length-check-first.md +0 -49
- package/.agent/skills/frontend/rules/js-min-max-loop.md +0 -82
- package/.agent/skills/frontend/rules/js-set-map-lookups.md +0 -24
- package/.agent/skills/frontend/rules/js-tosorted-immutable.md +0 -57
- package/.agent/skills/frontend/rules/rendering-activity.md +0 -26
- package/.agent/skills/frontend/rules/rendering-animate-svg-wrapper.md +0 -47
- package/.agent/skills/frontend/rules/rendering-conditional-render.md +0 -40
- package/.agent/skills/frontend/rules/rendering-content-visibility.md +0 -38
- package/.agent/skills/frontend/rules/rendering-hoist-jsx.md +0 -46
- package/.agent/skills/frontend/rules/rendering-hydration-no-flicker.md +0 -82
- package/.agent/skills/frontend/rules/rendering-hydration-suppress-warning.md +0 -30
- package/.agent/skills/frontend/rules/rendering-svg-precision.md +0 -28
- package/.agent/skills/frontend/rules/rendering-usetransition-loading.md +0 -75
- package/.agent/skills/frontend/rules/rerender-defer-reads.md +0 -39
- package/.agent/skills/frontend/rules/rerender-dependencies.md +0 -45
- package/.agent/skills/frontend/rules/rerender-derived-state-no-effect.md +0 -40
- package/.agent/skills/frontend/rules/rerender-derived-state.md +0 -29
- package/.agent/skills/frontend/rules/rerender-functional-setstate.md +0 -74
- package/.agent/skills/frontend/rules/rerender-lazy-state-init.md +0 -58
- package/.agent/skills/frontend/rules/rerender-memo-with-default-value.md +0 -38
- package/.agent/skills/frontend/rules/rerender-memo.md +0 -44
- package/.agent/skills/frontend/rules/rerender-move-effect-to-event.md +0 -45
- package/.agent/skills/frontend/rules/rerender-simple-expression-in-memo.md +0 -35
- package/.agent/skills/frontend/rules/rerender-transitions.md +0 -40
- package/.agent/skills/frontend/rules/rerender-use-ref-transient-values.md +0 -73
- package/.agent/skills/frontend/rules/schema.json +0 -34
- package/.agent/skills/frontend/rules/server-after-nonblocking.md +0 -73
- package/.agent/skills/frontend/rules/server-auth-actions.md +0 -96
- package/.agent/skills/frontend/rules/server-cache-lru.md +0 -41
- package/.agent/skills/frontend/rules/server-cache-react.md +0 -76
- package/.agent/skills/frontend/rules/server-dedup-props.md +0 -65
- package/.agent/skills/frontend/rules/server-parallel-fetching.md +0 -83
- package/.agent/skills/frontend/rules/server-serialization.md +0 -38
- package/.agent/skills/frontend-design/SKILL.md +0 -33
- package/.agent/skills/frontend-design/rules/animation-guide.md +0 -331
- package/.agent/skills/frontend-design/rules/color-system.md +0 -311
- package/.agent/skills/frontend-design/rules/decision-trees.md +0 -418
- package/.agent/skills/frontend-design/rules/motion-graphics.md +0 -306
- package/.agent/skills/frontend-design/rules/typography-system.md +0 -345
- package/.agent/skills/frontend-design/rules/ux-psychology.md +0 -541
- package/.agent/skills/frontend-design/rules/visual-effects.md +0 -383
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +0 -183
- package/.agent/skills/frontend-design/scripts/ux_audit.py +0 -722
- package/.agent/skills/geo-fundamentals/SKILL.md +0 -156
- package/.agent/skills/geo-fundamentals/scripts/geo_checker.py +0 -289
- package/.agent/skills/git-conventions/.skill-source.json +0 -8
- package/.agent/skills/git-conventions/SKILL.md +0 -28
- package/.agent/skills/git-conventions/enforcement/commit-validation-rules.md +0 -55
- package/.agent/skills/git-conventions/examples/bad-commits.md +0 -201
- package/.agent/skills/git-conventions/examples/good-commits.md +0 -135
- package/.agent/skills/git-conventions/metadata/commit-config.yaml +0 -79
- package/.agent/skills/git-conventions/metadata/intent-triggers.yaml +0 -25
- package/.agent/skills/git-conventions/metadata/scope-mapping.yaml +0 -83
- package/.agent/skills/git-conventions/resources/BEST_PRACTICES.md +0 -121
- package/.agent/skills/git-conventions/resources/references.md +0 -53
- package/.agent/skills/git-conventions/scripts/format-commit.js +0 -393
- package/.agent/skills/git-conventions/scripts/validate-commit-msg.sh +0 -27
- package/.agent/skills/governance/.skill-source.json +0 -8
- package/.agent/skills/governance/CHANGELOG.md +0 -222
- package/.agent/skills/governance/README.md +0 -250
- package/.agent/skills/governance/SKILL.md +0 -199
- package/.agent/skills/governance/VERSION +0 -4
- package/.agent/skills/governance/examples/violation-backend-mutation/after.tsx +0 -59
- package/.agent/skills/governance/examples/violation-backend-mutation/before.tsx +0 -42
- package/.agent/skills/governance/examples/violation-backend-mutation/explanation.md +0 -87
- package/.agent/skills/governance/examples/violation-chart-injection/after.tsx +0 -99
- package/.agent/skills/governance/examples/violation-chart-injection/before.tsx +0 -57
- package/.agent/skills/governance/examples/violation-chart-injection/explanation.md +0 -116
- package/.agent/skills/governance/knowledge/lessons-learned.yaml +0 -3
- package/.agent/skills/governance/metadata/precedence.yaml +0 -117
- package/.agent/skills/governance/metadata/scope-map.yaml +0 -156
- package/.agent/skills/governance/proposals/v1.1-change-proposal-template.md +0 -197
- package/.agent/skills/governance/resources/AUTHORITY_MODEL.md +0 -111
- package/.agent/skills/governance/resources/ENFORCEMENT_GUIDE.md +0 -242
- package/.agent/skills/governance/resources/LOAD_ORDER.md +0 -82
- package/.agent/skills/governance/rules/constitution/coinpika-master-constitution.md +0 -206
- package/.agent/skills/governance/rules/doctrines/architecture/coinpika-architecture-doctrine.md +0 -184
- package/.agent/skills/governance/rules/doctrines/backend/coinpika-backend-data-engine-doctrine.md +0 -214
- package/.agent/skills/governance/rules/doctrines/commercial/coinpika-commercial-guardrails-doctrine.md +0 -192
- package/.agent/skills/governance/rules/doctrines/data/coinpika-chart-data-doctrine.md +0 -198
- package/.agent/skills/governance/rules/doctrines/frontend/coinpika-frontend-mobile-doctrine.md +0 -165
- package/.agent/skills/governance/rules/doctrines/frontend/coinpika-swipe-tabs-doctrine.md +0 -172
- package/.agent/skills/governance/rules/doctrines/learning/coinpika-learning-engine-doctrine.md +0 -188
- package/.agent/skills/governance/rules/doctrines/performance/coinpika-performance-doctrine.md +0 -176
- package/.agent/skills/governance/rules/doctrines/review/coinpika-code-review-doctrine.md +0 -170
- package/.agent/skills/governance/rules/enforcement/agents/coinpika-agent-enforcement-protocol.md +0 -214
- package/.agent/skills/governance/rules/enforcement/agents/coinpika-agent-system-prompt.md +0 -192
- package/.agent/skills/governance/rules/enforcement/checklists/backend-api-review-checklist.md +0 -127
- package/.agent/skills/governance/rules/enforcement/checklists/chart-component-review-checklist.md +0 -143
- package/.agent/skills/governance/rules/enforcement/checklists/coinpika-frontend-gesture-review-checklist.md +0 -190
- package/.agent/skills/governance/rules/enforcement/playbooks/doctrine-violation-playbook.md +0 -232
- package/.agent/skills/governance/scripts/audit_pr.js +0 -218
- package/.agent/skills/governance/scripts/learn.js +0 -161
- package/.agent/skills/governance/scripts/validate_doctrine.js +0 -286
- package/.agent/skills/i18n-localization/SKILL.md +0 -154
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +0 -241
- package/.agent/skills/intelligent-routing/SKILL.md +0 -335
- package/.agent/skills/lint-and-validate/SKILL.md +0 -45
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +0 -172
- package/.agent/skills/lint-and-validate/scripts/type_coverage.py +0 -173
- package/.agent/skills/mcp-builder/SKILL.md +0 -176
- package/.agent/skills/mermaidjs-v11/SKILL.md +0 -115
- package/.agent/skills/mermaidjs-v11/references/cli-usage.md +0 -228
- package/.agent/skills/mermaidjs-v11/references/configuration.md +0 -232
- package/.agent/skills/mermaidjs-v11/references/diagram-types.md +0 -315
- package/.agent/skills/mermaidjs-v11/references/examples.md +0 -344
- package/.agent/skills/mermaidjs-v11/references/integration.md +0 -310
- package/.agent/skills/mobile-design/references/anti-patterns.md +0 -46
- package/.agent/skills/nextjs-best-practices/SKILL.md +0 -203
- package/.agent/skills/nodejs-best-practices/SKILL.md +0 -76
- package/.agent/skills/nodejs-best-practices/references/architecture-patterns.md +0 -34
- package/.agent/skills/nodejs-best-practices/references/async-patterns.md +0 -32
- package/.agent/skills/nodejs-best-practices/references/error-handling.md +0 -39
- package/.agent/skills/nodejs-best-practices/references/framework-selection.md +0 -39
- package/.agent/skills/nodejs-best-practices/references/runtime-modules.md +0 -33
- package/.agent/skills/nodejs-best-practices/references/testing-strategy.md +0 -25
- package/.agent/skills/nodejs-best-practices/references/validation-security.md +0 -45
- package/.agent/skills/parallel-agents/SKILL.md +0 -175
- package/.agent/skills/performance-profiling/SKILL.md +0 -143
- package/.agent/skills/performance-profiling/scripts/lighthouse_audit.py +0 -76
- package/.agent/skills/plan-writing/SKILL.md +0 -152
- package/.agent/skills/powershell-windows/SKILL.md +0 -167
- package/.agent/skills/problem-solving/ABOUT.md +0 -40
- package/.agent/skills/problem-solving/SKILL.md +0 -69
- package/.agent/skills/problem-solving/collision-zone-thinking/SKILL.md +0 -62
- package/.agent/skills/problem-solving/inversion-exercise/SKILL.md +0 -58
- package/.agent/skills/problem-solving/meta-pattern-recognition/SKILL.md +0 -54
- package/.agent/skills/problem-solving/scale-game/SKILL.md +0 -63
- package/.agent/skills/problem-solving/simplification-cascades/SKILL.md +0 -76
- package/.agent/skills/problem-solving/when-stuck/SKILL.md +0 -88
- package/.agent/skills/python-patterns/SKILL.md +0 -80
- package/.agent/skills/python-patterns/references/async-patterns.md +0 -57
- package/.agent/skills/python-patterns/references/django-patterns.md +0 -41
- package/.agent/skills/python-patterns/references/fastapi-patterns.md +0 -54
- package/.agent/skills/python-patterns/references/framework-selection.md +0 -39
- package/.agent/skills/python-patterns/references/project-structure.md +0 -80
- package/.agent/skills/python-patterns/references/testing-patterns.md +0 -34
- package/.agent/skills/python-patterns/references/type-hints.md +0 -51
- package/.agent/skills/react-patterns/SKILL.md +0 -198
- package/.agent/skills/red-team-tactics/SKILL.md +0 -199
- package/.agent/skills/seo-fundamentals/SKILL.md +0 -129
- package/.agent/skills/seo-fundamentals/scripts/seo_checker.py +0 -219
- package/.agent/skills/sequential-thinking/README.md +0 -118
- package/.agent/skills/sequential-thinking/SKILL.md +0 -93
- package/.agent/skills/sequential-thinking/references/advanced.md +0 -122
- package/.agent/skills/sequential-thinking/references/examples.md +0 -274
- package/.agent/skills/server-management/SKILL.md +0 -161
- package/.agent/skills/skill-creator/LICENSE.txt +0 -202
- package/.agent/skills/skill-creator/SKILL.md +0 -237
- package/.agent/skills/skill-creator/scripts/init_skill.py +0 -303
- package/.agent/skills/skill-creator/scripts/package_skill.py +0 -110
- package/.agent/skills/skill-creator/scripts/quick_validate.py +0 -65
- package/.agent/skills/systematic-debugging/SKILL.md +0 -109
- package/.agent/skills/tailwind-patterns/SKILL.md +0 -269
- package/.agent/skills/tdd-workflow/SKILL.md +0 -149
- package/.agent/skills/testing-patterns/SKILL.md +0 -178
- package/.agent/skills/testing-patterns/scripts/test_runner.py +0 -219
- package/.agent/skills/vulnerability-scanner/SKILL.md +0 -276
- package/.agent/skills/vulnerability-scanner/checklists.md +0 -121
- package/.agent/skills/vulnerability-scanner/scripts/security_scan.py +0 -458
- package/.agent/skills/webapp-testing/SKILL.md +0 -187
- package/.agent/skills/webapp-testing/scripts/playwright_runner.py +0 -173
- package/.editorconfig +0 -21
- package/.github/workflows/release.yml +0 -39
- package/docs/PLAN-consolidation-final.md +0 -14
- package/docs/PLAN-integration.md +0 -28
- package/docs/PLAN-rebrand-agent-skills-kit.md +0 -104
- package/docs/PLAN-refactor.md +0 -48
- package/docs/PYTHON_SCRIPTS.md +0 -55
- package/docs/awf-user-guide.md +0 -436
- package/packages/cli/bin/ag-smart.v1.js +0 -78
- package/packages/cli/lib/audit.v2.js +0 -151
- package/packages/cli/lib/auto_preview.py +0 -148
- package/packages/cli/lib/checklist.py +0 -222
- package/packages/cli/lib/learn.v2.js +0 -255
- package/packages/cli/lib/recall.v2.js +0 -252
- package/packages/cli/lib/session_manager.py +0 -120
- package/packages/cli/lib/verify_all.py +0 -327
- /package/.agent/skills/{debugging → debug-pro}/defense-in-depth/SKILL.md +0 -0
- /package/.agent/skills/{debugging → debug-pro}/root-cause-tracing/SKILL.md +0 -0
- /package/.agent/skills/{debugging → debug-pro}/root-cause-tracing/find-polluter.sh +0 -0
- /package/.agent/skills/{debugging → debug-pro}/verification-before-completion/SKILL.md +0 -0
- /package/.agent/skills/mobile-design/{references/decision-trees.md → decision-trees.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-backend.md → mobile-backend.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-color-system.md → mobile-color-system.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-debugging.md → mobile-debugging.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-design-thinking.md → mobile-design-thinking.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-navigation.md → mobile-navigation.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-performance.md → mobile-performance.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-testing.md → mobile-testing.md} +0 -0
- /package/.agent/skills/mobile-design/{references/mobile-typography.md → mobile-typography.md} +0 -0
- /package/.agent/skills/mobile-design/{references/platform-android.md → platform-android.md} +0 -0
- /package/.agent/skills/mobile-design/{references/platform-ios.md → platform-ios.md} +0 -0
- /package/.agent/skills/mobile-design/{references/touch-psychology.md → touch-psychology.md} +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/charts.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/colors.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/icons.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/landing.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/products.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/prompts.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/react-performance.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/flutter.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/html-tailwind.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/jetpack-compose.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/nextjs.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/nuxt-ui.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/nuxtjs.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/react-native.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/react.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/shadcn.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/svelte.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/swiftui.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/stacks/vue.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/typography.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/ui-reasoning.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/ux-guidelines.csv +0 -0
- /package/.agent/{.shared/ui-ux-pro-max → skills/studio}/data/web-interface.csv +0 -0
- /package/docs/{PATTERNS_REFERENCE.md → archive/patterns-anthropic.md} +0 -0
- /package/docs/{context-engineering-guide.md → guides/context-engineering.md} +0 -0
- /package/{VERSIONING.md → docs/guides/versioning.md} +0 -0
|
@@ -0,0 +1,952 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design System Generator - Studio Scripts
|
|
3
|
+
* ==========================================
|
|
4
|
+
* JavaScript port of design_system.py
|
|
5
|
+
* Aggregates search results and applies reasoning to generate design systems
|
|
6
|
+
*
|
|
7
|
+
* Due to file size (~1300 LOC), this file is organized into clear sections:
|
|
8
|
+
* 1. Configuration & Setup
|
|
9
|
+
* 2. DesignSystemGenerator Class
|
|
10
|
+
* 3. Output Formatters (ASCII & Markdown)
|
|
11
|
+
* 4. Main Entry Point
|
|
12
|
+
* 5. Persistence Functions
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { readFile, writeFile, mkdir } from 'fs/promises';
|
|
16
|
+
import { existsSync } from 'fs';
|
|
17
|
+
import { fileURLToPath } from 'url';
|
|
18
|
+
import { dirname, join } from 'path';
|
|
19
|
+
import { search, DATA_DIR } from './core.js';
|
|
20
|
+
|
|
21
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
+
const __dirname = dirname(__filename);
|
|
23
|
+
|
|
24
|
+
// ============ CONFIGURATION ============
|
|
25
|
+
const REASONING_FILE = 'ui-reasoning.csv';
|
|
26
|
+
|
|
27
|
+
const SEARCH_CONFIG = {
|
|
28
|
+
product: { max_results: 1 },
|
|
29
|
+
style: { max_results: 3 },
|
|
30
|
+
color: { max_results: 2 },
|
|
31
|
+
landing: { max_results: 2 },
|
|
32
|
+
typography: { max_results: 2 }
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// ============ DESIGN SYSTEM GENERATOR ============
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Generates design system recommendations from aggregated searches
|
|
39
|
+
*/
|
|
40
|
+
export class DesignSystemGenerator {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.reasoningData = null;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Load reasoning rules from CSV
|
|
47
|
+
*/
|
|
48
|
+
async _loadReasoning() {
|
|
49
|
+
if (this.reasoningData) return this.reasoningData;
|
|
50
|
+
|
|
51
|
+
const filepath = join(DATA_DIR, REASONING_FILE);
|
|
52
|
+
if (!existsSync(filepath)) {
|
|
53
|
+
this.reasoningData = [];
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
try {
|
|
58
|
+
const content = await readFile(filepath, 'utf-8');
|
|
59
|
+
const lines = content.split('\n');
|
|
60
|
+
const headers = lines[0].split(',').map(h => h.trim());
|
|
61
|
+
|
|
62
|
+
this.reasoningData = lines.slice(1)
|
|
63
|
+
.filter(line => line.trim())
|
|
64
|
+
.map(line => {
|
|
65
|
+
const values = line.split(',');
|
|
66
|
+
const row = {};
|
|
67
|
+
headers.forEach((header, i) => {
|
|
68
|
+
row[header] = values[i] || '';
|
|
69
|
+
});
|
|
70
|
+
return row;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return this.reasoningData;
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.error('Error loading reasoning data:', error.message);
|
|
76
|
+
this.reasoningData = [];
|
|
77
|
+
return [];
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Execute searches across multiple domains
|
|
83
|
+
*/
|
|
84
|
+
async _multiDomainSearch(query, stylePriority = null) {
|
|
85
|
+
const results = {};
|
|
86
|
+
|
|
87
|
+
for (const [domain, config] of Object.entries(SEARCH_CONFIG)) {
|
|
88
|
+
if (domain === 'style' && stylePriority && stylePriority.length > 0) {
|
|
89
|
+
// For style, also search with priority keywords
|
|
90
|
+
const priorityQuery = stylePriority.slice(0, 2).join(' ');
|
|
91
|
+
const combinedQuery = `${query} ${priorityQuery}`;
|
|
92
|
+
results[domain] = await search(combinedQuery, domain, config.max_results);
|
|
93
|
+
} else {
|
|
94
|
+
results[domain] = await search(query, domain, config.max_results);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return results;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Find matching reasoning rule for a category
|
|
103
|
+
*/
|
|
104
|
+
async _findReasoningRule(category) {
|
|
105
|
+
const reasoningData = await this._loadReasoning();
|
|
106
|
+
const categoryLower = category.toLowerCase();
|
|
107
|
+
|
|
108
|
+
// Try exact match first
|
|
109
|
+
for (const rule of reasoningData) {
|
|
110
|
+
if (rule['UI_Category']?.toLowerCase() === categoryLower) {
|
|
111
|
+
return rule;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Try partial match
|
|
116
|
+
for (const rule of reasoningData) {
|
|
117
|
+
const uiCat = rule['UI_Category']?.toLowerCase() || '';
|
|
118
|
+
if (uiCat.includes(categoryLower) || categoryLower.includes(uiCat)) {
|
|
119
|
+
return rule;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Try keyword match
|
|
124
|
+
for (const rule of reasoningData) {
|
|
125
|
+
const uiCat = rule['UI_Category']?.toLowerCase() || '';
|
|
126
|
+
const keywords = uiCat.replace(/\//g, ' ').replace(/-/g, ' ').split(/\s+/);
|
|
127
|
+
if (keywords.some(kw => categoryLower.includes(kw))) {
|
|
128
|
+
return rule;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return {};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Apply reasoning rules to search results
|
|
137
|
+
*/
|
|
138
|
+
async _applyReasoning(category, searchResults) {
|
|
139
|
+
const rule = await this._findReasoningRule(category);
|
|
140
|
+
|
|
141
|
+
if (!rule || Object.keys(rule).length === 0) {
|
|
142
|
+
return {
|
|
143
|
+
pattern: 'Hero + Features + CTA',
|
|
144
|
+
style_priority: ['Minimalism', 'Flat Design'],
|
|
145
|
+
color_mood: 'Professional',
|
|
146
|
+
typography_mood: 'Clean',
|
|
147
|
+
key_effects: 'Subtle hover transitions',
|
|
148
|
+
anti_patterns: '',
|
|
149
|
+
decision_rules: {},
|
|
150
|
+
severity: 'MEDIUM'
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// Parse decision rules JSON
|
|
155
|
+
let decisionRules = {};
|
|
156
|
+
try {
|
|
157
|
+
const rulesStr = rule['Decision_Rules'] || '{}';
|
|
158
|
+
decisionRules = JSON.parse(rulesStr);
|
|
159
|
+
} catch (error) {
|
|
160
|
+
// Keep empty object if parsing fails
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const stylePriority = (rule['Style_Priority'] || '')
|
|
164
|
+
.split('+')
|
|
165
|
+
.map(s => s.trim())
|
|
166
|
+
.filter(s => s);
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
pattern: rule['Recommended_Pattern'] || '',
|
|
170
|
+
style_priority: stylePriority,
|
|
171
|
+
color_mood: rule['Color_Mood'] || '',
|
|
172
|
+
typography_mood: rule['Typography_Mood'] || '',
|
|
173
|
+
key_effects: rule['Key_Effects'] || '',
|
|
174
|
+
anti_patterns: rule['Anti_Patterns'] || '',
|
|
175
|
+
decision_rules: decisionRules,
|
|
176
|
+
severity: rule['Severity'] || 'MEDIUM'
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Select best matching result based on priority keywords
|
|
182
|
+
*/
|
|
183
|
+
_selectBestMatch(results, priorityKeywords) {
|
|
184
|
+
if (!results || results.length === 0) {
|
|
185
|
+
return {};
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (!priorityKeywords || priorityKeywords.length === 0) {
|
|
189
|
+
return results[0];
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// First: try exact style name match
|
|
193
|
+
for (const priority of priorityKeywords) {
|
|
194
|
+
const priorityLower = priority.toLowerCase().trim();
|
|
195
|
+
for (const result of results) {
|
|
196
|
+
const styleName = (result['Style Category'] || '').toLowerCase();
|
|
197
|
+
if (priorityLower.includes(styleName) || styleName.includes(priorityLower)) {
|
|
198
|
+
return result;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Second: score by keyword match in all fields
|
|
204
|
+
const scored = [];
|
|
205
|
+
for (const result of results) {
|
|
206
|
+
const resultStr = JSON.stringify(result).toLowerCase();
|
|
207
|
+
let score = 0;
|
|
208
|
+
|
|
209
|
+
for (const kw of priorityKeywords) {
|
|
210
|
+
const kwLower = kw.toLowerCase().trim();
|
|
211
|
+
// Higher score for style name match
|
|
212
|
+
if ((result['Style Category'] || '').toLowerCase().includes(kwLower)) {
|
|
213
|
+
score += 10;
|
|
214
|
+
}
|
|
215
|
+
// Lower score for keyword field match
|
|
216
|
+
else if ((result['Keywords'] || '').toLowerCase().includes(kwLower)) {
|
|
217
|
+
score += 3;
|
|
218
|
+
}
|
|
219
|
+
// Even lower for other field matches
|
|
220
|
+
else if (resultStr.includes(kwLower)) {
|
|
221
|
+
score += 1;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
scored.push([score, result]);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
scored.sort((a, b) => b[0] - a[0]);
|
|
229
|
+
return scored.length > 0 && scored[0][0] > 0 ? scored[0][1] : results[0];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Extract results list from search result dict
|
|
234
|
+
*/
|
|
235
|
+
_extractResults(searchResult) {
|
|
236
|
+
return searchResult?.results || [];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Generate complete design system recommendation
|
|
241
|
+
*/
|
|
242
|
+
async generate(query, projectName = null) {
|
|
243
|
+
// Step 1: First search product to get category
|
|
244
|
+
const productResult = await search(query, 'product', 1);
|
|
245
|
+
const productResults = productResult.results || [];
|
|
246
|
+
let category = 'General';
|
|
247
|
+
if (productResults.length > 0) {
|
|
248
|
+
category = productResults[0]['Product Type'] || 'General';
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Step 2: Get reasoning rules for this category
|
|
252
|
+
const reasoning = await this._applyReasoning(category, {});
|
|
253
|
+
const stylePriority = reasoning.style_priority || [];
|
|
254
|
+
|
|
255
|
+
// Step 3: Multi-domain search with style priority hints
|
|
256
|
+
const searchResults = await this._multiDomainSearch(query, stylePriority);
|
|
257
|
+
searchResults.product = productResult; // Reuse product search
|
|
258
|
+
|
|
259
|
+
// Step 4: Select best matches from each domain using priority
|
|
260
|
+
const styleResults = this._extractResults(searchResults.style || {});
|
|
261
|
+
const colorResults = this._extractResults(searchResults.color || {});
|
|
262
|
+
const typographyResults = this._extractResults(searchResults.typography || {});
|
|
263
|
+
const landingResults = this._extractResults(searchResults.landing || {});
|
|
264
|
+
|
|
265
|
+
const bestStyle = this._selectBestMatch(styleResults, reasoning.style_priority || []);
|
|
266
|
+
const bestColor = colorResults[0] || {};
|
|
267
|
+
const bestTypography = typographyResults[0] || {};
|
|
268
|
+
const bestLanding = landingResults[0] || {};
|
|
269
|
+
|
|
270
|
+
// Step 5: Build final recommendation
|
|
271
|
+
const styleEffects = bestStyle['Effects & Animation'] || '';
|
|
272
|
+
const reasoningEffects = reasoning.key_effects || '';
|
|
273
|
+
const combinedEffects = styleEffects || reasoningEffects;
|
|
274
|
+
|
|
275
|
+
return {
|
|
276
|
+
project_name: projectName || query.toUpperCase(),
|
|
277
|
+
category,
|
|
278
|
+
pattern: {
|
|
279
|
+
name: bestLanding['Pattern Name'] || reasoning.pattern || 'Hero + Features + CTA',
|
|
280
|
+
sections: bestLanding['Section Order'] || 'Hero > Features > CTA',
|
|
281
|
+
cta_placement: bestLanding['Primary CTA Placement'] || 'Above fold',
|
|
282
|
+
color_strategy: bestLanding['Color Strategy'] || '',
|
|
283
|
+
conversion: bestLanding['Conversion Optimization'] || ''
|
|
284
|
+
},
|
|
285
|
+
style: {
|
|
286
|
+
name: bestStyle['Style Category'] || 'Minimalism',
|
|
287
|
+
type: bestStyle['Type'] || 'General',
|
|
288
|
+
effects: styleEffects,
|
|
289
|
+
keywords: bestStyle['Keywords'] || '',
|
|
290
|
+
best_for: bestStyle['Best For'] || '',
|
|
291
|
+
performance: bestStyle['Performance'] || '',
|
|
292
|
+
accessibility: bestStyle['Accessibility'] || ''
|
|
293
|
+
},
|
|
294
|
+
colors: {
|
|
295
|
+
primary: bestColor['Primary (Hex)'] || '#2563EB',
|
|
296
|
+
secondary: bestColor['Secondary (Hex)'] || '#3B82F6',
|
|
297
|
+
cta: bestColor['CTA (Hex)'] || '#F97316',
|
|
298
|
+
background: bestColor['Background (Hex)'] || '#F8FAFC',
|
|
299
|
+
text: bestColor['Text (Hex)'] || '#1E293B',
|
|
300
|
+
notes: bestColor['Notes'] || ''
|
|
301
|
+
},
|
|
302
|
+
typography: {
|
|
303
|
+
heading: bestTypography['Heading Font'] || 'Inter',
|
|
304
|
+
body: bestTypography['Body Font'] || 'Inter',
|
|
305
|
+
mood: bestTypography['Mood/Style Keywords'] || reasoning.typography_mood || '',
|
|
306
|
+
best_for: bestTypography['Best For'] || '',
|
|
307
|
+
google_fonts_url: bestTypography['Google Fonts URL'] || '',
|
|
308
|
+
css_import: bestTypography['CSS Import'] || ''
|
|
309
|
+
},
|
|
310
|
+
key_effects: combinedEffects,
|
|
311
|
+
anti_patterns: reasoning.anti_patterns || '',
|
|
312
|
+
decision_rules: reasoning.decision_rules || {},
|
|
313
|
+
severity: reasoning.severity || 'MEDIUM'
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
// ============ OUTPUT FORMATTERS ============
|
|
319
|
+
const BOX_WIDTH = 90;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Wrap long text into multiple lines
|
|
323
|
+
*/
|
|
324
|
+
function wrapText(text, prefix, width) {
|
|
325
|
+
if (!text) return [];
|
|
326
|
+
|
|
327
|
+
const words = text.split(/\s+/);
|
|
328
|
+
const lines = [];
|
|
329
|
+
let currentLine = prefix;
|
|
330
|
+
|
|
331
|
+
for (const word of words) {
|
|
332
|
+
if (currentLine.length + word.length + 1 <= width - 2) {
|
|
333
|
+
currentLine += (currentLine !== prefix ? ' ' : '') + word;
|
|
334
|
+
} else {
|
|
335
|
+
if (currentLine !== prefix) {
|
|
336
|
+
lines.push(currentLine);
|
|
337
|
+
}
|
|
338
|
+
currentLine = prefix + word;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (currentLine !== prefix) {
|
|
343
|
+
lines.push(currentLine);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
return lines;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Format design system as ASCII box with emojis (MCP-style)
|
|
351
|
+
*/
|
|
352
|
+
export function formatAsciiBox(designSystem) {
|
|
353
|
+
const project = designSystem.project_name || 'PROJECT';
|
|
354
|
+
const pattern = designSystem.pattern || {};
|
|
355
|
+
const style = designSystem.style || {};
|
|
356
|
+
const colors = designSystem.colors || {};
|
|
357
|
+
const typography = designSystem.typography || {};
|
|
358
|
+
const effects = designSystem.key_effects || '';
|
|
359
|
+
const antiPatterns = designSystem.anti_patterns || '';
|
|
360
|
+
|
|
361
|
+
// Build sections from pattern
|
|
362
|
+
const sections = (pattern.sections || '')
|
|
363
|
+
.split('>')
|
|
364
|
+
.map(s => s.trim())
|
|
365
|
+
.filter(s => s);
|
|
366
|
+
|
|
367
|
+
// Build output lines
|
|
368
|
+
const lines = [];
|
|
369
|
+
const w = BOX_WIDTH - 1;
|
|
370
|
+
|
|
371
|
+
lines.push('+' + '-'.repeat(w) + '+');
|
|
372
|
+
lines.push(`| 🎯 TARGET: ${project} - RECOMMENDED DESIGN SYSTEM`.padEnd(BOX_WIDTH) + '|');
|
|
373
|
+
lines.push('+' + '-'.repeat(w) + '+');
|
|
374
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
375
|
+
|
|
376
|
+
// Pattern section
|
|
377
|
+
lines.push(`| 📐 PATTERN: ${pattern.name || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
378
|
+
if (pattern.conversion) {
|
|
379
|
+
lines.push(`| 🎯 Conversion: ${pattern.conversion}`.padEnd(BOX_WIDTH) + '|');
|
|
380
|
+
}
|
|
381
|
+
if (pattern.cta_placement) {
|
|
382
|
+
lines.push(`| 📍 CTA: ${pattern.cta_placement}`.padEnd(BOX_WIDTH) + '|');
|
|
383
|
+
}
|
|
384
|
+
lines.push('| 📋 Sections:'.padEnd(BOX_WIDTH) + '|');
|
|
385
|
+
sections.forEach((section, i) => {
|
|
386
|
+
lines.push(`| ${i + 1}. ${section}`.padEnd(BOX_WIDTH) + '|');
|
|
387
|
+
});
|
|
388
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
389
|
+
|
|
390
|
+
// Style section
|
|
391
|
+
lines.push(`| 🎨 STYLE: ${style.name || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
392
|
+
if (style.keywords) {
|
|
393
|
+
wrapText(`🏷️ Keywords: ${style.keywords}`, '| ', BOX_WIDTH).forEach(line => {
|
|
394
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
if (style.best_for) {
|
|
398
|
+
wrapText(`✨ Best For: ${style.best_for}`, '| ', BOX_WIDTH).forEach(line => {
|
|
399
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
if (style.performance || style.accessibility) {
|
|
403
|
+
const perfA11y = `⚡ Performance: ${style.performance} | ♿ Accessibility: ${style.accessibility}`;
|
|
404
|
+
lines.push(`| ${perfA11y}`.padEnd(BOX_WIDTH) + '|');
|
|
405
|
+
}
|
|
406
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
407
|
+
|
|
408
|
+
// Colors section
|
|
409
|
+
lines.push('| 🎨 COLORS:'.padEnd(BOX_WIDTH) + '|');
|
|
410
|
+
lines.push(`| Primary: ${colors.primary || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
411
|
+
lines.push(`| Secondary: ${colors.secondary || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
412
|
+
lines.push(`| CTA: ${colors.cta || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
413
|
+
lines.push(`| Background: ${colors.background || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
414
|
+
lines.push(`| Text: ${colors.text || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
415
|
+
if (colors.notes) {
|
|
416
|
+
wrapText(`📝 Notes: ${colors.notes}`, '| ', BOX_WIDTH).forEach(line => {
|
|
417
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
418
|
+
});
|
|
419
|
+
}
|
|
420
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
421
|
+
|
|
422
|
+
// Typography section
|
|
423
|
+
lines.push(`| 🔤 TYPOGRAPHY: ${typography.heading || ''} / ${typography.body || ''}`.padEnd(BOX_WIDTH) + '|');
|
|
424
|
+
if (typography.mood) {
|
|
425
|
+
wrapText(`💭 Mood: ${typography.mood}`, '| ', BOX_WIDTH).forEach(line => {
|
|
426
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
if (typography.best_for) {
|
|
430
|
+
wrapText(`✨ Best For: ${typography.best_for}`, '| ', BOX_WIDTH).forEach(line => {
|
|
431
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
432
|
+
});
|
|
433
|
+
}
|
|
434
|
+
if (typography.google_fonts_url) {
|
|
435
|
+
lines.push(`| 🔗 Google Fonts: ${typography.google_fonts_url}`.padEnd(BOX_WIDTH) + '|');
|
|
436
|
+
}
|
|
437
|
+
if (typography.css_import) {
|
|
438
|
+
const cssImport = typography.css_import.slice(0, 70) + (typography.css_import.length > 70 ? '...' : '');
|
|
439
|
+
lines.push(`| 📎 CSS Import: ${cssImport}`.padEnd(BOX_WIDTH) + '|');
|
|
440
|
+
}
|
|
441
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
442
|
+
|
|
443
|
+
// Key Effects section
|
|
444
|
+
if (effects) {
|
|
445
|
+
lines.push('| ✨ KEY EFFECTS:'.padEnd(BOX_WIDTH) + '|');
|
|
446
|
+
wrapText(effects, '| ', BOX_WIDTH).forEach(line => {
|
|
447
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
448
|
+
});
|
|
449
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
// Anti-patterns section
|
|
453
|
+
if (antiPatterns) {
|
|
454
|
+
lines.push('| ⛔ AVOID (Anti-patterns):'.padEnd(BOX_WIDTH) + '|');
|
|
455
|
+
wrapText(antiPatterns, '| ', BOX_WIDTH).forEach(line => {
|
|
456
|
+
lines.push(line.padEnd(BOX_WIDTH) + '|');
|
|
457
|
+
});
|
|
458
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// Pre-Delivery Checklist section
|
|
462
|
+
lines.push('| ✅ PRE-DELIVERY CHECKLIST:'.padEnd(BOX_WIDTH) + '|');
|
|
463
|
+
const checklistItems = [
|
|
464
|
+
'[ ] No emojis as icons (use SVG: Heroicons/Lucide)',
|
|
465
|
+
'[ ] cursor-pointer on all clickable elements',
|
|
466
|
+
'[ ] Hover states with smooth transitions (150-300ms)',
|
|
467
|
+
'[ ] Light mode: text contrast 4.5:1 minimum',
|
|
468
|
+
'[ ] Focus states visible for keyboard nav',
|
|
469
|
+
'[ ] prefers-reduced-motion respected',
|
|
470
|
+
'[ ] Responsive: 375px, 768px, 1024px, 1440px'
|
|
471
|
+
];
|
|
472
|
+
checklistItems.forEach(item => {
|
|
473
|
+
lines.push(`| ${item}`.padEnd(BOX_WIDTH) + '|');
|
|
474
|
+
});
|
|
475
|
+
lines.push('|' + ' '.repeat(BOX_WIDTH) + '|');
|
|
476
|
+
|
|
477
|
+
lines.push('+' + '-'.repeat(w) + '+');
|
|
478
|
+
|
|
479
|
+
return lines.join('\n');
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Format design system as markdown
|
|
484
|
+
*/
|
|
485
|
+
export function formatMarkdown(designSystem) {
|
|
486
|
+
const project = designSystem.project_name || 'PROJECT';
|
|
487
|
+
const pattern = designSystem.pattern || {};
|
|
488
|
+
const style = designSystem.style || {};
|
|
489
|
+
const colors = designSystem.colors || {};
|
|
490
|
+
const typography = designSystem.typography || {};
|
|
491
|
+
const effects = designSystem.key_effects || '';
|
|
492
|
+
const antiPatterns = designSystem.anti_patterns || '';
|
|
493
|
+
|
|
494
|
+
const lines = [];
|
|
495
|
+
lines.push(`## Design System: ${project}`);
|
|
496
|
+
lines.push('');
|
|
497
|
+
|
|
498
|
+
// Pattern section
|
|
499
|
+
lines.push('### Pattern');
|
|
500
|
+
lines.push(`- **Name:** ${pattern.name || ''}`);
|
|
501
|
+
if (pattern.conversion) {
|
|
502
|
+
lines.push(`- **Conversion Focus:** ${pattern.conversion}`);
|
|
503
|
+
}
|
|
504
|
+
if (pattern.cta_placement) {
|
|
505
|
+
lines.push(`- **CTA Placement:** ${pattern.cta_placement}`);
|
|
506
|
+
}
|
|
507
|
+
if (pattern.color_strategy) {
|
|
508
|
+
lines.push(`- **Color Strategy:** ${pattern.color_strategy}`);
|
|
509
|
+
}
|
|
510
|
+
lines.push(`- **Sections:** ${pattern.sections || ''}`);
|
|
511
|
+
lines.push('');
|
|
512
|
+
|
|
513
|
+
// Style section
|
|
514
|
+
lines.push('### Style');
|
|
515
|
+
lines.push(`- **Name:** ${style.name || ''}`);
|
|
516
|
+
if (style.keywords) {
|
|
517
|
+
lines.push(`- **Keywords:** ${style.keywords}`);
|
|
518
|
+
}
|
|
519
|
+
if (style.best_for) {
|
|
520
|
+
lines.push(`- **Best For:** ${style.best_for}`);
|
|
521
|
+
}
|
|
522
|
+
if (style.performance || style.accessibility) {
|
|
523
|
+
lines.push(`- **Performance:** ${style.performance} | **Accessibility:** ${style.accessibility}`);
|
|
524
|
+
}
|
|
525
|
+
lines.push('');
|
|
526
|
+
|
|
527
|
+
// Colors section
|
|
528
|
+
lines.push('### Colors');
|
|
529
|
+
lines.push('| Role | Hex |');
|
|
530
|
+
lines.push('|------|-----|');
|
|
531
|
+
lines.push(`| Primary | ${colors.primary || ''} |`);
|
|
532
|
+
lines.push(`| Secondary | ${colors.secondary || ''} |`);
|
|
533
|
+
lines.push(`| CTA | ${colors.cta || ''} |`);
|
|
534
|
+
lines.push(`| Background | ${colors.background || ''} |`);
|
|
535
|
+
lines.push(`| Text | ${colors.text || ''} |`);
|
|
536
|
+
if (colors.notes) {
|
|
537
|
+
lines.push('');
|
|
538
|
+
lines.push(`*Notes: ${colors.notes}*`);
|
|
539
|
+
}
|
|
540
|
+
lines.push('');
|
|
541
|
+
|
|
542
|
+
// Typography section
|
|
543
|
+
lines.push('### Typography');
|
|
544
|
+
lines.push(`- **Heading:** ${typography.heading || ''}`);
|
|
545
|
+
lines.push(`- **Body:** ${typography.body || ''}`);
|
|
546
|
+
if (typography.mood) {
|
|
547
|
+
lines.push(`- **Mood:** ${typography.mood}`);
|
|
548
|
+
}
|
|
549
|
+
if (typography.best_for) {
|
|
550
|
+
lines.push(`- **Best For:** ${typography.best_for}`);
|
|
551
|
+
}
|
|
552
|
+
if (typography.google_fonts_url) {
|
|
553
|
+
lines.push(`- **Google Fonts:** ${typography.google_fonts_url}`);
|
|
554
|
+
}
|
|
555
|
+
if (typography.css_import) {
|
|
556
|
+
lines.push('- **CSS Import:**');
|
|
557
|
+
lines.push('```css');
|
|
558
|
+
lines.push(typography.css_import);
|
|
559
|
+
lines.push('```');
|
|
560
|
+
}
|
|
561
|
+
lines.push('');
|
|
562
|
+
|
|
563
|
+
// Key Effects section
|
|
564
|
+
if (effects) {
|
|
565
|
+
lines.push('### Key Effects');
|
|
566
|
+
lines.push(effects);
|
|
567
|
+
lines.push('');
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
// Anti-patterns section
|
|
571
|
+
if (antiPatterns) {
|
|
572
|
+
lines.push('### Avoid (Anti-patterns)');
|
|
573
|
+
const antiList = antiPatterns.split('+').map(a => a.trim()).filter(a => a);
|
|
574
|
+
antiList.forEach(anti => {
|
|
575
|
+
lines.push(`- ${anti}`);
|
|
576
|
+
});
|
|
577
|
+
lines.push('');
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
// Pre-Delivery Checklist section
|
|
581
|
+
lines.push('### Pre-Delivery Checklist');
|
|
582
|
+
lines.push('- [ ] No emojis as icons (use SVG: Heroicons/Lucide)');
|
|
583
|
+
lines.push('- [ ] cursor-pointer on all clickable elements');
|
|
584
|
+
lines.push('- [ ] Hover states with smooth transitions (150-300ms)');
|
|
585
|
+
lines.push('- [ ] Light mode: text contrast 4.5:1 minimum');
|
|
586
|
+
lines.push('- [ ] Focus states visible for keyboard nav');
|
|
587
|
+
lines.push('- [ ] prefers-reduced-motion respected');
|
|
588
|
+
lines.push('- [ ] Responsive: 375px, 768px, 1024px, 1440px');
|
|
589
|
+
lines.push('');
|
|
590
|
+
|
|
591
|
+
return lines.join('\n');
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// ============ MAIN ENTRY POINT ============
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Main entry point for design system generation
|
|
598
|
+
*/
|
|
599
|
+
export async function generateDesignSystem(
|
|
600
|
+
query,
|
|
601
|
+
projectName = null,
|
|
602
|
+
outputFormat = 'ascii',
|
|
603
|
+
persist = false,
|
|
604
|
+
page = null,
|
|
605
|
+
outputDir = null
|
|
606
|
+
) {
|
|
607
|
+
const generator = new DesignSystemGenerator();
|
|
608
|
+
const designSystem = await generator.generate(query, projectName);
|
|
609
|
+
|
|
610
|
+
// Persist to files if requested
|
|
611
|
+
if (persist) {
|
|
612
|
+
await persistDesignSystem(designSystem, page, outputDir, query);
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if (outputFormat === 'markdown') {
|
|
616
|
+
return formatMarkdown(designSystem);
|
|
617
|
+
}
|
|
618
|
+
return formatAsciiBox(designSystem);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
// ============ ADVANCED PERSISTENCE FUNCTIONS ============
|
|
622
|
+
// Full implementation matching Python version (format_master_md + intelligent overrides)
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
import { generateTokenSystem } from './utils/css-templates.js';
|
|
626
|
+
import { generateComponentSpecs } from './utils/component-specs.js';
|
|
627
|
+
import { formatPageOverrideMd } from './utils/page-override-formatter.js';
|
|
628
|
+
|
|
629
|
+
/**
|
|
630
|
+
* Format design system as complete MASTER.md file with hierarchical override logic
|
|
631
|
+
* This is the full Python-equivalent implementation (260 LOC in Python)
|
|
632
|
+
* @param {Object} designSystem - Complete design system object
|
|
633
|
+
* @returns {string} Formatted MASTER.md content
|
|
634
|
+
*/
|
|
635
|
+
export function formatMasterMd(designSystem) {
|
|
636
|
+
const project = designSystem.project_name || 'PROJECT';
|
|
637
|
+
const pattern = designSystem.pattern || {};
|
|
638
|
+
const style = designSystem.style || {};
|
|
639
|
+
const colors = designSystem.colors || {};
|
|
640
|
+
const typography = designSystem.typography || {};
|
|
641
|
+
const effects = designSystem.key_effects || '';
|
|
642
|
+
const antiPatterns = designSystem.anti_patterns || '';
|
|
643
|
+
|
|
644
|
+
const timestamp = new Date().toISOString(); // Full ISO 8601 UTC format
|
|
645
|
+
|
|
646
|
+
const lines = [];
|
|
647
|
+
|
|
648
|
+
// Logic header - explains Master + Override pattern
|
|
649
|
+
lines.push('# Design System Master File');
|
|
650
|
+
lines.push('');
|
|
651
|
+
lines.push('> **LOGIC:** When building a specific page, first check `design-system/pages/[page-name].md`.');
|
|
652
|
+
lines.push('> If that file exists, its rules **override** this Master file.');
|
|
653
|
+
lines.push('> If not, strictly follow the rules below.');
|
|
654
|
+
lines.push('');
|
|
655
|
+
lines.push('---');
|
|
656
|
+
lines.push('');
|
|
657
|
+
lines.push(`**Project:** ${project}`);
|
|
658
|
+
lines.push(`**Generated:** ${timestamp}`);
|
|
659
|
+
lines.push(`**Category:** ${designSystem.category || 'General'}`);
|
|
660
|
+
lines.push('');
|
|
661
|
+
lines.push('---');
|
|
662
|
+
lines.push('');
|
|
663
|
+
|
|
664
|
+
// Global Rules section
|
|
665
|
+
lines.push('## Global Rules');
|
|
666
|
+
lines.push('');
|
|
667
|
+
|
|
668
|
+
// Color Palette with CSS variables
|
|
669
|
+
lines.push('### Color Palette');
|
|
670
|
+
lines.push('');
|
|
671
|
+
lines.push('| Role | Hex | CSS Variable |');
|
|
672
|
+
lines.push('|------|-----|--------------|');
|
|
673
|
+
lines.push(`| Primary | \`${colors.primary || '#2563EB'}\` | \`--color-primary\` |`);
|
|
674
|
+
lines.push(`| Secondary | \`${colors.secondary || '#3B82F6'}\` | \`--color-secondary\` |`);
|
|
675
|
+
lines.push(`| CTA/Accent | \`${colors.cta || '#F97316'}\` | \`--color-cta\` |`);
|
|
676
|
+
lines.push(`| Background | \`${colors.background || '#F8FAFC'}\` | \`--color-background\` |`);
|
|
677
|
+
lines.push(`| Text | \`${colors.text || '#1E293B'}\` | \`--color-text\` |`);
|
|
678
|
+
lines.push('');
|
|
679
|
+
if (colors.notes) {
|
|
680
|
+
lines.push(`**Color Notes:** ${colors.notes}`);
|
|
681
|
+
lines.push('');
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// Typography
|
|
685
|
+
lines.push('### Typography');
|
|
686
|
+
lines.push('');
|
|
687
|
+
lines.push(`- **Heading Font:** ${typography.heading || 'Inter'}`);
|
|
688
|
+
lines.push(`- **Body Font:** ${typography.body || 'Inter'}`);
|
|
689
|
+
if (typography.mood) {
|
|
690
|
+
lines.push(`- **Mood:** ${typography.mood}`);
|
|
691
|
+
}
|
|
692
|
+
if (typography.google_fonts_url) {
|
|
693
|
+
lines.push(`- **Google Fonts:** [${typography.heading} + ${typography.body}](${typography.google_fonts_url})`);
|
|
694
|
+
}
|
|
695
|
+
lines.push('');
|
|
696
|
+
if (typography.css_import) {
|
|
697
|
+
lines.push('**CSS Import:**');
|
|
698
|
+
lines.push('```css');
|
|
699
|
+
lines.push(typography.css_import);
|
|
700
|
+
lines.push('```');
|
|
701
|
+
lines.push('');
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// Spacing Variables
|
|
705
|
+
lines.push('### Spacing Variables');
|
|
706
|
+
lines.push('');
|
|
707
|
+
lines.push('| Token | Value | Usage |');
|
|
708
|
+
lines.push('|-------|-------|-------|');
|
|
709
|
+
lines.push('| `--space-xs` | `4px` / `0.25rem` | Tight gaps |');
|
|
710
|
+
lines.push('| `--space-sm` | `8px` / `0.5rem` | Icon gaps, inline spacing |');
|
|
711
|
+
lines.push('| `--space-md` | `16px` / `1rem` | Standard padding |');
|
|
712
|
+
lines.push('| `--space-lg` | `24px` / `1.5rem` | Section padding |');
|
|
713
|
+
lines.push('| `--space-xl` | `32px` / `2rem` | Large gaps |');
|
|
714
|
+
lines.push('| `--space-2xl` | `48px` / `3rem` | Section margins |');
|
|
715
|
+
lines.push('| `--space-3xl` | `64px` / `4rem` | Hero padding |');
|
|
716
|
+
lines.push('');
|
|
717
|
+
|
|
718
|
+
// Shadow Depths
|
|
719
|
+
lines.push('### Shadow Depths');
|
|
720
|
+
lines.push('');
|
|
721
|
+
lines.push('| Level | Value | Usage |');
|
|
722
|
+
lines.push('|-------|-------|-------|');
|
|
723
|
+
lines.push('| `--shadow-sm` | `0 1px 2px rgba(0,0,0,0.05)` | Subtle lift |');
|
|
724
|
+
lines.push('| `--shadow-md` | `0 4px 6px rgba(0,0,0,0.1)` | Cards, buttons |');
|
|
725
|
+
lines.push('| `--shadow-lg` | `0 10px 15px rgba(0,0,0,0.1)` | Modals, dropdowns |');
|
|
726
|
+
lines.push('| `--shadow-xl` | `0 20px 25px rgba(0,0,0,0.15)` | Hero images, featured cards |');
|
|
727
|
+
lines.push('');
|
|
728
|
+
|
|
729
|
+
// Component Specs section (using Phase 2 generators)
|
|
730
|
+
lines.push('---');
|
|
731
|
+
lines.push('');
|
|
732
|
+
lines.push('## Component Specs');
|
|
733
|
+
lines.push('');
|
|
734
|
+
|
|
735
|
+
// Buttons
|
|
736
|
+
lines.push('### Buttons');
|
|
737
|
+
lines.push('');
|
|
738
|
+
lines.push('```css');
|
|
739
|
+
lines.push('/* Primary Button */');
|
|
740
|
+
lines.push('.btn-primary {');
|
|
741
|
+
lines.push(` background: ${colors.cta || '#F97316'};`);
|
|
742
|
+
lines.push(' color: white;');
|
|
743
|
+
lines.push(' padding: 12px 24px;');
|
|
744
|
+
lines.push(' border-radius: 8px;');
|
|
745
|
+
lines.push(' font-weight: 600;');
|
|
746
|
+
lines.push(' transition: all 200ms ease;');
|
|
747
|
+
lines.push(' cursor: pointer;');
|
|
748
|
+
lines.push('}');
|
|
749
|
+
lines.push('');
|
|
750
|
+
lines.push('.btn-primary:hover {');
|
|
751
|
+
lines.push(' opacity: 0.9;');
|
|
752
|
+
lines.push(' transform: translateY(-1px);');
|
|
753
|
+
lines.push('}');
|
|
754
|
+
lines.push('');
|
|
755
|
+
lines.push('/* Secondary Button */');
|
|
756
|
+
lines.push('.btn-secondary {');
|
|
757
|
+
lines.push(' background: transparent;');
|
|
758
|
+
lines.push(` color: ${colors.primary || '#2563EB'};`);
|
|
759
|
+
lines.push(` border: 2px solid ${colors.primary || '#2563EB'};`);
|
|
760
|
+
lines.push(' padding: 12px 24px;');
|
|
761
|
+
lines.push(' border-radius: 8px;');
|
|
762
|
+
lines.push(' font-weight: 600;');
|
|
763
|
+
lines.push(' transition: all 200ms ease;');
|
|
764
|
+
lines.push(' cursor: pointer;');
|
|
765
|
+
lines.push('}');
|
|
766
|
+
lines.push('```');
|
|
767
|
+
lines.push('');
|
|
768
|
+
|
|
769
|
+
// Cards
|
|
770
|
+
lines.push('### Cards');
|
|
771
|
+
lines.push('');
|
|
772
|
+
lines.push('```css');
|
|
773
|
+
lines.push('.card {');
|
|
774
|
+
lines.push(` background: ${colors.background || '#FFFFFF'};`);
|
|
775
|
+
lines.push(' border-radius: 12px;');
|
|
776
|
+
lines.push(' padding: 24px;');
|
|
777
|
+
lines.push(' box-shadow: var(--shadow-md);');
|
|
778
|
+
lines.push(' transition: all 200ms ease;');
|
|
779
|
+
lines.push(' cursor: pointer;');
|
|
780
|
+
lines.push('}');
|
|
781
|
+
lines.push('');
|
|
782
|
+
lines.push('.card:hover {');
|
|
783
|
+
lines.push(' box-shadow: var(--shadow-lg);');
|
|
784
|
+
lines.push(' transform: translateY(-2px);');
|
|
785
|
+
lines.push('}');
|
|
786
|
+
lines.push('```');
|
|
787
|
+
lines.push('');
|
|
788
|
+
|
|
789
|
+
// Inputs
|
|
790
|
+
lines.push('### Inputs');
|
|
791
|
+
lines.push('');
|
|
792
|
+
lines.push('```css');
|
|
793
|
+
lines.push('.input {');
|
|
794
|
+
lines.push(' padding: 12px 16px;');
|
|
795
|
+
lines.push(' border: 1px solid #E2E8F0;');
|
|
796
|
+
lines.push(' border-radius: 8px;');
|
|
797
|
+
lines.push(' font-size: 16px;');
|
|
798
|
+
lines.push(' transition: border-color 200ms ease;');
|
|
799
|
+
lines.push('}');
|
|
800
|
+
lines.push('');
|
|
801
|
+
lines.push('.input:focus {');
|
|
802
|
+
lines.push(` border-color: ${colors.primary || '#2563EB'};`);
|
|
803
|
+
lines.push(' outline: none;');
|
|
804
|
+
lines.push(` box-shadow: 0 0 0 3px ${colors.primary || '#2563EB'}20;`);
|
|
805
|
+
lines.push('}');
|
|
806
|
+
lines.push('```');
|
|
807
|
+
lines.push('');
|
|
808
|
+
|
|
809
|
+
// Modals
|
|
810
|
+
lines.push('### Modals');
|
|
811
|
+
lines.push('');
|
|
812
|
+
lines.push('```css');
|
|
813
|
+
lines.push('.modal-overlay {');
|
|
814
|
+
lines.push(' background: rgba(0, 0, 0, 0.5);');
|
|
815
|
+
lines.push(' backdrop-filter: blur(4px);');
|
|
816
|
+
lines.push('}');
|
|
817
|
+
lines.push('');
|
|
818
|
+
lines.push('.modal {');
|
|
819
|
+
lines.push(' background: white;');
|
|
820
|
+
lines.push(' border-radius: 16px;');
|
|
821
|
+
lines.push(' padding: 32px;');
|
|
822
|
+
lines.push(' box-shadow: var(--shadow-xl);');
|
|
823
|
+
lines.push(' max-width: 500px;');
|
|
824
|
+
lines.push(' width: 90%;');
|
|
825
|
+
lines.push('}');
|
|
826
|
+
lines.push('```');
|
|
827
|
+
lines.push('');
|
|
828
|
+
|
|
829
|
+
// Style section
|
|
830
|
+
lines.push('---');
|
|
831
|
+
lines.push('');
|
|
832
|
+
lines.push('## Style Guidelines');
|
|
833
|
+
lines.push('');
|
|
834
|
+
lines.push(`**Style:** ${style.name || 'Minimalism'}`);
|
|
835
|
+
lines.push('');
|
|
836
|
+
if (style.keywords) {
|
|
837
|
+
lines.push(`**Keywords:** ${style.keywords}`);
|
|
838
|
+
lines.push('');
|
|
839
|
+
}
|
|
840
|
+
if (style.best_for) {
|
|
841
|
+
lines.push(`**Best For:** ${style.best_for}`);
|
|
842
|
+
lines.push('');
|
|
843
|
+
}
|
|
844
|
+
if (effects) {
|
|
845
|
+
lines.push(`**Key Effects:** ${effects}`);
|
|
846
|
+
lines.push('');
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
// Layout Pattern
|
|
850
|
+
lines.push('### Page Pattern');
|
|
851
|
+
lines.push('');
|
|
852
|
+
lines.push(`**Pattern Name:** ${pattern.name || ''}`);
|
|
853
|
+
lines.push('');
|
|
854
|
+
if (pattern.conversion) {
|
|
855
|
+
lines.push(`- **Conversion Strategy:** ${pattern.conversion}`);
|
|
856
|
+
}
|
|
857
|
+
if (pattern.cta_placement) {
|
|
858
|
+
lines.push(`- **CTA Placement:** ${pattern.cta_placement}`);
|
|
859
|
+
}
|
|
860
|
+
lines.push(`- **Section Order:** ${pattern.sections || ''}`);
|
|
861
|
+
lines.push('');
|
|
862
|
+
|
|
863
|
+
// Anti-Patterns section
|
|
864
|
+
lines.push('---');
|
|
865
|
+
lines.push('');
|
|
866
|
+
lines.push('## Anti-Patterns (Do NOT Use)');
|
|
867
|
+
lines.push('');
|
|
868
|
+
if (antiPatterns) {
|
|
869
|
+
const antiList = antiPatterns.split('+').map(a => a.trim()).filter(a => a);
|
|
870
|
+
antiList.forEach(anti => {
|
|
871
|
+
lines.push(`- ❌ ${anti}`);
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
lines.push('');
|
|
875
|
+
lines.push('### Additional Forbidden Patterns');
|
|
876
|
+
lines.push('');
|
|
877
|
+
lines.push('- ❌ **Emojis as icons** — Use SVG icons (Heroicons, Lucide, Simple Icons)');
|
|
878
|
+
lines.push('- ❌ **Missing cursor:pointer** — All clickable elements must have cursor:pointer');
|
|
879
|
+
lines.push('- ❌ **Layout-shifting hovers** — Avoid scale transforms that shift layout');
|
|
880
|
+
lines.push('- ❌ **Low contrast text** — Maintain 4.5:1 minimum contrast ratio');
|
|
881
|
+
lines.push('- ❌ **Instant state changes** — Always use transitions (150-300ms)');
|
|
882
|
+
lines.push('- ❌ **Invisible focus states** — Focus states must be visible for a11y');
|
|
883
|
+
lines.push('');
|
|
884
|
+
|
|
885
|
+
// Pre-Delivery Checklist
|
|
886
|
+
lines.push('---');
|
|
887
|
+
lines.push('');
|
|
888
|
+
lines.push('## Pre-Delivery Checklist');
|
|
889
|
+
lines.push('');
|
|
890
|
+
lines.push('Before delivering any UI code, verify:');
|
|
891
|
+
lines.push('');
|
|
892
|
+
lines.push('- [ ] No emojis used as icons (use SVG instead)');
|
|
893
|
+
lines.push('- [ ] All icons from consistent icon set (Heroicons/Lucide)');
|
|
894
|
+
lines.push('- [ ] `cursor-pointer` on all clickable elements');
|
|
895
|
+
lines.push('- [ ] Hover states with smooth transitions (150-300ms)');
|
|
896
|
+
lines.push('- [ ] Light mode: text contrast 4.5:1 minimum');
|
|
897
|
+
lines.push('- [ ] Focus states visible for keyboard navigation');
|
|
898
|
+
lines.push('- [ ] `prefers-reduced-motion` respected');
|
|
899
|
+
lines.push('- [ ] Responsive: 375px, 768px, 1024px, 1440px');
|
|
900
|
+
lines.push('- [ ] No content hidden behind fixed navbars');
|
|
901
|
+
lines.push('- [ ] No horizontal scroll on mobile');
|
|
902
|
+
lines.push('');
|
|
903
|
+
|
|
904
|
+
return lines.join('\n');
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/**
|
|
908
|
+
* Persist design system to design-system/<project>/ folder
|
|
909
|
+
* Updated to use full formatMasterMd() instead of simplified version
|
|
910
|
+
*/
|
|
911
|
+
export async function persistDesignSystem(
|
|
912
|
+
designSystem,
|
|
913
|
+
page = null,
|
|
914
|
+
outputDir = null,
|
|
915
|
+
pageQuery = null
|
|
916
|
+
) {
|
|
917
|
+
const baseDir = outputDir || process.cwd();
|
|
918
|
+
|
|
919
|
+
// Use project name for project-specific folder
|
|
920
|
+
const projectName = designSystem.project_name || 'default';
|
|
921
|
+
const projectSlug = projectName.toLowerCase().replace(/\s+/g, '-');
|
|
922
|
+
|
|
923
|
+
const designSystemDir = join(baseDir, 'design-system', projectSlug);
|
|
924
|
+
const pagesDir = join(designSystemDir, 'pages');
|
|
925
|
+
|
|
926
|
+
const createdFiles = [];
|
|
927
|
+
|
|
928
|
+
// Create directories
|
|
929
|
+
await mkdir(designSystemDir, { recursive: true });
|
|
930
|
+
await mkdir(pagesDir, { recursive: true });
|
|
931
|
+
|
|
932
|
+
const masterFile = join(designSystemDir, 'MASTER.md');
|
|
933
|
+
|
|
934
|
+
// Generate and write MASTER.md (now using full formatter)
|
|
935
|
+
const masterContent = formatMasterMd(designSystem);
|
|
936
|
+
await writeFile(masterFile, masterContent, 'utf-8');
|
|
937
|
+
createdFiles.push(masterFile);
|
|
938
|
+
|
|
939
|
+
// If page is specified, create intelligent page override file
|
|
940
|
+
if (page) {
|
|
941
|
+
const pageFile = join(pagesDir, `${page.toLowerCase().replace(/\s+/g, '-')}.md`);
|
|
942
|
+
const pageContent = await formatPageOverrideMd(designSystem, page, pageQuery);
|
|
943
|
+
await writeFile(pageFile, pageContent, 'utf-8');
|
|
944
|
+
createdFiles.push(pageFile);
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
return {
|
|
948
|
+
status: 'success',
|
|
949
|
+
design_system_dir: designSystemDir,
|
|
950
|
+
created_files: createdFiles
|
|
951
|
+
};
|
|
952
|
+
}
|