ptbk 0.112.0-34 → 0.112.0-36

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 +115 -0
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -364,6 +364,121 @@ Or you can install them separately:
364
364
 
365
365
 
366
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 templates in `prompts/templates/`, 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 verify
423
+ ```
424
+
425
+ #### Using `ptbk coder` in an external project
426
+
427
+ 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`.
428
+
429
+ ```bash
430
+ npm install ptbk
431
+
432
+ ptbk coder init
433
+
434
+ npx ptbk coder generate-boilerplates
435
+
436
+ npx ptbk coder generate-boilerplates --template prompts/templates/agents-server.md
437
+
438
+ npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
439
+
440
+ npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
441
+
442
+ npx ptbk coder find-refactor-candidates
443
+
444
+ npx ptbk coder verify
445
+ ```
446
+
447
+ `ptbk coder init` also bootstraps `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/`.
448
+
449
+ #### What each command does
450
+
451
+ | Command | What it does |
452
+ | --- | --- |
453
+ | `ptbk coder init` | Creates `prompts/`, `prompts/done/`, `prompts/templates/common.md`, `prompts/templates/agents-server.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/`. |
454
+ | `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. |
455
+ | `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. |
456
+ | `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors. |
457
+ | `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
458
+
459
+ #### Most useful `ptbk coder run` flags
460
+
461
+ | Flag | Purpose |
462
+ | --- | --- |
463
+ | `--agent <name>` | Selects the coding backend. |
464
+ | `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
465
+ | `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
466
+ | `--thinking-level <level>` | Sets reasoning effort for supported runners. |
467
+ | `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
468
+ | `--ignore-git-changes` | Disables the clean-working-tree guard. |
469
+ | `--priority <n>` | Runs only prompts at or above the given priority. |
470
+ | `--dry-run` | Prints which prompts are ready instead of executing them. |
471
+ | `--allow-credits` | Lets OpenAI Codex spend credits when required. |
472
+ | `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
473
+
474
+ #### Typical usage pattern
475
+
476
+ 1. Initialize once with `ptbk coder init`.
477
+ 2. Customize `prompts/templates/*.md` if needed, then create or write prompt files in `prompts/`.
478
+ 3. Put repository-specific instructions in `AGENTS.md`, then pass `--context AGENTS.md`.
479
+ 4. Run one prompt at a time interactively, or use `--no-wait` for unattended batches.
480
+ 5. Finish with `ptbk coder verify` so resolved prompts are archived and broken ones get explicit repair follow-ups.
481
+
367
482
 
368
483
 
369
484
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptbk",
3
- "version": "0.112.0-34",
3
+ "version": "0.112.0-36",
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-34"
94
+ "@promptbook/core": "0.112.0-36"
95
95
  },
96
96
  "dependencies": {
97
- "promptbook": "0.112.0-34"
97
+ "promptbook": "0.112.0-36"
98
98
  },
99
99
  "bin": {
100
100
  "ptbk": "bin/promptbook-cli-proxy.js"