@ifi/oh-pi-skills 0.3.4 → 0.3.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ifi/oh-pi-skills",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "On-demand skill packs for pi: web-search, debug-helper, git-workflow, and more.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -0,0 +1,8 @@
1
+ ---
2
+ name: grill-me
3
+ description: Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
4
+ ---
5
+
6
+ Interview me relentlessly about every aspect of this plan until we reach a shared understanding. Walk down each branch of the design tree, resolving dependencies between decisions one-by-one. For each question, provide your recommended answer.
7
+
8
+ If a question can be answered by exploring the codebase, explore the codebase instead.
@@ -0,0 +1,78 @@
1
+ # Reference
2
+
3
+ ## Dependency Categories
4
+
5
+ When assessing a candidate for deepening, classify its dependencies:
6
+
7
+ ### 1. In-process
8
+
9
+ Pure computation, in-memory state, no I/O. Always deepenable — just merge the modules and test directly.
10
+
11
+ ### 2. Local-substitutable
12
+
13
+ Dependencies that have local test stand-ins (e.g., PGLite for Postgres, in-memory filesystem). Deepenable if the test substitute exists. The deepened module is tested with the local stand-in running in the test suite.
14
+
15
+ ### 3. Remote but owned (Ports & Adapters)
16
+
17
+ Your own services across a network boundary (microservices, internal APIs). Define a port (interface) at the module boundary. The deep module owns the logic; the transport is injected. Tests use an in-memory adapter. Production uses the real HTTP/gRPC/queue adapter.
18
+
19
+ Recommendation shape: "Define a shared interface (port), implement an HTTP adapter for production and an in-memory adapter for testing, so the logic can be tested as one deep module even though it's deployed across a network boundary."
20
+
21
+ ### 4. True external (Mock)
22
+
23
+ Third-party services (Stripe, Twilio, etc.) you don't control. Mock at the boundary. The deepened module takes the external dependency as an injected port, and tests provide a mock implementation.
24
+
25
+ ## Testing Strategy
26
+
27
+ The core principle: **replace, don't layer.**
28
+
29
+ - Old unit tests on shallow modules are waste once boundary tests exist — delete them
30
+ - Write new tests at the deepened module's interface boundary
31
+ - Tests assert on observable outcomes through the public interface, not internal state
32
+ - Tests should survive internal refactors — they describe behavior, not implementation
33
+
34
+ ## Issue Template
35
+
36
+ <issue-template>
37
+
38
+ ## Problem
39
+
40
+ Describe the architectural friction:
41
+
42
+ - Which modules are shallow and tightly coupled
43
+ - What integration risk exists in the seams between them
44
+ - Why this makes the codebase harder to navigate and maintain
45
+
46
+ ## Proposed Interface
47
+
48
+ The chosen interface design:
49
+
50
+ - Interface signature (types, methods, params)
51
+ - Usage example showing how callers use it
52
+ - What complexity it hides internally
53
+
54
+ ## Dependency Strategy
55
+
56
+ Which category applies and how dependencies are handled:
57
+
58
+ - **In-process**: merged directly
59
+ - **Local-substitutable**: tested with [specific stand-in]
60
+ - **Ports & adapters**: port definition, production adapter, test adapter
61
+ - **Mock**: mock boundary for external services
62
+
63
+ ## Testing Strategy
64
+
65
+ - **New boundary tests to write**: describe the behaviors to verify at the interface
66
+ - **Old tests to delete**: list the shallow module tests that become redundant
67
+ - **Test environment needs**: any local stand-ins or adapters required
68
+
69
+ ## Implementation Recommendations
70
+
71
+ Durable architectural guidance that is NOT coupled to current file paths:
72
+
73
+ - What the module should own (responsibilities)
74
+ - What it should hide (implementation details)
75
+ - What it should expose (the interface contract)
76
+ - How callers should migrate to the new interface
77
+
78
+ </issue-template>
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: improve-codebase-architecture
3
+ description: Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable.
4
+ ---
5
+
6
+ # Improve Codebase Architecture
7
+
8
+ Explore a codebase like an AI would, surface architectural friction, discover opportunities for improving testability, and propose module-deepening refactors as GitHub issue RFCs.
9
+
10
+ A **deep module** (John Ousterhout, "A Philosophy of Software Design") has a small interface hiding a large implementation. Deep modules are more testable, more AI-navigable, and let you test at the boundary instead of inside.
11
+
12
+ ## Process
13
+
14
+ ### 1. Explore the codebase
15
+
16
+ Use the Agent tool with subagent_type=Explore to navigate the codebase naturally. Do NOT follow rigid heuristics — explore organically and note where you experience friction:
17
+
18
+ - Where does understanding one concept require bouncing between many small files?
19
+ - Where are modules so shallow that the interface is nearly as complex as the implementation?
20
+ - Where have pure functions been extracted just for testability, but the real bugs hide in how they're called?
21
+ - Where do tightly-coupled modules create integration risk in the seams between them?
22
+ - Which parts of the codebase are untested, or hard to test?
23
+
24
+ The friction you encounter IS the signal.
25
+
26
+ ### 2. Present candidates
27
+
28
+ Present a numbered list of deepening opportunities. For each candidate, show:
29
+
30
+ - **Cluster**: Which modules/concepts are involved
31
+ - **Why they're coupled**: Shared types, call patterns, co-ownership of a concept
32
+ - **Dependency category**: See [REFERENCE.md](REFERENCE.md) for the four categories
33
+ - **Test impact**: What existing tests would be replaced by boundary tests
34
+
35
+ Do NOT propose interfaces yet. Ask the user: "Which of these would you like to explore?"
36
+
37
+ ### 3. User picks a candidate
38
+
39
+ ### 4. Frame the problem space
40
+
41
+ Before spawning sub-agents, write a user-facing explanation of the problem space for the chosen candidate:
42
+
43
+ - The constraints any new interface would need to satisfy
44
+ - The dependencies it would need to rely on
45
+ - A rough illustrative code sketch to make the constraints concrete — this is not a proposal, just a way to ground the constraints
46
+
47
+ Show this to the user, then immediately proceed to Step 5. The user reads and thinks about the problem while the sub-agents work in parallel.
48
+
49
+ ### 5. Design multiple interfaces
50
+
51
+ Spawn 3+ sub-agents in parallel using the Agent tool. Each must produce a **radically different** interface for the deepened module.
52
+
53
+ Prompt each sub-agent with a separate technical brief (file paths, coupling details, dependency category, what's being hidden). This brief is independent of the user-facing explanation in Step 4. Give each agent a different design constraint:
54
+
55
+ - Agent 1: "Minimize the interface — aim for 1-3 entry points max"
56
+ - Agent 2: "Maximize flexibility — support many use cases and extension"
57
+ - Agent 3: "Optimize for the most common caller — make the default case trivial"
58
+ - Agent 4 (if applicable): "Design around the ports & adapters pattern for cross-boundary dependencies"
59
+
60
+ Each sub-agent outputs:
61
+
62
+ 1. Interface signature (types, methods, params)
63
+ 2. Usage example showing how callers use it
64
+ 3. What complexity it hides internally
65
+ 4. Dependency strategy (how deps are handled — see [REFERENCE.md](REFERENCE.md))
66
+ 5. Trade-offs
67
+
68
+ Present designs sequentially, then compare them in prose.
69
+
70
+ After comparing, give your own recommendation: which design you think is strongest and why. If elements from different designs would combine well, propose a hybrid. Be opinionated — the user wants a strong read, not just a menu.
71
+
72
+ ### 6. User picks an interface (or accepts recommendation)
73
+
74
+ ### 7. Create GitHub issue
75
+
76
+ Create a refactor RFC as a GitHub issue using `gh issue create`. Use the template in [REFERENCE.md](REFERENCE.md). Do NOT ask the user to review before creating — just create it and share the URL.
@@ -0,0 +1,68 @@
1
+ ---
2
+ name: request-refactor-plan
3
+ description: Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.
4
+ ---
5
+
6
+ This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.
7
+
8
+ 1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.
9
+
10
+ 2. Explore the repo to verify their assertions and understand the current state of the codebase.
11
+
12
+ 3. Ask whether they have considered other options, and present other options to them.
13
+
14
+ 4. Interview the user about the implementation. Be extremely detailed and thorough.
15
+
16
+ 5. Hammer out the exact scope of the implementation. Work out what you plan to change and what you plan not to change.
17
+
18
+ 6. Look in the codebase to check for test coverage of this area of the codebase. If there is insufficient test coverage, ask the user what their plans for testing are.
19
+
20
+ 7. Break the implementation into a plan of tiny commits. Remember Martin Fowler's advice to "make each refactoring step as small as possible, so that you can always see the program working."
21
+
22
+ 8. Create a GitHub issue with the refactor plan. Use the following template for the issue description:
23
+
24
+ <refactor-plan-template>
25
+
26
+ ## Problem Statement
27
+
28
+ The problem that the developer is facing, from the developer's perspective.
29
+
30
+ ## Solution
31
+
32
+ The solution to the problem, from the developer's perspective.
33
+
34
+ ## Commits
35
+
36
+ A LONG, detailed implementation plan. Write the plan in plain English, breaking down the implementation into the tiniest commits possible. Each commit should leave the codebase in a working state.
37
+
38
+ ## Decision Document
39
+
40
+ A list of implementation decisions that were made. This can include:
41
+
42
+ - The modules that will be built/modified
43
+ - The interfaces of those modules that will be modified
44
+ - Technical clarifications from the developer
45
+ - Architectural decisions
46
+ - Schema changes
47
+ - API contracts
48
+ - Specific interactions
49
+
50
+ Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.
51
+
52
+ ## Testing Decisions
53
+
54
+ A list of testing decisions that were made. Include:
55
+
56
+ - A description of what makes a good test (only test external behavior, not implementation details)
57
+ - Which modules will be tested
58
+ - Prior art for the tests (i.e. similar types of tests in the codebase)
59
+
60
+ ## Out of Scope
61
+
62
+ A description of the things that are out of scope for this refactor.
63
+
64
+ ## Further Notes (optional)
65
+
66
+ Any further notes about the refactor.
67
+
68
+ </refactor-plan-template>
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: write-a-skill
3
+ description: Create new agent skills with proper structure, progressive disclosure, and bundled resources. Use when user wants to create, write, or build a new skill.
4
+ ---
5
+
6
+ # Writing Skills
7
+
8
+ ## Process
9
+
10
+ 1. **Gather requirements** - ask user about:
11
+ - What task/domain does the skill cover?
12
+ - What specific use cases should it handle?
13
+ - Does it need executable scripts or just instructions?
14
+ - Any reference materials to include?
15
+
16
+ 2. **Draft the skill** - create:
17
+ - SKILL.md with concise instructions
18
+ - Additional reference files if content exceeds 500 lines
19
+ - Utility scripts if deterministic operations needed
20
+
21
+ 3. **Review with user** - present draft and ask:
22
+ - Does this cover your use cases?
23
+ - Anything missing or unclear?
24
+ - Should any section be more/less detailed?
25
+
26
+ ## Skill Structure
27
+
28
+ ```
29
+ skill-name/
30
+ ├── SKILL.md # Main instructions (required)
31
+ ├── REFERENCE.md # Detailed docs (if needed)
32
+ ├── EXAMPLES.md # Usage examples (if needed)
33
+ └── scripts/ # Utility scripts (if needed)
34
+ └── helper.js
35
+ ```
36
+
37
+ ## SKILL.md Template
38
+
39
+ ```md
40
+ ---
41
+ name: skill-name
42
+ description: Brief description of capability. Use when [specific triggers].
43
+ ---
44
+
45
+ # Skill Name
46
+
47
+ ## Quick start
48
+
49
+ [Minimal working example]
50
+
51
+ ## Workflows
52
+
53
+ [Step-by-step processes with checklists for complex tasks]
54
+
55
+ ## Advanced features
56
+
57
+ [Link to separate files: See [REFERENCE.md](REFERENCE.md)]
58
+ ```
59
+
60
+ ## Description Requirements
61
+
62
+ The description is **the only thing your agent sees** when deciding which skill to load. It's surfaced in the system prompt alongside all other installed skills. Your agent reads these descriptions and picks the relevant skill based on the user's request.
63
+
64
+ **Goal**: Give your agent just enough info to know:
65
+
66
+ 1. What capability this skill provides
67
+ 2. When/why to trigger it (specific keywords, contexts, file types)
68
+
69
+ **Format**:
70
+
71
+ - Max 1024 chars
72
+ - Write in third person
73
+ - First sentence: what it does
74
+ - Second sentence: "Use when [specific triggers]"
75
+
76
+ **Good example**:
77
+
78
+ ```
79
+ Extract text and tables from PDF files, fill forms, merge documents. Use when working with PDF files or when user mentions PDFs, forms, or document extraction.
80
+ ```
81
+
82
+ **Bad example**:
83
+
84
+ ```
85
+ Helps with documents.
86
+ ```
87
+
88
+ The bad example gives your agent no way to distinguish this from other document skills.
89
+
90
+ ## When to Add Scripts
91
+
92
+ Add utility scripts when:
93
+
94
+ - Operation is deterministic (validation, formatting)
95
+ - Same code would be generated repeatedly
96
+ - Errors need explicit handling
97
+
98
+ Scripts save tokens and improve reliability vs generated code.
99
+
100
+ ## When to Split Files
101
+
102
+ Split into separate files when:
103
+
104
+ - SKILL.md exceeds 100 lines
105
+ - Content has distinct domains (finance vs sales schemas)
106
+ - Advanced features are rarely needed
107
+
108
+ ## Review Checklist
109
+
110
+ After drafting, verify:
111
+
112
+ - [ ] Description includes triggers ("Use when...")
113
+ - [ ] SKILL.md under 100 lines
114
+ - [ ] No time-sensitive info
115
+ - [ ] Consistent terminology
116
+ - [ ] Concrete examples included
117
+ - [ ] References one level deep