antigravity-ide 4.2.1 → 4.3.3
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/.shared/{design-philosophy → core/design-philosophy}/README.md +12 -1
- package/.agent/.shared/{ai-master → technical/ai-master}/README.md +12 -1
- package/.agent/.shared/{api-standards → technical/api-standards}/README.md +12 -1
- package/.agent/.shared/{database-master → technical/database-master}/README.md +12 -2
- package/.agent/.shared/{seo-master → technical/seo-master}/README.md +12 -1
- package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/README.md +12 -1
- package/.agent/ARCHITECTURE.md +16 -10
- package/.agent/ARCHITECTURE.vi.md +8 -8
- package/{GEMINI.md → .agent/GEMINI.md} +4 -5
- package/.agent/RESOURCES.md +6 -1
- package/.agent/agents/backend-specialist.md +154 -19
- package/.agent/agents/browser-subagent.md +45 -0
- package/.agent/agents/cloud-architect.md +108 -189
- package/.agent/agents/debugger.md +83 -182
- package/.agent/agents/documentation-writer.md +125 -72
- package/.agent/agents/frontend-specialist.md +40 -7
- package/.agent/agents/game-developer.md +111 -116
- package/.agent/agents/mobile-developer.md +108 -321
- package/.agent/agents/orchestrator.md +106 -366
- package/.agent/agents/performance-optimizer.md +105 -136
- package/.agent/agents/project-planner.md +132 -39
- package/.agent/agents/quality-inspector.md +136 -32
- package/.agent/agents/security-auditor.md +138 -15
- package/.agent/agents/seo-specialist.md +118 -72
- package/.agent/agents/test-engineer.md +142 -11
- package/.agent/brain/task.md +16 -0
- package/.agent/rules/GEMINI.md +63 -31
- package/.agent/rules/code-quality.md +34 -3
- package/.agent/rules/frontend.md +3 -3
- package/.agent/rules/strict-protocol.md +44 -3
- package/.agent/rules/system-update.md +56 -3
- package/.agent/skills/agent-backend-patterns/SKILL.md +16 -3
- package/.agent/skills/ai-engineer/SKILL.md +29 -16
- package/.agent/skills/api-documenter/SKILL.md +4 -4
- package/.agent/skills/app-builder/SKILL.md +1 -1
- package/.agent/skills/app-builder/tech-stack.md +2 -2
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +39 -79
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +53 -75
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +56 -119
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +61 -94
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +56 -82
- package/.agent/skills/brand-guidelines-anthropic/LICENSE.txt +202 -0
- package/.agent/skills/brand-guidelines-anthropic/SKILL.md +26 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/color-application.md +5 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/colors.md +14 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/font-management.md +6 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/shape-and-accent-colors.md +7 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/smart-font-application.md +6 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/text-styling.md +6 -0
- package/.agent/skills/brand-guidelines-anthropic/sub-skills/typography.md +7 -0
- package/.agent/skills/cloud-architect-master/SKILL.md +9 -4
- package/.agent/skills/cro-expert-kit/SKILL.md +9 -4
- package/.agent/skills/database-migration/SKILL.md +9 -3
- package/.agent/skills/deployment-engineer/SKILL.md +9 -3
- package/.agent/skills/frontend-design/ux-psychology.md +10 -585
- package/.agent/skills/full-stack-scaffold/SKILL.md +4 -4
- package/.agent/skills/game-development/2d-games/SKILL.md +4 -2
- package/.agent/skills/game-development/3d-games/SKILL.md +4 -2
- package/.agent/skills/game-development/SKILL.md +18 -149
- package/.agent/skills/game-development/game-art/SKILL.md +4 -2
- package/.agent/skills/game-development/game-audio/SKILL.md +4 -2
- package/.agent/skills/game-development/game-design/SKILL.md +4 -2
- package/.agent/skills/game-development/mobile-games/SKILL.md +4 -2
- package/.agent/skills/game-development/multiplayer/SKILL.md +4 -2
- package/.agent/skills/game-development/pc-games/SKILL.md +4 -2
- package/.agent/skills/game-development/vr-ar/SKILL.md +4 -2
- package/.agent/skills/game-development/web-games/SKILL.md +4 -2
- package/.agent/skills/geo-fundamentals/SKILL.md +9 -136
- package/.agent/skills/git-collaboration-master/SKILL.md +9 -4
- package/.agent/skills/i18n-localization/SKILL.md +10 -118
- package/.agent/skills/incident-responder/SKILL.md +9 -6
- package/.agent/skills/internal-comms-anthropic/LICENSE.txt +202 -0
- package/.agent/skills/internal-comms-anthropic/SKILL.md +33 -0
- package/.agent/skills/internal-comms-anthropic/examples/3p-updates.md +47 -0
- package/.agent/skills/internal-comms-anthropic/examples/company-newsletter.md +65 -0
- package/.agent/skills/internal-comms-anthropic/examples/faq-answers.md +30 -0
- package/.agent/skills/internal-comms-anthropic/examples/general-comms.md +16 -0
- package/.agent/skills/last30days/tests/__init__.py +1 -0
- package/.agent/skills/last30days/tests/test_cache.py +59 -0
- package/.agent/skills/last30days/tests/test_dates.py +114 -0
- package/.agent/skills/last30days/tests/test_dedupe.py +111 -0
- package/.agent/skills/last30days/tests/test_models.py +135 -0
- package/.agent/skills/last30days/tests/test_normalize.py +138 -0
- package/.agent/skills/last30days/tests/test_render.py +116 -0
- package/.agent/skills/last30days/tests/test_score.py +168 -0
- package/.agent/skills/legacy-modernizer/SKILL.md +9 -4
- package/.agent/skills/lint-and-validate/scripts/lint_runner.py +2 -14
- package/.agent/skills/loki-mode/.github/workflows/claude-code-review.yml +57 -0
- package/.agent/skills/loki-mode/.github/workflows/claude.yml +50 -0
- package/.agent/skills/loki-mode/.github/workflows/release.yml +128 -0
- package/.agent/skills/loki-mode/tests/run-all-tests.sh +78 -0
- package/.agent/skills/loki-mode/tests/test-agent-timeout.sh +348 -0
- package/.agent/skills/loki-mode/tests/test-bootstrap.sh +196 -0
- package/.agent/skills/loki-mode/tests/test-circuit-breaker.sh +389 -0
- package/.agent/skills/loki-mode/tests/test-state-recovery.sh +393 -0
- package/.agent/skills/loki-mode/tests/test-task-queue.sh +396 -0
- package/.agent/skills/loki-mode/tests/test-wrapper.sh +314 -0
- package/.agent/skills/mcp-builder/SKILL.md +21 -164
- package/.agent/skills/mobile-design/SKILL.md +21 -369
- package/.agent/skills/mobile-design/mobile-performance.md +1 -1
- package/.agent/skills/modern-web-architect/SKILL.md +12 -6
- package/.agent/skills/nextjs-react-expert/scripts/convert_rules.py +1 -1
- package/.agent/skills/penetration-tester-master/SKILL.md +9 -4
- package/.agent/skills/performance-engineer/SKILL.md +4 -5
- package/.agent/skills/production-code-audit/SKILL.md +6 -0
- package/.agent/skills/rust-pro/SKILL.md +0 -177
- package/.agent/skills/security-auditor/SKILL.md +35 -27
- package/.agent/skills/seo-expert-kit/SKILL.md +9 -4
- package/.agent/skills/shopify-development/scripts/tests/test_shopify_init.py +379 -0
- package/.agent/skills/tdd-master-workflow/SKILL.md +9 -3
- package/.agent/workflows/audit.md +30 -16
- package/.agent/workflows/brainstorm.md +33 -96
- package/.agent/workflows/create.md +37 -45
- package/.agent/workflows/debug.md +45 -84
- package/.agent/workflows/deploy.md +33 -158
- package/.agent/workflows/document.md +38 -15
- package/.agent/workflows/enhance.md +33 -48
- package/.agent/workflows/monitor.md +35 -14
- package/.agent/workflows/orchestrate.md +33 -218
- package/.agent/workflows/plan.md +39 -70
- package/.agent/workflows/security.md +35 -14
- package/.agent/workflows/seo.md +39 -16
- package/.agent/workflows/status.md +33 -72
- package/.agent/workflows/test.md +30 -127
- package/.agent/workflows/ui-ux-pro-max.md +24 -283
- package/LICENSE +22 -8
- package/README.md +105 -72
- package/README.vi.md +93 -110
- package/cli/create.js +275 -413
- package/cli/index.js +36 -24
- package/cli/lib/auto-update.js +14 -21
- package/cli/logic/product-skills.js +58 -0
- package/cli/logic/skill-definitions.js +0 -39
- package/cli/prompts.js +151 -145
- package/cli/skills/browser-subagent-core/SKILL.md +22 -0
- package/cli/tools/browser.js +75 -0
- package/cli/ui/dashboard.js +48 -0
- package/docs/AGENTS_GUIDE.vi.md +39 -45
- package/docs/CONTRIBUTING.vi.md +12 -3
- package/docs/{GEMINI_GUIDE.md → GEMINI_USAGE.md} +6 -6
- package/docs/GLOSSARY.vi.md +49 -30
- package/docs/HOW_ANTIGRAVITY_THINKS.vi.md +1 -1
- package/docs/OPERATIONAL_FLOW.vi.md +15 -0
- package/docs/{PUBLISHING.md → PUBLISHING_GUIDE.md} +31 -3
- package/docs/RULES_GUIDE.vi.md +67 -31
- package/docs/SHARED_LIBRARY_GUIDE.vi.md +18 -22
- package/docs/SKILLS_GUIDE.vi.md +119 -32
- package/docs/TROUBLESHOOTING.vi.md +10 -2
- package/docs/WORKFLOW_GUIDE.vi.md +57 -9
- package/package.json +32 -8
- package/setup.js +147 -114
- package/.agent/.shared/compliance/README.md +0 -19
- package/.agent/.shared/design-system/README.md +0 -18
- package/.agent/.shared/domain-blueprints/README.md +0 -18
- package/.agent/.shared/dx-toolkit/README.md +0 -19
- package/.agent/.shared/i18n-master/README.md +0 -18
- package/.agent/.shared/infra-blueprints/README.md +0 -18
- package/.agent/.shared/metrics/README.md +0 -17
- package/.agent/.shared/resilience-patterns/README.md +0 -19
- package/.agent/.shared/security-armor/README.md +0 -25
- package/.agent/.shared/testing-master/README.md +0 -20
- package/.agent/.shared/vitals-templates/README.md +0 -18
- package/.agent/agents/accessibility-expert.md +0 -22
- package/.agent/agents/api-architect.md +0 -22
- package/.agent/agents/backend-specialist.eco.md +0 -19
- package/.agent/agents/backend-specialist.instant.md +0 -19
- package/.agent/agents/codebase-expert.md +0 -23
- package/.agent/agents/compliance-expert.md +0 -22
- package/.agent/agents/data-scientist.md +0 -22
- package/.agent/agents/debugger.eco.md +0 -20
- package/.agent/agents/debugger.instant.md +0 -20
- package/.agent/agents/deep-thinker.ultra.md +0 -23
- package/.agent/agents/devex-optimizer.md +0 -22
- package/.agent/agents/devops-architect.md +0 -22
- package/.agent/agents/frontend-specialist.eco.md +0 -19
- package/.agent/agents/frontend-specialist.instant.md +0 -19
- package/.agent/agents/growth-engineer.md +0 -22
- package/.agent/agents/i18n-specialist.md +0 -21
- package/.agent/agents/legacy-modernizer.md +0 -22
- package/.agent/agents/microservices-specialist.md +0 -22
- package/.agent/agents/motion-designer.md +0 -22
- package/.agent/agents/orchestrator.creative.md +0 -28
- package/.agent/agents/orchestrator.eco.md +0 -29
- package/.agent/agents/orchestrator.instant.md +0 -29
- package/.agent/agents/orchestrator.ultra.md +0 -28
- package/.agent/agents/performance-benchmarker.md +0 -22
- package/.agent/agents/project-planner.eco.md +0 -19
- package/.agent/agents/project-planner.instant.md +0 -19
- package/.agent/agents/security-pentester.md +0 -22
- package/.agent/agents/serverless-expert.md +0 -22
- package/.agent/fastcode_index.json +0 -1038
- package/.agent/mcp_config.json +0 -24
- package/.agent/rules/GEMINI.eco.md +0 -37
- package/.agent/rules/GEMINI.instant.md +0 -37
- package/.agent/rules/api-spec.md +0 -28
- package/.agent/rules/database.md +0 -24
- package/.agent/rules/devops.md +0 -23
- package/.agent/rules/growth-strategy.md +0 -22
- package/.agent/rules/logging-monitoring.md +0 -22
- package/.agent/rules/quality-assurance.md +0 -22
- package/.agent/rules/system-reasoning.md +0 -20
- package/.agent/rules/ui-design.md +0 -23
- package/.agent/rules/ux-patterns.md +0 -23
- package/.agent/scripts/auto_preview.py +0 -148
- package/.agent/scripts/checklist.py +0 -252
- package/.agent/scripts/session_manager.py +0 -120
- package/.agent/scripts/simulation_install.js +0 -59
- package/.agent/scripts/sync_to_global.py +0 -78
- package/.agent/scripts/translate_workflows.py +0 -53
- package/.agent/scripts/verify_all.py +0 -327
- package/.agent/scripts/verify_shared_modules.js +0 -126
- package/.agent/skills/fastcode-search/SKILL.md +0 -46
- package/.agent/skills/fastcode-search/fastcode_config.example.json +0 -17
- package/.agent/skills/frontend-trends-2026/SKILL.md +0 -78
- package/.agent/skills/frontend-trends-2026/formulas/BentoGrid.tsx +0 -42
- package/.agent/skills/frontend-trends-2026/formulas/LiquidCard.tsx +0 -32
- package/.agent/skills/frontend-trends-2026/formulas/NeoButton.tsx +0 -27
- package/.agent/workflows/deep-security-audit.md +0 -9
- package/.agent/workflows/growth-max.md +0 -9
- package/.agent/workflows/performance-max.md +0 -9
- package/.editorconfig +0 -21
- package/.gitattributes +0 -7
- package/CHANGELOG.md +0 -32
- package/ERRORS.md +0 -67
- package/action.yml +0 -32
- package/antigravity-ide-logo.png +0 -0
- package/antigravity-ide-logo.svg +0 -24
- package/assets/skills-bundle.json +0 -1
- package/cli/manifest.js +0 -524
- package/cli/skills/fastcode.js +0 -181
- package/docs/AGENT_FLOW.md +0 -608
- package/docs/CONTRIBUTING.md +0 -46
- package/docs/COPYRIGHT.md +0 -57
- package/docs/DEPLOYMENT.md +0 -77
- package/docs/GLOSSARY.md +0 -109
- package/docs/MASTER_GUIDE.md +0 -103
- package/docs/OPERATIONAL_FLOW.md +0 -147
- package/docs/PLAN-upgrade-core-architecture.md +0 -71
- package/docs/SKILLS.md +0 -610
- package/docs/TROUBLESHOOTING.md +0 -43
- package/jest.config.js +0 -8
- package/scripts/bump.js +0 -93
- package/scripts/bundle-skills.js +0 -59
- package/scripts/internal/automation/auto-release.js +0 -177
- package/scripts/internal/fractalize-skills.js +0 -89
- package/scripts/internal/generate-skill-definitions.js +0 -134
- package/scripts/internal/internal/update-docs.js +0 -115
- package/scripts/internal/refactor-skill-content.js +0 -127
- package/scripts/internal/rename-skills.js +0 -96
- package/scripts/internal/sync-skills.js +0 -112
- package/scripts/internal/update-frontmatter-names.js +0 -99
- package/scripts/internal/verification/audit-dna.js +0 -56
- package/scripts/internal/verification/audit-skills.js +0 -65
- package/web/src/app/docs/guide/examples/brainstorm/page.mdx +0 -91
- package/web/src/app/docs/guide/examples/create/page.mdx +0 -84
- package/web/src/app/docs/guide/examples/debugging/page.mdx +0 -83
- package/web/src/app/docs/guide/examples/deployment/page.mdx +0 -93
- package/web/src/app/docs/guide/examples/new-feature/page.mdx +0 -102
- package/web/src/app/docs/guide/examples/orchestration/page.mdx +0 -99
- package/web/src/app/docs/guide/examples/plan/page.mdx +0 -76
- package/web/src/app/docs/guide/examples/preview/page.mdx +0 -77
- package/web/src/app/docs/guide/examples/status/page.mdx +0 -78
- package/web/src/app/docs/guide/examples/test/page.mdx +0 -80
- package/web/src/app/docs/guide/examples/ui-design/page.mdx +0 -90
- package/web/src/components/mdx/Callout.tsx +0 -60
- package/web/src/components/mdx/FeatureGrid.tsx +0 -38
- package/web/src/components/mdx/ProTips.tsx +0 -29
- package/web/src/components/mdx/StepList.tsx +0 -33
- package/web/src/components/mdx/Terminal.tsx +0 -58
- package/web/src/components/mdx/index.ts +0 -5
- package/web/src/mdx-components.tsx +0 -98
- /package/.agent/.shared/{design-philosophy → core/design-philosophy}/MANIFESTO.md +0 -0
- /package/.agent/.shared/{design-philosophy → core/design-philosophy}/checklists/tactile_audit.md +0 -0
- /package/.agent/.shared/{design-philosophy → core/design-philosophy}/checklists/visual_audit.md +0 -0
- /package/.agent/.shared/{design-philosophy → core/design-philosophy}/presets/linear_glow.json +0 -0
- /package/.agent/.shared/{dx-toolkit → core/dx-toolkit}/checklists/code_review.md +0 -0
- /package/.agent/.shared/{dx-toolkit → core/dx-toolkit}/presets/vscode_settings.json +0 -0
- /package/.agent/.shared/{metrics → core/metrics}/benchmarks.json +0 -0
- /package/.agent/.shared/{vitals-templates → core/vitals-templates}/audit_report.md +0 -0
- /package/.agent/.shared/{vitals-templates → core/vitals-templates}/plan_prd.md +0 -0
- /package/.agent/.shared/{ai-master → technical/ai-master}/best_patterns.md +0 -0
- /package/.agent/.shared/{ai-master → technical/ai-master}/checklists/prompt_audit.md +0 -0
- /package/.agent/.shared/{ai-master → technical/ai-master}/presets/model_configs.json +0 -0
- /package/.agent/.shared/{api-standards → technical/api-standards}/data +0 -0
- /package/.agent/.shared/{api-standards → technical/api-standards}/endpoints_naming.md +0 -0
- /package/.agent/.shared/{api-standards → technical/api-standards}/error_codes.csv +0 -0
- /package/.agent/.shared/{api-standards → technical/api-standards}/pagination_sorting.md +0 -0
- /package/.agent/.shared/{api-standards → technical/api-standards}/response_format.json +0 -0
- /package/.agent/.shared/{database-master → technical/database-master}/schemas/auth_rbac.sql +0 -0
- /package/.agent/.shared/{database-master → technical/database-master}/schemas/cms.sql +0 -0
- /package/.agent/.shared/{database-master → technical/database-master}/schemas/ecommerce.sql +0 -0
- /package/.agent/.shared/{design-system → technical/design-system}/brand_presets.json +0 -0
- /package/.agent/.shared/{design-system → technical/design-system}/micro_interactions.md +0 -0
- /package/.agent/.shared/{i18n-master → technical/i18n-master}/vi_tech_dictionary.csv +0 -0
- /package/.agent/.shared/{i18n-master → technical/i18n-master}/workflows.json +0 -0
- /package/.agent/.shared/{resilience-patterns → technical/resilience-patterns}/checklists/chaos_engineering.md +0 -0
- /package/.agent/.shared/{resilience-patterns → technical/resilience-patterns}/presets/circuit_breaker.json +0 -0
- /package/.agent/.shared/{security-armor → technical/security-armor}/checklists/vuln_scan.md +0 -0
- /package/.agent/.shared/{security-armor → technical/security-armor}/hardening.md +0 -0
- /package/.agent/.shared/{security-armor → technical/security-armor}/presets/helmet_config.json +0 -0
- /package/.agent/.shared/{seo-master → technical/seo-master}/checklists/technical_seo.md +0 -0
- /package/.agent/.shared/{seo-master → technical/seo-master}/presets/json_ld_schema.json +0 -0
- /package/.agent/.shared/{testing-master → technical/testing-master}/checklists/pre_release.md +0 -0
- /package/.agent/.shared/{testing-master → technical/testing-master}/scenarios.md +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/colors.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/icons.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/landing.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/products.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/react-performance.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/flutter.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/html-tailwind.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/jetpack-compose.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/nextjs.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/nuxt-ui.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/nuxtjs.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/react-native.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/react.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/shadcn.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/svelte.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/swiftui.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/stacks/vue.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/ux-guidelines.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/data/web-interface.csv +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/__pycache__/core.cpython-313.pyc +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/core.py +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/design_system.py +0 -0
- /package/.agent/.shared/{ui-ux-pro-max → technical/ui-ux-pro-max}/scripts/search.py +0 -0
- /package/.agent/.shared/{compliance → verticals/compliance}/legal_templates.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/edtech.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/fintech.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/fnb_restaurant.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/freelance_marketplace.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/healthcare.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/hospitality_tourism.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/logistics.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/marketing_automation.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/personal_branding.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/real_estate.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/retail_ecommerce.md +0 -0
- /package/.agent/.shared/{domain-blueprints → verticals/domain-blueprints}/standard-pro-agents.md +0 -0
- /package/.agent/.shared/{infra-blueprints → verticals/infra-blueprints}/deployment_specs.md +0 -0
- /package/.agent/skills/ai-engineer/{resources → sub-skills}/ai_infra_stack.md +0 -0
- /package/.agent/skills/cloud-architect-master/{resources → sub-skills}/cost_optimization_checklist.md +0 -0
- /package/.agent/skills/cro-expert-kit/{resources → sub-skills}/psychological_triggers.md +0 -0
- /package/.agent/skills/database-migration/{resources → sub-skills}/zero_downtime_strategy.md +0 -0
- /package/.agent/skills/deployment-engineer/{resources → sub-skills}/k8s_best_practices.md +0 -0
- /package/.agent/skills/git-collaboration-master/{resources → sub-skills}/pr_template.md +0 -0
- /package/.agent/skills/incident-responder/{resources → sub-skills}/incident_severity_levels.md +0 -0
- /package/.agent/skills/legacy-modernizer/{resources → sub-skills}/strangler_fig_pattern.md +0 -0
- /package/.agent/skills/penetration-tester-master/{resources → sub-skills}/owasp_top_10_2025.md +0 -0
- /package/.agent/skills/production-code-audit/{resources → sub-skills}/solid_principles_cheat_sheet.md +0 -0
- /package/.agent/skills/seo-expert-kit/{resources → sub-skills}/technical_seo_checklist.md +0 -0
- /package/.agent/skills/tdd-master-workflow/{resources → sub-skills}/unit_test_naming_convention.md +0 -0
- /package/.agent/{.shared → skills}/ui-ux-pro-max/data/charts.csv +0 -0
- /package/.agent/{.shared → skills}/ui-ux-pro-max/data/prompts.csv +0 -0
- /package/.agent/{.shared → skills}/ui-ux-pro-max/data/styles.csv +0 -0
- /package/.agent/{.shared → skills}/ui-ux-pro-max/data/typography.csv +0 -0
- /package/.agent/{.shared → skills}/ui-ux-pro-max/data/ui-reasoning.csv +0 -0
package/cli/create.js
CHANGED
|
@@ -4,36 +4,49 @@
|
|
|
4
4
|
|
|
5
5
|
const fs = require('fs-extra');
|
|
6
6
|
const path = require('path');
|
|
7
|
+
const os = require('os');
|
|
7
8
|
const chalk = require('chalk');
|
|
8
9
|
const ora = require('ora');
|
|
9
10
|
const { execSync } = require('child_process');
|
|
10
|
-
const { getProjectConfig,
|
|
11
|
-
const MANIFEST = require('./manifest');
|
|
11
|
+
const { getProjectConfig, confirmOverwrite } = require('./prompts');
|
|
12
12
|
const gradient = require('gradient-string');
|
|
13
|
+
const { getRulesList, getAgentsList } = require('./logic/manifest-manager');
|
|
14
|
+
const { getScaleConfig } = require('./logic/scale-rules');
|
|
15
|
+
const { repairProject } = require('./repair');
|
|
16
|
+
const { generateGeminiMd } = require('./logic/gemini-generator');
|
|
17
|
+
const { getSkillsForCategories } = require('./logic/skill-definitions');
|
|
13
18
|
|
|
14
|
-
async function createProject(projectName, options) {
|
|
19
|
+
async function createProject(projectName, options, predefinedConfig = null) {
|
|
15
20
|
try {
|
|
16
21
|
// Determine target directory
|
|
17
22
|
const isCurrentDir = !projectName || projectName === '.';
|
|
23
|
+
const targetPath = isCurrentDir ? process.cwd() : path.resolve(process.cwd(), projectName);
|
|
18
24
|
const targetName = isCurrentDir ? path.basename(process.cwd()) : projectName;
|
|
19
25
|
|
|
20
|
-
// Get configuration (
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
// Get configuration (early for context)
|
|
27
|
+
const config = predefinedConfig || await getProjectConfig(options.skipPrompts, targetName);
|
|
28
|
+
config.projectName = targetName;
|
|
29
|
+
config.force = options.force;
|
|
30
|
+
config.skipPrompts = options.skipPrompts;
|
|
23
31
|
|
|
24
|
-
//
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
// --- SMART ENTRY: REPAIR OR CREATE ---
|
|
33
|
+
if (fs.existsSync(path.join(targetPath, '.agent'))) {
|
|
34
|
+
// It's an existing project!
|
|
35
|
+
return await repairProject(targetPath, options, config);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const projectPath = targetPath;
|
|
39
|
+
const finalProjectName = targetName;
|
|
27
40
|
|
|
28
|
-
// Check if directory exists (
|
|
29
|
-
if (!isCurrentDir && fs.existsSync(projectPath)) {
|
|
30
|
-
|
|
31
|
-
|
|
41
|
+
// Check if directory exists (but no .agent)
|
|
42
|
+
if (!isCurrentDir && fs.existsSync(projectPath) && fs.readdirSync(projectPath).length > 0) {
|
|
43
|
+
// Folder exists but it's not an Antigravity project - might be a normal repo
|
|
44
|
+
// We'll proceed but it will act like an 'init'
|
|
32
45
|
}
|
|
33
46
|
|
|
34
47
|
console.log('\n');
|
|
35
48
|
console.log(gradient.cristal('━'.repeat(60)));
|
|
36
|
-
console.log(chalk.bold('
|
|
49
|
+
console.log(chalk.bold(' 🛸 Antigravity IDE: Easy Vibe, Lazy Code'));
|
|
37
50
|
console.log(gradient.cristal('━'.repeat(60)));
|
|
38
51
|
console.log('');
|
|
39
52
|
|
|
@@ -41,35 +54,135 @@ async function createProject(projectName, options) {
|
|
|
41
54
|
const spinner = ora('Creating project structure...').start();
|
|
42
55
|
fs.mkdirSync(projectPath, { recursive: true });
|
|
43
56
|
|
|
44
|
-
//
|
|
45
|
-
|
|
46
|
-
|
|
57
|
+
// --- MODULAR INSTALLATION START ---
|
|
58
|
+
|
|
59
|
+
// 1. Resolve Rules & Agents based on Scale + Product
|
|
60
|
+
const rulesToInstall = getRulesList(config.rules, config.productType);
|
|
61
|
+
|
|
62
|
+
// We need list of ALL available agents to handle wildcards
|
|
63
|
+
const agentsDir = path.join(__dirname, '..', '.agent', 'agents');
|
|
64
|
+
const allAgents = fs.existsSync(agentsDir) ? fs.readdirSync(agentsDir) : [];
|
|
65
|
+
const rawAgentsToInstall = getAgentsList(config.rules, config.productType, allAgents);
|
|
66
|
+
const agentsToInstall = [...new Set(rawAgentsToInstall)];
|
|
67
|
+
|
|
68
|
+
// 2. Copy Base Structure + Selective Rules/Agents
|
|
69
|
+
await copyModularStructure(projectPath, config, rulesToInstall, agentsToInstall);
|
|
70
|
+
|
|
71
|
+
// 2b. Global Sync (Dual-Scope Strategy)
|
|
72
|
+
await ensureGlobalSync(config, rulesToInstall, agentsToInstall);
|
|
73
|
+
|
|
74
|
+
spinner.succeed('Project structure created (Modular Mode)');
|
|
75
|
+
|
|
76
|
+
// --- MODULAR INSTALLATION END ---
|
|
77
|
+
|
|
78
|
+
// --- INTELLIGENT RESOURCE BALANCING START ---
|
|
79
|
+
// Ensuring logical balance between Agents, Skills, and Workflows based on Scale
|
|
80
|
+
|
|
81
|
+
let finalSkillCategories = config.skillCategories || [];
|
|
82
|
+
let finalWorkflows = config.workflows || [];
|
|
83
|
+
|
|
84
|
+
// If explicitly empty or missing, derive from Scale Rules
|
|
85
|
+
// This ensures automated runs (CI/Test) get balanced resources seamlessly
|
|
86
|
+
if (finalSkillCategories.length === 0 || finalWorkflows.length === 0 || config.rules === 'creative') {
|
|
87
|
+
const scaleConfig = getScaleConfig(config.rules || 'creative'); // Default to creative if rule missing
|
|
88
|
+
|
|
89
|
+
// For Creative mode, we FORCE full set to ensure nothing is stripped
|
|
90
|
+
if (config.rules === 'creative') {
|
|
91
|
+
finalSkillCategories = scaleConfig.coreSkillCategories;
|
|
92
|
+
finalWorkflows = scaleConfig.baseWorkflows;
|
|
93
|
+
} else {
|
|
94
|
+
if (finalSkillCategories.length === 0) {
|
|
95
|
+
finalSkillCategories = scaleConfig.coreSkillCategories;
|
|
96
|
+
spinner.info(chalk.dim(`Auto-balanced Skills for ${config.rules}: ${finalSkillCategories.join(', ')}`));
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (finalWorkflows.length === 0) {
|
|
100
|
+
finalWorkflows = scaleConfig.baseWorkflows;
|
|
101
|
+
spinner.info(chalk.dim(`Auto-balanced Workflows for ${config.rules}: ${finalWorkflows.join(', ')}`));
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// --- INTELLIGENT RESOURCE BALANCING END ---
|
|
47
106
|
|
|
48
107
|
// Copy selected skills
|
|
49
|
-
|
|
108
|
+
let skillCount = 0;
|
|
109
|
+
if (finalSkillCategories.length > 0) {
|
|
50
110
|
spinner.start('Installing selected skills...');
|
|
51
|
-
await copySkills(projectPath,
|
|
52
|
-
spinner.succeed(`Installed ${
|
|
111
|
+
skillCount = await copySkills(projectPath, finalSkillCategories, config.engineMode);
|
|
112
|
+
spinner.succeed(`Installed ${skillCount} skills across ${finalSkillCategories.length} categories`);
|
|
53
113
|
}
|
|
54
114
|
|
|
115
|
+
// Copy workflows
|
|
116
|
+
// Copy workflows
|
|
117
|
+
let workflowCount = 0;
|
|
118
|
+
const workflowsSourceDir = path.join(__dirname, '..', '.agent', 'workflows');
|
|
119
|
+
const workflowsDestDir = path.join(projectPath, '.agent', 'workflows');
|
|
55
120
|
|
|
56
|
-
|
|
57
|
-
// Generate configuration files
|
|
58
|
-
spinner.start('Generating configuration files...');
|
|
59
|
-
await generateConfigs(projectPath, config);
|
|
60
|
-
spinner.succeed('Configuration files created');
|
|
61
|
-
|
|
62
|
-
// Initialize git
|
|
63
|
-
spinner.start('Initializing git repository...');
|
|
64
121
|
try {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
122
|
+
if (config.rules === 'creative' && fs.existsSync(workflowsSourceDir)) {
|
|
123
|
+
// FORCE FULL COPY for Creative Mode (Robustness)
|
|
124
|
+
spinner.start('Installing ALL workflows (Creative Mode)...');
|
|
125
|
+
await fs.copy(workflowsSourceDir, workflowsDestDir, { overwrite: true });
|
|
126
|
+
// Count files
|
|
127
|
+
workflowCount = fs.readdirSync(workflowsDestDir).filter(f => f.endsWith('.md')).length;
|
|
128
|
+
spinner.succeed(`Installed ${workflowCount} workflows (Full Suite)`);
|
|
129
|
+
} else if (finalWorkflows.length > 0) {
|
|
130
|
+
// Selective Installation
|
|
131
|
+
spinner.start(`Setting up ${finalWorkflows.length} specific workflows...`);
|
|
132
|
+
workflowCount = await copyWorkflows(projectPath, finalWorkflows);
|
|
133
|
+
spinner.succeed(`Configured ${workflowCount} workflows`);
|
|
134
|
+
} else {
|
|
135
|
+
// Fallback / Warning
|
|
136
|
+
spinner.warn('No workflows configured or found.');
|
|
137
|
+
}
|
|
138
|
+
} catch (err) {
|
|
139
|
+
spinner.warn(`Workflow installation warning: ${err.message}`);
|
|
69
140
|
}
|
|
70
141
|
|
|
142
|
+
// ... existing code ...
|
|
143
|
+
|
|
71
144
|
// Print success message
|
|
72
|
-
|
|
145
|
+
const sharedDir = path.join(__dirname, '..', '.agent', '.shared');
|
|
146
|
+
let sharedCount = 0;
|
|
147
|
+
if (fs.existsSync(sharedDir)) {
|
|
148
|
+
['core', 'technical', 'verticals'].forEach(dir => {
|
|
149
|
+
const subDir = path.join(sharedDir, dir);
|
|
150
|
+
if (fs.existsSync(subDir)) {
|
|
151
|
+
sharedCount += fs.readdirSync(subDir).filter(f => fs.lstatSync(path.join(subDir, f)).isDirectory()).length;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Create GEMINI.md
|
|
157
|
+
// generateGeminiMd(rules, language, industry, agentName)
|
|
158
|
+
// Create GEMINI.md
|
|
159
|
+
// generateGeminiMd(rules, language, industry, agentName)
|
|
160
|
+
// Check if modular structure already handled it?
|
|
161
|
+
// Actually, copyModularStructure already wrote it to Root in our previous edit to Step 5.
|
|
162
|
+
// But copyModularStructure is only called if we are in Modular mode.
|
|
163
|
+
// Let's ensure strict single source.
|
|
164
|
+
|
|
165
|
+
// If copyModularStructure ran, GEMINI.md is already there.
|
|
166
|
+
// We should check if it exists before overwriting, OR rely on the fact that modular structure is the main path.
|
|
167
|
+
|
|
168
|
+
// Let's keep this block for safety in case copyModularStructure didn't run (unlikely in current flow)
|
|
169
|
+
// But strictly, we removed the duplicate logic.
|
|
170
|
+
// To be safe: If GEMINI.md exists at root, don't re-write it here unless FORCE.
|
|
171
|
+
// Actually, the previous block (Step 5 in copyModularStructure) is INSIDE copyModularStructure.
|
|
172
|
+
// The block here is at the end of createProject.
|
|
173
|
+
|
|
174
|
+
// If we moved the root write to copyModularStructure (Step 5), then this block is DUPLICATE.
|
|
175
|
+
// Let's remove this block to avoid double-logging.
|
|
176
|
+
// Redundant fallback block removed
|
|
177
|
+
|
|
178
|
+
const stats = {
|
|
179
|
+
rules: rulesToInstall.length,
|
|
180
|
+
agents: agentsToInstall.length,
|
|
181
|
+
skills: skillCount,
|
|
182
|
+
workflows: workflowCount,
|
|
183
|
+
shared: sharedCount
|
|
184
|
+
};
|
|
185
|
+
printSuccessMessage(finalProjectName, config, stats);
|
|
73
186
|
|
|
74
187
|
} catch (error) {
|
|
75
188
|
console.error(chalk.red('\n❌ Error creating project:'), error.message);
|
|
@@ -78,11 +191,23 @@ async function createProject(projectName, options) {
|
|
|
78
191
|
}
|
|
79
192
|
|
|
80
193
|
// Helper to handle core file conflicts (auto-create backup if exists)
|
|
81
|
-
function handleCoreFileConflict(filePath, fileName) {
|
|
194
|
+
async function handleCoreFileConflict(filePath, fileName, force = false, skipPrompts = false) {
|
|
82
195
|
if (!fs.existsSync(filePath)) {
|
|
83
196
|
return { shouldWrite: true, targetPath: filePath };
|
|
84
197
|
}
|
|
85
198
|
|
|
199
|
+
if (force) {
|
|
200
|
+
return { shouldWrite: true, targetPath: filePath, isOverwrite: true };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Interactive Prompt (Only if prompts are allowed)
|
|
204
|
+
if (!skipPrompts) {
|
|
205
|
+
const shouldOverwrite = await confirmOverwrite(fileName);
|
|
206
|
+
if (shouldOverwrite) {
|
|
207
|
+
return { shouldWrite: true, targetPath: filePath, isOverwrite: true };
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
86
211
|
// File exists - create backup with .new extension
|
|
87
212
|
const dir = path.dirname(filePath);
|
|
88
213
|
const ext = path.extname(fileName);
|
|
@@ -94,10 +219,8 @@ function handleCoreFileConflict(filePath, fileName) {
|
|
|
94
219
|
// Helper to determine file filter based on engine mode
|
|
95
220
|
function getEngineFilter(engineMode) {
|
|
96
221
|
return (src, dest) => {
|
|
97
|
-
// If mode is 'standard' (Node.js focus), exclude Python files
|
|
98
222
|
if (engineMode === 'standard') {
|
|
99
223
|
const lowerSrc = src.toLowerCase();
|
|
100
|
-
// Exclude Python source, compiled files, and package configs
|
|
101
224
|
if (lowerSrc.endsWith('.py') ||
|
|
102
225
|
lowerSrc.endsWith('.pyc') ||
|
|
103
226
|
lowerSrc.endsWith('requirements.txt') ||
|
|
@@ -109,432 +232,107 @@ function getEngineFilter(engineMode) {
|
|
|
109
232
|
return false;
|
|
110
233
|
}
|
|
111
234
|
}
|
|
112
|
-
// 'advanced' mode (or others) includes everything
|
|
113
235
|
return true;
|
|
114
236
|
};
|
|
115
237
|
}
|
|
116
238
|
|
|
117
|
-
async function
|
|
239
|
+
async function copyModularStructure(projectPath, config, rulesList, agentsList) {
|
|
118
240
|
const sourceAgentDir = path.join(__dirname, '..', '.agent');
|
|
119
241
|
const destAgentDir = path.join(projectPath, '.agent');
|
|
120
242
|
const filter = getEngineFilter(config.engineMode);
|
|
121
|
-
|
|
122
|
-
const modeConfig = MANIFEST[operationMode];
|
|
123
|
-
|
|
243
|
+
|
|
124
244
|
// Create base .agent directory
|
|
125
245
|
fs.mkdirSync(destAgentDir, { recursive: true });
|
|
126
246
|
|
|
127
|
-
// Copy
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
await fs.copy(sourceDocsDir, destDocsDir);
|
|
247
|
+
// 1. Copy Shared Modules (Always copy .shared but maybe filter later? For now keep simple)
|
|
248
|
+
// To be strictly modular, we should only copy needed .shared. But let's copy all for safety first.
|
|
249
|
+
if (fs.existsSync(path.join(sourceAgentDir, '.shared'))) {
|
|
250
|
+
await fs.copy(path.join(sourceAgentDir, '.shared'), path.join(destAgentDir, '.shared'), { filter });
|
|
132
251
|
}
|
|
133
252
|
|
|
134
|
-
// Copy
|
|
135
|
-
const
|
|
136
|
-
for (const
|
|
137
|
-
|
|
138
|
-
const dest = path.join(destAgentDir, dir);
|
|
139
|
-
if (fs.existsSync(src)) {
|
|
140
|
-
await fs.copy(src, dest, { filter });
|
|
141
|
-
}
|
|
253
|
+
// 1b. Copy Root Concept Files (Architecture, Start Here, etc.) - FIX for v4.1.30
|
|
254
|
+
const rootFiles = fs.readdirSync(sourceAgentDir).filter(f => f.endsWith('.md') && f !== 'GEMINI.md'); // GEMINI.md is generated
|
|
255
|
+
for (const file of rootFiles) {
|
|
256
|
+
await fs.copy(path.join(sourceAgentDir, file), path.join(destAgentDir, file));
|
|
142
257
|
}
|
|
143
258
|
|
|
144
|
-
// Copy
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
const manifestKey = folder.startsWith('.') ? folder.slice(1) : folder;
|
|
153
|
-
const whitelist = modeConfig[manifestKey];
|
|
154
|
-
|
|
155
|
-
if (fs.existsSync(globalFolder)) {
|
|
156
|
-
const files = fs.readdirSync(globalFolder);
|
|
157
|
-
for (const file of files) {
|
|
158
|
-
// Suffix handling (e.g., orchestrator.eco.md)
|
|
159
|
-
const isEcoVariant = file.includes('.eco.md') || file.includes('.instant.md');
|
|
160
|
-
const isUltraVariant = file.includes('.ultra.md') || file.includes('.creative.md');
|
|
161
|
-
const isProVariant = !isEcoVariant && !isUltraVariant;
|
|
162
|
-
const isDirectory = fs.lstatSync(path.join(globalFolder, file)).isDirectory();
|
|
163
|
-
|
|
164
|
-
let targetFileName = file;
|
|
165
|
-
let shouldCopy = false;
|
|
166
|
-
|
|
167
|
-
if (whitelist === '*') {
|
|
168
|
-
// Ultra Mode: Copy everything, but prefer ultra variants
|
|
169
|
-
if (isUltraVariant) {
|
|
170
|
-
targetFileName = file.replace('.ultra.md', '.md').replace('.creative.md', '.md');
|
|
171
|
-
shouldCopy = true;
|
|
172
|
-
} else if (isProVariant) {
|
|
173
|
-
if (isDirectory) {
|
|
174
|
-
shouldCopy = true;
|
|
175
|
-
} else {
|
|
176
|
-
const ultraVariant = file.replace('.md', '.ultra.md');
|
|
177
|
-
const creativeVariant = file.replace('.md', '.creative.md');
|
|
178
|
-
if (!fs.existsSync(path.join(globalFolder, ultraVariant)) && !fs.existsSync(path.join(globalFolder, creativeVariant))) {
|
|
179
|
-
shouldCopy = true;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
} else {
|
|
184
|
-
// Eco or Pro Mode: Only copy from whitelist
|
|
185
|
-
const baseName = file.replace('.eco.md', '.md').replace('.instant.md', '.md')
|
|
186
|
-
.replace('.ultra.md', '.md').replace('.creative.md', '.md');
|
|
187
|
-
|
|
188
|
-
if (whitelist.includes(baseName)) {
|
|
189
|
-
if (operationMode === 'eco') {
|
|
190
|
-
if (isEcoVariant) {
|
|
191
|
-
targetFileName = baseName;
|
|
192
|
-
shouldCopy = true;
|
|
193
|
-
} else if (isProVariant) {
|
|
194
|
-
if (isDirectory) {
|
|
195
|
-
shouldCopy = true;
|
|
196
|
-
} else {
|
|
197
|
-
const ecoVariant = file.replace('.md', '.eco.md');
|
|
198
|
-
const instantVariant = file.replace('.md', '.instant.md');
|
|
199
|
-
if (!fs.existsSync(path.join(globalFolder, ecoVariant)) && !fs.existsSync(path.join(globalFolder, instantVariant))) {
|
|
200
|
-
shouldCopy = true;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
} else if (operationMode === 'pro') {
|
|
205
|
-
if (isProVariant) {
|
|
206
|
-
shouldCopy = true;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
if (shouldCopy) {
|
|
213
|
-
const srcPath = path.join(globalFolder, file);
|
|
214
|
-
const destPath = path.join(localFolder, targetFileName);
|
|
215
|
-
|
|
216
|
-
if (fs.lstatSync(srcPath).isDirectory()) {
|
|
217
|
-
// Recursive copy for skill directories
|
|
218
|
-
await fs.copy(srcPath, destPath, { filter });
|
|
219
|
-
} else {
|
|
220
|
-
// File copy
|
|
221
|
-
fs.copyFileSync(srcPath, destPath);
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
}
|
|
259
|
+
// 2. Copy Rules (SELECTIVE)
|
|
260
|
+
const rulesDest = path.join(destAgentDir, 'rules');
|
|
261
|
+
fs.mkdirSync(rulesDest, { recursive: true });
|
|
262
|
+
|
|
263
|
+
for (const rule of rulesList) {
|
|
264
|
+
const srcRule = path.join(sourceAgentDir, 'rules', rule);
|
|
265
|
+
if (fs.existsSync(srcRule)) {
|
|
266
|
+
await fs.copy(srcRule, path.join(rulesDest, rule));
|
|
225
267
|
}
|
|
226
268
|
}
|
|
227
269
|
|
|
228
|
-
//
|
|
270
|
+
// 3. Agents (Skipped - Single Context Optimization)
|
|
271
|
+
// const agentsDest = path.join(destAgentDir, 'agents');
|
|
272
|
+
// fs.mkdirSync(agentsDest, { recursive: true });
|
|
273
|
+
|
|
274
|
+
// 4. Ensure 'skills' and 'workflows' dir exists
|
|
229
275
|
fs.mkdirSync(path.join(destAgentDir, 'skills'), { recursive: true });
|
|
276
|
+
fs.mkdirSync(path.join(destAgentDir, 'workflows'), { recursive: true });
|
|
230
277
|
|
|
231
|
-
//
|
|
232
|
-
|
|
233
|
-
const
|
|
234
|
-
const geminiDecision = handleCoreFileConflict(geminiPath, 'GEMINI.md');
|
|
278
|
+
// 5. Create GEMINI.md (Core file) - Write ONLY to Root, not to .agent/
|
|
279
|
+
const geminiContent = generateGeminiMd(config.rules, config.language, config.industryDomain, config.agentName);
|
|
280
|
+
const geminiDecision = await handleCoreFileConflict(path.join(projectPath, 'GEMINI.md'), 'GEMINI.md', config.force, config.skipPrompts);
|
|
235
281
|
|
|
236
282
|
if (geminiDecision.shouldWrite) {
|
|
237
|
-
const geminiContent = generateGeminiMd(config.operationMode, config.language, config.industryDomain, config.agentName);
|
|
238
283
|
fs.writeFileSync(geminiDecision.targetPath, geminiContent);
|
|
239
|
-
|
|
284
|
+
if (geminiDecision.isBackup) {
|
|
285
|
+
console.log(chalk.yellow(` ℹ️ GEMINI.md exists, created ${path.basename(geminiDecision.targetPath)}`));
|
|
286
|
+
} else if (geminiDecision.isOverwrite) {
|
|
287
|
+
console.log(chalk.green(` ✓ Overwrote existing GEMINI.md`));
|
|
288
|
+
}
|
|
240
289
|
}
|
|
241
290
|
|
|
242
|
-
// 2. Create ERRORS.md (Empty template for logging)
|
|
243
|
-
const errorsPath = path.join(projectPath, 'ERRORS.md');
|
|
244
|
-
if (!fs.existsSync(errorsPath)) {
|
|
245
|
-
const errorsTemplate = `# 🐛 Error Log - ${config.projectName}\n\n> Tập hợp tất cả lỗi xảy ra trong quá trình phát triển (Auto-generated).\n\n---\n\n## Thống kê nhanh\n- **Tổng lỗi**: 0\n- **Đã sửa**: 0\n\n---\n\n<!-- Errors sẽ được agent tự động ghi vào đây -->\n`;
|
|
246
|
-
fs.writeFileSync(errorsPath, errorsTemplate);
|
|
247
|
-
console.log(chalk.green(' ✓ Created ERRORS.md'));
|
|
248
|
-
}
|
|
249
291
|
|
|
250
|
-
|
|
251
|
-
const startHereSource = path.join(sourceAgentDir, config.language === 'vi' ? 'START_HERE.vi.md' : 'START_HERE.md');
|
|
252
|
-
const startHereDest = path.join(destAgentDir, 'START_HERE.md');
|
|
292
|
+
}
|
|
253
293
|
|
|
254
|
-
if (fs.existsSync(startHereSource)) {
|
|
255
|
-
fs.copyFileSync(startHereSource, startHereDest);
|
|
256
|
-
}
|
|
257
294
|
|
|
258
|
-
// 4. Copy README based on Language selection
|
|
259
|
-
const readmeSource = path.join(__dirname, '..', config.language === 'vi' ? 'README.vi.md' : 'README.md');
|
|
260
|
-
const readmeDest = path.join(projectPath, 'README.md'); // Always name it README.md in target
|
|
261
295
|
|
|
262
|
-
if (!fs.existsSync(readmeDest) && fs.existsSync(readmeSource)) {
|
|
263
|
-
fs.copyFileSync(readmeSource, readmeDest);
|
|
264
|
-
console.log(chalk.green(` ✓ Created README.md (${config.language === 'vi' ? 'Vietnamese' : 'English'})`));
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
// 5. Copy .gitignore
|
|
268
|
-
const gitignoreSource = path.join(__dirname, '..', '.gitignore');
|
|
269
|
-
const gitignoreDest = path.join(projectPath, '.gitignore');
|
|
270
|
-
if (!fs.existsSync(gitignoreDest) && fs.existsSync(gitignoreSource)) {
|
|
271
|
-
fs.copyFileSync(gitignoreSource, gitignoreDest);
|
|
272
|
-
console.log(chalk.green(' ✓ Created .gitignore'));
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
296
|
|
|
276
297
|
async function copySkills(projectPath, categories, engineMode) {
|
|
277
298
|
const skillsSourceDir = path.join(__dirname, '..', '.agent', 'skills');
|
|
278
299
|
const skillsDestDir = path.join(projectPath, '.agent', 'skills');
|
|
279
300
|
const filter = getEngineFilter(engineMode);
|
|
280
301
|
|
|
281
|
-
|
|
282
|
-
if (!fs.existsSync(skillsSourceDir)) {
|
|
283
|
-
console.warn(chalk.yellow(`\n⚠️ Warning: Skills directory not found at ${skillsSourceDir}`));
|
|
284
|
-
console.warn(' The .agent folder might be missing from the package.');
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
302
|
+
if (!fs.existsSync(skillsSourceDir)) return 0;
|
|
287
303
|
|
|
288
304
|
const selectedSkills = getSkillsForCategories(categories);
|
|
305
|
+
const uniqueSkills = [...new Set(selectedSkills)]; // Deduplicate to avoid overwrites and double-counting
|
|
306
|
+
let count = 0;
|
|
289
307
|
|
|
290
|
-
for (const skill of
|
|
308
|
+
for (const skill of uniqueSkills) {
|
|
291
309
|
const skillPath = path.join(skillsSourceDir, skill);
|
|
292
310
|
if (fs.existsSync(skillPath)) {
|
|
293
311
|
const destPath = path.join(skillsDestDir, skill);
|
|
294
312
|
await fs.copy(skillPath, destPath, { filter });
|
|
295
|
-
|
|
296
|
-
// Optional: Warn about missing specific skills if needed
|
|
313
|
+
count++;
|
|
297
314
|
}
|
|
298
315
|
}
|
|
316
|
+
return count;
|
|
299
317
|
}
|
|
300
318
|
|
|
301
319
|
async function copyWorkflows(projectPath, workflows) {
|
|
302
320
|
const workflowsSourceDir = path.join(__dirname, '..', '.agent', 'workflows');
|
|
303
321
|
const workflowsDestDir = path.join(projectPath, '.agent', 'workflows');
|
|
322
|
+
let count = 0;
|
|
304
323
|
|
|
305
324
|
for (const workflow of workflows) {
|
|
306
325
|
const workflowFile = `${workflow}.md`;
|
|
307
326
|
const source = path.join(workflowsSourceDir, workflowFile);
|
|
308
327
|
if (fs.existsSync(source)) {
|
|
309
328
|
await fs.copy(source, path.join(workflowsDestDir, workflowFile));
|
|
329
|
+
count++;
|
|
310
330
|
}
|
|
311
331
|
}
|
|
332
|
+
return count;
|
|
312
333
|
}
|
|
313
334
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
async function generateConfigs(projectPath, config) {
|
|
317
|
-
// Generate package.json only if it doesn't exist
|
|
318
|
-
const packageJsonPath = path.join(projectPath, 'package.json');
|
|
319
|
-
|
|
320
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
321
|
-
const packageJson = {
|
|
322
|
-
name: config.projectName,
|
|
323
|
-
version: '1.0.0',
|
|
324
|
-
description: 'AI Agent project powered by Google Antigravity',
|
|
325
|
-
private: true,
|
|
326
|
-
scripts: {
|
|
327
|
-
dev: 'echo "No dev server configured"',
|
|
328
|
-
build: 'echo "No build script"'
|
|
329
|
-
},
|
|
330
|
-
keywords: ['ai', 'agent', 'google-antigravity'],
|
|
331
|
-
author: '',
|
|
332
|
-
license: 'MIT'
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
fs.writeFileSync(
|
|
336
|
-
packageJsonPath,
|
|
337
|
-
JSON.stringify(packageJson, null, 2)
|
|
338
|
-
);
|
|
339
|
-
console.log(chalk.green(' ✓ Created package.json'));
|
|
340
|
-
} else {
|
|
341
|
-
console.log(chalk.yellow(' ℹ️ Skipped package.json (already exists)'));
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
// Generate .editorconfig only if it doesn't exist
|
|
345
|
-
const editorconfigPath = path.join(projectPath, '.editorconfig');
|
|
346
|
-
if (!fs.existsSync(editorconfigPath)) {
|
|
347
|
-
const editorConfig = `root = true
|
|
348
|
-
|
|
349
|
-
[*]
|
|
350
|
-
charset = utf-8
|
|
351
|
-
end_of_line = lf
|
|
352
|
-
insert_final_newline = true
|
|
353
|
-
indent_style = space
|
|
354
|
-
indent_size = 2
|
|
355
|
-
trim_trailing_whitespace = true
|
|
356
|
-
|
|
357
|
-
[*.md]
|
|
358
|
-
trim_trailing_whitespace = false
|
|
359
|
-
`;
|
|
360
|
-
fs.writeFileSync(editorconfigPath, editorConfig);
|
|
361
|
-
console.log(chalk.green(' ✓ Created .editorconfig'));
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
// Generate .gitattributes only if it doesn't exist
|
|
365
|
-
const gitAttributesPath = path.join(projectPath, '.gitattributes');
|
|
366
|
-
if (!fs.existsSync(gitAttributesPath)) {
|
|
367
|
-
const gitAttributes = `* text=auto eol=lf
|
|
368
|
-
*.js text eol=lf
|
|
369
|
-
*.sh text eol=lf
|
|
370
|
-
bin/* text eol=lf
|
|
371
|
-
`;
|
|
372
|
-
fs.writeFileSync(gitAttributesPath, gitAttributes);
|
|
373
|
-
console.log(chalk.green(' ✓ Created .gitattributes'));
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
function generateGeminiMd(operationMode = 'standard', language = 'en', industry = 'other', agentName = 'Antigravity') {
|
|
379
|
-
const strictness = {
|
|
380
|
-
creative: {
|
|
381
|
-
autoRun: 'false',
|
|
382
|
-
confirmLevel: 'Ask before every file modification and command execution'
|
|
383
|
-
},
|
|
384
|
-
standard: {
|
|
385
|
-
autoRun: 'true for safe read operations',
|
|
386
|
-
confirmLevel: 'Ask before destructive operations'
|
|
387
|
-
},
|
|
388
|
-
instant: {
|
|
389
|
-
autoRun: 'true',
|
|
390
|
-
confirmLevel: 'Minimal confirmation, high autonomy (MVP Mode)'
|
|
391
|
-
}
|
|
392
|
-
};
|
|
393
|
-
|
|
394
|
-
const config = strictness[operationMode] || strictness.standard;
|
|
395
|
-
const isVi = language === 'vi';
|
|
396
|
-
|
|
397
|
-
// Define Industry Focus strings
|
|
398
|
-
const industryMap = {
|
|
399
|
-
finance: isVi ? 'Tài chính & Fintech (An toàn, Chính xác)' : 'Finance & Fintech (Security, Precision)',
|
|
400
|
-
education: isVi ? 'Giáo dục & EdTech (Trực quan, Giải thích)' : 'Education & EdTech (Intuitive, Explanatory)',
|
|
401
|
-
fnb: isVi ? 'F&B & Nhà hàng (Tốc độ, Tiện lợi)' : 'F&B & Restaurant (Speed, Convenience)',
|
|
402
|
-
personal: isVi ? 'Cá nhân & Portfolio (Sáng tạo, Cá nhân hóa)' : 'Personal & Portfolio (Creative, Personalized)',
|
|
403
|
-
healthcare: isVi ? 'Y tế & Sức khỏe (Bảo mật, Tin cậy)' : 'Healthcare & HealthTech (Privacy, Reliability)',
|
|
404
|
-
logistics: isVi ? 'Vận tải & Logistics (Hiệu quả, Real-time)' : 'Logistics & Supply Chain (Efficiency, Real-time)',
|
|
405
|
-
other: isVi ? 'Phát triển chung' : 'General Development'
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
const industryFocus = industryMap[industry] || industryMap.other;
|
|
409
|
-
|
|
410
|
-
const contentEn = `---
|
|
411
|
-
trigger: always_on
|
|
412
|
-
---
|
|
413
|
-
|
|
414
|
-
# GEMINI.md - Agent Configuration
|
|
415
|
-
|
|
416
|
-
This file controls the behavior of your AI Agent.
|
|
417
|
-
|
|
418
|
-
## 🤖 Agent Identity: ${agentName}
|
|
419
|
-
> **Identity Verification**: You are ${agentName}. Always reflect this identity in your tone and decision-making. **Special Protocol**: If called by name, you MUST perform a "Context Integrity Check" to verify alignment with .agent rules, confirm your status, and then wait for instructions.
|
|
420
|
-
|
|
421
|
-
## 🎯 Primary Focus: ${industryFocus.toUpperCase()}
|
|
422
|
-
> **Priority**: Optimize all solutions for this domain.
|
|
423
|
-
|
|
424
|
-
## Agent Behavior Rules: ${operationMode.toUpperCase()}
|
|
425
|
-
|
|
426
|
-
**Auto-run Commands**: ${config.autoRun}
|
|
427
|
-
**Confirmation Level**: ${config.confirmLevel}
|
|
428
|
-
|
|
429
|
-
## 🌐 Language Protocol
|
|
430
|
-
|
|
431
|
-
1. **Communication**: Use **ENGLISH**.
|
|
432
|
-
2. **Artifacts**: Write content in **ENGLISH**.
|
|
433
|
-
3. **Code**: Use **ENGLISH** for all variables, functions, and comments.
|
|
434
|
-
|
|
435
|
-
## Core Capabilities
|
|
436
|
-
|
|
437
|
-
Your agent has access to **ALL** skills (Web, Mobile, DevOps, AI, Security).
|
|
438
|
-
Please utilize the appropriate skills for **${industryFocus}**.
|
|
439
|
-
|
|
440
|
-
- File operations (read, write, search)
|
|
441
|
-
- Terminal commands
|
|
442
|
-
- Web browsing
|
|
443
|
-
- Code analysis and refactoring
|
|
444
|
-
- Testing and debugging
|
|
445
|
-
|
|
446
|
-
## 📚 Shared Standards (Auto-Active)
|
|
447
|
-
The following **13 Shared Modules** in \`.agent/.shared\` must be respected:
|
|
448
|
-
1. **AI Master**: LLM patterns & RAG.
|
|
449
|
-
2. **API Standards**: OpenAPI & REST guidelines.
|
|
450
|
-
3. **Compliance**: GDPR/HIPAA protocols.
|
|
451
|
-
4. **Database Master**: Schema & Migration rules.
|
|
452
|
-
5. **Design System**: UI/UX patterns & tokens.
|
|
453
|
-
6. **Domain Blueprints**: Industry-specific architectures.
|
|
454
|
-
7. **I18n Master**: Localization standards.
|
|
455
|
-
8. **Infra Blueprints**: Terraform/Docker setups.
|
|
456
|
-
9. **Metrics**: Observability & Telemetry.
|
|
457
|
-
10. **Security Armor**: Hardening & Auditing.
|
|
458
|
-
11. **Testing Master**: TDD & E2E strategies.
|
|
459
|
-
12. **UI/UX Pro Max**: Advanced interactions.
|
|
460
|
-
13. **Vitals Templates**: Performance benchmarks.
|
|
461
|
-
|
|
462
|
-
## Custom Instructions
|
|
463
|
-
|
|
464
|
-
Add your project-specific instructions here.
|
|
465
|
-
|
|
466
|
-
---
|
|
467
|
-
*Generated by Google Antigravity*
|
|
468
|
-
`;
|
|
469
|
-
|
|
470
|
-
const contentVi = `---
|
|
471
|
-
trigger: always_on
|
|
472
|
-
---
|
|
473
|
-
|
|
474
|
-
# GEMINI.md - Cấu hình Agent
|
|
475
|
-
# NOTE FOR AGENT: The content below is for human reference.
|
|
476
|
-
# PLEASE PARSE INSTRUCTIONS IN ENGLISH ONLY (See .agent rules).
|
|
477
|
-
|
|
478
|
-
Tệp này kiểm soát hành vi của AI Agent.
|
|
479
|
-
|
|
480
|
-
## 🤖 Danh tính Agent: ${agentName}
|
|
481
|
-
> **Xác minh danh tính**: Bạn là ${agentName}. Luôn thể hiện danh tính này trong phong thái và cách ra quyết định. **Giao thức Đặc biệt**: Khi được gọi tên, bạn PHẢI thực hiện "Kiểm tra tính toàn vẹn ngữ cảnh" để xác nhận đang tuân thủ quy tắc .agent, báo cáo trạng thái và sẵn sàng đợi chỉ thị.
|
|
482
|
-
|
|
483
|
-
## 🎯 Trọng tâm Chính: ${industryFocus.toUpperCase()}
|
|
484
|
-
> **Ưu tiên**: Tối ưu hóa mọi giải pháp cho lĩnh vực này.
|
|
485
|
-
|
|
486
|
-
## Quy tắc hành vi: ${operationMode.toUpperCase()}
|
|
487
|
-
|
|
488
|
-
**Tự động chạy lệnh**: ${config.autoRun}
|
|
489
|
-
**Mức độ xác nhận**: ${config.confirmLevel === 'Minimal confirmation, high autonomy' ? 'Tối thiểu, tự chủ cao' : 'Hỏi trước các tác vụ quan trọng'}
|
|
490
|
-
|
|
491
|
-
## 🌐 Giao thức Ngôn ngữ (Language Protocol)
|
|
492
|
-
|
|
493
|
-
1. **Giao tiếp & Suy luận**: Sử dụng **TIẾNG VIỆT** (Bắt buộc).
|
|
494
|
-
2. **Tài liệu (Artifacts)**: Viết nội dung file .md (Plan, Task, Walkthrough) bằng **TIẾNG VIỆT**.
|
|
495
|
-
3. **Mã nguồn (Code)**:
|
|
496
|
-
- Tên biến, hàm, file: **TIẾNG ANH** (camelCase, snake_case...).
|
|
497
|
-
- Comment trong code: **TIẾNG ANH** (để chuẩn hóa).
|
|
498
|
-
|
|
499
|
-
## Khả năng cốt lõi
|
|
500
|
-
|
|
501
|
-
Agent có quyền truy cập **TOÀN BỘ** kỹ năng (Web, Mobile, DevOps, AI, Security).
|
|
502
|
-
Vui lòng sử dụng các kỹ năng phù hợp nhất cho **${industryFocus}**.
|
|
503
|
-
|
|
504
|
-
- Thao tác tệp (đọc, ghi, tìm kiếm)
|
|
505
|
-
- Lệnh terminal
|
|
506
|
-
- Duyệt web
|
|
507
|
-
- Phân tích và refactor code
|
|
508
|
-
- Kiểm thử và gỡ lỗi
|
|
509
|
-
|
|
510
|
-
## 📚 Tiêu chuẩn Dùng chung (Tự động Kích hoạt)
|
|
511
|
-
**13 Module Chia sẻ** sau trong \`.agent/.shared\` phải được tuân thủ:
|
|
512
|
-
1. **AI Master**: Mô hình LLM & RAG.
|
|
513
|
-
2. **API Standards**: Chuẩn OpenAPI & REST.
|
|
514
|
-
3. **Compliance**: Giao thức GDPR/HIPAA.
|
|
515
|
-
4. **Database Master**: Quy tắc Schema & Migration.
|
|
516
|
-
5. **Design System**: Pattern UI/UX & Tokens.
|
|
517
|
-
6. **Domain Blueprints**: Kiến trúc theo lĩnh vực.
|
|
518
|
-
7. **I18n Master**: Tiêu chuẩn Đa ngôn ngữ.
|
|
519
|
-
8. **Infra Blueprints**: Cấu hình Terraform/Docker.
|
|
520
|
-
9. **Metrics**: Giám sát & Telemetry.
|
|
521
|
-
10. **Security Armor**: Bảo mật & Audit.
|
|
522
|
-
11. **Testing Master**: Chiến lược TDD & E2E.
|
|
523
|
-
12. **UI/UX Pro Max**: Tương tác nâng cao.
|
|
524
|
-
13. **Vitals Templates**: Tiêu chuẩn Hiệu năng.
|
|
525
|
-
|
|
526
|
-
## Hướng dẫn tùy chỉnh
|
|
527
|
-
|
|
528
|
-
Thêm các hướng dẫn cụ thể cho dự án của bạn tại đây.
|
|
529
|
-
|
|
530
|
-
---
|
|
531
|
-
*Được tạo bởi Google Antigravity*
|
|
532
|
-
`;
|
|
533
|
-
|
|
534
|
-
return isVi ? contentVi : contentEn;
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
function printSuccessMessage(projectName, config) {
|
|
335
|
+
function printSuccessMessage(projectName, config, stats = null) {
|
|
538
336
|
console.log('\n');
|
|
539
337
|
console.log(gradient.rainbow('━'.repeat(60)));
|
|
540
338
|
console.log(gradient.morning.multiline(' ✓ SUCCESS! Project Ready'));
|
|
@@ -545,9 +343,9 @@ function printSuccessMessage(projectName, config) {
|
|
|
545
343
|
console.log(chalk.bold('📋 Config'));
|
|
546
344
|
console.log(chalk.gray(' Project: ') + gradient.cristal(projectName));
|
|
547
345
|
console.log(chalk.gray(' Template: ') + chalk.cyan(config.template));
|
|
548
|
-
console.log(chalk.gray('
|
|
346
|
+
console.log(chalk.gray(' Scale: ') + chalk.cyan((config.rules || 'N/A').toUpperCase()));
|
|
549
347
|
|
|
550
|
-
// AI Activation Instructions
|
|
348
|
+
// AI Activation Instructions
|
|
551
349
|
console.log('');
|
|
552
350
|
console.log(gradient.pastel('━'.repeat(60)));
|
|
553
351
|
console.log(chalk.bold.cyan(config.language === 'vi' ? '🤖 Kích hoạt AI Agent' : '🤖 AI Agent Activation'));
|
|
@@ -565,9 +363,21 @@ function printSuccessMessage(projectName, config) {
|
|
|
565
363
|
console.log(chalk.gray(' 3. Activate: ') + chalk.green(`Type: "wake up ${agentName}"`));
|
|
566
364
|
}
|
|
567
365
|
|
|
568
|
-
// Stats Display
|
|
569
|
-
|
|
570
|
-
|
|
366
|
+
// Dynamic Stats Display
|
|
367
|
+
if (stats) {
|
|
368
|
+
console.log('');
|
|
369
|
+
const statLine = [
|
|
370
|
+
chalk.white(`${stats.rules} Rules`),
|
|
371
|
+
chalk.white(`${stats.skills} Skills`),
|
|
372
|
+
chalk.white(`${stats.workflows} Workflows`),
|
|
373
|
+
chalk.white(`${stats.shared} Core Modules`)
|
|
374
|
+
].join(chalk.gray(' • '));
|
|
375
|
+
console.log(gradient.pastel(' ✨ Installed: ') + statLine);
|
|
376
|
+
} else {
|
|
377
|
+
// Fallback for non-modular runs
|
|
378
|
+
console.log('');
|
|
379
|
+
console.log(gradient.pastel(' ✨ Installed: ') + chalk.white('Adaptive Rules') + chalk.gray(' • ') + chalk.white('Shared Core'));
|
|
380
|
+
}
|
|
571
381
|
|
|
572
382
|
console.log('');
|
|
573
383
|
console.log(chalk.dim(config.language === 'vi' ? ' AI sẽ tự động tải các kỹ năng và quy tắc.' : ' The AI will load all skills and rules automatically.'));
|
|
@@ -577,10 +387,62 @@ function printSuccessMessage(projectName, config) {
|
|
|
577
387
|
console.log('');
|
|
578
388
|
}
|
|
579
389
|
|
|
390
|
+
// Helper: Ensure Global Sync (~/.antigravity)
|
|
391
|
+
async function ensureGlobalSync(config, rulesList, agentsList) {
|
|
392
|
+
try {
|
|
393
|
+
const globalDir = path.join(os.homedir(), '.antigravity');
|
|
394
|
+
const sourceAgentDir = path.join(__dirname, '..', '.agent');
|
|
395
|
+
const filter = getEngineFilter(config.engineMode);
|
|
396
|
+
|
|
397
|
+
// Ensure global dir exists
|
|
398
|
+
fs.ensureDirSync(globalDir);
|
|
399
|
+
|
|
400
|
+
// 1. Copy Shared
|
|
401
|
+
if (fs.existsSync(path.join(sourceAgentDir, '.shared'))) {
|
|
402
|
+
await fs.copy(path.join(sourceAgentDir, '.shared'), path.join(globalDir, '.shared'), {
|
|
403
|
+
overwrite: false,
|
|
404
|
+
filter
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// 2. Copy Rules
|
|
409
|
+
const rulesDest = path.join(globalDir, 'rules');
|
|
410
|
+
fs.ensureDirSync(rulesDest);
|
|
411
|
+
for (const rule of rulesList) {
|
|
412
|
+
const src = path.join(sourceAgentDir, 'rules', rule);
|
|
413
|
+
if (fs.existsSync(src)) {
|
|
414
|
+
await fs.copy(src, path.join(rulesDest, rule), { overwrite: false });
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// 3. Agents (Skipped - Single Context Optimization)
|
|
419
|
+
// const agentsDest = path.join(globalDir, 'agents');
|
|
420
|
+
|
|
421
|
+
// 4. Copy Skills (All standard skills)
|
|
422
|
+
const skillsSource = path.join(sourceAgentDir, 'skills');
|
|
423
|
+
const skillsDest = path.join(globalDir, 'skills');
|
|
424
|
+
if (fs.existsSync(skillsSource)) {
|
|
425
|
+
// We copy ALL skills to global to ensure the full arsenal is available
|
|
426
|
+
await fs.copy(skillsSource, skillsDest, {
|
|
427
|
+
overwrite: false,
|
|
428
|
+
filter
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// 5. Copy Workflows
|
|
433
|
+
const workflowsSource = path.join(sourceAgentDir, 'workflows');
|
|
434
|
+
const workflowsDest = path.join(globalDir, 'workflows');
|
|
435
|
+
if (fs.existsSync(workflowsSource)) {
|
|
436
|
+
await fs.copy(workflowsSource, workflowsDest, { overwrite: false });
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
} catch (e) {
|
|
440
|
+
// Silent fail for global sync is acceptable to avoid breaking project flow
|
|
441
|
+
// console.error('Global sync warning:', e.message);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
580
445
|
module.exports = {
|
|
581
446
|
createProject,
|
|
582
|
-
generateGeminiMd
|
|
583
|
-
copyBaseStructure,
|
|
584
|
-
copySkills,
|
|
585
|
-
copyWorkflows
|
|
447
|
+
generateGeminiMd
|
|
586
448
|
};
|