@orderful/droid 0.7.0 → 0.9.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 (78) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +80 -89
  3. package/assets/droid+claude.png +0 -0
  4. package/dist/commands/setup.d.ts +1 -0
  5. package/dist/commands/setup.d.ts.map +1 -1
  6. package/dist/commands/setup.js +77 -9
  7. package/dist/commands/setup.js.map +1 -1
  8. package/dist/commands/tui.d.ts.map +1 -1
  9. package/dist/commands/tui.js +111 -70
  10. package/dist/commands/tui.js.map +1 -1
  11. package/dist/lib/agents.d.ts +19 -4
  12. package/dist/lib/agents.d.ts.map +1 -1
  13. package/dist/lib/agents.js +121 -42
  14. package/dist/lib/agents.js.map +1 -1
  15. package/dist/lib/skills.d.ts.map +1 -1
  16. package/dist/lib/skills.js +56 -1
  17. package/dist/lib/skills.js.map +1 -1
  18. package/dist/lib/types.d.ts +2 -0
  19. package/dist/lib/types.d.ts.map +1 -1
  20. package/dist/skills/brain/SKILL.md +16 -16
  21. package/dist/skills/brain/SKILL.yaml +4 -6
  22. package/dist/skills/brain/commands/brain.md +12 -5
  23. package/dist/skills/brain/commands/scratchpad.md +52 -0
  24. package/dist/skills/brain/references/workflows.md +14 -4
  25. package/dist/skills/brain-obsidian/SKILL.md +1 -4
  26. package/dist/skills/brain-obsidian/SKILL.yaml +1 -4
  27. package/dist/skills/code-review/SKILL.md +54 -0
  28. package/dist/skills/code-review/SKILL.yaml +19 -0
  29. package/dist/skills/code-review/agents/edi-standards-reviewer/AGENT.md +39 -0
  30. package/dist/skills/code-review/agents/edi-standards-reviewer/AGENT.yaml +14 -0
  31. package/dist/skills/code-review/agents/error-handling-reviewer/AGENT.md +51 -0
  32. package/dist/skills/code-review/agents/error-handling-reviewer/AGENT.yaml +14 -0
  33. package/dist/skills/code-review/agents/test-coverage-analyzer/AGENT.md +53 -0
  34. package/dist/skills/code-review/agents/test-coverage-analyzer/AGENT.yaml +14 -0
  35. package/dist/skills/code-review/agents/type-reviewer/AGENT.md +50 -0
  36. package/dist/skills/code-review/agents/type-reviewer/AGENT.yaml +13 -0
  37. package/dist/skills/code-review/commands/code-review.md +91 -0
  38. package/dist/skills/comments/SKILL.md +21 -9
  39. package/dist/skills/comments/SKILL.yaml +2 -5
  40. package/dist/skills/comments/commands/comments.md +1 -1
  41. package/dist/skills/project/SKILL.md +10 -13
  42. package/dist/skills/project/SKILL.yaml +2 -7
  43. package/dist/skills/project/commands/project.md +9 -4
  44. package/dist/skills/project/references/creating.md +9 -4
  45. package/dist/skills/project/references/loading.md +11 -5
  46. package/package.json +1 -1
  47. package/src/commands/setup.test.ts +276 -0
  48. package/src/commands/setup.ts +80 -10
  49. package/src/commands/tui.tsx +149 -82
  50. package/src/lib/agents.ts +134 -44
  51. package/src/lib/skills.ts +61 -1
  52. package/src/lib/types.ts +4 -0
  53. package/src/skills/brain/SKILL.md +16 -16
  54. package/src/skills/brain/SKILL.yaml +4 -6
  55. package/src/skills/brain/commands/brain.md +12 -5
  56. package/src/skills/brain/commands/scratchpad.md +52 -0
  57. package/src/skills/brain/references/workflows.md +14 -4
  58. package/src/skills/brain-obsidian/SKILL.md +1 -4
  59. package/src/skills/brain-obsidian/SKILL.yaml +1 -4
  60. package/src/skills/code-review/SKILL.md +54 -0
  61. package/src/skills/code-review/SKILL.yaml +19 -0
  62. package/src/skills/code-review/agents/edi-standards-reviewer/AGENT.md +39 -0
  63. package/src/skills/code-review/agents/edi-standards-reviewer/AGENT.yaml +14 -0
  64. package/src/skills/code-review/agents/error-handling-reviewer/AGENT.md +51 -0
  65. package/src/skills/code-review/agents/error-handling-reviewer/AGENT.yaml +14 -0
  66. package/src/skills/code-review/agents/test-coverage-analyzer/AGENT.md +53 -0
  67. package/src/skills/code-review/agents/test-coverage-analyzer/AGENT.yaml +14 -0
  68. package/src/skills/code-review/agents/type-reviewer/AGENT.md +50 -0
  69. package/src/skills/code-review/agents/type-reviewer/AGENT.yaml +13 -0
  70. package/src/skills/code-review/commands/code-review.md +91 -0
  71. package/src/skills/comments/SKILL.md +21 -9
  72. package/src/skills/comments/SKILL.yaml +2 -5
  73. package/src/skills/comments/commands/comments.md +1 -1
  74. package/src/skills/project/SKILL.md +10 -13
  75. package/src/skills/project/SKILL.yaml +2 -7
  76. package/src/skills/project/commands/project.md +9 -4
  77. package/src/skills/project/references/creating.md +9 -4
  78. package/src/skills/project/references/loading.md +11 -5
package/src/lib/skills.ts CHANGED
@@ -5,6 +5,7 @@ import { fileURLToPath } from 'url';
5
5
  import YAML from 'yaml';
6
6
  import { loadConfig, saveConfig } from './config.js';
7
7
  import { AITool, SkillStatus, type SkillManifest, type InstalledSkill } from './types.js';
8
+ import { getInstalledAgentsDir, installAgentFromPath, uninstallAgent, isAgentInstalled } from './agents.js';
8
9
 
9
10
  // Marker comments for CLAUDE.md skill registration
10
11
  const DROID_SKILLS_START = '<!-- droid-skills-start -->';
@@ -336,6 +337,22 @@ export function installSkill(skillName: string): { success: boolean; message: st
336
337
  }
337
338
  }
338
339
  }
340
+
341
+ // Check bundled agent collisions
342
+ const agentsSource = join(bundledSkillDir, 'agents');
343
+ if (existsSync(agentsSource)) {
344
+ const agentDirs = readdirSync(agentsSource, { withFileTypes: true })
345
+ .filter(dirent => dirent.isDirectory())
346
+ .map(dirent => dirent.name);
347
+ for (const agentName of agentDirs) {
348
+ if (isAgentInstalled(agentName)) {
349
+ return {
350
+ success: false,
351
+ message: `Cannot install: agent '${agentName}' already exists at ${getInstalledAgentsDir()}`,
352
+ };
353
+ }
354
+ }
355
+ }
339
356
  }
340
357
 
341
358
  // Ensure skills directory exists
@@ -354,6 +371,22 @@ export function installSkill(skillName: string): { success: boolean; message: st
354
371
  writeFileSync(skillMdTarget, content);
355
372
  }
356
373
 
374
+ // Copy references if present (skill documentation files)
375
+ const referencesSource = join(bundledSkillDir, 'references');
376
+ if (existsSync(referencesSource)) {
377
+ const targetReferencesDir = join(targetSkillDir, 'references');
378
+ if (!existsSync(targetReferencesDir)) {
379
+ mkdirSync(targetReferencesDir, { recursive: true });
380
+ }
381
+ const referenceFiles = readdirSync(referencesSource).filter(f => f.endsWith('.md'));
382
+ for (const file of referenceFiles) {
383
+ const sourcePath = join(referencesSource, file);
384
+ const targetPath = join(targetReferencesDir, file);
385
+ const content = readFileSync(sourcePath, 'utf-8');
386
+ writeFileSync(targetPath, content);
387
+ }
388
+ }
389
+
357
390
  // Copy commands if present
358
391
  const commandsSource = join(bundledSkillDir, 'commands');
359
392
  if (existsSync(commandsSource)) {
@@ -369,10 +402,29 @@ export function installSkill(skillName: string): { success: boolean; message: st
369
402
  }
370
403
  }
371
404
 
405
+ // Install bundled agents if present
406
+ const installedAgents: string[] = [];
407
+ const agentsSource = join(bundledSkillDir, 'agents');
408
+ if (existsSync(agentsSource)) {
409
+ const agentDirs = readdirSync(agentsSource, { withFileTypes: true })
410
+ .filter(dirent => dirent.isDirectory())
411
+ .map(dirent => dirent.name);
412
+
413
+ for (const agentName of agentDirs) {
414
+ // Use the skill's bundled agent path instead of global agents
415
+ const agentDir = join(agentsSource, agentName);
416
+ const result = installAgentFromPath(agentDir, agentName);
417
+ if (result.success) {
418
+ installedAgents.push(agentName);
419
+ }
420
+ }
421
+ }
422
+
372
423
  // Update config
373
424
  config.skills[skillName] = {
374
425
  version: manifest.version,
375
426
  installed_at: new Date().toISOString(),
427
+ ...(installedAgents.length > 0 && { bundled_agents: installedAgents }),
376
428
  };
377
429
  saveConfig(config);
378
430
 
@@ -403,8 +455,8 @@ export function uninstallSkill(skillName: string): { success: boolean; message:
403
455
  // Remove command files if they exist
404
456
  const bundledSkillDir = join(BUNDLED_SKILLS_DIR, skillName);
405
457
  const commandsSource = join(bundledSkillDir, 'commands');
458
+ const commandsPath = getCommandsInstallPath(config.ai_tool);
406
459
  if (existsSync(commandsSource)) {
407
- const commandsPath = getCommandsInstallPath(config.ai_tool);
408
460
  const commandFiles = readdirSync(commandsSource).filter(f => f.endsWith('.md') && f.toLowerCase() !== 'readme.md');
409
461
  for (const file of commandFiles) {
410
462
  const commandPath = join(commandsPath, file);
@@ -414,6 +466,14 @@ export function uninstallSkill(skillName: string): { success: boolean; message:
414
466
  }
415
467
  }
416
468
 
469
+ // Remove bundled agents if they were installed with this skill
470
+ const installedSkillInfo = config.skills[skillName];
471
+ if (installedSkillInfo?.bundled_agents) {
472
+ for (const agentName of installedSkillInfo.bundled_agents) {
473
+ uninstallAgent(agentName);
474
+ }
475
+ }
476
+
417
477
  // Remove from config
418
478
  delete config.skills[skillName];
419
479
  saveConfig(config);
package/src/lib/types.ts CHANGED
@@ -43,6 +43,7 @@ export interface DroidConfig {
43
43
  export interface InstalledSkill {
44
44
  version: string;
45
45
  installed_at: string;
46
+ bundled_agents?: string[]; // Agents installed with this skill
46
47
  }
47
48
 
48
49
  export interface SkillExample {
@@ -61,6 +62,9 @@ export interface SkillManifest {
61
62
  provides_output?: boolean;
62
63
  // Usage examples to show in the TUI
63
64
  examples?: SkillExample[];
65
+ // Command aliases: maps alias name to source command filename (without .md)
66
+ // e.g., { "scratchpad": "brain" } creates /scratchpad as alias for /brain
67
+ command_aliases?: Record<string, string>;
64
68
  }
65
69
 
66
70
  export interface ConfigOption {
@@ -1,10 +1,6 @@
1
1
  ---
2
2
  name: brain
3
- description: >-
4
- Collaborative scratch pad for planning and research. Triggers on phrases like
5
- "let's use our brain", "let's think through this", or "plan this out" to capture
6
- AI output into a persistent doc. Create docs with /brain plan, /brain research,
7
- or /brain review. Use @mentions for async discussion. Docs persist across sessions.
3
+ description: "Your scratchpad (or brain) - a collaborative space for planning and research. Triggers on phrases like 'let's use our brain', 'open a scratchpad', or 'plan this out' to capture AI output into a persistent doc. Create docs with /brain plan (or /scratchpad plan), /brain research, or /brain review. Use @mentions for async discussion. Docs persist across sessions."
8
4
  globs:
9
5
  - "**/brain/**/*.md"
10
6
  alwaysApply: false
@@ -12,7 +8,9 @@ alwaysApply: false
12
8
 
13
9
  # Brain Skill
14
10
 
15
- Scratch pad for planning, research, and design docs that persist across sessions.
11
+ Your **scratchpad** (or **brain**) - a collaborative space for planning, research, and design docs that persist across sessions.
12
+
13
+ > **Alias:** All `/brain` commands also work as `/scratchpad` - use whichever feels natural.
16
14
 
17
15
  ## Why Brain Docs?
18
16
 
@@ -27,7 +25,7 @@ Ideas develop through iteration, not single prompts.
27
25
  - Planning implementation for a feature
28
26
  - Researching a problem or technology
29
27
  - Design work that benefits from written iteration
30
- - User says "brain", "let's think through", "plan this out"
28
+ - User says "brain", "scratchpad", "let's think through", "plan this out"
31
29
  - Optionally, to capture output from plan mode sessions
32
30
 
33
31
  ## When NOT to Use
@@ -38,16 +36,16 @@ Ideas develop through iteration, not single prompts.
38
36
 
39
37
  ## Configuration
40
38
 
41
- Check `~/.droid/skills/brain/overrides.yaml` for user settings:
39
+ **IMPORTANT:** Before using any default paths, ALWAYS read `~/.droid/skills/brain/overrides.yaml` first. If `brain_dir` is configured there, use that path. Only fall back to defaults if the file doesn't exist or lacks a `brain_dir` setting.
42
40
 
43
41
  | Setting | Default | Description |
44
42
  |---------|---------|-------------|
45
- | `brain_dir` | `~/{ai_tool}/brain` | Where docs are stored (varies by AI tool) |
43
+ | `brain_dir` | (see below) | Where docs are stored |
46
44
  | `inbox_folder` | (empty) | Optional subfolder for new docs (omit for flat structure) |
47
45
 
48
- Default `brain_dir` by AI tool:
46
+ Default `brain_dir` by AI tool (only if not configured):
49
47
  - **claude-code**: `~/.claude/brain`
50
- - **opencode**: `~/.opencode/brain`
48
+ - **opencode**: `~/.config/opencode/brain`
51
49
 
52
50
  ## Core Concepts
53
51
 
@@ -68,20 +66,22 @@ Default `brain_dir` by AI tool:
68
66
  | Command | Action |
69
67
  |---------|--------|
70
68
  | `/brain` | List recent docs or create new |
71
- | `/brain {topic}` | Open existing (fuzzy match) → becomes active |
72
- | `/brain plan {topic}` | Create planning doc becomes active |
73
- | `/brain research {topic}` | Create research doc becomes active |
74
- | `/brain review {topic}` | Create review doc becomes active |
69
+ | `/brain {topic}` | **Search** for existing doc (fuzzy match) → becomes active |
70
+ | `/brain plan {topic}` | Create planning doc (requires `plan` keyword) |
71
+ | `/brain research {topic}` | Create research doc (requires `research` keyword) |
72
+ | `/brain review {topic}` | Create review doc (requires `review` keyword) |
75
73
  | `/brain note {text}` | Quick capture (standalone, doesn't become active) |
76
74
  | `/brain add {text}` | Append to active doc |
77
75
  | `/brain check` | Address @droid comments in active doc |
78
76
  | `/brain done` | Finalize active doc, update status |
79
77
 
78
+ **IMPORTANT:** The default action for `/brain {topic}` is to **SEARCH** for existing docs, NOT create. Only use `/brain plan {topic}` or `/brain research {topic}` when the user explicitly wants to create a new doc.
79
+
80
80
  ## Opening a Doc
81
81
 
82
82
  **Trigger:** `/brain {topic}` or user asks to open a brain doc
83
83
 
84
- **TLDR:** Fuzzy-match topic against existing docs, read content, set as active.
84
+ **TLDR:** Search for and open an existing doc. Fuzzy-match topic against existing docs, read content, set as active.
85
85
 
86
86
  Full procedure: `references/workflows.md` § Opening
87
87
 
@@ -1,13 +1,11 @@
1
1
  name: brain
2
- description: >-
3
- Collaborative scratch pad for planning and research. Triggers on phrases like
4
- "let's use our brain", "let's think through this", or "plan this out" to capture
5
- AI output into a persistent doc. Create docs with /brain plan, /brain research,
6
- or /brain review. Use @mentions for async discussion. Docs persist across sessions.
7
- version: 0.1.0
2
+ description: "Your scratchpad (or brain) - a collaborative space for planning and research. Triggers on phrases like 'let's use our brain', 'open a scratchpad', or 'plan this out' to capture AI output into a persistent doc. Create docs with /brain plan (or /scratchpad plan), /brain research, or /brain review. Use @mentions for async discussion. Docs persist across sessions."
3
+ version: 0.2.0
8
4
  status: beta
9
5
  dependencies: []
10
6
  provides_output: false
7
+ command_aliases:
8
+ scratchpad: brain
11
9
  config_schema:
12
10
  brain_dir:
13
11
  type: string
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: Collaborative scratch pad for planning and research
3
- argument-hint: [plan|research|review|note|add|check|done] {topic/text}
2
+ description: Collaborative scratchpad for planning and research
3
+ argument-hint: "[{topic} | plan|research|review {topic} | note|add {text} | check|done]"
4
4
  allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir:*), Bash(ls:*)
5
5
  ---
6
6
 
@@ -8,16 +8,22 @@ allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir:*), Bash(ls:*)
8
8
 
9
9
  Entry point for brain doc management. See the **brain skill** for full behavior.
10
10
 
11
+ > **Alias:** This command also works as `/scratchpad` - use whichever feels natural.
12
+
11
13
  ## Arguments
12
14
 
13
15
  $ARGUMENTS
14
16
 
17
+ ## Default Behavior
18
+
19
+ **IMPORTANT:** When given just a topic (e.g., `/brain auth-refactor`), the default action is to **SEARCH** for existing docs, NOT create. Only create docs with explicit `/brain plan {topic}` or `/brain research {topic}`.
20
+
15
21
  ## Usage
16
22
 
17
23
  ```
18
24
  /brain # List recent docs or create new
19
- /brain {topic} # Open existing (fuzzy match) → active
20
- /brain plan {topic} # Create planning doc → active
25
+ /brain {topic} # SEARCH: Open existing doc (fuzzy match) → active
26
+ /brain plan {topic} # CREATE: New planning doc → active
21
27
  /brain research {topic} # Create research doc → active
22
28
  /brain review {topic} # Create review doc → active
23
29
  /brain note {text} # Quick capture (fire-and-forget)
@@ -28,7 +34,8 @@ $ARGUMENTS
28
34
 
29
35
  ## Configuration
30
36
 
31
- From `~/.droid/skills/brain/overrides.yaml`:
37
+ **ALWAYS read `~/.droid/skills/brain/overrides.yaml` first.** Use configured values if present, only fall back to defaults if missing.
38
+
32
39
  - `brain_dir` - Where docs live (default varies by AI tool)
33
40
  - `inbox_folder` - Subfolder for new docs (empty = flat)
34
41
 
@@ -0,0 +1,52 @@
1
+ ---
2
+ description: Collaborative scratchpad for planning and research
3
+ argument-hint: "[{topic} | plan|research|review {topic} | note|add {text} | check|done]"
4
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash(mkdir:*), Bash(ls:*)
5
+ ---
6
+
7
+ # /scratchpad
8
+
9
+ Your scratchpad for planning, research, and design. See the **brain skill** for full behavior.
10
+
11
+ > **Alias:** This command also works as `/brain` - use whichever feels natural.
12
+
13
+ ## Arguments
14
+
15
+ $ARGUMENTS
16
+
17
+ ## Default Behavior
18
+
19
+ **IMPORTANT:** When given just a topic (e.g., `/scratchpad auth-refactor`), the default action is to **SEARCH** for existing docs, NOT create. Only create docs with explicit `/scratchpad plan {topic}` or `/scratchpad research {topic}`.
20
+
21
+ ## Usage
22
+
23
+ ```
24
+ /scratchpad # List recent docs or create new
25
+ /scratchpad {topic} # SEARCH: Open existing doc (fuzzy match) → active
26
+ /scratchpad plan {topic} # CREATE: New planning doc → active
27
+ /scratchpad research {topic} # Create research doc → active
28
+ /scratchpad review {topic} # Create review doc → active
29
+ /scratchpad note {text} # Quick capture (fire-and-forget)
30
+ /scratchpad add {text} # Append to active doc
31
+ /scratchpad check # Address @droid comments in active doc
32
+ /scratchpad done # Finalize active doc
33
+ ```
34
+
35
+ ## Configuration
36
+
37
+ **ALWAYS read `~/.droid/skills/brain/overrides.yaml` first.** Use configured values if present, only fall back to defaults if missing.
38
+
39
+ - `brain_dir` - Where docs live (default varies by AI tool)
40
+ - `inbox_folder` - Subfolder for new docs (empty = flat)
41
+
42
+ ## Behavior
43
+
44
+ Refer to the brain skill for:
45
+ - **Opening**: How to fuzzy-match, handle multiple matches, set active
46
+ - **Creating**: Template structure by preset, naming conventions
47
+ - **Notes**: Quick capture workflow
48
+ - **Adding**: Append to active doc with timestamp
49
+ - **Checking**: Find and address @droid comments
50
+ - **Finalizing**: Update status, suggest next steps
51
+
52
+ The skill's `references/` folder contains detailed specs for workflows, templates, naming, and metadata.
@@ -8,7 +8,9 @@ Detailed procedures for each brain operation.
8
8
 
9
9
  **Steps:**
10
10
 
11
- 1. **Resolve brain_dir** from config (default: `~/.claude/brain` for claude-code)
11
+ 1. **Read config first**
12
+ - Read `~/.droid/skills/brain/overrides.yaml`
13
+ - Use `brain_dir` if configured, otherwise use default for current AI tool
12
14
 
13
15
  2. **Search for matches**
14
16
  ```
@@ -35,7 +37,10 @@ Detailed procedures for each brain operation.
35
37
 
36
38
  **Steps:**
37
39
 
38
- 1. **Resolve brain_dir** and **inbox_folder** from config
40
+ 1. **Read config first**
41
+ - Read `~/.droid/skills/brain/overrides.yaml`
42
+ - Use `brain_dir` if configured, otherwise use default for current AI tool
43
+ - Use `inbox_folder` if configured
39
44
 
40
45
  2. **Generate filename** using naming conventions (see `naming.md`):
41
46
  - Format: `{type}-{topic-slug}.md`
@@ -66,7 +71,10 @@ Detailed procedures for each brain operation.
66
71
 
67
72
  **Steps:**
68
73
 
69
- 1. **Resolve brain_dir** and **inbox_folder** from config
74
+ 1. **Read config first**
75
+ - Read `~/.droid/skills/brain/overrides.yaml`
76
+ - Use `brain_dir` if configured, otherwise use default for current AI tool
77
+ - Use `inbox_folder` if configured
70
78
 
71
79
  2. **Generate filename:**
72
80
  - Format: `note-{date}-{slug}.md` where date is `YYYYMMDD`
@@ -169,7 +177,9 @@ Detailed procedures for each brain operation.
169
177
 
170
178
  **Steps:**
171
179
 
172
- 1. **Resolve brain_dir** from config
180
+ 1. **Read config first**
181
+ - Read `~/.droid/skills/brain/overrides.yaml`
182
+ - Use `brain_dir` if configured, otherwise use default for current AI tool
173
183
 
174
184
  2. **Find recent docs:**
175
185
  ```
@@ -1,9 +1,6 @@
1
1
  ---
2
2
  name: brain-obsidian
3
- description: >-
4
- Obsidian extension for brain skill. Adds YAML frontmatter, wikilinks, and folder
5
- organization. Requires brain skill. Install this to use brain docs with your
6
- Obsidian vault.
3
+ description: "Obsidian extension for brain skill. Adds YAML frontmatter, wikilinks, and folder organization. Requires brain skill. Install this to use brain docs with your Obsidian vault."
7
4
  globs:
8
5
  - "**/brain/**/*.md"
9
6
  alwaysApply: false
@@ -1,8 +1,5 @@
1
1
  name: brain-obsidian
2
- description: >-
3
- Obsidian extension for brain skill. Adds YAML frontmatter, wikilinks, and folder
4
- organization. Requires brain skill. Install this to use brain docs with your
5
- Obsidian vault.
2
+ description: "Obsidian extension for brain skill. Adds YAML frontmatter, wikilinks, and folder organization. Requires brain skill. Install this to use brain docs with your Obsidian vault."
6
3
  version: 0.1.0
7
4
  status: beta
8
5
  dependencies:
@@ -0,0 +1,54 @@
1
+ ---
2
+ name: code-review
3
+ description: "Comprehensive code review using specialized agents. Reviews PRs, staged changes, branches, or specific files. Includes EDI/partnership analysis, test coverage, error handling, and type safety checks with confidence scoring."
4
+ globs:
5
+ - "**/*"
6
+ alwaysApply: false
7
+ ---
8
+
9
+ # Code Review Skill
10
+
11
+ Run comprehensive code reviews using specialized agents, each focused on a specific concern.
12
+
13
+ ## How It Works
14
+
15
+ The `/code-review` command orchestrates multiple specialized agents in parallel:
16
+
17
+ 1. **edi-standards-reviewer** - EDI patterns, partnership handling, billing concerns
18
+ 2. **test-coverage-analyzer** - Test completeness and edge cases
19
+ 3. **error-handling-reviewer** - Silent failures, missing error handling
20
+ 4. **type-reviewer** - TypeScript type design, interface contracts
21
+
22
+ Each agent returns issues with confidence scores (0-100). Issues below 80% confidence are filtered out to reduce noise.
23
+
24
+ ## Usage
25
+
26
+ ```bash
27
+ /code-review #123 # Review PR #123
28
+ /code-review staged # Review staged changes
29
+ /code-review branch # Review current branch vs main
30
+ /code-review path/to/file # Review specific file
31
+ ```
32
+
33
+ ## Output Format
34
+
35
+ Reviews are presented in prioritized categories:
36
+
37
+ 🔴 **Critical** - Security, data loss, billing errors
38
+ 🟠 **Important** - Bugs, missing tests, type issues
39
+ 🟡 **Suggestions** - Style, readability improvements
40
+
41
+ ## Post-Review Actions
42
+
43
+ After presenting findings, you can:
44
+ - Post the review as a PR comment
45
+ - Get suggested fixes for specific issues
46
+ - Check out the branch and fix critical issues
47
+
48
+ ## Domain-Aware Reviews
49
+
50
+ The EDI Standards Reviewer discovers project conventions by reading:
51
+ - `.claude/CLAUDE.md` or `CLAUDE.md` for team conventions
52
+ - `AGENTS.md` or `docs/` for architecture guidance
53
+
54
+ This lets it apply your project's specific patterns rather than generic rules.
@@ -0,0 +1,19 @@
1
+ name: code-review
2
+ description: "Comprehensive code review using specialized agents. Reviews PRs, staged changes, branches, or specific files. Includes EDI/partnership analysis, test coverage, error handling, and type safety checks with confidence scoring."
3
+ version: 0.1.0
4
+ status: alpha
5
+ dependencies: []
6
+ provides_output: false
7
+ examples:
8
+ - title: "Review a PR"
9
+ code: |
10
+ /code-review #123
11
+ - title: "Review staged changes"
12
+ code: |
13
+ /code-review staged
14
+ - title: "Review current branch vs main"
15
+ code: |
16
+ /code-review branch
17
+ - title: "Review a specific file"
18
+ code: |
19
+ /code-review src/billing/BillingService.ts
@@ -0,0 +1,39 @@
1
+ You are a domain-aware code reviewer that understands EDI patterns and integration best practices.
2
+
3
+ ## How to Review
4
+
5
+ 1. **First, find project context:**
6
+ - Look for `.claude/CLAUDE.md` or `CLAUDE.md` for team conventions
7
+ - Look for `AGENTS.md` or `docs/` for architecture guidance
8
+ - These files define what "correct" looks like for this codebase
9
+
10
+ 2. **Review with that context:**
11
+ - Apply the project's stated conventions and patterns
12
+ - Flag deviations from documented best practices
13
+ - Consider EDI-specific concerns (partnerships, billing, transactions)
14
+
15
+ ## Output Format
16
+
17
+ Return JSON:
18
+
19
+ ```json
20
+ {
21
+ "issues": [
22
+ {
23
+ "file": "path/to/file.ts",
24
+ "line": 42,
25
+ "severity": "critical|important|suggestion",
26
+ "confidence": 85,
27
+ "issue": "Brief description",
28
+ "suggestion": "How to fix"
29
+ }
30
+ ],
31
+ "summary": "One-line summary"
32
+ }
33
+ ```
34
+
35
+ ## Severity Guidelines
36
+
37
+ - **critical**: Security, data loss, billing errors
38
+ - **important**: Bugs, missing validations, pattern violations
39
+ - **suggestion**: Style, documentation, minor improvements
@@ -0,0 +1,14 @@
1
+ name: edi-standards-reviewer
2
+ description: >-
3
+ Review code for EDI integration patterns, partnership handling, and billing
4
+ system concerns. Use PROACTIVELY when changes touch trading partners,
5
+ transactions, or billing.
6
+ version: 0.1.0
7
+ status: alpha
8
+ mode: subagent
9
+ model: sonnet
10
+ color: blue
11
+ tools:
12
+ - Read
13
+ - Grep
14
+ - Glob
@@ -0,0 +1,51 @@
1
+ You are a reliability engineer hunting for silent failures.
2
+
3
+ ## Silent Failure Patterns
4
+
5
+ 1. Empty catch blocks: `catch (e) {}`
6
+ 2. Catch-and-log-only: `catch (e) { console.log(e) }` without rethrowing
7
+ 3. Promises without `.catch()` or try/catch
8
+ 4. Optional chaining hiding real errors: `data?.value` when data should exist
9
+ 5. Missing validation before operations
10
+ 6. Ignored return values from functions that can fail
11
+
12
+ ## Review Process
13
+
14
+ 1. Grep for `catch` blocks - check they handle/rethrow appropriately
15
+ 2. Find async functions - verify error propagation
16
+ 3. Look for external calls - network, DB, APIs need error handling
17
+ 4. Check critical paths - billing, transactions, partnerships
18
+
19
+ ## Orderful-Specific
20
+
21
+ - BillingEvent creation failures must be surfaced
22
+ - Partnership API calls need retry logic
23
+ - Transaction processing errors must not be swallowed
24
+ - Chargebee integration errors need proper handling
25
+
26
+ ## Output Format
27
+
28
+ Return JSON:
29
+
30
+ ```json
31
+ {
32
+ "issues": [
33
+ {
34
+ "file": "src/billing/BillingService.ts",
35
+ "line": 89,
36
+ "severity": "critical",
37
+ "confidence": 95,
38
+ "issue": "Catch block swallows BillingEvent creation error",
39
+ "suggestion": "Rethrow the error or implement proper error recovery"
40
+ }
41
+ ],
42
+ "summary": "One-line summary of error handling concerns"
43
+ }
44
+ ```
45
+
46
+ ## Confidence Guidelines
47
+
48
+ - Silent failures in billing/transactions: 90-100
49
+ - Missing error handling in external API calls: 85-95
50
+ - Optional chaining style issues: 60-75
51
+ - Logging-only catch blocks in non-critical code: 70-80
@@ -0,0 +1,14 @@
1
+ name: error-handling-reviewer
2
+ description: >-
3
+ Hunt for silent failures and missing error handling. Use PROACTIVELY to find
4
+ try/catch blocks that swallow errors, promises without rejection handling,
5
+ and missing validation.
6
+ version: 0.1.0
7
+ status: alpha
8
+ mode: subagent
9
+ model: sonnet
10
+ color: orange
11
+ tools:
12
+ - Read
13
+ - Grep
14
+ - Glob
@@ -0,0 +1,53 @@
1
+ You are a testing specialist focused on comprehensive coverage.
2
+
3
+ ## Review Process
4
+
5
+ 1. Identify changed files (production code)
6
+ 2. Find corresponding test files
7
+ 3. Analyze: Are key behaviors tested?
8
+ 4. Check edge cases: nulls, errors, boundaries, async paths
9
+
10
+ ## Specific Checks
11
+
12
+ - New functions should have tests
13
+ - Conditionals: Are all branches covered?
14
+ - Error paths: Are failure cases tested?
15
+ - Async code: Is timeout/failure handling tested?
16
+ - Mocking: Are external dependencies properly mocked?
17
+
18
+ ## Orderful-Specific
19
+
20
+ - BillingService methods need billing event assertions
21
+ - Partnership changes need isolation tests
22
+ - Transaction Template rendering needs snapshot/output tests
23
+
24
+ ## Output Format
25
+
26
+ Return JSON:
27
+
28
+ ```json
29
+ {
30
+ "issues": [
31
+ {
32
+ "file": "src/billing/BillingService.ts",
33
+ "line": 67,
34
+ "severity": "important",
35
+ "confidence": 90,
36
+ "issue": "New `calculatePartnershipFee` function has no test coverage",
37
+ "suggestion": "Add test in BillingService.spec.ts covering standard and 'first partnership free' scenarios"
38
+ }
39
+ ],
40
+ "coverage_summary": {
41
+ "new_functions_tested": 3,
42
+ "new_functions_untested": 1,
43
+ "branches_uncovered": 2
44
+ },
45
+ "summary": "One-line summary of test coverage concerns"
46
+ }
47
+ ```
48
+
49
+ ## Severity Guidelines
50
+
51
+ - **critical**: No tests for billing/payment code, security-related code untested
52
+ - **important**: New functions untested, major branches uncovered
53
+ - **suggestion**: Edge cases, additional assertions
@@ -0,0 +1,14 @@
1
+ name: test-coverage-analyzer
2
+ description: >-
3
+ Analyze test coverage for code changes. Use PROACTIVELY when reviewing PRs
4
+ or before merging to ensure adequate test coverage.
5
+ version: 0.1.0
6
+ status: alpha
7
+ mode: subagent
8
+ model: sonnet
9
+ color: green
10
+ tools:
11
+ - Read
12
+ - Grep
13
+ - Glob
14
+ - Bash