The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
feat(commands): add token-card command
iyashjayesh10525231276f
diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.jsonindex 4f3624062..acc0a4183 100644--- a/.claude-plugin/marketplace.json+++ b/.claude-plugin/marketplace.json@@ -11,7 +11,7 @@{"name": "ecc","source": "./",- "description": "Harness-native ECC operator layer - 68 agents, 286 skills, 94 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses",+ "description": "Harness-native ECC operator layer - 68 agents, 286 skills, 95 legacy command shims, reusable hooks, rules, selective install profiles, and production-ready workflows for Claude Code, Codex, OpenCode, Cursor, and related agent harnesses","version": "2.2.1","author": {"name": "Affaan Mustafa",diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.jsonindex f3e48987a..75a663370 100644--- a/.claude-plugin/plugin.json+++ b/.claude-plugin/plugin.json@@ -1,7 +1,7 @@{"name": "ecc","version": "2.2.1",- "description": "Harness-native ECC plugin for engineering teams - 68 agents, 286 skills, 94 legacy command shims, reusable hooks, rules, MCP conventions, and operator workflows for Claude Code plus adjacent agent harnesses",+ "description": "Harness-native ECC plugin for engineering teams - 68 agents, 286 skills, 95 legacy command shims, reusable hooks, rules, MCP conventions, and operator workflows for Claude Code plus adjacent agent harnesses","author": {"name": "Affaan Mustafa","url": "https://x.com/affaanmustafa"diff --git a/AGENTS.md b/AGENTS.mdindex 98f6f0ff4..4e5e04fb7 100644--- a/AGENTS.md+++ b/AGENTS.md@@ -1,6 +1,6 @@# Everything Claude Code (ECC) — Agent Instructions-This is a **production-ready AI coding plugin** providing 68 specialized agents, 286 skills, 94 commands, and automated hook workflows for software development.+This is a **production-ready AI coding plugin** providing 68 specialized agents, 286 skills, 95 commands, and automated hook workflows for software development.**Version:** 2.2.1@@ -155,7 +155,7 @@ Troubleshoot failures: check test isolation → verify mocks → fix implementat```agents/ — 68 specialized subagentsskills/ — 286 workflow skills and domain knowledge-commands/ — 94 slash commands+commands/ — 95 slash commandshooks/ — Trigger-based automationsrules/ — Always-follow guidelines (common + per-language)scripts/ — Cross-platform Node.js utilitiesdiff --git a/COMMANDS-QUICK-REF.md b/COMMANDS-QUICK-REF.mdindex 6a9fa22e2..ae52f0d14 100644--- a/COMMANDS-QUICK-REF.md+++ b/COMMANDS-QUICK-REF.md@@ -224,6 +224,7 @@ These lifecycle commands are also available through the `ecc` CLI.| `/setup-pm` | Configure package manager (npm / pnpm / yarn / bun) || `/auto-update` | Pull the latest ECC repo changes and reinstall the current managed targets || `/cost-report` | Generate a local Claude Code cost report from a cost-tracker SQLite database |+| `/token-card` | Render a token-usage stat card from local agent session logs and commit it to the repo || `/security-scan` | Run AgentShield against agent, hook, MCP, permission, and secret surfaces || `/jira` | Retrieve a Jira ticket, analyze requirements, update status, or add comments || `/pr` | Create a GitHub PR from current branch with unpushed commits |diff --git a/README.md b/README.mdindex 091836e33..6974af89b 100644--- a/README.md+++ b/README.md@@ -162,13 +162,13 @@ Instead of rebuilding that process in every prompt, you install it once and makeECC is MIT-licensed open source. It works best with Claude Code today, has a supported Codex sync path, and provides capability-limited adapters for Cursor, OpenCode, Gemini, Zed, GitHub Copilot, Antigravity, Qwen, and other harnesses. See the [support status matrix](#platform-support) before assuming feature parity.-Access to 68 agents, 286 skills, and 94 legacy command shims, plus hooks, rules, memory, continuous learning, and AgentShield security scanning. The agents are specialized for planning, review, build repair, security, architecture, and domain work.+Access to 68 agents, 286 skills, and 95 legacy command shims, plus hooks, rules, memory, continuous learning, and AgentShield security scanning. The agents are specialized for planning, review, build repair, security, architecture, and domain work.| Included | Count | What it gives you || ---------------- | ----------: | ------------------------------------------------------------------------------------ || Agents | 68 agents | Planning, review, build repair, security, architecture, and domain work || Skills | 286 skills | TDD, research, security, docs, frontend, data, ML, operations, and more |-| Commands | 94 commands | Convenient entry points while ECC moves to a skills-first surface |+| Commands | 95 commands | Convenient entry points while ECC moves to a skills-first surface || Hooks and memory | Runtime | Enforcement, session summaries, continuous learning, instincts, and context controls || Rules | Selective | Always-loaded standards you choose by language or project || AgentShield | Included | Scanning for prompts, hooks, MCP config, permissions, secrets, and agent files |diff --git a/README.zh-CN.md b/README.zh-CN.mdindex 8eb90eba8..753539cdc 100644--- a/README.zh-CN.md+++ b/README.zh-CN.md@@ -196,7 +196,7 @@ Copy-Item -Recurse rules/typescript "$HOME/.claude/rules/"/plugin list ecc@ecc```-**完成!** 你现在可以使用 68 个代理、286 个技能和 94 个命令。+**完成!** 你现在可以使用 68 个代理、286 个技能和 95 个命令。### multi-* 命令需要额外配置diff --git a/agent.yaml b/agent.yamlindex ff7abe065..5aa9b2aec 100644--- a/agent.yaml+++ b/agent.yaml@@ -250,6 +250,7 @@ commands:- skill-create- skill-health- test-coverage+ - token-card- update-codemaps- update-docs- vue-reviewdiff --git a/commands/token-card.md b/commands/token-card.mdnew file mode 100644index 000000000..37fb6ce5a--- /dev/null+++ b/commands/token-card.md@@ -0,0 +1,70 @@+---+description: Render a token-usage stat card from local agent session logs and commit it to the repo.+argument-hint: [--out PATH] [--theme auto|light|dark] [--dry-run]+---++# Token Card++## Purpose++Produce an SVG card summarising this machine's AI coding agent usage — total tokens,+equivalent API cost, current streak, and the split across agents — and write it into the+working tree as a file the README can reference.++The card is a committed artifact rather than a hosted image, so it renders from the+repository itself and does not depend on a third-party endpoint staying up.++## Relationship to `/cost-report`++They read different sources and produce different things, so both are useful:++| | `/cost-report` | `/token-card` |+|---|---|---|+| Source | `~/.claude/metrics/costs.jsonl`, written by ECC's `stop:cost-tracker` hook | The agents' own session logs |+| Agents | Claude Code | Claude Code, Codex, OpenCode |+| Output | Terminal summary, optional CSV | An SVG file committed to the repo |++Use `/cost-report` to answer "what did I spend this week". Use `/token-card` to put a+current figure in a README.++## Usage++```+/token-card # write ./tokenchit.svg+/token-card --out docs/usage.svg # write somewhere else+/token-card --theme dark+/token-card --dry-run # report what would be written, write nothing+```++## Workflow++1. Check whether `.tokenchit.json` exists in the repository root. If it does not, run+ `npx -y @tokenchit/cli@latest init` to detect which agents have logs on this machine and+ record them. That file is meant to be committed and never contains a credential.+2. Run `npx -y @tokenchit/cli@latest sync` with any arguments the user supplied. This reads+ only local files and makes no network request, so it is safe before deciding whether to+ publish anything.+3. Report the figures it prints — tokens, equivalent cost, streak, per-agent split — and the+ path it wrote.+4. If the repository has a README and the card is not referenced yet, offer to add the+ image reference. Do not edit the README without asking.++Stop after step 3 unless the user asks to publish. `sync` is local-only; joining the public+leaderboard is a separate `publish` command that requires an explicit opt-in, and+`unpublish` removes the row and the account again.++## Output++The path of the SVG that was written, the figures it contains, and the markdown snippet for+referencing it:++```markdown++```++## Notes++- Requires Node.js. Nothing is installed globally; `npx` fetches the CLI per invocation.+- Reads token counts and timestamps only. Prompts, code, and file contents are never parsed+ or transmitted.+- `@tokenchit/cli` is MIT licensed: <https://github.com/iyashjayesh/tokenchit>diff --git a/docs/COMMAND-REGISTRY.json b/docs/COMMAND-REGISTRY.jsonindex 29b1cd647..dc7c258bc 100644--- a/docs/COMMAND-REGISTRY.json+++ b/docs/COMMAND-REGISTRY.json@@ -1,6 +1,6 @@{"schemaVersion": 1,- "totalCommands": 94,+ "totalCommands": 95,"commands": [{"command": "aside",@@ -990,6 +990,15 @@"skills": [],"path": "commands/test-coverage.md"},+ {+ "command": "token-card",+ "description": "Render a token-usage stat card from local agent session logs and commit it to the repo.",+ "type": "testing",+ "primaryAgents": [],+ "allAgents": [],+ "skills": [],+ "path": "commands/token-card.md"+ },{"command": "update-codemaps","description": "Scan project structure and generate token-lean architecture codemaps.",@@ -1034,7 +1043,7 @@"planning": 2,"refactoring": 1,"review": 15,- "testing": 53+ "testing": 54},"topAgents": [{diff --git a/docs/tr/AGENTS.md b/docs/tr/AGENTS.mdindex 97d8a07c0..000b09c03 100644--- a/docs/tr/AGENTS.md+++ b/docs/tr/AGENTS.md@@ -1,6 +1,6 @@# Everything Claude Code (ECC) — Agent Talimatları-Bu, yazılım geliştirme için 68 özel agent, 286 skill, 94 command ve otomatik hook iş akışları sağlayan **üretime hazır bir AI kodlama eklentisidir**.+Bu, yazılım geliştirme için 68 özel agent, 286 skill, 95 command ve otomatik hook iş akışları sağlayan **üretime hazır bir AI kodlama eklentisidir**.**Sürüm:** 2.2.1@@ -143,7 +143,7 @@ Başarısızlık sorunlarını giderin: test izolasyonunu kontrol edin → mockl```agents/ — 68 özel subagentskills/ — 286 iş akışı skillleri ve alan bilgisi-commands/ — 94 slash command+commands/ — 95 slash commandhooks/ — Tetikleyici tabanlı otomasyonlarrules/ — Her zaman uyulması gereken kurallar (ortak + dile özel)scripts/ — Platformlar arası Node.js yardımcı programlarıdiff --git a/docs/zh-CN/AGENTS.md b/docs/zh-CN/AGENTS.mdindex 871719a16..d8e3f3757 100644--- a/docs/zh-CN/AGENTS.md+++ b/docs/zh-CN/AGENTS.md@@ -1,6 +1,6 @@# Everything Claude Code (ECC) — 智能体指令-这是一个**生产就绪的 AI 编码插件**,提供 68 个专业代理、286 项技能、94 条命令以及自动化钩子工作流,用于软件开发。+这是一个**生产就绪的 AI 编码插件**,提供 68 个专业代理、286 项技能、95 条命令以及自动化钩子工作流,用于软件开发。**版本:** 2.2.1@@ -148,7 +148,7 @@```agents/ — 68 个专业子代理skills/ — 286 个工作流技能和领域知识-commands/ — 94 个斜杠命令+commands/ — 95 个斜杠命令hooks/ — 基于触发的自动化rules/ — 始终遵循的指导方针(通用 + 每种语言)scripts/ — 跨平台 Node.js 实用工具diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.mdindex c8c0e3228..0de6fad64 100644--- a/docs/zh-CN/README.md+++ b/docs/zh-CN/README.md@@ -260,7 +260,7 @@ Copy-Item -Recurse rules/typescript "$HOME/.claude/rules/"/plugin list ecc@ecc```-**搞定!** 你现在可以使用 68 个智能体、286 项技能和 94 个命令了。+**搞定!** 你现在可以使用 68 个智能体、286 项技能和 95 个命令了。***@@ -1173,7 +1173,7 @@ opencode| 功能特性 | Claude Code | OpenCode | 状态 ||---------|---------------|----------|--------|| 智能体 | PASS: 68 个 | PASS: 12 个 | **Claude Code 领先** |-| 命令 | PASS: 94 个 | PASS: 35 个 | **Claude Code 领先** |+| 命令 | PASS: 95 个 | PASS: 35 个 | **Claude Code 领先** || 技能 | PASS: 286 项 | PASS: 37 项 | **Claude Code 领先** || 钩子 | PASS: 8 种事件类型 | PASS: 11 种事件 | **OpenCode 更多!** || 规则 | PASS: 29 条 | PASS: 13 条指令 | **Claude Code 领先** |@@ -1281,7 +1281,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以| 功能特性 | Claude Code | Cursor IDE | Codex CLI | OpenCode ||---------|-----------------------|------------|-----------|----------|| **智能体** | 68 | 共享 (AGENTS.md) | 共享 (AGENTS.md) | 12 |-| **命令** | 94 | 共享 | 基于指令 | 35 |+| **命令** | 95 | 共享 | 基于指令 | 35 || **技能** | 286 | 共享 | 10 (原生格式) | 37 || **钩子事件** | 8 种类型 | 15 种类型 | SessionStart(1 种类型) | 11 种类型 || **钩子脚本** | 20+ 个脚本 | 16 个脚本 (DRY 适配器) | 1 个 SessionStart 引导脚本 | 插件钩子 |