@pingvinen/donna-assistant 0.3.2 → 0.5.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.
@@ -0,0 +1,288 @@
1
+ # Donna Set-Role Workflow
2
+
3
+ <objective>
4
+ Define the user's job role, research recurring tasks and tools for that role using WebSearch, present findings for approval, and persist role definition and recurring tasks to the storage repo.
5
+ </objective>
6
+
7
+ <step name="read-config">
8
+ Read `~/.config/donna/config.md`.
9
+
10
+ If the file does not exist, print:
11
+ ```
12
+ ✗ Donna is not configured. Run /donna:setup first.
13
+ ```
14
+ Stop.
15
+
16
+ Extract the `storage_repo` and `auto_push` (default: false) fields from the YAML frontmatter.
17
+ </step>
18
+
19
+ <step name="check-pending-migrations">
20
+ Read `~/.donna/state.md` with the Read tool. If the file does not exist or has no `pending_migrations` field in its YAML frontmatter, skip this step.
21
+
22
+ For each entry in `pending_migrations`:
23
+
24
+ **`move-standing-files`:** Move standing files from storage repo root to donna/ subfolder.
25
+
26
+ Run via Bash:
27
+ ```bash
28
+ STORAGE_REPO="<storage_repo>"
29
+ DONNA_DIR="$STORAGE_REPO/donna"
30
+ MOVED=0
31
+
32
+ mkdir -p "$DONNA_DIR"
33
+ for FILE in role.md recurring.md role-research.md; do
34
+ if [ -f "$STORAGE_REPO/$FILE" ] && [ ! -f "$DONNA_DIR/$FILE" ]; then
35
+ mv "$STORAGE_REPO/$FILE" "$DONNA_DIR/$FILE"
36
+ echo "Moved $FILE to donna/$FILE"
37
+ MOVED=$((MOVED + 1))
38
+ fi
39
+ done
40
+
41
+ echo "MOVED=$MOVED"
42
+ ```
43
+
44
+ If MOVED > 0, commit the move:
45
+ ```bash
46
+ git -C <storage_repo> add -A
47
+ git -C <storage_repo> diff --cached --quiet || git -C <storage_repo> commit -m "donna(migrate): move standing files to donna/ subfolder"
48
+ ```
49
+
50
+ If `auto_push` is true in config, also push.
51
+
52
+ After processing all pending migrations, update `~/.donna/state.md` with the Write tool: remove the completed entries from `pending_migrations`. If no entries remain, write:
53
+ ```markdown
54
+ ---
55
+ pending_migrations: []
56
+ ---
57
+ ```
58
+ </step>
59
+
60
+ <step name="check-existing-role">
61
+ Run via Bash:
62
+ ```bash
63
+ test -f <storage_repo>/donna/role.md && echo "exists" || echo "missing"
64
+ ```
65
+
66
+ If the output is "exists", proceed to the rerun-menu step.
67
+ If the output is "missing", proceed to the ask-role step.
68
+ </step>
69
+
70
+ <step name="rerun-menu">
71
+ Use AskUserQuestion to present the re-run menu:
72
+
73
+ ```
74
+ A role definition already exists. What would you like to do?
75
+
76
+ 1. Something got messed up — start fresh (reset)
77
+ 2. Got promoted or changed roles — update (diff-update)
78
+ 3. Just want to refresh the research — re-research current role
79
+ 4. Cancel
80
+ ```
81
+
82
+ - On "reset" (option 1): proceed to ask-role (fresh start, will overwrite role.md and recurring.md).
83
+ - On "diff-update" (option 2): read current `<storage_repo>/donna/role.md` with the Read tool, proceed to ask-role but pre-fill with current values and note this is an update. After research, show delta (added/removed recurring tasks vs current `<storage_repo>/donna/recurring.md`). Preserve any manually-added recurring tasks (tasks in recurring.md not in the research suggestions).
84
+ - On "re-research" (option 3): read current `<storage_repo>/donna/role.md` with the Read tool to get the existing role data, skip to the research step.
85
+ - On "Cancel" (option 4): print "Cancelled." and stop.
86
+ </step>
87
+
88
+ <step name="ask-role">
89
+ Stage 1: Collect role details interactively.
90
+
91
+ Use AskUserQuestion to ask the following questions in sequence:
92
+
93
+ 1. "What is your job title?" — store as `<job_title>`.
94
+ 2. "How large is your team? How many direct reports do you have? (e.g. team of 8, 3 direct reports)" — store as `<team_info>`.
95
+ 3. "What are 2–3 things you focus on most in your role? (e.g. sprint planning, hiring, technical architecture)" — store as `<key_responsibilities>`.
96
+
97
+ Parse `<team_info>` into `<team_size>` (total team) and `<direct_reports>` (direct reports count) as best you can.
98
+ Parse `<key_responsibilities>` into an array of 2–3 items.
99
+
100
+ Store all values for use in subsequent steps.
101
+ </step>
102
+
103
+ <step name="research">
104
+ Stage 2: Research the role using WebSearch.
105
+
106
+ Construct targeted queries using ALL collected data from Stage 1. Run 2–3 focused searches:
107
+
108
+ 1. `<job_title> daily recurring tasks responsibilities`
109
+ 2. `<job_title> <key_responsibilities[0]> common tools workflows`
110
+ 3. (optional) `<job_title> weekly monthly recurring tasks best practices`
111
+
112
+ Use WebSearch for each query. Synthesize findings into a structured summary matching the role-research.md format:
113
+
114
+ - **Daily tasks**: recurring things done every workday
115
+ - **Weekly tasks**: recurring things done each week
116
+ - **Monthly tasks**: recurring things done each month
117
+ - **Tool suggestions**: tools commonly used for this role (with brief descriptions)
118
+
119
+ Tailor suggestions to the specific responsibilities the user described — avoid generic results that don't reflect their actual focus areas.
120
+ </step>
121
+
122
+ <step name="present-summary">
123
+ Print a concise summary of research findings (2–3 sentences covering the key patterns found).
124
+
125
+ Then use AskUserQuestion:
126
+ ```
127
+ Which category would you like to review?
128
+ 1. Recurring tasks
129
+ 2. Tool suggestions
130
+ 3. Both
131
+ 4. Skip (accept all recurring tasks as-is)
132
+ ```
133
+
134
+ Store the choice for subsequent steps.
135
+ </step>
136
+
137
+ <step name="approve-recurring">
138
+ If the user chose to review recurring tasks (options 1 or 3):
139
+
140
+ Display each category in turn (daily, weekly, monthly) and use AskUserQuestion for each task:
141
+ ```
142
+ [Daily] Check team Slack and unblock blockers
143
+ → Approve, reject, or modify? (approve / reject / [type modification)
144
+ ```
145
+
146
+ Interpret modifications naturally:
147
+ - "make this biweekly" → change interval to "every other week"
148
+ - "every other Monday" → interval becomes "every other Monday"
149
+ - "first Monday of the month" → interval becomes "first Monday of month"
150
+
151
+ After reviewing all categories, ask: "Would you like to add any recurring tasks I missed?" Accept free-text additions.
152
+
153
+ Collect the final approved list with their intervals.
154
+
155
+ If the user chose to skip (option 4): accept all suggested recurring tasks with their default intervals.
156
+ </step>
157
+
158
+ <step name="approve-tools">
159
+ If the user chose to review tool suggestions (options 2 or 3):
160
+
161
+ Display each tool suggestion and use AskUserQuestion:
162
+ ```
163
+ Tool: Jira (sprint management)
164
+ → Note this for future configuration? (yes / no)
165
+ ```
166
+
167
+ For noted tools, print:
168
+ ```
169
+ ✓ Noted: <tool name>. Run /donna:add-tool to configure <tool name> (available in a future update).
170
+ ```
171
+
172
+ Do NOT create tools.md or configure anything — only note the user's interest.
173
+ </step>
174
+
175
+ <step name="save-role">
176
+ Write `<storage_repo>/donna/role.md` with the Write tool.
177
+
178
+ Use this format (substituting actual values):
179
+ ```markdown
180
+ ---
181
+ job_title: <job_title>
182
+ team_size: <team_size>
183
+ direct_reports: <direct_reports>
184
+ key_responsibilities:
185
+ - <responsibility 1>
186
+ - <responsibility 2>
187
+ updated: <today's date in YYYY-MM-DD format>
188
+ ---
189
+
190
+ # Role: <job_title>
191
+
192
+ [Write a 2–3 sentence prose summary of the role as described by the user, incorporating their key responsibilities and team context.]
193
+ ```
194
+
195
+ Write `<storage_repo>/donna/role-research.md` with the Write tool.
196
+
197
+ Use this format:
198
+ ```markdown
199
+ ---
200
+ researched: <today's date in YYYY-MM-DD format>
201
+ role: <job_title>
202
+ ---
203
+
204
+ # Role Research: <job_title>
205
+
206
+ ## Summary
207
+ [2–3 sentence overview of what the research found for this role]
208
+
209
+ ## Recurring Task Suggestions
210
+
211
+ ### Daily
212
+ [List daily task suggestions from research]
213
+
214
+ ### Weekly
215
+ [List weekly task suggestions from research]
216
+
217
+ ### Monthly
218
+ [List monthly task suggestions from research]
219
+
220
+ ## Tool Suggestions
221
+ [List tool suggestions with brief descriptions]
222
+
223
+ ## Notes
224
+ [Any additional context from research relevant to this specific role]
225
+ ```
226
+ </step>
227
+
228
+ <step name="save-recurring">
229
+ Write `<storage_repo>/donna/recurring.md` with the Write tool.
230
+
231
+ Format: one approved recurring task per line as `- Task description: interval`.
232
+ For "every other" intervals (biweekly, every other Monday, etc.), append ` | last_run: <today's date>` suffix.
233
+
234
+ Use this format:
235
+ ```markdown
236
+ ---
237
+ # Recurring tasks — managed by donna:set-role
238
+ ---
239
+
240
+ - <task 1>: <interval 1>
241
+ - <task 2>: <interval 2>
242
+ - <task 3>: <interval 3> | last_run: <today's date>
243
+ ```
244
+
245
+ If this is a diff-update (user chose option 2 in rerun-menu):
246
+ 1. Read the existing `<storage_repo>/donna/recurring.md` with the Read tool.
247
+ 2. Identify manually-added tasks: tasks in recurring.md that were NOT in the research suggestions.
248
+ 3. Merge: keep manually-added tasks, add new approved tasks, remove tasks the user rejected.
249
+ 4. Write the merged result.
250
+ </step>
251
+
252
+ <step name="git-commit">
253
+ Run via Bash:
254
+ ```bash
255
+ git -C <storage_repo> add -A
256
+ ```
257
+
258
+ Check whether there is anything to commit:
259
+ ```bash
260
+ git -C <storage_repo> status --porcelain
261
+ ```
262
+
263
+ If the output is empty, skip the commit and continue.
264
+
265
+ Otherwise, run:
266
+ ```bash
267
+ git -C <storage_repo> commit -m "donna(set-role): define role as <job_title>"
268
+ ```
269
+
270
+ If `auto_push` is true in config, also run:
271
+ ```bash
272
+ git -C <storage_repo> push
273
+ ```
274
+ </step>
275
+
276
+ <step name="confirm">
277
+ Print:
278
+ ```
279
+ ✓ Role defined: <job_title>
280
+ ✓ <N> recurring tasks saved to recurring.md
281
+ ✓ Research saved to role-research.md
282
+ ```
283
+
284
+ If any tools were noted during approve-tools, remind:
285
+ ```
286
+ → Run /donna:add-tool to configure your noted tools (available in a future update).
287
+ ```
288
+ </step>
@@ -1,42 +1,185 @@
1
1
  # Donna Setup Workflow
2
2
 
3
3
  <objective>
4
- Display the Donna installation status and confirm the stub-to-workflow pipeline is working.
4
+ Guide the user through configuring Donna: set the storage repo path, initialize the file structure, and write the bootstrap config at ~/.config/donna/config.md.
5
5
  </objective>
6
6
 
7
7
  <step name="banner">
8
- Print the DONNA banner:
8
+ Print the Donna banner:
9
9
  ```
10
- ━━━ DONNA ▸ Setup ━━━
10
+ ━━━ Donna ▸ Setup ━━━
11
11
  ```
12
12
  </step>
13
13
 
14
- <step name="version">
15
- Read `~/.donna/version.md` and display the installed version. If the file exists, show:
14
+ <step name="check-existing-config">
15
+ Read `~/.config/donna/config.md`.
16
+
17
+ If the file exists, proceed to the re-run menu (step: rerun-menu).
18
+ If the file does not exist, proceed to first-run setup (step: ask-storage-path).
19
+ </step>
20
+
21
+ <step name="rerun-menu">
22
+ An existing Donna configuration was found. Use AskUserQuestion to present the user with this menu:
23
+
24
+ ```
25
+ Donna is already configured. What would you like to do?
26
+
27
+ 1. Change storage repo path
28
+ 2. View current config
29
+ 3. Reset (start over — deletes config and re-runs full setup)
30
+ 4. Cancel
31
+ ```
32
+
33
+ Handle each option:
34
+
35
+ - **Option 1:** Ask the user for the new storage repo path using AskUserQuestion. Validate and expand the path (run `echo <path>` via Bash to expand ~). Update `~/.config/donna/config.md` with the new storage_repo value. Print `✓ Storage repo updated.` then print the summary (step: summary).
36
+
37
+ - **Option 2:** Display the contents of `~/.config/donna/config.md`. Then stop.
38
+
39
+ - **Option 3:** Run `rm ~/.config/donna/config.md` via Bash to delete the config. Proceed to first-run setup (step: ask-storage-path).
40
+
41
+ - **Option 4:** Print `Setup cancelled.` and stop.
42
+ </step>
43
+
44
+ <step name="ask-storage-path">
45
+ Use AskUserQuestion to ask the user:
46
+
47
+ ```
48
+ Where is your Donna storage repo?
49
+
50
+ This is a local git repository where Donna stores your daily journal, tasks, and configuration. You can point to an existing git repo, an empty directory (Donna will initialize it), or a path that doesn't exist yet (Donna will create it).
51
+
52
+ Enter the path (e.g. ~/Documents/donna-notes):
53
+ ```
54
+
55
+ Wait for the user's response. Store the path as `<storage_path>`.
56
+ </step>
57
+
58
+ <step name="expand-and-validate-path">
59
+ Expand the path provided by the user:
60
+
61
+ Run via Bash:
62
+ ```bash
63
+ echo <storage_path>
64
+ ```
65
+
66
+ Use the expanded absolute path for all subsequent steps. Store as `<repo>`.
67
+
68
+ Then check the path status:
69
+
70
+ - If `<repo>` is an existing git repo (test: `git -C <repo> rev-parse --is-inside-work-tree 2>/dev/null`): use it as-is. Print `✓ Using existing git repo at <repo>`.
71
+
72
+ - If `<repo>` exists as a directory but is not a git repo: run `git -C <repo> init`. Print `✓ Initialized git repo at <repo>`.
73
+
74
+ - If `<repo>` does not exist: run `mkdir -p <repo>` then `git -C <repo> init`. Print `✓ Created and initialized git repo at <repo>`.
75
+ </step>
76
+
77
+ <step name="detect-daily-folder">
78
+ Determine where daily files should live.
79
+
80
+ **If `<repo>/.obsidian/daily-notes.json` exists:**
81
+ Read it. If it has a `folder` field, use that value as `<daily_folder>`. Print:
82
+ ```
83
+ ✓ Found Obsidian daily notes folder: <daily_folder>
16
84
  ```
17
- Version: {version}
18
- Installed: {installed date}
19
- Last updated: {updated date}
85
+
86
+ **If `<repo>/.obsidian/` exists but `.obsidian/daily-notes.json` does not exist or has no `folder` field:**
87
+ Set `<daily_folder>` to `daily`. Write `<repo>/.obsidian/daily-notes.json` with:
88
+ ```json
89
+ {
90
+ "folder": "daily"
91
+ }
92
+ ```
93
+ Print:
20
94
  ```
21
- If the file does not exist, show:
95
+ Configured Obsidian daily notes to use daily/
22
96
  ```
23
- No version file found. Donna may not be installed correctly.
24
- Try running: npx @pingvinen/donna-assistant
97
+
98
+ **If `<repo>/.obsidian/` does not exist:**
99
+ Set `<daily_folder>` to `daily`. Print:
100
+ ```
101
+ ✓ Using daily/ for daily files
25
102
  ```
26
103
  </step>
27
104
 
28
- <step name="status">
29
- Print the following message:
105
+ <step name="create-storage-structure">
106
+ Create the daily and donna directories:
107
+
108
+ Run via Bash:
109
+ ```bash
110
+ mkdir -p <repo>/<daily_folder>
111
+ mkdir -p <repo>/donna
30
112
  ```
31
- This is a stub -- real setup coming in Phase 2.
113
+
114
+ Print:
115
+ ```
116
+ ✓ Created <daily_folder>/ and donna/ directories
32
117
  ```
33
118
  </step>
34
119
 
35
- <step name="next">
36
- Print next steps:
120
+ <step name="write-bootstrap-config">
121
+ Create the config directory if it does not exist:
122
+
123
+ Run via Bash:
124
+ ```bash
125
+ mkdir -p ~/.config/donna
37
126
  ```
127
+
128
+ Write `~/.config/donna/config.md` with the following content (substituting the actual expanded path for `<repo>`):
129
+
130
+ ```markdown
131
+ ---
132
+ storage_repo: <repo>
133
+ daily_folder: <daily_folder>
134
+ auto_push: false
135
+ ---
136
+
137
+ # Donna Configuration
138
+
139
+ This file is managed by `/donna:setup`. All Donna skills read this file to find your storage repo.
140
+ ```
141
+
142
+ Print:
143
+ ```
144
+ ✓ Wrote config at ~/.config/donna/config.md
145
+ ```
146
+ </step>
147
+
148
+ <step name="initial-commit">
149
+ Check whether there is anything to commit:
150
+
151
+ Run via Bash:
152
+ ```bash
153
+ git -C <repo> status --porcelain
154
+ ```
155
+
156
+ If the output is non-empty (there are changes to commit):
157
+
158
+ Run:
159
+ ```bash
160
+ git -C <repo> add -A
161
+ git -C <repo> commit -m "donna(setup): initialize storage"
162
+ ```
163
+
164
+ Print:
165
+ ```
166
+ ✓ Committed initial structure
167
+ ```
168
+
169
+ If the output is empty (nothing to commit), skip the commit and continue.
170
+ </step>
171
+
172
+ <step name="summary">
173
+ Print the completion summary:
174
+
175
+ ```
176
+ ✓ Donna is ready!
177
+
178
+ Storage repo: <repo>
179
+ Config: ~/.config/donna/config.md
180
+
38
181
  Next steps:
39
- - Run /donna:setup again after upgrading to see new features
40
- - Phase 2 will add role configuration, storage setup, and more
182
+ - Run /donna:add-task to capture your first task
183
+ - Run /donna:done to mark tasks complete
41
184
  ```
42
185
  </step>