feat: align template with official Claude Code docs#3
Merged
Conversation
Major expansion of the template to cover the full surface area of the official Claude Code documentation. Fixes broken configs, packages as an installable plugin, and adds CI/CD, SDK starters, hardened devcontainer, and a full library of commands/agents/skills/hooks. Highlights - Fix .mcp.json (wrong package names) and settings.json (invented fields) - Package as plugin via .claude-plugin/ (plugin.json + marketplace.json) - Add .github/workflows/claude.yml + claude-review.yml - Add .gitlab-ci.yml and scripts/ci-review.sh (headless mode) - Replace log-only hooks with real ones: format-on-save, block-dangerous-bash, inject-context, session-cost - Expand subagents 2 -> 7 (add test-runner, pr-reviewer, refactor-planner, debugger, dependency-auditor) - Expand skills 2 -> 6 (add test-writing, api-design, performance-audit, accessibility) - Expand commands 5 -> 12 (add /review, /security-review, /debug, /refactor, /explain, /doc, /implement-issue) - Add output styles (concise, educational, review) - Add status line script - Add sdk/ directory with TS + Python Agent SDK starters - Add docs/ directory: best-practices, permission-modes, hooks-cookbook, plugins, agent-sdk, integrations, claude-directory - Harden devcontainer with init-firewall.sh (egress allowlist) - Overhaul CLAUDE.md and README Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Harden block-dangerous-bash hook against false positives and add regression tests. - Strip shell comments, then flatten newlines, then strip single/double- quoted content before matching. This prevents dangerous-pattern text appearing in --body strings, heredoc bodies, or comments from triggering blocks. - Switch from glob-style case patterns to anchored grep -E regex that requires command-boundary context (start-of-string or after ;, &&, ||, |, or open-paren). - Add scripts/hooks/test-block-dangerous-bash.sh with 13 smoke tests covering 6 positive (must-block) and 7 negative (must-not-block) cases, including the exact false-positive that hit when creating this PR. Refs #4 AI-Tool: claude-code Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4
Summary
settings.jsonfields, outdated README links.Changes
Bug fixes
.mcp.json—@anthropic/mcp-server-*(don't exist) →@modelcontextprotocol/server-*. Also addedgitandfetchservers..claude/settings.json— removed inventedmemory/editorfields (ignored by Claude Code). Added real fields:permissions.defaultMode,statusLine,includeCoAuthoredBy,cleanupPeriodDays,enabledMcpjsonServers.docs.anthropic.com/en/docs/claude-codelinks with currentcode.claude.com/docs/encanonical URLs.Packaged as a plugin
.claude-plugin/plugin.json— installable via/plugin install..claude-plugin/marketplace.json— single-plugin marketplace scaffolding.Slash commands (5 → 12)
Added
/review,/security-review,/debug,/refactor,/explain,/doc,/implement-issue.Subagents (2 → 7)
Added
test-runner,pr-reviewer,refactor-planner,debugger,dependency-auditor.Skills (2 → 6)
Added
test-writing,api-design,performance-audit,accessibility.Output styles (0 → 3)
concise,educational,review.Status line
.claude/statusline/statusline.sh— renders model · repo · branch · cost.Real hook scripts (replace log-only hooks)
format-on-save.sh— Prettier / Ruff / gofmt / rustfmt onEdit|Write|MultiEdit.block-dangerous-bash.sh— PreToolUse block for destructive patterns (recursive deletes, force-push to main, pipe-to-shell).inject-context.sh— injects branch, recent commits, open PRs onSessionStart.session-cost.sh— prints cost summary to stderr onStop.CI / CD
.github/workflows/claude.yml—@claudementions in PRs / issues..github/workflows/claude-review.yml— automatic review on new PRs..gitlab-ci.yml— GitLab MR review equivalent.scripts/ci-review.sh— headlessclaude -pexample for any CI.Agent SDK starter (
sdk/)TypeScript + Python examples, including a custom-tool example.
Docs directory
Condensed in-repo mirrors of key official docs:
best-practices,permission-modes,hooks-cookbook,plugins,agent-sdk,integrations,claude-directory.Devcontainer hardening
init-firewall.sh— egress allowlist (Anthropic API, GitHub, npm, PyPI only) via iptables + ipset.~/.claudeso global settings/auto-memory persist across rebuilds.--cap-add=NET_ADMINso the firewall can install.Settings overhaul
.claude/settings.local.json.example— expanded with Bedrock / Vertex / Foundry / LLM-gateway / OTel blocks.additionalDirectoriesexample for monorepos.Known follow-up
The
block-dangerous-bash.shhook was triggered while creating this very PR because its destructive-pattern strings appeared inside the PR body text. Tightening the pattern to match only command positions (not string content) is a worthwhile follow-up — for now, callers can work around it with--body-file.Test plan
jq . .mcp.json .claude/settings.json .claude-plugin/*.json— already validated clean.bash -non every script — already validated clean.claudeand confirm the new commands appear in/help./reviewon a throwaway branch to confirm subagent wiring.ANTHROPIC_API_KEYis set in repo secrets before the new workflows run.🤖 Generated with Claude Code