@orderful/droid 0.5.2 → 0.7.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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bun.lock +1 -1
  3. package/dist/commands/tui.d.ts.map +1 -1
  4. package/dist/commands/tui.js +54 -7
  5. package/dist/commands/tui.js.map +1 -1
  6. package/dist/lib/version.d.ts +17 -0
  7. package/dist/lib/version.d.ts.map +1 -1
  8. package/dist/lib/version.js +41 -0
  9. package/dist/lib/version.js.map +1 -1
  10. package/dist/skills/brain/SKILL.md +144 -0
  11. package/dist/skills/brain/SKILL.yaml +31 -0
  12. package/dist/skills/brain/commands/README.md +7 -0
  13. package/dist/skills/brain/commands/brain.md +45 -0
  14. package/dist/skills/brain/references/metadata.md +59 -0
  15. package/dist/skills/brain/references/naming.md +48 -0
  16. package/dist/skills/brain/references/templates.md +102 -0
  17. package/dist/skills/brain/references/workflows.md +188 -0
  18. package/dist/skills/brain-obsidian/SKILL.md +108 -0
  19. package/dist/skills/brain-obsidian/SKILL.yaml +45 -0
  20. package/dist/skills/brain-obsidian/references/templates.md +144 -0
  21. package/dist/skills/brain-obsidian/references/workflows.md +192 -0
  22. package/dist/skills/comments/SKILL.yaml +1 -1
  23. package/package.json +1 -1
  24. package/src/commands/tui.tsx +120 -15
  25. package/src/lib/version.ts +49 -0
  26. package/src/skills/brain/SKILL.md +144 -0
  27. package/src/skills/brain/SKILL.yaml +31 -0
  28. package/src/skills/brain/commands/README.md +7 -0
  29. package/src/skills/brain/commands/brain.md +45 -0
  30. package/src/skills/brain/references/metadata.md +59 -0
  31. package/src/skills/brain/references/naming.md +48 -0
  32. package/src/skills/brain/references/templates.md +102 -0
  33. package/src/skills/brain/references/workflows.md +188 -0
  34. package/src/skills/brain-obsidian/SKILL.md +108 -0
  35. package/src/skills/brain-obsidian/SKILL.yaml +45 -0
  36. package/src/skills/brain-obsidian/references/templates.md +144 -0
  37. package/src/skills/brain-obsidian/references/workflows.md +192 -0
  38. package/src/skills/comments/SKILL.yaml +1 -1
@@ -0,0 +1,144 @@
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
+ Check `~/.droid/skills/brain/overrides.yaml` for user settings:
42
+
43
+ | Setting | Default | Description |
44
+ |---------|---------|-------------|
45
+ | `brain_dir` | `~/{ai_tool}/brain` | Where docs are stored (varies by AI tool) |
46
+ | `inbox_folder` | (empty) | Optional subfolder for new docs (omit for flat structure) |
47
+
48
+ Default `brain_dir` by AI tool:
49
+ - **claude-code**: `~/.claude/brain`
50
+ - **opencode**: `~/.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}` | 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 |
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
+ ## Opening a Doc
81
+
82
+ **Trigger:** `/brain {topic}` or user asks to open a brain doc
83
+
84
+ **TLDR:** Fuzzy-match topic against existing docs, read content, set as active.
85
+
86
+ Full procedure: `references/workflows.md` § Opening
87
+
88
+ ## Creating a Doc
89
+
90
+ **Trigger:** `/brain plan {topic}` or `/brain research {topic}`
91
+
92
+ **TLDR:** Create doc from template, set as active, gather initial context.
93
+
94
+ Full procedure: `references/workflows.md` § Creating
95
+ Templates: `references/templates.md`
96
+ Naming: `references/naming.md`
97
+
98
+ ## Quick Notes
99
+
100
+ **Trigger:** `/brain note {text}`
101
+
102
+ **TLDR:** Fire-and-forget capture to inbox. Does not become active doc.
103
+
104
+ Full procedure: `references/workflows.md` § Notes
105
+
106
+ ## Adding Content
107
+
108
+ **Trigger:** `/brain add {text}`
109
+
110
+ **TLDR:** Append text to active doc with timestamp.
111
+
112
+ Full procedure: `references/workflows.md` § Adding
113
+
114
+ ## Checking Comments
115
+
116
+ **Trigger:** `/brain check`
117
+
118
+ **TLDR:** Find `> @droid` comments in active doc, address each one.
119
+
120
+ Full procedure: `references/workflows.md` § Checking
121
+
122
+ ## Finalizing
123
+
124
+ **Trigger:** `/brain done`
125
+
126
+ **TLDR:** Review doc, update status to `done`, suggest next steps.
127
+
128
+ Full procedure: `references/workflows.md` § Finalizing
129
+
130
+ ## Extensions
131
+
132
+ Before creating or modifying brain docs, check if any `brain-*` extension skills are installed:
133
+
134
+ ```
135
+ ~/.claude/skills/brain-*/SKILL.md
136
+ ~/.droid/skills/brain-*/SKILL.md
137
+ ```
138
+
139
+ If found (e.g., `brain-obsidian`), **ALWAYS** use the extension's templates, workflows, and configuration instead of this skill's defaults. Extensions may provide:
140
+ - Alternative template formats (YAML frontmatter, wikilinks)
141
+ - Folder organization (PARA structure)
142
+ - Additional commands or integrations
143
+
144
+ 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.0
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,7 @@
1
+ # Brain Skill Commands
2
+
3
+ Commands in this folder are installed to `~/.claude/commands/` (or equivalent for other AI tools).
4
+
5
+ ## /brain
6
+
7
+ Main entry point for brain doc management. See `brain.md` for details.
@@ -0,0 +1,45 @@
1
+ ---
2
+ description: Collaborative scratch pad for planning and research
3
+ argument-hint: [plan|research|review|note|add|check|done] {topic/text}
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
+ ## Usage
16
+
17
+ ```
18
+ /brain # List recent docs or create new
19
+ /brain {topic} # Open existing (fuzzy match) → active
20
+ /brain plan {topic} # Create planning doc → active
21
+ /brain research {topic} # Create research doc → active
22
+ /brain review {topic} # Create review doc → active
23
+ /brain note {text} # Quick capture (fire-and-forget)
24
+ /brain add {text} # Append to active doc
25
+ /brain check # Address @droid comments in active doc
26
+ /brain done # Finalize active doc
27
+ ```
28
+
29
+ ## Configuration
30
+
31
+ From `~/.droid/skills/brain/overrides.yaml`:
32
+ - `brain_dir` - Where docs live (default varies by AI tool)
33
+ - `inbox_folder` - Subfolder for new docs (empty = flat)
34
+
35
+ ## Behavior
36
+
37
+ Refer to the brain skill for:
38
+ - **Opening**: How to fuzzy-match, handle multiple matches, set active
39
+ - **Creating**: Template structure by preset, naming conventions
40
+ - **Notes**: Quick capture workflow
41
+ - **Adding**: Append to active doc with timestamp
42
+ - **Checking**: Find and address @droid comments
43
+ - **Finalizing**: Update status, suggest next steps
44
+
45
+ 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) |
@@ -0,0 +1,188 @@
1
+ # Brain Workflows
2
+
3
+ Detailed procedures for each brain operation.
4
+
5
+ ## Opening
6
+
7
+ **Trigger:** `/brain {topic}` or user asks to open a brain doc
8
+
9
+ **Steps:**
10
+
11
+ 1. **Resolve brain_dir** from config (default: `~/.claude/brain` for claude-code)
12
+
13
+ 2. **Search for matches**
14
+ ```
15
+ Glob: {brain_dir}/**/*{topic}*.md
16
+ ```
17
+ Fuzzy match the topic against doc filenames
18
+
19
+ 3. **Handle results:**
20
+ - **No matches**: Offer to create a new doc with that topic
21
+ - **One match**: Open it
22
+ - **Multiple matches**: Present list, let user choose
23
+
24
+ 4. **Read the doc** and summarize key points:
25
+ - Current status
26
+ - Main topic/context
27
+ - Any open `@droid` comments
28
+ - Recent updates
29
+
30
+ 5. **Set as active doc** - Remember path for subsequent `/brain add` and `/brain check` commands
31
+
32
+ ## Creating
33
+
34
+ **Trigger:** `/brain plan {topic}` or `/brain research {topic}`
35
+
36
+ **Steps:**
37
+
38
+ 1. **Resolve brain_dir** and **inbox_folder** from config
39
+
40
+ 2. **Generate filename** using naming conventions (see `naming.md`):
41
+ - Format: `{type}-{topic-slug}.md`
42
+ - Example: `plan-auth-refactor.md` or `research-caching-strategies.md`
43
+
44
+ 3. **Determine target path:**
45
+ - If `inbox_folder` is set: `{brain_dir}/{inbox_folder}/{filename}`
46
+ - Otherwise: `{brain_dir}/{filename}`
47
+
48
+ 4. **Create directory** if needed
49
+
50
+ 5. **Apply template** based on preset and type (see `templates.md`)
51
+
52
+ 6. **Gather initial context** from conversation:
53
+ - What problem are we solving?
54
+ - Any constraints or requirements mentioned?
55
+ - Related work or prior decisions?
56
+
57
+ 7. **Write the doc** with template structure and initial context
58
+
59
+ 8. **Set as active doc**
60
+
61
+ 9. **Confirm creation** and summarize what was captured
62
+
63
+ ## Notes
64
+
65
+ **Trigger:** `/brain note {text}`
66
+
67
+ **Steps:**
68
+
69
+ 1. **Resolve brain_dir** and **inbox_folder** from config
70
+
71
+ 2. **Generate filename:**
72
+ - Format: `note-{date}-{slug}.md` where date is `YYYYMMDD`
73
+ - Slug from first few words of text
74
+ - Example: `note-20250115-remember-rate-limits.md`
75
+
76
+ 3. **Determine target path:**
77
+ - If `inbox_folder` is set: `{brain_dir}/{inbox_folder}/{filename}`
78
+ - Otherwise: `{brain_dir}/{filename}`
79
+
80
+ 4. **Create simple note:**
81
+ - Markdown preset: Just the text
82
+ - Obsidian preset: Add frontmatter with `type: note`, `created: {date}`
83
+
84
+ 5. **Write the file** - Do NOT set as active (fire-and-forget)
85
+
86
+ 6. **Confirm** briefly: "Captured note to {filename}"
87
+
88
+ ## Adding
89
+
90
+ **Trigger:** `/brain add {text}`
91
+
92
+ **Steps:**
93
+
94
+ 1. **Check for active doc**
95
+ - If no active doc: Ask user which doc to add to, or offer to create new
96
+
97
+ 2. **Read current content** of active doc
98
+
99
+ 3. **Append new section:**
100
+ ```markdown
101
+
102
+ ---
103
+
104
+ ## Update ({date})
105
+
106
+ {text}
107
+ ```
108
+
109
+ 4. **Update the `updated` date** in frontmatter (if using obsidian preset)
110
+
111
+ 5. **Write changes**
112
+
113
+ 6. **Confirm** what was added
114
+
115
+ ## Checking
116
+
117
+ **Trigger:** `/brain check`
118
+
119
+ **Prefer `comments` skill:** If the `comments` skill is installed, use `/comments check` instead - it provides better comment detection, cleanup workflows, and supports the full `@droid`/`@user` convention. The workflow below is a fallback for basic comment handling.
120
+
121
+ **Steps:**
122
+
123
+ 1. **Check for active doc**
124
+ - If no active doc: Ask user which doc to check, or list docs with comments
125
+
126
+ 2. **Read active doc**
127
+
128
+ 3. **Find all `> @droid` comments**
129
+ - Pattern: Lines starting with `> @droid` (blockquote with mention)
130
+
131
+ 4. **For each comment:**
132
+ - Show the comment and surrounding context
133
+ - Address the question/request
134
+ - Add response as `> @{user_mention}` reply
135
+ - Or resolve inline if it was a simple note
136
+
137
+ 5. **Update the doc** with responses
138
+
139
+ 6. **Summarize** what was addressed
140
+
141
+ ## Finalizing
142
+
143
+ **Trigger:** `/brain done`
144
+
145
+ **Steps:**
146
+
147
+ 1. **Check for active doc**
148
+ - If no active doc: Ask which doc to finalize
149
+
150
+ 2. **Read active doc**
151
+
152
+ 3. **Review content:**
153
+ - Are there unresolved `@droid` comments?
154
+ - Is there a clear decision/outcome?
155
+ - Any loose ends?
156
+
157
+ 4. **Update status** to `done` in frontmatter (obsidian preset) or add "Status: Done" (markdown preset)
158
+
159
+ 5. **Suggest next steps:**
160
+ - Promote to project? (if substantial work)
161
+ - Archive? (if complete)
162
+ - Create follow-up tasks?
163
+
164
+ 6. **Clear active doc** from session
165
+
166
+ ## Listing
167
+
168
+ **Trigger:** `/brain` (no arguments)
169
+
170
+ **Steps:**
171
+
172
+ 1. **Resolve brain_dir** from config
173
+
174
+ 2. **Find recent docs:**
175
+ ```
176
+ Glob: {brain_dir}/**/*.md
177
+ ```
178
+ Sort by modification time, limit to 10-15
179
+
180
+ 3. **Present list** with:
181
+ - Filename
182
+ - Type (plan/research/note)
183
+ - Status (if available)
184
+ - Last modified
185
+
186
+ 4. **Offer options:**
187
+ - Select a doc to open
188
+ - Create new plan/research doc