patrick szymkowiak
fbfaa0053b
Merge pull request #37 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.7.0
v0.7.0
2026-02-01 20:08:08 +01:00
github-actions[bot]
c04fe839b8
chore(master): release 0.7.0
2026-02-01 19:07:31 +00:00
patrick szymkowiak
c9c64cfd30
Merge pull request #36 from FlorianBruniaux/feat/git-show
...
feat: discover command, auto-rewrite hook, git show
2026-02-01 20:07:12 +01:00
Florian BRUNIAUX
4bb0130695
fix: forward args in rtk git push/pull to support -u, remote, branch
...
rtk git push and rtk git pull now accept trailing arguments and forward
them to git. Fixes the auto-rewrite hook failing on commands like
`git push -u origin feat/branch`.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-02-01 16:38:02 +01:00
Florian BRUNIAUX
ff1c7598c2
feat: add discover command, auto-rewrite hook, and git show support
...
- New `rtk discover` command scans Claude Code JSONL session history to
identify missed RTK savings and suggest unhandled commands for issues.
Modular architecture: registry (RegexSet classification), provider
(SessionProvider trait + ClaudeProvider), report (text/json formatting).
- New PreToolUse auto-rewrite hook transparently intercepts Bash commands
and rewrites them to rtk equivalents before execution, ensuring 100%
adoption across all conversations including subagents.
- New `rtk git show` command with compact output: one-line commit summary
+ stat + compacted diff (reuses compact_diff from git diff).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-02-01 16:31:34 +01:00
patrick szymkowiak
d3f17c3b11
Merge pull request #34 from pszymkowiak/release-please--branches--master--components--rtk
v0.6.0
2026-02-01 15:43:08 +01:00
patrick szymkowiak
e1813b6bbf
Merge pull request #35 from FlorianBruniaux/feat/tdd-testing-skill
2026-02-01 15:41:28 +01:00
Florian BRUNIAUX
2d66726206
Add TDD skill, fix 3 failing tests, add 17 diff_cmd tests
...
- Fix test_analyze_logs: use normalizable paths instead of distinct IPs
- Fix test_filter_outdated: match real pnpm outdated output format
- Fix test_filter_ansi_colors: add missing Tests line for stats parsing
- Add .claude/skills/rtk-tdd/ with Red-Green-Refactor workflow
- Add testing-patterns.md reference with untested modules backlog
- Update CLAUDE.md Testing Strategy with TDD mandate and pre-commit gate
- Add 17 tests to diff_cmd.rs (similarity, truncate, compute_diff, condense)
- Test suite: 102/105 → 122/122
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-02-01 14:20:25 +01:00
github-actions[bot]
669f1d5801
chore(master): release 0.6.0
2026-02-01 10:58:18 +00:00
patrick szymkowiak
ca0f68e54a
Merge pull request #33 from FlorianBruniaux/feat/curl-command
2026-02-01 11:58:00 +01:00
patrick szymkowiak
0ec19c79d1
Merge pull request #32 from FlorianBruniaux/feat/js-ecosystem
2026-02-01 11:51:38 +01:00
patrick szymkowiak
2af9698353
Merge pull request #31 from FlorianBruniaux/feat/gh-expansion
2026-02-01 11:50:45 +01:00
patrick szymkowiak
3c20eb9c39
Merge pull request #30 from FlorianBruniaux/feat/git-extensions
2026-02-01 11:49:28 +01:00
patrick szymkowiak
9bfb003d90
Merge pull request #29 from FlorianBruniaux/feat/cargo-commands
2026-02-01 11:48:21 +01:00
patrick szymkowiak
6c608880e9
Merge pull request #28 from FlorianBruniaux/feat/shared-infra
...
feat: shared infrastructure for new commands
2026-02-01 10:05:56 +01:00
Florian BRUNIAUX
314accbfd9
feat: curl with auto-JSON detection
...
- Execute curl -s, auto-detect JSON responses
- JSON output piped through filter_json_string() for schema view
- Non-JSON output truncated to 30 lines with byte count
New module: src/curl_cmd.rs with 4 unit tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-31 23:39:55 +01:00
Florian BRUNIAUX
49b3cf293d
feat: npm/npx routing, pnpm build/typecheck, --skip-env flag
...
- npm run: filter boilerplate (> script, npm WARN, progress)
- npx: intelligent routing to specialized filters
(tsc, eslint, prisma, next, prettier, playwright)
- pnpm build: delegates to next_cmd filter
- pnpm typecheck: delegates to tsc_cmd filter
- --skip-env global flag: propagates SKIP_ENV_VALIDATION=1
New module: src/npm_cmd.rs with 2 unit tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-31 23:39:03 +01:00
Florian BRUNIAUX
517a93d0e4
feat: gh pr create/merge/diff/comment/edit + gh api
...
- gh pr create: capture URL + number, "ok created #N url"
- gh pr merge: "ok merged #N" confirmation
- gh pr diff: reuse compact_diff() for condensed output
- gh pr comment/edit: generic "ok {action} #N" confirmations
- gh api: auto-detect JSON, pipe through filter_json_string()
5 new tests in gh_cmd.rs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-31 23:37:17 +01:00
Florian BRUNIAUX
bc31da8ad9
feat: git branch, fetch, stash, worktree commands
...
- git branch: compact listing (current/local/remote-only)
- git fetch: "ok fetched (N new refs)" confirmation
- git stash: list/show/pop/apply/drop with compact output
- git worktree: compact listing with home dir abbreviation
4 new tests in git.rs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-31 23:36:44 +01:00
Florian BRUNIAUX
bfd5646f4e
feat: cargo build/test/clippy with compact output
...
- cargo build: strip Compiling/Downloading lines, show errors + summary
- cargo test: show failures only + summary line
- cargo clippy: group warnings by lint rule with locations
New module: src/cargo_cmd.rs with 6 unit tests
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-31 23:35:59 +01:00
Florian BRUNIAUX
9dbc1178e7
feat: shared infrastructure for new commands
...
- Make compact_diff pub(crate) in git.rs for cross-module use
- Extract filter_json_string() from json_cmd.rs for reuse
- Add ok_confirmation() to utils.rs for write operation confirmations
- Add detect_package_manager() and package_manager_exec() to utils.rs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com >
2026-01-31 23:34:54 +01:00
patrick szymkowiak
dcfc8d91a6
Merge pull request #26 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.5.2
v0.5.2
2026-01-30 16:52:20 +01:00
github-actions[bot]
038af6f648
chore(master): release 0.5.2
2026-01-30 15:49:54 +00:00
patrick szymkowiak
108d0b5ea3
Merge pull request #25 from FlorianBruniaux/fix/release-pipeline
...
fix: release pipeline trigger and version-agnostic package URLs
2026-01-30 16:49:35 +01:00
Florian BRUNIAUX
264539cf20
fix: release pipeline trigger and version-agnostic package URLs
...
Patrick reported 2 critical issues post-merge PR #23 :
1. **release.yml never triggers**: release-please creates tags via GitHub API
→ no push event generated → build workflow never runs
→ v0.5.1 released without binaries
2. **README install URLs 404**: DEB/RPM URLs hardcode version 0.3.1
→ /releases/latest/download/ serves different filenames
→ all releases > 0.3.1 break installation instructions
Root cause analysis:
- release-please creates GitHub Releases (triggers `release.published` event)
- release.yml only listens to `on: push: tags` (doesn't fire for API-created tags)
- Standard pattern: release-please + binary builds = `on: release.published`
Fixes:
1. release.yml trigger:
- Add `on: release: types: [published]` (standard release-please pattern)
- Remove `on: push: tags: ['v*']` (dead code with release-please)
- Update version extraction to handle `release` event
- Split release job: upload assets (release event) vs create release (workflow_dispatch)
2. Version-agnostic package naming:
- Create copies: rtk_0.5.0-1_amd64.deb → rtk_amd64.deb
- Create copies: rtk-0.5.0-1.x86_64.rpm → rtk.x86_64.rpm
- Update README URLs to use version-agnostic names
- /releases/latest/download/ now serves stable filenames
Impact:
- release-please releases now auto-trigger binary builds
- Installation URLs work for all future releases
- No manual workflow_dispatch needed for new versions
Manual action required:
Patrick needs to re-run build for v0.5.1 via workflow_dispatch
(or create v0.5.2 with a trivial fix commit)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 16:29:15 +01:00
patrick szymkowiak
b46ed8357f
Merge pull request #24 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.5.1
v0.5.1
2026-01-30 15:40:18 +01:00
github-actions[bot]
c30f3a151e
chore(master): release 0.5.1
2026-01-30 14:32:41 +00:00
patrick szymkowiak
d773ec3ea5
Merge pull request #23 from FlorianBruniaux/master
...
fix: 3 issues (latest tag, ccusage fallback, versioning)
2026-01-30 15:32:24 +01:00
Florian BRUNIAUX
9e322e2aee
fix: patrick's 3 issues (latest tag, ccusage fallback, versioning)
...
1. CRITICAL: Fix 'latest' tag creation after releases
- Move update-latest-tag job from release.yml to release-please.yml
- release-please creates tags via API (no push event) → must run in same workflow
- Job now conditional on release_created output
2. IMPORTANT: Add npx fallback for ccusage + improve message
- Check binary in PATH first, fallback to 'npx ccusage'
- Updated message: "npm i -g ccusage (or use npx ccusage)"
- Consistent with other JS tooling (next_cmd, tsc_cmd, prettier_cmd)
3. PROCESS: Slow down version bumps with release-please config
- Add release-please-config.json with bump-patch-for-minor-pre-major
- In 0.x versions: feat: → patch bump instead of minor
- Prevents rapid version inflation (0.3.1 → 0.5.0 in 21h)
Fixes issues raised by Patrick after PR #21 merge.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 15:24:56 +01:00
patrick szymkowiak
62f9055899
Merge pull request #22 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.5.0
v0.5.0
2026-01-30 14:24:44 +01:00
github-actions[bot]
3475992c14
chore(master): release 0.5.0
2026-01-30 13:15:53 +00:00
patrick szymkowiak
8e72e7a8b8
Merge pull request #21 from FlorianBruniaux/feature/temporal-audit-system
...
feat: comprehensive economics analysis and code quality improvements
2026-01-30 14:15:38 +01:00
Florian BRUNIAUX
3b847f863a
fix: optimize HashMap merge and add safety checks
...
Applies targeted code quality improvements:
Issue #5 : Reduce clones in HashMap merge
- Destructure CcusagePeriod to avoid cloning key
- Use .or_insert_with_key() for ccusage data merging
- Keep necessary clones for rtk data (HashMap ownership requirement)
- Affects: merge_daily, merge_weekly, merge_monthly
Issue #7 : Replace magic number with named constant
- Add const BILLION: f64 = 1e9
- Improves readability in cache token calculation
Issue #8 : Add NaN/Infinity safety check
- Guard format_usd() against invalid float values
- Return "$0.00" for non-finite inputs
Build: Clean (1 pre-existing warning)
Tests: 79/82 passing (3 pre-existing failures)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 14:05:50 +01:00
Florian BRUNIAUX
5b840cca49
fix: comprehensive code quality improvements
...
Apply systematic quality fixes identified in code audit:
Phase 1: Remove dead code (4 warnings → 0)
- Remove unused run_compact() function in gain.rs
- Remove unused track_tokens() function in tracking.rs
- Remove unused TRACKER singleton (Mutex)
- Clean up CommandRecord struct (remove unused fields)
Phase 2: Add error context and quality fixes
- Add .context() to all ? operators in cc_economics.rs (15+ callsites)
- Add .context() to all ? operators in gain.rs (10+ callsites)
- Fix bounds check panic risk in gain.rs:252 (week_start slice)
- Reduce visibility: estimate_tokens pub → private
- Replace 6 manual loops with idiomatic .collect::<Result<Vec<_>, _>>()?
- Remove residual dev comment (// psk:)
- Remove unnecessary .clone() in main.rs
Phase 3: Refactor duplication (132 lines eliminated)
- Create display_helpers.rs module with PeriodStats trait
- Unify print_daily_full/weekly/monthly in gain.rs (152 lines → 9 lines)
- Implement trait for DayStats, WeekStats, MonthStats
- Zero-overhead compile-time dispatch (monomorphization)
- Output bit-identical, all tests passing
Impact:
- Dead code: -20 lines
- Error context: Errors now actionable instead of opaque
- Duplication: -132 lines of pure duplication
- Safety: Bounds check prevents potential panic
- Idiomaticity: .collect() over manual loops
Metrics:
- Build: 0 errors, 1 warning (pre-existing cache_* fields)
- Tests: 79/82 passing (3 pre-existing failures)
- Clippy: 13 warnings (all pre-existing)
- Functional: rtk gain --daily, rtk cc-economics validated
Addresses code audit feedback from parallel session
Detailed report: claudedocs/refactoring-report.md
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 13:48:03 +01:00
Florian BRUNIAUX
ec1cf9a56d
feat: add comprehensive claude code economics analysis
...
Implement `rtk cc-economics` command combining ccusage spending data
with rtk savings analytics for economic impact reporting.
Features:
- Dual metric system (active vs blended cost-per-token)
- Daily/weekly/monthly granularity with ISO-8601 week alignment
- JSON/CSV export support for data analysis
- Graceful degradation when ccusage unavailable
- Real-time data merge with O(n+m) HashMap performance
Architecture:
- src/ccusage.rs: Isolated ccusage CLI interface (7 tests)
- src/cc_economics.rs: Business logic + display (10 tests)
- src/utils.rs: Shared formatting utilities (8 tests)
- Refactored gain.rs to use shared format_tokens()
Test coverage: 17 new tests, all passing
Validated with real-world data (2 months, $3.4K spent, 1.2M saved)
Addresses: #economics-integration
Impact: 24.4% cost savings identified ($830.91 active pricing)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 12:34:47 +01:00
patrick szymkowiak
4f0ad2e86e
Merge pull request #20 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.4.0
v0.4.0
2026-01-30 11:38:52 +01:00
github-actions[bot]
cf8ddcbe6e
chore(master): release 0.4.0
2026-01-30 10:37:17 +00:00
patrick szymkowiak
862047e387
Merge pull request #19 from FlorianBruniaux/feature/temporal-audit-system
...
feat: Comprehensive Temporal Audit System for Token Savings Analytics
2026-01-30 11:36:58 +01:00
Florian BRUNIAUX
76703ca3f5
feat: add comprehensive temporal audit system for token savings analytics
...
Implement day-by-day, week-by-week, and monthly breakdowns with JSON/CSV export
capabilities for in-depth token savings analysis and reporting.
New Features:
- Daily breakdown (--daily): Complete day-by-day statistics without 30-day limit
- Weekly breakdown (--weekly): Sunday-to-Saturday week aggregations with date ranges
- Monthly breakdown (--monthly): Calendar month aggregations (YYYY-MM format)
- Combined view (--all): All temporal breakdowns in single output
- JSON export (--format json): Structured data for APIs, dashboards, scripts
- CSV export (--format csv): Tabular data for Excel, Google Sheets, data science
Technical Implementation:
- src/tracking.rs: Add DayStats, WeekStats, MonthStats structures with Serialize
- src/tracking.rs: Implement get_all_days(), get_by_week(), get_by_month() SQL queries
- src/main.rs: Extend Commands::Gain with --daily, --weekly, --monthly, --all, --format flags
- src/gain.rs: Add print_daily_full(), print_weekly(), print_monthly() display functions
- src/gain.rs: Implement export_json() and export_csv() for data export
Documentation:
- docs/AUDIT_GUIDE.md: Comprehensive guide with examples, workflows, integrations
- README.md: Update Data section with new audit commands and export formats
- claudedocs/audit-feature-summary.md: Technical summary and implementation details
Database Scope:
- Global machine storage: ~/.local/share/rtk/history.db
- Shared across all projects, worktrees, and Claude sessions
- 90-day retention policy with automatic cleanup
- SQLite with indexed timestamp for fast aggregations
Use Cases:
- Trend analysis: identify daily/weekly patterns in token usage
- Cost reporting: monthly savings reports for budget tracking
- Data science: export CSV/JSON for pandas, R, Excel analysis
- Dashboards: integrate JSON export with Chart.js, D3.js, Grafana
- CI/CD: automated weekly/monthly savings reports via GitHub Actions
Examples:
rtk gain --daily # Day-by-day breakdown
rtk gain --weekly # Weekly aggregations
rtk gain --all # All breakdowns combined
rtk gain --all --format json | jq . # JSON export with jq
rtk gain --all --format csv # CSV for Excel/analysis
Backwards Compatibility:
- All existing flags (--graph, --history, --quota) preserved
- Default behavior unchanged (summary view)
- No database migration required
- Zero breaking changes
Performance:
- Efficient SQL aggregations with timestamp index
- No impact on rtk command execution speed
- Instant queries even with 90 days of data
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 11:12:45 +01:00
patrick szymkowiak
c84a8044ee
Merge pull request #18 from FlorianBruniaux/feature/auto-latest-tag
...
ci: automate 'latest' tag update on releases
2026-01-30 10:32:46 +01:00
Florian BRUNIAUX
3d76900469
ci: automate 'latest' tag update on releases
...
Add automated workflow step to update the 'latest' tag after each
successful release. This ensures 'latest' always points to the most
recent stable version without manual intervention.
The new job:
- Runs after successful release completion
- Updates 'latest' tag to point to the new semver tag
- Uses force push to move the tag reference
- Includes version info in tag annotation message
Benefits:
- Install scripts can reliably use /releases/latest/download/
- No manual tag management needed
- Consistent reference for "current stable" across platforms
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 10:26:20 +01:00
patrick szymkowiak
e0565dacd8
Merge pull request #17 from FlorianBruniaux/docs/comprehensive-update
...
docs: comprehensive documentation update for v0.3.1
2026-01-30 10:03:30 +01:00
Florian BRUNIAUX
14f3172b33
docs: comprehensive documentation update for v0.3.1
...
Updates documentation to reflect all features added in recent PRs:
**Version Updates**
- Update installation commands to v0.3.1 (DEB/RPM packages)
**New Sections**
- Add Global Flags section (-u/--ultra-compact, -v/--verbose)
- Add JavaScript/TypeScript Stack section (10 new commands)
**New Commands Documented**
- Files: `rtk smart` (heuristic code summary)
- Commands: `rtk gh` (GitHub CLI), `rtk wget`, `rtk config`
- Data: `rtk gain --quota` and `--tier` flags
- Containers: `rtk kubectl services`
- JS/TS Stack: lint, tsc, next, prettier, vitest, playwright, prisma
**Features Coverage**
This update documents functionality from:
- PR #5 : Git argument parsing improvements
- PR #6 : pnpm support
- PR #9 : Modern JavaScript/TypeScript stack support
- PR #10 : GitHub CLI integration
- PR #11 : Quota analysis features
- PR #14 : Additional command improvements
All commands documented are available in v0.3.1.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-30 09:58:31 +01:00
patrick szymkowiak
9820e32dbc
Merge pull request #16 from FlorianBruniaux/docs/architecture-v2
...
docs: add comprehensive ARCHITECTURE.md v2.0
2026-01-29 19:54:23 +01:00
Florian BRUNIAUX
586ec7fd17
docs: add comprehensive ARCHITECTURE.md v2.0
...
## Overview
Complete architectural documentation (1133 lines) covering all 30 modules,
design patterns, and extensibility guidelines.
## Critical Fixes (🔴 )
- ✅ Module count: 30 documented (not 27) - added deps, env_cmd, find_cmd, local_llm, summary, wget_cmd
- ✅ Language: Fully translated to English for consistency with README.md
- ✅ Shared Infrastructure: New section documenting utils.rs and package manager detection
- ✅ Exit codes: Correct documentation (git.rs preserves exit codes for CI/CD)
- ✅ Database: Correct path ~/.local/share/rtk/history.db (not tracking.db)
## Important Additions (🟡 )
- ✅ Global Flags Architecture: Verbosity (-v/-vv/-vvv) and ultra-compact (-u)
- ✅ Complete patterns: Package manager detection, exit code preservation, lazy static regex
- ✅ Config system: TOML format documented
- ✅ Performance: Verified binary size (4.1 MB) and estimated overhead
- ✅ Filter levels: Before/after examples with Rust code
## Bonus Improvements (🟢 )
- ✅ Table of Contents (12 sections)
- ✅ Extensibility Guide (7-step process for adding commands)
- ✅ Architecture Decision Records (Why Rust? Why SQLite?)
- ✅ Glossary (7 technical terms)
- ✅ Module Development Pattern (template + 3 common patterns)
- ✅ 15+ ASCII diagrams for visual clarity
## Stats
- Lines: 1133 (+118% vs original 520)
- Sections: 12 main + subsections
- Code examples: 10+ Rust/bash snippets
- Accuracy: 100% verified against source code
Production-ready for new contributors, experienced developers, and LLM teams.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-29 19:23:11 +01:00
patrick szymkowiak
cd1fa4b34f
Merge pull request #15 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.3.1
v0.3.1
2026-01-29 17:54:36 +01:00
github-actions[bot]
6781f2112b
chore(master): release 0.3.1
2026-01-29 16:51:43 +00:00
patrick szymkowiak
c2cd691c82
Merge pull request #14 from FlorianBruniaux/fix/critical-command-bugs
...
fix: improve command robustness and flag support
2026-01-29 17:51:28 +01:00
Florian BRUNIAUX
d7d8c65b86
fix: improve command robustness and flag support
...
## Fixes
### Lint crash handling
- Add graceful error handling for linter crashes (SIGABRT, OOM)
- Display warning message when process terminates abnormally
- Show first 5 lines of stderr for debugging context
### Grep command
- Add --type/-t flag for file type filtering (e.g., --type ts, --type py)
- Passes --type argument to ripgrep for efficient filtering
### Find command
- Add --type/-t flag for file/directory filtering
- Default: "f" (files only)
- Options: "f" (file), "d" (directory)
## Testing
- ✅ cargo check passes
- ✅ cargo build --release succeeds
- ✅ rtk grep --help shows --file-type flag
- ✅ rtk find --help shows --file-type flag with default
## Breaking Changes
None - all changes are backwards compatible additions
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com >
2026-01-29 17:43:20 +01:00
patrick szymkowiak
31c4988b40
Merge pull request #13 from pszymkowiak/release-please--branches--master--components--rtk
...
chore(master): release 0.3.0
v0.3.0
2026-01-29 17:23:02 +01:00