# Claude Code Infra Showcase — Real-World Setup Patterns > A practical showcase of Claude Code infrastructure patterns (layout, guardrails, scripts), so teams can copy defaults and standardize delivery fast. ## Install Save the content below to `.claude/skills/` or append to your `CLAUDE.md`: ## Quick Use 1. Clone: ```bash git clone https://github.com/diet103/claude-code-infrastructure-showcase cd claude-code-infrastructure-showcase ``` 2. Pick one pattern and port it to your repo (start with guardrails): - copy the minimal instruction file(s) - adapt the commands to your toolchain 3. Document your “definition of done” for agents in your repo root. ## Intro A practical showcase of Claude Code infrastructure patterns (layout, guardrails, scripts), so teams can copy defaults and standardize delivery fast. - **Best for:** teams standardizing Claude Code usage across many repos with consistent guardrails and scripts - **Works with:** Git + any repo; you copy patterns into your own projects and adapt commands - **Setup time:** 20–40 minutes ## Practical Notes - Start with 1 repo and 1 workflow (lint/test/fix) before rolling out to all repos. - Measure impact: PR cycle time and CI failure rate usually change first. ## What to copy first (high leverage) If you only copy one thing, copy the **guardrails**: - what agents must run before claiming done, - what they must never do (prod migrations, destructive ops), - how to present output (diff, commands, verification). ## A minimal “Claude Code team standard” 1) Add a short repo instruction file: - required commands, - allowed directories, - formatting expectations. 2) Provide one “happy path” script: - run checks, - apply fix, - re-run checks. 3) Keep it boring: The goal is consistent delivery, not clever prompts. ## Rollout plan - Pilot on one repo for one week. - Convert what worked into a template. - Only then scale to the rest of the org. ### FAQ **Q: Is this only for Claude Code?** A: It’s Claude Code oriented, but most guardrail patterns apply to any coding agent. **Q: How do I avoid prompt sprawl?** A: Keep one canonical instruction file per repo and treat it like code (review changes). **Q: What should I measure after rollout?** A: CI failure rate, PR cycle time, and number of reverted agent changes. ## Source & Thanks > Source: https://github.com/diet103/claude-code-infrastructure-showcase > License: MIT > GitHub stars: 9,633 · forks: 1,224 --- ## 快速使用 1. 克隆仓库: ```bash git clone https://github.com/diet103/claude-code-infrastructure-showcase cd claude-code-infrastructure-showcase ``` 2. 选一个范式迁移到你的仓库(建议先从护栏开始): - 复制最小的指令文件 - 把命令改成你们的工具链 3. 在仓库根目录写清 agent 的交付标准。 ## 简介 这是一个 Claude Code 基础设施落地示例集合(目录结构、护栏规则、脚本化流程等),让团队直接复用成熟默认值并快速标准化交付;把可复现、可验证的 agent 工作流当成工程资产管理。 - **适合谁:** 在多个仓库推广 Claude Code,希望用统一护栏与脚本标准化的团队 - **可搭配:** Git + 任意仓库;你把范式复制到自己的项目并按需改造 - **准备时间:** 20–40 分钟 ## 实战建议 - 先在 1 个仓库、1 条工作流(lint/test/fix)跑通,再全量铺开。 - 先看两个指标:PR 周期时间与 CI 失败率最容易出现变化。 ## 最值得先抄的内容(杠杆最大) 如果你只抄一件事,就抄 **护栏**: - agent 交付前必须跑什么, - 绝对不能做什么(生产迁移、破坏性操作等), - 输出格式如何规范(diff、命令、验证结果)。 ## 一套最小“团队标准” 1)加一份简短的仓库指令文件: - 必跑命令, - 允许操作的目录范围, - 输出格式约束。 2)提供一条“快乐路径”脚本: - 跑检查, - 修复, - 再跑检查。 3)越朴素越好: 目标是交付一致性,不是写出花哨 prompt。 ## 推广策略 - 先在 1 个仓库试运行一周。 - 把有效做法沉淀成模板。 - 再规模化推广到其他仓库。 ### FAQ **只适用于 Claude Code 吗?** 答:它面向 Claude Code,但大多数护栏范式适用于任何 coding agent。 **如何避免 prompt 越写越乱?** 答:每个仓库只保留一个权威指令文件,把它当代码评审。 **上线后该看什么指标?** 答:CI 失败率、PR 周期时间、以及 agent 改动被回滚的次数。 ## 来源与感谢 > Source: https://github.com/diet103/claude-code-infrastructure-showcase > License: MIT > GitHub stars: 9,633 · forks: 1,224 --- Source: https://tokrepo.com/en/workflows/claude-code-infra-showcase-real-world-setup-patterns Author: Skill Factory