Skip to content

Add installation guide for AI coding assistants#8

Merged
pszymkowiak merged 3 commits intortk-ai:masterfrom
FlorianBruniaux:docs/installation-guide
Jan 28, 2026
Merged

Add installation guide for AI coding assistants#8
pszymkowiak merged 3 commits intortk-ai:masterfrom
FlorianBruniaux:docs/installation-guide

Conversation

@FlorianBruniaux
Copy link
Collaborator

Summary

Adds INSTALL.md with comprehensive installation guide optimized for AI coding assistant integration and team collaboration.

Changes

  • New INSTALL.md with step-by-step installation instructions
  • Mandatory pre-installation verification check (prevents unnecessary reinstalls)
  • Troubleshooting section for common installation issues
  • Production-validated token savings metrics
  • AI assistant integration checklist

Key Features

1. Mandatory Verification First

  • ⚠️ Requires rtk --version check before any installation attempt
  • Prevents duplicate installations when RTK is already available
  • Helps AI assistants avoid unnecessary reinstall operations

2. Installation Options

  • Fork installation (includes latest features: pnpm, Vitest)
  • Upstream installation (stable baseline)
  • Clear guidance on when to use each option

3. Troubleshooting Section

  • PATH configuration issues
  • Missing command errors (feature branch selection)
  • Compilation errors and Rust version requirements

4. Production Metrics

Documents validated token savings from production T3 Stack projects:

  • Vitest: 99.6% reduction (102,199 → 377 chars)
  • Git operations: 59-80% reduction
  • pnpm operations: 70-90% reduction
  • Typical 30-min session: 70% reduction (150K → 45K tokens)

5. AI Assistant Integration

Provides checklist for AI coding assistants (Claude Code, Cursor, etc.):

  • Verify installation before use
  • Initialize project with rtk init
  • Use rtk proxy for all supported commands
  • Track savings with rtk gain

Use Cases

  • Helps teams onboard quickly with RTK
  • Ensures AI coding assistants properly check installation status
  • Provides clear troubleshooting guidance
  • Documents real-world token savings for validation

Files Changed

  • INSTALL.md: Comprehensive installation and usage guide (183 lines)

FlorianBruniaux and others added 2 commits January 28, 2026 15:18
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>
- Add INSTALL.md with step-by-step installation instructions
- Mandatory pre-installation verification check (rtk --version)
- Troubleshooting section for common issues
- Production-validated token savings metrics (anonymized)
- AI assistant integration checklist
- Fork vs upstream installation strategy
Copilot AI review requested due to automatic review settings January 28, 2026 16:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds an installation/onboarding guide aimed at AI coding assistants and updates the README with detailed “fork improvements” content (including claimed support/fixes and token-savings metrics).

Changes:

  • Added a new INSTALL.md with pre-install verification, install steps, troubleshooting, and an AI assistant checklist.
  • Extended README.md with a large section describing fork-specific improvements, upstream PR links, and installation guidance.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
README.md Adds a fork-focused section (claimed git parsing fix, pnpm support, token metrics, and fork install instructions).
INSTALL.md Introduces a dedicated installation guide with verification-first workflow, troubleshooting, and assistant checklist.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +180 to +183
- [ ] Use `rtk` for ALL git/pnpm/test/vitest commands
- [ ] Check savings: `rtk gain`

**Golden Rule**: AI coding assistants should ALWAYS use `rtk` as a proxy for shell commands that generate verbose output (git, pnpm, npm, cargo test, vitest, docker, kubectl).
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The “AI Assistant Checklist” says to use rtk for ALL pnpm/vitest commands, but those subcommands are not implemented in the current CLI. This should be reworded to match the actual supported command set (or explicitly scoped to the branch/PR that adds pnpm/vitest support).

Suggested change
- [ ] Use `rtk` for ALL git/pnpm/test/vitest commands
- [ ] Check savings: `rtk gain`
**Golden Rule**: AI coding assistants should ALWAYS use `rtk` as a proxy for shell commands that generate verbose output (git, pnpm, npm, cargo test, vitest, docker, kubectl).
- [ ] Prefer using `rtk` for git and test commands that are supported by your installed RTK version (see `rtk --help`)
- [ ] Check savings: `rtk gain`
**Golden Rule**: AI coding assistants should use `rtk` as a proxy for shell commands that generate verbose output and are supported by the installed RTK version (for example: git, npm, cargo test; and pnpm/vitest when using a fork/branch that adds support, docker, kubectl).

Copilot uses AI. Check for mistakes.
Comment on lines +187 to +206
Fixes a major bug where git flags were rejected as invalid arguments.

**Problem**:
```bash
rtk git log --oneline -20
# Error: unexpected argument '--oneline' found
```

**Solution**:
- Fixed Clap argument parsing with `trailing_var_arg + allow_hyphen_values`
- Auto-detects `--merges` flag to skip `--no-merges` injection
- Propagates git exit codes properly (fixes CI/CD false positives)

**Now Working**:
```bash
rtk git log --oneline -20 # Compact commit history
rtk git diff --cached # Staged changes only
rtk git log --graph --all # Branch visualization
rtk git status --short # Ultra-compact status
```
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The README claims the git argument parsing bug is fixed and shows examples like rtk git log --oneline -20 as “Now Working”, but the current CLI definition for rtk git log/rtk git diff still doesn’t allow hyphen-prefixed values for the args positional (see src/main.rs where GitCommands::{Log,Diff} have #[arg(trailing_var_arg = true)] without allow_hyphen_values = true). As-is, --oneline is still likely to be rejected by clap. Either update the docs to describe this as a pending change / branch-specific behavior, or implement the parsing fix before advertising it here.

Copilot uses AI. Check for mistakes.
Comment on lines +210 to +221
### 📦 PR #6: pnpm Support for Modern JavaScript Stacks

**Status**: [Open](https://github.com/pszymkowiak/rtk/pull/6) | **Target**: T3 Stack users

Adds first-class pnpm support with security hardening.

**New Commands**:
```bash
rtk pnpm list # Dependency tree (70% token reduction)
rtk pnpm outdated # Update candidates (80-90% reduction)
rtk pnpm install <pkg> # Silent success confirmation
```
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This section documents rtk pnpm ... commands and claims pnpm support exists in this fork, but there is no pnpm subcommand in the current CLI (src/main.rs enum Commands doesn’t include Pnpm). This will mislead users following the README. Either remove/soften this to “planned” and point at the relevant branch/PR, or add the actual pnpm command implementation before merging the docs.

Copilot uses AI. Check for mistakes.
Comment on lines +260 to +268
# Clone and build
git clone https://github.com/FlorianBruniaux/rtk.git
cd rtk
cargo build --release

# Install globally
cargo install --path .

# Or use directly
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The installation snippet runs cargo build --release and then cargo install --path .. cargo install --path . already performs a release build and does not reuse the local target/release artifacts, so this extra build step is redundant and can confuse readers (and wastes time). Consider either (a) using only cargo install --path . (optionally with --force for upgrades) or (b) using cargo build --release and running ./target/release/rtk without cargo install as an alternative path.

Suggested change
# Clone and build
git clone https://github.com/FlorianBruniaux/rtk.git
cd rtk
cargo build --release
# Install globally
cargo install --path .
# Or use directly
# Clone and install from source
git clone https://github.com/FlorianBruniaux/rtk.git
cd rtk
cargo install --path .
# Or build and run locally (no install)
cargo build --release

Copilot uses AI. Check for mistakes.
Comment on lines +179 to +181
## Improvements in This Fork

This fork adds critical fixes and modern JavaScript stack support to RTK, validated on production T3 Stack codebases.
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

The PR description says only INSTALL.md is changed, but this PR also adds a large fork-specific section to README.md. Please update the PR description (or remove the README change) so reviewers and downstream consumers understand the scope and intent of the PR.

Copilot uses AI. Check for mistakes.
Comment on lines +68 to +73
# Test with pnpm (fork only)
rtk pnpm list

# Test with Vitest (feat/vitest-support branch only)
rtk vitest run
```
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

INSTALL.md instructs users to run rtk pnpm list / rtk vitest run, but the current CLI doesn’t expose pnpm or vitest subcommands (src/main.rs has no Pnpm/Vitest in enum Commands). This verification section should only reference commands that exist in this repo, or clearly label them as branch-specific and point to the exact branch/commit that provides them.

Copilot uses AI. Check for mistakes.
git clone https://github.com/FlorianBruniaux/rtk.git
cd rtk

# Check branch (should be master or feat/vitest-support)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

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

This step hardcodes the default branch as master for the fork. In this repository the primary branch appears to be main (and forks may vary), so instructing “should be master” is likely to be wrong and confusing. Consider changing this to “ensure you’re on the default branch (e.g. main)” and only mention feat/vitest-support when explicitly needed.

Suggested change
# Check branch (should be master or feat/vitest-support)
# Check branch (ensure you're on the default branch, e.g. `main`, or `feat/vitest-support` when explicitly needed)

Copilot uses AI. Check for mistakes.
@pszymkowiak pszymkowiak merged commit 52b4ed3 into rtk-ai:master Jan 28, 2026
1 check failed
FlorianBruniaux added a commit to FlorianBruniaux/rtk that referenced this pull request Jan 29, 2026
FlorianBruniaux added a commit to FlorianBruniaux/rtk that referenced this pull request Jan 30, 2026
Applies targeted code quality improvements:

Issue rtk-ai#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 rtk-ai#7: Replace magic number with named constant
- Add const BILLION: f64 = 1e9
- Improves readability in cache token calculation

Issue rtk-ai#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>
ahundt pushed a commit to ahundt/rtk that referenced this pull request Feb 23, 2026
Add installation guide for AI coding assistants
ahundt pushed a commit to ahundt/rtk that referenced this pull request Feb 23, 2026
Applies targeted code quality improvements:

Issue rtk-ai#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 rtk-ai#7: Replace magic number with named constant
- Add const BILLION: f64 = 1e9
- Improves readability in cache token calculation

Issue rtk-ai#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>
navidemad added a commit to navidemad/rtk that referenced this pull request Mar 1, 2026
- Fix misleading correctable count comment in rubocop_cmd.rs to explain
  the 0-value ambiguity (absent field vs genuinely zero) (issue rtk-ai#8)
- Update compact_minitest_failure doc to describe full behavior including
  message line context (issue rtk-ai#14)
- Add JSON-parse-failure fallback mention to rspec_cmd.rs and
  rubocop_cmd.rs module-level docs (issue rtk-ai#15)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

3 participants