Skip to content

DOC-6740 Claude Code post-tool hook to check shortcodes#3477

Merged
andy-stark-redis merged 4 commits into
mainfrom
DOC-6740-investigate-claude-post-tool-hook-for-shortcode-checks
Jun 10, 2026
Merged

DOC-6740 Claude Code post-tool hook to check shortcodes#3477
andy-stark-redis merged 4 commits into
mainfrom
DOC-6740-investigate-claude-post-tool-hook-for-shortcode-checks

Conversation

@andy-stark-redis

@andy-stark-redis andy-stark-redis commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Changes only affect local Claude Code tooling and docs authoring workflows, not site builds or production runtime.

Overview
Adds Claude Code automation for the Hugo docs repo: a PostToolUse hook runs after Edit/Write/MultiEdit on markdown and validates that hard shortcode targets (image, embed-md, embed-code, etc.) point at real files under static/, content/embeds/, and related paths. Broken hard refs exit with code 2 so the agent sees the error; optional --scan mode bulk-checks content. relref checks stay off by default (CHECK_SHORTCODE_RELREF=1 for soft warnings only).

.claude/settings.json wires the hook and allows gh for PR/issue comment APIs (with gh outside the sandbox). A new docs/bugbot command documents how to fetch Cursor Bugbot comments on the current branch’s PR, triage them, and fix valid doc issues before committing.

Reviewed by Cursor Bugbot for commit 7788ea9. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

DOC-6740

@jit-ci

jit-ci Bot commented Jun 10, 2026

Copy link
Copy Markdown

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Comment thread .claude/settings.json

@dwdougherty dwdougherty left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Is there some place where you can summarize how to run these Claude commands?

@andy-stark-redis

Copy link
Copy Markdown
Contributor Author

Looks good to me. Is there some place where you can summarize how to run these Claude commands?

Yeah, wiki might be a good place or the repo README? BTW, this isn't the main task for this PR, it's just a bonus feature :-)

Comment thread .claude/hooks/check_shortcode_paths.py

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7788ea9. Configure here.

Comment thread .claude/hooks/check_shortcode_paths.py
@andy-stark-redis andy-stark-redis merged commit f1601e2 into main Jun 10, 2026
72 checks passed
@andy-stark-redis andy-stark-redis deleted the DOC-6740-investigate-claude-post-tool-hook-for-shortcode-checks branch June 10, 2026 14:50
EliShteinman added a commit to EliShteinman/docs that referenced this pull request Jun 11, 2026
Adds Claude Code dev tooling: a /bugbot command and a PostToolUse hook that checks Hugo shortcode paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants