@promptbook/cli 0.112.0-35 → 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.
- package/README.md +115 -18
- package/esm/index.es.js +525 -85
- package/esm/index.es.js.map +1 -1
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +127 -0
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/init.d.ts +38 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/umd/index.umd.js +523 -83
- package/umd/index.umd.js.map +1 -1
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +127 -0
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/init.d.ts +38 -0
- package/umd/src/version.d.ts +1 -1
package/README.md
CHANGED
|
@@ -472,24 +472,6 @@ You can install all of them at once:
|
|
|
472
472
|
npm i ptbk
|
|
473
473
|
```
|
|
474
474
|
|
|
475
|
-
Promptbook also ships coding-agent CLI utilities through `ptbk coder`.
|
|
476
|
-
For full `coder run` options and runner-specific examples, see [`scripts/run-codex-prompts/README.md`](./scripts/run-codex-prompts/README.md).
|
|
477
|
-
|
|
478
|
-
#### `ptbk coder`
|
|
479
|
-
|
|
480
|
-
Locally in this repository:
|
|
481
|
-
|
|
482
|
-
```bash
|
|
483
|
-
npx ts-node ./src/cli/test/ptbk.ts coder run --dry-run
|
|
484
|
-
```
|
|
485
|
-
|
|
486
|
-
In another project with `ptbk` installed:
|
|
487
|
-
|
|
488
|
-
```bash
|
|
489
|
-
npm install ptbk
|
|
490
|
-
npx ptbk coder run --dry-run
|
|
491
|
-
```
|
|
492
|
-
|
|
493
475
|
Or you can install them separately:
|
|
494
476
|
|
|
495
477
|
> ⭐ Marked packages are worth to try first
|
|
@@ -527,6 +509,121 @@ Or you can install them separately:
|
|
|
527
509
|
|
|
528
510
|
|
|
529
511
|
|
|
512
|
+
### 🤖 Promptbook Coder
|
|
513
|
+
|
|
514
|
+
`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.
|
|
515
|
+
|
|
516
|
+
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:
|
|
517
|
+
|
|
518
|
+
- prompt files with explicit statuses like `[ ]`, `[x]`, and `[-]`
|
|
519
|
+
- automatic selection of the next runnable task, including priority support
|
|
520
|
+
- optional shared repo context loaded from a file such as `AGENTS.md`
|
|
521
|
+
- automatic `git add`, commit, and push after each successful prompt
|
|
522
|
+
- dedicated coding-agent Git identity and optional GPG signing
|
|
523
|
+
- verification and repair flow for work that is done, partial, or broken
|
|
524
|
+
- helper commands for generating boilerplates and finding refactor prompts
|
|
525
|
+
|
|
526
|
+
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.
|
|
527
|
+
|
|
528
|
+
#### How the workflow works
|
|
529
|
+
|
|
530
|
+
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/`.
|
|
531
|
+
2. `ptbk coder generate-boilerplates` creates prompt files in `prompts/`.
|
|
532
|
+
3. You replace placeholder `@@@` sections with real coding tasks.
|
|
533
|
+
4. `ptbk coder run` sends the next ready `[ ]` prompt to the selected coding agent.
|
|
534
|
+
5. Promptbook Coder marks the prompt as done `[x]`, records runner metadata, then stages, commits, and pushes the resulting changes.
|
|
535
|
+
6. `ptbk coder verify` reviews completed prompts, archives finished files to `prompts/done/`, and appends a repair prompt when more work is needed.
|
|
536
|
+
|
|
537
|
+
Prompts marked with `[-]` are not ready yet, prompts containing `@@@` are treated as not fully written, and prompts with more `!` markers have higher priority.
|
|
538
|
+
|
|
539
|
+
#### Features
|
|
540
|
+
|
|
541
|
+
- **Multi-runner execution:** `openai-codex`, `github-copilot`, `cline`, `claude-code`, `opencode`, `gemini`
|
|
542
|
+
- **Context injection:** `--context AGENTS.md` or inline extra instructions
|
|
543
|
+
- **Reasoning control:** `--thinking-level low|medium|high|xhigh` for supported runners
|
|
544
|
+
- **Interactive or unattended runs:** default wait mode, or `--no-wait` for batch execution
|
|
545
|
+
- **Git safety:** clean working tree check by default, optional `--ignore-git-changes`
|
|
546
|
+
- **Prompt triage:** `--priority` to process only more important tasks first
|
|
547
|
+
- **Failure logging:** failed runs write a neighboring `.error.log`
|
|
548
|
+
- **Line-ending normalization:** changed files are normalized back to LF by default
|
|
549
|
+
|
|
550
|
+
#### Local usage in this repository
|
|
551
|
+
|
|
552
|
+
When working on Promptbook itself, the repository usually runs the CLI straight from source:
|
|
553
|
+
|
|
554
|
+
```bash
|
|
555
|
+
npx ts-node ./src/cli/test/ptbk.ts coder init
|
|
556
|
+
|
|
557
|
+
npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompts/templates/common.md
|
|
558
|
+
|
|
559
|
+
npx ts-node ./src/cli/test/ptbk.ts coder generate-boilerplates --template prompts/templates/agents-server.md
|
|
560
|
+
|
|
561
|
+
npx ts-node ./src/cli/test/ptbk.ts coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
|
|
562
|
+
|
|
563
|
+
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
|
|
564
|
+
|
|
565
|
+
npx ts-node ./src/cli/test/ptbk.ts coder find-refactor-candidates
|
|
566
|
+
|
|
567
|
+
npx ts-node ./src/cli/test/ptbk.ts coder verify
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
#### Using `ptbk coder` in an external project
|
|
571
|
+
|
|
572
|
+
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`.
|
|
573
|
+
|
|
574
|
+
```bash
|
|
575
|
+
npm install ptbk
|
|
576
|
+
|
|
577
|
+
ptbk coder init
|
|
578
|
+
|
|
579
|
+
npx ptbk coder generate-boilerplates
|
|
580
|
+
|
|
581
|
+
npx ptbk coder generate-boilerplates --template prompts/templates/agents-server.md
|
|
582
|
+
|
|
583
|
+
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md
|
|
584
|
+
|
|
585
|
+
npx ptbk coder run --agent github-copilot --model gpt-5.4 --thinking-level xhigh --context AGENTS.md --ignore-git-changes --no-wait
|
|
586
|
+
|
|
587
|
+
npx ptbk coder find-refactor-candidates
|
|
588
|
+
|
|
589
|
+
npx ptbk coder verify
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
`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/`.
|
|
593
|
+
|
|
594
|
+
#### What each command does
|
|
595
|
+
|
|
596
|
+
| Command | What it does |
|
|
597
|
+
| --- | --- |
|
|
598
|
+
| `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/`. |
|
|
599
|
+
| `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. |
|
|
600
|
+
| `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. |
|
|
601
|
+
| `ptbk coder find-refactor-candidates` | Scans the repository for oversized or overpacked files and writes prompt files for likely refactors. |
|
|
602
|
+
| `ptbk coder verify` | Walks through completed prompts, archives truly finished work, and adds follow-up repair prompts for unfinished results. |
|
|
603
|
+
|
|
604
|
+
#### Most useful `ptbk coder run` flags
|
|
605
|
+
|
|
606
|
+
| Flag | Purpose |
|
|
607
|
+
| --- | --- |
|
|
608
|
+
| `--agent <name>` | Selects the coding backend. |
|
|
609
|
+
| `--model <model>` | Chooses the runner model; required for `openai-codex` and `gemini`, optional for `github-copilot`. |
|
|
610
|
+
| `--context <text-or-file>` | Appends extra instructions inline or from a file like `AGENTS.md`. |
|
|
611
|
+
| `--thinking-level <level>` | Sets reasoning effort for supported runners. |
|
|
612
|
+
| `--no-wait` | Skips interactive pauses between prompts for unattended execution. |
|
|
613
|
+
| `--ignore-git-changes` | Disables the clean-working-tree guard. |
|
|
614
|
+
| `--priority <n>` | Runs only prompts at or above the given priority. |
|
|
615
|
+
| `--dry-run` | Prints which prompts are ready instead of executing them. |
|
|
616
|
+
| `--allow-credits` | Lets OpenAI Codex spend credits when required. |
|
|
617
|
+
| `--auto-migrate` | Runs testing-server database migrations after each successful prompt. |
|
|
618
|
+
|
|
619
|
+
#### Typical usage pattern
|
|
620
|
+
|
|
621
|
+
1. Initialize once with `ptbk coder init`.
|
|
622
|
+
2. Customize `prompts/templates/*.md` if needed, then create or write prompt files in `prompts/`.
|
|
623
|
+
3. Put repository-specific instructions in `AGENTS.md`, then pass `--context AGENTS.md`.
|
|
624
|
+
4. Run one prompt at a time interactively, or use `--no-wait` for unattended batches.
|
|
625
|
+
5. Finish with `ptbk coder verify` so resolved prompts are archived and broken ones get explicit repair follow-ups.
|
|
626
|
+
|
|
530
627
|
|
|
531
628
|
|
|
532
629
|
|