Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .claude/hooks/bash/pre-commit-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ if cargo clippy --all-targets 2>&1 | grep -q "error:"; then
exit 1
fi

# Validate documentation consistency (version, module count, commands)
if [ -f "scripts/validate-docs.sh" ]; then
if ! bash scripts/validate-docs.sh; then
echo "❌ Documentation validation failed. Fix before committing."
exit 1
fi
fi

echo "✅ Pre-commit checks passed (warnings allowed)"
59 changes: 59 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Bug Report
description: Report a bug or unexpected behavior in RTK
labels: ["bug"]
body:
- type: input
id: rtk-version
attributes:
label: RTK version
description: Output of `rtk --version`
placeholder: "rtk 0.20.0"
validations:
required: true

- type: dropdown
id: platform
attributes:
label: Platform
options:
- macOS
- Linux
- Windows
- Other
validations:
required: true

- type: input
id: command
attributes:
label: Command that failed
description: The exact RTK command you ran
placeholder: "rtk cargo test -- --nocapture"
validations:
required: true

- type: textarea
id: actual
attributes:
label: What happened
description: Paste the actual output or describe the unexpected behavior
render: shell
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected behavior
description: What should have happened instead?
validations:
required: true

- type: textarea
id: raw-output
attributes:
label: Raw command output (without RTK)
description: Run the same command without RTK and paste the output. This helps isolate whether the issue is in RTK's filter or the underlying tool.
render: shell
validations:
required: false
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Documentation
url: https://github.com/rtk-ai/rtk/blob/master/docs/ADDING_TOOLS.md
about: Guide for adding new tool support to RTK
- name: Website
url: https://www.rtk-ai.app
about: RTK project website
65 changes: 65 additions & 0 deletions .github/ISSUE_TEMPLATE/new-tool-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: New Tool Request
description: Request support for a new CLI tool in RTK
title: "[tool] Add `rtk <tool>` support"
labels: ["enhancement", "new-tool"]
body:
- type: markdown
attributes:
value: |
Thanks for suggesting a new tool! RTK reduces token consumption by filtering CLI output.
See [docs/ADDING_TOOLS.md](https://github.com/rtk-ai/rtk/blob/master/docs/ADDING_TOOLS.md) if you want to implement it yourself.

- type: input
id: tool-name
attributes:
label: Tool name
description: The CLI command name (e.g., `swift`, `maven`, `dotnet`)
placeholder: "swift"
validations:
required: true

- type: dropdown
id: strategy
attributes:
label: Output format
description: What does the tool's output look like?
options:
- "Structured text with repeating patterns (file:line: message)"
- "JSON output (single object/array)"
- "NDJSON / line-by-line JSON streaming"
- "Phased text output (header → results → summary)"
- "Simple line-based output"
- "Not sure"
validations:
required: true

- type: textarea
id: sample-output
attributes:
label: Sample output
description: Paste a typical output from the tool (raw, unfiltered). This helps estimate token savings.
render: shell
validations:
required: true

- type: textarea
id: expected-output
attributes:
label: Expected filtered output
description: What should RTK keep? What should it strip?
placeholder: |
Keep: error messages, file paths, summary line
Strip: progress bars, ASCII art, verbose success output
validations:
required: false

- type: dropdown
id: willing-to-contribute
attributes:
label: Would you like to implement this?
options:
- "Yes, I can submit a PR"
- "I can help test but not implement"
- "No, just requesting"
validations:
required: true
8 changes: 5 additions & 3 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,18 +233,20 @@ ENVIRONMENT env_cmd.rs env 60-80% ✓
SYSTEM init.rs init N/A ✓
gain.rs gain N/A ✓
config.rs (internal) N/A ✓
scaffold_cmd.rs scaffold N/A ✓
hook_audit_cmd.rs hook-audit N/A ✓

SHARED utils.rs Helpers N/A ✓
filter.rs Language filters N/A ✓
tracking.rs Token tracking N/A ✓
tee.rs Full output recovery N/A ✓
```

**Total: 48 modules** (30 command modules + 18 infrastructure modules)
**Total: 49 modules** (31 command modules + 18 infrastructure modules)

### Module Count Breakdown

- **Command Modules**: 29 (directly exposed to users)
- **Command Modules**: 31 (directly exposed to users)
- **Infrastructure Modules**: 18 (utils, filter, tracking, tee, config, init, gain, etc.)
- **Git Commands**: 7 operations (status, diff, log, add, commit, push, branch/checkout)
- **JS/TS Tooling**: 8 modules (modern frontend/fullstack development)
Expand Down Expand Up @@ -1435,4 +1437,4 @@ When implementing a new command, consider:

**Last Updated**: 2026-02-12
**Architecture Version**: 2.1
**rtk Version**: 0.20.1
**rtk Version**: 0.22.0
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This is a fork with critical fixes for git argument parsing and modern JavaScrip

**Verify correct installation:**
```bash
rtk --version # Should show "rtk 0.20.1" (or newer)
rtk --version # Should show "rtk 0.22.0" (or newer)
rtk gain # Should show token savings stats (NOT "command not found")
```

Expand Down
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rtk filters and compresses command outputs before they reach your LLM context, s

**How to verify you have the correct rtk:**
```bash
rtk --version # Should show "rtk 0.20.1"
rtk --version # Should show "rtk 0.22.0"
rtk gain # Should show token savings stats
```

Expand Down Expand Up @@ -800,6 +800,20 @@ MIT License - see [LICENSE](LICENSE) for details.

Contributions welcome! Please open an issue or PR on GitHub.

### Adding a New Tool

RTK ships with a scaffold command that generates 60% of the boilerplate for a new filter:

```bash
# Preview what will be generated
rtk scaffold <tool> --strategy <strategy> --dry-run

# Generate src/<tool>_cmd.rs
rtk scaffold <tool> --strategy <strategy>
```

Available strategies: `plain`, `regex`, `json`, `ndjson`, `text`. See [`docs/ADDING_TOOLS.md`](docs/ADDING_TOOLS.md) for the full step-by-step guide.

**For external contributors**: Your PR will undergo automated security review (see [SECURITY.md](SECURITY.md)). This protects RTK's shell execution capabilities against injection attacks and supply chain vulnerabilities.

## Contact
Expand Down
Loading
Loading