Skip to content

Commit 1500aa5

Browse files
Merge pull request #27 from HarnessLab/update_17_4
slash commands
2 parents 0f433d8 + 20aaad6 commit 1500aa5

40 files changed

Lines changed: 5717 additions & 46 deletions

‎PARITY_CHECKLIST.md‎

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Done:
117117
- [x] Filesystem-backed custom agent discovery from `~/.claude/agents` and `./.claude/agents`
118118
- [x] Active agent override precedence across built-in, user, and project agent definitions
119119
- [x] Custom agent resolution in the `Agent` tool with model, tool-filter, and initial-prompt support
120+
- [x] Local custom-agent file creation, update, and deletion flows for project/user agent definitions
120121

121122
Missing:
122123

@@ -145,6 +146,9 @@ Done:
145146
- [x] `agent-context-raw` command
146147
- [x] `token-budget` command
147148
- [x] `agents` command
149+
- [x] `agents-create` command
150+
- [x] `agents-update` command
151+
- [x] `agents-delete` command
148152
- [x] Local background session mode
149153
- [x] Local background session listing (`agent-ps`)
150154
- [x] Local background session logs (`agent-logs`)
@@ -171,14 +175,14 @@ Missing:
171175
- [ ] Self-hosted runner mode
172176
- [ ] tmux fast paths
173177
- [ ] Worktree fast paths at the CLI entrypoint level
174-
- [ ] Node.js version check and platform setup from `setup.ts`
178+
- [x] Python (Node.js equivalent) version check and platform detection from `setup.ts`
175179
- [ ] Worktree creation/setup from `setup.ts`
176180
- [ ] Terminal backup/restore from `setup.ts`
177-
- [ ] Release notes checking from `setup.ts`
181+
- [x] Release notes checking from `setup.ts` (local CHANGELOG.md, no network/cache layer)
178182
- [ ] Full `entrypoints/cli.tsx` parity (version flag, feature flags, env setup, dynamic imports)
179183
- [ ] Full `entrypoints/init.ts` parity (settings validation, OAuth, policy limits, telemetry, cleanup handlers)
180-
- [ ] SDK entrypoint (`entrypoints/sdk/` — controlTypes, coreTypes, runtimeTypes, settingsTypes, toolTypes)
181-
- [ ] Sandbox types/network config schema (`entrypoints/sandboxTypes.ts`)
184+
- [ ] SDK entrypoint (`entrypoints/sdk/` — controlTypes, coreTypes, runtimeTypes, settingsTypes, toolTypes) — partial: HOOK_EVENTS, EXIT_REASONS, ModelUsage, ThinkingConfig, MCP server configs, JsonSchemaOutputFormat ported in `src/sdk_core_types.py`
185+
- [x] Sandbox types/network config schema (`entrypoints/sandboxTypes.ts`)
182186

183187
## 3. Prompt Assembly
184188

@@ -317,56 +321,56 @@ Done (53 slash command names in 37 specs):
317321
Missing npm slash commands (from `src/commands/` — 80+ commands total):
318322

319323
- [x] `/add-dir` — Add a new working directory
320-
- [x] `/agents` — Inspect local agent configurations and show active definitions
324+
- [x] `/agents` — Inspect, create, update, and delete local agent definitions
321325
- [x] `/branch` — Create a branch of the current conversation
322-
- [ ] `/bridge` — Connect for remote-control sessions
323-
- [ ] `/btw` — Quick side question without interrupting main conversation
324-
- [ ] `/chrome` — Chrome extension settings
326+
- [x] `/bridge` — Connect for remote-control sessions (read-only status in this runtime)
327+
- [x] `/btw` — Quick side question without interrupting main conversation
328+
- [x] `/chrome` — Chrome extension settings
325329
- [x] `/color` — Set the prompt bar color for this session
326330
- [x] `/compact` — Clear history but keep a summary in context
327331
- [x] `/copy` — Copy Claude's last response to clipboard
328332
- [x] `/cost` — Show total cost and duration of session
329-
- [ ] `/desktop` — Continue session in Claude Desktop
333+
- [x] `/desktop` — Continue session in Claude Desktop
330334
- [x] `/diff` — View uncommitted changes and per-turn diffs
331335
- [x] `/doctor` — Diagnose and verify installation and settings
332336
- [x] `/effort` — Set effort level for model usage
333337
- [x] `/exit` — Exit the REPL
334338
- [x] `/export` — Export conversation to file or clipboard
335-
- [ ] `/extra-usage` — Configure extra usage for rate limits
339+
- [x] `/extra-usage` — Configure extra usage for rate limits
336340
- [x] `/fast` — Toggle fast mode
337-
- [ ] `/feedback` — Submit feedback
341+
- [x] `/feedback` — Submit feedback (alias `/bug`)
338342
- [x] `/files` — List all files currently in context
339-
- [ ] `/ide` — Manage IDE integrations and show status
340-
- [ ] `/install-github-app` — Set up GitHub Actions
341-
- [ ] `/install-slack-app` — Install Slack app
342-
- [ ] `/keybindings` — Open keybindings config file
343-
- [ ] `/mobile` — QR code for mobile app
344-
- [ ] `/output-style` — Change output style
345-
- [ ] `/passes` — Passes management
346-
- [ ] `/plugin` — Plugin management
343+
- [x] `/ide` — Manage IDE integrations and show status
344+
- [x] `/install-github-app` — Set up GitHub Actions
345+
- [x] `/install-slack-app` — Install Slack app
346+
- [x] `/keybindings` — Open keybindings config file
347+
- [x] `/mobile` — Mobile app store links (aliases `/ios`, `/android`)
348+
- [x] `/output-style` — Deprecation pointer to `/config`
349+
- [x] `/passes` — Passes management
350+
- [x] `/plugin` — Plugin management (read-only listing)
347351
- [x] `/pr-comments`, `/pr_comments` — Get comments from a GitHub PR (prompt-type)
348-
- [ ] `/privacy-settings` — View/update privacy settings
349-
- [ ] `/rate-limit-options` — Show options when rate limited
350-
- [ ] `/release-notes` — View release notes
351-
- [ ] `/reload-plugins` — Activate pending plugin changes
352-
- [ ] `/remote-env` — Configure default remote environment
353-
- [ ] `/remote-setup` — Remote setup configuration
352+
- [x] `/privacy-settings` — View/update privacy settings
353+
- [x] `/rate-limit-options` — Show options when rate limited
354+
- [x] `/release-notes` — View release notes
355+
- [x] `/reload-plugins` — Activate pending plugin changes
356+
- [x] `/remote-env` — Configure default remote environment
357+
- [x] `/remote-setup` — Remote setup configuration (gh auth status + Claude.ai/code link)
354358
- [x] `/rename` — Rename current conversation
355359
- [x] `/resume`, `/continue` — Resume a previous conversation
356360
- [x] `/rewind`, `/checkpoint` — Restore code/conversation to a previous point
357-
- [ ] `/sandbox-toggle` — Toggle sandbox mode
358-
- [x] `/skills` — List available skills
361+
- [x] `/sandbox-toggle` — Toggle sandbox mode (alias `/sandbox`)
362+
- [x] `/skills` — List available bundled skills (mirrors `commands/skills/SkillsMenu.tsx`; lists `bundled_skills.BUNDLED_SKILLS`, not slash commands)
359363
- [x] `/stats` — Usage statistics and activity
360-
- [ ] `/stickers` — Order stickers
364+
- [x] `/stickers` — Order stickers
361365
- [x] `/tag` — Toggle a searchable tag on the session
362-
- [ ] `/theme` — Change the theme
363-
- [ ] `/upgrade` — Upgrade to Max
366+
- [x] `/theme` — Change the theme
367+
- [x] `/upgrade` — Upgrade to Max
364368
- [x] `/vim` — Toggle Vim/Normal editing modes
365-
- [ ] `/voice` — Toggle voice mode
369+
- [x] `/voice` — Toggle voice mode
366370
- [ ] Feature-gated: `/buddy`, `/fork`, `/peers`, `/proactive`, `/torch`, `/workflows` (full), etc.
367371
- [ ] Internal: `/backfill-sessions`, `/break-cache`, `/bughunter`, `/commit-push-pr`, `/init-verifiers`, `/mock-limits`, `/version`, `/ultraplan`, `/autofix-pr`, etc.
368372
- [x] `/commit` — Create a git commit (prompt-type with injected git context)
369-
- [ ] Full `/agents` parity for create/edit/delete flows and multi-source management UI
373+
- [ ] Full `/agents` parity for interactive TUI/editor flows, plugin sources, and full multi-source management UX
370374

371375
## 6. Built-in Tools
372376

@@ -702,21 +706,24 @@ Done:
702706
- [x] Basic file operations in tool implementations
703707
- [x] Basic git status snapshot
704708
- [x] Basic shell/subprocess handling
709+
- [x] Bundled small portable utilities — `utils/array.ts`, `utils/set.ts`, `utils/objectGroupBy.ts`, `utils/xml.ts`, `utils/uuid.ts` ported in `src/small_utils.py`
710+
- [x] Session-scoped env-var registry (`utils/sessionEnvVars.ts`) ported in `src/session_env_vars.py`, merged into spawned subprocess env via `_build_subprocess_env` (mirrors `utils/shell/bashProvider.ts`), and dropped on `/clear` via `clear_runtime_state` (mirrors `commands/clear/caches.ts`)
711+
- [x] Display formatters from `utils/format.ts` (`formatFileSize`, `formatSecondsShort`, `formatDuration`, `formatNumber`, `formatTokens`) ported in `src/format_utils.py`
705712

706713
Missing major utility categories:
707714

708715
- [ ] Shell utilities (`utils/bash/`, `utils/shell/`, `Shell.ts`, `ShellCommand.ts`)
709-
- [ ] Git operations (`utils/git.ts`, `utils/gitDiff.ts`, `utils/gitSettings.ts`, `utils/commitAttribution.ts`)
716+
- [ ] Git operations (`utils/git.ts`, `utils/gitDiff.ts`, `utils/gitSettings.ts`, `utils/commitAttribution.ts`) — partial: `findGitRoot`, `normalizeGitRemoteUrl`, `getRepoRemoteHash`, and `shouldIncludeGitInstructions` ported in `src/git_utils.py`
710717
- [ ] File operations (`utils/file.ts`, `utils/fileRead.ts`, `utils/fileHistory.ts`, `utils/fileStateCache.ts`, `utils/fsOperations.ts`, `utils/ripgrep.ts`, `utils/glob.ts`)
711-
- [ ] AI/Model utilities (`utils/modelCost.ts`, `utils/model/`, `utils/context.ts`, `utils/queryContext.ts`)
718+
- [ ] AI/Model utilities (`utils/modelCost.ts`, `utils/model/`, `utils/context.ts`, `utils/queryContext.ts`) — partial: modelCost ported in `src/model_cost.py`
712719
- [ ] Config/Settings (`utils/config.ts`, `utils/settings/`)
713720
- [ ] Message handling (`utils/messages.ts`, `utils/messages/`, `utils/messageQueueManager.ts`)
714721
- [ ] API/Network (`utils/api.ts`, `utils/http.ts`, `utils/proxy.ts`, `utils/auth.ts`)
715722
- [ ] Session management (`utils/sessionStorage.ts`, `utils/sessionState.ts`, `utils/sessionStart.ts`, `utils/sessionRestore.ts`)
716723
- [ ] Plugin/Skill utilities (`utils/plugins/`, `utils/skills/`)
717724
- [ ] Memory/Context (`utils/memory/`, `utils/claudemd.ts`, `utils/contextAnalysis.ts`)
718-
- [ ] IDE integration (`utils/ide.ts`, `utils/jetbrains.ts`)
719-
- [ ] Platform/OS (`utils/platform.ts`, `utils/terminal.ts`, `utils/systemDirectories.ts`)
725+
- [ ] IDE integration (`utils/ide.ts`, `utils/jetbrains.ts`) — partial: `utils/idePathConversion.ts` ported in `src/ide_path_conversion.py` (`WindowsToWSLConverter`, `checkWSLDistroMatch`)
726+
- [ ] Platform/OS (`utils/platform.ts`, `utils/terminal.ts`, `utils/systemDirectories.ts`) — partial: platform detection (`getPlatform`, `getWslVersion`, `getLinuxDistroInfo`, `detectVcs`) and `getSystemDirectories` ported in `src/platform_info.py`
720727
- [ ] Debugging (`utils/debug.ts`, `utils/diagLogs.ts`, `utils/log.ts`, `utils/profilerBase.ts`)
721728
- [ ] Telemetry (`utils/telemetry/`)
722729
- [ ] Deep link utilities (`utils/deepLink/`)

‎README.md‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ Built on the public porting workspace from [instructkr/claw-code](https://github
152152
- [x] Nested agent delegation with dependency-aware topological batching
153153
- [x] Agent manager with lineage tracking and group membership
154154
- [x] Filesystem-backed custom agent profiles with built-in/user/project precedence
155+
- [x] Local custom-agent create/update/delete flows via CLI and `/agents`
155156
- [x] Local daemon-style background command family
156157
- [x] Local background session workflows: `agent-bg`, `agent-ps`, `agent-logs`, `agent-attach`, `agent-kill`
157158
- [x] Local remote runtime: manifest discovery, profile listing, connect/disconnect persistence, and CLI/slash flows
@@ -451,6 +452,9 @@ python3 -m src.main agent \
451452
| `agent-context-raw` | Show the raw context snapshot |
452453
| `token-budget` | Show prompt-window budget, reserves, and soft/hard input limits |
453454
| `agents [agent_type]` | List active local agent definitions or show one agent profile |
455+
| `agents-create <agent_type>` | Create a project or user agent definition markdown file |
456+
| `agents-update <agent_type>` | Update an existing project or user agent definition |
457+
| `agents-delete <agent_type>` | Delete an existing project or user agent definition |
454458
| `agent-resume <id> <prompt>` | Resume a saved session |
455459

456460
### Runtime Utility Commands
@@ -550,7 +554,7 @@ These are handled **locally** before the model loop:
550554
| `/permissions` | — | Show active tool permission mode |
551555
| `/model` | — | Show or update the active model |
552556
| `/tools` | — | List registered tools with permission status |
553-
| `/agents` | — | List active local agent definitions or show one profile |
557+
| `/agents` | — | List, show, create, update, or delete local agent definitions |
554558
| `/memory` | — | Show loaded CLAUDE.md memory bundle |
555559
| `/status` | `/session` | Show runtime/session status summary |
556560
| `/clear` | — | Clear ephemeral runtime state |
@@ -596,6 +600,32 @@ python3 -m src.main agent "/agents" --cwd .
596600
python3 -m src.main agent "/agents show reviewer" --cwd .
597601
```
598602

603+
Create, update, or delete agent files from the CLI:
604+
605+
```bash
606+
python3 -m src.main agents-create reviewer \
607+
--cwd . \
608+
--description "Review implementation changes carefully." \
609+
--prompt "Inspect code changes and summarize risks." \
610+
--tools read_file,grep_search \
611+
--model Qwen/Qwen3-Coder-30B-A3B-Instruct
612+
613+
python3 -m src.main agents-update reviewer \
614+
--cwd . \
615+
--description "Review implementation changes and tests carefully." \
616+
--prompt "Focus on regressions, missing tests, and risky diffs."
617+
618+
python3 -m src.main agents-delete reviewer --cwd . --source project
619+
```
620+
621+
Or use the local slash command management forms:
622+
623+
```bash
624+
python3 -m src.main agent "/agents create reviewer :: Review implementation changes carefully. :: Inspect code changes and summarize risks." --cwd .
625+
python3 -m src.main agent "/agents update reviewer Updated review description :: Focus on regressions and missing tests." --cwd .
626+
python3 -m src.main agent "/agents delete reviewer" --cwd .
627+
```
628+
599629
### Utility Commands
600630

601631
```bash

‎TESTING_GUIDE.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,9 @@ python3 -m src.main agent "/model demo-model" --cwd ./test_cases
621621
python3 -m src.main agent "/tools" --cwd ./test_cases
622622
python3 -m src.main agent "/agents" --cwd ./test_cases_agents
623623
python3 -m src.main agent "/agents show reviewer" --cwd ./test_cases_agents
624+
python3 -m src.main agent "/agents create reviewer-temp :: Review temporary code changes. :: Inspect code and summarize risks." --cwd ./test_cases_agents
625+
python3 -m src.main agent "/agents update reviewer-temp Updated temp reviewer :: Focus on regressions and missing tests." --cwd ./test_cases_agents
626+
python3 -m src.main agent "/agents delete reviewer-temp" --cwd ./test_cases_agents
624627
python3 -m src.main agent "/memory" --cwd ./test_cases
625628
python3 -m src.main agent "/status" --cwd ./test_cases
626629
python3 -m src.main agent "/session" --cwd ./test_cases
@@ -700,6 +703,9 @@ python3 -m src.main agent-context-raw --cwd ./test_cases
700703
python3 -m src.main token-budget --cwd ./test_cases
701704
python3 -m src.main agents --cwd ./test_cases_agents
702705
python3 -m src.main agents reviewer --cwd ./test_cases_agents
706+
python3 -m src.main agents-create reviewer-cli --cwd ./test_cases_agents --description "CLI-created reviewer agent." --prompt "Inspect code changes and summarize risks."
707+
python3 -m src.main agents-update reviewer-cli --cwd ./test_cases_agents --description "Updated CLI reviewer." --prompt "Focus on regressions and missing tests."
708+
python3 -m src.main agents-delete reviewer-cli --cwd ./test_cases_agents --source project
703709
```
704710

705711
### 6.2 Extra working directories and `CLAUDE.md` toggle

‎src/__init__.py‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@
1313
from .agent_manager import AgentManager
1414
from .agent_registry import (
1515
AgentLoadError,
16+
AgentMutationResult,
1617
AgentRegistrySnapshot,
18+
create_agent_definition,
19+
delete_agent_definition,
1720
find_agent_definition,
1821
load_agent_registry,
22+
normalize_mutable_source,
1923
render_agent_detail,
24+
render_agent_mutation,
2025
render_agents_report,
26+
scaffold_agent_definition,
27+
update_agent_definition,
2128
)
2229
from .agent_runtime import LocalCodingAgent
2330
from .agent_session import AgentMessage, AgentSessionState
@@ -51,6 +58,7 @@
5158
'AgentContextSnapshot',
5259
'AgentManager',
5360
'AgentLoadError',
61+
'AgentMutationResult',
5462
'AgentPermissions',
5563
'AgentRegistrySnapshot',
5664
'AgentRunResult',
@@ -119,8 +127,10 @@
119127
'clear_context_caches',
120128
'clear_token_counter_cache',
121129
'count_tokens',
130+
'create_agent_definition',
122131
'calculate_token_budget',
123132
'default_tool_registry',
133+
'delete_agent_definition',
124134
'describe_token_counter',
125135
'estimate_chat_overhead',
126136
'execute_tool',
@@ -130,9 +140,13 @@
130140
'get_user_context',
131141
'load_agent_registry',
132142
'load_session',
143+
'normalize_mutable_source',
133144
'render_agent_detail',
145+
'render_agent_mutation',
134146
'render_agents_report',
135147
'run_parity_audit',
148+
'scaffold_agent_definition',
136149
'save_session',
137150
'set_system_prompt_injection',
151+
'update_agent_definition',
138152
]

0 commit comments

Comments
 (0)