|
1 | 1 | # PDD (Prompt-Driven Development) Command Line Interface |
2 | 2 |
|
3 | | - [](https://discord.gg/Yp4RTh8bG7) |
| 3 | + [](https://discord.gg/Yp4RTh8bG7) |
4 | 4 |
|
5 | 5 | ## Introduction |
6 | 6 |
|
@@ -285,7 +285,7 @@ export PDD_TEST_OUTPUT_PATH=/path/to/tests/ |
285 | 285 |
|
286 | 286 | ## Version |
287 | 287 |
|
288 | | -Current version: 0.0.88 |
| 288 | +Current version: 0.0.89 |
289 | 289 |
|
290 | 290 | To check your installed version, run: |
291 | 291 | ``` |
@@ -1606,6 +1606,28 @@ pdd [GLOBAL OPTIONS] change --csv --output modified_prompts/ changes_batch.csv s |
1606 | 1606 |
|
1607 | 1607 | Update prompts based on code changes. This command operates in two primary modes: |
1608 | 1608 |
|
| 1609 | +**Agentic Prompt Optimization (Default)** |
| 1610 | +
|
| 1611 | +The `update` command uses an agentic AI (Claude Code, Gemini, or Codex) by default to produce compact, high-quality prompts. The agent has full file access and performs a 4-step optimization: |
| 1612 | +
|
| 1613 | +1. **Assess Differences**: Reads the prompt (including all `<include>` files) and compares against the modified code |
| 1614 | +2. **Filter Using Guide + Tests**: Consults `docs/prompting_guide.md` and existing tests to determine what belongs in the prompt |
| 1615 | +3. **Remove Duplication**: Eliminates redundant content that duplicates included files |
| 1616 | +4. **Validate**: Ensures the prompt is human-readable and can reliably regenerate the code |
| 1617 | +
|
| 1618 | +This produces prompts that are more concise while remaining clear to developers and reliable for code generation. |
| 1619 | +
|
| 1620 | +**Prerequisites**: Requires one of these CLI tools installed and configured: |
| 1621 | +- `claude` (Anthropic Claude Code) |
| 1622 | +- `gemini` (Google Gemini CLI) |
| 1623 | +- `codex` (OpenAI Codex CLI) |
| 1624 | +
|
| 1625 | +If no agentic CLI is available, the command automatically falls back to the legacy 2-stage LLM update process. |
| 1626 | +
|
| 1627 | +**Test-Aware Updates**: When tests exist for a module (e.g., `test_my_module.py`, `test_my_module_1.py`), the agentic update automatically discovers and considers them. Behaviors verified by tests don't need to be explicitly specified in the prompt, resulting in more compact prompts. |
| 1628 | +
|
| 1629 | +**Modes:** |
| 1630 | +
|
1609 | 1631 | 1. **Repository-Wide Mode (Default)**: When run with no file arguments, `pdd update` scans the entire repository. It finds all code/prompt pairs, creates any missing prompt files, and updates all of them based on the latest Git changes. This is the easiest way to keep your entire project in sync. |
1610 | 1632 |
|
1611 | 1633 | 2. **Single-File Mode**: When you provide file arguments, the command operates on a specific file. There are three distinct use cases for this mode: |
@@ -1657,13 +1679,23 @@ Options: |
1657 | 1679 | - `--output LOCATION`: Specify where to save the updated prompt file. **If not specified, the original prompt file is overwritten to maintain it as the authoritative source of truth.** If an environment variable `PDD_UPDATE_OUTPUT_PATH` is set, it will be used only when `--output` is explicitly omitted and you want a different default location. |
1658 | 1680 | - `--git`: Use git history to find the original code file, eliminating the need for the `INPUT_CODE_FILE` argument. |
1659 | 1681 | - `--extensions EXTENSIONS`: In repository-wide mode, filter the update to only include files with the specified comma-separated extensions (e.g., `py,js,ts`). |
| 1682 | +- `--simple`: Use the legacy 2-stage LLM update process instead of the default agentic mode. Useful when agentic CLIs are not available or for faster updates. |
1660 | 1683 |
|
1661 | 1684 | Example (overwrite original prompt - default behavior): |
1662 | 1685 | ``` |
1663 | 1686 | pdd [GLOBAL OPTIONS] update factorial_calculator_python.prompt src/modified_factorial_calculator.py src/original_factorial_calculator.py |
1664 | 1687 | # This overwrites factorial_calculator_python.prompt in place |
1665 | 1688 | ``` |
1666 | 1689 |
|
| 1690 | +Example (agentic vs simple mode): |
| 1691 | +```bash |
| 1692 | +# Default: Agentic mode (uses claude/gemini/codex for intelligent optimization) |
| 1693 | +pdd update --git my_module_python.prompt src/my_module.py |
| 1694 | +
|
| 1695 | +# Legacy: Simple 2-stage LLM update (faster, no agentic CLI required) |
| 1696 | +pdd update --simple --git my_module_python.prompt src/my_module.py |
| 1697 | +``` |
| 1698 | +
|
1667 | 1699 |
|
1668 | 1700 |
|
1669 | 1701 |
|
|
0 commit comments