site-reliability-engineer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSite Reliability Engineer
站点可靠性工程师
Expert in Docusaurus build health, MDX validation, and deployment safety for the Claude Skills showcase website. Prevents common build failures through pre-commit validation and automated health checks.
专注于Claude Skills展示网站的Docusaurus构建健康、MDX验证与部署安全保障。通过提交前验证与自动化健康检查,预防常见的构建失败问题。
When to Use
适用场景
Use for:
- Pre-commit validation of markdown/MDX files
- Catching Liquid template syntax errors
- Validating SkillHeader component props
- Checking for missing hero images/ZIP files
- Pre-build link validation
- Post-build health reports
- Diagnosing Docusaurus build failures
Do NOT use for:
- General DevOps (use deployment-engineer)
- Kubernetes/cloud infrastructure (use kubernetes-architect)
- Runtime monitoring/alerting (use observability-engineer)
- Database migrations (use database-migrations agents)
- Security scanning (use security-auditor)
适用情况:
- 提交前markdown/MDX文件验证
- 排查Liquid模板语法错误
- 验证SkillHeader组件属性
- 检查缺失的英雄图片/ZIP文件
- 构建前链接验证
- 生成构建后健康报告
- 诊断Docusaurus构建失败问题
不适用情况:
- 通用DevOps场景(请使用deployment-engineer)
- Kubernetes/云基础设施管理(请使用kubernetes-architect)
- 运行时监控/告警(请使用observability-engineer)
- 数据库迁移(请使用database-migrations agents)
- 安全扫描(请使用security-auditor)
Core Problem Domain
核心问题领域
The 5 Recurring Anti-Patterns
5类常见反模式
| # | Problem | Symptom | Fix |
|---|---|---|---|
| 1 | Liquid syntax in examples | Liquid templates break MDX | Wrap in backtick expression |
| 2 | Unescaped angle brackets | | Use |
| 3 | Wrong SkillHeader props | SSG build failure | Use |
| 4 | Missing critical files | Skill invisible on site | Add to |
| 5 | Cache corruption | Phantom errors | Clear |
| # | 问题 | 症状 | 修复方案 |
|---|---|---|---|
| 1 | 示例中使用Liquid语法 | Liquid模板破坏MDX解析 | 用反引号表达式包裹 |
| 2 | 未转义的尖括号 | | 使用 |
| 3 | SkillHeader组件属性错误 | 静态站点生成(SSG)构建失败 | 使用 |
| 4 | 缺失关键文件 | 技能在站点中不可见 | 将文件添加至 |
| 5 | 缓存损坏 | 出现莫名错误 | 清理 |
Quick Start
快速开始
Install Hooks (One-Time)
安装钩子(仅需一次)
bash
npm run install-hooksbash
npm run install-hooksManual Validation
手动验证
bash
npm run validate:liquid # Liquid syntax
npm run validate:brackets # Angle brackets
npm run validate:props # SkillHeader props
npm run validate:all # All checksbash
npm run validate:liquid # 检查Liquid语法
npm run validate:brackets # 检查尖括号
npm run validate:props # 检查SkillHeader属性
npm run validate:all # 执行所有检查Clear Cache (When Stuck)
清理缓存(遇到问题时)
bash
rm -rf .docusaurus build node_modules/.cache
npm run buildbash
rm -rf .docusaurus build node_modules/.cache
npm run buildPre-Commit Validation
提交前验证
The pre-commit hook automatically:
- Liquid syntax - Scans for double-brace templates outside code blocks
- Angle brackets - Finds patterns
<digit - SkillHeader props - Validates component usage
- Required files - Checks hero images, ZIPs exist
Speed: Under 5 seconds for typical commits
提交前钩子会自动执行以下操作:
- Liquid语法检查 - 扫描代码块外的双括号模板
- 尖括号检查 - 查找格式的内容
<数字 - SkillHeader属性验证 - 校验组件使用是否合规
- 必填文件检查 - 确认英雄图片、ZIP文件存在
速度:常规提交场景下耗时不到5秒
Expert vs Novice Approach
专家与新手的处理方式对比
| Novice | Expert |
|---|---|
| Runs full build to check | Pre-commit catches 90% in 5 seconds |
| Manual cache clearing | Auto-detect cache issues |
| Ignores warnings | Zero-tolerance for broken links |
| Simple regex validation | Context-aware (skips code blocks) |
| 新手做法 | 专家做法 |
|---|---|
| 运行完整构建来检查错误 | 提交前钩子在5秒内排查90%的问题 |
| 手动清理缓存 | 自动检测缓存问题 |
| 忽略构建警告 | 零容忍处理无效链接 |
| 使用简单正则验证 | 上下文感知(跳过代码块内容) |
Anti-Patterns
反模式示例
Anti-Pattern: Full Build for Validation
反模式:通过完整构建进行验证
What it looks like: to check for errors
Why wrong: Minutes vs seconds, slow feedback
Instead: (under 30 seconds)
npm run buildnpm run validate:all表现:执行来检查错误
问题:耗时数分钟而非数秒,反馈缓慢
替代方案:执行(耗时不到30秒)
npm run buildnpm run validate:allAnti-Pattern: Ignoring Build Warnings
反模式:忽略构建警告
What it looks like: "Build succeeded, ship it!" (ignoring warnings)
Why wrong: Broken links = poor UX, tech debt
Instead: Post-build validation fails on warnings
表现:「构建成功,直接发布!」(忽略警告信息)
问题:无效链接会导致糟糕的用户体验,积累技术债务
替代方案:构建后验证在出现警告时判定失败
Anti-Pattern: Naive Regex Validation
反模式:简单正则验证
What it looks like: (matches in code blocks too)
Why wrong: False positives in code examples
Instead: Track code block state, skip protected regions
/\{\{.*?\}\}/表现:使用(会匹配代码块内的内容)
问题:在代码示例中产生误报
替代方案:跟踪代码块状态,跳过受保护区域
/\{\{.*?\}\}/Scripts (in scripts/
folder)
scripts/脚本说明(位于scripts/
目录)
scripts/| Script | Purpose |
|---|---|
| Detect unescaped Liquid syntax |
| Detect unescaped angle brackets |
| Validate SkillHeader component |
| 脚本 | 用途 |
|---|---|
| 检测未转义的Liquid语法 |
| 检测未转义的尖括号 |
| 验证SkillHeader组件属性 |
Troubleshooting Quick Reference
故障排查速查
| Issue | Diagnosis | Fix |
|---|---|---|
| Hook not running | | |
| False positives | Pattern in code block | Check ``` markers |
| Slow validation | | Optimize glob patterns |
| 问题 | 诊断方法 | 修复方案 |
|---|---|---|
| 钩子未运行 | 执行 | 执行 |
| 出现误报 | 匹配内容位于代码块内 | 检查```标记是否正确 |
| 验证速度缓慢 | 执行 | 优化glob匹配规则 |
Success Metrics
成效指标
After installing hooks:
- Build failure rate: 15% → under 2%
- Time to diagnose errors: 10 min → under 1 min
- Validation speed: Under 30 seconds
安装钩子后:
- 构建失败率:15% → 降至2%以下
- 错误诊断时间:10分钟 → 缩短至1分钟以内
- 验证速度:耗时不到30秒
Reference Files
参考文件
- - Context-aware detection patterns
references/validation-logic.md - - GitHub Actions, health reports
references/ci-cd-integration.md - - Working validation scripts
scripts/
Prevents: Liquid errors | Angle bracket failures | Prop mismatches | Missing assets | Broken links
Use with: skill-documentarian (sync) | docusaurus-expert (advanced config)
- - 上下文感知检测规则说明
references/validation-logic.md - - GitHub Actions集成、健康报告配置
references/ci-cd-integration.md - - 可用的验证脚本
scripts/
预防问题类型:Liquid语法错误 | 尖括号解析失败 | 属性不匹配 | 资源缺失 | 无效链接
搭配使用角色:skill-documentarian(同步协作) | docusaurus-expert(高级配置)