prism-pr 1.0.0-alpha.47
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/README.md +964 -0
- package/bin/run.js +9 -0
- package/dist/ai/agents/architecture-reviewer.d.ts +3 -0
- package/dist/ai/agents/architecture-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/architecture-reviewer.js +67 -0
- package/dist/ai/agents/architecture-reviewer.js.map +1 -0
- package/dist/ai/agents/blade-reviewer.d.ts +3 -0
- package/dist/ai/agents/blade-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/blade-reviewer.js +59 -0
- package/dist/ai/agents/blade-reviewer.js.map +1 -0
- package/dist/ai/agents/config-reviewer.d.ts +3 -0
- package/dist/ai/agents/config-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/config-reviewer.js +106 -0
- package/dist/ai/agents/config-reviewer.js.map +1 -0
- package/dist/ai/agents/csharp-reviewer.d.ts +3 -0
- package/dist/ai/agents/csharp-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/csharp-reviewer.js +59 -0
- package/dist/ai/agents/csharp-reviewer.js.map +1 -0
- package/dist/ai/agents/css-reviewer.d.ts +3 -0
- package/dist/ai/agents/css-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/css-reviewer.js +65 -0
- package/dist/ai/agents/css-reviewer.js.map +1 -0
- package/dist/ai/agents/framework-rules/index.d.ts +33 -0
- package/dist/ai/agents/framework-rules/index.d.ts.map +1 -0
- package/dist/ai/agents/framework-rules/index.js +67 -0
- package/dist/ai/agents/framework-rules/index.js.map +1 -0
- package/dist/ai/agents/framework-rules/normalize.d.ts +40 -0
- package/dist/ai/agents/framework-rules/normalize.d.ts.map +1 -0
- package/dist/ai/agents/framework-rules/normalize.js +102 -0
- package/dist/ai/agents/framework-rules/normalize.js.map +1 -0
- package/dist/ai/agents/framework-rules/routing-map.d.ts +3 -0
- package/dist/ai/agents/framework-rules/routing-map.d.ts.map +1 -0
- package/dist/ai/agents/framework-rules/routing-map.js +15 -0
- package/dist/ai/agents/framework-rules/routing-map.js.map +1 -0
- package/dist/ai/agents/html-reviewer.d.ts +3 -0
- package/dist/ai/agents/html-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/html-reviewer.js +61 -0
- package/dist/ai/agents/html-reviewer.js.map +1 -0
- package/dist/ai/agents/performance-reviewer.d.ts +3 -0
- package/dist/ai/agents/performance-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/performance-reviewer.js +60 -0
- package/dist/ai/agents/performance-reviewer.js.map +1 -0
- package/dist/ai/agents/php-reviewer.d.ts +3 -0
- package/dist/ai/agents/php-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/php-reviewer.js +62 -0
- package/dist/ai/agents/php-reviewer.js.map +1 -0
- package/dist/ai/agents/prompts/architecture-reviewer.txt +39 -0
- package/dist/ai/agents/prompts/blade-reviewer.txt +39 -0
- package/dist/ai/agents/prompts/config-reviewer.txt +47 -0
- package/dist/ai/agents/prompts/csharp-reviewer.txt +39 -0
- package/dist/ai/agents/prompts/css-reviewer.txt +41 -0
- package/dist/ai/agents/prompts/html-reviewer.txt +43 -0
- package/dist/ai/agents/prompts/performance-reviewer.txt +38 -0
- package/dist/ai/agents/prompts/php-reviewer.txt +87 -0
- package/dist/ai/agents/prompts/python-reviewer.txt +42 -0
- package/dist/ai/agents/prompts/security-reviewer.txt +36 -0
- package/dist/ai/agents/prompts/sql-reviewer.txt +43 -0
- package/dist/ai/agents/prompts/testing-reviewer.txt +38 -0
- package/dist/ai/agents/prompts/ts-reviewer.txt +54 -0
- package/dist/ai/agents/prompts/ux-text-reviewer.txt +68 -0
- package/dist/ai/agents/python-reviewer.d.ts +3 -0
- package/dist/ai/agents/python-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/python-reviewer.js +59 -0
- package/dist/ai/agents/python-reviewer.js.map +1 -0
- package/dist/ai/agents/registry.d.ts +20 -0
- package/dist/ai/agents/registry.d.ts.map +1 -0
- package/dist/ai/agents/registry.js +65 -0
- package/dist/ai/agents/registry.js.map +1 -0
- package/dist/ai/agents/security-reviewer.d.ts +3 -0
- package/dist/ai/agents/security-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/security-reviewer.js +69 -0
- package/dist/ai/agents/security-reviewer.js.map +1 -0
- package/dist/ai/agents/shared/content-builder.d.ts +14 -0
- package/dist/ai/agents/shared/content-builder.d.ts.map +1 -0
- package/dist/ai/agents/shared/content-builder.js +158 -0
- package/dist/ai/agents/shared/content-builder.js.map +1 -0
- package/dist/ai/agents/shared/finding-schema.d.ts +54 -0
- package/dist/ai/agents/shared/finding-schema.d.ts.map +1 -0
- package/dist/ai/agents/shared/finding-schema.js +65 -0
- package/dist/ai/agents/shared/finding-schema.js.map +1 -0
- package/dist/ai/agents/shared/line-validator.d.ts +8 -0
- package/dist/ai/agents/shared/line-validator.d.ts.map +1 -0
- package/dist/ai/agents/shared/line-validator.js +12 -0
- package/dist/ai/agents/shared/line-validator.js.map +1 -0
- package/dist/ai/agents/shared/prompt-builder.d.ts +3 -0
- package/dist/ai/agents/shared/prompt-builder.d.ts.map +1 -0
- package/dist/ai/agents/shared/prompt-builder.js +68 -0
- package/dist/ai/agents/shared/prompt-builder.js.map +1 -0
- package/dist/ai/agents/sql-reviewer.d.ts +3 -0
- package/dist/ai/agents/sql-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/sql-reviewer.js +61 -0
- package/dist/ai/agents/sql-reviewer.js.map +1 -0
- package/dist/ai/agents/testing-reviewer.d.ts +3 -0
- package/dist/ai/agents/testing-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/testing-reviewer.js +80 -0
- package/dist/ai/agents/testing-reviewer.js.map +1 -0
- package/dist/ai/agents/ts-reviewer.d.ts +3 -0
- package/dist/ai/agents/ts-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/ts-reviewer.js +63 -0
- package/dist/ai/agents/ts-reviewer.js.map +1 -0
- package/dist/ai/agents/ux-text-reviewer.d.ts +3 -0
- package/dist/ai/agents/ux-text-reviewer.d.ts.map +1 -0
- package/dist/ai/agents/ux-text-reviewer.js +116 -0
- package/dist/ai/agents/ux-text-reviewer.js.map +1 -0
- package/dist/ai/orchestrator/agent-classifier.d.ts +28 -0
- package/dist/ai/orchestrator/agent-classifier.d.ts.map +1 -0
- package/dist/ai/orchestrator/agent-classifier.js +137 -0
- package/dist/ai/orchestrator/agent-classifier.js.map +1 -0
- package/dist/ai/orchestrator/consolidation.d.ts +12 -0
- package/dist/ai/orchestrator/consolidation.d.ts.map +1 -0
- package/dist/ai/orchestrator/consolidation.js +34 -0
- package/dist/ai/orchestrator/consolidation.js.map +1 -0
- package/dist/ai/orchestrator/context-analyzer.d.ts +47 -0
- package/dist/ai/orchestrator/context-analyzer.d.ts.map +1 -0
- package/dist/ai/orchestrator/context-analyzer.js +368 -0
- package/dist/ai/orchestrator/context-analyzer.js.map +1 -0
- package/dist/ai/orchestrator/deduplicator.d.ts +43 -0
- package/dist/ai/orchestrator/deduplicator.d.ts.map +1 -0
- package/dist/ai/orchestrator/deduplicator.js +97 -0
- package/dist/ai/orchestrator/deduplicator.js.map +1 -0
- package/dist/ai/orchestrator/orchestrator.d.ts +57 -0
- package/dist/ai/orchestrator/orchestrator.d.ts.map +1 -0
- package/dist/ai/orchestrator/orchestrator.js +181 -0
- package/dist/ai/orchestrator/orchestrator.js.map +1 -0
- package/dist/ai/orchestrator/rule-based-strategy.d.ts +20 -0
- package/dist/ai/orchestrator/rule-based-strategy.d.ts.map +1 -0
- package/dist/ai/orchestrator/rule-based-strategy.js +55 -0
- package/dist/ai/orchestrator/rule-based-strategy.js.map +1 -0
- package/dist/ai/orchestrator/semaphore.d.ts +25 -0
- package/dist/ai/orchestrator/semaphore.d.ts.map +1 -0
- package/dist/ai/orchestrator/semaphore.js +52 -0
- package/dist/ai/orchestrator/semaphore.js.map +1 -0
- package/dist/ai/orchestrator/severity-pipeline.d.ts +21 -0
- package/dist/ai/orchestrator/severity-pipeline.d.ts.map +1 -0
- package/dist/ai/orchestrator/severity-pipeline.js +69 -0
- package/dist/ai/orchestrator/severity-pipeline.js.map +1 -0
- package/dist/ai/orchestrator/strategy.d.ts +20 -0
- package/dist/ai/orchestrator/strategy.d.ts.map +1 -0
- package/dist/ai/orchestrator/strategy.js +2 -0
- package/dist/ai/orchestrator/strategy.js.map +1 -0
- package/dist/ai/providers/anthropic-provider.d.ts +14 -0
- package/dist/ai/providers/anthropic-provider.d.ts.map +1 -0
- package/dist/ai/providers/anthropic-provider.js +108 -0
- package/dist/ai/providers/anthropic-provider.js.map +1 -0
- package/dist/ai/providers/claude-code-provider.d.ts +12 -0
- package/dist/ai/providers/claude-code-provider.d.ts.map +1 -0
- package/dist/ai/providers/claude-code-provider.js +103 -0
- package/dist/ai/providers/claude-code-provider.js.map +1 -0
- package/dist/ai/providers/errors.d.ts +22 -0
- package/dist/ai/providers/errors.d.ts.map +1 -0
- package/dist/ai/providers/errors.js +44 -0
- package/dist/ai/providers/errors.js.map +1 -0
- package/dist/ai/skills/skill-registry.d.ts +21 -0
- package/dist/ai/skills/skill-registry.d.ts.map +1 -0
- package/dist/ai/skills/skill-registry.js +27 -0
- package/dist/ai/skills/skill-registry.js.map +1 -0
- package/dist/ai/text-extractor/extractor.d.ts +15 -0
- package/dist/ai/text-extractor/extractor.d.ts.map +1 -0
- package/dist/ai/text-extractor/extractor.js +63 -0
- package/dist/ai/text-extractor/extractor.js.map +1 -0
- package/dist/ai/text-extractor/index.d.ts +4 -0
- package/dist/ai/text-extractor/index.d.ts.map +1 -0
- package/dist/ai/text-extractor/index.js +3 -0
- package/dist/ai/text-extractor/index.js.map +1 -0
- package/dist/ai/text-extractor/patterns.d.ts +21 -0
- package/dist/ai/text-extractor/patterns.d.ts.map +1 -0
- package/dist/ai/text-extractor/patterns.js +169 -0
- package/dist/ai/text-extractor/patterns.js.map +1 -0
- package/dist/ai/text-extractor/types.d.ts +47 -0
- package/dist/ai/text-extractor/types.d.ts.map +1 -0
- package/dist/ai/text-extractor/types.js +2 -0
- package/dist/ai/text-extractor/types.js.map +1 -0
- package/dist/bitbucket/client.d.ts +38 -0
- package/dist/bitbucket/client.d.ts.map +1 -0
- package/dist/bitbucket/client.js +448 -0
- package/dist/bitbucket/client.js.map +1 -0
- package/dist/bitbucket/errors.d.ts +75 -0
- package/dist/bitbucket/errors.d.ts.map +1 -0
- package/dist/bitbucket/errors.js +127 -0
- package/dist/bitbucket/errors.js.map +1 -0
- package/dist/bitbucket/mappers.d.ts +3 -0
- package/dist/bitbucket/mappers.d.ts.map +1 -0
- package/dist/bitbucket/mappers.js +14 -0
- package/dist/bitbucket/mappers.js.map +1 -0
- package/dist/commands/guard/check.d.ts +19 -0
- package/dist/commands/guard/check.d.ts.map +1 -0
- package/dist/commands/guard/check.js +224 -0
- package/dist/commands/guard/check.js.map +1 -0
- package/dist/commands/guard/index.d.ts +7 -0
- package/dist/commands/guard/index.d.ts.map +1 -0
- package/dist/commands/guard/index.js +65 -0
- package/dist/commands/guard/index.js.map +1 -0
- package/dist/commands/interactive.d.ts +10 -0
- package/dist/commands/interactive.d.ts.map +1 -0
- package/dist/commands/interactive.js +88 -0
- package/dist/commands/interactive.js.map +1 -0
- package/dist/commands/login.d.ts +35 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +164 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +12 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +23 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/review/start.d.ts +22 -0
- package/dist/commands/review/start.d.ts.map +1 -0
- package/dist/commands/review/start.js +120 -0
- package/dist/commands/review/start.js.map +1 -0
- package/dist/commands/rules/push.d.ts +13 -0
- package/dist/commands/rules/push.d.ts.map +1 -0
- package/dist/commands/rules/push.js +75 -0
- package/dist/commands/rules/push.js.map +1 -0
- package/dist/commands/rules/stats.d.ts +14 -0
- package/dist/commands/rules/stats.d.ts.map +1 -0
- package/dist/commands/rules/stats.js +101 -0
- package/dist/commands/rules/stats.js.map +1 -0
- package/dist/commands/rules/sync.d.ts +15 -0
- package/dist/commands/rules/sync.d.ts.map +1 -0
- package/dist/commands/rules/sync.js +144 -0
- package/dist/commands/rules/sync.js.map +1 -0
- package/dist/config/config-manager.d.ts +14 -0
- package/dist/config/config-manager.d.ts.map +1 -0
- package/dist/config/config-manager.js +85 -0
- package/dist/config/config-manager.js.map +1 -0
- package/dist/config/convention-builder.d.ts +13 -0
- package/dist/config/convention-builder.d.ts.map +1 -0
- package/dist/config/convention-builder.js +31 -0
- package/dist/config/convention-builder.js.map +1 -0
- package/dist/config/credentials.d.ts +14 -0
- package/dist/config/credentials.d.ts.map +1 -0
- package/dist/config/credentials.js +85 -0
- package/dist/config/credentials.js.map +1 -0
- package/dist/config/encryption.d.ts +20 -0
- package/dist/config/encryption.d.ts.map +1 -0
- package/dist/config/encryption.js +94 -0
- package/dist/config/encryption.js.map +1 -0
- package/dist/config/repo-config-loader.d.ts +34 -0
- package/dist/config/repo-config-loader.d.ts.map +1 -0
- package/dist/config/repo-config-loader.js +103 -0
- package/dist/config/repo-config-loader.js.map +1 -0
- package/dist/core/cli-workflow-callbacks.d.ts +35 -0
- package/dist/core/cli-workflow-callbacks.d.ts.map +1 -0
- package/dist/core/cli-workflow-callbacks.js +141 -0
- package/dist/core/cli-workflow-callbacks.js.map +1 -0
- package/dist/core/comment-publisher.d.ts +61 -0
- package/dist/core/comment-publisher.d.ts.map +1 -0
- package/dist/core/comment-publisher.js +172 -0
- package/dist/core/comment-publisher.js.map +1 -0
- package/dist/core/integrity-checker.d.ts +22 -0
- package/dist/core/integrity-checker.d.ts.map +1 -0
- package/dist/core/integrity-checker.js +83 -0
- package/dist/core/integrity-checker.js.map +1 -0
- package/dist/core/review-workflow.d.ts +34 -0
- package/dist/core/review-workflow.d.ts.map +1 -0
- package/dist/core/review-workflow.js +21 -0
- package/dist/core/review-workflow.js.map +1 -0
- package/dist/core/session-manager.d.ts +107 -0
- package/dist/core/session-manager.d.ts.map +1 -0
- package/dist/core/session-manager.js +164 -0
- package/dist/core/session-manager.js.map +1 -0
- package/dist/core/workflow-callbacks.d.ts +74 -0
- package/dist/core/workflow-callbacks.d.ts.map +1 -0
- package/dist/core/workflow-callbacks.js +2 -0
- package/dist/core/workflow-callbacks.js.map +1 -0
- package/dist/core/workflow-engine.d.ts +48 -0
- package/dist/core/workflow-engine.d.ts.map +1 -0
- package/dist/core/workflow-engine.js +442 -0
- package/dist/core/workflow-engine.js.map +1 -0
- package/dist/errors/base.d.ts +6 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +13 -0
- package/dist/errors/base.js.map +1 -0
- package/dist/errors/config-error.d.ts +5 -0
- package/dist/errors/config-error.d.ts.map +1 -0
- package/dist/errors/config-error.js +9 -0
- package/dist/errors/config-error.js.map +1 -0
- package/dist/errors/index.d.ts +5 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +5 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/validation-error.d.ts +5 -0
- package/dist/errors/validation-error.d.ts.map +1 -0
- package/dist/errors/validation-error.js +9 -0
- package/dist/errors/validation-error.js.map +1 -0
- package/dist/errors/workflow-error.d.ts +6 -0
- package/dist/errors/workflow-error.d.ts.map +1 -0
- package/dist/errors/workflow-error.js +11 -0
- package/dist/errors/workflow-error.js.map +1 -0
- package/dist/guard/ast-grep-strategy.d.ts +25 -0
- package/dist/guard/ast-grep-strategy.d.ts.map +1 -0
- package/dist/guard/ast-grep-strategy.js +112 -0
- package/dist/guard/ast-grep-strategy.js.map +1 -0
- package/dist/guard/diff-pattern-matcher.d.ts +52 -0
- package/dist/guard/diff-pattern-matcher.d.ts.map +1 -0
- package/dist/guard/diff-pattern-matcher.js +325 -0
- package/dist/guard/diff-pattern-matcher.js.map +1 -0
- package/dist/guard/file-fetcher.d.ts +3 -0
- package/dist/guard/file-fetcher.d.ts.map +1 -0
- package/dist/guard/file-fetcher.js +21 -0
- package/dist/guard/file-fetcher.js.map +1 -0
- package/dist/guard/guard-engine.d.ts +8 -0
- package/dist/guard/guard-engine.d.ts.map +1 -0
- package/dist/guard/guard-engine.js +78 -0
- package/dist/guard/guard-engine.js.map +1 -0
- package/dist/guard/match-strategy.d.ts +14 -0
- package/dist/guard/match-strategy.d.ts.map +1 -0
- package/dist/guard/match-strategy.js +7 -0
- package/dist/guard/match-strategy.js.map +1 -0
- package/dist/guard/patterns-loader.d.ts +16 -0
- package/dist/guard/patterns-loader.d.ts.map +1 -0
- package/dist/guard/patterns-loader.js +61 -0
- package/dist/guard/patterns-loader.js.map +1 -0
- package/dist/guard/types.d.ts +61 -0
- package/dist/guard/types.d.ts.map +1 -0
- package/dist/guard/types.js +2 -0
- package/dist/guard/types.js.map +1 -0
- package/dist/memory/engram-client.d.ts +15 -0
- package/dist/memory/engram-client.d.ts.map +1 -0
- package/dist/memory/engram-client.js +167 -0
- package/dist/memory/engram-client.js.map +1 -0
- package/dist/memory/review-memory-service.d.ts +13 -0
- package/dist/memory/review-memory-service.d.ts.map +1 -0
- package/dist/memory/review-memory-service.js +43 -0
- package/dist/memory/review-memory-service.js.map +1 -0
- package/dist/persistence/database.d.ts +8 -0
- package/dist/persistence/database.d.ts.map +1 -0
- package/dist/persistence/database.js +58 -0
- package/dist/persistence/database.js.map +1 -0
- package/dist/persistence/false-positive-repository.d.ts +12 -0
- package/dist/persistence/false-positive-repository.d.ts.map +1 -0
- package/dist/persistence/false-positive-repository.js +58 -0
- package/dist/persistence/false-positive-repository.js.map +1 -0
- package/dist/persistence/migrations/0000_peaceful_blur.sql +66 -0
- package/dist/persistence/migrations/0001_phase3a_schema.sql +15 -0
- package/dist/persistence/migrations/0002_stack_profile.sql +1 -0
- package/dist/persistence/migrations/0003_known_workspaces.sql +5 -0
- package/dist/persistence/migrations/0004_review_memory.sql +24 -0
- package/dist/persistence/migrations/meta/0000_snapshot.json +468 -0
- package/dist/persistence/migrations/meta/_journal.json +41 -0
- package/dist/persistence/profile-repository.d.ts +33 -0
- package/dist/persistence/profile-repository.d.ts.map +1 -0
- package/dist/persistence/profile-repository.js +94 -0
- package/dist/persistence/profile-repository.js.map +1 -0
- package/dist/persistence/repository.d.ts +70 -0
- package/dist/persistence/repository.d.ts.map +1 -0
- package/dist/persistence/repository.js +225 -0
- package/dist/persistence/repository.js.map +1 -0
- package/dist/persistence/schema.d.ts +1333 -0
- package/dist/persistence/schema.d.ts.map +1 -0
- package/dist/persistence/schema.js +92 -0
- package/dist/persistence/schema.js.map +1 -0
- package/dist/persistence/workspace-repository.d.ts +14 -0
- package/dist/persistence/workspace-repository.d.ts.map +1 -0
- package/dist/persistence/workspace-repository.js +30 -0
- package/dist/persistence/workspace-repository.js.map +1 -0
- package/dist/rules-engine/finding-aggregator.d.ts +13 -0
- package/dist/rules-engine/finding-aggregator.d.ts.map +1 -0
- package/dist/rules-engine/finding-aggregator.js +135 -0
- package/dist/rules-engine/finding-aggregator.js.map +1 -0
- package/dist/rules-engine/pattern-generator.d.ts +26 -0
- package/dist/rules-engine/pattern-generator.d.ts.map +1 -0
- package/dist/rules-engine/pattern-generator.js +116 -0
- package/dist/rules-engine/pattern-generator.js.map +1 -0
- package/dist/rules-engine/rule-prompt-builder.d.ts +32 -0
- package/dist/rules-engine/rule-prompt-builder.d.ts.map +1 -0
- package/dist/rules-engine/rule-prompt-builder.js +124 -0
- package/dist/rules-engine/rule-prompt-builder.js.map +1 -0
- package/dist/rules-engine/types.d.ts +80 -0
- package/dist/rules-engine/types.d.ts.map +1 -0
- package/dist/rules-engine/types.js +18 -0
- package/dist/rules-engine/types.js.map +1 -0
- package/dist/rules-repo/rules-cache.d.ts +14 -0
- package/dist/rules-repo/rules-cache.d.ts.map +1 -0
- package/dist/rules-repo/rules-cache.js +43 -0
- package/dist/rules-repo/rules-cache.js.map +1 -0
- package/dist/rules-repo/rules-repo-client.d.ts +27 -0
- package/dist/rules-repo/rules-repo-client.d.ts.map +1 -0
- package/dist/rules-repo/rules-repo-client.js +85 -0
- package/dist/rules-repo/rules-repo-client.js.map +1 -0
- package/dist/rules-repo/types.d.ts +16 -0
- package/dist/rules-repo/types.d.ts.map +1 -0
- package/dist/rules-repo/types.js +10 -0
- package/dist/rules-repo/types.js.map +1 -0
- package/dist/stack-detector/ai-stack-fallback.d.ts +12 -0
- package/dist/stack-detector/ai-stack-fallback.d.ts.map +1 -0
- package/dist/stack-detector/ai-stack-fallback.js +67 -0
- package/dist/stack-detector/ai-stack-fallback.js.map +1 -0
- package/dist/stack-detector/ai-stack-schema.d.ts +28 -0
- package/dist/stack-detector/ai-stack-schema.d.ts.map +1 -0
- package/dist/stack-detector/ai-stack-schema.js +13 -0
- package/dist/stack-detector/ai-stack-schema.js.map +1 -0
- package/dist/stack-detector/formatter.d.ts +7 -0
- package/dist/stack-detector/formatter.d.ts.map +1 -0
- package/dist/stack-detector/formatter.js +37 -0
- package/dist/stack-detector/formatter.js.map +1 -0
- package/dist/stack-detector/index.d.ts +7 -0
- package/dist/stack-detector/index.d.ts.map +1 -0
- package/dist/stack-detector/index.js +5 -0
- package/dist/stack-detector/index.js.map +1 -0
- package/dist/stack-detector/merge-profiles.d.ts +5 -0
- package/dist/stack-detector/merge-profiles.d.ts.map +1 -0
- package/dist/stack-detector/merge-profiles.js +36 -0
- package/dist/stack-detector/merge-profiles.js.map +1 -0
- package/dist/stack-detector/parsers.d.ts +12 -0
- package/dist/stack-detector/parsers.d.ts.map +1 -0
- package/dist/stack-detector/parsers.js +259 -0
- package/dist/stack-detector/parsers.js.map +1 -0
- package/dist/stack-detector/stack-detector.d.ts +11 -0
- package/dist/stack-detector/stack-detector.d.ts.map +1 -0
- package/dist/stack-detector/stack-detector.js +83 -0
- package/dist/stack-detector/stack-detector.js.map +1 -0
- package/dist/stack-detector/types.d.ts +13 -0
- package/dist/stack-detector/types.d.ts.map +1 -0
- package/dist/stack-detector/types.js +2 -0
- package/dist/stack-detector/types.js.map +1 -0
- package/dist/tui/app.d.ts +9 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +45 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/callbacks/tui-workflow-callbacks.d.ts +32 -0
- package/dist/tui/callbacks/tui-workflow-callbacks.d.ts.map +1 -0
- package/dist/tui/callbacks/tui-workflow-callbacks.js +88 -0
- package/dist/tui/callbacks/tui-workflow-callbacks.js.map +1 -0
- package/dist/tui/components/key-hint.d.ts +7 -0
- package/dist/tui/components/key-hint.d.ts.map +1 -0
- package/dist/tui/components/key-hint.js +6 -0
- package/dist/tui/components/key-hint.js.map +1 -0
- package/dist/tui/components/scroll-list.d.ts +20 -0
- package/dist/tui/components/scroll-list.d.ts.map +1 -0
- package/dist/tui/components/scroll-list.js +85 -0
- package/dist/tui/components/scroll-list.js.map +1 -0
- package/dist/tui/components/searchable-list.d.ts +15 -0
- package/dist/tui/components/searchable-list.d.ts.map +1 -0
- package/dist/tui/components/searchable-list.js +97 -0
- package/dist/tui/components/searchable-list.js.map +1 -0
- package/dist/tui/components/severity-badge.d.ts +6 -0
- package/dist/tui/components/severity-badge.d.ts.map +1 -0
- package/dist/tui/components/severity-badge.js +17 -0
- package/dist/tui/components/severity-badge.js.map +1 -0
- package/dist/tui/components/severity-selector.d.ts +9 -0
- package/dist/tui/components/severity-selector.d.ts.map +1 -0
- package/dist/tui/components/severity-selector.js +29 -0
- package/dist/tui/components/severity-selector.js.map +1 -0
- package/dist/tui/components/spinner.d.ts +6 -0
- package/dist/tui/components/spinner.d.ts.map +1 -0
- package/dist/tui/components/spinner.js +19 -0
- package/dist/tui/components/spinner.js.map +1 -0
- package/dist/tui/components/status-bar.d.ts +10 -0
- package/dist/tui/components/status-bar.d.ts.map +1 -0
- package/dist/tui/components/status-bar.js +7 -0
- package/dist/tui/components/status-bar.js.map +1 -0
- package/dist/tui/deps-context.d.ts +27 -0
- package/dist/tui/deps-context.d.ts.map +1 -0
- package/dist/tui/deps-context.js +9 -0
- package/dist/tui/deps-context.js.map +1 -0
- package/dist/tui/error-boundary.d.ts +16 -0
- package/dist/tui/error-boundary.d.ts.map +1 -0
- package/dist/tui/error-boundary.js +30 -0
- package/dist/tui/error-boundary.js.map +1 -0
- package/dist/tui/hooks/use-agent-recommendations.d.ts +10 -0
- package/dist/tui/hooks/use-agent-recommendations.d.ts.map +1 -0
- package/dist/tui/hooks/use-agent-recommendations.js +66 -0
- package/dist/tui/hooks/use-agent-recommendations.js.map +1 -0
- package/dist/tui/hooks/use-auth.d.ts +14 -0
- package/dist/tui/hooks/use-auth.d.ts.map +1 -0
- package/dist/tui/hooks/use-auth.js +32 -0
- package/dist/tui/hooks/use-auth.js.map +1 -0
- package/dist/tui/hooks/use-bitbucket.d.ts +18 -0
- package/dist/tui/hooks/use-bitbucket.d.ts.map +1 -0
- package/dist/tui/hooks/use-bitbucket.js +31 -0
- package/dist/tui/hooks/use-bitbucket.js.map +1 -0
- package/dist/tui/hooks/use-review.d.ts +6 -0
- package/dist/tui/hooks/use-review.d.ts.map +1 -0
- package/dist/tui/hooks/use-review.js +24 -0
- package/dist/tui/hooks/use-review.js.map +1 -0
- package/dist/tui/hooks/use-session.d.ts +47 -0
- package/dist/tui/hooks/use-session.d.ts.map +1 -0
- package/dist/tui/hooks/use-session.js +17 -0
- package/dist/tui/hooks/use-session.js.map +1 -0
- package/dist/tui/screen-router.d.ts +3 -0
- package/dist/tui/screen-router.d.ts.map +1 -0
- package/dist/tui/screen-router.js +73 -0
- package/dist/tui/screen-router.js.map +1 -0
- package/dist/tui/screens/agent-select.d.ts +3 -0
- package/dist/tui/screens/agent-select.d.ts.map +1 -0
- package/dist/tui/screens/agent-select.js +173 -0
- package/dist/tui/screens/agent-select.js.map +1 -0
- package/dist/tui/screens/finding-detail.d.ts +3 -0
- package/dist/tui/screens/finding-detail.d.ts.map +1 -0
- package/dist/tui/screens/finding-detail.js +48 -0
- package/dist/tui/screens/finding-detail.js.map +1 -0
- package/dist/tui/screens/findings-list.d.ts +3 -0
- package/dist/tui/screens/findings-list.d.ts.map +1 -0
- package/dist/tui/screens/findings-list.js +108 -0
- package/dist/tui/screens/findings-list.js.map +1 -0
- package/dist/tui/screens/guard-detail.d.ts +3 -0
- package/dist/tui/screens/guard-detail.d.ts.map +1 -0
- package/dist/tui/screens/guard-detail.js +41 -0
- package/dist/tui/screens/guard-detail.js.map +1 -0
- package/dist/tui/screens/guard-home.d.ts +3 -0
- package/dist/tui/screens/guard-home.d.ts.map +1 -0
- package/dist/tui/screens/guard-home.js +81 -0
- package/dist/tui/screens/guard-home.js.map +1 -0
- package/dist/tui/screens/guard-results.d.ts +3 -0
- package/dist/tui/screens/guard-results.d.ts.map +1 -0
- package/dist/tui/screens/guard-results.js +103 -0
- package/dist/tui/screens/guard-results.js.map +1 -0
- package/dist/tui/screens/guard-running.d.ts +3 -0
- package/dist/tui/screens/guard-running.d.ts.map +1 -0
- package/dist/tui/screens/guard-running.js +92 -0
- package/dist/tui/screens/guard-running.js.map +1 -0
- package/dist/tui/screens/home.d.ts +3 -0
- package/dist/tui/screens/home.d.ts.map +1 -0
- package/dist/tui/screens/home.js +44 -0
- package/dist/tui/screens/home.js.map +1 -0
- package/dist/tui/screens/integrity-report.d.ts +3 -0
- package/dist/tui/screens/integrity-report.d.ts.map +1 -0
- package/dist/tui/screens/integrity-report.js +29 -0
- package/dist/tui/screens/integrity-report.js.map +1 -0
- package/dist/tui/screens/login.d.ts +3 -0
- package/dist/tui/screens/login.d.ts.map +1 -0
- package/dist/tui/screens/login.js +81 -0
- package/dist/tui/screens/login.js.map +1 -0
- package/dist/tui/screens/pr-list.d.ts +3 -0
- package/dist/tui/screens/pr-list.d.ts.map +1 -0
- package/dist/tui/screens/pr-list.js +76 -0
- package/dist/tui/screens/pr-list.js.map +1 -0
- package/dist/tui/screens/publish-confirm.d.ts +3 -0
- package/dist/tui/screens/publish-confirm.d.ts.map +1 -0
- package/dist/tui/screens/publish-confirm.js +42 -0
- package/dist/tui/screens/publish-confirm.js.map +1 -0
- package/dist/tui/screens/publishing.d.ts +3 -0
- package/dist/tui/screens/publishing.d.ts.map +1 -0
- package/dist/tui/screens/publishing.js +50 -0
- package/dist/tui/screens/publishing.js.map +1 -0
- package/dist/tui/screens/repo-select.d.ts +3 -0
- package/dist/tui/screens/repo-select.d.ts.map +1 -0
- package/dist/tui/screens/repo-select.js +76 -0
- package/dist/tui/screens/repo-select.js.map +1 -0
- package/dist/tui/screens/review-running.d.ts +3 -0
- package/dist/tui/screens/review-running.d.ts.map +1 -0
- package/dist/tui/screens/review-running.js +187 -0
- package/dist/tui/screens/review-running.js.map +1 -0
- package/dist/tui/screens/session-detail.d.ts +7 -0
- package/dist/tui/screens/session-detail.d.ts.map +1 -0
- package/dist/tui/screens/session-detail.js +28 -0
- package/dist/tui/screens/session-detail.js.map +1 -0
- package/dist/tui/screens/session-list.d.ts +7 -0
- package/dist/tui/screens/session-list.d.ts.map +1 -0
- package/dist/tui/screens/session-list.js +38 -0
- package/dist/tui/screens/session-list.js.map +1 -0
- package/dist/tui/screens/url-input.d.ts +3 -0
- package/dist/tui/screens/url-input.d.ts.map +1 -0
- package/dist/tui/screens/url-input.js +111 -0
- package/dist/tui/screens/url-input.js.map +1 -0
- package/dist/tui/screens/welcome.d.ts +3 -0
- package/dist/tui/screens/welcome.d.ts.map +1 -0
- package/dist/tui/screens/welcome.js +48 -0
- package/dist/tui/screens/welcome.js.map +1 -0
- package/dist/tui/screens/workspace-select.d.ts +3 -0
- package/dist/tui/screens/workspace-select.d.ts.map +1 -0
- package/dist/tui/screens/workspace-select.js +128 -0
- package/dist/tui/screens/workspace-select.js.map +1 -0
- package/dist/tui/state/router-context.d.ts +14 -0
- package/dist/tui/state/router-context.d.ts.map +1 -0
- package/dist/tui/state/router-context.js +9 -0
- package/dist/tui/state/router-context.js.map +1 -0
- package/dist/tui/state/router-reducer.d.ts +23 -0
- package/dist/tui/state/router-reducer.d.ts.map +1 -0
- package/dist/tui/state/router-reducer.js +21 -0
- package/dist/tui/state/router-reducer.js.map +1 -0
- package/dist/tui/state/tui-context.d.ts +11 -0
- package/dist/tui/state/tui-context.d.ts.map +1 -0
- package/dist/tui/state/tui-context.js +9 -0
- package/dist/tui/state/tui-context.js.map +1 -0
- package/dist/tui/state/tui-reducer.d.ts +212 -0
- package/dist/tui/state/tui-reducer.d.ts.map +1 -0
- package/dist/tui/state/tui-reducer.js +321 -0
- package/dist/tui/state/tui-reducer.js.map +1 -0
- package/dist/tui/utils/group-by-file.d.ts +7 -0
- package/dist/tui/utils/group-by-file.d.ts.map +1 -0
- package/dist/tui/utils/group-by-file.js +18 -0
- package/dist/tui/utils/group-by-file.js.map +1 -0
- package/dist/tui/utils/group-matches-by-file.d.ts +7 -0
- package/dist/tui/utils/group-matches-by-file.d.ts.map +1 -0
- package/dist/tui/utils/group-matches-by-file.js +18 -0
- package/dist/tui/utils/group-matches-by-file.js.map +1 -0
- package/dist/tui/utils/group-repos-by-project.d.ts +9 -0
- package/dist/tui/utils/group-repos-by-project.d.ts.map +1 -0
- package/dist/tui/utils/group-repos-by-project.js +48 -0
- package/dist/tui/utils/group-repos-by-project.js.map +1 -0
- package/dist/types/agent.d.ts +46 -0
- package/dist/types/agent.d.ts.map +1 -0
- package/dist/types/agent.js +2 -0
- package/dist/types/agent.js.map +1 -0
- package/dist/types/bitbucket.d.ts +90 -0
- package/dist/types/bitbucket.d.ts.map +1 -0
- package/dist/types/bitbucket.js +2 -0
- package/dist/types/bitbucket.js.map +1 -0
- package/dist/types/config.d.ts +17 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +2 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/diff.d.ts +24 -0
- package/dist/types/diff.d.ts.map +1 -0
- package/dist/types/diff.js +2 -0
- package/dist/types/diff.js.map +1 -0
- package/dist/types/engram.d.ts +29 -0
- package/dist/types/engram.d.ts.map +1 -0
- package/dist/types/engram.js +2 -0
- package/dist/types/engram.js.map +1 -0
- package/dist/types/false-positive.d.ts +12 -0
- package/dist/types/false-positive.d.ts.map +1 -0
- package/dist/types/false-positive.js +2 -0
- package/dist/types/false-positive.js.map +1 -0
- package/dist/types/index.d.ts +14 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/provider.d.ts +31 -0
- package/dist/types/provider.d.ts.map +1 -0
- package/dist/types/provider.js +2 -0
- package/dist/types/provider.js.map +1 -0
- package/dist/types/repo-config.d.ts +336 -0
- package/dist/types/repo-config.d.ts.map +1 -0
- package/dist/types/repo-config.js +62 -0
- package/dist/types/repo-config.js.map +1 -0
- package/dist/types/review-finding.d.ts +34 -0
- package/dist/types/review-finding.d.ts.map +1 -0
- package/dist/types/review-finding.js +11 -0
- package/dist/types/review-finding.js.map +1 -0
- package/dist/types/review-session.d.ts +21 -0
- package/dist/types/review-session.d.ts.map +1 -0
- package/dist/types/review-session.js +2 -0
- package/dist/types/review-session.js.map +1 -0
- package/dist/types/skill.d.ts +7 -0
- package/dist/types/skill.d.ts.map +1 -0
- package/dist/types/skill.js +2 -0
- package/dist/types/skill.js.map +1 -0
- package/dist/utils/comment-formatter.d.ts +19 -0
- package/dist/utils/comment-formatter.d.ts.map +1 -0
- package/dist/utils/comment-formatter.js +53 -0
- package/dist/utils/comment-formatter.js.map +1 -0
- package/dist/utils/cost-estimator.d.ts +19 -0
- package/dist/utils/cost-estimator.d.ts.map +1 -0
- package/dist/utils/cost-estimator.js +32 -0
- package/dist/utils/cost-estimator.js.map +1 -0
- package/dist/utils/diff-parser.d.ts +7 -0
- package/dist/utils/diff-parser.d.ts.map +1 -0
- package/dist/utils/diff-parser.js +175 -0
- package/dist/utils/diff-parser.js.map +1 -0
- package/dist/utils/file-filter.d.ts +16 -0
- package/dist/utils/file-filter.d.ts.map +1 -0
- package/dist/utils/file-filter.js +64 -0
- package/dist/utils/file-filter.js.map +1 -0
- package/dist/utils/hash.d.ts +25 -0
- package/dist/utils/hash.d.ts.map +1 -0
- package/dist/utils/hash.js +45 -0
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +40 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/parse-bitbucket-url.d.ts +12 -0
- package/dist/utils/parse-bitbucket-url.d.ts.map +1 -0
- package/dist/utils/parse-bitbucket-url.js +41 -0
- package/dist/utils/parse-bitbucket-url.js.map +1 -0
- package/dist/utils/paths.d.ts +6 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +27 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/summary-generator.d.ts +17 -0
- package/dist/utils/summary-generator.d.ts.map +1 -0
- package/dist/utils/summary-generator.js +76 -0
- package/dist/utils/summary-generator.js.map +1 -0
- package/oclif.manifest.json +467 -0
- package/package.json +100 -0
package/README.md
ADDED
|
@@ -0,0 +1,964 @@
|
|
|
1
|
+
# PRISM-CLI
|
|
2
|
+
|
|
3
|
+
Intelligent Pull Request review orchestrator for Bitbucket. Automates code reviews using AI multi-agent architecture with a TUI-first interactive experience.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Quick Start](#quick-start)
|
|
8
|
+
- [Prerequisites](#prerequisites)
|
|
9
|
+
- [Installation](#installation)
|
|
10
|
+
- [Authentication Setup](#authentication-setup)
|
|
11
|
+
- [Usage](#usage)
|
|
12
|
+
- [Architecture Overview](#architecture-overview)
|
|
13
|
+
- [Data Flow](#data-flow)
|
|
14
|
+
- [AI Agent System](#ai-agent-system)
|
|
15
|
+
- [Configuration](#configuration)
|
|
16
|
+
- [Project Structure](#project-structure)
|
|
17
|
+
- [Development](#development)
|
|
18
|
+
- [Troubleshooting](#troubleshooting)
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# 1. Clone and install
|
|
26
|
+
git clone <repo-url>
|
|
27
|
+
cd prism-cli
|
|
28
|
+
pnpm install
|
|
29
|
+
|
|
30
|
+
# 2. Build
|
|
31
|
+
pnpm build
|
|
32
|
+
|
|
33
|
+
# 3. Run
|
|
34
|
+
pnpm start # or: node bin/run.js
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
On first launch, PRISM opens an interactive TUI that guides you through login, workspace selection, and PR review.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Prerequisites
|
|
42
|
+
|
|
43
|
+
| Requirement | Version | Notes |
|
|
44
|
+
|-------------|---------|-------|
|
|
45
|
+
| Node.js | >= 20.0.0 | Required for ESM + crypto APIs |
|
|
46
|
+
| pnpm | Latest | Package manager |
|
|
47
|
+
| Bitbucket API Token | - | See [Authentication Setup](#authentication-setup) |
|
|
48
|
+
| AI Provider | - | Claude Code CLI (default) or Anthropic API key |
|
|
49
|
+
|
|
50
|
+
### AI Provider Options
|
|
51
|
+
|
|
52
|
+
| Provider | Setup | Cost |
|
|
53
|
+
|----------|-------|------|
|
|
54
|
+
| **Claude Code** (default) | No extra config needed — uses your local Claude Code CLI | Included in Claude Code subscription |
|
|
55
|
+
| **Anthropic API** | Set `ANTHROPIC_API_KEY` env var or in `config.json` | Pay-per-token |
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## Installation
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Install dependencies
|
|
63
|
+
pnpm install
|
|
64
|
+
|
|
65
|
+
# Build (TypeScript → dist/ + migrations + oclif manifest)
|
|
66
|
+
pnpm build
|
|
67
|
+
|
|
68
|
+
# Verify
|
|
69
|
+
pnpm test # Run all 1210 tests
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Build Pipeline
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
pnpm build
|
|
76
|
+
└── tsc -b # TypeScript compilation
|
|
77
|
+
└── postbuild:
|
|
78
|
+
├── copyfiles migrations → dist/ # SQLite migration files
|
|
79
|
+
├── copyfiles prompts → dist/ # Agent prompt templates
|
|
80
|
+
└── oclif manifest # Command discovery manifest
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Authentication Setup
|
|
86
|
+
|
|
87
|
+
PRISM uses Bitbucket API tokens for authentication.
|
|
88
|
+
|
|
89
|
+
### Step 1: Create an API Token
|
|
90
|
+
|
|
91
|
+
1. Go to [https://id.atlassian.com/manage-profile/security/api-tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
|
|
92
|
+
2. Create an **"API token with scopes"** (NOT a simple API token)
|
|
93
|
+
3. Create an App with these scopes:
|
|
94
|
+
|
|
95
|
+
| Scope | Access | Purpose |
|
|
96
|
+
|-------|--------|---------|
|
|
97
|
+
| `read:user:bitbucket` | Read | Validate credentials (`GET /2.0/user`) |
|
|
98
|
+
| `read:workspace:bitbucket` | Read | Access workspace info |
|
|
99
|
+
| `read:repository:bitbucket` | Read | List repos, fetch file content (stack detection) |
|
|
100
|
+
| `read:pullrequest:bitbucket` | Read | Fetch PR metadata, diffs, and comments |
|
|
101
|
+
| `write:pullrequest:bitbucket` | Write | Publish inline review comments |
|
|
102
|
+
|
|
103
|
+
### Step 2: Login via PRISM
|
|
104
|
+
|
|
105
|
+
On first launch, the TUI shows a login screen:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
Username: your-email@example.com
|
|
109
|
+
API Token: ****************************
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
- **Username**: Your Bitbucket email (the one you log in with)
|
|
113
|
+
- **API Token**: The token created in Step 1
|
|
114
|
+
|
|
115
|
+
Credentials are encrypted (AES-256-GCM) and stored locally. Never transmitted anywhere except Bitbucket API.
|
|
116
|
+
|
|
117
|
+
### Credential Storage
|
|
118
|
+
|
|
119
|
+
| Platform | Location |
|
|
120
|
+
|----------|----------|
|
|
121
|
+
| Windows | `%APPDATA%\prism-cli\credentials.json` |
|
|
122
|
+
| macOS | `~/.config/prism-cli/credentials.json` |
|
|
123
|
+
| Linux | `~/.config/prism-cli/credentials.json` |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Usage
|
|
128
|
+
|
|
129
|
+
### Interactive Mode (Default)
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
prism # Launch TUI
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The TUI guides you through:
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
Login --> Workspace --> Repository --> PR --> Agents --> Review --> Publish
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Command Mode
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
prism login # Authenticate
|
|
145
|
+
prism logout # Clear credentials
|
|
146
|
+
prism review start --pr <id> # Start review for a specific PR
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Architecture Overview
|
|
152
|
+
|
|
153
|
+
PRISM is organized in 5 horizontal layers. Each layer only depends on the layers below it.
|
|
154
|
+
|
|
155
|
+
### Layer Diagram
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
===================================================================
|
|
159
|
+
TERMINAL EXPERIENCE src/tui/, src/commands/
|
|
160
|
+
-------------------------------------------------------------------
|
|
161
|
+
TUI Screens (Ink/React) Screen Router TUI State (useReducer)
|
|
162
|
+
14 interactive screens navigation map auth, selection, review
|
|
163
|
+
===================================================================
|
|
164
|
+
|
|
|
165
|
+
v
|
|
166
|
+
===================================================================
|
|
167
|
+
APPLICATION CORE src/core/
|
|
168
|
+
-------------------------------------------------------------------
|
|
169
|
+
Workflow Engine Session Manager Comment Publisher
|
|
170
|
+
16-step orchestration SQLite CRUD BB inline comments
|
|
171
|
+
coordinates all layers review sessions rate-limit handling
|
|
172
|
+
===================================================================
|
|
173
|
+
|
|
|
174
|
+
v
|
|
175
|
+
===================================================================
|
|
176
|
+
AI ORCHESTRATION src/ai/
|
|
177
|
+
-------------------------------------------------------------------
|
|
178
|
+
Review Orchestrator ──> Rule-Based Strategy ──> Context Analyzer
|
|
179
|
+
sequential dispatch agent plan builder file + stack analysis
|
|
180
|
+
|
|
|
181
|
+
Agent Registry (7 agents, sequential execution)
|
|
182
|
+
┌──────┬──────┬──────┬──────┬──────┬──────┬──────┐
|
|
183
|
+
│ TS │ SEC │ CSS │ C# │ ARCH │ TEST │ PERF │
|
|
184
|
+
└──────┴──────┴──────┴──────┴──────┴──────┴──────┘
|
|
185
|
+
Deduplicator Consolidation Skill Registry
|
|
186
|
+
vs existing comments merge multi-agent per-agent instructions
|
|
187
|
+
===================================================================
|
|
188
|
+
|
|
|
189
|
+
v
|
|
190
|
+
===================================================================
|
|
191
|
+
INTEGRATION src/bitbucket/, src/stack-detector/
|
|
192
|
+
-------------------------------------------------------------------
|
|
193
|
+
Bitbucket Client Stack Detector Engram Client
|
|
194
|
+
REST API (auth, PRs, 8 manifest parsers cross-session memory
|
|
195
|
+
diffs, comments) + AI fallback prior reviews + context
|
|
196
|
+
===================================================================
|
|
197
|
+
|
|
|
198
|
+
v
|
|
199
|
+
===================================================================
|
|
200
|
+
PERSISTENCE src/persistence/, src/config/
|
|
201
|
+
-------------------------------------------------------------------
|
|
202
|
+
SQLite + Drizzle ORM Credential Manager Config Manager
|
|
203
|
+
sessions, findings, AES-256-GCM provider resolution
|
|
204
|
+
profiles, workspaces encrypted storage global + per-repo
|
|
205
|
+
===================================================================
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Component Summary
|
|
209
|
+
|
|
210
|
+
| Layer | Key Components | Technology |
|
|
211
|
+
|-------|---------------|------------|
|
|
212
|
+
| **Terminal** | 14 TUI screens, screen router, state management | Ink v5, React 18, oclif v4 |
|
|
213
|
+
| **Core** | 16-step workflow engine, session tracking, comment publishing | Custom orchestration |
|
|
214
|
+
| **AI** | 7 specialized agents, strategy-based selection, dedup pipeline | Anthropic SDK, Zod |
|
|
215
|
+
| **Integration** | Bitbucket REST client, manifest-based stack detection, memory | fetch, Engram HTTP |
|
|
216
|
+
| **Persistence** | SQLite (WAL), encrypted credentials, JSON config | better-sqlite3, Drizzle |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Data Flow
|
|
221
|
+
|
|
222
|
+
### Complete Workflow: Input to Output
|
|
223
|
+
|
|
224
|
+
```
|
|
225
|
+
┌─────────────┐
|
|
226
|
+
│ USER │
|
|
227
|
+
│ launches │
|
|
228
|
+
│ prism │
|
|
229
|
+
└──────┬──────┘
|
|
230
|
+
│
|
|
231
|
+
┌──────────▼──────────┐
|
|
232
|
+
│ AUTHENTICATION │
|
|
233
|
+
│ │
|
|
234
|
+
│ credentials.json │
|
|
235
|
+
│ ──decrypt──► │
|
|
236
|
+
│ GET /2.0/user │
|
|
237
|
+
│ ──validate──► │
|
|
238
|
+
└──────────┬──────────┘
|
|
239
|
+
│
|
|
240
|
+
┌──────────▼──────────┐
|
|
241
|
+
│ SELECTION │
|
|
242
|
+
│ │
|
|
243
|
+
│ Workspace (SQLite) │
|
|
244
|
+
│ ▼ │
|
|
245
|
+
│ Repos (BB API) │
|
|
246
|
+
│ ▼ │
|
|
247
|
+
│ Open PRs (BB API) │
|
|
248
|
+
│ ▼ │
|
|
249
|
+
│ Agents (checkbox) │
|
|
250
|
+
└──────────┬──────────┘
|
|
251
|
+
│
|
|
252
|
+
┌────────────────────▼────────────────────┐
|
|
253
|
+
│ WORKFLOW ENGINE (16 steps) │
|
|
254
|
+
│ │
|
|
255
|
+
│ ┌─────────────────────────────────────┐ │
|
|
256
|
+
│ │ Step 1: Fetch PR metadata │ │
|
|
257
|
+
│ │ GET /pullrequests/{id} │ │
|
|
258
|
+
│ └──────────────┬──────────────────────┘ │
|
|
259
|
+
│ ▼ │
|
|
260
|
+
│ ┌─────────────────────────────────────┐ │
|
|
261
|
+
│ │ Step 2: Fetch existing BB comments │ │
|
|
262
|
+
│ │ GET /pullrequests/{id}/comments │ │
|
|
263
|
+
│ └──────────────┬──────────────────────┘ │
|
|
264
|
+
│ ▼ │
|
|
265
|
+
│ ┌─────────────────────────────────────┐ │
|
|
266
|
+
│ │ Step 2b: Comment integrity check │ │
|
|
267
|
+
│ │ Compare DB findings vs live BB │ │
|
|
268
|
+
│ │ comments → detect deleted ones │ │
|
|
269
|
+
│ └──────────────┬──────────────────────┘ │
|
|
270
|
+
│ ▼ │
|
|
271
|
+
│ ┌─────────────────────────────────────┐ │
|
|
272
|
+
│ │ Step 4: Fetch raw unified diff │ │
|
|
273
|
+
│ │ GET /pullrequests/{id}/diff │ │
|
|
274
|
+
│ └──────────────┬──────────────────────┘ │
|
|
275
|
+
│ ▼ │
|
|
276
|
+
│ ┌─────────────────────────────────────┐ │
|
|
277
|
+
│ │ Step 5: Load prior review memory │ │
|
|
278
|
+
│ │ Engram: search prior findings │ │
|
|
279
|
+
│ │ Engram: get project context │ │
|
|
280
|
+
│ └──────────────┬──────────────────────┘ │
|
|
281
|
+
│ ▼ │
|
|
282
|
+
│ ┌─────────────────────────────────────┐ │
|
|
283
|
+
│ │ Step 4b: Load conventions │ │
|
|
284
|
+
│ │ From prism.yaml or inline config │ │
|
|
285
|
+
│ └──────────────┬──────────────────────┘ │
|
|
286
|
+
│ ▼ │
|
|
287
|
+
│ ┌─────────────────────────────────────┐ │
|
|
288
|
+
│ │ Step 4c: Detect tech stack │ │
|
|
289
|
+
│ │ │ │
|
|
290
|
+
│ │ ┌──────────────────────────┐ │ │
|
|
291
|
+
│ │ │ 1. Check SQLite cache │ │ │
|
|
292
|
+
│ │ └─────────┬────────────────┘ │ │
|
|
293
|
+
│ │ ▼ │ │
|
|
294
|
+
│ │ ┌──────────────────────────┐ │ │
|
|
295
|
+
│ │ │ 2. Fetch manifests from │ │ │
|
|
296
|
+
│ │ │ BB source API │ │ │
|
|
297
|
+
│ │ │ (package.json, go.mod, │ │ │
|
|
298
|
+
│ │ │ Cargo.toml, etc.) │ │ │
|
|
299
|
+
│ │ └─────────┬────────────────┘ │ │
|
|
300
|
+
│ │ ▼ │ │
|
|
301
|
+
│ │ ┌──────────────────────────┐ │ │
|
|
302
|
+
│ │ │ 3. Parse → StackProfile │ │ │
|
|
303
|
+
│ │ │ {framework, runtime, │ │ │
|
|
304
|
+
│ │ │ language, libraries} │ │ │
|
|
305
|
+
│ │ └─────────┬────────────────┘ │ │
|
|
306
|
+
│ │ ▼ │ │
|
|
307
|
+
│ │ ┌──────────────────────────┐ │ │
|
|
308
|
+
│ │ │ 4. AI fallback (haiku) │ │ │
|
|
309
|
+
│ │ │ if manifests missing │ │ │
|
|
310
|
+
│ │ └─────────┬────────────────┘ │ │
|
|
311
|
+
│ │ ▼ │ │
|
|
312
|
+
│ │ ┌──────────────────────────┐ │ │
|
|
313
|
+
│ │ │ 5. Merge + cache in │ │ │
|
|
314
|
+
│ │ │ SQLite │ │ │
|
|
315
|
+
│ │ └──────────────────────────┘ │ │
|
|
316
|
+
│ └──────────────┬──────────────────────┘ │
|
|
317
|
+
│ ▼ │
|
|
318
|
+
│ ┌─────────────────────────────────────┐ │
|
|
319
|
+
│ │ Step 6: Parse diff → DiffFile[] │ │
|
|
320
|
+
│ │ Filter excluded patterns │ │
|
|
321
|
+
│ └──────────────┬──────────────────────┘ │
|
|
322
|
+
│ ▼ │
|
|
323
|
+
│ ┌─────────────────────────────────────┐ │
|
|
324
|
+
│ │ Step 6b: Cost estimation │ │
|
|
325
|
+
│ │ chars × agents × provider rate │ │
|
|
326
|
+
│ │ Warn if >5000 lines or >$5 │ │
|
|
327
|
+
│ └──────────────┬──────────────────────┘ │
|
|
328
|
+
│ ▼ │
|
|
329
|
+
│ ┌─────────────────────────────────────┐ │
|
|
330
|
+
│ │ Step 7: Create DB session │ │
|
|
331
|
+
│ │ SessionManager → SQLite │ │
|
|
332
|
+
│ └──────────────┬──────────────────────┘ │
|
|
333
|
+
│ ▼ │
|
|
334
|
+
└─────────────────┬───────────────────────┘
|
|
335
|
+
│
|
|
336
|
+
┌────────────────────▼────────────────────┐
|
|
337
|
+
│ AI ORCHESTRATION (Step 9) │
|
|
338
|
+
│ │
|
|
339
|
+
│ ┌─────────────────────────────────────┐ │
|
|
340
|
+
│ │ Agent Selection (RuleBasedStrategy) │ │
|
|
341
|
+
│ │ │ │
|
|
342
|
+
│ │ Priority chain: │ │
|
|
343
|
+
│ │ 1. config.agents (explicit override) │ │
|
|
344
|
+
│ │ 2. context ∪ stack (merged) │ │
|
|
345
|
+
│ │ 3. context-only (fallback) │ │
|
|
346
|
+
│ │ │ │
|
|
347
|
+
│ │ Context: file extensions in diff │ │
|
|
348
|
+
│ │ Stack: framework/library rules │ │
|
|
349
|
+
│ └──────────────┬──────────────────────┘ │
|
|
350
|
+
│ ▼ │
|
|
351
|
+
│ ┌─────────────────────────────────────┐ │
|
|
352
|
+
│ │ Sequential Agent Execution │ │
|
|
353
|
+
│ │ │ │
|
|
354
|
+
│ │ For each selected agent: │ │
|
|
355
|
+
│ │ ┌───────────────────────────────┐ │ │
|
|
356
|
+
│ │ │ 1. Filter files by fileFilter │ │ │
|
|
357
|
+
│ │ │ 2. Load skills for agent │ │ │
|
|
358
|
+
│ │ │ 3. Build system prompt: │ │ │
|
|
359
|
+
│ │ │ base + context + conventions│ │ │
|
|
360
|
+
│ │ │ + skills + stack profile │ │ │
|
|
361
|
+
│ │ │ + framework rules (auto + │ │ │
|
|
362
|
+
│ │ │ repo reviewRules) │ │ │
|
|
363
|
+
│ │ │ 4. Format diff as user content │ │ │
|
|
364
|
+
│ │ │ with [L{line}] annotations │ │ │
|
|
365
|
+
│ │ │ 5. Call AI provider │ │ │
|
|
366
|
+
│ │ │ (tool_use: report_findings) │ │ │
|
|
367
|
+
│ │ │ 6. Validate findings via Zod │ │ │
|
|
368
|
+
│ │ │ 7. Check line numbers vs diff │ │ │
|
|
369
|
+
│ │ └───────────────────────────────┘ │ │
|
|
370
|
+
│ └──────────────┬──────────────────────┘ │
|
|
371
|
+
│ ▼ │
|
|
372
|
+
│ ┌─────────────────────────────────────┐ │
|
|
373
|
+
│ │ Post-Processing │ │
|
|
374
|
+
│ │ │ │
|
|
375
|
+
│ │ 1. Consolidate (same loc+category │ │
|
|
376
|
+
│ │ → keep highest severity) │ │
|
|
377
|
+
│ │ 2. Deduplicate vs existing BB │ │
|
|
378
|
+
│ │ comments + prior Engram findings │ │
|
|
379
|
+
│ │ 3. Sort: severity → file → line │ │
|
|
380
|
+
│ └──────────────┬──────────────────────┘ │
|
|
381
|
+
│ │ │
|
|
382
|
+
│ Output: ReviewFinding[] │
|
|
383
|
+
│ + agentResults[] + totalUsage │
|
|
384
|
+
└─────────────────┬───────────────────────┘
|
|
385
|
+
│
|
|
386
|
+
┌──────────────▼──────────────┐
|
|
387
|
+
│ HUMAN REVIEW (TUI) │
|
|
388
|
+
│ │
|
|
389
|
+
│ Findings grouped by file │
|
|
390
|
+
│ Severity badges: │
|
|
391
|
+
│ [CRITICAL] [HIGH] [MED] │
|
|
392
|
+
│ │
|
|
393
|
+
│ Navigate: arrows + Enter │
|
|
394
|
+
│ Publish: 'p' key │
|
|
395
|
+
└──────────────┬──────────────┘
|
|
396
|
+
│
|
|
397
|
+
┌──────────────▼──────────────┐
|
|
398
|
+
│ PUBLISH FLOW │
|
|
399
|
+
│ │
|
|
400
|
+
│ Confirm: y/n │
|
|
401
|
+
│ ▼ │
|
|
402
|
+
│ For each finding: │
|
|
403
|
+
│ 1. Format as markdown │
|
|
404
|
+
│ 2. POST /comments │
|
|
405
|
+
│ {inline: {path, line}} │
|
|
406
|
+
│ 3. 500ms rate limit delay │
|
|
407
|
+
│ 4. Store BB comment ID │
|
|
408
|
+
│ ▼ │
|
|
409
|
+
│ Save to Engram memory │
|
|
410
|
+
│ Update SQLite session │
|
|
411
|
+
└──────────────┬──────────────┘
|
|
412
|
+
│
|
|
413
|
+
┌──────────────▼──────────────┐
|
|
414
|
+
│ OUTPUT │
|
|
415
|
+
│ │
|
|
416
|
+
│ Published: X comments │
|
|
417
|
+
│ Skipped: Y │
|
|
418
|
+
│ Failed: Z │
|
|
419
|
+
│ Cost: $0.XX │
|
|
420
|
+
│ Session: #abc123 │
|
|
421
|
+
│ │
|
|
422
|
+
│ → Inline comments now │
|
|
423
|
+
│ visible on Bitbucket PR │
|
|
424
|
+
└─────────────────────────────┘
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### Agent Selection Detail
|
|
428
|
+
|
|
429
|
+
```
|
|
430
|
+
┌─────────────┐ ┌──────────────────┐
|
|
431
|
+
│ Diff Files │ │ Stack Profile │
|
|
432
|
+
│ (.ts, .css, │ │ {framework: │
|
|
433
|
+
│ .yaml ...) │ │ "angular", │
|
|
434
|
+
└──────┬──────┘ │ keyLibraries: │
|
|
435
|
+
│ │ ["rxjs"]} │
|
|
436
|
+
▼ └────────┬─────────┘
|
|
437
|
+
┌──────────────────┐ │
|
|
438
|
+
│ analyzeContext() │ │
|
|
439
|
+
│ File extensions │ ▼
|
|
440
|
+
│ → DetectedContext│ ┌──────────────────────┐
|
|
441
|
+
└────────┬────────┘ │ getStackAwareAgents() │
|
|
442
|
+
│ │ Framework rules: │
|
|
443
|
+
│ │ angular → ts + arch │
|
|
444
|
+
│ │ react → ts │
|
|
445
|
+
│ │ dotnet → cs + sec │
|
|
446
|
+
│ │ Library rules: │
|
|
447
|
+
│ │ rxjs → perf │
|
|
448
|
+
│ │ prisma → sec + perf │
|
|
449
|
+
▼ └────────┬─────────────┘
|
|
450
|
+
┌──────────────────┐ │
|
|
451
|
+
│getRecommendedA- │ │
|
|
452
|
+
│gents() by ext: │ │
|
|
453
|
+
│ .ts → ts-rev │ │
|
|
454
|
+
│ .css → css-rev │ │
|
|
455
|
+
│ .cs → cs-rev │ │
|
|
456
|
+
│ always: sec-rev │ │
|
|
457
|
+
└────────┬────────┘ │
|
|
458
|
+
│ │
|
|
459
|
+
└───────┬───────────────┘
|
|
460
|
+
▼
|
|
461
|
+
┌─────────────────────┐
|
|
462
|
+
│ resolveAgentIds() │
|
|
463
|
+
│ │
|
|
464
|
+
│ Priority: │
|
|
465
|
+
│ 1. config.agents │
|
|
466
|
+
│ (absolute) │
|
|
467
|
+
│ 2. context ∪ stack │
|
|
468
|
+
│ (merged Set) │
|
|
469
|
+
│ 3. context-only │
|
|
470
|
+
│ (no stack) │
|
|
471
|
+
└──────────┬──────────┘
|
|
472
|
+
│
|
|
473
|
+
▼
|
|
474
|
+
┌─────────────────────┐
|
|
475
|
+
│ Selected Agents │
|
|
476
|
+
│ [ts, sec, arch, │
|
|
477
|
+
│ perf] │
|
|
478
|
+
└─────────────────────┘
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Screen Navigation Map
|
|
482
|
+
|
|
483
|
+
```
|
|
484
|
+
┌──────────┐ no creds ┌──────────┐
|
|
485
|
+
│ Welcome │─────────────►│ Login │
|
|
486
|
+
│ Screen │ │ Screen │
|
|
487
|
+
└────┬─────┘ └────┬─────┘
|
|
488
|
+
│ valid │ saved
|
|
489
|
+
▼ ▼
|
|
490
|
+
┌──────────────────────────────────────┐
|
|
491
|
+
│ Home Screen │
|
|
492
|
+
│ [Start Review] [Past Sessions] │
|
|
493
|
+
└────┬────────────────────┬────────────┘
|
|
494
|
+
│ │
|
|
495
|
+
▼ ▼
|
|
496
|
+
┌──────────┐ ┌─────────────┐
|
|
497
|
+
│Workspace │ │ Session │
|
|
498
|
+
│ Select │ │ List │
|
|
499
|
+
└────┬─────┘ └─────────────┘
|
|
500
|
+
│
|
|
501
|
+
▼
|
|
502
|
+
┌──────────┐
|
|
503
|
+
│ Repo │ Search + project groups
|
|
504
|
+
│ Select │
|
|
505
|
+
└────┬─────┘
|
|
506
|
+
│
|
|
507
|
+
▼
|
|
508
|
+
┌──────────┐
|
|
509
|
+
│ PR List │ Search by id/title/author
|
|
510
|
+
└────┬─────┘
|
|
511
|
+
│
|
|
512
|
+
▼
|
|
513
|
+
┌──────────┐
|
|
514
|
+
│ Agent │ Checkboxes, Space to toggle
|
|
515
|
+
│ Select │
|
|
516
|
+
└────┬─────┘
|
|
517
|
+
│ Enter
|
|
518
|
+
▼
|
|
519
|
+
┌──────────┐ integrity ┌─────────────┐
|
|
520
|
+
│ Review │────────────►│ Integrity │
|
|
521
|
+
│ Running │◄────────────│ Report │
|
|
522
|
+
└────┬─────┘ key press └─────────────┘
|
|
523
|
+
│ findings ready
|
|
524
|
+
▼
|
|
525
|
+
┌──────────┐
|
|
526
|
+
│ Findings │ Navigate, view detail
|
|
527
|
+
│ List │
|
|
528
|
+
└────┬─────┘
|
|
529
|
+
│ 'p' key
|
|
530
|
+
▼
|
|
531
|
+
┌──────────┐
|
|
532
|
+
│ Publish │ y = publish, n = draft
|
|
533
|
+
│ Confirm │
|
|
534
|
+
└────┬─────┘
|
|
535
|
+
│ 'y'
|
|
536
|
+
▼
|
|
537
|
+
┌──────────┐
|
|
538
|
+
│Publishing│ Progress bar per comment
|
|
539
|
+
│ Screen │
|
|
540
|
+
└────┬─────┘
|
|
541
|
+
│ complete + key press
|
|
542
|
+
▼
|
|
543
|
+
┌──────────┐
|
|
544
|
+
│ Report │ Stats + cost → Home
|
|
545
|
+
└──────────┘
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
---
|
|
549
|
+
|
|
550
|
+
## AI Agent System
|
|
551
|
+
|
|
552
|
+
### Registered Agents
|
|
553
|
+
|
|
554
|
+
| Agent | ID | Handles | Trigger |
|
|
555
|
+
|-------|----|---------|---------|
|
|
556
|
+
| TypeScript | `ts-reviewer` | `.ts .tsx .js .jsx` | TS/JS files in diff |
|
|
557
|
+
| Security | `security-reviewer` | All files | Always runs |
|
|
558
|
+
| CSS | `css-reviewer` | `.css .scss .sass .less` | Style files in diff |
|
|
559
|
+
| C# | `csharp-reviewer` | `.cs` | C# files in diff or .NET stack |
|
|
560
|
+
| Architecture | `architecture-reviewer` | All files | 5+ files or 2+ languages |
|
|
561
|
+
| Testing | `testing-reviewer` | `*.test.* *.spec.*` | Test files in diff |
|
|
562
|
+
| Performance | `performance-reviewer` | All files | 300+ lines or 8+ files |
|
|
563
|
+
|
|
564
|
+
### Stack-Aware Selection Rules
|
|
565
|
+
|
|
566
|
+
When a `StackProfile` is detected from the project's manifest files:
|
|
567
|
+
|
|
568
|
+
| Framework / Library | Extra Agents Added |
|
|
569
|
+
|--------------------|--------------------|
|
|
570
|
+
| Angular | ts-reviewer + architecture-reviewer |
|
|
571
|
+
| React / Next.js / Vue | ts-reviewer |
|
|
572
|
+
| .NET / ASP.NET | csharp-reviewer + security-reviewer |
|
|
573
|
+
| NestJS | ts-reviewer + security-reviewer + architecture-reviewer |
|
|
574
|
+
| Express / Fastify | security-reviewer |
|
|
575
|
+
| Django / Flask / FastAPI | security-reviewer |
|
|
576
|
+
| rxjs / ngrx | performance-reviewer |
|
|
577
|
+
| ORMs (Prisma, Drizzle, TypeORM, EF) | security-reviewer + performance-reviewer |
|
|
578
|
+
|
|
579
|
+
### Finding Schema
|
|
580
|
+
|
|
581
|
+
Each agent produces findings with this structure:
|
|
582
|
+
|
|
583
|
+
```typescript
|
|
584
|
+
{
|
|
585
|
+
filePath: string // File in the diff
|
|
586
|
+
lineNumber: number // Must be an actual addition line
|
|
587
|
+
severity: 'critical' | 'high' | 'medium' | 'low' | 'info'
|
|
588
|
+
category: 'bug' | 'security' | 'performance' | 'style' | 'maintainability'
|
|
589
|
+
| 'accessibility' | 'testing' | 'architecture' | 'documentation' | 'other'
|
|
590
|
+
title: string // Short description (max 100 chars)
|
|
591
|
+
problem: string // What's wrong
|
|
592
|
+
rationale: string // Why it matters
|
|
593
|
+
suggestion: string // How to fix it
|
|
594
|
+
agentId: string // Which agent produced this
|
|
595
|
+
}
|
|
596
|
+
```
|
|
597
|
+
|
|
598
|
+
### Framework Context Auto-Injection
|
|
599
|
+
|
|
600
|
+
When a `StackProfile` is detected, PRISM automatically injects a framework context block into each relevant agent's prompt. The `FRAMEWORK_AGENT_MAP` controls which agents receive context for each framework:
|
|
601
|
+
|
|
602
|
+
| Framework | Agents that receive context |
|
|
603
|
+
|-----------|----------------------------|
|
|
604
|
+
| Angular | ts-reviewer, architecture-reviewer, html-reviewer |
|
|
605
|
+
| React / Next.js | ts-reviewer |
|
|
606
|
+
| Vue / Nuxt | ts-reviewer, html-reviewer |
|
|
607
|
+
| NestJS | ts-reviewer, architecture-reviewer, security-reviewer |
|
|
608
|
+
| Laravel | security-reviewer |
|
|
609
|
+
| .NET / .NET Framework | csharp-reviewer, security-reviewer |
|
|
610
|
+
|
|
611
|
+
The injected block looks like:
|
|
612
|
+
|
|
613
|
+
```
|
|
614
|
+
## Framework-Specific Review Rules
|
|
615
|
+
Framework: Angular
|
|
616
|
+
Version: ^17.3.0
|
|
617
|
+
Key libraries: RxJS, NgRx
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
Custom `reviewRules` defined in `.prism.yml` are merged after the auto-detected framework context. They are agent-scoped: each entry targets one agent by ID and appends free-form instructions to that agent's prompt.
|
|
621
|
+
|
|
622
|
+
**Source files:**
|
|
623
|
+
- `src/ai/agents/framework-rules/normalize.ts` — framework name normalization + version extraction
|
|
624
|
+
- `src/ai/agents/framework-rules/routing-map.ts` — `FRAMEWORK_AGENT_MAP`
|
|
625
|
+
- `src/ai/agents/framework-rules/index.ts` — `resolveFrameworkRules()` merges auto context + repo rules
|
|
626
|
+
|
|
627
|
+
### Post-Processing Pipeline
|
|
628
|
+
|
|
629
|
+
```
|
|
630
|
+
Raw Findings (all agents)
|
|
631
|
+
│
|
|
632
|
+
▼
|
|
633
|
+
Consolidation: same file+line+category → keep highest severity
|
|
634
|
+
│
|
|
635
|
+
▼
|
|
636
|
+
Deduplication: remove findings matching existing BB comments or prior Engram reviews
|
|
637
|
+
│
|
|
638
|
+
▼
|
|
639
|
+
Sort: severity (critical→info) → filePath (A→Z) → lineNumber (asc)
|
|
640
|
+
│
|
|
641
|
+
▼
|
|
642
|
+
Final ReviewFinding[] → presented to user
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
---
|
|
646
|
+
|
|
647
|
+
## Configuration
|
|
648
|
+
|
|
649
|
+
### Global Config (`config.json`)
|
|
650
|
+
|
|
651
|
+
Auto-created in platform config directory.
|
|
652
|
+
|
|
653
|
+
```json
|
|
654
|
+
{
|
|
655
|
+
"defaultModel": "claude-opus-4-5",
|
|
656
|
+
"maxDiffLines": 5000,
|
|
657
|
+
"engramUrl": "http://localhost:7437",
|
|
658
|
+
"provider": "claude-code"
|
|
659
|
+
}
|
|
660
|
+
```
|
|
661
|
+
|
|
662
|
+
| Key | Default | Description |
|
|
663
|
+
|-----|---------|-------------|
|
|
664
|
+
| `defaultModel` | `claude-opus-4-5` | AI model for all agents |
|
|
665
|
+
| `maxDiffLines` | `5000` | Lines before cost warning |
|
|
666
|
+
| `engramUrl` | `http://localhost:7437` | Engram memory server |
|
|
667
|
+
| `provider` | auto-detect | `anthropic` or `claude-code` |
|
|
668
|
+
| `anthropicApiKey` | - | Inline API key (alternative to env var) |
|
|
669
|
+
|
|
670
|
+
### Per-Repo Config (`prism.yaml`)
|
|
671
|
+
|
|
672
|
+
Place in the repository's working directory to customize reviews for that repo.
|
|
673
|
+
|
|
674
|
+
```yaml
|
|
675
|
+
# Override which agents run (bypasses auto-detection)
|
|
676
|
+
agents:
|
|
677
|
+
- ts-reviewer
|
|
678
|
+
- security-reviewer
|
|
679
|
+
|
|
680
|
+
# Model override for this repo
|
|
681
|
+
model: claude-sonnet-4-5-20250514
|
|
682
|
+
|
|
683
|
+
# Coding conventions injected into agent prompts
|
|
684
|
+
conventions:
|
|
685
|
+
- "Use functional components with hooks, no class components"
|
|
686
|
+
- "All API calls must go through the service layer"
|
|
687
|
+
|
|
688
|
+
# Or load from a file
|
|
689
|
+
conventionsFile: .github/conventions.md
|
|
690
|
+
|
|
691
|
+
# Files to skip during review
|
|
692
|
+
excludePatterns:
|
|
693
|
+
- "**/*.generated.ts"
|
|
694
|
+
- "dist/**"
|
|
695
|
+
- "*.lock"
|
|
696
|
+
|
|
697
|
+
# Custom skills (inject domain-specific instructions per agent)
|
|
698
|
+
skills:
|
|
699
|
+
- id: react-patterns
|
|
700
|
+
name: React Patterns
|
|
701
|
+
instructions: "Enforce custom hooks for shared state logic"
|
|
702
|
+
agentIds:
|
|
703
|
+
- ts-reviewer
|
|
704
|
+
- architecture-reviewer
|
|
705
|
+
|
|
706
|
+
# Per-agent custom review rules (injected after framework context)
|
|
707
|
+
reviewRules:
|
|
708
|
+
- agent: ts-reviewer
|
|
709
|
+
rules: |
|
|
710
|
+
Prefer inject() over constructor injection.
|
|
711
|
+
Flag *ngIf usage in files under src/features/.
|
|
712
|
+
- agent: security-reviewer
|
|
713
|
+
rules: |
|
|
714
|
+
Treat any hardcoded URL containing internal hostnames as HIGH severity.
|
|
715
|
+
|
|
716
|
+
# Max diff lines for this repo
|
|
717
|
+
maxDiffLines: 8000
|
|
718
|
+
```
|
|
719
|
+
|
|
720
|
+
### Engram (Optional Memory Service)
|
|
721
|
+
|
|
722
|
+
Engram provides cross-session memory. When running:
|
|
723
|
+
|
|
724
|
+
- Prior review findings are loaded before agents run (avoids duplicate comments)
|
|
725
|
+
- Project context (patterns, conventions learned) is available to agents
|
|
726
|
+
- Review results are saved for future sessions
|
|
727
|
+
|
|
728
|
+
Start Engram separately:
|
|
729
|
+
```bash
|
|
730
|
+
# Engram runs as a local HTTP service
|
|
731
|
+
engram serve --port 7437
|
|
732
|
+
```
|
|
733
|
+
|
|
734
|
+
If Engram is unavailable, PRISM works normally without memory features.
|
|
735
|
+
|
|
736
|
+
---
|
|
737
|
+
|
|
738
|
+
## Project Structure
|
|
739
|
+
|
|
740
|
+
```
|
|
741
|
+
prism-cli/
|
|
742
|
+
├── bin/
|
|
743
|
+
│ └── run.js # CLI entry point
|
|
744
|
+
├── src/
|
|
745
|
+
│ ├── commands/ # oclif commands
|
|
746
|
+
│ │ ├── interactive.ts # Default: launches TUI
|
|
747
|
+
│ │ ├── login.ts # prism login
|
|
748
|
+
│ │ ├── logout.ts # prism logout
|
|
749
|
+
│ │ └── review/
|
|
750
|
+
│ │ └── start.ts # prism review start --pr <id>
|
|
751
|
+
│ ├── tui/ # Ink/React TUI
|
|
752
|
+
│ │ ├── app.tsx # Root component + state
|
|
753
|
+
│ │ ├── screen-router.tsx # Screen navigation (14 screens)
|
|
754
|
+
│ │ ├── screens/ # Individual screen components
|
|
755
|
+
│ │ ├── components/ # Reusable UI (ScrollList, SearchableList)
|
|
756
|
+
│ │ └── hooks/ # Custom hooks (useAuth, useBitbucket)
|
|
757
|
+
│ ├── ai/
|
|
758
|
+
│ │ ├── agents/ # AI review agents
|
|
759
|
+
│ │ │ ├── registry.ts # Agent registration
|
|
760
|
+
│ │ │ ├── ts-reviewer.ts # TypeScript agent
|
|
761
|
+
│ │ │ ├── security-reviewer.ts
|
|
762
|
+
│ │ │ ├── css-reviewer.ts
|
|
763
|
+
│ │ │ ├── csharp-reviewer.ts
|
|
764
|
+
│ │ │ ├── architecture-reviewer.ts
|
|
765
|
+
│ │ │ ├── testing-reviewer.ts
|
|
766
|
+
│ │ │ ├── performance-reviewer.ts
|
|
767
|
+
│ │ │ ├── prompts/ # Agent system prompt templates
|
|
768
|
+
│ │ │ └── shared/ # Finding schema + prompt builder
|
|
769
|
+
│ │ ├── orchestrator/ # Agent coordination
|
|
770
|
+
│ │ │ ├── orchestrator.ts # Main orchestrator
|
|
771
|
+
│ │ │ ├── context-analyzer.ts # File analysis + stack-aware selection
|
|
772
|
+
│ │ │ ├── rule-based-strategy.ts # Agent plan builder
|
|
773
|
+
│ │ │ ├── strategy.ts # Strategy interface
|
|
774
|
+
│ │ │ ├── deduplicator.ts # Finding dedup vs existing comments
|
|
775
|
+
│ │ │ └── consolidation.ts # Multi-agent finding merge
|
|
776
|
+
│ │ ├── providers/ # AI provider abstraction
|
|
777
|
+
│ │ │ ├── anthropic.ts # Direct Anthropic SDK
|
|
778
|
+
│ │ │ └── claude-code.ts # Claude Code CLI bridge
|
|
779
|
+
│ │ └── skills/ # Skill registry
|
|
780
|
+
│ ├── bitbucket/ # Bitbucket REST API client
|
|
781
|
+
│ │ ├── client.ts # All API methods
|
|
782
|
+
│ │ └── errors.ts # BB-specific error types
|
|
783
|
+
│ ├── config/ # Configuration
|
|
784
|
+
│ │ ├── config-manager.ts # Global config + provider resolution
|
|
785
|
+
│ │ └── credentials.ts # Encrypted credential storage
|
|
786
|
+
│ ├── core/ # Application core
|
|
787
|
+
│ │ ├── workflow-engine.ts # 16-step review workflow
|
|
788
|
+
│ │ ├── comment-publisher.ts # BB comment posting + rate limits
|
|
789
|
+
│ │ └── diff-parser.ts # Unified diff → DiffFile[]
|
|
790
|
+
│ ├── memory/ # Engram integration
|
|
791
|
+
│ │ └── engram-client.ts # HTTP client for Engram sidecar
|
|
792
|
+
│ ├── persistence/ # SQLite + Drizzle ORM
|
|
793
|
+
│ │ ├── database.ts # DB init + auto-migration
|
|
794
|
+
│ │ ├── schema.ts # Drizzle schema (sessions, findings, profiles)
|
|
795
|
+
│ │ ├── session-manager.ts # Session CRUD
|
|
796
|
+
│ │ ├── profile-repository.ts # Stack profile cache
|
|
797
|
+
│ │ ├── workspace-repository.ts # Known workspaces
|
|
798
|
+
│ │ └── migrations/ # SQL migration files
|
|
799
|
+
│ ├── stack-detector/ # Tech stack detection
|
|
800
|
+
│ │ ├── stack-detector.ts # Manifest-based detection
|
|
801
|
+
│ │ ├── parsers.ts # 8 manifest parsers
|
|
802
|
+
│ │ ├── ai-stack-fallback.ts # AI fallback (haiku)
|
|
803
|
+
│ │ ├── merge-profiles.ts # Deterministic + AI merge
|
|
804
|
+
│ │ ├── formatter.ts # Profile → text for prompts
|
|
805
|
+
│ │ └── types.ts # StackProfile interface
|
|
806
|
+
│ ├── types/ # Shared TypeScript types
|
|
807
|
+
│ └── utils/ # Utilities (logger, paths)
|
|
808
|
+
├── test/
|
|
809
|
+
│ └── unit/ # 1210 tests across 104 files
|
|
810
|
+
├── .sdd/
|
|
811
|
+
│ └── STATE.md # SDD development state tracker
|
|
812
|
+
├── package.json
|
|
813
|
+
├── tsconfig.json
|
|
814
|
+
├── vitest.config.ts
|
|
815
|
+
└── .eslintrc.cjs
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
---
|
|
819
|
+
|
|
820
|
+
## Development
|
|
821
|
+
|
|
822
|
+
### Commands
|
|
823
|
+
|
|
824
|
+
```bash
|
|
825
|
+
pnpm build # Compile TypeScript + copy assets + oclif manifest
|
|
826
|
+
pnpm start # Build + run
|
|
827
|
+
pnpm dev # Watch mode (tsc -b --watch)
|
|
828
|
+
pnpm test # Run all tests (vitest run)
|
|
829
|
+
pnpm test:watch # Watch mode tests
|
|
830
|
+
pnpm test:coverage # Tests with coverage report
|
|
831
|
+
pnpm lint # ESLint check
|
|
832
|
+
pnpm lint:fix # ESLint auto-fix
|
|
833
|
+
pnpm format # Prettier format
|
|
834
|
+
pnpm format:check # Prettier check
|
|
835
|
+
pnpm release # Bump version + CHANGELOG + commit + tag
|
|
836
|
+
pnpm release:graduate # Graduate from prerelease to stable
|
|
837
|
+
```
|
|
838
|
+
|
|
839
|
+
### Tech Stack
|
|
840
|
+
|
|
841
|
+
| Technology | Purpose |
|
|
842
|
+
|-----------|---------|
|
|
843
|
+
| TypeScript 5.7 | Language (strict mode, ESM) |
|
|
844
|
+
| oclif v4 | CLI framework + command routing |
|
|
845
|
+
| Ink v5 + React 18 | Terminal UI (TUI) |
|
|
846
|
+
| Anthropic SDK | Claude API integration |
|
|
847
|
+
| better-sqlite3 | Local database (WAL mode) |
|
|
848
|
+
| Drizzle ORM | SQL schema + migrations |
|
|
849
|
+
| Vitest 3.0 | Testing framework |
|
|
850
|
+
| msw 2.7 | API mocking in tests |
|
|
851
|
+
| ink-testing-library | TUI component testing |
|
|
852
|
+
| Zod | Runtime schema validation |
|
|
853
|
+
| ESLint + Prettier | Code quality |
|
|
854
|
+
|
|
855
|
+
### TypeScript Conventions
|
|
856
|
+
|
|
857
|
+
- **Strict mode**: `exactOptionalPropertyTypes`, `noUncheckedIndexedAccess`, `noImplicitAny`
|
|
858
|
+
- **ESM**: All imports use `.js` extensions (`import { foo } from './bar.js'`)
|
|
859
|
+
- **Optional properties**: Omit via spread, never pass `undefined` directly
|
|
860
|
+
- **Conventional commits**: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`
|
|
861
|
+
- **Agent findings**: Output in Spanish (language instruction in all prompts)
|
|
862
|
+
|
|
863
|
+
### Running Tests
|
|
864
|
+
|
|
865
|
+
```bash
|
|
866
|
+
# All tests
|
|
867
|
+
pnpm test
|
|
868
|
+
|
|
869
|
+
# Specific file
|
|
870
|
+
npx vitest run test/unit/context-analyzer.test.ts
|
|
871
|
+
|
|
872
|
+
# Pattern match
|
|
873
|
+
npx vitest run --reporter=verbose -t "stack"
|
|
874
|
+
|
|
875
|
+
# Watch single file
|
|
876
|
+
npx vitest test/unit/context-analyzer.test.ts
|
|
877
|
+
```
|
|
878
|
+
|
|
879
|
+
---
|
|
880
|
+
|
|
881
|
+
## Versioning
|
|
882
|
+
|
|
883
|
+
This project uses [Semantic Versioning](https://semver.org/) with automated releases via [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version). Versions are derived from [Conventional Commits](https://www.conventionalcommits.org/).
|
|
884
|
+
|
|
885
|
+
### Commit types and version impact
|
|
886
|
+
|
|
887
|
+
| Commit prefix | Example | In prerelease | In stable |
|
|
888
|
+
|---------------|---------|---------------|-----------|
|
|
889
|
+
| `fix:` | `fix: handle 409 on approve` | `alpha.42` → `alpha.43` | `1.0.0` → `1.0.1` |
|
|
890
|
+
| `feat:` | `feat: add python-reviewer` | `alpha.42` → `alpha.43` | `1.0.0` → `1.1.0` |
|
|
891
|
+
| `feat!:` / `BREAKING CHANGE` | `feat!: redesign agent API` | `alpha.42` → `2.0.0-alpha.0` | `1.0.0` → `2.0.0` |
|
|
892
|
+
| `docs:`, `chore:`, `test:`, `ci:` | `docs: update STATE.md` | No bump | No bump |
|
|
893
|
+
|
|
894
|
+
### Release lifecycle
|
|
895
|
+
|
|
896
|
+
```
|
|
897
|
+
alpha (current) → beta → stable → ongoing
|
|
898
|
+
1.0.0-alpha.X 1.0.0-beta.X 1.0.0 1.1.0, 1.0.1, ...
|
|
899
|
+
```
|
|
900
|
+
|
|
901
|
+
- **Alpha** (`1.0.0-alpha.X`) — Core features working, known gaps and rough edges. Each `feat:` or `fix:` increments the alpha number.
|
|
902
|
+
- **Beta** (`1.0.0-beta.X`) — All v1 features implemented, focus on polish and stability.
|
|
903
|
+
- **Stable** (`1.0.0`) — Production-ready. `feat:` bumps minor, `fix:` bumps patch.
|
|
904
|
+
|
|
905
|
+
### Release commands
|
|
906
|
+
|
|
907
|
+
```bash
|
|
908
|
+
# Regular alpha release (after committing changes)
|
|
909
|
+
pnpm release
|
|
910
|
+
# 1.0.0-alpha.42 → 1.0.0-alpha.43
|
|
911
|
+
|
|
912
|
+
# Promote to beta
|
|
913
|
+
npx commit-and-tag-version --prerelease beta
|
|
914
|
+
# 1.0.0-alpha.X → 1.0.0-beta.1
|
|
915
|
+
|
|
916
|
+
# Graduate to stable
|
|
917
|
+
pnpm release:graduate
|
|
918
|
+
# 1.0.0-beta.X → 1.0.0
|
|
919
|
+
```
|
|
920
|
+
|
|
921
|
+
After graduating to stable, `pnpm release:graduate` continues to work for regular semver releases (`1.0.0` → `1.1.0` on feat, `1.0.1` on fix).
|
|
922
|
+
|
|
923
|
+
### CHANGELOG
|
|
924
|
+
|
|
925
|
+
Only user-facing changes appear in `CHANGELOG.md`: Features (`feat:`), Bug Fixes (`fix:`), and Performance (`perf:`). Internal commits (`docs:`, `chore:`, `test:`, `refactor:`) are hidden from the CHANGELOG but tracked in git history.
|
|
926
|
+
|
|
927
|
+
### Configuration
|
|
928
|
+
|
|
929
|
+
Versioning behavior is defined in `.versionrc`. Tags use the `v` prefix (e.g., `v1.0.0-alpha.42`).
|
|
930
|
+
|
|
931
|
+
---
|
|
932
|
+
|
|
933
|
+
## Troubleshooting
|
|
934
|
+
|
|
935
|
+
### Common Issues
|
|
936
|
+
|
|
937
|
+
| Issue | Cause | Fix |
|
|
938
|
+
|-------|-------|-----|
|
|
939
|
+
| `EEXIT` error on login | oclif `this.exit(0)` caught as error | Fixed in codebase — use `return` instead |
|
|
940
|
+
| Arrow keys don't work | Ink raw mode ref-count dropped to 0 | `RawModeGuard` component fixes this |
|
|
941
|
+
| `410 Gone` on workspace list | Bitbucket removed cross-workspace API | Uses local SQLite registry now |
|
|
942
|
+
| Findings show "clean PR" when API errors | All agents failed silently | Check API key balance / connectivity |
|
|
943
|
+
| Diff parser fails on Windows | CRLF normalization issue | Fixed: `\r\n?` regex handles double-CRLF |
|
|
944
|
+
| DB migrations not found | Running with `tsc` directly (no `dist/`) | `resolveMigrationsFolder()` falls back to `src/` |
|
|
945
|
+
|
|
946
|
+
### Logs
|
|
947
|
+
|
|
948
|
+
PRISM logs to stdout via the TUI. For debugging, check:
|
|
949
|
+
- SQLite database: `<config-dir>/prism.db` (use any SQLite browser)
|
|
950
|
+
- Session data: `review_sessions` + `review_findings` tables
|
|
951
|
+
- Stack cache: `project_profiles` table
|
|
952
|
+
|
|
953
|
+
### Resetting State
|
|
954
|
+
|
|
955
|
+
```bash
|
|
956
|
+
# Clear credentials (forces re-login)
|
|
957
|
+
rm "<config-dir>/credentials.json"
|
|
958
|
+
|
|
959
|
+
# Clear all data (sessions, profiles, workspaces)
|
|
960
|
+
rm "<config-dir>/prism.db"
|
|
961
|
+
|
|
962
|
+
# Clear global config
|
|
963
|
+
rm "<config-dir>/config.json"
|
|
964
|
+
```
|