prjct-cli 0.11.5 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/README.md +81 -25
- package/bin/dev.js +1 -1
- package/bin/generate-views.js +209 -0
- package/bin/migrate-to-json.js +742 -0
- package/bin/prjct +5 -5
- package/bin/serve.js +226 -50
- package/core/__tests__/agentic/{memory-system.test.js → memory-system.test.ts} +12 -23
- package/core/__tests__/agentic/{plan-mode.test.js → plan-mode.test.ts} +26 -24
- package/core/__tests__/agentic/{prompt-builder.test.js → prompt-builder.test.ts} +3 -8
- package/core/__tests__/utils/{date-helper.test.js → date-helper.test.ts} +19 -30
- package/core/__tests__/utils/{output.test.js → output.test.ts} +12 -24
- package/core/agentic/agent-router.ts +137 -0
- package/core/agentic/chain-of-thought.ts +228 -0
- package/core/agentic/command-executor/command-executor.ts +384 -0
- package/core/agentic/command-executor/index.ts +16 -0
- package/core/agentic/command-executor/status-signal.ts +38 -0
- package/core/agentic/command-executor/types.ts +79 -0
- package/core/agentic/command-executor.ts +8 -0
- package/core/agentic/{context-builder.js → context-builder.ts} +92 -81
- package/core/agentic/context-filter.ts +365 -0
- package/core/agentic/ground-truth/index.ts +76 -0
- package/core/agentic/ground-truth/types.ts +33 -0
- package/core/agentic/ground-truth/utils.ts +48 -0
- package/core/agentic/ground-truth/verifiers/analyze.ts +54 -0
- package/core/agentic/ground-truth/verifiers/done.ts +75 -0
- package/core/agentic/ground-truth/verifiers/feature.ts +70 -0
- package/core/agentic/ground-truth/verifiers/index.ts +37 -0
- package/core/agentic/ground-truth/verifiers/init.ts +52 -0
- package/core/agentic/ground-truth/verifiers/now.ts +57 -0
- package/core/agentic/ground-truth/verifiers/ship.ts +85 -0
- package/core/agentic/ground-truth/verifiers/spec.ts +45 -0
- package/core/agentic/ground-truth/verifiers/sync.ts +47 -0
- package/core/agentic/ground-truth/verifiers.ts +6 -0
- package/core/agentic/ground-truth.ts +8 -0
- package/core/agentic/loop-detector/error-analysis.ts +97 -0
- package/core/agentic/loop-detector/hallucination.ts +71 -0
- package/core/agentic/loop-detector/index.ts +41 -0
- package/core/agentic/loop-detector/loop-detector.ts +222 -0
- package/core/agentic/loop-detector/types.ts +66 -0
- package/core/agentic/loop-detector.ts +8 -0
- package/core/agentic/memory-system/history.ts +53 -0
- package/core/agentic/memory-system/index.ts +192 -0
- package/core/agentic/memory-system/patterns.ts +156 -0
- package/core/agentic/memory-system/semantic-memories.ts +277 -0
- package/core/agentic/memory-system/session.ts +21 -0
- package/core/agentic/memory-system/types.ts +159 -0
- package/core/agentic/memory-system.ts +8 -0
- package/core/agentic/parallel-tools.ts +165 -0
- package/core/agentic/plan-mode/approval.ts +57 -0
- package/core/agentic/plan-mode/constants.ts +44 -0
- package/core/agentic/plan-mode/index.ts +28 -0
- package/core/agentic/plan-mode/plan-mode.ts +406 -0
- package/core/agentic/plan-mode/types.ts +193 -0
- package/core/agentic/plan-mode.ts +8 -0
- package/core/agentic/prompt-builder.ts +566 -0
- package/core/agentic/response-templates.ts +164 -0
- package/core/agentic/semantic-compression.ts +273 -0
- package/core/agentic/services.ts +206 -0
- package/core/agentic/smart-context.ts +476 -0
- package/core/agentic/{template-loader.js → template-loader.ts} +27 -16
- package/core/agentic/think-blocks.ts +202 -0
- package/core/agentic/tool-registry.ts +119 -0
- package/core/agentic/validation-rules.ts +313 -0
- package/core/agents/index.ts +28 -0
- package/core/agents/performance.ts +444 -0
- package/core/agents/types.ts +126 -0
- package/core/bus/{index.js → index.ts} +57 -61
- package/core/command-registry/categories.ts +23 -0
- package/core/command-registry/commands.ts +15 -0
- package/core/command-registry/core-commands.ts +319 -0
- package/core/command-registry/index.ts +158 -0
- package/core/command-registry/optional-commands.ts +119 -0
- package/core/command-registry/setup-commands.ts +53 -0
- package/core/command-registry/types.ts +59 -0
- package/core/command-registry.ts +9 -0
- package/core/commands/analysis.ts +298 -0
- package/core/commands/analytics.ts +288 -0
- package/core/commands/base.ts +273 -0
- package/core/commands/index.ts +211 -0
- package/core/commands/maintenance.ts +226 -0
- package/core/commands/planning.ts +311 -0
- package/core/commands/setup.ts +309 -0
- package/core/commands/shipping.ts +188 -0
- package/core/commands/types.ts +183 -0
- package/core/commands/workflow.ts +226 -0
- package/core/commands.ts +11 -0
- package/core/constants/formats.ts +187 -0
- package/core/constants/index.ts +7 -0
- package/core/{context-sync.js → context-sync.ts} +59 -26
- package/core/data/agents-manager.ts +76 -0
- package/core/data/analysis-manager.ts +83 -0
- package/core/data/base-manager.ts +156 -0
- package/core/data/ideas-manager.ts +81 -0
- package/core/data/index.ts +32 -0
- package/core/data/outcomes-manager.ts +96 -0
- package/core/data/project-manager.ts +75 -0
- package/core/data/roadmap-manager.ts +118 -0
- package/core/data/shipped-manager.ts +65 -0
- package/core/data/state-manager.ts +214 -0
- package/core/domain/{agent-generator.js → agent-generator.ts} +77 -57
- package/core/domain/{agent-loader.js → agent-loader.ts} +65 -56
- package/core/domain/{agent-matcher.js → agent-matcher.ts} +51 -24
- package/core/domain/{agent-validator.js → agent-validator.ts} +70 -37
- package/core/domain/{analyzer.js → analyzer.ts} +91 -85
- package/core/domain/{architect-session.js → architect-session.ts} +49 -34
- package/core/domain/{architecture-generator.js → architecture-generator.ts} +25 -13
- package/core/domain/{context-estimator.js → context-estimator.ts} +57 -36
- package/core/domain/{product-standards.js → product-standards.ts} +40 -26
- package/core/domain/{smart-cache.js → smart-cache.ts} +39 -30
- package/core/domain/{snapshot-manager.js → snapshot-manager.ts} +103 -100
- package/core/domain/{task-analyzer.js → task-analyzer.ts} +82 -43
- package/core/domain/task-stack/index.ts +19 -0
- package/core/domain/task-stack/parser.ts +86 -0
- package/core/domain/task-stack/storage.ts +123 -0
- package/core/domain/task-stack/task-stack.ts +340 -0
- package/core/domain/task-stack/types.ts +51 -0
- package/core/domain/task-stack.ts +8 -0
- package/core/{index.js → index.ts} +61 -18
- package/core/infrastructure/{agent-detector.js → agent-detector.ts} +55 -19
- package/core/infrastructure/agents/{claude-agent.js → claude-agent.ts} +61 -21
- package/core/infrastructure/{author-detector.js → author-detector.ts} +42 -49
- package/core/infrastructure/{capability-installer.js → capability-installer.ts} +51 -27
- package/core/infrastructure/{command-installer.js → command-installer/command-installer.ts} +43 -144
- package/core/infrastructure/command-installer/global-config.ts +106 -0
- package/core/infrastructure/command-installer/index.ts +25 -0
- package/core/infrastructure/command-installer/types.ts +41 -0
- package/core/infrastructure/command-installer.ts +8 -0
- package/core/infrastructure/{config-manager.js → config-manager.ts} +60 -80
- package/core/infrastructure/{editors-config.js → editors-config.ts} +33 -31
- package/core/infrastructure/legacy-installer-detector/cleanup.ts +216 -0
- package/core/infrastructure/legacy-installer-detector/detection.ts +95 -0
- package/core/infrastructure/legacy-installer-detector/index.ts +171 -0
- package/core/infrastructure/legacy-installer-detector/migration.ts +87 -0
- package/core/infrastructure/legacy-installer-detector/types.ts +42 -0
- package/core/infrastructure/legacy-installer-detector.ts +7 -0
- package/core/infrastructure/migrator/file-operations.ts +125 -0
- package/core/infrastructure/migrator/index.ts +288 -0
- package/core/infrastructure/migrator/project-scanner.ts +89 -0
- package/core/infrastructure/migrator/reports.ts +117 -0
- package/core/infrastructure/migrator/types.ts +124 -0
- package/core/infrastructure/migrator/validation.ts +94 -0
- package/core/infrastructure/migrator/version-migration.ts +117 -0
- package/core/infrastructure/migrator.ts +10 -0
- package/core/infrastructure/{path-manager.js → path-manager.ts} +51 -91
- package/core/infrastructure/session-manager/index.ts +23 -0
- package/core/infrastructure/session-manager/migration.ts +88 -0
- package/core/infrastructure/session-manager/session-manager.ts +307 -0
- package/core/infrastructure/session-manager/types.ts +45 -0
- package/core/infrastructure/session-manager.ts +8 -0
- package/core/infrastructure/{setup.js → setup.ts} +29 -21
- package/core/infrastructure/{update-checker.js → update-checker.ts} +40 -18
- package/core/outcomes/analyzer.ts +333 -0
- package/core/outcomes/index.ts +34 -0
- package/core/outcomes/recorder.ts +194 -0
- package/core/outcomes/types.ts +145 -0
- package/core/plugin/{hooks.js → hooks.ts} +56 -58
- package/core/plugin/{index.js → index.ts} +19 -8
- package/core/plugin/{loader.js → loader.ts} +87 -69
- package/core/plugin/{registry.js → registry.ts} +49 -45
- package/core/plugins/{webhook.js → webhook.ts} +43 -27
- package/core/schemas/agents.ts +27 -0
- package/core/schemas/analysis.ts +41 -0
- package/core/schemas/ideas.ts +83 -0
- package/core/schemas/index.ts +73 -0
- package/core/schemas/outcomes.ts +22 -0
- package/core/schemas/project.ts +26 -0
- package/core/schemas/roadmap.ts +90 -0
- package/core/schemas/shipped.ts +82 -0
- package/core/schemas/state.ts +107 -0
- package/core/session/index.ts +17 -0
- package/core/session/{metrics.js → metrics.ts} +64 -46
- package/core/session/{index.js → session-manager.ts} +51 -117
- package/core/session/types.ts +29 -0
- package/core/session/utils.ts +57 -0
- package/core/state/index.ts +25 -0
- package/core/state/manager.ts +376 -0
- package/core/state/types.ts +185 -0
- package/core/tsconfig.json +22 -0
- package/core/types/index.ts +506 -0
- package/core/utils/{animations.js → animations.ts} +74 -28
- package/core/utils/{branding.js → branding.ts} +29 -4
- package/core/utils/{date-helper.js → date-helper.ts} +31 -74
- package/core/utils/file-helper.ts +262 -0
- package/core/utils/{jsonl-helper.js → jsonl-helper.ts} +71 -107
- package/core/utils/{logger.js → logger.ts} +24 -12
- package/core/utils/{output.js → output.ts} +25 -13
- package/core/utils/{project-capabilities.js → project-capabilities.ts} +31 -18
- package/core/utils/{session-helper.js → session-helper.ts} +79 -66
- package/core/utils/{version.js → version.ts} +23 -31
- package/core/view-generator.ts +536 -0
- package/package.json +23 -17
- package/packages/shared/.turbo/turbo-build.log +14 -0
- package/packages/shared/dist/index.d.ts +8 -613
- package/packages/shared/dist/index.d.ts.map +1 -0
- package/packages/shared/dist/index.js +4110 -118
- package/packages/shared/dist/schemas.d.ts +408 -0
- package/packages/shared/dist/schemas.d.ts.map +1 -0
- package/packages/shared/dist/types.d.ts +144 -0
- package/packages/shared/dist/types.d.ts.map +1 -0
- package/packages/shared/dist/unified.d.ts +139 -0
- package/packages/shared/dist/unified.d.ts.map +1 -0
- package/packages/shared/dist/utils.d.ts +60 -0
- package/packages/shared/dist/utils.d.ts.map +1 -0
- package/packages/shared/package.json +4 -4
- package/packages/shared/src/index.ts +1 -0
- package/packages/shared/src/unified.ts +174 -0
- package/packages/web/app/api/claude/sessions/route.ts +1 -1
- package/packages/web/app/api/claude/status/route.ts +1 -1
- package/packages/web/app/api/migrate/route.ts +46 -0
- package/packages/web/app/api/projects/[id]/route.ts +1 -1
- package/packages/web/app/api/projects/[id]/stats/route.ts +30 -2
- package/packages/web/app/api/projects/[id]/status/route.ts +1 -1
- package/packages/web/app/api/projects/route.ts +1 -1
- package/packages/web/app/api/settings/route.ts +97 -0
- package/packages/web/app/api/v2/projects/[id]/unified/route.ts +57 -0
- package/packages/web/app/globals.css +38 -0
- package/packages/web/app/layout.tsx +10 -2
- package/packages/web/app/page.tsx +9 -224
- package/packages/web/app/project/[id]/page.tsx +191 -63
- package/packages/web/app/project/[id]/stats/loading.tsx +43 -0
- package/packages/web/app/project/[id]/stats/page.tsx +204 -163
- package/packages/web/app/settings/page.tsx +222 -2
- package/packages/web/components/ActivityTimeline/ActivityTimeline.constants.ts +2 -0
- package/packages/web/components/ActivityTimeline/ActivityTimeline.tsx +50 -0
- package/packages/web/components/ActivityTimeline/ActivityTimeline.types.ts +8 -0
- package/packages/web/components/ActivityTimeline/hooks/index.ts +2 -0
- package/packages/web/components/ActivityTimeline/hooks/useExpandable.ts +9 -0
- package/packages/web/components/ActivityTimeline/hooks/useGroupedEvents.ts +23 -0
- package/packages/web/components/ActivityTimeline/index.ts +2 -0
- package/packages/web/components/AgentsCard/AgentsCard.tsx +63 -0
- package/packages/web/components/AgentsCard/AgentsCard.types.ts +13 -0
- package/packages/web/components/AgentsCard/index.ts +2 -0
- package/packages/web/components/AppSidebar/AppSidebar.tsx +190 -0
- package/packages/web/components/AppSidebar/index.ts +1 -0
- package/packages/web/components/BackLink/BackLink.tsx +18 -0
- package/packages/web/components/BackLink/BackLink.types.ts +5 -0
- package/packages/web/components/BackLink/index.ts +2 -0
- package/packages/web/components/BentoCard/BentoCard.constants.ts +16 -0
- package/packages/web/components/BentoCard/BentoCard.tsx +47 -0
- package/packages/web/components/BentoCard/BentoCard.types.ts +15 -0
- package/packages/web/components/BentoCard/index.ts +2 -0
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.constants.ts +9 -0
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.tsx +18 -0
- package/packages/web/components/BentoCardSkeleton/BentoCardSkeleton.types.ts +5 -0
- package/packages/web/components/BentoCardSkeleton/index.ts +2 -0
- package/packages/web/components/{stats → BentoGrid}/BentoGrid.tsx +4 -8
- package/packages/web/components/BentoGrid/BentoGrid.types.ts +4 -0
- package/packages/web/components/BentoGrid/index.ts +2 -0
- package/packages/web/components/CommandButton/index.ts +1 -0
- package/packages/web/components/ConnectionStatus/index.ts +1 -0
- package/packages/web/components/DashboardContent/DashboardContent.tsx +254 -0
- package/packages/web/components/DashboardContent/index.ts +1 -0
- package/packages/web/components/DateGroup/DateGroup.tsx +18 -0
- package/packages/web/components/DateGroup/DateGroup.types.ts +6 -0
- package/packages/web/components/DateGroup/DateGroup.utils.ts +11 -0
- package/packages/web/components/DateGroup/index.ts +2 -0
- package/packages/web/components/{stats → EmptyState}/EmptyState.tsx +1 -10
- package/packages/web/components/EmptyState/EmptyState.types.ts +10 -0
- package/packages/web/components/EmptyState/index.ts +2 -0
- package/packages/web/components/EventRow/EventRow.constants.ts +10 -0
- package/packages/web/components/EventRow/EventRow.tsx +49 -0
- package/packages/web/components/EventRow/EventRow.types.ts +7 -0
- package/packages/web/components/EventRow/EventRow.utils.ts +49 -0
- package/packages/web/components/EventRow/index.ts +2 -0
- package/packages/web/components/ExpandButton/ExpandButton.tsx +18 -0
- package/packages/web/components/ExpandButton/ExpandButton.types.ts +6 -0
- package/packages/web/components/ExpandButton/index.ts +2 -0
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.tsx +14 -0
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.types.ts +5 -0
- package/packages/web/components/HealthGradientBackground/HealthGradientBackground.utils.ts +13 -0
- package/packages/web/components/HealthGradientBackground/index.ts +2 -0
- package/packages/web/components/HeroSection/HeroSection.tsx +55 -0
- package/packages/web/components/HeroSection/HeroSection.types.ts +14 -0
- package/packages/web/components/HeroSection/HeroSection.utils.ts +7 -0
- package/packages/web/components/HeroSection/hooks/index.ts +2 -0
- package/packages/web/components/HeroSection/hooks/useCountUp.ts +45 -0
- package/packages/web/components/HeroSection/hooks/useWeeklyActivity.ts +18 -0
- package/packages/web/components/HeroSection/index.ts +2 -0
- package/packages/web/components/{stats → IdeasCard}/IdeasCard.tsx +3 -14
- package/packages/web/components/IdeasCard/IdeasCard.types.ts +9 -0
- package/packages/web/components/IdeasCard/index.ts +2 -0
- package/packages/web/components/InsightMessage/InsightMessage.tsx +9 -0
- package/packages/web/components/InsightMessage/InsightMessage.types.ts +3 -0
- package/packages/web/components/InsightMessage/index.ts +2 -0
- package/packages/web/components/Logo/index.ts +1 -0
- package/packages/web/components/MarkdownContent/index.ts +1 -0
- package/packages/web/components/NowCard/NowCard.tsx +93 -0
- package/packages/web/components/NowCard/NowCard.types.ts +15 -0
- package/packages/web/components/NowCard/index.ts +2 -0
- package/packages/web/components/ProgressRing/ProgressRing.constants.ts +20 -0
- package/packages/web/components/{stats → ProgressRing}/ProgressRing.tsx +4 -27
- package/packages/web/components/ProgressRing/ProgressRing.types.ts +11 -0
- package/packages/web/components/ProgressRing/index.ts +2 -0
- package/packages/web/components/ProjectAvatar/index.ts +1 -0
- package/packages/web/components/Providers/index.ts +1 -0
- package/packages/web/components/QueueCard/QueueCard.tsx +72 -0
- package/packages/web/components/QueueCard/QueueCard.types.ts +11 -0
- package/packages/web/components/QueueCard/QueueCard.utils.ts +12 -0
- package/packages/web/components/QueueCard/index.ts +2 -0
- package/packages/web/components/{stats → RoadmapCard}/RoadmapCard.tsx +3 -23
- package/packages/web/components/RoadmapCard/RoadmapCard.types.ts +15 -0
- package/packages/web/components/RoadmapCard/index.ts +2 -0
- package/packages/web/components/{stats → ShipsCard}/ShipsCard.tsx +4 -22
- package/packages/web/components/ShipsCard/ShipsCard.types.ts +12 -0
- package/packages/web/components/ShipsCard/ShipsCard.utils.ts +4 -0
- package/packages/web/components/ShipsCard/index.ts +2 -0
- package/packages/web/components/{stats → SparklineChart}/SparklineChart.tsx +1 -7
- package/packages/web/components/SparklineChart/SparklineChart.types.ts +6 -0
- package/packages/web/components/SparklineChart/index.ts +2 -0
- package/packages/web/components/StreakCard/StreakCard.constants.ts +2 -0
- package/packages/web/components/{stats → StreakCard}/StreakCard.tsx +5 -11
- package/packages/web/components/StreakCard/StreakCard.types.ts +4 -0
- package/packages/web/components/StreakCard/index.ts +2 -0
- package/packages/web/components/TasksCounter/TasksCounter.tsx +14 -0
- package/packages/web/components/TasksCounter/TasksCounter.types.ts +3 -0
- package/packages/web/components/TasksCounter/index.ts +2 -0
- package/packages/web/components/TechStackBadges/index.ts +1 -0
- package/packages/web/components/{TerminalTab.tsx → TerminalTabs/TerminalTab.tsx} +11 -0
- package/packages/web/components/{TerminalTabs.tsx → TerminalTabs/TerminalTabs.tsx} +29 -28
- package/packages/web/components/TerminalTabs/index.ts +1 -0
- package/packages/web/components/VelocityBadge/VelocityBadge.tsx +27 -0
- package/packages/web/components/VelocityBadge/VelocityBadge.types.ts +3 -0
- package/packages/web/components/VelocityBadge/index.ts +2 -0
- package/packages/web/components/VelocityCard/VelocityCard.tsx +71 -0
- package/packages/web/components/VelocityCard/VelocityCard.types.ts +7 -0
- package/packages/web/components/VelocityCard/index.ts +2 -0
- package/packages/web/components/WeeklySparkline/WeeklySparkline.tsx +13 -0
- package/packages/web/components/WeeklySparkline/WeeklySparkline.types.ts +3 -0
- package/packages/web/components/WeeklySparkline/index.ts +2 -0
- package/packages/web/components/ui/input.tsx +21 -0
- package/packages/web/context/TerminalTabsContext.tsx +46 -1
- package/packages/web/hooks/useClaudeTerminal.ts +71 -21
- package/packages/web/hooks/useProjectStats.ts +55 -0
- package/packages/web/hooks/useProjects.ts +6 -6
- package/packages/web/lib/actions/projects.ts +15 -0
- package/packages/web/lib/json-loader.ts +630 -0
- package/packages/web/lib/services/index.ts +9 -0
- package/packages/web/lib/services/migration.server.ts +600 -0
- package/packages/web/lib/services/projects.server.ts +52 -0
- package/packages/web/lib/services/stats.server.ts +264 -0
- package/packages/web/lib/unified-loader.ts +396 -0
- package/packages/web/package.json +10 -7
- package/packages/web/server.ts +58 -8
- package/templates/commands/done.md +76 -32
- package/templates/commands/feature.md +121 -47
- package/templates/commands/idea.md +81 -8
- package/templates/commands/now.md +41 -17
- package/templates/commands/ship.md +64 -25
- package/templates/commands/sync.md +28 -3
- package/core/agentic/agent-router.js +0 -140
- package/core/agentic/chain-of-thought.js +0 -578
- package/core/agentic/command-executor.js +0 -417
- package/core/agentic/context-filter.js +0 -354
- package/core/agentic/ground-truth.js +0 -591
- package/core/agentic/loop-detector.js +0 -406
- package/core/agentic/memory-system.js +0 -845
- package/core/agentic/parallel-tools.js +0 -366
- package/core/agentic/plan-mode.js +0 -572
- package/core/agentic/prompt-builder.js +0 -352
- package/core/agentic/response-templates.js +0 -290
- package/core/agentic/semantic-compression.js +0 -517
- package/core/agentic/think-blocks.js +0 -657
- package/core/agentic/tool-registry.js +0 -184
- package/core/agentic/validation-rules.js +0 -380
- package/core/command-registry.js +0 -698
- package/core/commands.js +0 -2237
- package/core/domain/task-stack.js +0 -497
- package/core/infrastructure/legacy-installer-detector.js +0 -546
- package/core/infrastructure/migrator.js +0 -796
- package/core/infrastructure/session-manager.js +0 -390
- package/core/utils/file-helper.js +0 -329
- package/packages/web/app/api/projects/[id]/delete/route.ts +0 -21
- package/packages/web/app/api/stats/route.ts +0 -38
- package/packages/web/components/AppSidebar.tsx +0 -113
- package/packages/web/components/stats/ActivityTimeline.tsx +0 -201
- package/packages/web/components/stats/AgentsCard.tsx +0 -56
- package/packages/web/components/stats/BentoCard.tsx +0 -88
- package/packages/web/components/stats/HeroSection.tsx +0 -172
- package/packages/web/components/stats/NowCard.tsx +0 -71
- package/packages/web/components/stats/QueueCard.tsx +0 -58
- package/packages/web/components/stats/VelocityCard.tsx +0 -60
- package/packages/web/components/stats/index.ts +0 -17
- package/packages/web/hooks/useStats.ts +0 -28
- /package/packages/web/components/{CommandButton.tsx → CommandButton/CommandButton.tsx} +0 -0
- /package/packages/web/components/{ConnectionStatus.tsx → ConnectionStatus/ConnectionStatus.tsx} +0 -0
- /package/packages/web/components/{Logo.tsx → Logo/Logo.tsx} +0 -0
- /package/packages/web/components/{MarkdownContent.tsx → MarkdownContent/MarkdownContent.tsx} +0 -0
- /package/packages/web/components/{ProjectAvatar.tsx → ProjectAvatar/ProjectAvatar.tsx} +0 -0
- /package/packages/web/components/{providers.tsx → Providers/Providers.tsx} +0 -0
- /package/packages/web/components/{TechStackBadges.tsx → TechStackBadges/TechStackBadges.tsx} +0 -0
|
@@ -3,25 +3,46 @@
|
|
|
3
3
|
* Handles conversational state for ARCHITECT MODE (Agent-based, not deterministic)
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import fs from 'fs/promises'
|
|
7
|
+
import path from 'path'
|
|
8
|
+
|
|
9
|
+
interface ConversationEntry {
|
|
10
|
+
question: string
|
|
11
|
+
answer: string
|
|
12
|
+
timestamp: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface ArchitectSessionData {
|
|
16
|
+
idea: string
|
|
17
|
+
projectType: string
|
|
18
|
+
active: boolean
|
|
19
|
+
startedAt: string
|
|
20
|
+
completedAt?: string
|
|
21
|
+
conversation: ConversationEntry[]
|
|
22
|
+
answers: Record<string, string>
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface SessionSummary {
|
|
26
|
+
idea: string
|
|
27
|
+
projectType: string
|
|
28
|
+
conversationLength: number
|
|
29
|
+
insights: number
|
|
30
|
+
startedAt: string
|
|
31
|
+
completedAt: string
|
|
32
|
+
}
|
|
8
33
|
|
|
9
34
|
class ArchitectSession {
|
|
10
35
|
/**
|
|
11
36
|
* Initialize new architect session
|
|
12
|
-
* @param {string} idea - Project idea
|
|
13
|
-
* @param {string} projectType - Type of project (web, api, mobile, cli, data)
|
|
14
|
-
* @param {string} globalPath - Global project path
|
|
15
|
-
* @returns {Promise<Object>} Session object
|
|
16
37
|
*/
|
|
17
|
-
async init(idea, projectType, globalPath) {
|
|
18
|
-
const session = {
|
|
38
|
+
async init(idea: string, projectType: string, globalPath: string): Promise<ArchitectSessionData> {
|
|
39
|
+
const session: ArchitectSessionData = {
|
|
19
40
|
idea,
|
|
20
41
|
projectType,
|
|
21
42
|
active: true,
|
|
22
43
|
startedAt: new Date().toISOString(),
|
|
23
|
-
conversation: [],
|
|
24
|
-
answers: {},
|
|
44
|
+
conversation: [],
|
|
45
|
+
answers: {},
|
|
25
46
|
}
|
|
26
47
|
|
|
27
48
|
await this.save(session, globalPath)
|
|
@@ -31,7 +52,7 @@ class ArchitectSession {
|
|
|
31
52
|
/**
|
|
32
53
|
* Load active session
|
|
33
54
|
*/
|
|
34
|
-
async load(globalPath) {
|
|
55
|
+
async load(globalPath: string): Promise<ArchitectSessionData | null> {
|
|
35
56
|
try {
|
|
36
57
|
const sessionPath = path.join(globalPath, 'planning', 'architect-session.json')
|
|
37
58
|
const content = await fs.readFile(sessionPath, 'utf-8')
|
|
@@ -44,7 +65,7 @@ class ArchitectSession {
|
|
|
44
65
|
/**
|
|
45
66
|
* Save session to disk
|
|
46
67
|
*/
|
|
47
|
-
async save(session, globalPath) {
|
|
68
|
+
async save(session: ArchitectSessionData, globalPath: string): Promise<void> {
|
|
48
69
|
const planningDir = path.join(globalPath, 'planning')
|
|
49
70
|
await fs.mkdir(planningDir, { recursive: true })
|
|
50
71
|
|
|
@@ -54,11 +75,8 @@ class ArchitectSession {
|
|
|
54
75
|
|
|
55
76
|
/**
|
|
56
77
|
* Log a Q&A pair to the conversation
|
|
57
|
-
* @param {string} question - The question asked by Claude
|
|
58
|
-
* @param {string} answer - User's answer
|
|
59
|
-
* @param {string} globalPath - Global project path
|
|
60
78
|
*/
|
|
61
|
-
async logQA(question, answer, globalPath) {
|
|
79
|
+
async logQA(question: string, answer: string, globalPath: string): Promise<void> {
|
|
62
80
|
const session = await this.load(globalPath)
|
|
63
81
|
|
|
64
82
|
if (!session || !session.active) {
|
|
@@ -76,11 +94,8 @@ class ArchitectSession {
|
|
|
76
94
|
|
|
77
95
|
/**
|
|
78
96
|
* Save key insight for plan generation
|
|
79
|
-
* @param {string} key - Insight key (e.g., 'language', 'framework', 'database')
|
|
80
|
-
* @param {string} value - Insight value
|
|
81
|
-
* @param {string} globalPath - Global project path
|
|
82
97
|
*/
|
|
83
|
-
async saveInsight(key, value, globalPath) {
|
|
98
|
+
async saveInsight(key: string, value: string, globalPath: string): Promise<void> {
|
|
84
99
|
const session = await this.load(globalPath)
|
|
85
100
|
|
|
86
101
|
if (!session || !session.active) {
|
|
@@ -93,10 +108,8 @@ class ArchitectSession {
|
|
|
93
108
|
|
|
94
109
|
/**
|
|
95
110
|
* Complete session and generate plan
|
|
96
|
-
* @param {string} globalPath - Global project path
|
|
97
|
-
* @returns {Promise<Object>} Summary object
|
|
98
111
|
*/
|
|
99
|
-
async complete(globalPath) {
|
|
112
|
+
async complete(globalPath: string): Promise<SessionSummary> {
|
|
100
113
|
const session = await this.load(globalPath)
|
|
101
114
|
|
|
102
115
|
if (!session || !session.active) {
|
|
@@ -117,7 +130,7 @@ class ArchitectSession {
|
|
|
117
130
|
/**
|
|
118
131
|
* Generate architect plan MD file
|
|
119
132
|
*/
|
|
120
|
-
async generatePlan(session, globalPath) {
|
|
133
|
+
async generatePlan(session: ArchitectSessionData, globalPath: string): Promise<void> {
|
|
121
134
|
const plan = this.buildPlanMarkdown(session)
|
|
122
135
|
|
|
123
136
|
const planPath = path.join(globalPath, 'planning', 'architect-session.md')
|
|
@@ -127,7 +140,7 @@ class ArchitectSession {
|
|
|
127
140
|
/**
|
|
128
141
|
* Build plan markdown content
|
|
129
142
|
*/
|
|
130
|
-
buildPlanMarkdown(session) {
|
|
143
|
+
buildPlanMarkdown(session: ArchitectSessionData): string {
|
|
131
144
|
const { projectType, idea, conversation, answers } = session
|
|
132
145
|
|
|
133
146
|
// Build conversation log
|
|
@@ -192,8 +205,8 @@ Generated: ${new Date().toISOString()}
|
|
|
192
205
|
/**
|
|
193
206
|
* Build stack summary from answers
|
|
194
207
|
*/
|
|
195
|
-
buildStackSummary(answers) {
|
|
196
|
-
const parts = []
|
|
208
|
+
buildStackSummary(answers: Record<string, string>): string {
|
|
209
|
+
const parts: string[] = []
|
|
197
210
|
|
|
198
211
|
for (const [key, value] of Object.entries(answers)) {
|
|
199
212
|
if (value && value !== 'Ninguna' && value !== 'None' && value !== 'Otro') {
|
|
@@ -207,8 +220,8 @@ Generated: ${new Date().toISOString()}
|
|
|
207
220
|
/**
|
|
208
221
|
* Build Context7 queries from answers
|
|
209
222
|
*/
|
|
210
|
-
buildContext7Queries(answers) {
|
|
211
|
-
const queries = []
|
|
223
|
+
buildContext7Queries(answers: Record<string, string>): string[] {
|
|
224
|
+
const queries: string[] = []
|
|
212
225
|
|
|
213
226
|
if (answers.framework) {
|
|
214
227
|
queries.push(`${answers.framework} getting started`)
|
|
@@ -239,9 +252,9 @@ Generated: ${new Date().toISOString()}
|
|
|
239
252
|
/**
|
|
240
253
|
* Build implementation steps from session
|
|
241
254
|
*/
|
|
242
|
-
buildImplementationSteps(session) {
|
|
255
|
+
buildImplementationSteps(session: ArchitectSessionData): string[] {
|
|
243
256
|
const { answers } = session
|
|
244
|
-
const steps = []
|
|
257
|
+
const steps: string[] = []
|
|
245
258
|
|
|
246
259
|
// Generic steps - Claude will refine during execution
|
|
247
260
|
if (answers.language) {
|
|
@@ -273,7 +286,7 @@ Generated: ${new Date().toISOString()}
|
|
|
273
286
|
/**
|
|
274
287
|
* Build summary of session
|
|
275
288
|
*/
|
|
276
|
-
buildSummary(session) {
|
|
289
|
+
buildSummary(session: ArchitectSessionData): SessionSummary {
|
|
277
290
|
return {
|
|
278
291
|
idea: session.idea,
|
|
279
292
|
projectType: session.projectType,
|
|
@@ -287,7 +300,7 @@ Generated: ${new Date().toISOString()}
|
|
|
287
300
|
/**
|
|
288
301
|
* Clear architect session
|
|
289
302
|
*/
|
|
290
|
-
async clear(globalPath) {
|
|
303
|
+
async clear(globalPath: string): Promise<void> {
|
|
291
304
|
try {
|
|
292
305
|
const sessionPath = path.join(globalPath, 'planning', 'architect-session.json')
|
|
293
306
|
await fs.unlink(sessionPath)
|
|
@@ -297,4 +310,6 @@ Generated: ${new Date().toISOString()}
|
|
|
297
310
|
}
|
|
298
311
|
}
|
|
299
312
|
|
|
300
|
-
|
|
313
|
+
const architectSession = new ArchitectSession()
|
|
314
|
+
export default architectSession
|
|
315
|
+
export { ArchitectSession }
|
|
@@ -4,10 +4,24 @@
|
|
|
4
4
|
* This file only provides structure - real content from Claude
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import path from 'path'
|
|
8
|
+
import fs from 'fs/promises'
|
|
9
|
+
|
|
10
|
+
interface ArchitectureContext {
|
|
11
|
+
[key: string]: unknown
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface Architecture {
|
|
15
|
+
id: string
|
|
16
|
+
idea: string
|
|
17
|
+
createdAt: string
|
|
18
|
+
phases: Record<string, unknown>
|
|
19
|
+
_agenticNote: string
|
|
20
|
+
}
|
|
9
21
|
|
|
10
22
|
class ArchitectureGenerator {
|
|
23
|
+
defaultPhases: string[]
|
|
24
|
+
|
|
11
25
|
constructor() {
|
|
12
26
|
// AGENTIC: Phases determined by Claude via templates/architect/phases.md
|
|
13
27
|
this.defaultPhases = [
|
|
@@ -25,11 +39,8 @@ class ArchitectureGenerator {
|
|
|
25
39
|
/**
|
|
26
40
|
* Generate architecture skeleton
|
|
27
41
|
* AGENTIC: Claude fills in content using templates
|
|
28
|
-
* @param {string} idea - The initial idea
|
|
29
|
-
* @param {object} context - Project context
|
|
30
|
-
* @returns {Promise<object>} Architecture skeleton
|
|
31
42
|
*/
|
|
32
|
-
async generateArchitecture(idea, context = {}) {
|
|
43
|
+
async generateArchitecture(idea: string, context: ArchitectureContext = {}): Promise<Architecture> {
|
|
33
44
|
// Return skeleton - Claude generates actual content via templates
|
|
34
45
|
return {
|
|
35
46
|
id: `arch-${Date.now()}`,
|
|
@@ -37,15 +48,16 @@ class ArchitectureGenerator {
|
|
|
37
48
|
createdAt: new Date().toISOString(),
|
|
38
49
|
phases: {},
|
|
39
50
|
// AGENTIC: Claude populates phases using templates/architect/*.md
|
|
40
|
-
_agenticNote:
|
|
51
|
+
_agenticNote:
|
|
52
|
+
'Use templates/architect/phases.md to determine needed phases, then templates/architect/discovery.md etc for content',
|
|
41
53
|
}
|
|
42
54
|
}
|
|
43
55
|
|
|
44
56
|
/**
|
|
45
57
|
* Get template path for a phase
|
|
46
58
|
*/
|
|
47
|
-
getPhaseTemplate(phase) {
|
|
48
|
-
const templateMap = {
|
|
59
|
+
getPhaseTemplate(phase: string): string | null {
|
|
60
|
+
const templateMap: Record<string, string> = {
|
|
49
61
|
discovery: 'templates/architect/discovery.md',
|
|
50
62
|
'user-flows': 'templates/design/flow.md',
|
|
51
63
|
'domain-modeling': 'templates/design/database.md',
|
|
@@ -62,7 +74,7 @@ class ArchitectureGenerator {
|
|
|
62
74
|
* Save architecture to files
|
|
63
75
|
* AGENTIC: Format determined by Claude based on content
|
|
64
76
|
*/
|
|
65
|
-
async saveArchitecture(architecture, projectPath) {
|
|
77
|
+
async saveArchitecture(architecture: Architecture, projectPath: string): Promise<string> {
|
|
66
78
|
const archPath = path.join(projectPath, 'planning', 'architectures', architecture.id)
|
|
67
79
|
await fs.mkdir(archPath, { recursive: true })
|
|
68
80
|
|
|
@@ -76,8 +88,8 @@ class ArchitectureGenerator {
|
|
|
76
88
|
/**
|
|
77
89
|
* SQL type mapping utility
|
|
78
90
|
*/
|
|
79
|
-
sqlType(type) {
|
|
80
|
-
const typeMap = {
|
|
91
|
+
sqlType(type: string): string {
|
|
92
|
+
const typeMap: Record<string, string> = {
|
|
81
93
|
uuid: 'UUID',
|
|
82
94
|
string: 'VARCHAR(255)',
|
|
83
95
|
text: 'TEXT',
|
|
@@ -90,4 +102,4 @@ class ArchitectureGenerator {
|
|
|
90
102
|
}
|
|
91
103
|
}
|
|
92
104
|
|
|
93
|
-
|
|
105
|
+
export default ArchitectureGenerator
|
|
@@ -1,24 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* ContextEstimator - Pre-filter files before building context
|
|
3
|
-
*
|
|
3
|
+
*
|
|
4
4
|
* Estimates which files are needed based on task analysis
|
|
5
5
|
* BEFORE building full context - saves I/O
|
|
6
|
-
*
|
|
6
|
+
*
|
|
7
7
|
* @version 1.0.0
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import path from 'path'
|
|
11
|
+
import { glob } from 'glob'
|
|
12
|
+
import log from '../utils/logger'
|
|
13
|
+
|
|
14
|
+
interface TaskAnalysis {
|
|
15
|
+
primaryDomain: string
|
|
16
|
+
projectTechnologies?: ProjectTech
|
|
17
|
+
semantic?: SemanticAnalysis
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface ProjectTech {
|
|
21
|
+
extensions?: Record<string, number>
|
|
22
|
+
directories?: string[]
|
|
23
|
+
[key: string]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SemanticAnalysis {
|
|
27
|
+
requiresMultipleAgents?: boolean
|
|
28
|
+
agents?: string[]
|
|
29
|
+
[key: string]: unknown
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
interface FilePatterns {
|
|
33
|
+
include: string[]
|
|
34
|
+
extensions: string[]
|
|
35
|
+
exclude: string[]
|
|
36
|
+
}
|
|
13
37
|
|
|
14
38
|
class ContextEstimator {
|
|
15
39
|
/**
|
|
16
40
|
* Estimate which files are needed for a task
|
|
17
|
-
* @param {Object} taskAnalysis - Task analysis result
|
|
18
|
-
* @param {string} projectPath - Project path
|
|
19
|
-
* @returns {Promise<Array<string>>} Estimated file paths
|
|
20
41
|
*/
|
|
21
|
-
async estimateFiles(taskAnalysis, projectPath) {
|
|
42
|
+
async estimateFiles(taskAnalysis: TaskAnalysis, projectPath: string): Promise<string[]> {
|
|
22
43
|
const domain = taskAnalysis.primaryDomain
|
|
23
44
|
const projectTech = taskAnalysis.projectTechnologies || {}
|
|
24
45
|
const semantic = taskAnalysis.semantic || {}
|
|
@@ -29,13 +50,16 @@ class ContextEstimator {
|
|
|
29
50
|
// Expand with semantic understanding
|
|
30
51
|
if (semantic.requiresMultipleAgents && semantic.agents) {
|
|
31
52
|
// Multi-agent task - combine patterns
|
|
32
|
-
const allPatterns = semantic.agents.reduce(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
53
|
+
const allPatterns = semantic.agents.reduce(
|
|
54
|
+
(acc, agentDomain) => {
|
|
55
|
+
const agentPatterns = this.getPatternsForDomain(agentDomain, projectTech)
|
|
56
|
+
return {
|
|
57
|
+
include: [...acc.include, ...agentPatterns.include],
|
|
58
|
+
extensions: [...acc.extensions, ...agentPatterns.extensions],
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{ include: [] as string[], extensions: [] as string[] }
|
|
62
|
+
)
|
|
39
63
|
|
|
40
64
|
patterns.include = [...new Set(allPatterns.include)]
|
|
41
65
|
patterns.extensions = [...new Set(allPatterns.extensions)]
|
|
@@ -55,35 +79,33 @@ class ContextEstimator {
|
|
|
55
79
|
* 100% AGENTIC: Uses REAL project data, not hardcoded patterns.
|
|
56
80
|
* No domain-specific assumptions or language→extension mapping.
|
|
57
81
|
*/
|
|
58
|
-
getPatternsForDomain(domain, projectData) {
|
|
59
|
-
const patterns = {
|
|
82
|
+
getPatternsForDomain(domain: string, projectData: ProjectTech): FilePatterns {
|
|
83
|
+
const patterns: FilePatterns = {
|
|
60
84
|
include: [],
|
|
61
85
|
extensions: [],
|
|
62
|
-
exclude: ['node_modules', 'dist', 'build', '.git', '.next', 'target', 'vendor', 'coverage']
|
|
86
|
+
exclude: ['node_modules', 'dist', 'build', '.git', '.next', 'target', 'vendor', 'coverage'],
|
|
63
87
|
}
|
|
64
88
|
|
|
65
89
|
// Use REAL extensions from project (if provided in projectData)
|
|
66
90
|
if (projectData && projectData.extensions) {
|
|
67
91
|
// projectData.extensions is {'.js': 45, '.ts': 23, ...}
|
|
68
92
|
patterns.extensions = Object.keys(projectData.extensions)
|
|
69
|
-
.filter(ext => ext.startsWith('.'))
|
|
70
|
-
.slice(0, 15)
|
|
93
|
+
.filter((ext) => ext.startsWith('.'))
|
|
94
|
+
.slice(0, 15) // Top 15 extensions
|
|
71
95
|
}
|
|
72
96
|
|
|
73
97
|
// Use REAL directories from project (if provided in projectData)
|
|
74
98
|
if (projectData && projectData.directories) {
|
|
75
|
-
patterns.include = projectData.directories.filter(dir =>
|
|
76
|
-
!patterns.exclude.includes(dir)
|
|
77
|
-
);
|
|
99
|
+
patterns.include = projectData.directories.filter((dir) => !patterns.exclude.includes(dir))
|
|
78
100
|
}
|
|
79
101
|
|
|
80
102
|
// If no real data available, use minimal universal fallback
|
|
81
103
|
if (patterns.extensions.length === 0) {
|
|
82
|
-
patterns.extensions = ['*']
|
|
104
|
+
patterns.extensions = ['*'] // All files
|
|
83
105
|
}
|
|
84
106
|
|
|
85
107
|
if (patterns.include.length === 0) {
|
|
86
|
-
patterns.include = ['.']
|
|
108
|
+
patterns.include = ['.'] // Root directory
|
|
87
109
|
}
|
|
88
110
|
|
|
89
111
|
// NO domain-specific hardcoding
|
|
@@ -95,12 +117,12 @@ class ContextEstimator {
|
|
|
95
117
|
/**
|
|
96
118
|
* Find files matching patterns
|
|
97
119
|
*/
|
|
98
|
-
async findMatchingFiles(projectPath, patterns) {
|
|
99
|
-
const files = []
|
|
120
|
+
async findMatchingFiles(projectPath: string, patterns: FilePatterns): Promise<string[]> {
|
|
121
|
+
const files: string[] = []
|
|
100
122
|
|
|
101
123
|
try {
|
|
102
124
|
// Build glob patterns
|
|
103
|
-
const globPatterns = []
|
|
125
|
+
const globPatterns: string[] = []
|
|
104
126
|
|
|
105
127
|
// Add include patterns
|
|
106
128
|
for (const include of patterns.include) {
|
|
@@ -120,15 +142,15 @@ class ContextEstimator {
|
|
|
120
142
|
try {
|
|
121
143
|
const matches = await glob(pattern, {
|
|
122
144
|
cwd: projectPath,
|
|
123
|
-
ignore: patterns.exclude.map(ex => `**/${ex}/**`),
|
|
145
|
+
ignore: patterns.exclude.map((ex) => `**/${ex}/**`),
|
|
124
146
|
nodir: true,
|
|
125
|
-
follow: false
|
|
147
|
+
follow: false,
|
|
126
148
|
})
|
|
127
149
|
|
|
128
150
|
if (Array.isArray(matches)) {
|
|
129
151
|
files.push(...matches)
|
|
130
152
|
}
|
|
131
|
-
} catch
|
|
153
|
+
} catch {
|
|
132
154
|
// Skip invalid patterns
|
|
133
155
|
}
|
|
134
156
|
}
|
|
@@ -136,7 +158,7 @@ class ContextEstimator {
|
|
|
136
158
|
// Remove duplicates and sort
|
|
137
159
|
return [...new Set(files)].sort()
|
|
138
160
|
} catch (error) {
|
|
139
|
-
log.error('Error finding files:', error.message)
|
|
161
|
+
log.error('Error finding files:', (error as Error).message)
|
|
140
162
|
return []
|
|
141
163
|
}
|
|
142
164
|
}
|
|
@@ -144,11 +166,10 @@ class ContextEstimator {
|
|
|
144
166
|
/**
|
|
145
167
|
* Estimate context size (number of files)
|
|
146
168
|
*/
|
|
147
|
-
async estimateContextSize(taskAnalysis, projectPath) {
|
|
169
|
+
async estimateContextSize(taskAnalysis: TaskAnalysis, projectPath: string): Promise<number> {
|
|
148
170
|
const files = await this.estimateFiles(taskAnalysis, projectPath)
|
|
149
171
|
return files.length
|
|
150
172
|
}
|
|
151
173
|
}
|
|
152
174
|
|
|
153
|
-
|
|
154
|
-
|
|
175
|
+
export default ContextEstimator
|
|
@@ -4,13 +4,29 @@
|
|
|
4
4
|
* Used to inject high standards into agent prompts.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
interface DomainStandard {
|
|
8
|
+
title: string
|
|
9
|
+
rules: string[]
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Standards {
|
|
13
|
+
title: string
|
|
14
|
+
rules: string[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
interface ProductStandardsType {
|
|
18
|
+
general: string[]
|
|
19
|
+
domains: Record<string, DomainStandard>
|
|
20
|
+
getStandards(domain?: string): Standards
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const ProductStandards: ProductStandardsType = {
|
|
8
24
|
// General standards applicable to all agents
|
|
9
25
|
general: [
|
|
10
26
|
'SHIP IT: Bias for action. Better to ship and iterate than perfect and delay.',
|
|
11
27
|
'USER CENTRIC: Always ask "How does this help the user?"',
|
|
12
28
|
'CLEAN CODE: Write code that is easy to read, test, and maintain.',
|
|
13
|
-
'NO BS: Avoid over-engineering. Simple is better than complex.'
|
|
29
|
+
'NO BS: Avoid over-engineering. Simple is better than complex.',
|
|
14
30
|
],
|
|
15
31
|
|
|
16
32
|
// Domain-specific standards
|
|
@@ -22,8 +38,8 @@ const ProductStandards = {
|
|
|
22
38
|
'ACCESSIBILITY: Semantic HTML, ARIA labels, keyboard navigation (WCAG 2.1 AA).',
|
|
23
39
|
'RESPONSIVE: Mobile-first design. Works on all devices.',
|
|
24
40
|
'UX/UI: Smooth transitions, loading states, error boundaries. No dead clicks.',
|
|
25
|
-
'STATE: Local state for UI, Global state (Context/Zustand) for data. No prop drilling.'
|
|
26
|
-
]
|
|
41
|
+
'STATE: Local state for UI, Global state (Context/Zustand) for data. No prop drilling.',
|
|
42
|
+
],
|
|
27
43
|
},
|
|
28
44
|
backend: {
|
|
29
45
|
title: 'Robust Backend Standards',
|
|
@@ -32,8 +48,8 @@ const ProductStandards = {
|
|
|
32
48
|
'SCALABILITY: Stateless services. Caching strategies (Redis/CDN).',
|
|
33
49
|
'RELIABILITY: Graceful error handling. Structured logging. Health checks.',
|
|
34
50
|
'API DESIGN: RESTful or GraphQL best practices. Consistent response envelopes.',
|
|
35
|
-
'DB: Indexed queries. Migrations for schema changes. No N+1 queries.'
|
|
36
|
-
]
|
|
51
|
+
'DB: Indexed queries. Migrations for schema changes. No N+1 queries.',
|
|
52
|
+
],
|
|
37
53
|
},
|
|
38
54
|
database: {
|
|
39
55
|
title: 'Data Integrity Standards',
|
|
@@ -41,8 +57,8 @@ const ProductStandards = {
|
|
|
41
57
|
'INTEGRITY: Foreign keys, constraints, transactions.',
|
|
42
58
|
'PERFORMANCE: Index usage analysis. Query optimization.',
|
|
43
59
|
'BACKUPS: Point-in-time recovery awareness.',
|
|
44
|
-
'MIGRATIONS: Idempotent scripts. Zero-downtime changes.'
|
|
45
|
-
]
|
|
60
|
+
'MIGRATIONS: Idempotent scripts. Zero-downtime changes.',
|
|
61
|
+
],
|
|
46
62
|
},
|
|
47
63
|
devops: {
|
|
48
64
|
title: 'Modern Ops Standards',
|
|
@@ -50,8 +66,8 @@ const ProductStandards = {
|
|
|
50
66
|
'AUTOMATION: CI/CD for everything. No manual deployments.',
|
|
51
67
|
'IaC: Infrastructure as Code (Terraform/Pulumi).',
|
|
52
68
|
'OBSERVABILITY: Metrics, Logs, Traces (OpenTelemetry).',
|
|
53
|
-
'SECURITY: Least privilege access. Secrets management.'
|
|
54
|
-
]
|
|
69
|
+
'SECURITY: Least privilege access. Secrets management.',
|
|
70
|
+
],
|
|
55
71
|
},
|
|
56
72
|
qa: {
|
|
57
73
|
title: 'Quality Assurance Standards',
|
|
@@ -59,8 +75,8 @@ const ProductStandards = {
|
|
|
59
75
|
'PYRAMID: Many unit tests, some integration, few E2E.',
|
|
60
76
|
'COVERAGE: Critical paths must be tested.',
|
|
61
77
|
'REALISM: Test with realistic data and scenarios.',
|
|
62
|
-
'SPEED: Fast feedback loops. Parallel execution.'
|
|
63
|
-
]
|
|
78
|
+
'SPEED: Fast feedback loops. Parallel execution.',
|
|
79
|
+
],
|
|
64
80
|
},
|
|
65
81
|
architecture: {
|
|
66
82
|
title: 'System Architecture Standards',
|
|
@@ -68,25 +84,23 @@ const ProductStandards = {
|
|
|
68
84
|
'MODULARITY: High cohesion, low coupling.',
|
|
69
85
|
'EVOLVABILITY: Easy to change. Hard to break.',
|
|
70
86
|
'SIMPLICITY: Choose boring technology. Innovation tokens are limited.',
|
|
71
|
-
'DOCS: Architecture Decision Records (ADRs).'
|
|
72
|
-
]
|
|
73
|
-
}
|
|
87
|
+
'DOCS: Architecture Decision Records (ADRs).',
|
|
88
|
+
],
|
|
89
|
+
},
|
|
74
90
|
},
|
|
75
91
|
|
|
76
92
|
/**
|
|
77
93
|
* Get standards for a specific domain
|
|
78
|
-
* @param {string} domain - The domain (frontend, backend, etc.)
|
|
79
|
-
* @returns {Object} The standards object
|
|
80
94
|
*/
|
|
81
|
-
getStandards(domain) {
|
|
82
|
-
const key = domain?.toLowerCase()
|
|
83
|
-
const specific = this.domains[key] || { title: 'General Standards', rules: [] }
|
|
84
|
-
|
|
95
|
+
getStandards(domain?: string): Standards {
|
|
96
|
+
const key = domain?.toLowerCase()
|
|
97
|
+
const specific = (key && this.domains[key]) || { title: 'General Standards', rules: [] }
|
|
98
|
+
|
|
85
99
|
return {
|
|
86
100
|
title: specific.title,
|
|
87
|
-
rules: [...this.general, ...specific.rules]
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
101
|
+
rules: [...this.general, ...specific.rules],
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
}
|
|
91
105
|
|
|
92
|
-
|
|
106
|
+
export default ProductStandards
|