@orderful/droid 0.6.0 → 0.8.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.
- package/CHANGELOG.md +45 -0
- package/README.md +80 -89
- package/assets/droid+claude.png +0 -0
- package/bun.lock +1 -1
- package/dist/commands/setup.d.ts +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +77 -9
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/tui.d.ts.map +1 -1
- package/dist/commands/tui.js +111 -70
- package/dist/commands/tui.js.map +1 -1
- package/dist/lib/agents.d.ts +19 -4
- package/dist/lib/agents.d.ts.map +1 -1
- package/dist/lib/agents.js +121 -42
- package/dist/lib/agents.js.map +1 -1
- package/dist/lib/skills.d.ts.map +1 -1
- package/dist/lib/skills.js +55 -0
- package/dist/lib/skills.js.map +1 -1
- package/dist/lib/types.d.ts +1 -0
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/skills/brain/SKILL.md +146 -0
- package/dist/skills/brain/SKILL.yaml +31 -0
- package/dist/skills/brain/commands/README.md +7 -0
- package/dist/skills/brain/commands/brain.md +50 -0
- package/dist/skills/brain/references/metadata.md +59 -0
- package/dist/skills/brain/references/naming.md +48 -0
- package/dist/skills/brain/references/templates.md +102 -0
- package/dist/skills/brain/references/workflows.md +198 -0
- package/dist/skills/brain-obsidian/SKILL.md +108 -0
- package/dist/skills/brain-obsidian/SKILL.yaml +45 -0
- package/dist/skills/brain-obsidian/references/templates.md +144 -0
- package/dist/skills/brain-obsidian/references/workflows.md +192 -0
- package/dist/skills/code-review/SKILL.md +57 -0
- package/dist/skills/code-review/SKILL.yaml +22 -0
- package/dist/skills/code-review/agents/edi-standards-reviewer/AGENT.md +39 -0
- package/dist/skills/code-review/agents/edi-standards-reviewer/AGENT.yaml +14 -0
- package/dist/skills/code-review/agents/error-handling-reviewer/AGENT.md +51 -0
- package/dist/skills/code-review/agents/error-handling-reviewer/AGENT.yaml +14 -0
- package/dist/skills/code-review/agents/test-coverage-analyzer/AGENT.md +53 -0
- package/dist/skills/code-review/agents/test-coverage-analyzer/AGENT.yaml +14 -0
- package/dist/skills/code-review/agents/type-reviewer/AGENT.md +50 -0
- package/dist/skills/code-review/agents/type-reviewer/AGENT.yaml +13 -0
- package/dist/skills/code-review/commands/code-review.md +91 -0
- package/dist/skills/comments/SKILL.md +20 -5
- package/dist/skills/comments/SKILL.yaml +1 -1
- package/dist/skills/comments/commands/comments.md +1 -1
- package/dist/skills/project/SKILL.md +9 -7
- package/dist/skills/project/SKILL.yaml +1 -1
- package/dist/skills/project/commands/project.md +9 -4
- package/dist/skills/project/references/creating.md +9 -4
- package/dist/skills/project/references/loading.md +11 -5
- package/package.json +1 -1
- package/src/commands/setup.test.ts +276 -0
- package/src/commands/setup.ts +80 -10
- package/src/commands/tui.tsx +149 -82
- package/src/lib/agents.ts +134 -44
- package/src/lib/skills.ts +60 -0
- package/src/lib/types.ts +1 -0
- package/src/skills/brain/SKILL.md +146 -0
- package/src/skills/brain/SKILL.yaml +31 -0
- package/src/skills/brain/commands/README.md +7 -0
- package/src/skills/brain/commands/brain.md +50 -0
- package/src/skills/brain/references/metadata.md +59 -0
- package/src/skills/brain/references/naming.md +48 -0
- package/src/skills/brain/references/templates.md +102 -0
- package/src/skills/brain/references/workflows.md +198 -0
- package/src/skills/brain-obsidian/SKILL.md +108 -0
- package/src/skills/brain-obsidian/SKILL.yaml +45 -0
- package/src/skills/brain-obsidian/references/templates.md +144 -0
- package/src/skills/brain-obsidian/references/workflows.md +192 -0
- package/src/skills/code-review/SKILL.md +57 -0
- package/src/skills/code-review/SKILL.yaml +22 -0
- package/src/skills/code-review/agents/edi-standards-reviewer/AGENT.md +39 -0
- package/src/skills/code-review/agents/edi-standards-reviewer/AGENT.yaml +14 -0
- package/src/skills/code-review/agents/error-handling-reviewer/AGENT.md +51 -0
- package/src/skills/code-review/agents/error-handling-reviewer/AGENT.yaml +14 -0
- package/src/skills/code-review/agents/test-coverage-analyzer/AGENT.md +53 -0
- package/src/skills/code-review/agents/test-coverage-analyzer/AGENT.yaml +14 -0
- package/src/skills/code-review/agents/type-reviewer/AGENT.md +50 -0
- package/src/skills/code-review/agents/type-reviewer/AGENT.yaml +13 -0
- package/src/skills/code-review/commands/code-review.md +91 -0
- package/src/skills/comments/SKILL.md +20 -5
- package/src/skills/comments/SKILL.yaml +1 -1
- package/src/skills/comments/commands/comments.md +1 -1
- package/src/skills/project/SKILL.md +9 -7
- package/src/skills/project/SKILL.yaml +1 -1
- package/src/skills/project/commands/project.md +9 -4
- package/src/skills/project/references/creating.md +9 -4
- 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
|
|
|
@@ -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
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
---
|
|
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.
|
|
8
|
+
globs:
|
|
9
|
+
- "**/brain/**/*.md"
|
|
10
|
+
alwaysApply: false
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Brain Skill
|
|
14
|
+
|
|
15
|
+
Scratch pad for planning, research, and design docs that persist across sessions.
|
|
16
|
+
|
|
17
|
+
## Why Brain Docs?
|
|
18
|
+
|
|
19
|
+
Ideas develop through iteration, not single prompts.
|
|
20
|
+
|
|
21
|
+
- **Thinking space** - Work through problems before committing to code
|
|
22
|
+
- **Async collaboration** - Leave `@mentions` for discussion across sessions (see comments skill for full support)
|
|
23
|
+
- **Persistent context** - Docs survive after chat history disappears
|
|
24
|
+
|
|
25
|
+
## When to Use
|
|
26
|
+
|
|
27
|
+
- Planning implementation for a feature
|
|
28
|
+
- Researching a problem or technology
|
|
29
|
+
- Design work that benefits from written iteration
|
|
30
|
+
- User says "brain", "let's think through", "plan this out"
|
|
31
|
+
- Optionally, to capture output from plan mode sessions
|
|
32
|
+
|
|
33
|
+
## When NOT to Use
|
|
34
|
+
|
|
35
|
+
- Quick questions that don't need persistence
|
|
36
|
+
- Tasks with clear implementation path
|
|
37
|
+
- One-off lookups or simple fixes
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
**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
|
+
|
|
43
|
+
| Setting | Default | Description |
|
|
44
|
+
|---------|---------|-------------|
|
|
45
|
+
| `brain_dir` | (see below) | Where docs are stored |
|
|
46
|
+
| `inbox_folder` | (empty) | Optional subfolder for new docs (omit for flat structure) |
|
|
47
|
+
|
|
48
|
+
Default `brain_dir` by AI tool (only if not configured):
|
|
49
|
+
- **claude-code**: `~/.claude/brain`
|
|
50
|
+
- **opencode**: `~/.config/opencode/brain`
|
|
51
|
+
|
|
52
|
+
## Core Concepts
|
|
53
|
+
|
|
54
|
+
**Active doc:** Opening or creating a brain doc makes it "active" for the session. Subsequent `/brain add` commands append to it without specifying a path.
|
|
55
|
+
|
|
56
|
+
**Doc types:**
|
|
57
|
+
- `plan` - Structured: Context → Exploration → Decision → Next Steps
|
|
58
|
+
- `research` - Open-ended exploration of a topic
|
|
59
|
+
- `review` - Code review, document review, or any evaluation task
|
|
60
|
+
- `note` - Quick capture (fire-and-forget, doesn't become active)
|
|
61
|
+
|
|
62
|
+
**Comment conventions:** Use `@droid` / `@{user}` markers for async back-and-forth. If droid's `comments` skill is installed, use `/comments check` for full support.
|
|
63
|
+
|
|
64
|
+
**Status lifecycle:** `exploring` → `drafting` → `decided` → `done`
|
|
65
|
+
|
|
66
|
+
## Commands
|
|
67
|
+
|
|
68
|
+
| Command | Action |
|
|
69
|
+
|---------|--------|
|
|
70
|
+
| `/brain` | List recent docs or create new |
|
|
71
|
+
| `/brain {topic}` | **Search** for existing doc (fuzzy match) → becomes active |
|
|
72
|
+
| `/brain plan {topic}` | Create planning doc (requires `plan` keyword) |
|
|
73
|
+
| `/brain research {topic}` | Create research doc (requires `research` keyword) |
|
|
74
|
+
| `/brain review {topic}` | Create review doc (requires `review` keyword) |
|
|
75
|
+
| `/brain note {text}` | Quick capture (standalone, doesn't become active) |
|
|
76
|
+
| `/brain add {text}` | Append to active doc |
|
|
77
|
+
| `/brain check` | Address @droid comments in active doc |
|
|
78
|
+
| `/brain done` | Finalize active doc, update status |
|
|
79
|
+
|
|
80
|
+
**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.
|
|
81
|
+
|
|
82
|
+
## Opening a Doc
|
|
83
|
+
|
|
84
|
+
**Trigger:** `/brain {topic}` or user asks to open a brain doc
|
|
85
|
+
|
|
86
|
+
**TLDR:** Search for and open an existing doc. Fuzzy-match topic against existing docs, read content, set as active.
|
|
87
|
+
|
|
88
|
+
Full procedure: `references/workflows.md` § Opening
|
|
89
|
+
|
|
90
|
+
## Creating a Doc
|
|
91
|
+
|
|
92
|
+
**Trigger:** `/brain plan {topic}` or `/brain research {topic}`
|
|
93
|
+
|
|
94
|
+
**TLDR:** Create doc from template, set as active, gather initial context.
|
|
95
|
+
|
|
96
|
+
Full procedure: `references/workflows.md` § Creating
|
|
97
|
+
Templates: `references/templates.md`
|
|
98
|
+
Naming: `references/naming.md`
|
|
99
|
+
|
|
100
|
+
## Quick Notes
|
|
101
|
+
|
|
102
|
+
**Trigger:** `/brain note {text}`
|
|
103
|
+
|
|
104
|
+
**TLDR:** Fire-and-forget capture to inbox. Does not become active doc.
|
|
105
|
+
|
|
106
|
+
Full procedure: `references/workflows.md` § Notes
|
|
107
|
+
|
|
108
|
+
## Adding Content
|
|
109
|
+
|
|
110
|
+
**Trigger:** `/brain add {text}`
|
|
111
|
+
|
|
112
|
+
**TLDR:** Append text to active doc with timestamp.
|
|
113
|
+
|
|
114
|
+
Full procedure: `references/workflows.md` § Adding
|
|
115
|
+
|
|
116
|
+
## Checking Comments
|
|
117
|
+
|
|
118
|
+
**Trigger:** `/brain check`
|
|
119
|
+
|
|
120
|
+
**TLDR:** Find `> @droid` comments in active doc, address each one.
|
|
121
|
+
|
|
122
|
+
Full procedure: `references/workflows.md` § Checking
|
|
123
|
+
|
|
124
|
+
## Finalizing
|
|
125
|
+
|
|
126
|
+
**Trigger:** `/brain done`
|
|
127
|
+
|
|
128
|
+
**TLDR:** Review doc, update status to `done`, suggest next steps.
|
|
129
|
+
|
|
130
|
+
Full procedure: `references/workflows.md` § Finalizing
|
|
131
|
+
|
|
132
|
+
## Extensions
|
|
133
|
+
|
|
134
|
+
Before creating or modifying brain docs, check if any `brain-*` extension skills are installed:
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
~/.claude/skills/brain-*/SKILL.md
|
|
138
|
+
~/.droid/skills/brain-*/SKILL.md
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If found (e.g., `brain-obsidian`), **ALWAYS** use the extension's templates, workflows, and configuration instead of this skill's defaults. Extensions may provide:
|
|
142
|
+
- Alternative template formats (YAML frontmatter, wikilinks)
|
|
143
|
+
- Folder organization (PARA structure)
|
|
144
|
+
- Additional commands or integrations
|
|
145
|
+
|
|
146
|
+
The base brain skill provides simple markdown. Extensions layer on advanced features.
|
|
@@ -0,0 +1,31 @@
|
|
|
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.1
|
|
8
|
+
status: beta
|
|
9
|
+
dependencies: []
|
|
10
|
+
provides_output: false
|
|
11
|
+
config_schema:
|
|
12
|
+
brain_dir:
|
|
13
|
+
type: string
|
|
14
|
+
description: Directory for brain docs (default varies by AI tool)
|
|
15
|
+
inbox_folder:
|
|
16
|
+
type: string
|
|
17
|
+
description: Subfolder for new docs (empty = flat structure)
|
|
18
|
+
default: ""
|
|
19
|
+
examples:
|
|
20
|
+
- title: "Start a planning doc"
|
|
21
|
+
code: |
|
|
22
|
+
/brain plan auth refactor
|
|
23
|
+
# Creates planning doc, becomes active for session
|
|
24
|
+
- title: "Quick note capture"
|
|
25
|
+
code: |
|
|
26
|
+
/brain note Remember to check rate limits on the API
|
|
27
|
+
# Fire-and-forget to inbox
|
|
28
|
+
- title: "Check for comments"
|
|
29
|
+
code: |
|
|
30
|
+
/brain check
|
|
31
|
+
# Find and address @mentions in active doc
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Collaborative scratch pad 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
|
+
# /brain
|
|
8
|
+
|
|
9
|
+
Entry point for brain doc management. See the **brain skill** for full behavior.
|
|
10
|
+
|
|
11
|
+
## Arguments
|
|
12
|
+
|
|
13
|
+
$ARGUMENTS
|
|
14
|
+
|
|
15
|
+
## Default Behavior
|
|
16
|
+
|
|
17
|
+
**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}`.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
/brain # List recent docs or create new
|
|
23
|
+
/brain {topic} # SEARCH: Open existing doc (fuzzy match) → active
|
|
24
|
+
/brain plan {topic} # CREATE: New planning doc → active
|
|
25
|
+
/brain research {topic} # Create research doc → active
|
|
26
|
+
/brain review {topic} # Create review doc → active
|
|
27
|
+
/brain note {text} # Quick capture (fire-and-forget)
|
|
28
|
+
/brain add {text} # Append to active doc
|
|
29
|
+
/brain check # Address @droid comments in active doc
|
|
30
|
+
/brain done # Finalize active doc
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Configuration
|
|
34
|
+
|
|
35
|
+
**ALWAYS read `~/.droid/skills/brain/overrides.yaml` first.** Use configured values if present, only fall back to defaults if missing.
|
|
36
|
+
|
|
37
|
+
- `brain_dir` - Where docs live (default varies by AI tool)
|
|
38
|
+
- `inbox_folder` - Subfolder for new docs (empty = flat)
|
|
39
|
+
|
|
40
|
+
## Behavior
|
|
41
|
+
|
|
42
|
+
Refer to the brain skill for:
|
|
43
|
+
- **Opening**: How to fuzzy-match, handle multiple matches, set active
|
|
44
|
+
- **Creating**: Template structure by preset, naming conventions
|
|
45
|
+
- **Notes**: Quick capture workflow
|
|
46
|
+
- **Adding**: Append to active doc with timestamp
|
|
47
|
+
- **Checking**: Find and address @droid comments
|
|
48
|
+
- **Finalizing**: Update status, suggest next steps
|
|
49
|
+
|
|
50
|
+
The skill's `references/` folder contains detailed specs for workflows, templates, naming, and metadata.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Brain Doc Metadata
|
|
2
|
+
|
|
3
|
+
Inline metadata and status lifecycle for brain docs.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
Status and type tracked inline at top of doc:
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
# {Topic}
|
|
11
|
+
|
|
12
|
+
**Type:** plan
|
|
13
|
+
**Status:** exploring
|
|
14
|
+
**Created:** 2025-01-15
|
|
15
|
+
|
|
16
|
+
...
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Simple and portable. Works anywhere markdown is supported.
|
|
20
|
+
|
|
21
|
+
## Fields
|
|
22
|
+
|
|
23
|
+
| Field | Required | Description |
|
|
24
|
+
|-------|----------|-------------|
|
|
25
|
+
| `Type` | Yes | Doc type: `plan`, `research`, `review`, or `note` |
|
|
26
|
+
| `Status` | Yes (except notes) | Current lifecycle stage |
|
|
27
|
+
| `Created` | Yes | Creation date |
|
|
28
|
+
| `Updated` | No | Last modification date (add when doc changes) |
|
|
29
|
+
|
|
30
|
+
## Status Lifecycle
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
exploring → drafting → decided → done
|
|
34
|
+
↓ ↓ ↓
|
|
35
|
+
stale stale stale
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Status Definitions
|
|
39
|
+
|
|
40
|
+
| Status | Meaning | Typical Actions |
|
|
41
|
+
|--------|---------|-----------------|
|
|
42
|
+
| `exploring` | Initial discovery, gathering information | Research, ask questions, explore options |
|
|
43
|
+
| `drafting` | Forming opinions, narrowing options | Document trade-offs, propose approaches |
|
|
44
|
+
| `decided` | Decision made, ready to act | Document decision rationale, plan implementation |
|
|
45
|
+
| `done` | Work complete, doc is reference material | Archive or link from project |
|
|
46
|
+
| `stale` | Abandoned or outdated | Review for archival or deletion |
|
|
47
|
+
|
|
48
|
+
### Transitions
|
|
49
|
+
|
|
50
|
+
- **exploring → drafting**: When you have enough info to start forming opinions
|
|
51
|
+
- **drafting → decided**: When a clear decision/direction emerges
|
|
52
|
+
- **decided → done**: When the work is complete
|
|
53
|
+
- **any → stale**: When doc hasn't been touched in 30+ days without resolution
|
|
54
|
+
|
|
55
|
+
## Updating Metadata
|
|
56
|
+
|
|
57
|
+
When modifying a doc:
|
|
58
|
+
1. Add or update the `Updated` field to current date
|
|
59
|
+
2. Update `Status` if the work has progressed
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Brain Doc Naming
|
|
2
|
+
|
|
3
|
+
Conventions for naming brain docs.
|
|
4
|
+
|
|
5
|
+
## Format
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
{type}-{topic-slug}.md
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Components
|
|
12
|
+
|
|
13
|
+
| Component | Description | Examples |
|
|
14
|
+
|-----------|-------------|----------|
|
|
15
|
+
| `{type}` | Doc type: `plan`, `research`, `note` | `plan`, `research`, `note` |
|
|
16
|
+
| `{topic-slug}` | Lowercase, hyphen-separated topic | `auth-refactor`, `caching-strategies` |
|
|
17
|
+
|
|
18
|
+
## Slug Rules
|
|
19
|
+
|
|
20
|
+
1. **Lowercase** all words
|
|
21
|
+
2. **Replace spaces** with hyphens
|
|
22
|
+
3. **Remove special characters** (keep alphanumeric and hyphens only)
|
|
23
|
+
4. **Limit length** to ~50 characters (truncate at word boundary)
|
|
24
|
+
5. **No trailing hyphens**
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
| Input | Filename |
|
|
29
|
+
|-------|----------|
|
|
30
|
+
| `/brain plan Auth Refactor` | `plan-auth-refactor.md` |
|
|
31
|
+
| `/brain research Caching Strategies` | `research-caching-strategies.md` |
|
|
32
|
+
| `/brain plan Transaction Template Rendering` | `plan-transaction-template-rendering.md` |
|
|
33
|
+
| `/brain note Remember to check rate limits` | `note-20250115-remember-to-check-rate.md` |
|
|
34
|
+
|
|
35
|
+
## Notes
|
|
36
|
+
|
|
37
|
+
For notes, include the date in the filename:
|
|
38
|
+
```
|
|
39
|
+
note-{YYYYMMDD}-{slug}.md
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
This prevents collisions and allows chronological sorting.
|
|
43
|
+
|
|
44
|
+
## Uniqueness
|
|
45
|
+
|
|
46
|
+
If a file with the generated name already exists:
|
|
47
|
+
1. Check if user wants to open existing doc
|
|
48
|
+
2. Or append a numeric suffix: `plan-auth-refactor-2.md`
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Brain Doc Templates
|
|
2
|
+
|
|
3
|
+
Templates for each doc type. All templates use simple markdown.
|
|
4
|
+
|
|
5
|
+
## Plan Template
|
|
6
|
+
|
|
7
|
+
```markdown
|
|
8
|
+
# {Topic}
|
|
9
|
+
|
|
10
|
+
**Type:** plan
|
|
11
|
+
**Status:** exploring
|
|
12
|
+
**Created:** {date}
|
|
13
|
+
|
|
14
|
+
Planning {brief description}.
|
|
15
|
+
|
|
16
|
+
## Context
|
|
17
|
+
|
|
18
|
+
What we're solving and why.
|
|
19
|
+
|
|
20
|
+
## Exploration
|
|
21
|
+
|
|
22
|
+
Options and approaches considered.
|
|
23
|
+
|
|
24
|
+
## Decision
|
|
25
|
+
|
|
26
|
+
What we chose and why.
|
|
27
|
+
|
|
28
|
+
## Next Steps
|
|
29
|
+
|
|
30
|
+
- [ ] Action items
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Research Template
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
# {Topic}
|
|
37
|
+
|
|
38
|
+
**Type:** research
|
|
39
|
+
**Status:** exploring
|
|
40
|
+
**Created:** {date}
|
|
41
|
+
|
|
42
|
+
Researching {brief description}.
|
|
43
|
+
|
|
44
|
+
## Questions
|
|
45
|
+
|
|
46
|
+
What we're trying to understand.
|
|
47
|
+
|
|
48
|
+
## Findings
|
|
49
|
+
|
|
50
|
+
What we've learned.
|
|
51
|
+
|
|
52
|
+
## Summary
|
|
53
|
+
|
|
54
|
+
Key takeaways.
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Review Template
|
|
58
|
+
|
|
59
|
+
```markdown
|
|
60
|
+
# {Topic}
|
|
61
|
+
|
|
62
|
+
**Type:** review
|
|
63
|
+
**Status:** exploring
|
|
64
|
+
**Created:** {date}
|
|
65
|
+
|
|
66
|
+
Reviewing {brief description}.
|
|
67
|
+
|
|
68
|
+
## Overview
|
|
69
|
+
|
|
70
|
+
What's being reviewed and scope.
|
|
71
|
+
|
|
72
|
+
## Observations
|
|
73
|
+
|
|
74
|
+
Key findings and notes.
|
|
75
|
+
|
|
76
|
+
## Recommendations
|
|
77
|
+
|
|
78
|
+
Suggested changes or actions.
|
|
79
|
+
|
|
80
|
+
## Verdict
|
|
81
|
+
|
|
82
|
+
Overall assessment.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Note Template
|
|
86
|
+
|
|
87
|
+
```markdown
|
|
88
|
+
# Note: {Brief Title}
|
|
89
|
+
|
|
90
|
+
**Created:** {date}
|
|
91
|
+
|
|
92
|
+
{content}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Template Variables
|
|
96
|
+
|
|
97
|
+
| Variable | Description | Example |
|
|
98
|
+
|----------|-------------|---------|
|
|
99
|
+
| `{Topic}` | Doc title from user input | "Auth Refactor" |
|
|
100
|
+
| `{date}` | Current date (YYYY-MM-DD) | "2025-01-15" |
|
|
101
|
+
| `{brief description}` | Context from conversation | "refactoring the authentication system" |
|
|
102
|
+
| `{content}` | User-provided text | (for notes) |
|