@pi-unipi/unipi 0.1.1

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 (31) hide show
  1. package/README.md +143 -0
  2. package/package.json +70 -0
  3. package/packages/btw/README.md +95 -0
  4. package/packages/btw/extensions/btw.ts +1972 -0
  5. package/packages/btw/skills/btw/SKILL.md +149 -0
  6. package/packages/core/README.md +74 -0
  7. package/packages/core/index.ts +10 -0
  8. package/packages/info-screen/README.md +115 -0
  9. package/packages/info-screen/index.ts +165 -0
  10. package/packages/memory/README.md +94 -0
  11. package/packages/memory/index.ts +209 -0
  12. package/packages/memory/skills/memory/SKILL.md +151 -0
  13. package/packages/ralph/README.md +101 -0
  14. package/packages/ralph/index.ts +548 -0
  15. package/packages/subagents/README.md +114 -0
  16. package/packages/unipi/index.ts +28 -0
  17. package/packages/workflow/README.md +129 -0
  18. package/packages/workflow/index.ts +155 -0
  19. package/packages/workflow/skills/brainstorm/SKILL.md +202 -0
  20. package/packages/workflow/skills/consolidate/SKILL.md +142 -0
  21. package/packages/workflow/skills/consultant/SKILL.md +97 -0
  22. package/packages/workflow/skills/document/SKILL.md +120 -0
  23. package/packages/workflow/skills/gather-context/SKILL.md +122 -0
  24. package/packages/workflow/skills/plan/SKILL.md +169 -0
  25. package/packages/workflow/skills/quick-work/SKILL.md +110 -0
  26. package/packages/workflow/skills/review-work/SKILL.md +131 -0
  27. package/packages/workflow/skills/scan-issues/SKILL.md +183 -0
  28. package/packages/workflow/skills/work/SKILL.md +144 -0
  29. package/packages/workflow/skills/worktree-create/SKILL.md +69 -0
  30. package/packages/workflow/skills/worktree-list/SKILL.md +67 -0
  31. package/packages/workflow/skills/worktree-merge/SKILL.md +79 -0
@@ -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
@@ -0,0 +1,169 @@
1
+ ---
2
+ name: plan
3
+ description: "Strategic planning — create implementation plan from brainstorm specs. Tasks, dependencies, acceptance criteria."
4
+ ---
5
+
6
+ # Planning From Specs
7
+
8
+ Turn brainstorm decisions into an actionable implementation plan.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** read specs, read codebase, ask questions, write plan document, update brainstorm checkboxes.
13
+ **This skill MAY NOT:** edit code, implement anything, run tests, deploy.
14
+
15
+ **NEVER write code during this skill. This is planning, not implementation.**
16
+
17
+ ## Command Format
18
+
19
+ ```
20
+ /unipi:plan specs:<path>(multiple,optional) <string(greedy)>(optional)
21
+ ```
22
+
23
+ - `specs:<path>` — one or more brainstorm specs to plan from (auto-suggested)
24
+ - `string(greedy)` — optional scope guidance (e.g., "focus on API layer only")
25
+ - If no specs provided → agent asks user which spec to plan from
26
+ - Runs in current session, read-only sandbox + write to `.unipi/docs/`
27
+
28
+ ## Sandbox
29
+
30
+ - **Read:** full codebase access for context
31
+ - **Write:** only `.unipi/docs/` directory
32
+
33
+ ## Output Path
34
+
35
+ ```
36
+ .unipi/docs/plans/YYYY-MM-DD-<topic>-plan.md
37
+ ```
38
+
39
+ Committed to current branch.
40
+
41
+ ---
42
+
43
+ ## Phase 1: Load Specs
44
+
45
+ 1. If `specs:` arg provided, read those spec files
46
+ 2. If not provided, list available specs in `.unipi/docs/specs/` and ask user to choose
47
+ 3. Read the spec(s) fully — understand problem, approach, design, checklist
48
+
49
+ **Exit:** Spec(s) loaded. Understand what to plan.
50
+
51
+ ---
52
+
53
+ ## Phase 2: Review & Ask
54
+
55
+ 1. Review spec critically — identify concerns or gaps
56
+ 2. If concerns: raise with user before proceeding
57
+ 3. If `string(greedy)` provided: use it to scope planning (e.g., "focus on auth only")
58
+ 4. Ask clarifying questions if needed (one at a time)
59
+
60
+ **Exit:** No blockers. Ready to plan.
61
+
62
+ ---
63
+
64
+ ## Phase 3: Create Implementation Plan
65
+
66
+ Structure the plan with heart of gold style:
67
+
68
+ ```markdown
69
+ ---
70
+ title: "{Topic} — Implementation Plan"
71
+ type: plan
72
+ date: YYYY-MM-DD
73
+ specs:
74
+ - path/to/spec.md
75
+ ---
76
+
77
+ # {Topic} — Implementation Plan
78
+
79
+ ## Overview
80
+ {Brief summary of what this plan covers}
81
+
82
+ ## Tasks
83
+
84
+ ### Task 1: {Task Name}
85
+ **Description:** {What needs to be done}
86
+ **Dependencies:** {None, or list of tasks}
87
+ **Acceptance Criteria:** {How to verify done}
88
+ **Steps:**
89
+ 1. {Concrete step}
90
+ 2. {Concrete step}
91
+
92
+ ### Task 2: {Task Name}
93
+ ...
94
+
95
+ ## Sequencing
96
+ {Order of execution, dependency graph if complex}
97
+
98
+ ## Risks
99
+ {Potential blockers or concerns}
100
+ ```
101
+
102
+ ### Task Guidelines
103
+
104
+ - Each task should be **discrete and completable** in one session
105
+ - **Dependencies** must be explicit — task B can't start before task A
106
+ - **Acceptance criteria** must be verifiable — not "looks good" but "tests pass, builds clean"
107
+ - **Steps** are bite-sized — agent can follow without guessing
108
+ - Order tasks by dependency (foundational work first)
109
+
110
+ ---
111
+
112
+ ## Phase 4: Update Brainstorm Checkboxes
113
+
114
+ After plan is complete:
115
+
116
+ 1. Read the source brainstorm spec(s)
117
+ 2. For each checklist item covered by this plan, mark `[x]`
118
+ 3. Leave items not covered as `[ ]`
119
+ 4. Write updated spec back
120
+
121
+ **Example:**
122
+ ```markdown
123
+ ## Implementation Checklist
124
+ - [x] Set up auth middleware — covered in Task 1
125
+ - [x] Create login endpoint — covered in Task 2
126
+ - [ ] Add OAuth support — deferred to next plan
127
+ - [ ] Rate limiting — out of scope
128
+ ```
129
+
130
+ This creates the link between brainstorm and plan — plan covers some items, others remain for future plans.
131
+
132
+ ---
133
+
134
+ ## Phase 5: Review Plan
135
+
136
+ Self-check before presenting:
137
+
138
+ - [ ] Every task has clear acceptance criteria
139
+ - [ ] Dependencies are correct (no circular, no missing)
140
+ - [ ] Steps are bite-sized (agent can follow without guessing)
141
+ - [ ] Brainstorm checkboxes updated correctly
142
+ - [ ] String greedy scope respected (if provided)
143
+ - [ ] Plan is focused enough for single `/unipi:work` session
144
+
145
+ ---
146
+
147
+ ## Phase 6: Present & Handoff
148
+
149
+ Present plan summary to user. Then ask:
150
+
151
+ 1. **Proceed to /unipi:work** — Start implementing in a worktree
152
+ 2. **Revise plan** — Adjust tasks or scope
153
+ 3. **Done for now** — Return later
154
+
155
+ If user selects "Proceed to /unipi:work", suggest:
156
+ ```
157
+ /unipi:work worktree:feat/<branch-name> specs:YYYY-MM-DD-<topic>-plan
158
+ ```
159
+
160
+ Recommend starting a **new session** for work — it will switch pi's internal worktree.
161
+
162
+ ---
163
+
164
+ ## Resumability
165
+
166
+ If user runs `/unipi:plan` on an existing plan:
167
+ 1. Read the plan
168
+ 2. Check what's already marked done
169
+ 3. Ask user if they want to add tasks, modify existing, or plan new scope
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: quick-work
3
+ description: "Fast single-task execution — one shot, done. Use for small tasks that don't need full brainstorm/plan/work flow."
4
+ ---
5
+
6
+ # Quick Work
7
+
8
+ Execute a single task directly. No brainstorm, no plan — just do it and record what happened.
9
+
10
+ ## Boundaries
11
+
12
+ **This skill MAY:** read/write code, run tests, commit, write summary to `.unipi/quick-work/`.
13
+ **This skill MAY NOT:** create worktrees, merge branches, deploy.
14
+
15
+ ## Command Format
16
+
17
+ ```
18
+ /unipi:quick-work <string(greedy)>
19
+ ```
20
+
21
+ - `string(greedy)` — what to do (e.g., "add input validation to login form", "fix the typo in README")
22
+ - Full read/write sandbox
23
+ - One shot — complete the task in this session
24
+
25
+ ---
26
+
27
+ ## Process
28
+
29
+ ### Phase 1: Understand Task
30
+
31
+ 1. Read the request
32
+ 2. If unclear, ask one clarifying question
33
+ 3. Assess scope — is this truly a quick task?
34
+ - If too complex → suggest `/unipi:brainstorm` instead
35
+ - If appropriate → proceed
36
+
37
+ **Exit:** Task understood, scoped appropriately.
38
+
39
+ ### Phase 2: Execute
40
+
41
+ 1. Find relevant files
42
+ 2. Make the changes
43
+ 3. Verify (run tests if applicable)
44
+ 4. Commit with descriptive message
45
+
46
+ Straightforward — no planning, no discussion, just work.
47
+
48
+ **Exit:** Task complete.
49
+
50
+ ### Phase 3: Write Summary
51
+
52
+ Write summary to `.unipi/quick-work/YYYY-MM-DD-<topic>.md`:
53
+
54
+ ```markdown
55
+ ---
56
+ title: "{Topic}"
57
+ type: quick-work
58
+ date: YYYY-MM-DD
59
+ ---
60
+
61
+ # {Topic}
62
+
63
+ ## Task
64
+ {What was requested}
65
+
66
+ ## Changes
67
+ - {File 1}: {what changed}
68
+ - {File 2}: {what changed}
69
+
70
+ ## Verification
71
+ {How it was tested — "ran tests", "manual check", etc.}
72
+
73
+ ## Notes
74
+ {Anything worth noting — gotchas, follow-ups, etc.}
75
+ ```
76
+
77
+ ### Phase 4: Report
78
+
79
+ > "Done. Changes committed. Summary at `.unipi/quick-work/YYYY-MM-DD-<topic>.md`"
80
+
81
+ No further suggestions needed — this was a one-shot task.
82
+
83
+ ---
84
+
85
+ ## When to Use Quick Work vs Full Flow
86
+
87
+ **Use quick-work for:**
88
+ - Bug fixes (small, clear)
89
+ - Typo corrections
90
+ - Config changes
91
+ - Small feature additions (< 30 min work)
92
+ - Dependency updates
93
+
94
+ **Use full flow (brainstorm/plan/work) for:**
95
+ - New features
96
+ - Architecture changes
97
+ - Multi-file refactors
98
+ - Anything with design decisions
99
+ - Tasks requiring discussion
100
+
101
+ When in doubt, start with quick-work. If it gets complex, suggest switching to full flow.
102
+
103
+ ---
104
+
105
+ ## Notes
106
+
107
+ - No worktree isolation — works on current branch
108
+ - No planning overhead — direct execution
109
+ - Summary provides record of what was done
110
+ - Task should be completable in one session