@codeyam/codeyam-cli 0.1.0-staging.1669d45 → 0.1.0-staging.2a88920
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/analyzer-template/.build-info.json +8 -8
- package/analyzer-template/log.txt +3 -3
- package/analyzer-template/package.json +5 -5
- package/analyzer-template/packages/ai/index.ts +15 -2
- package/analyzer-template/packages/ai/src/lib/analyzeScope.ts +87 -51
- package/analyzer-template/packages/ai/src/lib/astScopes/arrayDerivationDetector.ts +199 -0
- package/analyzer-template/packages/ai/src/lib/astScopes/astScopeAnalyzer.ts +98 -9
- package/analyzer-template/packages/ai/src/lib/astScopes/methodSemantics.ts +139 -23
- package/analyzer-template/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.ts +6 -126
- package/analyzer-template/packages/ai/src/lib/astScopes/processExpression.ts +555 -28
- package/analyzer-template/packages/ai/src/lib/astScopes/types.ts +88 -7
- package/analyzer-template/packages/ai/src/lib/completionCall.ts +198 -34
- package/analyzer-template/packages/ai/src/lib/dataStructure/ScopeDataStructure.ts +772 -243
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.ts +205 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.ts +10 -2
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.ts +16 -3
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.ts +6 -4
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.ts +43 -1
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.ts +122 -15
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.ts +160 -0
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.ts +40 -30
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.ts +319 -88
- package/analyzer-template/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.ts +129 -0
- package/analyzer-template/packages/ai/src/lib/dataStructureChunking.ts +156 -0
- package/analyzer-template/packages/ai/src/lib/e2eDataTracking.ts +334 -0
- package/analyzer-template/packages/ai/src/lib/extractCriticalDataKeys.ts +120 -0
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarioData.ts +642 -7
- package/analyzer-template/packages/ai/src/lib/generateEntityScenarios.ts +35 -6
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlows.ts +383 -6
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionalEffects.ts +1 -1
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromConditionals.ts +1299 -51
- package/analyzer-template/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.ts +239 -0
- package/analyzer-template/packages/ai/src/lib/mergeStatements.ts +90 -96
- package/analyzer-template/packages/ai/src/lib/promptGenerators/gatherAttributesMap.ts +10 -7
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateChunkPrompt.ts +82 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateCriticalKeysPrompt.ts +103 -0
- package/analyzer-template/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.ts +23 -6
- package/analyzer-template/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.ts +391 -0
- package/analyzer-template/packages/ai/src/lib/resolvePathToControllable.ts +179 -45
- package/analyzer-template/packages/ai/src/lib/worker/SerializableDataStructure.ts +26 -4
- package/analyzer-template/packages/ai/src/lib/worker/analyzeScopeWorker.ts +114 -2
- package/analyzer-template/packages/analyze/src/lib/FileAnalyzer.ts +65 -59
- package/analyzer-template/packages/analyze/src/lib/ProjectAnalyzer.ts +113 -26
- package/analyzer-template/packages/analyze/src/lib/analysisContext.ts +44 -4
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.ts +19 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getAllExports.ts +11 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.ts +8 -0
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.ts +49 -1
- package/analyzer-template/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.ts +30 -19
- package/analyzer-template/packages/analyze/src/lib/files/analyze/analyzeEntities.ts +14 -4
- package/analyzer-template/packages/analyze/src/lib/files/analyze/dependencyResolver.ts +6 -0
- package/analyzer-template/packages/analyze/src/lib/files/analyze/gatherEntityMap.ts +4 -2
- package/analyzer-template/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.ts +33 -10
- package/analyzer-template/packages/analyze/src/lib/files/analyzeRemixRoute.ts +4 -5
- package/analyzer-template/packages/analyze/src/lib/files/getImportedExports.ts +14 -12
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.ts +189 -76
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.ts +29 -0
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateDataStructure.ts +77 -9
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.ts +118 -10
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.ts +276 -17
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.ts +56 -11
- package/analyzer-template/packages/analyze/src/lib/files/scenarios/propagateArrayItemSchemas.ts +474 -0
- package/analyzer-template/packages/analyze/src/lib/files/setImportedExports.ts +2 -1
- package/analyzer-template/packages/analyze/src/lib/utils/getFileByPath.ts +19 -0
- package/analyzer-template/packages/aws/package.json +2 -2
- package/analyzer-template/packages/database/src/lib/kysely/db.ts +8 -1
- package/analyzer-template/packages/database/src/lib/kysely/tables/commitsTable.ts +6 -0
- package/analyzer-template/packages/database/src/lib/loadAnalyses.ts +58 -1
- package/analyzer-template/packages/database/src/lib/loadAnalysis.ts +13 -0
- package/analyzer-template/packages/database/src/lib/loadBranch.ts +16 -1
- package/analyzer-template/packages/database/src/lib/loadCommit.ts +11 -0
- package/analyzer-template/packages/database/src/lib/loadCommits.ts +28 -0
- package/analyzer-template/packages/database/src/lib/loadEntities.ts +26 -3
- package/analyzer-template/packages/database/src/lib/loadEntityBranches.ts +12 -0
- package/analyzer-template/packages/database/src/lib/updateCommitMetadata.ts +7 -14
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js +8 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/db.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/analysesTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts +1 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/analyzer-template/packages/github/dist/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts +2 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js +45 -2
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalyses.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js +8 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadAnalysis.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js +11 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadBranch.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js +7 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommit.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js +22 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadCommits.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts +3 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js +23 -4
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntities.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js +9 -0
- package/analyzer-template/packages/github/dist/database/src/lib/loadEntityBranches.js.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts +2 -2
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js +5 -4
- package/analyzer-template/packages/github/dist/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts +1 -1
- package/analyzer-template/packages/github/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts +25 -1
- package/analyzer-template/packages/github/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/github/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
- package/analyzer-template/packages/github/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/github/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/github/dist/utils/src/lib/safeFileName.js.map +1 -1
- package/analyzer-template/packages/github/package.json +1 -1
- package/analyzer-template/packages/types/index.ts +1 -0
- package/analyzer-template/packages/types/src/types/Analysis.ts +25 -0
- package/analyzer-template/packages/types/src/types/Commit.ts +2 -0
- package/analyzer-template/packages/types/src/types/ScenariosDataStructure.ts +70 -6
- package/analyzer-template/packages/types/src/types/ScopeAnalysis.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/index.d.ts +1 -1
- package/analyzer-template/packages/utils/dist/types/index.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/index.js.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts +25 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Analysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts +2 -0
- package/analyzer-template/packages/utils/dist/types/src/types/Commit.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts +56 -6
- package/analyzer-template/packages/utils/dist/types/src/types/ScenariosDataStructure.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts +6 -1
- package/analyzer-template/packages/utils/dist/types/src/types/ScopeAnalysis.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts +9 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.d.ts.map +1 -1
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js +29 -3
- package/analyzer-template/packages/utils/dist/utils/src/lib/safeFileName.js.map +1 -1
- package/analyzer-template/packages/utils/src/lib/safeFileName.ts +48 -3
- package/analyzer-template/playwright/capture.ts +20 -8
- package/analyzer-template/playwright/captureStatic.ts +1 -1
- package/analyzer-template/project/analyzeBaselineCommit.ts +5 -0
- package/analyzer-template/project/analyzeRegularCommit.ts +5 -0
- package/analyzer-template/project/captureLibraryFunctionDirect.ts +29 -26
- package/analyzer-template/project/constructMockCode.ts +367 -37
- package/analyzer-template/project/createEntitiesAndSortFiles.ts +83 -0
- package/analyzer-template/project/loadReadyToBeCaptured.ts +65 -41
- package/analyzer-template/project/orchestrateCapture/AwsCaptureTaskRunner.ts +12 -4
- package/analyzer-template/project/orchestrateCapture/SequentialCaptureTaskRunner.ts +18 -7
- package/analyzer-template/project/orchestrateCapture/taskRunner.ts +4 -2
- package/analyzer-template/project/orchestrateCapture.ts +71 -6
- package/analyzer-template/project/reconcileMockDataKeys.ts +152 -9
- package/analyzer-template/project/runAnalysis.ts +4 -0
- package/analyzer-template/project/start.ts +35 -11
- package/analyzer-template/project/writeMockDataTsx.ts +127 -4
- package/analyzer-template/project/writeScenarioComponents.ts +101 -8
- package/analyzer-template/scripts/comboWorkerLoop.cjs +98 -50
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeBaselineCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js +5 -0
- package/background/src/lib/virtualized/project/analyzeRegularCommit.js.map +1 -1
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js +3 -3
- package/background/src/lib/virtualized/project/captureLibraryFunctionDirect.js.map +1 -1
- package/background/src/lib/virtualized/project/constructMockCode.js +300 -7
- package/background/src/lib/virtualized/project/constructMockCode.js.map +1 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js +73 -1
- package/background/src/lib/virtualized/project/createEntitiesAndSortFiles.js.map +1 -1
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js +19 -8
- package/background/src/lib/virtualized/project/loadReadyToBeCaptured.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js +2 -2
- package/background/src/lib/virtualized/project/orchestrateCapture/AwsCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js +7 -5
- package/background/src/lib/virtualized/project/orchestrateCapture/SequentialCaptureTaskRunner.js.map +1 -1
- package/background/src/lib/virtualized/project/orchestrateCapture.js +58 -6
- package/background/src/lib/virtualized/project/orchestrateCapture.js.map +1 -1
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js +126 -9
- package/background/src/lib/virtualized/project/reconcileMockDataKeys.js.map +1 -1
- package/background/src/lib/virtualized/project/runAnalysis.js +3 -0
- package/background/src/lib/virtualized/project/runAnalysis.js.map +1 -1
- package/background/src/lib/virtualized/project/start.js +32 -11
- package/background/src/lib/virtualized/project/start.js.map +1 -1
- package/background/src/lib/virtualized/project/writeMockDataTsx.js +101 -4
- package/background/src/lib/virtualized/project/writeMockDataTsx.js.map +1 -1
- package/background/src/lib/virtualized/project/writeScenarioComponents.js +57 -8
- package/background/src/lib/virtualized/project/writeScenarioComponents.js.map +1 -1
- package/codeyam-cli/src/cli.js +2 -0
- package/codeyam-cli/src/cli.js.map +1 -1
- package/codeyam-cli/src/commands/debug.js +7 -5
- package/codeyam-cli/src/commands/debug.js.map +1 -1
- package/codeyam-cli/src/commands/memory.js +273 -0
- package/codeyam-cli/src/commands/memory.js.map +1 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js +4 -0
- package/codeyam-cli/src/utils/__tests__/setupClaudeCodeSettings.test.js.map +1 -1
- package/codeyam-cli/src/utils/analysisRunner.js +21 -2
- package/codeyam-cli/src/utils/analysisRunner.js.map +1 -1
- package/codeyam-cli/src/utils/install-skills.js +42 -6
- package/codeyam-cli/src/utils/install-skills.js.map +1 -1
- package/codeyam-cli/src/utils/queue/job.js +1 -0
- package/codeyam-cli/src/utils/queue/job.js.map +1 -1
- package/codeyam-cli/src/utils/queue/manager.js +6 -0
- package/codeyam-cli/src/utils/queue/manager.js.map +1 -1
- package/codeyam-cli/src/utils/rules/index.js +5 -0
- package/codeyam-cli/src/utils/rules/index.js.map +1 -0
- package/codeyam-cli/src/utils/rules/parser.js +106 -0
- package/codeyam-cli/src/utils/rules/parser.js.map +1 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js +18 -0
- package/codeyam-cli/src/utils/rules/pathMatcher.js.map +1 -0
- package/codeyam-cli/src/utils/rules/staleness.js +132 -0
- package/codeyam-cli/src/utils/rules/staleness.js.map +1 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js +2 -0
- package/codeyam-cli/src/utils/setupClaudeCodeSettings.js.map +1 -1
- package/codeyam-cli/src/webserver/app/lib/database.js +7 -3
- package/codeyam-cli/src/webserver/app/lib/database.js.map +1 -1
- package/codeyam-cli/src/webserver/bootstrap.js +40 -0
- package/codeyam-cli/src/webserver/bootstrap.js.map +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-DsN1wKrm.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeBadge-COi5OvsN.js → EntityTypeBadge-DLqD3qNt.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{EntityTypeIcon-BwdQv49w.js → EntityTypeIcon-Ba2JVPzP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InlineSpinner-CEleMv_j.js → InlineSpinner-C8lyxW9k.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{InteractivePreview-D68KarMg.js → InteractivePreview-aht4aafF.js} +2 -2
- package/codeyam-cli/src/webserver/build/client/assets/{LibraryFunctionPreview-L75Wvqgw.js → LibraryFunctionPreview-CVtiBnY5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LoadingDots-C53WM8qn.js → LoadingDots-B0GLXMsr.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{LogViewer-CrNkmy4i.js → LogViewer-xgeCVgSM.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-OApQuNyq.js +16 -0
- package/codeyam-cli/src/webserver/build/client/assets/{SafeScreenshot-CQifa1n-.js → SafeScreenshot-DuDvi0jm.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{ScenarioViewer-CyaBFX7l.js → ScenarioViewer-DzccYyI8.js} +3 -13
- package/codeyam-cli/src/webserver/build/client/assets/{TruncatedFilePath-D36O1rzU.js → TruncatedFilePath-DyFZkK0l.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/_index-BwqWJOgH.js +11 -0
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BwavGCpm.js +32 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.health-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.memory-profile-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/api.restart-server-l0sNRNKZ.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{chevron-down-DgTPh8H-.js → chevron-down-Cx24_aWc.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{chunk-EPOLDU6W-DdQKK6on.js → chunk-EPOLDU6W-CXRTFQ3F.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{circle-check-Dmr2bb1R.js → circle-check-BOARzkeR.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/copy-Bb-80kDT.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{createLucideIcon-Do4ZLUYa.js → createLucideIcon-BdhJEx6B.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-BBnGWYga.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha._-CbdFyxZh.js → entity._sha._-BJUiQqZF.js} +12 -12
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha.scenarios._scenarioId.fullscreen-B4iCfs5M.js → entity._sha.scenarios._scenarioId.fullscreen-DavjRmOY.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.create-scenario-wDWZZO1W.js → entity._sha_.create-scenario-D1T4TGjf.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entity._sha_.edit._scenarioId-BMbl7MeQ.js → entity._sha_.edit._scenarioId-CTBG2mmz.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{entry.client-5wRKRIH9.js → entry.client-CS2cb_eZ.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/file-code-Dhef1kWN.js +6 -0
- package/codeyam-cli/src/webserver/build/client/assets/{fileTableUtils-DD3SDH7t.js → fileTableUtils-DMJ7zii9.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-CJ6lTdTA.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{git-zXjT7J0G.js → git-CPTZZ-JZ.js} +8 -8
- package/codeyam-cli/src/webserver/build/client/assets/globals-D3yhhV8x.css +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/{index-DLbXwndH.js → index-B1h680n5.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{index-gPZ-lad1.js → index-lzqtyFU8.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{loader-circle-BsPXJ81F.js → loader-circle-B7B9V-bu.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-a78b90a2.js +1 -0
- package/codeyam-cli/src/webserver/build/client/assets/memory--GCbFsBE.js +92 -0
- package/codeyam-cli/src/webserver/build/client/assets/root-eVAaavTS.js +62 -0
- package/codeyam-cli/src/webserver/build/client/assets/{search-P2FKIUql.js → search-CxXUmBSd.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{settings-B2eDuBj8.js → settings-CS5f3WzT.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{simulations-L18M6-kN.js → simulations-DwFIBT09.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{triangle-alert-BDz7kbVA.js → triangle-alert-B6LgvRJg.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useCustomSizes-29dDmbH8.js → useCustomSizes-C1v1PQzo.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useLastLogLine-BUm0UVJm.js → useLastLogLine-aSv48UbS.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useReportContext-CkIOKTrZ.js → useReportContext-DYxHZQuP.js} +1 -1
- package/codeyam-cli/src/webserver/build/client/assets/{useToast-KKw5kTn-.js → useToast-mBRpZPiu.js} +1 -1
- package/codeyam-cli/src/webserver/build/server/assets/index-BM6TDT1Y.js +1 -0
- package/codeyam-cli/src/webserver/build/server/assets/server-build-dYC34MHw.js +257 -0
- package/codeyam-cli/src/webserver/build/server/index.js +1 -1
- package/codeyam-cli/src/webserver/build-info.json +5 -5
- package/codeyam-cli/templates/codeyam-memory-hook.sh +200 -0
- package/codeyam-cli/templates/codeyam:debug.md +47 -3
- package/codeyam-cli/templates/codeyam:diagnose.md +203 -25
- package/codeyam-cli/templates/codeyam:memory.md +341 -0
- package/codeyam-cli/templates/codeyam:new-rule.md +13 -0
- package/codeyam-cli/templates/rule-reflection-hook.py +160 -0
- package/codeyam-cli/templates/rules-instructions.md +93 -0
- package/package.json +8 -5
- package/packages/ai/index.js +7 -3
- package/packages/ai/index.js.map +1 -1
- package/packages/ai/src/lib/analyzeScope.js +70 -29
- package/packages/ai/src/lib/analyzeScope.js.map +1 -1
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js +150 -0
- package/packages/ai/src/lib/astScopes/arrayDerivationDetector.js.map +1 -0
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js +78 -8
- package/packages/ai/src/lib/astScopes/astScopeAnalyzer.js.map +1 -1
- package/packages/ai/src/lib/astScopes/methodSemantics.js +109 -23
- package/packages/ai/src/lib/astScopes/methodSemantics.js.map +1 -1
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js +1 -102
- package/packages/ai/src/lib/astScopes/patterns/variableDeclarationHandler.js.map +1 -1
- package/packages/ai/src/lib/astScopes/processExpression.js +440 -27
- package/packages/ai/src/lib/astScopes/processExpression.js.map +1 -1
- package/packages/ai/src/lib/completionCall.js +161 -30
- package/packages/ai/src/lib/completionCall.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js +589 -166
- package/packages/ai/src/lib/dataStructure/ScopeDataStructure.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js +179 -0
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/MuiManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js +7 -1
- package/packages/ai/src/lib/dataStructure/equivalencyManagers/frameworks/ReactFrameworkManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js +13 -3
- package/packages/ai/src/lib/dataStructure/helpers/BatchSchemaProcessor.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js +6 -4
- package/packages/ai/src/lib/dataStructure/helpers/ScopeTreeManager.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js +41 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js +104 -11
- package/packages/ai/src/lib/dataStructure/helpers/cleanNonObjectFunctions.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js +159 -0
- package/packages/ai/src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js.map +1 -0
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js +37 -20
- package/packages/ai/src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js +265 -79
- package/packages/ai/src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js.map +1 -1
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js +107 -0
- package/packages/ai/src/lib/dataStructure/helpers/fixNullIdsBySchema.js.map +1 -0
- package/packages/ai/src/lib/dataStructureChunking.js +111 -0
- package/packages/ai/src/lib/dataStructureChunking.js.map +1 -0
- package/packages/ai/src/lib/e2eDataTracking.js +241 -0
- package/packages/ai/src/lib/e2eDataTracking.js.map +1 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js +96 -0
- package/packages/ai/src/lib/extractCriticalDataKeys.js.map +1 -0
- package/packages/ai/src/lib/generateEntityScenarioData.js +525 -8
- package/packages/ai/src/lib/generateEntityScenarioData.js.map +1 -1
- package/packages/ai/src/lib/generateEntityScenarios.js +26 -2
- package/packages/ai/src/lib/generateEntityScenarios.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlows.js +281 -4
- package/packages/ai/src/lib/generateExecutionFlows.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js +946 -42
- package/packages/ai/src/lib/generateExecutionFlowsFromConditionals.js.map +1 -1
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js +194 -0
- package/packages/ai/src/lib/generateExecutionFlowsFromJsxUsages.js.map +1 -0
- package/packages/ai/src/lib/mergeStatements.js +70 -51
- package/packages/ai/src/lib/mergeStatements.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js +10 -4
- package/packages/ai/src/lib/promptGenerators/gatherAttributesMap.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js +54 -0
- package/packages/ai/src/lib/promptGenerators/generateChunkPrompt.js.map +1 -0
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js +15 -7
- package/packages/ai/src/lib/promptGenerators/generateEntityScenarioDataGenerator.js.map +1 -1
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js +335 -0
- package/packages/ai/src/lib/promptGenerators/simplifyKeysForLLM.js.map +1 -0
- package/packages/ai/src/lib/resolvePathToControllable.js +155 -41
- package/packages/ai/src/lib/resolvePathToControllable.js.map +1 -1
- package/packages/ai/src/lib/worker/SerializableDataStructure.js +7 -0
- package/packages/ai/src/lib/worker/SerializableDataStructure.js.map +1 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js +94 -1
- package/packages/ai/src/lib/worker/analyzeScopeWorker.js.map +1 -1
- package/packages/analyze/src/lib/FileAnalyzer.js +60 -36
- package/packages/analyze/src/lib/FileAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/ProjectAnalyzer.js +96 -26
- package/packages/analyze/src/lib/ProjectAnalyzer.js.map +1 -1
- package/packages/analyze/src/lib/analysisContext.js +30 -5
- package/packages/analyze/src/lib/analysisContext.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllDeclaredEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js +14 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllEntityNodes.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getAllExports.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js +6 -0
- package/packages/analyze/src/lib/asts/sourceFiles/getImportsAnalysis.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js +39 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getResolvedModule.js.map +1 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js +2 -1
- package/packages/analyze/src/lib/asts/sourceFiles/getSourceFilesForAllImports.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js +21 -9
- package/packages/analyze/src/lib/files/analyze/analyzeEntities/prepareDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js +14 -4
- package/packages/analyze/src/lib/files/analyze/analyzeEntities.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js +5 -0
- package/packages/analyze/src/lib/files/analyze/dependencyResolver.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js +2 -1
- package/packages/analyze/src/lib/files/analyze/gatherEntityMap.js.map +1 -1
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js +31 -10
- package/packages/analyze/src/lib/files/analyze/validateDependencyAnalyses.js.map +1 -1
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js +3 -2
- package/packages/analyze/src/lib/files/analyzeRemixRoute.js.map +1 -1
- package/packages/analyze/src/lib/files/getImportedExports.js +11 -7
- package/packages/analyze/src/lib/files/getImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js +160 -68
- package/packages/analyze/src/lib/files/scenarios/enrichArrayTypesFromChildSignatures.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js +25 -8
- package/packages/analyze/src/lib/files/scenarios/gatherDataForMocks.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js +71 -9
- package/packages/analyze/src/lib/files/scenarios/generateDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js +57 -9
- package/packages/analyze/src/lib/files/scenarios/generateExecutionFlows.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js +233 -9
- package/packages/analyze/src/lib/files/scenarios/mergeInDependentDataStructure.js.map +1 -1
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js +46 -9
- package/packages/analyze/src/lib/files/scenarios/mergeValidatedDataStructures.js.map +1 -1
- package/packages/analyze/src/lib/files/setImportedExports.js +2 -1
- package/packages/analyze/src/lib/files/setImportedExports.js.map +1 -1
- package/packages/analyze/src/lib/utils/getFileByPath.js +12 -0
- package/packages/analyze/src/lib/utils/getFileByPath.js.map +1 -0
- package/packages/database/src/lib/kysely/db.js +8 -1
- package/packages/database/src/lib/kysely/db.js.map +1 -1
- package/packages/database/src/lib/kysely/tables/commitsTable.js +3 -0
- package/packages/database/src/lib/kysely/tables/commitsTable.js.map +1 -1
- package/packages/database/src/lib/loadAnalyses.js +45 -2
- package/packages/database/src/lib/loadAnalyses.js.map +1 -1
- package/packages/database/src/lib/loadAnalysis.js +8 -0
- package/packages/database/src/lib/loadAnalysis.js.map +1 -1
- package/packages/database/src/lib/loadBranch.js +11 -1
- package/packages/database/src/lib/loadBranch.js.map +1 -1
- package/packages/database/src/lib/loadCommit.js +7 -0
- package/packages/database/src/lib/loadCommit.js.map +1 -1
- package/packages/database/src/lib/loadCommits.js +22 -1
- package/packages/database/src/lib/loadCommits.js.map +1 -1
- package/packages/database/src/lib/loadEntities.js +23 -4
- package/packages/database/src/lib/loadEntities.js.map +1 -1
- package/packages/database/src/lib/loadEntityBranches.js +9 -0
- package/packages/database/src/lib/loadEntityBranches.js.map +1 -1
- package/packages/database/src/lib/updateCommitMetadata.js +5 -4
- package/packages/database/src/lib/updateCommitMetadata.js.map +1 -1
- package/packages/types/index.js.map +1 -1
- package/packages/utils/src/lib/safeFileName.js +29 -3
- package/packages/utils/src/lib/safeFileName.js.map +1 -1
- package/scripts/finalize-analyzer.cjs +3 -3
- package/codeyam-cli/src/webserver/build/client/assets/EntityItem-vauWK972.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/ReportIssueModal-DzJRkCkr.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/_index-Be83mo_j.js +0 -11
- package/codeyam-cli/src/webserver/build/client/assets/activity.(_tab)-BN6wu6Y-.js +0 -37
- package/codeyam-cli/src/webserver/build/client/assets/dev.empty-Bn6aCAy_.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/files-DKyMFI90.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/globals-DTTQ3gY7.css +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/manifest-22590fcf.js +0 -1
- package/codeyam-cli/src/webserver/build/client/assets/root-BsAarjAM.js +0 -57
- package/codeyam-cli/src/webserver/build/server/assets/index-BND5I5fv.js +0 -1
- package/codeyam-cli/src/webserver/build/server/assets/server-build-CFXnd7MG.js +0 -228
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codeyam:memory
|
|
3
|
+
autoApprove: true
|
|
4
|
+
description: |
|
|
5
|
+
Generate and maintain Claude Rules for your codebase based on thorough analysis.
|
|
6
|
+
Use when: User wants to set up memory, claude rules, document confusing areas,
|
|
7
|
+
or ensure Claude has proper context for working in the codebase.
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# CodeYam Memory Assistant
|
|
11
|
+
|
|
12
|
+
This skill helps you generate and maintain Claude Rules (`.claude/rules/`) that provide context-specific guidance. The goal is robust coverage of anything confusing while avoiding documentation of things Claude can intuit.
|
|
13
|
+
|
|
14
|
+
## When to Use This Skill
|
|
15
|
+
|
|
16
|
+
- Initial setup: User asks to "set up memory" or "generate claude rules"
|
|
17
|
+
- Maintenance: After completing complex work where lessons should be preserved
|
|
18
|
+
- Review: Periodically to ensure rules are accurate and up-to-date
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Phase 1: Setup (First Run Only)
|
|
23
|
+
|
|
24
|
+
Check if this is the first time running memory.
|
|
25
|
+
|
|
26
|
+
### 1A. Add Documentation Section to CLAUDE.md
|
|
27
|
+
|
|
28
|
+
If CLAUDE.md doesn't contain a "When Confused / With Mistakes" section, add close to the top:
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
## When Confused / With Mistakes: Stop. Ask. Document.
|
|
32
|
+
|
|
33
|
+
- If you are not sure about something stop and ask about it.
|
|
34
|
+
- If you attempt something and it goes wrong then you are confused. Stop and ask about it.
|
|
35
|
+
- If the user is unable to help. Do your best to research.
|
|
36
|
+
- Then document the findings!
|
|
37
|
+
|
|
38
|
+
### Documenting Confusion / Mistakes
|
|
39
|
+
|
|
40
|
+
It is very important to document any confusion or mistakes you encounter in Claude Rules (`.claude/rules`).
|
|
41
|
+
Please see `.codeyam/rules/instructions.md` for guidance.
|
|
42
|
+
|
|
43
|
+
After making any code changes please run `codeyam memory status` and follow the instructions.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### 1B. Verify Instructions File
|
|
47
|
+
|
|
48
|
+
Check that `.codeyam/rules/instructions.md` exists (it should be created during `codeyam init`). If missing, copy it from `codeyam-cli/templates/rules-instructions.md`.
|
|
49
|
+
|
|
50
|
+
### 1C. Install Pre-commit Hook
|
|
51
|
+
|
|
52
|
+
Check if the project uses Husky (`.husky/` directory exists).
|
|
53
|
+
|
|
54
|
+
**If using Husky**, append to `.husky/pre-commit`:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# CodeYam Memory Up-To-Date Check
|
|
58
|
+
if [ -f ".codeyam/bin/memory-hook.sh" ]; then
|
|
59
|
+
.codeyam/bin/memory-hook.sh
|
|
60
|
+
fi
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**If not using Husky**, create or append to `.git/hooks/pre-commit`.
|
|
64
|
+
|
|
65
|
+
Ensure `.codeyam/bin/memory-hook.sh` exists and is executable (`chmod +x`).
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
## Phase 2: Deep Codebase Analysis
|
|
70
|
+
|
|
71
|
+
Perform thorough analysis to identify areas that may be confusing. The goal is to find everything that might trip up someone (or Claude) working in this codebase.
|
|
72
|
+
|
|
73
|
+
### 2A. Analyze Git Commit Messages for Problem Signals
|
|
74
|
+
|
|
75
|
+
Look for commits indicating gotchas, workarounds, or complexity:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Find commits with problem-indicating keywords
|
|
79
|
+
git log --oneline --since="6 months ago" --grep="fix" --grep="bug" --grep="workaround" --grep="hack" --grep="revert" --grep="oops" --grep="forgot" --grep="actually" --all-match | head -30
|
|
80
|
+
|
|
81
|
+
# Find commits with long messages (indicate complex changes)
|
|
82
|
+
git log --since="6 months ago" --format="%h %s" | awk 'length($0) > 80' | head -20
|
|
83
|
+
|
|
84
|
+
# Find reverted commits
|
|
85
|
+
git log --oneline --since="6 months ago" --grep="revert" -i | head -10
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For interesting commits, examine the full message and changes:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
git show <commit-hash> --stat
|
|
92
|
+
git log -1 --format="%B" <commit-hash>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 2B. Identify Files with High Churn or Complexity Signals
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Files changed most frequently (last 6 months)
|
|
99
|
+
git log --since="6 months ago" --name-only --pretty=format: | sort | uniq -c | sort -rn | head -30
|
|
100
|
+
|
|
101
|
+
# Files with many different authors (tribal knowledge risk)
|
|
102
|
+
git shortlog -sn --since="6 months ago" -- . | head -20
|
|
103
|
+
|
|
104
|
+
# Files frequently modified together (hidden dependencies)
|
|
105
|
+
git log --since="6 months ago" --name-only --pretty=format: | awk '/^$/{if(NR>1)print "---"}; /./{print}' | head -100
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Look for patterns where the same 2-3 files appear together repeatedly.
|
|
109
|
+
|
|
110
|
+
### 2C. Scan for Developer Notes in Code
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Find TODO, FIXME, HACK, XXX, NOTE comments
|
|
114
|
+
grep -rn "TODO\|FIXME\|HACK\|XXX\|NOTE:" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --include="*.py" --include="*.rb" --include="*.go" --include="*.java" --include="*.rs" . 2>/dev/null | head -50
|
|
115
|
+
|
|
116
|
+
# Find "workaround" or "hack" mentions in comments
|
|
117
|
+
grep -rni "workaround\|hack\|temporary\|legacy" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" --include="*.py" . 2>/dev/null | head -30
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### 2D. Analyze Project Structure
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Get directory structure (2 levels deep)
|
|
124
|
+
find . -type d -maxdepth 3 | grep -v node_modules | grep -v .git | grep -v dist | grep -v build | head -50
|
|
125
|
+
|
|
126
|
+
# Find config files
|
|
127
|
+
find . -name "*.config.*" -o -name "*.rc" -o -name ".env*" -o -name "tsconfig*" -o -name "package.json" 2>/dev/null | grep -v node_modules | head -30
|
|
128
|
+
|
|
129
|
+
# Find test directories
|
|
130
|
+
find . -type d -name "*test*" -o -type d -name "*spec*" -o -type d -name "__tests__" 2>/dev/null | grep -v node_modules | head -20
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### 2E. Check for Environment and Configuration Complexity
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Find environment variable references
|
|
137
|
+
grep -rn "process.env\|os.environ\|ENV\[" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.py" . 2>/dev/null | head -30
|
|
138
|
+
|
|
139
|
+
# Find multiple config files that might conflict or confuse
|
|
140
|
+
ls -la *.config.* .*.rc tsconfig*.json 2>/dev/null
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 2F. Review Existing Documentation
|
|
144
|
+
|
|
145
|
+
Read these files if they exist:
|
|
146
|
+
|
|
147
|
+
- `README.md`
|
|
148
|
+
- `CLAUDE.md`
|
|
149
|
+
- `CONTRIBUTING.md`
|
|
150
|
+
- `docs/` directory
|
|
151
|
+
- Any `*.md` files in the root
|
|
152
|
+
|
|
153
|
+
Note what's already documented and what gaps exist.
|
|
154
|
+
|
|
155
|
+
### 2G. Examine Import/Dependency Patterns
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
# Find files with many imports (high coupling)
|
|
159
|
+
for f in $(find . -name "*.ts" -o -name "*.tsx" -o -name "*.js" 2>/dev/null | grep -v node_modules | head -100); do
|
|
160
|
+
count=$(grep -c "^import\|^from\|require(" "$f" 2>/dev/null || echo 0)
|
|
161
|
+
if [ "$count" -gt 15 ]; then
|
|
162
|
+
echo "$count $f"
|
|
163
|
+
fi
|
|
164
|
+
done | sort -rn | head -20
|
|
165
|
+
|
|
166
|
+
# Find commonly imported local modules (core utilities)
|
|
167
|
+
grep -rh "from '\.\|from \"\.\|require('\.\|require(\"\." --include="*.ts" --include="*.tsx" --include="*.js" . 2>/dev/null | sort | uniq -c | sort -rn | head -20
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Phase 3: Cluster and Prioritize Findings
|
|
173
|
+
|
|
174
|
+
After gathering signals, organize them by area/module:
|
|
175
|
+
|
|
176
|
+
1. **Group findings by directory** - Which parts of the codebase have the most signals?
|
|
177
|
+
2. **Identify themes**:
|
|
178
|
+
- Architecture patterns (how things connect)
|
|
179
|
+
- Testing complexity (special setup needed)
|
|
180
|
+
- Configuration/environment gotchas
|
|
181
|
+
- Historical workarounds still in place
|
|
182
|
+
- Non-obvious conventions
|
|
183
|
+
|
|
184
|
+
3. **Score areas** - More signals = higher priority for documentation
|
|
185
|
+
|
|
186
|
+
Create a mental map of:
|
|
187
|
+
|
|
188
|
+
- Which directories/modules are most complex?
|
|
189
|
+
- What relationships exist between different parts?
|
|
190
|
+
- Where are the gotchas hiding?
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Phase 4: Ask Specific Questions
|
|
195
|
+
|
|
196
|
+
Based on your analysis, ask the user specific questions about the actual findings. Reference the concrete evidence you found (file names, commit messages, code patterns) and ask about the substance.
|
|
197
|
+
|
|
198
|
+
Always include "I'm not sure - please investigate" as an option so users can delegate investigation to you.
|
|
199
|
+
|
|
200
|
+
### Question Format
|
|
201
|
+
|
|
202
|
+
Ask about the **specific finding**, not the file generally:
|
|
203
|
+
|
|
204
|
+
**For high-churn files with concerning commits:**
|
|
205
|
+
|
|
206
|
+
> "ScopeDataStructure.ts has commits mentioning 'exponential blowup' and 'execution flows'. What causes this blowup? When does it happen?"
|
|
207
|
+
>
|
|
208
|
+
> Options: [Explain the cause] [I'm not sure - please investigate]
|
|
209
|
+
|
|
210
|
+
**For files frequently modified together:**
|
|
211
|
+
|
|
212
|
+
> "`src/api/auth.ts` and `src/middleware/session.ts` are modified together in 12 commits. Why do these need to change together?"
|
|
213
|
+
>
|
|
214
|
+
> Options: [Explain the relationship] [I'm not sure - please investigate]
|
|
215
|
+
|
|
216
|
+
**For commits with workaround language:**
|
|
217
|
+
|
|
218
|
+
> "Commit `abc123` says 'workaround for webpack issue'. What's the underlying issue and what's the workaround?"
|
|
219
|
+
>
|
|
220
|
+
> Options: [Explain] [I'm not sure - please investigate]
|
|
221
|
+
|
|
222
|
+
**For multiple config files:**
|
|
223
|
+
|
|
224
|
+
> "There are 3 tsconfig files. When is each one used?"
|
|
225
|
+
>
|
|
226
|
+
> Options: [Explain usage] [I'm not sure - please investigate]
|
|
227
|
+
|
|
228
|
+
**For TODO/FIXME comments:**
|
|
229
|
+
|
|
230
|
+
> "There's a FIXME in `src/parser.ts:142` about 'handle nested callbacks'. What's the issue with nested callbacks here?"
|
|
231
|
+
>
|
|
232
|
+
> Options: [Explain] [I'm not sure - please investigate]
|
|
233
|
+
|
|
234
|
+
**For test organization:**
|
|
235
|
+
|
|
236
|
+
> "Tests are split between `__tests__/` folders and colocated `*.test.ts` files. When should each approach be used?"
|
|
237
|
+
>
|
|
238
|
+
> Options: [Explain convention] [I'm not sure - please investigate]
|
|
239
|
+
|
|
240
|
+
### Process
|
|
241
|
+
|
|
242
|
+
1. Group related questions by area/module
|
|
243
|
+
2. Ask 2-3 questions at a time, wait for answers
|
|
244
|
+
3. If user says "I'm not sure - please investigate":
|
|
245
|
+
- Read the relevant code, commits, and context yourself
|
|
246
|
+
- Analyze the patterns and behavior
|
|
247
|
+
- Document your findings based on what you discover
|
|
248
|
+
4. Move to next area after capturing answers
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Phase 5: Generate Rules
|
|
253
|
+
|
|
254
|
+
For each area where you have enough information, create a rule file.
|
|
255
|
+
|
|
256
|
+
### Rule File Guidelines:
|
|
257
|
+
|
|
258
|
+
1. **Location mirrors code structure**
|
|
259
|
+
- Rule for `src/api/` → `.claude/rules/src/api/architecture.md`
|
|
260
|
+
- Rule for testing patterns → `.claude/rules/testing-patterns.md`
|
|
261
|
+
|
|
262
|
+
2. **Paths must be specific**
|
|
263
|
+
- Good: `paths: ['src/api/**/*.ts']`
|
|
264
|
+
- Bad: `paths: ['**/*.ts']` (too broad, wastes context)
|
|
265
|
+
|
|
266
|
+
3. **Content should be actionable**
|
|
267
|
+
- Focus on "how to" and "what to know"
|
|
268
|
+
- Avoid warnings unless truly critical
|
|
269
|
+
- Be concise - every word costs context
|
|
270
|
+
|
|
271
|
+
4. **Timestamp must be current**
|
|
272
|
+
- Use ISO 8601 format: `2026-01-27T15:30:00Z`
|
|
273
|
+
- This enables the pre-commit hook enforcement
|
|
274
|
+
|
|
275
|
+
### Rule Template:
|
|
276
|
+
|
|
277
|
+
```markdown
|
|
278
|
+
---
|
|
279
|
+
paths:
|
|
280
|
+
- 'specific/path/**/*.ts'
|
|
281
|
+
category: architecture | testing | faq
|
|
282
|
+
timestamp: [CURRENT_ISO_TIMESTAMP]
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## [Clear, Descriptive Title]
|
|
286
|
+
|
|
287
|
+
[Concise explanation of what this covers]
|
|
288
|
+
|
|
289
|
+
### [Section as appropriate]
|
|
290
|
+
|
|
291
|
+
[Specific, actionable content]
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Phase 6: Final Review
|
|
297
|
+
|
|
298
|
+
After generating rules based on your analysis and user answers:
|
|
299
|
+
|
|
300
|
+
1. **Present a summary** of all rules created
|
|
301
|
+
2. **Ask the user:**
|
|
302
|
+
|
|
303
|
+
> "I've created rules covering [list areas]. Are there any other areas of the codebase that you know are confusing or have tribal knowledge that I might have missed?"
|
|
304
|
+
|
|
305
|
+
3. **Generate any additional rules** based on their response
|
|
306
|
+
|
|
307
|
+
4. **Suggest viewing rules in the dashboard:**
|
|
308
|
+
|
|
309
|
+
> "Run `codeyam` to open the dashboard and view all rules in the Rules tab."
|
|
310
|
+
|
|
311
|
+
5. **Remind the user** to commit the new rules:
|
|
312
|
+
```
|
|
313
|
+
git add .claude/rules/ .codeyam/rules/
|
|
314
|
+
git commit -m "Add rules for Claude Code (generated via /codeyam:memory)"
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Ongoing Maintenance
|
|
320
|
+
|
|
321
|
+
### When Claude Should Update Rules
|
|
322
|
+
|
|
323
|
+
- After fixing a bug that revealed a gotcha
|
|
324
|
+
- After making an architectural decision
|
|
325
|
+
- When code patterns change
|
|
326
|
+
- When asking "why does this work this way?" and learning the answer
|
|
327
|
+
- When receiving clarification from the user about any confusion
|
|
328
|
+
|
|
329
|
+
### Pre-commit Hook Behavior
|
|
330
|
+
|
|
331
|
+
The pre-commit hook **blocks commits** when:
|
|
332
|
+
|
|
333
|
+
- Code files matching a rule's `paths` are modified
|
|
334
|
+
- The rule's `timestamp` is older than the code changes
|
|
335
|
+
|
|
336
|
+
To proceed:
|
|
337
|
+
|
|
338
|
+
1. Review the flagged rule(s)
|
|
339
|
+
2. Update content if needed
|
|
340
|
+
3. Update the `timestamp` to current time
|
|
341
|
+
4. Stage and commit
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: codeyam:new-rule
|
|
3
|
+
autoApprove: true
|
|
4
|
+
description: |
|
|
5
|
+
Create a new Claude Rule for documenting codebase patterns.
|
|
6
|
+
Use when: User wants to add documentation for a specific area of the codebase.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Create New Claude Rule
|
|
10
|
+
|
|
11
|
+
Read `.codeyam/rules/instructions.md` for guidance on how to create and structure a new rule.
|
|
12
|
+
|
|
13
|
+
If the instructions file doesn't exist, copy it from `codeyam-cli/templates/rules-instructions.md`.
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Rule reflection hook for Claude Code.
|
|
4
|
+
|
|
5
|
+
Reads the session transcript to find new conversation since last check,
|
|
6
|
+
then prompts Claude to consider rule updates if there was substantive content.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import json
|
|
10
|
+
import sys
|
|
11
|
+
from pathlib import Path
|
|
12
|
+
|
|
13
|
+
MIN_USER_TURNS = 5 # Fire after N user turns
|
|
14
|
+
|
|
15
|
+
def main():
|
|
16
|
+
# Read hook input from stdin
|
|
17
|
+
try:
|
|
18
|
+
hook_input = json.load(sys.stdin)
|
|
19
|
+
except json.JSONDecodeError:
|
|
20
|
+
# No valid input, exit silently
|
|
21
|
+
return
|
|
22
|
+
|
|
23
|
+
session_id = hook_input.get('session_id', '')
|
|
24
|
+
transcript_path = hook_input.get('transcript_path', '')
|
|
25
|
+
stop_hook_active = hook_input.get('stop_hook_active', False)
|
|
26
|
+
|
|
27
|
+
# Prevent infinite loops - if we're already in a stop hook continuation, exit silently
|
|
28
|
+
if stop_hook_active:
|
|
29
|
+
return
|
|
30
|
+
|
|
31
|
+
if not session_id or not transcript_path:
|
|
32
|
+
return
|
|
33
|
+
|
|
34
|
+
# Marker file tracks last checked line per session
|
|
35
|
+
marker_dir = Path('/tmp/claude-rule-markers')
|
|
36
|
+
marker_dir.mkdir(exist_ok=True)
|
|
37
|
+
marker_file = marker_dir / f'{session_id}.marker'
|
|
38
|
+
|
|
39
|
+
# Read last checked line
|
|
40
|
+
last_line = 0
|
|
41
|
+
if marker_file.exists():
|
|
42
|
+
try:
|
|
43
|
+
last_line = int(marker_file.read_text().strip())
|
|
44
|
+
except (ValueError, IOError):
|
|
45
|
+
last_line = 0
|
|
46
|
+
|
|
47
|
+
# Read transcript and get new lines
|
|
48
|
+
try:
|
|
49
|
+
with open(transcript_path, 'r') as f:
|
|
50
|
+
all_lines = f.readlines()
|
|
51
|
+
except IOError:
|
|
52
|
+
return
|
|
53
|
+
|
|
54
|
+
current_line_count = len(all_lines)
|
|
55
|
+
new_lines = all_lines[last_line:]
|
|
56
|
+
|
|
57
|
+
if not new_lines:
|
|
58
|
+
return
|
|
59
|
+
|
|
60
|
+
# Count user turns and extract conversation content from new lines
|
|
61
|
+
user_turn_count = 0
|
|
62
|
+
conversation_snippets = []
|
|
63
|
+
|
|
64
|
+
for line in new_lines:
|
|
65
|
+
try:
|
|
66
|
+
obj = json.loads(line)
|
|
67
|
+
msg_type = obj.get('type')
|
|
68
|
+
|
|
69
|
+
if msg_type not in ('user', 'assistant'):
|
|
70
|
+
continue
|
|
71
|
+
|
|
72
|
+
message = obj.get('message', {})
|
|
73
|
+
content = message.get('content', '')
|
|
74
|
+
is_external_user = msg_type == 'user' and obj.get('userType') == 'external'
|
|
75
|
+
|
|
76
|
+
# Handle string content
|
|
77
|
+
if isinstance(content, str):
|
|
78
|
+
# Skip meta messages and very short content
|
|
79
|
+
if obj.get('isMeta') or len(content) < 20:
|
|
80
|
+
continue
|
|
81
|
+
# Skip tool results (they show up as user messages)
|
|
82
|
+
if content.startswith('[{') or '<tool_result' in content:
|
|
83
|
+
continue
|
|
84
|
+
|
|
85
|
+
# Count substantive user turns
|
|
86
|
+
if is_external_user and not content.startswith('<'):
|
|
87
|
+
user_turn_count += 1
|
|
88
|
+
|
|
89
|
+
conversation_snippets.append({
|
|
90
|
+
'role': message.get('role', msg_type),
|
|
91
|
+
'content': content[:500] # Truncate long messages
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
# Handle array content (tool calls, etc.)
|
|
95
|
+
elif isinstance(content, list):
|
|
96
|
+
for item in content:
|
|
97
|
+
if isinstance(item, dict):
|
|
98
|
+
if item.get('type') == 'text':
|
|
99
|
+
text = item.get('text', '')
|
|
100
|
+
if len(text) > 20:
|
|
101
|
+
conversation_snippets.append({
|
|
102
|
+
'role': message.get('role', msg_type),
|
|
103
|
+
'content': text[:500]
|
|
104
|
+
})
|
|
105
|
+
except (json.JSONDecodeError, KeyError):
|
|
106
|
+
continue
|
|
107
|
+
|
|
108
|
+
# Only fire after enough user turns
|
|
109
|
+
if user_turn_count < MIN_USER_TURNS:
|
|
110
|
+
return
|
|
111
|
+
|
|
112
|
+
# Update marker with current line count
|
|
113
|
+
marker_file.write_text(str(current_line_count))
|
|
114
|
+
|
|
115
|
+
# If not enough substantive conversation, exit silently
|
|
116
|
+
if len(conversation_snippets) < 3:
|
|
117
|
+
return
|
|
118
|
+
|
|
119
|
+
# Build a summary of the recent conversation for the rule check
|
|
120
|
+
summary_lines = []
|
|
121
|
+
for snippet in conversation_snippets[-15:]: # Last 15 messages
|
|
122
|
+
role = snippet['role']
|
|
123
|
+
content = snippet['content'].replace('\n', ' ')[:300]
|
|
124
|
+
summary_lines.append(f"[{role}]: {content}")
|
|
125
|
+
|
|
126
|
+
summary = '\n'.join(summary_lines)
|
|
127
|
+
|
|
128
|
+
# Write detailed context to a file (keeps displayed output short)
|
|
129
|
+
context_file = marker_dir / f'{session_id}.context'
|
|
130
|
+
context = f"""Recent conversation to review for rule-worthy learnings:
|
|
131
|
+
|
|
132
|
+
{summary}
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
Guidelines:
|
|
136
|
+
- Did Claude get confused during this session in any way?
|
|
137
|
+
- How exactly did it get confused and what information would have resolved that confusion. No additional detail is needed especially if it is something that Claude likely already knows.
|
|
138
|
+
- Only update rules for patterns of confusion that will likely recur in future sessions.
|
|
139
|
+
- Document knowledge not easily evident from code
|
|
140
|
+
- Locations of tests
|
|
141
|
+
- Commands that can be run that are relevant to the task at hand
|
|
142
|
+
- Architectural design, where to look for, fix, or add certain things
|
|
143
|
+
- Do not document bugs being fixed as they will likely be resolved.
|
|
144
|
+
- Issues that are abandoned as known issues can be noted.
|
|
145
|
+
- Keep rules concise (<50 lines), use bullets/tables where appropriate.
|
|
146
|
+
- Clean up, summarize, and delete existing rules as needed.
|
|
147
|
+
- If no changes are needed, just say "No rule updates needed."
|
|
148
|
+
"""
|
|
149
|
+
context_file.write_text(context)
|
|
150
|
+
|
|
151
|
+
# Output blocking decision - just trigger background agent
|
|
152
|
+
# Keep reason minimal since main agent will spawn background worker
|
|
153
|
+
output = {
|
|
154
|
+
"decision": "block",
|
|
155
|
+
"reason": f"RULE_CHECK:{context_file}"
|
|
156
|
+
}
|
|
157
|
+
print(json.dumps(output))
|
|
158
|
+
|
|
159
|
+
if __name__ == '__main__':
|
|
160
|
+
main()
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Claude Rules Guide
|
|
2
|
+
|
|
3
|
+
Rules provide context-specific guidance when working in files matching their `paths` patterns.
|
|
4
|
+
|
|
5
|
+
## Core Principles
|
|
6
|
+
|
|
7
|
+
1. **One concept per rule** - Each rule should cover a single topic. If you're documenting two unrelated things, create two rules.
|
|
8
|
+
2. **Paths must match content scope** - A rule about one specific file should have that file in `paths`, not a broad `**/*.ts` pattern.
|
|
9
|
+
3. **Be concise** - Every word costs context. Use bullets and tables.
|
|
10
|
+
|
|
11
|
+
## When to Create a New Rule
|
|
12
|
+
|
|
13
|
+
Create a new rule when:
|
|
14
|
+
|
|
15
|
+
- You learn something non-obvious about the codebase
|
|
16
|
+
- You make a mistake and want to prevent it in the future
|
|
17
|
+
- The user explains something that isn't clear from the code
|
|
18
|
+
- An existing rule is covering multiple unrelated topics (split it)
|
|
19
|
+
|
|
20
|
+
## Path Specificity
|
|
21
|
+
|
|
22
|
+
The `paths` field controls when the rule is shown. Match the scope of your content:
|
|
23
|
+
|
|
24
|
+
| Content Scope | Path Pattern | Example |
|
|
25
|
+
| ------------- | ----------------------- | ------------------------------------------------------ |
|
|
26
|
+
| Single file | `'path/to/file.ts'` | Rule about `processExpression.ts` specifically |
|
|
27
|
+
| Related files | `'path/to/feature*.ts'` | Rule about `generateExecutionFlows*.ts` files |
|
|
28
|
+
| Directory | `'path/to/dir/**/*.ts'` | Rule about the queue system in `utils/queue/` |
|
|
29
|
+
| Cross-cutting | Multiple specific paths | Testing rule with paths to test configs and test files |
|
|
30
|
+
|
|
31
|
+
**Anti-pattern**: Don't use `'**/*.ts'` for a rule about one specific feature.
|
|
32
|
+
|
|
33
|
+
## File Structure
|
|
34
|
+
|
|
35
|
+
Rules mirror the source code structure:
|
|
36
|
+
|
|
37
|
+
| Source Location | Rule Location |
|
|
38
|
+
| -------------------- | --------------------------------------- |
|
|
39
|
+
| `src/api/auth.ts` | `.claude/rules/src/api/auth.md` |
|
|
40
|
+
| `src/utils/queue/**` | `.claude/rules/src/utils/queue.md` |
|
|
41
|
+
| Test configuration | `.claude/rules/testing/jest-configs.md` |
|
|
42
|
+
|
|
43
|
+
## Required Frontmatter
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
---
|
|
47
|
+
paths:
|
|
48
|
+
- 'specific/path/to/file.ts'
|
|
49
|
+
- 'another/specific/path/*.ts'
|
|
50
|
+
category: architecture | testing | faq
|
|
51
|
+
timestamp: 2026-01-30T00:00:00Z
|
|
52
|
+
---
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
| Field | Purpose |
|
|
56
|
+
| ----------- | -------------------------------------------------------------------------------------------------- |
|
|
57
|
+
| `paths` | Glob patterns - be specific to avoid loading rules unnecessarily |
|
|
58
|
+
| `category` | `architecture` (design/data flow), `testing` (test commands/patterns), `faq` (gotchas/workarounds) |
|
|
59
|
+
| `timestamp` | ISO 8601 - update when rule is reviewed |
|
|
60
|
+
|
|
61
|
+
## Content Guidelines
|
|
62
|
+
|
|
63
|
+
### Be Actionable
|
|
64
|
+
|
|
65
|
+
- Good: "Run `pnpm test:api` for API tests"
|
|
66
|
+
- Bad: "Make sure to run the appropriate tests"
|
|
67
|
+
|
|
68
|
+
### Focus on What, Not What Not
|
|
69
|
+
|
|
70
|
+
- Good: "Auth tokens are stored in httpOnly cookies via `src/auth/cookies.ts`"
|
|
71
|
+
- Bad: "WARNING: Don't store tokens in localStorage!"
|
|
72
|
+
|
|
73
|
+
### Keep Rules Short
|
|
74
|
+
|
|
75
|
+
- Target 30-50 lines
|
|
76
|
+
- If a rule exceeds 60 lines, consider splitting it
|
|
77
|
+
|
|
78
|
+
## Categories
|
|
79
|
+
|
|
80
|
+
**architecture** - Design decisions, file relationships, data flow
|
|
81
|
+
|
|
82
|
+
- "These three files must change together because..."
|
|
83
|
+
- "Data flows from X → Y → Z"
|
|
84
|
+
|
|
85
|
+
**testing** - Test commands, mock patterns, fixtures
|
|
86
|
+
|
|
87
|
+
- "Run tests with: `pnpm test path/to/test.ts`"
|
|
88
|
+
- "Must run `pnpm pretest` first because..."
|
|
89
|
+
|
|
90
|
+
**faq** - Gotchas, workarounds, common questions
|
|
91
|
+
|
|
92
|
+
- "If you see error X, it means Y"
|
|
93
|
+
- "This looks wrong but is intentional because..."
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeyam/codeyam-cli",
|
|
3
|
-
"version": "0.1.0-staging.
|
|
3
|
+
"version": "0.1.0-staging.2a88920",
|
|
4
4
|
"description": "Local development CLI for CodeYam analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"@anthropic-ai/sdk": "^0.71.0",
|
|
15
15
|
"@aws-sdk/client-dynamodb": "^3.956.0",
|
|
16
16
|
"@aws-sdk/s3-request-presigner": "^3.940.0",
|
|
17
|
-
"@aws-sdk/util-dynamodb": "^3.
|
|
18
|
-
"@modelcontextprotocol/sdk": "^1.25.
|
|
17
|
+
"@aws-sdk/util-dynamodb": "^3.971.0",
|
|
18
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
19
19
|
"@octokit/auth-app": "^8.1.0",
|
|
20
20
|
"@octokit/request": "^10.0.3",
|
|
21
21
|
"@octokit/rest": "^22.0.0",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"better-sqlite3": "^12.4.1",
|
|
28
28
|
"chalk": "^5.6.2",
|
|
29
29
|
"chokidar": "^4.0.3",
|
|
30
|
-
"cli-spinners": "^3.
|
|
30
|
+
"cli-spinners": "^3.4.0",
|
|
31
31
|
"domhandler": "^5.0.3",
|
|
32
32
|
"dotenv": "^17.2.3",
|
|
33
33
|
"express": "^5.2.1",
|
|
@@ -41,20 +41,23 @@
|
|
|
41
41
|
"kysely": "^0.28.5",
|
|
42
42
|
"lru-cache": "^11.2.4",
|
|
43
43
|
"lucide-react": "^0.556.0",
|
|
44
|
+
"minimatch": "^10.0.1",
|
|
44
45
|
"openai": "^6.16.0",
|
|
45
46
|
"p-queue": "^8.1.0",
|
|
46
47
|
"p-retry": "^7.1.1",
|
|
47
48
|
"pg": "^8.16.3",
|
|
48
49
|
"piscina": "^5.1.4",
|
|
49
50
|
"pixelmatch": "^5.3.0",
|
|
50
|
-
"playwright": "
|
|
51
|
+
"playwright": "1.58.0",
|
|
51
52
|
"pluralize": "^8.0.0",
|
|
52
53
|
"prompts": "^2.4.2",
|
|
53
54
|
"react": "^19.2.3",
|
|
54
55
|
"react-diff-viewer-continued": "^4.0.6",
|
|
55
56
|
"react-dom": "^19.2.3",
|
|
57
|
+
"react-markdown": "^10.1.0",
|
|
56
58
|
"react-resizable": "^3.0.5",
|
|
57
59
|
"react-syntax-highlighter": "^15.6.1",
|
|
60
|
+
"remark-gfm": "^4.0.1",
|
|
58
61
|
"sharp": "^0.34.5",
|
|
59
62
|
"simple-git": "^3.28.0",
|
|
60
63
|
"typescript": "^5.9.3",
|
package/packages/ai/index.js
CHANGED
|
@@ -26,19 +26,23 @@ export { default as describeCodeChange } from "./src/lib/describeCodeChange.js";
|
|
|
26
26
|
export { default as validateTypeStructure } from "./src/lib/validateTypeStructure.js";
|
|
27
27
|
export { default as validateDataStructure } from "./src/lib/validateDataStructure.js";
|
|
28
28
|
export { default as isolateScopes } from "./src/lib/isolateScopes.js";
|
|
29
|
-
export { default as analyzeScope } from "./src/lib/analyzeScope.js";
|
|
29
|
+
export { default as analyzeScope, destroyWorkerPool, } from "./src/lib/analyzeScope.js";
|
|
30
30
|
export { default as logOrderedMap } from "./src/lib/logOrderedMap.js";
|
|
31
31
|
export { default as splitOutsideParentheses, splitOutsideParenthesesAndArrays, joinParenthesesAndArrays, functionArguments, } from "./src/lib/splitOutsideParentheses.js";
|
|
32
32
|
export { cleanKnownObjectFunctionsFromMapping } from "./src/lib/dataStructure/helpers/cleanKnownObjectFunctions.js";
|
|
33
33
|
export { clearAttributesFromMapping, removeDuplicateFunctionCalls, } from "./src/lib/dataStructure/helpers/cleanNonObjectFunctions.js";
|
|
34
34
|
export { default as convertDotNotation } from "./src/lib/dataStructure/helpers/convertDotNotation.js";
|
|
35
|
+
export { default as convertTypeAnnotationsToValues } from "./src/lib/dataStructure/helpers/convertTypeAnnotationsToValues.js";
|
|
35
36
|
export { default as cleanOutBoundary } from "./src/lib/cleanOutBoundary.js";
|
|
36
|
-
export { fillInDirectSchemaGapsAndUnknowns } from "./src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js";
|
|
37
|
+
export { fillInDirectSchemaGapsAndUnknowns, buildSchemaIndexes, } from "./src/lib/dataStructure/helpers/fillInSchemaGapsAndUnknowns.js";
|
|
37
38
|
export { default as deduplicateFunctionSchemas } from "./src/lib/dataStructure/helpers/deduplicateFunctionSchemas.js";
|
|
38
39
|
export { default as getConditionalUsagesFromCode } from "./src/lib/getConditionalUsagesFromCode.js";
|
|
39
|
-
export { getExternalFunctionCallInfo, getFunctionSignature, getReturnValue, getUsageEquivalencies, getSourceEquivalencies, getEquivalentSignatureVariables, getConditionalUsages, getConditionalEffects, getCompoundConditionals, getChildBoundaryGatingConditions, } from "./src/lib/worker/SerializableDataStructure.js";
|
|
40
|
+
export { getExternalFunctionCallInfo, getFunctionSignature, getReturnValue, getUsageEquivalencies, getSourceEquivalencies, getEquivalentSignatureVariables, getConditionalUsages, getConditionalEffects, getCompoundConditionals, getChildBoundaryGatingConditions, getJsxRenderingUsages, } from "./src/lib/worker/SerializableDataStructure.js";
|
|
40
41
|
export { parseJsonSafe } from "./src/lib/parsers/parseJsonSafe.js";
|
|
41
42
|
export { default as completionCall } from "./src/lib/completionCall.js";
|
|
43
|
+
// NOTE: E2E data tracking utilities (e2eDataTracking.ts) are NOT exported here
|
|
44
|
+
// because they use Node.js 'crypto' module which breaks browser builds.
|
|
45
|
+
// Import directly from "../../packages/ai/src/lib/e2eDataTracking.js" when needed in Node.js tests.
|
|
42
46
|
// Wrapper detection
|
|
43
47
|
export { default as detectWrapperRequirements } from "./src/lib/wrapperDetection/detectWrapperRequirements.js";
|
|
44
48
|
export { KNOWN_LIBRARY_HOOKS } from "./src/lib/wrapperDetection/knownLibraryHooks.js";
|