maintenance
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMaintenance
维护
Infra health audit. Investigate → Flag → Create issues. Never modify code, configs, or repo contents.
Install via npx:
bash
npx skills add fellowship-dev/dogfooded-skills/ops/maintenanceArchitecture/doc checks have moved to. This skill covers infrastructure only: processes, secrets, labels, branches, dependencies, system health, and memory hygiene./entropy-check
基础设施健康审计流程:调查→标记→创建议题。绝不修改代码、配置或仓库内容。
通过npx安装:
bash
npx skills add fellowship-dev/dogfooded-skills/ops/maintenance架构/文档检查已迁移至。 本技能仅覆盖基础设施相关内容: 进程、密钥、标签、分支、依赖项、系统健康状况和内存管理。/entropy-check
When to Use
使用场景
- Weekly scheduled run (cron) — full infra sweep
- After a system change (new LaunchAgent, new cron job)
- When an automated task seems to have stopped working
- When disk or brew issues are suspected
- 每周定时运行(cron)——全面扫描基础设施
- 系统变更后(新增LaunchAgent、新增cron任务)
- 自动化任务疑似停止工作时
- 怀疑存在磁盘或brew问题时
Guiding Principle
指导原则
Maintenance takes 10x more effort than building. This job surfaces problems Max can't see day-to-day. Output: a report + GitHub issues for anything worth tracking.
维护所需的精力是构建的10倍。本任务旨在发现Max日常无法察觉的问题。输出内容:一份报告 + 值得跟踪的问题对应的GitHub议题。
Instructions
操作步骤
Run ALL checks. Each finding either becomes a GitHub issue in fellowship-dev/claude-buddy or is noted as clean.
bash
undefined运行所有检查项。每个发现的问题要么在fellowship-dev/claude-buddy中创建GitHub议题,要么标记为无异常。
bash
undefinedSet GH_TOKEN at the start of every run
每次运行开始时设置GH_TOKEN
export GH_TOKEN=$(grep GH_TOKEN_FELLOWSHIP /home/ubuntu/projects/fellowship-dev/claude-buddy/.env | cut -d= -f2)
---export GH_TOKEN=$(grep GH_TOKEN_FELLOWSHIP /home/ubuntu/projects/fellowship-dev/claude-buddy/.env | cut -d= -f2)
---1. Memory Consolidation (always)
1. 内存整合(必做)
bash
wc -l /home/ubuntu/projects/fellowship-dev/claude-buddy/memory/MEMORY.md
ls ~/.claude/projects/-Users-maxfindel-Projects-claude-buddy/*.jsonl | wc -l- MEMORY.md >180 lines → compact, run
/save-memory - JSONL session files: ignore accumulation — ~5MB each is fine, no action needed
bash
wc -l /home/ubuntu/projects/fellowship-dev/claude-buddy/memory/MEMORY.md
ls ~/.claude/projects/-Users-maxfindel-Projects-claude-buddy/*.jsonl | wc -l- MEMORY.md行数>180 → 压缩,运行
/save-memory - JSONL会话文件:忽略累积情况——每个约5MB即可,无需操作
2. Secrets Scan
2. 密钥扫描
bash
grep -r "ghp_\|ghs_\|sk-\|xoxb-\|AAEi\|AAAA[a-zA-Z0-9]" \
/home/ubuntu/projects/fellowship-dev/claude-buddy/ \
--include="*.md" --include="*.sh" --include="*.py" --include="*.mjs" \
-l 2>/dev/null | grep -v ".git"Flag any file with a live-looking token/key that is git-tracked.
bash
grep -r "ghp_\|ghs_\|sk-\|xoxb-\|AAEi\|AAAA[a-zA-Z0-9]" \
/home/ubuntu/projects/fellowship-dev/claude-buddy/ \
--include="*.md" --include="*.sh" --include="*.py" --include="*.mjs" \
-l 2>/dev/null | grep -v ".git"标记任何包含可正常使用的令牌/密钥且被git追踪的文件。
3. Dependabot Coverage
3. Dependabot覆盖情况
Read . For every active repo (Products + Tooling, skip FVL):
PROJECTS.mdbash
GH_TOKEN=$GH_TOKEN gh api repos/{org}/{repo}/contents/.github/dependabot.yml 2>&1- Missing config → flag as issue
- Config present but silent >30 days → flag
阅读。对于每个活跃仓库(产品+工具类,跳过FVL):
PROJECTS.mdbash
GH_TOKEN=$GH_TOKEN gh api repos/{org}/{repo}/contents/.github/dependabot.yml 2>&1- 缺少配置文件 → 标记为问题
- 配置文件存在但超过30天无更新 → 标记
4. Stale Branches
4. 过时分支
For active repos, check for branches that are merged but not deleted:
bash
GH_TOKEN=$GH_TOKEN gh api repos/{org}/{repo}/branches --paginate \
--jq '.[].name' 2>/dev/null对于活跃仓库,检查已合并但未删除的分支:
bash
GH_TOKEN=$GH_TOKEN gh api repos/{org}/{repo}/branches --paginate \
--jq '.[].name' 2>/dev/nullCross-reference against merged PRs
与已合并的PR交叉验证
Flag repos with >5 stale merged branches.
---
标记存在超过5个已合并过时分支的仓库。
---5. LaunchAgent Health
5. LaunchAgent健康状况
bash
ls ~/Library/LaunchAgents/fry.*.plist | while read f; do
target=$(grep -o '/[^<]*' "$f" | grep -E '\.sh|\.py|\.mjs' | head -1)
[ -f "$target" ] || echo "MISSING: $f → $target"
done
launchctl list | grep fryFlag any plist pointing to a missing file, or any fry agent not loaded.
bash
ls ~/Library/LaunchAgents/fry.*.plist | while read f; do
target=$(grep -o '/[^<]*' "$f" | grep -E '\.sh|\.py|\.mjs' | head -1)
[ -f "$target" ] || echo "MISSING: $f → $target"
done
launchctl list | grep fry标记任何指向不存在文件的plist,或任何未加载的fry agent。
6. Cron Log Errors (last 7 days)
6. Cron日志错误(最近7天)
bash
ls -t ~/.local/share/fry-bot/cron-logs/*.log | head -20 | xargs grep -l "FAILED\|ERROR\|timeout" 2>/dev/nullRecurring failures in the same job = flag as issue with log excerpt.
bash
ls -t ~/.local/share/fry-bot/cron-logs/*.log | head -20 | xargs grep -l "FAILED\|ERROR\|timeout" 2>/dev/null同一任务反复失败 → 标记为问题并附上日志片段。
7. PROJECTS.md Accuracy
7. PROJECTS.md准确性
- Check repos listed as active: do they still exist on GitHub?
- Check repos listed as Dormant: any commits in last 30 days?
- Any new repos Max created that aren't in PROJECTS.md?
bash
GH_TOKEN=$GH_TOKEN gh repo list {org} --json name,isArchived,pushedAt --limit 50Run for: maxfindel, fellowship-dev, Lexgo-cl, CLAPES-UC, Energia-UC.
- 检查标记为活跃的仓库:是否仍在GitHub上存在?
- 检查标记为休眠的仓库:最近30天是否有提交?
- Max是否创建了未列入PROJECTS.md的新仓库?
bash
GH_TOKEN=$GH_TOKEN gh repo list {org} --json name,isArchived,pushedAt --limit 50针对以下组织/用户运行:maxfindel, fellowship-dev, Lexgo-cl, CLAPES-UC, Energia-UC。
8. Spacestation System Health
8. Spacestation系统健康状况
bash
brew outdated --quiet | wc -l
df -h / | tail -1- Brew packages outdated >20 → flag
- Disk >85% used → flag
bash
brew outdated --quiet | wc -l
df -h / | tail -1- brew包过时数量>20 → 标记
- 磁盘使用率>85% → 标记
9. Label Sync
9. 标签同步
Verify standard labels across active repos.
For each active fellowship-dev repo (farmesa, inbox-angel, booster-pack, mtg-lotr, commander):
bash
STANDARD="ready-to-work in-progress needs-manual-review reviewed double-checked ready-to-merge groundwork dependencies bug enhancement documentation"
for repo in farmesa inbox-angel booster-pack mtg-lotr commander; do
existing=$(GH_TOKEN=$GH_TOKEN gh label list --repo fellowship-dev/$repo \
--json name --jq '.[].name' 2>/dev/null | tr '\n' ' ')
for label in $STANDARD; do
echo "$existing" | grep -q "$label" || echo "MISSING: fellowship-dev/$repo → $label"
done
done- Any missing labels → run to add them (idempotent, safe to do inline)
gh label create - Report how many were created vs already present
验证活跃仓库的标准标签是否一致。
针对每个fellowship-dev的活跃仓库(farmesa, inbox-angel, booster-pack, mtg-lotr, commander):
bash
STANDARD="ready-to-work in-progress needs-manual-review reviewed double-checked ready-to-merge groundwork dependencies bug enhancement documentation"
for repo in farmesa inbox-angel booster-pack mtg-lotr commander; do
existing=$(GH_TOKEN=$GH_TOKEN gh label list --repo fellowship-dev/$repo \
--json name --jq '.[].name' 2>/dev/null | tr '\n' ' ')
for label in $STANDARD; do
echo "$existing" | grep -q "$label" || echo "MISSING: fellowship-dev/$repo → $label"
done
done- 任何缺失的标签 → 运行添加(幂等操作,可直接执行)
gh label create - 报告新增标签数量与已存在标签数量
10. Booster-Pack Sync
10. Booster-Pack同步
Pull changes into dependent sites.
Find all local repos that have a git remote:
boosterbash
for dir in ~/Projects/fellowship-dev/*/; do
if git -C "$dir" remote | grep -q '^booster$' 2>/dev/null; then
repo=$(basename "$dir")
BEHIND=$(git -C "$dir" rev-list HEAD..booster/main --count 2>/dev/null || echo "?")
echo "fellowship-dev/$repo: $BEHIND commits behind booster-pack"
fi
done- If any site is >0 commits behind → queue a task in overnight-tasks.md: , type
pull-booster-{repo-slug}, executormaintenance, prompt{project-path}.git pull booster main --no-edit && git push - If there are conflicts → flag for Max instead, do not pull autonomously.
将变更拉取到依赖站点。
查找所有带有 git远程仓库的本地仓库:
boosterbash
for dir in ~/Projects/fellowship-dev/*/; do
if git -C "$dir" remote | grep -q '^booster$' 2>/dev/null; then
repo=$(basename "$dir")
BEHIND=$(git -C "$dir" rev-list HEAD..booster/main --count 2>/dev/null || echo "?")
echo "fellowship-dev/$repo: $BEHIND commits behind booster-pack"
fi
done- 若任何站点落后提交数>0 → 在overnight-tasks.md中添加任务:,类型为
pull-booster-{repo-slug},执行路径为maintenance,提示语为{project-path}。git pull booster main --no-edit && git push - 若存在冲突 → 标记给Max处理,不要自主拉取。
11. Open Issues in fellowship-dev/claude-buddy
11. fellowship-dev/claude-buddy中的开放议题
List all open issues — no action, just surface in report so Max sees the backlog.
bash
GH_TOKEN=$GH_TOKEN gh issue list --repo fellowship-dev/claude-buddy --state open \
--json number,title,labels,createdAt列出所有开放议题——无需操作,仅在报告中展示以便Max查看积压情况。
bash
GH_TOKEN=$GH_TOKEN gh issue list --repo fellowship-dev/claude-buddy --state open \
--json number,title,labels,createdAtCreating Issues
创建议题
Before creating any issue, check for duplicates:
bash
undefined创建任何议题前,先检查是否存在重复:
bash
undefinedFetch open + closed issue titles (closed catches older attempts at the same problem)
获取开放+已关闭的议题标题(已关闭的包含之前针对同一问题的尝试)
GH_TOKEN=$GH_TOKEN gh issue list --repo fellowship-dev/claude-buddy
--state all --limit 200 --json number,title,state
--jq '.[] | "(.state) #(.number): (.title)"'
--state all --limit 200 --json number,title,state
--jq '.[] | "(.state) #(.number): (.title)"'
- If a matching open issue already exists → add a comment or just note it in the report. Do NOT create a duplicate.
- If a matching closed issue exists → only re-open or create a new one if the problem has clearly recurred. Note the previous issue number in the body.
For each **new** finding with no existing issue:
```bash
GH_TOKEN=$GH_TOKEN gh issue create \
--repo fellowship-dev/claude-buddy \
--title "Maintenance: {finding}" \
--label "maintenance" \
--body "..."GH_TOKEN=$GH_TOKEN gh issue list --repo fellowship-dev/claude-buddy
--state all --limit 200 --json number,title,state
--jq '.[] | "(.state) #(.number): (.title)"'
--state all --limit 200 --json number,title,state
--jq '.[] | "(.state) #(.number): (.title)"'
- 若已存在匹配的开放议题 → 添加评论或仅在报告中注明。**不要创建重复议题。**
- 若存在匹配的已关闭议题 → 仅当问题明显再次出现时才重新打开或创建新议题。在议题正文中注明之前的议题编号。
针对每个**新的**无对应议题的发现:
```bash
GH_TOKEN=$GH_TOKEN gh issue create \
--repo fellowship-dev/claude-buddy \
--title "Maintenance: {finding}" \
--label "maintenance" \
--body "..."Output
输出内容
Save report to :
reports/maintenance/YYYY-MM-DD.mdmarkdown
undefined将报告保存至:
reports/maintenance/YYYY-MM-DD.mdmarkdown
undefinedMaintenance Report — YYYY-MM-DD
维护报告 — YYYY-MM-DD
Checks Run
已运行检查项
- Memory consolidation
- Secrets scan
- Dependabot coverage
- Stale branches
- LaunchAgent health
- Cron log errors
- PROJECTS.md accuracy
- Spacestation system health
- Label sync
- Booster-pack sync
- Open issues review
Note: Architecture/doc drift checks have moved to /entropy-check (separate skill)
- 内存整合
- 密钥扫描
- Dependabot覆盖情况
- 过时分支
- LaunchAgent健康状况
- Cron日志错误
- PROJECTS.md准确性
- Spacestation系统健康状况
- 标签同步
- Booster-Pack同步
- 开放议题审核
注意:架构/文档偏差检查已迁移至/entropy-check(独立技能)
Findings
发现结果
Issues Created
创建的议题
- issue fellowship-dev/claude-buddy#N: {title}
- 议题 fellowship-dev/claude-buddy#N: {title}
Clean
无异常
- {area}: nothing flagged
- {领域}: 未发现问题
Noted (no issue, low severity)
已记录(无需创建议题,低严重性)
- {finding}
- {发现内容}
Memory
内存情况
- MEMORY.md: {N} lines
- JSONL sessions: {N} files
Then output a short Telegram summary:
🔧 Maintenance — YYYY-MM-DD
{N} issues created: [list with links]
{N} areas clean
Memory: {N}/200 lines
Full report: reports/maintenance/YYYY-MM-DD.md
---- MEMORY.md: {N}行
- JSONL会话文件: {N}个
然后输出简短的Telegram摘要:
🔧 维护 — YYYY-MM-DD
已创建{N}个议题:[带链接的列表]
{N}个领域无异常
内存使用:{N}/200行
完整报告:reports/maintenance/YYYY-MM-DD.md
---What Was Removed from This Skill
本技能移除的内容
Section 11 (Imported lib drift — speckit and toolkit) was extracted to .
/entropy-checkWhy: Checking whether speckit commands match the source of truth is an architecture/doc check — it measures whether the tooling knowledge layer is current. Entropy-check owns all doc/architecture freshness signals. This skill owns infra only.
To check speckit drift: run against the target repo.
/entropy-check**第11节(导入库偏差——speckit和toolkit)**已提取至。
/entropy-check原因: 检查speckit命令是否与源一致属于架构/文档检查——用于衡量工具知识层是否最新。Entropy-check负责所有文档/架构新鲜度相关检测。本技能仅负责基础设施相关内容。
如需检查speckit偏差:针对目标仓库运行。
/entropy-check