Commit Graph

590 Commits

Author SHA1 Message Date
patrick szymkowiak d6ff33f543 Merge pull request #52 from FlorianBruniaux/docs/point-to-upstream
docs: point all documentation to upstream instead of fork
2026-02-02 20:48:52 +01:00
patrick szymkowiak 48ed221a06 Revise RTK roadmap for clarity and updated goals
Updated the RTK roadmap to reflect current objectives, phases, and tasks. Removed outdated sections and added new priorities for upcoming phases.
2026-02-02 20:32:45 +01:00
patrick szymkowiak 67f93a50bc Update README.md 2026-02-02 20:23:55 +01:00
patrick szymkowiak b1f15cf494 Fix repository link in INSTALL.md
Updated repository links for Rust Token Killer installation instructions.
2026-02-02 20:22:25 +01:00
patrick szymkowiak 8138071139 Update name collision warning in CLAUDE.md
Clarified name collision warning for 'rtk' projects.
2026-02-02 20:20:44 +01:00
patrick szymkowiak 15a34aef04 Fix installation script URL and update project info
Updated installation instructions and clarified project details.
2026-02-02 20:19:41 +01:00
patrick szymkowiak c2e5304382 Update installation script URLs to new repository
correcting url
2026-02-02 20:17:07 +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
patrick szymkowiak 5faabce69a Merge pull request #51 from FlorianBruniaux/docs/suggest-hook-pattern 2026-02-02 17:16:57 +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
patrick szymkowiak 8948473a02 Merge pull request #50 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.8.1
v0.8.1
2026-02-02 16:50:07 +01:00
github-actions[bot] 5eb65f61d7 chore(master): release 0.8.1 2026-02-02 15:48:14 +00:00
patrick szymkowiak a7ea1439fb Merge pull request #49 from FlorianBruniaux/fix/git-status-accept-flags
fix: allow git status to accept native flags
2026-02-02 16:47:51 +01:00
Florian BRUNIAUX a27bce82f0 fix: allow git status to accept native flags
Previously, `rtk git status` was the only git subcommand that rejected
all arguments. This fix aligns it with other git subcommands (diff, log,
show, etc.) by accepting native git flags.

Changes:
- Extract format_status_output() as pure testable function
- Add args variant to Clap Status command with trailing_var_arg
- Modify run_status() to accept args parameter
- Passthrough mode: if user provides flags (--short, -s, --porcelain),
  forward directly to git without RTK formatting
- Default mode: no flags = RTK compact formatting (unchanged behavior)
- Add 5 unit tests for format_status_output (clean, modified, untracked,
  mixed, truncation)
- Add 4 smoke tests for flag passthrough (--short, -s, --porcelain)

Test results:
- 151 unit tests passed (5 new)
- 69 smoke tests passed (4 new for status flags)

Fixes the issue where commands like `rtk git status --short` were
rejected with "unexpected argument" error.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 16:42:06 +01:00
patrick szymkowiak e2e478ddc1 Merge pull request #48 from FlorianBruniaux/docs/fix-name-collision-confusion
docs: clarify rtk name collision and fix installation confusion
2026-02-02 15:26:17 +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
patrick szymkowiak 13217e830e Merge pull request #47 from rtk-ai/release-please--branches--master--components--rtk
chore(master): release 0.8.0
v0.8.0
2026-02-02 14:55:16 +01:00
github-actions[bot] 92a3333d10 chore(master): release 0.8.0 2026-02-02 13:32:50 +00:00
patrick szymkowiak 1ca6e81bdf Merge pull request #46 from FlorianBruniaux/feat/security-review-workflow
feat: add comprehensive security review workflow for PRs
2026-02-02 14:32:19 +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 66101ebb65 feat: add comprehensive security review workflow for PRs
This PR implements a 3-layer security review process to protect RTK
against shell injection, supply chain attacks, and backdoors from
external contributors.

**Layer 1: Automated GitHub Action**
- .github/workflows/security-check.yml: Runs on every PR
  - cargo audit for CVE detection in dependencies
  - Critical files alert (runner.rs, tracking.rs, Cargo.toml, workflows)
  - Dangerous pattern scanning (Command::new("sh"), reqwest::, unsafe, etc.)
  - New dependency auditing
  - Clippy security lints
  - Structured report in GitHub Actions summary

**Layer 2: Documentation**
- SECURITY.md: Public security policy with:
  - Vulnerability reporting process (responsible disclosure)
  - PR security review workflow for external contributors
  - Critical files requiring enhanced review (3 tiers)
  - Dangerous code patterns we check for
  - Dependency security criteria
  - Best practices for contributors

**Layer 3: Claude Code Skill (external)**
- Skill rtk-pr-security deployed in reviewer's local environment
- Provides comprehensive RTK-specific analysis
- Complements automated checks with semantic analysis

**Critical Files Protected:**
- src/runner.rs (shell execution engine)
- src/summary.rs (command aggregation)
- src/tracking.rs (SQLite database)
- src/pnpm_cmd.rs (input validation)
- Cargo.toml (supply chain)
- .github/workflows/ (CI/CD tampering)

**Detection Patterns:**
- Shell injection vectors (Command::new("sh"))
- Environment manipulation (.env("LD_PRELOAD"))
- Network operations (reqwest::, std::net::)
- Unsafe code blocks
- Panic-inducing code (.unwrap() in production)
- Time-based logic bombs
- Obfuscated code (base64, hex)

**Review Requirements:**
- Standard review: Non-critical files, <200 lines
- Enhanced review: Critical files OR >200 lines
- 2 maintainers: Cargo.toml changes OR workflow modifications

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 13:57:51 +01:00
patrick szymkowiak bcaf6f22d4 Merge pull request #44 from FlorianBruniaux/docs/execution-time-tracking-v0.7.1
docs: document execution time tracking feature in v0.7.1
2026-02-02 11:57:24 +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
patrick szymkowiak ac59c4b350 Merge pull request #41 from FlorianBruniaux/fix/release-manifest-version
chore: set version to 0.7.1 (skip unintended 1.0.0 bump)
v0.7.1
2026-02-02 09:05:32 +01:00
patrick szymkowiak 6493bc92d8 Merge pull request #43 from FlorianBruniaux/feat/git-show
feat: add parser infrastructure with three-tier fallback system
2026-02-02 09:04:08 +01:00
Florian BRUNIAUX cf26ad477b feat: migrate vitest, playwright, pnpm to OutputParser trait
Complete Phase 4 module migrations - refactor to use unified parser infrastructure:

**Modules Migrated:**
1. vitest_cmd.rs → VitestParser : OutputParser<Output=TestResult>
2. playwright_cmd.rs → PlaywrightParser : OutputParser<Output=TestResult>
3. pnpm_cmd.rs → PnpmListParser + PnpmOutdatedParser : OutputParser<Output=DependencyState>

**Architecture:**
- All modules now use three-tier fallback (Full/Degraded/Passthrough)
- Leverage TokenFormatter trait for Compact/Verbose/Ultra modes
- Canonical types (TestResult, DependencyState) replace ad-hoc structures
- Consistent error handling with emit_degradation_warning/emit_passthrough_warning

**Benefits:**
- 41 lines removed (762 insertions, 803 deletions)
- Unified formatting across all test runners
- Observable parsing tiers in verbose mode
- Better maintainability with shared infrastructure
- Foundation for future module migrations

**Testing:**
- 10 new tests added (4 vitest, 3 playwright, 3 pnpm)
- All migrated modules pass their test suites
- JSON Tier 1 parsing validated
- Regex Tier 2 fallback validated
- Passthrough Tier 3 safety validated

**Next Steps:**
- Migrate remaining modules (lint_cmd, tsc_cmd, gh_cmd, prisma_cmd)
- Add observability (track parse_tier in tracking.db)
- Performance benchmarking of new architecture

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 08:44:11 +01:00
Florian BRUNIAUX edab4e142e feat: add parser infrastructure with three-tier fallback system
Implement Phase 3 of maintainability plan - unified parser architecture:

**Core Components:**
- parser/mod.rs: OutputParser trait + ParseResult enum (Full/Degraded/Passthrough)
- parser/error.rs: ParseError types with thiserror (JSON, Pattern, Partial, etc.)
- parser/types.rs: Canonical types (TestResult, LintResult, DependencyState, BuildOutput)
- parser/formatter.rs: TokenFormatter trait with Compact/Verbose/Ultra modes
- parser/README.md: Complete usage guide and migration examples

**Three-Tier Fallback System:**
1. Tier 1 (Full): Complete JSON parsing with structured data
2. Tier 2 (Degraded): Partial regex extraction with warnings
3. Tier 3 (Passthrough): Truncated raw output with [RTK:PASSTHROUGH] marker

**Benefits:**
- Never returns false data silently (fixes prisma_cmd issue)
- Graceful degradation on tool version changes
- Unified interface across all tool types
- Observable degradation with [RTK:DEGRADED] warnings
- Foundation for Phase 4 module migrations

**Dependencies:**
- Added thiserror 1.0 for structured error types

**Testing:**
- 3 unit tests for ParseResult tier system
- Tests pass: tier(), is_ok(), map(), warnings()

Next: Phase 4 - Migrate existing modules to use parser trait

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 08:43:19 +01:00
Florian BRUNIAUX 50ba21e2e5 feat: add JSON parsing with safe fallbacks for vitest, playwright, pnpm
Implement "Structured Output First" strategy with graceful degradation:

Phase 1 (Quick Wins):
- vitest: Add --reporter=json flag
- playwright: Add --reporter=json flag
- pnpm list/outdated: Add --json/--format json flags

Phase 2 (Safe Fallbacks):
- All modules: JSON parsing with [RTK:DEGRADED] fallback to regex
- Prevents silent failures and false data returns
- Three-tier fallback: JSON → Regex → Truncated passthrough

Impact:
- Eliminates 75% of maintenance risk from output format changes
- Provides structured data parsing for better token compression
- Maintains backward compatibility with existing regex parsers

Token savings maintained while improving reliability and future-proofing
against tool version changes.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 08:43:19 +01:00
Florian BRUNIAUX 1d857914d6 feat: add local LLM analysis, filter improvements, and testing scripts
Add smart code analysis with local LLM integration (rtk smart command),
improve filter.rs formatting and readability, and add comprehensive
testing utilities.

Key changes:
- local_llm.rs: Ultra-compact code summaries for LLM contexts
- filter.rs: Better formatting, enhanced comment/docstring detection
- main.rs: Integrate smart command routing
- config.rs: Code formatting improvements
- .gitignore: Exclude claudedocs/ directory
- scripts/rtk-economics.sh: Token savings analysis
- scripts/test-all.sh: Comprehensive test runner
- scripts/test-aristote.sh: Project-specific test suite

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 08:43:19 +01:00
patrick szymkowiak a3bfbf747c Merge pull request #42 from FlorianBruniaux/feat/execution-time-tracking
feat: add execution time tracking to rtk gain analytics
2026-02-02 08:32:09 +01:00
patrick szymkowiak 3ddffddc6d Merge pull request #40 from FlorianBruniaux/fix/release-workflow-trigger
fix: trigger release build after release-please creates tag
2026-02-02 08:22:57 +01:00
Florian BRUNIAUX db30d74c69 docs: add execution time tracking test guide 2026-02-02 00:14:15 +01:00
Florian BRUNIAUX 2a1e1a8ef3 feat: add execution time tracking to rtk gain analytics
Add exec_time_ms column to SQLite schema and track execution time
for all rtk commands. Display time metrics in gain summary, daily/
weekly/monthly breakdowns, and JSON/CSV exports.

Changes:
- tracking.rs: Add exec_time_ms column, TimedExecution struct
- display_helpers.rs: Add format_duration() helper, update tables
- gain.rs: Display total/avg exec time in summary and by-command
- All command modules: Apply TimedExecution timer wrapper
- Exports: Include total_time_ms and avg_time_ms in JSON/CSV

Example output:
  Total exec time:   24.6s (avg 34ms)
  rtk cargo test        7    -86.1%   349ms avg
  rtk git status      111    -84.1%     1ms avg

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 00:14:06 +01:00
Florian BRUNIAUX 61e4467b4f chore: set version to 0.7.1 (skip unintended 1.0.0 bump)
The previous PR #38 contained BREAKING CHANGE in the commit message,
which triggered an unintended major version bump to 1.0.0.

This commit:
- Updates manifest to 0.7.1
- Updates Cargo.toml to 0.7.1

After merging, close PR #39 without merging to skip the 1.0.0 release.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:21:12 +01:00
Florian BRUNIAUX 3b44ef9865 fix: trigger release build after release-please creates tag
Fixes #27

Tags created by GITHUB_TOKEN don't trigger other workflows. This change
makes release-please call release.yml directly via workflow_call after
creating a release.

Changes:
- release.yml: Add workflow_call trigger with tag input
- release.yml: Handle workflow_call in version detection
- release.yml: Upload assets for workflow_call events
- release-please.yml: Add build-release job that calls release.yml
- release-please.yml: update-latest-tag now waits for build to complete

This approach:
- Requires no PAT/secrets
- Keeps workflows separate and maintainable
- Uses workflow_call (cleaner than workflow_dispatch)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 21:36:53 +01:00
patrick szymkowiak fe4e0f9976 Merge pull request #38 from FlorianBruniaux/fix/ls-native-proxy
fix: convert rtk ls from reimplementation to native proxy
2026-02-01 21:35:16 +01:00
Florian BRUNIAUX 2176369467 fix: convert rtk ls from reimplementation to native proxy
BREAKING CHANGE: Removes --depth, --format (tree/flat/json) flags

Before: `rtk ls` was a reimplementation using WalkBuilder that didn't
support native ls flags like -l, -a, -h, -R.

After: `rtk ls` proxies to native ls, supporting all flags:
- `rtk ls -la` works
- `rtk ls -alh` works
- `rtk ls -R src/` works
- Default: `-la` when no args

Token optimization: filters "total X" line from output.

This aligns with rtk philosophy: proxy and filter, don't reimplement.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-01 21:22:17 +01:00
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