From 7e91ceaf17689f298771efff1f664b9b013225e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lollipopkit=F0=9F=8F=B3=EF=B8=8F=E2=80=8D=E2=9A=A7?= =?UTF-8?q?=EF=B8=8F?= <10864310+lollipopkit@users.noreply.github.com> Date: Sat, 24 Jan 2026 01:57:21 +0800 Subject: [PATCH 1/2] feat(devloop): run pre-commit checks in validator --- plugins/devloop/README.md | 4 ++++ plugins/devloop/README.zh-CN.md | 4 ++++ plugins/devloop/agents/devloop-validator.md | 3 +++ 3 files changed, 11 insertions(+) diff --git a/plugins/devloop/README.md b/plugins/devloop/README.md index 5916513..4e89540 100644 --- a/plugins/devloop/README.md +++ b/plugins/devloop/README.md @@ -33,6 +33,10 @@ A Claude Code plugin that drives a task/issue to a merge-ready PR through an ite Create `.claude/devloop.local.md` in your project root. +Notes: + +- If your repo contains `.pre-commit-config.yaml` and `pre-commit` is available, the validator step will run `pre-commit run --all-files --show-diff-on-failure` to help catch CI failures earlier. + Minimal template: ```markdown diff --git a/plugins/devloop/README.zh-CN.md b/plugins/devloop/README.zh-CN.md index 90d6896..8e1ff07 100644 --- a/plugins/devloop/README.zh-CN.md +++ b/plugins/devloop/README.zh-CN.md @@ -33,6 +33,10 @@ 在你的项目根目录创建 `.claude/devloop.local.md`。 +说明: + +- 如果你的仓库包含 `.pre-commit-config.yaml` 且本机可用 `pre-commit`,验证阶段会运行 `pre-commit run --all-files --show-diff-on-failure`,用于提前发现可能导致 CI 失败的问题。 + 最小模板: ```markdown diff --git a/plugins/devloop/agents/devloop-validator.md b/plugins/devloop/agents/devloop-validator.md index 5145f40..dca05c1 100644 --- a/plugins/devloop/agents/devloop-validator.md +++ b/plugins/devloop/agents/devloop-validator.md @@ -12,6 +12,9 @@ You are a specialized Sub-Agent focused on validation. Your goal is to ensure th 1. **Identify Tests**: Determine which existing tests are relevant to the changes, or identify what manual verification commands (e.g., build, lint) should be run. 2. **Execution**: Run the relevant tests and verification commands. + - If the repo contains `.pre-commit-config.yaml` and `pre-commit` is available, also run: + - `pre-commit run --all-files --show-diff-on-failure` + - If `.pre-commit-config.yaml` exists but `pre-commit` is not installed/available, report this clearly and skip. 3. **Analysis**: Interpret the results. Distinguish between failures caused by the new changes and pre-existing issues. 4. **Reporting**: Provide a clear report of test results, including any failures and logs. From 021da8fb3d8c3b4baf155219e07fb3610ac1e84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lollipopkit=F0=9F=8F=B3=EF=B8=8F=E2=80=8D=E2=9A=A7?= =?UTF-8?q?=EF=B8=8F?= <10864310+lollipopkit@users.noreply.github.com> Date: Sat, 24 Jan 2026 09:52:59 +0800 Subject: [PATCH 2/2] feat(devloop): run pre-commit hook script in validator --- plugins/devloop/README.md | 2 +- plugins/devloop/README.zh-CN.md | 2 +- plugins/devloop/agents/devloop-validator.md | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/devloop/README.md b/plugins/devloop/README.md index 4e89540..e0338c0 100644 --- a/plugins/devloop/README.md +++ b/plugins/devloop/README.md @@ -35,7 +35,7 @@ Create `.claude/devloop.local.md` in your project root. Notes: -- If your repo contains `.pre-commit-config.yaml` and `pre-commit` is available, the validator step will run `pre-commit run --all-files --show-diff-on-failure` to help catch CI failures earlier. +- If your repo contains a pre-commit hook script (e.g. `./.husky/pre-commit`), the validator step will run it to help catch CI failures earlier. Minimal template: diff --git a/plugins/devloop/README.zh-CN.md b/plugins/devloop/README.zh-CN.md index 8e1ff07..01e3ff5 100644 --- a/plugins/devloop/README.zh-CN.md +++ b/plugins/devloop/README.zh-CN.md @@ -35,7 +35,7 @@ 说明: -- 如果你的仓库包含 `.pre-commit-config.yaml` 且本机可用 `pre-commit`,验证阶段会运行 `pre-commit run --all-files --show-diff-on-failure`,用于提前发现可能导致 CI 失败的问题。 +- 如果你的仓库包含 pre-commit 的 hook 脚本(例如 `./.husky/pre-commit`),验证阶段会运行该脚本,用于提前发现可能导致 CI 失败的问题。 最小模板: diff --git a/plugins/devloop/agents/devloop-validator.md b/plugins/devloop/agents/devloop-validator.md index dca05c1..88337ed 100644 --- a/plugins/devloop/agents/devloop-validator.md +++ b/plugins/devloop/agents/devloop-validator.md @@ -12,9 +12,10 @@ You are a specialized Sub-Agent focused on validation. Your goal is to ensure th 1. **Identify Tests**: Determine which existing tests are relevant to the changes, or identify what manual verification commands (e.g., build, lint) should be run. 2. **Execution**: Run the relevant tests and verification commands. - - If the repo contains `.pre-commit-config.yaml` and `pre-commit` is available, also run: - - `pre-commit run --all-files --show-diff-on-failure` - - If `.pre-commit-config.yaml` exists but `pre-commit` is not installed/available, report this clearly and skip. + - If the repo contains a pre-commit hook script, run it to catch common CI failures earlier: + - If `./.husky/pre-commit` exists, run `./.husky/pre-commit` + - Else if `.git/hooks/pre-commit` exists, run `.git/hooks/pre-commit` + - If no hook script exists, report that you skipped this step. 3. **Analysis**: Interpret the results. Distinguish between failures caused by the new changes and pre-existing issues. 4. **Reporting**: Provide a clear report of test results, including any failures and logs.