Skip to content

Commit ee473ef

Browse files
committed
feat: /refactor /debug /init /todo /deps workflow commands (v1.6.0)
1 parent 6c14213 commit ee473ef

File tree

3 files changed

+48
-1
lines changed

3 files changed

+48
-1
lines changed

dist/agent/loop.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,27 @@ export async function interactiveSession(config, getUserInput, onEvent, onAbortR
369369
const pattern = input.slice(6).trim();
370370
input = `Find files matching the pattern "${pattern}" using Glob. Show the results.`;
371371
}
372+
// Handle /refactor <description> — code refactoring
373+
if (input.startsWith('/refactor ')) {
374+
const desc = input.slice(10).trim();
375+
input = `Refactor: ${desc}. Read the relevant code first, then make targeted changes. Explain each change.`;
376+
}
377+
// Handle /debug — analyze recent error
378+
if (input === '/debug') {
379+
input = 'Look at the most recent error in this session. Read the relevant source files, analyze the root cause, and suggest a fix with specific code changes.';
380+
}
381+
// Handle /init — initialize project context
382+
if (input === '/init') {
383+
input = 'Read the project structure: check package.json (or equivalent), README, and key config files. Summarize: what this project is, main language/framework, entry points, and how to run/test it.';
384+
}
385+
// Handle /todo — find TODOs in codebase
386+
if (input === '/todo') {
387+
input = 'Search the codebase for TODO, FIXME, HACK, and XXX comments using Grep. Show the results grouped by file.';
388+
}
389+
// Handle /deps — show project dependencies
390+
if (input === '/deps') {
391+
input = 'Read the project dependency file (package.json, requirements.txt, go.mod, Cargo.toml, etc.) and list key dependencies with their versions.';
392+
}
372393
// Handle /status — show git status
373394
if (input === '/status') {
374395
try {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@blockrun/runcode",
3-
"version": "1.5.14",
3+
"version": "1.6.0",
44
"description": "RunCode — AI coding agent powered by 41+ models. Pay per use with USDC.",
55
"type": "module",
66
"bin": {

src/agent/loop.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,32 @@ export async function interactiveSession(
468468
input = `Find files matching the pattern "${pattern}" using Glob. Show the results.`;
469469
}
470470

471+
// Handle /refactor <description> — code refactoring
472+
if (input.startsWith('/refactor ')) {
473+
const desc = input.slice(10).trim();
474+
input = `Refactor: ${desc}. Read the relevant code first, then make targeted changes. Explain each change.`;
475+
}
476+
477+
// Handle /debug — analyze recent error
478+
if (input === '/debug') {
479+
input = 'Look at the most recent error in this session. Read the relevant source files, analyze the root cause, and suggest a fix with specific code changes.';
480+
}
481+
482+
// Handle /init — initialize project context
483+
if (input === '/init') {
484+
input = 'Read the project structure: check package.json (or equivalent), README, and key config files. Summarize: what this project is, main language/framework, entry points, and how to run/test it.';
485+
}
486+
487+
// Handle /todo — find TODOs in codebase
488+
if (input === '/todo') {
489+
input = 'Search the codebase for TODO, FIXME, HACK, and XXX comments using Grep. Show the results grouped by file.';
490+
}
491+
492+
// Handle /deps — show project dependencies
493+
if (input === '/deps') {
494+
input = 'Read the project dependency file (package.json, requirements.txt, go.mod, Cargo.toml, etc.) and list key dependencies with their versions.';
495+
}
496+
471497
// Handle /status — show git status
472498
if (input === '/status') {
473499
try {

0 commit comments

Comments
 (0)