You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(auto-code-quality): replace Stop hooks with /cq skill
The 3 Stop hooks (format-on-stop, lint-file, advisory-test-runner) caused
race conditions with background agents, fired too frequently during
orchestration pauses, and produced lint results as passive context that
Claude couldn't act on.
Replace them with:
- /cq skill — Claude runs format, lint (auto-fix), and tests explicitly
- quality-gate.py — lightweight Stop hook that prompts /cq when needed
- task-tracker.py — tracks active background tasks to avoid conflicts
The gate is background-task-aware and self-cleaning (deletes temp files
on block to prevent loops).
Copy file name to clipboardExpand all lines: container/.devcontainer/CHANGELOG.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,12 @@
40
40
-**Cross-references added** — before-you-install, accessing-services, troubleshooting, and devcontainer-cli pages now link to the Windows networking guide
41
41
-**Agent-browser CDP troubleshooting** — new troubleshooting section for host Chrome connection issues (localhost vs host.docker.internal, Chrome version requirements, port exposure)
42
42
43
+
### Code Quality
44
+
45
+
-**Replaced auto-format/lint/test Stop hooks with `/cq` skill** — the three Stop hooks (`format-on-stop.py`, `lint-file.py`, `advisory-test-runner.py`) that ran automatically on every stop are replaced by a single `/cq` skill that Claude invokes explicitly. Eliminates race conditions with background agents, stops firing during orchestration pauses, and lets Claude act on lint/test results instead of ignoring passive context.
46
+
-**New quality gate Stop hook** — lightweight `quality-gate.py` (~1ms) checks whether files were edited and no background tasks are running, then blocks the stop with a prompt to run `/cq`. Deletes temp files on block to prevent loops.
47
+
-**New task tracker hooks** — `task-tracker.py` handles `TaskCreated`/`TaskCompleted` events to maintain an active-task count. The quality gate skips blocking while tasks are running, preventing format/lint conflicts with background agents.
48
+
43
49
### CI
44
50
45
51
-**Canary pre-release publishing** — every push to `staging` that touches `container/` now auto-publishes a canary build to npm. Install with `npm i @coredirective/cf-container@canary` to try unreleased changes. Versions use the format `{version}-staging.{sha7}`.
|`hermes`| Nous Research Hermes Agent CLI (run `hermes setup` on first use) |
220
220
221
+
### Windows Host Chrome CDP
222
+
223
+
For Hermes, Vercel agent-browser, Codex, or Claude Code to control Chrome running on a Windows host, run this from an Administrator PowerShell at the repository root:
224
+
225
+
```powershell
226
+
.\.devcontainer\scripts\start-hermes-chrome.ps1
227
+
```
228
+
229
+
The devcontainer uses `HERMES_CDP_ENDPOINT=http://192.168.65.254:9223` for Docker Desktop. Verify the current host IPv4 from inside the container:
@@ -335,7 +350,7 @@ CodeForge includes custom devcontainer features. Any feature can be disabled by
335
350
336
351
### auto-code-quality
337
352
338
-
Combined auto-formatter, auto-linter, and advisory test runner plugin at `plugins/devs-marketplace/plugins/auto-code-quality/`. Three-phase pipeline: collect edited files (PostToolUse), batch format + lint (Stop), and advisory test runner (Stop). Supports all languages from the former auto-formatter + auto-linter plugins. Replaces the separate `auto-formatter` and `auto-linter` plugins.
353
+
Code quality plugin at `plugins/devs-marketplace/plugins/auto-code-quality/`. Tracks edited files (PostToolUse), validates data file syntax instantly, tracks background tasks (TaskCreated/Completed), and gates stops with a lightweight check — if files were edited and no tasks are running, prompts Claude to run the `/cq` skill for formatting, linting (with auto-fix), and affected test execution. Supports Python, JS/TS, Go, Shell, Rust, Markdown, YAML, TOML, and Dockerfiles.
Copy file name to clipboardExpand all lines: container/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/.claude-plugin/plugin.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "auto-code-quality",
3
-
"description": "Self-contained code quality plugin: collects edited files, batch-formats at Stop (Ruff/Black for Python, gofmt for Go, Biome for JS/TS/CSS/JSON/GraphQL/HTML, shfmt for Shell, dprint for Markdown/YAML/TOML/Dockerfile, rustfmt for Rust), batch-lints at Stop (Pyright + Ruff for Python, Biome for JS/TS/CSS/GraphQL, ShellCheck for Shell, go vet for Go, hadolint for Dockerfile, clippy for Rust), and validates JSON/JSONC/YAML/TOML syntax on edit",
3
+
"description": "Code quality plugin: collects edited files on edit, validates JSON/JSONC/YAML/TOML syntax instantly, tracks background tasks, and gates stops with a /cq skill prompt — format, lint, and test on demand instead of automatically",
Copy file name to clipboardExpand all lines: container/.devcontainer/plugins/devs-marketplace/plugins/auto-code-quality/README.md
+89-29Lines changed: 89 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,20 @@
1
1
# auto-code-quality
2
2
3
-
Self-contained Claude Code plugin that automatically formats and lints edited files. Drop it into any Claude Code plugin marketplace and enable it — no other plugins required.
3
+
Claude Code plugin that tracks edited files and runs code quality checks on demand via the `/cq` skill. Drop it into any Claude Code plugin marketplace and enable it — no other plugins required.
4
4
5
5
## What It Does
6
6
7
-
Three-phase pipeline that runs transparently during your Claude Code session:
7
+
Two-phase pipeline with an explicit quality gate:
8
8
9
-
1.**Collect** (PostToolUse on Edit/Write) — Records which files Claude edits
10
-
2.**Format** (Stop hook) — Batch-formats all edited files when Claude finishes responding
11
-
3.**Lint** (Stop hook) — Batch-lints all edited files and surfaces warnings as context
9
+
1.**Track** (PostToolUse on Edit/Write) — Records which files Claude edits, validates data file syntax instantly
10
+
2.**Gate** (Stop hook) — Lightweight check: if files were edited and no background tasks are running, blocks the stop and prompts Claude to run `/cq`
11
+
3.**Quality** (`/cq` skill) — Claude formats, lints (with auto-fix), and runs affected tests on all edited files
12
12
13
-
Additionally validates JSON, JSONC, YAML, and TOML syntax immediately after each edit.
13
+
The `/cq` skill can also be invoked manually at any time during a session.
14
14
15
-
All phases are non-blocking. Missing tools are silently skipped. The plugin always exits cleanly — it will never interrupt Claude.
15
+
### Why a skill instead of automatic hooks?
16
+
17
+
Previous versions ran formatters, linters, and test runners as Stop hooks. This caused issues with background agents (race conditions on file writes), fired too frequently during orchestration pauses, and produced lint results as passive context that was often ignored. The `/cq` skill runs explicitly — Claude can act on results, fix issues, and re-run checks.
16
18
17
19
## Required Tools
18
20
@@ -21,7 +23,6 @@ Install the tools for the languages you work with. Everything is optional — th
|`claude-active-tasks-{session_id}`| Active background task IDs | task-tracker.py | quality-gate.py |
138
+
139
+
All temp files are cleaned up after processing (by the gate and/or the skill).
140
+
141
+
### Loop Prevention
142
+
143
+
The quality gate deletes the edited-files temp file when it blocks. On the second stop (after `/cq` runs), the temp file is gone — the gate exits clean. The `/cq` skill also cleans up temp files as a safety net.
104
144
105
145
### Timeouts
106
146
107
147
| Hook | Timeout |
108
148
|------|---------|
109
149
| File collection | 3s |
110
150
| Syntax validation | 5s |
111
-
| Batch formatting | 15s total |
112
-
| Batch linting | 60s total |
113
-
| Individual tool | 10-12s each |
151
+
| Task tracking | 3s |
152
+
| Quality gate | 3s |
153
+
154
+
The `/cq` skill has no timeout — it runs as a normal Claude conversation turn.
155
+
156
+
## Disabling
157
+
158
+
### Disable the entire plugin
159
+
160
+
Remove from `enabledPlugins` in your settings.
161
+
162
+
### Disable individual hooks
163
+
164
+
Add the script name (without `.py`) to the `disabled` array in `~/.claude/disabled-hooks.json`:
165
+
166
+
```json
167
+
{
168
+
"disabled": ["quality-gate"]
169
+
}
170
+
```
171
+
172
+
Available hook names: `collect-edited-files`, `syntax-validator`, `task-tracker`, `quality-gate`
114
173
115
174
## Conflict Warning
116
175
117
176
This plugin bundles functionality that may overlap with other plugins. If you're using any of the following, **disable them** before enabling this plugin to avoid duplicate processing:
118
177
119
-
-`auto-formatter` — formatting is included here
120
-
-`auto-linter` — linting is included here
178
+
-`auto-formatter` — formatting is included in `/cq`
179
+
-`auto-linter` — linting is included in `/cq`
121
180
-`code-directive``collect-edited-files.py` hook — file collection is included here
122
181
123
-
All pipelines use the `claude-cq-*` temp file prefix, so enabling both won't corrupt data — but files would be formatted and linted twice.
0 commit comments