@hasna/skills 0.1.62 → 0.1.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -12
- package/bin/index.js +15743 -21709
- package/bin/mcp.js +3866 -11522
- package/bin/migrate.js +281 -35
- package/bin/server.js +5805 -2682
- package/bin/worker.js +5280 -2388
- package/dist/cli/commands/publish.d.ts +2 -0
- package/dist/cli/commands/registry-reconcile.d.ts +2 -0
- package/dist/cli/components/App.d.ts +2 -1
- package/dist/cli/components/CategorySelect.d.ts +2 -1
- package/dist/cli/components/Header.d.ts +2 -1
- package/dist/cli/components/InstallProgress.d.ts +2 -1
- package/dist/cli/components/SearchView.d.ts +2 -1
- package/dist/cli/components/SkillSelect.d.ts +2 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +5386 -13739
- package/dist/lib/agent-sync.d.ts +61 -6
- package/dist/lib/auth-store.d.ts +37 -0
- package/dist/lib/config.d.ts +51 -0
- package/dist/lib/home-adoption.d.ts +91 -0
- package/dist/lib/home-census.d.ts +26 -0
- package/dist/lib/home-migration.d.ts +60 -0
- package/dist/lib/native-storage.d.ts +1 -1
- package/dist/lib/portable-skills-files.d.ts +21 -1
- package/dist/lib/portable-skills-types.d.ts +46 -0
- package/dist/lib/portable-skills.d.ts +35 -6
- package/dist/lib/pull.d.ts +97 -0
- package/dist/lib/registry-reconcile.d.ts +114 -0
- package/dist/lib/registry.d.ts +7 -4
- package/dist/lib/remote-client.d.ts +124 -1
- package/dist/lib/remote-registry.d.ts +26 -0
- package/dist/lib/revision.d.ts +29 -0
- package/dist/lib/run-state.d.ts +5 -0
- package/dist/lib/skill-bundles.d.ts +54 -0
- package/dist/lib/skill-contract.d.ts +35 -0
- package/dist/lib/skill-hash.d.ts +77 -0
- package/dist/sdk/cancel.d.ts +30 -0
- package/dist/sdk/dispatcher.d.ts +40 -0
- package/dist/sdk/event-sink.d.ts +2 -0
- package/dist/sdk/events.d.ts +79 -0
- package/dist/sdk/execution/admission.d.ts +44 -0
- package/dist/sdk/execution/dispatchers/e2b.d.ts +17 -0
- package/dist/sdk/execution/dispatchers/ecs.d.ts +151 -0
- package/dist/sdk/execution/image-profile.d.ts +73 -0
- package/dist/sdk/execution/index.d.ts +15 -0
- package/dist/sdk/execution/receipts.d.ts +44 -0
- package/dist/sdk/execution/state-machine.d.ts +38 -0
- package/dist/sdk/execution/storage.d.ts +158 -0
- package/dist/sdk/execution/types.d.ts +130 -0
- package/dist/sdk/executor.d.ts +17 -0
- package/dist/sdk/governance-store.d.ts +156 -0
- package/dist/sdk/governance.d.ts +92 -0
- package/dist/sdk/index.d.ts +26 -0
- package/dist/sdk/index.js +49728 -0
- package/dist/sdk/offline.d.ts +16 -0
- package/dist/sdk/outputs.d.ts +71 -0
- package/dist/sdk/registry.d.ts +28 -0
- package/dist/sdk/runs.d.ts +229 -0
- package/dist/sdk/server.d.ts +35 -0
- package/dist/sdk/spend.d.ts +36 -0
- package/dist/sdk/storage.d.ts +25 -0
- package/dist/server/app.d.ts +42 -0
- package/dist/server/artifact-storage.d.ts +102 -0
- package/dist/server/auth.d.ts +5 -0
- package/dist/server/config.d.ts +50 -0
- package/dist/server/database-url.d.ts +42 -0
- package/dist/server/handlers.d.ts +3 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/migrate.d.ts +13 -0
- package/dist/server/migrations-dir.d.ts +18 -0
- package/dist/server/redaction.d.ts +1 -0
- package/dist/server/registry.d.ts +5 -0
- package/dist/server/rows.d.ts +24 -0
- package/dist/server/skills-api.d.ts +170 -0
- package/dist/server/sqlite-store.d.ts +131 -0
- package/dist/server/store-fixtures.d.ts +25 -0
- package/dist/server/store.d.ts +170 -0
- package/dist/server/types.d.ts +337 -0
- package/dist/server/worker.d.ts +4 -0
- package/dist/storage.js +39 -2
- package/docs/skill-standard.md +211 -39
- package/migrations/postgres/0003_run_outputs_governance.sql +83 -0
- package/migrations/postgres/0004_hosted_pins.sql +28 -0
- package/migrations/postgres/0005_revision_tombstone_registry.sql +37 -0
- package/migrations/postgres/0005_tag_projection.sql +36 -0
- package/migrations/sqlite/0003_run_outputs_governance.sql +58 -0
- package/migrations/sqlite/0004_hosted_pins.sql +21 -0
- package/migrations/sqlite/0005_revision_tombstone_registry.sql +18 -0
- package/migrations/sqlite/0005_tag_projection.sql +25 -0
- package/package.json +12 -8
- package/schemas/skill.schema.json +181 -0
- package/agent-skills/README.md +0 -41
- package/agent-skills/fleet-package-rollout/SKILL.md +0 -169
- package/agent-skills/inbox/SKILL.md +0 -25
- package/agent-skills/inbox/scripts/inbox +0 -109
- package/agent-skills/inbox/tests/test_registered_sender_id.sh +0 -92
- package/agent-skills/inbox-monitor/SKILL.md +0 -41
- package/agent-skills/inbox-monitor/scripts/inbox_monitor.sh +0 -91
- package/agent-skills/inbox-monitor/scripts/test_inbox_monitor.sh +0 -71
- package/agent-skills/merge-pr/SKILL.md +0 -85
- package/agent-skills/merge-pr/references/merge-safety.md +0 -82
- package/agent-skills/merge-pr/scripts/merge_pr_guard.py +0 -694
- package/agent-skills/merge-pr/scripts/test_merge_pr_guard.py +0 -647
- package/agent-skills/merge-pr/tests/fixtures/multi-commit-synthesized.json +0 -28
- package/agent-skills/merge-pr/tests/fixtures/trailer-free-provider.json +0 -28
- package/agent-skills/skill-goal-execute/SKILL.md +0 -115
- package/agent-skills/skill-login/SKILL.md +0 -109
- package/agent-skills/skill-project-create/SKILL.md +0 -91
- package/agent-skills/skill-publish/SKILL.md +0 -254
- package/agent-skills/skill-publish/scripts/capture_registry.js +0 -47
- package/agent-skills/skill-publish/scripts/publish_with_git_head.sh +0 -143
- package/agent-skills/skill-publish/scripts/test_publish_with_git_head.sh +0 -231
- package/skills/_common/auth.ts +0 -45
- package/skills/_common/http-client.ts +0 -143
- package/skills/_common/index.ts +0 -26
- package/skills/_common/install.sh +0 -7
- package/skills/_common/installer.ts +0 -72
- package/skills/_common/skill-install.ts +0 -37
- package/skills/_common/vision.ts +0 -374
- package/skills/ad-creative-pack/SKILL.md +0 -55
- package/skills/ad-creative-pack/package.json +0 -10
- package/skills/analyze-data/CLAUDE.md +0 -16
- package/skills/analyze-data/SKILL.md +0 -112
- package/skills/analyze-data/package.json +0 -23
- package/skills/analyze-data/src/analysis.ts +0 -401
- package/skills/analyze-data/src/cli.ts +0 -66
- package/skills/analyze-data/src/formatters.ts +0 -235
- package/skills/analyze-data/src/index.ts +0 -74
- package/skills/analyze-data/src/logger.ts +0 -36
- package/skills/analyze-data/src/parsers.ts +0 -57
- package/skills/analyze-data/src/stats.ts +0 -151
- package/skills/analyze-data/src/types.ts +0 -85
- package/skills/analyze-data/tsconfig.json +0 -19
- package/skills/api-docs-portal/SKILL.md +0 -84
- package/skills/api-docs-portal/package.json +0 -35
- package/skills/api-docs-portal/src/index.ts +0 -919
- package/skills/api-docs-portal/tsconfig.json +0 -17
- package/skills/api-test-suite/CLAUDE.md +0 -19
- package/skills/api-test-suite/package.json +0 -27
- package/skills/api-test-suite/src/index.ts +0 -381
- package/skills/api-test-suite/tsconfig.json +0 -10
- package/skills/audio-extract/CLAUDE.md +0 -9
- package/skills/audio-extract/SKILL.md +0 -73
- package/skills/audio-extract/package.json +0 -23
- package/skills/audio-extract/src/index.ts +0 -323
- package/skills/audio-extract/tsconfig.json +0 -11
- package/skills/bio-sequence-tool/CLAUDE.md +0 -19
- package/skills/bio-sequence-tool/package.json +0 -27
- package/skills/bio-sequence-tool/src/index.ts +0 -85
- package/skills/bio-sequence-tool/tsconfig.json +0 -10
- package/skills/blog-article/CLAUDE.md +0 -12
- package/skills/blog-article/SKILL.md +0 -55
- package/skills/blog-article/package.json +0 -10
- package/skills/blog-article/tsconfig.json +0 -10
- package/skills/brand-assets/SKILL.md +0 -118
- package/skills/brand-assets/package.json +0 -35
- package/skills/brand-assets/src/cli.ts +0 -155
- package/skills/brand-assets/src/constants.ts +0 -8
- package/skills/brand-assets/src/extract.ts +0 -236
- package/skills/brand-assets/src/index.ts +0 -668
- package/skills/brand-assets/src/types.ts +0 -59
- package/skills/brand-assets/tsconfig.json +0 -17
- package/skills/brand-kit/SKILL.md +0 -54
- package/skills/brand-kit/package.json +0 -10
- package/skills/businessactivity/CLAUDE.md +0 -176
- package/skills/businessactivity/LICENSE +0 -192
- package/skills/businessactivity/README.md +0 -287
- package/skills/businessactivity/package.json +0 -25
- package/skills/businessactivity/scripts/publish.ts +0 -210
- package/skills/businessactivity/src/commands/activity.ts +0 -211
- package/skills/businessactivity/src/commands/function.ts +0 -227
- package/skills/businessactivity/src/commands/owner.ts +0 -193
- package/skills/businessactivity/src/commands/profile.ts +0 -121
- package/skills/businessactivity/src/commands/responsibility.ts +0 -264
- package/skills/businessactivity/src/commands/team.ts +0 -244
- package/skills/businessactivity/src/commands/workflow.ts +0 -359
- package/skills/businessactivity/src/index.ts +0 -3
- package/skills/businessactivity/src/lib/config.ts +0 -167
- package/skills/businessactivity/src/lib/output.ts +0 -76
- package/skills/businessactivity/src/lib/paths.ts +0 -79
- package/skills/businessactivity/src/lib/storage.ts +0 -95
- package/skills/businessactivity/src/types/index.ts +0 -86
- package/skills/businessactivity/tsconfig.json +0 -29
- package/skills/codefix/LICENSE +0 -192
- package/skills/codefix/README.md +0 -232
- package/skills/codefix/SKILL.md +0 -94
- package/skills/codefix/package.json +0 -21
- package/skills/codefix/src/fixers/batch.ts +0 -213
- package/skills/codefix/src/fixers/detector.ts +0 -160
- package/skills/codefix/src/fixers/index.ts +0 -7
- package/skills/codefix/src/fixers/runner.ts +0 -522
- package/skills/codefix/src/index-local.ts +0 -431
- package/skills/codefix/src/index.ts +0 -4
- package/skills/codefix/src/types.ts +0 -211
- package/skills/codefix/tsconfig.json +0 -15
- package/skills/commitpush/SKILL.md +0 -57
- package/skills/commitpush/package.json +0 -33
- package/skills/commitpush/src/index.ts +0 -34
- package/skills/commitpush/tsconfig.json +0 -17
- package/skills/commitpushpr/SKILL.md +0 -55
- package/skills/commitpushpr/package.json +0 -33
- package/skills/commitpushpr/src/index.ts +0 -34
- package/skills/commitpushpr/tsconfig.json +0 -17
- package/skills/compress-video/CLAUDE.md +0 -9
- package/skills/compress-video/SKILL.md +0 -79
- package/skills/compress-video/package.json +0 -23
- package/skills/compress-video/src/index.ts +0 -473
- package/skills/compress-video/tsconfig.json +0 -11
- package/skills/contract-review-report/SKILL.md +0 -52
- package/skills/contract-review-report/package.json +0 -10
- package/skills/customer-feedback-report/SKILL.md +0 -52
- package/skills/customer-feedback-report/package.json +0 -10
- package/skills/dashboard-builder/CLAUDE.md +0 -19
- package/skills/dashboard-builder/package.json +0 -29
- package/skills/dashboard-builder/src/index.ts +0 -150
- package/skills/dashboard-builder/tsconfig.json +0 -10
- package/skills/data-anonymizer/CLAUDE.md +0 -19
- package/skills/data-anonymizer/package.json +0 -27
- package/skills/data-anonymizer/src/index.ts +0 -183
- package/skills/data-anonymizer/tsconfig.json +0 -10
- package/skills/database-explorer/CLAUDE.md +0 -19
- package/skills/database-explorer/package.json +0 -29
- package/skills/database-explorer/src/index.ts +0 -95
- package/skills/database-explorer/tsconfig.json +0 -10
- package/skills/diff-viewer/CLAUDE.md +0 -19
- package/skills/diff-viewer/package.json +0 -30
- package/skills/diff-viewer/src/index.ts +0 -164
- package/skills/diff-viewer/tsconfig.json +0 -10
- package/skills/doc-read/SKILL.md +0 -45
- package/skills/doc-read/package.json +0 -29
- package/skills/doc-read/src/index.ts +0 -324
- package/skills/doc-read/tsconfig.json +0 -8
- package/skills/domainpurchase/LICENSE +0 -192
- package/skills/domainpurchase/SKILL.md +0 -29
- package/skills/domainpurchase/package.json +0 -30
- package/skills/domainpurchase/src/index.ts +0 -3
- package/skills/domainpurchase/tsconfig.json +0 -21
- package/skills/email-sequence/SKILL.md +0 -53
- package/skills/email-sequence/package.json +0 -10
- package/skills/experiment-power-calculator/CLAUDE.md +0 -19
- package/skills/experiment-power-calculator/package.json +0 -29
- package/skills/experiment-power-calculator/src/index.ts +0 -86
- package/skills/experiment-power-calculator/tsconfig.json +0 -10
- package/skills/extract-frames/CLAUDE.md +0 -19
- package/skills/extract-frames/package.json +0 -27
- package/skills/extract-frames/src/index.ts +0 -616
- package/skills/extract-frames/tsconfig.json +0 -10
- package/skills/file-organizer/CLAUDE.md +0 -19
- package/skills/file-organizer/package.json +0 -27
- package/skills/file-organizer/src/index.ts +0 -91
- package/skills/file-organizer/tsconfig.json +0 -10
- package/skills/folder-tree/CLAUDE.md +0 -19
- package/skills/folder-tree/package.json +0 -29
- package/skills/folder-tree/src/index.ts +0 -568
- package/skills/folder-tree/tsconfig.json +0 -10
- package/skills/form-filler/CLAUDE.md +0 -19
- package/skills/form-filler/package.json +0 -29
- package/skills/form-filler/src/index.ts +0 -81
- package/skills/form-filler/tsconfig.json +0 -10
- package/skills/generate-api-client/CLAUDE.md +0 -19
- package/skills/generate-api-client/package.json +0 -29
- package/skills/generate-api-client/src/generator.ts +0 -47
- package/skills/generate-api-client/src/index.ts +0 -92
- package/skills/generate-api-client/src/logger.ts +0 -34
- package/skills/generate-api-client/src/python-generator.ts +0 -245
- package/skills/generate-api-client/src/spec-loader.ts +0 -48
- package/skills/generate-api-client/src/type-mappers.ts +0 -79
- package/skills/generate-api-client/src/types.ts +0 -76
- package/skills/generate-api-client/src/typescript-generator.ts +0 -247
- package/skills/generate-api-client/tsconfig.json +0 -10
- package/skills/generate-chart/CLAUDE.md +0 -19
- package/skills/generate-chart/package.json +0 -27
- package/skills/generate-chart/src/index.ts +0 -510
- package/skills/generate-chart/tsconfig.json +0 -10
- package/skills/generate-dockerfile/CLAUDE.md +0 -19
- package/skills/generate-dockerfile/package.json +0 -27
- package/skills/generate-dockerfile/src/cli.ts +0 -78
- package/skills/generate-dockerfile/src/dockerfile-templates.ts +0 -392
- package/skills/generate-dockerfile/src/index.ts +0 -81
- package/skills/generate-dockerfile/src/logger.ts +0 -30
- package/skills/generate-dockerfile/src/project-detection.ts +0 -68
- package/skills/generate-dockerfile/src/support-files.ts +0 -171
- package/skills/generate-dockerfile/src/types.ts +0 -29
- package/skills/generate-dockerfile/tsconfig.json +0 -10
- package/skills/generate-env/CLAUDE.md +0 -19
- package/skills/generate-env/package.json +0 -29
- package/skills/generate-env/src/cli.ts +0 -85
- package/skills/generate-env/src/detection.ts +0 -161
- package/skills/generate-env/src/env-data.ts +0 -66
- package/skills/generate-env/src/generators.ts +0 -240
- package/skills/generate-env/src/index.ts +0 -120
- package/skills/generate-env/src/runtime.ts +0 -30
- package/skills/generate-env/src/types.ts +0 -32
- package/skills/generate-env/tsconfig.json +0 -10
- package/skills/generate-favicon/CLAUDE.md +0 -19
- package/skills/generate-favicon/package.json +0 -29
- package/skills/generate-favicon/src/index.ts +0 -421
- package/skills/generate-favicon/tsconfig.json +0 -10
- package/skills/generate-qrcode/CLAUDE.md +0 -19
- package/skills/generate-qrcode/package.json +0 -30
- package/skills/generate-qrcode/src/index.ts +0 -584
- package/skills/generate-qrcode/tsconfig.json +0 -10
- package/skills/generate-resume/CLAUDE.md +0 -19
- package/skills/generate-resume/package.json +0 -27
- package/skills/generate-resume/src/cli.ts +0 -157
- package/skills/generate-resume/src/index.ts +0 -178
- package/skills/generate-resume/src/parsers.ts +0 -95
- package/skills/generate-resume/src/renderers.ts +0 -538
- package/skills/generate-resume/src/security.ts +0 -39
- package/skills/generate-resume/src/types.ts +0 -86
- package/skills/generate-resume/tsconfig.json +0 -10
- package/skills/generate-sitemap/CLAUDE.md +0 -19
- package/skills/generate-sitemap/package.json +0 -27
- package/skills/generate-sitemap/src/index.ts +0 -626
- package/skills/generate-sitemap/tsconfig.json +0 -10
- package/skills/gif-maker/CLAUDE.md +0 -19
- package/skills/gif-maker/package.json +0 -30
- package/skills/gif-maker/src/index.ts +0 -600
- package/skills/gif-maker/tsconfig.json +0 -10
- package/skills/hook/LICENSE +0 -192
- package/skills/hook/README.md +0 -74
- package/skills/hook/SKILL.md +0 -85
- package/skills/hook/bunfig.toml +0 -5
- package/skills/hook/package.json +0 -28
- package/skills/hook/src/commands/create.ts +0 -112
- package/skills/hook/src/commands/events.ts +0 -37
- package/skills/hook/src/commands/validate.ts +0 -117
- package/skills/hook/src/index.ts +0 -118
- package/skills/hook/src/templates/root.ts +0 -196
- package/skills/hook/src/templates/source.ts +0 -647
- package/skills/hook/tsconfig.json +0 -18
- package/skills/http-server/CLAUDE.md +0 -19
- package/skills/http-server/package.json +0 -29
- package/skills/http-server/src/index.ts +0 -51
- package/skills/http-server/tsconfig.json +0 -10
- package/skills/implementation/LICENSE +0 -192
- package/skills/implementation/README.md +0 -53
- package/skills/implementation/SKILL.md +0 -57
- package/skills/implementation/bunfig.toml +0 -5
- package/skills/implementation/package.json +0 -28
- package/skills/implementation/src/commands/create.ts +0 -187
- package/skills/implementation/src/index.ts +0 -62
- package/skills/implementation/tsconfig.json +0 -18
- package/skills/implementation-plan/CLAUDE.md +0 -19
- package/skills/implementation-plan/package.json +0 -29
- package/skills/implementation-plan/src/index.ts +0 -520
- package/skills/implementation-plan/tsconfig.json +0 -10
- package/skills/implementation-todo/CLAUDE.md +0 -19
- package/skills/implementation-todo/package.json +0 -29
- package/skills/implementation-todo/src/index.ts +0 -429
- package/skills/implementation-todo/tsconfig.json +0 -10
- package/skills/invoice/.env.example +0 -3
- package/skills/invoice/CLAUDE.md +0 -31
- package/skills/invoice/LICENSE +0 -192
- package/skills/invoice/README.md +0 -70
- package/skills/invoice/package.json +0 -26
- package/skills/invoice/src/commands/companies.ts +0 -202
- package/skills/invoice/src/commands/config.ts +0 -132
- package/skills/invoice/src/commands/generate.ts +0 -177
- package/skills/invoice/src/commands/invoices.ts +0 -218
- package/skills/invoice/src/index.ts +0 -3
- package/skills/invoice/src/lib/api.ts +0 -124
- package/skills/invoice/src/lib/storage.ts +0 -171
- package/skills/invoice/src/types/index.ts +0 -86
- package/skills/invoice/src/utils/logger.ts +0 -33
- package/skills/invoice/src/utils/paths.ts +0 -25
- package/skills/invoice/tsconfig.json +0 -23
- package/skills/invoice-reconciliation/SKILL.md +0 -98
- package/skills/invoice-reconciliation/package.json +0 -36
- package/skills/invoice-reconciliation/src/index.ts +0 -743
- package/skills/invoice-reconciliation/tsconfig.json +0 -17
- package/skills/landing-page-pack/SKILL.md +0 -55
- package/skills/landing-page-pack/package.json +0 -10
- package/skills/latex-table-generator/CLAUDE.md +0 -19
- package/skills/latex-table-generator/package.json +0 -29
- package/skills/latex-table-generator/src/index.ts +0 -113
- package/skills/latex-table-generator/tsconfig.json +0 -10
- package/skills/logo-design/SKILL.md +0 -94
- package/skills/logo-design/package.json +0 -35
- package/skills/logo-design/src/cli.ts +0 -132
- package/skills/logo-design/src/constants.ts +0 -5
- package/skills/logo-design/src/docs.ts +0 -102
- package/skills/logo-design/src/geometry.ts +0 -324
- package/skills/logo-design/src/index.ts +0 -212
- package/skills/logo-design/src/palette.ts +0 -258
- package/skills/logo-design/src/types.ts +0 -50
- package/skills/logo-design/tsconfig.json +0 -17
- package/skills/lorem-generator/CLAUDE.md +0 -19
- package/skills/lorem-generator/package.json +0 -29
- package/skills/lorem-generator/src/index.ts +0 -59
- package/skills/lorem-generator/tsconfig.json +0 -10
- package/skills/managemcp/CLAUDE.md +0 -14
- package/skills/managemcp/README.md +0 -24
- package/skills/managemcp/package.json +0 -16
- package/skills/managemcp/src/index.ts +0 -3
- package/skills/managemcp/tsconfig.json +0 -27
- package/skills/markdown-validator/CLAUDE.md +0 -19
- package/skills/markdown-validator/package.json +0 -29
- package/skills/markdown-validator/src/index.ts +0 -92
- package/skills/markdown-validator/tsconfig.json +0 -10
- package/skills/market-research-report/SKILL.md +0 -51
- package/skills/market-research-report/package.json +0 -10
- package/skills/meeting-pack/SKILL.md +0 -52
- package/skills/meeting-pack/package.json +0 -10
- package/skills/merge-pdfs/CLAUDE.md +0 -19
- package/skills/merge-pdfs/package.json +0 -31
- package/skills/merge-pdfs/src/index.ts +0 -427
- package/skills/merge-pdfs/tsconfig.json +0 -10
- package/skills/migration-plan-pack/SKILL.md +0 -56
- package/skills/migration-plan-pack/package.json +0 -10
- package/skills/monitor/SKILL.md +0 -69
- package/skills/monitor/package.json +0 -33
- package/skills/monitor/src/index.ts +0 -34
- package/skills/monitor/tsconfig.json +0 -17
- package/skills/one-page-website/SKILL.md +0 -128
- package/skills/one-page-website/package.json +0 -34
- package/skills/one-page-website/src/design.ts +0 -336
- package/skills/one-page-website/src/docs.ts +0 -159
- package/skills/one-page-website/src/index.ts +0 -357
- package/skills/one-page-website/src/page.ts +0 -340
- package/skills/one-page-website/src/styles.ts +0 -508
- package/skills/one-page-website/src/types.ts +0 -78
- package/skills/one-page-website/tsconfig.json +0 -17
- package/skills/pdf-generate/CLAUDE.md +0 -19
- package/skills/pdf-generate/SKILL.md +0 -86
- package/skills/pdf-generate/package.json +0 -21
- package/skills/pdf-generate/src/cli.ts +0 -162
- package/skills/pdf-generate/src/html.ts +0 -84
- package/skills/pdf-generate/src/index.ts +0 -62
- package/skills/pdf-generate/src/markdown.ts +0 -27
- package/skills/pdf-generate/src/pdf-writer.ts +0 -78
- package/skills/pdf-generate/src/runtime.ts +0 -34
- package/skills/pdf-generate/src/security.ts +0 -37
- package/skills/pdf-generate/src/templates.ts +0 -311
- package/skills/pdf-generate/src/types.ts +0 -28
- package/skills/pdf-generate/tsconfig.json +0 -16
- package/skills/pdf-to-dataset/SKILL.md +0 -88
- package/skills/pdf-to-dataset/package.json +0 -37
- package/skills/pdf-to-dataset/src/index.ts +0 -790
- package/skills/pdf-to-dataset/tsconfig.json +0 -17
- package/skills/pdf-to-markdown/SKILL.md +0 -81
- package/skills/pdf-to-markdown/package.json +0 -35
- package/skills/pdf-to-markdown/src/index.ts +0 -694
- package/skills/pdf-to-markdown/tsconfig.json +0 -17
- package/skills/performance-audit-report/SKILL.md +0 -49
- package/skills/performance-audit-report/package.json +0 -10
- package/skills/pitch-deck/SKILL.md +0 -51
- package/skills/pitch-deck/package.json +0 -10
- package/skills/product-mockup/SKILL.md +0 -107
- package/skills/product-mockup/package.json +0 -32
- package/skills/product-mockup/src/cli.ts +0 -150
- package/skills/product-mockup/src/design.ts +0 -151
- package/skills/product-mockup/src/docs.ts +0 -134
- package/skills/product-mockup/src/index.ts +0 -182
- package/skills/product-mockup/src/render.ts +0 -407
- package/skills/product-mockup/src/types.ts +0 -66
- package/skills/product-mockup/tsconfig.json +0 -17
- package/skills/proposal-pack/SKILL.md +0 -53
- package/skills/proposal-pack/package.json +0 -10
- package/skills/read-csv/SKILL.md +0 -62
- package/skills/read-csv/package.json +0 -37
- package/skills/read-csv/src/index.ts +0 -356
- package/skills/read-csv/tsconfig.json +0 -17
- package/skills/read-excel/SKILL.md +0 -64
- package/skills/read-excel/package.json +0 -36
- package/skills/read-excel/src/index.ts +0 -266
- package/skills/read-excel/tsconfig.json +0 -17
- package/skills/regex-tester/CLAUDE.md +0 -19
- package/skills/regex-tester/package.json +0 -27
- package/skills/regex-tester/src/index.ts +0 -183
- package/skills/regex-tester/tsconfig.json +0 -10
- package/skills/repo-onboarding-report/SKILL.md +0 -52
- package/skills/repo-onboarding-report/package.json +0 -10
- package/skills/scancommitpr/SKILL.md +0 -178
- package/skills/scancommitpr/package.json +0 -34
- package/skills/scancommitpr/src/index.ts +0 -44
- package/skills/scancommitpr/tsconfig.json +0 -13
- package/skills/scancommitpush/SKILL.md +0 -174
- package/skills/scancommitpush/package.json +0 -32
- package/skills/scancommitpush/src/index.ts +0 -44
- package/skills/scancommitpush/tsconfig.json +0 -13
- package/skills/scientific-figure-check/CLAUDE.md +0 -19
- package/skills/scientific-figure-check/package.json +0 -29
- package/skills/scientific-figure-check/src/index.ts +0 -83
- package/skills/scientific-figure-check/tsconfig.json +0 -10
- package/skills/security-audit/CLAUDE.md +0 -19
- package/skills/security-audit/package.json +0 -27
- package/skills/security-audit/src/index.ts +0 -145
- package/skills/security-audit/tsconfig.json +0 -10
- package/skills/security-audit-report/SKILL.md +0 -52
- package/skills/security-audit-report/package.json +0 -10
- package/skills/seo-content-pack/SKILL.md +0 -54
- package/skills/seo-content-pack/package.json +0 -10
- package/skills/siteanalyze/SKILL.md +0 -25
- package/skills/siteanalyze/package.json +0 -27
- package/skills/siteanalyze/src/index.ts +0 -592
- package/skills/slide-deck-generator/SKILL.md +0 -93
- package/skills/slide-deck-generator/package.json +0 -38
- package/skills/slide-deck-generator/src/cli.ts +0 -133
- package/skills/slide-deck-generator/src/index.ts +0 -148
- package/skills/slide-deck-generator/src/model.ts +0 -307
- package/skills/slide-deck-generator/src/pptx.ts +0 -143
- package/skills/slide-deck-generator/src/render.ts +0 -248
- package/skills/slide-deck-generator/src/types.ts +0 -114
- package/skills/slide-deck-generator/src/utils.ts +0 -53
- package/skills/slide-deck-generator/tsconfig.json +0 -17
- package/skills/social-content-calendar/SKILL.md +0 -54
- package/skills/social-content-calendar/package.json +0 -10
- package/skills/split-pdf/CLAUDE.md +0 -19
- package/skills/split-pdf/package.json +0 -30
- package/skills/split-pdf/src/index.ts +0 -301
- package/skills/split-pdf/tsconfig.json +0 -10
- package/skills/statistical-test-selector/CLAUDE.md +0 -19
- package/skills/statistical-test-selector/package.json +0 -27
- package/skills/statistical-test-selector/src/index.ts +0 -75
- package/skills/statistical-test-selector/tsconfig.json +0 -10
- package/skills/test-suite-generator/SKILL.md +0 -51
- package/skills/test-suite-generator/package.json +0 -10
- package/skills/tmux-session/SKILL.md +0 -109
- package/skills/tmux-session/package.json +0 -33
- package/skills/tmux-session/src/index.ts +0 -34
- package/skills/tmux-session/tsconfig.json +0 -17
- package/skills/todos-plan/SKILL.md +0 -363
- package/skills/todos-plan/agents/openai.yaml +0 -4
- package/skills/todos-plan/package.json +0 -9
- package/skills/todos-plan/src/index.ts +0 -68
- package/skills/tsconfig.base.json +0 -12
- package/skills/validate-config/CLAUDE.md +0 -19
- package/skills/validate-config/package.json +0 -29
- package/skills/validate-config/src/index.ts +0 -56
- package/skills/validate-config/tsconfig.json +0 -10
- package/skills/video-downloader/CLAUDE.md +0 -19
- package/skills/video-downloader/package.json +0 -29
- package/skills/video-downloader/src/index.ts +0 -561
- package/skills/video-downloader/tsconfig.json +0 -10
- package/skills/video-highlight-pack/SKILL.md +0 -54
- package/skills/video-highlight-pack/package.json +0 -10
- package/skills/watermark/CLAUDE.md +0 -19
- package/skills/watermark/package.json +0 -32
- package/skills/watermark/src/index.ts +0 -587
- package/skills/watermark/tsconfig.json +0 -10
|
@@ -1,647 +0,0 @@
|
|
|
1
|
-
export function generateIndexTs(hookName: string, shortName: string): string {
|
|
2
|
-
return `#!/usr/bin/env bun
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* ${hookName} - Claude Code hook
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { runHook } from './commands/run';
|
|
9
|
-
import { setupHook } from './commands/setup';
|
|
10
|
-
import { testHook } from './commands/test';
|
|
11
|
-
import { showConfig, setConfig } from './commands/config';
|
|
12
|
-
import { showLogs, clearLogs } from './utils/logger';
|
|
13
|
-
|
|
14
|
-
// Read hook config
|
|
15
|
-
const hookConfigPath = new URL('../hook.config.json', import.meta.url).pathname;
|
|
16
|
-
const hookConfig = await Bun.file(hookConfigPath).json();
|
|
17
|
-
|
|
18
|
-
export function printHelp() {
|
|
19
|
-
console.log(\`${hookName} v\${hookConfig.version}
|
|
20
|
-
|
|
21
|
-
\${hookConfig.description}
|
|
22
|
-
|
|
23
|
-
USAGE:
|
|
24
|
-
${hookName} [command] [options]
|
|
25
|
-
|
|
26
|
-
COMMANDS:
|
|
27
|
-
(no command) Run the hook (reads stdin, outputs JSON)
|
|
28
|
-
setup Configure Claude Code to use this hook
|
|
29
|
-
test [input] Test the hook with sample input
|
|
30
|
-
config Show current configuration
|
|
31
|
-
config set <k> <v> Update configuration
|
|
32
|
-
logs View recent log entries
|
|
33
|
-
logs clear Clear the log file
|
|
34
|
-
help Show this help message
|
|
35
|
-
|
|
36
|
-
OPTIONS:
|
|
37
|
-
--global Use global scope (~/.claude)
|
|
38
|
-
--project Use project scope (./.claude)
|
|
39
|
-
--verbosity <lvl> Set log level: none, blocked, all
|
|
40
|
-
--yes Skip confirmation prompts
|
|
41
|
-
--version Show version
|
|
42
|
-
--help Show help
|
|
43
|
-
\`);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function main() {
|
|
47
|
-
const args = process.argv.slice(2);
|
|
48
|
-
const command = args[0];
|
|
49
|
-
|
|
50
|
-
// Version
|
|
51
|
-
if (args.includes('--version') || args.includes('-v')) {
|
|
52
|
-
console.log(hookConfig.version);
|
|
53
|
-
process.exit(0);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Help
|
|
57
|
-
if (args.includes('--help') || args.includes('-h') || command === 'help') {
|
|
58
|
-
printHelp();
|
|
59
|
-
process.exit(0);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// Parse options
|
|
63
|
-
const options: Record<string, string | boolean> = {};
|
|
64
|
-
for (let i = 0; i < args.length; i++) {
|
|
65
|
-
if (args[i] === '--global') options.global = true;
|
|
66
|
-
else if (args[i] === '--project') options.project = true;
|
|
67
|
-
else if (args[i] === '--yes' || args[i] === '-y') options.yes = true;
|
|
68
|
-
else if (args[i] === '--verbosity' && args[i + 1]) {
|
|
69
|
-
options.verbosity = args[++i];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
switch (command) {
|
|
74
|
-
case 'setup':
|
|
75
|
-
await setupHook(hookConfig, options);
|
|
76
|
-
break;
|
|
77
|
-
|
|
78
|
-
case 'test':
|
|
79
|
-
await testHook(args.slice(1).filter(a => !a.startsWith('--')));
|
|
80
|
-
break;
|
|
81
|
-
|
|
82
|
-
case 'config':
|
|
83
|
-
if (args[1] === 'set' && args[2] && args[3]) {
|
|
84
|
-
await setConfig(hookConfig.name, args[2], args[3]);
|
|
85
|
-
} else {
|
|
86
|
-
await showConfig(hookConfig.name);
|
|
87
|
-
}
|
|
88
|
-
break;
|
|
89
|
-
|
|
90
|
-
case 'logs':
|
|
91
|
-
if (args[1] === 'clear') {
|
|
92
|
-
await clearLogs(hookConfig.name);
|
|
93
|
-
} else {
|
|
94
|
-
await showLogs(hookConfig.name);
|
|
95
|
-
}
|
|
96
|
-
break;
|
|
97
|
-
|
|
98
|
-
case undefined:
|
|
99
|
-
// No command = run the hook (read from stdin)
|
|
100
|
-
await runHook(hookConfig);
|
|
101
|
-
break;
|
|
102
|
-
|
|
103
|
-
default:
|
|
104
|
-
console.error(\`Unknown command: \${command}\`);
|
|
105
|
-
printHelp();
|
|
106
|
-
process.exit(1);
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
main().catch((error) => {
|
|
111
|
-
console.error(JSON.stringify({ decision: 'error', message: error.message }));
|
|
112
|
-
process.exit(1);
|
|
113
|
-
});
|
|
114
|
-
`;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function generateRunTs(shortName: string, event: string): string {
|
|
118
|
-
const canBlock = event === 'PreToolUse';
|
|
119
|
-
|
|
120
|
-
return `/**
|
|
121
|
-
* Main hook execution logic
|
|
122
|
-
*/
|
|
123
|
-
|
|
124
|
-
import { process${shortName.charAt(0).toUpperCase() + shortName.slice(1)} } from '../core/${shortName}';
|
|
125
|
-
import { log } from '../utils/logger';
|
|
126
|
-
|
|
127
|
-
interface HookInput {
|
|
128
|
-
tool?: string;
|
|
129
|
-
input?: any;
|
|
130
|
-
output?: any;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
interface HookOutput {
|
|
134
|
-
decision: 'allow' | 'block' | 'error';
|
|
135
|
-
reason?: string;
|
|
136
|
-
message?: string;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export async function runHook(hookConfig: any): Promise<void> {
|
|
140
|
-
let input: HookInput = {};
|
|
141
|
-
|
|
142
|
-
// Read from stdin
|
|
143
|
-
const chunks: Buffer[] = [];
|
|
144
|
-
for await (const chunk of Bun.stdin.stream()) {
|
|
145
|
-
chunks.push(Buffer.from(chunk));
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
const stdinData = Buffer.concat(chunks).toString('utf-8').trim();
|
|
149
|
-
|
|
150
|
-
if (stdinData) {
|
|
151
|
-
try {
|
|
152
|
-
input = JSON.parse(stdinData);
|
|
153
|
-
} catch {
|
|
154
|
-
// Not JSON, might be raw command
|
|
155
|
-
input = { input: stdinData };
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
try {
|
|
160
|
-
const result = await process${shortName.charAt(0).toUpperCase() + shortName.slice(1)}(input, hookConfig);
|
|
161
|
-
|
|
162
|
-
// Log based on verbosity
|
|
163
|
-
await log(hookConfig.name, {
|
|
164
|
-
event: hookConfig.event,
|
|
165
|
-
action: result.decision,
|
|
166
|
-
input,
|
|
167
|
-
reason: result.reason,
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
// Output result
|
|
171
|
-
console.log(JSON.stringify(result));
|
|
172
|
-
} catch (error) {
|
|
173
|
-
const errorResult: HookOutput = {
|
|
174
|
-
decision: 'error',
|
|
175
|
-
message: (error as Error).message,
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
await log(hookConfig.name, {
|
|
179
|
-
event: hookConfig.event,
|
|
180
|
-
action: 'error',
|
|
181
|
-
input,
|
|
182
|
-
reason: errorResult.message,
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
console.log(JSON.stringify(errorResult));
|
|
186
|
-
process.exit(1);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
`;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export function generateSetupTs(hookName: string): string {
|
|
193
|
-
return `/**
|
|
194
|
-
* Setup command - configures Claude Code to use this hook
|
|
195
|
-
*/
|
|
196
|
-
|
|
197
|
-
import { existsSync, mkdirSync } from 'fs';
|
|
198
|
-
import { join } from 'path';
|
|
199
|
-
import { homedir } from 'os';
|
|
200
|
-
import { readClaudeSettings, writeClaudeSettings, mergeHookConfig } from '../utils/claude';
|
|
201
|
-
|
|
202
|
-
interface SetupOptions {
|
|
203
|
-
global?: boolean;
|
|
204
|
-
project?: boolean;
|
|
205
|
-
verbosity?: string;
|
|
206
|
-
yes?: boolean;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
export async function setupHook(hookConfig: any, options: SetupOptions): Promise<void> {
|
|
210
|
-
console.log(\`Setting up \${hookConfig.name}...\\n\`);
|
|
211
|
-
|
|
212
|
-
// Determine scope
|
|
213
|
-
let scope: 'global' | 'project';
|
|
214
|
-
|
|
215
|
-
if (options.global) {
|
|
216
|
-
scope = 'global';
|
|
217
|
-
} else if (options.project) {
|
|
218
|
-
scope = 'project';
|
|
219
|
-
} else {
|
|
220
|
-
// Interactive prompt
|
|
221
|
-
console.log('Where should the hook be configured?');
|
|
222
|
-
console.log(' 1. Global (~/.claude) - applies to all projects');
|
|
223
|
-
console.log(' 2. Project (./.claude) - applies to this project only');
|
|
224
|
-
process.stdout.write('\\nChoice [1]: ');
|
|
225
|
-
|
|
226
|
-
const choice = await readLine();
|
|
227
|
-
scope = choice === '2' ? 'project' : 'global';
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const baseDir = scope === 'global'
|
|
231
|
-
? join(homedir(), '.claude')
|
|
232
|
-
: join(process.cwd(), '.claude');
|
|
233
|
-
|
|
234
|
-
const hooksDir = join(baseDir, 'hooks');
|
|
235
|
-
|
|
236
|
-
console.log(\`\\nScope: \${scope} (\${baseDir})\`);
|
|
237
|
-
|
|
238
|
-
// Determine verbosity
|
|
239
|
-
let verbosity = options.verbosity || 'blocked';
|
|
240
|
-
if (!options.verbosity && !options.yes) {
|
|
241
|
-
console.log('\\nLog verbosity:');
|
|
242
|
-
console.log(' 1. blocked - Only log blocked operations');
|
|
243
|
-
console.log(' 2. all - Log all operations');
|
|
244
|
-
console.log(' 3. none - Disable logging');
|
|
245
|
-
process.stdout.write('\\nChoice [1]: ');
|
|
246
|
-
|
|
247
|
-
const choice = await readLine();
|
|
248
|
-
verbosity = choice === '2' ? 'all' : choice === '3' ? 'none' : 'blocked';
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
console.log(\`Verbosity: \${verbosity}\`);
|
|
252
|
-
|
|
253
|
-
// Create hooks directory
|
|
254
|
-
if (!existsSync(hooksDir)) {
|
|
255
|
-
mkdirSync(hooksDir, { recursive: true });
|
|
256
|
-
console.log(\`\\nCreated: \${hooksDir}\`);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// Create log file
|
|
260
|
-
const logFile = join(hooksDir, hookConfig.logFile);
|
|
261
|
-
if (!existsSync(logFile)) {
|
|
262
|
-
await Bun.write(logFile, '');
|
|
263
|
-
console.log(\`Created: \${logFile}\`);
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
// Create hook config file
|
|
267
|
-
const configFile = join(hooksDir, \`\${hookConfig.name}.config.json\`);
|
|
268
|
-
await Bun.write(configFile, JSON.stringify({
|
|
269
|
-
verbosity,
|
|
270
|
-
enabled: true,
|
|
271
|
-
}, null, 2));
|
|
272
|
-
console.log(\`Created: \${configFile}\`);
|
|
273
|
-
|
|
274
|
-
// Copy HOOK.md
|
|
275
|
-
const hookMdSource = new URL('../../HOOK.md', import.meta.url).pathname;
|
|
276
|
-
const hookMdDest = join(hooksDir, \`\${hookConfig.name}.md\`);
|
|
277
|
-
if (existsSync(hookMdSource)) {
|
|
278
|
-
const content = await Bun.file(hookMdSource).text();
|
|
279
|
-
await Bun.write(hookMdDest, content);
|
|
280
|
-
console.log(\`Created: \${hookMdDest}\`);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// Update Claude settings
|
|
284
|
-
const settingsPath = join(baseDir, 'settings.json');
|
|
285
|
-
const settings = await readClaudeSettings(settingsPath);
|
|
286
|
-
|
|
287
|
-
const newSettings = mergeHookConfig(settings, {
|
|
288
|
-
event: hookConfig.event,
|
|
289
|
-
matcher: hookConfig.matcher,
|
|
290
|
-
command: hookConfig.name,
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
await writeClaudeSettings(settingsPath, newSettings);
|
|
294
|
-
console.log(\`Updated: \${settingsPath}\`);
|
|
295
|
-
|
|
296
|
-
console.log(\`\\n\${hookConfig.name} setup complete!\`);
|
|
297
|
-
console.log(\`\\nThe hook will now run on \${hookConfig.event} events.\`);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
async function readLine(): Promise<string> {
|
|
301
|
-
const buf = new Uint8Array(1024);
|
|
302
|
-
const n = await Bun.stdin.stream().getReader().read();
|
|
303
|
-
return new TextDecoder().decode(n.value).trim();
|
|
304
|
-
}
|
|
305
|
-
`;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
export function generateTestTs(shortName: string): string {
|
|
309
|
-
return `/**
|
|
310
|
-
* Test command - manually test the hook
|
|
311
|
-
*/
|
|
312
|
-
|
|
313
|
-
import { process${shortName.charAt(0).toUpperCase() + shortName.slice(1)} } from '../core/${shortName}';
|
|
314
|
-
|
|
315
|
-
export async function testHook(args: string[]): Promise<void> {
|
|
316
|
-
const testInput = args.join(' ') || 'echo "test"';
|
|
317
|
-
|
|
318
|
-
console.log('Testing hook with input:');
|
|
319
|
-
console.log(\` \${testInput}\\n\`);
|
|
320
|
-
|
|
321
|
-
// Load hook config
|
|
322
|
-
const hookConfigPath = new URL('../../hook.config.json', import.meta.url).pathname;
|
|
323
|
-
const hookConfig = await Bun.file(hookConfigPath).json();
|
|
324
|
-
|
|
325
|
-
const input = {
|
|
326
|
-
tool: 'Bash',
|
|
327
|
-
input: { command: testInput },
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
try {
|
|
331
|
-
const result = await process${shortName.charAt(0).toUpperCase() + shortName.slice(1)}(input, hookConfig);
|
|
332
|
-
|
|
333
|
-
console.log('Result:');
|
|
334
|
-
console.log(JSON.stringify(result, null, 2));
|
|
335
|
-
} catch (error) {
|
|
336
|
-
console.error('Error:', (error as Error).message);
|
|
337
|
-
process.exit(1);
|
|
338
|
-
}
|
|
339
|
-
}
|
|
340
|
-
`;
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
export function generateConfigTs(hookName: string): string {
|
|
344
|
-
return `/**
|
|
345
|
-
* Config command - show/update hook configuration
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
import { existsSync } from 'fs';
|
|
349
|
-
import { join } from 'path';
|
|
350
|
-
import { homedir } from 'os';
|
|
351
|
-
|
|
352
|
-
export async function showConfig(hookName: string): Promise<void> {
|
|
353
|
-
const locations = [
|
|
354
|
-
join(process.cwd(), '.claude', 'hooks', \`\${hookName}.config.json\`),
|
|
355
|
-
join(homedir(), '.claude', 'hooks', \`\${hookName}.config.json\`),
|
|
356
|
-
];
|
|
357
|
-
|
|
358
|
-
for (const path of locations) {
|
|
359
|
-
if (existsSync(path)) {
|
|
360
|
-
console.log(\`Config: \${path}\\n\`);
|
|
361
|
-
const config = await Bun.file(path).json();
|
|
362
|
-
console.log(JSON.stringify(config, null, 2));
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
console.log('No configuration found. Run setup first:');
|
|
368
|
-
console.log(\` \${hookName} setup\`);
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
export async function setConfig(hookName: string, key: string, value: string): Promise<void> {
|
|
372
|
-
const locations = [
|
|
373
|
-
join(process.cwd(), '.claude', 'hooks', \`\${hookName}.config.json\`),
|
|
374
|
-
join(homedir(), '.claude', 'hooks', \`\${hookName}.config.json\`),
|
|
375
|
-
];
|
|
376
|
-
|
|
377
|
-
for (const path of locations) {
|
|
378
|
-
if (existsSync(path)) {
|
|
379
|
-
const config = await Bun.file(path).json();
|
|
380
|
-
|
|
381
|
-
// Parse value
|
|
382
|
-
let parsedValue: any = value;
|
|
383
|
-
if (value === 'true') parsedValue = true;
|
|
384
|
-
else if (value === 'false') parsedValue = false;
|
|
385
|
-
else if (!isNaN(Number(value))) parsedValue = Number(value);
|
|
386
|
-
|
|
387
|
-
config[key] = parsedValue;
|
|
388
|
-
|
|
389
|
-
await Bun.write(path, JSON.stringify(config, null, 2));
|
|
390
|
-
console.log(\`Updated \${key} = \${parsedValue}\`);
|
|
391
|
-
return;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
console.log('No configuration found. Run setup first:');
|
|
396
|
-
console.log(\` \${hookName} setup\`);
|
|
397
|
-
}
|
|
398
|
-
`;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
export function generateCoreTs(shortName: string, event: string): string {
|
|
402
|
-
const canBlock = event === 'PreToolUse';
|
|
403
|
-
const className = shortName.charAt(0).toUpperCase() + shortName.slice(1);
|
|
404
|
-
|
|
405
|
-
return `/**
|
|
406
|
-
* Core ${shortName} logic
|
|
407
|
-
*
|
|
408
|
-
* TODO: Implement your hook logic here
|
|
409
|
-
*/
|
|
410
|
-
|
|
411
|
-
interface HookInput {
|
|
412
|
-
tool?: string;
|
|
413
|
-
input?: any;
|
|
414
|
-
output?: any;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
interface HookOutput {
|
|
418
|
-
decision: 'allow' | 'block' | 'error';
|
|
419
|
-
reason?: string;
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* Process the hook input and return a decision
|
|
424
|
-
*
|
|
425
|
-
* @param input - The tool input from Claude Code
|
|
426
|
-
* @param config - The hook configuration
|
|
427
|
-
* @returns Decision to allow${canBlock ? ', block,' : ' or'} error
|
|
428
|
-
*/
|
|
429
|
-
export async function process${className}(
|
|
430
|
-
input: HookInput,
|
|
431
|
-
config: any
|
|
432
|
-
): Promise<HookOutput> {
|
|
433
|
-
// TODO: Implement your hook logic here
|
|
434
|
-
|
|
435
|
-
// Example: Extract command if Bash tool
|
|
436
|
-
const command = input.input?.command || '';
|
|
437
|
-
|
|
438
|
-
// TODO: Add your validation/processing logic
|
|
439
|
-
// For PreToolUse hooks, you can return { decision: 'block', reason: '...' }
|
|
440
|
-
// For PostToolUse/Stop hooks, typically just return { decision: 'allow' }
|
|
441
|
-
|
|
442
|
-
${canBlock ? `// Example blocking logic (uncomment and modify):
|
|
443
|
-
// if (command.includes('rm -rf /')) {
|
|
444
|
-
// return {
|
|
445
|
-
// decision: 'block',
|
|
446
|
-
// reason: 'Dangerous command detected: rm -rf /',
|
|
447
|
-
// };
|
|
448
|
-
// }` : '// This is a PostToolUse/Stop hook - cannot block, only observe'}
|
|
449
|
-
|
|
450
|
-
return { decision: 'allow' };
|
|
451
|
-
}
|
|
452
|
-
`;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
export function generateLoggerTs(hookName: string): string {
|
|
456
|
-
return `/**
|
|
457
|
-
* Logging utilities
|
|
458
|
-
*/
|
|
459
|
-
|
|
460
|
-
import { existsSync, appendFileSync, readFileSync, writeFileSync } from 'fs';
|
|
461
|
-
import { join } from 'path';
|
|
462
|
-
import { homedir } from 'os';
|
|
463
|
-
|
|
464
|
-
interface LogEntry {
|
|
465
|
-
timestamp: string;
|
|
466
|
-
event: string;
|
|
467
|
-
action: string;
|
|
468
|
-
input?: any;
|
|
469
|
-
reason?: string;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
export function getLogPath(hookName: string): string | null {
|
|
473
|
-
const locations = [
|
|
474
|
-
join(process.cwd(), '.claude', 'hooks', \`\${hookName}.log\`),
|
|
475
|
-
join(homedir(), '.claude', 'hooks', \`\${hookName}.log\`),
|
|
476
|
-
];
|
|
477
|
-
|
|
478
|
-
for (const path of locations) {
|
|
479
|
-
if (existsSync(path)) {
|
|
480
|
-
return path;
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
return null;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
export function getConfigPath(hookName: string): string | null {
|
|
487
|
-
const locations = [
|
|
488
|
-
join(process.cwd(), '.claude', 'hooks', \`\${hookName}.config.json\`),
|
|
489
|
-
join(homedir(), '.claude', 'hooks', \`\${hookName}.config.json\`),
|
|
490
|
-
];
|
|
491
|
-
|
|
492
|
-
for (const path of locations) {
|
|
493
|
-
if (existsSync(path)) {
|
|
494
|
-
return path;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
return null;
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
export async function log(hookName: string, entry: Omit<LogEntry, 'timestamp'>): Promise<void> {
|
|
501
|
-
// Check verbosity setting
|
|
502
|
-
const configPath = getConfigPath(hookName);
|
|
503
|
-
if (configPath) {
|
|
504
|
-
try {
|
|
505
|
-
const config = JSON.parse(readFileSync(configPath, 'utf-8'));
|
|
506
|
-
|
|
507
|
-
if (config.verbosity === 'none') return;
|
|
508
|
-
if (config.verbosity === 'blocked' && entry.action === 'allow') return;
|
|
509
|
-
} catch {
|
|
510
|
-
// Continue with logging if config read fails
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
const logPath = getLogPath(hookName);
|
|
515
|
-
if (!logPath) return;
|
|
516
|
-
|
|
517
|
-
const logEntry: LogEntry = {
|
|
518
|
-
timestamp: new Date().toISOString(),
|
|
519
|
-
...entry,
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
const line = JSON.stringify(logEntry) + '\\n';
|
|
523
|
-
appendFileSync(logPath, line);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
export async function showLogs(hookName: string, limit = 20): Promise<void> {
|
|
527
|
-
const logPath = getLogPath(hookName);
|
|
528
|
-
|
|
529
|
-
if (!logPath) {
|
|
530
|
-
console.log('No log file found. Run setup first:');
|
|
531
|
-
console.log(\` \${hookName} setup\`);
|
|
532
|
-
return;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const content = readFileSync(logPath, 'utf-8').trim();
|
|
536
|
-
|
|
537
|
-
if (!content) {
|
|
538
|
-
console.log('Log file is empty.');
|
|
539
|
-
return;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
const lines = content.split('\\n').slice(-limit);
|
|
543
|
-
|
|
544
|
-
console.log(\`Recent logs (\${logPath}):\\n\`);
|
|
545
|
-
|
|
546
|
-
for (const line of lines) {
|
|
547
|
-
try {
|
|
548
|
-
const entry = JSON.parse(line) as LogEntry;
|
|
549
|
-
const icon = entry.action === 'block' ? 'X' : entry.action === 'error' ? '!' : '-';
|
|
550
|
-
console.log(\`[\${entry.timestamp}] \${icon} \${entry.event}: \${entry.action}\`);
|
|
551
|
-
if (entry.reason) {
|
|
552
|
-
console.log(\` Reason: \${entry.reason}\`);
|
|
553
|
-
}
|
|
554
|
-
} catch {
|
|
555
|
-
console.log(line);
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
export async function clearLogs(hookName: string): Promise<void> {
|
|
561
|
-
const logPath = getLogPath(hookName);
|
|
562
|
-
|
|
563
|
-
if (!logPath) {
|
|
564
|
-
console.log('No log file found.');
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
writeFileSync(logPath, '');
|
|
569
|
-
console.log('Logs cleared.');
|
|
570
|
-
}
|
|
571
|
-
`;
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
export function generateClaudeTs(): string {
|
|
575
|
-
return `/**
|
|
576
|
-
* Claude Code configuration utilities
|
|
577
|
-
*/
|
|
578
|
-
|
|
579
|
-
import { existsSync } from 'fs';
|
|
580
|
-
|
|
581
|
-
interface ClaudeSettings {
|
|
582
|
-
hooks?: {
|
|
583
|
-
[event: string]: Array<{
|
|
584
|
-
matcher: string | string[];
|
|
585
|
-
hooks: string[];
|
|
586
|
-
}>;
|
|
587
|
-
};
|
|
588
|
-
[key: string]: any;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
interface HookConfig {
|
|
592
|
-
event: string;
|
|
593
|
-
matcher: string | string[];
|
|
594
|
-
command: string;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
export async function readClaudeSettings(path: string): Promise<ClaudeSettings> {
|
|
598
|
-
if (!existsSync(path)) {
|
|
599
|
-
return {};
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
try {
|
|
603
|
-
return await Bun.file(path).json();
|
|
604
|
-
} catch {
|
|
605
|
-
return {};
|
|
606
|
-
}
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
export async function writeClaudeSettings(path: string, settings: ClaudeSettings): Promise<void> {
|
|
610
|
-
await Bun.write(path, JSON.stringify(settings, null, 2));
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
export function mergeHookConfig(settings: ClaudeSettings, hookConfig: HookConfig): ClaudeSettings {
|
|
614
|
-
const { event, matcher, command } = hookConfig;
|
|
615
|
-
|
|
616
|
-
// Initialize hooks object if needed
|
|
617
|
-
if (!settings.hooks) {
|
|
618
|
-
settings.hooks = {};
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
// Initialize event array if needed
|
|
622
|
-
if (!settings.hooks[event]) {
|
|
623
|
-
settings.hooks[event] = [];
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
// Check if hook already exists for this matcher
|
|
627
|
-
const existingIndex = settings.hooks[event].findIndex(
|
|
628
|
-
(h) => JSON.stringify(h.matcher) === JSON.stringify(matcher)
|
|
629
|
-
);
|
|
630
|
-
|
|
631
|
-
if (existingIndex >= 0) {
|
|
632
|
-
// Add command to existing matcher if not already present
|
|
633
|
-
if (!settings.hooks[event][existingIndex].hooks.includes(command)) {
|
|
634
|
-
settings.hooks[event][existingIndex].hooks.push(command);
|
|
635
|
-
}
|
|
636
|
-
} else {
|
|
637
|
-
// Add new hook config
|
|
638
|
-
settings.hooks[event].push({
|
|
639
|
-
matcher,
|
|
640
|
-
hooks: [command],
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
return settings;
|
|
645
|
-
}
|
|
646
|
-
`;
|
|
647
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"forceConsistentCasingInFileNames": true,
|
|
6
|
-
"resolveJsonModule": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"outDir": "./dist",
|
|
9
|
-
"rootDir": "./src"
|
|
10
|
-
},
|
|
11
|
-
"include": [
|
|
12
|
-
"src/**/*"
|
|
13
|
-
],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"node_modules",
|
|
16
|
-
"dist"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "http-server",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"description": "Http Server skill",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"http-server": "./src/index.ts"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"dev": "bun run src/index.ts",
|
|
11
|
-
"build": "bun build src/index.ts --outdir dist --target node",
|
|
12
|
-
"typecheck": "tsc --noEmit"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"serve-handler": "^6.1.6"
|
|
16
|
-
},
|
|
17
|
-
"devDependencies": {
|
|
18
|
-
"@types/bun": "latest",
|
|
19
|
-
"typescript": "^5.7.0"
|
|
20
|
-
},
|
|
21
|
-
"publishConfig": {
|
|
22
|
-
"access": "restricted",
|
|
23
|
-
"registry": "https://registry.npmjs.org/"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"src",
|
|
27
|
-
"tsconfig.json"
|
|
28
|
-
]
|
|
29
|
-
}
|