Guardrails and QA for building websites with Claude Code, from a working web studio. Two hooks that stop the expensive mistakes, three skills that check the page before anyone says "done".
| What it does | |
|---|---|
| deploy-gate (hook) | Asks a person before about 20 deploy and publish commands it recognizes (Vercel, Netlify, Cloudflare, Firebase, Railway, Fly, npm, Docker, Shopify themes, Terraform and more) and before pushes to production branches. A tool it does not know passes through: open an issue and we add it. |
| secret-guard (hook) | Blocks key formats from common providers (Stripe, OpenAI, Anthropic, AWS, GitHub, Google and more) written into source code or given a browser-exposed name (VITE_, NEXT_PUBLIC_, PUBLIC_, REACT_APP_ ...), and git add of a .env that is not ignored. |
| launch-qa (skill) | Renders the page at 390, 768 and 1440 px and fails on console errors, failed requests, sideways scroll, missing alt text, broken links, tiny text and tap targets. |
| five-attacks (skill) | A ten-minute pre-launch test of the five attacks that hit small sites: stolen key, AI endpoint called in a loop, bot-flooded form, impersonation, fake payment. |
| concrete-copy (skill) | Rules for the words on a page, plus a linter that fails AI-tell copy ("unlock", "seamless", "not just X, it's Y", em dashes, "Learn more"). |
The scripts run on your machine and the kit adds no telemetry or accounts; Claude Code itself sends your prompts and the context it reads to the model as usual. Standard-library Python.
Studio Kit is a local developer tool for web developers and studios, not a hosted service or a product intended for children under 18. MEG Web Studio does not receive or retain Claude session data through this plugin. The plugin adds no telemetry, account system, or automatic upload of project files or QA reports. Claude Code's own model/context handling is separate.
- Local inputs and outputs: hooks inspect tool input (commands and proposed file content); scanners and the copy linter read the files or pages you select. launch-qa saves full-page screenshots and report.md/report.json locally in its output folder. Page text, URLs, console errors and screenshots may contain personal or confidential data. These files are not automatically deleted; you control their retention and sharing.
- Network destinations are the URLs you choose, not MCP connectors. copy_lint.py fetches the selected page. scan_bundle.py fetches the selected page and follows scripts/imports/source maps selected on the same host. HTTP redirects can lead to another host. launch-qa opens the chosen page in Chromium, runs its JavaScript, and checks same-origin links; the page itself may contact its own third-party services, and redirects are followed.
- probe_endpoint.py sends the JSON/form body and optional headers you supply to the selected endpoint (at most 100 requests). Use synthetic test data and only systems you own or are authorized to test; the script does not enforce synthetic-only payloads. A real endpoint may store the requests or trigger its normal downstream actions.
- Network traffic exposes ordinary request metadata (such as the requesting IP) to the destination. Destination-site and Claude-provider retention policies are outside this plugin; no 30-day deletion promise is made.
Inside Claude Code:
/plugin marketplace add megwebstudio/studio-kit
/plugin install studio-kit@studio-kit
Restart the session and the hooks are active. Skills load on their own when the task matches, or call them by name ("run launch-qa on dist/").
Requirements: Claude Code 2.1 or later, Python 3.9 or later (tested on 3.9 and 3.15). launch-qa also needs Playwright:
python3 -m pip install playwright && python3 -m playwright install chromium.
Every block below is the unedited output of the code in this repository, produced by
tools/capture_examples.py on demo inputs. Fake keys are generated at runtime and
only ever printed masked.
deploy-gate: Claude tries to deploy to production during a normal session. The hook answers ask, so
Claude Code shows you a permission prompt with this reason:
$ npm run build && npx vercel --prod
decision: ask
deploy-gate: this looks like a Vercel production deploy. A person should confirm production changes. Approve only if you asked for this deploy.
In bypassPermissions mode nobody can be asked, so the hook denies and tells Claude to stop:
$ git push origin main (in bypassPermissions mode)
decision: deny
deploy-gate blocked a git push to production branch 'main'. Do not retry or work around this. Stop and ask the user to confirm the deploy; they can run the command themselves, or add a pattern to .claude/deploy-gate-allow for deploys that never need a prompt.
secret-guard: Claude is about to write an OpenAI key into a variable that Vite inlines into the browser bundle:
$ Write .env.local: VITE_OPENAI_API_KEY=sk-proj-...
decision: deny
secret-guard blocked this change in .env.local:
- VITE_OPENAI_API_KEY holds an OpenAI API key and is bundled into browser JavaScript: sk-pro... (56 chars)
Keep secrets server-side: put the value in a gitignored .env under a name WITHOUT a browser prefix (not VITE_/NEXT_PUBLIC_/PUBLIC_/REACT_APP_), read it only in server code (API route, edge function, backend), and reference it by name. For .env files: add them to .gitignore and commit a .env.example with empty values. Do not retry with the same value or split it to evade this check; tell the user.
five-attacks (attack 1, stolen key): scanning a build folder where a key leaked into a chunk:
$ python3 scan_bundle.py dist/
scanned 1 file(s) in dist
FAIL: 1 finding(s)
assets/index-4f2a.js OpenAI API key sk-pro... (56 chars)
(exit 1)
launch-qa on a small restaurant page with four planted defects (wide banner, image without alt,
console error, dead link). All four are caught; the report and full-page screenshots are written to qa-out/:
$ python3 launch_qa.py site/
launch-qa FAIL http://127.0.0.1:62369/
PASS page-load HTTP 200, load 5 ms (desktop)
FAIL console-errors 1 distinct error(s)
FAIL failed-requests 1 failed request(s)
FAIL horizontal-overflow page scrolls sideways (worst: mobile, +1210px)
PASS title 12 chars: Osteria Lume
WARN meta-description 26 chars (aim for 50-160)
WARN og-tags missing og:title, og:image
PASS lang lang="en"
PASS h1 1 <h1>: Fresh pasta every morning
FAIL img-alt 1 of 1 <img> without alt attribute
PASS meta-viewport width=device-width,initial-scale=1
PASS small-text-mobile 4 text elements, none under 12px
WARN tap-targets-mobile 1 of 2 targets under 40px
FAIL internal-links 1 of 2 same-origin links broken
report: qa-out/report.md
(exit 1)
concrete-copy on a hero written in the usual AI register:
$ python3 copy_lint.py index.html
== index.html (5 text blocks) FAIL 5 WARN 3
FAIL AI-tell word 'elevate' in <title>: Elevate Your Dining Journey
FAIL AI-tell word 'seamless' in <h1>: Unlock a seamless taste experience
FAIL AI-tell word 'unlock' in <h1>: Unlock a seamless taste experience
FAIL 'not just X, it's Y' shape in <p>: Not just a restaurant, it's a lifestyle — crafted with passion.
FAIL em dash in <p>: Not just a restaurant, it's a lifestyle — crafted with passion.
WARN soft word 'journey' (keep only if literal) in <title>: Elevate Your Dining Journey
WARN soft word 'passion' (keep only if literal) in <p>: Not just a restaurant, it's a lifestyle — crafted with passion.
WARN vague button/link text 'Learn more' (use verb + object)
RESULT: FAIL
(exit 1)
| Setting | Values | Default |
|---|---|---|
STUDIO_KIT_DEPLOY_GATE |
ask, deny, off |
ask (deny when permissions are bypassed) |
STUDIO_KIT_PROD_BRANCHES |
comma list | main,master,production,prod,release,live |
STUDIO_KIT_SECRET_GUARD |
on, ask, off |
on (deny high-confidence keys, ask otherwise) |
.claude/deploy-gate-allow |
one regex per line | the entire command must match, e.g. wrangler deploy --env staging; added commands are not covered by that line |
.claude/secret-guard-allow |
one glob per line | paths to skip, e.g. tests/fixtures/* (* also matches subfolders) |
Real .env files with server-side names are allowed: that is where secrets belong. Findings are shown
masked (first 6 characters and length).
These hooks are guardrails against accidents, not a security boundary: a person with shell access can always deploy. If Python is missing the hooks print a warning and let the command through rather than blocking your work.
- A substitution inside a Git option (
git -C $(pwd) push,git --git-dir=$(pwd)/.git push) no longer cuts the Git command in two: the substitution counts as an unresolved value, so the push asks. - A
git configorgit remotechange in the same command is reported and the.envscan still runs, so a real env finding is still denied. - Allowlist writes are also caught through
git diff/log --outputand through.claude/paths with wildcards or variables; plain reads (cat,ls,grep,git diff) stay quiet. - A subshell glued to a word (
then(...),do(...)), a process substitution (<(...),>(...)), a computed subcommand (git $(...),git "$VERB") and very deep or very longsh -cnesting ask instead of passing. A push to a computed destination (git push origin $(git branch --show-current),"$BRANCH") asks. Allowlist names split by quotes or backslashes, or written aftercd .claude, are recognized.
- The 1.0.0 reading of each command now runs next to the new parser and the stricter answer wins, so no command that 1.0.0 stopped can pass.
- Git commands inside strings that another command runs (
eval,ssh host "...",watch,bash <<<,echo ... | sh), in subshells( ... ), in$(...)and in backticks are checked. - More routing overrides ask:
GIT_CONFIG*,GIT_COMMON_DIR,GIT_OBJECT_DIRECTORY,GIT_NAMESPACE,--bare,--exec-path, an exportedGIT_DIR, andgit configorgit remote set-urlin the same command as a push or agit add. - Writing
.claude/deploy-gate-allowor.claude/secret-guard-allowfrom the shell (>,tee,sed -i,cp...) asks for confirmation; reading them does not.
- Literal Git global options and quoted/repeated
-Cdirectories no longer hide recognized pushes or env staging. Repository/configuration overrides that the checks cannot safely reproduce require review; pending-csettings are never executed by the checks. - A single
&separates commands, while quoted/escaped separators in paths remain intact. - Git supplies the candidate env paths recursively, including tracked files that are now ignored; literal directory pathspecs are respected. A staging exception must match the entire command, not just its first part.
- Direct Write/Edit/MultiEdit/NotebookEdit changes to either allowlist require confirmation. Relative paths are normalized before allowlist matching; direct policy edits through an existing symlink are also checked.
.env.js, other recognized source extensions and env files under public/output directories are scanned for keys. Private server-side env files remain allowed. Fixture findings still ask interactively, but findings deny when the runtime reportsbypassPermissionsordontAskinstead of relying on an unavailable prompt.- Shell comments are skipped, so a quote inside
# ...no longer hides the command after it. Command strings given tosh -c,bash -corzsh -care checked too. When the quoting cannot be followed, or a-Cdirectory uses~,$VAR, a backtick or a missing path, a push or staging command asks instead of passing.
They read command text and proposed file content; they are not a shell interpreter or a security sandbox.
- A deploy started inside a script, alias or function (
npm run deploy,bash deploy.sh) can still be missed. - Here-documents, variables, dynamic paths/options, environment changes and shell control structures are not comprehensively resolved; substitutions and subshells are only split, not evaluated. Git context overrides are handled conservatively, not fully emulated.
- Quoted multi-word strings are read as possible commands, so a commit message that mentions
git push origin maincan ask. The checks err on the side of asking. - Shell commands that name an allowlist file ask, but a script, another path to the same file or an edit to the hook itself can still change the policy. Keep those files in Git and review changes; the checks do not make the policy immutable. Explicitly broad allowlist patterns remain broad.
- Secret matching covers known patterns, not every credential or encoded/generated value. The Git check focuses
on env filenames; it is not a full staged-content secret scanner. An interactive fixture finding still asks.
A forced
git add -f .orgit add --force <dir>can stage an ignored.envwithout a warning; a forced add of a named env file is blocked. - When secret-guard asks about a file write (for example a key in a test fixture), Claude Code shows its normal file dialog. In the version tested (2.1.314) the hook's reason is not shown there: read the content preview before you approve. For Bash commands the reason is shown in the prompt.
- Internal errors, missing Python and unavailable Git checks can leave a command unexamined. The wrapper warns on hook failure; these controls are accident prevention, not a substitute for sandboxing or a release review.
Found another one? Open an issue with the command.
python3 -m unittest discover -s plugins/studio-kit/hooks/tests
python3 -m unittest discover -s plugins/studio-kit/skills/five-attacks/tests
python3 -m unittest discover -s plugins/studio-kit/skills/concrete-copy/tests
python3 -m unittest discover -s plugins/studio-kit/skills/launch-qa/tests
The free core checks the work. Pro is the pipeline that produces it: twelve skills a studio runs from brief to launch, with scripts, templates and tests.
creative-director · web-art-director · web-designer · website-builder · conversion-copywriter ·
seo-specialist · cro-specialist · security-engineer · graphics-engineer · scroll-scrub-hero ·
site-archetypes · visual-qa
79 € one-time, one seat, unlimited client projects: megwebstudio.com/kit
Studio Kit pairs with community design skills you may already use, such as Impeccable and UI UX Pro Max. They are not part of this kit.
MIT for this repository. Studio Kit Pro has its own license.
Studio Kit is an independent project by MEG Web Studio. Claude Code is a product of Anthropic; this project is not affiliated with or endorsed by Anthropic.
