Skip to content

Commit a18a16c

Browse files
committed
docs(readme): show actual terminal output for check and hook flows
The README described the experience but never showed it. Adds two short code blocks readers can scan in five seconds: 1. After the ASCII flow diagram, a 'What it looks like' section showing three real outputs from 'stackguard check': a clean pass, a HIGH-confidence block with the suggested-revision box and the interactive menu, and a low-confidence soft warning that passes through. 2. In 'Integrating with Claude Code', the exact stderr message Claude Code shows when the hook blocks a prompt — the visual that proves the integration actually works inside the REPL. Both blocks reuse the renderer's real output format so they match what users actually see. Links out to examples/ for the longer per-language walkthroughs.
1 parent 4a2cc36 commit a18a16c

1 file changed

Lines changed: 67 additions & 1 deletion

File tree

README.md

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,54 @@ seconds, with no infrastructure to set up.
5959

6060
---
6161

62+
## What it looks like
63+
64+
A clean prompt is invisible:
65+
66+
```
67+
$ stackguard check "build a settings page where users can change their display name"
68+
✓ stackguard: ok
69+
```
70+
71+
A prompt that conflicts with your policy stops and shows you why:
72+
73+
```
74+
$ stackguard check "add a MongoDB connection for user sessions"
75+
76+
⚠ stackguard: guideline conflict detected
77+
──────────────────────────────────────────────────────────────────────
78+
79+
"add a MongoDB connection for user sessions"
80+
Rule: NEVER use MongoDB, DynamoDB, or any NoSQL store for primary
81+
data.
82+
Why: The prompt names a database that the policy excludes.
83+
Level: HIGH confidence
84+
85+
Suggested revision:
86+
┌──────────────────────────────────────────────────────────┐
87+
│ Add a Postgres-backed user_sessions table accessed via │
88+
│ the team's approved DB wrapper, with a parameterized │
89+
│ query for lookups │
90+
└──────────────────────────────────────────────────────────┘
91+
92+
[P]roceed anyway [R]evise [S]how policy [C]ancel
93+
> r
94+
Use suggested revision? [Y]es / [N]o, type my own: y
95+
✓ stackguard: ok
96+
```
97+
98+
A possible-but-uncertain conflict surfaces as a soft note and lets the prompt through (see [ADR-002](./docs/adr/ADR-002-low-confidence-passthrough.md)):
99+
100+
```
101+
$ stackguard check "add a date picker that handles timezones nicely"
102+
ℹ stackguard: possible conflict (low confidence — passing through)
103+
"date picker that handles timezones" may conflict with "moment is prohibited…"
104+
```
105+
106+
For more examples — including Python, Go, fintech, and a deliberately tiny two-person policy — see [`examples/`](./examples/).
107+
108+
---
109+
62110
## Quickstart
63111

64112
```bash
@@ -90,7 +138,25 @@ git add .claude/settings.json # commit so the rest of the team gets it
90138

91139
Now every prompt you submit to Claude Code in this project is checked first.
92140
A clean prompt passes through invisibly. A blocked prompt shows the violation
93-
in the Claude Code UI and waits for you to revise.
141+
in the Claude Code UI and waits for you to revise:
142+
143+
```
144+
> add a MongoDB connection for user sessions
145+
146+
✗ stackguard: prompt blocked by engineering policy
147+
148+
• "add a MongoDB connection for user sessions"
149+
Rule: NEVER use MongoDB, DynamoDB, or any NoSQL store for primary data
150+
Why: The prompt names a database that the policy excludes.
151+
Level: HIGH confidence
152+
153+
Suggested revision:
154+
Add a Postgres-backed user_sessions table accessed via the team's
155+
approved DB wrapper, with a parameterized query for lookups
156+
157+
Edit your prompt and submit again, or run `stackguard policy show`
158+
to read the full policy.
159+
```
94160

95161
**Block mode vs warn mode:** in `block` mode the hook returns exit 2 and
96162
Claude Code refuses to send the prompt. In `warn` mode the violation gets

0 commit comments

Comments
 (0)