ashlrcode 1.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +73 -16
  2. package/package.json +28 -9
  3. package/prompts/skills/commit.md +36 -0
  4. package/prompts/skills/coordinate.md +21 -0
  5. package/prompts/skills/daily-review.md +65 -0
  6. package/prompts/skills/debug.md +23 -0
  7. package/prompts/skills/deep-work.md +129 -0
  8. package/prompts/skills/explore.md +24 -0
  9. package/prompts/skills/init.md +39 -0
  10. package/prompts/skills/kairos.md +19 -0
  11. package/prompts/skills/plan.md +19 -0
  12. package/prompts/skills/polish.md +94 -0
  13. package/prompts/skills/pr.md +30 -0
  14. package/prompts/skills/refactor.md +26 -0
  15. package/prompts/skills/resume-branch.md +27 -0
  16. package/prompts/skills/review.md +27 -0
  17. package/prompts/skills/ship.md +32 -0
  18. package/prompts/skills/simplify.md +25 -0
  19. package/prompts/skills/test.md +19 -0
  20. package/prompts/skills/verify.md +17 -0
  21. package/prompts/skills/weekly-plan.md +63 -0
  22. package/prompts/system.md +451 -0
  23. package/src/agent/away-summary.ts +138 -0
  24. package/src/agent/context.ts +6 -0
  25. package/src/agent/coordinator.ts +494 -0
  26. package/src/agent/dream.ts +149 -11
  27. package/src/agent/error-handler.ts +51 -35
  28. package/src/agent/kairos.ts +52 -4
  29. package/src/agent/loop.ts +153 -13
  30. package/src/agent/mailbox.ts +151 -0
  31. package/src/agent/model-patches.ts +28 -3
  32. package/src/agent/product-agent.ts +463 -0
  33. package/src/agent/speculation.ts +21 -18
  34. package/src/agent/sub-agent.ts +11 -1
  35. package/src/agent/system-prompt.ts +19 -0
  36. package/src/agent/tool-executor.ts +83 -3
  37. package/src/agent/verification.ts +223 -0
  38. package/src/agent/worktree-manager.ts +50 -1
  39. package/src/cli.ts +228 -36
  40. package/src/config/features.ts +8 -8
  41. package/src/config/keychain.ts +105 -0
  42. package/src/config/permissions.ts +3 -2
  43. package/src/config/settings.ts +73 -5
  44. package/src/config/upgrade-notice.ts +15 -2
  45. package/src/mcp/client.ts +392 -2
  46. package/src/mcp/manager.ts +129 -13
  47. package/src/mcp/types.ts +4 -1
  48. package/src/migrate.ts +228 -0
  49. package/src/persistence/session.ts +209 -5
  50. package/src/providers/anthropic.ts +112 -98
  51. package/src/providers/cost-tracker.ts +71 -2
  52. package/src/providers/retry.ts +2 -4
  53. package/src/providers/types.ts +5 -1
  54. package/src/providers/xai.ts +1 -0
  55. package/src/repl.tsx +514 -127
  56. package/src/setup.ts +37 -1
  57. package/src/tools/coordinate.ts +88 -0
  58. package/src/tools/grep.ts +9 -11
  59. package/src/tools/lsp.ts +44 -32
  60. package/src/tools/registry.ts +75 -9
  61. package/src/tools/send-message.ts +89 -30
  62. package/src/tools/types.ts +2 -0
  63. package/src/tools/verify.ts +88 -0
  64. package/src/tools/web-browser.ts +8 -5
  65. package/src/tools/workflow.ts +34 -10
  66. package/src/ui/AnimatedSpinner.tsx +302 -0
  67. package/src/ui/App.tsx +16 -15
  68. package/src/ui/BuddyPanel.tsx +27 -34
  69. package/src/ui/SlashInput.tsx +99 -0
  70. package/src/ui/banner.ts +10 -0
  71. package/src/ui/buddy.ts +5 -4
  72. package/src/ui/effort.ts +5 -1
  73. package/src/ui/markdown.ts +269 -88
  74. package/src/ui/message-renderer.ts +183 -35
  75. package/src/ui/quips.json +41 -0
  76. package/src/ui/speech-bubble.ts +35 -19
  77. package/src/utils/ring-buffer.ts +101 -0
  78. package/src/voice/voice-mode.ts +13 -2
  79. package/src/__tests__/branded-types.test.ts +0 -47
  80. package/src/__tests__/context.test.ts +0 -163
  81. package/src/__tests__/cost-tracker.test.ts +0 -274
  82. package/src/__tests__/cron.test.ts +0 -197
  83. package/src/__tests__/dream.test.ts +0 -204
  84. package/src/__tests__/error-handler.test.ts +0 -192
  85. package/src/__tests__/features.test.ts +0 -69
  86. package/src/__tests__/file-history.test.ts +0 -177
  87. package/src/__tests__/hooks.test.ts +0 -145
  88. package/src/__tests__/keybindings.test.ts +0 -159
  89. package/src/__tests__/model-patches.test.ts +0 -82
  90. package/src/__tests__/permissions-rules.test.ts +0 -121
  91. package/src/__tests__/permissions.test.ts +0 -108
  92. package/src/__tests__/project-config.test.ts +0 -63
  93. package/src/__tests__/retry.test.ts +0 -321
  94. package/src/__tests__/router.test.ts +0 -158
  95. package/src/__tests__/session-compact.test.ts +0 -191
  96. package/src/__tests__/session.test.ts +0 -145
  97. package/src/__tests__/skill-registry.test.ts +0 -130
  98. package/src/__tests__/speculation.test.ts +0 -196
  99. package/src/__tests__/tasks-v2.test.ts +0 -267
  100. package/src/__tests__/telemetry.test.ts +0 -149
  101. package/src/__tests__/tool-executor.test.ts +0 -141
  102. package/src/__tests__/tool-registry.test.ts +0 -166
  103. package/src/__tests__/undercover.test.ts +0 -93
  104. package/src/__tests__/workflow.test.ts +0 -195
package/README.md CHANGED
@@ -2,36 +2,47 @@
2
2
 
3
3
  **Multi-provider AI coding agent for the terminal.**
4
4
 
5
- [![Version](https://img.shields.io/badge/version-1.0.0-blue)]()
6
- [![Tests](https://img.shields.io/badge/tests-335%20passing-green)]()
5
+ [![Version](https://img.shields.io/badge/version-2.0.0-blue)]()
6
+ [![Tests](https://img.shields.io/badge/tests-367%2B%20passing-green)]()
7
7
  [![TypeScript](https://img.shields.io/badge/TypeScript-strict-blue)]()
8
8
  [![Runtime](https://img.shields.io/badge/runtime-Bun-black)]()
9
9
  [![License](https://img.shields.io/badge/license-MIT-green)]()
10
10
 
11
- **42 tools | 34 commands | 6 providers | 335 tests | 130 source files**
11
+ **45+ tools | 18 skills | 42+ slash commands | 6 providers | 367+ tests | 130 source files**
12
12
 
13
13
  ---
14
14
 
15
15
  ## What is AshlrCode?
16
16
 
17
- AshlrCode is an open-source AI coding agent CLI built as an alternative to Claude Code. It runs multi-provider LLM conversations with tool use in your terminal — powered by xAI Grok by default, with failover to Anthropic, OpenAI, DeepSeek, Groq, and Ollama. It ships with 42 built-in tools, an autonomous KAIROS mode, sub-agent orchestration, and a persistent buddy companion.
17
+ AshlrCode is an open-source AI coding agent CLI built as an alternative to Claude Code. It runs multi-provider LLM conversations with tool use in your terminal — powered by xAI Grok by default, with failover to Anthropic, OpenAI, DeepSeek, Groq, and Ollama. It ships with 45+ built-in tools, 18 skills, an autonomous KAIROS mode, sub-agent orchestration, MCP server integration, and a persistent buddy companion.
18
18
 
19
19
  ---
20
20
 
21
- ## Quick Start
21
+ ## Install
22
22
 
23
23
  ```bash
24
- git clone https://github.com/ashlrai/ashlrcode.git
25
- cd ashlrcode
26
- bun install
27
- bun link # makes 'ac' available globally
24
+ bun install -g ashlrcode
25
+ ```
26
+
27
+ > **Requires [Bun](https://bun.sh) runtime.** Install Bun with `curl -fsSL https://bun.sh/install | bash`.
28
28
 
29
+ ```bash
29
30
  export XAI_API_KEY="your-key"
30
31
 
31
32
  ac # interactive REPL
32
33
  ac "fix the login bug" # single-shot mode
33
34
  ac --continue # resume last session
34
35
  ac --resume <id> # resume specific session
36
+ ac --migrate # import MCP servers, skills, and sessions from Claude Code
37
+ ```
38
+
39
+ ### From source
40
+
41
+ ```bash
42
+ git clone https://github.com/ashlrai/ashlrcode.git
43
+ cd ashlrcode
44
+ bun install
45
+ bun link # makes 'ac' available globally
35
46
  ```
36
47
 
37
48
  ---
@@ -45,8 +56,13 @@ ac --resume <id> # resume specific session
45
56
  - **3-tier context compression** — autoCompact, snipCompact, contextCollapse
46
57
  - **Speculation** — speculative tool execution for faster responses
47
58
  - **Model patches** — per-model prompt adjustments for optimal behavior
59
+ - **Global error handling** — uncaught exceptions caught with data loss prevention (session auto-save)
60
+ - **Thinking display** — stream and display model reasoning/thinking tokens
61
+ - **Effort levels** — low / normal / high controls response depth and token budget
62
+ - **Session import** — import Claude Code sessions with `ac --migrate`
63
+ - **Autopilot mode** — fully autonomous scan → fix → test → PR → merge pipeline
48
64
 
49
- ### Tools (42)
65
+ ### Tools (45+)
50
66
 
51
67
  | Category | Tools | Description |
52
68
  |----------|-------|-------------|
@@ -65,7 +81,7 @@ ac --resume <id> # resume specific session
65
81
  | **Infrastructure** | LSP, Workflow, Snip, Sleep | Language server, reusable workflows, context trimming, polling |
66
82
  | **MCP** | ListMcpResources, mcp__*__* | External tool servers via Model Context Protocol |
67
83
 
68
- ### Commands (34)
84
+ ### Commands (42+)
69
85
 
70
86
  | Command | Description |
71
87
  |---------|-------------|
@@ -115,8 +131,11 @@ Plus **custom skills** loaded from `~/.ashlrcode/skills/*.md` — invoked as `/s
115
131
 
116
132
  ### UX
117
133
 
118
- - **Ink-based UI** — React terminal rendering with input box, context bar, and autocomplete
119
- - **Buddy system** — persistent ASCII pet companion with species, moods, hats, rarity, and stats
134
+ - **Ink-based UI** — React terminal rendering with bordered input box, context bar, and autocomplete
135
+ - **Bordered tool result blocks** — tool output framed with colored diff highlighting (green/red)
136
+ - **Slash command coloring** — commands highlighted in blue for quick visual scanning
137
+ - **Buddy system** — persistent ASCII pet with species, moods, animated poses, hats, rarity, and stats
138
+ - **Buddy animations** — mood-driven pose cycling with idle, thinking, celebrating, and confused states
120
139
  - **Keybindings** — customizable shortcuts, chord bindings, Shift+Tab mode switching
121
140
  - **Effort levels** — low / normal / high controls response depth
122
141
  - **Smart paste** — large clipboard pastes auto-collapsed in context
@@ -139,6 +158,8 @@ Plus **custom skills** loaded from `~/.ashlrcode/skills/*.md` — invoked as `/s
139
158
  - **Hook system** — pre/post tool hooks can block, modify, or extend tool calls
140
159
  - **Undercover mode** — stealth prompt adjustments
141
160
  - **Input validation** — tool input schemas validated before execution
161
+ - **macOS Keychain** — credential storage via macOS Keychain for API keys
162
+ - **Global error handling** — uncaught exceptions and SIGTERM caught; sessions saved before exit to prevent data loss
142
163
 
143
164
  ### Infrastructure
144
165
 
@@ -148,6 +169,7 @@ Plus **custom skills** loaded from `~/.ashlrcode/skills/*.md` — invoked as `/s
148
169
  - **Retry with backoff** — rate limits (3x, 1s base), network errors (2x, 2s base)
149
170
  - **Speculation** — predictive tool execution
150
171
  - **LSP integration** — Language Server Protocol for diagnostics and completions
172
+ - **MCP with SSE/WebSocket transport** — stdio, SSE, and WebSocket connections to external tool servers
151
173
  - **MCP OAuth** — OAuth flow for MCP server authentication
152
174
  - **Cron triggers** — scheduled recurring agent tasks
153
175
  - **IPC** — inter-process messaging between instances
@@ -157,6 +179,41 @@ Plus **custom skills** loaded from `~/.ashlrcode/skills/*.md` — invoked as `/s
157
179
 
158
180
  ---
159
181
 
182
+ ## MCP (Model Context Protocol)
183
+
184
+ AshlrCode connects to external tool servers via MCP. Configure servers in `~/.ashlrcode/settings.json`:
185
+
186
+ ```json
187
+ {
188
+ "mcpServers": {
189
+ "my-server": {
190
+ "command": "npx",
191
+ "args": ["-y", "@my-org/mcp-server"],
192
+ "env": { "API_KEY": "..." }
193
+ },
194
+ "remote-server": {
195
+ "url": "http://localhost:3000"
196
+ },
197
+ "chrome-extension": {
198
+ "url": "http://localhost:12007",
199
+ "env": {}
200
+ }
201
+ }
202
+ }
203
+ ```
204
+
205
+ **Stdio transport** — spawns a local process and communicates over stdin/stdout. Use `command` + `args`.
206
+
207
+ **SSE transport** — connects to a running HTTP server. Use `url`. Works with browser extensions like Claude-in-Chrome that expose an MCP endpoint.
208
+
209
+ **WebSocket transport** — connects via WebSocket for bidirectional streaming. Use `url` with a `ws://` or `wss://` scheme.
210
+
211
+ **OAuth** — for authenticated MCP servers, add an `oauth` block with `authorizationUrl`, `tokenUrl`, `clientId`, and `scopes`.
212
+
213
+ MCP tools appear automatically as `mcp__<server>__<tool>` and are available to the agent alongside built-in tools.
214
+
215
+ ---
216
+
160
217
  ## Configuration
161
218
 
162
219
  | Path | Purpose |
@@ -260,7 +317,7 @@ bun install
260
317
 
261
318
  bun run dev # watch mode
262
319
  bun run start # run CLI
263
- bun test # 335 tests, 666 assertions, ~10s
320
+ bun test # 367+ tests, ~10s
264
321
  bunx tsc --noEmit # type check
265
322
  bun run build # bundle to dist/
266
323
  ```
@@ -274,9 +331,9 @@ src/ # 130 source files
274
331
  ├── setup.ts # Initialization and wiring
275
332
  ├── agent/ # Core agent loop, sub-agents, KAIROS, teams, dreams, IPC
276
333
  ├── providers/ # xAI, Anthropic, router, retry, cost tracking
277
- ├── tools/ # 42 tools (32 files)
334
+ ├── tools/ # 45+ tools (32 files)
278
335
  ├── skills/ # Skill loader + registry
279
- ├── mcp/ # MCP client, manager, OAuth
336
+ ├── mcp/ # MCP client, manager, OAuth, SSE transport
280
337
  ├── planning/ # Plan mode + plan tools
281
338
  ├── persistence/ # Sessions + memory
282
339
  ├── config/ # Settings, hooks, permissions, features, sync, undercover
package/package.json CHANGED
@@ -1,29 +1,48 @@
1
1
  {
2
2
  "name": "ashlrcode",
3
- "version": "1.0.0",
4
- "description": "Multi-provider AI coding agent CLI — 42 tools, 34 commands, autonomous mode",
5
- "module": "src/cli.ts",
3
+ "version": "2.1.0",
4
+ "description": "Multi-provider AI coding agent CLI — 45 tools, 40 commands, autonomous mode, verification agent, multi-agent coordination",
6
5
  "type": "module",
7
6
  "private": false,
8
7
  "license": "MIT",
9
8
  "repository": {
10
9
  "type": "git",
11
- "url": "https://github.com/ashlrai/ashlrcode"
10
+ "url": "git+https://github.com/ashlrai/ashlrcode.git"
12
11
  },
13
- "keywords": ["ai", "coding", "agent", "cli", "xai", "grok", "claude", "multi-provider", "autonomous"],
14
- "files": ["src/", "README.md", "LICENSE"],
12
+ "keywords": [
13
+ "ai",
14
+ "coding",
15
+ "agent",
16
+ "cli",
17
+ "xai",
18
+ "grok",
19
+ "claude",
20
+ "multi-provider",
21
+ "autonomous"
22
+ ],
23
+ "files": [
24
+ "src/",
25
+ "!src/__tests__/",
26
+ "prompts/",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
15
30
  "bin": {
16
- "ashlrcode": "./src/cli.ts",
17
- "ac": "./src/cli.ts"
31
+ "ashlrcode": "src/cli.ts",
32
+ "ac": "src/cli.ts"
18
33
  },
19
34
  "scripts": {
20
35
  "dev": "bun run src/cli.ts",
21
36
  "test": "bun test",
22
37
  "build": "bun build src/cli.ts --compile --outfile dist/ac",
23
38
  "build:all": "bun build src/cli.ts --compile --outfile dist/ac-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m)",
24
- "typecheck": "tsc --noEmit"
39
+ "typecheck": "tsc --noEmit",
40
+ "lint": "bunx @biomejs/biome check src/",
41
+ "lint:fix": "bunx @biomejs/biome check --write src/",
42
+ "format": "bunx @biomejs/biome format --write src/"
25
43
  },
26
44
  "devDependencies": {
45
+ "@biomejs/biome": "^2.4.10",
27
46
  "@types/bun": "latest",
28
47
  "@types/react": "^19.2.14"
29
48
  },
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: commit
3
+ description: Create a well-crafted git commit and push to GitHub
4
+ trigger: /commit
5
+ ---
6
+
7
+ Create a git commit for the current changes. Follow these steps:
8
+
9
+ 1. Run `git status` to see all changes and `git diff` to see the actual modifications.
10
+ 2. Run `git log --oneline -5` to match the repo's commit message style.
11
+ 3. Analyze ALL changes (staged and unstaged) and draft a commit message:
12
+ - Summarize the nature: new feature, bug fix, refactor, docs, etc.
13
+ - Focus on WHY, not WHAT
14
+ - Keep it concise (1-2 sentences)
15
+ 4. Stage specific files by name (NEVER use `git add -A` or `git add .`)
16
+ 5. Do NOT commit files that contain secrets (.env, credentials, API keys)
17
+ 6. Create the commit:
18
+
19
+ ```bash
20
+ git commit -m "$(cat <<'EOF'
21
+ Your commit message here.
22
+
23
+ Co-Authored-By: AshlrCode <noreply@ashlr.ai>
24
+ EOF
25
+ )"
26
+ ```
27
+
28
+ 7. After commit, run `git status` to verify success.
29
+ 8. Push to remote if the user asked for it.
30
+
31
+ IMPORTANT:
32
+ - Always create NEW commits, never amend
33
+ - Never skip hooks (--no-verify)
34
+ - Never force push to main/master
35
+
36
+ {{args}}
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: coordinate
3
+ description: Break a complex task into subtasks and dispatch to multiple agents
4
+ trigger: /coordinate
5
+ ---
6
+
7
+ Use coordinator mode to tackle a complex task with multiple agents working in parallel.
8
+
9
+ ## How it works:
10
+ 1. **Plan**: A planning agent breaks your goal into independent subtasks
11
+ 2. **Dispatch**: Each subtask is assigned to a specialized sub-agent (explorer, implementer, test-writer, code-reviewer)
12
+ 3. **Execute**: Agents work in parallel waves (up to 3 concurrent)
13
+ 4. **Verify**: Optional verification agent checks the combined output
14
+ 5. **Report**: Summary of what each agent accomplished
15
+
16
+ ## Usage:
17
+ Describe the complex task you want to coordinate. Be specific about the goal and any constraints.
18
+
19
+ Example: "Refactor the auth module to use JWT tokens, update all tests, and review for security issues"
20
+
21
+ {{args}}
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: daily-review
3
+ description: Morning status check across projects, inbox, and blockers
4
+ trigger: /daily-review
5
+ ---
6
+
7
+ Morning routine to prepare for the day's work.
8
+
9
+ ## Steps
10
+
11
+ 1. **Show Inbox Status**
12
+ - Count notes in `00-Inbox/` with `status: captured`
13
+ - Highlight any with `urgency: now`
14
+ - Format: `Inbox: X items (Y urgent)`
15
+
16
+ 2. **Display Today's GSD Focus**
17
+ - Read each project's STATE.md current focus
18
+ - Show current phase, description, and progress for each active project
19
+ - Format as boxed sections per project with progress bars
20
+
21
+ 3. **List Active Blockers**
22
+ - Search for notes with `status: blocked` in all projects
23
+ - Show any GSD phases that are stuck
24
+ - Format: `Blockers: [Project] Feature X blocked by: ...`
25
+
26
+ 4. **Quick Actions**
27
+ Present options:
28
+ - Process inbox (`/process-inbox`)
29
+ - Continue GSD work (`/gsd:progress`)
30
+ - Plan today's tasks (manual)
31
+
32
+ 5. **Create Daily Note (Optional)**
33
+ - If user approves, create today's daily note in `01-Daily/`
34
+ - Use template from `01-Daily/_templates/daily-note.md`
35
+ - Pre-fill with GSD status and inbox count
36
+
37
+ ## Output Format
38
+
39
+ ```
40
+ Daily Review - [Date]
41
+
42
+ Inbox: X items (Y urgent)
43
+
44
+ Focus
45
+ +-- Project A --------------------+
46
+ | Phase: [phase name] |
47
+ | Progress: [progress bar] XX% |
48
+ | Current: [current task] |
49
+ +---------------------------------+
50
+ +-- Project B --------------------+
51
+ | Phase: [phase name] |
52
+ | Progress: [progress bar] XX% |
53
+ | Current: [current task] |
54
+ +---------------------------------+
55
+
56
+ Blockers: None
57
+
58
+ What would you like to do?
59
+ 1. Process inbox
60
+ 2. Continue [Project A] work
61
+ 3. Continue [Project B] work
62
+ 4. Something else
63
+ ```
64
+
65
+ {{args}}
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: debug
3
+ description: Systematic debugging with error analysis
4
+ trigger: /debug
5
+ ---
6
+
7
+ Debug the issue described below using a systematic approach.
8
+
9
+ Steps:
10
+ 1. **Reproduce**: Identify how to reproduce the issue
11
+ 2. **Locate**: Use Grep and Read to find the relevant code paths
12
+ 3. **Diagnose**: Trace the execution path, identify the root cause
13
+ 4. **Fix**: Make the minimal change that fixes the root cause
14
+ 5. **Verify**: Run the fix and confirm the issue is resolved
15
+ 6. **Prevent**: Check if similar issues exist elsewhere
16
+
17
+ Rules:
18
+ - Fix the root cause, not symptoms
19
+ - Don't add workarounds unless the root cause is unfixable
20
+ - Make the smallest change possible
21
+ - Verify the fix doesn't break other functionality
22
+
23
+ {{args}}
@@ -0,0 +1,129 @@
1
+ ---
2
+ name: deep-work
3
+ description: Strategic session kickoff with parallel exploration before acting
4
+ trigger: /deep-work
5
+ ---
6
+
7
+ You are starting a deep work session. Thoroughly investigate before acting. Follow these phases in order. Scale effort to task complexity.
8
+
9
+ **User's task:** {{args}}
10
+
11
+ ---
12
+
13
+ ## Phase 0: Context Recovery (conditional)
14
+
15
+ **Skip this phase if** you've already recovered context this session (e.g., via `/resume-branch`, `entire resume`, or earlier in the conversation). Don't duplicate work.
16
+
17
+ If context has NOT been recovered yet:
18
+
19
+ 1. Read project memory files -- search for entries relevant to this task
20
+ 2. Check git state: run `git status` and `git log --oneline -10`
21
+ 3. If on a non-main branch, run `entire resume <branch>` for session context
22
+ 4. Scan the project's configuration for conventions relevant to this task
23
+
24
+ Output a brief **Current State** summary (3-5 lines): branch, recent changes, relevant memory entries. If skipping, state "Context already recovered" and move on.
25
+
26
+ ---
27
+
28
+ ## Phase 1: Task Classification (immediate, no agents)
29
+
30
+ Analyze the user's task and classify it:
31
+
32
+ **Type:** feature | bug | refactor | investigation | optimization | architecture
33
+ **Scope:** surgical (1-2 files) | focused (3-10 files) | broad (10+ files) | architectural (system-wide)
34
+ **Familiarity:** known territory | partially known | unexplored
35
+
36
+ Map to exploration depth:
37
+
38
+ | Scope | Agents to Deploy | Delivery Mode |
39
+ |-------|-----------------|---------------|
40
+ | surgical | 1 (patterns) | Brief + draft plan + questions together |
41
+ | focused | 2 (patterns + impact) | Brief + draft plan + questions together |
42
+ | broad | 3 (patterns + impact + risk) | Brief + questions first, then plan after answers |
43
+ | architectural | 3+ (full spectrum) | Brief + questions first, then plan after answers |
44
+
45
+ State your classification and depth explicitly before proceeding.
46
+
47
+ ---
48
+
49
+ ## Phase 2: Parallel Exploration (adaptive agent deployment)
50
+
51
+ Deploy agents **in parallel** based on depth from Phase 1. The **Patterns & Conventions** agent is the most critical -- give it the heaviest workload. Other agents should be targeted, not broad.
52
+
53
+ ### Agent Missions
54
+
55
+ | Agent | Mission | Deploy When |
56
+ |-------|---------|-------------|
57
+ | **Patterns & Conventions** (primary) | How does the codebase handle similar things? What utilities/patterns exist to reuse? What conventions must be followed? Search for analogous implementations. Find the specific files, functions, and patterns that this task should mirror. | Always -- this is the workhorse agent |
58
+ | **Impact & Dependencies** | What specifically will this change touch? What imports/calls the affected code? What tests cover it? Map the concrete dependency graph -- files and functions, not abstractions. | Focused+ |
59
+ | **Risk & Edge Cases** | Specific security implications for THIS change? Concrete performance concerns? Actual error scenarios based on the code paths involved? Skip generic risk lists. | Broad+ |
60
+ | **Architecture & Design** | Design options with concrete tradeoffs specific to this codebase. How does this fit the existing system architecture? What precedents exist for similar decisions? | Architectural only |
61
+ | **Prior Art & History** | Has this been attempted before? Check git log for related commits, memory files for past decisions, session transcripts for context. | Architectural or unfamiliar territory only |
62
+
63
+ Each agent must report: **findings**, **relevant file paths with line numbers**, **reusable utilities**, and **risks/unknowns**.
64
+
65
+ Deploy all applicable agents in a **single message** (parallel execution).
66
+
67
+ ---
68
+
69
+ ## Phase 3: Synthesis Brief
70
+
71
+ After all agents complete, combine findings into this structure:
72
+
73
+ ```
74
+ ## Situation
75
+ [Current state of the relevant code/subsystem -- 2-4 sentences]
76
+
77
+ ## Approach
78
+ [What needs to change and the recommended path -- be specific about strategy]
79
+
80
+ ## Key Findings
81
+ - [Patterns/conventions to follow -- with file paths]
82
+ - [Existing utilities to reuse -- with file:line references]
83
+ - [Dependencies and impact areas]
84
+
85
+ ## Risks & Unknowns
86
+ - [Risk 1 -- proposed mitigation]
87
+ - [Unknown 1 -- needs user input]
88
+ ```
89
+
90
+ Keep it concise. No filler. Every bullet should be actionable or inform a decision.
91
+
92
+ ---
93
+
94
+ ## Phase 4: Questions + Plan (merged for speed)
95
+
96
+ **For surgical/focused scope:** Present the synthesis brief, a draft execution plan, AND strategic questions in a single response. Frame questions as: "Here's what I'd do -- but these decisions could change the approach:"
97
+
98
+ **For broad/architectural scope:** Present the synthesis brief and strategic questions first. Wait for answers before producing the plan, since the answers materially change the approach.
99
+
100
+ ### Question Quality Rules
101
+
102
+ Questions must be:
103
+ - **Specific** -- emerged from actual exploration, not generic
104
+ - **Decision-forcing** -- present concrete options with tradeoffs discovered in Phase 2
105
+ - **Minimal** -- only ask what you genuinely can't decide autonomously
106
+
107
+ Good: "The auth middleware uses session-based auth but this endpoint needs API key support. Should we extend the existing middleware or create a separate auth path?"
108
+ Bad: "What authentication approach do you prefer?"
109
+
110
+ ### Execution Plan Structure
111
+
112
+ 1. **Files to create/modify** -- specific paths, what changes in each
113
+ 2. **Sequence** -- ordered by dependencies (what must happen first)
114
+ 3. **Reuse** -- existing code/utilities to leverage (with file:line references)
115
+ 4. **Verification** -- how to test end-to-end (specific commands, browser checks, etc.)
116
+
117
+ After the user responds (answers questions and/or approves plan), begin implementation directly.
118
+
119
+ ---
120
+
121
+ ## Key Principles
122
+
123
+ - **Adaptive depth** -- a 1-file bug fix gets 1 agent and ships fast; a system redesign gets full investigation. Never over-investigate simple tasks.
124
+ - **Patterns agent is king** -- for convention-heavy codebases, the patterns agent does the most valuable work. Other agents should be targeted, not broad. Don't deploy agents that will return generic findings.
125
+ - **Reuse-first** -- agents specifically look for existing patterns and utilities. Don't reinvent.
126
+ - **Memory-aware** -- check past session context before exploring from scratch. Don't duplicate `/resume-branch` work.
127
+ - **Speed over ceremony** -- for surgical/focused tasks, merge the brief + plan + questions into one response. Don't create blocking pauses between phases.
128
+ - **Strategic questions over volume** -- ask the RIGHT questions, not many questions.
129
+ - **Show your work** -- output the classification, agent findings summary, and brief so the user sees the thinking.
@@ -0,0 +1,24 @@
1
+ ---
2
+ name: explore
3
+ description: Deep codebase exploration and architecture analysis
4
+ trigger: /explore
5
+ ---
6
+
7
+ Thoroughly explore this codebase and provide a comprehensive analysis.
8
+
9
+ Steps:
10
+ 1. Use Glob to map the directory structure
11
+ 2. Read key files: package.json, README, config files, entry points
12
+ 3. Use Grep to find patterns: exports, classes, routes, handlers
13
+ 4. Identify the architecture: framework, patterns, layers
14
+ 5. Map dependencies between modules
15
+
16
+ Report:
17
+ - Project type and framework
18
+ - Directory structure overview
19
+ - Key entry points and modules
20
+ - Architecture patterns used
21
+ - Notable dependencies
22
+ - Areas of complexity or tech debt
23
+
24
+ {{args}}
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: init
3
+ description: Initialize AshlrCode for a new project (create ASHLR.md)
4
+ trigger: /init
5
+ ---
6
+
7
+ Initialize AshlrCode for this project by creating an ASHLR.md file with project-specific instructions.
8
+
9
+ Steps:
10
+ 1. Use Glob and LS to understand the project structure
11
+ 2. Read package.json, Cargo.toml, requirements.txt, or equivalent for project type
12
+ 3. Read README.md if it exists
13
+ 4. Identify: framework, language, test commands, build commands, conventions
14
+ 5. Create ASHLR.md with:
15
+
16
+ ```markdown
17
+ # Project Name
18
+
19
+ Brief description of what this project is.
20
+
21
+ ## Architecture
22
+ - Framework and key libraries
23
+ - Directory structure overview
24
+ - Key entry points
25
+
26
+ ## Commands
27
+ - How to build: `command`
28
+ - How to test: `command`
29
+ - How to run: `command`
30
+
31
+ ## Conventions
32
+ - Coding style notes
33
+ - Naming conventions
34
+ - File organization patterns
35
+ ```
36
+
37
+ Keep it concise — only include what would help an AI assistant work effectively on this project.
38
+
39
+ {{args}}
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: kairos
3
+ description: Start autonomous KAIROS mode with terminal focus-aware behavior
4
+ trigger: /kairos
5
+ ---
6
+
7
+ Activate KAIROS — autonomous agent mode. The agent will:
8
+
9
+ - **Detect terminal focus** to adjust autonomy level:
10
+ - Focused (you're watching): Collaborative, asks before big changes
11
+ - Unfocused (you're away): Full auto, commits and pushes independently
12
+ - Unknown: Balanced default
13
+ - **Heartbeat loop**: Keeps working between your inputs (every 30s)
14
+ - **Push notifications**: macOS notification when done or on error
15
+ - **Auto-stop**: Stops when nothing is left to do or you say stop
16
+
17
+ Give KAIROS a goal to work on autonomously:
18
+
19
+ {{args}}
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: plan
3
+ description: Enter plan mode for structured exploration and planning
4
+ trigger: /plan-task
5
+ ---
6
+
7
+ I need you to enter plan mode and create a detailed implementation plan before making any changes.
8
+
9
+ Steps:
10
+ 1. Call EnterPlan to activate plan mode
11
+ 2. Use Read, Glob, and Grep to explore the relevant code
12
+ 3. Ask me strategic questions using AskUser if you need direction
13
+ 4. Write a detailed plan using PlanWrite that includes:
14
+ - Context: what problem this solves
15
+ - Approach: what files to modify and how
16
+ - Verification: how to test the changes
17
+ 5. Call ExitPlan when the plan is ready for my review
18
+
19
+ {{args}}