@ulpi/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/dist/auth-PN7TMQHV-2W4ICG64.js +15 -0
- package/dist/chunk-247GVVKK.js +2259 -0
- package/dist/chunk-2CLNOKPA.js +793 -0
- package/dist/chunk-2HEE5OKX.js +79 -0
- package/dist/chunk-2MZER6ND.js +415 -0
- package/dist/chunk-3SBPZRB5.js +772 -0
- package/dist/chunk-4VNS5WPM.js +42 -0
- package/dist/chunk-6JCMYYBT.js +1546 -0
- package/dist/chunk-6OCEY7JY.js +422 -0
- package/dist/chunk-74WVVWJ4.js +375 -0
- package/dist/chunk-7AL4DOEJ.js +131 -0
- package/dist/chunk-7LXY5UVC.js +330 -0
- package/dist/chunk-DBMUNBNB.js +3048 -0
- package/dist/chunk-JWUUVXIV.js +13694 -0
- package/dist/chunk-KIKPIH6N.js +4048 -0
- package/dist/chunk-KLEASXUR.js +70 -0
- package/dist/chunk-MIAQVCFW.js +39 -0
- package/dist/chunk-NNUWU6CV.js +1610 -0
- package/dist/chunk-PKD4ASEM.js +115 -0
- package/dist/chunk-Q4HIY43N.js +4230 -0
- package/dist/chunk-QJ5GSMEC.js +146 -0
- package/dist/chunk-SIAQVRKG.js +2163 -0
- package/dist/chunk-SPOI23SB.js +197 -0
- package/dist/chunk-YM2HV4IA.js +505 -0
- package/dist/codemap-RRJIDBQ5.js +636 -0
- package/dist/config-EGAXXCGL.js +127 -0
- package/dist/dist-6G7JC2RA.js +90 -0
- package/dist/dist-7LHZ65GC.js +418 -0
- package/dist/dist-LZKZFPVX.js +140 -0
- package/dist/dist-R5F4MX3I.js +107 -0
- package/dist/dist-R5ZJ4LX5.js +56 -0
- package/dist/dist-RJGCUS3L.js +87 -0
- package/dist/dist-RKOGLK7R.js +151 -0
- package/dist/dist-W7K4WPAF.js +597 -0
- package/dist/export-import-4A5MWLIA.js +53 -0
- package/dist/history-ATTUKOHO.js +934 -0
- package/dist/index.js +2120 -0
- package/dist/init-AY5C2ZAS.js +393 -0
- package/dist/launchd-LF2QMSKZ.js +148 -0
- package/dist/log-TVTUXAYD.js +75 -0
- package/dist/mcp-installer-NQCGKQ23.js +124 -0
- package/dist/memory-J3G24QHS.js +406 -0
- package/dist/ollama-3XCUZMZT-FYKHW4TZ.js +7 -0
- package/dist/openai-E7G2YAHU-UYY4ZWON.js +8 -0
- package/dist/projects-ATHDD3D6.js +271 -0
- package/dist/review-ADUPV3PN.js +152 -0
- package/dist/rules-E427DKYJ.js +134 -0
- package/dist/server-MOYPE4SM-N7SE2AN7.js +18 -0
- package/dist/server-X5P6WH2M-7K2RY34N.js +11 -0
- package/dist/skills/ulpi-generate-guardian/SKILL.md +511 -0
- package/dist/skills/ulpi-generate-guardian/references/framework-rules.md +692 -0
- package/dist/skills/ulpi-generate-guardian/references/language-rules.md +596 -0
- package/dist/skills-CX73O3IV.js +76 -0
- package/dist/status-4DFHDJMN.js +66 -0
- package/dist/templates/biome.yml +24 -0
- package/dist/templates/conventional-commits.yml +18 -0
- package/dist/templates/django.yml +30 -0
- package/dist/templates/docker.yml +30 -0
- package/dist/templates/eslint.yml +13 -0
- package/dist/templates/express.yml +20 -0
- package/dist/templates/fastapi.yml +23 -0
- package/dist/templates/git-flow.yml +26 -0
- package/dist/templates/github-flow.yml +27 -0
- package/dist/templates/go.yml +33 -0
- package/dist/templates/jest.yml +24 -0
- package/dist/templates/laravel.yml +30 -0
- package/dist/templates/monorepo.yml +26 -0
- package/dist/templates/nestjs.yml +21 -0
- package/dist/templates/nextjs.yml +31 -0
- package/dist/templates/nodejs.yml +33 -0
- package/dist/templates/npm.yml +15 -0
- package/dist/templates/php.yml +25 -0
- package/dist/templates/pnpm.yml +15 -0
- package/dist/templates/prettier.yml +23 -0
- package/dist/templates/prisma.yml +21 -0
- package/dist/templates/python.yml +33 -0
- package/dist/templates/quality-of-life.yml +111 -0
- package/dist/templates/ruby.yml +25 -0
- package/dist/templates/rust.yml +34 -0
- package/dist/templates/typescript.yml +14 -0
- package/dist/templates/vitest.yml +24 -0
- package/dist/templates/yarn.yml +15 -0
- package/dist/templates-U7T6MARD.js +156 -0
- package/dist/ui-L7UAWXDY.js +167 -0
- package/dist/ui.html +698 -0
- package/dist/ulpi-RMMCUAGP-JCJ273T6.js +161 -0
- package/dist/uninstall-6SW35IK4.js +25 -0
- package/dist/update-M2B4RLGH.js +61 -0
- package/dist/version-checker-ANCS3IHR.js +10 -0
- package/package.json +92 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
JsonSessionStore
|
|
3
|
+
} from "./chunk-YM2HV4IA.js";
|
|
4
|
+
import "./chunk-7LXY5UVC.js";
|
|
5
|
+
import "./chunk-4VNS5WPM.js";
|
|
6
|
+
|
|
7
|
+
// src/commands/status.ts
|
|
8
|
+
import chalk from "chalk";
|
|
9
|
+
async function runStatus(_args, projectDir) {
|
|
10
|
+
const store = new JsonSessionStore(void 0, projectDir);
|
|
11
|
+
let state = store.getLatestForProject(projectDir);
|
|
12
|
+
if (!state) {
|
|
13
|
+
const globalStore = new JsonSessionStore();
|
|
14
|
+
const sessions = globalStore.list();
|
|
15
|
+
if (sessions.length > 0) {
|
|
16
|
+
const latestId = sessions[sessions.length - 1];
|
|
17
|
+
state = globalStore.load(latestId);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (!state) {
|
|
21
|
+
console.log(chalk.yellow("No active sessions found."));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
console.log(chalk.bold("\nSession Status\n"));
|
|
25
|
+
console.log(` Session ID: ${chalk.dim(state.sessionId)}`);
|
|
26
|
+
console.log(` Started: ${state.startedAt}`);
|
|
27
|
+
console.log(` Project: ${state.projectDir}`);
|
|
28
|
+
if (state.branch) {
|
|
29
|
+
console.log(` Branch: ${state.branch}`);
|
|
30
|
+
}
|
|
31
|
+
console.log(chalk.bold("\nActivity:"));
|
|
32
|
+
console.log(` Files read: ${state.filesRead.length}`);
|
|
33
|
+
console.log(` Files written: ${state.filesWritten.length}`);
|
|
34
|
+
console.log(` Commands run: ${state.commandsRun.length}`);
|
|
35
|
+
console.log(chalk.bold("\nChecks:"));
|
|
36
|
+
printCheck("Tests", state.testsRun, state.testsPassed);
|
|
37
|
+
printCheck("Lint", state.lintRun, state.lintPassed);
|
|
38
|
+
printCheck("Build", state.buildRun, state.buildPassed);
|
|
39
|
+
printCheck("Format", state.formatterRun, null);
|
|
40
|
+
console.log(chalk.bold("\nEnforcement:"));
|
|
41
|
+
console.log(` Rules enforced: ${state.rulesEnforced}`);
|
|
42
|
+
console.log(` Actions blocked: ${state.actionsBlocked}`);
|
|
43
|
+
console.log(` Auto-actions run: ${state.autoActionsRun}`);
|
|
44
|
+
if (state.stack) {
|
|
45
|
+
console.log(chalk.bold("\nDetected Stack:"));
|
|
46
|
+
if (state.stack.runtime) console.log(` Runtime: ${state.stack.runtime.name}`);
|
|
47
|
+
if (state.stack.language) console.log(` Language: ${state.stack.language.name}`);
|
|
48
|
+
if (state.stack.framework) console.log(` Framework: ${state.stack.framework.name}`);
|
|
49
|
+
if (state.stack.packageManager) console.log(` Package Manager: ${state.stack.packageManager.name}`);
|
|
50
|
+
}
|
|
51
|
+
console.log("");
|
|
52
|
+
}
|
|
53
|
+
function printCheck(name, run, passed) {
|
|
54
|
+
if (!run) {
|
|
55
|
+
console.log(` ${chalk.dim("\u25CB")} ${name}: ${chalk.dim("not run")}`);
|
|
56
|
+
} else if (passed === true) {
|
|
57
|
+
console.log(` ${chalk.green("\u2713")} ${name}: ${chalk.green("passed")}`);
|
|
58
|
+
} else if (passed === false) {
|
|
59
|
+
console.log(` ${chalk.red("\u2717")} ${name}: ${chalk.red("failed")}`);
|
|
60
|
+
} else {
|
|
61
|
+
console.log(` ${chalk.yellow("\u25CF")} ${name}: ${chalk.yellow("run (status unknown)")}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
runStatus
|
|
66
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
id: biome
|
|
2
|
+
name: Biome
|
|
3
|
+
category: linter
|
|
4
|
+
variables:
|
|
5
|
+
format_command: "npx biome format --write ."
|
|
6
|
+
lint_command: "npx biome check --fix ."
|
|
7
|
+
|
|
8
|
+
rules:
|
|
9
|
+
postconditions:
|
|
10
|
+
biome-check-after-edit:
|
|
11
|
+
enabled: true
|
|
12
|
+
trigger: PostToolUse
|
|
13
|
+
matcher: "Write|Edit|MultiEdit"
|
|
14
|
+
file_pattern: "*.{ts,tsx,js,jsx,json}"
|
|
15
|
+
run: "npx biome check --fix {file_path}"
|
|
16
|
+
timeout: 15000
|
|
17
|
+
preconditions:
|
|
18
|
+
biome-before-commit:
|
|
19
|
+
enabled: true
|
|
20
|
+
trigger: PreToolUse
|
|
21
|
+
matcher: "Bash"
|
|
22
|
+
command_pattern: "git commit"
|
|
23
|
+
requires: [lint_run, formatter_run]
|
|
24
|
+
message: "Run biome check before committing."
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
id: conventional-commits
|
|
2
|
+
name: Conventional Commits
|
|
3
|
+
category: git-workflow
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
preconditions:
|
|
7
|
+
commit-message-format:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PreToolUse
|
|
10
|
+
matcher: "Bash"
|
|
11
|
+
command_pattern: "git commit"
|
|
12
|
+
message: "Use Conventional Commits format: type(scope): description. Types: feat, fix, docs, style, refactor, perf, test, build, ci, chore."
|
|
13
|
+
no-wip-commits:
|
|
14
|
+
enabled: true
|
|
15
|
+
trigger: PreToolUse
|
|
16
|
+
matcher: "Bash"
|
|
17
|
+
command_pattern: "git commit"
|
|
18
|
+
message: "Do not use WIP commit messages. Write meaningful commit descriptions."
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
id: django
|
|
2
|
+
name: Django
|
|
3
|
+
category: framework
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "python manage.py test"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
postconditions:
|
|
9
|
+
makemigrations-after-model:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PostToolUse
|
|
12
|
+
matcher: "Write|Edit"
|
|
13
|
+
file_pattern: "**/models.py"
|
|
14
|
+
run: "python manage.py makemigrations"
|
|
15
|
+
timeout: 30000
|
|
16
|
+
collectstatic-after-assets:
|
|
17
|
+
enabled: true
|
|
18
|
+
trigger: PostToolUse
|
|
19
|
+
matcher: "Write|Edit"
|
|
20
|
+
file_pattern: "**/static/**"
|
|
21
|
+
run: "python manage.py collectstatic --noinput"
|
|
22
|
+
timeout: 15000
|
|
23
|
+
permissions:
|
|
24
|
+
block-flush:
|
|
25
|
+
enabled: true
|
|
26
|
+
trigger: PreToolUse
|
|
27
|
+
matcher: "Bash"
|
|
28
|
+
command_pattern: "manage.py flush"
|
|
29
|
+
decision: deny
|
|
30
|
+
message: "manage.py flush deletes all data. Use targeted deletion instead."
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
id: docker
|
|
2
|
+
name: Docker
|
|
3
|
+
category: deployment
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
postconditions:
|
|
7
|
+
rebuild-after-dockerfile:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PostToolUse
|
|
10
|
+
matcher: "Write|Edit"
|
|
11
|
+
file_pattern: "Dockerfile*"
|
|
12
|
+
run: "docker build -t app:dev ."
|
|
13
|
+
timeout: 120000
|
|
14
|
+
block_on_failure: false
|
|
15
|
+
compose-up-after-edit:
|
|
16
|
+
enabled: true
|
|
17
|
+
trigger: PostToolUse
|
|
18
|
+
matcher: "Write|Edit"
|
|
19
|
+
file_pattern: "docker-compose*.{yml,yaml}"
|
|
20
|
+
run: "docker compose up -d"
|
|
21
|
+
timeout: 60000
|
|
22
|
+
block_on_failure: false
|
|
23
|
+
permissions:
|
|
24
|
+
block-system-prune:
|
|
25
|
+
enabled: true
|
|
26
|
+
trigger: PreToolUse
|
|
27
|
+
matcher: "Bash"
|
|
28
|
+
command_pattern: "docker system prune"
|
|
29
|
+
decision: deny
|
|
30
|
+
message: "docker system prune removes all unused data. Use targeted cleanup instead."
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
id: eslint
|
|
2
|
+
name: ESLint
|
|
3
|
+
category: linter
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
postconditions:
|
|
7
|
+
lint-after-edit:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PostToolUse
|
|
10
|
+
matcher: "Write|Edit|MultiEdit"
|
|
11
|
+
file_pattern: "*.{ts,tsx,js,jsx}"
|
|
12
|
+
run: "npx eslint --fix {file_path}"
|
|
13
|
+
timeout: 15000
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
id: express
|
|
2
|
+
name: Express.js
|
|
3
|
+
category: framework
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
preconditions:
|
|
7
|
+
no-listen-in-module:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PreToolUse
|
|
10
|
+
matcher: "Write|Edit"
|
|
11
|
+
file_pattern: "*.{ts,js}"
|
|
12
|
+
message: "Export the app instead of calling app.listen() in module files. Use a separate entry point."
|
|
13
|
+
permissions:
|
|
14
|
+
auto-approve-curl:
|
|
15
|
+
enabled: true
|
|
16
|
+
trigger: PermissionRequest
|
|
17
|
+
matcher: "Bash"
|
|
18
|
+
command_pattern: "curl"
|
|
19
|
+
decision: allow
|
|
20
|
+
message: "Auto-approved curl for API testing."
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: fastapi
|
|
2
|
+
name: FastAPI
|
|
3
|
+
category: framework
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "python -m pytest"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
postconditions:
|
|
9
|
+
generate-openapi:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PostToolUse
|
|
12
|
+
matcher: "Write|Edit"
|
|
13
|
+
file_pattern: "**/routes/*.py"
|
|
14
|
+
run: "python -c \"from app.main import app; import json; print(json.dumps(app.openapi()))\""
|
|
15
|
+
timeout: 15000
|
|
16
|
+
block_on_failure: false
|
|
17
|
+
preconditions:
|
|
18
|
+
async-endpoints:
|
|
19
|
+
enabled: true
|
|
20
|
+
trigger: PreToolUse
|
|
21
|
+
matcher: "Write|Edit"
|
|
22
|
+
file_pattern: "**/routes/*.py"
|
|
23
|
+
message: "Use async def for endpoint handlers to avoid blocking the event loop."
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
id: git-flow
|
|
2
|
+
name: Git Flow
|
|
3
|
+
category: git-workflow
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
preconditions:
|
|
7
|
+
feature-branch-naming:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PreToolUse
|
|
10
|
+
matcher: "Bash"
|
|
11
|
+
command_pattern: "git checkout -b"
|
|
12
|
+
message: "Use git-flow branch naming: feature/, bugfix/, release/, hotfix/ prefixes."
|
|
13
|
+
no-commit-to-develop:
|
|
14
|
+
enabled: true
|
|
15
|
+
trigger: PreToolUse
|
|
16
|
+
matcher: "Bash"
|
|
17
|
+
command_pattern: "git commit"
|
|
18
|
+
message: "Do not commit directly to develop. Create a feature branch first."
|
|
19
|
+
permissions:
|
|
20
|
+
block-force-merge:
|
|
21
|
+
enabled: true
|
|
22
|
+
trigger: PreToolUse
|
|
23
|
+
matcher: "Bash"
|
|
24
|
+
command_pattern: "git merge"
|
|
25
|
+
decision: deny
|
|
26
|
+
message: "Use pull requests for merging into develop/main. Direct merges are blocked."
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
id: github-flow
|
|
2
|
+
name: GitHub Flow
|
|
3
|
+
category: git-workflow
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
preconditions:
|
|
7
|
+
branch-before-commit:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PreToolUse
|
|
10
|
+
matcher: "Bash"
|
|
11
|
+
command_pattern: "git commit"
|
|
12
|
+
requires: [branch_created]
|
|
13
|
+
message: "Create a feature branch before committing. Don't commit on main."
|
|
14
|
+
descriptive-branch-name:
|
|
15
|
+
enabled: true
|
|
16
|
+
trigger: PreToolUse
|
|
17
|
+
matcher: "Bash"
|
|
18
|
+
command_pattern: "git checkout -b"
|
|
19
|
+
message: "Use descriptive branch names: feat/, fix/, docs/, chore/ prefixes."
|
|
20
|
+
permissions:
|
|
21
|
+
block-push-main:
|
|
22
|
+
enabled: true
|
|
23
|
+
trigger: PreToolUse
|
|
24
|
+
matcher: "Bash"
|
|
25
|
+
command_pattern: "git push origin main"
|
|
26
|
+
decision: deny
|
|
27
|
+
message: "Push to a feature branch and open a pull request instead."
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
id: go
|
|
2
|
+
name: Go
|
|
3
|
+
category: runtime
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "go test ./..."
|
|
6
|
+
lint_command: "golangci-lint run"
|
|
7
|
+
build_command: "go build ./..."
|
|
8
|
+
|
|
9
|
+
rules:
|
|
10
|
+
preconditions:
|
|
11
|
+
test-before-commit:
|
|
12
|
+
enabled: true
|
|
13
|
+
trigger: PreToolUse
|
|
14
|
+
matcher: "Bash"
|
|
15
|
+
command_pattern: "git commit"
|
|
16
|
+
requires: [tests_run]
|
|
17
|
+
message: "Run {test_command} before committing."
|
|
18
|
+
postconditions:
|
|
19
|
+
go-mod-tidy:
|
|
20
|
+
enabled: true
|
|
21
|
+
trigger: PostToolUse
|
|
22
|
+
matcher: "Write|Edit"
|
|
23
|
+
file_pattern: "go.mod"
|
|
24
|
+
run: "go mod tidy"
|
|
25
|
+
timeout: 30000
|
|
26
|
+
go-vet-after-edit:
|
|
27
|
+
enabled: true
|
|
28
|
+
trigger: PostToolUse
|
|
29
|
+
matcher: "Write|Edit|MultiEdit"
|
|
30
|
+
file_pattern: "*.go"
|
|
31
|
+
run: "go vet ./..."
|
|
32
|
+
timeout: 20000
|
|
33
|
+
block_on_failure: false
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
id: jest
|
|
2
|
+
name: Jest
|
|
3
|
+
category: test-runner
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "npx jest"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
permissions:
|
|
9
|
+
auto-approve-jest:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PermissionRequest
|
|
12
|
+
matcher: "Bash"
|
|
13
|
+
command_pattern: "jest"
|
|
14
|
+
decision: allow
|
|
15
|
+
message: "Auto-approved jest command."
|
|
16
|
+
postconditions:
|
|
17
|
+
run-tests-after-edit:
|
|
18
|
+
enabled: true
|
|
19
|
+
trigger: PostToolUse
|
|
20
|
+
matcher: "Write|Edit|MultiEdit"
|
|
21
|
+
file_pattern: "*.{test,spec}.{ts,tsx,js,jsx}"
|
|
22
|
+
run: "npx jest {file_path}"
|
|
23
|
+
timeout: 30000
|
|
24
|
+
block_on_failure: false
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
id: laravel
|
|
2
|
+
name: Laravel
|
|
3
|
+
category: framework
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "php artisan test"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
postconditions:
|
|
9
|
+
migrate-after-migration:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PostToolUse
|
|
12
|
+
matcher: "Write|Edit"
|
|
13
|
+
file_pattern: "database/migrations/*.php"
|
|
14
|
+
run: "php artisan migrate"
|
|
15
|
+
timeout: 30000
|
|
16
|
+
clear-cache-after-config:
|
|
17
|
+
enabled: true
|
|
18
|
+
trigger: PostToolUse
|
|
19
|
+
matcher: "Write|Edit"
|
|
20
|
+
file_pattern: "config/*.php"
|
|
21
|
+
run: "php artisan config:clear"
|
|
22
|
+
timeout: 10000
|
|
23
|
+
permissions:
|
|
24
|
+
block-migrate-fresh:
|
|
25
|
+
enabled: true
|
|
26
|
+
trigger: PreToolUse
|
|
27
|
+
matcher: "Bash"
|
|
28
|
+
command_pattern: "artisan migrate:fresh"
|
|
29
|
+
decision: deny
|
|
30
|
+
message: "migrate:fresh drops all tables. Use migrate:rollback instead."
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
id: monorepo
|
|
2
|
+
name: Monorepo
|
|
3
|
+
category: deployment
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
preconditions:
|
|
7
|
+
scope-changes:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PreToolUse
|
|
10
|
+
matcher: "Bash"
|
|
11
|
+
command_pattern: "git commit"
|
|
12
|
+
message: "Scope commits to a single package when possible. Use package-scoped test/build commands."
|
|
13
|
+
build-deps-first:
|
|
14
|
+
enabled: true
|
|
15
|
+
trigger: PreToolUse
|
|
16
|
+
matcher: "Bash"
|
|
17
|
+
command_pattern: "build"
|
|
18
|
+
message: "Build workspace dependencies before building the current package."
|
|
19
|
+
permissions:
|
|
20
|
+
auto-approve-workspace:
|
|
21
|
+
enabled: true
|
|
22
|
+
trigger: PermissionRequest
|
|
23
|
+
matcher: "Bash"
|
|
24
|
+
command_pattern: "pnpm -w"
|
|
25
|
+
decision: allow
|
|
26
|
+
message: "Auto-approved workspace command."
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
id: nestjs
|
|
2
|
+
name: NestJS
|
|
3
|
+
category: framework
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
postconditions:
|
|
7
|
+
nest-build-after-edit:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PostToolUse
|
|
10
|
+
matcher: "Write|Edit|MultiEdit"
|
|
11
|
+
file_pattern: "*.module.ts"
|
|
12
|
+
run: "npx nest build"
|
|
13
|
+
timeout: 30000
|
|
14
|
+
block_on_failure: false
|
|
15
|
+
preconditions:
|
|
16
|
+
inject-via-constructor:
|
|
17
|
+
enabled: true
|
|
18
|
+
trigger: PreToolUse
|
|
19
|
+
matcher: "Write|Edit"
|
|
20
|
+
file_pattern: "*.{service,controller,guard,interceptor}.ts"
|
|
21
|
+
message: "Use constructor injection for dependencies. Do not instantiate services directly."
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
id: nextjs
|
|
2
|
+
name: Next.js
|
|
3
|
+
category: framework
|
|
4
|
+
variables:
|
|
5
|
+
build_command: "npx next build"
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
postconditions:
|
|
9
|
+
next-build-after-config:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PostToolUse
|
|
12
|
+
matcher: "Write|Edit"
|
|
13
|
+
file_pattern: "next.config.{js,mjs,ts}"
|
|
14
|
+
run: "npx next build"
|
|
15
|
+
timeout: 120000
|
|
16
|
+
block_on_failure: false
|
|
17
|
+
preconditions:
|
|
18
|
+
no-client-in-server:
|
|
19
|
+
enabled: true
|
|
20
|
+
trigger: PreToolUse
|
|
21
|
+
matcher: "Write|Edit"
|
|
22
|
+
file_pattern: "app/**/page.{ts,tsx}"
|
|
23
|
+
message: "Server Components cannot use useState/useEffect. Add 'use client' directive or move to a client component."
|
|
24
|
+
permissions:
|
|
25
|
+
auto-approve-next-dev:
|
|
26
|
+
enabled: true
|
|
27
|
+
trigger: PermissionRequest
|
|
28
|
+
matcher: "Bash"
|
|
29
|
+
command_pattern: "next dev"
|
|
30
|
+
decision: allow
|
|
31
|
+
message: "Auto-approved next dev server."
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
id: nodejs
|
|
2
|
+
name: Node.js
|
|
3
|
+
category: runtime
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "{package_manager} test"
|
|
6
|
+
lint_command: "{package_manager} lint"
|
|
7
|
+
build_command: "{package_manager} build"
|
|
8
|
+
|
|
9
|
+
rules:
|
|
10
|
+
preconditions:
|
|
11
|
+
test-before-commit:
|
|
12
|
+
enabled: true
|
|
13
|
+
trigger: PreToolUse
|
|
14
|
+
matcher: "Bash"
|
|
15
|
+
command_pattern: "git commit"
|
|
16
|
+
requires: [tests_run]
|
|
17
|
+
message: "Run {test_command} before committing."
|
|
18
|
+
lint-before-commit:
|
|
19
|
+
enabled: true
|
|
20
|
+
trigger: PreToolUse
|
|
21
|
+
matcher: "Bash"
|
|
22
|
+
command_pattern: "git commit"
|
|
23
|
+
requires: [lint_run]
|
|
24
|
+
message: "Run {lint_command} before committing."
|
|
25
|
+
|
|
26
|
+
postconditions:
|
|
27
|
+
install-after-package-json:
|
|
28
|
+
enabled: true
|
|
29
|
+
trigger: PostToolUse
|
|
30
|
+
matcher: "Write|Edit"
|
|
31
|
+
file_pattern: "package.json"
|
|
32
|
+
run: "{package_manager} install"
|
|
33
|
+
timeout: 60000
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
id: npm
|
|
2
|
+
name: npm
|
|
3
|
+
category: package-manager
|
|
4
|
+
variables:
|
|
5
|
+
package_manager: npm
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
permissions:
|
|
9
|
+
auto-approve-npm:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PermissionRequest
|
|
12
|
+
matcher: "Bash"
|
|
13
|
+
command_pattern: "npm"
|
|
14
|
+
decision: allow
|
|
15
|
+
message: "Auto-approved npm command."
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
id: php
|
|
2
|
+
name: PHP
|
|
3
|
+
category: runtime
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "vendor/bin/phpunit"
|
|
6
|
+
lint_command: "vendor/bin/phpstan analyse"
|
|
7
|
+
package_manager: composer
|
|
8
|
+
|
|
9
|
+
rules:
|
|
10
|
+
preconditions:
|
|
11
|
+
test-before-commit:
|
|
12
|
+
enabled: true
|
|
13
|
+
trigger: PreToolUse
|
|
14
|
+
matcher: "Bash"
|
|
15
|
+
command_pattern: "git commit"
|
|
16
|
+
requires: [tests_run]
|
|
17
|
+
message: "Run {test_command} before committing."
|
|
18
|
+
postconditions:
|
|
19
|
+
composer-install:
|
|
20
|
+
enabled: true
|
|
21
|
+
trigger: PostToolUse
|
|
22
|
+
matcher: "Write|Edit"
|
|
23
|
+
file_pattern: "composer.json"
|
|
24
|
+
run: "composer install"
|
|
25
|
+
timeout: 60000
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
id: pnpm
|
|
2
|
+
name: pnpm
|
|
3
|
+
category: package-manager
|
|
4
|
+
variables:
|
|
5
|
+
package_manager: pnpm
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
permissions:
|
|
9
|
+
auto-approve-pnpm:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PermissionRequest
|
|
12
|
+
matcher: "Bash"
|
|
13
|
+
command_pattern: "pnpm"
|
|
14
|
+
decision: allow
|
|
15
|
+
message: "Auto-approved pnpm command."
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
id: prettier
|
|
2
|
+
name: Prettier
|
|
3
|
+
category: formatter
|
|
4
|
+
variables:
|
|
5
|
+
format_command: "npx prettier --write ."
|
|
6
|
+
|
|
7
|
+
rules:
|
|
8
|
+
postconditions:
|
|
9
|
+
format-after-edit:
|
|
10
|
+
enabled: true
|
|
11
|
+
trigger: PostToolUse
|
|
12
|
+
matcher: "Write|Edit|MultiEdit"
|
|
13
|
+
file_pattern: "*.{ts,tsx,js,jsx,css,json,md}"
|
|
14
|
+
run: "npx prettier --write {file_path}"
|
|
15
|
+
timeout: 10000
|
|
16
|
+
preconditions:
|
|
17
|
+
format-before-commit:
|
|
18
|
+
enabled: true
|
|
19
|
+
trigger: PreToolUse
|
|
20
|
+
matcher: "Bash"
|
|
21
|
+
command_pattern: "git commit"
|
|
22
|
+
requires: [formatter_run]
|
|
23
|
+
message: "Run prettier before committing."
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
id: prisma
|
|
2
|
+
name: Prisma
|
|
3
|
+
category: orm
|
|
4
|
+
|
|
5
|
+
rules:
|
|
6
|
+
postconditions:
|
|
7
|
+
prisma-generate:
|
|
8
|
+
enabled: true
|
|
9
|
+
trigger: PostToolUse
|
|
10
|
+
matcher: "Write|Edit"
|
|
11
|
+
file_pattern: "prisma/schema.prisma"
|
|
12
|
+
run: "npx prisma generate"
|
|
13
|
+
timeout: 30000
|
|
14
|
+
permissions:
|
|
15
|
+
block-prisma-reset:
|
|
16
|
+
enabled: true
|
|
17
|
+
trigger: PreToolUse
|
|
18
|
+
matcher: "Bash"
|
|
19
|
+
command_pattern: "prisma migrate reset"
|
|
20
|
+
decision: deny
|
|
21
|
+
message: "prisma migrate reset is destructive. Use prisma migrate dev instead."
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
id: python
|
|
2
|
+
name: Python
|
|
3
|
+
category: runtime
|
|
4
|
+
variables:
|
|
5
|
+
test_command: "python -m pytest"
|
|
6
|
+
lint_command: "python -m ruff check ."
|
|
7
|
+
package_manager: pip
|
|
8
|
+
|
|
9
|
+
rules:
|
|
10
|
+
preconditions:
|
|
11
|
+
test-before-commit:
|
|
12
|
+
enabled: true
|
|
13
|
+
trigger: PreToolUse
|
|
14
|
+
matcher: "Bash"
|
|
15
|
+
command_pattern: "git commit"
|
|
16
|
+
requires: [tests_run]
|
|
17
|
+
message: "Run {test_command} before committing."
|
|
18
|
+
postconditions:
|
|
19
|
+
install-after-requirements:
|
|
20
|
+
enabled: true
|
|
21
|
+
trigger: PostToolUse
|
|
22
|
+
matcher: "Write|Edit"
|
|
23
|
+
file_pattern: "requirements*.txt"
|
|
24
|
+
run: "pip install -r {file_path}"
|
|
25
|
+
timeout: 60000
|
|
26
|
+
permissions:
|
|
27
|
+
auto-approve-pytest:
|
|
28
|
+
enabled: true
|
|
29
|
+
trigger: PermissionRequest
|
|
30
|
+
matcher: "Bash"
|
|
31
|
+
command_pattern: "pytest"
|
|
32
|
+
decision: allow
|
|
33
|
+
message: "Auto-approved pytest command."
|