Skip to content
Merged
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 .agents/skills/cleanup/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: cleanup
description: Simplify and clean code
---

# Cleanup

Please review the uncommitted changes (staged and unstaged) and find ways to simplify the code. Clean up logic. Find a simpler design. Reuse existing functions. Move utilities to utility files. Lower the cyclomatic complexity. Remove try/catch statements when not completely necessary.
8 changes: 8 additions & 0 deletions .agents/skills/review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: review
description: Review uncommitted changes
---

# Review

Run commands to get the current unstaged and stage changes. Read those files and any other that are relevant. Find ways to simplify, improve the code, find any bugs, etc.
1 change: 1 addition & 0 deletions agents/base2/base2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export function createBase2(
'propose_str_replace',
'propose_write_file',
!noAskUser && 'ask_user',
'skill',
'set_output',
),
spawnableAgents: buildArray(
Expand Down
10 changes: 10 additions & 0 deletions agents/types/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export type ToolName =
| 'run_terminal_command'
| 'set_messages'
| 'set_output'
| 'skill'
| 'spawn_agents'
| 'str_replace'
| 'suggest_followups'
Expand Down Expand Up @@ -49,6 +50,7 @@ export interface ToolParamsMap {
run_terminal_command: RunTerminalCommandParams
set_messages: SetMessagesParams
set_output: SetOutputParams
skill: SkillParams
spawn_agents: SpawnAgentsParams
str_replace: StrReplaceParams
suggest_followups: SuggestFollowupsParams
Expand Down Expand Up @@ -246,6 +248,14 @@ export interface SetMessagesParams {
*/
export interface SetOutputParams {}

/**
* Load a skill's full instructions when relevant to the current task. Skills are loaded on-demand - only load them when you need their specific guidance.
*/
export interface SkillParams {
/** The name of the skill to load */
name: string
}

/**
* Spawn multiple agents and send a prompt and/or parameters to each of them. These agents will run in parallel. Note that that means they will run independently. If you need to run agents sequentially, use spawn_agents with one agent at a time instead.
*/
Expand Down
33 changes: 16 additions & 17 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions cli/src/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { MessageWithAgents } from './components/message-with-agents'
import { PendingBashMessage } from './components/pending-bash-message'
import { StatusBar } from './components/status-bar'
import { TopBanner } from './components/top-banner'
import { SLASH_COMMANDS } from './data/slash-commands'
import { getSlashCommandsWithSkills } from './data/slash-commands'
import { useAgentValidation } from './hooks/use-agent-validation'
import { useAskUserBridge } from './hooks/use-ask-user-bridge'
import { useChatInput } from './hooks/use-chat-input'
Expand Down Expand Up @@ -63,6 +63,7 @@ import {
createDefaultChatKeyboardState,
} from './utils/keyboard-actions'
import { loadLocalAgents } from './utils/local-agent-registry'
import { getLoadedSkills } from './utils/skill-registry'
import {
getStatusIndicatorState,
type AuthStatus,
Expand Down Expand Up @@ -205,15 +206,20 @@ export const Chat = ({
const setInputMode = useChatStore((state) => state.setInputMode)
const askUserState = useChatStore((state) => state.askUserState)

// Get loaded skills for slash commands
const loadedSkills = useMemo(() => getLoadedSkills(), [])

// Filter slash commands based on current ads state - only show the option that changes state
// Also merge in skill commands
const filteredSlashCommands = useMemo(() => {
const adsEnabled = getAdsEnabled()
return SLASH_COMMANDS.filter((cmd) => {
const allCommands = getSlashCommandsWithSkills(loadedSkills)
return allCommands.filter((cmd) => {
if (cmd.id === 'ads:enable') return !adsEnabled
if (cmd.id === 'ads:disable') return adsEnabled
return true
})
}, [inputValue]) // Re-evaluate when input changes (user may have just toggled)
}, [inputValue, loadedSkills]) // Re-evaluate when input changes (user may have just toggled)

const {
slashContext,
Expand Down
Loading