# @webpieces/ai-hook-rules

> Independent source edit rules and source hook for AI coding agents.

Latest version **0.4.972** (published 2026-10-22) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @webpieces/ai-hook-rules
pnpm add @webpieces/ai-hook-rules
yarn add @webpieces/ai-hook-rules
bun add @webpieces/ai-hook-rules
```

Provides the command `wp-ai-rules-hook`.

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.972 |
| Published | 2026-10-22 |
| First published | 2026-04-20 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 243.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 4 |
| Author | Dean Hiller |
| Maintainers | deanwebpieces |

## Links

- npm: https://www.npmjs.com/package/@webpieces/ai-hook-rules
- Repository: https://github.com/deanhiller/webpieces-ts
- Homepage: https://github.com/deanhiller/webpieces-ts#readme
- Issues: https://github.com/deanhiller/webpieces-ts/issues
- npm.io page: https://npm.io/package/@webpieces/ai-hook-rules

## Dependencies (6)

- [inversify](https://npm.io/package/inversify.md) 7.10.4
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) 0.2.2
- [@webpieces/rules-sdk](https://npm.io/package/@webpieces/rules-sdk.md) 0.4.972
- [@webpieces/hook-runtime](https://npm.io/package/@webpieces/hook-runtime.md) 0.4.972
- [@webpieces/rules-config](https://npm.io/package/@webpieces/rules-config.md) 0.4.972
- [@webpieces/tooling-common](https://npm.io/package/@webpieces/tooling-common.md) 0.4.972

## Recent versions

- 0.4.972 (latest) — 2026-10-22
- 0.4.971 — 2026-10-22
- 0.4.970 — 2026-10-22
- 0.4.969 — 2026-10-21
- 0.4.968 — 2026-10-21
- 0.4.967 — 2026-10-21
- 0.4.966 — 2026-10-21
- 0.4.965 — 2026-10-21
- 0.4.964 — 2026-10-21
- 0.4.963 — 2026-10-21
- 0.4.962 — 2026-10-21
- 0.4.961 — 2026-10-21
- 0.4.960 — 2026-10-21
- 0.4.959 — 2026-10-21
- 0.4.958 — 2026-10-21
- … 823 more at https://npm.io/package/@webpieces/ai-hook-rules/versions

## README

# @webpieces/ai-hook-rules

Source edit validation for AI coding agents, contributed independently to the shared hook runtime.

## In Scope

- The thirteen source rule implementations, including the three source-only rules and ten edit contributions shared in concept with code-rules.
- Source rule registration, custom source rules and match rules.
- `wp-ai-rules-hook`, its source pipeline, and source fixtures and golden tests.

## Out of Scope

- Workflow guards, state, logging and hook installation (agent-workflow-rules).
- Protocol normalization and generic rule evaluation (hook-runtime).
- Git and worktree primitives (repo-workflow-core).
- Config validation (rules-config), committed-diff validation (code-rules), and aggregate packaging (nx-webpieces-rules).

The public source and guard hooks keep their existing binary names. Import shared rule contracts from `@webpieces/hook-runtime`, pure schema/value contracts from `@webpieces/rules-sdk` and concrete configuration types from their owner package, and errors from `@webpieces/tooling-common`. Workflow APIs previously imported from `ai-hook-rules` now belong to `agent-workflow-rules`. OpenClaw composition is provided by the umbrella package.

The committed dispatcher is upgraded from the installed published release; this extraction does not regenerate it from unreleased source.

This pack owns its concrete policy schemas, mode enums, optional tuning, and reviewed seeds. Workflow rule/field retirements and keyless safeguard metadata are published by the workflow owner.

---
_Source: https://npm.io/package/@webpieces/ai-hook-rules · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
