diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index acc0a4183..4ade1b5de 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, 95 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, 287 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.json index 75a663370..9dc28739d 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, 95 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, 287 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.md index 4e5e04fb7..0391df9c5 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, 95 commands, and automated hook workflows for software development. +This is a **production-ready AI coding plugin** providing 68 specialized agents, 287 skills, 95 commands, and automated hook workflows for software development. **Version:** 2.2.1 @@ -154,7 +154,7 @@ Troubleshoot failures: check test isolation → verify mocks → fix implementat ``` agents/ — 68 specialized subagents -skills/ — 286 workflow skills and domain knowledge +skills/ — 287 workflow skills and domain knowledge commands/ — 95 slash commands hooks/ — Trigger-based automations rules/ — Always-follow guidelines (common + per-language) diff --git a/README.md b/README.md index 6974af89b..ecf33fe0f 100644 --- a/README.md +++ b/README.md @@ -162,12 +162,12 @@ Instead of rebuilding that process in every prompt, you install it once and make ECC 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 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. +Access to 68 agents, 287 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 | +| Skills | 287 skills | TDD, research, security, docs, frontend, data, ML, operations, and more | | 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 | diff --git a/README.zh-CN.md b/README.zh-CN.md index 753539cdc..589032fd1 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 个技能和 95 个命令。 +**完成!** 你现在可以使用 68 个代理、287 个技能和 95 个命令。 ### multi-* 命令需要额外配置 diff --git a/agent.yaml b/agent.yaml index 5aa9b2aec..abcde4c2a 100644 --- a/agent.yaml +++ b/agent.yaml @@ -152,6 +152,7 @@ skills: - tdd-workflow - team-builder - token-budget-advisor + - token-card - unified-memory - verification-loop - video-editing diff --git a/commands/token-card.md b/commands/token-card.md index 37fb6ce5a..8c537b827 100644 --- a/commands/token-card.md +++ b/commands/token-card.md @@ -1,31 +1,13 @@ --- -description: Render a token-usage stat card from local agent session logs and commit it to the repo. +description: Render a token-usage stat card from local agent session logs and commit it to the repo. Invokes the token-card skill. 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. +Thin compatibility shim. The workflow lives in the **token-card** skill +(`skills/token-card/SKILL.md`), which is the canonical surface; this command exists so the +slash-command harnesses can reach it. ## Usage @@ -36,35 +18,11 @@ current figure in a README. /token-card --dry-run # report what would be written, write nothing ``` -## Workflow +## What it does -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. +Renders an SVG card of this machine's AI coding agent usage — tokens, equivalent cost, +streak, per-agent split — from local Claude Code, Codex and OpenCode session logs, and writes +it into the working tree as a file the README can reference. -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 -![tokenchit](./tokenchit.svg) -``` - -## 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: +Follow the skill for the full workflow, including the confirmation required before the first +registry download, the pinned CLI version, and the dry-run rules. diff --git a/docs/COMMAND-REGISTRY.json b/docs/COMMAND-REGISTRY.json index dc7c258bc..c5b76b617 100644 --- a/docs/COMMAND-REGISTRY.json +++ b/docs/COMMAND-REGISTRY.json @@ -992,11 +992,13 @@ }, { "command": "token-card", - "description": "Render a token-usage stat card from local agent session logs and commit it to the repo.", - "type": "testing", + "description": "Render a token-usage stat card from local agent session logs and commit it to the repo. Invokes the token-card skill.", + "type": "general", "primaryAgents": [], "allAgents": [], - "skills": [], + "skills": [ + "token-card" + ], "path": "commands/token-card.md" }, { @@ -1038,12 +1040,12 @@ "statistics": { "byType": { "build": 2, - "general": 10, + "general": 11, "orchestration": 11, "planning": 2, "refactoring": 1, "review": 15, - "testing": 54 + "testing": 53 }, "topAgents": [ { diff --git a/docs/tr/AGENTS.md b/docs/tr/AGENTS.md index 000b09c03..fec63aafb 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, 95 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, 287 skill, 95 command ve otomatik hook iş akışları sağlayan **üretime hazır bir AI kodlama eklentisidir**. **Sürüm:** 2.2.1 @@ -142,7 +142,7 @@ Başarısızlık sorunlarını giderin: test izolasyonunu kontrol edin → mockl ``` agents/ — 68 özel subagent -skills/ — 286 iş akışı skillleri ve alan bilgisi +skills/ — 287 iş akışı skillleri ve alan bilgisi commands/ — 95 slash command hooks/ — Tetikleyici tabanlı otomasyonlar rules/ — Her zaman uyulması gereken kurallar (ortak + dile özel) diff --git a/docs/zh-CN/AGENTS.md b/docs/zh-CN/AGENTS.md index d8e3f3757..30598bfaf 100644 --- a/docs/zh-CN/AGENTS.md +++ b/docs/zh-CN/AGENTS.md @@ -1,6 +1,6 @@ # Everything Claude Code (ECC) — 智能体指令 -这是一个**生产就绪的 AI 编码插件**,提供 68 个专业代理、286 项技能、95 条命令以及自动化钩子工作流,用于软件开发。 +这是一个**生产就绪的 AI 编码插件**,提供 68 个专业代理、287 项技能、95 条命令以及自动化钩子工作流,用于软件开发。 **版本:** 2.2.1 @@ -147,7 +147,7 @@ ``` agents/ — 68 个专业子代理 -skills/ — 286 个工作流技能和领域知识 +skills/ — 287 个工作流技能和领域知识 commands/ — 95 个斜杠命令 hooks/ — 基于触发的自动化 rules/ — 始终遵循的指导方针(通用 + 每种语言) diff --git a/docs/zh-CN/README.md b/docs/zh-CN/README.md index 0de6fad64..ce8704120 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 项技能和 95 个命令了。 +**搞定!** 你现在可以使用 68 个智能体、287 项技能和 95 个命令了。 *** @@ -1174,7 +1174,7 @@ opencode |---------|---------------|----------|--------| | 智能体 | PASS: 68 个 | PASS: 12 个 | **Claude Code 领先** | | 命令 | PASS: 95 个 | PASS: 35 个 | **Claude Code 领先** | -| 技能 | PASS: 286 项 | PASS: 37 项 | **Claude Code 领先** | +| 技能 | PASS: 287 项 | PASS: 37 项 | **Claude Code 领先** | | 钩子 | PASS: 8 种事件类型 | PASS: 11 种事件 | **OpenCode 更多!** | | 规则 | PASS: 29 条 | PASS: 13 条指令 | **Claude Code 领先** | | MCP 服务器 | PASS: 14 个 | PASS: 完整 | **完全对等** | @@ -1282,7 +1282,7 @@ ECC 是**第一个最大化利用每个主要 AI 编码工具的插件**。以 |---------|-----------------------|------------|-----------|----------| | **智能体** | 68 | 共享 (AGENTS.md) | 共享 (AGENTS.md) | 12 | | **命令** | 95 | 共享 | 基于指令 | 35 | -| **技能** | 286 | 共享 | 10 (原生格式) | 37 | +| **技能** | 287 | 共享 | 10 (原生格式) | 37 | | **钩子事件** | 8 种类型 | 15 种类型 | SessionStart(1 种类型) | 11 种类型 | | **钩子脚本** | 20+ 个脚本 | 16 个脚本 (DRY 适配器) | 1 个 SessionStart 引导脚本 | 插件钩子 | | **规则** | 34 (通用 + 语言) | 34 (YAML 前页) | 基于指令 | 13 条指令 | diff --git a/manifests/install-modules.json b/manifests/install-modules.json index 0e45965a5..93d924913 100644 --- a/manifests/install-modules.json +++ b/manifests/install-modules.json @@ -558,6 +558,7 @@ "skills/messages-ops", "skills/project-flow-ops", "skills/terminal-ops", + "skills/token-card", "skills/unified-notifications-ops", "skills/workspace-surface-audit", "skills/mailtrap-email-integration" diff --git a/package.json b/package.json index 70f136fc9..42bd2a6b9 100644 --- a/package.json +++ b/package.json @@ -337,6 +337,7 @@ "skills/terminal-opener/", "skills/terminal-ops/", "skills/token-budget-advisor/", + "skills/token-card/", "skills/ui-demo/", "skills/ui-to-vue/", "skills/unified-memory/", diff --git a/skills/token-card/SKILL.md b/skills/token-card/SKILL.md new file mode 100644 index 000000000..be93c599e --- /dev/null +++ b/skills/token-card/SKILL.md @@ -0,0 +1,102 @@ +--- +name: token-card +description: Render a token-usage stat card from local Claude Code, Codex, and OpenCode session logs and commit it into the repository as a file. Use when someone wants a current usage figure in a README, or asks for a shareable card of their coding-agent activity. +metadata: + origin: community +--- + +# Token Card + +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. + +## When to Use + +- Someone wants a usage figure visible in a README or docs page. +- Someone asks for a shareable summary of their agent activity across tools. + +Use `/cost-report` instead when the question is "what did I spend this week". The two read +different sources and produce different things: + +| | `/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 | + +## The tool this runs + +`@tokenchit/cli`, MIT licensed: + +**Pinned to an exact version, deliberately.** `@latest` resolves to whatever the registry +currently serves, and this tool reads local session logs — so a compromised future release +would be executed with access to them before anyone had reviewed it. Pin, and raise the pin +knowingly: + +```bash +TOKENCHIT_VERSION=0.7.0 +``` + +To check the pinned artifact before running it the first time: + +```bash +npm view @tokenchit/cli@0.7.0 dist.integrity dist.tarball +``` + +## Workflow + +1. **Ask before the first download.** `npx` fetches the package from the npm registry and + executes it. That is a remote download of code that will read local logs, so get explicit + confirmation from the user before the first run on a machine. If they decline, stop here + and say what would have run. + +2. **Configure, unless this is a dry run.** If `.tokenchit.json` is absent, run: + + ```bash + npx -y @tokenchit/cli@0.7.0 init + ``` + + It detects which agents have logs on this machine and records them. The file is meant to + be committed and never contains a credential. + + **Skip this entirely when the user passed `--dry-run`**, and report that `.tokenchit.json` + *would* be created. A preview that writes a config file is not a preview. + +3. **Render the card:** + + ```bash + npx -y @tokenchit/cli@0.7.0 sync [--out PATH] [--theme auto|light|dark] [--dry-run] + ``` + + `sync` reads local files and sends nothing: no prompts, no code, no file contents leave + the machine, and it transmits nothing to any server. The npx invocation around it is a + registry download — that is the network access in this workflow, and step 1 is where it + is agreed. + +4. **Report and offer.** Print the figures it produced — tokens, equivalent cost, streak, + per-agent split — and the path written. If the repository has a README that does not yet + reference the card, offer to add: + + ```markdown + ![tokenchit](./tokenchit.svg) + ``` + + Do not edit the README without being asked. + +Stop after step 4. Publishing to the public leaderboard is a separate `publish` command that +requires explicit opt-in, and is not part of this workflow — run it only if the user asks for +it by name. `unpublish` removes the row and the account again. + +## Output + +The path of the SVG, the figures it contains, and the markdown snippet for referencing it. +On a dry run: what would have been written, and nothing on disk changed. + +## Notes + +- Requires Node.js. Nothing is installed globally; `npx` fetches the pinned version per run. +- Reads token counts and timestamps only.