Install
$ agentstack add skill-bensheridanedwards-architectplaybook-pre-audit-setup ✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Verified badge
Passed review? Show it. Paste this badge into your README, it links to the public security report.
Reliability & compatibility
Declared compatibility
Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.
We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.
How agent discovery & health will work →About
/pre-audit-setup
Idempotent preparation that every audit in the architect-playbook expects to have been run at least once in the target project. Run this immediately after installing the skills.
Usage
/pre-audit-setup # do everything that has not been done yet
/pre-audit-setup --force # rebuild the knowledge graph and rewrite the hook even if both already exist
/pre-audit-setup --dry-run # describe what would change without modifying anything
What this skill does
- Verifies graphify is installed at
~/.claude/skills/graphify. This skill does not install graphify. If it is missing, stop and tell the user where to install it (see https://graphify.net/graphify-claude-code-integration.html). Do not invent a clone URL. - Builds the project knowledge graph by invoking
/graphify .from the current working directory. Subsequent audits readgraphify-out/graph.jsonandgraphify-out/GRAPH_REPORT.mdas their map of the codebase. - Merges the graphify-aware PreToolUse hook into the project-local
.claude/settings.json(creating the file if needed). The hook attaches a hint to every Glob and Grep call: when the knowledge graph exists, Claude is reminded to read the report before searching raw files. - Creates the
.architect-audits/directory that downstream audits will write findings into. Adds a single.gitkeepso it survivesgit clean. - Prints a checklist describing what was done, what was already in place, and what the user should verify before launching audits.
Implementation steps
Follow these steps in order. Stop at the first hard failure and report.
Step 1 — Verify graphify
test -f "$HOME/.claude/skills/graphify/SKILL.md" \
&& echo "graphify: present" \
|| { echo "graphify: missing — install it first (see https://graphify.net/graphify-claude-code-integration.html)"; exit 1; }
If graphify is missing, stop and surface the message above. Do not attempt to download anything.
Step 2 — Detect prior runs
test -f graphify-out/graph.json && echo "knowledge graph: present" || echo "knowledge graph: missing"
test -f .claude/settings.json && echo "settings.json: present" || echo "settings.json: missing"
If both the knowledge graph and the hook are already present, and --force was not passed, print the checklist and exit cleanly. The skill is idempotent.
Step 3 — Build the knowledge graph
If graphify-out/graph.json is missing or --force was passed, run:
/graphify .
(Invoke the graphify slash command — do not call it as a shell command.) Wait for it to finish before moving on.
Step 4 — Merge the PreToolUse hook into .claude/settings.json
The hook to merge is exactly:
{
"matcher": "Glob|Grep",
"hooks": [
{
"type": "command",
"command": "[ -f graphify-out/graph.json ] && echo '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"additionalContext\":\"graphify: Knowledge graph exists. Read graphify-out/GRAPH_REPORT.md for god nodes and community structure before searching raw files.\"}}' || true"
}
]
}
Merge rules (in order):
- If
.claude/settings.jsondoes not exist, create it with the structure:
``json { "hooks": { "PreToolUse": [ ] } } ``
- If it exists but has no
hookskey, addhooks: { PreToolUse: [] }. - If it has
hooks.PreToolUse, append the hook only if no existing entry has both the samematcherand an identicalcommandstring. Never duplicate. - Preserve every other field in
.claude/settings.jsonexactly as it was. - Use
jqif it is on PATH; otherwise read the file with the Read tool, transform it in memory, and write it back with the Write tool.
After merging, print the final hook block so the user can confirm.
Step 5 — Ensure the .architect-audits/ directory exists
mkdir -p .architect-audits
[ -f .architect-audits/.gitkeep ] || touch .architect-audits/.gitkeep
Step 6 — Print the checklist
Output a short report with one line per item, each prefixed with [done], [skipped], or [already]:
[done] graphify presence verified
[done] graphify-out/graph.json built (53 files indexed)
[done] PreToolUse hook merged into .claude/settings.json
[done] .architect-audits/ directory created
[hint] next: open one chat per audit slash command and run them in parallel
Idempotency rules
- Never duplicate the hook entry. The check is
matcherplus exactcommandstring match. - Never overwrite the existing knowledge graph unless
--forcewas passed. - Never modify any setting other than
hooks.PreToolUse. - Never touch
~/.claude/settings.json. This skill is project-local only.
Failure modes and remediation
| Symptom | Cause | Fix | | --- | --- | --- | | graphify: missing | graphify is not installed at ~/.claude/skills/graphify | Install graphify first; see the integration page above. | | /graphify . fails | graphify-side problem | Read graphify's own error output. This skill does not retry. | | Settings file is invalid JSON | Pre-existing corruption in .claude/settings.json | Stop and ask the user to fix or move the file. Never silently overwrite. |
When to run again
Re-run /pre-audit-setup after:
- A major refactor (the knowledge graph has gone stale).
- Pulling a branch that significantly changes file layout.
- Adding new top-level packages or workspaces.
Use --force when re-running to rebuild the graph and re-merge the hook.
What this skill explicitly does NOT do
- Install graphify itself.
- Modify global Claude Code settings.
- Run any audit. Audits are separate skills and are intended to run in their own chat sessions.
- Commit anything to git. Commit changes manually, with a Conventional Commits message such as
chore: add graphify pre-tool-use hook to settings.json.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: BenSheridanEdwards
- Source: BenSheridanEdwards/ArchitectPlaybook
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet, be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.