memory-journal-mcp 6.1.2 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -28
- package/dist/{chunk-X4SWFATC.js → chunk-BI4ZNSKA.js} +38 -24
- package/dist/{chunk-HCEWINSB.js → chunk-N6EBIDN7.js} +99 -102
- package/dist/cli.js +2 -2
- package/dist/index.js +2 -2
- package/dist/tools-WPRY5MJ6.js +2 -0
- package/package.json +10 -1
- package/skills/github-commander/SKILL.md +151 -0
- package/skills/github-commander/config/project-config.example.md +125 -0
- package/skills/github-commander/workflows/code-quality-audit.md +80 -0
- package/skills/github-commander/workflows/full-audit.md +134 -0
- package/skills/github-commander/workflows/issue-triage.md +239 -0
- package/skills/github-commander/workflows/milestone-sprint.md +81 -0
- package/skills/github-commander/workflows/perf-audit.md +142 -0
- package/skills/github-commander/workflows/pr-review.md +123 -0
- package/skills/github-commander/workflows/security-audit.md +170 -0
- package/skills/github-commander/workflows/update-deps.md +109 -0
- package/.dockerignore +0 -139
- package/.gitattributes +0 -20
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -95
- package/.github/ISSUE_TEMPLATE/config.yml +0 -11
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -110
- package/.github/ISSUE_TEMPLATE/question.md +0 -78
- package/.github/aw/actions-lock.json +0 -14
- package/.github/copilot-instructions.md +0 -122
- package/.github/dependabot.yml +0 -93
- package/.github/pull_request_template.md +0 -135
- package/.github/workflows/README.md +0 -133
- package/.github/workflows/agentics-maintenance.yml +0 -141
- package/.github/workflows/auto-release.yml +0 -68
- package/.github/workflows/ci-health-monitor.lock.yml +0 -1121
- package/.github/workflows/ci-health-monitor.md +0 -87
- package/.github/workflows/codeql.yml +0 -41
- package/.github/workflows/dependabot-auto-merge.yml +0 -42
- package/.github/workflows/dependency-maintenance.lock.yml +0 -1182
- package/.github/workflows/dependency-maintenance.md +0 -147
- package/.github/workflows/docker-publish.yml +0 -254
- package/.github/workflows/docs-drift-detector.lock.yml +0 -1142
- package/.github/workflows/docs-drift-detector.md +0 -115
- package/.github/workflows/lint-and-test.yml +0 -60
- package/.github/workflows/publish-npm.yml +0 -85
- package/.github/workflows/secrets-scanning.yml +0 -32
- package/.github/workflows/security-update.yml +0 -127
- package/.gitleaks.toml +0 -9
- package/.prettierignore +0 -21
- package/.prettierrc +0 -33
- package/.scout-ignore +0 -12
- package/.trivyignore +0 -21
- package/CHANGELOG.md +0 -1814
- package/CODE_OF_CONDUCT.md +0 -133
- package/CONTRIBUTING.md +0 -263
- package/DOCKER_README.md +0 -331
- package/Dockerfile +0 -128
- package/SECURITY.md +0 -227
- package/UNRELEASED.md +0 -1
- package/dist/tools-T4U5A3X4.js +0 -2
- package/docker-compose.yml +0 -71
- package/docs/README.md +0 -18
- package/docs/agentic-journal-synergy.md +0 -175
- package/docs/copilot-setup.md +0 -72
- package/eslint.config.js +0 -110
- package/mcp-config-example.json +0 -21
- package/playwright.config.ts +0 -35
- package/releases/v2.1.0.md +0 -220
- package/releases/v2.2.0.md +0 -168
- package/releases/v3.0.0.md +0 -237
- package/releases/v3.1.0.md +0 -104
- package/releases/v3.1.1.md +0 -42
- package/releases/v3.1.2.md +0 -40
- package/releases/v3.1.3.md +0 -64
- package/releases/v3.1.4.md +0 -32
- package/releases/v3.1.5.md +0 -44
- package/releases/v4.0.0.md +0 -71
- package/releases/v4.1.0.md +0 -88
- package/releases/v4.2.0.md +0 -90
- package/releases/v4.3.0.md +0 -92
- package/releases/v4.3.1.md +0 -69
- package/releases/v4.4.0.md +0 -120
- package/releases/v4.4.1.md +0 -33
- package/releases/v4.4.2.md +0 -31
- package/releases/v4.5.0.md +0 -116
- package/releases/v5.0.0.md +0 -105
- package/releases/v5.0.1.md +0 -25
- package/releases/v5.1.0.md +0 -83
- package/releases/v5.1.1.md +0 -10
- package/releases/v6.0.0.md +0 -48
- package/releases/v6.0.1.md +0 -36
- package/releases/v6.1.0.md +0 -68
- package/releases/v6.1.1.md +0 -30
- package/releases/v6.1.2.md +0 -23
- package/scripts/generate-server-instructions.ts +0 -306
- package/scripts/server-instructions-function-body.ts +0 -107
- package/scripts/server-instructions-gotchas.ts +0 -45
- package/server.json +0 -42
- package/social-preview.png +0 -0
- package/src/auth/auth-context.ts +0 -78
- package/src/auth/authorization-server-discovery.ts +0 -263
- package/src/auth/errors.ts +0 -215
- package/src/auth/index.ts +0 -58
- package/src/auth/middleware.ts +0 -392
- package/src/auth/oauth-resource-server.ts +0 -170
- package/src/auth/scope-map.ts +0 -46
- package/src/auth/scopes.ts +0 -256
- package/src/auth/token-validator.ts +0 -293
- package/src/auth/transport-agnostic.ts +0 -164
- package/src/auth/types.ts +0 -372
- package/src/cli.ts +0 -279
- package/src/codemode/api-constants.ts +0 -263
- package/src/codemode/api.ts +0 -302
- package/src/codemode/auto-return.ts +0 -65
- package/src/codemode/index.ts +0 -47
- package/src/codemode/sandbox-factory.ts +0 -144
- package/src/codemode/sandbox.ts +0 -220
- package/src/codemode/security.ts +0 -155
- package/src/codemode/types.ts +0 -228
- package/src/codemode/worker-sandbox.ts +0 -277
- package/src/codemode/worker-script.ts +0 -239
- package/src/constants/icons.ts +0 -183
- package/src/constants/server-instructions.md +0 -166
- package/src/constants/server-instructions.ts +0 -514
- package/src/database/adapter-factory.ts +0 -16
- package/src/database/core/entry-columns.ts +0 -10
- package/src/database/core/interfaces.ts +0 -188
- package/src/database/core/schema.ts +0 -152
- package/src/database/sqlite-adapter/backup.ts +0 -167
- package/src/database/sqlite-adapter/entries/crud.ts +0 -233
- package/src/database/sqlite-adapter/entries/importance.ts +0 -76
- package/src/database/sqlite-adapter/entries/index.ts +0 -142
- package/src/database/sqlite-adapter/entries/search.ts +0 -294
- package/src/database/sqlite-adapter/entries/shared.ts +0 -102
- package/src/database/sqlite-adapter/entries/statistics.ts +0 -162
- package/src/database/sqlite-adapter/index.ts +0 -265
- package/src/database/sqlite-adapter/native-connection.ts +0 -301
- package/src/database/sqlite-adapter/relationships.ts +0 -70
- package/src/database/sqlite-adapter/tags.ts +0 -182
- package/src/filtering/tool-filter.ts +0 -312
- package/src/github/github-integration/client.ts +0 -114
- package/src/github/github-integration/index.ts +0 -297
- package/src/github/github-integration/insights.ts +0 -155
- package/src/github/github-integration/issues.ts +0 -213
- package/src/github/github-integration/milestones.ts +0 -262
- package/src/github/github-integration/projects.ts +0 -414
- package/src/github/github-integration/pull-requests.ts +0 -235
- package/src/github/github-integration/repository.ts +0 -110
- package/src/github/github-integration/types.ts +0 -43
- package/src/handlers/prompts/github.ts +0 -210
- package/src/handlers/prompts/index.ts +0 -97
- package/src/handlers/prompts/workflow.ts +0 -361
- package/src/handlers/resources/core/briefing/context-section.ts +0 -182
- package/src/handlers/resources/core/briefing/github-section.ts +0 -354
- package/src/handlers/resources/core/briefing/index.ts +0 -106
- package/src/handlers/resources/core/briefing/user-message.ts +0 -114
- package/src/handlers/resources/core/health.ts +0 -75
- package/src/handlers/resources/core/index.ts +0 -31
- package/src/handlers/resources/core/instructions.ts +0 -45
- package/src/handlers/resources/core/utilities.ts +0 -310
- package/src/handlers/resources/github.ts +0 -340
- package/src/handlers/resources/graph.ts +0 -218
- package/src/handlers/resources/help.ts +0 -410
- package/src/handlers/resources/index.ts +0 -143
- package/src/handlers/resources/shared.ts +0 -219
- package/src/handlers/resources/team.ts +0 -134
- package/src/handlers/resources/templates.ts +0 -334
- package/src/handlers/tools/admin.ts +0 -351
- package/src/handlers/tools/analytics.ts +0 -346
- package/src/handlers/tools/backup.ts +0 -272
- package/src/handlers/tools/codemode.ts +0 -188
- package/src/handlers/tools/core.ts +0 -359
- package/src/handlers/tools/error-fields-mixin.ts +0 -10
- package/src/handlers/tools/export.ts +0 -150
- package/src/handlers/tools/github/copilot-tools.ts +0 -72
- package/src/handlers/tools/github/helpers.ts +0 -125
- package/src/handlers/tools/github/insights-tools.ts +0 -112
- package/src/handlers/tools/github/issue-tools.ts +0 -442
- package/src/handlers/tools/github/kanban-tools.ts +0 -153
- package/src/handlers/tools/github/milestone-tools.ts +0 -371
- package/src/handlers/tools/github/mutation-tools.ts +0 -17
- package/src/handlers/tools/github/read-tools.ts +0 -302
- package/src/handlers/tools/github/schemas.ts +0 -435
- package/src/handlers/tools/github.ts +0 -39
- package/src/handlers/tools/index.ts +0 -255
- package/src/handlers/tools/relationships.ts +0 -390
- package/src/handlers/tools/schemas.ts +0 -165
- package/src/handlers/tools/search.ts +0 -448
- package/src/handlers/tools/team/admin-tools.ts +0 -164
- package/src/handlers/tools/team/analytics-tools.ts +0 -233
- package/src/handlers/tools/team/backup-tools.ts +0 -83
- package/src/handlers/tools/team/core-tools.ts +0 -197
- package/src/handlers/tools/team/export-tools.ts +0 -130
- package/src/handlers/tools/team/helpers.ts +0 -66
- package/src/handlers/tools/team/index.ts +0 -45
- package/src/handlers/tools/team/relationship-tools.ts +0 -219
- package/src/handlers/tools/team/schemas.ts +0 -558
- package/src/handlers/tools/team/search-tools.ts +0 -145
- package/src/handlers/tools/team/vector-tools.ts +0 -261
- package/src/index.ts +0 -57
- package/src/server/mcp-server.ts +0 -446
- package/src/server/registration.ts +0 -141
- package/src/server/scheduler.ts +0 -283
- package/src/transports/http/handlers.ts +0 -78
- package/src/transports/http/index.ts +0 -8
- package/src/transports/http/security.ts +0 -147
- package/src/transports/http/server/index.ts +0 -397
- package/src/transports/http/server/legacy-sse.ts +0 -87
- package/src/transports/http/server/stateful.ts +0 -222
- package/src/transports/http/server/stateless.ts +0 -42
- package/src/transports/http/types.ts +0 -132
- package/src/types/entities.ts +0 -145
- package/src/types/error-types.ts +0 -92
- package/src/types/errors.ts +0 -200
- package/src/types/filtering.ts +0 -55
- package/src/types/github.ts +0 -216
- package/src/types/index.ts +0 -348
- package/src/utils/error-helpers.ts +0 -78
- package/src/utils/errors/error-response-fields.ts +0 -29
- package/src/utils/errors/suggestions.ts +0 -94
- package/src/utils/github-helpers.ts +0 -33
- package/src/utils/logger.ts +0 -107
- package/src/utils/mcp-logger.ts +0 -155
- package/src/utils/progress-utils.ts +0 -100
- package/src/utils/query-helpers.ts +0 -78
- package/src/utils/resource-annotations.ts +0 -75
- package/src/utils/security-utils.ts +0 -198
- package/src/utils/vector-index-helpers.ts +0 -24
- package/src/vector/vector-search-manager.ts +0 -409
- package/src/version.ts +0 -15
- package/test-server/README.md +0 -193
- package/test-server/code-map.md +0 -399
- package/test-server/test-agent-experience.md +0 -213
- package/test-server/test-filter-instructions.mjs +0 -295
- package/test-server/test-instruction-levels.mjs +0 -102
- package/test-server/test-preflight.md +0 -55
- package/test-server/test-prompts.mjs +0 -185
- package/test-server/test-scheduler.mjs +0 -174
- package/test-server/test-tool-annotations.mjs +0 -115
- package/test-server/test-tools-codemode.md +0 -632
- package/test-server/test-tools-codemode2.md +0 -1218
- package/test-server/test-tools-team.md +0 -215
- package/test-server/test-tools.md +0 -429
- package/test-server/test-tools2.md +0 -361
- package/test-server/test-tools3.md +0 -396
- package/test-server/tool-reference.md +0 -231
- package/tests/README.md +0 -54
- package/tests/auth/auth-context.test.ts +0 -162
- package/tests/auth/authorization-server-discovery.test.ts +0 -265
- package/tests/auth/errors.test.ts +0 -170
- package/tests/auth/middleware.test.ts +0 -585
- package/tests/auth/oauth-resource-server.test.ts +0 -173
- package/tests/auth/scope-map.test.ts +0 -66
- package/tests/auth/scopes.test.ts +0 -347
- package/tests/auth/token-validator.test.ts +0 -271
- package/tests/codemode/api.test.ts +0 -396
- package/tests/codemode/auto-return.test.ts +0 -167
- package/tests/codemode/codemode-tool-handlers.test.ts +0 -197
- package/tests/codemode/sandbox-factory.test.ts +0 -152
- package/tests/codemode/sandbox.test.ts +0 -190
- package/tests/codemode/security.test.ts +0 -242
- package/tests/codemode/worker-sandbox.test.ts +0 -106
- package/tests/constants/icons.test.ts +0 -101
- package/tests/constants/server-instructions.test.ts +0 -514
- package/tests/database/crud-workflow-branches.test.ts +0 -418
- package/tests/database/database-branches.test.ts +0 -132
- package/tests/database/entries-auth-branches.test.ts +0 -390
- package/tests/database/native-connection.test.ts +0 -249
- package/tests/database/shared-helpers.test.ts +0 -103
- package/tests/database/sqlite-adapter.bench.ts +0 -63
- package/tests/database/sqlite-adapter.test.ts +0 -690
- package/tests/database/tags.test.ts +0 -134
- package/tests/e2e/README.md +0 -39
- package/tests/e2e/auth.spec.ts +0 -106
- package/tests/e2e/codemode-abuse.spec.ts +0 -75
- package/tests/e2e/health.spec.ts +0 -63
- package/tests/e2e/helpers.ts +0 -139
- package/tests/e2e/oauth-discovery.spec.ts +0 -102
- package/tests/e2e/oauth-scopes.spec.ts +0 -222
- package/tests/e2e/payloads-admin.spec.ts +0 -76
- package/tests/e2e/payloads-analytics.spec.ts +0 -37
- package/tests/e2e/payloads-backup-restore.spec.ts +0 -102
- package/tests/e2e/payloads-backup.spec.ts +0 -44
- package/tests/e2e/payloads-codemode-api.spec.ts +0 -131
- package/tests/e2e/payloads-codemode-readonly.spec.ts +0 -116
- package/tests/e2e/payloads-codemode.spec.ts +0 -116
- package/tests/e2e/payloads-core.spec.ts +0 -82
- package/tests/e2e/payloads-error-contracts.spec.ts +0 -159
- package/tests/e2e/payloads-export.spec.ts +0 -46
- package/tests/e2e/payloads-github-degradation.spec.ts +0 -73
- package/tests/e2e/payloads-github.spec.ts +0 -176
- package/tests/e2e/payloads-relationships.spec.ts +0 -56
- package/tests/e2e/payloads-search.spec.ts +0 -64
- package/tests/e2e/payloads-team-happy.spec.ts +0 -231
- package/tests/e2e/payloads-team.spec.ts +0 -174
- package/tests/e2e/prompts-expanded.spec.ts +0 -137
- package/tests/e2e/prompts.spec.ts +0 -62
- package/tests/e2e/protocols.spec.ts +0 -134
- package/tests/e2e/rate-limiting.spec.ts +0 -291
- package/tests/e2e/resources-briefing-env.spec.ts +0 -106
- package/tests/e2e/resources-complete.spec.ts +0 -180
- package/tests/e2e/resources-expanded.spec.ts +0 -83
- package/tests/e2e/resources-instructions-levels.spec.ts +0 -145
- package/tests/e2e/resources-templates.spec.ts +0 -123
- package/tests/e2e/resources.spec.ts +0 -103
- package/tests/e2e/scheduler.spec.ts +0 -79
- package/tests/e2e/security.spec.ts +0 -112
- package/tests/e2e/session-advanced.spec.ts +0 -152
- package/tests/e2e/sessions.spec.ts +0 -95
- package/tests/e2e/stateless.spec.ts +0 -79
- package/tests/e2e/streaming.spec.ts +0 -176
- package/tests/e2e/tool-filtering-presets.spec.ts +0 -192
- package/tests/e2e/tool-filtering.spec.ts +0 -77
- package/tests/e2e/tools.spec.ts +0 -111
- package/tests/filtering/tool-filter.test.ts +0 -314
- package/tests/github/client-issues-errors.test.ts +0 -433
- package/tests/github/github-integration-branches.test.ts +0 -490
- package/tests/github/github-integration.test.ts +0 -1015
- package/tests/github/github-managers-branches.test.ts +0 -907
- package/tests/github/pull-requests.test.ts +0 -334
- package/tests/handlers/analytics-branches.test.ts +0 -222
- package/tests/handlers/backup-branches.test.ts +0 -270
- package/tests/handlers/briefing-context-section.test.ts +0 -388
- package/tests/handlers/briefing-github-section.test.ts +0 -392
- package/tests/handlers/briefing-user-message.test.ts +0 -405
- package/tests/handlers/codemode-tools.test.ts +0 -85
- package/tests/handlers/copilot-tools.test.ts +0 -126
- package/tests/handlers/error-path-coverage.test.ts +0 -324
- package/tests/handlers/export-tools.test.ts +0 -203
- package/tests/handlers/github-resource-handlers.test.ts +0 -929
- package/tests/handlers/github-tool-handlers.test.ts +0 -1452
- package/tests/handlers/handler-error-branches.test.ts +0 -346
- package/tests/handlers/help-resource.test.ts +0 -92
- package/tests/handlers/prompt-handler-coverage.test.ts +0 -108
- package/tests/handlers/prompt-handlers.test.ts +0 -131
- package/tests/handlers/resource-handler-coverage.test.ts +0 -281
- package/tests/handlers/resource-handlers.test.ts +0 -357
- package/tests/handlers/resource-prompt-branches.test.ts +0 -495
- package/tests/handlers/search-tool-handlers.test.ts +0 -379
- package/tests/handlers/targeted-gap-closure.test.ts +0 -387
- package/tests/handlers/team-admin.test.ts +0 -291
- package/tests/handlers/team-analytics.test.ts +0 -220
- package/tests/handlers/team-core.test.ts +0 -148
- package/tests/handlers/team-data.test.ts +0 -198
- package/tests/handlers/team-relationships.test.ts +0 -271
- package/tests/handlers/team-resource-handlers.test.ts +0 -161
- package/tests/handlers/team-search.test.ts +0 -134
- package/tests/handlers/team-tool-handlers.test.ts +0 -301
- package/tests/handlers/team-vector.test.ts +0 -213
- package/tests/handlers/template-github-branches.test.ts +0 -676
- package/tests/handlers/tool-annotations.test.ts +0 -90
- package/tests/handlers/tool-handler-coverage.test.ts +0 -514
- package/tests/handlers/tool-handlers.test.ts +0 -510
- package/tests/handlers/tool-output-schemas.test.ts +0 -116
- package/tests/handlers/vector-tool-handlers.test.ts +0 -238
- package/tests/security/sql-injection.test.ts +0 -284
- package/tests/server/mcp-server.bench.ts +0 -55
- package/tests/server/mcp-server.test.ts +0 -1326
- package/tests/server/scheduler.test.ts +0 -400
- package/tests/transports/http-legacy-sse.test.ts +0 -275
- package/tests/transports/http-security.test.ts +0 -322
- package/tests/transports/http-stateful.test.ts +0 -487
- package/tests/transports/http-transport-server.test.ts +0 -301
- package/tests/transports/http-transport.test.ts +0 -771
- package/tests/utils/github-helpers.test.ts +0 -58
- package/tests/utils/logger.test.ts +0 -180
- package/tests/utils/mcp-logger.test.ts +0 -211
- package/tests/utils/progress-utils.test.ts +0 -156
- package/tests/utils/query-helpers.test.ts +0 -80
- package/tests/utils/security-utils.test.ts +0 -82
- package/tests/vector/vector-search-branches.test.ts +0 -111
- package/tests/vector/vector-search-manager.test.ts +0 -375
- package/tests/vector/vector-search.bench.ts +0 -48
- package/tsconfig.json +0 -42
- package/tsup.config.ts +0 -19
- package/vitest.config.ts +0 -25
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Code Quality Audit
|
|
2
|
+
|
|
3
|
+
Run a comprehensive code quality audit as a static analysis pass. No code
|
|
4
|
+
changes are made until the human approves the findings.
|
|
5
|
+
|
|
6
|
+
## Prompt
|
|
7
|
+
|
|
8
|
+
Perform a comprehensive code quality audit of the target project. For each
|
|
9
|
+
finding, report the file path, line range, severity (critical / moderate / low),
|
|
10
|
+
and a concrete fix suggestion. Group findings by category:
|
|
11
|
+
|
|
12
|
+
1. **Dead & unreachable code** — unused exports, unreachable branches, vestigial
|
|
13
|
+
feature flags
|
|
14
|
+
2. **Duplication** — repeated logic that should be extracted into shared helpers
|
|
15
|
+
3. **Import hygiene** — unused imports, missing imports, circular dependencies
|
|
16
|
+
4. **Type safety** — `any` usage, loose type assertions (`as`), missing return
|
|
17
|
+
types on exported functions
|
|
18
|
+
5. **Error handling** — typed error classes with descriptive messages including
|
|
19
|
+
context. Propagate with stack traces; never silently swallow exceptions
|
|
20
|
+
6. **Logging** — centralized logger with structured payloads. Module-prefixed
|
|
21
|
+
codes. Severity: error | warning | info
|
|
22
|
+
7. **Complexity** — functions exceeding ~40 lines, files exceeding ~500 lines,
|
|
23
|
+
high branching depth. Large files should be split into subdirectories with
|
|
24
|
+
barrel re-exports
|
|
25
|
+
8. **Naming & consistency** — files/folders should follow project conventions.
|
|
26
|
+
Flag unclear variable names and inconsistent naming
|
|
27
|
+
9. **Magic values** — hardcoded strings, numbers, or timeouts that should be
|
|
28
|
+
named constants
|
|
29
|
+
10. **Stale markers** — TODO, FIXME, HACK, XXX comments; outdated JSDoc;
|
|
30
|
+
comments that contradict the code
|
|
31
|
+
11. **Security** — unsanitized input, missing validation, overly permissive
|
|
32
|
+
schemas
|
|
33
|
+
12. **Performance** — unnecessary allocations in hot paths, missing early
|
|
34
|
+
returns, redundant queries
|
|
35
|
+
13. **Dependency hygiene** — unused dependencies, unlisted peer dependencies
|
|
36
|
+
14. **Accessibility** — if any UI/HTML output exists, verify proper labeling,
|
|
37
|
+
semantic structure, keyboard operability, contrast, and ARIA attributes
|
|
38
|
+
|
|
39
|
+
## Execution
|
|
40
|
+
|
|
41
|
+
1. Scan the project source directory systematically
|
|
42
|
+
2. Journal each finding:
|
|
43
|
+
```
|
|
44
|
+
create_entry({
|
|
45
|
+
content: "Code quality finding: [<category>] <severity> — <description>. File: <path>:<lines>.",
|
|
46
|
+
entry_type: "audit_finding",
|
|
47
|
+
tags: ["commander", "code-quality", "<category>"],
|
|
48
|
+
})
|
|
49
|
+
```
|
|
50
|
+
3. Produce a summary table:
|
|
51
|
+
| Category | Findings | Critical | Moderate | Low |
|
|
52
|
+
|---|---|---|---|---|
|
|
53
|
+
4. Assign an overall quality score (A–F)
|
|
54
|
+
|
|
55
|
+
## HITL Checkpoint
|
|
56
|
+
|
|
57
|
+
Present findings to the human:
|
|
58
|
+
|
|
59
|
+
- Summary table with counts per category
|
|
60
|
+
- Overall quality score
|
|
61
|
+
- Top critical findings with fix suggestions
|
|
62
|
+
|
|
63
|
+
Wait for approval before applying any fixes.
|
|
64
|
+
|
|
65
|
+
## Apply Fixes
|
|
66
|
+
|
|
67
|
+
After human approval:
|
|
68
|
+
|
|
69
|
+
1. Fix critical issues first, then moderate, then low
|
|
70
|
+
2. Run validation gates after all fixes:
|
|
71
|
+
- Gate 1: Lint + Typecheck
|
|
72
|
+
- Gate 2: Build
|
|
73
|
+
- Gate 3: Tests
|
|
74
|
+
3. Update changelog with audit fixes
|
|
75
|
+
4. Commit with descriptive message:
|
|
76
|
+
```bash
|
|
77
|
+
git add <fixed files> <changelog>
|
|
78
|
+
git diff --cached --stat
|
|
79
|
+
git commit -m "chore: code quality audit fixes"
|
|
80
|
+
```
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Full Audit
|
|
2
|
+
|
|
3
|
+
Run a unified code quality + performance + security audit in a single pass with
|
|
4
|
+
cross-reference analysis. Use for codebases that are already in good shape.
|
|
5
|
+
|
|
6
|
+
> **When to use**: For established codebases that have likely passed individual
|
|
7
|
+
> audits before. This prevents the "fix cascade" where a security fix introduces
|
|
8
|
+
> a quality regression, or a performance optimization weakens validation.
|
|
9
|
+
|
|
10
|
+
> **Do not use for**: First-time audits on codebases with many known issues.
|
|
11
|
+
> Run the individual workflows (`code-quality-audit.md`, `perf-audit.md`,
|
|
12
|
+
> `security-audit.md`) separately and fix iteratively instead.
|
|
13
|
+
|
|
14
|
+
## Phase 1 — Collect Findings (Read-Only)
|
|
15
|
+
|
|
16
|
+
Run all three audits as **read-only analysis** — no fixes yet. Tag each finding
|
|
17
|
+
by its source domain.
|
|
18
|
+
|
|
19
|
+
### 1a. Code Quality Scan
|
|
20
|
+
|
|
21
|
+
Follow `code-quality-audit.md` categories 1–14. Tag every finding with `[CQ]`.
|
|
22
|
+
|
|
23
|
+
### 1b. Performance Scan
|
|
24
|
+
|
|
25
|
+
Follow `perf-audit.md` sections 1–6. Tag every finding with `[PERF]`.
|
|
26
|
+
|
|
27
|
+
### 1c. Security Scan
|
|
28
|
+
|
|
29
|
+
Follow `security-audit.md` phases 2–7. Tag every finding with `[SEC]`.
|
|
30
|
+
|
|
31
|
+
### 1d. Raw Findings Ledger
|
|
32
|
+
|
|
33
|
+
Produce **one** consolidated table sorted by severity:
|
|
34
|
+
|
|
35
|
+
| # | Tag | Severity | File | Lines | Finding | Suggested Fix |
|
|
36
|
+
| --- | --- | -------- | ---- | ----- | ------- | ------------- |
|
|
37
|
+
|
|
38
|
+
**Do not apply any fixes yet.**
|
|
39
|
+
|
|
40
|
+
## Phase 2 — Cross-Reference Analysis
|
|
41
|
+
|
|
42
|
+
Review the raw ledger and identify findings that interact across domains.
|
|
43
|
+
|
|
44
|
+
### Conflict Types
|
|
45
|
+
|
|
46
|
+
| Type | Example |
|
|
47
|
+
| -------------------------- | ------------------------------------------------------------------------------- |
|
|
48
|
+
| **Security ↔ Quality** | A `[SEC]` fix (adding validation) could introduce duplication flagged by `[CQ]` |
|
|
49
|
+
| **Security ↔ Performance** | A `[SEC]` fix (parameterized queries, hashing) could degrade `[PERF]` |
|
|
50
|
+
| **Performance ↔ Quality** | A `[PERF]` fix (inlining, caching) could increase complexity flagged by `[CQ]` |
|
|
51
|
+
| **Performance ↔ Security** | A `[PERF]` fix (caching, skipping validation) could weaken a `[SEC]` boundary |
|
|
52
|
+
| **Shared Root Cause** | Multiple findings trace to the same underlying issue |
|
|
53
|
+
| **Fix Dependency** | One finding must be fixed before another |
|
|
54
|
+
|
|
55
|
+
### Cross-Reference Table
|
|
56
|
+
|
|
57
|
+
| Linked Findings | Conflict Type | Resolution Strategy |
|
|
58
|
+
| --------------- | ------------- | ------------------- |
|
|
59
|
+
|
|
60
|
+
If no cross-references are found, state that explicitly.
|
|
61
|
+
|
|
62
|
+
## Phase 3 — Prioritized Fix Plan
|
|
63
|
+
|
|
64
|
+
Produce an **ordered fix plan** that avoids cascading regressions:
|
|
65
|
+
|
|
66
|
+
### Ordering Rules
|
|
67
|
+
|
|
68
|
+
1. **Shared root causes first** — a single fix resolves multiple findings
|
|
69
|
+
2. **Fix dependencies next** — structural changes that unblock later fixes
|
|
70
|
+
3. **Security-critical** — critical/high `[SEC]` findings
|
|
71
|
+
4. **Cross-referenced fixes** — unified resolution strategies from Phase 2
|
|
72
|
+
5. **Remaining findings** — in severity order
|
|
73
|
+
|
|
74
|
+
### Fix Plan Table
|
|
75
|
+
|
|
76
|
+
| Order | Finding(s) | Fix Description | Domains Resolved |
|
|
77
|
+
| ----- | ---------- | --------------- | ---------------- |
|
|
78
|
+
|
|
79
|
+
## HITL Gate — User Approval
|
|
80
|
+
|
|
81
|
+
**Stop here.** Present the Phase 2 cross-reference analysis and Phase 3 fix
|
|
82
|
+
plan to the human for review. Do not proceed until explicitly approved.
|
|
83
|
+
|
|
84
|
+
Journal the audit state:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
create_entry({
|
|
88
|
+
content: "Full audit complete. Findings: <N total> (<CQ count> CQ, <PERF count> PERF, <SEC count> SEC). Cross-references: <N>. Awaiting approval for fix plan.",
|
|
89
|
+
entry_type: "audit_finding",
|
|
90
|
+
tags: ["commander", "full-audit", "summary"],
|
|
91
|
+
})
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Phase 4 — Apply Fixes & Verify
|
|
95
|
+
|
|
96
|
+
Apply fixes in the approved order. After **all** fixes:
|
|
97
|
+
|
|
98
|
+
Run validation gates:
|
|
99
|
+
|
|
100
|
+
- Gate 1: Lint + Typecheck
|
|
101
|
+
- Gate 2: Build
|
|
102
|
+
- Gate 3: Tests
|
|
103
|
+
|
|
104
|
+
If any validation fails, identify which fix group caused it and revise.
|
|
105
|
+
|
|
106
|
+
## Phase 5 — Final Report
|
|
107
|
+
|
|
108
|
+
### Summary Table
|
|
109
|
+
|
|
110
|
+
| Domain | Score (A–F) | Findings | Critical | Cross-Referenced |
|
|
111
|
+
| ------------ | ----------- | -------- | -------- | ---------------- |
|
|
112
|
+
| Code Quality | | | | |
|
|
113
|
+
| Performance | | | | |
|
|
114
|
+
| Security | | | | |
|
|
115
|
+
|
|
116
|
+
### Metrics
|
|
117
|
+
|
|
118
|
+
- **Total findings**: _N_
|
|
119
|
+
- **Cross-referenced findings**: _N_
|
|
120
|
+
- **Cascading fixes avoided**: _N_
|
|
121
|
+
|
|
122
|
+
### Overall Score
|
|
123
|
+
|
|
124
|
+
Assign an **overall health score (A–F)** considering all three domains.
|
|
125
|
+
|
|
126
|
+
## Post-Audit
|
|
127
|
+
|
|
128
|
+
1. Update changelog with fixes
|
|
129
|
+
2. Commit:
|
|
130
|
+
```bash
|
|
131
|
+
git add <fixed files> <changelog>
|
|
132
|
+
git diff --cached --stat
|
|
133
|
+
git commit -m "chore: unified audit fixes"
|
|
134
|
+
```
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
# Issue Triage
|
|
2
|
+
|
|
3
|
+
Fix a single assigned GitHub issue end-to-end — from context gathering through
|
|
4
|
+
validated PR submission.
|
|
5
|
+
|
|
6
|
+
## Phase 1 — Gather Context
|
|
7
|
+
|
|
8
|
+
1. Read `memory://briefing` for session context
|
|
9
|
+
2. Fetch the assigned issue:
|
|
10
|
+
```
|
|
11
|
+
get_github_issue({ issue_number: <N> })
|
|
12
|
+
```
|
|
13
|
+
3. Search journal for related prior work:
|
|
14
|
+
```
|
|
15
|
+
semantic_search({ query: "<issue title/description>" })
|
|
16
|
+
search_entries({ tags: ["commander"] })
|
|
17
|
+
```
|
|
18
|
+
4. Check knowledge graph for linked specs/implementations:
|
|
19
|
+
```
|
|
20
|
+
visualize_relationships({ format: "mermaid" })
|
|
21
|
+
```
|
|
22
|
+
5. Journal the triage start:
|
|
23
|
+
```
|
|
24
|
+
create_entry({
|
|
25
|
+
content: "Triaging issue #<N>: <title>. Related entries: <ids>. Prior context: <summary>.",
|
|
26
|
+
entry_type: "triage",
|
|
27
|
+
tags: ["commander", "triage"],
|
|
28
|
+
issue_number: <N>
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Phase 2 — Implement Fix
|
|
33
|
+
|
|
34
|
+
1. Analyze the issue and implement the fix
|
|
35
|
+
2. Follow existing project conventions (check journal for patterns, rules, etc.)
|
|
36
|
+
3. Journal the implementation:
|
|
37
|
+
```
|
|
38
|
+
create_entry({
|
|
39
|
+
content: "Implemented fix for #<N>: <description of changes>. Files modified: <list>.",
|
|
40
|
+
entry_type: "implementation",
|
|
41
|
+
tags: ["commander", "fix"],
|
|
42
|
+
issue_number: <N>
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Phase 3 — Validation Gates
|
|
47
|
+
|
|
48
|
+
Run gates sequentially. Each must pass before the next. Skip gates where the
|
|
49
|
+
command is empty or not configured.
|
|
50
|
+
|
|
51
|
+
### Gate 1: Lint + Typecheck
|
|
52
|
+
|
|
53
|
+
Run `PROJECT_LINT_CMD` (default: `npm run lint`).
|
|
54
|
+
Run `PROJECT_TYPECHECK_CMD` (default: `npm run typecheck`).
|
|
55
|
+
|
|
56
|
+
On failure:
|
|
57
|
+
|
|
58
|
+
- Attempt auto-fix (run lint with `--fix` if available)
|
|
59
|
+
- Re-run the gate
|
|
60
|
+
- If still failing after 2 attempts → **HITL checkpoint**
|
|
61
|
+
|
|
62
|
+
Journal result:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
create_entry({
|
|
66
|
+
content: "Gate 1 (Lint + Typecheck): PASSED/FAILED. Details: <output>.",
|
|
67
|
+
entry_type: "gate_pass" or "gate_fail",
|
|
68
|
+
tags: ["commander", "validation", "lint"],
|
|
69
|
+
issue_number: <N>
|
|
70
|
+
})
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Gate 2: Build
|
|
74
|
+
|
|
75
|
+
Run `PROJECT_BUILD_CMD` (default: `npm run build`).
|
|
76
|
+
Skip if not configured (empty string).
|
|
77
|
+
|
|
78
|
+
On failure → attempt fix → **HITL checkpoint** after 2 attempts.
|
|
79
|
+
|
|
80
|
+
### Gate 3: Unit/Integration Tests
|
|
81
|
+
|
|
82
|
+
Run `PROJECT_TEST_CMD` (default: `npm run test`).
|
|
83
|
+
|
|
84
|
+
On failure:
|
|
85
|
+
|
|
86
|
+
- Analyze test output to determine if failure is related to the fix
|
|
87
|
+
- If related: attempt to fix the test or the code
|
|
88
|
+
- If unrelated (pre-existing failure): journal and flag for human
|
|
89
|
+
- After 2 fix attempts → **HITL checkpoint**
|
|
90
|
+
|
|
91
|
+
### Gate 4: E2E Tests
|
|
92
|
+
|
|
93
|
+
Run `PROJECT_E2E_CMD` (default: empty = skip).
|
|
94
|
+
Skip if not configured. Same failure handling as Gate 3.
|
|
95
|
+
|
|
96
|
+
### Gate 5: Security Scans
|
|
97
|
+
|
|
98
|
+
Run auto-detected security scanning tools (see SKILL.md § Security Tool
|
|
99
|
+
Auto-Detection). For each available tool:
|
|
100
|
+
|
|
101
|
+
1. Run the scan
|
|
102
|
+
2. Parse output for findings with severity levels
|
|
103
|
+
3. Journal each finding:
|
|
104
|
+
```
|
|
105
|
+
create_entry({
|
|
106
|
+
content: "Security finding (<tool>): <severity> - <description>",
|
|
107
|
+
entry_type: "security_finding",
|
|
108
|
+
tags: ["commander", "security", "<tool-name>"],
|
|
109
|
+
issue_number: <N>
|
|
110
|
+
})
|
|
111
|
+
```
|
|
112
|
+
4. **Critical/High findings → HITL checkpoint** (present findings, ask how to proceed)
|
|
113
|
+
5. Missing tools → skip with journal note:
|
|
114
|
+
```
|
|
115
|
+
create_entry({
|
|
116
|
+
content: "Security scan: <tool> not available — skipped.",
|
|
117
|
+
entry_type: "gate_pass",
|
|
118
|
+
tags: ["commander", "validation", "security-skip"],
|
|
119
|
+
issue_number: <N>
|
|
120
|
+
})
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
#### npm audit
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm audit --json
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Parse JSON output. Report vulnerabilities by severity.
|
|
130
|
+
|
|
131
|
+
#### CodeQL (if available)
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
codeql database create /tmp/codeql-db --language=javascript --overwrite
|
|
135
|
+
codeql database analyze /tmp/codeql-db --format=sarif-latest --output=/tmp/codeql-results.sarif
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Or via GitHub Actions (if running in CI context).
|
|
139
|
+
|
|
140
|
+
#### Trivy (if available)
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
trivy fs --severity HIGH,CRITICAL --format json .
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
For Docker projects (`PROJECT_HAS_DOCKERFILE=true`):
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
trivy image --severity HIGH,CRITICAL --format json <image-name>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
#### Docker Scout (if available)
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
docker scout cves <image-name> --format json --only-severity critical,high
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
#### Gitleaks (if available)
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
gitleaks detect --source . --report-format json --report-path /tmp/gitleaks.json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
#### TruffleHog (if available)
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
trufflehog filesystem . --json --only-verified
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Phase 4 — Human Checkpoint
|
|
171
|
+
|
|
172
|
+
**Always pause before submitting a PR.** Present to the human:
|
|
173
|
+
|
|
174
|
+
1. Summary of changes (files modified, lines added/removed)
|
|
175
|
+
2. All gate results (pass/fail with details)
|
|
176
|
+
3. Any security findings
|
|
177
|
+
4. All journal entries created during this workflow
|
|
178
|
+
|
|
179
|
+
**Additional HITL triggers** (pause earlier if any apply):
|
|
180
|
+
|
|
181
|
+
- Changes touch more files than `COMMANDER_HITL_FILE_THRESHOLD` (default: 10)
|
|
182
|
+
- Any critical or high security findings
|
|
183
|
+
- Test failures that couldn't be auto-fixed
|
|
184
|
+
|
|
185
|
+
Wait for human approval before proceeding to Phase 5.
|
|
186
|
+
|
|
187
|
+
## Phase 5 — Submit PR
|
|
188
|
+
|
|
189
|
+
1. Create a feature branch:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
git checkout -b <COMMANDER_BRANCH_PREFIX>/issue-<N>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
2. Stage changed files selectively (**never `git add -A`**):
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
git add <file1> <file2> ...
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
3. Verify staged files:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
git diff --cached --stat
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
4. Commit with descriptive message:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
git commit -m "fix: <description> (closes #<N>)"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
5. Push and create PR:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
git push origin <COMMANDER_BRANCH_PREFIX>/issue-<N>
|
|
217
|
+
gh pr create --base main --title "fix: <description>" --body "Closes #<N>\n\n<summary of changes>"
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
6. Journal the PR:
|
|
221
|
+
```
|
|
222
|
+
create_entry({
|
|
223
|
+
content: "Submitted PR #<pr_number> for issue #<N>: <description>. Gates: all passed.",
|
|
224
|
+
entry_type: "pr_submitted",
|
|
225
|
+
tags: ["commander", "pr"],
|
|
226
|
+
issue_number: <N>,
|
|
227
|
+
pr_number: <pr_number>
|
|
228
|
+
})
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Phase 6 — Session Summary
|
|
232
|
+
|
|
233
|
+
Run `/session-summary` to capture:
|
|
234
|
+
|
|
235
|
+
- Issue triaged and fixed
|
|
236
|
+
- All gate results
|
|
237
|
+
- Security findings (if any)
|
|
238
|
+
- PR link and status
|
|
239
|
+
- Any pending items for next session
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Milestone Sprint
|
|
2
|
+
|
|
3
|
+
Work through open issues in a GitHub milestone sequentially, applying the
|
|
4
|
+
issue-triage workflow to each.
|
|
5
|
+
|
|
6
|
+
## Phase 1 — Load Milestone
|
|
7
|
+
|
|
8
|
+
1. Read `memory://briefing` for session context
|
|
9
|
+
2. Fetch milestone details:
|
|
10
|
+
```
|
|
11
|
+
get_github_milestone({ milestone_number: <N> })
|
|
12
|
+
```
|
|
13
|
+
3. List open issues in the milestone, sorted by priority labels:
|
|
14
|
+
```
|
|
15
|
+
get_github_issues({ milestone: <N>, state: "open" })
|
|
16
|
+
```
|
|
17
|
+
4. Journal sprint start:
|
|
18
|
+
```
|
|
19
|
+
create_entry({
|
|
20
|
+
content: "Starting milestone sprint: <title>. Open issues: <count>. Completion: <percent>%.",
|
|
21
|
+
entry_type: "milestone_sprint_start",
|
|
22
|
+
tags: ["commander", "milestone"],
|
|
23
|
+
})
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Phase 2 — Triage Issues
|
|
27
|
+
|
|
28
|
+
For each open issue in the milestone (in priority order):
|
|
29
|
+
|
|
30
|
+
1. **HITL checkpoint**: Present the next issue to the human:
|
|
31
|
+
- Issue number, title, labels
|
|
32
|
+
- Estimated complexity (based on description and labels)
|
|
33
|
+
- Ask: "Proceed with this issue?" / "Skip?" / "Stop sprint?"
|
|
34
|
+
|
|
35
|
+
2. If human approves: run the full **issue-triage.md** workflow for this issue
|
|
36
|
+
|
|
37
|
+
3. After each issue is complete, update the sprint progress:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
get_github_milestone({ milestone_number: <N> })
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Report updated completion percentage.
|
|
44
|
+
|
|
45
|
+
4. Repeat for next issue until:
|
|
46
|
+
- All issues are complete
|
|
47
|
+
- Human chooses to stop
|
|
48
|
+
- Session time/token limits are approached
|
|
49
|
+
|
|
50
|
+
## Phase 3 — Sprint Summary
|
|
51
|
+
|
|
52
|
+
After all issues are processed (or sprint is stopped):
|
|
53
|
+
|
|
54
|
+
1. Aggregate results across all triaged issues:
|
|
55
|
+
- Issues attempted vs. completed
|
|
56
|
+
- Gate results summary (total passes/fails)
|
|
57
|
+
- Security findings across all issues
|
|
58
|
+
- PRs submitted
|
|
59
|
+
|
|
60
|
+
2. Report milestone delta:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
get_github_milestone({ milestone_number: <N> })
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Show completion percentage before and after sprint.
|
|
67
|
+
|
|
68
|
+
3. Journal sprint summary:
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
create_entry({
|
|
72
|
+
content: "Milestone sprint complete: <title>. Issues fixed: <N>/<total>. Milestone: <before>% → <after>%. PRs: <list>.",
|
|
73
|
+
entry_type: "milestone_sprint_start",
|
|
74
|
+
tags: ["commander", "milestone", "summary"],
|
|
75
|
+
})
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
4. Run `/session-summary` with:
|
|
79
|
+
- All issues triaged in this sprint
|
|
80
|
+
- Remaining issues for next session
|
|
81
|
+
- Any blockers or findings requiring human attention
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# Performance Audit
|
|
2
|
+
|
|
3
|
+
Run a comprehensive performance audit covering build times, bundle size, runtime
|
|
4
|
+
patterns, test suite speed, and database/IO efficiency.
|
|
5
|
+
|
|
6
|
+
## 1. Build Performance
|
|
7
|
+
|
|
8
|
+
Measure compilation speed and identify bottlenecks.
|
|
9
|
+
|
|
10
|
+
For TypeScript projects:
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx tsc --noEmit --diagnostics
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
If a bundler is configured, also run `PROJECT_BUILD_CMD` and report build time.
|
|
17
|
+
|
|
18
|
+
Report:
|
|
19
|
+
|
|
20
|
+
- Total compilation time
|
|
21
|
+
- Files compiled, lines of code
|
|
22
|
+
- Memory usage
|
|
23
|
+
- Any abnormally slow type-resolution (deep generics, circular types)
|
|
24
|
+
|
|
25
|
+
## 2. Bundle & Output Analysis
|
|
26
|
+
|
|
27
|
+
Analyze the compiled output for size and optimization opportunities:
|
|
28
|
+
|
|
29
|
+
- Count total output files and aggregate size
|
|
30
|
+
- Identify the largest output files (top 5 by size)
|
|
31
|
+
- Check for accidental bundling of dev dependencies or test fixtures
|
|
32
|
+
- Flag output files that include source maps in production builds
|
|
33
|
+
|
|
34
|
+
For frontend projects, additionally check:
|
|
35
|
+
|
|
36
|
+
- Code-splitting effectiveness
|
|
37
|
+
- Asset optimization (images, fonts, CSS)
|
|
38
|
+
- Tree-shaking gaps
|
|
39
|
+
|
|
40
|
+
## 3. Dependency Weight
|
|
41
|
+
|
|
42
|
+
Audit dependency footprint:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# npm
|
|
46
|
+
npm ls --all --prod 2>/dev/null | tail -1
|
|
47
|
+
|
|
48
|
+
# yarn
|
|
49
|
+
yarn list --prod
|
|
50
|
+
|
|
51
|
+
# pnpm
|
|
52
|
+
pnpm list --prod
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Report:
|
|
56
|
+
|
|
57
|
+
- Total production dependency count (direct + transitive)
|
|
58
|
+
- Top 5 heaviest dependencies
|
|
59
|
+
- Duplicate packages (different versions of same dep)
|
|
60
|
+
- Dependencies replaceable with lighter alternatives
|
|
61
|
+
- devDependencies accidentally listed in dependencies
|
|
62
|
+
|
|
63
|
+
## 4. Runtime Performance
|
|
64
|
+
|
|
65
|
+
Static analysis pass for runtime performance issues:
|
|
66
|
+
|
|
67
|
+
- **Hot-path allocations** — object/array creation inside tight loops, repeated
|
|
68
|
+
`JSON.parse`/`JSON.stringify`, unnecessary spread in iteration
|
|
69
|
+
- **Missing early returns** — expensive work before guard conditions
|
|
70
|
+
- **Redundant computation** — values computed multiple times when cacheable
|
|
71
|
+
- **Blocking operations** — synchronous I/O, CPU-intensive loops without
|
|
72
|
+
yielding, serial `await` where parallel is safe
|
|
73
|
+
- **Memory leaks** — event listeners not cleaned up, growing collections
|
|
74
|
+
without eviction, closures capturing large scopes
|
|
75
|
+
- **Startup cost** — heavy top-level initialization, eager loading of
|
|
76
|
+
rarely-used modules
|
|
77
|
+
|
|
78
|
+
## 5. Test Suite Performance
|
|
79
|
+
|
|
80
|
+
Run tests with verbose output:
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
<PROJECT_TEST_CMD> -- --reporter=verbose
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Report:
|
|
87
|
+
|
|
88
|
+
- Total suite duration
|
|
89
|
+
- Top 5 slowest test files
|
|
90
|
+
- Top 5 slowest individual tests
|
|
91
|
+
- Tests doing real I/O without mocking
|
|
92
|
+
- Parallelization opportunities
|
|
93
|
+
|
|
94
|
+
## 6. Database & I/O Performance
|
|
95
|
+
|
|
96
|
+
If the project interacts with databases or performs significant I/O:
|
|
97
|
+
|
|
98
|
+
- **Query patterns** — N+1 queries, missing indexes, unbounded queries,
|
|
99
|
+
sequential queries that could be batched
|
|
100
|
+
- **Connection management** — pool sizing, connection leak risks, missing
|
|
101
|
+
timeouts
|
|
102
|
+
- **Caching** — repeated identical queries without caching, stale TTLs
|
|
103
|
+
- **Serialization** — excessive object transformation between layers
|
|
104
|
+
|
|
105
|
+
## Findings Report
|
|
106
|
+
|
|
107
|
+
Journal each finding:
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
create_entry({
|
|
111
|
+
content: "Performance finding: <severity> — <description>. File: <path>:<lines>. Expected improvement: <estimate>.",
|
|
112
|
+
entry_type: "audit_finding",
|
|
113
|
+
tags: ["commander", "performance", "<category>"],
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Produce a structured summary:
|
|
118
|
+
|
|
119
|
+
| Category | Score (A–F) | Findings | Critical |
|
|
120
|
+
| ------------------- | ----------- | -------- | -------- |
|
|
121
|
+
| Build Performance | | | |
|
|
122
|
+
| Bundle & Output | | | |
|
|
123
|
+
| Dependency Weight | | | |
|
|
124
|
+
| Runtime Performance | | | |
|
|
125
|
+
| Test Suite Speed | | | |
|
|
126
|
+
| Database & I/O | | | |
|
|
127
|
+
|
|
128
|
+
Assign an **overall performance score (A–F)** and list the top 3 highest-impact
|
|
129
|
+
improvements.
|
|
130
|
+
|
|
131
|
+
## HITL Checkpoint
|
|
132
|
+
|
|
133
|
+
Present findings to the human. Wait for approval before applying any fixes.
|
|
134
|
+
|
|
135
|
+
## Apply Fixes
|
|
136
|
+
|
|
137
|
+
After approval:
|
|
138
|
+
|
|
139
|
+
1. Apply fixes in impact order (highest improvement first)
|
|
140
|
+
2. Run validation gates
|
|
141
|
+
3. Update changelog
|
|
142
|
+
4. Commit
|