agent-quality-police 0.2.7 → 0.2.9
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/.agents/skills/anti-bypass-audit/SKILL.md +3 -0
- package/.agents/skills/quality-index/SKILL.md +3 -1
- package/.claude/agents/bypass-auditor.md +4 -1
- package/.claude/agents/implementer.md +7 -2
- package/.claude/agents/pr-gatekeeper.md +1 -1
- package/.claude/agents/tdd-warden.md +1 -1
- package/.claude/rules/review-and-gates.md +2 -0
- package/.claude/rules/typescript-zero-bypass.md +3 -1
- package/.claude/skills/anti-bypass-audit/SKILL.md +3 -0
- package/.claude/skills/quality-index/SKILL.md +3 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex/agents/bypass-auditor.toml +4 -1
- package/.codex/agents/implementer.toml +7 -2
- package/.codex/agents/pr-gatekeeper.toml +1 -1
- package/.codex/agents/tdd-warden.toml +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.opencode/agents/bypass-auditor.md +4 -1
- package/.opencode/agents/implementer.md +7 -2
- package/.opencode/agents/pr-gatekeeper.md +1 -1
- package/.opencode/agents/tdd-warden.md +1 -1
- package/.opencode/skills/anti-bypass-audit/SKILL.md +3 -0
- package/.opencode/skills/quality-index/SKILL.md +3 -1
- package/CLAUDE.md +15 -7
- package/docs/policy/quality-definition.md +5 -1
- package/docs/policy/workflow.md +2 -0
- package/lib/install.mjs +16 -8
- package/package.json +1 -1
|
@@ -40,6 +40,9 @@ Find and report bypasses with short, evidence-based language. This skill is not
|
|
|
40
40
|
- `eslint-disable`
|
|
41
41
|
- lowered strictness in config
|
|
42
42
|
- fake narrowing branches
|
|
43
|
+
- constructor bypass
|
|
44
|
+
- prototype fabrication
|
|
45
|
+
- internal field hydration that fakes a valid class instance
|
|
43
46
|
- helper or factory noise hiding test intent
|
|
44
47
|
- mocks that replace the behavior under test
|
|
45
48
|
|
|
@@ -23,7 +23,8 @@ Use this skill as the entry point to the framework. It maps task types to the ri
|
|
|
23
23
|
2. Read `docs/policy/workflow.md`.
|
|
24
24
|
3. Classify the task.
|
|
25
25
|
4. Load only the skills required by that task.
|
|
26
|
-
5.
|
|
26
|
+
5. Decide which audit agents are mandatory before implementation is considered complete.
|
|
27
|
+
6. Require the named audit agents to run before final approval.
|
|
27
28
|
|
|
28
29
|
## Routing
|
|
29
30
|
|
|
@@ -51,6 +52,7 @@ Use this skill as the entry point to the framework. It maps task types to the ri
|
|
|
51
52
|
- Loading every skill by default.
|
|
52
53
|
- Starting implementation before deciding what behavior must be proven.
|
|
53
54
|
- Skipping the auditors because the change “looks small.”
|
|
55
|
+
- Treating inline self-review as a substitute for invoking the named audit agents.
|
|
54
56
|
|
|
55
57
|
## Examples
|
|
56
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bypass-auditor
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use proactively before final approval for any typing, config, mock, helper, or suspicious diff review."
|
|
4
4
|
tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Glob
|
|
@@ -33,6 +33,9 @@ You must actively hunt for:
|
|
|
33
33
|
- `eslint-disable`
|
|
34
34
|
- config weakening
|
|
35
35
|
- fake narrowing or artificial fallback branches
|
|
36
|
+
- constructor bypass
|
|
37
|
+
- prototype fabrication such as `Object.create(SomeClass.prototype)`
|
|
38
|
+
- internal field hydration such as `Object.assign(...)` into fabricated instances
|
|
36
39
|
- helper noise
|
|
37
40
|
- mocks with no probative value
|
|
38
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: implementer
|
|
3
|
-
description: "Executes approved code changes under the framework
|
|
3
|
+
description: "Executes approved code changes under the framework and hands off to the required audit agents before completion."
|
|
4
4
|
tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Write
|
|
@@ -31,7 +31,10 @@ Required behavior:
|
|
|
31
31
|
2. If tests are viable, follow Red -> Green -> Refactor.
|
|
32
32
|
3. Make the smallest defensible change.
|
|
33
33
|
4. If canonical skill or agent sources change, rebuild generated projections instead of editing generated files by hand.
|
|
34
|
-
5.
|
|
34
|
+
5. Explicitly invoke the required audit agents before claiming the work is complete.
|
|
35
|
+
6. Treat inline self-review as insufficient when a named audit agent is required.
|
|
36
|
+
7. If a required audit agent cannot run, stop and report `BLOCKED`.
|
|
37
|
+
8. Report what behavior was proven, which audit agents ran, what commands were run, and what remains blocked.
|
|
35
38
|
|
|
36
39
|
Forbidden behavior:
|
|
37
40
|
|
|
@@ -39,6 +42,8 @@ Forbidden behavior:
|
|
|
39
42
|
- introducing assertions, non-null assertions, or ts-comment bypasses
|
|
40
43
|
- muting lint or type errors through configuration weakening
|
|
41
44
|
- adding fake fallback branches or fake narrowing only to satisfy the compiler
|
|
45
|
+
- fabricating typed instances through `Object.create(SomeClass.prototype)` or equivalent prototype tricks
|
|
46
|
+
- hydrating internal fields with `Object.assign(...)` or direct writes to bypass constructors or public factories
|
|
42
47
|
- hiding test intent behind generic helpers
|
|
43
48
|
|
|
44
49
|
If the request conflicts with the policy, reject the shortcut and explain the blocker.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: tdd-warden
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use proactively before final approval whenever behavior changed, tests changed, or tests should have changed."
|
|
4
4
|
tools:
|
|
5
5
|
- Read
|
|
6
6
|
- Glob
|
|
@@ -3,5 +3,7 @@
|
|
|
3
3
|
- Run `tdd-warden` for behavior and TDD verification when tests changed or should have changed.
|
|
4
4
|
- Run `bypass-auditor` for any TypeScript, lint, config, mock, helper, or suspicious review surface.
|
|
5
5
|
- Run `pr-gatekeeper` before publishing or claiming approval.
|
|
6
|
+
- Inline self-review does not replace invoking the named audit agents.
|
|
7
|
+
- If a required audit agent cannot run, report `BLOCKED` instead of claiming completion.
|
|
6
8
|
- Auditor outputs must be concrete, short, evidence-based, and severe.
|
|
7
9
|
- A reviewer who cannot prove safety must reject the change.
|
|
@@ -7,8 +7,10 @@ paths:
|
|
|
7
7
|
|
|
8
8
|
- Prohibit `any`, `as`, `as const`, chained assertions, angle-bracket assertions, and non-null assertions.
|
|
9
9
|
- Prohibit `@ts-ignore`, `@ts-expect-error`, `@ts-nocheck`, and `@ts-check` as escape hatches.
|
|
10
|
-
- Prohibit inline structural types.
|
|
10
|
+
- Prohibit inline structural types, including in private methods, local helpers, and return types.
|
|
11
11
|
- Require named interfaces and named unions instead of inline structural types.
|
|
12
|
+
- Prohibit `Object.create(SomeClass.prototype)` and equivalent prototype fabrication to fake typed instances.
|
|
13
|
+
- Prohibit `Object.assign(...)` or direct internal field hydration when used to bypass constructors, factories, or invariants.
|
|
12
14
|
- Reject `Record` and index signatures when they are used as generic escape hatches.
|
|
13
15
|
- Do not add branches or fallback values solely to satisfy the compiler.
|
|
14
16
|
- If the type system is resisting, remodel the data instead of coercing it.
|
|
@@ -40,6 +40,9 @@ Find and report bypasses with short, evidence-based language. This skill is not
|
|
|
40
40
|
- `eslint-disable`
|
|
41
41
|
- lowered strictness in config
|
|
42
42
|
- fake narrowing branches
|
|
43
|
+
- constructor bypass
|
|
44
|
+
- prototype fabrication
|
|
45
|
+
- internal field hydration that fakes a valid class instance
|
|
43
46
|
- helper or factory noise hiding test intent
|
|
44
47
|
- mocks that replace the behavior under test
|
|
45
48
|
|
|
@@ -23,7 +23,8 @@ Use this skill as the entry point to the framework. It maps task types to the ri
|
|
|
23
23
|
2. Read `docs/policy/workflow.md`.
|
|
24
24
|
3. Classify the task.
|
|
25
25
|
4. Load only the skills required by that task.
|
|
26
|
-
5.
|
|
26
|
+
5. Decide which audit agents are mandatory before implementation is considered complete.
|
|
27
|
+
6. Require the named audit agents to run before final approval.
|
|
27
28
|
|
|
28
29
|
## Routing
|
|
29
30
|
|
|
@@ -51,6 +52,7 @@ Use this skill as the entry point to the framework. It maps task types to the ri
|
|
|
51
52
|
- Loading every skill by default.
|
|
52
53
|
- Starting implementation before deciding what behavior must be proven.
|
|
53
54
|
- Skipping the auditors because the change “looks small.”
|
|
55
|
+
- Treating inline self-review as a substitute for invoking the named audit agents.
|
|
54
56
|
|
|
55
57
|
## Examples
|
|
56
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by scripts/build_framework.py; do not edit directly
|
|
2
2
|
name = "bypass-auditor"
|
|
3
|
-
description = "
|
|
3
|
+
description = "Use proactively before final approval for any typing, config, mock, helper, or suspicious diff review."
|
|
4
4
|
model = "gpt-5.4-mini"
|
|
5
5
|
model_reasoning_effort = "high"
|
|
6
6
|
sandbox_mode = "read-only"
|
|
@@ -27,6 +27,9 @@ You must actively hunt for:
|
|
|
27
27
|
- `eslint-disable`
|
|
28
28
|
- config weakening
|
|
29
29
|
- fake narrowing or artificial fallback branches
|
|
30
|
+
- constructor bypass
|
|
31
|
+
- prototype fabrication such as `Object.create(SomeClass.prototype)`
|
|
32
|
+
- internal field hydration such as `Object.assign(...)` into fabricated instances
|
|
30
33
|
- helper noise
|
|
31
34
|
- mocks with no probative value
|
|
32
35
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by scripts/build_framework.py; do not edit directly
|
|
2
2
|
name = "implementer"
|
|
3
|
-
description = "Executes approved code changes under the framework
|
|
3
|
+
description = "Executes approved code changes under the framework and hands off to the required audit agents before completion."
|
|
4
4
|
model = "gpt-5.3-codex-spark"
|
|
5
5
|
model_reasoning_effort = "medium"
|
|
6
6
|
sandbox_mode = "workspace-write"
|
|
@@ -20,7 +20,10 @@ Required behavior:
|
|
|
20
20
|
2. If tests are viable, follow Red -> Green -> Refactor.
|
|
21
21
|
3. Make the smallest defensible change.
|
|
22
22
|
4. If canonical skill or agent sources change, rebuild generated projections instead of editing generated files by hand.
|
|
23
|
-
5.
|
|
23
|
+
5. Explicitly invoke the required audit agents before claiming the work is complete.
|
|
24
|
+
6. Treat inline self-review as insufficient when a named audit agent is required.
|
|
25
|
+
7. If a required audit agent cannot run, stop and report `BLOCKED`.
|
|
26
|
+
8. Report what behavior was proven, which audit agents ran, what commands were run, and what remains blocked.
|
|
24
27
|
|
|
25
28
|
Forbidden behavior:
|
|
26
29
|
|
|
@@ -28,6 +31,8 @@ Forbidden behavior:
|
|
|
28
31
|
- introducing assertions, non-null assertions, or ts-comment bypasses
|
|
29
32
|
- muting lint or type errors through configuration weakening
|
|
30
33
|
- adding fake fallback branches or fake narrowing only to satisfy the compiler
|
|
34
|
+
- fabricating typed instances through `Object.create(SomeClass.prototype)` or equivalent prototype tricks
|
|
35
|
+
- hydrating internal fields with `Object.assign(...)` or direct writes to bypass constructors or public factories
|
|
31
36
|
- hiding test intent behind generic helpers
|
|
32
37
|
|
|
33
38
|
If the request conflicts with the policy, reject the shortcut and explain the blocker.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by scripts/build_framework.py; do not edit directly
|
|
2
2
|
name = "pr-gatekeeper"
|
|
3
|
-
description = "
|
|
3
|
+
description = "Use proactively as the final approve-or-reject gate after the other required auditors complete."
|
|
4
4
|
model = "gpt-5.4"
|
|
5
5
|
model_reasoning_effort = "high"
|
|
6
6
|
sandbox_mode = "read-only"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# generated by scripts/build_framework.py; do not edit directly
|
|
2
2
|
name = "tdd-warden"
|
|
3
|
-
description = "
|
|
3
|
+
description = "Use proactively before final approval whenever behavior changed, tests changed, or tests should have changed."
|
|
4
4
|
model = "gpt-5.4-mini"
|
|
5
5
|
model_reasoning_effort = "high"
|
|
6
6
|
sandbox_mode = "read-only"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- generated by scripts/build_framework.py; do not edit directly -->
|
|
2
2
|
---
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use proactively before final approval for any typing, config, mock, helper, or suspicious diff review."
|
|
4
4
|
mode: subagent
|
|
5
5
|
model: anthropic/claude-sonnet-4-20250514
|
|
6
6
|
temperature: 0.0
|
|
@@ -31,6 +31,9 @@ You must actively hunt for:
|
|
|
31
31
|
- `eslint-disable`
|
|
32
32
|
- config weakening
|
|
33
33
|
- fake narrowing or artificial fallback branches
|
|
34
|
+
- constructor bypass
|
|
35
|
+
- prototype fabrication such as `Object.create(SomeClass.prototype)`
|
|
36
|
+
- internal field hydration such as `Object.assign(...)` into fabricated instances
|
|
34
37
|
- helper noise
|
|
35
38
|
- mocks with no probative value
|
|
36
39
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- generated by scripts/build_framework.py; do not edit directly -->
|
|
2
2
|
---
|
|
3
|
-
description: "Executes approved code changes under the framework
|
|
3
|
+
description: "Executes approved code changes under the framework and hands off to the required audit agents before completion."
|
|
4
4
|
mode: subagent
|
|
5
5
|
model: anthropic/claude-sonnet-4-20250514
|
|
6
6
|
temperature: 0.1
|
|
@@ -24,7 +24,10 @@ Required behavior:
|
|
|
24
24
|
2. If tests are viable, follow Red -> Green -> Refactor.
|
|
25
25
|
3. Make the smallest defensible change.
|
|
26
26
|
4. If canonical skill or agent sources change, rebuild generated projections instead of editing generated files by hand.
|
|
27
|
-
5.
|
|
27
|
+
5. Explicitly invoke the required audit agents before claiming the work is complete.
|
|
28
|
+
6. Treat inline self-review as insufficient when a named audit agent is required.
|
|
29
|
+
7. If a required audit agent cannot run, stop and report `BLOCKED`.
|
|
30
|
+
8. Report what behavior was proven, which audit agents ran, what commands were run, and what remains blocked.
|
|
28
31
|
|
|
29
32
|
Forbidden behavior:
|
|
30
33
|
|
|
@@ -32,6 +35,8 @@ Forbidden behavior:
|
|
|
32
35
|
- introducing assertions, non-null assertions, or ts-comment bypasses
|
|
33
36
|
- muting lint or type errors through configuration weakening
|
|
34
37
|
- adding fake fallback branches or fake narrowing only to satisfy the compiler
|
|
38
|
+
- fabricating typed instances through `Object.create(SomeClass.prototype)` or equivalent prototype tricks
|
|
39
|
+
- hydrating internal fields with `Object.assign(...)` or direct writes to bypass constructors or public factories
|
|
35
40
|
- hiding test intent behind generic helpers
|
|
36
41
|
|
|
37
42
|
If the request conflicts with the policy, reject the shortcut and explain the blocker.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- generated by scripts/build_framework.py; do not edit directly -->
|
|
2
2
|
---
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use proactively as the final approve-or-reject gate after the other required auditors complete."
|
|
4
4
|
mode: subagent
|
|
5
5
|
model: anthropic/claude-opus-4-1-20250805
|
|
6
6
|
temperature: 0.0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<!-- generated by scripts/build_framework.py; do not edit directly -->
|
|
2
2
|
---
|
|
3
|
-
description: "
|
|
3
|
+
description: "Use proactively before final approval whenever behavior changed, tests changed, or tests should have changed."
|
|
4
4
|
mode: subagent
|
|
5
5
|
model: anthropic/claude-sonnet-4-20250514
|
|
6
6
|
temperature: 0.0
|
|
@@ -40,6 +40,9 @@ Find and report bypasses with short, evidence-based language. This skill is not
|
|
|
40
40
|
- `eslint-disable`
|
|
41
41
|
- lowered strictness in config
|
|
42
42
|
- fake narrowing branches
|
|
43
|
+
- constructor bypass
|
|
44
|
+
- prototype fabrication
|
|
45
|
+
- internal field hydration that fakes a valid class instance
|
|
43
46
|
- helper or factory noise hiding test intent
|
|
44
47
|
- mocks that replace the behavior under test
|
|
45
48
|
|
|
@@ -23,7 +23,8 @@ Use this skill as the entry point to the framework. It maps task types to the ri
|
|
|
23
23
|
2. Read `docs/policy/workflow.md`.
|
|
24
24
|
3. Classify the task.
|
|
25
25
|
4. Load only the skills required by that task.
|
|
26
|
-
5.
|
|
26
|
+
5. Decide which audit agents are mandatory before implementation is considered complete.
|
|
27
|
+
6. Require the named audit agents to run before final approval.
|
|
27
28
|
|
|
28
29
|
## Routing
|
|
29
30
|
|
|
@@ -51,6 +52,7 @@ Use this skill as the entry point to the framework. It maps task types to the ri
|
|
|
51
52
|
- Loading every skill by default.
|
|
52
53
|
- Starting implementation before deciding what behavior must be proven.
|
|
53
54
|
- Skipping the auditors because the change “looks small.”
|
|
55
|
+
- Treating inline self-review as a substitute for invoking the named audit agents.
|
|
54
56
|
|
|
55
57
|
## Examples
|
|
56
58
|
|
package/CLAUDE.md
CHANGED
|
@@ -4,33 +4,41 @@
|
|
|
4
4
|
|
|
5
5
|
- Direct system, developer, and user instructions override this file.
|
|
6
6
|
- Prefer current local code and current official documentation over memory.
|
|
7
|
-
-
|
|
7
|
+
- Treat the required skills and auditors in this file as mandatory workflow requirements.
|
|
8
8
|
|
|
9
9
|
## Startup Sequence
|
|
10
10
|
|
|
11
11
|
1. Read [quality-definition](docs/policy/quality-definition.md) when the task needs repository policy context.
|
|
12
12
|
2. Read [workflow](docs/policy/workflow.md) when the repository defines one.
|
|
13
|
-
3. Load
|
|
13
|
+
3. Load the smallest required skill set from `.claude/skills/` before proposing edits or writing code.
|
|
14
14
|
|
|
15
15
|
## Skill Routing
|
|
16
16
|
|
|
17
|
-
- Use [quality-index](.claude/skills/quality-index/SKILL.md) when the task spans multiple concerns.
|
|
17
|
+
- Use [quality-index](.claude/skills/quality-index/SKILL.md) when the task spans multiple concerns or when you are unsure which validators apply.
|
|
18
18
|
- Use [typescript-zero-bypass](.claude/skills/typescript-zero-bypass/SKILL.md) for `.ts` or `.tsx` changes.
|
|
19
19
|
- Use [vite-vitest-tdd](.claude/skills/vite-vitest-tdd/SKILL.md) for Vite or Vitest TDD.
|
|
20
20
|
- Use [react-public-api-testing](.claude/skills/react-public-api-testing/SKILL.md) for React behavior tests.
|
|
21
|
+
- Use [anti-bypass-audit](.claude/skills/anti-bypass-audit/SKILL.md) when reviewing diffs, suspicious helpers, weakened configs, or type/config-heavy changes.
|
|
22
|
+
- Use [refactoring-with-safety](.claude/skills/refactoring-with-safety/SKILL.md) for refactors that are not pure bug fixes.
|
|
23
|
+
- Use [governance-installation](.claude/skills/governance-installation/SKILL.md) when installing or updating this governance package.
|
|
21
24
|
|
|
22
25
|
## Quality Rules
|
|
23
26
|
|
|
27
|
+
- Load the required skills before proposing edits or writing code.
|
|
28
|
+
- If a required skill is unavailable in the current runtime, stop and report `BLOCKED`.
|
|
24
29
|
- Use behavior-first tests when tests are viable.
|
|
25
30
|
- Avoid type bypasses, comment bypasses, config weakening, and fake greens.
|
|
26
31
|
- Prefer named types and explicit models over inline structural shortcuts.
|
|
27
32
|
|
|
28
33
|
## Review Flow
|
|
29
34
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
35
|
+
- For code changes, explicitly invoke the required auditors before final approval.
|
|
36
|
+
- For code changes, do not finalize until the required auditors have run and their results were reviewed.
|
|
37
|
+
- Do not substitute inline self-review for a required audit agent invocation.
|
|
38
|
+
- For typing, config, mocks, helpers, or suspicious diffs, run `bypass-auditor`.
|
|
39
|
+
- For behavior changes or bug fixes, run `tdd-warden` and `bypass-auditor`.
|
|
40
|
+
- For final approval, release, or merge decisions, run `pr-gatekeeper` after the other required auditors.
|
|
41
|
+
- If a required skill or auditor cannot run in the current runtime, stop and report `BLOCKED`.
|
|
34
42
|
|
|
35
43
|
## Claude Code
|
|
36
44
|
|
|
@@ -51,6 +51,8 @@ Fraud includes:
|
|
|
51
51
|
- disabling ESLint to suppress a local violation
|
|
52
52
|
- weakening `tsconfig`, `eslint`, `vite`, `vitest`, or equivalent config to silence a problem
|
|
53
53
|
- adding impossible fallback branches, fake narrowing, or defensive code only to satisfy TypeScript
|
|
54
|
+
- constructor bypass through `Object.create(SomeClass.prototype)` or equivalent prototype fabrication
|
|
55
|
+
- internal field hydration through `Object.assign(...)` or direct assignment to simulate a valid instance without using the real constructor or public factory
|
|
54
56
|
- using `Map` in public or domain-facing contracts to avoid explicit named input modeling
|
|
55
57
|
- helper layers that hide what the test is proving
|
|
56
58
|
- mocks that replace the exact behavior under test
|
|
@@ -66,6 +68,7 @@ Reject immediately when a diff introduces any of the following without an explic
|
|
|
66
68
|
- unproven tests
|
|
67
69
|
- suspicious helper noise
|
|
68
70
|
- narrowing that exists only to appease the compiler
|
|
71
|
+
- constructor bypasses, prototype fabrication, or internal field hydration that fabricate class instances without their real invariants
|
|
69
72
|
- branching that changes runtime semantics without product or domain justification
|
|
70
73
|
|
|
71
74
|
## Safe Refactor
|
|
@@ -94,12 +97,13 @@ Acceptable modeling favors:
|
|
|
94
97
|
- Zod only for external input boundaries
|
|
95
98
|
- Joi only for environment validation when that boundary exists and matters
|
|
96
99
|
|
|
97
|
-
Inline structural types are prohibited.
|
|
100
|
+
Inline structural types are prohibited, including private methods, local helpers, and return types.
|
|
98
101
|
|
|
99
102
|
Unacceptable modeling includes:
|
|
100
103
|
|
|
101
104
|
- anonymous structural types in signatures
|
|
102
105
|
- inline structural types in local declarations when a named concept exists
|
|
106
|
+
- inline structural object return types such as `(): { completed: number; total: number }`
|
|
103
107
|
- `Record` or index signatures as generic escape hatches
|
|
104
108
|
- `Map` used as a lookup-bag escape hatch in a public or domain-facing contract
|
|
105
109
|
- generic “utils” that absorb domain meaning
|
package/docs/policy/workflow.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
7. Run the appropriate audit agents.
|
|
12
12
|
8. Validate the repository before commit or publication.
|
|
13
13
|
|
|
14
|
+
Inline self-review does not satisfy an audit requirement. When an audit agent is required, invoke the named agent. If the required agent cannot run, report `BLOCKED` instead of claiming completion.
|
|
15
|
+
|
|
14
16
|
## Required Audit Pairing
|
|
15
17
|
|
|
16
18
|
- TypeScript or config-heavy change: run `bypass-auditor`.
|
package/lib/install.mjs
CHANGED
|
@@ -89,29 +89,37 @@ function globalPolicySections() {
|
|
|
89
89
|
priorityBody: [
|
|
90
90
|
"- Direct system, developer, and user instructions override this file.",
|
|
91
91
|
"- Prefer current local code and current official documentation over memory.",
|
|
92
|
-
"-
|
|
92
|
+
"- Treat the required skills and auditors in this file as mandatory workflow requirements."
|
|
93
93
|
].join("\n"),
|
|
94
94
|
startupSequenceBody: [
|
|
95
95
|
"1. Read [quality-definition]({{quality_definition_path}}) when the task needs repository policy context.",
|
|
96
96
|
"2. Read [workflow]({{workflow_path}}) when the repository defines one.",
|
|
97
|
-
"3. Load
|
|
97
|
+
"3. Load the smallest required skill set from `{{primary_skill_root}}` before proposing edits or writing code."
|
|
98
98
|
].join("\n"),
|
|
99
99
|
skillRoutingBody: [
|
|
100
|
-
"- Use [quality-index]({{quality_index_skill_path}}) when the task spans multiple concerns.",
|
|
100
|
+
"- Use [quality-index]({{quality_index_skill_path}}) when the task spans multiple concerns or when you are unsure which validators apply.",
|
|
101
101
|
"- Use [typescript-zero-bypass]({{typescript_zero_bypass_skill_path}}) for `.ts` or `.tsx` changes.",
|
|
102
102
|
"- Use [vite-vitest-tdd]({{vite_vitest_tdd_skill_path}}) for Vite or Vitest TDD.",
|
|
103
|
-
"- Use [react-public-api-testing]({{react_public_api_testing_skill_path}}) for React behavior tests."
|
|
103
|
+
"- Use [react-public-api-testing]({{react_public_api_testing_skill_path}}) for React behavior tests.",
|
|
104
|
+
"- Use [anti-bypass-audit]({{anti_bypass_audit_skill_path}}) when reviewing diffs, suspicious helpers, weakened configs, or type/config-heavy changes.",
|
|
105
|
+
"- Use [refactoring-with-safety]({{refactoring_with_safety_skill_path}}) for refactors that are not pure bug fixes.",
|
|
106
|
+
"- Use [governance-installation]({{governance_installation_skill_path}}) when installing or updating this governance package."
|
|
104
107
|
].join("\n"),
|
|
105
108
|
qualityRulesBody: [
|
|
109
|
+
"- Load the required skills before proposing edits or writing code.",
|
|
110
|
+
"- If a required skill is unavailable in the current runtime, stop and report `BLOCKED`.",
|
|
106
111
|
"- Use behavior-first tests when tests are viable.",
|
|
107
112
|
"- Avoid type bypasses, comment bypasses, config weakening, and fake greens.",
|
|
108
113
|
"- Prefer named types and explicit models over inline structural shortcuts."
|
|
109
114
|
].join("\n"),
|
|
110
115
|
reviewFlowBody: [
|
|
111
|
-
"-
|
|
112
|
-
"-
|
|
113
|
-
"-
|
|
114
|
-
"-
|
|
116
|
+
"- For code changes, explicitly invoke the required auditors before final approval.",
|
|
117
|
+
"- For code changes, do not finalize until the required auditors have run and their results were reviewed.",
|
|
118
|
+
"- Do not substitute inline self-review for a required audit agent invocation.",
|
|
119
|
+
"- For typing, config, mocks, helpers, or suspicious diffs, run `bypass-auditor`.",
|
|
120
|
+
"- For behavior changes or bug fixes, run `tdd-warden` and `bypass-auditor`.",
|
|
121
|
+
"- For final approval, release, or merge decisions, run `pr-gatekeeper` after the other required auditors.",
|
|
122
|
+
"- If a required skill or auditor cannot run in the current runtime, stop and report `BLOCKED`."
|
|
115
123
|
].join("\n")
|
|
116
124
|
};
|
|
117
125
|
}
|