tdd-guard
TDD Guard grew into Probity: the same TDD enforcement, now for Claude Code, Codex, and GitHub Copilot CLI, with more reliable validation and no test reporters to set up. New projects should start there.
Probity forces AI coding agents to follow your rules. It hooks into your agent and checks every file write and shell command before it happens. When an action breaks a rule, Probity blocks it and tells the agent why.
> /plugin marketplace add nizos/probity> /plugin install probity@probity
Repo: nizos/probity
What's inside
Probity forces AI coding agents to follow your rules. It hooks into your agent and checks every file write and shell command before it happens. When an action breaks a rule, Probity blocks it and tells the agent why.
You can use it to enforce Test-Driven Development with the built-in rule, block destructive commands, or keep unwanted patterns out of your code. Writing your own rules takes a few lines of TypeScript, and one config works across most coding agents.
When a rule is broken, the agent sees a reason and a path forward:
Probity: you're adding production code before a failing test has been
observed.
The next TDD-legal step is to add one focused test in src/cart.test.ts
and run it to a clean assertion failure before implementing only the
minimum code to pass it.
The agent corrects course and continues.
Rules can be deterministic, matching commands or file content by string or regex, or AI-validated using official SDKs. Both kinds can read recent session activity, so actions are judged in context.
npm install -D @nizos/probity
Create probity.config.ts at your project root:
import { defineConfig, enforceTdd } from '@nizos/probity'
export default defineConfig({
rules: [
{
files: ['src/**', 'test/**'],
rules: [enforceTdd()],
},
],
})
Then wire it into your agent. One-time setup per agent.
enforceTdd(): failing test first, minimal implementation, refactor on greenforbidCommandPattern(): block shell commands by patternrequireCommand(): require a prior command (e.g. tests before commit)forbidContentPattern(): block writes containing a patternenforceFilenameCasing(): enforce a filename casing styleDoes it work with my agent? Probity currently works with Claude Code, Codex, and GitHub Copilot CLI, with more coming.
Does it work with my language? Probity reads each agent's session transcript directly, so there are no per-framework reporters to install. It works with any language and test runner that your agent can work with.
Does Probity need its own API key or subscription? No. AI-validated rules use each vendor's official SDK and reuse whatever authentication your agent already has, so Probity doesn't require its own access or billing.
I'm already using TDD Guard. Should I switch? Yes. Probity handles refactors and multi-step edits more reliably, is safe with parallel sessions, and supports more agents. See Migrating from TDD Guard.
Contributions are welcome. See the contributing guidelines to get started.
.claude/
.claude-plugin/
marketplace.json
plugin.json
settings.json
.commitlintrc.json
.devcontainer/
devcontainer.json
Dockerfile
README.md
.github/
workflows/
ci.yml
security.yml
.gitignore
.husky/
commit-msg
pre-commit
.prettierignore
.prettierrc.json
CLAUDE.md
CONTRIBUTING.md
docs/
adr/
0001-per-vendor-adapter-anti-corruption-layer.md
0002-walk-up-from-cwd-to-discover-config.md
0003-session-history-via-host-transcript.md
0004-action-path-absolute-posix.md
0005-anchor-files-globs-at-config-directory.md
0006-optional-peer-deps-for-tdd-fast-path.md
0007-normalize-vendor-edits-to-write.md
0008-rule-context-readfile-capability.md
0009-outcome-value-type-and-evaluate-hooks.md
0010-validate-rule-results-at-the-contract.md
assets/
probity-tdd-demo.gif
configuration.md
migrating-from-tdd-guard.md
rules.md
setup.md
eslint.config.js
hooks/
hooks.json
LICENSE
package-lock.json
package.json
probity.config.ts
README.md
src/
agent-call-collector.test.ts
agent-call-collector.ts
bin.test.ts
bin.ts
cli.test.ts
cli.ts
config.test.ts
config.ts
engine.test.ts
engine.ts
index.ts
registry.test.ts
registry.ts
rules/
contract.test.ts
contract.ts
enforce-filename-casing.test.ts
enforce-filename-casing.ts
enforce-tdd.test.ts
enforce-tdd.ts
factory-naming.test.ts
forbid-command-pattern.test.ts
forbid-command-pattern.ts
forbid-content-pattern.test.ts
forbid-content-pattern.ts
index.ts
matchers/
count-new-test-nodes.test.ts
count-new-test-nodes.ts
languages/
csharp.ts
index.test.ts
index.ts
javascript.ts
php.ts
python.ts
register.test.ts
register.ts
ruby.ts
typescript.ts
require-command.test.ts
require-command.ts
trim-history.test.ts
trim-history.ts
utils/
match-paths.test.ts
match-paths.ts
string-or-regex-matches.test.ts
string-or-regex-matches.ts
types.ts
utils/
json-string.test.ts
json-string.ts
parse-args.test.ts
parse-args.ts
parse-as.test.ts
parse-as.ts
read-capped.test.ts
read-capped.ts
read-jsonl.test.ts
read-jsonl.ts
safe-read.test.ts
safe-read.ts
vendors/
adapter.test.ts
adapter.ts
antigravity-cli/
adapter.test.ts
adapter.ts
event.test.ts
event.ts
transcript.test.ts
transcript.ts
apply-edit.test.ts
apply-edit.ts
claude-code/
adapter.test.ts
adapter.ts
agent.test.ts
agent.ts
event.test.ts
event.ts
transcript.test.ts
transcript.ts
codex/
adapter.test.ts
adapter.ts
agent.test.ts
agent.ts
event.test.ts
event.ts
transcript.test.ts
transcript.ts
github-copilot/
github-copilot-chat/
adapter.test.ts
adapter.ts
event.test.ts
event.ts
transcript.test.ts
transcript.ts
adapter.test.ts
adapter.ts
agent.test.ts
agent.ts
event.test.ts
event.ts
transcript.test.ts
transcript.ts
posix-absolute.test.ts
posix-absolute.ts
relativize-path.test.ts
relativize-path.ts
to-verdict.test.ts
to-verdict.ts
test/
fixtures/
antigravity-cli/
real-session.jsonl
claude-code/
bash-npm-install.json
write-kebab-case.json
write-new-file.json
codex/
post-bash-pwd.json
pre-apply-patch.json
pre-bash-pwd.json
session-start.json
user-prompt-submit.json
config/
discovery/
discovery-js/
probity.config.js
probity.config.ts
subdir/
.gitkeep
empty.config.ts
configs/
blocks.config.ts
kebab-only.config.ts
negation-double-star.config.ts
negation.config.ts
github-copilot/
github-copilot-chat/
chatsession-direct-id.jsonl
chatsession-resumed.jsonl
chatsession-sample.jsonl
chatsession-unmatched.jsonl
chatSessions/
derive-test.jsonl
GitHub.copilot-chat/
transcripts/
derive-test.jsonl
pre-create-file.json
pre-list-dir.json
pre-read-file.json
pre-replace-string-in-file.json
pre-run-in-terminal.json
transcript-direct-id.jsonl
transcript-resumed.jsonl
transcript-sample.jsonl
pre-bash-npm-test.json
pre-create-new-test.json
pre-edit-add-subtract.json
pre-report-intent.json
pre-view-calculator.json
session-start.json
user-prompt-submitted.json
transcripts/
bad-tool-use.jsonl
basic.jsonl
codex-basic.jsonl
codex-tdd-cycle-completed.jsonl
codex-tdd-no-test-run.jsonl
codex-tdd-test-failed.jsonl
copilot-basic.jsonl
copilot-tdd-clean.jsonl
copilot-tdd-cycle-completed.jsonl
copilot-tdd-no-test-run.jsonl
interleaved.jsonl
invoice-green-in-steps.jsonl
invoice-refactor-in-steps.jsonl
ledger-borderline-refactor.jsonl
non-object-content.jsonl
override-agent-clear.jsonl
override-agent-feedback.jsonl
override-user.jsonl
summarize-refactor-skipped.jsonl
tdd-clean.jsonl
tdd-cycle-completed.jsonl
tdd-no-test-run.jsonl
tdd-noisy-buried-failure.jsonl
tdd-over-impl.jsonl
tdd-prior-block-not-in-rules.jsonl
tdd-remove-used-fn.jsonl
tool-result-array-content.jsonl
with-malformed-line.jsonl
helpers/
auth-patterns.ts
decode-response.ts
invoice-fixtures.ts
ledger-fixtures.ts
override-fixtures.ts
preflight-auth.test.ts
preflight-auth.ts
run-bin.test.ts
run-bin.ts
sandbox.test.ts
sandbox.ts
summarize-fixtures.ts
tdd-fixtures.ts
write-actions.ts
integration/
cli.e2e.test.ts
enforce-tdd-claude-code.test.ts
enforce-tdd-codex.test.ts
enforce-tdd-copilot.test.ts
require-command-copilot-chat.test.ts
require-command-copilot.test.ts
scenarios.e2e.test.ts
tsconfig.build.json
tsconfig.jsonFAQ
probity is a Claude Code plugin with hand-picked skills for hooks work, indexed on Flowy. Install it with the command on its page. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.