Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c536b16
fix(hook): Close fail-open gaps in stop-guard and change tracking
sd0xdev Jun 12, 2026
eaf0594
docs(workflow-orchestration): Add feasibility study and requirements
sd0xdev Jun 12, 2026
3be3372
docs(plan-review-loop): Add lifecycle specs for pre-ExitPlanMode gate
sd0xdev Jun 12, 2026
95846ae
feat(plan-review): Add pre-ExitPlanMode adversarial plan review loop
sd0xdev Jul 3, 2026
01db6ac
docs(plan-review-loop): Sync tech spec with implementation and add v1…
sd0xdev Jul 3, 2026
55c14db
feat(orchestrate): Add agent-driven workflow orchestration (report-on…
sd0xdev Jul 3, 2026
e890782
docs(workflow-orchestration): Add tech spec and v1 request ticket
sd0xdev Jul 3, 2026
2a3eacb
fix(catalog): Register /plan-review and /orchestrate, count untracked…
sd0xdev Jul 3, 2026
a644717
fix(test): expand npm test glob so nested suites run under /bin/sh
sd0xdev Jul 6, 2026
0ce8986
fix(hooks): harden review-state gates — fail-closed parsing, locked w…
sd0xdev Jul 6, 2026
d2c321e
fix(scripts): word-bound AI attribution patterns, precommit skip reco…
sd0xdev Jul 6, 2026
83f7bdc
docs: sync forbidden-pattern tables, dep-audit allowed-tools, test-co…
sd0xdev Jul 6, 2026
031547e
fix(hooks): harden review-state and session gates against fail-open a…
sd0xdev Jul 10, 2026
e3d8542
fix(scripts): word-bound AI patterns, fail-closed precommit all-skip,…
sd0xdev Jul 10, 2026
98df154
docs: sync resource counts and AI-pattern wording across READMEs, tec…
sd0xdev Jul 10, 2026
fe6a06f
fix(orchestrate): detect .git/-internals bypass in run-verify SC-2 ba…
sd0xdev Jul 10, 2026
f4187c5
fix(orchestrate): enforce DAG and expand forbidden sentinels in valid…
sd0xdev Jul 10, 2026
c1c1c1f
fix: bug
sd0xdev Jul 26, 2026
94115fd
refactor: migrate auto-loop to tier-based gating with opt-in dual rev…
sd0xdev Jul 26, 2026
b1cbf31
chore: bump to 4.0.0 and remove 'dual-review' wording from metadata
sd0xdev Jul 26, 2026
8c8c252
refactor: adopt tier-based gating with opt-in dual review; update doc…
sd0xdev Jul 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"source": "github",
"repo": "sd0xdev/sd0x-dev-flow"
},
"description": "Harness engineering for Claude Code — hook-enforced dual review, state-machine gates, and fail-closed safety where it counts."
"description": "Harness engineering for Claude Code — hook-enforced review gates, state-machine gates, and fail-closed safety where it counts."
}
]
}
4 changes: 2 additions & 2 deletions .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "sd0x-dev-flow",
"description": "Harness engineering for Claude Code — hook-enforced dual review, state-machine gates, and fail-closed safety where it counts.",
"version": "3.0.12",
"description": "Harness engineering for Claude Code — hook-enforced review gates, state-machine gates, and fail-closed safety where it counts.",
"version": "4.0.0",
"author": {
"name": "sd0xdev"
},
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ node_modules/
.env.*
settings.local.json
.claude_review_state.json
.claude_review_state.json.*
.claude_nit_history.json
.claude_workflows/
.claude/

# Local-only skills (not published)
Expand Down
2 changes: 1 addition & 1 deletion .sd0x/install-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schema_version": 1,
"installed_at": "2026-04-02T08:45:00Z",
"updated_at": "2026-04-04T00:00:00Z",
"plugin_version": "3.0.12",
"plugin_version": "4.0.0",
"hook_scripts": {
"pre-edit-guard.sh": {
"hash": "1e3b3847f5ff3a6eac654840edc8c7152e0d3662"
Expand Down
24 changes: 21 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@
| `.md` docs | `/codex-review-doc` | `/codex-review-fast` |
| Comments only | - | All |

> **What the Stop Hook actually enforces**: that *a* precommit gate ran and passed — not *which* variant. `/precommit-fast` skips the build/typecheck step yet satisfies the gate by default. Two settings are needed to make the full variant above actually binding, and each alone is insufficient:
>
> | Setting | Without it |
> |---------|-----------|
> | `PRECOMMIT_REQUIRE_FULL=1` | a passing `mode: fast` (or an unrecorded mode) satisfies the gate |
> | `STOP_GUARD_MODE=strict` | the default `warn` mode prints the missing step to stderr and **still exits 0** |
>
> With both set, the flag is honoured in **both** of stop-guard's modes: from `precommit.mode` when a state file exists, and from the invoked command name (`/precommit` vs `/precommit-fast`) in the transcript fallback. The fallback arm ships with the same change as this note — before it, the flag was state-file-only, so a session without a readable state file (the degraded path where an unproven verdict is least affordable) silently accepted the fast gate. Verify rather than assume: `grep -c PRECOMMIT_REQUIRE_FULL hooks/stop-guard.sh` should report 4, and a checkout predating this change reports 0.
>
> Even with both, the flag gates the **command variant**, not the stages that ran: a repo with no build script records `full` with no typecheck behind it. See `docs/features/precommit-tiering/2-tech-spec.md` §6.

Before PR: `/pr-review`

## Workflow
Expand All @@ -25,12 +36,17 @@ After editing code or docs, you **MUST** run the review command **in the same re
|------------------|----------------|--------------|
| code files | `/codex-review-fast` | `/precommit` |
| `.md` docs | `/codex-review-doc` | (done) |
| Review found issues | Fix all → re-run same review | — |
| Review found **blocking** issues | Fix all → re-run same review | — |
| Review found **sub-threshold** issues | Log `[NIT_DEFERRED]`, do not re-review | continue to the "Then on pass" column |

One reviewer — Codex. `/codex-review-fast` and `/codex-review-doc` do not launch a secondary; `/codex-review-branch --dual` is the only code-review entry point where two reviewers run, and it is off unless the flag is passed. (`/plan-review --dual` is the plan-mode equivalent, also off by default.)

What counts as blocking comes from the **tier** (`fast` P0 · `standard` P0/P1 · `thorough` P0/P1/P2). Unset means `standard`. **80 is a passing grade** — reach for `thorough` when the change is security, data integrity, a release, or public API, not by default.

**Declaring ≠ Executing**: Saying "should run review" without invoking the Skill tool is a violation.
**Summary ≠ Completion**: Outputting a table then stopping is a violation.

Full spec: @rules/auto-loop.md
Full spec: @rules/auto-loop.md (§ Tiers, § Sub-Threshold Findings)

## Test Requirements

Expand All @@ -51,6 +67,8 @@ Coverage: happy path + error handling + edge cases (null, empty, extremes)
| `/feasibility-study` | Feasibility analysis | Requirements |
| `/tech-spec` | Generate tech spec | Design |
| `/review-spec` | Review tech spec | Design |
| `/plan-review` | Pre-ExitPlanMode adversarial plan review loop | Planning |
| `/orchestrate` | Agent-driven workflow planning + read-only fanout (report-only v1) | Planning |
| `/deep-analyze` | Deep analysis + roadmap | Design |
| `/architecture` | Architecture design + 3-architecture.md | Design |
| `/project-brief` | PM/CTO executive summary | Design |
Expand Down Expand Up @@ -139,7 +157,7 @@ Coverage: happy path + error handling + edge cases (null, empty, extremes)
## Development Rules

1. **Reference existing code** -- find similar files first, keep style consistent
2. **Test command** -- `node --test test/**/*.test.js`
2. **Test command** -- `npm test`(`node --test $(find test -name '*.test.js')` — npm scripts 走 `/bin/sh`,`**` glob 不展開巢狀目錄,勿用 `test/**/*.test.js`
3. **Author attribution** -- use developer's GitHub username, never AI names (exception: `/smart-commit --ai-co-author`). Forbidden patterns in commit messages **and PR title/body** (canonical source: `scripts/commit-msg-guard.sh`): Co-Authored-By AI, Generated-by tags, emoji robot tags. Commits: install `commit-msg-guard.sh` via `/install-scripts`. PRs: `/create-pr` Step 4b enforces sanitization automatically.
4. **No auto-commit** -- Claude must not run `git add`, `git commit`, `git push` (exception: `/push-ci` may execute `git push` after user approval; `/smart-commit --execute` may execute `git add` + `git commit` after user approval)

Expand Down
26 changes: 22 additions & 4 deletions CLAUDE.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,21 @@

| Change Type | Must Run | Can Skip |
|-------------|----------|----------|
| code files | `/codex-review-fast` -> `/precommit-fast` | - |
| code files | `/codex-review-fast` -> `/precommit` | - |
| `.md` docs | `/codex-review-doc` | `/codex-review-fast` |
| Comments only | - | All |

> **What the Stop Hook actually enforces**: that *a* precommit gate ran and passed — not *which* variant. `/precommit-fast` skips the build/typecheck step yet satisfies the gate by default. Two settings are needed to make the full variant above actually binding, and each alone is insufficient:
>
> | Setting | Without it |
> |---------|-----------|
> | `PRECOMMIT_REQUIRE_FULL=1` | a passing `mode: fast` (or an unrecorded mode) satisfies the gate |
> | `STOP_GUARD_MODE=strict` | the default `warn` mode prints the missing step to stderr and **still exits 0** |
>
> With both set, the flag is honoured in both of stop-guard's modes: from `precommit.mode` when `.claude_review_state.json` exists, and from the invoked command name (`/precommit` vs `/precommit-fast`) when it falls back to reading the transcript.
>
> Even with both, the flag gates the **command variant**, not the stages that ran: `/precommit` resolves lint / build / test from whatever your manifest actually defines, so a repo with no build script records `full` with no build behind it. The gate proves which command was invoked; it cannot prove which stages existed to run. `/precommit` prints the resolved stages — read them rather than assuming.

Before PR: `/pr-review`

## Workflow
Expand All @@ -23,14 +34,19 @@ After editing code or docs, you **MUST** run the review command **in the same re

| After editing... | Immediately run | Then on pass |
|------------------|----------------|--------------|
| code files | `/codex-review-fast` | `/precommit-fast` |
| code files | `/codex-review-fast` | `/precommit` |
| `.md` docs | `/codex-review-doc` | (done) |
| Review found issues | Fix all -> re-run same review | - |
| Review found **blocking** issues | Fix all -> re-run same review | - |
| Review found **sub-threshold** issues | Log `[NIT_DEFERRED]`, do not re-review | continue to the "Then on pass" column |

One reviewer -- Codex. `/codex-review-fast` and `/codex-review-doc` do not launch a secondary; `/codex-review-branch --dual` is the only code-review entry point where two reviewers run, and it is off unless the flag is passed. (`/plan-review --dual` is the plan-mode equivalent, also off by default.)

What counts as blocking comes from the **tier** (`fast` P0 / `standard` P0+P1 / `thorough` P0+P1+P2). Unset means `standard`. **80 is a passing grade** -- reach for `thorough` when the change is security, data integrity, a release, or public API, not by default.

**Declaring != Executing**: Saying "should run review" without invoking the Skill tool is a violation.
**Summary != Completion**: Outputting a table then stopping is a violation.

Full spec: @rules/auto-loop.md
Full spec: @rules/auto-loop.md (§ Tiers, § Sub-Threshold Findings)

## Test Requirements

Expand Down Expand Up @@ -99,6 +115,8 @@ Coverage: happy path + error handling + edge cases (null, empty, extremes)
| `/feasibility-study` | Feasibility analysis | Requirements |
| `/tech-spec` | Generate tech spec | Design |
| `/review-spec` | Review tech spec | Design |
| `/plan-review` | Pre-ExitPlanMode adversarial plan review loop | Planning |
| `/orchestrate` | Agent-driven workflow planning + read-only fanout (report-only v1) | Planning |
| `/deep-analyze` | Deep analysis + roadmap | Design |
| `/architecture` | Architecture design + 3-architecture.md | Design |
| `/project-brief` | PM/CTO executive summary | Design |
Expand Down
Loading