Commit Graph

71 Commits

Author SHA1 Message Date
patrick szymkowiak 67f93a50bc Update README.md 2026-02-02 20:23:55 +01:00
Florian BRUNIAUX 00623cb80e docs: point all documentation to upstream instead of fork
## Problem
Documentation incorrectly promoted the fork over upstream for installation,
creating confusion about which repository is the source of truth.

## Changes

### Installation Instructions
- **README.md**: Restored curl install pointing to upstream (pszymkowiak/rtk)
- **README.md**: Removed "Fork with All Features" section
- **INSTALL.md**: Added curl install, removed fork recommendation
- **TROUBLESHOOTING.md**: All installation paths → upstream

### Repository References
- **README.md**: Removed fork from repo list, issues → rtk-ai/rtk
- **CLAUDE.md**: Removed fork mention from project list
- **CHANGELOG.md**: Repository and issues → rtk-ai/rtk
- **ROADMAP.md**: Installation instructions → upstream curl

### Scripts
- **check-installation.sh**: Install instructions → upstream curl

## Result
All documentation now consistently points to upstream (rtk-ai/rtk, pszymkowiak/rtk)
as the source of truth for installation and issues.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 18:39:18 +01:00
Florian BRUNIAUX 2df4a348ab docs: add suggest hook pattern + fix discover issues URL
Changes:
- Fix discover issues URL: FlorianBruniaux → rtk-ai upstream repo
- Document suggest hook pattern as non-intrusive alternative to auto-rewrite
- Add rtk-suggest.sh template with systemMessage strategy
- Provide comparison table and setup instructions

The suggest hook emits system reminders instead of rewriting commands,
giving Claude Code explicit visibility into rtk alternatives while
preserving user control over execution decisions.

Use cases:
- Learning rtk patterns with visibility into rewrite logic
- Auditing command choices without forced adoption
- Debugging workflows requiring exact command preservation
- User preference for explicit control over transparency

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 17:03:19 +01:00
Florian BRUNIAUX e2e8be42a7 docs: clarify rtk name collision and fix installation confusion
## Problem
Users are accidentally installing the wrong "rtk" package:
- Rust Type Kit (reachingforthejack/rtk) - type generation tool
- Rust Token Killer (rtk-ai/rtk) - LLM token optimizer

This causes confusion when `rtk gain` doesn't exist after installation.

## Changes

### Documentation Updates
- **README.md**: Add prominent warning about name collision at top
- **README.md**: Fix installation instructions with mandatory verification
- **CLAUDE.md**: Add name collision warning with verification steps
- **INSTALL.md**: Clarify pre-installation checks and wrong package handling

### New Files
- **docs/TROUBLESHOOTING.md**: Comprehensive troubleshooting guide covering:
  - Wrong rtk installed (Type Kit vs Token Killer)
  - cargo install rtk pitfalls
  - Missing commands (vitest, pnpm, etc.)
  - PATH issues and compilation errors

- **scripts/check-installation.sh**: Automated diagnostic script that verifies:
  - RTK installed and in PATH
  - Correct version (Token Killer with `rtk gain`)
  - Available features
  - Claude Code integration status
  - Auto-rewrite hook configuration

## Verification
After these changes, users can quickly diagnose installation issues:
```bash
bash scripts/check-installation.sh
```

Fixes installation confusion reported by multiple users.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 15:20:39 +01:00
Florian BRUNIAUX 29869ef322 docs: document security review workflow and /rtk-pr-security skill
Add comprehensive maintainer documentation for the 3-layer security review:
- Automated GitHub Action (security-check.yml)
- Claude Code skill (/rtk-pr-security)
- Manual review requirements

Also add SECURITY.md to documentation links.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 14:01:19 +01:00
Florian BRUNIAUX cb71237b80 docs: document execution time tracking feature in v0.7.1
Add comprehensive documentation for the execution time tracking feature
introduced in upstream v0.7.1:

- CHANGELOG.md: Add v0.7.1 entry with execution time tracking feature
- CHANGELOG.md: Document parser infrastructure and migrations
- README.md: Update rtk gain analytics section with time metrics
- ARCHITECTURE.md: Add exec_time_ms column to database schema
- ARCHITECTURE.md: Update INSERT statement with exec_time_ms
- ARCHITECTURE.md: Update REPORTING example with time metrics

The feature tracks command execution duration with <0.1ms overhead
and displays total/average execution time in rtk gain output.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 10:44:34 +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
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
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
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 542eca5783 Merge branch 'master' into docs/installation-guide 2026-01-28 23:15:24 +01:00
Patrick szymkowiak 4b6887906f adding in readme exemple of multiple days sessions 2026-01-28 22:54:51 +01:00
Patrick szymkowiak bd61f6db50 chore: bump version to 0.2.1 and trigger release on master push 2026-01-28 22:54:51 +01:00
Florian BRUNIAUX 0e5b690947 docs: add fork features section with Vitest metrics to README
- Add comprehensive Fork Features section
- Document git argument parsing fix
- Add pnpm support with token savings table
- Add Vitest support with validated metrics (99.6% reduction)
- Include installation instructions for fork
- Metrics validated on production Méthode Aristote codebase

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 16:41:23 +01:00
Florian BRUNIAUX 9ff4c56f2a docs: add fork improvements section to README
Documents 3 upstream PRs (git fix, pnpm support, issues) with:
- Before/after examples
- Token savings metrics
- Production testing notes
- Security improvements
- Installation instructions

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-28 15:18:37 +01:00
Patrick szymkowiak 7548f67b1d chore: remove demo section from README 2026-01-23 16:52:30 +01:00
Patrick szymkowiak 561446254e chore: disable homebrew step for now 2026-01-23 15:41:48 +01:00
Patrick szymkowiak 964601f710 fix: correct install.sh URL (master not main) 2026-01-23 15:33:54 +01:00
Patrick szymkowiak 49b50c8f99 docs: add deb/rpm install commands 2026-01-23 14:24:58 +01:00
Patrick szymkowiak 1b762318e7 docs: update to v0.2.0, add install instructions and gain command 2026-01-23 14:23:26 +01:00
Patrick szymkowiak 5932ba1d66 docs: add README with token savings analysis and asciinema demo 2026-01-23 07:49:17 +01:00