npx skills add https://github.com/boshu2/agentops --skill flywheel监控知识飞轮的健康状况。
Sessions → Transcripts → Forge → Pool → Promote → Knowledge
↑ │
└───────────────────────────────────────────────┘
Future sessions find it
速度 = 知识流经的速率 摩擦 = 阻碍飞轮运转的瓶颈
给定 /flywheel 命令:
# 统计顶层工件文件(避免统计目录)
LEARNINGS=$(find .agents/learnings -maxdepth 1 -type f 2>/dev/null | wc -l)
PATTERNS=$(find .agents/patterns -maxdepth 1 -type f 2>/dev/null | wc -l)
RESEARCH=$(find .agents/research -maxdepth 1 -type f 2>/dev/null | wc -l)
RETROS=$(find .agents/retros -maxdepth 1 -type f 2>/dev/null | wc -l)
echo "Learnings: $LEARNINGS"
echo "Patterns: $PATTERNS"
echo "Research: $RESEARCH"
echo "Retros: $RETROS"
# 近期学习成果(过去 7 天)
find .agents/learnings -maxdepth 1 -type f -mtime -7 2>/dev/null | wc -l
# 近期研究
find .agents/research -maxdepth 1 -type f -mtime -7 2>/dev/null | wc -l
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
# 旧工件(超过 30 天未修改)
find .agents/ -name "*.md" -mtime +30 2>/dev/null | wc -l
if command -v ao &>/dev/null; then
# 获取引用报告(缓存指标)
CITE_REPORT=$(ao metrics cite-report --json --days 30 2>/dev/null)
if [ -n "$CITE_REPORT" ]; then
HIT_RATE=$(echo "$CITE_REPORT" | jq -r '.hit_rate // "unknown"')
UNCITED=$(echo "$CITE_REPORT" | jq -r '(.uncited_learnings // []) | length')
STALE_90D=$(echo "$CITE_REPORT" | jq -r '.staleness["90d"] // 0')
echo "Cache hit rate: $HIT_RATE"
echo "Uncited learnings: $UNCITED"
echo "Stale (90d uncited): $STALE_90D"
fi
else
# 无 ao 回退方案:根据文件计算近似指标
echo "Cache health (ao-free fallback):"
# 过去 30 天内修改的学习成果(活跃池)
ACTIVE_30D=$(find .agents/learnings/ -name "*.md" -mtime -30 2>/dev/null | wc -l | tr -d ' ')
echo "Active learnings (30d): $ACTIVE_30D"
# 等待提升的 Forge 候选
FORGE_PENDING=$(ls .agents/forge/*.md 2>/dev/null | wc -l | tr -d ' ')
echo "Forge candidates pending: $FORGE_PENDING"
# 引用跟踪(如果 citations.jsonl 存在)
if [ -f .agents/ao/citations.jsonl ]; then
CITATION_COUNT=$(wc -l < .agents/ao/citations.jsonl | tr -d ' ')
UNIQUE_CITED=$(grep -o '"learning_file":"[^"]*"' .agents/ao/citations.jsonl 2>/dev/null | sort -u | wc -l | tr -d ' ')
echo "Total citations: $CITATION_COUNT"
echo "Unique learnings cited: $UNIQUE_CITED"
else
echo "No citation data (citations.jsonl not found)"
fi
# 会话结果(如果 outcomes.jsonl 存在)
if [ -f .agents/ao/outcomes.jsonl ]; then
OUTCOME_COUNT=$(wc -l < .agents/ao/outcomes.jsonl | tr -d ' ')
echo "Session outcomes recorded: $OUTCOME_COUNT"
fi
fi
if command -v ao &>/dev/null; then
ao metrics flywheel status 2>/dev/null || echo "ao metrics flywheel status unavailable"
ao status 2>/dev/null || echo "ao status unavailable"
ao maturity --scan 2>/dev/null || echo "ao maturity unavailable"
ao promote-anti-patterns --dry-run 2>/dev/null || echo "ao promote-anti-patterns unavailable"
ao badge 2>/dev/null || echo "ao badge unavailable"
# 知识维护
ao dedup --merge 2>/dev/null || true
ao contradict 2>/dev/null || true
ao constraint review 2>/dev/null || true
ao curate status 2>/dev/null || true
ao metrics health 2>/dev/null || true
ao metrics cite-report --days 30 2>/dev/null || true
# 主动修剪:归档陈旧内容,驱逐低效用内容
ao maturity --expire --archive 2>/dev/null || true
ao maturity --evict --archive 2>/dev/null || true
else
echo "ao CLI not available — using file-based metrics"
# 知识池清单
echo "Pool depths:"
for pool in learnings patterns forge knowledge research retros; do
COUNT=$(ls .agents/${pool}/*.md 2>/dev/null | wc -l | tr -d ' ')
echo " $pool: $COUNT"
done
# 全局模式
GLOBAL_COUNT=$(ls ~/.claude/patterns/*.md 2>/dev/null | wc -l | tr -d ' ')
echo " global patterns: $GLOBAL_COUNT"
# 检查可提升的学习成果(参见 references/promotion-tiers.md)
echo "See: skills/flywheel/references/promotion-tiers.md for tier definitions"
fi
如果 .agents/ao/skill-telemetry.jsonl 存在,使用 jq 提取:按技能分类的调用次数、每个技能的平均周期时间、关卡失败率。将其包含在健康报告(步骤 6)的 ## Process Metrics 部分。
交叉引用验证:扫描知识工件中损坏的内部引用。使用 scripts/artifact-consistency.sh(方法记录在 references/artifact-consistency.md 中)。默认白名单位于 references/artifact-consistency-allowlist.txt;使用 --no-allowlist 进行完整的原始审计。
健康指标:>90% = 健康,70-90% = 警告,<70% = 严重。
写入文件: .agents/flywheel-status.md
# Knowledge Flywheel Health
**Date:** YYYY-MM-DD
## Pool Depths
| Pool | Count | Recent (7d) |
|------|-------|-------------|
| Learnings | <count> | <count> |
| Patterns | <count> | <count> |
| Research | <count> | <count> |
| Retros | <count> | <count> |
## Velocity (Last 7 Days)
- Sessions with extractions: <count>
- New learnings: <count>
- New patterns: <count>
## Artifact Consistency
- References scanned: <count>
- Broken references: <count>
- Consistency score: <percentage>%
- Status: <Healthy/Warning/Critical>
## Cache Health
- Hit rate: <percentage>%
- Uncited learnings: <count>
- Stale (90d uncited): <count>
- Status: <Healthy/Warning/Critical>
## Health Status
<Healthy/Warning/Critical>
## Friction Points
- <issue 1>
- <issue 2>
## Recommendations
1. <recommendation>
2. <recommendation>
告知用户:
| 指标 | 健康 | 警告 | 严重 |
|---|---|---|---|
| 每周学习成果 | 3+ | 1-2 | 0 |
| 陈旧工件 | <20% | 20-50% | >50% |
| 研究/计划比率 | >0.5 | 0.2-0.5 | <0.2 |
| 缓存命中率 | >80% | 50-80% | <50% |
阅读 references/cache-eviction.md 了解完整的驱逐流程(被动跟踪 → 置信度衰减 → 成熟度扫描 → 归档)。
用户输入: /flywheel — 统计知识池深度,检查近期活动,验证工件一致性,将健康报告写入 .agents/flywheel-status.md。
钩子触发: 在 /post-mortem 之后 — 比较当前与历史指标,标记速度下降和摩擦点。
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 所有知识池计数为零 | .agents/ 目录缺失或为空 | 运行 /post-mortem 或 /retro 来填充知识池 |
| 速度始终为零 | 近期没有提取(过去 7 天) | 运行 /retro 或 /post-mortem 来提取和索引学习成果 |
| "ao CLI not available" | ao 命令未安装或不在 PATH 中 | 安装 ao CLI 或使用手动知识池计数回退方案 |
| 陈旧工件 >50% | 距离上次会话时间过长或仓库不活跃 | 运行 /provenance --stale 来审计和归档旧工件 |
每周安装次数
207
仓库
GitHub 星标数
197
首次出现
2026年2月2日
安全审计
安装于
codex204
github-copilot203
opencode202
amp202
kimi-cli202
gemini-cli202
Monitor the knowledge flywheel health.
Sessions → Transcripts → Forge → Pool → Promote → Knowledge
↑ │
└───────────────────────────────────────────────┘
Future sessions find it
Velocity = Rate of knowledge flowing through Friction = Bottlenecks slowing the flywheel
Given /flywheel:
# Count top-level artifact files (avoid counting directories)
LEARNINGS=$(find .agents/learnings -maxdepth 1 -type f 2>/dev/null | wc -l)
PATTERNS=$(find .agents/patterns -maxdepth 1 -type f 2>/dev/null | wc -l)
RESEARCH=$(find .agents/research -maxdepth 1 -type f 2>/dev/null | wc -l)
RETROS=$(find .agents/retros -maxdepth 1 -type f 2>/dev/null | wc -l)
echo "Learnings: $LEARNINGS"
echo "Patterns: $PATTERNS"
echo "Research: $RESEARCH"
echo "Retros: $RETROS"
# Recent learnings (last 7 days)
find .agents/learnings -maxdepth 1 -type f -mtime -7 2>/dev/null | wc -l
# Recent research
find .agents/research -maxdepth 1 -type f -mtime -7 2>/dev/null | wc -l
# Old artifacts (> 30 days without modification)
find .agents/ -name "*.md" -mtime +30 2>/dev/null | wc -l
if command -v ao &>/dev/null; then
# Get citation report (cache metrics)
CITE_REPORT=$(ao metrics cite-report --json --days 30 2>/dev/null)
if [ -n "$CITE_REPORT" ]; then
HIT_RATE=$(echo "$CITE_REPORT" | jq -r '.hit_rate // "unknown"')
UNCITED=$(echo "$CITE_REPORT" | jq -r '(.uncited_learnings // []) | length')
STALE_90D=$(echo "$CITE_REPORT" | jq -r '.staleness["90d"] // 0')
echo "Cache hit rate: $HIT_RATE"
echo "Uncited learnings: $UNCITED"
echo "Stale (90d uncited): $STALE_90D"
fi
else
# ao-free fallback: compute approximate metrics from files
echo "Cache health (ao-free fallback):"
# Learnings modified in last 30 days (active pool)
ACTIVE_30D=$(find .agents/learnings/ -name "*.md" -mtime -30 2>/dev/null | wc -l | tr -d ' ')
echo "Active learnings (30d): $ACTIVE_30D"
# Forge candidates awaiting promotion
FORGE_PENDING=$(ls .agents/forge/*.md 2>/dev/null | wc -l | tr -d ' ')
echo "Forge candidates pending: $FORGE_PENDING"
# Citation tracking (if citations.jsonl exists)
if [ -f .agents/ao/citations.jsonl ]; then
CITATION_COUNT=$(wc -l < .agents/ao/citations.jsonl | tr -d ' ')
UNIQUE_CITED=$(grep -o '"learning_file":"[^"]*"' .agents/ao/citations.jsonl 2>/dev/null | sort -u | wc -l | tr -d ' ')
echo "Total citations: $CITATION_COUNT"
echo "Unique learnings cited: $UNIQUE_CITED"
else
echo "No citation data (citations.jsonl not found)"
fi
# Session outcomes (if outcomes.jsonl exists)
if [ -f .agents/ao/outcomes.jsonl ]; then
OUTCOME_COUNT=$(wc -l < .agents/ao/outcomes.jsonl | tr -d ' ')
echo "Session outcomes recorded: $OUTCOME_COUNT"
fi
fi
if command -v ao &>/dev/null; then
ao metrics flywheel status 2>/dev/null || echo "ao metrics flywheel status unavailable"
ao status 2>/dev/null || echo "ao status unavailable"
ao maturity --scan 2>/dev/null || echo "ao maturity unavailable"
ao promote-anti-patterns --dry-run 2>/dev/null || echo "ao promote-anti-patterns unavailable"
ao badge 2>/dev/null || echo "ao badge unavailable"
# Knowledge maintenance
ao dedup --merge 2>/dev/null || true
ao contradict 2>/dev/null || true
ao constraint review 2>/dev/null || true
ao curate status 2>/dev/null || true
ao metrics health 2>/dev/null || true
ao metrics cite-report --days 30 2>/dev/null || true
# Active pruning: archive stale, evict low-utility
ao maturity --expire --archive 2>/dev/null || true
ao maturity --evict --archive 2>/dev/null || true
else
echo "ao CLI not available — using file-based metrics"
# Pool inventory
echo "Pool depths:"
for pool in learnings patterns forge knowledge research retros; do
COUNT=$(ls .agents/${pool}/*.md 2>/dev/null | wc -l | tr -d ' ')
echo " $pool: $COUNT"
done
# Global patterns
GLOBAL_COUNT=$(ls ~/.claude/patterns/*.md 2>/dev/null | wc -l | tr -d ' ')
echo " global patterns: $GLOBAL_COUNT"
# Check for promotion-ready learnings (see references/promotion-tiers.md)
echo "See: skills/flywheel/references/promotion-tiers.md for tier definitions"
fi
If .agents/ao/skill-telemetry.jsonl exists, use jq to extract: invocations by skill, average cycle time per skill, gate failure rates. Include in health report (Step 6) under ## Process Metrics.
Cross-reference validation: scan knowledge artifacts for broken internal references. Use scripts/artifact-consistency.sh (method documented in references/artifact-consistency.md). Default allowlist lives at references/artifact-consistency-allowlist.txt; use --no-allowlist for a full raw audit.
Health indicator: >90% = Healthy, 70-90% = Warning, <70% = Critical.
Write to: .agents/flywheel-status.md
# Knowledge Flywheel Health
**Date:** YYYY-MM-DD
## Pool Depths
| Pool | Count | Recent (7d) |
|------|-------|-------------|
| Learnings | <count> | <count> |
| Patterns | <count> | <count> |
| Research | <count> | <count> |
| Retros | <count> | <count> |
## Velocity (Last 7 Days)
- Sessions with extractions: <count>
- New learnings: <count>
- New patterns: <count>
## Artifact Consistency
- References scanned: <count>
- Broken references: <count>
- Consistency score: <percentage>%
- Status: <Healthy/Warning/Critical>
## Cache Health
- Hit rate: <percentage>%
- Uncited learnings: <count>
- Stale (90d uncited): <count>
- Status: <Healthy/Warning/Critical>
## Health Status
<Healthy/Warning/Critical>
## Friction Points
- <issue 1>
- <issue 2>
## Recommendations
1. <recommendation>
2. <recommendation>
Tell the user:
| Metric | Healthy | Warning | Critical |
|---|---|---|---|
| Learnings/week | 3+ | 1-2 | 0 |
| Stale artifacts | <20% | 20-50% | >50% |
| Research/plan ratio | >0.5 | 0.2-0.5 | <0.2 |
| Cache hit rate | >80% | 50-80% | <50% |
Read references/cache-eviction.md for the full eviction pipeline (passive tracking → confidence decay → maturity scan → archive).
User says: /flywheel — Counts pool depths, checks recent activity, validates artifact consistency, writes health report to .agents/flywheel-status.md.
Hook trigger: After /post-mortem — Compares current vs historical metrics, flags velocity drops and friction points.
| Problem | Cause | Solution |
|---|---|---|
| All pool counts zero | .agents/ directory missing or empty | Run /post-mortem or /retro to seed knowledge pools |
| Velocity always zero | No recent extractions (last 7 days) | Run /retro or /post-mortem to extract and index learnings |
| "ao CLI not available" | ao command not installed or not in PATH | Install ao CLI or use manual pool counting fallback |
| Stale artifacts >50% | Long time since last session or inactive repo | Run to audit and archive old artifacts |
Weekly Installs
207
Repository
GitHub Stars
197
First Seen
Feb 2, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex204
github-copilot203
opencode202
amp202
kimi-cli202
gemini-cli202
超能力技能使用指南:AI助手技能调用优先级与工作流程详解
41,800 周安装
/provenance --stale