feat(app): add skill slash commands (#11369)

This commit is contained in:
Ryan Vogel
2026-01-31 09:59:28 -05:00
committed by GitHub
parent f73f88fb56
commit 786ae0a584
5 changed files with 59 additions and 2 deletions

View File

@@ -359,6 +359,20 @@ export function Autocomplete(props: {
})
}
for (const skill of sync.data.skill) {
results.push({
display: "/skill:" + skill.name,
description: skill.description,
onSelect: () => {
const newText = `Load the "${skill.name}" skill and follow its instructions.`
const cursor = props.input().logicalCursor
props.input().deleteRange(0, 0, cursor.row, cursor.col)
props.input().insertText(newText)
props.input().cursorOffset = Bun.stringWidth(newText)
},
})
}
results.sort((a, b) => a.display.localeCompare(b.display))
const max = firstBy(results, [(x) => x.display.length, "desc"])?.display.length