@codyswann/lisa 1.0.0
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/LICENSE +21 -0
- package/README.md +867 -0
- package/all/copy-overwrite/.claude/README.md +205 -0
- package/all/copy-overwrite/.claude/agents/agent-architect.md +311 -0
- package/all/copy-overwrite/.claude/agents/codebase-analyzer.md +146 -0
- package/all/copy-overwrite/.claude/agents/codebase-locator.md +125 -0
- package/all/copy-overwrite/.claude/agents/codebase-pattern-finder.md +237 -0
- package/all/copy-overwrite/.claude/agents/git-history-analyzer.md +183 -0
- package/all/copy-overwrite/.claude/agents/hooks-expert.md +74 -0
- package/all/copy-overwrite/.claude/agents/skill-evaluator.md +246 -0
- package/all/copy-overwrite/.claude/agents/slash-command-architect.md +87 -0
- package/all/copy-overwrite/.claude/agents/web-search-researcher.md +112 -0
- package/all/copy-overwrite/.claude/commands/git/commit-and-submit-pr.md +8 -0
- package/all/copy-overwrite/.claude/commands/git/commit.md +44 -0
- package/all/copy-overwrite/.claude/commands/git/prune.md +34 -0
- package/all/copy-overwrite/.claude/commands/git/submit-pr.md +50 -0
- package/all/copy-overwrite/.claude/commands/jira/create.md +50 -0
- package/all/copy-overwrite/.claude/commands/jira/verify.md +34 -0
- package/all/copy-overwrite/.claude/commands/project/archive.md +8 -0
- package/all/copy-overwrite/.claude/commands/project/bootstrap.md +49 -0
- package/all/copy-overwrite/.claude/commands/project/complete-task.md +7 -0
- package/all/copy-overwrite/.claude/commands/project/debrief.md +65 -0
- package/all/copy-overwrite/.claude/commands/project/execute.md +94 -0
- package/all/copy-overwrite/.claude/commands/project/implement.md +42 -0
- package/all/copy-overwrite/.claude/commands/project/local-code-review.md +88 -0
- package/all/copy-overwrite/.claude/commands/project/lower-code-complexity.md +74 -0
- package/all/copy-overwrite/.claude/commands/project/plan.md +314 -0
- package/all/copy-overwrite/.claude/commands/project/research.md +248 -0
- package/all/copy-overwrite/.claude/commands/project/review.md +63 -0
- package/all/copy-overwrite/.claude/commands/project/setup.md +19 -0
- package/all/copy-overwrite/.claude/commands/project/verify.md +38 -0
- package/all/copy-overwrite/.claude/commands/pull-request/review.md +12 -0
- package/all/copy-overwrite/.claude/commands/rules/format-md.md +72 -0
- package/all/copy-overwrite/.claude/commands/sonarqube/check.md +6 -0
- package/all/copy-overwrite/.claude/commands/sonarqube/fix.md +3 -0
- package/all/copy-overwrite/.claude/hooks/README.md +301 -0
- package/all/copy-overwrite/.claude/hooks/notify-ntfy.sh +181 -0
- package/all/copy-overwrite/.claude/settings.json +41 -0
- package/all/copy-overwrite/.claude/settings.local.json.example +14 -0
- package/all/copy-overwrite/.claude/skills/coding-philosophy/SKILL.md +405 -0
- package/all/copy-overwrite/.claude/skills/coding-philosophy/references/function-structure.md +416 -0
- package/all/copy-overwrite/.claude/skills/coding-philosophy/references/immutable-patterns.md +316 -0
- package/all/copy-overwrite/.claude/skills/prompt-complexity-scorer/SKILL.md +118 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/SKILL.md +210 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/__pycache__/quick_validate.cpython-312.pyc +0 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/init_skill.py +303 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/package_skill.py +110 -0
- package/all/copy-overwrite/.claude/skills/skill-creator/scripts/quick_validate.py +65 -0
- package/all/copy-overwrite/CLAUDE.md +77 -0
- package/all/copy-overwrite/HUMAN.md +17 -0
- package/all/copy-overwrite/specs/.keep +0 -0
- package/all/create-only/PROJECT_RULES.md +0 -0
- package/cdk/merge/package.json +20 -0
- package/dist/cli/index.d.ts +7 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +107 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/prompts.d.ts +45 -0
- package/dist/cli/prompts.d.ts.map +1 -0
- package/dist/cli/prompts.js +58 -0
- package/dist/cli/prompts.js.map +1 -0
- package/dist/core/config.d.ts +73 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +36 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +4 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/lisa.d.ts +81 -0
- package/dist/core/lisa.d.ts.map +1 -0
- package/dist/core/lisa.js +459 -0
- package/dist/core/lisa.js.map +1 -0
- package/dist/core/manifest.d.ts +58 -0
- package/dist/core/manifest.d.ts.map +1 -0
- package/dist/core/manifest.js +104 -0
- package/dist/core/manifest.js.map +1 -0
- package/dist/detection/detector.interface.d.ts +15 -0
- package/dist/detection/detector.interface.d.ts.map +1 -0
- package/dist/detection/detector.interface.js +2 -0
- package/dist/detection/detector.interface.js.map +1 -0
- package/dist/detection/detectors/cdk.d.ts +10 -0
- package/dist/detection/detectors/cdk.d.ts.map +1 -0
- package/dist/detection/detectors/cdk.js +34 -0
- package/dist/detection/detectors/cdk.js.map +1 -0
- package/dist/detection/detectors/expo.d.ts +10 -0
- package/dist/detection/detectors/expo.d.ts.map +1 -0
- package/dist/detection/detectors/expo.js +30 -0
- package/dist/detection/detectors/expo.js.map +1 -0
- package/dist/detection/detectors/nestjs.d.ts +10 -0
- package/dist/detection/detectors/nestjs.d.ts.map +1 -0
- package/dist/detection/detectors/nestjs.js +34 -0
- package/dist/detection/detectors/nestjs.js.map +1 -0
- package/dist/detection/detectors/npm-package.d.ts +13 -0
- package/dist/detection/detectors/npm-package.d.ts.map +1 -0
- package/dist/detection/detectors/npm-package.js +30 -0
- package/dist/detection/detectors/npm-package.js.map +1 -0
- package/dist/detection/detectors/typescript.d.ts +10 -0
- package/dist/detection/detectors/typescript.d.ts.map +1 -0
- package/dist/detection/detectors/typescript.js +25 -0
- package/dist/detection/detectors/typescript.js.map +1 -0
- package/dist/detection/index.d.ts +24 -0
- package/dist/detection/index.d.ts.map +1 -0
- package/dist/detection/index.js +57 -0
- package/dist/detection/index.js.map +1 -0
- package/dist/errors/index.d.ts +69 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +110 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/logging/console-logger.d.ts +12 -0
- package/dist/logging/console-logger.d.ts.map +1 -0
- package/dist/logging/console-logger.js +22 -0
- package/dist/logging/console-logger.js.map +1 -0
- package/dist/logging/index.d.ts +4 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/logging/index.js +3 -0
- package/dist/logging/index.js.map +1 -0
- package/dist/logging/logger.interface.d.ts +20 -0
- package/dist/logging/logger.interface.d.ts.map +1 -0
- package/dist/logging/logger.interface.js +2 -0
- package/dist/logging/logger.interface.js.map +1 -0
- package/dist/logging/silent-logger.d.ts +12 -0
- package/dist/logging/silent-logger.d.ts.map +1 -0
- package/dist/logging/silent-logger.js +21 -0
- package/dist/logging/silent-logger.js.map +1 -0
- package/dist/strategies/copy-contents.d.ts +14 -0
- package/dist/strategies/copy-contents.d.ts.map +1 -0
- package/dist/strategies/copy-contents.js +69 -0
- package/dist/strategies/copy-contents.js.map +1 -0
- package/dist/strategies/copy-overwrite.d.ts +14 -0
- package/dist/strategies/copy-overwrite.d.ts.map +1 -0
- package/dist/strategies/copy-overwrite.js +47 -0
- package/dist/strategies/copy-overwrite.js.map +1 -0
- package/dist/strategies/create-only.d.ts +13 -0
- package/dist/strategies/create-only.d.ts.map +1 -0
- package/dist/strategies/create-only.js +30 -0
- package/dist/strategies/create-only.js.map +1 -0
- package/dist/strategies/index.d.ts +31 -0
- package/dist/strategies/index.d.ts.map +1 -0
- package/dist/strategies/index.js +52 -0
- package/dist/strategies/index.js.map +1 -0
- package/dist/strategies/merge.d.ts +13 -0
- package/dist/strategies/merge.d.ts.map +1 -0
- package/dist/strategies/merge.js +60 -0
- package/dist/strategies/merge.js.map +1 -0
- package/dist/strategies/strategy.interface.d.ts +31 -0
- package/dist/strategies/strategy.interface.d.ts.map +1 -0
- package/dist/strategies/strategy.interface.js +2 -0
- package/dist/strategies/strategy.interface.js.map +1 -0
- package/dist/transaction/backup.d.ts +38 -0
- package/dist/transaction/backup.d.ts.map +1 -0
- package/dist/transaction/backup.js +97 -0
- package/dist/transaction/backup.js.map +1 -0
- package/dist/transaction/index.d.ts +4 -0
- package/dist/transaction/index.d.ts.map +1 -0
- package/dist/transaction/index.js +3 -0
- package/dist/transaction/index.js.map +1 -0
- package/dist/transaction/transaction.d.ts +34 -0
- package/dist/transaction/transaction.d.ts.map +1 -0
- package/dist/transaction/transaction.js +68 -0
- package/dist/transaction/transaction.js.map +1 -0
- package/dist/utils/file-operations.d.ts +29 -0
- package/dist/utils/file-operations.d.ts.map +1 -0
- package/dist/utils/file-operations.js +84 -0
- package/dist/utils/file-operations.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/json-utils.d.ts +22 -0
- package/dist/utils/json-utils.d.ts.map +1 -0
- package/dist/utils/json-utils.js +57 -0
- package/dist/utils/json-utils.js.map +1 -0
- package/dist/utils/path-utils.d.ts +21 -0
- package/dist/utils/path-utils.d.ts.map +1 -0
- package/dist/utils/path-utils.js +35 -0
- package/dist/utils/path-utils.js.map +1 -0
- package/eslint-plugin-code-organization/README.md +149 -0
- package/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +468 -0
- package/eslint-plugin-code-organization/index.js +23 -0
- package/eslint-plugin-code-organization/package.json +10 -0
- package/eslint-plugin-code-organization/rules/enforce-statement-order.js +157 -0
- package/expo/copy-overwrite/.claude/skills/apollo-client/SKILL.md +238 -0
- package/expo/copy-overwrite/.claude/skills/apollo-client/references/mutation-patterns.md +360 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/SKILL.md +360 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/references/atomic-levels.md +417 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/references/folder-structure.md +257 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/references/gluestack-mapping.md +233 -0
- package/expo/copy-overwrite/.claude/skills/atomic-design-gluestack/scripts/validate_atomic_structure.py +327 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/SKILL.md +299 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/references/examples.md +749 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/references/patterns.md +318 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/create_component.py +198 -0
- package/expo/copy-overwrite/.claude/skills/container-view-pattern/scripts/validate_component.py +207 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/SKILL.md +268 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/references/common-issues.md +619 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/references/file-extensions.md +340 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/references/platform-api.md +276 -0
- package/expo/copy-overwrite/.claude/skills/cross-platform-compatibility/scripts/validate_cross_platform.py +414 -0
- package/expo/copy-overwrite/.claude/skills/directory-structure/SKILL.md +202 -0
- package/expo/copy-overwrite/.claude/skills/directory-structure/scripts/validate_structure.py +443 -0
- package/expo/copy-overwrite/.claude/skills/expo-env-config/SKILL.md +309 -0
- package/expo/copy-overwrite/.claude/skills/expo-env-config/references/validation-patterns.md +417 -0
- package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/SKILL.md +431 -0
- package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/references/official-docs.md +290 -0
- package/expo/copy-overwrite/.claude/skills/expo-router-best-practices/scripts/generate-route.py +169 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/SKILL.md +411 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/references/color-tokens.md +343 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/references/component-mapping.md +307 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/references/spacing-scale.md +300 -0
- package/expo/copy-overwrite/.claude/skills/gluestack-nativewind/scripts/validate_styling.py +354 -0
- package/expo/copy-overwrite/.claude/skills/local-state/SKILL.md +362 -0
- package/expo/copy-overwrite/.claude/skills/local-state/references/async-storage.md +505 -0
- package/expo/copy-overwrite/.claude/skills/local-state/references/persistence-patterns.md +711 -0
- package/expo/copy-overwrite/.claude/skills/local-state/references/reactive-variables.md +446 -0
- package/expo/copy-overwrite/.claude/skills/playwright-selectors/SKILL.md +223 -0
- package/expo/copy-overwrite/.claude/skills/testing-library/SKILL.md +319 -0
- package/expo/copy-overwrite/.claude/skills/testing-library/references/async-patterns.md +420 -0
- package/expo/copy-overwrite/.claude/skills/testing-library/references/expo-router-testing.md +556 -0
- package/expo/copy-overwrite/.claude/skills/testing-library/references/mocking-patterns.md +590 -0
- package/expo/copy-overwrite/.claude/skills/testing-library/references/query-priority.md +291 -0
- package/expo/copy-overwrite/.easignore.extra +2 -0
- package/expo/copy-overwrite/.mcp.json +33 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/README.md +234 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/plugin-index.test.js +84 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/require-memo-in-view.test.js +196 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/__tests__/single-component-per-file.test.js +289 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/index.js +32 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/package.json +10 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/enforce-component-structure.js +230 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/no-return-in-view.js +91 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/require-memo-in-view.js +178 -0
- package/expo/copy-overwrite/eslint-plugin-component-structure/rules/single-component-per-file.js +238 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/README.md +260 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/index.js +29 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/package.json +10 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-classname-outside-ui.js +51 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-direct-rn-imports.js +55 -0
- package/expo/copy-overwrite/eslint-plugin-ui-standards/rules/no-inline-styles.js +73 -0
- package/expo/copy-overwrite/eslint.config.mjs +560 -0
- package/expo/copy-overwrite/lighthouserc.js +194 -0
- package/expo/create-only/lighthouserc-config.json +28 -0
- package/expo/merge/package.json +132 -0
- package/lisa.sh +35 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/SKILL.md +176 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/advanced-features.md +527 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/project-patterns.md +483 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/quick-start.md +257 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/resolvers-mutations.md +413 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-graphql/references/types-scalars.md +513 -0
- package/nestjs/copy-overwrite/.claude/skills/nestjs-rules/SKILL.md +536 -0
- package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/SKILL.md +275 -0
- package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/references/configuration-patterns.md +487 -0
- package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/references/entity-patterns.md +450 -0
- package/nestjs/copy-overwrite/.claude/skills/typeorm-patterns/references/observability-patterns.md +536 -0
- package/nestjs/merge/package.json +75 -0
- package/package.json +124 -0
- package/typescript/copy-contents/.husky/commit-msg +91 -0
- package/typescript/copy-contents/.husky/pre-commit +96 -0
- package/typescript/copy-contents/.husky/pre-push +211 -0
- package/typescript/copy-overwrite/.claude/hooks/format-on-edit.sh +74 -0
- package/typescript/copy-overwrite/.claude/hooks/install_pkgs.sh +59 -0
- package/typescript/copy-overwrite/.claude/hooks/lint-on-edit.sh +103 -0
- package/typescript/copy-overwrite/.claude/skills/jsdoc-best-practices/SKILL.md +388 -0
- package/typescript/copy-overwrite/.github/README.md +455 -0
- package/typescript/copy-overwrite/.github/dependabot.yml +40 -0
- package/typescript/copy-overwrite/.github/k6/BROWSER_TESTING_NOTE.md +129 -0
- package/typescript/copy-overwrite/.github/k6/INTEGRATION_GUIDE.md +354 -0
- package/typescript/copy-overwrite/.github/k6/README.md +386 -0
- package/typescript/copy-overwrite/.github/k6/SCENARIO_SELECTION_GUIDE.md +264 -0
- package/typescript/copy-overwrite/.github/k6/examples/customer-deploy-integration.yml +115 -0
- package/typescript/copy-overwrite/.github/k6/examples/data-driven-test.js +268 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/load.js +142 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/load.json +27 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/smoke.js +26 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/smoke.json +20 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/soak.js +244 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/soak.json +29 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/spike.js +180 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/spike.json +32 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/stress.js +206 -0
- package/typescript/copy-overwrite/.github/k6/scenarios/stress.json +38 -0
- package/typescript/copy-overwrite/.github/k6/scripts/api-test.js +452 -0
- package/typescript/copy-overwrite/.github/k6/scripts/default-test.js +185 -0
- package/typescript/copy-overwrite/.github/k6/thresholds/normal.json +30 -0
- package/typescript/copy-overwrite/.github/k6/thresholds/relaxed.json +21 -0
- package/typescript/copy-overwrite/.github/k6/thresholds/strict.json +29 -0
- package/typescript/copy-overwrite/.github/workflows/build.yml +72 -0
- package/typescript/copy-overwrite/.github/workflows/ci.yml +49 -0
- package/typescript/copy-overwrite/.github/workflows/claude.yml +51 -0
- package/typescript/copy-overwrite/.github/workflows/create-github-issue-on-failure.yml +113 -0
- package/typescript/copy-overwrite/.github/workflows/create-jira-issue-on-failure.yml +195 -0
- package/typescript/copy-overwrite/.github/workflows/create-sentry-issue-on-failure.yml +267 -0
- package/typescript/copy-overwrite/.github/workflows/deploy.yml +228 -0
- package/typescript/copy-overwrite/.github/workflows/k6-load-test-README.md +230 -0
- package/typescript/copy-overwrite/.github/workflows/lighthouse.yml +68 -0
- package/typescript/copy-overwrite/.github/workflows/load-test.yml +282 -0
- package/typescript/copy-overwrite/.github/workflows/quality.yml +1737 -0
- package/typescript/copy-overwrite/.github/workflows/release.yml +1599 -0
- package/typescript/copy-overwrite/.gitleaksignore +28 -0
- package/typescript/copy-overwrite/.nvmrc +1 -0
- package/typescript/copy-overwrite/.prettierignore +23 -0
- package/typescript/copy-overwrite/.prettierrc.json +22 -0
- package/typescript/copy-overwrite/.versionrc +42 -0
- package/typescript/copy-overwrite/.yamllint +20 -0
- package/typescript/copy-overwrite/commitlint.config.js +11 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/README.md +149 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/__tests__/enforce-statement-order.test.js +468 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/index.js +23 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/package.json +10 -0
- package/typescript/copy-overwrite/eslint-plugin-code-organization/rules/enforce-statement-order.js +157 -0
- package/typescript/copy-overwrite/eslint.config.mjs +390 -0
- package/typescript/copy-overwrite/eslint.ignore.config.json +57 -0
- package/typescript/copy-overwrite/eslint.thresholds.config.json +5 -0
- package/typescript/github-rulesets/base.json +106 -0
- package/typescript/merge/.claude/settings.json +28 -0
- package/typescript/merge/package.json +71 -0
package/package.json
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{
|
|
2
|
+
"lint-staged": {
|
|
3
|
+
"*.{js,ts,tsx}": [
|
|
4
|
+
"eslint --quiet --cache --fix"
|
|
5
|
+
],
|
|
6
|
+
"*.{js,ts,jsx,tsx,html,css,scss,yaml,yml,graphql}": [
|
|
7
|
+
"prettier --write"
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
"engines": {
|
|
11
|
+
"npm": "please-use-bun",
|
|
12
|
+
"yarn": "please-use-bun",
|
|
13
|
+
"bun": ">= 1.3.5",
|
|
14
|
+
"node": ">=18.0.0"
|
|
15
|
+
},
|
|
16
|
+
"config": {
|
|
17
|
+
"commitizen": {
|
|
18
|
+
"path": "./node_modules/cz-conventional-changelog"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"//docs": "The following commands MUST be defined for CI/CD to work properly - even if they're no-ops.",
|
|
23
|
+
"lint": "eslint src --ext .ts",
|
|
24
|
+
"lint:fix": "eslint . --fix",
|
|
25
|
+
"build": "tsc",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:unit": "NODE_ENV=test jest --testPathIgnorePatterns=\"\\.integration\\.test\\.(ts|tsx)$\" --passWithNoTests",
|
|
28
|
+
"test:integration": "NODE_ENV=test jest --testPathPatterns=\"\\.integration\\.test\\.(ts|tsx)$\" --passWithNoTests",
|
|
29
|
+
"test:cov": "NODE_ENV=test jest --coverage",
|
|
30
|
+
"types:check": "tsc --noEmit",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"format:check": "prettier --check .",
|
|
33
|
+
"format": "prettier --check . --write",
|
|
34
|
+
"prepare": "npm run build",
|
|
35
|
+
"//end-docs": "",
|
|
36
|
+
"start": "node dist/index.js",
|
|
37
|
+
"dev": "tsx src/index.ts",
|
|
38
|
+
"test:watch": "vitest",
|
|
39
|
+
"test:coverage": "vitest run --coverage"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@commitlint/cli": "^20.3.1",
|
|
43
|
+
"@commitlint/config-conventional": "^20.3.1",
|
|
44
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
45
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
46
|
+
"@eslint/js": "^9.39.0",
|
|
47
|
+
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
48
|
+
"@jest/test-sequencer": "^30.2.0",
|
|
49
|
+
"@types/jest": "^30.0.0",
|
|
50
|
+
"commitizen": "^4.3.0",
|
|
51
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
52
|
+
"eslint": "^9.39.0",
|
|
53
|
+
"eslint-config-prettier": "^10.0.0",
|
|
54
|
+
"eslint-plugin-code-organization": "file:./eslint-plugin-code-organization",
|
|
55
|
+
"eslint-plugin-functional": "^9.0.0",
|
|
56
|
+
"eslint-plugin-jsdoc": "^61.5.0",
|
|
57
|
+
"eslint-plugin-prettier": "^5.5.0",
|
|
58
|
+
"eslint-plugin-sonarjs": "^3.0.0",
|
|
59
|
+
"husky": "^8.0.0",
|
|
60
|
+
"jest": "^30.0.0",
|
|
61
|
+
"jscodeshift": "0.15.2",
|
|
62
|
+
"lint-staged": "^16.2.7",
|
|
63
|
+
"prettier": "^3.3.3",
|
|
64
|
+
"standard-version": "^9.5.0",
|
|
65
|
+
"ts-jest": "^29.4.6",
|
|
66
|
+
"ts-morph": "^27.0.2",
|
|
67
|
+
"ts-node": "^10.9.2",
|
|
68
|
+
"typescript": "~5.7.0",
|
|
69
|
+
"typescript-eslint": "^8.0.0",
|
|
70
|
+
"@types/fs-extra": "^11.0.0",
|
|
71
|
+
"@types/lodash.merge": "^4.6.0",
|
|
72
|
+
"@types/node": "^22.0.0",
|
|
73
|
+
"@vitest/coverage-v8": "^3.0.0",
|
|
74
|
+
"memfs": "^4.0.0",
|
|
75
|
+
"tsx": "^4.0.0",
|
|
76
|
+
"vitest": "^3.0.0"
|
|
77
|
+
},
|
|
78
|
+
"resolutions": {},
|
|
79
|
+
"trustedDependencies": [
|
|
80
|
+
"@sentry/cli"
|
|
81
|
+
],
|
|
82
|
+
"name": "@codyswann/lisa",
|
|
83
|
+
"version": "1.0.0",
|
|
84
|
+
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
85
|
+
"type": "module",
|
|
86
|
+
"main": "dist/index.js",
|
|
87
|
+
"bin": {
|
|
88
|
+
"lisa": "dist/index.js"
|
|
89
|
+
},
|
|
90
|
+
"keywords": [
|
|
91
|
+
"claude",
|
|
92
|
+
"claude-code",
|
|
93
|
+
"governance",
|
|
94
|
+
"linting",
|
|
95
|
+
"configuration"
|
|
96
|
+
],
|
|
97
|
+
"author": "Cody Swann",
|
|
98
|
+
"license": "MIT",
|
|
99
|
+
"repository": {
|
|
100
|
+
"type": "git",
|
|
101
|
+
"url": "git+https://github.com/CodySwannGT/lisa.git"
|
|
102
|
+
},
|
|
103
|
+
"bugs": {
|
|
104
|
+
"url": "https://github.com/CodySwannGT/lisa/issues"
|
|
105
|
+
},
|
|
106
|
+
"homepage": "https://github.com/CodySwannGT/lisa#readme",
|
|
107
|
+
"dependencies": {
|
|
108
|
+
"@inquirer/prompts": "^7.0.0",
|
|
109
|
+
"commander": "^12.0.0",
|
|
110
|
+
"fs-extra": "^11.0.0",
|
|
111
|
+
"lodash.merge": "^4.6.2",
|
|
112
|
+
"picocolors": "^1.0.0"
|
|
113
|
+
},
|
|
114
|
+
"files": [
|
|
115
|
+
"dist",
|
|
116
|
+
"all",
|
|
117
|
+
"typescript",
|
|
118
|
+
"expo",
|
|
119
|
+
"nestjs",
|
|
120
|
+
"cdk",
|
|
121
|
+
"eslint-plugin-code-organization",
|
|
122
|
+
"lisa.sh"
|
|
123
|
+
]
|
|
124
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# BEGIN: AI GUARDRAILS
|
|
2
|
+
|
|
3
|
+
# Detect package manager (check if tool is available before using it)
|
|
4
|
+
# Priority: bun > yarn > npm (bun first since package.json engines prefer it)
|
|
5
|
+
if ([ -f "bun.lockb" ] || [ -f "bun.lock" ]) && command -v bun >/dev/null 2>&1; then
|
|
6
|
+
PACKAGE_MANAGER="bun"
|
|
7
|
+
EXECUTOR="bunx"
|
|
8
|
+
elif [ -f "yarn.lock" ] && command -v yarn >/dev/null 2>&1; then
|
|
9
|
+
PACKAGE_MANAGER="yarn"
|
|
10
|
+
EXECUTOR="yarn"
|
|
11
|
+
elif [ -f "package-lock.json" ]; then
|
|
12
|
+
PACKAGE_MANAGER="npm"
|
|
13
|
+
EXECUTOR="npx"
|
|
14
|
+
else
|
|
15
|
+
# Default to npm if no lock file is found or tool is not available
|
|
16
|
+
PACKAGE_MANAGER="npm"
|
|
17
|
+
EXECUTOR="npx"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Get the commit message file path
|
|
21
|
+
COMMIT_MSG_FILE=$1
|
|
22
|
+
|
|
23
|
+
# Get the current branch name
|
|
24
|
+
BRANCH_NAME=$(git branch --show-current)
|
|
25
|
+
|
|
26
|
+
# Extract Jira key from branch name if present
|
|
27
|
+
# Default pattern matches common Jira project keys (2-10 uppercase letters followed by a hyphen and numbers)
|
|
28
|
+
# Can be overridden with JIRA_PROJECT_KEY environment variable (e.g., JIRA_PROJECT_KEY="SE|PROJ|ABC")
|
|
29
|
+
JIRA_PROJECT_KEY=${JIRA_PROJECT_KEY:-"[A-Z]{2,10}"}
|
|
30
|
+
|
|
31
|
+
# Extract Jira key from branch name using grep
|
|
32
|
+
# Matches patterns like: feat/SE-2397-description, SE-2397-description, chore/PROJ-123-something
|
|
33
|
+
JIRA_KEY=$(echo "$BRANCH_NAME" | grep -E "(^|/)($JIRA_PROJECT_KEY)-[0-9]+" | grep -E "($JIRA_PROJECT_KEY)-[0-9]+" -o | head -1)
|
|
34
|
+
|
|
35
|
+
if [ -n "$JIRA_KEY" ]; then
|
|
36
|
+
# Read the current commit message
|
|
37
|
+
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
|
|
38
|
+
|
|
39
|
+
# Check if the Jira key is already in the commit message
|
|
40
|
+
if ! echo "$COMMIT_MSG" | grep -q "\[$JIRA_KEY\]"; then
|
|
41
|
+
# Append the Jira key to the commit message
|
|
42
|
+
echo "$COMMIT_MSG [$JIRA_KEY]" > "$COMMIT_MSG_FILE"
|
|
43
|
+
echo "🎫 Auto-appended Jira key: [$JIRA_KEY]"
|
|
44
|
+
fi
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
echo "📝 Validating commit message with commitlint..."
|
|
48
|
+
$EXECUTOR commitlint --edit $1
|
|
49
|
+
|
|
50
|
+
if [ $? -ne 0 ]; then
|
|
51
|
+
echo ""
|
|
52
|
+
echo "❌ Commit message does not follow conventional commits format!"
|
|
53
|
+
echo ""
|
|
54
|
+
echo "📖 Examples of valid commit messages:"
|
|
55
|
+
echo " - feat: add new feature"
|
|
56
|
+
echo " - fix: resolve bug in login"
|
|
57
|
+
echo " - docs: update README"
|
|
58
|
+
echo " - style: format code"
|
|
59
|
+
echo " - refactor: restructure auth module"
|
|
60
|
+
echo " - test: add unit tests for utils"
|
|
61
|
+
echo " - chore: update dependencies"
|
|
62
|
+
echo ""
|
|
63
|
+
echo "Format: <type>(<optional scope>): <subject>"
|
|
64
|
+
echo ""
|
|
65
|
+
echo "For more info, see: https://www.conventionalcommits.org/"
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
# Check for Co-Authored-By line (skip for merge commits)
|
|
70
|
+
COMMIT_MSG=$(cat "$COMMIT_MSG_FILE")
|
|
71
|
+
|
|
72
|
+
# Skip AI co-authorship check for merge commits (e.g., from git pull)
|
|
73
|
+
if echo "$COMMIT_MSG" | grep -qE "^Merge (branch|pull request|remote-tracking)"; then
|
|
74
|
+
echo "🔀 Merge commit detected, skipping AI co-authorship check"
|
|
75
|
+
exit 0
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
echo "🤖 Checking for AI co-authorship..."
|
|
79
|
+
|
|
80
|
+
if ! echo "$COMMIT_MSG" | grep -q "Co-Authored-By:.*Claude"; then
|
|
81
|
+
echo ""
|
|
82
|
+
echo "❌ Commit message must include AI co-authorship!"
|
|
83
|
+
echo ""
|
|
84
|
+
echo "All commits must include a Co-Authored-By line for Claude."
|
|
85
|
+
echo ""
|
|
86
|
+
echo "If you're using Claude Code, use the /git:commit command"
|
|
87
|
+
echo ""
|
|
88
|
+
exit 1
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
# END: AI GUARDRAILS
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# BEGIN: AI GUARDRAILS
|
|
2
|
+
# Detect package manager (check if tool is available before using it)
|
|
3
|
+
# Priority: bun > yarn > npm (bun first since package.json engines prefer it)
|
|
4
|
+
if ([ -f "bun.lockb" ] || [ -f "bun.lock" ]) && command -v bun >/dev/null 2>&1; then
|
|
5
|
+
PACKAGE_MANAGER="bun"
|
|
6
|
+
RUNNER="bun run"
|
|
7
|
+
EXECUTOR="bunx"
|
|
8
|
+
elif [ -f "yarn.lock" ] && command -v yarn >/dev/null 2>&1; then
|
|
9
|
+
PACKAGE_MANAGER="yarn"
|
|
10
|
+
RUNNER="yarn"
|
|
11
|
+
EXECUTOR="yarn"
|
|
12
|
+
elif [ -f "package-lock.json" ]; then
|
|
13
|
+
PACKAGE_MANAGER="npm"
|
|
14
|
+
RUNNER="npm run"
|
|
15
|
+
EXECUTOR="npx"
|
|
16
|
+
else
|
|
17
|
+
# Default to npm if no lock file is found or tool is not available
|
|
18
|
+
PACKAGE_MANAGER="npm"
|
|
19
|
+
RUNNER="npm run"
|
|
20
|
+
EXECUTOR="npx"
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
echo "📦 Using package manager: $PACKAGE_MANAGER"
|
|
24
|
+
|
|
25
|
+
# Check for direct commits to environment branches
|
|
26
|
+
echo "🔒 Checking branch protection..."
|
|
27
|
+
BRANCH_NAME=$(git branch --show-current)
|
|
28
|
+
|
|
29
|
+
# Skip check if running in CI (GitHub Actions sets CI=true)
|
|
30
|
+
if [ "$CI" = "true" ]; then
|
|
31
|
+
echo "⚠️ Running in CI, skipping branch protection check"
|
|
32
|
+
# Skip check if in detached HEAD state (empty branch name)
|
|
33
|
+
elif [ -z "$BRANCH_NAME" ]; then
|
|
34
|
+
echo "⚠️ In detached HEAD state, skipping branch check"
|
|
35
|
+
else
|
|
36
|
+
# Check if current branch is an environment branch
|
|
37
|
+
if [ "$BRANCH_NAME" = "dev" ] || [ "$BRANCH_NAME" = "staging" ] || [ "$BRANCH_NAME" = "main" ]; then
|
|
38
|
+
echo ""
|
|
39
|
+
echo "❌ You are not allowed to commit directly to $BRANCH_NAME because it is an environment branch."
|
|
40
|
+
echo " Instead, create a new branch and open a pull request to $BRANCH_NAME"
|
|
41
|
+
echo ""
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
# Check for Gitleaks and run secret detection
|
|
47
|
+
echo "🔐 Checking for secrets with Gitleaks..."
|
|
48
|
+
if command -v gitleaks >/dev/null 2>&1; then
|
|
49
|
+
# Run gitleaks on staged files
|
|
50
|
+
gitleaks protect --staged --redact -v
|
|
51
|
+
if [ $? -ne 0 ]; then
|
|
52
|
+
echo ""
|
|
53
|
+
echo "❌ Secrets detected in staged files!"
|
|
54
|
+
echo ""
|
|
55
|
+
echo "Please remove any secrets from your code before committing."
|
|
56
|
+
echo "If this is a false positive, you can add it to .gitleaksignore"
|
|
57
|
+
echo ""
|
|
58
|
+
exit 1
|
|
59
|
+
fi
|
|
60
|
+
echo "✅ No secrets detected"
|
|
61
|
+
else
|
|
62
|
+
echo ""
|
|
63
|
+
echo "⚠️ WARNING: Gitleaks is not installed!"
|
|
64
|
+
echo ""
|
|
65
|
+
echo "Gitleaks helps prevent secrets from being committed to your repository."
|
|
66
|
+
echo ""
|
|
67
|
+
echo "To install Gitleaks:"
|
|
68
|
+
echo " macOS: brew install gitleaks"
|
|
69
|
+
echo " Windows: scoop install gitleaks # or choco install gitleaks"
|
|
70
|
+
echo " Linux: See https://github.com/gitleaks/gitleaks#installing"
|
|
71
|
+
echo ""
|
|
72
|
+
echo "After installation, your commits will be automatically scanned for secrets."
|
|
73
|
+
echo ""
|
|
74
|
+
echo "Continuing without secret scanning..."
|
|
75
|
+
echo ""
|
|
76
|
+
fi
|
|
77
|
+
|
|
78
|
+
# Check if native changes require runtime version bump
|
|
79
|
+
# echo "🔍 Checking for native dependency changes..."
|
|
80
|
+
# node scripts/check-runtime-version.js
|
|
81
|
+
# if [ $? -ne 0 ]; then
|
|
82
|
+
# exit 1
|
|
83
|
+
# fi
|
|
84
|
+
|
|
85
|
+
# Run type check on entire project (can't be done incrementally)
|
|
86
|
+
echo "🔍 Running type check..."
|
|
87
|
+
$RUNNER typecheck
|
|
88
|
+
if [ $? -ne 0 ]; then
|
|
89
|
+
echo "❌ Type check failed. Please fix TypeScript errors before committing."
|
|
90
|
+
exit 1
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# Run lint-staged for incremental lint and format checks
|
|
94
|
+
echo "🚀 Running lint-staged..."
|
|
95
|
+
$EXECUTOR lint-staged --config package.json
|
|
96
|
+
# END: AI GUARDRAILS
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# BEGIN: AI GUARDRAILS
|
|
2
|
+
|
|
3
|
+
# Detect package manager (check if tool is available before using it)
|
|
4
|
+
# Priority: bun > yarn > npm (bun first since package.json engines prefer it)
|
|
5
|
+
if ([ -f "bun.lockb" ] || [ -f "bun.lock" ]) && command -v bun >/dev/null 2>&1; then
|
|
6
|
+
PACKAGE_MANAGER="bun"
|
|
7
|
+
RUNNER="bun run"
|
|
8
|
+
elif [ -f "yarn.lock" ] && command -v yarn >/dev/null 2>&1; then
|
|
9
|
+
PACKAGE_MANAGER="yarn"
|
|
10
|
+
RUNNER="yarn"
|
|
11
|
+
elif [ -f "package-lock.json" ]; then
|
|
12
|
+
PACKAGE_MANAGER="npm"
|
|
13
|
+
RUNNER="npm run"
|
|
14
|
+
else
|
|
15
|
+
# Default to npm if no lock file is found or tool is not available
|
|
16
|
+
PACKAGE_MANAGER="npm"
|
|
17
|
+
RUNNER="npm run"
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
echo "📦 Using package manager: $PACKAGE_MANAGER"
|
|
21
|
+
|
|
22
|
+
# Run security audit
|
|
23
|
+
echo "🔒 Running security audit..."
|
|
24
|
+
|
|
25
|
+
if [ "$PACKAGE_MANAGER" = "yarn" ]; then
|
|
26
|
+
# Check if jq is installed (required for yarn audit filtering)
|
|
27
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
28
|
+
echo ""
|
|
29
|
+
echo "⚠️ WARNING: jq is not installed - required for yarn audit filtering"
|
|
30
|
+
echo ""
|
|
31
|
+
echo "To install jq:"
|
|
32
|
+
echo " macOS: brew install jq"
|
|
33
|
+
echo " Windows: choco install jq # or scoop install jq"
|
|
34
|
+
echo " Linux: apt-get install jq"
|
|
35
|
+
echo ""
|
|
36
|
+
echo "Continuing without security audit..."
|
|
37
|
+
echo ""
|
|
38
|
+
else
|
|
39
|
+
# Excluding GHSA-5j98-mcp5-4vw2 (CVE-2025-64756): glob CLI command injection
|
|
40
|
+
# This vulnerability only affects the glob CLI (--cmd flag), not library usage
|
|
41
|
+
# We only use glob as a library through Babel and other tools - never invoke CLI
|
|
42
|
+
# Risk: None - vulnerable code path is not executed in our application
|
|
43
|
+
# Run yarn audit and filter for high/critical vulnerabilities (excluding glob CLI vuln)
|
|
44
|
+
# Filter by both GHSA ID and CVE ID for robustness
|
|
45
|
+
yarn audit --groups dependencies --json | jq -r 'select(.type == "auditAdvisory") | select(.data.advisory.severity == "high" or .data.advisory.severity == "critical") | select((.data.advisory.github_advisory_id == "GHSA-5j98-mcp5-4vw2" or (.data.advisory.cves | any(. == "CVE-2025-64756"))) | not) | .data.advisory' > high_vulns.json
|
|
46
|
+
|
|
47
|
+
if [ -s high_vulns.json ]; then
|
|
48
|
+
echo "❌ High or critical vulnerabilities found in production dependencies!"
|
|
49
|
+
cat high_vulns.json
|
|
50
|
+
rm high_vulns.json
|
|
51
|
+
exit 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
echo "✅ No high or critical vulnerabilities found in production dependencies (excluding known false positives)"
|
|
55
|
+
rm -f high_vulns.json
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
elif [ "$PACKAGE_MANAGER" = "npm" ]; then
|
|
59
|
+
# Run npm audit and only fail on high or critical vulnerabilities
|
|
60
|
+
npm audit --production --audit-level=high
|
|
61
|
+
if [ $? -ne 0 ]; then
|
|
62
|
+
echo "⚠️ Security audit failed. Please fix high/critical vulnerabilities before pushing."
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
65
|
+
echo "✅ No high or critical vulnerabilities found in production dependencies"
|
|
66
|
+
|
|
67
|
+
elif [ "$PACKAGE_MANAGER" = "bun" ]; then
|
|
68
|
+
# Bun's 'bun pm scan' requires a configured scanner in bunfig.toml
|
|
69
|
+
# Fall back to npm audit which works with package.json
|
|
70
|
+
echo " (using npm audit fallback for bun projects)"
|
|
71
|
+
|
|
72
|
+
# Check if jq is installed (required for filtering vulnerabilities)
|
|
73
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
74
|
+
echo ""
|
|
75
|
+
echo "⚠️ WARNING: jq is not installed - required for vulnerability filtering"
|
|
76
|
+
echo ""
|
|
77
|
+
echo "To install jq:"
|
|
78
|
+
echo " macOS: brew install jq"
|
|
79
|
+
echo " Windows: choco install jq # or scoop install jq"
|
|
80
|
+
echo " Linux: apt-get install jq"
|
|
81
|
+
echo ""
|
|
82
|
+
echo "Continuing without security audit..."
|
|
83
|
+
echo ""
|
|
84
|
+
else
|
|
85
|
+
# npm audit requires a lockfile - generate temporary one if needed
|
|
86
|
+
TEMP_LOCKFILE=false
|
|
87
|
+
if [ ! -f "package-lock.json" ]; then
|
|
88
|
+
echo " Generating temporary package-lock.json for audit..."
|
|
89
|
+
npm i --package-lock-only --ignore-scripts --legacy-peer-deps --silent 2>/dev/null
|
|
90
|
+
TEMP_LOCKFILE=true
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# Excluding GHSA-8qq5-rm4j-mr97: node-tar path sanitization vulnerability
|
|
94
|
+
# This is a nested dependency in @expo/cli that bun resolves to the patched version (7.5.3)
|
|
95
|
+
# npm audit generates its own lockfile and doesn't respect bun's resolutions
|
|
96
|
+
# Risk: None - bun.lock shows tar@7.5.3 is used, not the vulnerable version
|
|
97
|
+
VULN_COUNT=$(npm audit --omit=dev --json 2>/dev/null | jq '
|
|
98
|
+
.vulnerabilities | to_entries | map(select(
|
|
99
|
+
.value.severity == "high" or .value.severity == "critical"
|
|
100
|
+
)) | map(select(
|
|
101
|
+
.value.via | all(. | if type == "object" then (.url == "https://github.com/advisories/GHSA-8qq5-rm4j-mr97" | not) else true end)
|
|
102
|
+
)) | length
|
|
103
|
+
')
|
|
104
|
+
if [ "$VULN_COUNT" -gt 0 ] 2>/dev/null; then
|
|
105
|
+
AUDIT_EXIT=1
|
|
106
|
+
else
|
|
107
|
+
AUDIT_EXIT=0
|
|
108
|
+
fi
|
|
109
|
+
|
|
110
|
+
# Clean up temporary lockfile
|
|
111
|
+
if [ "$TEMP_LOCKFILE" = "true" ]; then
|
|
112
|
+
rm -f package-lock.json
|
|
113
|
+
fi
|
|
114
|
+
|
|
115
|
+
if [ $AUDIT_EXIT -ne 0 ]; then
|
|
116
|
+
# Re-run to show the actual vulnerabilities (excluding the known one)
|
|
117
|
+
echo "⚠️ Security audit found high/critical vulnerabilities:"
|
|
118
|
+
npm audit --omit=dev 2>/dev/null | grep -v "GHSA-8qq5-rm4j-mr97" || true
|
|
119
|
+
exit 1
|
|
120
|
+
fi
|
|
121
|
+
echo "✅ No high or critical vulnerabilities found in production dependencies (excluding known false positives)"
|
|
122
|
+
fi
|
|
123
|
+
fi
|
|
124
|
+
|
|
125
|
+
# Run unit tests with coverage
|
|
126
|
+
echo "🧪 Running unit tests with coverage..."
|
|
127
|
+
$RUNNER test:cov
|
|
128
|
+
if [ $? -ne 0 ]; then
|
|
129
|
+
echo "❌ Unit tests or coverage thresholds failed. Please fix before pushing."
|
|
130
|
+
exit 1
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Run integration tests
|
|
134
|
+
echo "🧪 Running integration tests..."
|
|
135
|
+
$RUNNER test:integration
|
|
136
|
+
if [ $? -ne 0 ]; then
|
|
137
|
+
echo "❌ Integration tests failed. Please fix failing tests before pushing."
|
|
138
|
+
exit 1
|
|
139
|
+
fi
|
|
140
|
+
|
|
141
|
+
# Run Lighthouse CI performance audit (only if installed)
|
|
142
|
+
# Check if lighthouse:check script exists in package.json
|
|
143
|
+
if ! grep -q '"lighthouse:check"' package.json 2>/dev/null; then
|
|
144
|
+
echo ""
|
|
145
|
+
echo "ℹ️ Skipping Lighthouse CI audit (not configured for this project)"
|
|
146
|
+
echo ""
|
|
147
|
+
else
|
|
148
|
+
# Check if Chrome is available (required for Lighthouse)
|
|
149
|
+
CHROME_AVAILABLE=false
|
|
150
|
+
if command -v google-chrome >/dev/null 2>&1 || \
|
|
151
|
+
command -v google-chrome-stable >/dev/null 2>&1 || \
|
|
152
|
+
command -v chromium >/dev/null 2>&1 || \
|
|
153
|
+
command -v chromium-browser >/dev/null 2>&1 || \
|
|
154
|
+
[ -x "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then
|
|
155
|
+
CHROME_AVAILABLE=true
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
if [ "$CHROME_AVAILABLE" = "false" ]; then
|
|
159
|
+
echo ""
|
|
160
|
+
echo "⚠️ WARNING: Chrome/Chromium not found - skipping Lighthouse CI audit"
|
|
161
|
+
echo ""
|
|
162
|
+
echo "To enable Lighthouse performance audits, install Chrome:"
|
|
163
|
+
echo " macOS: brew install --cask google-chrome"
|
|
164
|
+
echo " Linux: apt-get install chromium-browser # or google-chrome-stable"
|
|
165
|
+
echo " Windows: choco install googlechrome"
|
|
166
|
+
echo ""
|
|
167
|
+
echo "Continuing without Lighthouse audit..."
|
|
168
|
+
echo ""
|
|
169
|
+
else
|
|
170
|
+
echo "🔦 Building web export for Lighthouse..."
|
|
171
|
+
$RUNNER export:web
|
|
172
|
+
if [ $? -ne 0 ]; then
|
|
173
|
+
echo "❌ Web export failed. Please fix build errors before pushing."
|
|
174
|
+
exit 1
|
|
175
|
+
fi
|
|
176
|
+
|
|
177
|
+
echo "🔦 Running Lighthouse CI performance audit..."
|
|
178
|
+
LIGHTHOUSE_OUTPUT=$($RUNNER lighthouse:check 2>&1)
|
|
179
|
+
LIGHTHOUSE_EXIT=$?
|
|
180
|
+
echo "$LIGHTHOUSE_OUTPUT"
|
|
181
|
+
|
|
182
|
+
# Extract report URL from output
|
|
183
|
+
REPORT_URL=$(echo "$LIGHTHOUSE_OUTPUT" | grep -o 'https://storage.googleapis.com/[^ ]*\.html' | head -1)
|
|
184
|
+
|
|
185
|
+
if [ $LIGHTHOUSE_EXIT -ne 0 ]; then
|
|
186
|
+
echo ""
|
|
187
|
+
echo "❌ Lighthouse CI performance audit failed!"
|
|
188
|
+
echo ""
|
|
189
|
+
echo "Your changes caused performance regressions that exceed the allowed thresholds."
|
|
190
|
+
echo ""
|
|
191
|
+
if [ -n "$REPORT_URL" ]; then
|
|
192
|
+
echo "📊 View full report: $REPORT_URL"
|
|
193
|
+
echo ""
|
|
194
|
+
fi
|
|
195
|
+
echo "Common fixes:"
|
|
196
|
+
echo " • Bundle size too large → Remove unused dependencies, add code splitting"
|
|
197
|
+
echo " • LCP/FCP too slow → Optimize images, reduce render-blocking resources"
|
|
198
|
+
echo " • CLS too high → Add explicit dimensions to images/containers"
|
|
199
|
+
echo " • Too much unused JS → Implement lazy loading for non-critical code"
|
|
200
|
+
echo ""
|
|
201
|
+
echo "See lighthouserc.js for threshold details."
|
|
202
|
+
echo ""
|
|
203
|
+
exit 1
|
|
204
|
+
fi
|
|
205
|
+
echo "✅ Lighthouse CI performance audit passed"
|
|
206
|
+
fi
|
|
207
|
+
fi
|
|
208
|
+
|
|
209
|
+
exit 0
|
|
210
|
+
|
|
211
|
+
# END: AI GUARDRAILS
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Hook script to format files with Prettier after Claude edits them
|
|
4
|
+
# This script receives JSON input via stdin with tool information
|
|
5
|
+
# Reference: https://docs.claude.com/en/docs/claude-code/hooks
|
|
6
|
+
|
|
7
|
+
# Read the JSON input from stdin
|
|
8
|
+
JSON_INPUT=$(cat)
|
|
9
|
+
|
|
10
|
+
# Extract the file path from the tool_input
|
|
11
|
+
# The Edit tool input contains a "file_path" field in the tool_input object
|
|
12
|
+
FILE_PATH=$(echo "$JSON_INPUT" | grep -o '"tool_input":{[^}]*"file_path":"[^"]*"' | grep -o '"file_path":"[^"]*"' | cut -d'"' -f4)
|
|
13
|
+
|
|
14
|
+
# Check if we successfully extracted a file path
|
|
15
|
+
if [ -z "$FILE_PATH" ]; then
|
|
16
|
+
echo "⚠ Skipping Prettier: Could not extract file path from Edit tool input" >&2
|
|
17
|
+
exit 0 # Exit gracefully to not interrupt Claude's workflow
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
# Check if the file exists
|
|
21
|
+
if [ ! -f "$FILE_PATH" ]; then
|
|
22
|
+
echo "⚠ Skipping Prettier: File does not exist: $FILE_PATH" >&2
|
|
23
|
+
exit 0 # Exit gracefully
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
# Get the file extension
|
|
27
|
+
FILE_EXT="${FILE_PATH##*.}"
|
|
28
|
+
|
|
29
|
+
# Check if this is a TypeScript or JavaScript file that should be formatted
|
|
30
|
+
# Based on package.json format command: "prettier --write \"src/**/*.ts\" \"test/**/*.ts\""
|
|
31
|
+
case "$FILE_EXT" in
|
|
32
|
+
ts|tsx|js|jsx|json)
|
|
33
|
+
# File type is supported for formatting
|
|
34
|
+
;;
|
|
35
|
+
*)
|
|
36
|
+
echo "ℹ Skipping Prettier: File type .$FILE_EXT is not configured for auto-formatting"
|
|
37
|
+
exit 0
|
|
38
|
+
;;
|
|
39
|
+
esac
|
|
40
|
+
|
|
41
|
+
# Change to the project directory to ensure package manager commands work
|
|
42
|
+
cd "$CLAUDE_PROJECT_DIR" || exit 0
|
|
43
|
+
|
|
44
|
+
# Detect package manager based on lock file presence
|
|
45
|
+
detect_package_manager() {
|
|
46
|
+
if [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
47
|
+
echo "bun"
|
|
48
|
+
elif [ -f "pnpm-lock.yaml" ]; then
|
|
49
|
+
echo "pnpm"
|
|
50
|
+
elif [ -f "yarn.lock" ]; then
|
|
51
|
+
echo "yarn"
|
|
52
|
+
elif [ -f "package-lock.json" ]; then
|
|
53
|
+
echo "npm"
|
|
54
|
+
else
|
|
55
|
+
echo "npm" # Default fallback
|
|
56
|
+
fi
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
PKG_MANAGER=$(detect_package_manager)
|
|
60
|
+
|
|
61
|
+
# Run Prettier on the specific file
|
|
62
|
+
echo "🎨 Running Prettier on: $FILE_PATH"
|
|
63
|
+
$PKG_MANAGER prettier --write "$FILE_PATH" 2>&1 | grep -v "run v" | grep -v "Done in"
|
|
64
|
+
|
|
65
|
+
# Check the exit status
|
|
66
|
+
if [ ${PIPESTATUS[0]} -eq 0 ]; then
|
|
67
|
+
echo "✓ Successfully formatted: $(basename "$FILE_PATH")"
|
|
68
|
+
else
|
|
69
|
+
echo "⚠ Prettier formatting failed for: $FILE_PATH" >&2
|
|
70
|
+
echo " You may need to run '$PKG_MANAGER run format' manually to fix formatting issues." >&2
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# Always exit successfully to not interrupt Claude's workflow
|
|
74
|
+
exit 0
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Only run package installation in remote (Claude Code web) environment
|
|
4
|
+
# node_modules are gitignored, so they need to be installed remotely
|
|
5
|
+
if [ "$CLAUDE_CODE_REMOTE" != "true" ]; then
|
|
6
|
+
exit 0
|
|
7
|
+
fi
|
|
8
|
+
|
|
9
|
+
# Detect package manager based on lock file presence
|
|
10
|
+
if [ -f "bun.lockb" ] || [ -f "bun.lock" ]; then
|
|
11
|
+
bun install
|
|
12
|
+
elif [ -f "pnpm-lock.yaml" ]; then
|
|
13
|
+
pnpm install
|
|
14
|
+
elif [ -f "yarn.lock" ]; then
|
|
15
|
+
yarn install
|
|
16
|
+
elif [ -f "package-lock.json" ]; then
|
|
17
|
+
npm install
|
|
18
|
+
else
|
|
19
|
+
npm install
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
# Install Gitleaks for secret detection (pre-commit hook)
|
|
23
|
+
echo "Installing Gitleaks for secret detection..."
|
|
24
|
+
GITLEAKS_VERSION="8.18.4"
|
|
25
|
+
curl -sSfL "https://github.com/gitleaks/gitleaks/releases/download/v${GITLEAKS_VERSION}/gitleaks_${GITLEAKS_VERSION}_linux_x64.tar.gz" | tar -xz -C /usr/local/bin gitleaks
|
|
26
|
+
echo "Gitleaks installed: $(gitleaks version)"
|
|
27
|
+
|
|
28
|
+
# Install Chromium for Lighthouse CI (pre-push hook)
|
|
29
|
+
# Playwright's bundled Chromium works with @lhci/cli
|
|
30
|
+
echo "Installing Chromium for Lighthouse CI..."
|
|
31
|
+
npx playwright install chromium
|
|
32
|
+
|
|
33
|
+
# Find and export CHROME_PATH for Lighthouse CI
|
|
34
|
+
# Use sort to ensure deterministic selection of the latest version
|
|
35
|
+
CHROME_PATH=$(find ~/.cache/ms-playwright -name "chrome" -type f 2>/dev/null | grep "chrome-linux" | sort | tail -n 1)
|
|
36
|
+
if [ -n "$CHROME_PATH" ]; then
|
|
37
|
+
# Write to .claude/env.local for project-specific env (preferred)
|
|
38
|
+
ENV_LOCAL="$CLAUDE_PROJECT_DIR/.claude/env.local"
|
|
39
|
+
if [ -f "$ENV_LOCAL" ]; then
|
|
40
|
+
# Remove old CHROME_PATH entries and add new one
|
|
41
|
+
grep -v "^export CHROME_PATH=" "$ENV_LOCAL" > "$ENV_LOCAL.tmp" 2>/dev/null || true
|
|
42
|
+
mv "$ENV_LOCAL.tmp" "$ENV_LOCAL"
|
|
43
|
+
fi
|
|
44
|
+
echo "export CHROME_PATH=\"$CHROME_PATH\"" >> "$ENV_LOCAL"
|
|
45
|
+
|
|
46
|
+
# Also append to ~/.bashrc for shell sessions (idempotent)
|
|
47
|
+
if ! grep -q "export CHROME_PATH=" ~/.bashrc 2>/dev/null; then
|
|
48
|
+
echo "export CHROME_PATH=\"$CHROME_PATH\"" >> ~/.bashrc
|
|
49
|
+
else
|
|
50
|
+
# Update existing CHROME_PATH in bashrc
|
|
51
|
+
sed -i "s|^export CHROME_PATH=.*|export CHROME_PATH=\"$CHROME_PATH\"|" ~/.bashrc
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
export CHROME_PATH="$CHROME_PATH"
|
|
55
|
+
echo "Chromium installed at: $CHROME_PATH"
|
|
56
|
+
echo "CHROME_PATH exported to: $ENV_LOCAL and ~/.bashrc"
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
exit 0
|