@bookedsolid/reagent 0.1.0
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/LICENSE +21 -0
- package/README.md +118 -0
- package/agents/reagent-orchestrator.md +66 -0
- package/bin/init.js +818 -0
- package/commands/rea.md +76 -0
- package/commands/restart.md +105 -0
- package/cursor/rules/001-no-hallucination.mdc +28 -0
- package/cursor/rules/002-verify-before-act.mdc +28 -0
- package/cursor/rules/003-attribution.mdc +36 -0
- package/hooks/attribution-advisory.sh +74 -0
- package/hooks/dangerous-bash-interceptor.sh +287 -0
- package/hooks/env-file-protection.sh +110 -0
- package/hooks/secret-scanner.sh +229 -0
- package/husky/commit-msg.sh +50 -0
- package/husky/pre-commit.sh +57 -0
- package/husky/pre-push.sh +75 -0
- package/package.json +60 -0
- package/profiles/bst-internal.json +30 -0
- package/profiles/client-engagement.json +30 -0
- package/templates/CLAUDE.md +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Booked Solid Technology (Clarity House LLC)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# @bookedsolid/reagent
|
|
2
|
+
|
|
3
|
+
Zero-trust agentic infrastructure for AI-assisted development.
|
|
4
|
+
|
|
5
|
+
Reagent installs safety hooks, behavioral policies, and developer tooling into any project — enforcing zero-trust principles across AI agent operations.
|
|
6
|
+
|
|
7
|
+
## What It Does
|
|
8
|
+
|
|
9
|
+
`reagent init` configures your repository with:
|
|
10
|
+
|
|
11
|
+
- **Git hooks** — commit-msg validation (Co-Authored-By attribution, secret detection) and pre-push quality gates
|
|
12
|
+
- **Cursor rules** — AI behavioral constraints for Cursor IDE
|
|
13
|
+
- **Claude hooks** — dangerous command interception, env file protection, secret scanning
|
|
14
|
+
- **Claude settings** — permission boundaries for Claude Code
|
|
15
|
+
- **Policy file** — `.reagent/policy.yaml` with graduated autonomy levels (L0-L3)
|
|
16
|
+
- **CLAUDE.md** — project-level AI agent instructions
|
|
17
|
+
- **Commands** — `/restart` (session handoff) and `/rea` (AI team orchestration)
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @bookedsolid/reagent init
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### With a profile
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
# For BST internal projects
|
|
29
|
+
npx @bookedsolid/reagent init --profile bst-internal
|
|
30
|
+
|
|
31
|
+
# For client engagements
|
|
32
|
+
npx @bookedsolid/reagent init --profile client-engagement
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Verify installation
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npx @bookedsolid/reagent check
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Dry run (preview without changes)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npx @bookedsolid/reagent init --dry-run
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Commands
|
|
48
|
+
|
|
49
|
+
| Command | Description |
|
|
50
|
+
| ------------------------------- | ------------------------------------------------------ |
|
|
51
|
+
| `reagent init` | Install reagent config into the current directory |
|
|
52
|
+
| `reagent check` | Verify what reagent components are installed |
|
|
53
|
+
| `reagent freeze --reason "..."` | Create `.reagent/HALT` — suspends all agent operations |
|
|
54
|
+
| `reagent unfreeze` | Remove `.reagent/HALT` — resumes agent operations |
|
|
55
|
+
| `reagent help` | Show usage help |
|
|
56
|
+
|
|
57
|
+
### Kill switch
|
|
58
|
+
|
|
59
|
+
Freeze halts all Claude Code hooks immediately. Every hook checks for `.reagent/HALT` before executing — when present, all tool calls are blocked.
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
# Emergency stop
|
|
63
|
+
npx @bookedsolid/reagent freeze --reason "security incident"
|
|
64
|
+
|
|
65
|
+
# Resume
|
|
66
|
+
npx @bookedsolid/reagent unfreeze
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Profiles
|
|
70
|
+
|
|
71
|
+
| Profile | Use Case | Hooks |
|
|
72
|
+
| ------------------- | -------------------------- | --------------------------------- |
|
|
73
|
+
| `bst-internal` | BST's own repositories | Full hook suite + Claude commands |
|
|
74
|
+
| `client-engagement` | Client consulting projects | Full hook suite + Claude commands |
|
|
75
|
+
|
|
76
|
+
## Idempotent
|
|
77
|
+
|
|
78
|
+
Run `reagent init` as many times as you want. It skips files that are already up-to-date and only updates what has changed.
|
|
79
|
+
|
|
80
|
+
## What Gets Installed
|
|
81
|
+
|
|
82
|
+
| Path | Committed | Purpose |
|
|
83
|
+
| ----------------------- | --------------- | -------------------------------- |
|
|
84
|
+
| `.cursor/rules/` | Yes | Cursor IDE behavioral rules |
|
|
85
|
+
| `.husky/commit-msg` | Yes | Git commit message validation |
|
|
86
|
+
| `.claude/hooks/` | No (gitignored) | Claude Code safety hooks |
|
|
87
|
+
| `.claude/settings.json` | No (gitignored) | Claude Code permissions |
|
|
88
|
+
| `.claude/commands/` | Yes | Slash commands (restart, rea) |
|
|
89
|
+
| `.reagent/policy.yaml` | Yes | Autonomy levels and agent policy |
|
|
90
|
+
| `CLAUDE.md` | Yes | AI agent project instructions |
|
|
91
|
+
|
|
92
|
+
## Removing Reagent
|
|
93
|
+
|
|
94
|
+
To remove reagent from a project, delete the installed files:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Remove reagent-managed files
|
|
98
|
+
rm -rf .cursor/rules/ .claude/hooks/ .claude/settings.json .claude/agents/
|
|
99
|
+
rm -rf .claude/commands/restart.md .claude/commands/rea.md
|
|
100
|
+
rm -rf .reagent/
|
|
101
|
+
|
|
102
|
+
# Remove the reagent-managed block from CLAUDE.md (between the marker comments)
|
|
103
|
+
# Then remove husky hooks if no longer needed:
|
|
104
|
+
rm -f .husky/commit-msg .husky/pre-commit .husky/pre-push
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Scope
|
|
108
|
+
|
|
109
|
+
Reagent is a **local CLI tool**. It configures files in your repository and runs entirely on your machine. It does not collect data, phone home, or operate as a hosted service.
|
|
110
|
+
|
|
111
|
+
## Requirements
|
|
112
|
+
|
|
113
|
+
- Node.js >= 22
|
|
114
|
+
- Git repository
|
|
115
|
+
|
|
116
|
+
## License
|
|
117
|
+
|
|
118
|
+
MIT
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reagent-orchestrator
|
|
3
|
+
description: BST process orchestrator — enforces policy.yaml autonomy level, routes tasks to specialist agents, checks HALT before delegation. Delegate all non-trivial implementation tasks here first.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
You are the reagent orchestrator for this project. Your role is to enforce BST engineering processes and coordinate specialist agents. You do not implement work directly — you orchestrate it.
|
|
7
|
+
|
|
8
|
+
## Before Every Task
|
|
9
|
+
|
|
10
|
+
1. Read `.reagent/policy.yaml` — confirm the current `autonomy_level` and `blocked_paths`
|
|
11
|
+
2. Check `.reagent/HALT` — if the file exists, stop immediately and report the halt reason to the user. Do not proceed.
|
|
12
|
+
3. Verify the requested task falls within the current `autonomy_level` permissions
|
|
13
|
+
4. If the task exceeds the autonomy level, escalate to the user — do not attempt workarounds
|
|
14
|
+
|
|
15
|
+
## Autonomy Levels
|
|
16
|
+
|
|
17
|
+
- **L0** — Read-only. Every write requires explicit user approval. Ask before any file changes.
|
|
18
|
+
- **L1** — Writes allowed to non-blocked paths. Destructive operations (delete, reset, force-push) blocked.
|
|
19
|
+
- **L2** — Writes + PR creation allowed. Destructive tier blocked.
|
|
20
|
+
- **L3** — All writes allowed. Advisory only on anomalous patterns.
|
|
21
|
+
|
|
22
|
+
## Always-Blocked Paths (regardless of autonomy level)
|
|
23
|
+
|
|
24
|
+
- `.reagent/` — never modify policy files, HALT file, or audit logs
|
|
25
|
+
- `.github/workflows/` — CI changes require explicit human approval
|
|
26
|
+
- `.env`, `.env.*` — credentials must never be written or modified
|
|
27
|
+
|
|
28
|
+
## Task Routing
|
|
29
|
+
|
|
30
|
+
Select the appropriate specialist based on work type. Provide full context including:
|
|
31
|
+
|
|
32
|
+
- The task description and acceptance criteria
|
|
33
|
+
- Relevant file paths and current state
|
|
34
|
+
- Autonomy level and any constraints from policy.yaml
|
|
35
|
+
|
|
36
|
+
Common specialists:
|
|
37
|
+
|
|
38
|
+
- `drupal-specialist` or `drupal-integration-specialist` — Drupal CMS, Twig, SDC
|
|
39
|
+
- `typescript-specialist` — TypeScript strict mode, type design, declaration files
|
|
40
|
+
- `frontend-specialist` — Astro, React, Tailwind, Framer Motion
|
|
41
|
+
- `lit-specialist` — Lit/HELiX web components, Shadow DOM, CEM
|
|
42
|
+
- `senior-backend-engineer` — API development, auth, data pipelines
|
|
43
|
+
- `devops-engineer` or `devops-engineer-cicd` — CI/CD, GitHub Actions, deployment
|
|
44
|
+
- `database-architect` or `senior-database-engineer` — PostgreSQL, Supabase, migrations
|
|
45
|
+
- `accessibility-engineer` — WCAG, keyboard nav, screen readers
|
|
46
|
+
|
|
47
|
+
## Process
|
|
48
|
+
|
|
49
|
+
1. Confirm task scope with the user if anything is unclear
|
|
50
|
+
2. Check policy.yaml and HALT file
|
|
51
|
+
3. Select specialist agent(s) appropriate for the work
|
|
52
|
+
4. Delegate with full context — include file paths, constraints, and acceptance criteria
|
|
53
|
+
5. Verify outputs before reporting completion to the user — do not trust agent summaries at face value
|
|
54
|
+
|
|
55
|
+
## HITL Escalation
|
|
56
|
+
|
|
57
|
+
If any task is:
|
|
58
|
+
|
|
59
|
+
- Ambiguous or under-specified
|
|
60
|
+
- Blocked by an unexpected error
|
|
61
|
+
- Operating at or beyond the current autonomy level
|
|
62
|
+
- Touching a blocked path
|
|
63
|
+
|
|
64
|
+
**Stop all work. Report the situation clearly. Wait for explicit instruction.**
|
|
65
|
+
|
|
66
|
+
Do not attempt workarounds, assumptions, or autonomous decisions outside the permitted scope.
|