@senomas/pi-git-hat 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.
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/git-hat.ts +1456 -0
- package/lib/searchable-select-list.ts +112 -0
- package/package.json +24 -0
- package/roles/admin.md +13 -0
- package/roles/implementor.md +20 -0
- package/roles/planner.md +25 -0
- package/roles/reviewer.md +22 -0
- package/roles/roles.json +8 -0
- package/scripts/validate-role-prompts.py +149 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 seno
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# git-hat ๐งข
|
|
2
|
+
|
|
3
|
+
**Wear different hats by switching git branches.**
|
|
4
|
+
|
|
5
|
+
A [pi](https://github.com/earendil-works/pi) extension that maps git branches to roles (planner, implementor, reviewer, admin) and enforces role-based permissions.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Role-based branch switching** โ `/hat` TUI to pick branches grouped by role
|
|
10
|
+
- **Permission enforcement** โ each role can only write to certain paths
|
|
11
|
+
- **System prompt injection** โ role instructions injected automatically per session
|
|
12
|
+
- **Ancestry checking** โ `/hatt` validates branch parent chain before work
|
|
13
|
+
- **Auto-seeding** โ role prompts copied from bundled `roles/` to project `.pi/` on first use
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# Install
|
|
19
|
+
pi install npm:@senomas/pi-git-hat
|
|
20
|
+
|
|
21
|
+
# Create a roles.json
|
|
22
|
+
mkdir -p .pi
|
|
23
|
+
cat > .pi/roles.json << 'EOF'
|
|
24
|
+
{
|
|
25
|
+
"roles": {
|
|
26
|
+
"planner": { "pattern": "^plan", "description": "Plan work" },
|
|
27
|
+
"implementor": { "pattern": "^feat", "description": "Implement features" },
|
|
28
|
+
"reviewer": { "pattern": "^review", "description": "Review implementations" },
|
|
29
|
+
"admin": { "pattern": "^(main|master)$", "description": "Configuration" }
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
EOF
|
|
33
|
+
|
|
34
|
+
# Start pi โ role prompts auto-seed into .pi/
|
|
35
|
+
pi
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Commands
|
|
39
|
+
|
|
40
|
+
| Command | Description |
|
|
41
|
+
|---------|-------------|
|
|
42
|
+
| `/hat` | TUI branch selector |
|
|
43
|
+
| `/hat info` | Show current role and branch |
|
|
44
|
+
| `/hat todo` | List pending items across todo/ |
|
|
45
|
+
| `/hatt` | Ancestry check + todo listing |
|
|
46
|
+
| `/hatl [N]` | Colored git log (default 10 lines) |
|
|
47
|
+
|
|
48
|
+
## License
|
|
49
|
+
|
|
50
|
+
MIT
|