ptbk 0.112.0-35 → 0.112.0-38

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 (2) hide show
  1. package/README.md +119 -18
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -327,24 +327,6 @@ You can install all of them at once:
327
327
  npm i ptbk
328
328
  ```
329
329
 
330
- Promptbook also ships coding-agent CLI utilities through `ptbk coder`.
331
- For full `coder run` options and runner-specific examples, see [`scripts/run-codex-prompts/README.md`](./scripts/run-codex-prompts/README.md).
332
-
333
- #### `ptbk coder`
334
-
335
- Locally in this repository:
336
-
337
- ```bash
338
- npx ts-node ./src/cli/test/ptbk.ts coder run --dry-run
339
- ```
340
-
341
- In another project with `ptbk` installed:
342
-
343
- ```bash
344
- npm install ptbk
345
- npx ptbk coder run --dry-run
346
- ```
347
-
348
330
  Or you can install them separately:
349
331
 
350
332
  > ⭐ Marked packages are worth to try first
@@ -382,6 +364,125 @@ Or you can install them separately:
382
364
 
383
365
 
384
366
 
367
+ ### 🤖 Promptbook Coder
368
+
369
+ `ptbk coder` is Promptbook's workflow layer for AI-assisted software changes. Instead of opening one chat and manually copy-pasting tasks, you keep a queue of coding prompts in `prompts/*.md`, let a coding agent execute the next ready task, and then verify the result before archiving the prompt.
370
+
371
+ Promptbook Coder is **not another standalone coding model**. It is an orchestration layer over coding agents such as **GitHub Copilot**, **OpenAI Codex**, **Claude Code**, **Opencode**, **Cline**, and **Gemini CLI**. The difference is that Promptbook Coder adds a repeatable repository workflow on top of them:
372
+
373
+ - prompt files with explicit statuses like `[ ]`, `[x]`, and `[-]`
374
+ - automatic selection of the next runnable task, including priority support
375
+ - optional shared repo context loaded from a file such as `AGENTS.md`
376
+ - automatic `git add`, commit, and push after each successful prompt
377
+ - dedicated coding-agent Git identity and optional GPG signing
378
+ - verification and repair flow for work that is done, partial, or broken
379
+ - helper commands for generating boilerplates and finding refactor prompts
380
+
381
+ In short: tools like Claude Code, Codex, or GitHub Copilot are the **engines**; Promptbook Coder is the **workflow** that keeps coding work structured, reviewable, and repeatable across many prompts.
382
+
383
+ #### How the workflow works
384
+
385
+ 1. `ptbk coder init` prepares the project for the coder workflow, seeds project-owned generic templates in `prompts/templates/`, creates a starter `AGENTS.md` context file, adds helper `npm run coder:*` scripts, ensures `.gitignore` ignores `/.tmp`, and configures VS Code prompt screenshots in `prompts/screenshots/`.
386
+ 2. `ptbk coder generate-boilerplates` creates prompt files in `prompts/`.
387
+ 3. You replace placeholder `@@@` sections with real coding tasks.
388
+ 4. `ptbk coder run` sends the next ready `[ ]` prompt to the selected coding agent.
389
+ 5. Promptbook Coder marks the prompt as done `[x]`, records runner metadata, then stages, commits, and pushes the resulting changes.
390
+ 6. `ptbk coder verify` reviews completed prompts, archives finished files to `prompts/done/`, and appends a repair prompt when more work is needed.
391
+
392
+ Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treated as not fully written, and prompts with more `!` markers have higher priority.
393
+
394
+ #### Features
395
+
396
+ - **Multi-runner execution:** `openai-codex`, `github-copilot`, `cline`, `claude-code`, `opencode`, `gemini`
397
+ - **Context injection:** `--context AGENTS.md` or inline extra instructions
398
+ - **Reasoning control:** `--thinking-level low|medium|high|xhigh` for supported runners
399
+ - **Interactive or unattended runs:** default wait mode, or `--no-wait` for batch execution
400
+ - **Git safety:** clean working tree check by default, optional `--ignore-git-changes`
401
+ - **Prompt triage:** `--priority` to process only more important tasks first
402
+ - **Failure logging:** failed runs write a neighboring `.error.log`
403
+ - **Line-ending normalization:** changed files are normalized back to LF by default
404
+
405
+ #### Local usage in this repository
406
+
407
+ When working on Promptbook itself, the repository usually runs the CLI straight from source:
408
+
409
+ ```bash
410
+ npx ts-node ./src/cli/test/ptbk.ts coder init
411
+
412
+ npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompts/templates/common.md
413
+
414
+ npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompts/templates/agents-server.md
415
+
416
+ npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
417
+
418
+ npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
419
+
420
+ npx ts-node ./src/cli/test/ptbk.ts coder find-refactor-candidates
421
+
422
+ npx ts-node ./src/cli/test/ptbk.ts coder find-refactor-candidates --level xhigh
423
+
424
+ npx ts-node ./src/cli/test/ptbk.ts coder verify
425
+ ```
426
+
427
+ #### Using `ptbk coder` in an external project
428
+
429
+ If you want to use the workflow in another repository, install the package and invoke the `ptbk` binary. After local installation, `npx ptbk ...` is the most portable form; plain `ptbk ...` also works when your environment exposes the local binary on `PATH`.
430
+
431
+ ```bash
432
+ npm install ptbk
433
+
434
+ ptbk coder init
435
+
436
+ npx ptbk coder generate-boilerplates
437
+
438
+ npx ptbk coder generate-boilerplates --template prompts/templates/common.md
439
+
440
+ npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
441
+
442
+ npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
443
+
444
+ npx ptbk coder find-refactor-candidates
445
+
446
+ npx ptbk coder find-refactor-candidates --level xhigh
447
+
448
+ npx ptbk coder verify
449
+ ```
450
+
451
+ `ptbk coder init` also bootstraps a starter `AGENTS.md`, adds `package.json` scripts for the four main coder commands, adds the coder temp ignore to `.gitignore`, and configures `.vscode/settings.json` so pasted images from `prompts/*.md` land in `prompts/screenshots/`.
452
+
453
+ #### What each command does
454
+
455
+ | Command | What it does |
456
+ | --- | --- |
457
+ | `ptbk coder init` | Creates `prompts/`, `prompts/done/`, the project-generic template files materialized in `prompts/templates/` (currently `common.md`), and a starter `AGENTS.md`; ensures `.env` contains `CODING_AGENT_GIT_NAME`, `CODING_AGENT_GIT_EMAIL`, and `CODING_AGENT_GIT_SIGNING_KEY`; adds helper coder scripts to `package.json`; ensures `.gitignore` contains `/.tmp`; and configures `.vscode/settings.json` to save pasted prompt images into `prompts/screenshots/`. |
458
+ | `ptbk coder generate-boilerplates` | Creates new prompt markdown files with fresh emoji tags so you can quickly fill in coding tasks; `--template` accepts either a built-in alias or a markdown file path relative to the project root. |
459
+ | `ptbk coder run` | Picks the next ready prompt, appends optional context, runs it through the selected coding agent, marks success or failure, then commits and pushes the result. |
460
+ | `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors; `--level <low|medium|high|xhigh>` makes the scan more or less aggressive. |
461
+ | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
462
+
463
+ #### Most useful `ptbk coder run` flags
464
+
465
+ | Flag | Purpose |
466
+ | --- | --- |
467
+ | `--agent <name>` | Selects the coding backend. |
468
+ | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
469
+ | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
470
+ | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
471
+ | `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
472
+ | `--ignore-git-changes` | Disables the clean-working-tree guard. |
473
+ | `--priority <n>` | Runs only prompts at or above the given priority. |
474
+ | `--dry-run` | Prints which prompts are ready instead of executing them. |
475
+ | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
476
+ | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
477
+
478
+ #### Typical usage pattern
479
+
480
+ 1. Initialize once with `ptbk coder init`.
481
+ 2. Customize `prompts/templates/*.md` if needed, then create or write prompt files in `prompts/`.
482
+ 3. Customize the starter `AGENTS.md` with repository-specific instructions, then pass `--context AGENTS.md`.
483
+ 4. Run one prompt at a time interactively, or use `--no-wait` for unattended batches.
484
+ 5. Finish with `ptbk coder verify` so resolved prompts are archived and broken ones get explicit repair follow-ups.
485
+
385
486
 
386
487
 
387
488
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptbk",
3
- "version": "0.112.0-35",
3
+ "version": "0.112.0-38",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -91,10 +91,10 @@
91
91
  "zod": "$zod"
92
92
  },
93
93
  "peerDependencies": {
94
- "@promptbook/core": "0.112.0-35"
94
+ "@promptbook/core": "0.112.0-38"
95
95
  },
96
96
  "dependencies": {
97
- "promptbook": "0.112.0-35"
97
+ "promptbook": "0.112.0-38"
98
98
  },
99
99
  "bin": {
100
100
  "ptbk": "bin/promptbook-cli-proxy.js"