@shanvit7/poiesis 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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 shanvit7
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,303 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/Shanvit7/poiesis/main/apps/web/public/logo.svg" width="72" alt="Poiesis logo" />
3
+ <h1 align="center">@shanvit7/poiesis</h1>
4
+ <p align="center">
5
+ <a href="https://www.npmjs.com/package/@shanvit7/poiesis"><img src="https://img.shields.io/npm/v/@shanvit7/poiesis?color=4f46e5&label=npm&style=flat-square" alt="npm version" /></a>
6
+ <a href="./LICENSE"><img src="https://img.shields.io/npm/l/@shanvit7/poiesis?color=22c55e&style=flat-square" alt="License: MIT" /></a>
7
+ <a href="https://github.com/Shanvit7/poiesis/pulls"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen?style=flat-square" alt="PRs Welcome" /></a>
8
+ <a href="https://pi.earendil.works"><img src="https://img.shields.io/badge/pi--package-%E2%9C%93-7c3aed?style=flat-square" alt="pi-package" /></a>
9
+ </p>
10
+ </p>
11
+
12
+ A [pi](https://pi.earendil.works) extension that turns any YouTube coding tutorial into a hands-on, test-driven build session.
13
+
14
+ Pi reads the video, profiles your existing experience, and codes through it chapter by chapter — running every step itself, explaining each decision, and making sure you understand what's being built and why.
15
+
16
+ ---
17
+
18
+ ## Table of Contents
19
+
20
+ - [Features](#features)
21
+ - [Install](#install)
22
+ - [Usage](#usage)
23
+ - [What a session looks like](#what-a-session-looks-like)
24
+ - [Command review](#command-review)
25
+ - [Project structure](#project-structure)
26
+ - [Bundled extensions and skills](#bundled-extensions-and-skills)
27
+ - [Registered tools](#registered-tools)
28
+ - [Prerequisites](#prerequisites)
29
+ - [Local development](#local-development)
30
+ - [Contributing](#contributing)
31
+ - [License](#license)
32
+
33
+ ---
34
+
35
+
36
+
37
+ ## Features
38
+
39
+ - **One command** — `/poiesis` does everything: onboard, scaffold, and run chapters
40
+ - **Profile-aware** — scans your GitHub repos to calibrate depth, skips what you already know
41
+ - **Gemini-powered analysis** — feeds the YouTube URL to Gemini, extracts chapters, tech stack, and concepts automatically
42
+ - **Strict TDD flow** — Pi writes the tests; you never write tests. Chapters cannot be marked done until tests are green
43
+ - **Interactive test-plan review** — a full-screen TUI dialog lets you approve, add, or trim checkpoints before a single test is written
44
+ - **Command review gate** — every shell command Pi wants to run is intercepted and shown to you first: run, steer, skip, or ask for an explanation
45
+ - **Theory quizzes** — wrong answers are implemented and run so you see the failure before the fix
46
+ - **Prerequisite gate** — if a chapter's tech is new to you, Pi runs a short primer before the chapter starts
47
+ - **Session-safe** — chapter state persists across context compactions; Pi picks up exactly where it left off
48
+
49
+ ---
50
+
51
+
52
+
53
+ ## Install
54
+
55
+ ```bash
56
+ pi install npm:@shanvit7/poiesis
57
+ ```
58
+
59
+ Requires a free Gemini API key — get one at [aistudio.google.com](https://aistudio.google.com/app/apikey):
60
+
61
+ ```bash
62
+ export GEMINI_API_KEY=your-key-here
63
+ ```
64
+
65
+ ---
66
+
67
+
68
+
69
+ ## Usage
70
+
71
+ Everything runs through one command:
72
+
73
+ ```bash
74
+ /poiesis
75
+ ```
76
+
77
+ Pi decides what to do based on context:
78
+
79
+
80
+ | Situation | What happens |
81
+ | --------------------------------- | ---------------------------------------------------------------------------------- |
82
+ | No profile yet | Onboarding — pi scans your GitHub and asks a few questions to build your profile |
83
+ | Profile exists, no active project | Pi asks for a YouTube URL, analyzes the video with Gemini, and scaffolds a project |
84
+ | Inside an active project | Pi resumes the chapter session from where you left off |
85
+
86
+
87
+ ---
88
+
89
+
90
+
91
+ ## What a session looks like
92
+
93
+
94
+
95
+ ### Onboarding
96
+
97
+ Pi scans your GitHub repos (or you describe your projects if preferred) to understand your stack and background. This calibrates every chapter going forward — what to explain, what to skip, and how deep to go.
98
+
99
+ Profile is saved to `~/.poiesis/user-profile.json`.
100
+
101
+ ### Project setup
102
+
103
+ Paste a YouTube URL. Pi uses Gemini to analyze the video — chapters, tech stack, concepts, and key takeaways — then scaffolds a project directory:
104
+
105
+ ```
106
+ <project-name>/
107
+ .poiesis/
108
+ chapters/
109
+ .progress.json ← tracks current chapter and test status
110
+ chapter-index.md ← video overview and chapter map
111
+ chapter-1.md ← concepts, learning goals, tutor notes
112
+ chapter-2.md
113
+ ...
114
+ .gitignore
115
+ ```
116
+
117
+
118
+
119
+ ### Chapter session
120
+
121
+ Each chapter follows a structured flow:
122
+
123
+ 1. **Prerequisite gate** — Pi checks whether the chapter's tech is familiar given your profile. If not, it runs a short quiz and primes you before starting.
124
+ 2. **Theory and quiz** — Pi explains the core concepts for this chapter. Wrong answers are implemented and tested so you see the failure before the correction.
125
+ 3. **Test plan** — Pi proposes what to verify, shown in a full-screen dialog. You approve or adjust.
126
+ 4. **Test file** — Pi writes the test file. You do not write tests.
127
+ 5. **Implementation** — Pi codes through the chapter, narrating each decision. You make design calls when asked; Pi handles all shell commands.
128
+ 6. **Done** — Tests pass, chapter is marked complete, next chapter queued.
129
+
130
+ Pi runs all commands. You only answer questions.
131
+
132
+ ---
133
+
134
+
135
+
136
+ ## Command review
137
+
138
+ During an active chapter session, every shell command Pi wants to execute is intercepted and shown to you in a TUI review dialog before it runs:
139
+
140
+ ```
141
+ ╔══════════════════════════════════╗
142
+ ║ Command Review ║
143
+ ║ ║
144
+ ║ npx vitest run tests/ch-1.test ║
145
+ ║ ║
146
+ ╟──────────────────────────────────╢
147
+ ║ > Run it ║
148
+ ║ Steer ║
149
+ ║ Skip — don't run this ║
150
+ ║ Explain first ║
151
+ ╚══════════════════════════════════╝
152
+ ```
153
+
154
+
155
+ | Choice | What happens |
156
+ | ----------------- | ------------------------------------------------------------------------- |
157
+ | **Run it** | Command executes immediately |
158
+ | **Steer** | You type a correction (e.g. "use pnpm, not npm") — Pi adjusts and retries |
159
+ | **Skip** | Command is blocked; Pi continues without running it |
160
+ | **Explain first** | Pi explains what the command does and why before re-proposing |
161
+
162
+
163
+ Read-only commands (`cat`, `ls`, `grep`, `find`, etc.) are auto-approved and bypass the dialog.
164
+
165
+ ---
166
+
167
+
168
+
169
+ ## Project structure
170
+
171
+ ```
172
+ ~/.poiesis/
173
+ user-profile.json ← your stack and recent projects (built during onboarding)
174
+ ```
175
+
176
+ ```
177
+ <project-name>/
178
+ .poiesis/
179
+ chapters/
180
+ .progress.json
181
+ chapter-N.md
182
+ ```
183
+
184
+ ---
185
+
186
+
187
+
188
+ ## Bundled extensions and skills
189
+
190
+
191
+
192
+ ### @juicesharp/rpiv-ask-user-question
193
+
194
+ Registers the `ask_user_question` tool — a structured TUI option selector with typed choices and a free-text fallback. Pi uses this throughout onboarding and chapter sessions wherever a multiple-choice prompt is more precise than a free-form reply.
195
+
196
+ Source: [npmjs.com/package/@juicesharp/rpiv-ask-user-question](https://www.npmjs.com/package/@juicesharp/rpiv-ask-user-question)
197
+
198
+ ### agent-browser (skill)
199
+
200
+ When Pi is unsure about an API, config shape, or error message during your session, it opens the relevant documentation in a headless browser and quotes the live source rather than guessing from training data.
201
+
202
+ Both are loaded automatically — you don't need to invoke them manually.
203
+
204
+ ---
205
+
206
+
207
+
208
+ ## Registered tools
209
+
210
+ The extension registers the following tools, which Pi calls internally during chapter sessions:
211
+
212
+
213
+ | Tool | Purpose |
214
+ | --------------------------- | --------------------------------------------------------- |
215
+ | `poiesis_save_profile` | Persists the user profile after onboarding |
216
+ | `poiesis_confirm_test_plan` | Shows the test-plan TUI and captures the student's choice |
217
+ | `poiesis_run_tests` | Runs the chapter's test suite and records pass/fail |
218
+ | `poiesis_chapter_done` | Marks a chapter complete — gated on tests passing |
219
+ | `poiesis_prereq_done` | Records the prereq gate result and fires the theory step |
220
+ | `poiesis_theory_done` | Fires the test-plan step once theory is understood |
221
+ | `poiesis_tests_written` | Records the test file path and fires the implement step |
222
+
223
+
224
+ ---
225
+
226
+
227
+
228
+ ## Prerequisites
229
+
230
+ - `[pi](https://pi.earendil.works)` — the coding agent
231
+ - `GEMINI_API_KEY` — free at [aistudio.google.com](https://aistudio.google.com/app/apikey)
232
+
233
+ ---
234
+
235
+
236
+
237
+ ## Local development
238
+
239
+ ```bash
240
+ # Install from local path
241
+ pi install /path/to/poiesis/apps/pi-extension
242
+
243
+ # Test without installing
244
+ pi -e /path/to/poiesis/apps/pi-extension
245
+
246
+ # Hot-reload after edits (inside pi)
247
+ /reload
248
+ ```
249
+
250
+ ---
251
+
252
+
253
+
254
+ ## Contributing
255
+
256
+ Contributions are very welcome — whether it's a bug fix, a new feature, better prompts, or just improving the docs.
257
+
258
+ ### Ways to contribute
259
+
260
+ - **Bug reports** — open an issue with steps to reproduce and the chapter/step where it broke
261
+ - **Feature ideas** — open a discussion; the best ones get fast-tracked
262
+ - **Code** — fork, branch off `main`, open a PR; see the dev loop above
263
+ - **Prompts** — the `prompts/` directory contains the step prompts Pi uses; improving them has the highest leverage
264
+ - **Eval cases** — `promptfooconfig.yaml` drives the evals; adding cases for tricky scenarios is incredibly valuable
265
+
266
+
267
+
268
+ ### Getting started
269
+
270
+ ```bash
271
+ git clone https://github.com/shanvit7/poiesis
272
+ cd poiesis
273
+ pnpm install
274
+ cd apps/pi-extension
275
+ bun install
276
+ ```
277
+
278
+ Run the evals:
279
+
280
+ ```bash
281
+ cd apps/pi-extension
282
+ pnpm eval
283
+ ```
284
+
285
+
286
+
287
+ ### Guidelines
288
+
289
+ - The command-review gate must not be bypassable during an active session
290
+ - Prompts live in `prompts/`; logic lives in `src/`; keep them separate
291
+ - Open an issue before a large refactor so we can align first
292
+
293
+ All contributors are credited in the changelog.
294
+
295
+ ---
296
+
297
+
298
+
299
+ ## License
300
+
301
+ MIT © [shanvit7](https://github.com/shanvit7)
302
+
303
+ See [LICENSE](./LICENSE) for the full text.