From 3e5f3b5705a010ae385f5a472bef3fc2054b7cf5 Mon Sep 17 00:00:00 2001 From: balovbohdan Date: Tue, 9 Jun 2026 15:05:15 +0300 Subject: [PATCH 1/5] chore(#1): add commitlint and commit-msg hook - Install @commitlint/cli and @commitlint/config-conventional - Add commitlint.config.js with scope validation - Add .husky/commit-msg hook for commit message linting Co-Authored-By: Claude Haiku 4.5 --- .husky/commit-msg | 4 + commitlint.config.js | 6 + package-lock.json | 833 +++++++++++++++++++++++++++++++++++++++++++ package.json | 3 + 4 files changed, 846 insertions(+) create mode 100755 .husky/commit-msg create mode 100644 commitlint.config.js diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 0000000..2bd2133 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname -- "$0")/_/husky.sh" + +npx --no -- commitlint --edit "$1" diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..c31f12d --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,6 @@ +export default { + extends: ['@commitlint/config-conventional'], + rules: { + 'scope-empty': [2, 'never'], + }, +}; diff --git a/package-lock.json b/package-lock.json index 7865374..ecf54cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { + "@commitlint/cli": "^21.0.2", + "@commitlint/config-conventional": "^21.0.2", "husky": "^9.0.0", "validate-branch-name": "^1.3.2" }, @@ -41,6 +43,421 @@ "node": ">=6.9.0" } }, + "node_modules/@commitlint/cli": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-21.0.2.tgz", + "integrity": "sha512-YMmfLbqBg+ZRvvmPhc+cilSQFrh/AgzVgCT1U/OifmUZEwPbvCtA8rN//YNaF9d5eoZphxVMGYtmwA2QgQORgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/format": "^21.0.1", + "@commitlint/lint": "^21.0.2", + "@commitlint/load": "^21.0.2", + "@commitlint/read": "^21.0.2", + "@commitlint/types": "^21.0.1", + "tinyexec": "^1.0.0", + "yargs": "^18.0.0" + }, + "bin": { + "commitlint": "cli.js" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/config-conventional": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/config-conventional/-/config-conventional-21.0.2.tgz", + "integrity": "sha512-P/ZRhryQmkj0Z0dY9FOoRwe3xkwJyyAdtXwt01NT2kuZttcG2CNYp1q5Ci3u+nDT2jcbJRw2kt13Czl1qKNPfg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^21.0.1", + "conventional-changelog-conventionalcommits": "^9.2.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/config-validator": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/config-validator/-/config-validator-21.0.1.tgz", + "integrity": "sha512-Zd2UFdndeMMaW2O96HK0tdfT4gOImUvidMpAd/pws2zZ4m1nrAZ/9b/v2JYuE8fs86GpXv9F7LNaIuCIWhY+pA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^21.0.1", + "ajv": "^8.11.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/ensure": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/ensure/-/ensure-21.0.1.tgz", + "integrity": "sha512-jJ1037967wU7YN/xkv+iRlOBlmaOXPhPO5KQSqya6GyXzBlwuLzELBFao16DVg9dZyqmNrhewzwZ3SAibetHBQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^21.0.1", + "es-toolkit": "^1.46.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/execute-rule": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/execute-rule/-/execute-rule-21.0.1.tgz", + "integrity": "sha512-RifH+FmImozKBE6mozhF4K3r2RRKP7SMi/Q/zLCmExtp5e05lhHOUYqGBlFBAGNHaZxU/WYw1XuugYK9jQzqnA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/format": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/format/-/format-21.0.1.tgz", + "integrity": "sha512-ksmG2+cHGtuDPQQbhBbC4unwm444+6TiPw0d1bKf67hntgZqZ8E0g1MuYKUuyT5IH4IMmXZhKq22/Z3jBvtQIw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^21.0.1", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/is-ignored": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/is-ignored/-/is-ignored-21.0.2.tgz", + "integrity": "sha512-H5z4t8PC9tUsmZ/o+EptM3Nq8sTFtskAShdcqxCoyzklW5eaVT5xbrDAET2uypzir9Vsj4ZZmBtyKjYe2XqgeQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^21.0.1", + "semver": "^7.6.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/lint": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/lint/-/lint-21.0.2.tgz", + "integrity": "sha512-PnUmLYGeGLfW8oVatR9KpNxSHYAnJOEWlMZzfdeFOUq6WUrFx1fGQaWCWJqMoIll/xPM+GdfJV+tKHZVHhl0Fg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/is-ignored": "^21.0.2", + "@commitlint/parse": "^21.0.2", + "@commitlint/rules": "^21.0.2", + "@commitlint/types": "^21.0.1" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/load": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-21.0.2.tgz", + "integrity": "sha512-lwUE70hN0/qE/ZRROhbaX65ly/FF12DrqfReLCESo37M0OQCFAf2jRS+2tSCSORq+bm4Kdju7qNDj46uc1QzTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/config-validator": "^21.0.1", + "@commitlint/execute-rule": "^21.0.1", + "@commitlint/resolve-extends": "^21.0.1", + "@commitlint/types": "^21.0.1", + "cosmiconfig": "^9.0.1", + "cosmiconfig-typescript-loader": "^6.1.0", + "es-toolkit": "^1.46.0", + "is-plain-obj": "^4.1.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/load/node_modules/cosmiconfig": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.2.tgz", + "integrity": "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@commitlint/load/node_modules/cosmiconfig-typescript-loader": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/cosmiconfig-typescript-loader/-/cosmiconfig-typescript-loader-6.3.0.tgz", + "integrity": "sha512-Akr82WH1Wfqatyiqpj8HDkO2o2KmJRu1FhKfSNJP3K4IdXwHfEyL7MOb62i1AGQVLtIQM+iCE9CGOtrfhR+mmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "jiti": "2.6.1" + }, + "engines": { + "node": ">=v18" + }, + "peerDependencies": { + "@types/node": "*", + "cosmiconfig": ">=9", + "typescript": ">=5" + } + }, + "node_modules/@commitlint/message": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/message/-/message-21.0.2.tgz", + "integrity": "sha512-5n4aqHGD/FNnom/D5L8i7cYtV+xjuXcBL832C3w9VglEsZzIsoHpJsvxzJ7cgiOsOdc/2jU4t5+7qMHh7GBX3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/parse": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/parse/-/parse-21.0.2.tgz", + "integrity": "sha512-QVZJhGHTm+oiuWyEKOCTQ0ZM3mfJ0eGWFeHuj7WzSKEth+UukcCHac9GD8pgdFlg/qGkFWOtyaNd1T8REgagaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/types": "^21.0.1", + "conventional-changelog-angular": "^8.2.0", + "conventional-commits-parser": "^6.3.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/read": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/read/-/read-21.0.2.tgz", + "integrity": "sha512-BtsrnLVycSSKf4Q0gMch4giCj5NNlmcbhc8ra5vONgGtP2IjRDo33bEFtr5Pm+2N+5fXGWb2MksWPrspPfdhdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/top-level": "^21.0.2", + "@commitlint/types": "^21.0.1", + "git-raw-commits": "^5.0.0", + "tinyexec": "^1.0.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/resolve-extends": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-21.0.1.tgz", + "integrity": "sha512-0DhjYWL6uYrY16Efa032fYk3woGJDU4AGWiG1XXltT9AMUNYKyb5cIZU2ivbaMZ3+kKFqUjikD2cjh66Sbh/Sg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/config-validator": "^21.0.1", + "@commitlint/types": "^21.0.1", + "es-toolkit": "^1.46.0", + "global-directory": "^5.0.0", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/resolve-extends/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/@commitlint/rules": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/rules/-/rules-21.0.2.tgz", + "integrity": "sha512-k6tQ69Td7t2qUSIbik8D3TL1q3ZJpkEbV+yLogDzCRAdOxJm4ndhtBNREsLA1/puRfWvzS9eioF2w43WT+hHgQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@commitlint/ensure": "^21.0.1", + "@commitlint/message": "^21.0.2", + "@commitlint/to-lines": "^21.0.1", + "@commitlint/types": "^21.0.1" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/to-lines": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/to-lines/-/to-lines-21.0.1.tgz", + "integrity": "sha512-bd1BFII7p1EQZre9Kaj+kKaMFP3cFCdt21K7DItVux9XP5WjLgJ0/Uy1pJJh9aPwVJ6SKg62PxqlZaHI8hQAXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/top-level": { + "version": "21.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/top-level/-/top-level-21.0.2.tgz", + "integrity": "sha512-s9KKM+e+mXgFeIh4n7KmOGAVT3mkJ3Fp1bBYHIK5pjeUwlEMzp/tZfb5u0Poa680AsQTXMEMRxZi1vQ9m2X5ug==", + "dev": true, + "license": "MIT", + "dependencies": { + "escalade": "^3.2.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@commitlint/types": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/@commitlint/types/-/types-21.0.1.tgz", + "integrity": "sha512-4u7w8jcoCUFWhjWnASYzZHAP34OqOtuFBN87nQmFvqda03YU0T6z+yB4w0gSAMpekiRqqGk5rt+qSlW+a2vSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "conventional-commits-parser": "^6.3.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@conventional-changelog/git-client": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@conventional-changelog/git-client/-/git-client-2.7.0.tgz", + "integrity": "sha512-j7A8/LBEQ+3rugMzPXoKYzyUPpw/0CBQCyvtTR7Lmu4olG4yRC/Tfkq79Mr3yuPs0SUitlO2HwGP3gitMJnRFw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@simple-libs/child-process-utils": "^1.0.0", + "@simple-libs/stream-utils": "^1.2.0", + "semver": "^7.5.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "conventional-commits-filter": "^5.0.0", + "conventional-commits-parser": "^6.4.0" + }, + "peerDependenciesMeta": { + "conventional-commits-filter": { + "optional": true + }, + "conventional-commits-parser": { + "optional": true + } + } + }, + "node_modules/@simple-libs/child-process-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@simple-libs/child-process-utils/-/child-process-utils-1.0.2.tgz", + "integrity": "sha512-/4R8QKnd/8agJynkNdJmNw2MBxuFTRcNFnE5Sg/G+jkSsV8/UBgULMzhizWWW42p8L5H7flImV2ATi79Ove2Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@simple-libs/stream-utils": "^1.2.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://ko-fi.com/dangreen" + } + }, + "node_modules/@simple-libs/stream-utils": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@simple-libs/stream-utils/-/stream-utils-1.2.0.tgz", + "integrity": "sha512-KxXvfapcixpz6rVEB6HPjOUZT22yN6v0vI0urQSk1L8MlEWPDFCZkhw2xmkyoTGYeFw7tWTZd7e3lVzRZRN/EA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://ko-fi.com/dangreen" + } + }, + "node_modules/@types/node": { + "version": "25.9.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.9.2.tgz", + "integrity": "sha512-G05zqtJhcDLb8uslf5EjCxXg9G1KQxiV8OS0R26IC//Eoyitzqe8z37I7cqvnZlrlSfgocQRfSn/AHBZJJFyGw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": ">=7.24.0 <7.24.7" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -48,6 +465,13 @@ "dev": true, "license": "Python-2.0" }, + "node_modules/array-ify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-ify/-/array-ify-1.0.0.tgz", + "integrity": "sha512-c5AMf34bKdvPhQ7tBGhqkgKNUzMr4WUs+WDtC2ZUGOUncbxKMTvqxYctiseW3+L4bA8ec+GcZ6/A/FW4m8ukng==", + "dev": true, + "license": "MIT" + }, "node_modules/callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -58,6 +482,21 @@ "node": ">=6" } }, + "node_modules/cliui": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, "node_modules/commander": { "version": "8.3.0", "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", @@ -68,6 +507,60 @@ "node": ">= 12" } }, + "node_modules/compare-func": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "array-ify": "^1.0.0", + "dot-prop": "^5.1.0" + } + }, + "node_modules/conventional-changelog-angular": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-8.3.1.tgz", + "integrity": "sha512-6gfI3otXK5Ph5DfCOI1dblr+kN3FAm5a97hYoQkqNZxOaYa5WKfXH+AnpsmS+iUH2mgVC2Cg2Qw9m5OKcmNrIg==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/conventional-changelog-conventionalcommits": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-9.3.1.tgz", + "integrity": "sha512-dTYtpIacRpcZgrvBYvBfArMmK2xvIpv2TaxM0/ZI5CBtNUzvF2x0t15HsbRABWprS6UPmvj+PzHVjSx4qAVKyw==", + "dev": true, + "license": "ISC", + "dependencies": { + "compare-func": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/conventional-commits-parser": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-6.4.0.tgz", + "integrity": "sha512-tvRg7FIBNlyPzjdG8wWRlPHQJJHI7DylhtRGeU9Lq+JuoPh5BKpPRX83ZdLrvXuOSu5Eo/e7SzOQhU4Hd2Miuw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@simple-libs/stream-utils": "^1.2.0", + "meow": "^13.0.0" + }, + "bin": { + "conventional-commits-parser": "dist/cli/index.js" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/cosmiconfig": { "version": "8.3.6", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", @@ -95,6 +588,36 @@ } } }, + "node_modules/dot-prop": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-obj": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "dev": true, + "license": "MIT" + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/error-ex": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", @@ -105,6 +628,74 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/es-toolkit": { + "version": "1.47.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.47.0.tgz", + "integrity": "sha512-n1GuoD0WEQZMBk5tttoZSqwgyLx01oqa5XsBmCHwPyNe1S9jPBEmtR2pSgp2kJuWE3ciFZ6yRHmY4pM4C3OOkw==", + "dev": true, + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks" + ] + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.2.tgz", + "integrity": "sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-east-asian-width": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz", + "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/git-local-info": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/git-local-info/-/git-local-info-1.0.1.tgz", @@ -118,6 +709,49 @@ "node": ">= 4.0" } }, + "node_modules/git-raw-commits": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-5.0.1.tgz", + "integrity": "sha512-Y+csSm2GD/PCSh6Isd/WiMjNAydu0VBiG9J7EdQsNA5P9uXvLayqjmTsNlK5Gs9IhblFZqOU0yid5Il5JPoLiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@conventional-changelog/git-client": "^2.6.0", + "meow": "^13.0.0" + }, + "bin": { + "git-raw-commits": "src/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/global-directory": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/global-directory/-/global-directory-5.0.0.tgz", + "integrity": "sha512-1pgFdhK3J2LeM+dVf2Pd424yHx2ou338lC0ErNP2hPx4j8eW1Sp0XqSjNxtk6Tc4Kr5wlWtSvz8cn2yb7/SG/w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "6.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/global-directory/node_modules/ini": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-6.0.0.tgz", + "integrity": "sha512-IBTdIkzZNOpqm7q3dRqJvMaldXjDHWkEDfrwGEQTs5eaQMWV+djAhR+wahyNNMAa+qpbDUhBMVt4ZKNwpPm7xQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.17.0 || >=22.9.0" + } + }, "node_modules/husky": { "version": "9.1.7", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", @@ -165,6 +799,39 @@ "dev": true, "license": "MIT" }, + "node_modules/is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jiti": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz", + "integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==", + "dev": true, + "license": "MIT", + "bin": { + "jiti": "lib/jiti-cli.mjs" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -202,6 +869,13 @@ "dev": true, "license": "MIT" }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT" + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -209,6 +883,19 @@ "dev": true, "license": "MIT" }, + "node_modules/meow": { + "version": "13.2.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-13.2.0.tgz", + "integrity": "sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -258,6 +945,16 @@ "dev": true, "license": "ISC" }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", @@ -268,6 +965,86 @@ "node": ">=4" } }, + "node_modules/semver": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.3.tgz", + "integrity": "sha512-wnilbGyMxzbY7dNOl7jpKbLSjcfeweJWU5j4+u5qW+6/wuGD9KzIGOyZnQVSBM9E7DtWaaH3CyHkppYrKYoxwg==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.24.6.tgz", + "integrity": "sha512-WRNW+sJgj5OBN4/0JpHFqtqzhpbnV0GuB+OozA9gCL7a993SmU+1JBZCzLNxYsbMfIeDL+lTsphD5jN5N+n0zg==", + "dev": true, + "license": "MIT", + "peer": true + }, "node_modules/validate-branch-name": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/validate-branch-name/-/validate-branch-name-1.3.2.tgz", @@ -282,6 +1059,62 @@ "bin": { "validate-branch-name": "cli.js" } + }, + "node_modules/wrap-ansi": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^9.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "string-width": "^7.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^22.0.0" + }, + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } } } } diff --git a/package.json b/package.json index d11135c..5c8c8e0 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "type": "module", "name": "@torqlab/claude", "version": "1.0.0", "description": "This repository contains a project-level Claude collection: skills, hooks, and other useful things for the agentic development.", @@ -29,6 +30,8 @@ "prepare": "husky install" }, "devDependencies": { + "@commitlint/cli": "^21.0.2", + "@commitlint/config-conventional": "^21.0.2", "husky": "^9.0.0", "validate-branch-name": "^1.3.2" } From fdad9e104e1b7a995ede7d035abd65ba29ee3cf5 Mon Sep 17 00:00:00 2001 From: balovbohdan Date: Tue, 9 Jun 2026 15:08:40 +0300 Subject: [PATCH 2/5] fix(#1): add validate-branch-name config to package.json - Configure branch name pattern in package.json for validate-branch-name - Pattern: feat|fix|chore|docs|test|refactor|perf/- - Allows semantic-release aligned branch naming Co-Authored-By: Claude Haiku 4.5 --- package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package.json b/package.json index 5c8c8e0..331a922 100644 --- a/package.json +++ b/package.json @@ -34,5 +34,9 @@ "@commitlint/config-conventional": "^21.0.2", "husky": "^9.0.0", "validate-branch-name": "^1.3.2" + }, + "validate-branch-name": { + "pattern": "^(feat|fix|chore|docs|test|refactor|perf)/\\d+-.+$|^(master|main|develop)$", + "errorMsg": "Branch name must follow pattern: /-\n\nExamples:\n feat/123-add-feature\n fix/42-resolve-bug\n chore/99-update-deps\n\nAllowed types: feat, fix, chore, docs, test, refactor, perf\nTicket ID must be numeric (required).\n\nSee: .claude/skills/semantic-release/SKILL.md for details" } } From 7d3204a87369fc3cd81c4584432a9e5cddbd4f1e Mon Sep 17 00:00:00 2001 From: balovbohdan Date: Tue, 9 Jun 2026 15:09:55 +0300 Subject: [PATCH 3/5] chore(#1): remove deprecated husky shebang and sourcing lines - Update .husky/commit-msg and .husky/pre-push hooks - Remove deprecated #!/bin/sh and . "$(dirname ...)/_/husky.sh" lines - Hooks will work with husky v10.0.0+ Co-Authored-By: Claude Haiku 4.5 --- .husky/commit-msg | 3 --- .husky/pre-push | 3 --- validate-branch-name.config.js | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index 2bd2133..da99483 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname -- "$0")/_/husky.sh" - npx --no -- commitlint --edit "$1" diff --git a/.husky/pre-push b/.husky/pre-push index 6afd66e..0446e81 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,4 +1 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - npx validate-branch-name diff --git a/validate-branch-name.config.js b/validate-branch-name.config.js index ae2a87f..7121c3b 100644 --- a/validate-branch-name.config.js +++ b/validate-branch-name.config.js @@ -1,4 +1,4 @@ -module.exports = { +export default { pattern: "^(feat|fix|chore|docs|test|refactor|perf)/\\d+-.+$", errorMsg: "Branch name must follow pattern: /-\n\nExamples:\n feat/123-add-feature\n fix/42-resolve-bug\n chore/99-update-deps\n\nAllowed types: feat, fix, chore, docs, test, refactor, perf\nTicket ID must be numeric (required).\n\nSee: .claude/skills/semantic-release/SKILL.md for details", From 8b67862198040dcc129c79ee15f7a0bfc3c9736f Mon Sep 17 00:00:00 2001 From: balovbohdan Date: Tue, 9 Jun 2026 18:03:07 +0300 Subject: [PATCH 4/5] feat(docs, #1): refactor Skills Documentation Improves AGENTS.md clarity and links to official documentation. Addresses #1 --- AGENTS.md | 194 ++++++++++-------------------------------------------- 1 file changed, 36 insertions(+), 158 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 57f8287..4225c0b 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,173 +1,51 @@ -# AGENTS.md β€” Agent Skills & Development Workflow Guide +# TORQ Claude Configuration Collection -**Reference**: See [README.md](./README.md) for complete overview, installation instructions, and skills table. +A shared collection of Claude configurations, skills, hooks, and conventions for the TORQ project. This repository provides a unified set of AI development tools used across multiple TORQ repositories via symlinks. -This guide documents the **Addy Osmani agent-skills workflow** β€” the primary development methodology for this TORQ Claude configuration collection. All agents and skills work together to support structured, collaborative development from requirements through launch. +## Overview -## πŸ” About This Collection +This is a **project-level Claude collection** that serves as a centralized source of truth for Claude development practices. Every TORQ repository can reference this collection via a symlink, ensuring consistent configurations, skills, and conventions across all projects. -**TORQ Claude** is a shared collection of Claude configurations, skills, and conventions. Per [README.md](./README.md): +**Key purpose**: Enable standardized AI-driven development workflows, code generation, and automation while maintaining quality standards through shared hooks, rules, and custom skills. -> **Primary Development Methodology**: This collection uses **Addy Osmani's agent-skills workflow** as the foundation for structured, collaborative development. This proven framework breaks work into clear phases with specialized agents, testing strategies, and quality gatesβ€”enabling faster iteration while maintaining code quality and reliability. +## What's Included -**Maintainer**: Mr.B.Lab -**Repository**: @torqlab/claude -**License**: MIT - -## Quick Reference - -- **README.md** (source of truth) β€” Overview, installation, complete skills table -- **This document** β€” Workflow phases, when to use each agent -- **Skills**: See README.md Β§Skills table for full list -- **Installation**: See README.md Β§Quick Start for symlink setup -- **Conventions**: `./.claude/rules/` directory - -## 🎯 Addy Osmani Workflow: Primary Development Methodology - -The **Addy Osmani agent-skills workflow** is the core development approach. See [README.md Β§Addy Osmani Workflow](./README.md#-addy-osmani-workflow-primary-development-methodology) for: -- **Core Workflow Phases** table (requirements β†’ specification β†’ planning β†’ implementation β†’ testing β†’ review β†’ launch) -- **Essential Commands & Shortcuts** (organized by purpose) -- **Typical Development Flow** (step-by-step process) -- **When to Use Each Agent** (decision guidance) - -## πŸ”§ Available Agents in This Collection - -All agents are part of the **@addy-agent-skills plugin** suite. For complete workflow details, see [README.md Β§Addy Osmani Workflow](./README.md#-addy-osmani-workflow-primary-development-methodology). - -### Workflow Agents (Core Development Flow) - -| Agent | Purpose | When to Use | -|-------|---------|-----------| -| `/idea-refine` | Refine raw concepts into sharp, actionable requirements | Starting with vague ideas or unclear scope | -| `/interview-me` | Extract actual user needs vs. assumed requirements | Before starting development, to clarify requirements | -| `/spec` | Write detailed specifications before implementation | When requirements are clear; write before coding | -| `/plan` | Break work into ordered tasks with dependencies | After spec is complete; need ordered task list | -| `/build` | Implement tasks incrementally with validation | Executing planned tasks; implement β†’ test β†’ verify β†’ commit | -| `/test` | TDD workflow with failing tests first | Testing existing code or developing new features | -| `/review` | Five-axis code review (correctness, readability, architecture, security, performance) | Before merging; quality gate | -| `/ship` | Pre-launch checklist and production readiness | Before shipping to production | - -### Domain-Specific Agents - -| Agent | Purpose | When to Use | -|-------|---------|-----------| -| `/frontend-ui-engineering` | Build production-quality user interfaces | Designing and implementing frontend features | -| `/api-and-interface-design` | Design stable APIs and module boundaries | Planning API or module architecture | -| `/performance-optimization` | Profile and optimize application performance | Performance issues or optimization requirements | -| `/security-and-hardening` | Harden code against vulnerabilities and OWASP threats | Security-sensitive code; before production | -| `/ci-cd-and-automation` | Automate CI/CD pipeline setup and orchestration | Setting up or improving CI/CD workflows | -| `/documentation-and-adrs` | Record architectural decisions and create documentation | Documenting decisions; creating architecture docs | - -### Practice & Specialized Agents - -| Agent | Purpose | When to Use | -|-------|---------|-----------| -| `/incremental-implementation` | Ship changes in small, verifiable steps | Implementing features; ensure incremental delivery | -| `/test-driven-development` | TDD patterns and practices | Structuring development around tests | -| `/code-review-and-quality` | Multi-axis code review patterns | Before merge; detailed quality review | -| `/source-driven-development` | Ground decisions in official documentation | When decisions need documentation backing | -| `/doubt-driven-development` | Adversarial review before decisions | Questioning non-trivial decisions | -| `/git-workflow-and-versioning` | Git practices and semantic versioning | Managing git workflow and version management | -| `/debugging-and-error-recovery` | Systematic root-cause analysis | Debugging failures; error recovery | -| `/context-engineering` | Optimize agent context and prompts | Improving output quality and relevance | -| `/deprecation-and-migration` | Plan and execute migrations | Deprecating features or managing migrations | -| `/browser-testing-with-devtools` | Real browser testing via Chrome DevTools MCP | Testing in actual browser environments | -| `/using-agent-skills` | Discover and invoke available agent skills | Learning what agent skills are available | -| `/code-simplify` | Simplify code for clarity | Refactoring code for readability | -| `/code-simplification` | Simplify code for clarity and maintainability | Maintenance and refactoring tasks | -| `/spec-driven-development` | Create detailed specifications before coding | Spec-first development approach | -| `/shipping-and-launch` | Prepare applications for production launch | Pre-launch preparation | -| `/planning-and-task-breakdown` | Break work into ordered tasks with dependencies | Task organization and dependency management | - -## πŸ“¦ Custom Project-Specific Skills - -In addition to agent-skills, this collection provides custom skills. See [README.md Β§Key Skills Overview](./README.md#-key-skills-overview) for details: - -| Skill | Purpose | Usage | -|-------|---------|-------| -| **pr-open** | Create pull requests on GitHub from changelog entries with branch validation | `/pr-open` | -| **create-changelog** | Generate changelog entries following Keep a Changelog standard | `/create-changelog` | -| **github-mcp-setup** | Configure GitHub MCP with GitHub App authentication | `/github-mcp-setup` | -| **frontend-design** | Build distinctive, production-grade UI components | `/frontend-design` | -| **skill-creator** | Create, test, and iteratively improve new Claude skills | `/skill-creator` | - -For complete skill details including features and workflows, see README.md. - -## πŸ“‹ Common Workflows - -Typical development patterns using the agent-skills workflow: - -### Workflow 1: Start with Unclear Requirements -1. Use `/idea-refine` or `/interview-me` to clarify scope -2. Write specification with `/spec` -3. Plan with `/plan` to break into tasks -4. Implement with `/build` -5. Test with `/test` (TDD approach) -6. Review with `/review` before merge -7. Launch with `/ship` when ready - -### Workflow 2: Implement a Known Feature -1. Have specifications ready -2. Use `/plan` to organize tasks -3. Use `/build` to implement incrementally -4. Use `/test` for test-driven development -5. Use `/review` for quality gate -6. Use `/ship` before production - -### Workflow 3: Debug or Fix an Issue -1. Use `/debugging-and-error-recovery` for systematic root-cause analysis -2. Use `/test` to create failing test first -3. Fix and verify with `/build` -4. Use `/review` before merge - -### Workflow 4: Optimize Performance -1. Use `/performance-optimization` to profile and identify bottlenecks -2. Implement optimizations with `/build` -3. Test improvements with `/test` -4. Use `/review` before merge - -### Workflow 5: Add Security Hardening -1. Use `/security-and-hardening` for vulnerability analysis -2. Implement fixes with `/build` -3. Test with `/test` -4. Use `/ship` or `/review` before deployment - -## πŸ”Œ Installation & Setup - -For complete installation instructions, see [README.md Β§Quick Start](./README.md#quick-start-using-this-collection-in-your-project). - -**Quick setup** (from any TORQ repository): - -```bash -# Create symlink -ln -s ../claude/.claude .claude - -# Verify -ls -l .claude -``` +- **Skills**: Comprehensive skill inventory organized by type (custom, open-source, agent skills) +- **Workflows**: Structured development patterns for requirements, implementation, testing, and deployment +- **Configurations**: Claude Code settings, hooks, and project conventions +- **Documentation**: [SKILLS.md](./SKILLS.md) for complete skills reference, README.md for setup and usage + +## Quick Links -All skills and agents are automatically discovered after creating the symlink. +- **[README.md](./README.md)** β€” Complete setup guide, workflow patterns, and skill integration +- **[SKILLS.md](./SKILLS.md)** β€” All available skills organized by type with decision trees -## πŸ“š Reference & Resources +## Repository Structure -- **README.md** (source of truth) β€” Overview, installation, complete skills and workflow documentation -- **`.claude/skills/`** β€” Custom project-specific skills -- **`.claude/settings.json`** β€” Plugin configuration -- **`.claude/rules/`** β€” Project conventions and coding standards -- **`skills-lock.json`** β€” Open-source skills registry from anthropics/skills -- **Agent Skills Source**: [github.com/addyosmani/agent-skills](https://github.com/addyosmani/agent-skills/tree/main) +``` +torq/claude/ +β”œβ”€β”€ .claude/ +β”‚ β”œβ”€β”€ skills/ # Custom project-specific skills +β”‚ β”œβ”€β”€ settings.json # Claude configuration +β”‚ └── settings.local.json # Local Claude overrides +β”œβ”€β”€ README.md # Setup, workflows, and skill integration +β”œβ”€β”€ SKILLS.md # Complete skills reference with decision trees +β”œβ”€β”€ package.json # Project metadata +β”œβ”€β”€ skills-lock.json # Open-source skills registry +└── .nvmrc # Node version specification +``` -## Getting Help +## Support & Resources -1. **See README.md** for installation, overview, and complete skill details -2. **Check individual SKILL.md files** for detailed skill documentation in `./.claude/skills/*/` -3. **Review project conventions** in `./.claude/rules/` -4. **Explore agent skills** with `/using-agent-skills` command +For complete documentation on setup, workflows, and skill integration, see [README.md](./README.md). + +For detailed skill documentation, see [SKILLS.md](./SKILLS.md). + +For agent-skills reference, see [github.com/addyosmani/agent-skills](https://github.com/addyosmani/agent-skills/tree/main). --- -**Last updated**: 2026-06-04 -**Collection**: @torqlab/claude -**Maintainer**: Mr.B.Lab +**Repository**: [@torqlab/claude](https://github.com/torqlab/claude) **License**: MIT -**Source**: [README.md](./README.md) is the authoritative reference for this collection +**Maintainer**: Mr.B.Lab +**Node**: 24.x From 34e8219369de4770666dfbf54119a10fab1bb7de Mon Sep 17 00:00:00 2001 From: balovbohdan Date: Wed, 10 Jun 2026 21:37:28 +0300 Subject: [PATCH 5/5] feat(skills, #1): add js-project-structure skill assets Adds comprehensive skill setup including environment configuration, commit linting, branch name validation, evaluation specs, project standards reference, and initialization/validation scripts. Addresses #1 --- .../js-project-structure/assets/.env.example | 82 +++++++ .../assets/commitlint.config.js | 18 ++ .../assets/validate-branch-name.config.js | 12 + .../js-project-structure/evals/evals.json | 205 +++++++++++++++++ .../references/TORQ_PROJECT_STANDARDS.md | 215 ++++++++++++++++++ .../scripts/init-project.sh | 124 ++++++++++ .../scripts/validate-setup.sh | 121 ++++++++++ 7 files changed, 777 insertions(+) create mode 100644 .claude/skills/js-project-structure/assets/.env.example create mode 100644 .claude/skills/js-project-structure/assets/commitlint.config.js create mode 100644 .claude/skills/js-project-structure/assets/validate-branch-name.config.js create mode 100644 .claude/skills/js-project-structure/evals/evals.json create mode 100644 .claude/skills/js-project-structure/references/TORQ_PROJECT_STANDARDS.md create mode 100755 .claude/skills/js-project-structure/scripts/init-project.sh create mode 100755 .claude/skills/js-project-structure/scripts/validate-setup.sh diff --git a/.claude/skills/js-project-structure/assets/.env.example b/.claude/skills/js-project-structure/assets/.env.example new file mode 100644 index 0000000..9408395 --- /dev/null +++ b/.claude/skills/js-project-structure/assets/.env.example @@ -0,0 +1,82 @@ +# GitHub App Setup Instructions + +This project uses GitHub MCP (Model Context Protocol) to interact with the GitHub API. To use GitHub-dependent features, you need to configure a GitHub App. + +## Setup Steps + +### 1. Create a GitHub App (One-time) + +Visit https://github.com/settings/apps and create a new GitHub App: + +- **App name**: torq-mcp (or your organization name) +- **Homepage URL**: https://github.com/mrbalov (your GitHub profile) +- **Permissions**: + - Contents: Read & write + - Pull requests: Read & write + - Issues: Read & write + - Workflows: Read & write + +### 2. Generate Private Key + +After creating the app: +1. Scroll to "Private keys" section +2. Click "Generate a private key" +3. Save the downloaded `.pem` file securely + +### 3. Install App to Your Organization + +1. Go to "Install App" in the app settings +2. Select your GitHub organization +3. Authorize the app + +Note the **Installation ID** from the URL (e.g., https://github.com/settings/installations/12345678) + +### 4. Configure .env + +Create a `.env` file in the project root: + +```env +GITHUB_APP_ID=123456 +GITHUB_APP_PRIVATE_KEY_PATH=/path/to/private-key.pem +GITHUB_INSTALLATION_ID=12345678 +``` + +### 5. Verify Setup + +Test the configuration: + +```bash +# This should display your GitHub user info +npx @anthropic-ai/claude-code-mcp github user +``` + +## Publishing to npm + +For automatic publishing via semantic-release: + +1. Configure **OIDC Trusted Publishing** on npm (recommended) + - No secrets needed in GitHub + - GitHub Actions automatically exchanges tokens + - See: https://docs.npmjs.com/creating-and-viewing-access-tokens#creating-automation-tokens + +2. OR configure **npm authentication**: + - Create an npm automation token + - Add to GitHub Secrets as `NPM_TOKEN` + - Workflow will use it for publishing + +## Troubleshooting + +**"Cannot find private key"** +- Verify path in `.env` is absolute and file exists +- Check file permissions: `chmod 600 /path/to/key.pem` + +**"App not authorized"** +- Confirm app is installed on your organization +- Check Installation ID in `.env` matches + +**GitHub Actions fails to publish** +- Verify OIDC is configured on npm +- Check GitHub Actions has `id-token: write` permission +- View workflow logs for detailed errors + +See `.mcp.json` for MCP server configuration details. diff --git a/.claude/skills/js-project-structure/assets/commitlint.config.js b/.claude/skills/js-project-structure/assets/commitlint.config.js new file mode 100644 index 0000000..bc4bcb9 --- /dev/null +++ b/.claude/skills/js-project-structure/assets/commitlint.config.js @@ -0,0 +1,18 @@ +/** + * Commitlint configuration for conventional commits + * Extends @commitlint/config-conventional with torq-specific rules + * + * Rules: + * - type-enum: Allowed commit types + * - scope-empty: Scope is required (never empty) + * - subject-case: Subject must be lowercase + * - subject-full-stop: No period at end + */ + +export default { + extends: ['@commitlint/config-conventional'], + rules: { + 'scope-empty': [2, 'never'], + 'subject-case': [2, 'never', ['start-case', 'pascal-case', 'upper-case']], + }, +}; diff --git a/.claude/skills/js-project-structure/assets/validate-branch-name.config.js b/.claude/skills/js-project-structure/assets/validate-branch-name.config.js new file mode 100644 index 0000000..2954c01 --- /dev/null +++ b/.claude/skills/js-project-structure/assets/validate-branch-name.config.js @@ -0,0 +1,12 @@ +/** + * Validate branch name configuration + * Enforces semantic branch naming: /- + */ + +export default { + pattern: /^(feat|fix|chore|docs|test|refactor|perf)\/(\d+)-([a-z0-9\-]+)$|^(main|master|develop)$/, + errorMsg: + 'Branch name must match pattern: /-\n' + + 'Types: feat, fix, chore, docs, test, refactor, perf\n' + + 'Examples: feat/1-add-auth, fix/42-resolve-bug', +}; diff --git a/.claude/skills/js-project-structure/evals/evals.json b/.claude/skills/js-project-structure/evals/evals.json new file mode 100644 index 0000000..e61cd51 --- /dev/null +++ b/.claude/skills/js-project-structure/evals/evals.json @@ -0,0 +1,205 @@ +{ + "version": "1.0.0", + "name": "js-project-structure", + "description": "Evaluation tests for js-project-structure skill", + "tests": [ + { + "id": "test-1-project-creation", + "name": "Create new local project", + "description": "Initialize a new JavaScript project locally without remote GitHub repo", + "steps": [ + "Run: bash scripts/init-project.sh test-lib-local empty-scope 'A test library' no", + "Verify: test-lib-local directory created", + "Verify: package.json exists with name 'test-lib-local'", + "Verify: All required files present (tsconfig.json, eslint.config.mjs, .prettierrc, etc.)", + "Verify: .git directory initialized", + "Verify: Initial commit created with message 'chore: initialize project from torq template'", + "Verify: node_modules installed" + ], + "expected": { + "exitCode": 0, + "files": [ + "test-lib-local/package.json", + "test-lib-local/tsconfig.json", + "test-lib-local/eslint.config.mjs", + "test-lib-local/.prettierrc", + "test-lib-local/commitlint.config.js", + "test-lib-local/.releaserc.json", + "test-lib-local/.github/workflows/verify.yml", + "test-lib-local/.github/workflows/publish.yml", + "test-lib-local/.husky/commit-msg", + "test-lib-local/.husky/pre-push" + ], + "gitBranch": "main", + "gitCommits": "β‰₯1" + } + }, + { + "id": "test-2-scoped-package", + "name": "Create scoped npm package", + "description": "Initialize project with @scope namespace", + "steps": [ + "Run: bash scripts/init-project.sh test-scoped '@torqlab' 'A scoped test lib' no", + "Verify: package.json name is '@torqlab/test-scoped'", + "Verify: All configuration files customized", + "Verify: Git initialized and first commit created" + ], + "expected": { + "packageName": "@torqlab/test-scoped", + "files": [ + "test-scoped/package.json" + ] + } + }, + { + "id": "test-3-validation-setup", + "name": "Validate project setup", + "description": "Run validation checks on initialized project", + "steps": [ + "Create test project via init-project.sh", + "Run: bash scripts/validate-setup.sh test-lib-local", + "Verify: All checks pass (0 errors)" + ], + "expected": { + "exitCode": 0, + "checksPass": [ + "configuration files", + "directories", + "git repository", + "git hooks", + "dependencies", + "typescript", + "eslint", + "prettier" + ] + } + }, + { + "id": "test-4-husky-hooks", + "name": "Test commit-msg hook", + "description": "Verify commitlint validation works", + "steps": [ + "Create test project", + "cd into project", + "Try bad commit: git commit --allow-empty -m 'bad message'", + "Verify: Commit is rejected by hook", + "Try good commit: git commit --allow-empty -m 'feat(core): add feature'", + "Verify: Commit succeeds" + ], + "expected": { + "badCommitRejected": true, + "goodCommitAccepted": true, + "hookInstalled": true + } + }, + { + "id": "test-5-branch-validation", + "name": "Test branch name validation", + "description": "Verify branch naming convention is enforced", + "steps": [ + "Create test project", + "cd into project", + "Create branch with bad name: git checkout -b bad-branch-name", + "Try to push (dry-run to origin): pre-push hook should validate", + "Create branch with good name: git checkout -b feat/1-test-feature", + "Verify branch name is accepted by validate-branch-name" + ], + "expected": { + "badBranchRejected": true, + "goodBranchAccepted": true + } + }, + { + "id": "test-6-build-pipeline", + "name": "Test build scripts", + "description": "Verify build process works", + "steps": [ + "Create test project", + "cd into project", + "Run: bun run build", + "Verify: dist/ directory created", + "Verify: dist/index.mjs (ESM) exists", + "Verify: dist/index.cjs (CommonJS) exists", + "Verify: dist/index.d.ts (types) exists" + ], + "expected": { + "exitCode": 0, + "outputDir": "dist", + "files": [ + "dist/index.mjs", + "dist/index.cjs", + "dist/index.d.ts" + ] + } + }, + { + "id": "test-7-linting", + "name": "Test ESLint integration", + "description": "Verify linting works without errors", + "steps": [ + "Create test project", + "cd into project", + "Run: bun run lint", + "Verify: No ESLint errors (exit code 0)" + ], + "expected": { + "exitCode": 0, + "errors": 0 + } + }, + { + "id": "test-8-formatting", + "name": "Test Prettier integration", + "description": "Verify code formatting is correct", + "steps": [ + "Create test project", + "cd into project", + "Run: bun run format:check", + "Verify: Code already formatted (exit code 0)" + ], + "expected": { + "exitCode": 0, + "message": "All matched files use Prettier code style" + } + }, + { + "id": "test-9-tests", + "name": "Test runner (Bun)", + "description": "Verify test execution works", + "steps": [ + "Create test project", + "cd into project", + "Run: bun test", + "Verify: Tests execute (at least placeholder test)" + ], + "expected": { + "exitCode": 0, + "testsRun": "β‰₯1" + } + }, + { + "id": "test-10-config-files", + "name": "Validate config files", + "description": "Verify all config files are valid", + "steps": [ + "Create test project", + "Validate package.json: JSON parse succeeds", + "Validate tsconfig.json: JSON parse succeeds", + "Validate .releaserc.json: JSON parse succeeds", + "Validate commitlint.config.js: Can be imported", + "Validate eslint.config.mjs: Can be imported", + "Validate .prettierrc: JSON parse succeeds" + ], + "expected": { + "allValid": true, + "parseErrors": 0 + } + } + ], + "cleanup": { + "description": "Remove test artifacts after evaluation", + "commands": [ + "rm -rf test-lib-local test-scoped test-lib-local-remote" + ] + } +} diff --git a/.claude/skills/js-project-structure/references/TORQ_PROJECT_STANDARDS.md b/.claude/skills/js-project-structure/references/TORQ_PROJECT_STANDARDS.md new file mode 100644 index 0000000..a6a38f7 --- /dev/null +++ b/.claude/skills/js-project-structure/references/TORQ_PROJECT_STANDARDS.md @@ -0,0 +1,215 @@ +# Torq Project Standards + +This document defines the standardization approach for all TypeScript/Node.js projects within the torq ecosystem. + +## Philosophy + +All torq projects follow a **single-source-of-truth template** approach: +- One canonical template repository (torqlab/js-project-template) +- All new projects clone and customize from this template +- Consistent tooling, git workflow, and publishing pipeline +- Low overhead for new projects, high consistency across org + +## Core Standards + +### 1. Version Control & Git Workflow + +**Branch Naming**: `/-` +- Types: `feat`, `fix`, `chore`, `docs`, `test`, `refactor`, `perf` +- Ticket ID: numeric (links to GitHub issues/Jira) +- Example: `feat/42-add-user-auth`, `fix/99-resolve-race-condition` + +**Commit Format** (Conventional Commits): +``` +(, #): + + + +Addresses # +``` +- Type & Scope: Required +- Scope examples: `api`, `types`, `auth`, `db`, `ui` +- Subject: Imperative mood, lowercase, max 50 chars, no period + +**Validation**: Enforced via Git hooks +- commit-msg hook: Validates format via commitlint +- pre-push hook: Validates branch name, runs linting, tests + +### 2. Versioning & Publishing + +**Semantic Versioning**: Automatic via semantic-release +- `feat` commits β†’ MINOR bump (1.0.0 β†’ 1.1.0) +- `fix` & `perf` commits β†’ PATCH bump (1.0.0 β†’ 1.0.1) +- `feat!` β†’ MAJOR bump (1.0.0 β†’ 2.0.0, breaking change) +- `chore`, `docs`, `test` β†’ No version bump + +**Publishing**: Automatic when merged to main +- Runs on GitHub Actions +- Uses OIDC Trusted Publishing (keyless, secure) +- Publishes to npm automatically +- Creates GitHub releases & tags + +### 3. Code Quality + +**TypeScript**: Strict mode +- `strict: true` in tsconfig.json +- Dual-format output: ESM + CommonJS +- Type declarations (.d.ts) included + +**ESLint**: Code rules via eslint-config-prettier +- Immutability: Only `const`, no `let`/`var` +- Max line length: 100 characters +- JSDoc required for all functions +- Node.js built-ins use `node:` prefix + +**Prettier**: Code formatting +- Print width: 100 characters +- Single quotes for strings +- Trailing commas in objects/arrays +- 2-space indentation +- Semicolons required + +**Integration**: No conflicts via eslint-config-prettier +- ESLint handles logic rules (errors) +- Prettier handles formatting (style) +- ESLint rules that conflict with Prettier are disabled + +### 4. Testing + +**Test Runner**: Bun (built-in, zero-config) +- Located in `src/**/*.test.ts` +- Run with `bun test` +- Integrated in pre-push hook + +**Coverage**: Not enforced, but encouraged +- No minimum threshold required +- Developers responsible for adequate coverage + +### 5. Build & Distribution + +**Build Outputs**: +- ESM: `dist/index.mjs` (modern JavaScript, tree-shakeable) +- CommonJS: `dist/index.cjs` (legacy compatibility) +- Types: `dist/index.d.ts` (TypeScript declarations) + +**Build Scripts**: +```bash +bun run build # Full build (types + ESM + CJS) +bun run build:types # Just .d.ts files +bun run build:esm # Just .mjs modules +bun run build:cjs # Just .cjs modules +``` + +**Package Distribution**: +- Main entry: `dist/index.cjs` (CommonJS default) +- Module entry: `dist/index.mjs` (Modern tooling prefers ESM) +- Types entry: `dist/index.d.ts` (TypeScript) +- Exports configured in package.json for both formats + +### 6. Configuration Files + +| File | Purpose | +|------|---------| +| `package.json` | Project metadata, scripts, dependencies | +| `tsconfig.json` | TypeScript strict mode, ES2022 target | +| `eslint.config.mjs` | Code quality rules (flat config) | +| `.prettierrc` | Code formatting rules | +| `commitlint.config.js` | Commit message validation | +| `.releaserc.json` | Semantic-release configuration | +| `.mcp.json` | GitHub MCP server config | +| `.env.example` | Environment setup template | + +### 7. Git Hooks + +**Husky** manages two hooks: + +**commit-msg** (before commit saved) +- Validates commit message format +- Enforced by commitlint +- Fails if message doesn't follow conventional format + +**pre-push** (before push to remote) +- Linting check: `bun run lint` +- Format check: `bun run format:check` +- Test check: `bun test` +- Branch validation: `npx validate-branch-name` +- Fails if any check fails (push blocked) + +### 8. CI/CD Workflows + +**verify.yml**: Runs on pull request +- Install dependencies +- Run linting +- Run formatting check +- Run tests +- Run build +- Parallel jobs for speed + +**publish.yml**: Runs on merge to main +- Install dependencies +- Run full verify pipeline +- Run semantic-release +- Publishes to npm (OIDC trusted) +- Creates GitHub release + +### 9. Development Commands + +```bash +bun install # Install dependencies +bun run build # Build project +bun run lint # Run ESLint +bun run format # Auto-format with Prettier +bun run format:check # Check formatting without changes +bun test # Run all tests +npm run prepare # Install git hooks +bun run clean # Remove dist/ directory +``` + +### 10. Node.js Version + +**Required**: Node.js 24+ +- Enforced via `.nvmrc` (managed by nvm) +- TypeScript target: ES2022 +- Modern JavaScript features expected + +## Monorepo Pattern + +For monorepos (multiple projects under torq/): + +1. **Shared configuration** via symlink: + ```bash + ln -s ../../.claude .claude + ``` + +2. **Per-project customization**: + - Each project has own package.json (name, description) + - Each project has own CI/CD workflow + - Each project publishes independently to npm + +3. **Benefits**: + - One update point for shared standards + - Independent versioning per project + - Consistent development experience + +## Standards Evolution + +Standards can evolve, but changes should: +1. Be documented with rationale +2. Be applied to new projects first +3. Provide migration path for existing projects +4. Maintain backward compatibility where possible + +Template repository serves as the canonical version. Changes are: +- Tagged with releases in the template repo +- Applied to new projects immediately +- Backported to existing projects via pull requests + +## References + +- [Conventional Commits](https://www.conventionalcommits.org/) +- [Semantic Versioning](https://semver.org/) +- [Semantic Release Documentation](https://semantic-release.gitbook.io/) +- [TypeScript Handbook](https://www.typescriptlang.org/docs/) +- [ESLint Documentation](https://eslint.org/) +- [Prettier Documentation](https://prettier.io/) +- [Bun Runtime](https://bun.sh/) diff --git a/.claude/skills/js-project-structure/scripts/init-project.sh b/.claude/skills/js-project-structure/scripts/init-project.sh new file mode 100755 index 0000000..98728aa --- /dev/null +++ b/.claude/skills/js-project-structure/scripts/init-project.sh @@ -0,0 +1,124 @@ +#!/usr/bin/env bash +set -euo pipefail + +# js-project-structure: init-project.sh +# Initializes a new JavaScript project from torq template + +PROJECT_NAME="${1:?Project name required (e.g., my-lib)}" +PROJECT_SCOPE="${2:-}" +PROJECT_DESC="${3:?Project description required}" +CREATE_REMOTE="${4:-no}" +ORG="${5:-}" + +TEMPLATE_REPO="https://github.com/torqlab/js-project-template.git" +PROJECT_DIR="${PROJECT_NAME}" + +echo "πŸš€ Initializing project: $PROJECT_NAME" +echo " Template: $TEMPLATE_REPO" +echo "" + +# Clone template +if [ -d "$PROJECT_DIR" ]; then + echo "❌ Directory already exists: $PROJECT_DIR" + exit 1 +fi + +echo "πŸ“¦ Cloning template..." +git clone "$TEMPLATE_REPO" "$PROJECT_DIR" +cd "$PROJECT_DIR" + +# Remove original git history +rm -rf .git +git init +git branch -M main + +echo "βœ… Template cloned" +echo "" + +# Customize package.json +echo "πŸ”§ Customizing configuration..." + +FULL_NAME="$PROJECT_SCOPE/$PROJECT_NAME" +if [ -z "$PROJECT_SCOPE" ]; then + FULL_NAME="$PROJECT_NAME" +fi + +# Use sed to update package.json +if [[ "$OSTYPE" == "darwin"* ]]; then + # macOS sed syntax + sed -i '' "s|{{PROJECT_NAME}}|$FULL_NAME|g" package.json + sed -i '' "s|{{PROJECT_DESCRIPTION}}|$PROJECT_DESC|g" package.json +else + # Linux sed syntax + sed -i "s|{{PROJECT_NAME}}|$FULL_NAME|g" package.json + sed -i "s|{{PROJECT_DESCRIPTION}}|$PROJECT_DESC|g" package.json +fi + +echo "βœ… Configuration customized" +echo "" + +# Create GitHub repo if requested +if [ "$CREATE_REMOTE" = "yes" ]; then + echo "🌐 Creating GitHub repository..." + + REPO_NAME="$PROJECT_NAME" + VISIBILITY="public" + + if [ -z "$ORG" ]; then + ORG=$(gh api user --jq '.login') + fi + + REPO_URL="https://github.com/$ORG/$REPO_NAME" + + # Create repo + gh repo create "$ORG/$REPO_NAME" --public --description "$PROJECT_DESC" --source=. --remote=origin --push 2>&1 | grep -E "created|error|fatal|https" || true + + echo "βœ… Repository created: $REPO_URL" + echo "" +else + echo "πŸ“ Local git repository initialized" + echo " To push later: git remote add origin " + echo "" +fi + +# Add files and create initial commit +git add . +git commit -m "chore: initialize project from torq template" + +# Install dependencies +echo "πŸ“₯ Installing dependencies..." +if command -v bun &> /dev/null; then + bun install +else + npm install +fi +echo "βœ… Dependencies installed" +echo "" + +# Install git hooks +echo "πŸ” Installing git hooks..." +npm run prepare 2>/dev/null || true +echo "βœ… Git hooks installed" +echo "" + +# Validate setup +echo "βœ“ Setup complete!" +echo "" +echo "πŸ“‹ Project structure:" +echo " $PROJECT_DIR/" +echo " β”œβ”€β”€ .github/workflows/ # CI/CD workflows" +echo " β”œβ”€β”€ .husky/ # Git hooks" +echo " β”œβ”€β”€ src/ # Source code" +echo " β”œβ”€β”€ package.json # Dependencies" +echo " β”œβ”€β”€ tsconfig.json # TypeScript config" +echo " β”œβ”€β”€ eslint.config.mjs # Linting rules" +echo " β”œβ”€β”€ .releaserc.json # Publishing config" +echo " └── README.md # Documentation" +echo "" +echo "πŸš€ Next steps:" +echo " 1. cd $PROJECT_DIR" +echo " 2. git checkout -b feat/1-your-feature" +echo " 3. Start coding!" +echo " 4. git commit with conventional format" +echo " 5. git push and create PR" +echo " 6. Merge to main for automatic publishing" diff --git a/.claude/skills/js-project-structure/scripts/validate-setup.sh b/.claude/skills/js-project-structure/scripts/validate-setup.sh new file mode 100755 index 0000000..b2af693 --- /dev/null +++ b/.claude/skills/js-project-structure/scripts/validate-setup.sh @@ -0,0 +1,121 @@ +#!/usr/bin/env bash +set -euo pipefail + +# js-project-structure: validate-setup.sh +# Validates that a project is properly configured + +PROJECT_DIR="${1:-.}" + +if [ ! -d "$PROJECT_DIR" ]; then + echo "❌ Directory not found: $PROJECT_DIR" + exit 1 +fi + +cd "$PROJECT_DIR" + +echo "πŸ” Validating project setup..." +echo "" + +ERRORS=0 + +# Check required files +echo "πŸ“‹ Checking configuration files..." +for file in package.json tsconfig.json eslint.config.mjs .prettierrc commitlint.config.js .releaserc.json .env.example .gitignore .mcp.json; do + if [ -f "$file" ]; then + echo " βœ… $file" + else + echo " ❌ Missing: $file" + ((ERRORS++)) + fi +done +echo "" + +# Check directories +echo "πŸ“ Checking directories..." +for dir in .github .husky; do + if [ -d "$dir" ]; then + echo " βœ… $dir/" + else + echo " ❌ Missing: $dir/" + ((ERRORS++)) + fi +done +echo "" + +# Check git setup +echo "πŸ” Checking git configuration..." +if [ -d ".git" ]; then + echo " βœ… Git repository initialized" + BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown") + echo " Current branch: $branch" +else + echo " ⚠️ Git repository not initialized" +fi +echo "" + +# Check husky hooks +echo "πŸͺ Checking git hooks..." +if [ -f ".husky/commit-msg" ]; then + echo " βœ… commit-msg hook" +else + echo " ❌ Missing: .husky/commit-msg" + ((ERRORS++)) +fi + +if [ -f ".husky/pre-push" ]; then + echo " βœ… pre-push hook" +else + echo " ❌ Missing: .husky/pre-push" + ((ERRORS++)) +fi +echo "" + +# Check node_modules +echo "πŸ“¦ Checking dependencies..." +if [ -d "node_modules" ]; then + echo " βœ… Dependencies installed" +else + echo " ⚠️ Dependencies not installed (run: bun install)" +fi +echo "" + +# Check TypeScript +echo "πŸ”· Checking TypeScript..." +if command -v tsc &> /dev/null; then + echo " βœ… TypeScript installed" +else + echo " ⚠️ TypeScript not in PATH (run: bun install)" +fi +echo "" + +# Check ESLint +echo "πŸ” Checking ESLint..." +if command -v eslint &> /dev/null || [ -f "node_modules/.bin/eslint" ]; then + echo " βœ… ESLint installed" +else + echo " ⚠️ ESLint not installed (run: bun install)" +fi +echo "" + +# Check Prettier +echo "✨ Checking Prettier..." +if command -v prettier &> /dev/null || [ -f "node_modules/.bin/prettier" ]; then + echo " βœ… Prettier installed" +else + echo " ⚠️ Prettier not installed (run: bun install)" +fi +echo "" + +if [ $ERRORS -eq 0 ]; then + echo "βœ… All checks passed! Project is ready to use." + echo "" + echo "Next steps:" + echo " 1. bun install # Install dependencies" + echo " 2. npm run prepare # Install git hooks" + echo " 3. git checkout -b feat/1-your-feature" + echo " 4. Start coding!" + exit 0 +else + echo "❌ Found $ERRORS issue(s). Run setup again or check SKILL.md for troubleshooting." + exit 1 +fi