claude-code-templates 1.21.6 → 1.21.8
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/components/sandbox/e2b/e2b-launcher.py +0 -1
- package/package.json +2 -2
- package/components/agents/ai-specialists/ai-ethics-advisor.md +0 -195
- package/components/agents/ai-specialists/hackathon-ai-strategist.md +0 -46
- package/components/agents/ai-specialists/llms-maintainer.md +0 -94
- package/components/agents/ai-specialists/model-evaluator.md +0 -150
- package/components/agents/ai-specialists/prompt-engineer.md +0 -112
- package/components/agents/ai-specialists/search-specialist.md +0 -59
- package/components/agents/ai-specialists/task-decomposition-expert.md +0 -97
- package/components/agents/api-graphql/graphql-architect.md +0 -208
- package/components/agents/api-graphql/graphql-performance-optimizer.md +0 -357
- package/components/agents/api-graphql/graphql-security-specialist.md +0 -519
- package/components/agents/blockchain-web3/smart-contract-auditor.md +0 -32
- package/components/agents/blockchain-web3/smart-contract-specialist.md +0 -32
- package/components/agents/blockchain-web3/web3-integration-specialist.md +0 -32
- package/components/agents/business-marketing/business-analyst.md +0 -194
- package/components/agents/business-marketing/content-marketer.md +0 -36
- package/components/agents/business-marketing/customer-support.md +0 -36
- package/components/agents/business-marketing/legal-advisor.md +0 -50
- package/components/agents/business-marketing/marketing-attribution-analyst.md +0 -352
- package/components/agents/business-marketing/payment-integration.md +0 -33
- package/components/agents/business-marketing/product-strategist.md +0 -212
- package/components/agents/business-marketing/risk-manager.md +0 -42
- package/components/agents/business-marketing/sales-automator.md +0 -36
- package/components/agents/data-ai/ai-engineer.md +0 -33
- package/components/agents/data-ai/computer-vision-engineer.md +0 -562
- package/components/agents/data-ai/data-engineer.md +0 -33
- package/components/agents/data-ai/data-scientist.md +0 -337
- package/components/agents/data-ai/ml-engineer.md +0 -33
- package/components/agents/data-ai/mlops-engineer.md +0 -58
- package/components/agents/data-ai/nlp-engineer.md +0 -680
- package/components/agents/data-ai/quant-analyst.md +0 -33
- package/components/agents/database/database-admin.md +0 -33
- package/components/agents/database/database-architect.md +0 -590
- package/components/agents/database/database-optimization.md +0 -33
- package/components/agents/database/database-optimizer.md +0 -33
- package/components/agents/database/nosql-specialist.md +0 -708
- package/components/agents/database/supabase-schema-architect.md +0 -138
- package/components/agents/deep-research-team/academic-researcher.md +0 -33
- package/components/agents/deep-research-team/agent-overview.md +0 -235
- package/components/agents/deep-research-team/competitive-intelligence-analyst.md +0 -530
- package/components/agents/deep-research-team/data-analyst.md +0 -112
- package/components/agents/deep-research-team/fact-checker.md +0 -553
- package/components/agents/deep-research-team/query-clarifier.md +0 -73
- package/components/agents/deep-research-team/report-generator.md +0 -108
- package/components/agents/deep-research-team/research-brief-generator.md +0 -108
- package/components/agents/deep-research-team/research-coordinator.md +0 -94
- package/components/agents/deep-research-team/research-orchestrator.md +0 -119
- package/components/agents/deep-research-team/research-synthesizer.md +0 -109
- package/components/agents/deep-research-team/technical-researcher.md +0 -95
- package/components/agents/development-team/backend-architect.md +0 -31
- package/components/agents/development-team/cli-ui-designer.md +0 -405
- package/components/agents/development-team/devops-engineer.md +0 -886
- package/components/agents/development-team/frontend-developer.md +0 -32
- package/components/agents/development-team/fullstack-developer.md +0 -1205
- package/components/agents/development-team/ios-developer.md +0 -36
- package/components/agents/development-team/mobile-developer.md +0 -33
- package/components/agents/development-team/ui-ux-designer.md +0 -36
- package/components/agents/development-tools/code-reviewer.md +0 -30
- package/components/agents/development-tools/command-expert.md +0 -422
- package/components/agents/development-tools/context-manager.md +0 -65
- package/components/agents/development-tools/debugger.md +0 -31
- package/components/agents/development-tools/dx-optimizer.md +0 -64
- package/components/agents/development-tools/error-detective.md +0 -33
- package/components/agents/development-tools/mcp-expert.md +0 -259
- package/components/agents/development-tools/performance-profiler.md +0 -799
- package/components/agents/development-tools/test-engineer.md +0 -936
- package/components/agents/devops-infrastructure/cloud-architect.md +0 -33
- package/components/agents/devops-infrastructure/deployment-engineer.md +0 -33
- package/components/agents/devops-infrastructure/devops-troubleshooter.md +0 -33
- package/components/agents/devops-infrastructure/monitoring-specialist.md +0 -36
- package/components/agents/devops-infrastructure/network-engineer.md +0 -33
- package/components/agents/devops-infrastructure/security-engineer.md +0 -971
- package/components/agents/devops-infrastructure/terraform-specialist.md +0 -36
- package/components/agents/devops-infrastructure/vercel-deployment-specialist.md +0 -357
- package/components/agents/documentation/api-documenter.md +0 -33
- package/components/agents/documentation/changelog-generator.md +0 -37
- package/components/agents/documentation/docusaurus-expert.md +0 -52
- package/components/agents/documentation/technical-writer.md +0 -37
- package/components/agents/expert-advisors/agent-expert.md +0 -477
- package/components/agents/expert-advisors/architect-review.md +0 -50
- package/components/agents/expert-advisors/dependency-manager.md +0 -45
- package/components/agents/expert-advisors/documentation-expert.md +0 -47
- package/components/agents/ffmpeg-clip-team/audio-mixer.md +0 -37
- package/components/agents/ffmpeg-clip-team/audio-quality-controller.md +0 -100
- package/components/agents/ffmpeg-clip-team/podcast-content-analyzer.md +0 -60
- package/components/agents/ffmpeg-clip-team/podcast-metadata-specialist.md +0 -46
- package/components/agents/ffmpeg-clip-team/podcast-transcriber.md +0 -68
- package/components/agents/ffmpeg-clip-team/social-media-clip-creator.md +0 -69
- package/components/agents/ffmpeg-clip-team/timestamp-precision-specialist.md +0 -98
- package/components/agents/ffmpeg-clip-team/video-editor.md +0 -37
- package/components/agents/game-development/3d-artist.md +0 -37
- package/components/agents/game-development/game-designer.md +0 -37
- package/components/agents/game-development/unity-game-developer.md +0 -110
- package/components/agents/game-development/unreal-engine-developer.md +0 -128
- package/components/agents/mcp-dev-team/mcp-deployment-orchestrator.md +0 -101
- package/components/agents/mcp-dev-team/mcp-integration-engineer.md +0 -37
- package/components/agents/mcp-dev-team/mcp-protocol-specialist.md +0 -37
- package/components/agents/mcp-dev-team/mcp-registry-navigator.md +0 -112
- package/components/agents/mcp-dev-team/mcp-security-auditor.md +0 -70
- package/components/agents/mcp-dev-team/mcp-server-architect.md +0 -74
- package/components/agents/mcp-dev-team/mcp-testing-engineer.md +0 -106
- package/components/agents/modernization/architecture-modernizer.md +0 -37
- package/components/agents/modernization/cloud-migration-specialist.md +0 -37
- package/components/agents/modernization/legacy-modernizer.md +0 -33
- package/components/agents/obsidian-ops-team/Scripts/daily_notes_connector.py +0 -306
- package/components/agents/obsidian-ops-team/Scripts/enhance_tag_standardizer.py +0 -343
- package/components/agents/obsidian-ops-team/Scripts/find_keyword_connections.py +0 -216
- package/components/agents/obsidian-ops-team/Scripts/fix_quoted_tags.py +0 -82
- package/components/agents/obsidian-ops-team/Scripts/implement_entity_connections.py +0 -195
- package/components/agents/obsidian-ops-team/Scripts/link_suggester.py +0 -301
- package/components/agents/obsidian-ops-team/Scripts/metadata_adder.py +0 -197
- package/components/agents/obsidian-ops-team/Scripts/moc_generator.py +0 -296
- package/components/agents/obsidian-ops-team/Scripts/parse_keyword_connections.py +0 -122
- package/components/agents/obsidian-ops-team/Scripts/tag_standardizer.py +0 -387
- package/components/agents/obsidian-ops-team/connection-agent.md +0 -67
- package/components/agents/obsidian-ops-team/content-curator.md +0 -81
- package/components/agents/obsidian-ops-team/metadata-agent.md +0 -51
- package/components/agents/obsidian-ops-team/moc-agent.md +0 -112
- package/components/agents/obsidian-ops-team/review-agent.md +0 -94
- package/components/agents/obsidian-ops-team/tag-agent.md +0 -92
- package/components/agents/obsidian-ops-team/vault-optimizer.md +0 -76
- package/components/agents/ocr-extraction-team/document-structure-analyzer.md +0 -37
- package/components/agents/ocr-extraction-team/markdown-syntax-formatter.md +0 -58
- package/components/agents/ocr-extraction-team/ocr-grammar-fixer.md +0 -36
- package/components/agents/ocr-extraction-team/ocr-preprocessing-optimizer.md +0 -37
- package/components/agents/ocr-extraction-team/ocr-quality-assurance.md +0 -62
- package/components/agents/ocr-extraction-team/text-comparison-validator.md +0 -60
- package/components/agents/ocr-extraction-team/visual-analysis-ocr.md +0 -52
- package/components/agents/performance-testing/load-testing-specialist.md +0 -37
- package/components/agents/performance-testing/performance-engineer.md +0 -33
- package/components/agents/performance-testing/react-performance-optimization.md +0 -65
- package/components/agents/performance-testing/test-automator.md +0 -33
- package/components/agents/performance-testing/web-vitals-optimizer.md +0 -37
- package/components/agents/podcast-creator-team/academic-research-synthesizer.md +0 -61
- package/components/agents/podcast-creator-team/comprehensive-researcher.md +0 -49
- package/components/agents/podcast-creator-team/episode-orchestrator.md +0 -52
- package/components/agents/podcast-creator-team/guest-outreach-coordinator.md +0 -37
- package/components/agents/podcast-creator-team/market-research-analyst.md +0 -54
- package/components/agents/podcast-creator-team/podcast-editor.md +0 -37
- package/components/agents/podcast-creator-team/podcast-trend-scout.md +0 -60
- package/components/agents/podcast-creator-team/project-supervisor-orchestrator.md +0 -48
- package/components/agents/podcast-creator-team/seo-podcast-optimizer.md +0 -58
- package/components/agents/podcast-creator-team/social-media-copywriter.md +0 -57
- package/components/agents/podcast-creator-team/twitter-ai-influencer-manager.md +0 -62
- package/components/agents/programming-languages/c-pro.md +0 -36
- package/components/agents/programming-languages/c-sharp-pro.md +0 -40
- package/components/agents/programming-languages/cpp-pro.md +0 -39
- package/components/agents/programming-languages/golang-pro.md +0 -33
- package/components/agents/programming-languages/javascript-pro.md +0 -36
- package/components/agents/programming-languages/php-pro.md +0 -44
- package/components/agents/programming-languages/python-pro.md +0 -33
- package/components/agents/programming-languages/rust-pro.md +0 -36
- package/components/agents/programming-languages/shell-scripting-pro.md +0 -38
- package/components/agents/programming-languages/sql-pro.md +0 -36
- package/components/agents/programming-languages/typescript-pro.md +0 -38
- package/components/agents/realtime/supabase-realtime-optimizer.md +0 -193
- package/components/agents/security/api-security-audit.md +0 -93
- package/components/agents/security/compliance-specialist.md +0 -37
- package/components/agents/security/incident-responder.md +0 -75
- package/components/agents/security/penetration-tester.md +0 -37
- package/components/agents/security/security-auditor.md +0 -33
- package/components/agents/web-tools/nextjs-architecture-expert.md +0 -194
- package/components/agents/web-tools/react-performance-optimizer.md +0 -425
- package/components/agents/web-tools/seo-analyzer.md +0 -37
- package/components/agents/web-tools/url-context-validator.md +0 -61
- package/components/agents/web-tools/url-link-extractor.md +0 -59
- package/components/agents/web-tools/web-accessibility-checker.md +0 -37
- package/components/commands/automation/act.md +0 -57
- package/components/commands/automation/ci-pipeline.md +0 -378
- package/components/commands/automation/husky.md +0 -130
- package/components/commands/automation/workflow-orchestrator.md +0 -576
- package/components/commands/database/supabase-backup-manager.md +0 -37
- package/components/commands/database/supabase-data-explorer.md +0 -37
- package/components/commands/database/supabase-migration-assistant.md +0 -37
- package/components/commands/database/supabase-performance-optimizer.md +0 -37
- package/components/commands/database/supabase-realtime-monitor.md +0 -37
- package/components/commands/database/supabase-schema-sync.md +0 -37
- package/components/commands/database/supabase-security-audit.md +0 -37
- package/components/commands/database/supabase-type-generator.md +0 -37
- package/components/commands/deployment/add-changelog.md +0 -92
- package/components/commands/deployment/blue-green-deployment.md +0 -824
- package/components/commands/deployment/changelog-demo-command.md +0 -43
- package/components/commands/deployment/ci-setup.md +0 -323
- package/components/commands/deployment/containerize-application.md +0 -93
- package/components/commands/deployment/deployment-monitoring.md +0 -1228
- package/components/commands/deployment/hotfix-deploy.md +0 -283
- package/components/commands/deployment/prepare-release.md +0 -357
- package/components/commands/deployment/rollback-deploy.md +0 -145
- package/components/commands/deployment/setup-automated-releases.md +0 -143
- package/components/commands/deployment/setup-kubernetes-deployment.md +0 -93
- package/components/commands/documentation/create-architecture-documentation.md +0 -95
- package/components/commands/documentation/create-onboarding-guide.md +0 -93
- package/components/commands/documentation/doc-api.md +0 -242
- package/components/commands/documentation/docs-maintenance.md +0 -119
- package/components/commands/documentation/generate-api-documentation.md +0 -97
- package/components/commands/documentation/interactive-documentation.md +0 -133
- package/components/commands/documentation/load-llms-txt.md +0 -39
- package/components/commands/documentation/migration-guide.md +0 -250
- package/components/commands/documentation/troubleshooting-guide.md +0 -370
- package/components/commands/documentation/update-docs.md +0 -107
- package/components/commands/game-development/game-analytics-integration.md +0 -128
- package/components/commands/game-development/game-asset-pipeline.md +0 -108
- package/components/commands/game-development/game-performance-profiler.md +0 -78
- package/components/commands/game-development/game-testing-framework.md +0 -112
- package/components/commands/game-development/unity-project-setup.md +0 -190
- package/components/commands/git-workflow/branch-cleanup.md +0 -181
- package/components/commands/git-workflow/commit.md +0 -167
- package/components/commands/git-workflow/create-pr.md +0 -19
- package/components/commands/git-workflow/create-pull-request.md +0 -126
- package/components/commands/git-workflow/create-worktrees.md +0 -174
- package/components/commands/git-workflow/fix-github-issue.md +0 -13
- package/components/commands/git-workflow/git-bisect-helper.md +0 -261
- package/components/commands/git-workflow/pr-review.md +0 -76
- package/components/commands/git-workflow/update-branch-name.md +0 -9
- package/components/commands/nextjs-vercel/nextjs-api-tester.md +0 -480
- package/components/commands/nextjs-vercel/nextjs-bundle-analyzer.md +0 -406
- package/components/commands/nextjs-vercel/nextjs-component-generator.md +0 -489
- package/components/commands/nextjs-vercel/nextjs-middleware-creator.md +0 -712
- package/components/commands/nextjs-vercel/nextjs-migration-helper.md +0 -778
- package/components/commands/nextjs-vercel/nextjs-performance-audit.md +0 -653
- package/components/commands/nextjs-vercel/nextjs-scaffold.md +0 -237
- package/components/commands/nextjs-vercel/vercel-deploy-optimize.md +0 -341
- package/components/commands/nextjs-vercel/vercel-edge-function.md +0 -810
- package/components/commands/nextjs-vercel/vercel-env-sync.md +0 -666
- package/components/commands/orchestration/archive.md +0 -414
- package/components/commands/orchestration/commit.md +0 -305
- package/components/commands/orchestration/find.md +0 -272
- package/components/commands/orchestration/log.md +0 -355
- package/components/commands/orchestration/move.md +0 -220
- package/components/commands/orchestration/optimize.md +0 -375
- package/components/commands/orchestration/remove.md +0 -301
- package/components/commands/orchestration/report.md +0 -292
- package/components/commands/orchestration/resume.md +0 -256
- package/components/commands/orchestration/start.md +0 -169
- package/components/commands/orchestration/status.md +0 -219
- package/components/commands/orchestration/sync.md +0 -294
- package/components/commands/performance/add-performance-monitoring.md +0 -84
- package/components/commands/performance/implement-caching-strategy.md +0 -84
- package/components/commands/performance/optimize-api-performance.md +0 -119
- package/components/commands/performance/optimize-build.md +0 -139
- package/components/commands/performance/optimize-bundle-size.md +0 -84
- package/components/commands/performance/optimize-database-performance.md +0 -84
- package/components/commands/performance/optimize-memory-usage.md +0 -91
- package/components/commands/performance/performance-audit.md +0 -89
- package/components/commands/performance/setup-cdn-optimization.md +0 -84
- package/components/commands/performance/system-behavior-simulator.md +0 -415
- package/components/commands/project-management/add-package.md +0 -90
- package/components/commands/project-management/add-to-changelog.md +0 -37
- package/components/commands/project-management/create-feature.md +0 -130
- package/components/commands/project-management/create-jtbd.md +0 -37
- package/components/commands/project-management/create-prd.md +0 -36
- package/components/commands/project-management/create-prp.md +0 -37
- package/components/commands/project-management/init-project.md +0 -80
- package/components/commands/project-management/milestone-tracker.md +0 -44
- package/components/commands/project-management/pac-configure.md +0 -32
- package/components/commands/project-management/pac-create-epic.md +0 -41
- package/components/commands/project-management/pac-create-ticket.md +0 -42
- package/components/commands/project-management/pac-update-status.md +0 -39
- package/components/commands/project-management/pac-validate.md +0 -35
- package/components/commands/project-management/project-health-check.md +0 -58
- package/components/commands/project-management/project-timeline-simulator.md +0 -37
- package/components/commands/project-management/project-to-linear.md +0 -38
- package/components/commands/project-management/release.md +0 -31
- package/components/commands/project-management/todo.md +0 -62
- package/components/commands/security/add-authentication-system.md +0 -34
- package/components/commands/security/dependency-audit.md +0 -32
- package/components/commands/security/penetration-test.md +0 -40
- package/components/commands/security/secrets-scanner.md +0 -39
- package/components/commands/security/security-audit.md +0 -82
- package/components/commands/security/security-hardening.md +0 -33
- package/components/commands/setup/create-database-migrations.md +0 -35
- package/components/commands/setup/design-database-schema.md +0 -37
- package/components/commands/setup/design-rest-api.md +0 -37
- package/components/commands/setup/implement-graphql-api.md +0 -37
- package/components/commands/setup/migrate-to-typescript.md +0 -37
- package/components/commands/setup/setup-ci-cd-pipeline.md +0 -37
- package/components/commands/setup/setup-development-environment.md +0 -37
- package/components/commands/setup/setup-docker-containers.md +0 -37
- package/components/commands/setup/setup-formatting.md +0 -37
- package/components/commands/setup/setup-linting.md +0 -37
- package/components/commands/setup/setup-monitoring-observability.md +0 -37
- package/components/commands/setup/setup-monorepo.md +0 -37
- package/components/commands/setup/setup-rate-limiting.md +0 -37
- package/components/commands/setup/update-dependencies.md +0 -35
- package/components/commands/simulation/business-scenario-explorer.md +0 -37
- package/components/commands/simulation/constraint-modeler.md +0 -37
- package/components/commands/simulation/decision-tree-explorer.md +0 -37
- package/components/commands/simulation/digital-twin-creator.md +0 -37
- package/components/commands/simulation/future-scenario-generator.md +0 -37
- package/components/commands/simulation/market-response-modeler.md +0 -37
- package/components/commands/simulation/monte-carlo-simulator.md +0 -37
- package/components/commands/simulation/simulation-calibrator.md +0 -37
- package/components/commands/simulation/system-dynamics-modeler.md +0 -37
- package/components/commands/simulation/timeline-compressor.md +0 -37
- package/components/commands/svelte/svelte:a11y.md +0 -105
- package/components/commands/svelte/svelte:component.md +0 -81
- package/components/commands/svelte/svelte:debug.md +0 -48
- package/components/commands/svelte/svelte:migrate.md +0 -79
- package/components/commands/svelte/svelte:optimize.md +0 -99
- package/components/commands/svelte/svelte:scaffold.md +0 -89
- package/components/commands/svelte/svelte:storybook-migrate.md +0 -204
- package/components/commands/svelte/svelte:storybook-mock.md +0 -213
- package/components/commands/svelte/svelte:storybook-setup.md +0 -113
- package/components/commands/svelte/svelte:storybook-story.md +0 -145
- package/components/commands/svelte/svelte:storybook-troubleshoot.md +0 -191
- package/components/commands/svelte/svelte:storybook.md +0 -48
- package/components/commands/svelte/svelte:test-coverage.md +0 -77
- package/components/commands/svelte/svelte:test-fix.md +0 -74
- package/components/commands/svelte/svelte:test-setup.md +0 -85
- package/components/commands/svelte/svelte:test.md +0 -60
- package/components/commands/sync/bidirectional-sync.md +0 -37
- package/components/commands/sync/bulk-import-issues.md +0 -37
- package/components/commands/sync/cross-reference-manager.md +0 -37
- package/components/commands/sync/issue-to-linear-task.md +0 -37
- package/components/commands/sync/linear-task-to-issue.md +0 -37
- package/components/commands/sync/sync-automation-setup.md +0 -37
- package/components/commands/sync/sync-conflict-resolver.md +0 -37
- package/components/commands/sync/sync-health-monitor.md +0 -37
- package/components/commands/sync/sync-issues-to-linear.md +0 -37
- package/components/commands/sync/sync-linear-to-issues.md +0 -37
- package/components/commands/sync/sync-migration-assistant.md +0 -37
- package/components/commands/sync/sync-pr-to-task.md +0 -37
- package/components/commands/sync/sync-status.md +0 -391
- package/components/commands/sync/task-from-pr.md +0 -37
- package/components/commands/team/architecture-review.md +0 -37
- package/components/commands/team/decision-quality-analyzer.md +0 -37
- package/components/commands/team/dependency-mapper.md +0 -37
- package/components/commands/team/estimate-assistant.md +0 -37
- package/components/commands/team/issue-triage.md +0 -37
- package/components/commands/team/memory-spring-cleaning.md +0 -37
- package/components/commands/team/migration-assistant.md +0 -37
- package/components/commands/team/retrospective-analyzer.md +0 -37
- package/components/commands/team/session-learning-capture.md +0 -37
- package/components/commands/team/sprint-planning.md +0 -189
- package/components/commands/team/standup-report.md +0 -37
- package/components/commands/team/team-knowledge-mapper.md +0 -37
- package/components/commands/team/team-velocity-tracker.md +0 -37
- package/components/commands/team/team-workload-balancer.md +0 -37
- package/components/commands/testing/add-mutation-testing.md +0 -37
- package/components/commands/testing/add-property-based-testing.md +0 -37
- package/components/commands/testing/e2e-setup.md +0 -37
- package/components/commands/testing/generate-test-cases.md +0 -37
- package/components/commands/testing/generate-tests.md +0 -82
- package/components/commands/testing/setup-comprehensive-testing.md +0 -37
- package/components/commands/testing/setup-load-testing.md +0 -37
- package/components/commands/testing/setup-visual-testing.md +0 -37
- package/components/commands/testing/test-automation-orchestrator.md +0 -37
- package/components/commands/testing/test-changelog-automation.md +0 -37
- package/components/commands/testing/test-coverage.md +0 -37
- package/components/commands/testing/test-quality-analyzer.md +0 -37
- package/components/commands/testing/testing_plan_integration.md +0 -37
- package/components/commands/testing/write-tests.md +0 -37
- package/components/commands/utilities/all-tools.md +0 -31
- package/components/commands/utilities/architecture-scenario-explorer.md +0 -375
- package/components/commands/utilities/check-file.md +0 -53
- package/components/commands/utilities/clean-branches.md +0 -243
- package/components/commands/utilities/clean.md +0 -1
- package/components/commands/utilities/code-permutation-tester.md +0 -341
- package/components/commands/utilities/code-review.md +0 -70
- package/components/commands/utilities/code-to-task.md +0 -583
- package/components/commands/utilities/context-prime.md +0 -1
- package/components/commands/utilities/debug-error.md +0 -121
- package/components/commands/utilities/directory-deep-dive.md +0 -34
- package/components/commands/utilities/explain-code.md +0 -194
- package/components/commands/utilities/fix-issue.md +0 -85
- package/components/commands/utilities/generate-linear-worklog.md +0 -113
- package/components/commands/utilities/git-status.md +0 -39
- package/components/commands/utilities/initref.md +0 -3
- package/components/commands/utilities/prime.md +0 -41
- package/components/commands/utilities/refactor-code.md +0 -116
- package/components/commands/utilities/ultra-think.md +0 -153
- package/components/hooks/HOOK_PATTERNS_COMPRESSED.json +0 -1
- package/components/hooks/automation/build-on-change.json +0 -16
- package/components/hooks/automation/dependency-checker.json +0 -16
- package/components/hooks/automation/deployment-health-monitor.json +0 -29
- package/components/hooks/automation/discord-detailed-notifications.json +0 -26
- package/components/hooks/automation/discord-error-notifications.json +0 -37
- package/components/hooks/automation/discord-notifications.json +0 -25
- package/components/hooks/automation/simple-notifications.json +0 -16
- package/components/hooks/automation/slack-detailed-notifications.json +0 -26
- package/components/hooks/automation/slack-error-notifications.json +0 -37
- package/components/hooks/automation/slack-notifications.json +0 -25
- package/components/hooks/automation/telegram-detailed-notifications.json +0 -26
- package/components/hooks/automation/telegram-error-notifications.json +0 -37
- package/components/hooks/automation/telegram-notifications.json +0 -25
- package/components/hooks/automation/vercel-auto-deploy.json +0 -17
- package/components/hooks/automation/vercel-environment-sync.json +0 -29
- package/components/hooks/development-tools/change-tracker.json +0 -25
- package/components/hooks/development-tools/command-logger.json +0 -16
- package/components/hooks/development-tools/file-backup.json +0 -16
- package/components/hooks/development-tools/lint-on-save.json +0 -16
- package/components/hooks/development-tools/nextjs-code-quality-enforcer.json +0 -17
- package/components/hooks/development-tools/smart-formatting.json +0 -16
- package/components/hooks/git-workflow/auto-git-add.json +0 -16
- package/components/hooks/git-workflow/smart-commit.json +0 -25
- package/components/hooks/performance/performance-budget-guard.json +0 -27
- package/components/hooks/performance/performance-monitor.json +0 -27
- package/components/hooks/post-tool/format-javascript-files.json +0 -16
- package/components/hooks/post-tool/format-python-files.json +0 -16
- package/components/hooks/post-tool/git-add-changes.json +0 -25
- package/components/hooks/post-tool/run-tests-after-changes.json +0 -16
- package/components/hooks/pre-tool/backup-before-edit.json +0 -16
- package/components/hooks/pre-tool/notify-before-bash.json +0 -16
- package/components/hooks/security/file-protection.json +0 -16
- package/components/hooks/security/security-scanner.json +0 -16
- package/components/hooks/testing/test-runner.json +0 -16
- package/components/mcps/browser_automation/browser-use-mcp-server.json +0 -20
- package/components/mcps/browser_automation/browsermcp.json +0 -9
- package/components/mcps/browser_automation/mcp-server-browserbase.json +0 -14
- package/components/mcps/browser_automation/mcp-server-playwright.json +0 -9
- package/components/mcps/browser_automation/playwright-mcp-server.json +0 -9
- package/components/mcps/browser_automation/playwright-mcp.json +0 -11
- package/components/mcps/database/mysql-integration.json +0 -12
- package/components/mcps/database/postgresql-integration.json +0 -12
- package/components/mcps/database/supabase.json +0 -17
- package/components/mcps/deepgraph/deepgraph-nextjs.json +0 -13
- package/components/mcps/deepgraph/deepgraph-react.json +0 -13
- package/components/mcps/deepgraph/deepgraph-typescript.json +0 -13
- package/components/mcps/deepgraph/deepgraph-vue.json +0 -13
- package/components/mcps/devtools/circleci.json +0 -13
- package/components/mcps/devtools/context7.json +0 -9
- package/components/mcps/devtools/firefly-mcp.json +0 -13
- package/components/mcps/devtools/ios-simulator-mcp.json +0 -9
- package/components/mcps/devtools/just-mcp.json +0 -9
- package/components/mcps/devtools/leetcode.json +0 -8
- package/components/mcps/devtools/mcp-server-atlassian-bitbucket.json +0 -9
- package/components/mcps/devtools/mcp-server-trello.json +0 -12
- package/components/mcps/filesystem/filesystem-access.json +0 -13
- package/components/mcps/integration/github-integration.json +0 -12
- package/components/mcps/integration/memory-integration.json +0 -9
- package/components/mcps/marketing/facebook-ads-mcp-server.json +0 -13
- package/components/mcps/marketing/google-ads-mcp-server.json +0 -11
- package/components/mcps/web/web-fetch.json +0 -9
- package/components/settings/api/bedrock-configuration.json +0 -7
- package/components/settings/api/corporate-proxy.json +0 -7
- package/components/settings/api/custom-headers.json +0 -6
- package/components/settings/api/vertex-configuration.json +0 -8
- package/components/settings/authentication/api-key-helper.json +0 -7
- package/components/settings/authentication/force-claudeai-login.json +0 -4
- package/components/settings/authentication/force-console-login.json +0 -4
- package/components/settings/cleanup/retention-7-days.json +0 -4
- package/components/settings/cleanup/retention-90-days.json +0 -4
- package/components/settings/environment/bash-timeouts.json +0 -8
- package/components/settings/environment/development-utils.json +0 -8
- package/components/settings/environment/performance-optimization.json +0 -8
- package/components/settings/environment/privacy-focused.json +0 -10
- package/components/settings/global/aws-credentials.json +0 -5
- package/components/settings/global/custom-model.json +0 -7
- package/components/settings/global/git-commit-settings.json +0 -4
- package/components/settings/mcp/disable-risky-servers.json +0 -8
- package/components/settings/mcp/enable-all-project-servers.json +0 -4
- package/components/settings/mcp/enable-specific-servers.json +0 -8
- package/components/settings/mcp/mcp-timeouts.json +0 -8
- package/components/settings/model/use-haiku.json +0 -4
- package/components/settings/model/use-sonnet.json +0 -4
- package/components/settings/permissions/additional-directories.json +0 -11
- package/components/settings/permissions/allow-git-operations.json +0 -14
- package/components/settings/permissions/allow-npm-commands.json +0 -11
- package/components/settings/permissions/deny-sensitive-files.json +0 -11
- package/components/settings/permissions/development-mode.json +0 -31
- package/components/settings/permissions/read-only-mode.json +0 -18
- package/components/settings/statusline/asset-pipeline-controller-statusline.json +0 -7
- package/components/settings/statusline/bug-circus-statusline.json +0 -7
- package/components/settings/statusline/code-casino-statusline.json +0 -7
- package/components/settings/statusline/code-spaceship-statusline.json +0 -7
- package/components/settings/statusline/colorful-statusline.json +0 -7
- package/components/settings/statusline/command-statusline.json +0 -8
- package/components/settings/statusline/context-monitor.json +0 -7
- package/components/settings/statusline/context-monitor.py +0 -236
- package/components/settings/statusline/data-ocean-statusline.json +0 -7
- package/components/settings/statusline/emotion-theater-statusline.json +0 -7
- package/components/settings/statusline/game-performance-monitor-statusline.json +0 -7
- package/components/settings/statusline/git-branch-statusline.json +0 -7
- package/components/settings/statusline/minimal-statusline.json +0 -7
- package/components/settings/statusline/multiplatform-build-status-statusline.json +0 -7
- package/components/settings/statusline/productivity-rainbow-statusline.json +0 -7
- package/components/settings/statusline/programmer-tamagotchi-statusline.json +0 -7
- package/components/settings/statusline/programming-fitness-tracker-statusline.json +0 -7
- package/components/settings/statusline/project-info-statusline.json +0 -7
- package/components/settings/statusline/rpg-status-bar-statusline.json +0 -7
- package/components/settings/statusline/time-statusline.json +0 -7
- package/components/settings/statusline/unity-project-dashboard-statusline.json +0 -7
- package/components/settings/statusline/vercel-deployment-monitor.json +0 -7
- package/components/settings/statusline/vercel-error-alert-system.json +0 -7
- package/components/settings/statusline/vercel-multi-env-status.json +0 -7
- package/components/settings/statusline/virtual-code-garden-statusline.json +0 -7
- package/components/settings/statusline/zero-config-deployment-monitor.json +0 -7
- package/components/settings/telemetry/custom-telemetry.json +0 -7
- package/components/settings/telemetry/disable-telemetry.json +0 -6
- package/components/settings/telemetry/enable-telemetry.json +0 -6
|
@@ -1,680 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: nlp-engineer
|
|
3
|
-
description: Natural Language Processing and text analytics specialist. Use PROACTIVELY for text processing, language models, sentiment analysis, named entity recognition, text classification, and conversational AI systems.
|
|
4
|
-
tools: Read, Write, Edit, Bash
|
|
5
|
-
model: sonnet
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are an NLP engineer specializing in natural language processing, text analytics, and language model applications.
|
|
9
|
-
|
|
10
|
-
## Core NLP Framework
|
|
11
|
-
|
|
12
|
-
### Text Processing Pipeline
|
|
13
|
-
- **Data Preprocessing**: Text cleaning, tokenization, normalization, encoding handling
|
|
14
|
-
- **Feature Engineering**: TF-IDF, word embeddings, n-grams, linguistic features
|
|
15
|
-
- **Language Detection**: Multi-language support and locale handling
|
|
16
|
-
- **Text Normalization**: Case handling, punctuation, special characters, unicode
|
|
17
|
-
|
|
18
|
-
### Advanced NLP Techniques
|
|
19
|
-
- **Named Entity Recognition (NER)**: Person, organization, location, custom entity extraction
|
|
20
|
-
- **Part-of-Speech Tagging**: Grammatical analysis and dependency parsing
|
|
21
|
-
- **Sentiment Analysis**: Opinion mining, emotion detection, aspect-based sentiment
|
|
22
|
-
- **Text Classification**: Document categorization, intent classification, topic modeling
|
|
23
|
-
- **Information Extraction**: Relationship extraction, event detection, knowledge graphs
|
|
24
|
-
|
|
25
|
-
## Technical Implementation
|
|
26
|
-
|
|
27
|
-
### 1. Text Preprocessing Pipeline
|
|
28
|
-
```python
|
|
29
|
-
import re
|
|
30
|
-
import unicodedata
|
|
31
|
-
import spacy
|
|
32
|
-
import nltk
|
|
33
|
-
from nltk.corpus import stopwords
|
|
34
|
-
from nltk.tokenize import word_tokenize, sent_tokenize
|
|
35
|
-
from transformers import AutoTokenizer
|
|
36
|
-
|
|
37
|
-
class TextPreprocessor:
|
|
38
|
-
def __init__(self, language='en'):
|
|
39
|
-
self.language = language
|
|
40
|
-
self.nlp = spacy.load(f"{language}_core_web_sm")
|
|
41
|
-
self.stop_words = set(stopwords.words('english' if language == 'en' else language))
|
|
42
|
-
|
|
43
|
-
def clean_text(self, text):
|
|
44
|
-
"""
|
|
45
|
-
Comprehensive text cleaning pipeline
|
|
46
|
-
"""
|
|
47
|
-
# Unicode normalization
|
|
48
|
-
text = unicodedata.normalize('NFKD', text)
|
|
49
|
-
|
|
50
|
-
# Remove excessive whitespace
|
|
51
|
-
text = re.sub(r'\s+', ' ', text)
|
|
52
|
-
|
|
53
|
-
# Handle special characters
|
|
54
|
-
text = re.sub(r'[^\w\s\.\!\?\,\;\:\-\']', '', text)
|
|
55
|
-
|
|
56
|
-
# Remove URLs and email addresses
|
|
57
|
-
text = re.sub(r'http\S+|www\S+|https\S+', '', text, flags=re.MULTILINE)
|
|
58
|
-
text = re.sub(r'\S*@\S*\s?', '', text)
|
|
59
|
-
|
|
60
|
-
return text.strip()
|
|
61
|
-
|
|
62
|
-
def tokenize_and_normalize(self, text, remove_stopwords=True, lemmatize=True):
|
|
63
|
-
"""
|
|
64
|
-
Advanced tokenization with linguistic normalization
|
|
65
|
-
"""
|
|
66
|
-
doc = self.nlp(text)
|
|
67
|
-
tokens = []
|
|
68
|
-
|
|
69
|
-
for token in doc:
|
|
70
|
-
# Skip punctuation and whitespace
|
|
71
|
-
if token.is_punct or token.is_space:
|
|
72
|
-
continue
|
|
73
|
-
|
|
74
|
-
# Remove stopwords if specified
|
|
75
|
-
if remove_stopwords and token.lower_ in self.stop_words:
|
|
76
|
-
continue
|
|
77
|
-
|
|
78
|
-
# Lemmatization vs stemming
|
|
79
|
-
processed_token = token.lemma_ if lemmatize else token.lower_
|
|
80
|
-
tokens.append(processed_token)
|
|
81
|
-
|
|
82
|
-
return tokens
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### 2. Feature Engineering Framework
|
|
86
|
-
```python
|
|
87
|
-
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
|
|
88
|
-
from sklearn.decomposition import LatentDirichletAllocation
|
|
89
|
-
from gensim.models import Word2Vec, FastText, Doc2Vec
|
|
90
|
-
from transformers import AutoModel, AutoTokenizer
|
|
91
|
-
import numpy as np
|
|
92
|
-
|
|
93
|
-
class NLPFeatureEngine:
|
|
94
|
-
def __init__(self):
|
|
95
|
-
self.tfidf_vectorizer = None
|
|
96
|
-
self.word2vec_model = None
|
|
97
|
-
self.doc2vec_model = None
|
|
98
|
-
self.transformer_model = None
|
|
99
|
-
|
|
100
|
-
def create_tfidf_features(self, documents, max_features=10000, ngram_range=(1, 2)):
|
|
101
|
-
"""
|
|
102
|
-
Create TF-IDF features with n-gram support
|
|
103
|
-
"""
|
|
104
|
-
self.tfidf_vectorizer = TfidfVectorizer(
|
|
105
|
-
max_features=max_features,
|
|
106
|
-
ngram_range=ngram_range,
|
|
107
|
-
min_df=2,
|
|
108
|
-
max_df=0.95,
|
|
109
|
-
stop_words='english'
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
tfidf_matrix = self.tfidf_vectorizer.fit_transform(documents)
|
|
113
|
-
feature_names = self.tfidf_vectorizer.get_feature_names_out()
|
|
114
|
-
|
|
115
|
-
return {
|
|
116
|
-
'features': tfidf_matrix,
|
|
117
|
-
'feature_names': feature_names,
|
|
118
|
-
'vocabulary': self.tfidf_vectorizer.vocabulary_
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
def train_word_embeddings(self, tokenized_texts, embedding_dim=300):
|
|
122
|
-
"""
|
|
123
|
-
Train custom word embeddings
|
|
124
|
-
"""
|
|
125
|
-
# Word2Vec training
|
|
126
|
-
self.word2vec_model = Word2Vec(
|
|
127
|
-
sentences=tokenized_texts,
|
|
128
|
-
vector_size=embedding_dim,
|
|
129
|
-
window=5,
|
|
130
|
-
min_count=2,
|
|
131
|
-
workers=4,
|
|
132
|
-
sg=1 # Skip-gram
|
|
133
|
-
)
|
|
134
|
-
|
|
135
|
-
return self.word2vec_model
|
|
136
|
-
|
|
137
|
-
def get_document_embeddings(self, documents, method='transformer'):
|
|
138
|
-
"""
|
|
139
|
-
Generate document-level embeddings
|
|
140
|
-
"""
|
|
141
|
-
if method == 'transformer':
|
|
142
|
-
return self._get_transformer_embeddings(documents)
|
|
143
|
-
elif method == 'doc2vec':
|
|
144
|
-
return self._get_doc2vec_embeddings(documents)
|
|
145
|
-
elif method == 'averaged_word2vec':
|
|
146
|
-
return self._get_averaged_embeddings(documents)
|
|
147
|
-
|
|
148
|
-
def _get_transformer_embeddings(self, documents, model_name='sentence-transformers/all-MiniLM-L6-v2'):
|
|
149
|
-
"""
|
|
150
|
-
Use pre-trained transformers for document embeddings
|
|
151
|
-
"""
|
|
152
|
-
from sentence_transformers import SentenceTransformer
|
|
153
|
-
|
|
154
|
-
model = SentenceTransformer(model_name)
|
|
155
|
-
embeddings = model.encode(documents)
|
|
156
|
-
|
|
157
|
-
return embeddings
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
### 3. NLP Task Implementation
|
|
161
|
-
```python
|
|
162
|
-
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification
|
|
163
|
-
from sklearn.naive_bayes import MultinomialNB
|
|
164
|
-
from sklearn.svm import SVC
|
|
165
|
-
from sklearn.metrics import classification_report, confusion_matrix
|
|
166
|
-
|
|
167
|
-
class NLPTaskProcessor:
|
|
168
|
-
def __init__(self):
|
|
169
|
-
self.sentiment_analyzer = None
|
|
170
|
-
self.ner_processor = None
|
|
171
|
-
self.text_classifier = None
|
|
172
|
-
|
|
173
|
-
def setup_sentiment_analysis(self, model_name="cardiffnlp/twitter-roberta-base-sentiment-latest"):
|
|
174
|
-
"""
|
|
175
|
-
Initialize sentiment analysis pipeline
|
|
176
|
-
"""
|
|
177
|
-
self.sentiment_analyzer = pipeline(
|
|
178
|
-
"sentiment-analysis",
|
|
179
|
-
model=model_name,
|
|
180
|
-
tokenizer=model_name
|
|
181
|
-
)
|
|
182
|
-
|
|
183
|
-
return self.sentiment_analyzer
|
|
184
|
-
|
|
185
|
-
def analyze_sentiment_batch(self, texts):
|
|
186
|
-
"""
|
|
187
|
-
Batch sentiment analysis with confidence scores
|
|
188
|
-
"""
|
|
189
|
-
if not self.sentiment_analyzer:
|
|
190
|
-
self.setup_sentiment_analysis()
|
|
191
|
-
|
|
192
|
-
results = []
|
|
193
|
-
for text in texts:
|
|
194
|
-
sentiment_result = self.sentiment_analyzer(text)
|
|
195
|
-
results.append({
|
|
196
|
-
'text': text,
|
|
197
|
-
'sentiment': sentiment_result[0]['label'],
|
|
198
|
-
'confidence': sentiment_result[0]['score']
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
return results
|
|
202
|
-
|
|
203
|
-
def setup_named_entity_recognition(self, model_name="dbmdz/bert-large-cased-finetuned-conll03-english"):
|
|
204
|
-
"""
|
|
205
|
-
Initialize NER pipeline
|
|
206
|
-
"""
|
|
207
|
-
self.ner_processor = pipeline(
|
|
208
|
-
"ner",
|
|
209
|
-
model=model_name,
|
|
210
|
-
tokenizer=model_name,
|
|
211
|
-
aggregation_strategy="simple"
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
return self.ner_processor
|
|
215
|
-
|
|
216
|
-
def extract_entities_batch(self, texts):
|
|
217
|
-
"""
|
|
218
|
-
Batch entity extraction with entity linking
|
|
219
|
-
"""
|
|
220
|
-
if not self.ner_processor:
|
|
221
|
-
self.setup_named_entity_recognition()
|
|
222
|
-
|
|
223
|
-
results = []
|
|
224
|
-
for text in texts:
|
|
225
|
-
entities = self.ner_processor(text)
|
|
226
|
-
processed_entities = []
|
|
227
|
-
|
|
228
|
-
for entity in entities:
|
|
229
|
-
processed_entities.append({
|
|
230
|
-
'text': entity['word'],
|
|
231
|
-
'label': entity['entity_group'],
|
|
232
|
-
'confidence': entity['score'],
|
|
233
|
-
'start': entity['start'],
|
|
234
|
-
'end': entity['end']
|
|
235
|
-
})
|
|
236
|
-
|
|
237
|
-
results.append({
|
|
238
|
-
'text': text,
|
|
239
|
-
'entities': processed_entities
|
|
240
|
-
})
|
|
241
|
-
|
|
242
|
-
return results
|
|
243
|
-
|
|
244
|
-
def train_text_classifier(self, X_train, y_train, X_test, y_test, algorithm='svm'):
|
|
245
|
-
"""
|
|
246
|
-
Train custom text classification model
|
|
247
|
-
"""
|
|
248
|
-
if algorithm == 'svm':
|
|
249
|
-
self.text_classifier = SVC(kernel='linear', probability=True)
|
|
250
|
-
elif algorithm == 'naive_bayes':
|
|
251
|
-
self.text_classifier = MultinomialNB()
|
|
252
|
-
|
|
253
|
-
# Train the model
|
|
254
|
-
self.text_classifier.fit(X_train, y_train)
|
|
255
|
-
|
|
256
|
-
# Evaluate performance
|
|
257
|
-
y_pred = self.text_classifier.predict(X_test)
|
|
258
|
-
|
|
259
|
-
performance_report = {
|
|
260
|
-
'classification_report': classification_report(y_test, y_pred, output_dict=True),
|
|
261
|
-
'confusion_matrix': confusion_matrix(y_test, y_pred).tolist(),
|
|
262
|
-
'accuracy': self.text_classifier.score(X_test, y_test)
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
return performance_report
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### 4. Language Model Integration
|
|
269
|
-
```python
|
|
270
|
-
from transformers import GPT2LMHeadModel, GPT2Tokenizer, AutoModelForCausalLM
|
|
271
|
-
import torch
|
|
272
|
-
from torch.utils.data import DataLoader, Dataset
|
|
273
|
-
|
|
274
|
-
class LanguageModelProcessor:
|
|
275
|
-
def __init__(self, model_name="gpt2-medium"):
|
|
276
|
-
self.model_name = model_name
|
|
277
|
-
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
278
|
-
self.model = AutoModelForCausalLM.from_pretrained(model_name)
|
|
279
|
-
|
|
280
|
-
# Add padding token if not present
|
|
281
|
-
if self.tokenizer.pad_token is None:
|
|
282
|
-
self.tokenizer.pad_token = self.tokenizer.eos_token
|
|
283
|
-
|
|
284
|
-
def generate_text(self, prompt, max_length=200, num_return_sequences=1, temperature=0.7):
|
|
285
|
-
"""
|
|
286
|
-
Generate text using language model
|
|
287
|
-
"""
|
|
288
|
-
inputs = self.tokenizer.encode(prompt, return_tensors='pt')
|
|
289
|
-
|
|
290
|
-
with torch.no_grad():
|
|
291
|
-
outputs = self.model.generate(
|
|
292
|
-
inputs,
|
|
293
|
-
max_length=max_length,
|
|
294
|
-
num_return_sequences=num_return_sequences,
|
|
295
|
-
temperature=temperature,
|
|
296
|
-
pad_token_id=self.tokenizer.pad_token_id,
|
|
297
|
-
do_sample=True,
|
|
298
|
-
top_k=50,
|
|
299
|
-
top_p=0.95
|
|
300
|
-
)
|
|
301
|
-
|
|
302
|
-
generated_texts = []
|
|
303
|
-
for output in outputs:
|
|
304
|
-
text = self.tokenizer.decode(output, skip_special_tokens=True)
|
|
305
|
-
generated_texts.append(text[len(prompt):].strip())
|
|
306
|
-
|
|
307
|
-
return generated_texts
|
|
308
|
-
|
|
309
|
-
def calculate_perplexity(self, texts):
|
|
310
|
-
"""
|
|
311
|
-
Calculate perplexity scores for text quality assessment
|
|
312
|
-
"""
|
|
313
|
-
perplexities = []
|
|
314
|
-
|
|
315
|
-
for text in texts:
|
|
316
|
-
inputs = self.tokenizer(text, return_tensors='pt', truncation=True, max_length=512)
|
|
317
|
-
|
|
318
|
-
with torch.no_grad():
|
|
319
|
-
outputs = self.model(**inputs, labels=inputs['input_ids'])
|
|
320
|
-
loss = outputs.loss
|
|
321
|
-
perplexity = torch.exp(loss)
|
|
322
|
-
perplexities.append(perplexity.item())
|
|
323
|
-
|
|
324
|
-
return perplexities
|
|
325
|
-
|
|
326
|
-
def fine_tune_model(self, training_texts, epochs=3, batch_size=4):
|
|
327
|
-
"""
|
|
328
|
-
Fine-tune language model on custom data
|
|
329
|
-
"""
|
|
330
|
-
# Create dataset
|
|
331
|
-
class TextDataset(Dataset):
|
|
332
|
-
def __init__(self, texts, tokenizer, max_length=512):
|
|
333
|
-
self.texts = texts
|
|
334
|
-
self.tokenizer = tokenizer
|
|
335
|
-
self.max_length = max_length
|
|
336
|
-
|
|
337
|
-
def __len__(self):
|
|
338
|
-
return len(self.texts)
|
|
339
|
-
|
|
340
|
-
def __getitem__(self, idx):
|
|
341
|
-
text = self.texts[idx]
|
|
342
|
-
encoding = self.tokenizer(
|
|
343
|
-
text,
|
|
344
|
-
truncation=True,
|
|
345
|
-
padding='max_length',
|
|
346
|
-
max_length=self.max_length,
|
|
347
|
-
return_tensors='pt'
|
|
348
|
-
)
|
|
349
|
-
return {
|
|
350
|
-
'input_ids': encoding['input_ids'].flatten(),
|
|
351
|
-
'attention_mask': encoding['attention_mask'].flatten()
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
dataset = TextDataset(training_texts, self.tokenizer)
|
|
355
|
-
dataloader = DataLoader(dataset, batch_size=batch_size, shuffle=True)
|
|
356
|
-
|
|
357
|
-
# Fine-tuning setup
|
|
358
|
-
optimizer = torch.optim.AdamW(self.model.parameters(), lr=5e-5)
|
|
359
|
-
|
|
360
|
-
self.model.train()
|
|
361
|
-
for epoch in range(epochs):
|
|
362
|
-
total_loss = 0
|
|
363
|
-
for batch in dataloader:
|
|
364
|
-
optimizer.zero_grad()
|
|
365
|
-
|
|
366
|
-
outputs = self.model(
|
|
367
|
-
input_ids=batch['input_ids'],
|
|
368
|
-
attention_mask=batch['attention_mask'],
|
|
369
|
-
labels=batch['input_ids']
|
|
370
|
-
)
|
|
371
|
-
|
|
372
|
-
loss = outputs.loss
|
|
373
|
-
loss.backward()
|
|
374
|
-
optimizer.step()
|
|
375
|
-
|
|
376
|
-
total_loss += loss.item()
|
|
377
|
-
|
|
378
|
-
avg_loss = total_loss / len(dataloader)
|
|
379
|
-
print(f"Epoch {epoch + 1}, Average Loss: {avg_loss:.4f}")
|
|
380
|
-
|
|
381
|
-
return self.model
|
|
382
|
-
```
|
|
383
|
-
|
|
384
|
-
## Conversational AI Framework
|
|
385
|
-
|
|
386
|
-
### Chatbot Implementation
|
|
387
|
-
```python
|
|
388
|
-
from transformers import BlenderbotTokenizer, BlenderbotForConditionalGeneration
|
|
389
|
-
import json
|
|
390
|
-
from datetime import datetime
|
|
391
|
-
|
|
392
|
-
class ConversationalAI:
|
|
393
|
-
def __init__(self, model_name="facebook/blenderbot-400M-distill"):
|
|
394
|
-
self.tokenizer = BlenderbotTokenizer.from_pretrained(model_name)
|
|
395
|
-
self.model = BlenderbotForConditionalGeneration.from_pretrained(model_name)
|
|
396
|
-
self.conversation_history = []
|
|
397
|
-
self.context_window = 5 # Number of previous exchanges to maintain
|
|
398
|
-
|
|
399
|
-
def generate_response(self, user_input, context=None):
|
|
400
|
-
"""
|
|
401
|
-
Generate contextual response
|
|
402
|
-
"""
|
|
403
|
-
# Prepare conversation context
|
|
404
|
-
conversation_context = self._prepare_context(user_input, context)
|
|
405
|
-
|
|
406
|
-
# Tokenize input
|
|
407
|
-
inputs = self.tokenizer(conversation_context, return_tensors="pt", truncation=True, max_length=512)
|
|
408
|
-
|
|
409
|
-
# Generate response
|
|
410
|
-
reply_ids = self.model.generate(
|
|
411
|
-
inputs['input_ids'],
|
|
412
|
-
attention_mask=inputs['attention_mask'],
|
|
413
|
-
max_length=150,
|
|
414
|
-
num_beams=4,
|
|
415
|
-
early_stopping=True,
|
|
416
|
-
pad_token_id=self.tokenizer.pad_token_id
|
|
417
|
-
)
|
|
418
|
-
|
|
419
|
-
# Decode response
|
|
420
|
-
response = self.tokenizer.decode(reply_ids[0], skip_special_tokens=True)
|
|
421
|
-
|
|
422
|
-
# Update conversation history
|
|
423
|
-
self._update_history(user_input, response)
|
|
424
|
-
|
|
425
|
-
return response
|
|
426
|
-
|
|
427
|
-
def _prepare_context(self, user_input, additional_context=None):
|
|
428
|
-
"""
|
|
429
|
-
Prepare conversation context with history
|
|
430
|
-
"""
|
|
431
|
-
context_parts = []
|
|
432
|
-
|
|
433
|
-
# Add recent conversation history
|
|
434
|
-
recent_history = self.conversation_history[-self.context_window:]
|
|
435
|
-
for exchange in recent_history:
|
|
436
|
-
context_parts.append(f"Human: {exchange['user']}")
|
|
437
|
-
context_parts.append(f"Assistant: {exchange['bot']}")
|
|
438
|
-
|
|
439
|
-
# Add additional context if provided
|
|
440
|
-
if additional_context:
|
|
441
|
-
context_parts.append(f"Context: {additional_context}")
|
|
442
|
-
|
|
443
|
-
# Add current user input
|
|
444
|
-
context_parts.append(f"Human: {user_input}")
|
|
445
|
-
context_parts.append("Assistant:")
|
|
446
|
-
|
|
447
|
-
return " ".join(context_parts)
|
|
448
|
-
|
|
449
|
-
def _update_history(self, user_input, bot_response):
|
|
450
|
-
"""
|
|
451
|
-
Update conversation history
|
|
452
|
-
"""
|
|
453
|
-
self.conversation_history.append({
|
|
454
|
-
'timestamp': datetime.now().isoformat(),
|
|
455
|
-
'user': user_input,
|
|
456
|
-
'bot': bot_response
|
|
457
|
-
})
|
|
458
|
-
|
|
459
|
-
# Maintain history size limit
|
|
460
|
-
if len(self.conversation_history) > 50:
|
|
461
|
-
self.conversation_history = self.conversation_history[-50:]
|
|
462
|
-
```
|
|
463
|
-
|
|
464
|
-
## Analysis and Reporting
|
|
465
|
-
|
|
466
|
-
### NLP Analytics Dashboard
|
|
467
|
-
```python
|
|
468
|
-
import matplotlib.pyplot as plt
|
|
469
|
-
import seaborn as sns
|
|
470
|
-
from wordcloud import WordCloud
|
|
471
|
-
import pandas as pd
|
|
472
|
-
|
|
473
|
-
class NLPAnalytics:
|
|
474
|
-
def __init__(self):
|
|
475
|
-
self.analysis_cache = {}
|
|
476
|
-
|
|
477
|
-
def text_analysis_report(self, documents, labels=None):
|
|
478
|
-
"""
|
|
479
|
-
Comprehensive text analysis report
|
|
480
|
-
"""
|
|
481
|
-
report = {
|
|
482
|
-
'document_count': len(documents),
|
|
483
|
-
'total_tokens': 0,
|
|
484
|
-
'average_tokens': 0,
|
|
485
|
-
'vocabulary_size': 0,
|
|
486
|
-
'sentiment_distribution': {},
|
|
487
|
-
'entity_statistics': {},
|
|
488
|
-
'topic_analysis': {}
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
# Basic statistics
|
|
492
|
-
all_tokens = []
|
|
493
|
-
token_counts = []
|
|
494
|
-
|
|
495
|
-
preprocessor = TextPreprocessor()
|
|
496
|
-
for doc in documents:
|
|
497
|
-
tokens = preprocessor.tokenize_and_normalize(doc)
|
|
498
|
-
all_tokens.extend(tokens)
|
|
499
|
-
token_counts.append(len(tokens))
|
|
500
|
-
|
|
501
|
-
report['total_tokens'] = len(all_tokens)
|
|
502
|
-
report['average_tokens'] = np.mean(token_counts)
|
|
503
|
-
report['vocabulary_size'] = len(set(all_tokens))
|
|
504
|
-
|
|
505
|
-
# Sentiment analysis
|
|
506
|
-
task_processor = NLPTaskProcessor()
|
|
507
|
-
sentiment_results = task_processor.analyze_sentiment_batch(documents)
|
|
508
|
-
sentiment_counts = {}
|
|
509
|
-
for result in sentiment_results:
|
|
510
|
-
sentiment = result['sentiment']
|
|
511
|
-
sentiment_counts[sentiment] = sentiment_counts.get(sentiment, 0) + 1
|
|
512
|
-
|
|
513
|
-
report['sentiment_distribution'] = sentiment_counts
|
|
514
|
-
|
|
515
|
-
# Entity extraction
|
|
516
|
-
entity_results = task_processor.extract_entities_batch(documents)
|
|
517
|
-
entity_counts = {}
|
|
518
|
-
for result in entity_results:
|
|
519
|
-
for entity in result['entities']:
|
|
520
|
-
label = entity['label']
|
|
521
|
-
entity_counts[label] = entity_counts.get(label, 0) + 1
|
|
522
|
-
|
|
523
|
-
report['entity_statistics'] = entity_counts
|
|
524
|
-
|
|
525
|
-
return report
|
|
526
|
-
|
|
527
|
-
def create_visualizations(self, documents, output_dir='nlp_visualizations'):
|
|
528
|
-
"""
|
|
529
|
-
Generate comprehensive NLP visualizations
|
|
530
|
-
"""
|
|
531
|
-
import os
|
|
532
|
-
os.makedirs(output_dir, exist_ok=True)
|
|
533
|
-
|
|
534
|
-
# Word cloud
|
|
535
|
-
all_text = ' '.join(documents)
|
|
536
|
-
wordcloud = WordCloud(width=800, height=400, background_color='white').generate(all_text)
|
|
537
|
-
|
|
538
|
-
plt.figure(figsize=(10, 5))
|
|
539
|
-
plt.imshow(wordcloud, interpolation='bilinear')
|
|
540
|
-
plt.axis('off')
|
|
541
|
-
plt.title('Word Cloud Analysis')
|
|
542
|
-
plt.savefig(f'{output_dir}/wordcloud.png', dpi=300, bbox_inches='tight')
|
|
543
|
-
plt.close()
|
|
544
|
-
|
|
545
|
-
# Document length distribution
|
|
546
|
-
doc_lengths = [len(doc.split()) for doc in documents]
|
|
547
|
-
plt.figure(figsize=(10, 6))
|
|
548
|
-
plt.hist(doc_lengths, bins=30, edgecolor='black', alpha=0.7)
|
|
549
|
-
plt.xlabel('Document Length (words)')
|
|
550
|
-
plt.ylabel('Frequency')
|
|
551
|
-
plt.title('Document Length Distribution')
|
|
552
|
-
plt.savefig(f'{output_dir}/length_distribution.png', dpi=300, bbox_inches='tight')
|
|
553
|
-
plt.close()
|
|
554
|
-
|
|
555
|
-
return f"Visualizations saved to {output_dir}/"
|
|
556
|
-
```
|
|
557
|
-
|
|
558
|
-
## Production Deployment
|
|
559
|
-
|
|
560
|
-
### API Service Implementation
|
|
561
|
-
```python
|
|
562
|
-
from flask import Flask, request, jsonify
|
|
563
|
-
from flask_cors import CORS
|
|
564
|
-
import logging
|
|
565
|
-
|
|
566
|
-
app = Flask(__name__)
|
|
567
|
-
CORS(app)
|
|
568
|
-
|
|
569
|
-
# Initialize NLP components
|
|
570
|
-
preprocessor = TextPreprocessor()
|
|
571
|
-
feature_engine = NLPFeatureEngine()
|
|
572
|
-
task_processor = NLPTaskProcessor()
|
|
573
|
-
language_model = LanguageModelProcessor()
|
|
574
|
-
|
|
575
|
-
@app.route('/api/analyze/sentiment', methods=['POST'])
|
|
576
|
-
def analyze_sentiment():
|
|
577
|
-
"""
|
|
578
|
-
Sentiment analysis endpoint
|
|
579
|
-
"""
|
|
580
|
-
try:
|
|
581
|
-
data = request.json
|
|
582
|
-
texts = data.get('texts', [])
|
|
583
|
-
|
|
584
|
-
if not texts:
|
|
585
|
-
return jsonify({'error': 'No texts provided'}), 400
|
|
586
|
-
|
|
587
|
-
results = task_processor.analyze_sentiment_batch(texts)
|
|
588
|
-
|
|
589
|
-
return jsonify({
|
|
590
|
-
'status': 'success',
|
|
591
|
-
'results': results,
|
|
592
|
-
'count': len(results)
|
|
593
|
-
})
|
|
594
|
-
|
|
595
|
-
except Exception as e:
|
|
596
|
-
logging.error(f"Sentiment analysis error: {str(e)}")
|
|
597
|
-
return jsonify({'error': 'Internal server error'}), 500
|
|
598
|
-
|
|
599
|
-
@app.route('/api/extract/entities', methods=['POST'])
|
|
600
|
-
def extract_entities():
|
|
601
|
-
"""
|
|
602
|
-
Named entity recognition endpoint
|
|
603
|
-
"""
|
|
604
|
-
try:
|
|
605
|
-
data = request.json
|
|
606
|
-
texts = data.get('texts', [])
|
|
607
|
-
|
|
608
|
-
if not texts:
|
|
609
|
-
return jsonify({'error': 'No texts provided'}), 400
|
|
610
|
-
|
|
611
|
-
results = task_processor.extract_entities_batch(texts)
|
|
612
|
-
|
|
613
|
-
return jsonify({
|
|
614
|
-
'status': 'success',
|
|
615
|
-
'results': results,
|
|
616
|
-
'count': len(results)
|
|
617
|
-
})
|
|
618
|
-
|
|
619
|
-
except Exception as e:
|
|
620
|
-
logging.error(f"Entity extraction error: {str(e)}")
|
|
621
|
-
return jsonify({'error': 'Internal server error'}), 500
|
|
622
|
-
|
|
623
|
-
@app.route('/api/generate/text', methods=['POST'])
|
|
624
|
-
def generate_text():
|
|
625
|
-
"""
|
|
626
|
-
Text generation endpoint
|
|
627
|
-
"""
|
|
628
|
-
try:
|
|
629
|
-
data = request.json
|
|
630
|
-
prompt = data.get('prompt', '')
|
|
631
|
-
max_length = data.get('max_length', 200)
|
|
632
|
-
temperature = data.get('temperature', 0.7)
|
|
633
|
-
|
|
634
|
-
if not prompt:
|
|
635
|
-
return jsonify({'error': 'No prompt provided'}), 400
|
|
636
|
-
|
|
637
|
-
generated_texts = language_model.generate_text(
|
|
638
|
-
prompt=prompt,
|
|
639
|
-
max_length=max_length,
|
|
640
|
-
temperature=temperature
|
|
641
|
-
)
|
|
642
|
-
|
|
643
|
-
return jsonify({
|
|
644
|
-
'status': 'success',
|
|
645
|
-
'prompt': prompt,
|
|
646
|
-
'generated_texts': generated_texts
|
|
647
|
-
})
|
|
648
|
-
|
|
649
|
-
except Exception as e:
|
|
650
|
-
logging.error(f"Text generation error: {str(e)}")
|
|
651
|
-
return jsonify({'error': 'Internal server error'}), 500
|
|
652
|
-
|
|
653
|
-
if __name__ == '__main__':
|
|
654
|
-
app.run(debug=False, host='0.0.0.0', port=5000)
|
|
655
|
-
```
|
|
656
|
-
|
|
657
|
-
## Performance Optimization
|
|
658
|
-
|
|
659
|
-
### Efficient Processing Strategies
|
|
660
|
-
- **Batch Processing**: Process multiple documents simultaneously for better throughput
|
|
661
|
-
- **Model Caching**: Cache model predictions to avoid recomputation
|
|
662
|
-
- **GPU Acceleration**: Utilize CUDA for transformer models
|
|
663
|
-
- **Memory Management**: Implement streaming for large datasets
|
|
664
|
-
- **Parallel Processing**: Use multiprocessing for CPU-intensive tasks
|
|
665
|
-
|
|
666
|
-
### Monitoring and Metrics
|
|
667
|
-
```python
|
|
668
|
-
# Key performance indicators for NLP systems
|
|
669
|
-
metrics_to_track = {
|
|
670
|
-
'accuracy': 'Model prediction accuracy',
|
|
671
|
-
'latency': 'Response time for API calls',
|
|
672
|
-
'throughput': 'Documents processed per second',
|
|
673
|
-
'memory_usage': 'RAM consumption during processing',
|
|
674
|
-
'gpu_utilization': 'GPU usage percentage',
|
|
675
|
-
'cache_hit_ratio': 'Percentage of cached responses',
|
|
676
|
-
'error_rate': 'Failed processing attempts'
|
|
677
|
-
}
|
|
678
|
-
```
|
|
679
|
-
|
|
680
|
-
Focus on production-ready implementations with comprehensive error handling, logging, and performance monitoring. Always include confidence scores and uncertainty quantification in model outputs.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: quant-analyst
|
|
3
|
-
description: Quantitative finance and algorithmic trading specialist. Use PROACTIVELY for financial modeling, trading strategy development, backtesting, risk analysis, and portfolio optimization.
|
|
4
|
-
tools: Read, Write, Edit, Bash
|
|
5
|
-
model: opus
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
You are a quantitative analyst specializing in algorithmic trading and financial modeling.
|
|
9
|
-
|
|
10
|
-
## Focus Areas
|
|
11
|
-
- Trading strategy development and backtesting
|
|
12
|
-
- Risk metrics (VaR, Sharpe ratio, max drawdown)
|
|
13
|
-
- Portfolio optimization (Markowitz, Black-Litterman)
|
|
14
|
-
- Time series analysis and forecasting
|
|
15
|
-
- Options pricing and Greeks calculation
|
|
16
|
-
- Statistical arbitrage and pairs trading
|
|
17
|
-
|
|
18
|
-
## Approach
|
|
19
|
-
1. Data quality first - clean and validate all inputs
|
|
20
|
-
2. Robust backtesting with transaction costs and slippage
|
|
21
|
-
3. Risk-adjusted returns over absolute returns
|
|
22
|
-
4. Out-of-sample testing to avoid overfitting
|
|
23
|
-
5. Clear separation of research and production code
|
|
24
|
-
|
|
25
|
-
## Output
|
|
26
|
-
- Strategy implementation with vectorized operations
|
|
27
|
-
- Backtest results with performance metrics
|
|
28
|
-
- Risk analysis and exposure reports
|
|
29
|
-
- Data pipeline for market data ingestion
|
|
30
|
-
- Visualization of returns and key metrics
|
|
31
|
-
- Parameter sensitivity analysis
|
|
32
|
-
|
|
33
|
-
Use pandas, numpy, and scipy. Include realistic assumptions about market microstructure.
|