Show ACE playbook statistics and learning status
Display comprehensive statistics about your ACE playbook, including pattern counts by section, average confidence scores, and top helpful/harmful patterns. Use this to monitor learning progress and identify which patterns need refinement.
/plugin marketplace add ce-dot-net/ce-claude-marketplace/plugin install ace@ce-dot-net-marketplaceDisplay comprehensive statistics about your ACE playbook.
Call ace-cli to get current statistics:
#!/usr/bin/env bash
set -euo pipefail
# CLI detection: ace-cli (preferred) or ce-ace (fallback)
if ! command -v ace-cli >/dev/null 2>&1; then
echo "❌ ace-cli not found - Install: npm install -g @ace-sdk/cli"
exit 1
fi
# Check for jq (required for JSON formatting)
if ! command -v jq >/dev/null 2>&1; then
echo "❌ jq not found - Install: brew install jq (macOS) or apt-get install jq (Linux)"
exit 1
fi
# Version check: Query npm registry directly (Issue #8 - CLI version check broken)
INSTALLED_VERSION=$(ace-cli --version 2>/dev/null | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo "unknown")
LATEST_VERSION=$(curl -s "https://registry.npmjs.org/@ace-sdk/cli/latest" 2>/dev/null | jq -r '.version // "unknown"' || echo "unknown")
if [ "$INSTALLED_VERSION" != "unknown" ] && [ "$LATEST_VERSION" != "unknown" ]; then
if [ "$INSTALLED_VERSION" != "$LATEST_VERSION" ]; then
echo "💡 Update available: ace-cli v$INSTALLED_VERSION → v$LATEST_VERSION"
echo " Run: npm install -g @ace-sdk/cli@latest"
echo ""
fi
fi
# Optional: Export environment variables if available from .claude/settings.json
# ace-cli will use these if provided, otherwise fallback to global config
export ACE_ORG_ID="${ACE_ORG_ID:-}"
export ACE_PROJECT_ID="${ACE_PROJECT_ID:-}"
# Run ace-cli status and capture output
# Filter out CLI update notifications (💡 lines) that break JSON parsing
RAW_OUTPUT=$(ace-cli status --json 2>&1)
EXIT_CODE=$?
STATUS_OUTPUT=$(echo "$RAW_OUTPUT" | grep -v '^💡' | grep -v '^$')
# Check if command succeeded
if [ $EXIT_CODE -ne 0 ]; then
echo "❌ Failed to get ACE status"
echo ""
echo "Error details:"
echo "$STATUS_OUTPUT"
echo ""
echo "Common fixes:"
echo " 1. Run: /ace-configure to setup configuration"
echo " 2. Verify global config exists: cat ~/.config/ace/config.json"
echo " 3. Check API token is valid at: https://ace.code-engine.app/settings"
exit 1
fi
# Verify we got valid JSON
if ! echo "$STATUS_OUTPUT" | jq empty 2>/dev/null; then
echo "❌ Invalid response from ace-cli (not valid JSON)"
echo ""
echo "Response:"
echo "$STATUS_OUTPUT"
exit 1
fi
# Format output for readability
echo "$STATUS_OUTPUT" | jq -r '
"📊 ACE Playbook Status",
"━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━",
"Organization: \(.org_id // "Not configured")",
"Project: \(.project_id // "Not configured")",
"",
"📚 Total Patterns: \(.total_bullets // 0)",
"",
"By Section:",
" • Strategies & Rules: \(.by_section.strategies_and_hard_rules // 0)",
" • Code Snippets: \(.by_section.useful_code_snippets // 0)",
" • Troubleshooting: \(.by_section.troubleshooting_and_pitfalls // 0)",
" • APIs to Use: \(.by_section.apis_to_use // 0)",
"",
"📈 Average Confidence: \((.avg_confidence // 0) * 100 | floor)%"
'
Playbook Summary:
Top Helpful Bullets:
Top Harmful Bullets:
{
"total_bullets": 42,
"by_section": {
"strategies_and_hard_rules": 10,
"useful_code_snippets": 15,
"troubleshooting_and_pitfalls": 12,
"apis_to_use": 5
},
"avg_confidence": 0.78,
"top_helpful": [
{
"id": "ctx-1737387600-a1b2c",
"section": "strategies_and_hard_rules",
"content": "Always verify npm package names...",
"helpful": 12,
"harmful": 0,
"confidence": 1.0
},
...
],
"top_harmful": [...]
}
High helpful count → Pattern proven useful across multiple tasks High harmful count → Pattern caused errors, needs revision High confidence → helpful/(helpful+harmful) ratio is strong Low confidence → Pattern unreliable, may be pruned at 0.30 threshold
ACE v3.0 stores playbooks in:
After checking status:
If playbook is empty (0 bullets):
/ace:bootstrap to populate initial patterns from git/docs/codeIf not configured yet:
/ace:configure to set up ACE server connectionIf ACE not initialized in project:
/ace:claude-init to add ACE instructions to CLAUDE.md/ace:configure - Configure ACE server connection/ace:claude-init - Initialize ACE in project/ace:bootstrap - Bootstrap playbook from git/docs/code/ace:patterns - View learned patterns/ace:clear - Clear playbook and start fresh