@pi-unipi/workflow 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+ ---
2
+ name: brainstorm
3
+ description: "Collaborative discovery — explore problem space, evaluate approaches, write design spec. Use before any creative work."
4
+ ---
5
+
6
+ # Brainstorming Ideas Into Designs
7
+
8
+ Turn ideas into fully formed designs through collaborative dialogue.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** research (read-only), discuss, ask questions, write the brainstorm document.
13
+ **This skill MAY NOT:** edit code, create files beyond the brainstorm document, run tests, deploy, implement anything.
14
+
15
+ **NEVER write code during this skill. This is a discussion, not implementation.**
16
+
17
+ ## Command Format
18
+
19
+ ```
20
+ /unipi:brainstorm <string(greedy)>
21
+ ```
22
+
23
+ - `string(greedy)` — the topic or problem to brainstorm about
24
+ - No worktree args — brainstorm runs in current session on current branch
25
+ - No visual companion — text-only brainstorming
26
+
27
+ ## Hard Gate
28
+
29
+ Do NOT write any code, scaffold any project, or take any implementation action until design is presented and user approved. This applies to EVERY project regardless of perceived simplicity.
30
+
31
+ ## Anti-Pattern: "Too Simple For Design"
32
+
33
+ Every project goes through this process. A todo list, a utility, a config change — all of them. "Simple" projects are where unexamined assumptions cause wasted work. Design can be short, but MUST present and get approval.
34
+
35
+ ## Output Path
36
+
37
+ ```
38
+ .unipi/docs/specs/YYYY-MM-DD-<topic>-design.md
39
+ ```
40
+
41
+ Committed to current branch. Accessible across worktrees via git.
42
+
43
+ ---
44
+
45
+ ## Phase 1: Explore Project Context
46
+
47
+ 1. Check files, docs, recent commits to understand current state
48
+ 2. Assess scope: if request describes multiple independent subsystems, flag immediately
49
+ 3. If too large for single spec, help decompose into sub-projects
50
+
51
+ **Exit:** Context gathered. Ready to ask questions.
52
+
53
+ ---
54
+
55
+ ## Phase 2: Ask Clarifying Questions
56
+
57
+ Ask **one question at a time**. Don't dump a questionnaire.
58
+
59
+ Start with:
60
+ 1. "What problem are we actually solving?" — strip assumptions, get root need
61
+ 2. "Who has this problem and when?" — context changes solutions
62
+ 3. "What does success look like?" — outcomes, not features
63
+
64
+ Prefer multiple choice when natural options exist. Validate assumptions explicitly.
65
+
66
+ **Exit:** Problem statement clear and reframed. Both agree on what solving.
67
+
68
+ ---
69
+
70
+ ## Phase 3: Propose Approaches
71
+
72
+ Propose 2-3 different approaches with trade-offs:
73
+ - What each optimizes for (speed, flexibility, simplicity)
74
+ - What each costs (complexity, maintenance, time, risk)
75
+ - Prior art in codebase or industry
76
+
77
+ Present conversationally with recommendation and reasoning.
78
+
79
+ **If open questions emerge:** MUST ask user about each one. Don't assume.
80
+
81
+ **Exit:** Approach chosen. User signals decision.
82
+
83
+ ---
84
+
85
+ ## Phase 4: Present Design
86
+
87
+ Once approach chosen, present design in sections:
88
+ - Scale each section to complexity (few sentences if straightforward, 200-300 words if nuanced)
89
+ - Ask after each section whether it looks right
90
+ - Cover: architecture, components, data flow, error handling, testing
91
+ - Be ready to go back and clarify
92
+
93
+ **Design for isolation and clarity:**
94
+ - Break into smaller units with one clear purpose
95
+ - Each unit communicates through well-defined interfaces
96
+ - Can someone understand unit without reading internals?
97
+
98
+ **Exit:** Design approved by user.
99
+
100
+ ---
101
+
102
+ ## Phase 5: Write Design Document
103
+
104
+ Write to `.unipi/docs/specs/YYYY-MM-DD-<topic>-design.md`:
105
+
106
+ ```markdown
107
+ ---
108
+ title: "{Topic}"
109
+ type: brainstorm
110
+ date: YYYY-MM-DD
111
+ ---
112
+
113
+ # {Topic}
114
+
115
+ ## Problem Statement
116
+ {The actual problem, reframed}
117
+
118
+ ## Context
119
+ {Key findings — what exists, what's been tried}
120
+
121
+ ## Chosen Approach
122
+ {High-level description}
123
+
124
+ ## Why This Approach
125
+ {Decision rationale, alternatives rejected}
126
+
127
+ ## Design
128
+ {Architecture, components, data flow}
129
+
130
+ ## Implementation Checklist
131
+ - [ ] Task 1 — description
132
+ - [ ] Task 2 — description
133
+ - [ ] Task 3 — description
134
+
135
+ ## Open Questions
136
+ {Questions for planning phase}
137
+
138
+ ## Out of Scope
139
+ {Explicitly excluded}
140
+ ```
141
+
142
+ ### Checklist Items
143
+
144
+ The `## Implementation Checklist` section uses `- [ ]` markdown checkboxes. These are critical:
145
+
146
+ - **`[ ]` = unplanned** — not yet covered by a plan
147
+ - **`[x]` = planned** — marked when `/unipi:plan` covers this item
148
+ - Agent MUST fill in checklist items based on the design
149
+ - Each item should be a discrete, implementable task
150
+ - Items should be ordered by dependency (earlier items don't depend on later ones)
151
+
152
+ ---
153
+
154
+ ## Phase 6: Spec Self-Review
155
+
156
+ After writing, review with fresh eyes:
157
+
158
+ 1. **Placeholder scan:** Any "TBD", "TODO", incomplete sections? Fix them.
159
+ 2. **Internal consistency:** Do sections contradict each other?
160
+ 3. **Scope check:** Focused enough for single implementation plan?
161
+ 4. **Ambiguity check:** Could any requirement be interpreted two ways? Pick one.
162
+
163
+ Fix issues inline. No need to re-review — fix and move on.
164
+
165
+ ---
166
+
167
+ ## Phase 7: User Review Gate
168
+
169
+ After self-review passes:
170
+
171
+ > "Spec written and committed to `.unipi/docs/specs/YYYY-MM-DD-<topic>-design.md`. Please review and let me know if you want changes before we plan."
172
+
173
+ Wait for user response. If changes requested, make them and re-run self-review.
174
+
175
+ ---
176
+
177
+ ## Phase 8: Handoff
178
+
179
+ Ask user what to do next:
180
+
181
+ 1. **Proceed to /unipi:plan** — Turn decisions into implementation plan
182
+ 2. **Keep exploring** — More questions or refine decisions
183
+ 3. **Done for now** — Return later
184
+
185
+ If user selects "Proceed to /unipi:plan", suggest:
186
+ ```
187
+ /unipi:plan specs:YYYY-MM-DD-<topic>-design
188
+ ```
189
+
190
+ ---
191
+
192
+ ## Validate
193
+
194
+ Before delivering, verify:
195
+
196
+ - [ ] Problem was reframed — not accepted at face value
197
+ - [ ] At least 2 approaches explored with tradeoffs
198
+ - [ ] Every decision has rationale and rejected alternatives documented
199
+ - [ ] Implementation checklist has concrete, discrete tasks with `[ ]` markers
200
+ - [ ] Open questions listed — nothing swept under rug
201
+ - [ ] No code was written — only brainstorm document created
202
+ - [ ] `/unipi:plan` can start from this document without asking "what did you decide about X?"
@@ -0,0 +1,142 @@
1
+ ---
2
+ name: consolidate
3
+ description: "Consolidate — save learnings to memory, craft skills if reusable. Use at end of work session or to summarize current state."
4
+ ---
5
+
6
+ # Consolidating Learnings
7
+
8
+ Capture what was learned, update memory, and craft skills when patterns emerge.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** read/write `.unipi/memory/`, read session context, read plans/specs, write skill files if user approves.
13
+ **This skill MAY NOT:** edit production code, run tests, deploy.
14
+
15
+ ## Command Format
16
+
17
+ ```
18
+ /unipi:consolidate <string(greedy)>(optional)
19
+ ```
20
+
21
+ - `string(greedy)` — optional focus (e.g., "focus on auth patterns" or "summarize what we learned about testing")
22
+ - Two modes: **end-of-work** (memory + registry hooks) or **start/middle** (read context, consolidate ideas)
23
+
24
+ ---
25
+
26
+ ## Mode 1: End of Work Session
27
+
28
+ Triggered when run after `/unipi:review-work` marks work as done.
29
+
30
+ ### Phase 1: Gather Learnings
31
+
32
+ 1. Read session context — what was discussed, decided, built
33
+ 2. Read the plan and spec — what was the goal, what was achieved
34
+ 3. Identify key learnings:
35
+ - Patterns discovered
36
+ - Decisions made and why
37
+ - Problems encountered and solutions
38
+ - Things that would be done differently
39
+ - Reusable approaches
40
+
41
+ **Exit:** Learnings identified.
42
+
43
+ ### Phase 2: Update Memory
44
+
45
+ 1. Check if `@unipi/memory` extension is installed
46
+ 2. If not installed → skip memory, note to user
47
+ 3. If installed:
48
+ - Read existing `.unipi/memory/` files
49
+ - Find relevant memory files (by topic, date, or tag)
50
+ - **Update in place** — don't always create new files
51
+ - Merge new learnings with existing knowledge
52
+ - Prevent stale data by updating, not appending
53
+
54
+ **Memory file format:**
55
+ ```markdown
56
+ ---
57
+ topic: {topic}
58
+ updated: YYYY-MM-DD
59
+ tags: [tag1, tag2]
60
+ ---
61
+
62
+ # {Topic}
63
+
64
+ ## Key Learnings
65
+ - {Learning 1}
66
+ - {Learning 2}
67
+
68
+ ## Patterns
69
+ - {Pattern description}
70
+
71
+ ## Decisions
72
+ - {Decision} — {Rationale}
73
+ ```
74
+
75
+ **Exit:** Memory updated.
76
+
77
+ ### Phase 3: Skill Crafting
78
+
79
+ 1. Check if `@unipi/registry` extension is installed
80
+ 2. If not installed → skip, note to user
81
+ 3. If installed, assess if learnings are reusable:
82
+
83
+ **Auto-create skill if:**
84
+ - Pattern will definitely be used in future runs
85
+ - Solution applies to recurring problem
86
+ - Workflow could be standardized
87
+
88
+ **Ask user if uncertain:**
89
+ > "I discovered a pattern that might be worth capturing as a skill: {description}. Should I create a skill for this?"
90
+
91
+ **Skip if:**
92
+ - One-off solution, unlikely to recur
93
+ - Too specific to current context
94
+ - User declines
95
+
96
+ **Exit:** Skill created or skipped.
97
+
98
+ ### Phase 4: Summary
99
+
100
+ Report to user:
101
+ - What was saved to memory
102
+ - What skills were created (if any)
103
+ - Suggest next steps if any work remains
104
+
105
+ ---
106
+
107
+ ## Mode 2: Start / Middle of Session
108
+
109
+ Triggered when run without prior work session context.
110
+
111
+ ### Phase 1: Read Context
112
+
113
+ 1. Read session conversation so far
114
+ 2. OR read latest brainstorm/spec/plan
115
+ 3. Understand current state — what's been discussed, what's decided
116
+
117
+ ### Phase 2: Consolidate Ideas
118
+
119
+ 1. Summarize key points from context
120
+ 2. Identify open questions
121
+ 3. Identify decisions made
122
+ 4. Identify next steps
123
+
124
+ ### Phase 3: Write Summary
125
+
126
+ Write consolidation to `.unipi/memory/` — same format as Mode 1.
127
+
128
+ ### Phase 4: Present
129
+
130
+ Present summary to user. Ask:
131
+ 1. **Continue to brainstorm** — if ideas need formalizing
132
+ 2. **Continue to plan** — if decisions are clear
133
+ 3. **Done** — summary captured, return later
134
+
135
+ ---
136
+
137
+ ## Notes
138
+
139
+ - Memory files are living documents — update, don't always create new
140
+ - Skill creation is opportunistic — only when pattern is clearly reusable
141
+ - Both modes write to `.unipi/memory/` — consistent location
142
+ - Respects extension availability — graceful degradation if extensions not installed
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: consultant
3
+ description: "Expert consultation — advisory with framework-based analysis. Read-only. Use when you need expert advice before brainstorming."
4
+ ---
5
+
6
+ # Expert Consultation
7
+
8
+ Provide expert advisory using structured frameworks. Analyze problems, evaluate options, give recommendations.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** read codebase, research, analyze, discuss, provide recommendations.
13
+ **This skill MAY NOT:** edit code, create files, run tests, implement anything.
14
+
15
+ **This is advisory only — no implementation.**
16
+
17
+ ## Command Format
18
+
19
+ ```
20
+ /unipi:consultant <string(greedy)>
21
+ ```
22
+
23
+ - `string(greedy)` — the question, problem, or topic to consult on
24
+ - Read-only sandbox — agent analyzes and advises, doesn't touch code
25
+
26
+ ---
27
+
28
+ ## Frameworks
29
+
30
+ Apply relevant framework based on the question type:
31
+
32
+ ### Architecture Questions
33
+ - **Decision Matrix** — evaluate options against weighted criteria
34
+ - **ADR format** — document architectural decisions with context and consequences
35
+ - **C4 Model** — system context, containers, components, code
36
+
37
+ ### Code Quality Questions
38
+ - **SOLID principles** — assess adherence
39
+ - **Code smells** — identify and prioritize
40
+ - **Tech debt quadrant** — reckless vs prudent, deliberate vs inadvertent
41
+
42
+ ### Strategy Questions
43
+ - **SWOT analysis** — strengths, weaknesses, opportunities, threats
44
+ - **Cost-benefit** — quantify trade-offs
45
+ - **Risk matrix** — likelihood vs impact
46
+
47
+ ### Debugging Questions
48
+ - **5 Whys** — root cause analysis
49
+ - **Fishbone diagram** — categorize potential causes
50
+ - **Binary search** — narrow down systematically
51
+
52
+ ---
53
+
54
+ ## Process
55
+
56
+ ### Phase 1: Understand the Question
57
+
58
+ 1. Read the question carefully
59
+ 2. If ambiguous, ask clarifying question (one at a time)
60
+ 3. Determine which framework applies
61
+ 4. Read relevant codebase context if needed
62
+
63
+ ### Phase 2: Analyze
64
+
65
+ 1. Apply the relevant framework
66
+ 2. Research codebase for evidence
67
+ 3. Consider multiple perspectives
68
+ 4. Form recommendations
69
+
70
+ ### Phase 3: Advise
71
+
72
+ Present analysis with:
73
+ - **Framework used** — so user knows the lens
74
+ - **Key findings** — what I discovered
75
+ - **Recommendation** — what I'd do and why
76
+ - **Alternatives** — what else was considered
77
+ - **Risks** — what could go wrong
78
+
79
+ ### Phase 4: Handoff
80
+
81
+ After advising:
82
+
83
+ > "If you'd like to explore this further, I can help you brainstorm solutions."
84
+ ```
85
+ /unipi:brainstorm <topic>
86
+ ```
87
+
88
+ Or if user has more questions, continue consulting.
89
+
90
+ ---
91
+
92
+ ## Notes
93
+
94
+ - This is read-only advisory — no code changes
95
+ - Frameworks are tools, not rules — adapt to context
96
+ - Recommendations are starting points for discussion, not final answers
97
+ - Natural lead-in to brainstorm when user wants to act on advice
@@ -0,0 +1,120 @@
1
+ ---
2
+ name: document
3
+ description: "Generate documentation — README, API docs, guides. Use when you need to document code or features."
4
+ ---
5
+
6
+ # Generating Documentation
7
+
8
+ Create documentation for code, features, or the project. Works with gather-context for thorough docs.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** read codebase, run read-only commands, write docs to `.unipi/docs/generated/`.
13
+ **This skill MAY NOT:** edit source code, run tests, implement features.
14
+
15
+ ## Command Format
16
+
17
+ ```
18
+ /unipi:document <string(greedy)>(optional)
19
+ ```
20
+
21
+ - `string(greedy)` — optional scope (e.g., "document the auth module", "write API docs for /api/users")
22
+ - If not provided → agent asks what to document
23
+ - Output: `.unipi/docs/generated/` in markdown
24
+
25
+ ---
26
+
27
+ ## Process
28
+
29
+ ### Phase 1: Determine Scope
30
+
31
+ **If scope provided:**
32
+ 1. Parse what to document
33
+ 2. Confirm with user: "I'll document {scope}. Sound right?"
34
+
35
+ **If no scope:**
36
+ 1. Ask user what to document:
37
+ - "What should I document? (e.g., specific module, feature, or entire project)"
38
+ 2. Ask doc type:
39
+ - "What type of documentation? (README, API docs, guide, architecture doc)"
40
+
41
+ **Exit:** Scope and type confirmed.
42
+
43
+ ### Phase 2: Gather Context
44
+
45
+ 1. Read relevant source code
46
+ 2. Check for existing documentation
47
+ 3. Identify gaps
48
+ 4. Use gather-context patterns if needed:
49
+ - Find related files
50
+ - Check git history for context
51
+ - Look for comments and docstrings
52
+
53
+ **Exit:** Context gathered. Ready to write.
54
+
55
+ ### Phase 3: Generate Documentation
56
+
57
+ Based on doc type:
58
+
59
+ **README:**
60
+ - Project overview
61
+ - Installation
62
+ - Usage examples
63
+ - Configuration
64
+ - Contributing
65
+
66
+ **API docs:**
67
+ - Endpoints/routes
68
+ - Request/response formats
69
+ - Authentication
70
+ - Error codes
71
+ - Examples
72
+
73
+ **Guides:**
74
+ - Step-by-step instructions
75
+ - Code examples
76
+ - Common patterns
77
+ - Troubleshooting
78
+
79
+ **Architecture doc:**
80
+ - System overview
81
+ - Module responsibilities
82
+ - Data flow
83
+ - Key decisions
84
+
85
+ ### Phase 4: Write
86
+
87
+ Write to `.unipi/docs/generated/YYYY-MM-DD-<topic>.md`:
88
+
89
+ ```markdown
90
+ ---
91
+ title: "{Title}"
92
+ type: documentation
93
+ date: YYYY-MM-DD
94
+ scope: {what was documented}
95
+ ---
96
+
97
+ # {Title}
98
+
99
+ {Content based on doc type}
100
+ ```
101
+
102
+ ### Phase 5: Present
103
+
104
+ Show summary to user:
105
+ > "Documentation written to `.unipi/docs/generated/YYYY-MM-DD-<topic>.md`"
106
+ > "Covers: {summary of what's documented}"
107
+
108
+ Ask:
109
+ 1. **Review it** — read and suggest changes
110
+ 2. **Add more** — extend documentation
111
+ 3. **Done** — documentation complete
112
+
113
+ ---
114
+
115
+ ## Notes
116
+
117
+ - Output in markdown — portable, readable, diffable
118
+ - `.unipi/docs/generated/` keeps docs separate from workflow artifacts
119
+ - Can document code, features, architecture, or processes
120
+ - Natural extension of gather-context — research then document
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: gather-context
3
+ description: "Research codebase — surface patterns, find prior art, prepare for brainstorm. Spawns subagents if available."
4
+ ---
5
+
6
+ # Gathering Context
7
+
8
+ Research the codebase thoroughly to prepare for brainstorming. Find patterns, prior art, and relevant context.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** read codebase, run read-only commands (find, grep, ls), spawn subagents, write findings.
13
+ **This skill MAY NOT:** edit code, implement features, run tests that modify state.
14
+
15
+ ## Command Format
16
+
17
+ ```
18
+ /unipi:gather-context <string(greedy)>
19
+ ```
20
+
21
+ - `string(greedy)` — what to research (e.g., "authentication patterns", "how we handle errors", "database layer")
22
+ - Read-only sandbox
23
+ - Spawns subagents if `@unipi/subagents` extension is installed
24
+
25
+ ---
26
+
27
+ ## Process
28
+
29
+ ### Phase 1: Parse Research Request
30
+
31
+ 1. Read the research topic
32
+ 2. Break into sub-topics if needed
33
+ 3. Determine research strategy:
34
+ - File search (find files related to topic)
35
+ - Pattern search (grep for patterns, conventions)
36
+ - Structure analysis (directory layout, module organization)
37
+ - History analysis (git log for related changes)
38
+
39
+ **Exit:** Research plan ready.
40
+
41
+ ### Phase 2: Gather Context
42
+
43
+ If subagents available:
44
+ 1. Spawn parallel subagents for different sub-topics
45
+ 2. Each subagent researches independently
46
+ 3. Collect findings from all subagents
47
+
48
+ If no subagents:
49
+ 1. Research sequentially
50
+ 2. Use find, grep, read commands
51
+ 3. Build context incrementally
52
+
53
+ **Research areas:**
54
+
55
+ **Code structure:**
56
+ - Directory layout
57
+ - Module organization
58
+ - Key files and their purposes
59
+ - Entry points
60
+
61
+ **Patterns & conventions:**
62
+ - Naming conventions
63
+ - Import patterns
64
+ - Error handling patterns
65
+ - Testing patterns
66
+
67
+ **Prior art:**
68
+ - Similar features that exist
69
+ - Past approaches (from git history)
70
+ - Reusable components
71
+ - Known issues or tech debt
72
+
73
+ **Dependencies:**
74
+ - External libraries used
75
+ - Internal module dependencies
76
+ - Configuration files
77
+
78
+ **Exit:** Context gathered from all areas.
79
+
80
+ ### Phase 3: Synthesize
81
+
82
+ Organize findings into clear categories:
83
+
84
+ ```markdown
85
+ ## Key Findings
86
+
87
+ ### Structure
88
+ - {Finding about project structure}
89
+
90
+ ### Patterns
91
+ - {Finding about patterns used}
92
+
93
+ ### Prior Art
94
+ - {Finding about existing similar work}
95
+
96
+ ### Gaps
97
+ - {Finding about what's missing}
98
+
99
+ ### Recommendations
100
+ - {Suggestion for brainstorm based on findings}
101
+ ```
102
+
103
+ ### Phase 4: Present & Handoff
104
+
105
+ Present findings to user. Then:
106
+
107
+ > "Context gathered. Ready to brainstorm solutions?"
108
+ ```
109
+ /unipi:brainstorm <topic>
110
+ ```
111
+
112
+ The brainstorm will start with this context already available — no need to re-research.
113
+
114
+ ---
115
+
116
+ ## Notes
117
+
118
+ - This is a research skill — read-only, no changes
119
+ - Subagent support enables parallel research when available
120
+ - Findings feed directly into brainstorm — natural workflow
121
+ - Can be run standalone for exploration, or as pre-brainstorm step
122
+ - Output is ephemeral (in conversation) unless user requests saving