@preapexis/pi-kit 1.0.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,30 @@
1
+ name: Publish Package
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+
12
+ permissions:
13
+ contents: read
14
+ id-token: write
15
+
16
+ steps:
17
+ - uses: actions/checkout@v6
18
+
19
+ - uses: actions/setup-node@v6
20
+ with:
21
+ node-version: 24
22
+ registry-url: "https://registry.npmjs.org"
23
+
24
+ - run: npm ci
25
+
26
+ - run: npm test
27
+
28
+ - run: npm publish --access public
29
+ env:
30
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -0,0 +1,3 @@
1
+ {
2
+ "packages": []
3
+ }
package/AGENTS.md ADDED
@@ -0,0 +1,199 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI agents working in this repository.
4
+
5
+ ## Project
6
+
7
+ This repository is `preapexis-pi-kit`, a personal Pi coding-agent package.
8
+
9
+ It contains:
10
+
11
+ - `extensions/` — TypeScript Pi extensions.
12
+ - `prompts/` — prompt templates that become slash commands.
13
+ - `skills/` — reusable skills, each in its own folder with a `SKILL.md`.
14
+ - `themes/` — Pi UI themes.
15
+ - `package.json` — declares this repository as a Pi package.
16
+
17
+ ## Core Rules
18
+
19
+ - Keep changes small, focused, and reviewable.
20
+ - Read existing files before editing them.
21
+ - Preserve existing behavior unless explicitly asked to change it.
22
+ - Match the style already used in the repo.
23
+ - Do not add dependencies unless explicitly approved.
24
+ - Do not delete files unless explicitly approved.
25
+ - Do not rewrite Git history.
26
+ - Do not edit secrets, `.env` files, `.git`, build output, or generated files.
27
+
28
+ ## Package Structure Rules
29
+
30
+ The Pi package should continue to use this structure:
31
+
32
+ ```txt
33
+ preapexis-pi-kit/
34
+ package.json
35
+ README.md
36
+ LICENSE
37
+ AGENTS.md
38
+ extensions/
39
+ prompts/
40
+ skills/
41
+ themes/
42
+ ```
43
+
44
+ Each skill must live in its own folder:
45
+
46
+ ```txt
47
+ skills/
48
+ safe-coding/
49
+ SKILL.md
50
+ component-implementation/
51
+ SKILL.md
52
+ frontend-onboarding/
53
+ SKILL.md
54
+ frontend-quality/
55
+ SKILL.md
56
+ ```
57
+
58
+ Do not place skill files directly inside `skills/` unless Pi explicitly supports that format.
59
+
60
+ ## Extension Rules
61
+
62
+ Extensions are TypeScript files in `extensions/`.
63
+
64
+ Current expected extensions:
65
+
66
+ - `safety.ts` — general safety protection.
67
+ - `git-guard.ts` — Git-specific safety.
68
+ - `status.ts` — footer/status display.
69
+ - `prompts.ts` — `/prompts` menu.
70
+ - `brand-ui.ts` — custom UI branding.
71
+
72
+ Avoid duplicate responsibilities:
73
+
74
+ - Git branch display belongs in `git-guard.ts`.
75
+ - Model, mode, repo trust, and test status belong in `status.ts`.
76
+ - Risky non-Git shell command protection belongs in `safety.ts`.
77
+ - Prompt menu belongs in `prompts.ts`.
78
+
79
+ Do not reintroduce duplicate `/plan`, `/commit`, `/security`, or similar commands in extensions if matching prompt files already exist.
80
+
81
+ ## Prompt Rules
82
+
83
+ Prompt files live in `prompts/`.
84
+
85
+ The filename becomes the slash command.
86
+
87
+ Examples:
88
+
89
+ ```txt
90
+ prompts/plan.md -> /plan
91
+ prompts/security.md -> /security
92
+ ```
93
+
94
+ Do not create `prompts/prompts.md` because `/prompts` is already provided by `extensions/prompts.ts`.
95
+
96
+ Current expected prompts:
97
+
98
+ - `init.md`
99
+ - `plan.md`
100
+ - `save-plan.md`
101
+ - `implement.md`
102
+ - `commit.md`
103
+ - `review-safe.md`
104
+ - `security.md`
105
+
106
+ Prompt behavior rules:
107
+
108
+ - Planning prompts should be read-only.
109
+ - Review prompts should be read-only.
110
+ - Commit prompt should suggest a commit message only; it must not commit.
111
+ - Implement prompt may edit files, but should follow the saved plan and ask if unclear.
112
+ - Save-plan prompt should save plans under `docs/plans/`.
113
+ - Do not edit `AGENTS.md` from a prompt unless the user approves.
114
+
115
+ ## Skill Rules
116
+
117
+ Skill files must start with valid frontmatter:
118
+
119
+ ```md
120
+ ---
121
+ name: skill-name
122
+ description: Short description.
123
+ ---
124
+ ```
125
+
126
+ Do not add an extra `---` after the frontmatter.
127
+
128
+ Keep skills focused and reusable.
129
+
130
+ Good skill categories for this repo:
131
+
132
+ - safe coding
133
+ - frontend onboarding
134
+ - frontend quality review
135
+ - component implementation
136
+
137
+ ## Safety Rules
138
+
139
+ Agents must avoid:
140
+
141
+ - reading or editing `.env` files
142
+ - editing `.git`
143
+ - editing `node_modules`
144
+ - editing build output such as `dist`, `build`, `out`, or `coverage`
145
+ - changing lockfiles unless the user approves
146
+ - running package install/remove commands unless the user approves
147
+ - running destructive Git commands
148
+ - running destructive shell commands
149
+
150
+ If a task is unclear, ask questions before editing.
151
+
152
+ Ask only important questions. If the task is clear, continue.
153
+
154
+ ## Verification
155
+
156
+ When code changes are made, run the narrowest relevant check if available:
157
+
158
+ - typecheck
159
+ - lint
160
+ - test
161
+ - build
162
+
163
+ If checks cannot be run, explain why.
164
+
165
+ Do not claim tests passed unless they were actually run.
166
+
167
+ ## Git Rules
168
+
169
+ Before risky edits, check whether the repo is dirty.
170
+
171
+ Dirty means there are uncommitted changes.
172
+
173
+ Avoid overwriting user work.
174
+
175
+ Do not run:
176
+
177
+ ```bash
178
+ git push --force
179
+ git reset --hard
180
+ git clean -fd
181
+ ```
182
+
183
+ unless the user explicitly approves and the safety extension allows it.
184
+
185
+ ## README Rules
186
+
187
+ Keep `README.md` aligned with the actual files.
188
+
189
+ If an extension, prompt, skill, or theme is renamed, update the README.
190
+
191
+ Avoid mentioning removed files such as `team.ts` or old names such as `workflow.ts` if they no longer exist.
192
+
193
+ ## Style
194
+
195
+ - Use clear, simple language.
196
+ - Prefer plain Markdown.
197
+ - Avoid unnecessary complexity.
198
+ - Avoid adding comments that only repeat the code.
199
+ - Prefer explicit names over clever names.
package/CHANGELOG.md ADDED
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to `preapexis-pi-kit` will be documented in this file.
4
+
5
+ This project follows a simple changelog format:
6
+ - `Added` for new features
7
+ - `Changed` for updates to existing behavior
8
+ - `Fixed` for bug fixes
9
+ - `Removed` for deleted features/files
10
+ - `Security` for safety-related changes
11
+
12
+ ## [1.0.0] - 2026-06-26
13
+
14
+ ### Added
15
+
16
+ - Initial Pi package setup.
17
+ - Added `package.json` with Pi package entries for:
18
+ - `extensions`
19
+ - `prompts`
20
+ - `skills`
21
+ - `themes`
22
+ - Added safety-focused extensions:
23
+ - `safety.ts`
24
+ - `git-guard.ts`
25
+ - `status.ts`
26
+ - `prompts.ts`
27
+ - `brand-ui.ts`
28
+ - Added prompt workflows:
29
+ - `init.md`
30
+ - `plan.md`
31
+ - `save-plan.md`
32
+ - `implement.md`
33
+ - `commit.md`
34
+ - `review-safe.md`
35
+ - `security.md`
36
+ - Added reusable skills:
37
+ - `safe-coding`
38
+ - `component-implementation`
39
+ - `frontend-onboarding`
40
+ - `frontend-quality`
41
+ - Added `README.md`.
42
+ - Added `AGENTS.md`.
43
+ - Added `LICENSE`.
44
+ - Added `.gitignore`.
45
+
46
+ ### Changed
47
+
48
+ - Renamed workflow helper concept to `/prompts`.
49
+ - Updated `plan.md` to include:
50
+ - batch planning
51
+ - recommended model
52
+ - effort level
53
+ - risk level
54
+ - approval requirement
55
+ - final execution summary
56
+ - Updated `save-plan.md` to save plans under `docs/plans/`.
57
+ - Cleaned skill files to remove extra frontmatter separators.
58
+ - Simplified `settings.json` recommendations.
59
+
60
+ ### Fixed
61
+
62
+ - Removed duplicate `/plan`, `/commit`, `/security`, and related command behavior by keeping real workflows in prompt files.
63
+ - Removed duplicate branch display from `status.ts`.
64
+ - Kept Git branch display inside `git-guard.ts`.
65
+
66
+ ### Security
67
+
68
+ - Added protection rules for risky shell commands.
69
+ - Added `.env` read/edit blocking.
70
+ - Added protected path checks for generated files, dependency folders, and Git internals.
71
+ - Added Git protection for dirty worktrees, force-push, and `git reset --hard`.
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Varun Gaikwad
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,370 @@
1
+ # preapexis-pi-kit
2
+
3
+ A personalized kit for the [Pi Agent Harness](https://github.com/earendil-works/pi) that bundles extensions, prompts, skills, and themes to improve AI-assisted coding workflows.
4
+
5
+ ## What’s inside
6
+
7
+ - **extensions/** – TypeScript extensions that add custom behavior to Pi:
8
+ - `safety.ts` – blocks risky shell commands, protects secrets, blocks unsafe paths, and injects safety rules.
9
+ - `git-guard.ts` – warns on dirty Git worktrees, blocks force-push, confirms `git reset --hard`, creates checkpoint branches before edits, and shows the current branch.
10
+ - `status.ts` – shows useful footer info such as model, mode, repo trust state, and test status.
11
+ - `usage-tracker.ts` – tracks session token usage and estimated cost, with `/usage` and `/usage-reset`.
12
+ - `prompts.ts` – adds `/prompts`, a small menu listing available prompt workflows.
13
+ - `brand-ui.ts` – adds custom Pi branding/UI.
14
+
15
+ - **prompts/** – prompt templates for common workflows:
16
+ - `init.md` – inspect a repository and create an onboarding report.
17
+ - `plan.md` – create a read-only implementation plan with batches, model choice, and effort guidance.
18
+ - `save-plan.md` – save a generated plan as a markdown file.
19
+ - `implement.md` – implement a saved or pasted plan.
20
+ - `commit.md` – generate a conventional commit message from current Git changes.
21
+ - `review-safe.md` – run a safe read-only project review.
22
+ - `security.md` – run a read-only security review.
23
+
24
+ - **skills/** – reusable skills for focused agent behavior:
25
+ - `safe-coding`
26
+ - `component-implementation`
27
+ - `frontend-onboarding`
28
+ - `frontend-quality`
29
+
30
+ - **themes/** – custom Pi themes.
31
+
32
+ - **package.json** – declares this repository as a Pi package.
33
+
34
+ ## Installation
35
+
36
+ ### Install from npm
37
+
38
+ If the package is published to npm, install it with:
39
+
40
+ ```bash
41
+ pi install npm:preapexis-pi-kit
42
+ ```
43
+
44
+ After installing, restart Pi or reload extensions:
45
+
46
+ ```txt
47
+ /reload
48
+ ```
49
+
50
+ ### Install from GitHub
51
+
52
+ Install directly from GitHub:
53
+
54
+ ```bash
55
+ pi install git:github.com/VarunGaikwad/preapexis-pi-kit@master
56
+ ```
57
+
58
+ After installing, restart Pi or reload extensions:
59
+
60
+ ```txt
61
+ /reload
62
+ ```
63
+
64
+ ### Install from a local clone
65
+
66
+ Clone this repository:
67
+
68
+ ```bash
69
+ git clone https://github.com/VarunGaikwad/preapexis-pi-kit.git
70
+ cd preapexis-pi-kit
71
+ ```
72
+
73
+ Install or link it with Pi:
74
+
75
+ ```bash
76
+ pi install -l .
77
+ ```
78
+
79
+ Then restart Pi or reload extensions:
80
+
81
+ ```txt
82
+ /reload
83
+ ```
84
+
85
+ ## Updating
86
+
87
+ ### Update from npm
88
+
89
+ If installed from npm, run:
90
+
91
+ ```bash
92
+ pi install npm:preapexis-pi-kit
93
+ ```
94
+
95
+ Then reload Pi:
96
+
97
+ ```txt
98
+ /reload
99
+ ```
100
+
101
+ ### Update from GitHub
102
+
103
+ If installed from GitHub, run:
104
+
105
+ ```bash
106
+ pi install git:github.com/VarunGaikwad/preapexis-pi-kit@master
107
+ ```
108
+
109
+ Then reload Pi:
110
+
111
+ ```txt
112
+ /reload
113
+ ```
114
+
115
+ ### Update a local linked copy
116
+
117
+ If installed with local link mode, pull the latest changes in the local repo:
118
+
119
+ ```bash
120
+ git pull
121
+ ```
122
+
123
+ Then reload Pi:
124
+
125
+ ```txt
126
+ /reload
127
+ ```
128
+
129
+ To update from GitHub, run:
130
+
131
+ ```bash
132
+ pi install git:github.com/VarunGaikwad/preapexis-pi-kit@master
133
+ ```
134
+
135
+ Then reload Pi:
136
+
137
+ ```txt
138
+ /reload
139
+ ```
140
+
141
+ ## Usage
142
+
143
+ ### Prompt workflow
144
+
145
+ Recommended flow:
146
+
147
+ ```txt
148
+ /init
149
+ /plan <your request>
150
+ /save-plan <paste generated plan>
151
+ /implement <saved plan path or pasted plan>
152
+ /commit
153
+ ```
154
+
155
+ Use review prompts when needed:
156
+
157
+ ```txt
158
+ /review-safe
159
+ /security
160
+ ```
161
+
162
+ ### `/prompts`
163
+
164
+ Run:
165
+
166
+ ```txt
167
+ /prompts
168
+ ```
169
+
170
+ This shows all available prompt workflows and how to use them.
171
+
172
+ ## Prompt details
173
+
174
+ ### `/init`
175
+
176
+ Reads the project and creates an onboarding report.
177
+
178
+ Use this when opening a new repo or unfamiliar feature area.
179
+
180
+ ### `/plan`
181
+
182
+ Creates a read-only plan.
183
+
184
+ The plan includes:
185
+
186
+ - implementation batches
187
+ - likely files to change
188
+ - risk level
189
+ - recommended model
190
+ - recommended effort level
191
+ - approval needs
192
+ - final execution summary
193
+
194
+ Example summary:
195
+
196
+ ```txt
197
+ Use Haiku with low effort for batches 1 and 2.
198
+ Use Sonnet with medium effort for batches 3 and 4.
199
+ Use Opus with high effort for batch 5.
200
+ ```
201
+
202
+ ### `/save-plan`
203
+
204
+ Saves a generated plan to:
205
+
206
+ ```txt
207
+ docs/plans/YYYY-MM-DD-plan-name.md
208
+ ```
209
+
210
+ It asks before editing `AGENTS.md`.
211
+
212
+ ### `/implement`
213
+
214
+ Implements a saved or pasted plan.
215
+
216
+ It should:
217
+
218
+ - follow the plan closely
219
+ - keep changes small
220
+ - ask if something is unclear
221
+ - run tests, lint, or typecheck when available
222
+ - summarize what changed
223
+
224
+ ### `/commit`
225
+
226
+ Reads Git changes and suggests a commit message.
227
+
228
+ It does not commit automatically.
229
+
230
+ ### `/review-safe`
231
+
232
+ Runs a read-only project review.
233
+
234
+ ### `/security`
235
+
236
+ Runs a read-only security review.
237
+
238
+ ## Extensions
239
+
240
+ ### safety.ts
241
+
242
+ General safety layer.
243
+
244
+ Protects against:
245
+
246
+ - risky shell commands
247
+ - reading or editing `.env` files
248
+ - editing dependency folders
249
+ - editing build output
250
+ - editing `.git` internals
251
+ - unsafe package install/remove commands without confirmation
252
+
253
+ It also injects safety and clarification rules into the agent prompt.
254
+
255
+ ### git-guard.ts
256
+
257
+ Git-specific safety layer.
258
+
259
+ Handles:
260
+
261
+ - dirty working tree warning
262
+ - branch display with `*` when dirty
263
+ - force-push blocking
264
+ - `git reset --hard` confirmation
265
+ - checkpoint branch creation before risky edits
266
+
267
+ Example status:
268
+
269
+ ```txt
270
+ ⎇ master*
271
+ ```
272
+
273
+ The `*` means there are uncommitted changes.
274
+
275
+ ### status.ts
276
+
277
+ Shows project status in the footer:
278
+
279
+ ```txt
280
+ mode: safe model: openrouter/... repo: trusted tests: none
281
+ ```
282
+
283
+ Commands:
284
+
285
+ ```txt
286
+ /test-pass
287
+ /test-fail
288
+ /test-none
289
+ ```
290
+
291
+ ### prompts.ts
292
+
293
+ Adds:
294
+
295
+ ```txt
296
+ /prompts
297
+ ```
298
+
299
+ This command lists available prompt workflows.
300
+
301
+ ### brand-ui.ts
302
+
303
+ Adds custom Pi branding and visual UI customization.
304
+
305
+ ## Skills
306
+
307
+ Each skill should live in its own folder:
308
+
309
+ ```txt
310
+ skills/
311
+ safe-coding/
312
+ SKILL.md
313
+ component-implementation/
314
+ SKILL.md
315
+ frontend-onboarding/
316
+ SKILL.md
317
+ frontend-quality/
318
+ SKILL.md
319
+ ```
320
+
321
+ ## Development
322
+
323
+ To add a new extension:
324
+
325
+ ```txt
326
+ extensions/my-extension.ts
327
+ ```
328
+
329
+ It should export a default function that receives `ExtensionAPI`.
330
+
331
+ To add a new prompt:
332
+
333
+ ```txt
334
+ prompts/my-prompt.md
335
+ ```
336
+
337
+ The filename becomes the slash command.
338
+
339
+ Example:
340
+
341
+ ```txt
342
+ prompts/security.md → /security
343
+ ```
344
+
345
+ To add a new skill:
346
+
347
+ ```txt
348
+ skills/my-skill/SKILL.md
349
+ ```
350
+
351
+ ## Package structure
352
+
353
+ ```txt
354
+ preapexis-pi-kit/
355
+ package.json
356
+ LICENSE
357
+ README.md
358
+ extensions/
359
+ prompts/
360
+ skills/
361
+ themes/
362
+ ```
363
+
364
+ ## License
365
+
366
+ ISC. See the `LICENSE` file for details.
367
+
368
+ ---
369
+
370
+ Built for a safer, cleaner Pi coding-agent workflow.