@trieungoctam/vibekit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/agents/debugger.md +158 -0
- package/agents/docs-manager.md +220 -0
- package/agents/planner.md +129 -0
- package/agents/researcher.md +58 -0
- package/agents/reviewer.md +152 -0
- package/agents/tester.md +126 -0
- package/bin/vibekit.js +18 -0
- package/hooks/lib/ck-config-utils.cjs +831 -0
- package/hooks/lib/colors.cjs +95 -0
- package/hooks/lib/config-counter.cjs +103 -0
- package/hooks/lib/context-builder.cjs +616 -0
- package/hooks/lib/git-info-cache.cjs +143 -0
- package/hooks/lib/hook-logger.cjs +92 -0
- package/hooks/lib/privacy-checker.cjs +297 -0
- package/hooks/lib/project-detector.cjs +474 -0
- package/hooks/lib/scout-checker.cjs +263 -0
- package/hooks/lib/transcript-parser.cjs +181 -0
- package/hooks/post-edit-simplify-reminder.cjs +156 -0
- package/hooks/privacy-block.cjs +166 -0
- package/hooks/scout-block.cjs +147 -0
- package/hooks/session-init.cjs +360 -0
- package/package.json +41 -0
- package/rules/development-rules.md +52 -0
- package/rules/documentation-management.md +121 -0
- package/rules/orchestration-protocol.md +43 -0
- package/rules/primary-workflow.md +57 -0
- package/rules/team-coordination-rules.md +90 -0
- package/skills/ai/agent-browser/SKILL.md +294 -0
- package/skills/ai/agent-browser/references/.gitkeep +0 -0
- package/skills/ai/agent-browser/references/agent-browser-vs-chrome-devtools.md +112 -0
- package/skills/ai/agent-browser/references/browserbase-cloud-setup.md +161 -0
- package/skills/ai/ai-artist/SKILL.md +122 -0
- package/skills/ai/ai-artist/data/awesome-prompts.csv +3592 -0
- package/skills/ai/ai-artist/data/lighting.csv +19 -0
- package/skills/ai/ai-artist/data/nano-banana-templates.csv +17 -0
- package/skills/ai/ai-artist/data/platforms.csv +11 -0
- package/skills/ai/ai-artist/data/styles.csv +26 -0
- package/skills/ai/ai-artist/data/techniques.csv +19 -0
- package/skills/ai/ai-artist/data/use-cases.csv +16 -0
- package/skills/ai/ai-artist/references/advanced-techniques.md +184 -0
- package/skills/ai/ai-artist/references/awesome-nano-banana-pro-prompts.md +8575 -0
- package/skills/ai/ai-artist/references/domain-code.md +66 -0
- package/skills/ai/ai-artist/references/domain-data.md +72 -0
- package/skills/ai/ai-artist/references/domain-marketing.md +66 -0
- package/skills/ai/ai-artist/references/domain-patterns.md +33 -0
- package/skills/ai/ai-artist/references/domain-writing.md +68 -0
- package/skills/ai/ai-artist/references/image-prompting.md +141 -0
- package/skills/ai/ai-artist/references/llm-prompting.md +165 -0
- package/skills/ai/ai-artist/references/nano-banana.md +136 -0
- package/skills/ai/ai-artist/references/reasoning-techniques.md +201 -0
- package/skills/ai/ai-artist/references/validation-workflow.md +117 -0
- package/skills/ai/ai-artist/scripts/core.py +197 -0
- package/skills/ai/ai-artist/scripts/extract_prompts.py +102 -0
- package/skills/ai/ai-artist/scripts/generate.py +370 -0
- package/skills/ai/ai-artist/scripts/search.py +147 -0
- package/skills/ai/ai-multimodal/.env.example +204 -0
- package/skills/ai/ai-multimodal/SKILL.md +110 -0
- package/skills/ai/ai-multimodal/references/audio-processing.md +387 -0
- package/skills/ai/ai-multimodal/references/image-generation.md +939 -0
- package/skills/ai/ai-multimodal/references/music-generation.md +311 -0
- package/skills/ai/ai-multimodal/references/video-analysis.md +515 -0
- package/skills/ai/ai-multimodal/references/video-generation.md +457 -0
- package/skills/ai/ai-multimodal/references/vision-understanding.md +492 -0
- package/skills/ai/ai-multimodal/scripts/.coverage +0 -0
- package/skills/ai/ai-multimodal/scripts/check_setup.py +315 -0
- package/skills/ai/ai-multimodal/scripts/document_converter.py +395 -0
- package/skills/ai/ai-multimodal/scripts/gemini_batch_process.py +1185 -0
- package/skills/ai/ai-multimodal/scripts/media_optimizer.py +506 -0
- package/skills/ai/ai-multimodal/scripts/requirements.txt +26 -0
- package/skills/ai/ai-multimodal/scripts/tests/.coverage +0 -0
- package/skills/ai/ai-multimodal/scripts/tests/requirements.txt +20 -0
- package/skills/ai/ai-multimodal/scripts/tests/test_document_converter.py +74 -0
- package/skills/ai/ai-multimodal/scripts/tests/test_gemini_batch_process.py +362 -0
- package/skills/ai/ai-multimodal/scripts/tests/test_media_optimizer.py +373 -0
- package/skills/ai/mcp-management/README.md +219 -0
- package/skills/ai/mcp-management/SKILL.md +210 -0
- package/skills/ai/mcp-management/assets/tools.json +3146 -0
- package/skills/ai/mcp-management/references/configuration.md +114 -0
- package/skills/ai/mcp-management/references/gemini-cli-integration.md +221 -0
- package/skills/ai/mcp-management/references/mcp-protocol.md +116 -0
- package/skills/ai/mcp-management/scripts/.env.example +10 -0
- package/skills/ai/mcp-management/scripts/cli.ts +195 -0
- package/skills/ai/mcp-management/scripts/dist/analyze-tools.js +70 -0
- package/skills/ai/mcp-management/scripts/dist/cli.js +160 -0
- package/skills/ai/mcp-management/scripts/dist/mcp-client.js +183 -0
- package/skills/ai/mcp-management/scripts/mcp-client.ts +230 -0
- package/skills/ai/mcp-management/scripts/package.json +20 -0
- package/skills/ai/mcp-management/scripts/tsconfig.json +15 -0
- package/skills/core/brainstorm/SKILL.md +164 -0
- package/skills/core/brainstorm/scripts/frame-template.html +214 -0
- package/skills/core/brainstorm/scripts/helper.js +88 -0
- package/skills/core/brainstorm/scripts/server.cjs +338 -0
- package/skills/core/brainstorm/scripts/start-server.sh +153 -0
- package/skills/core/brainstorm/scripts/stop-server.sh +55 -0
- package/skills/core/brainstorm/spec-document-reviewer-prompt.md +49 -0
- package/skills/core/brainstorm/visual-companion.md +286 -0
- package/skills/core/code-review/SKILL.md +147 -0
- package/skills/core/code-review/references/code-review-reception.md +113 -0
- package/skills/core/code-review/references/codebase-scan-workflow.md +29 -0
- package/skills/core/code-review/references/edge-case-scouting.md +119 -0
- package/skills/core/code-review/references/parallel-review-workflow.md +69 -0
- package/skills/core/code-review/references/requesting-code-review.md +116 -0
- package/skills/core/code-review/references/task-management-reviews.md +140 -0
- package/skills/core/code-review/references/verification-before-completion.md +139 -0
- package/skills/core/cook/README.md +86 -0
- package/skills/core/cook/SKILL.md +113 -0
- package/skills/core/cook/references/intent-detection.md +101 -0
- package/skills/core/cook/references/review-cycle.md +75 -0
- package/skills/core/cook/references/subagent-patterns.md +75 -0
- package/skills/core/cook/references/workflow-steps.md +172 -0
- package/skills/core/debug/SKILL.md +121 -0
- package/skills/core/debug/references/defense-in-depth.md +124 -0
- package/skills/core/debug/references/frontend-verification.md +103 -0
- package/skills/core/debug/references/investigation-methodology.md +101 -0
- package/skills/core/debug/references/log-and-ci-analysis.md +97 -0
- package/skills/core/debug/references/performance-diagnostics.md +113 -0
- package/skills/core/debug/references/reporting-standards.md +122 -0
- package/skills/core/debug/references/root-cause-tracing.md +122 -0
- package/skills/core/debug/references/systematic-debugging.md +102 -0
- package/skills/core/debug/references/task-management-debugging.md +155 -0
- package/skills/core/debug/references/verification.md +123 -0
- package/skills/core/debug/scripts/find-polluter.sh +63 -0
- package/skills/core/debug/scripts/find-polluter.test.md +102 -0
- package/skills/core/execute/SKILL.md +70 -0
- package/skills/core/fix/SKILL.md +111 -0
- package/skills/core/fix/references/complexity-assessment.md +72 -0
- package/skills/core/fix/references/mode-selection.md +46 -0
- package/skills/core/fix/references/parallel-exploration.md +100 -0
- package/skills/core/fix/references/review-cycle.md +77 -0
- package/skills/core/fix/references/skill-activation-matrix.md +78 -0
- package/skills/core/fix/references/task-orchestration.md +103 -0
- package/skills/core/fix/references/workflow-ci.md +28 -0
- package/skills/core/fix/references/workflow-deep.md +122 -0
- package/skills/core/fix/references/workflow-logs.md +72 -0
- package/skills/core/fix/references/workflow-quick.md +59 -0
- package/skills/core/fix/references/workflow-standard.md +111 -0
- package/skills/core/fix/references/workflow-test.md +75 -0
- package/skills/core/fix/references/workflow-types.md +33 -0
- package/skills/core/fix/references/workflow-ui.md +75 -0
- package/skills/core/plan/SKILL.md +145 -0
- package/skills/core/plan/plan-document-reviewer-prompt.md +49 -0
- package/skills/core/subagent-dev/SKILL.md +277 -0
- package/skills/core/subagent-dev/code-quality-reviewer-prompt.md +26 -0
- package/skills/core/subagent-dev/implementer-prompt.md +113 -0
- package/skills/core/subagent-dev/spec-reviewer-prompt.md +61 -0
- package/skills/core/tdd/SKILL.md +371 -0
- package/skills/core/tdd/testing-anti-patterns.md +299 -0
- package/skills/core/test/SKILL.md +109 -0
- package/skills/core/test/references/report-format.md +58 -0
- package/skills/core/test/references/test-execution-workflow.md +103 -0
- package/skills/core/test/references/ui-testing-workflow.md +65 -0
- package/skills/core/verify/SKILL.md +139 -0
- package/skills/dev/backend-dev/SKILL.md +96 -0
- package/skills/dev/backend-dev/references/backend-api-design.md +495 -0
- package/skills/dev/backend-dev/references/backend-architecture.md +454 -0
- package/skills/dev/backend-dev/references/backend-authentication.md +338 -0
- package/skills/dev/backend-dev/references/backend-code-quality.md +659 -0
- package/skills/dev/backend-dev/references/backend-debugging.md +904 -0
- package/skills/dev/backend-dev/references/backend-devops.md +494 -0
- package/skills/dev/backend-dev/references/backend-mindset.md +387 -0
- package/skills/dev/backend-dev/references/backend-performance.md +397 -0
- package/skills/dev/backend-dev/references/backend-security.md +290 -0
- package/skills/dev/backend-dev/references/backend-technologies.md +256 -0
- package/skills/dev/backend-dev/references/backend-testing.md +429 -0
- package/skills/dev/context-engineering/SKILL.md +108 -0
- package/skills/dev/context-engineering/references/context-compression.md +84 -0
- package/skills/dev/context-engineering/references/context-degradation.md +93 -0
- package/skills/dev/context-engineering/references/context-fundamentals.md +75 -0
- package/skills/dev/context-engineering/references/context-optimization.md +82 -0
- package/skills/dev/context-engineering/references/evaluation.md +89 -0
- package/skills/dev/context-engineering/references/memory-systems.md +88 -0
- package/skills/dev/context-engineering/references/multi-agent-patterns.md +90 -0
- package/skills/dev/context-engineering/references/project-development.md +97 -0
- package/skills/dev/context-engineering/references/runtime-awareness.md +202 -0
- package/skills/dev/context-engineering/references/tool-design.md +86 -0
- package/skills/dev/context-engineering/scripts/compression_evaluator.py +349 -0
- package/skills/dev/context-engineering/scripts/context_analyzer.py +317 -0
- package/skills/dev/context-engineering/scripts/tests/test_edge_cases.py +246 -0
- package/skills/dev/databases/SKILL.md +84 -0
- package/skills/dev/databases/analytics.md +198 -0
- package/skills/dev/databases/db-design.md +188 -0
- package/skills/dev/databases/incremental-etl.md +213 -0
- package/skills/dev/databases/references/mongodb-aggregation.md +447 -0
- package/skills/dev/databases/references/mongodb-atlas.md +465 -0
- package/skills/dev/databases/references/mongodb-crud.md +408 -0
- package/skills/dev/databases/references/mongodb-indexing.md +442 -0
- package/skills/dev/databases/references/postgresql-administration.md +594 -0
- package/skills/dev/databases/references/postgresql-performance.md +527 -0
- package/skills/dev/databases/references/postgresql-psql-cli.md +467 -0
- package/skills/dev/databases/references/postgresql-queries.md +475 -0
- package/skills/dev/databases/scripts/.coverage +0 -0
- package/skills/dev/databases/scripts/db_backup.py +502 -0
- package/skills/dev/databases/scripts/db_migrate.py +426 -0
- package/skills/dev/databases/scripts/db_performance_check.py +457 -0
- package/skills/dev/databases/scripts/requirements.txt +20 -0
- package/skills/dev/databases/scripts/tests/coverage-db.json +1 -0
- package/skills/dev/databases/scripts/tests/requirements.txt +4 -0
- package/skills/dev/databases/scripts/tests/test_db_backup.py +340 -0
- package/skills/dev/databases/scripts/tests/test_db_migrate.py +277 -0
- package/skills/dev/databases/scripts/tests/test_db_performance_check.py +370 -0
- package/skills/dev/databases/stacks/bigquery.md +231 -0
- package/skills/dev/databases/stacks/d1_cloudflare.md +137 -0
- package/skills/dev/databases/stacks/mysql.md +216 -0
- package/skills/dev/databases/stacks/postgres.md +235 -0
- package/skills/dev/databases/stacks/sqlite.md +244 -0
- package/skills/dev/databases/transactional.md +176 -0
- package/skills/dev/devops/.env.example +76 -0
- package/skills/dev/devops/SKILL.md +97 -0
- package/skills/dev/devops/references/browser-rendering.md +305 -0
- package/skills/dev/devops/references/cloudflare-d1-kv.md +123 -0
- package/skills/dev/devops/references/cloudflare-platform.md +271 -0
- package/skills/dev/devops/references/cloudflare-r2-storage.md +280 -0
- package/skills/dev/devops/references/cloudflare-workers-advanced.md +312 -0
- package/skills/dev/devops/references/cloudflare-workers-apis.md +309 -0
- package/skills/dev/devops/references/cloudflare-workers-basics.md +418 -0
- package/skills/dev/devops/references/docker-basics.md +297 -0
- package/skills/dev/devops/references/docker-compose.md +292 -0
- package/skills/dev/devops/references/gcloud-platform.md +297 -0
- package/skills/dev/devops/references/gcloud-services.md +304 -0
- package/skills/dev/devops/references/kubernetes-basics.md +99 -0
- package/skills/dev/devops/references/kubernetes-helm-advanced.md +75 -0
- package/skills/dev/devops/references/kubernetes-helm.md +81 -0
- package/skills/dev/devops/references/kubernetes-kubectl.md +74 -0
- package/skills/dev/devops/references/kubernetes-security-advanced.md +98 -0
- package/skills/dev/devops/references/kubernetes-security.md +95 -0
- package/skills/dev/devops/references/kubernetes-troubleshooting-advanced.md +74 -0
- package/skills/dev/devops/references/kubernetes-troubleshooting.md +49 -0
- package/skills/dev/devops/references/kubernetes-workflows-advanced.md +75 -0
- package/skills/dev/devops/references/kubernetes-workflows.md +78 -0
- package/skills/dev/devops/scripts/cloudflare_deploy.py +269 -0
- package/skills/dev/devops/scripts/docker_optimize.py +332 -0
- package/skills/dev/devops/scripts/requirements.txt +20 -0
- package/skills/dev/devops/scripts/tests/requirements.txt +3 -0
- package/skills/dev/devops/scripts/tests/test_cloudflare_deploy.py +285 -0
- package/skills/dev/devops/scripts/tests/test_docker_optimize.py +436 -0
- package/skills/dev/frontend-design/SKILL.md +78 -0
- package/skills/dev/frontend-design/references/ai-multimodal-overview.md +165 -0
- package/skills/dev/frontend-design/references/analysis-best-practices.md +80 -0
- package/skills/dev/frontend-design/references/analysis-prompts.md +141 -0
- package/skills/dev/frontend-design/references/analysis-techniques.md +118 -0
- package/skills/dev/frontend-design/references/animejs.md +396 -0
- package/skills/dev/frontend-design/references/asset-generation.md +337 -0
- package/skills/dev/frontend-design/references/design-extraction-overview.md +71 -0
- package/skills/dev/frontend-design/references/extraction-best-practices.md +141 -0
- package/skills/dev/frontend-design/references/extraction-output-templates.md +162 -0
- package/skills/dev/frontend-design/references/extraction-prompts.md +127 -0
- package/skills/dev/frontend-design/references/technical-accessibility.md +119 -0
- package/skills/dev/frontend-design/references/technical-best-practices.md +97 -0
- package/skills/dev/frontend-design/references/technical-optimization.md +44 -0
- package/skills/dev/frontend-design/references/technical-overview.md +90 -0
- package/skills/dev/frontend-design/references/technical-workflows.md +150 -0
- package/skills/dev/frontend-design/references/visual-analysis-overview.md +95 -0
- package/skills/dev/frontend-design/references/workflow-3d.md +102 -0
- package/skills/dev/frontend-design/references/workflow-describe.md +87 -0
- package/skills/dev/frontend-design/references/workflow-immersive.md +87 -0
- package/skills/dev/frontend-design/references/workflow-quick.md +57 -0
- package/skills/dev/frontend-design/references/workflow-screenshot.md +63 -0
- package/skills/dev/frontend-design/references/workflow-video.md +74 -0
- package/skills/dev/frontend-dev/SKILL.md +400 -0
- package/skills/dev/frontend-dev/resources/common-patterns.md +331 -0
- package/skills/dev/frontend-dev/resources/complete-examples.md +872 -0
- package/skills/dev/frontend-dev/resources/component-patterns.md +502 -0
- package/skills/dev/frontend-dev/resources/data-fetching.md +767 -0
- package/skills/dev/frontend-dev/resources/file-organization.md +502 -0
- package/skills/dev/frontend-dev/resources/loading-and-error-states.md +501 -0
- package/skills/dev/frontend-dev/resources/performance.md +406 -0
- package/skills/dev/frontend-dev/resources/routing-guide.md +364 -0
- package/skills/dev/frontend-dev/resources/styling-guide.md +428 -0
- package/skills/dev/frontend-dev/resources/typescript-standards.md +418 -0
- package/skills/dev/git/SKILL.md +114 -0
- package/skills/dev/git/references/branch-management.md +88 -0
- package/skills/dev/git/references/commit-standards.md +46 -0
- package/skills/dev/git/references/gh-cli-guide.md +109 -0
- package/skills/dev/git/references/safety-protocols.md +69 -0
- package/skills/dev/git/references/workflow-commit.md +58 -0
- package/skills/dev/git/references/workflow-merge.md +48 -0
- package/skills/dev/git/references/workflow-pr.md +58 -0
- package/skills/dev/git/references/workflow-push.md +52 -0
- package/skills/dev/git-worktree/SKILL.md +218 -0
- package/skills/utils/ask/SKILL.md +58 -0
- package/skills/utils/bootstrap/SKILL.md +101 -0
- package/skills/utils/bootstrap/references/shared-phases.md +59 -0
- package/skills/utils/bootstrap/references/workflow-auto.md +52 -0
- package/skills/utils/bootstrap/references/workflow-fast.md +50 -0
- package/skills/utils/bootstrap/references/workflow-full.md +60 -0
- package/skills/utils/bootstrap/references/workflow-parallel.md +59 -0
- package/skills/utils/ck-help/SKILL.md +102 -0
- package/skills/utils/ck-help/scripts/ck-help.py +1321 -0
- package/skills/utils/ck-help/scripts/commands_data.yaml +3 -0
- package/skills/utils/ck-help/scripts/skills_data.yaml +593 -0
- package/skills/utils/copywriting/SKILL.md +94 -0
- package/skills/utils/copywriting/references/copy-formulas.md +150 -0
- package/skills/utils/copywriting/references/cta-patterns.md +168 -0
- package/skills/utils/copywriting/references/email-copy.md +193 -0
- package/skills/utils/copywriting/references/headline-templates.md +140 -0
- package/skills/utils/copywriting/references/landing-page-copy.md +175 -0
- package/skills/utils/copywriting/references/power-words.md +189 -0
- package/skills/utils/copywriting/references/social-media-copy.md +222 -0
- package/skills/utils/copywriting/references/workflow-cro.md +83 -0
- package/skills/utils/copywriting/references/workflow-enhance.md +32 -0
- package/skills/utils/copywriting/references/workflow-fast.md +29 -0
- package/skills/utils/copywriting/references/workflow-good.md +39 -0
- package/skills/utils/copywriting/references/writing-styles.md +247 -0
- package/skills/utils/copywriting/scripts/extract-writing-styles.py +308 -0
- package/skills/utils/copywriting/templates/copy-brief.md +49 -0
- package/skills/utils/docs/SKILL.md +55 -0
- package/skills/utils/docs/references/init-workflow.md +32 -0
- package/skills/utils/docs/references/summarize-workflow.md +18 -0
- package/skills/utils/docs/references/update-workflow.md +59 -0
- package/skills/utils/journal/SKILL.md +11 -0
- package/skills/utils/kanban/SKILL.md +99 -0
- package/skills/utils/preview/SKILL.md +75 -0
- package/skills/utils/preview/references/generation-modes.md +95 -0
- package/skills/utils/preview/references/view-mode.md +42 -0
- package/skills/utils/repomix/SKILL.md +248 -0
- package/skills/utils/repomix/references/configuration.md +211 -0
- package/skills/utils/repomix/references/usage-patterns.md +232 -0
- package/skills/utils/repomix/scripts/.coverage +0 -0
- package/skills/utils/repomix/scripts/README.md +179 -0
- package/skills/utils/repomix/scripts/repomix_batch.py +455 -0
- package/skills/utils/repomix/scripts/repos.example.json +15 -0
- package/skills/utils/repomix/scripts/requirements.txt +15 -0
- package/skills/utils/repomix/scripts/tests/test_repomix_batch.py +531 -0
- package/skills/utils/research/SKILL.md +171 -0
- package/skills/utils/scout/SKILL.md +89 -0
- package/skills/utils/scout/references/external-scouting.md +140 -0
- package/skills/utils/scout/references/internal-scouting.md +119 -0
- package/skills/utils/scout/references/task-management-scouting.md +125 -0
- package/skills/utils/sequential-thinking/.env.example +8 -0
- package/skills/utils/sequential-thinking/README.md +183 -0
- package/skills/utils/sequential-thinking/SKILL.md +95 -0
- package/skills/utils/sequential-thinking/package.json +31 -0
- package/skills/utils/sequential-thinking/references/advanced-strategies.md +79 -0
- package/skills/utils/sequential-thinking/references/advanced-techniques.md +76 -0
- package/skills/utils/sequential-thinking/references/core-patterns.md +95 -0
- package/skills/utils/sequential-thinking/references/examples-api.md +88 -0
- package/skills/utils/sequential-thinking/references/examples-architecture.md +94 -0
- package/skills/utils/sequential-thinking/references/examples-debug.md +90 -0
- package/skills/utils/sequential-thinking/scripts/format-thought.js +159 -0
- package/skills/utils/sequential-thinking/scripts/process-thought.js +236 -0
- package/skills/utils/sequential-thinking/tests/format-thought.test.js +133 -0
- package/skills/utils/sequential-thinking/tests/process-thought.test.js +215 -0
- package/skills/utils/write-skill/SKILL.md +655 -0
- package/skills/utils/write-skill/anthropic-best-practices.md +1150 -0
- package/skills/utils/write-skill/examples/CLAUDE_MD_TESTING.md +189 -0
- package/skills/utils/write-skill/graphviz-conventions.dot +172 -0
- package/skills/utils/write-skill/persuasion-principles.md +187 -0
- package/skills/utils/write-skill/render-graphs.js +168 -0
- package/skills/utils/write-skill/testing-skills-with-subagents.md +384 -0
- package/src/commands/init.js +238 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Nano Banana Pro (Gemini Image)
|
|
2
|
+
|
|
3
|
+
## Models
|
|
4
|
+
|
|
5
|
+
| Model ID | Type | Best For |
|
|
6
|
+
|----------|------|----------|
|
|
7
|
+
| `gemini-2.5-flash-image` | Flash | Speed, high-volume |
|
|
8
|
+
| `gemini-3-pro-image-preview` | Pro | Text rendering, complex prompts |
|
|
9
|
+
|
|
10
|
+
## Core Principle
|
|
11
|
+
|
|
12
|
+
**Narrative paragraphs > keyword lists** (32K context). Write like briefing a photographer.
|
|
13
|
+
|
|
14
|
+
## Parameters
|
|
15
|
+
|
|
16
|
+
```python
|
|
17
|
+
responseModalities=['TEXT', 'IMAGE']
|
|
18
|
+
aspect_ratio="16:9" # 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9
|
|
19
|
+
image_size="2K" # 1K, 2K, 4K - MUST be uppercase K
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Prompt Templates
|
|
23
|
+
|
|
24
|
+
**Photorealistic**: `A [subject] in [location], [lens] lens. [Lighting] creates [mood]. [Details]. [Camera angle]. Professional photography, natural lighting.`
|
|
25
|
+
|
|
26
|
+
**Illustration**: `[Art style] illustration of [subject]. [Color palette]. [Line style]. [Background]. [Mood].`
|
|
27
|
+
|
|
28
|
+
**Text in Image**: `Image with text "[EXACT]" in [font]. Font: [style]. Color: [hex/#FF5733]. Position: [top/center/bottom]. Background: [desc]. Context: [poster/sign].`
|
|
29
|
+
|
|
30
|
+
**Product**: `[Product] on [surface]. Materials: [finish]. Lighting: [setup]. Camera: [angle]. Background: [type]. Style: [commercial/lifestyle].`
|
|
31
|
+
|
|
32
|
+
**Infographic**: `Premium liquid glass Bento grid infographic with 8 modules. Product: [item]. Language: [lang]. Hero card: 28-30%. Background: [ethereal/macro/pattern/context].`
|
|
33
|
+
|
|
34
|
+
## Prompt Collection / Prompt Search
|
|
35
|
+
|
|
36
|
+
Read `references/awesome-prompts.csv` directly or search for relevant prompts using `python3 ../scripts/search.py "<query>"`.
|
|
37
|
+
|
|
38
|
+
## JSON Structured Prompts
|
|
39
|
+
|
|
40
|
+
For complex scenes, use JSON structure:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"meta_data": { "prompt_version": "2.0", "use_case": "..." },
|
|
45
|
+
"subject_layer": {
|
|
46
|
+
"anatomy": { "demographics": {}, "face_detail": {}, "hair": {} },
|
|
47
|
+
"attire_layer": { "garment_main": {}, "accessories": {} },
|
|
48
|
+
"pose_dynamics": { "posture": "", "limb_placement": {} }
|
|
49
|
+
},
|
|
50
|
+
"environment_layer": { "setting_type": "", "spatial_layout": {} },
|
|
51
|
+
"composition_and_tech": {
|
|
52
|
+
"framing": { "type": "", "angle": "" },
|
|
53
|
+
"lighting": { "source": "", "direction": "" },
|
|
54
|
+
"aesthetic_style": { "visual_core": "", "vibe": "" }
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Techniques
|
|
60
|
+
|
|
61
|
+
| Technique | Example |
|
|
62
|
+
|-----------|---------|
|
|
63
|
+
| Emphasis | `ALL CAPS` for critical requirements |
|
|
64
|
+
| Precision colors | `#9F2B68` instead of "dark magenta" |
|
|
65
|
+
| Negative constraints | `NEVER include text/watermarks. DO NOT add labels.` |
|
|
66
|
+
| Realism trigger | `Natural lighting, DOF. Captured with Canon EOS 90D DSLR.` |
|
|
67
|
+
| Structured edits | `Make ALL edits: - [1] - [2] - [3]` |
|
|
68
|
+
| Complex logic | `Kittens MUST have heterochromatic eyes matching fur colors` |
|
|
69
|
+
| Identity lock | `Use reference as EXACT facial reference. STRICT identity lock.` |
|
|
70
|
+
|
|
71
|
+
## Advanced Features
|
|
72
|
+
|
|
73
|
+
**Multi-Image Input** (up to 14): 6 object + 5 human refs. Tip: collage refs into single image.
|
|
74
|
+
|
|
75
|
+
**Search Grounding**: `tools=[{"google_search": {}}]` — real-time data (weather, charts, events).
|
|
76
|
+
|
|
77
|
+
**Thinking Mode** (Pro only): `part.thought` in response for complex reasoning.
|
|
78
|
+
|
|
79
|
+
## Popular Use Case Templates
|
|
80
|
+
|
|
81
|
+
### Quote Card
|
|
82
|
+
```
|
|
83
|
+
A wide quote card with {background} background, {font_style} font.
|
|
84
|
+
Quote: "{quote_text}" — {author}
|
|
85
|
+
Large subtle quotation mark before text. Portrait on left, text right.
|
|
86
|
+
Text: 2/3 width, portrait: 1/3 width. Gradient transition on portrait.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Infographic (Bento Grid)
|
|
90
|
+
```
|
|
91
|
+
Premium liquid glass Bento grid product infographic with 8 modules.
|
|
92
|
+
Product: [name]. Language: [lang].
|
|
93
|
+
1) Hero card (28-30%): Product photo/3D glass
|
|
94
|
+
2) Core Benefits: 4 benefits + icons
|
|
95
|
+
3) How to Use: 4 methods + icons
|
|
96
|
+
4) Key Metrics: 5 data points
|
|
97
|
+
5) Who It's For: 4 recommended + 3 caution groups
|
|
98
|
+
6) Important Notes: 4 precautions
|
|
99
|
+
7) Quick Reference: Specs/certifications
|
|
100
|
+
8) Did You Know: 3 facts
|
|
101
|
+
Background: Apple liquid glass cards (85-90% transparent).
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Mirror Selfie
|
|
105
|
+
```
|
|
106
|
+
Scene: Mirror selfie in [room type], [color] tone.
|
|
107
|
+
Subject: [demographics], [body type], [hairstyle].
|
|
108
|
+
Pose: [stance], holding smartphone.
|
|
109
|
+
Clothing: [detailed outfit description].
|
|
110
|
+
Environment: [room details, furnishings, lighting].
|
|
111
|
+
Camera: Smartphone rear camera via mirror, [focal length]mm.
|
|
112
|
+
Negative: [artifacts to avoid].
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Style Transformation
|
|
116
|
+
```
|
|
117
|
+
A Japanese Edo-period Ukiyo-e woodblock print reimagining [modern scene].
|
|
118
|
+
Characters: Edo-era kimono but modern actions.
|
|
119
|
+
Tech transformation: Smartphones → glowing scrolls, trains → wooden carriages.
|
|
120
|
+
Composition: Flattened perspective, bold ink outlines.
|
|
121
|
+
Texture: Wood grain, paper fibers, pigment bleeding.
|
|
122
|
+
Colors: Prussian blue, vermilion red, muted ochre.
|
|
123
|
+
Include vertical Japanese calligraphy and red artist seal.
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Workflow
|
|
127
|
+
|
|
128
|
+
1. Narrative description → 2. Photography terms → 3. ALL CAPS emphasis → 4. Multi-turn refine → 5. Negative constraints → 6. Set ratio/resolution
|
|
129
|
+
|
|
130
|
+
## Avoid
|
|
131
|
+
|
|
132
|
+
- Keyword spam ("4k, trending, masterpiece")
|
|
133
|
+
- Vague text ("add some text" → specify exact text, font, position)
|
|
134
|
+
- Lowercase resolution ("4k" rejected, use "4K")
|
|
135
|
+
- Over-smoothed skin requests (leads to plastic look)
|
|
136
|
+
- Generic prompts without specific details
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Reasoning Techniques Deep Dive
|
|
2
|
+
|
|
3
|
+
## Chain of Thought (CoT) Variants
|
|
4
|
+
|
|
5
|
+
### Zero-Shot CoT
|
|
6
|
+
```
|
|
7
|
+
[Task description]
|
|
8
|
+
|
|
9
|
+
Think step by step before answering.
|
|
10
|
+
```
|
|
11
|
+
**Use when**: Quick reasoning, no examples available
|
|
12
|
+
**Effectiveness**: +40-60% on reasoning tasks
|
|
13
|
+
|
|
14
|
+
### Few-Shot CoT
|
|
15
|
+
```
|
|
16
|
+
Example 1:
|
|
17
|
+
Q: [Question]
|
|
18
|
+
A: Let me think through this...
|
|
19
|
+
Step 1: [Reasoning]
|
|
20
|
+
Step 2: [Reasoning]
|
|
21
|
+
Therefore: [Answer]
|
|
22
|
+
|
|
23
|
+
Example 2:
|
|
24
|
+
Q: [Question]
|
|
25
|
+
A: Breaking this down...
|
|
26
|
+
First: [Reasoning]
|
|
27
|
+
Next: [Reasoning]
|
|
28
|
+
So: [Answer]
|
|
29
|
+
|
|
30
|
+
Now solve:
|
|
31
|
+
Q: [Your question]
|
|
32
|
+
```
|
|
33
|
+
**Use when**: Complex reasoning, pattern demonstration needed
|
|
34
|
+
**Effectiveness**: +50-80% on complex tasks
|
|
35
|
+
|
|
36
|
+
### Auto-CoT
|
|
37
|
+
```
|
|
38
|
+
Let me approach this systematically:
|
|
39
|
+
1. Identify the key elements
|
|
40
|
+
2. Analyze relationships
|
|
41
|
+
3. Apply relevant principles
|
|
42
|
+
4. Draw conclusions
|
|
43
|
+
5. Verify my reasoning
|
|
44
|
+
```
|
|
45
|
+
**Use when**: General problem-solving, exploratory reasoning
|
|
46
|
+
|
|
47
|
+
## Tree of Thoughts (ToT)
|
|
48
|
+
|
|
49
|
+
### Implementation Pattern
|
|
50
|
+
```
|
|
51
|
+
Problem: [Complex problem]
|
|
52
|
+
|
|
53
|
+
Generate 3 different approaches:
|
|
54
|
+
|
|
55
|
+
Approach A:
|
|
56
|
+
- Method: [Description]
|
|
57
|
+
- Reasoning: [Why this might work]
|
|
58
|
+
- Potential issues: [Risks]
|
|
59
|
+
- Confidence: [1-10]
|
|
60
|
+
|
|
61
|
+
Approach B:
|
|
62
|
+
- Method: [Description]
|
|
63
|
+
- Reasoning: [Why this might work]
|
|
64
|
+
- Potential issues: [Risks]
|
|
65
|
+
- Confidence: [1-10]
|
|
66
|
+
|
|
67
|
+
Approach C:
|
|
68
|
+
- Method: [Description]
|
|
69
|
+
- Reasoning: [Why this might work]
|
|
70
|
+
- Potential issues: [Risks]
|
|
71
|
+
- Confidence: [1-10]
|
|
72
|
+
|
|
73
|
+
Evaluate branches:
|
|
74
|
+
- Which has highest success probability?
|
|
75
|
+
- Which has fewest risks?
|
|
76
|
+
- Which is most feasible?
|
|
77
|
+
|
|
78
|
+
Selected approach: [Best option with justification]
|
|
79
|
+
Execution: [Step-by-step implementation]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Use when**: Strategic decisions, multiple valid paths, high-stakes problems
|
|
83
|
+
|
|
84
|
+
## Self-Consistency
|
|
85
|
+
|
|
86
|
+
### Process
|
|
87
|
+
1. Generate 5 responses at temp=0.7
|
|
88
|
+
2. Extract final answers from each
|
|
89
|
+
3. Take majority vote
|
|
90
|
+
4. Report confidence = agreement %
|
|
91
|
+
|
|
92
|
+
### Implementation
|
|
93
|
+
```
|
|
94
|
+
Run this prompt 5 times (or use n=5 parameter):
|
|
95
|
+
[Your reasoning task]
|
|
96
|
+
Think step by step and provide final answer.
|
|
97
|
+
|
|
98
|
+
Aggregate: If 4/5 agree = high confidence
|
|
99
|
+
If 3/5 agree = medium confidence
|
|
100
|
+
If split = low confidence, needs review
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Use when**: Math, logic, factual questions with verifiable answers
|
|
104
|
+
|
|
105
|
+
## ReAct (Reasoning + Acting)
|
|
106
|
+
|
|
107
|
+
### Full Pattern
|
|
108
|
+
```
|
|
109
|
+
Task: [Goal to achieve]
|
|
110
|
+
|
|
111
|
+
Thought 1: I need to understand the current situation.
|
|
112
|
+
Action 1: [Observation or tool use]
|
|
113
|
+
Observation 1: [Result from action]
|
|
114
|
+
|
|
115
|
+
Thought 2: Based on this, I should [next logical step].
|
|
116
|
+
Action 2: [Next action]
|
|
117
|
+
Observation 2: [Result]
|
|
118
|
+
|
|
119
|
+
Thought 3: Now I can see that [insight].
|
|
120
|
+
Action 3: [Verification or next step]
|
|
121
|
+
Observation 3: [Result]
|
|
122
|
+
|
|
123
|
+
Thought 4: I have enough information to conclude.
|
|
124
|
+
Final Answer: [Conclusion with reasoning]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Use when**: Tool-augmented reasoning, research tasks, multi-step analysis
|
|
128
|
+
|
|
129
|
+
## Least-to-Most Prompting
|
|
130
|
+
|
|
131
|
+
### Structure
|
|
132
|
+
```
|
|
133
|
+
Complex problem: [Full problem statement]
|
|
134
|
+
|
|
135
|
+
Step 1: Decomposition
|
|
136
|
+
Break this into simpler subproblems, ordered from easiest to hardest:
|
|
137
|
+
1. [Simplest subproblem]
|
|
138
|
+
2. [Next subproblem, may depend on 1]
|
|
139
|
+
3. [Harder subproblem, may depend on 1,2]
|
|
140
|
+
4. [Final subproblem requiring all above]
|
|
141
|
+
|
|
142
|
+
Step 2: Sequential Solution
|
|
143
|
+
Subproblem 1: [Solution]
|
|
144
|
+
Using result from 1, Subproblem 2: [Solution]
|
|
145
|
+
Using results from 1,2, Subproblem 3: [Solution]
|
|
146
|
+
Using all results, Subproblem 4: [Solution]
|
|
147
|
+
|
|
148
|
+
Final integrated answer: [Complete solution]
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**Use when**: Mathematical word problems, multi-step procedures, compositional tasks
|
|
152
|
+
|
|
153
|
+
## Decomposed Prompting (DECOMP)
|
|
154
|
+
|
|
155
|
+
### Pattern
|
|
156
|
+
```
|
|
157
|
+
Task: [Complex task]
|
|
158
|
+
|
|
159
|
+
Required capabilities:
|
|
160
|
+
- [Capability 1]: Use [specialized prompt/tool]
|
|
161
|
+
- [Capability 2]: Use [specialized prompt/tool]
|
|
162
|
+
- [Capability 3]: Use [specialized prompt/tool]
|
|
163
|
+
|
|
164
|
+
Orchestration:
|
|
165
|
+
1. Call [Capability 1] with [input] → get [output1]
|
|
166
|
+
2. Call [Capability 2] with [output1] → get [output2]
|
|
167
|
+
3. Call [Capability 3] with [output2] → get [final output]
|
|
168
|
+
|
|
169
|
+
Integrate results: [Final response]
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
**Use when**: Tasks requiring diverse expertise, specialized sub-tasks
|
|
173
|
+
|
|
174
|
+
## Constitutional AI Reasoning
|
|
175
|
+
|
|
176
|
+
### Self-Critique Pattern
|
|
177
|
+
```
|
|
178
|
+
Initial response: [Generated content]
|
|
179
|
+
|
|
180
|
+
Critique against principles:
|
|
181
|
+
- Is it helpful? [Yes/No + reasoning]
|
|
182
|
+
- Is it harmless? [Yes/No + reasoning]
|
|
183
|
+
- Is it honest? [Yes/No + reasoning]
|
|
184
|
+
|
|
185
|
+
If any No:
|
|
186
|
+
Revised response that addresses [specific issues]:
|
|
187
|
+
[Improved content]
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Choosing the Right Technique
|
|
191
|
+
|
|
192
|
+
| Task Type | Best Technique |
|
|
193
|
+
|-----------|---------------|
|
|
194
|
+
| Simple reasoning | Zero-shot CoT |
|
|
195
|
+
| Complex multi-step | Few-shot CoT |
|
|
196
|
+
| Strategic decisions | Tree of Thoughts |
|
|
197
|
+
| Factual verification | Self-Consistency |
|
|
198
|
+
| Tool-using tasks | ReAct |
|
|
199
|
+
| Word problems | Least-to-Most |
|
|
200
|
+
| Specialized sub-tasks | DECOMP |
|
|
201
|
+
| Safety-critical | Constitutional AI |
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# AI Artist Validation Workflow
|
|
2
|
+
|
|
3
|
+
Agent instructions for mandatory validation interview before image generation.
|
|
4
|
+
|
|
5
|
+
## Step 1: Parse Arguments
|
|
6
|
+
|
|
7
|
+
Extract from user input:
|
|
8
|
+
- **concept**: The subject/description (required)
|
|
9
|
+
- **--mode**: search (default), creative, or wild
|
|
10
|
+
- **--skip**: If present, use defaults and skip to Step 4
|
|
11
|
+
|
|
12
|
+
**Defaults for --skip mode:** Style=Photorealistic, Mood=Professional, Colors=Auto, Aspect=16:9
|
|
13
|
+
|
|
14
|
+
## Step 2: Interview User
|
|
15
|
+
|
|
16
|
+
Use `AskUserQuestion` with these 4 questions in a single call:
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{"questions": [
|
|
20
|
+
{"question": "Visual style?", "header": "Style", "multiSelect": false, "options": [
|
|
21
|
+
{"label": "Photorealistic (Recommended)", "description": "Professional photography, 8K"},
|
|
22
|
+
{"label": "Cinematic", "description": "Film-like, dramatic lighting"},
|
|
23
|
+
{"label": "Illustration", "description": "Digital art, stylized"},
|
|
24
|
+
{"label": "Minimalist", "description": "Clean, white space"}
|
|
25
|
+
]},
|
|
26
|
+
{"question": "Mood?", "header": "Mood", "multiSelect": false, "options": [
|
|
27
|
+
{"label": "Professional", "description": "Corporate, trustworthy"},
|
|
28
|
+
{"label": "Energetic", "description": "Dynamic, bold"},
|
|
29
|
+
{"label": "Calm", "description": "Peaceful, serene"},
|
|
30
|
+
{"label": "Dramatic", "description": "High contrast, intense"}
|
|
31
|
+
]},
|
|
32
|
+
{"question": "Colors?", "header": "Colors", "multiSelect": false, "options": [
|
|
33
|
+
{"label": "Auto-select (Recommended)", "description": "AI chooses"},
|
|
34
|
+
{"label": "Warm tones", "description": "Oranges, reds"},
|
|
35
|
+
{"label": "Cool tones", "description": "Blues, greens"},
|
|
36
|
+
{"label": "High contrast", "description": "Blacks, neons"}
|
|
37
|
+
]},
|
|
38
|
+
{"question": "Aspect ratio?", "header": "Ratio", "multiSelect": false, "options": [
|
|
39
|
+
{"label": "16:9 (Recommended)", "description": "Widescreen"},
|
|
40
|
+
{"label": "1:1", "description": "Square"},
|
|
41
|
+
{"label": "9:16", "description": "Vertical"},
|
|
42
|
+
{"label": "4:3", "description": "Standard"}
|
|
43
|
+
]}
|
|
44
|
+
]}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Dynamic questions** (ask separately if concept matches):
|
|
48
|
+
- "banner/poster/thumbnail" → Ask about text space
|
|
49
|
+
- "product/showcase" → Ask about background preference
|
|
50
|
+
|
|
51
|
+
## Step 3: Build Prompt
|
|
52
|
+
|
|
53
|
+
Map answers to keywords:
|
|
54
|
+
|
|
55
|
+
| Style | Keywords |
|
|
56
|
+
|-------|----------|
|
|
57
|
+
| Photorealistic | photorealistic, professional photography, 8K, RAW |
|
|
58
|
+
| Cinematic | cinematic, film still, anamorphic, dramatic lighting |
|
|
59
|
+
| Illustration | digital illustration, artistic, stylized |
|
|
60
|
+
| Minimalist | minimalist, clean design, white space |
|
|
61
|
+
|
|
62
|
+
| Mood | Keywords |
|
|
63
|
+
|------|----------|
|
|
64
|
+
| Professional | professional, clean, corporate, polished |
|
|
65
|
+
| Energetic | dynamic, bold, vibrant, high energy |
|
|
66
|
+
| Calm | serene, peaceful, soft, tranquil |
|
|
67
|
+
| Dramatic | dramatic, high contrast, intense, moody |
|
|
68
|
+
|
|
69
|
+
| Colors | Keywords |
|
|
70
|
+
|--------|----------|
|
|
71
|
+
| Auto-select | (none) |
|
|
72
|
+
| Warm tones | warm palette, golden tones, amber |
|
|
73
|
+
| Cool tones | cool palette, blue tones, teal |
|
|
74
|
+
| High contrast | high contrast, bold blacks, neon |
|
|
75
|
+
|
|
76
|
+
**Template:** `[concept], [style], [mood], [colors]. Professional quality. NEVER add watermarks.`
|
|
77
|
+
|
|
78
|
+
## Step 4: Confirm & Generate
|
|
79
|
+
|
|
80
|
+
Show preview, then ask confirmation:
|
|
81
|
+
|
|
82
|
+
```json
|
|
83
|
+
{"questions": [{"question": "Generate?", "header": "Confirm", "multiSelect": false, "options": [
|
|
84
|
+
{"label": "Yes, generate (Recommended)", "description": "Proceed"},
|
|
85
|
+
{"label": "Edit prompt", "description": "Modify first"},
|
|
86
|
+
{"label": "Start over", "description": "Re-answer"}
|
|
87
|
+
]}]}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**If "Edit prompt":** Ask user for edited text, use that instead.
|
|
91
|
+
**If "Start over":** Return to Step 2.
|
|
92
|
+
|
|
93
|
+
Run generation:
|
|
94
|
+
```bash
|
|
95
|
+
cd .claude/skills/ai-artist && .venv/bin/python3 scripts/generate.py "[concept]" \
|
|
96
|
+
-o ./generated-$(date +%Y%m%d-%H%M%S).png \
|
|
97
|
+
--mode [mode] \
|
|
98
|
+
-ar [ratio] \
|
|
99
|
+
-v
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Error Handling
|
|
103
|
+
|
|
104
|
+
| Error | Action |
|
|
105
|
+
|-------|--------|
|
|
106
|
+
| API key missing | Tell user to set GEMINI_API_KEY |
|
|
107
|
+
| Model error | Suggest `--model flash` |
|
|
108
|
+
| No concept | Ask user for concept |
|
|
109
|
+
|
|
110
|
+
## Output
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
[OK] Image generated: [path]
|
|
114
|
+
Style: [style] | Mood: [mood] | Aspect: [ratio]
|
|
115
|
+
|
|
116
|
+
Tip: Use --skip to bypass interview next time.
|
|
117
|
+
```
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
AI Artist Core - BM25 search engine for prompt engineering resources
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import csv
|
|
8
|
+
import re
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
from math import log
|
|
11
|
+
from collections import defaultdict
|
|
12
|
+
|
|
13
|
+
# ============ CONFIGURATION ============
|
|
14
|
+
DATA_DIR = Path(__file__).parent.parent / "data"
|
|
15
|
+
MAX_RESULTS = 3
|
|
16
|
+
|
|
17
|
+
CSV_CONFIG = {
|
|
18
|
+
"use-case": {
|
|
19
|
+
"file": "use-cases.csv",
|
|
20
|
+
"search_cols": ["Use Case", "Category", "Keywords", "Best Platforms"],
|
|
21
|
+
"output_cols": ["Use Case", "Category", "Keywords", "Prompt Template", "Key Elements", "Best Platforms", "Aspect Ratios", "Tips", "Example"]
|
|
22
|
+
},
|
|
23
|
+
"style": {
|
|
24
|
+
"file": "styles.csv",
|
|
25
|
+
"search_cols": ["Style Name", "Category", "Keywords", "Description", "Best For"],
|
|
26
|
+
"output_cols": ["Style Name", "Category", "Description", "Key Characteristics", "Color Palette", "Best For", "Platforms", "Prompt Keywords"]
|
|
27
|
+
},
|
|
28
|
+
"platform": {
|
|
29
|
+
"file": "platforms.csv",
|
|
30
|
+
"search_cols": ["Platform", "Type", "Keywords", "Strengths"],
|
|
31
|
+
"output_cols": ["Platform", "Type", "Prompt Style", "Key Parameters", "Strengths", "Limitations", "Aspect Ratios", "Best Practices"]
|
|
32
|
+
},
|
|
33
|
+
"technique": {
|
|
34
|
+
"file": "techniques.csv",
|
|
35
|
+
"search_cols": ["Technique", "Category", "Keywords", "Description", "When to Use"],
|
|
36
|
+
"output_cols": ["Technique", "Category", "Description", "When to Use", "Syntax Example", "Platforms", "Tips"]
|
|
37
|
+
},
|
|
38
|
+
"lighting": {
|
|
39
|
+
"file": "lighting.csv",
|
|
40
|
+
"search_cols": ["Lighting Type", "Category", "Keywords", "Description", "Mood", "Best For"],
|
|
41
|
+
"output_cols": ["Lighting Type", "Category", "Description", "Mood", "Best For", "Prompt Keywords", "Technical Notes"]
|
|
42
|
+
},
|
|
43
|
+
"template": {
|
|
44
|
+
"file": "nano-banana-templates.csv",
|
|
45
|
+
"search_cols": ["Category", "Template Name", "Keywords"],
|
|
46
|
+
"output_cols": ["Category", "Template Name", "Keywords", "Prompt Template", "Aspect Ratio", "Tips"]
|
|
47
|
+
},
|
|
48
|
+
"awesome": {
|
|
49
|
+
"file": "awesome-prompts.csv",
|
|
50
|
+
"search_cols": ["title", "description", "prompt"],
|
|
51
|
+
"output_cols": ["id", "title", "category", "description", "prompt", "author", "source"]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
# ============ BM25 IMPLEMENTATION ============
|
|
57
|
+
class BM25:
|
|
58
|
+
"""BM25 ranking algorithm for text search"""
|
|
59
|
+
|
|
60
|
+
def __init__(self, k1=1.5, b=0.75):
|
|
61
|
+
self.k1 = k1
|
|
62
|
+
self.b = b
|
|
63
|
+
self.corpus = []
|
|
64
|
+
self.doc_lengths = []
|
|
65
|
+
self.avgdl = 0
|
|
66
|
+
self.idf = {}
|
|
67
|
+
self.doc_freqs = defaultdict(int)
|
|
68
|
+
self.N = 0
|
|
69
|
+
|
|
70
|
+
def tokenize(self, text):
|
|
71
|
+
"""Lowercase, split, remove punctuation, filter short words"""
|
|
72
|
+
text = re.sub(r'[^\w\s]', ' ', str(text).lower())
|
|
73
|
+
return [w for w in text.split() if len(w) > 2]
|
|
74
|
+
|
|
75
|
+
def fit(self, documents):
|
|
76
|
+
"""Build BM25 index from documents"""
|
|
77
|
+
self.corpus = [self.tokenize(doc) for doc in documents]
|
|
78
|
+
self.N = len(self.corpus)
|
|
79
|
+
if self.N == 0:
|
|
80
|
+
return
|
|
81
|
+
self.doc_lengths = [len(doc) for doc in self.corpus]
|
|
82
|
+
self.avgdl = sum(self.doc_lengths) / self.N
|
|
83
|
+
|
|
84
|
+
for doc in self.corpus:
|
|
85
|
+
seen = set()
|
|
86
|
+
for word in doc:
|
|
87
|
+
if word not in seen:
|
|
88
|
+
self.doc_freqs[word] += 1
|
|
89
|
+
seen.add(word)
|
|
90
|
+
|
|
91
|
+
for word, freq in self.doc_freqs.items():
|
|
92
|
+
self.idf[word] = log((self.N - freq + 0.5) / (freq + 0.5) + 1)
|
|
93
|
+
|
|
94
|
+
def score(self, query):
|
|
95
|
+
"""Score all documents against query"""
|
|
96
|
+
query_tokens = self.tokenize(query)
|
|
97
|
+
scores = []
|
|
98
|
+
|
|
99
|
+
for idx, doc in enumerate(self.corpus):
|
|
100
|
+
score = 0
|
|
101
|
+
doc_len = self.doc_lengths[idx]
|
|
102
|
+
term_freqs = defaultdict(int)
|
|
103
|
+
for word in doc:
|
|
104
|
+
term_freqs[word] += 1
|
|
105
|
+
|
|
106
|
+
for token in query_tokens:
|
|
107
|
+
if token in self.idf:
|
|
108
|
+
tf = term_freqs[token]
|
|
109
|
+
idf = self.idf[token]
|
|
110
|
+
numerator = tf * (self.k1 + 1)
|
|
111
|
+
denominator = tf + self.k1 * (1 - self.b + self.b * doc_len / self.avgdl)
|
|
112
|
+
score += idf * numerator / denominator
|
|
113
|
+
|
|
114
|
+
scores.append((idx, score))
|
|
115
|
+
|
|
116
|
+
return sorted(scores, key=lambda x: x[1], reverse=True)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
# ============ SEARCH FUNCTIONS ============
|
|
120
|
+
def _load_csv(filepath):
|
|
121
|
+
"""Load CSV and return list of dicts"""
|
|
122
|
+
with open(filepath, 'r', encoding='utf-8') as f:
|
|
123
|
+
return list(csv.DictReader(f))
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _search_csv(filepath, search_cols, output_cols, query, max_results):
|
|
127
|
+
"""Core search function using BM25"""
|
|
128
|
+
if not filepath.exists():
|
|
129
|
+
return []
|
|
130
|
+
|
|
131
|
+
data = _load_csv(filepath)
|
|
132
|
+
|
|
133
|
+
# Build documents from search columns
|
|
134
|
+
documents = [" ".join(str(row.get(col, "")) for col in search_cols) for row in data]
|
|
135
|
+
|
|
136
|
+
# BM25 search
|
|
137
|
+
bm25 = BM25()
|
|
138
|
+
bm25.fit(documents)
|
|
139
|
+
ranked = bm25.score(query)
|
|
140
|
+
|
|
141
|
+
# Get top results with score > 0
|
|
142
|
+
results = []
|
|
143
|
+
for idx, score in ranked[:max_results]:
|
|
144
|
+
if score > 0:
|
|
145
|
+
row = data[idx]
|
|
146
|
+
results.append({col: row.get(col, "") for col in output_cols if col in row})
|
|
147
|
+
|
|
148
|
+
return results
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def detect_domain(query):
|
|
152
|
+
"""Auto-detect the most relevant domain from query"""
|
|
153
|
+
query_lower = query.lower()
|
|
154
|
+
|
|
155
|
+
domain_keywords = {
|
|
156
|
+
"use-case": ["avatar", "profile", "thumbnail", "poster", "social", "youtube", "instagram", "marketing", "product", "e-commerce", "infographic", "comic", "game", "app", "web", "header", "banner"],
|
|
157
|
+
"style": ["style", "aesthetic", "photorealistic", "anime", "manga", "3d", "render", "illustration", "pixel", "watercolor", "oil", "cyberpunk", "vaporwave", "minimalist", "vintage", "retro"],
|
|
158
|
+
"platform": ["midjourney", "dalle", "dall-e", "stable diffusion", "flux", "nano banana", "gemini", "imagen", "ideogram", "leonardo", "firefly", "platform", "tool"],
|
|
159
|
+
"technique": ["prompt", "technique", "weight", "emphasis", "negative", "json", "structured", "iteration", "reference", "identity", "multi-panel", "search grounding"],
|
|
160
|
+
"lighting": ["lighting", "light", "shadow", "golden hour", "blue hour", "rembrandt", "butterfly", "neon", "volumetric", "softbox", "rim light", "studio"]
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
scores = {domain: sum(1 for kw in keywords if kw in query_lower) for domain, keywords in domain_keywords.items()}
|
|
164
|
+
best = max(scores, key=scores.get)
|
|
165
|
+
return best if scores[best] > 0 else "style"
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
def search(query, domain=None, max_results=MAX_RESULTS):
|
|
169
|
+
"""Main search function with auto-domain detection"""
|
|
170
|
+
if domain is None:
|
|
171
|
+
domain = detect_domain(query)
|
|
172
|
+
|
|
173
|
+
config = CSV_CONFIG.get(domain, CSV_CONFIG["style"])
|
|
174
|
+
filepath = DATA_DIR / config["file"]
|
|
175
|
+
|
|
176
|
+
if not filepath.exists():
|
|
177
|
+
return {"error": f"File not found: {filepath}", "domain": domain}
|
|
178
|
+
|
|
179
|
+
results = _search_csv(filepath, config["search_cols"], config["output_cols"], query, max_results)
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
"domain": domain,
|
|
183
|
+
"query": query,
|
|
184
|
+
"file": config["file"],
|
|
185
|
+
"count": len(results),
|
|
186
|
+
"results": results
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def search_all_domains(query, max_per_domain=2):
|
|
191
|
+
"""Search across all domains for comprehensive results"""
|
|
192
|
+
all_results = {}
|
|
193
|
+
for domain in CSV_CONFIG.keys():
|
|
194
|
+
result = search(query, domain, max_per_domain)
|
|
195
|
+
if result.get("count", 0) > 0:
|
|
196
|
+
all_results[domain] = result
|
|
197
|
+
return all_results
|