@the-bearded-bear/claude-craft 9.2.0 → 9.2.1-next.8ec26ae
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/Dev/i18n/base/Angular/rules/00-project-context.md.template +1 -1
- package/Dev/i18n/base/Angular/rules/03-coding-standards.md +17 -16
- package/Dev/i18n/base/Angular/rules/06-tooling.md +2 -2
- package/Dev/i18n/base/CSharp/rules/06-tooling.md +8 -6
- package/Dev/i18n/base/Common/hooks/scripts/block-dangerous-commands.sh +93 -48
- package/Dev/i18n/base/Common/hooks/scripts/guard-network.sh +58 -0
- package/Dev/i18n/base/Common/hooks/scripts/lib/hook-io.sh +181 -0
- package/Dev/i18n/base/Common/hooks/scripts/notify-slack.sh +21 -32
- package/Dev/i18n/base/Common/hooks/scripts/output-filter.sh +23 -0
- package/Dev/i18n/base/Common/hooks/scripts/output-size-hint.sh +19 -0
- package/Dev/i18n/base/Common/hooks/scripts/post-edit-lint.sh +29 -53
- package/Dev/i18n/base/Common/hooks/scripts/post-tool-failure.sh +50 -0
- package/Dev/i18n/base/Common/hooks/scripts/pre-commit-check.sh +59 -63
- package/Dev/i18n/base/Common/hooks/scripts/pre-compact.sh +52 -0
- package/Dev/i18n/base/Common/hooks/scripts/protect-sensitive-files.sh +16 -0
- package/Dev/i18n/base/Common/hooks/scripts/quality-gate.sh +49 -92
- package/Dev/i18n/base/Common/hooks/scripts/session-end.sh +51 -0
- package/Dev/i18n/base/Common/hooks/scripts/session-init.sh +45 -69
- package/Dev/i18n/base/Common/hooks/templates/examples/README.md +59 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/auto-format.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/block-dangerous-commands.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/context-reinject.json +28 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/output-filter.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/pre-compact.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/protect-files.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/security-block.json +18 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/stop-hook.json +16 -0
- package/Dev/i18n/base/Common/hooks/templates/examples/user-prompt-submit.json +16 -0
- package/Dev/i18n/base/Common/hooks/templates/hooks.default.json +72 -0
- package/Dev/i18n/base/Common/hooks/templates/{settings-hooks.json → hooks.full.json} +22 -23
- package/Dev/i18n/base/Common/hooks/templates/hooks.memory.json +62 -0
- package/Dev/i18n/base/Common/templates/AGENTS.md.template +1 -1
- package/Dev/i18n/base/Common/templates/settings.json.template +46 -0
- package/Dev/i18n/base/Flutter/rules/00-project-context.md.template +9 -9
- package/Dev/i18n/base/Laravel/checks/code-quality.md +1 -1
- package/Dev/i18n/base/Laravel/rules/00-project-context.md.template +2 -2
- package/Dev/i18n/base/Laravel/rules/06-tooling.md +10 -8
- package/Dev/i18n/base/Laravel/rules/07-testing-laravel.md +2 -0
- package/Dev/i18n/base/Laravel/rules/08-quality-tools.md +2 -2
- package/Dev/i18n/base/PHP/rules/00-project-context.md.template +2 -2
- package/Dev/i18n/base/Tauri/rules/02-architecture-tauri.md +1 -0
- package/Dev/i18n/base/Vercel/checks/all.md +1 -1
- package/Dev/i18n/base/Vercel/checks/architecture.md +1 -1
- package/Dev/i18n/base/Vercel/rules/02-architecture-vercel.md +4 -2
- package/Dev/i18n/base/Vercel/rules/06-tooling.md +7 -5
- package/Dev/i18n/base/Vercel/rules/11-security-vercel.md +1 -1
- package/Dev/i18n/base/Vite/rules/06-tooling.md +2 -1
- package/Dev/i18n/base/Vite/rules/08-quality-tools.md +1 -1
- package/Dev/i18n/base/VueJS/rules/06-tooling.md +3 -3
- package/Dev/i18n/base/VueJS/rules/07-testing-vuejs.md +9 -8
- package/Dev/i18n/base/VueJS/rules/08-quality-tools.md +1 -1
- package/Dev/i18n/base/WordPress/checklists/new-feature.md +59 -0
- package/Dev/i18n/base/WordPress/checklists/pre-commit.md +125 -0
- package/Dev/i18n/base/WordPress/checks/all.md +257 -0
- package/Dev/i18n/base/WordPress/checks/architecture.md +157 -0
- package/Dev/i18n/base/WordPress/checks/code-quality.md +158 -0
- package/Dev/i18n/base/WordPress/checks/security.md +158 -0
- package/Dev/i18n/base/WordPress/checks/testing.md +157 -0
- package/Dev/i18n/base/WordPress/commands/check.md +28 -0
- package/Dev/i18n/base/WordPress/rules/00-project-context.md.template +169 -0
- package/Dev/i18n/base/WordPress/rules/02-architecture-wordpress.md +174 -0
- package/Dev/i18n/base/WordPress/rules/03-coding-standards.md +98 -0
- package/Dev/i18n/base/WordPress/rules/06-tooling.md +146 -0
- package/Dev/i18n/base/WordPress/rules/07-testing-wordpress.md +150 -0
- package/Dev/i18n/base/WordPress/rules/08-quality-tools.md +161 -0
- package/Dev/i18n/base/WordPress/rules/11-security-wordpress.md +175 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/REFERENCE.md +214 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/SKILL.md +40 -0
- package/Dev/i18n/base/WordPress/skills/woocommerce/checklist.md +66 -0
- package/Dev/i18n/base/WordPress/templates/block.md +235 -0
- package/Dev/i18n/base/WordPress/templates/plugin-bootstrap.md +215 -0
- package/Dev/i18n/base/WordPress/templates/rest-endpoint.md +246 -0
- package/Dev/i18n/de/Angular/CLAUDE.md.template +2 -1
- package/Dev/i18n/de/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/de/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/de/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/de/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/de/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/de/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/de/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/de/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/de/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/de/Common/rules/11-security.md +12 -12
- package/Dev/i18n/de/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/de/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/de/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/de/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/de/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/de/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/de/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/de/Paperclip/README.md +1 -1
- package/Dev/i18n/de/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/de/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/de/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/de/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/de/Python/checks/security.md +2 -2
- package/Dev/i18n/de/Python/checks/testing.md +2 -2
- package/Dev/i18n/de/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/de/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/de/Python/templates/repository.md +2 -2
- package/Dev/i18n/de/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/de/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/de/React/templates/component.md +11 -9
- package/Dev/i18n/de/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/de/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/de/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/de/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/de/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/de/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/de/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/de/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/de/Symfony/adr/README.md +1 -1
- package/Dev/i18n/de/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/de/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/de/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/de/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/de/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/de/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/de/Symfony/templates/README.md +1 -1
- package/Dev/i18n/de/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/de/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/de/Vercel/checks/all.md +1 -1
- package/Dev/i18n/de/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/de/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/de/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/de/WordPress/checks/all.md +242 -0
- package/Dev/i18n/de/WordPress/commands/check.md +28 -0
- package/Dev/i18n/en/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/en/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/en/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/en/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/en/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/en/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/en/Common/hooks/HOOKS-QUICKSTART.md +31 -43
- package/Dev/i18n/en/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/en/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/en/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/en/Common/rules/11-security.md +12 -12
- package/Dev/i18n/en/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/en/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/en/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/en/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/en/Laravel/CLAUDE.md.template +1 -1
- package/Dev/i18n/en/Laravel/agents/laravel-reviewer.md +3 -3
- package/Dev/i18n/en/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/en/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/en/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/en/Paperclip/README.md +1 -1
- package/Dev/i18n/en/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/en/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/en/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/en/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/en/Python/checks/security.md +2 -2
- package/Dev/i18n/en/Python/checks/testing.md +2 -2
- package/Dev/i18n/en/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/en/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/en/Python/templates/repository.md +2 -2
- package/Dev/i18n/en/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/en/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/en/React/templates/component.md +11 -9
- package/Dev/i18n/en/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/en/ReactNative/rules/02-architecture.md +4 -4
- package/Dev/i18n/en/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/en/ReactNative/rules/07-testing-reactnative.md +1 -1
- package/Dev/i18n/en/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/en/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/en/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/en/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/en/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/en/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/en/Symfony/adr/README.md +1 -1
- package/Dev/i18n/en/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/en/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/en/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/en/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/en/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/en/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/en/Symfony/templates/README.md +1 -1
- package/Dev/i18n/en/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/en/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/en/Vercel/checks/all.md +1 -1
- package/Dev/i18n/en/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/en/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/en/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/en/WordPress/checks/all.md +241 -0
- package/Dev/i18n/en/WordPress/commands/check.md +28 -0
- package/Dev/i18n/es/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/es/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/es/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/es/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/es/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/es/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/es/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/es/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/es/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/es/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/es/Common/rules/11-security.md +12 -12
- package/Dev/i18n/es/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/es/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/es/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/es/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/es/Laravel/agents/laravel-reviewer.md +2 -2
- package/Dev/i18n/es/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/es/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/es/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/es/Paperclip/README.md +1 -1
- package/Dev/i18n/es/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/es/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/es/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/es/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/es/Python/checks/security.md +2 -2
- package/Dev/i18n/es/Python/checks/testing.md +2 -2
- package/Dev/i18n/es/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/es/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/es/Python/templates/repository.md +2 -2
- package/Dev/i18n/es/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/es/React/templates/component.md +11 -9
- package/Dev/i18n/es/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/es/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/es/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/es/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/es/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/es/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/es/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/es/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/es/Symfony/adr/README.md +1 -1
- package/Dev/i18n/es/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/es/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/es/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/es/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/es/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/es/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/es/Symfony/templates/README.md +1 -1
- package/Dev/i18n/es/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/es/Vercel/agents/vercel-reviewer.md +2 -1
- package/Dev/i18n/es/Vercel/checks/all.md +1 -1
- package/Dev/i18n/es/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/es/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/es/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/es/WordPress/checks/all.md +241 -0
- package/Dev/i18n/es/WordPress/commands/check.md +28 -0
- package/Dev/i18n/fr/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/fr/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/fr/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/fr/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/fr/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/fr/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/fr/Common/hooks/HOOKS-QUICKSTART.md +32 -44
- package/Dev/i18n/fr/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/fr/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/fr/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/fr/Common/rules/11-security.md +12 -12
- package/Dev/i18n/fr/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/fr/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/fr/Flutter/rules/02-architecture.md +4 -4
- package/Dev/i18n/fr/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/fr/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/fr/Laravel/CLAUDE.md.template +1 -1
- package/Dev/i18n/fr/Laravel/agents/laravel-reviewer.md +3 -3
- package/Dev/i18n/fr/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/fr/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/fr/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/fr/Paperclip/README.md +1 -1
- package/Dev/i18n/fr/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/fr/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/fr/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/fr/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/fr/Python/checks/security.md +2 -2
- package/Dev/i18n/fr/Python/checks/testing.md +2 -2
- package/Dev/i18n/fr/Python/commands/dependency-audit.md +1 -2
- package/Dev/i18n/fr/Python/commands/generate-endpoint.md +7 -11
- package/Dev/i18n/fr/Python/commands/generate-model.md +6 -6
- package/Dev/i18n/fr/Python/rules/02-architecture.md +9 -24
- package/Dev/i18n/fr/Python/rules/03-coding-standards.md +19 -7
- package/Dev/i18n/fr/Python/templates/repository.md +9 -10
- package/Dev/i18n/fr/React/commands/generate-component.md +52 -51
- package/Dev/i18n/fr/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/fr/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/fr/React/templates/component.md +11 -9
- package/Dev/i18n/fr/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/fr/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/fr/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/fr/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/fr/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/fr/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/fr/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/fr/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/fr/Symfony/adr/README.md +1 -1
- package/Dev/i18n/fr/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/fr/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/fr/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/fr/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/fr/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/fr/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/fr/Symfony/templates/README.md +1 -1
- package/Dev/i18n/fr/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/fr/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/fr/Vercel/checks/all.md +1 -1
- package/Dev/i18n/fr/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/fr/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/fr/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/fr/WordPress/checks/all.md +242 -0
- package/Dev/i18n/fr/WordPress/commands/check.md +28 -0
- package/Dev/i18n/pt/Angular/CLAUDE.md.template +3 -2
- package/Dev/i18n/pt/Angular/agents/angular-reviewer.md +23 -7
- package/Dev/i18n/pt/Common/agents/devops-engineer.md +1 -1
- package/Dev/i18n/pt/Common/agents/migration-specialist.md +1 -1
- package/Dev/i18n/pt/Common/commands/ralph-run.md +3 -3
- package/Dev/i18n/pt/Common/commands/setup-rtk.md +2 -9
- package/Dev/i18n/pt/Common/hooks/HOOKS-QUICKSTART.md +33 -45
- package/Dev/i18n/pt/Common/rules/04-solid-principles.md +2 -2
- package/Dev/i18n/pt/Common/rules/09-git-workflow.md +7 -1
- package/Dev/i18n/pt/Common/rules/10-documentation.md +2 -2
- package/Dev/i18n/pt/Common/rules/11-security.md +12 -12
- package/Dev/i18n/pt/Common/rules/12-context-management.md +5 -3
- package/Dev/i18n/pt/Flutter/commands/analyze-performance.md +1 -1
- package/Dev/i18n/pt/Flutter/rules/06-tooling.md +6 -2
- package/Dev/i18n/pt/Flutter/rules/11-security-flutter.md +1 -1
- package/Dev/i18n/pt/Laravel/agents/laravel-reviewer.md +2 -2
- package/Dev/i18n/pt/PHP/rules/03-coding-standards.md +10 -0
- package/Dev/i18n/pt/PHP/rules/06-tooling.md +7 -3
- package/Dev/i18n/pt/Paperclip/CLAUDE.md.template +2 -2
- package/Dev/i18n/pt/Paperclip/README.md +1 -1
- package/Dev/i18n/pt/Paperclip/checks/security.md +1 -0
- package/Dev/i18n/pt/Paperclip/rules/11-security-paperclip.md +3 -1
- package/Dev/i18n/pt/Python/agents/python-reviewer.md +1 -1
- package/Dev/i18n/pt/Python/checks/code-quality.md +4 -4
- package/Dev/i18n/pt/Python/checks/security.md +2 -2
- package/Dev/i18n/pt/Python/checks/testing.md +2 -2
- package/Dev/i18n/pt/Python/rules/02-architecture.md +1 -8
- package/Dev/i18n/pt/Python/rules/03-coding-standards.md +16 -5
- package/Dev/i18n/pt/Python/templates/repository.md +2 -2
- package/Dev/i18n/pt/React/rules/02-architecture.md +17 -20
- package/Dev/i18n/pt/React/rules/03-coding-standards.md +15 -16
- package/Dev/i18n/pt/React/templates/component.md +12 -10
- package/Dev/i18n/pt/ReactNative/agents/reactnative-reviewer.md +4 -4
- package/Dev/i18n/pt/ReactNative/rules/06-tooling.md +15 -14
- package/Dev/i18n/pt/ReactNative/rules/14-navigation.md +2 -0
- package/Dev/i18n/pt/Ruby/agents/ruby-reviewer.md +1 -1
- package/Dev/i18n/pt/Ruby/rules/06-tooling.md +2 -2
- package/Dev/i18n/pt/Ruby/rules/11-security-ruby.md +13 -1
- package/Dev/i18n/pt/Rust/rules/03-coding-standards.md +1 -1
- package/Dev/i18n/pt/Rust/rules/11-security-rust.md +1 -1
- package/Dev/i18n/pt/Symfony/adr/README.md +1 -1
- package/Dev/i18n/pt/Symfony/checks/code-quality.md +2 -2
- package/Dev/i18n/pt/Symfony/rules/03-coding-standards.md +15 -0
- package/Dev/i18n/pt/Symfony/rules/06-docker-hadolint.md +1 -1
- package/Dev/i18n/pt/Symfony/rules/08-quality-tools.md +1 -3
- package/Dev/i18n/pt/Symfony/rules/15-doctrine-extensions.md +5 -5
- package/Dev/i18n/pt/Symfony/rules/16-i18n.md +1 -1
- package/Dev/i18n/pt/Symfony/templates/README.md +1 -1
- package/Dev/i18n/pt/Tauri/agents/tauri-reviewer.md +3 -0
- package/Dev/i18n/pt/Vercel/agents/vercel-reviewer.md +1 -0
- package/Dev/i18n/pt/Vercel/checks/all.md +1 -1
- package/Dev/i18n/pt/Vite/agents/vite-reviewer.md +11 -11
- package/Dev/i18n/pt/WordPress/CLAUDE.md.template +100 -0
- package/Dev/i18n/pt/WordPress/agents/wordpress-reviewer.md +350 -0
- package/Dev/i18n/pt/WordPress/checks/all.md +241 -0
- package/Dev/i18n/pt/WordPress/commands/check.md +28 -0
- package/Dev/scripts/check-config.sh +1 -1
- package/Dev/scripts/install-common-rules.sh +65 -0
- package/Dev/scripts/install-from-config.sh +3 -0
- package/Dev/scripts/install-paperclip-rules.sh +1 -1
- package/Dev/scripts/install-wordpress-rules.sh +153 -0
- package/Dev/scripts/lib/merge-hooks.mjs +110 -0
- package/Dev/scripts/memory-lifecycle/README.md +10 -9
- package/Dev/scripts/memory-lifecycle/_db.sh +1 -1
- package/Dev/scripts/memory-lifecycle/post-tool.sh +1 -1
- package/Dev/scripts/memory-lifecycle/pre-compact.sh +5 -5
- package/Dev/scripts/memory-lifecycle/prompt-submit.sh +1 -1
- package/Dev/scripts/memory-lifecycle/session-end.sh +1 -1
- package/Dev/scripts/memory-lifecycle/session-start.sh +5 -4
- package/Dev/stack-profiles/wordpress/permissions.txt +10 -0
- package/Dev/stack-profiles/wordpress/quality.md +4 -0
- package/Dev/stack-profiles/wordpress/stack.txt +2 -0
- package/Infra/i18n/de/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/de/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/de/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/de/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/de/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/de/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/de/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/de/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/de/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/de/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/de/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/de/Hcloud/agents/hcloud-architect.md +16 -14
- package/Infra/i18n/de/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/de/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/de/Hcloud/agents/hcloud-security.md +1 -1
- package/Infra/i18n/de/Hcloud/commands/architecture.md +2 -2
- package/Infra/i18n/de/Hcloud/commands/debug.md +3 -3
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/de/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/de/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/de/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/de/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/de/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/de/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/de/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/en/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/en/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/en/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/en/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/en/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/en/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/en/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/en/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/en/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/en/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/en/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/en/Hcloud/agents/hcloud-architect.md +10 -8
- package/Infra/i18n/en/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/en/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/en/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/en/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/en/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/en/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/en/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/en/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/en/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/es/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/es/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/es/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/es/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/es/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/es/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/es/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/es/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/es/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/es/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/es/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/es/Hcloud/agents/hcloud-architect.md +11 -9
- package/Infra/i18n/es/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/es/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/es/Hcloud/commands/debug.md +1 -1
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/es/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/es/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/es/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/es/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/es/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/es/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/es/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/fr/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/fr/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/fr/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/fr/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/fr/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/fr/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/fr/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/fr/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/fr/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/fr/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/fr/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/fr/Hcloud/agents/hcloud-architect.md +7 -5
- package/Infra/i18n/fr/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/fr/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/fr/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/fr/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/fr/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/fr/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/fr/PgBouncer/commands/deploy-setup.md +1 -1
- package/Infra/i18n/pt/Ansible/agents/ansible-architect.md +3 -1
- package/Infra/i18n/pt/Ansible/agents/ansible-debug.md +1 -0
- package/Infra/i18n/pt/Ansible/agents/ansible-deployment.md +3 -0
- package/Infra/i18n/pt/Ansible/agents/ansible-security.md +2 -0
- package/Infra/i18n/pt/Ansible/commands/security-audit.md +1 -1
- package/Infra/i18n/pt/Coolify/agents/coolify-debug.md +1 -0
- package/Infra/i18n/pt/Coolify/agents/coolify-deployment.md +5 -1
- package/Infra/i18n/pt/Coolify/commands/coolify-debug.md +1 -0
- package/Infra/i18n/pt/Coolify/commands/coolify-deploy.md +1 -0
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-architect.md +4 -2
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-deployment.md +2 -2
- package/Infra/i18n/pt/FrankenPHP/agents/frankenphp-security.md +1 -1
- package/Infra/i18n/pt/FrankenPHP/commands/deploy-setup.md +1 -1
- package/Infra/i18n/pt/Hcloud/agents/hcloud-architect.md +9 -7
- package/Infra/i18n/pt/Hcloud/agents/hcloud-cost.md +11 -9
- package/Infra/i18n/pt/Hcloud/agents/hcloud-deployment.md +1 -1
- package/Infra/i18n/pt/Hcloud/commands/architecture.md +1 -1
- package/Infra/i18n/pt/Hcloud/commands/debug.md +1 -1
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-architect.md +4 -0
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-deployment.md +31 -0
- package/Infra/i18n/pt/Kubernetes/agents/kubernetes-security.md +5 -1
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-architect.md +3 -1
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-deployment.md +2 -2
- package/Infra/i18n/pt/OpenTofu/agents/opentofu-security.md +5 -5
- package/Infra/i18n/pt/OpenTofu/commands/security-audit.md +1 -1
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-architect.md +1 -0
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-deployment.md +3 -3
- package/Infra/i18n/pt/PgBouncer/agents/pgbouncer-monitoring.md +1 -1
- package/Infra/i18n/pt/PgBouncer/commands/deploy-setup.md +1 -1
- package/README.md +27 -15
- package/Tools/PluginExport/export-plugin.sh +15 -17
- package/Tools/Ralph/README.md +17 -7
- package/Tools/Ralph/hooks/lib/ralph-common.sh +101 -0
- package/Tools/Ralph/hooks/pre-tool-context.sh +28 -0
- package/Tools/Ralph/hooks/session-restore.sh +94 -0
- package/Tools/Ralph/hooks/stop-dod-gate.sh +60 -0
- package/Tools/Ralph/lib/hooks-generator.sh +109 -93
- package/bundles/cursor/.cursorrules +11 -10
- package/bundles/windsurf/.windsurfrules +11 -10
- package/cli/index.js +1 -0
- package/cli/lib/doctor.js +4 -3
- package/cli/lib/help.js +1 -0
- package/cli/lib/installer.js +1 -1
- package/cli/lib/parse-args.js +12 -0
- package/cli/lib/tech-registry.js +15 -5
- package/package.json +2 -1
- package/Dev/i18n/de/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/de/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/de/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/de/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/en/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/en/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/en/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/en/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/es/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/es/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/es/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/es/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/fr/Common/hooks/scripts/post-tool-failure.sh +0 -88
- package/Dev/i18n/fr/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/fr/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/fr/Common/templates/settings.json.template +0 -128
- package/Dev/i18n/pt/Common/hooks/scripts/post-tool-failure.sh +0 -89
- package/Dev/i18n/pt/Common/hooks/scripts/pre-compact.sh +0 -53
- package/Dev/i18n/pt/Common/hooks/scripts/session-end.sh +0 -98
- package/Dev/i18n/pt/Common/templates/settings.json.template +0 -128
- package/Tools/Ralph/.ralph/hooks/pre-tool-context.sh +0 -100
- package/Tools/Ralph/.ralph/hooks/session-restore.sh +0 -118
- package/Tools/Ralph/.ralph/hooks/status-injector.sh +0 -147
- package/Tools/Ralph/.ralph/hooks/stop-dod-gate.sh +0 -137
|
@@ -1,58 +1,34 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
set -
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PostToolUse (Edit|Write) : formate/lint le fichier modifié selon son extension.
|
|
3
|
+
# Payload JSON lu sur stdin ; informatif, ne bloque jamais.
|
|
4
|
+
set -u
|
|
5
|
+
# shellcheck source=lib/hook-io.sh
|
|
6
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
hook_has_parser || exit 0
|
|
9
|
+
hook_input
|
|
10
|
+
FILE_PATH=$(hook_get tool_input.file_path)
|
|
11
|
+
[ -n "$FILE_PATH" ] || exit 0
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
FILE_PATH=$(echo "$INPUT" | jq -r '.tool_input.file_path // empty')
|
|
13
|
+
have() { command -v "$1" >/dev/null 2>&1; }
|
|
11
14
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
fi
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
vendor/bin/php-cs-fixer fix "$FILE_PATH" --quiet 2>/dev/null || true
|
|
31
|
-
fi
|
|
32
|
-
;;
|
|
33
|
-
py)
|
|
34
|
-
if command -v black &> /dev/null; then
|
|
35
|
-
black --quiet "$FILE_PATH" 2>/dev/null || true
|
|
36
|
-
fi
|
|
37
|
-
if command -v isort &> /dev/null; then
|
|
38
|
-
isort --quiet "$FILE_PATH" 2>/dev/null || true
|
|
39
|
-
fi
|
|
40
|
-
;;
|
|
41
|
-
dart)
|
|
42
|
-
if command -v dart &> /dev/null; then
|
|
43
|
-
dart format "$FILE_PATH" 2>/dev/null || true
|
|
44
|
-
fi
|
|
45
|
-
;;
|
|
46
|
-
go)
|
|
47
|
-
if command -v gofmt &> /dev/null; then
|
|
48
|
-
gofmt -w "$FILE_PATH" 2>/dev/null || true
|
|
49
|
-
fi
|
|
50
|
-
;;
|
|
51
|
-
rs)
|
|
52
|
-
if command -v rustfmt &> /dev/null; then
|
|
53
|
-
rustfmt "$FILE_PATH" 2>/dev/null || true
|
|
54
|
-
fi
|
|
55
|
-
;;
|
|
15
|
+
case "${FILE_PATH##*.}" in
|
|
16
|
+
js | jsx | ts | tsx)
|
|
17
|
+
if have npx && [ -f package.json ]; then npx --no-install eslint --fix "$FILE_PATH" >/dev/null 2>&1 || true; fi
|
|
18
|
+
;;
|
|
19
|
+
php)
|
|
20
|
+
if have php-cs-fixer; then
|
|
21
|
+
php-cs-fixer fix "$FILE_PATH" --quiet >/dev/null 2>&1 || true
|
|
22
|
+
elif [ -x vendor/bin/php-cs-fixer ]; then
|
|
23
|
+
vendor/bin/php-cs-fixer fix "$FILE_PATH" --quiet >/dev/null 2>&1 || true
|
|
24
|
+
fi
|
|
25
|
+
;;
|
|
26
|
+
py)
|
|
27
|
+
if have black; then black --quiet "$FILE_PATH" >/dev/null 2>&1 || true; fi
|
|
28
|
+
if have isort; then isort --quiet "$FILE_PATH" >/dev/null 2>&1 || true; fi
|
|
29
|
+
;;
|
|
30
|
+
dart) if have dart; then dart format "$FILE_PATH" >/dev/null 2>&1 || true; fi ;;
|
|
31
|
+
go) if have gofmt; then gofmt -w "$FILE_PATH" >/dev/null 2>&1 || true; fi ;;
|
|
32
|
+
rs) if have rustfmt; then rustfmt "$FILE_PATH" >/dev/null 2>&1 || true; fi ;;
|
|
56
33
|
esac
|
|
57
|
-
|
|
58
34
|
exit 0
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PostToolUseFailure : journalise l'échec d'un outil et, quand une piste de
|
|
3
|
+
# récupération est connue, la transmet au modèle (hookSpecificOutput.additionalContext).
|
|
4
|
+
# Les messages ci-dessous s'adressent au modèle et aux journaux : en anglais, quelle
|
|
5
|
+
# que soit la langue d'installation.
|
|
6
|
+
set -u
|
|
7
|
+
# shellcheck source=lib/hook-io.sh
|
|
8
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
9
|
+
|
|
10
|
+
hook_has_parser || exit 0
|
|
11
|
+
hook_input
|
|
12
|
+
TOOL=$(hook_get tool_name)
|
|
13
|
+
ERROR=$(hook_get error)
|
|
14
|
+
CWD=$(hook_get cwd)
|
|
15
|
+
[ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
|
|
16
|
+
|
|
17
|
+
has() { printf '%s' "$ERROR" | grep -qiE -e "$1"; }
|
|
18
|
+
|
|
19
|
+
# Piste de récupération (vide = aucune) selon l'outil et le message d'erreur.
|
|
20
|
+
recovery_hint() {
|
|
21
|
+
case "$TOOL" in
|
|
22
|
+
Bash)
|
|
23
|
+
if has "command not found"; then printf 'Command not found. Check that it is installed, or run it in a Docker container.'
|
|
24
|
+
elif has "permission denied"; then printf 'Permission denied. Check file permissions instead of retrying with elevated rights.'
|
|
25
|
+
elif has "no such file or directory"; then printf 'File or directory not found. Check that the path exists.'
|
|
26
|
+
elif has "timeout|timed out"; then printf 'Command timed out. Raise the timeout or narrow the command.'
|
|
27
|
+
fi ;;
|
|
28
|
+
Edit | Write)
|
|
29
|
+
if has "permission denied"; then printf 'Write permission denied. Check the file permissions.'
|
|
30
|
+
elif has "no such file"; then printf 'The target directory may not exist. Create the parent directories first.'
|
|
31
|
+
elif has "not unique|multiple matches|found [0-9]+ matches"; then printf 'old_string is not unique. Provide more surrounding context.'
|
|
32
|
+
fi ;;
|
|
33
|
+
Read)
|
|
34
|
+
if has "no such file"; then printf 'File not found. Use Glob to locate the right path.'
|
|
35
|
+
elif has "is a directory"; then printf 'The target is a directory, not a file. Use ls or Glob to list its content.'
|
|
36
|
+
fi ;;
|
|
37
|
+
Glob | Grep) printf 'Search failed. Check the pattern syntax and the path.' ;;
|
|
38
|
+
Agent | Task) has "timeout|timed out" && printf 'Sub-agent timed out. Consider splitting the task into smaller parts.' ;;
|
|
39
|
+
esac
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
severity=ERROR
|
|
43
|
+
case "$TOOL" in Read | Glob | Grep) severity=WARN ;; esac
|
|
44
|
+
mkdir -p .claude/logs 2>/dev/null
|
|
45
|
+
printf '[%s] [%s] [%s] %s\n' "$(date -u +%Y-%m-%dT%H:%M:%SZ)" "$severity" "$TOOL" \
|
|
46
|
+
"$(printf '%s' "$ERROR" | tr '\n' ' ' | cut -c1-300)" >>.claude/logs/tool-failures.log 2>/dev/null
|
|
47
|
+
|
|
48
|
+
HINT=$(recovery_hint)
|
|
49
|
+
[ -z "$HINT" ] || hook_context PostToolUseFailure "$HINT"
|
|
50
|
+
exit 0
|
|
@@ -1,72 +1,68 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PreToolUse(Bash) : avant un `git [-C dir] commit`, refuse les fichiers sensibles
|
|
3
|
+
# (.env, clés, credentials…) et les secrets à fort signal (clé privée, AWS, GitHub, Slack).
|
|
4
|
+
# La détection du commit se fait ici (position de commande, corps de heredoc ignorés) :
|
|
5
|
+
# un matcher `Bash(git commit:*)` ne correspond jamais au nom d'outil.
|
|
6
|
+
# Si la commande contient aussi `git add` ou `commit -a`, les fichiers modifiés et non
|
|
7
|
+
# suivis sont examinés en plus de l'index (ils seront committés par cette même commande).
|
|
8
|
+
set -u
|
|
9
|
+
# shellcheck source=lib/hook-io.sh
|
|
10
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
5
11
|
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
hook_require_parser
|
|
13
|
+
hook_input
|
|
14
|
+
CMD=$(hook_get tool_input.command)
|
|
15
|
+
[ -n "$CMD" ] || exit 0
|
|
16
|
+
cwd=$(hook_get cwd)
|
|
17
|
+
[ -z "$cwd" ] || cd "$cwd" 2>/dev/null || exit 0
|
|
8
18
|
|
|
9
|
-
#
|
|
10
|
-
|
|
19
|
+
# Lignes émises : `commit`, `all` (commit -a), `add` (git add), `dir <chemin>` (git -C).
|
|
20
|
+
facts=$(printf '%s\n' "$CMD" | hook_strip_heredocs | tr "'\"" ' ' | awk '
|
|
21
|
+
{ buf = buf $0 ";" }
|
|
22
|
+
END {
|
|
23
|
+
ns = split(buf, stmts, /[;&|()`{}]/)
|
|
24
|
+
for (s = 1; s <= ns; s++) {
|
|
25
|
+
nt = split(stmts[s], t); i = 1
|
|
26
|
+
while (i <= nt && (t[i] ~ /^(sudo|env|nohup|command|exec|time|nice)$/ || t[i] ~ /^[A-Za-z_][A-Za-z0-9_]*=/)) i++
|
|
27
|
+
if (i > nt || t[i] != "git") continue
|
|
28
|
+
dir = ""; j = i + 1
|
|
29
|
+
while (j <= nt && t[j] ~ /^-/) {
|
|
30
|
+
if (t[j] == "-C" && j < nt) { dir = t[j + 1]; j += 2 } else if (t[j] == "-c") j += 2; else j++
|
|
31
|
+
}
|
|
32
|
+
if (j > nt) continue
|
|
33
|
+
if (t[j] == "add") print "add"
|
|
34
|
+
if (t[j] != "commit") continue
|
|
35
|
+
print "commit"
|
|
36
|
+
if (dir != "") print "dir " dir
|
|
37
|
+
for (k = j + 1; k <= nt; k++) if (t[k] == "--all" || t[k] ~ /^-[a-zA-Z]*a/ && t[k] !~ /^--/) print "all"
|
|
38
|
+
}
|
|
39
|
+
}')
|
|
11
40
|
|
|
12
|
-
|
|
13
|
-
check_secrets() {
|
|
14
|
-
local patterns=(
|
|
15
|
-
"password\s*="
|
|
16
|
-
"api_key\s*="
|
|
17
|
-
"secret\s*="
|
|
18
|
-
"token\s*="
|
|
19
|
-
"AWS_ACCESS_KEY"
|
|
20
|
-
"AWS_SECRET_KEY"
|
|
21
|
-
"PRIVATE_KEY"
|
|
22
|
-
"-----BEGIN.*PRIVATE KEY-----"
|
|
23
|
-
)
|
|
41
|
+
case "$facts" in *commit*) ;; *) exit 0 ;; esac
|
|
24
42
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
done
|
|
30
|
-
return 0
|
|
31
|
-
}
|
|
43
|
+
dir=$(printf '%s\n' "$facts" | sed -n 's/^dir //p' | head -n 1)
|
|
44
|
+
[ -z "$dir" ] || cd "$dir" 2>/dev/null || exit 0
|
|
45
|
+
top=$(git rev-parse --show-toplevel 2>/dev/null) || exit 0
|
|
46
|
+
cd "$top" || exit 0
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
while read -r file; do
|
|
37
|
-
if [ -f "$file" ]; then
|
|
38
|
-
size=$(stat -f%z "$file" 2>/dev/null || stat -c%s "$file" 2>/dev/null)
|
|
39
|
-
if [ "$size" -gt "$max_size" ]; then
|
|
40
|
-
echo "File too large: $file ($size bytes)" >&2
|
|
41
|
-
return 1
|
|
42
|
-
fi
|
|
43
|
-
fi
|
|
44
|
-
done < <(git diff --cached --name-only 2>/dev/null)
|
|
45
|
-
return 0
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
# Check for .env files
|
|
49
|
-
check_env_files() {
|
|
50
|
-
if git diff --cached --name-only 2>/dev/null | grep -qE "\.env$|\.env\..+$"; then
|
|
51
|
-
echo "BLOCKED: Attempting to commit .env file" >&2
|
|
52
|
-
return 1
|
|
53
|
-
fi
|
|
54
|
-
return 0
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
# Main checks
|
|
58
|
-
if ! check_env_files; then
|
|
59
|
-
exit 2
|
|
48
|
+
files=$(git diff --cached --name-only 2>/dev/null)
|
|
49
|
+
if printf '%s\n' "$facts" | grep -qxE 'add|all'; then
|
|
50
|
+
files=$(printf '%s\n%s\n%s\n' "$files" "$(git diff --name-only HEAD 2>/dev/null)" "$(git ls-files -o --exclude-standard 2>/dev/null)")
|
|
60
51
|
fi
|
|
52
|
+
files=$(printf '%s\n' "$files" | sed '/^$/d' | sort -u)
|
|
53
|
+
[ -n "$files" ] || exit 0
|
|
61
54
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
55
|
+
existing=()
|
|
56
|
+
while IFS= read -r f; do
|
|
57
|
+
if is_sensitive_path "$f"; then hook_block "Attempting to commit a sensitive file: $f"; fi
|
|
58
|
+
[ -f "$f" ] && existing+=("$f")
|
|
59
|
+
done <<EOF
|
|
60
|
+
$files
|
|
61
|
+
EOF
|
|
62
|
+
[ ${#existing[@]} -gt 0 ] || exit 0
|
|
70
63
|
|
|
71
|
-
|
|
64
|
+
for p in '-----BEGIN [A-Z ]*PRIVATE KEY-----' 'AKIA[0-9A-Z]{16}' 'ghp_[A-Za-z0-9]{36}' 'xox[baprs]-[A-Za-z0-9-]{10,}'; do
|
|
65
|
+
hit=$(grep -lIE -e "$p" -- "${existing[@]}" 2>/dev/null | head -n 1)
|
|
66
|
+
[ -z "$hit" ] || hook_block "Potential secret detected in $hit"
|
|
67
|
+
done
|
|
72
68
|
exit 0
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PreCompact (optionnel, projets BMAD) : sauvegarde l'état du sprint/de la story/de la
|
|
3
|
+
# session de recette avant la compaction. Le stdout d'un hook PreCompact est lu comme
|
|
4
|
+
# consignes de compaction : on émet donc du TEXTE BRUT (pas de JSON). Non branché par
|
|
5
|
+
# défaut : la réinjection de context-essentials.md est déjà assurée par le fragment
|
|
6
|
+
# `default` (PreCompact + SessionStart compact).
|
|
7
|
+
set -u
|
|
8
|
+
# shellcheck source=lib/hook-io.sh
|
|
9
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
10
|
+
|
|
11
|
+
hook_has_parser || exit 0
|
|
12
|
+
hook_input
|
|
13
|
+
CWD=$(hook_get cwd)
|
|
14
|
+
[ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
|
|
15
|
+
SESSION_ID=$(hook_get session_id)
|
|
16
|
+
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
17
|
+
STAMP=$(date -u +%Y%m%d%H%M%S)
|
|
18
|
+
mkdir -p .claude/logs
|
|
19
|
+
log() { printf '[%s] [COMPACT] %s\n' "$NOW" "$1" >>.claude/logs/session.log; }
|
|
20
|
+
|
|
21
|
+
# backup <fichier> <dossier> <nom> : copie horodatée, journalisée.
|
|
22
|
+
backup() {
|
|
23
|
+
mkdir -p "$2" && cp "$1" "$2/$3-$STAMP.yaml" && log "Backed up $1"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
# Ne garde que les 10 sauvegardes les plus récentes d'un dossier.
|
|
27
|
+
prune() {
|
|
28
|
+
local f i=0
|
|
29
|
+
while IFS= read -r f; do
|
|
30
|
+
i=$((i + 1))
|
|
31
|
+
[ "$i" -le 10 ] || rm -f "$f"
|
|
32
|
+
done < <(ls -t "$1"/*.yaml 2>/dev/null)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
log "Context compaction triggered (session: ${SESSION_ID:-unknown})"
|
|
36
|
+
SAVED=""
|
|
37
|
+
if [ -f .bmad/sprint-status.yaml ]; then
|
|
38
|
+
backup .bmad/sprint-status.yaml .bmad/backups sprint-status && SAVED="$SAVED .bmad/sprint-status.yaml"
|
|
39
|
+
fi
|
|
40
|
+
if [ -f .bmad/current-story.yaml ]; then
|
|
41
|
+
backup .bmad/current-story.yaml .bmad/backups current-story && SAVED="$SAVED .bmad/current-story.yaml"
|
|
42
|
+
fi
|
|
43
|
+
if [ -d .recette/sessions ]; then
|
|
44
|
+
ACTIVE=$(find .recette/sessions -name '*.yaml' -mmin -60 2>/dev/null | head -n 1)
|
|
45
|
+
[ -z "$ACTIVE" ] || backup "$ACTIVE" .recette/backups "$(basename "$ACTIVE" .yaml)"
|
|
46
|
+
fi
|
|
47
|
+
for d in .bmad/backups .recette/backups; do
|
|
48
|
+
[ ! -d "$d" ] || prune "$d"
|
|
49
|
+
done
|
|
50
|
+
|
|
51
|
+
[ -z "$SAVED" ] || printf 'When compacting, keep the current BMAD sprint and story context (backed up:%s).\n' "$SAVED"
|
|
52
|
+
exit 0
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PreToolUse(Edit|Write|NotebookEdit) : refuse l'écriture des fichiers de secrets
|
|
3
|
+
# (.env, clés, credentials). Les fichiers d'exemple (.env.example…) restent éditables.
|
|
4
|
+
set -u
|
|
5
|
+
# shellcheck source=lib/hook-io.sh
|
|
6
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
7
|
+
|
|
8
|
+
hook_require_parser
|
|
9
|
+
hook_input
|
|
10
|
+
FILE=$(hook_get tool_input.file_path)
|
|
11
|
+
[ -n "$FILE" ] || FILE=$(hook_get tool_input.notebook_path)
|
|
12
|
+
|
|
13
|
+
if [ -n "$FILE" ] && is_sensitive_path "$FILE"; then
|
|
14
|
+
hook_block "Cannot modify sensitive file: $FILE"
|
|
15
|
+
fi
|
|
16
|
+
exit 0
|
|
@@ -1,99 +1,56 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#
|
|
3
|
-
#
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
#
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
# Python
|
|
35
|
-
if [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then
|
|
36
|
-
if command -v pytest &> /dev/null; then
|
|
37
|
-
if pytest -q 2>/dev/null; then
|
|
38
|
-
return 0
|
|
39
|
-
else
|
|
40
|
-
return 1
|
|
41
|
-
fi
|
|
42
|
-
fi
|
|
43
|
-
fi
|
|
44
|
-
|
|
45
|
-
# Flutter / Dart
|
|
46
|
-
if [ -f "pubspec.yaml" ]; then
|
|
47
|
-
if command -v flutter &> /dev/null; then
|
|
48
|
-
if flutter test --reporter compact 2>/dev/null; then
|
|
49
|
-
return 0
|
|
50
|
-
else
|
|
51
|
-
return 1
|
|
52
|
-
fi
|
|
53
|
-
fi
|
|
54
|
-
fi
|
|
55
|
-
|
|
56
|
-
# Go
|
|
57
|
-
if [ -f "go.mod" ]; then
|
|
58
|
-
if go test ./... 2>/dev/null; then
|
|
59
|
-
return 0
|
|
60
|
-
else
|
|
61
|
-
return 1
|
|
62
|
-
fi
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# No tests found — warn but pass by default
|
|
66
|
-
echo "WARNING: No test framework detected — quality gate passed by default" >&2
|
|
67
|
-
return 0
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Stop : exécute les tests avant que Claude s'arrête ; en cas d'échec, refuse l'arrêt
|
|
3
|
+
# avec {"decision":"block","reason":…} (stdout = ce seul JSON ; sinon stdout vide).
|
|
4
|
+
# - stop_hook_active=true : on ne bloque jamais (sinon boucle infinie)
|
|
5
|
+
# - toute la sortie des tests va dans .claude/logs/quality-gate.log
|
|
6
|
+
# - QUALITY_GATE_CMD surcharge la détection (npm test, phpunit, pytest, flutter, go)
|
|
7
|
+
# - après un succès, les tests sont sautés tant que l'arbre git ne change pas
|
|
8
|
+
set -u
|
|
9
|
+
# shellcheck source=lib/hook-io.sh
|
|
10
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
11
|
+
|
|
12
|
+
hook_has_parser || exit 0
|
|
13
|
+
hook_input
|
|
14
|
+
[ "$(hook_get stop_hook_active)" = "true" ] && exit 0
|
|
15
|
+
cwd=$(hook_get cwd)
|
|
16
|
+
[ -z "$cwd" ] || cd "$cwd" 2>/dev/null || exit 0
|
|
17
|
+
|
|
18
|
+
# Commande de test du projet (vide si aucun framework détecté).
|
|
19
|
+
detect_cmd() {
|
|
20
|
+
if [ -n "${QUALITY_GATE_CMD:-}" ]; then printf '%s' "$QUALITY_GATE_CMD"; return; fi
|
|
21
|
+
if [ -f package.json ]; then
|
|
22
|
+
local saved=$HOOK_INPUT script
|
|
23
|
+
HOOK_INPUT=$(cat package.json)
|
|
24
|
+
script=$(hook_get scripts.test)
|
|
25
|
+
HOOK_INPUT=$saved
|
|
26
|
+
case "$script" in "" | *"no test specified"*) ;; *) printf 'npm test'; return ;; esac
|
|
27
|
+
fi
|
|
28
|
+
if [ -f composer.json ] && [ -x vendor/bin/phpunit ]; then printf 'vendor/bin/phpunit'
|
|
29
|
+
elif { [ -f pyproject.toml ] || [ -f setup.py ]; } && command -v pytest >/dev/null 2>&1; then printf 'pytest -q'
|
|
30
|
+
elif [ -f pubspec.yaml ] && command -v flutter >/dev/null 2>&1; then printf 'flutter test'
|
|
31
|
+
elif [ -f go.mod ] && command -v go >/dev/null 2>&1; then printf 'go test ./...'
|
|
32
|
+
fi
|
|
68
33
|
}
|
|
69
34
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
# PHP
|
|
73
|
-
if [ -f "vendor/bin/phpstan" ]; then
|
|
74
|
-
vendor/bin/phpstan analyse --no-progress 2>/dev/null || return 1
|
|
75
|
-
fi
|
|
76
|
-
|
|
77
|
-
# TypeScript
|
|
78
|
-
if [ -f "tsconfig.json" ] && command -v npx &> /dev/null; then
|
|
79
|
-
npx tsc --noEmit 2>/dev/null || return 1
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
return 0
|
|
83
|
-
}
|
|
35
|
+
cmd=$(detect_cmd)
|
|
36
|
+
[ -n "$cmd" ] || exit 0
|
|
84
37
|
|
|
85
|
-
#
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
38
|
+
# Empreinte de l'arbre de travail (hors journaux) : vide hors dépôt git => pas de cache.
|
|
39
|
+
fingerprint=""
|
|
40
|
+
if git rev-parse --git-dir >/dev/null 2>&1; then
|
|
41
|
+
fingerprint=$({ git status --porcelain -- . ':!.claude/logs'; git diff HEAD -- . ':!.claude/logs'; } 2>/dev/null | cksum)
|
|
89
42
|
fi
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
echo '{"continue": true, "systemMessage": "Warning: Static analysis found issues. Consider reviewing."}'
|
|
94
|
-
exit 0
|
|
43
|
+
ok_file=.claude/logs/quality-gate.ok
|
|
44
|
+
if [ -n "$fingerprint" ] && [ -f "$ok_file" ] && [ "$(cat "$ok_file")" = "$fingerprint" ]; then
|
|
45
|
+
exit 0
|
|
95
46
|
fi
|
|
96
47
|
|
|
97
|
-
|
|
98
|
-
|
|
48
|
+
mkdir -p .claude/logs
|
|
49
|
+
log=.claude/logs/quality-gate.log
|
|
50
|
+
if bash -c "$cmd" >"$log" 2>&1; then
|
|
51
|
+
printf '%s' "$fingerprint" >"$ok_file"
|
|
52
|
+
exit 0
|
|
53
|
+
fi
|
|
54
|
+
rm -f "$ok_file"
|
|
55
|
+
hook_stop_block "$(printf 'Tests failing:\n%s' "$(tail -n 20 "$log")")"
|
|
99
56
|
exit 0
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# SessionEnd : journalise la fin de session et ajoute une ligne de métriques JSONL.
|
|
3
|
+
# Budget par défaut d'un SessionEnd : 1,5 s — le fragment full relève `timeout` à 5.
|
|
4
|
+
# Aucune sortie n'est lue par Claude Code à ce stade : stdout reste vide.
|
|
5
|
+
set -u
|
|
6
|
+
# shellcheck source=lib/hook-io.sh
|
|
7
|
+
. "$(dirname "${BASH_SOURCE[0]}")/lib/hook-io.sh"
|
|
8
|
+
|
|
9
|
+
hook_has_parser || exit 0
|
|
10
|
+
hook_input
|
|
11
|
+
CWD=$(hook_get cwd)
|
|
12
|
+
[ -z "$CWD" ] || cd "$CWD" 2>/dev/null || true
|
|
13
|
+
SESSION_ID=$(hook_get session_id)
|
|
14
|
+
REASON=$(hook_get reason)
|
|
15
|
+
NOW=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
16
|
+
DAY=$(date -u +%Y%m%d)
|
|
17
|
+
METRICS=".claude/metrics/session-$DAY.jsonl"
|
|
18
|
+
mkdir -p .claude/logs .claude/metrics
|
|
19
|
+
|
|
20
|
+
printf '[%s] [SESSION_END] session: %s, reason: %s\n' "$NOW" "${SESSION_ID:-unknown}" "${REASON:-unknown}" >>.claude/logs/session.log
|
|
21
|
+
|
|
22
|
+
# Fichiers modifiés = entrées de `git status` (0 hors dépôt git).
|
|
23
|
+
FILES=$(git status --porcelain -- . ':!.claude' 2>/dev/null | wc -l | tr -d ' ')
|
|
24
|
+
|
|
25
|
+
# Échecs d'outils du jour ; `|| true` : grep -c affiche déjà 0 et sort en 1 sans correspondance.
|
|
26
|
+
FAILURES=0
|
|
27
|
+
if [ -f .claude/logs/tool-failures.log ]; then
|
|
28
|
+
FAILURES=$(grep -c "^\[$(date -u +%Y-%m-%d)" .claude/logs/tool-failures.log) || true
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
STORY=none
|
|
32
|
+
STATUS=unknown
|
|
33
|
+
if [ -f .bmad/current-story.yaml ]; then
|
|
34
|
+
STORY=$(grep '^id:' .bmad/current-story.yaml | head -n 1 | cut -d' ' -f2) || true
|
|
35
|
+
STATUS=$(grep '^status:' .bmad/current-story.yaml | head -n 1 | cut -d' ' -f2) || true
|
|
36
|
+
fi
|
|
37
|
+
|
|
38
|
+
hook_object timestamp "$NOW" session_id "${SESSION_ID:-unknown}" reason "${REASON:-unknown}" \
|
|
39
|
+
files_modified "${FILES:-0}" tool_failures "${FAILURES:-0}" \
|
|
40
|
+
current_story "${STORY:-none}" story_status "${STATUS:-unknown}" >>"$METRICS"
|
|
41
|
+
|
|
42
|
+
# Résumé quotidien : totaux recalculés depuis le JSONL (format compact maîtrisé).
|
|
43
|
+
total() { grep -o "\"$1\":[0-9]*" "$METRICS" | cut -d: -f2 | awk '{ s += $1 } END { print s + 0 }'; }
|
|
44
|
+
hook_object date "$(date -u +%Y-%m-%d)" total_sessions "$(wc -l <"$METRICS" | tr -d ' ')" \
|
|
45
|
+
total_files_modified "$(total files_modified)" total_tool_failures "$(total tool_failures)" \
|
|
46
|
+
generated_at "$NOW" >".claude/metrics/daily-summary-$DAY.json"
|
|
47
|
+
|
|
48
|
+
# Rétention : métriques 30 jours, journaux 7 jours.
|
|
49
|
+
find .claude/metrics -type f \( -name '*.jsonl' -o -name 'daily-summary-*.json' \) -mtime +30 -delete 2>/dev/null
|
|
50
|
+
find .claude/logs -type f -name '*.log' -mtime +7 -delete 2>/dev/null
|
|
51
|
+
exit 0
|