xtrm-tools 2.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/CHANGELOG.md +496 -0
- package/README.md +762 -0
- package/cli/dist/index.cjs +55245 -0
- package/cli/dist/index.cjs.map +1 -0
- package/cli/dist/index.d.cts +2 -0
- package/cli/package.json +43 -0
- package/config/.env.example +40 -0
- package/config/hooks.json +36 -0
- package/config/mcp_servers.json +46 -0
- package/config/mcp_servers_optional.json +53 -0
- package/config/settings.json +70 -0
- package/hooks/README.md +156 -0
- package/hooks/__pycache__/agent_context.cpython-314.pyc +0 -0
- package/hooks/agent_context.py +105 -0
- package/hooks/gitnexus/gitnexus-hook.cjs +133 -0
- package/hooks/serena-workflow-reminder.py +74 -0
- package/hooks/skill-discovery.py +90 -0
- package/hooks/skill-suggestion.py +112 -0
- package/hooks/test_agent_context.py +112 -0
- package/hooks/type-safety-enforcement.py +107 -0
- package/package.json +48 -0
- package/project-skills/main-guard/.claude/hooks/main-guard.cjs +188 -0
- package/project-skills/main-guard/.claude/settings.json +16 -0
- package/project-skills/main-guard/.claude/skills/using-main-guard/SKILL.md +135 -0
- package/project-skills/main-guard/README.md +163 -0
- package/project-skills/py-quality-gate/.claude/hooks/quality-check.py +311 -0
- package/project-skills/py-quality-gate/.claude/settings.json +16 -0
- package/project-skills/py-quality-gate/.claude/skills/using-py-quality-gate/SKILL.md +112 -0
- package/project-skills/py-quality-gate/README.md +147 -0
- package/project-skills/service-skills-set/.claude/git-hooks/__pycache__/doc_reminder.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/git-hooks/__pycache__/skill_staleness.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/git-hooks/doc_reminder.py +67 -0
- package/project-skills/service-skills-set/.claude/git-hooks/skill_staleness.py +194 -0
- package/project-skills/service-skills-set/.claude/service-registry.json +4 -0
- package/project-skills/service-skills-set/.claude/settings.json +37 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/SKILL.md +433 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/script_quality_standards.md +412 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/references/service_skill_system_guide.md +264 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/bootstrap.py +308 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/deep_dive.py +304 -0
- package/project-skills/service-skills-set/.claude/skills/creating-service-skills/scripts/scaffolder.py +482 -0
- package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/SKILL.md +231 -0
- package/project-skills/service-skills-set/.claude/skills/scoping-service-skills/scripts/scope.py +74 -0
- package/project-skills/service-skills-set/.claude/skills/updating-service-skills/SKILL.md +136 -0
- package/project-skills/service-skills-set/.claude/skills/updating-service-skills/scripts/__pycache__/drift_detector.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/skills/updating-service-skills/scripts/drift_detector.py +222 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/SKILL.md +108 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/__pycache__/cataloger.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/__pycache__/skill_activator.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/cataloger.py +74 -0
- package/project-skills/service-skills-set/.claude/skills/using-service-skills/scripts/skill_activator.py +152 -0
- package/project-skills/service-skills-set/README.md +93 -0
- package/project-skills/service-skills-set/__pycache__/install-service-skills.cpython-314.pyc +0 -0
- package/project-skills/service-skills-set/install-service-skills.py +163 -0
- package/project-skills/service-skills-set/service-skills-readme.md +236 -0
- package/project-skills/tdd-guard/.claude/settings.json +38 -0
- package/project-skills/tdd-guard/.claude/skills/using-tdd-guard/SKILL.md +74 -0
- package/project-skills/tdd-guard/CLAUDE.md +98 -0
- package/project-skills/tdd-guard/CONTRIBUTING.md +38 -0
- package/project-skills/tdd-guard/DEVELOPMENT.md +127 -0
- package/project-skills/tdd-guard/LICENSE +21 -0
- package/project-skills/tdd-guard/README.md +396 -0
- package/project-skills/tdd-guard/docs/adr/001-claude-session-subdirectory.md +52 -0
- package/project-skills/tdd-guard/docs/adr/002-secure-claude-binary-path.md +56 -0
- package/project-skills/tdd-guard/docs/adr/003-remove-configurable-data-directory.md +56 -0
- package/project-skills/tdd-guard/docs/adr/004-monorepo-architecture.md +64 -0
- package/project-skills/tdd-guard/docs/adr/005-claude-project-dir-support.md +55 -0
- package/project-skills/tdd-guard/docs/adr/006-phpunit-separate-repository.md +93 -0
- package/project-skills/tdd-guard/docs/adr/007-golangci-lint-path-support.md +83 -0
- package/project-skills/tdd-guard/docs/adr/008-storybook-reporter-design.md +182 -0
- package/project-skills/tdd-guard/docs/assets/tdd-guard-demo-screenshot.gif +0 -0
- package/project-skills/tdd-guard/docs/config-migration.md +143 -0
- package/project-skills/tdd-guard/docs/configuration.md +137 -0
- package/project-skills/tdd-guard/docs/custom-instructions.md +43 -0
- package/project-skills/tdd-guard/docs/enforcement.md +46 -0
- package/project-skills/tdd-guard/docs/ignore-patterns.md +81 -0
- package/project-skills/tdd-guard/docs/linting.md +109 -0
- package/project-skills/tdd-guard/docs/quick-commands.md +52 -0
- package/project-skills/tdd-guard/docs/session-management.md +75 -0
- package/project-skills/tdd-guard/docs/storybook-vitest-addon.md +120 -0
- package/project-skills/tdd-guard/docs/validation-model.md +63 -0
- package/project-skills/tdd-guard/eslint.config.mjs +140 -0
- package/project-skills/tdd-guard/package-lock.json +16937 -0
- package/project-skills/tdd-guard/package.json +102 -0
- package/project-skills/tdd-guard/reporters/go/README.md +67 -0
- package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main.go +127 -0
- package/project-skills/tdd-guard/reporters/go/cmd/tdd-guard-go/main_test.go +280 -0
- package/project-skills/tdd-guard/reporters/go/go.mod +3 -0
- package/project-skills/tdd-guard/reporters/go/go.sum +0 -0
- package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter.go +126 -0
- package/project-skills/tdd-guard/reporters/go/internal/formatter/formatter_test.go +264 -0
- package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader.go +26 -0
- package/project-skills/tdd-guard/reporters/go/internal/io/tee_reader_test.go +37 -0
- package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader.go +94 -0
- package/project-skills/tdd-guard/reporters/go/internal/parser/mixed_reader_test.go +198 -0
- package/project-skills/tdd-guard/reporters/go/internal/parser/parser.go +245 -0
- package/project-skills/tdd-guard/reporters/go/internal/parser/parser_test.go +547 -0
- package/project-skills/tdd-guard/reporters/go/internal/storage/storage.go +35 -0
- package/project-skills/tdd-guard/reporters/go/internal/storage/storage_test.go +113 -0
- package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer.go +103 -0
- package/project-skills/tdd-guard/reporters/go/internal/transformer/transformer_test.go +303 -0
- package/project-skills/tdd-guard/reporters/jest/README.md +102 -0
- package/project-skills/tdd-guard/reporters/jest/package.json +38 -0
- package/project-skills/tdd-guard/reporters/phpunit/.php-cs-fixer.php +28 -0
- package/project-skills/tdd-guard/reporters/phpunit/README.md +97 -0
- package/project-skills/tdd-guard/reporters/phpunit/SYNC_README.md +29 -0
- package/project-skills/tdd-guard/reporters/phpunit/composer.json +55 -0
- package/project-skills/tdd-guard/reporters/phpunit/phpunit.xml.dist +19 -0
- package/project-skills/tdd-guard/reporters/phpunit/psalm.xml +44 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/ErroredTestSubscriber.php +28 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/FailedTestSubscriber.php +28 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/IncompleteTestSubscriber.php +28 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/PassedTestSubscriber.php +27 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/SkippedTestSubscriber.php +28 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Event/TestRunnerFinishedSubscriber.php +24 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/PathValidator.php +88 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/Storage.php +26 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardExtension.php +33 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardListener.php +158 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/TddGuardSubscriber.php +35 -0
- package/project-skills/tdd-guard/reporters/phpunit/src/TestResultCollector.php +105 -0
- package/project-skills/tdd-guard/reporters/phpunit/tests/PathValidatorTest.php +74 -0
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionFailedTest.php +241 -0
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardExtensionTest.php +84 -0
- package/project-skills/tdd-guard/reporters/phpunit/tests/TddGuardStorageLocationTest.php +71 -0
- package/project-skills/tdd-guard/reporters/pytest/README.md +77 -0
- package/project-skills/tdd-guard/reporters/pytest/pyproject.toml +43 -0
- package/project-skills/tdd-guard/reporters/pytest/pytest.ini.example +7 -0
- package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/__init__.py +1 -0
- package/project-skills/tdd-guard/reporters/pytest/tdd_guard_pytest/pytest_reporter.py +134 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/__init__.py +1 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/conftest.py +3 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/helpers.py +293 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/test_config_option.py +38 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/test_path_validation.py +59 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/test_plugin_config.py +32 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/test_project_root.py +296 -0
- package/project-skills/tdd-guard/reporters/pytest/tests/test_pytest_reporter.py +137 -0
- package/project-skills/tdd-guard/reporters/rspec/Gemfile +3 -0
- package/project-skills/tdd-guard/reporters/rust/Cargo.lock +458 -0
- package/project-skills/tdd-guard/reporters/rust/Cargo.toml +33 -0
- package/project-skills/tdd-guard/reporters/rust/Makefile.example +95 -0
- package/project-skills/tdd-guard/reporters/rust/README.md +88 -0
- package/project-skills/tdd-guard/reporters/rust/src/error_parser.rs +309 -0
- package/project-skills/tdd-guard/reporters/rust/src/main.rs +464 -0
- package/project-skills/tdd-guard/reporters/rust/src/parser.rs +225 -0
- package/project-skills/tdd-guard/reporters/rust/src/transformer.rs +409 -0
- package/project-skills/tdd-guard/reporters/storybook/README.md +108 -0
- package/project-skills/tdd-guard/reporters/storybook/package-lock.json +9482 -0
- package/project-skills/tdd-guard/reporters/storybook/package.json +43 -0
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test-data.ts +22 -0
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.test.ts +190 -0
- package/project-skills/tdd-guard/reporters/storybook/src/StorybookReporter.ts +88 -0
- package/project-skills/tdd-guard/reporters/storybook/src/index.ts +12 -0
- package/project-skills/tdd-guard/reporters/storybook/src/types.ts +37 -0
- package/project-skills/tdd-guard/reporters/storybook/tsconfig.json +11 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/go.mod +3 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/go/failing/single_failing_test.go +13 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/go/import/go.mod +3 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/go/import/single_import_error_test.go +17 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/go.mod +3 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/go/passing/single_passing_test.go +13 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-failing.test.js +5 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-import-error.test.js +8 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/jest/single-passing.test.js +5 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleFailingTest.php +11 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SingleImportErrorTest.php +14 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/phpunit/SinglePassingTest.php +11 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_failing.py +3 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_import_error.py +6 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/pytest/test_single_passing.py +3 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.lock +7 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/Cargo.toml +4 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/failing/src/lib.rs +14 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.lock +7 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/Cargo.toml +4 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/import/src/lib.rs +13 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.lock +7 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/Cargo.toml +4 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/rust/passing/src/lib.rs +14 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/Calculator.js +4 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-failing.stories.js +15 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-import-error.stories.js +14 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/storybook/single-passing.stories.js +15 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-failing.test.js +7 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-import-error.test.js +9 -0
- package/project-skills/tdd-guard/reporters/test/artifacts/vitest/single-passing.test.js +7 -0
- package/project-skills/tdd-guard/reporters/test/factories/go.ts +59 -0
- package/project-skills/tdd-guard/reporters/test/factories/helpers.ts +48 -0
- package/project-skills/tdd-guard/reporters/test/factories/index.ts +7 -0
- package/project-skills/tdd-guard/reporters/test/factories/jest.ts +51 -0
- package/project-skills/tdd-guard/reporters/test/factories/phpunit.ts +63 -0
- package/project-skills/tdd-guard/reporters/test/factories/pytest.ts +41 -0
- package/project-skills/tdd-guard/reporters/test/factories/rust.ts +158 -0
- package/project-skills/tdd-guard/reporters/test/factories/storybook.ts +198 -0
- package/project-skills/tdd-guard/reporters/test/factories/vitest.ts +51 -0
- package/project-skills/tdd-guard/reporters/test/reporters.integration.test.ts +735 -0
- package/project-skills/tdd-guard/reporters/test/types.ts +28 -0
- package/project-skills/tdd-guard/reporters/vitest/README.md +64 -0
- package/project-skills/tdd-guard/reporters/vitest/package.json +35 -0
- package/project-skills/tdd-guard/src/cli/buildContext.test.ts +200 -0
- package/project-skills/tdd-guard/src/cli/buildContext.ts +48 -0
- package/project-skills/tdd-guard/src/cli/tdd-guard.test.ts +159 -0
- package/project-skills/tdd-guard/src/cli/tdd-guard.ts +48 -0
- package/project-skills/tdd-guard/src/config/Config.test.ts +538 -0
- package/project-skills/tdd-guard/src/config/Config.ts +172 -0
- package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.test.ts +58 -0
- package/project-skills/tdd-guard/src/contracts/schemas/guardSchemas.ts +8 -0
- package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.test.ts +347 -0
- package/project-skills/tdd-guard/src/contracts/schemas/lintSchemas.ts +61 -0
- package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.test.ts +24 -0
- package/project-skills/tdd-guard/src/contracts/schemas/pytestSchemas.ts +7 -0
- package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.test.ts +377 -0
- package/project-skills/tdd-guard/src/contracts/schemas/reporterSchemas.ts +75 -0
- package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.test.ts +563 -0
- package/project-skills/tdd-guard/src/contracts/schemas/toolSchemas.ts +140 -0
- package/project-skills/tdd-guard/src/contracts/types/ClientType.ts +1 -0
- package/project-skills/tdd-guard/src/contracts/types/ConfigOptions.ts +12 -0
- package/project-skills/tdd-guard/src/contracts/types/Context.ts +16 -0
- package/project-skills/tdd-guard/src/contracts/types/ModelClient.ts +3 -0
- package/project-skills/tdd-guard/src/contracts/types/ValidationResult.ts +6 -0
- package/project-skills/tdd-guard/src/guard/GuardManager.test.ts +336 -0
- package/project-skills/tdd-guard/src/guard/GuardManager.ts +83 -0
- package/project-skills/tdd-guard/src/hooks/HookEvents.test.ts +107 -0
- package/project-skills/tdd-guard/src/hooks/HookEvents.ts +39 -0
- package/project-skills/tdd-guard/src/hooks/fileTypeDetection.ts +16 -0
- package/project-skills/tdd-guard/src/hooks/postToolLint.test.ts +327 -0
- package/project-skills/tdd-guard/src/hooks/postToolLint.ts +165 -0
- package/project-skills/tdd-guard/src/hooks/processHookData.test.ts +465 -0
- package/project-skills/tdd-guard/src/hooks/processHookData.ts +203 -0
- package/project-skills/tdd-guard/src/hooks/sessionHandler.test.ts +136 -0
- package/project-skills/tdd-guard/src/hooks/sessionHandler.ts +31 -0
- package/project-skills/tdd-guard/src/hooks/userPromptHandler.test.ts +131 -0
- package/project-skills/tdd-guard/src/hooks/userPromptHandler.ts +55 -0
- package/project-skills/tdd-guard/src/index.ts +19 -0
- package/project-skills/tdd-guard/src/linters/Linter.ts +5 -0
- package/project-skills/tdd-guard/src/linters/eslint/ESLint.test.ts +183 -0
- package/project-skills/tdd-guard/src/linters/eslint/ESLint.ts +82 -0
- package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.test.ts +170 -0
- package/project-skills/tdd-guard/src/linters/golangci/GolangciLint.ts +148 -0
- package/project-skills/tdd-guard/src/processors/index.ts +1 -0
- package/project-skills/tdd-guard/src/processors/lintProcessor.ts +77 -0
- package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.test.ts +303 -0
- package/project-skills/tdd-guard/src/processors/testResults/TestResultsProcessor.ts +255 -0
- package/project-skills/tdd-guard/src/providers/LinterProvider.test.ts +43 -0
- package/project-skills/tdd-guard/src/providers/LinterProvider.ts +20 -0
- package/project-skills/tdd-guard/src/providers/ModelClientProvider.test.ts +68 -0
- package/project-skills/tdd-guard/src/providers/ModelClientProvider.ts +22 -0
- package/project-skills/tdd-guard/src/storage/FileStorage.test.ts +76 -0
- package/project-skills/tdd-guard/src/storage/FileStorage.ts +108 -0
- package/project-skills/tdd-guard/src/storage/MemoryStorage.ts +57 -0
- package/project-skills/tdd-guard/src/storage/Storage.test.ts +227 -0
- package/project-skills/tdd-guard/src/storage/Storage.ts +17 -0
- package/project-skills/tdd-guard/src/validation/context/context.test.ts +364 -0
- package/project-skills/tdd-guard/src/validation/context/context.ts +155 -0
- package/project-skills/tdd-guard/src/validation/models/AnthropicApi.test.ts +171 -0
- package/project-skills/tdd-guard/src/validation/models/AnthropicApi.ts +49 -0
- package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.test.ts +167 -0
- package/project-skills/tdd-guard/src/validation/models/ClaudeAgentSdk.ts +54 -0
- package/project-skills/tdd-guard/src/validation/models/ClaudeCli.test.ts +239 -0
- package/project-skills/tdd-guard/src/validation/models/ClaudeCli.ts +57 -0
- package/project-skills/tdd-guard/src/validation/prompts/file-types.ts +52 -0
- package/project-skills/tdd-guard/src/validation/prompts/operations/edit.ts +58 -0
- package/project-skills/tdd-guard/src/validation/prompts/operations/multi-edit.ts +54 -0
- package/project-skills/tdd-guard/src/validation/prompts/operations/write.ts +54 -0
- package/project-skills/tdd-guard/src/validation/prompts/response.ts +40 -0
- package/project-skills/tdd-guard/src/validation/prompts/rules.ts +51 -0
- package/project-skills/tdd-guard/src/validation/prompts/system-prompt.ts +10 -0
- package/project-skills/tdd-guard/src/validation/prompts/tools/lint-results.ts +15 -0
- package/project-skills/tdd-guard/src/validation/prompts/tools/test-output.ts +14 -0
- package/project-skills/tdd-guard/src/validation/prompts/tools/todos.ts +9 -0
- package/project-skills/tdd-guard/src/validation/validator.test.ts +268 -0
- package/project-skills/tdd-guard/src/validation/validator.ts +159 -0
- package/project-skills/tdd-guard/test/artifacts/go/.golangci.yml +6 -0
- package/project-skills/tdd-guard/test/artifacts/go/with-issues/file-with-issues.go +12 -0
- package/project-skills/tdd-guard/test/artifacts/go/with-issues/go.mod +3 -0
- package/project-skills/tdd-guard/test/artifacts/go/without-issues/file-without-issues.go +7 -0
- package/project-skills/tdd-guard/test/artifacts/go/without-issues/go.mod +3 -0
- package/project-skills/tdd-guard/test/artifacts/javascript/eslint.config.js +20 -0
- package/project-skills/tdd-guard/test/artifacts/javascript/file-with-issues.js +12 -0
- package/project-skills/tdd-guard/test/artifacts/javascript/file-without-issues.js +10 -0
- package/project-skills/tdd-guard/test/hooks/fileTypeDetection.test.ts +26 -0
- package/project-skills/tdd-guard/test/hooks/processHookData.fileType.test.ts +46 -0
- package/project-skills/tdd-guard/test/hooks/processHookData.python.test.ts +68 -0
- package/project-skills/tdd-guard/test/integration/test-context.test.ts +66 -0
- package/project-skills/tdd-guard/test/integration/validator.core.test.ts +96 -0
- package/project-skills/tdd-guard/test/integration/validator.scenarios.test.ts +497 -0
- package/project-skills/tdd-guard/test/utils/assertions.ts +29 -0
- package/project-skills/tdd-guard/test/utils/factories/contextFactory.ts +30 -0
- package/project-skills/tdd-guard/test/utils/factories/editFactory.ts +82 -0
- package/project-skills/tdd-guard/test/utils/factories/helpers.test.ts +46 -0
- package/project-skills/tdd-guard/test/utils/factories/helpers.ts +46 -0
- package/project-skills/tdd-guard/test/utils/factories/lintFactory.ts +352 -0
- package/project-skills/tdd-guard/test/utils/factories/modelClientProviderFactory.ts +21 -0
- package/project-skills/tdd-guard/test/utils/factories/multiEditFactory.ts +79 -0
- package/project-skills/tdd-guard/test/utils/factories/operations.ts +57 -0
- package/project-skills/tdd-guard/test/utils/factories/reporterFactory.ts +55 -0
- package/project-skills/tdd-guard/test/utils/factories/scenarios/index.ts +22 -0
- package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/python.ts +745 -0
- package/project-skills/tdd-guard/test/utils/factories/scenarios/languages/typescript.ts +767 -0
- package/project-skills/tdd-guard/test/utils/factories/scenarios/types.ts +77 -0
- package/project-skills/tdd-guard/test/utils/factories/scenarios/utils.ts +15 -0
- package/project-skills/tdd-guard/test/utils/factories/sessionStartFactory.ts +36 -0
- package/project-skills/tdd-guard/test/utils/factories/testDefaults.ts +90 -0
- package/project-skills/tdd-guard/test/utils/factories/testResultsFactory.ts +234 -0
- package/project-skills/tdd-guard/test/utils/factories/todoFactory.ts +99 -0
- package/project-skills/tdd-guard/test/utils/factories/userPromptSubmitFactory.ts +39 -0
- package/project-skills/tdd-guard/test/utils/factories/writeFactory.ts +70 -0
- package/project-skills/tdd-guard/test/utils/index.ts +131 -0
- package/project-skills/tdd-guard/tsconfig.build.json +16 -0
- package/project-skills/tdd-guard/tsconfig.eslint.json +17 -0
- package/project-skills/tdd-guard/tsconfig.json +32 -0
- package/project-skills/tdd-guard/tsconfig.node.json +10 -0
- package/project-skills/tdd-guard/vitest.config.ts +85 -0
- package/project-skills/ts-quality-gate/.claude/hooks/hook-config.json +66 -0
- package/project-skills/ts-quality-gate/.claude/hooks/quality-check.cjs +1251 -0
- package/project-skills/ts-quality-gate/.claude/settings.json +16 -0
- package/project-skills/ts-quality-gate/.claude/skills/using-ts-quality-gate/SKILL.md +81 -0
- package/project-skills/ts-quality-gate/README.md +115 -0
- package/skills/README.txt +31 -0
- package/skills/clean-code/SKILL.md +201 -0
- package/skills/delegating/SKILL.md +196 -0
- package/skills/delegating/config.yaml +210 -0
- package/skills/delegating/references/orchestration-protocols.md +41 -0
- package/skills/docker-expert/SKILL.md +409 -0
- package/skills/documenting/CHANGELOG.md +23 -0
- package/skills/documenting/README.md +148 -0
- package/skills/documenting/SKILL.md +113 -0
- package/skills/documenting/examples/example_pattern.md +70 -0
- package/skills/documenting/examples/example_reference.md +70 -0
- package/skills/documenting/examples/example_ssot_analytics.md +64 -0
- package/skills/documenting/examples/example_workflow.md +141 -0
- package/skills/documenting/references/changelog-format.md +97 -0
- package/skills/documenting/references/metadata-schema.md +136 -0
- package/skills/documenting/references/taxonomy.md +81 -0
- package/skills/documenting/references/versioning-rules.md +78 -0
- package/skills/documenting/scripts/__pycache__/drift_detector.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/__pycache__/orchestrator.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/__pycache__/validate_metadata.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/bump_version.sh +60 -0
- package/skills/documenting/scripts/changelog/__init__.py +0 -0
- package/skills/documenting/scripts/changelog/__pycache__/__init__.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/changelog/__pycache__/add_entry.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/changelog/__pycache__/bump_release.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/changelog/__pycache__/validate_changelog.cpython-314.pyc +0 -0
- package/skills/documenting/scripts/changelog/add_entry.py +216 -0
- package/skills/documenting/scripts/changelog/bump_release.py +117 -0
- package/skills/documenting/scripts/changelog/init_changelog.py +54 -0
- package/skills/documenting/scripts/changelog/validate_changelog.py +128 -0
- package/skills/documenting/scripts/drift_detector.py +266 -0
- package/skills/documenting/scripts/generate_template.py +311 -0
- package/skills/documenting/scripts/list_by_category.sh +84 -0
- package/skills/documenting/scripts/orchestrator.py +255 -0
- package/skills/documenting/scripts/validate_metadata.py +242 -0
- package/skills/documenting/templates/CHANGELOG.md.template +13 -0
- package/skills/documenting/tests/__pycache__/test_changelog.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/documenting/tests/__pycache__/test_drift_detector.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/documenting/tests/__pycache__/test_orchestrator.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/documenting/tests/__pycache__/test_validate_metadata.cpython-314-pytest-9.0.2.pyc +0 -0
- package/skills/documenting/tests/integration_test.sh +70 -0
- package/skills/documenting/tests/test_changelog.py +201 -0
- package/skills/documenting/tests/test_drift_detector.py +80 -0
- package/skills/documenting/tests/test_orchestrator.py +52 -0
- package/skills/documenting/tests/test_validate_metadata.py +64 -0
- package/skills/find-skills/SKILL.md +133 -0
- package/skills/gitnexus-debugging/SKILL.md +85 -0
- package/skills/gitnexus-exploring/SKILL.md +75 -0
- package/skills/gitnexus-impact-analysis/SKILL.md +94 -0
- package/skills/gitnexus-refactoring/SKILL.md +113 -0
- package/skills/hook-development/SKILL.md +797 -0
- package/skills/hook-development/examples/load-context.sh +55 -0
- package/skills/hook-development/examples/quality-check.js +1168 -0
- package/skills/hook-development/examples/validate-bash.sh +43 -0
- package/skills/hook-development/examples/validate-write.sh +38 -0
- package/skills/hook-development/references/advanced.md +527 -0
- package/skills/hook-development/references/migration.md +369 -0
- package/skills/hook-development/references/patterns.md +412 -0
- package/skills/hook-development/scripts/README.md +164 -0
- package/skills/hook-development/scripts/hook-linter.sh +153 -0
- package/skills/hook-development/scripts/test-hook.sh +252 -0
- package/skills/hook-development/scripts/validate-hook-schema.sh +159 -0
- package/skills/obsidian-cli/SKILL.md +106 -0
- package/skills/orchestrating-agents/SKILL.md +135 -0
- package/skills/orchestrating-agents/config.yaml +45 -0
- package/skills/orchestrating-agents/references/agent-context-integration.md +37 -0
- package/skills/orchestrating-agents/references/examples.md +45 -0
- package/skills/orchestrating-agents/references/handover-protocol.md +31 -0
- package/skills/orchestrating-agents/references/workflows.md +42 -0
- package/skills/orchestrating-agents/scripts/detect_neighbors.py +23 -0
- package/skills/prompt-improving/README.md +162 -0
- package/skills/prompt-improving/SKILL.md +74 -0
- package/skills/prompt-improving/references/analysis_commands.md +24 -0
- package/skills/prompt-improving/references/chain_of_thought.md +24 -0
- package/skills/prompt-improving/references/mcp_definitions.md +20 -0
- package/skills/prompt-improving/references/multishot.md +23 -0
- package/skills/prompt-improving/references/xml_core.md +60 -0
- package/skills/python-testing/SKILL.md +815 -0
- package/skills/senior-backend/SKILL.md +209 -0
- package/skills/senior-backend/references/api_design_patterns.md +103 -0
- package/skills/senior-backend/references/backend_security_practices.md +103 -0
- package/skills/senior-backend/references/database_optimization_guide.md +103 -0
- package/skills/senior-backend/scripts/api_load_tester.py +114 -0
- package/skills/senior-backend/scripts/api_scaffolder.py +114 -0
- package/skills/senior-backend/scripts/database_migration_tool.py +114 -0
- package/skills/senior-data-scientist/SKILL.md +226 -0
- package/skills/senior-data-scientist/references/experiment_design_frameworks.md +80 -0
- package/skills/senior-data-scientist/references/feature_engineering_patterns.md +80 -0
- package/skills/senior-data-scientist/references/statistical_methods_advanced.md +80 -0
- package/skills/senior-data-scientist/scripts/experiment_designer.py +100 -0
- package/skills/senior-data-scientist/scripts/feature_engineering_pipeline.py +100 -0
- package/skills/senior-data-scientist/scripts/model_evaluation_suite.py +100 -0
- package/skills/senior-devops/SKILL.md +209 -0
- package/skills/senior-devops/references/cicd_pipeline_guide.md +103 -0
- package/skills/senior-devops/references/deployment_strategies.md +103 -0
- package/skills/senior-devops/references/infrastructure_as_code.md +103 -0
- package/skills/senior-devops/scripts/deployment_manager.py +114 -0
- package/skills/senior-devops/scripts/pipeline_generator.py +114 -0
- package/skills/senior-devops/scripts/terraform_scaffolder.py +114 -0
- package/skills/senior-security/SKILL.md +209 -0
- package/skills/senior-security/references/cryptography_implementation.md +103 -0
- package/skills/senior-security/references/penetration_testing_guide.md +103 -0
- package/skills/senior-security/references/security_architecture_patterns.md +103 -0
- package/skills/senior-security/scripts/pentest_automator.py +114 -0
- package/skills/senior-security/scripts/security_auditor.py +114 -0
- package/skills/senior-security/scripts/threat_modeler.py +114 -0
- package/skills/skill-creator/LICENSE.txt +202 -0
- package/skills/skill-creator/SKILL.md +479 -0
- package/skills/skill-creator/agents/analyzer.md +274 -0
- package/skills/skill-creator/agents/comparator.md +202 -0
- package/skills/skill-creator/agents/grader.md +223 -0
- package/skills/skill-creator/assets/eval_review.html +146 -0
- package/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/skills/skill-creator/references/schemas.md +430 -0
- package/skills/skill-creator/scripts/__init__.py +0 -0
- package/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/skills/skill-creator/scripts/generate_report.py +326 -0
- package/skills/skill-creator/scripts/improve_description.py +248 -0
- package/skills/skill-creator/scripts/package_skill.py +136 -0
- package/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/skills/skill-creator/scripts/run_eval.py +310 -0
- package/skills/skill-creator/scripts/run_loop.py +332 -0
- package/skills/skill-creator/scripts/utils.py +47 -0
- package/skills/using-TDD/SKILL.md +410 -0
- package/skills/using-serena-lsp/README.md +8 -0
- package/skills/using-serena-lsp/REFERENCE.md +194 -0
- package/skills/using-serena-lsp/SKILL.md +82 -0
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Using TS Quality Gate
|
|
2
|
+
|
|
3
|
+
**TS Quality Gate** enforces TypeScript, ESLint, and Prettier quality checks on every file edit. It provides immediate feedback and auto-fixes issues when possible.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
- **TypeScript compilation check** - Catches type errors immediately
|
|
8
|
+
- **ESLint validation** - Enforces code style and best practices
|
|
9
|
+
- **Prettier formatting** - Ensures consistent code formatting
|
|
10
|
+
- **Auto-fix** - Automatically fixes issues when possible
|
|
11
|
+
- **Fast feedback** - Runs in <1s for most files
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
When you edit a TypeScript/JavaScript file:
|
|
16
|
+
|
|
17
|
+
1. PostToolUse hook fires after Write/Edit
|
|
18
|
+
2. Runs `quality-check.js` with the file path
|
|
19
|
+
3. Checks TypeScript compilation, ESLint, Prettier
|
|
20
|
+
4. Auto-fixes issues if configured
|
|
21
|
+
5. Returns exit code 2 if blocking errors found
|
|
22
|
+
|
|
23
|
+
## Configuration
|
|
24
|
+
|
|
25
|
+
The quality gate is configured via `.claude/hooks/hook-config.json`:
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
{
|
|
29
|
+
"typescript": {
|
|
30
|
+
"enabled": true,
|
|
31
|
+
"showDependencyErrors": false
|
|
32
|
+
},
|
|
33
|
+
"eslint": {
|
|
34
|
+
"enabled": true,
|
|
35
|
+
"autofix": true
|
|
36
|
+
},
|
|
37
|
+
"prettier": {
|
|
38
|
+
"enabled": true,
|
|
39
|
+
"autofix": true
|
|
40
|
+
},
|
|
41
|
+
"general": {
|
|
42
|
+
"autofixSilent": true,
|
|
43
|
+
"debug": false
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Requirements
|
|
49
|
+
|
|
50
|
+
- Node.js 18+
|
|
51
|
+
- TypeScript installed in project
|
|
52
|
+
- ESLint installed in project (optional)
|
|
53
|
+
- Prettier installed in project (optional)
|
|
54
|
+
|
|
55
|
+
## Installation
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
# Install project skill
|
|
59
|
+
xtrm install project ts-quality-gate
|
|
60
|
+
|
|
61
|
+
# Ensure dependencies are installed in your project
|
|
62
|
+
npm install --save-dev typescript eslint prettier
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Troubleshooting
|
|
66
|
+
|
|
67
|
+
**"ESLint not found"**
|
|
68
|
+
- Install ESLint: `npm install --save-dev eslint`
|
|
69
|
+
- Or disable in hook-config.json: `"eslint": { "enabled": false }`
|
|
70
|
+
|
|
71
|
+
**"Prettier not found"**
|
|
72
|
+
- Install Prettier: `npm install --save-dev prettier`
|
|
73
|
+
- Or disable in hook-config.json: `"prettier": { "enabled": false }`
|
|
74
|
+
|
|
75
|
+
**TypeScript errors from dependencies**
|
|
76
|
+
- Set `"showDependencyErrors": false` in hook-config.json
|
|
77
|
+
|
|
78
|
+
## See Also
|
|
79
|
+
|
|
80
|
+
- Full documentation: `.claude/docs/ts-quality-gate-readme.md`
|
|
81
|
+
- Reference: https://github.com/bartolli/claude-code-typescript-hooks
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# TS Quality Gate
|
|
2
|
+
|
|
3
|
+
**TypeScript/ESLint/Prettier quality gate** for Claude Code. Runs automatically on every file edit to ensure code quality.
|
|
4
|
+
|
|
5
|
+
## What It Does
|
|
6
|
+
|
|
7
|
+
TS Quality Gate enforces code quality standards in real-time:
|
|
8
|
+
|
|
9
|
+
| Check | Description | Auto-fix |
|
|
10
|
+
|-------|-------------|----------|
|
|
11
|
+
| **TypeScript** | Compilation errors, type safety | No |
|
|
12
|
+
| **ESLint** | Code style, best practices, rules | Yes (if enabled) |
|
|
13
|
+
| **Prettier** | Code formatting consistency | Yes (if enabled) |
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install project skill
|
|
19
|
+
xtrm install project ts-quality-gate
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Post-install:** Ensure your project has the required dependencies:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install --save-dev typescript eslint prettier
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## How It Works
|
|
29
|
+
|
|
30
|
+
The quality gate runs as a `PostToolUse` hook:
|
|
31
|
+
|
|
32
|
+
1. You edit a TypeScript/JavaScript file
|
|
33
|
+
2. After the edit completes, the hook fires
|
|
34
|
+
3. `quality-check.cjs` validates the file
|
|
35
|
+
4. Issues are reported with auto-fix when possible
|
|
36
|
+
5. Exit code 2 blocks if critical errors found
|
|
37
|
+
|
|
38
|
+
## Configuration
|
|
39
|
+
|
|
40
|
+
Edit `.claude/hooks/hook-config.json` to customize:
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"typescript": {
|
|
45
|
+
"enabled": true,
|
|
46
|
+
"showDependencyErrors": false
|
|
47
|
+
},
|
|
48
|
+
"eslint": {
|
|
49
|
+
"enabled": true,
|
|
50
|
+
"autofix": true
|
|
51
|
+
},
|
|
52
|
+
"prettier": {
|
|
53
|
+
"enabled": true,
|
|
54
|
+
"autofix": true
|
|
55
|
+
},
|
|
56
|
+
"general": {
|
|
57
|
+
"autofixSilent": true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Environment Variable Overrides
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
export CLAUDE_HOOKS_TYPESCRIPT_ENABLED=false
|
|
66
|
+
export CLAUDE_HOOKS_ESLINT_AUTOFIX=true
|
|
67
|
+
export CLAUDE_HOOKS_PRETTIER_ENABLED=false
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Features
|
|
71
|
+
|
|
72
|
+
### TypeScript Checking
|
|
73
|
+
- Uses project's tsconfig.json
|
|
74
|
+
- Checks only edited file (fast)
|
|
75
|
+
- Optionally shows dependency errors
|
|
76
|
+
|
|
77
|
+
### ESLint Integration
|
|
78
|
+
- Auto-discovers .eslintrc or eslint.config.js
|
|
79
|
+
- Auto-fixes when `autofix: true`
|
|
80
|
+
- Reports errors and warnings
|
|
81
|
+
|
|
82
|
+
### Prettier Formatting
|
|
83
|
+
- Auto-discovers .prettierrc
|
|
84
|
+
- Auto-formats when `autofix: true`
|
|
85
|
+
- Supports all Prettier options
|
|
86
|
+
|
|
87
|
+
### Smart File Detection
|
|
88
|
+
- Skips non-source files
|
|
89
|
+
- Detects test files, CLI files, services
|
|
90
|
+
- Applies file-type-specific rules
|
|
91
|
+
|
|
92
|
+
## Exit Codes
|
|
93
|
+
|
|
94
|
+
| Code | Meaning |
|
|
95
|
+
|------|---------|
|
|
96
|
+
| 0 | All checks passed |
|
|
97
|
+
| 1 | Fatal error (hook crashed) |
|
|
98
|
+
| 2 | Blocking errors found (Claude must fix) |
|
|
99
|
+
|
|
100
|
+
## Troubleshooting
|
|
101
|
+
|
|
102
|
+
**Hook not running**
|
|
103
|
+
- Verify PostToolUse hook in `.claude/settings.json`
|
|
104
|
+
- Check hook path is correct
|
|
105
|
+
|
|
106
|
+
**TypeScript errors from node_modules**
|
|
107
|
+
- Set `showDependencyErrors: false`
|
|
108
|
+
|
|
109
|
+
**ESLint/Prettier not found**
|
|
110
|
+
- Install in project: `npm install --save-dev eslint prettier`
|
|
111
|
+
- Or disable in config
|
|
112
|
+
|
|
113
|
+
## Reference
|
|
114
|
+
|
|
115
|
+
Based on: https://github.com/bartolli/claude-code-typescript-hooks
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Local Agent Skills
|
|
2
|
+
|
|
3
|
+
This directory contains specialized agent skills designed for the Gemini CLI. These skills extend the agent's capabilities for specific workflows like debugging, security auditing, and cross-model orchestration.
|
|
4
|
+
|
|
5
|
+
## Skill Discovery
|
|
6
|
+
|
|
7
|
+
All skills in this directory are automatically discovered by the `hooks/skill-discovery.py` hook at the start of each session. The hook injects a summarized list of these skills into the agent's initial context, ensuring the agent is aware of specialized tools from the first prompt.
|
|
8
|
+
|
|
9
|
+
### How to Add a New Skill
|
|
10
|
+
|
|
11
|
+
To add a new skill that is automatically discovered:
|
|
12
|
+
|
|
13
|
+
1. **Create a Directory**: Add a new folder in `skills/` (e.g., `skills/my-new-skill/`).
|
|
14
|
+
2. **Add `SKILL.md`**: Create a `SKILL.md` file in the new folder.
|
|
15
|
+
3. **Define Metadata**: The `SKILL.md` **MUST** start with YAML frontmatter containing `name` and `description`.
|
|
16
|
+
4. **Keep it Concise**: The `description` should ideally start with a single, clear sentence explaining *what* the skill does and *when* to use it. The discovery hook will only show the first sentence to keep the initial context efficient.
|
|
17
|
+
|
|
18
|
+
#### Metadata Schema (Example)
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
---
|
|
22
|
+
name: my-new-skill
|
|
23
|
+
description: Performs deep architectural analysis of the project's dependency graph. Use when planning major refactors or evaluating library updates.
|
|
24
|
+
version: 1.0.0
|
|
25
|
+
---
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Maintenance
|
|
29
|
+
|
|
30
|
+
- **Update Descriptions**: If you significantly change a skill's purpose, ensure the first sentence of its description in `SKILL.md` is updated.
|
|
31
|
+
- **Workflow Integrity**: Avoid creating empty skill directories or `SKILL.md` files without proper frontmatter.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clean-code
|
|
3
|
+
description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments
|
|
4
|
+
allowed-tools: Read, Write, Edit
|
|
5
|
+
version: 2.0
|
|
6
|
+
priority: CRITICAL
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Clean Code - Pragmatic AI Coding Standards
|
|
10
|
+
|
|
11
|
+
> **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Core Principles
|
|
16
|
+
|
|
17
|
+
| Principle | Rule |
|
|
18
|
+
|-----------|------|
|
|
19
|
+
| **SRP** | Single Responsibility - each function/class does ONE thing |
|
|
20
|
+
| **DRY** | Don't Repeat Yourself - extract duplicates, reuse |
|
|
21
|
+
| **KISS** | Keep It Simple - simplest solution that works |
|
|
22
|
+
| **YAGNI** | You Aren't Gonna Need It - don't build unused features |
|
|
23
|
+
| **Boy Scout** | Leave code cleaner than you found it |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Naming Rules
|
|
28
|
+
|
|
29
|
+
| Element | Convention |
|
|
30
|
+
|---------|------------|
|
|
31
|
+
| **Variables** | Reveal intent: `userCount` not `n` |
|
|
32
|
+
| **Functions** | Verb + noun: `getUserById()` not `user()` |
|
|
33
|
+
| **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` |
|
|
34
|
+
| **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` |
|
|
35
|
+
|
|
36
|
+
> **Rule:** If you need a comment to explain a name, rename it.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Function Rules
|
|
41
|
+
|
|
42
|
+
| Rule | Description |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| **Small** | Max 20 lines, ideally 5-10 |
|
|
45
|
+
| **One Thing** | Does one thing, does it well |
|
|
46
|
+
| **One Level** | One level of abstraction per function |
|
|
47
|
+
| **Few Args** | Max 3 arguments, prefer 0-2 |
|
|
48
|
+
| **No Side Effects** | Don't mutate inputs unexpectedly |
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Code Structure
|
|
53
|
+
|
|
54
|
+
| Pattern | Apply |
|
|
55
|
+
|---------|-------|
|
|
56
|
+
| **Guard Clauses** | Early returns for edge cases |
|
|
57
|
+
| **Flat > Nested** | Avoid deep nesting (max 2 levels) |
|
|
58
|
+
| **Composition** | Small functions composed together |
|
|
59
|
+
| **Colocation** | Keep related code close |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## AI Coding Style
|
|
64
|
+
|
|
65
|
+
| Situation | Action |
|
|
66
|
+
|-----------|--------|
|
|
67
|
+
| User asks for feature | Write it directly |
|
|
68
|
+
| User reports bug | Fix it, don't explain |
|
|
69
|
+
| No clear requirement | Ask, don't assume |
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Anti-Patterns (DON'T)
|
|
74
|
+
|
|
75
|
+
| ❌ Pattern | ✅ Fix |
|
|
76
|
+
|-----------|-------|
|
|
77
|
+
| Comment every line | Delete obvious comments |
|
|
78
|
+
| Helper for one-liner | Inline the code |
|
|
79
|
+
| Factory for 2 objects | Direct instantiation |
|
|
80
|
+
| utils.ts with 1 function | Put code where used |
|
|
81
|
+
| "First we import..." | Just write code |
|
|
82
|
+
| Deep nesting | Guard clauses |
|
|
83
|
+
| Magic numbers | Named constants |
|
|
84
|
+
| God functions | Split by responsibility |
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🔴 Before Editing ANY File (THINK FIRST!)
|
|
89
|
+
|
|
90
|
+
**Before changing a file, ask yourself:**
|
|
91
|
+
|
|
92
|
+
| Question | Why |
|
|
93
|
+
|----------|-----|
|
|
94
|
+
| **What imports this file?** | They might break |
|
|
95
|
+
| **What does this file import?** | Interface changes |
|
|
96
|
+
| **What tests cover this?** | Tests might fail |
|
|
97
|
+
| **Is this a shared component?** | Multiple places affected |
|
|
98
|
+
|
|
99
|
+
**Quick Check:**
|
|
100
|
+
```
|
|
101
|
+
File to edit: UserService.ts
|
|
102
|
+
└── Who imports this? → UserController.ts, AuthController.ts
|
|
103
|
+
└── Do they need changes too? → Check function signatures
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
> 🔴 **Rule:** Edit the file + all dependent files in the SAME task.
|
|
107
|
+
> 🔴 **Never leave broken imports or missing updates.**
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Summary
|
|
112
|
+
|
|
113
|
+
| Do | Don't |
|
|
114
|
+
|----|-------|
|
|
115
|
+
| Write code directly | Write tutorials |
|
|
116
|
+
| Let code self-document | Add obvious comments |
|
|
117
|
+
| Fix bugs immediately | Explain the fix first |
|
|
118
|
+
| Inline small things | Create unnecessary files |
|
|
119
|
+
| Name things clearly | Use abbreviations |
|
|
120
|
+
| Keep functions small | Write 100+ line functions |
|
|
121
|
+
|
|
122
|
+
> **Remember: The user wants working code, not a programming lesson.**
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 🔴 Self-Check Before Completing (MANDATORY)
|
|
127
|
+
|
|
128
|
+
**Before saying "task complete", verify:**
|
|
129
|
+
|
|
130
|
+
| Check | Question |
|
|
131
|
+
|-------|----------|
|
|
132
|
+
| ✅ **Goal met?** | Did I do exactly what user asked? |
|
|
133
|
+
| ✅ **Files edited?** | Did I modify all necessary files? |
|
|
134
|
+
| ✅ **Code works?** | Did I test/verify the change? |
|
|
135
|
+
| ✅ **No errors?** | Lint and TypeScript pass? |
|
|
136
|
+
| ✅ **Nothing forgotten?** | Any edge cases missed? |
|
|
137
|
+
|
|
138
|
+
> 🔴 **Rule:** If ANY check fails, fix it before completing.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## Verification Scripts (MANDATORY)
|
|
143
|
+
|
|
144
|
+
> 🔴 **CRITICAL:** Each agent runs ONLY their own skill's scripts after completing work.
|
|
145
|
+
|
|
146
|
+
### Agent → Script Mapping
|
|
147
|
+
|
|
148
|
+
| Agent | Script | Command |
|
|
149
|
+
|-------|--------|---------|
|
|
150
|
+
| **frontend-specialist** | UX Audit | `python ~/.claude/skills/frontend-design/scripts/ux_audit.py .` |
|
|
151
|
+
| **frontend-specialist** | A11y Check | `python ~/.claude/skills/frontend-design/scripts/accessibility_checker.py .` |
|
|
152
|
+
| **backend-specialist** | API Validator | `python ~/.claude/skills/api-patterns/scripts/api_validator.py .` |
|
|
153
|
+
| **mobile-developer** | Mobile Audit | `python ~/.claude/skills/mobile-design/scripts/mobile_audit.py .` |
|
|
154
|
+
| **database-architect** | Schema Validate | `python ~/.claude/skills/database-design/scripts/schema_validator.py .` |
|
|
155
|
+
| **security-auditor** | Security Scan | `python ~/.claude/skills/vulnerability-scanner/scripts/security_scan.py .` |
|
|
156
|
+
| **seo-specialist** | SEO Check | `python ~/.claude/skills/seo-fundamentals/scripts/seo_checker.py .` |
|
|
157
|
+
| **seo-specialist** | GEO Check | `python ~/.claude/skills/geo-fundamentals/scripts/geo_checker.py .` |
|
|
158
|
+
| **performance-optimizer** | Lighthouse | `python ~/.claude/skills/performance-profiling/scripts/lighthouse_audit.py <url>` |
|
|
159
|
+
| **test-engineer** | Test Runner | `python ~/.claude/skills/testing-patterns/scripts/test_runner.py .` |
|
|
160
|
+
| **test-engineer** | Playwright | `python ~/.claude/skills/webapp-testing/scripts/playwright_runner.py <url>` |
|
|
161
|
+
| **Any agent** | Lint Check | `python ~/.claude/skills/lint-and-validate/scripts/lint_runner.py .` |
|
|
162
|
+
| **Any agent** | Type Coverage | `python ~/.claude/skills/lint-and-validate/scripts/type_coverage.py .` |
|
|
163
|
+
| **Any agent** | i18n Check | `python ~/.claude/skills/i18n-localization/scripts/i18n_checker.py .` |
|
|
164
|
+
|
|
165
|
+
> ❌ **WRONG:** `test-engineer` running `ux_audit.py`
|
|
166
|
+
> ✅ **CORRECT:** `frontend-specialist` running `ux_audit.py`
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### 🔴 Script Output Handling (READ → SUMMARIZE → ASK)
|
|
171
|
+
|
|
172
|
+
**When running a validation script, you MUST:**
|
|
173
|
+
|
|
174
|
+
1. **Run the script** and capture ALL output
|
|
175
|
+
2. **Parse the output** - identify errors, warnings, and passes
|
|
176
|
+
3. **Summarize to user** in this format:
|
|
177
|
+
|
|
178
|
+
```markdown
|
|
179
|
+
## Script Results: [script_name.py]
|
|
180
|
+
|
|
181
|
+
### ❌ Errors Found (X items)
|
|
182
|
+
- [File:Line] Error description 1
|
|
183
|
+
- [File:Line] Error description 2
|
|
184
|
+
|
|
185
|
+
### ⚠️ Warnings (Y items)
|
|
186
|
+
- [File:Line] Warning description
|
|
187
|
+
|
|
188
|
+
### ✅ Passed (Z items)
|
|
189
|
+
- Check 1 passed
|
|
190
|
+
- Check 2 passed
|
|
191
|
+
|
|
192
|
+
**Should I fix the X errors?**
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
4. **Wait for user confirmation** before fixing
|
|
196
|
+
5. **After fixing** → Re-run script to confirm
|
|
197
|
+
|
|
198
|
+
> 🔴 **VIOLATION:** Running script and ignoring output = FAILED task.
|
|
199
|
+
> 🔴 **VIOLATION:** Auto-fixing without asking = Not allowed.
|
|
200
|
+
> 🔴 **Rule:** Always READ output → SUMMARIZE → ASK → then fix.
|
|
201
|
+
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: delegating
|
|
3
|
+
description: >-
|
|
4
|
+
Proactively delegates tasks to cost-optimized agents before working in main session.
|
|
5
|
+
MUST suggest for: tests, typos, formatting, docs, refactors, code reviews, feature
|
|
6
|
+
implementation, debugging, commit validation. Skips main session token usage by routing
|
|
7
|
+
to GLM (simple/deterministic), Gemini (reasoning/analysis), Qwen (quality/patterns),
|
|
8
|
+
or multi-agent orchestration (review, feature dev, bug hunt). Never suggest for:
|
|
9
|
+
architecture decisions, security-critical code, unknown-cause bugs, performance optimization.
|
|
10
|
+
allowed-tools: Bash
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Delegating Tasks
|
|
14
|
+
|
|
15
|
+
Delegate tasks to cost-optimized models (CCS) or multi-agent orchestration workflows (Gemini/Qwen).
|
|
16
|
+
|
|
17
|
+
## When to Suggest
|
|
18
|
+
|
|
19
|
+
**Task Pattern → Backend Mapping** (auto-selection logic):
|
|
20
|
+
|
|
21
|
+
| Task Pattern | Backend | Cost | Reason |
|
|
22
|
+
|-------------------------------|-------------|--------|--------------------------------|
|
|
23
|
+
| `typo\|test\|doc\|format` | CCS (GLM) | LOW | Simple deterministic |
|
|
24
|
+
| `think\|analyze\|reason` | CCS (Gemini)| MEDIUM | Requires reasoning |
|
|
25
|
+
| `review.*(code\|security)` | Orchestration| HIGH | Multi-agent code review |
|
|
26
|
+
| `implement.*feature` | Orchestration| HIGH | Full development workflow |
|
|
27
|
+
| `validate.*commit` | Orchestration| MEDIUM | Security+Quality validation |
|
|
28
|
+
| `debug\|bug.*unknown` | Orchestration| HIGH | Root cause investigation |
|
|
29
|
+
|
|
30
|
+
**Never Suggest For:**
|
|
31
|
+
- Architecture decisions requiring human judgment
|
|
32
|
+
- Security-critical without review
|
|
33
|
+
- Performance optimization (needs profiling first)
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Interactive Menu
|
|
38
|
+
|
|
39
|
+
### Step 1: Delegation Choice
|
|
40
|
+
|
|
41
|
+
Use AskUserQuestion with:
|
|
42
|
+
- question: "This task can be delegated. How would you like to proceed?"
|
|
43
|
+
- header: "Execution"
|
|
44
|
+
- options:
|
|
45
|
+
- "Delegate (Recommended)" — Execute via optimal backend. Saves main session tokens and uses cost-efficient models.
|
|
46
|
+
- "Work in main session" — Execute in current Claude session. Better for tasks requiring discussion or complex context.
|
|
47
|
+
|
|
48
|
+
**If user selects "Delegate"** → Continue to Step 2
|
|
49
|
+
**If user selects "Work in main session"** → Execute task normally (don't delegate)
|
|
50
|
+
|
|
51
|
+
### Step 2: Backend Selection
|
|
52
|
+
|
|
53
|
+
Use AskUserQuestion with:
|
|
54
|
+
- question: "Which backend should handle this task?"
|
|
55
|
+
- header: "Backend"
|
|
56
|
+
- options:
|
|
57
|
+
- "Auto-select (Recommended)" — Analyzes task keywords and selects optimal backend/profile automatically.
|
|
58
|
+
- "GLM - Cost-optimized" — Fast model for tests, typos, formatting [LOW COST]
|
|
59
|
+
- "Gemini - Reasoning" — Analysis, thinking, architecture tasks [MEDIUM COST]
|
|
60
|
+
- "Qwen - Quality" — Code quality, pattern detection [MEDIUM COST]
|
|
61
|
+
- "Multi-Agent Orchestration" — Direct Gemini/Qwen collaboration for complex tasks (review, feature dev, debugging) [HIGH COST]
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Auto-Selection Logic
|
|
66
|
+
|
|
67
|
+
**Configuration-Driven:** All pattern matching is defined in [config.yaml](config.yaml), not hardcoded.
|
|
68
|
+
|
|
69
|
+
### Configuration Structure
|
|
70
|
+
|
|
71
|
+
The skill reads `config.yaml` to determine:
|
|
72
|
+
1. **Available backends** (CCS profiles + Orchestration workflows)
|
|
73
|
+
2. **Pattern mappings** (task keywords → backend selection)
|
|
74
|
+
3. **Priority order** (Orchestration workflows checked before CCS)
|
|
75
|
+
4. **Default fallback** (when no pattern matches)
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Orchestration Workflow Selection (Autonomous)
|
|
80
|
+
|
|
81
|
+
When `backend: 'orchestration'` is selected, **Claude autonomously** chooses the appropriate workflow and orchestrates between `gemini` and `qwen` CLI tools.
|
|
82
|
+
|
|
83
|
+
### Selection Process
|
|
84
|
+
|
|
85
|
+
1. **Load config** - Read workflow definitions from `config.yaml`
|
|
86
|
+
2. **Match patterns** - Determine which orchestration pattern (collaborative, handshake, troubleshoot) applies.
|
|
87
|
+
3. **Execute turn protocol** - Use CLI commands sequentially:
|
|
88
|
+
- `gemini -p "..."`
|
|
89
|
+
- `qwen "..."`
|
|
90
|
+
- `gemini -r latest -p "..."` (to refine)
|
|
91
|
+
|
|
92
|
+
### Turn Protocols
|
|
93
|
+
|
|
94
|
+
| Workflow | Protocol |
|
|
95
|
+
| :--- | :--- |
|
|
96
|
+
| **handshake** | 1 turn: Agent A (Gemini) proposes -> Agent B (Qwen) validates. |
|
|
97
|
+
| **collaborative** | 3 turns: Gemini designs -> Qwen critiques -> Gemini refines. |
|
|
98
|
+
| **troubleshoot** | 4 turns: Gemini hypothesis -> Qwen verification -> Gemini root cause -> Final synthesis. |
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Execution Flow
|
|
103
|
+
|
|
104
|
+
### For Direct Invocation (`/delegation [task]` or `/delegate [task]`)
|
|
105
|
+
|
|
106
|
+
1. **Parse override flag** (if present: `--glm`, `--gemini`, `--orchestrate`, etc.)
|
|
107
|
+
2. **Auto-select backend** using keyword-based logic.
|
|
108
|
+
3. **Route to appropriate backend** (see sections below).
|
|
109
|
+
4. **Report results**: Backend, Workflow (if Orchestration), Cost indicator, Duration.
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### CCS / GLM Execution
|
|
114
|
+
|
|
115
|
+
CCS wraps the `claude` CLI and **only works with GLM**. It requires a PTY for output and is blocked by the `CLAUDECODE` nested-session guard — always run via tmux:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
tmux new-session -d -s ccs_task "env -u CLAUDECODE ccs glm -p '{task}' > /tmp/ccs_out.txt 2>&1"
|
|
119
|
+
sleep 30 # or poll until session exits
|
|
120
|
+
cat /tmp/ccs_out.txt
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**If the task requires file modifications**, add `--dangerously-skip-permissions`:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
tmux new-session -d -s ccs_task "env -u CLAUDECODE ccs glm --dangerously-skip-permissions -p '{task}' > /tmp/ccs_out.txt 2>&1"
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
### Gemini CLI Execution
|
|
132
|
+
|
|
133
|
+
Gemini is a **direct CLI** — no tmux workaround needed:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
gemini -p "task description"
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**If the task requires file modifications**, add `-y` to auto-approve all tool calls:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
gemini -y -p "task description"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
### Qwen CLI Execution
|
|
148
|
+
|
|
149
|
+
Qwen is a **direct CLI** — no tmux workaround needed:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
qwen "task description"
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**If the task requires file modifications**, add `-y` to auto-approve all tool calls:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
qwen -y "task description"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
### Orchestration Execution
|
|
164
|
+
|
|
165
|
+
Multi-turn sequences use Gemini and Qwen **direct CLIs**. Add `-y` to all turns when modifications are expected:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
gemini -y -p "..." # Turn 1
|
|
169
|
+
qwen -y "..." # Turn 2
|
|
170
|
+
gemini -y -r latest -p "..." # Turn 3 (refine)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Examples
|
|
176
|
+
|
|
177
|
+
### Auto-Selection Examples
|
|
178
|
+
|
|
179
|
+
**CCS Simple:**
|
|
180
|
+
- `/delegate add unit tests for UserService` → CCS (GLM)
|
|
181
|
+
- `/delegate think about the best database schema` → CCS (Gemini)
|
|
182
|
+
|
|
183
|
+
**Orchestration Workflows:**
|
|
184
|
+
- `/delegate review this code for security issues` → Orchestration (parallel-review)
|
|
185
|
+
- `/delegate implement OAuth authentication feature` → Orchestration (feature-design)
|
|
186
|
+
- `/delegate debug crash on startup` → Orchestration (bug-hunt)
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Notes
|
|
191
|
+
|
|
192
|
+
### Version 7.0.0 - Direct Orchestration
|
|
193
|
+
- **Independent of unitAI**: Now uses direct `gemini` and `qwen` CLI calls.
|
|
194
|
+
- **Unified backends**: CCS (cost-optimized) + Direct Orchestration.
|
|
195
|
+
- **Config-driven**: All behavior defined in `config.yaml`.
|
|
196
|
+
- **Reference**: Uses patterns from [orchestrating-agents](../orchestrating-agents/SKILL.md).
|