Skip to content

Commit 9ad4965

Browse files
idoubiclaude
andcommitted
feat: /security-review /refactor /summary /ask, 41 commands, README badges
- /security-review (/sec): OWASP-focused vulnerability scan - /refactor: code improvement with best practices - /summary: codebase overview and architecture - /ask: quick Q&A without tool use - README: badges, feature highlights - /help: added new commands to categorized view - Total: 41 slash commands, ~5000 lines Go Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 33cba92 commit 9ad4965

3 files changed

Lines changed: 73 additions & 0 deletions

File tree

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Codeany
22

3+
[![Release](https://img.shields.io/github/v/release/codeany-ai/codeany)](https://github.com/codeany-ai/codeany/releases)
4+
[![Go](https://img.shields.io/github/go-mod/go-version/codeany-ai/codeany)](https://go.dev/)
5+
[![License](https://img.shields.io/github/license/codeany-ai/codeany)](LICENSE)
6+
37
An open-source AI-powered terminal agent for software engineering. Built in Go with [Bubble Tea](https://github.com/charmbracelet/bubbletea) TUI and the [Open Agent SDK](https://github.com/codeany-ai/open-agent-sdk-go).
48

9+
**41 slash commands** | **Skills & Plugins** | **MCP support** | **Chinese/IME input** | **Self-update**
10+
511
## Quick Install
612

713
```bash

internal/slash/commands.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -997,6 +997,56 @@ func (h *Handler) usageCmd(args []string) Result {
997997
return Result{Message: b.String()}
998998
}
999999

1000+
// ─── /security-review ─────────────────────────────
1001+
1002+
func (h *Handler) securityReviewCmd(args []string) Result {
1003+
target := strings.Join(args, " ")
1004+
if target == "" {
1005+
target = "the current codebase"
1006+
}
1007+
return Result{
1008+
SkillPrompt: fmt.Sprintf("Perform a security review of %s. Check for:\n1. OWASP Top 10 vulnerabilities\n2. Injection attacks (SQL, command, XSS)\n3. Authentication/authorization flaws\n4. Sensitive data exposure\n5. Insecure dependencies\n6. Hardcoded secrets or credentials\n\nProvide a severity-ranked list of findings with remediation steps.", target),
1009+
}
1010+
}
1011+
1012+
// ─── /refactor ────────────────────────────────────
1013+
1014+
func (h *Handler) refactorCmd(args []string) Result {
1015+
target := strings.Join(args, " ")
1016+
if target == "" {
1017+
return Result{Message: "Usage: /refactor <file or description>\n\nAsk the agent to refactor code with best practices."}
1018+
}
1019+
return Result{
1020+
SkillPrompt: fmt.Sprintf("Refactor %s. Focus on:\n1. Code clarity and readability\n2. DRY principle (remove duplication)\n3. Single responsibility\n4. Better naming\n5. Simplify complex logic\n\nMake the changes, keeping functionality identical.", target),
1021+
}
1022+
}
1023+
1024+
// ─── /summary ─────────────────────────────────────
1025+
1026+
func (h *Handler) summaryCmd(args []string) Result {
1027+
target := strings.Join(args, " ")
1028+
if target == "" {
1029+
return Result{
1030+
SkillPrompt: "Summarize this project/codebase. Provide:\n1. What the project does\n2. Tech stack and main dependencies\n3. Directory structure overview\n4. Key entry points\n5. How to build/run/test",
1031+
}
1032+
}
1033+
return Result{
1034+
SkillPrompt: fmt.Sprintf("Summarize: %s", target),
1035+
}
1036+
}
1037+
1038+
// ─── /ask ─────────────────────────────────────────
1039+
1040+
func (h *Handler) askCmd(args []string) Result {
1041+
question := strings.Join(args, " ")
1042+
if question == "" {
1043+
return Result{Message: "Usage: /ask <question>\n\nAsk a question. The agent will answer without using tools."}
1044+
}
1045+
return Result{
1046+
SkillPrompt: fmt.Sprintf("[Answer this question directly without using any tools, just from your knowledge]: %s", question),
1047+
}
1048+
}
1049+
10001050
// ─── helpers ──────────────────────────────────────
10011051

10021052
func min(a, b int) int {

internal/slash/slash.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ func AllCommands() []CommandDef {
9494
{Name: "/branch", Description: "Git branch management", HasArgs: true},
9595
{Name: "/pr", Description: "Create pull request", HasArgs: true},
9696
{Name: "/stash", Description: "Git stash management", HasArgs: true},
97+
// Analysis
98+
{Name: "/security-review", Aliases: []string{"/sec"}, Description: "Security vulnerability scan", HasArgs: true},
99+
{Name: "/refactor", Description: "Refactor code", HasArgs: true},
100+
{Name: "/summary", Description: "Summarize project/codebase", HasArgs: true},
101+
{Name: "/ask", Description: "Quick Q&A without tools", HasArgs: true},
97102
}
98103
}
99104

@@ -221,6 +226,14 @@ func (h *Handler) Handle(input string) Result {
221226
return h.prCmd(args)
222227
case "/stash":
223228
return h.stashCmd(args)
229+
case "/security-review", "/sec":
230+
return h.securityReviewCmd(args)
231+
case "/refactor":
232+
return h.refactorCmd(args)
233+
case "/summary":
234+
return h.summaryCmd(args)
235+
case "/ask":
236+
return h.askCmd(args)
224237
default:
225238
// Try skill invocation
226239
if result, ok := h.HandleSkillInvocation(cmd, args); ok {
@@ -251,6 +264,10 @@ func (h *Handler) help() Result {
251264
b.WriteString(" /stash Stash management\n")
252265
b.WriteString(" /bug <desc> Investigate a bug\n")
253266
b.WriteString(" /test Run tests\n")
267+
b.WriteString(" /sec Security review\n")
268+
b.WriteString(" /refactor Refactor code\n")
269+
b.WriteString(" /summary Summarize codebase\n")
270+
b.WriteString(" /ask <q> Quick Q&A (no tools)\n")
254271

255272
b.WriteString("\nTools & Context:\n")
256273
b.WriteString(" /mcp Manage MCP servers\n")

0 commit comments

Comments
 (0)