Skip to content

docs(skills): streamline agent guidance and enforce commit scopes - #1555

Merged
ryoppippi merged 9 commits into
mainfrom
fix-skills
Aug 1, 2026
Merged

ryoppippi merged 9 commits into
mainfrom
fix-skills

Conversation

@ryoppippi

@ryoppippi ryoppippi commented Jul 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Two related changes to how this repository instructs agents and names commits.

Skills rewritten for current frontier models. Every skill under .agents/skills was rewritten following Anthropic's prompt-reduction work and the context engineering guidance that came out of it — both now linked from skill-creator so future edits keep the same bar. Prohibitions and "always" rules became the repo fact plus the judgement it implies, derivable examples are gone, and paraphrases of code became pointers to the file that shows it. Eleven reference files merged into the skill that linked them. AGENTS.md, which loads before an agent knows what it is doing, keeps only routing, repository shape, and the policies an agent would otherwise violate unknowingly.

The set drops from 2250 to 1103 lines and AGENTS.md from 140 to 55, with no repo-specific fact lost — paths, just recipes, crate and adapter names, fixtures, and validation steps were each checked against the tree.

Commit and PR title scopes are now enforced. A subject cannot reveal an invented scope on its own: feat(coding) reads fine until you know the change was codex. A commit-msg hook reads the ownership off the staged paths and rejects a scope that points elsewhere, or is missing when the change belongs to one adapter. CI applies the same rules to the PR title, since a squash merge makes that title the subject on main.

Why only rust/adapters/* maps to a scope

Replaying the rules over the last 400 commits showed that deriving a scope from the crates rejects good messages — those crates are catch-alls whose commits are scoped by feature (cost, statusline, json) rather than by crate name. With adapters alone the replay produces no false rejection, while perf(rust) and chore(deps) stay available for workspace-wide and cross-cutting changes.

Testing

  • 18 hook cases over a throwaway repository: correct scope, wrong scope, missing scope, feat(coding) on a codex-only change, multi-adapter changes, rust/adapters/common deriving adapter, cross-cutting scopes, merge and fixup subjects, and a comment-only message.
  • The same cases against the CI script with a stubbed gh, checking exit codes.
  • Replay of both rule sets over the last 400 commits: no false rejection.
  • just fmt clean, actionlint clean, nu --ide-check clean on both scripts, and the hook validated every commit in this PR.

The PR title check itself only runs once this workflow is on main, so its first real exercise is the next PR.


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.


Summary by cubic

Streamlined repo-local agent skills and enforced Conventional Commit scopes so commit subjects and PR titles reflect the adapter changed, closing a scope-bypass edge case. This reduces docs noise and keeps wrong scopes off main.

  • New Features

    • Enforced adapter scopes: single-adapter changes must use that adapter; cross-cutting changes can use workspace scopes. Added a commit-msg hook via nix/git-hooks.nix that runs scripts/validate-commit-scope.nu, and a PR title check in .github/workflows/check-pr-title.yaml with the same rules.
    • Hardened validation: every scope in a comma-separated list must be allowed; matched PR title-check exemptions to the shape check.
  • Refactors

    • Rewrote skills under .agents/skills for clarity; merged 11 references; reduced content from 2250 → 1103 lines. Trimmed AGENTS.md to routing and policy; aligned package/adapters docs; corrected nix/tools runtime (Bun) and clarified when chore: format needs an adapter scope.
    • Added ccusage-specific TDD failure-mode guidance (horizontal slicing, tautological expectations, mocking inside system seams like --offline, CLAUDE_CONFIG_DIR, and ccusage-test-support); removed generic .cpuprofile reading advice.

Written for commit 717d77b. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Documentation

    • Refreshed contributor guidance covering development, testing, profiling, documentation, releases, pull requests, and AI-assisted workflows.
    • Clarified repository conventions, command usage, adapter practices, and supported CLI behavior.
  • Quality Improvements

    • Added validation to ensure commit and pull-request titles use approved Conventional Commit scopes.
    • Added pre-commit checks to identify invalid scopes before submission.
    • Improved validation guidance for reviews, testing, and release readiness.

A subject line cannot reveal an invented scope on its own: `feat(coding)`
reads fine until you know the change was codex. Add a commit-msg hook that
reads the ownership off the staged paths instead and rejects a scope that
points elsewhere, or is missing when the change belongs to one adapter.

Only `rust/adapters/*` maps to a scope. Replaying the rules over the last 400
commits showed that deriving one from the crates rejects good messages,
because those crates are catch-alls whose commits are scoped by feature
(`cost`, `statusline`, `json`) rather than by crate name. With adapters alone
the replay produces no false rejection, while `perf(rust)` and `chore(deps)`
stay available for workspace-wide and cross-cutting changes.
A squash merge writes the pull request title as the subject that lands on
main, so the commit-msg hook never sees it. Check the title against the same
adapter ownership rules, reading the changed files from the API so the job
needs no checkout.

The rules are inline rather than a call into scripts/validate-commit-scope.nu:
running that script would mean cloning the repository and installing Nix for a
title check. The two copies are cross-referenced so they move together.
An outside contributor's PR title is now rejected by CI when its scope names
something other than the adapter it changes, so the rule belongs where they
read before opening one.
AGENTS.md loads before an agent knows what it is doing, so it should carry
only what is true at that point: where code lives, which skill owns what, and
the policies an agent would otherwise violate unknowingly. Everything else was
a second copy of a skill that loads on trigger anyway.

Move the task-time detail into the owning skills, drop what one `ls` or
`just --list` reveals, and name real files where the guidance pointed at a
description of them. The root file goes from 140 to 55 lines.
Rewrite every skill under .agents/skills for current frontier models,
following the prompt-reduction work Anthropic describes and the context
engineering guidance that came out of it, both now linked from skill-creator.

Three edits repeated across the set. Prohibitions and "always" rules that
restate good practice become the repo fact plus the judgement the fact
implies, because a "do not" collides badly with a user instruction and the
model already applies the practice. Examples the model can derive are gone;
what remains is the shape that cannot be guessed. Paraphrases of code become
pointers to the file that shows it, so the skill cannot drift from what it
describes.

Eleven reference files merged into the skill that linked them, or into the
skill that already owned the topic. The set drops from 2250 to 1103 lines with
no repo-specific fact lost: paths, just recipes, crate and adapter names,
fixtures, and validation steps were checked against the tree, and the ones an
earlier pass over-cut were restored.
Copilot AI review requested due to automatic review settings July 31, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
ccusage-guide 717d77b Commit Preview URL

Branch Preview URL
Aug 01 2026, 11:17 AM

@coderabbitai

coderabbitai Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request reorganizes repository and agent-skill guidance around the Rust adapter architecture. It updates development, testing, profiling, and workflow instructions. It also adds adapter-aware Conventional Commit scope validation to Git hooks and pull-request CI.

Changes

Repository and adapter guidance

Layer / File(s) Summary
Repository and adapter guidance
AGENTS.md, CONTRIBUTING.md, apps/ccusage/AGENTS.md, docs/AGENTS.md, rust/adapters/AGENTS.md
Updates repository structure, adapter workflows, documentation rules, package boundaries, and commit-title requirements.

Source and runtime guidance

Layer / File(s) Summary
Source and runtime guidance
.agents/skills/agent-sources/*, .agents/skills/rust/*, .agents/skills/typescript/*, .agents/skills/profile/*, .agents/skills/rust-binary-size/*, .agents/skills/reduce-similarities/*, .agents/skills/testing/*
Aligns source, runtime, pricing, profiling, binary-size, similarity, and testing guidance with the Rust adapter architecture.

Engineering and skill guidance

Layer / File(s) Summary
Engineering and skill guidance
.agents/skills/development/*, .agents/skills/nushell/*, .agents/skills/docs/*, .agents/skills/cmux-debug/*, .agents/skills/skill-creator/*, .agents/skills/fix-ci/*, .agents/skills/ast-grep/*, .agents/skills/tdd/*
Revises development commands, Nushell practices, terminal validation, documentation audits, CI fixes, AST searches, and skill-authoring rules.

Commit and pull-request workflow

Layer / File(s) Summary
Commit and pull-request workflow
.agents/skills/commit/*, .agents/skills/create-pr/*
Consolidates atomic staging, branch handling, review polling, CI monitoring, PR creation, readiness, and merge guidance.

Commit and pull-request scope enforcement

Layer / File(s) Summary
Commit and pull-request scope enforcement
.github/workflows/check-pr-title.yaml, nix/git-hooks.nix, scripts/validate-commit-scope.nu
Adds adapter-owner discovery and Conventional Commit scope validation for commit hooks and pull-request titles.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant CommitHook
  participant ScopeValidator
  participant AdapterPaths
  participant PRWorkflow
  Developer->>CommitHook: create commit
  CommitHook->>ScopeValidator: validate subject and staged paths
  ScopeValidator->>AdapterPaths: derive adapter owners
  AdapterPaths-->>ScopeValidator: return owners
  ScopeValidator-->>CommitHook: accept or reject scope
  Developer->>PRWorkflow: open pull request
  PRWorkflow->>AdapterPaths: retrieve changed files
  PRWorkflow-->>Developer: report title-scope result
Loading

Possibly related PRs

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: streamlined agent guidance and enforced commit scopes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-skills

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog

pullfrog Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Diagnosis: The tirith security scan job failed because .agents/skills/rust/SKILL.md contained a bare URL (https://github.com/astral-sh/hawk on line 63) that tirith flagged as config_injection at the high severity threshold. The PR's skill rewrite had turned the original [hawk](https://github.com/astral-sh/hawk) markdown link into a bare URL.

Fix: Changed the bare URL back to a proper markdown link [hawk](https://github.com/astral-sh/hawk). Commit 30dcf27.

Push blocked: pullfrog_push_branch failed with 403 Permission to ccusage/ccusage.git denied to github-actions[bot]. The GITHUB_TOKEN does not have write access to push to this repository.

Task list (5/5 completed)

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | via Pullfrog | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

tirith reads "do not reveal" as a prompt-injection pattern and fails the scan
at error level, so the phrase cannot stay in a skill file.
Copilot AI review requested due to automatic review settings July 31, 2026 23:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Skills condensed — every skill under .agents/skills rewritten following the linked context-engineering guidance: prohibitions and always-rules replaced by repo facts plus the judgment they imply, derivable examples removed, code paraphrases replaced by file pointers. Six reference files fully deleted and merged into parent skills; many more trimmed. No repo-specific facts lost — paths, just recipes, crate names, fixture locations, and validation steps were traced against the tree.
  • AGENTS.md reduced — from 67 to 55 lines, keeping only routing, repository shape, and the policies an agent would violate unknowingly. Content that was load-time-duplicated between AGENTS.md and a skill moved to the skill.
  • Commit scope enforcement — new scripts/validate-commit-scope.nu commit-msg hook derives the owner from rust/adapters/<agent>/ staged paths and rejects a scope that names something else or is missing when the change is single-agent. Cross-cutting and workspace scopes accepted; rust/adapters/common/ maps to adapter. A matching CI job checks PR titles via gh api so the squash-merge subject on main passes the same rules.
  • Hook wiring — new ccusage-commit-scope entry in nix/git-hooks.nix, commit-msg stage, priority 0.
  • CONTRIBUTING.md — new "Commit and PR Titles" section documenting the convention for human contributors.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — one new commit since the initial review.

  • f217edae — rewords "Two boundaries the crate names do not reveal" to "Two boundaries the crate names hide" in .agents/skills/rust/SKILL.md. No behavioral impact.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pkg-pr-new

pkg-pr-new Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

ccusage

npx https://pkg.pr.new/ccusage@1555

@ccusage/ccusage-darwin-arm64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-arm64@1555

@ccusage/ccusage-darwin-x64

npx https://pkg.pr.new/@ccusage/ccusage-darwin-x64@1555

@ccusage/ccusage-linux-arm64

npx https://pkg.pr.new/@ccusage/ccusage-linux-arm64@1555

@ccusage/ccusage-linux-x64

npx https://pkg.pr.new/@ccusage/ccusage-linux-x64@1555

@ccusage/ccusage-win32-x64

npx https://pkg.pr.new/@ccusage/ccusage-win32-x64@1555

commit: 717d77b

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: f217edaee15c
Base SHA: 5ee72780d8c1

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 350.2ms 2.87 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 311.5ms 3.23 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 115.3ms 8.73 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.5ms 10.76 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 31.7ms 3.6ms 8.89x 55.00 MiB 12.45 MiB 0.23x 0.05 MiB/s 0.43 MiB/s
claude session --offline --json 0.00 MiB 26.3ms 2.8ms 9.25x 55.00 MiB 12.45 MiB 0.23x 0.06 MiB/s 0.54 MiB/s
codex daily --offline --json 0.00 MiB 26.1ms 2.4ms 10.67x 54.75 MiB 10.45 MiB 0.19x 0.03 MiB/s 0.35 MiB/s
codex session --offline --json 0.00 MiB 23.0ms 2.4ms 9.71x 55.00 MiB 10.46 MiB 0.19x 0.04 MiB/s 0.36 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 374.3ms 325.1ms 1.15x 948.59 MiB 958.59 MiB 1.01x 2.69 GiB/s 3.10 GiB/s
codex --offline --json 1.01 GiB 119.5ms 96.7ms 1.24x 392.90 MiB 420.91 MiB 1.07x 8.42 GiB/s 10.41 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 19.09 KiB 19.09 KiB -0.00 KiB 1.00x
installed native package binary 4194.28 KiB 4194.28 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: f217edaee15c
Base SHA: 5ee72780d8c1

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 358.9ms 2.81 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 328.1ms 3.07 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 118.4ms 8.51 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.3ms 10.79 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 26.3ms 26.5ms 0.99x 55.00 MiB 55.25 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 24.9ms 26.1ms 0.95x 55.00 MiB 55.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 23.1ms 23.1ms 1.00x 55.00 MiB 55.50 MiB 1.01x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 22.7ms 24.7ms 0.92x 55.25 MiB 55.00 MiB 1.00x 0.04 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 372.8ms 339.8ms 1.10x 956.59 MiB 966.59 MiB 1.01x 2.70 GiB/s 2.96 GiB/s
codex --offline --json 1.01 GiB 120.2ms 117.8ms 1.02x 420.91 MiB 398.90 MiB 0.95x 8.37 GiB/s 8.54 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 19.09 KiB 19.09 KiB -0.00 KiB 1.00x
installed native package binary 4194.28 KiB 4194.28 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".github/workflows/check-pr-title.yaml">

<violation number="1" location=".github/workflows/check-pr-title.yaml:51">
P3: Scope enforcement is implemented twice, so the local commit hook and CI can silently diverge whenever a scope or path-mapping rule changes. Running the repository script from CI (with a checkout), or extracting shared logic that both callers execute, would leave one source of truth.</violation>
</file>

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

Comment thread .agents/skills/profile/SKILL.md Outdated
Comment thread scripts/validate-commit-scope.nu Outdated
Comment thread .github/workflows/check-pr-title.yaml
Comment thread .agents/skills/commit/SKILL.md Outdated
# This job only calls GitHub APIs, so keeping the script inline avoids a repository clone.
run: |
# Mirrors scripts/validate-commit-scope.nu; the two move together.
const CROSS_CUTTING_SCOPES = [deps, release, pricing, revert]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Scope enforcement is implemented twice, so the local commit hook and CI can silently diverge whenever a scope or path-mapping rule changes. Running the repository script from CI (with a checkout), or extracting shared logic that both callers execute, would leave one source of truth.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/check-pr-title.yaml, line 51:

<comment>Scope enforcement is implemented twice, so the local commit hook and CI can silently diverge whenever a scope or path-mapping rule changes. Running the repository script from CI (with a checkout), or extracting shared logic that both callers execute, would leave one source of truth.</comment>

<file context>
@@ -23,3 +23,100 @@ jobs:
+        # This job only calls GitHub APIs, so keeping the script inline avoids a repository clone.
+        run: |
+          # Mirrors scripts/validate-commit-scope.nu; the two move together.
+          const CROSS_CUTTING_SCOPES = [deps, release, pricing, revert]
+          const WORKSPACE_SCOPES = [adapter, all, rust]
+          const GENERATED_SUBJECTS = ["Merge ", "Revert ", "fixup!", "squash!", "amend!"]
</file context>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deliberate, and kept as is. Running the script from CI would mean a checkout plus a Nix install for what is otherwise a single API call, so this job reads the changed files from the API and stays clone-free on ubuntu-slim. Both copies carry a comment pointing at the other, and the rule surface is small on purpose: three constant lists and one path mapping.

`fix(kimi,coding)` passed the check because one valid scope was enough, so a
comma-separated list could smuggle an unrelated name past the rule. Require
every scope in the list to be allowed.

Also skip the PR title job for the labels the shape check already exempts
(`autorelease: pending`, `dependencies`), so the two title policies judge the
same pull requests.
The profiling skill said the tools under nix/tools run on node; all three are
built with bunCli or bunNodeModules and run under Bun, so `node --cpu-prof`
would profile nothing. The commit skill's `chore: format` line now says when a
scope is required, since an adapter-only format commit needs one.
Copilot AI review requested due to automatic review settings July 31, 2026 23:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — two new commits since the prior pullfrog review at f217edae.

  • Closed scope bypass in validation — any → all in both scripts/validate-commit-scope.nu and .github/workflows/check-pr-title.yaml means every scope in a comma-separated list must be in the allowed set. Before this, feat(codex,foo) on a codex change would pass because any found codex valid; now it correctly rejects because foo is not.
  • CI scope job now respects title exemptions — added an if: condition on the scope job that skips PRs labeled autorelease: pending or dependencies, matching the shape-check job above it so the two title policies agree on which PRs they judge.
  • Corrected nix/tools runtime in profile skill — the tools under nix/tools/ run under Bun (built with bunCli/bunNodeModules), not Node as previously stated.
  • Clarified format-commit wording — chore: format vs chore(<scope>): format now references the scope rule instead of an opaque chore(xxx).

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🧹 Nitpick comments (1)
CONTRIBUTING.md (1)

60-68: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document all scopes accepted by the validator.

CONTRIBUTING.md documents only single-agent scopes. scripts/validate-commit-scope.nu Lines [1-55] also accepts deps, release, pricing, and revert, plus adapter, all, and rust for workspace changes. Document when contributors should use these scopes. Otherwise, valid multi-agent or cross-cutting commits are not discoverable from the contribution guide.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CONTRIBUTING.md` around lines 60 - 68, Update the “Commit and PR Titles”
section in CONTRIBUTING.md to document every scope accepted by
scripts/validate-commit-scope.nu: deps, release, pricing, revert, adapter, all,
and rust. Briefly state when to use each scope, including workspace-wide and
cross-cutting changes, while preserving the existing single-agent
directory-scope guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/commit/references/git-apply.md:
- Around line 3-19: Update the patch-staging guidance to use git apply --cached
--check before git apply --cached -v, so validation targets the index
consistently. Remove the --reject recommendation for commit staging and instruct
users to rebuild the patch and apply it only after all hunks validate cleanly.

In @.agents/skills/create-pr/references/gh-review.md:
- Around line 10-12: Update the inline-comment lookup command described in the
gh pr comment workflow to include the gh api --paginate option when retrieving
pull-request comments. Preserve the existing repository and pull-request
endpoint and subsequent comment-ID selection so comments on later pages can be
found and replied to.

In @.agents/skills/create-pr/references/open-pr.md:
- Around line 11-14: Update the CI description in open-pr.md to state that
check-pr-title.yaml uses a copied inline validator mirroring
scripts/validate-commit-scope.nu, rather than rerunning the script;
alternatively, modify the workflow to invoke the script and retain the existing
description.

In @.agents/skills/create-pr/SKILL.md:
- Line 14: Update the branch guidance in the create-PR workflow to require a
feature branch and pull request unconditionally, removing the exception that
permits direct pushes to main even with user permission. Keep the existing
branch naming convention and commit-scope guidance unchanged.

In @.agents/skills/development/references/commands.md:
- Around line 5-8: Update the command guidance to match the supplied root
justfile: remove schema from the list of Nix-owned whole-repository jobs, unless
a corresponding root schema recipe is added. Keep fmt and check unchanged.

In @.agents/skills/profile/SKILL.md:
- Around line 31-34: Update the profiling guidance in SKILL.md to separate
Node-launched tools from Bun-based tools under nix/tools. Identify
nix/tools/models-dev-gen and the bunCli-built tools as Bun targets, and
prescribe Bun-compatible profiling rather than NODE_OPTIONS or node --cpu-prof;
retain Node launcher guidance only for tools that actually run on Node.

In @.agents/skills/reduce-similarities/SKILL.md:
- Line 5: Update the allowed-tools declaration near the documented similarity-rs
invocation so the Bash allowlist matches the command users are instructed to
run: either permit the full direnv exec . similarity-rs command via an explicit
rule or remove the direnv prefix from the invocation when the bare similarity-rs
command is sufficient.

In @.agents/skills/rust-binary-size/SKILL.md:
- Around line 35-38: Update the Rust inspection commands in the
release-regression guidance to pass --manifest-path rust/Cargo.toml to both
cargo tree and cargo bloat. Keep their existing feature and binary/crate
arguments unchanged so both inspections target the same manifest as the release
build.

In @.agents/skills/skill-creator/SKILL.md:
- Around line 36-38: Update the optional routing fields guidance in SKILL.md to
remove the reference to the TypeScript peer skill and explicitly state the
accepted forms for paths and globs in place. Preserve the existing distinction
between Claude-style paths and cross-runtime globs, and retain the requirement
that Codex triggers belong in description.

In @.agents/skills/tdd/SKILL.md:
- Around line 35-42: Update the Node test command in the TDD instructions to run
through the pinned development environment by prefixing it with direnv exec .,
matching the Rust test commands and preserving the existing test name filter and
target.

In `@scripts/validate-commit-scope.nu`:
- Around line 85-91: Require every declared scope to be allowed by replacing the
any-based validation with all-based validation after the empty-scope check in
scripts/validate-commit-scope.nu (lines 85-91) and the inline validator in
.github/workflows/check-pr-title.yaml (lines 85-93), preserving rejection of
titles containing any disallowed scope.
- Around line 120-127: Update staged-owners in scripts/validate-commit-scope.nu
(lines 120-127) to request cached names with renames disabled so renamed files
yield both paths. Update the changed-file processing in
.github/workflows/check-pr-title.yaml (lines 104-113) to include each file’s
previous_filename when present alongside filename.

---

Nitpick comments:
In `@CONTRIBUTING.md`:
- Around line 60-68: Update the “Commit and PR Titles” section in
CONTRIBUTING.md to document every scope accepted by
scripts/validate-commit-scope.nu: deps, release, pricing, revert, adapter, all,
and rust. Briefly state when to use each scope, including workspace-wide and
cross-cutting changes, while preserving the existing single-agent
directory-scope guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 027cb332-1358-448d-8068-20648e8969f1

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee7278 and f217eda.

📒 Files selected for processing (45)
  • .agents/skills/agent-sources/SKILL.md
  • .agents/skills/ast-grep/SKILL.md
  • .agents/skills/cmux-debug/SKILL.md
  • .agents/skills/commit/SKILL.md
  • .agents/skills/commit/references/commit-guidance.md
  • .agents/skills/commit/references/git-apply.md
  • .agents/skills/commit/references/push.md
  • .agents/skills/commit/references/revertable-commits.md
  • .agents/skills/create-pr/SKILL.md
  • .agents/skills/create-pr/references/ai-review.md
  • .agents/skills/create-pr/references/branch-and-commit.md
  • .agents/skills/create-pr/references/ci.md
  • .agents/skills/create-pr/references/completion.md
  • .agents/skills/create-pr/references/gh-review.md
  • .agents/skills/create-pr/references/merge.md
  • .agents/skills/create-pr/references/open-pr.md
  • .agents/skills/development/SKILL.md
  • .agents/skills/development/references/commands.md
  • .agents/skills/development/references/environment-and-validation.md
  • .agents/skills/docs/SKILL.md
  • .agents/skills/fix-ci/SKILL.md
  • .agents/skills/nushell/SKILL.md
  • .agents/skills/profile/SKILL.md
  • .agents/skills/profile/references/rust.md
  • .agents/skills/profile/references/typescript.md
  • .agents/skills/reduce-similarities/SKILL.md
  • .agents/skills/rust-binary-size/SKILL.md
  • .agents/skills/rust/SKILL.md
  • .agents/skills/skill-creator/SKILL.md
  • .agents/skills/tdd/SKILL.md
  • .agents/skills/tdd/references/node-test.md
  • .agents/skills/tdd/references/rust.md
  • .agents/skills/testing/SKILL.md
  • .agents/skills/testing/references/node-test.md
  • .agents/skills/testing/references/rust.md
  • .agents/skills/typescript/SKILL.md
  • .agents/skills/typescript/references/style.md
  • .github/workflows/check-pr-title.yaml
  • AGENTS.md
  • CONTRIBUTING.md
  • apps/ccusage/AGENTS.md
  • docs/AGENTS.md
  • nix/git-hooks.nix
  • rust/adapters/AGENTS.md
  • scripts/validate-commit-scope.nu
💤 Files with no reviewable changes (11)
  • .agents/skills/commit/references/commit-guidance.md
  • .agents/skills/tdd/references/rust.md
  • .agents/skills/typescript/references/style.md
  • .agents/skills/development/references/environment-and-validation.md
  • .agents/skills/profile/references/typescript.md
  • .agents/skills/create-pr/references/completion.md
  • .agents/skills/create-pr/references/branch-and-commit.md
  • .agents/skills/commit/references/revertable-commits.md
  • .agents/skills/create-pr/references/ci.md
  • .agents/skills/tdd/references/node-test.md
  • .agents/skills/create-pr/references/merge.md

Comment on lines +3 to +19
Stage a hand-built patch without touching the worktree, verifying first:

```bash
# Always verify first before applying.
git apply --check patch_file.patch

# Apply with verbose output for debugging.
git apply -v patch_file.patch

# Stage without touching the worktree.
git apply --cached -v patch_file.patch

# Apply a diff generated between refs.
git diff main...HEAD -- <file> | git apply -v
```

`git apply` applies or stages changes without creating commits. `git am` applies
patches with commit messages and author info preserved. Use `git apply -v` for
this workflow to keep commit creation explicit and controlled.

## Flags

- `-v, --verbose`: always use this for detailed feedback during application.
- `--check`: verify whether a patch can be applied cleanly without making
changes.
- `--cached`: stage the patch without applying it to the worktree.
- `--stat`: display affected files before applying.
- `--whitespace=fix`: automatically correct trailing whitespace issues.
- `--reject`: create `.rej` files for failed sections instead of aborting
entirely.
- `--reverse` / `-R`: revert a previously applied patch.

## Troubleshooting

Trailing whitespace:

```bash
git apply --check --whitespace=fix patch_file.patch
git apply --whitespace=fix -v patch_file.patch
```

Partial failures:

```bash
git apply --reject -v patch_file.patch
```

Context mismatch:
Keep `-v` so a failure reports which hunk was rejected. `--stat` lists the
affected files before applying.

```bash
git apply --ignore-whitespace -v patch_file.patch
```

Line ending issues:
When a patch does not apply cleanly:

```bash
git apply --ignore-space-change -v patch_file.patch
```
- Trailing whitespace: `--whitespace=fix`
- Only some hunks conflict: `--reject` writes `.rej` files instead of aborting
- Context mismatch: `--ignore-whitespace`
- Line-ending differences: `--ignore-space-change`
- Undo an applied patch: `--reverse`

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="$(mktemp -d)"
trap 'rm -rf "$repo"' EXIT
cd "$repo"

git init -q
git config user.email [email protected]
git config user.name review
printf 'one\ntwo\n' > file.txt
git add file.txt
git commit -qm base

# Make the index differ from the worktree.
printf 'one\nTWO\n' > file.txt
git add file.txt
printf 'one\ntwo\n' > file.txt

cat > change.patch <<'PATCH'
diff --git a/file.txt b/file.txt
--- a/file.txt
+++ b/file.txt
@@ -1,2 +1,2 @@
-one
+ONE
 two
PATCH

git apply --check change.patch
if git apply --cached --check change.patch; then
  echo "Unexpected: index check passed" >&2
  exit 1
fi

Repository: ccusage/ccusage

Length of output: 223


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'File location:\n'
git ls-files | grep -F '.agents/skills/commit/references/git-apply.md' || true

printf '\nCurrent file excerpt:\n'
if [ -f .agents/skills/commit/references/git-apply.md ]; then
  nl -ba .agents/skills/commit/references/git-apply.md | sed -n '1,80p'
fi

printf '\nBehavioral probe: --check on worktree, --cached --check on index\n'
repo="$(mktemp -d)"
trap 'rm -rf "$repo"' EXIT
cd "$repo"

git init -q
git config user.email [email protected]
git config user.name review
printf 'one\ntwo\n' > file.txt
git add file.txt
git commit -qm base

# Make the index differ from the worktree.
printf 'one\nTWO\n' > file.txt
git add file.txt
printf 'one\ntwo\n' > file.txt

cat > change.patch <<'PATCH'
diff --git a/file.txt b/file.txt
--- a/file.txt
+++ b/file.txt
@@ -1,2 +1,2 @@
-one
+ONE
 two
PATCH

printf 'git apply --check exit=%s\n' "$(git apply --check change.patch >/tmp/apply-check.txt 2>/tmp/apply-check.err && echo 0 || echo 1)"
printf 'git apply --cached --check exit=%s\n' "$(git apply --cached --check change.patch >/tmp/apply-cached-check.txt 2>/tmp/apply-cached-check.err && echo 0 || echo 1)"

printf '\nRelevant stderr snippets:\n'
sed -n '1,8p' /tmp/apply-check.err
sed -n '1,8p' /tmp/apply-cached-check.err

Repository: ccusage/ccusage

Length of output: 277


Validate the index and keep partial patch application out of commit staging.

git apply --check checks the worktree, while git apply --cached stages against the index. If you stage with --cached --check, the previous step should use --cached --check as well.

Do not recommend --reject for commit staging; it can stage only clean hunks and leave a partial change in the index. Rebuild the patch and stage it only when all hunks apply.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/commit/references/git-apply.md around lines 3 - 19, Update
the patch-staging guidance to use git apply --cached --check before git apply
--cached -v, so validation targets the index consistently. Remove the --reject
recommendation for commit staging and instruct users to rebuild the patch and
apply it only after all hunks validate cleanly.

Comment on lines +10 to +12
`gh pr comment` only posts top-level comments, so replying in the thread a bot
opened needs the REST replies endpoint with that comment's id (from
`gh api repos/:owner/:repo/pulls/<pr-number>/comments`):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

gh api --paginate \
  "repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/comments" \
  --jq '.[].id'

Repository: ccusage/ccusage

Length of output: 203


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Repository files around target:\n'
git ls-files '.agents/skills/create-pr/references/gh-review.md' || true

printf '\nTarget file contents:\n'
if [ -f .agents/skills/create-pr/references/gh-review.md ]; then
  cat -n .agents/skills/create-pr/references/gh-review.md | sed -n '1,40p'
fi

printf '\ngh CLI version and help snippets:\n'
if command -v gh >/dev/null 2>&1; then
  gh --version | sed -n '1,3p'
  gh api --help | sed -n '1,80p' | rg -n 'paginate|page|--paginate' -C 3 || true
fi

printf '\nSearch for gh api pagination usage:\n'
rg -n 'gh api|paginate|pulls/.*/comments' .agents README.md 2>/dev/null || true

Repository: ccusage/ccusage

Length of output: 3861


Paginate the inline-comment lookup.

gh api repos/:owner/:repo/pulls/<pr-number>/comments returns only the first page. If the target comment is on a later page, the command cannot obtain its ID and cannot reply in that thread. Add --paginate.

Proposed fix
-gh api repos/:owner/:repo/pulls/<pr-number>/comments
+gh api --paginate repos/:owner/:repo/pulls/<pr-number>/comments
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
`gh pr comment` only posts top-level comments, so replying in the thread a bot
opened needs the REST replies endpoint with that comment's id (from
`gh api repos/:owner/:repo/pulls/<pr-number>/comments`):
`gh api --paginate repos/:owner/:repo/pulls/<pr-number>/comments` returns only the first page. If the target comment is on a later page, the command cannot obtain its ID and cannot reply in that thread. Add `--paginate`.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/create-pr/references/gh-review.md around lines 10 - 12,
Update the inline-comment lookup command described in the gh pr comment workflow
to include the gh api --paginate option when retrieving pull-request comments.
Preserve the existing repository and pull-request endpoint and subsequent
comment-ID selection so comments on later pages can be found and replied to.

Comment thread .agents/skills/create-pr/references/open-pr.md
Comment thread .agents/skills/create-pr/SKILL.md
Comment on lines +5 to +8
`just` is the single entry point (`just --list`). Each workspace package owns a
justfile imported as a module, so package recipes are `just <module>::<recipe>`
and `just <module>::--list` lists one module. Whole-repo jobs the Nix flake owns
(`fmt`, `check`, `schema`) stay at the root.

@coderabbitai coderabbitai Bot Jul 31, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove or implement the schema recipe.

The supplied root justfile defines fmt and check, but it does not define schema. Agents that follow this guidance will run a nonexistent command. Remove schema from this list or add the missing root recipe.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/development/references/commands.md around lines 5 - 8, Update
the command guidance to match the supplied root justfile: remove schema from the
list of Nix-owned whole-repository jobs, unless a corresponding root schema
recipe is added. Keep fmt and check unchanged.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive: the root justfile does define a schema recipe (justfile:71, running nix run .#generate-schema), so the documented command exists.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipped: comment is from another GitHub bot.

Comment on lines +35 to +38
When the release profile does not explain a regression, look at feature flags
(`cargo tree -e features -p ccusage`) and large symbols (`cargo bloat --release
--bin ccusage --crates`), both against the same manifest. `cargo bloat` is not in
the dev shell; the `missing-tools` skill covers running it without a flake change.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "File excerpt:"
sed -n '1,70p' .agents/skills/rust-binary-size/SKILL.md 2>/dev/null || true

echo
echo "Cargo manifest files:"
git ls-files '*Cargo.toml' | sed -n '1,120p'

echo
echo "Search related commands in skill and docs:"
rg -n "cargo (tree|build|clippy|benches)|--manifest-path|cd rust|rust/Cargo.toml|cargo bloat" .agents README.md . 2>/dev/null | sed -n '1,200p'

echo
echo "Installed tool availability and option parsing:"
for cmd in cargo cargo-tree cargo-bloat; do
  if command -v "$cmd" >/dev/null 2>&1; then
    echo "--- $cmd ---"
    "$cmd" --version 2>&1 | sed -n '1,5p'
    case "$cmd" in
      cargo) "$cmd" tree --help 2>&1 | rg -n "manifest|path" || true ;;
      cargo-tree) "$cmd" --help 2>&1 | rg -n "manifest|path" || true ;;
      cargo-bloat) "$cmd" --help 2>&1 | rg -n "manifest|path" || true ;;
    esac
  else
    echo "--- $cmd: not installed ---"
  fi
done

Repository: ccusage/ccusage

Length of output: 145


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "File excerpt:"
sed -n '1,70p' .agents/skills/rust-binary-size/SKILL.md 2>/dev/null || true

echo
echo "Cargo manifest files:"
git ls-files '*Cargo.toml' | sed -n '1,120p'

echo
echo "Search related commands in skill and docs:"
rg -n "cargo (tree|build|clippy|benches)|--manifest-path|cd rust|rust/Cargo.toml|cargo bloat" .agents README.md . 2>/dev/null | sed -n '1,200p'

echo
echo "Installed tool availability and option parsing:"
for cmd in cargo cargo-tree cargo-bloat; do
  if command -v "$cmd" >/dev/null 2>&1; then
    echo "--- $cmd ---"
    "$cmd" --version 2>&1 | sed -n '1,5p'
    case "$cmd" in
      cargo) "$cmd" tree --help 2>&1 | rg -n "manifest|path" || true ;;
      cargo-tree) "$cmd" --help 2>&1 | igrep -n "manifest|path" || true ;;
      cargo-bloat) "$cmd" --help 2>&1 | igrep -n "manifest|path" || true ;;
    esac
  else
    echo "--- $cmd: not installed ---"
  fi
done

Repository: ccusage/ccusage

Length of output: 145


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "pwd:"
pwd || true

echo
echo "Top-level files:"
find . -maxdepth 1 -type f -not -path '*/\.*' | sed 's#^\./##' | sort | sed -n '1,120p' || true

echo
echo "Cargo manifest files:"
find . -name Cargo.toml -not -path './.git/*' | sort | sed -n '1,120p'

echo
echo "Relevant skill excerpt if present:"
if [ -f .agents/skills/rust-binary-size/SKILL.md ]; then
  sed -n '1,80p' .agents/skills/rust-binary-size/SKILL.md
else
  find . -path '*/rust-binary-size/SKILL.md' -o -path '*rust-binary-size*' -not -path './.git/*' -maxdepth 4 | sort | sed -n '1,120p' || true
fi

echo
echo "Fast text search in tracked files only for key terms:"
git ls-files '*.md' | while read -r f; do
  case "$f" in
    .agents/skills/rust-binary-size/SKILL.md|README.md) ;;
    *) ;;
  esac
done | xargs -r rg -n "cargo (tree|build|bloat|--manifest-path)|cd rust|rust/Cargo.toml|missing-tools" || true

echo
echo "Cargo-related docs anywhere tracked:"
git ls-files '*.md' | xargs -r rg -n "cargo (tree|build|bloat|--manifest-path)|cd rust|rust/Cargo.toml|missing-tools" || true

Repository: ccusage/ccusage

Length of output: 145


🏁 Script executed:

#!/bin/bash
set -u

echo "pwd:"
pwd

printf 'top-level entries:\n'
ls -1A . 2>/dev/null | sed -n '1,80p'

printf 'Cargo manifest files:\n'
find . -name Cargo.toml 2>/dev/null | sort | sed -n '1,120p'

printf 'Target skill excerpt:\n'
sed -n '1,80p' .agents/skills/rust-binary-size/SKILL.md 2>/dev/null || true

printf 'Key command mentions in markdown files:\n'
for f in $(find . -name '*.md' -type f 2>/dev/null | sed -n '1,100p'); do
  rg -n "cargo (tree|build|bloat|--manifest-path)|cd rust|rust/Cargo.toml|missing-tools" "$f" 2>/dev/null || true
done

printf 'Installed cargo commands:\n'
command -v cargo || true
command -v cargo-tree || true
command -v cargo-bloat || true

Repository: ccusage/ccusage

Length of output: 145


🏁 Script executed:

#!/bin/bash
set -euo pipefail
printf '%s\n' 'quick ls'
ls . 2>/dev/null | sed -n '1,40p'
printf '%s\n' 'skill file exists'
test -f .agents/skills/rust-binary-size/SKILL.md && echo yes || echo no
printf '%s\n' 'lines 1-70'
sed -n '1,70p' .agents/skills/rust-binary-size/SKILL.md 2>/dev/null || true

Repository: ccusage/ccusage

Length of output: 2802


🌐 Web query:

cargo-tree --manifest-path option documentation

💡 Result:

The --manifest-path option for the cargo tree command is used to specify the path to a Cargo.toml file [1][2]. By default, Cargo searches for the Cargo.toml file in the current working directory or any parent directory [1][2]. When the --manifest-path option is provided, Cargo uses the specified path instead of performing this automatic search [1][2]. The manifest file determines which packages are selected for display by default when no specific package selection options are provided [1][2]. If the manifest is the root of a workspace, the workspace's default members are selected; otherwise, only the package defined by the manifest file is selected [3][4][5].

Citations:


🌐 Web query:

cargo-bloat --manifest-path option documentation

💡 Result:

The cargo-bloat tool supports the --manifest-path option, which allows you to specify the path to a Cargo.toml file [1][2]. This is useful when you want to run cargo-bloat from a directory other than the root of the crate you are analyzing [3]. This flag was added in version 0.10.0 of cargo-bloat [1][2]. It functions similarly to the --manifest-path flag in standard cargo commands, enabling you to point the tool directly to the project manifest [2]. While it may not always appear in the high-level summary of command-line flags in the README, it is officially supported for passing configuration down to cargo [1][2].

Citations:


Use rust/Cargo.toml for the Rust inspection commands.

The build command already targets rust/Cargo.toml, but cargo tree and cargo bloat run against the current package unless told otherwise. Add --manifest-path rust/Cargo.toml to both commands so the regression check does not inspect a different package from the repository root.

Proposed command fix
- cargo tree -e features -p ccusage
- cargo bloat --release --bin ccusage --crates
+ cargo tree --manifest-path rust/Cargo.toml -e features -p ccusage
+ cargo bloat --manifest-path rust/Cargo.toml --release --bin ccusage --crates
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
When the release profile does not explain a regression, look at feature flags
(`cargo tree -e features -p ccusage`) and large symbols (`cargo bloat --release
--bin ccusage --crates`), both against the same manifest. `cargo bloat` is not in
the dev shell; the `missing-tools` skill covers running it without a flake change.
When the release profile does not explain a regression, look at feature flags
(`cargo tree --manifest-path rust/Cargo.toml -e features -p ccusage`) and large symbols (`cargo bloat --manifest-path rust/Cargo.toml --release
--bin ccusage --crates`), both against the same manifest. `cargo bloat` is not in
the dev shell; the `missing-tools` skill covers running it without a flake change.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/rust-binary-size/SKILL.md around lines 35 - 38, Update the
Rust inspection commands in the release-regression guidance to pass
--manifest-path rust/Cargo.toml to both cargo tree and cargo bloat. Keep their
existing feature and binary/crate arguments unchanged so both inspections target
the same manifest as the release build.

Comment thread .agents/skills/skill-creator/SKILL.md
Comment on lines +35 to +42
Rust tests live in the `rust/Cargo.toml` workspace. Prefix with `direnv exec .` when
`cargo` is not already on `PATH`.

## Workflow
```sh
direnv exec . cargo test --manifest-path rust/Cargo.toml --workspace <name-filter>
direnv exec . cargo test --manifest-path rust/Cargo.toml --workspace -- --ignored

1. **Sketch behaviors** — Before writing any code, list the behaviors to implement as placeholder tests, such as `it.todo(...)` in Node test or `#[ignore]` in Rust.
2. **Pick one behavior** — Start with the simplest or most fundamental one.
3. **Red** — Write the test. Run it. Confirm it fails for the right reason.
4. **Green** — Write the minimum code to pass. Run the test. Confirm it passes.
5. **Refactor** — Clean up. Run all affected tests. Confirm everything is green.
6. **Repeat** from step 2 until all behaviors are covered.
node --test --test-name-pattern '<name-filter>' apps/ccusage/src/cli.test.ts

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Run the Node test in the pinned Nix shell.

Line 42 omits the direnv exec . prefix used for the Rust commands. Use direnv exec . node --test ..., or state that the command requires an already active development shell.

As per coding guidelines, prefix one-off commands with direnv exec . when they run outside the pinned development shell.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/tdd/SKILL.md around lines 35 - 42, Update the Node test
command in the TDD instructions to run through the pinned development
environment by prefixing it with direnv exec ., matching the Rust test commands
and preserving the existing test name filter and target.

Source: Coding guidelines

Comment thread scripts/validate-commit-scope.nu
Comment on lines +120 to +127
def staged-owners []: nothing -> list<string> {
git diff --cached --name-only
| lines
| where {|path| ($path | str trim) != "" }
| each {|path| owner-for-path $path }
| compact
| uniq
| sort

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

repo="$(mktemp -d)"
trap 'rm -rf "$repo"' EXIT
cd "$repo"

git init -q
git config user.email [email protected]
git config user.name review
git config diff.renames true

mkdir -p rust/adapters/codex
printf 'source\n' > rust/adapters/codex/usage.rs
git add .
git commit -qm base

mkdir -p rust/adapters/kimi
git mv rust/adapters/codex/usage.rs rust/adapters/kimi/usage.rs

echo "Current command:"
git diff --cached --name-only

echo "Owner-safe command:"
git diff --cached --no-renames --name-only

Repository: ccusage/ccusage

Length of output: 275


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Files:"
git ls-files 'scripts/validate-commit-scope.nu' '.github/workflows/check-pr-title.yaml' 'AGENTS.md' 'rust/' | sed -n '1,120p'

echo
echo "Relevant nus scripts:"
if [ -f scripts/validate-commit-scope.nu ]; then
  wc -l scripts/validate-commit-scope.nu
  sed -n '1,180p' scripts/validate-commit-scope.nu
fi

echo
echo "Relevant workflow excerpts:"
if [ -f .github/workflows/check-pr-title.yaml ]; then
  wc -l .github/workflows/check-pr-title.yaml
  sed -n '1,160p' .github/workflows/check-pr-title.yaml
fi

echo
echo "Search for owner-for-path/staged-owners/previous_filename:"
rg -n "owner-for-path|staged-owners|changed-owners|previous_filename|AGENTS|rust/adapters|adapter" scripts .github rust docs 2>/dev/null | sed -n '1,220p'

Repository: ccusage/ccusage

Length of output: 31375


🌐 Web query:

GitHub pulls list files API previous_filename field documentation

💡 Result:

The previous_filename field is a component of the Diff Entry object used in the GitHub REST API, specifically appearing in the responses for listing files in a pull request and listing files in a commit [1][2]. When a file is renamed, the previous_filename field contains the original name of the file before the rename operation [2]. This field is primarily relevant when the status of the file change is reported as renamed [2]. Technical details: - API endpoints: It is available in the responses for GET /repos/{owner}/{repo}/pulls/{pull_number}/files and GET /repos/{owner}/{repo}/commits/{commit_sha} (as part of the commit file data) [1][2]. - Data structure: It is a string field within the Diff Entry object schema [1][2]. - Usage: Developers can use this field to track file provenance, such as identifying the original path of a file that has been moved or renamed in a pull request or commit [2][3].

Citations:


Include both paths when a file is renamed.

A rename from one adapter to another can report only the destination path, leaving both validators with no derived adapter scope.

  • scripts/validate-commit-scope.nu#L120-L127: use git diff --cached --no-renames --name-only so a rename produces the deleted and added paths.
  • .github/workflows/check-pr-title.yaml#L104-L113: include each changed file's previous_filename when it exists, in addition to filename.
📍 Affects 2 files
  • scripts/validate-commit-scope.nu#L120-L127 (this comment)
  • .github/workflows/check-pr-title.yaml#L104-L113
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/validate-commit-scope.nu` around lines 120 - 127, Update
staged-owners in scripts/validate-commit-scope.nu (lines 120-127) to request
cached names with renames disabled so renamed files yield both paths. Update the
changed-file processing in .github/workflows/check-pr-title.yaml (lines 104-113)
to include each file’s previous_filename when present alongside filename.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 1f03741c406f
Base SHA: 5ee72780d8c1

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 340.8ms 2.95 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 304.9ms 3.30 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 117.1ms 8.60 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.4ms 10.77 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 29.2ms 5.1ms 5.70x 54.75 MiB 12.45 MiB 0.23x 0.05 MiB/s 0.30 MiB/s
claude session --offline --json 0.00 MiB 24.5ms 4.6ms 5.36x 55.00 MiB 12.45 MiB 0.23x 0.06 MiB/s 0.34 MiB/s
codex daily --offline --json 0.00 MiB 23.4ms 2.2ms 10.54x 55.00 MiB 10.45 MiB 0.19x 0.04 MiB/s 0.39 MiB/s
codex session --offline --json 0.00 MiB 24.8ms 2.4ms 10.45x 54.75 MiB 10.45 MiB 0.19x 0.03 MiB/s 0.36 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 362.9ms 313.9ms 1.16x 948.59 MiB 956.59 MiB 1.01x 2.77 GiB/s 3.21 GiB/s
codex --offline --json 1.01 GiB 115.9ms 97.7ms 1.19x 418.91 MiB 400.90 MiB 0.96x 8.69 GiB/s 10.31 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 19.09 KiB 19.09 KiB +0.00 KiB 1.00x
installed native package binary 4194.28 KiB 4194.28 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 1f03741c406f
Base SHA: 5ee72780d8c1

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 340.1ms 2.96 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 335.9ms 3.00 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 117.7ms 8.55 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 93.2ms 10.80 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 28.9ms 25.7ms 1.12x 55.00 MiB 55.00 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 25.2ms 25.1ms 1.01x 55.00 MiB 55.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 23.8ms 23.2ms 1.03x 55.00 MiB 55.25 MiB 1.00x 0.04 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 24.3ms 22.9ms 1.06x 55.25 MiB 55.00 MiB 1.00x 0.04 MiB/s 0.04 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 367.4ms 347.0ms 1.06x 946.59 MiB 958.59 MiB 1.01x 2.74 GiB/s 2.90 GiB/s
codex --offline --json 1.01 GiB 114.3ms 118.5ms 0.96x 394.91 MiB 408.91 MiB 1.04x 8.81 GiB/s 8.50 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 19.09 KiB 19.09 KiB +0.00 KiB 1.00x
installed native package binary 4194.28 KiB 4194.28 KiB +0.00 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.agents/skills/commit/SKILL.md:
- Around line 20-23: Update the workflow around the existing “Read the state and
recent history” and patch-staging steps to explicitly detect untracked files,
since git diff HEAD omits them. Document creating and applying a patch for each
new file before committing, then verify the complete staged file list before the
commit; preserve the existing independently revertable-unit and git show HEAD
checks.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a762de2-2b1f-4dd1-a3be-269aa3e8ba4f

📥 Commits

Reviewing files that changed from the base of the PR and between 5ee7278 and 1f03741.

📒 Files selected for processing (45)
  • .agents/skills/agent-sources/SKILL.md
  • .agents/skills/ast-grep/SKILL.md
  • .agents/skills/cmux-debug/SKILL.md
  • .agents/skills/commit/SKILL.md
  • .agents/skills/commit/references/commit-guidance.md
  • .agents/skills/commit/references/git-apply.md
  • .agents/skills/commit/references/push.md
  • .agents/skills/commit/references/revertable-commits.md
  • .agents/skills/create-pr/SKILL.md
  • .agents/skills/create-pr/references/ai-review.md
  • .agents/skills/create-pr/references/branch-and-commit.md
  • .agents/skills/create-pr/references/ci.md
  • .agents/skills/create-pr/references/completion.md
  • .agents/skills/create-pr/references/gh-review.md
  • .agents/skills/create-pr/references/merge.md
  • .agents/skills/create-pr/references/open-pr.md
  • .agents/skills/development/SKILL.md
  • .agents/skills/development/references/commands.md
  • .agents/skills/development/references/environment-and-validation.md
  • .agents/skills/docs/SKILL.md
  • .agents/skills/fix-ci/SKILL.md
  • .agents/skills/nushell/SKILL.md
  • .agents/skills/profile/SKILL.md
  • .agents/skills/profile/references/rust.md
  • .agents/skills/profile/references/typescript.md
  • .agents/skills/reduce-similarities/SKILL.md
  • .agents/skills/rust-binary-size/SKILL.md
  • .agents/skills/rust/SKILL.md
  • .agents/skills/skill-creator/SKILL.md
  • .agents/skills/tdd/SKILL.md
  • .agents/skills/tdd/references/node-test.md
  • .agents/skills/tdd/references/rust.md
  • .agents/skills/testing/SKILL.md
  • .agents/skills/testing/references/node-test.md
  • .agents/skills/testing/references/rust.md
  • .agents/skills/typescript/SKILL.md
  • .agents/skills/typescript/references/style.md
  • .github/workflows/check-pr-title.yaml
  • AGENTS.md
  • CONTRIBUTING.md
  • apps/ccusage/AGENTS.md
  • docs/AGENTS.md
  • nix/git-hooks.nix
  • rust/adapters/AGENTS.md
  • scripts/validate-commit-scope.nu
💤 Files with no reviewable changes (11)
  • .agents/skills/create-pr/references/completion.md
  • .agents/skills/development/references/environment-and-validation.md
  • .agents/skills/tdd/references/rust.md
  • .agents/skills/profile/references/typescript.md
  • .agents/skills/commit/references/commit-guidance.md
  • .agents/skills/tdd/references/node-test.md
  • .agents/skills/commit/references/revertable-commits.md
  • .agents/skills/typescript/references/style.md
  • .agents/skills/create-pr/references/merge.md
  • .agents/skills/create-pr/references/ci.md
  • .agents/skills/create-pr/references/branch-and-commit.md
🚧 Files skipped from review as they are similar to previous changes (20)
  • nix/git-hooks.nix
  • .agents/skills/typescript/SKILL.md
  • .agents/skills/testing/references/node-test.md
  • .agents/skills/commit/references/git-apply.md
  • .agents/skills/testing/references/rust.md
  • .agents/skills/reduce-similarities/SKILL.md
  • .agents/skills/docs/SKILL.md
  • .agents/skills/commit/references/push.md
  • .agents/skills/agent-sources/SKILL.md
  • .github/workflows/check-pr-title.yaml
  • .agents/skills/create-pr/references/gh-review.md
  • .agents/skills/rust-binary-size/SKILL.md
  • apps/ccusage/AGENTS.md
  • .agents/skills/create-pr/references/ai-review.md
  • CONTRIBUTING.md
  • .agents/skills/cmux-debug/SKILL.md
  • rust/adapters/AGENTS.md
  • scripts/validate-commit-scope.nu
  • AGENTS.md
  • .agents/skills/ast-grep/SKILL.md

Comment on lines +20 to +23
1. Read the state and recent history — `git status --short`, `git diff HEAD`, `git log --oneline -10` — and match the granularity, scopes, and explanation style already in the log.
2. Split the diff into independently revertable units, hunk by hunk rather than file by file.
3. Stage each unit with `git apply --cached -v <patch>`. `git add -p` and `git add --interactive` hang in this environment, so a patch is the only way to stage part of a file. Read `references/git-apply.md` when one fails to apply.
4. Commit, then confirm with `git show HEAD`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Handle untracked files before patch-only staging.

git diff HEAD excludes untracked files. A new file can therefore remain unstaged while this workflow appears complete. Add an explicit untracked-file check and document how to apply a new-file patch. Verify the staged file list before committing.

Suggested workflow update
-1. Read the state and recent history — `git status --short`, `git diff HEAD`, `git log --oneline -10` — and match the granularity, scopes, and explanation style already in the log.
+1. Read the state and recent history — `git status --short`, `git diff HEAD`, `git ls-files --others --exclude-standard`, and `git log --oneline -10` — and match the granularity, scopes, and explanation style already in the log.
-3. Stage each unit with `git apply --cached -v <patch>`. `git add -p` and `git add --interactive` hang in this environment, so a patch is the only way to stage part of a file. Read `references/git-apply.md` when one fails to apply.
+3. Stage tracked units with `git apply --cached -v <patch>`. For each untracked file, generate and apply a new-file patch from `/dev/null`. `git add -p` and `git add --interactive` hang in this environment, so use non-interactive patch staging. Read `references/git-apply.md` when one fails to apply.
-4. Commit, then confirm with `git show HEAD`.
+4. Inspect `git diff --cached --name-status`, commit, then confirm with `git show --stat HEAD` and `git status --short`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. Read the state and recent history — `git status --short`, `git diff HEAD`, `git log --oneline -10` — and match the granularity, scopes, and explanation style already in the log.
2. Split the diff into independently revertable units, hunk by hunk rather than file by file.
3. Stage each unit with `git apply --cached -v <patch>`. `git add -p` and `git add --interactive` hang in this environment, so a patch is the only way to stage part of a file. Read `references/git-apply.md` when one fails to apply.
4. Commit, then confirm with `git show HEAD`.
1. Read the state and recent history — `git status --short`, `git diff HEAD`, `git ls-files --others --exclude-standard`, and `git log --oneline -10` — and match the granularity, scopes, and explanation style already in the log.
2. Split the diff into independently revertable units, hunk by hunk rather than file by file.
3. Stage tracked units with `git apply --cached -v <patch>`. For each untracked file, generate and apply a new-file patch from `/dev/null`. `git add -p` and `git add --interactive` hang in this environment, so use non-interactive patch staging. Read `references/git-apply.md` when one fails to apply.
4. Inspect `git diff --cached --name-status`, commit, then confirm with `git show --stat HEAD` and `git status --short`.
🧰 Tools
🪛 LanguageTool

[grammar] ~21-~21: Ensure spelling is correct
Context: ...g. 2. Split the diff into independently revertable units, hunk by hunk rather than file by...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.agents/skills/commit/SKILL.md around lines 20 - 23, Update the workflow
around the existing “Read the state and recent history” and patch-staging steps
to explicitly detect untracked files, since git diff HEAD omits them. Document
creating and applying a patch for each new file before committing, then verify
the complete staged file list before the commit; preserve the existing
independently revertable-unit and git show HEAD checks.

Carry over the parts of the personal tdd skill this one was missing —
horizontal slicing, tautological expectations, and mocking inside the system —
stated against the seams this repository actually has: `--offline`,
`CLAUDE_CONFIG_DIR`, and `ccusage-test-support`. The upstream mocking reference
is Vitest and MSW throughout, which nothing here uses, so it stays out.

Also drop the generic advice on reading a `.cpuprofile` from the profile skill,
keeping the part a profiler cannot tell you: no `profiles/` directory is
ignored, so the output goes outside the worktree.
Copilot AI review requested due to automatic review settings August 1, 2026 11:16

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes — one new commit since the prior pullfrog review at 1f03741c.

  • TDD skill gained ccusage-specific failure modes — the three named failure modes (horizontal slicing, tautological expectations, mocking inside the system) replace generic rules. Each references real repo seams: --offline, CLAUDE_CONFIG_DIR, and ccusage-test-support. The cycle now folds placeholder sketching into step 1 and includes just recipe references.
  • Profile skill lost stale .cpuprofile read instructions — Bun tools under nix/tools/ and nushell/babashka scripts in apps/ccusage/scripts/ are not Node, so the removed .cpuprofile reading advice was misleading.

Pullfrog  | ⚠️ this action is pinned to a commit SHA, which freezes the cleanup step — switch to @v0 or keep the SHA fresh with Dependabot | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 45 out of 45 changed files in this pull request and generated 1 comment.

Suppressed comments (2)

scripts/validate-commit-scope.nu:29

  • Nushell command substitutions in let assignments need parentheses; otherwise these lines are treated as bare expressions and the commit-msg hook will fail before enforcing scopes.
    scripts/validate-commit-scope.nu:2
  • This script shells out to git, but the Nix shebang only includes nushell. If someone runs it directly (or via a hook entry that executes the file), it will fail with git missing from PATH. Include nixpkgs#git in the shebang tool list to make it self-contained.

This issue also appears on line 25 of the same file.

Comment on lines +60 to +75
def main []: nothing -> nothing {
let title = $env.PR_TITLE | str trim

if ($GENERATED_SUBJECTS | any {|prefix| $title | str starts-with $prefix }) { return }

let parsed = $title | parse --regex '^(?<type>[a-z]+)(?:\((?<scope>[^()]+)\))?!?: \S' | get 0?
if $parsed == null {
reject $title "is not a Conventional Commit" "Use `<type>(<scope>): <subject>`, for example `feat(codex): add session totals`."
}

let owners = changed-owners
let scopes = $parsed.scope
| default ""
| split row ","
| each {|scope| $scope | str trim }
| where {|scope| $scope != "" }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nushell has allowed pipelines and command calls directly on the right side of let since 0.72 (this workflow pins 0.114.1), and the identical forms already run in scripts/validate-commit-scope.nu and apps/ccusage/scripts/ensure-native-binary.nu, so no runtime failure occurs.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 717d77b5548c
Base SHA: 5ee72780d8c1

This compares the PR package against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 362.6ms 2.78 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 308.1ms 3.27 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 119.5ms 8.42 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 92.9ms 10.83 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 27.2ms 26.4ms 1.03x 55.00 MiB 55.00 MiB 1.00x 0.06 MiB/s 0.06 MiB/s
claude session --offline --json 0.00 MiB 28.2ms 24.7ms 1.14x 55.00 MiB 55.00 MiB 1.00x 0.05 MiB/s 0.06 MiB/s
codex daily --offline --json 0.00 MiB 25.2ms 23.4ms 1.08x 55.00 MiB 55.00 MiB 1.00x 0.03 MiB/s 0.04 MiB/s
codex session --offline --json 0.00 MiB 25.1ms 24.5ms 1.02x 55.00 MiB 55.00 MiB 1.00x 0.03 MiB/s 0.03 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published ccusage package from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 375.8ms 348.6ms 1.08x 954.59 MiB 974.59 MiB 1.02x 2.68 GiB/s 2.89 GiB/s
codex --offline --json 1.01 GiB 119.6ms 150.0ms 0.80x 414.91 MiB 402.91 MiB 0.97x 8.42 GiB/s 6.71 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 19.09 KiB 19.09 KiB +0.00 KiB 1.00x
installed native package binary 4194.28 KiB 4194.34 KiB +0.06 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

ccusage performance comparison

PR SHA: 717d77b5548c
Base SHA: 5ee72780d8c1

This compares the Rust PR release binary against the configured base package on the same CI runner.

Package runtime diagnostics

Compares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
All rows run --offline --json, measured by hyperfine with 0 warmups and 1 runs. This isolates wrapper overhead from the installed native optional dependency and the workspace release binary built on the runner.

Command Runtime Input Median Throughput Samples
claude --offline --json Package wrapper 1.01 GiB 368.4ms 2.73 GiB/s 1
claude --offline --json Installed native binary 1.01 GiB 323.7ms 3.11 GiB/s 1
codex --offline --json Package wrapper 1.01 GiB 117.2ms 8.59 GiB/s 1
codex --offline --json Installed native binary 1.01 GiB 94.7ms 10.63 GiB/s 1

Committed fixture performance

Committed small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage.

Fixtures: Claude apps/ccusage/test/fixtures/claude (0.00 MiB, 2 files), Codex apps/ccusage/test/fixtures/codex (0.00 MiB, 1 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 2 warmups and 7 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude daily --offline --json 0.00 MiB 26.4ms 5.4ms 4.90x 55.25 MiB 12.46 MiB 0.23x 0.06 MiB/s 0.29 MiB/s
claude session --offline --json 0.00 MiB 23.8ms 4.8ms 4.94x 55.00 MiB 12.45 MiB 0.23x 0.07 MiB/s 0.32 MiB/s
codex daily --offline --json 0.00 MiB 24.3ms 2.6ms 9.32x 55.00 MiB 10.46 MiB 0.19x 0.04 MiB/s 0.33 MiB/s
codex session --offline --json 0.00 MiB 22.4ms 2.3ms 9.60x 55.00 MiB 10.45 MiB 0.19x 0.04 MiB/s 0.37 MiB/s

Large real-world-shaped fixture performance

Generated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures.

Fixtures: Claude /home/runner/_work/_temp/ccusage-large-fixture (1.01 GiB, 2597 files), Codex /home/runner/_work/_temp/ccusage-large-codex-fixture (1.01 GiB, 2597 files)
Base runs the published ccusage package from pkg.pr.new, installed before measurement; PR runs the published native ccusage binary from pkg.pr.new, installed before measurement. Both run --offline --json, measured by hyperfine with 0 warmups and 1 runs.
Peak RSS is measured separately with /usr/bin/time using 1 runs. Lower RSS ratios are better.

Command Input Base median PR median PR vs base Base peak RSS PR peak RSS PR/base RSS Base throughput PR throughput
claude --offline --json 1.01 GiB 361.5ms 321.7ms 1.12x 962.59 MiB 954.59 MiB 0.99x 2.79 GiB/s 3.13 GiB/s
codex --offline --json 1.01 GiB 117.9ms 96.9ms 1.22x 416.91 MiB 402.91 MiB 0.97x 8.54 GiB/s 10.39 GiB/s

Artifact size

Artifact Base PR Delta Ratio
packed ccusage-*.tgz 19.09 KiB 19.09 KiB +0.00 KiB 1.00x
installed native package binary 4194.28 KiB 4194.34 KiB +0.06 KiB 1.00x

Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees.

@ryoppippi
ryoppippi merged commit d426a9d into main Aug 1, 2026
38 of 39 checks passed
@ryoppippi
ryoppippi deleted the fix-skills branch August 1, 2026 11:26
@github-actions github-actions Bot mentioned this pull request Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants