You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Merge upstream/main: resolve conflict keeping both #203 and #349 tests
The conflict was in tests/test_sync_determine_operation.py where both
issue #203 (stale test detection) and issue #349 (infinite loop fix)
added new test classes at the end of the file. Both sets are retained.
@# Update CHANGELOG.md with changes from this release
648
648
@echo "Updating CHANGELOG.md..."
649
-
@claude --dangerously-skip-permissions -p "do a git diff between the prior version and the current version to update CHANGELOG.md to make the description more accurate and complete but concise. Be sure to not missing any updates. We are using a prompt driven development approach: docs/prompting_guide.md."
649
+
@claude --dangerously-skip-permissions -p "Update CHANGELOG.md for the latest release. Steps: \
650
+
1. Run 'git tag | tail -2' to find the prior and current version tags. \
651
+
2. Run 'git diff <prior>..HEAD --stat' and 'git log <prior>..HEAD --oneline' to see all changes. \
652
+
3.Forfileswithsignificantchanges(>20linesinthestat),run'gitdiff<prior>..HEAD--<file>'tounderstandtheSEMANTICmeaningofthechange,notjustthatlineschanged.Lookfor: new features, behavior changes, removed constants/functions, generalized logic. \
653
+
4. Note any DELETED files (shown as 'delete mode' or '0 insertions, N deletions') - these are often meaningful (e.g., removed prompts, deprecated modules). \
654
+
5.IMPORTANT: PR numbers in merge commits (e.g., 'Merge pull request #337') are from the FORK (gltanaka/pdd), NOT the public repo (promptdriven/pdd). Do NOT include fork PR numbers in the CHANGELOG - they will confuse users who look them up on the public repo. \
655
+
6. For external contributor credits ONLY: use 'gh pr list --repo promptdriven/pdd --state merged --limit 20' to find upstream PRs. Verify PRs exist with 'gh pr view <num> --repo promptdriven/pdd --json state,title'. Only credit PRs that are actually merged on promptdriven/pdd. \
656
+
7. Organize changes into sections: Feat, Fix, Build, Refactor, Docs. \
657
+
8. Keep descriptions concise but complete. Every significant code change should be represented. \
658
+
We are using a prompt driven development approach: docs/prompting_guide.md."
-`pdd bug <issue-url>` - Create failing tests for bugs
30
30
-`pdd fix <issue-url>` - Fix the failing tests
31
+
-`pdd generate <issue-url>` - Generate architecture.json from a PRD issue (8-step workflow)
32
+
-`pdd test <issue-url>` - Generate UI tests from issue descriptions (9-step workflow)
31
33
32
34
For prompt-based workflows, the **`sync`** command automates the complete development cycle with intelligent decision-making, real-time visual feedback, and sophisticated state management.
When the positional argument is a GitHub issue URL instead of a prompt file, `generate` enters agentic architecture mode. The issue body serves as the PRD (Product Requirements Document), and an 8-step agentic workflow generates `architecture.json` automatically.
3.**Research**: Web search for tech stack documentation and best practices
1019
+
4.**Design**: Module breakdown with dependency graph and priority ordering
1020
+
5.**Research Dependencies**: Find relevant API docs and code examples per module
1021
+
6.**Generate**: Produce complete `architecture.json` with proper priorities
1022
+
7.**Validate**: Check for circular deps, priority ordering, missing deps
1023
+
8.**Fix**: Auto-fix validation issues (loops back to step 7, max 5 iterations)
1024
+
1025
+
Prerequisites:
1026
+
-`gh` CLI must be installed and authenticated
1027
+
- The issue must contain a PRD describing the project scope
1028
+
1029
+
**Workflow Resumption**: Re-running `pdd generate <issue-url>` resumes from the last completed step. State is persisted to GitHub issue comments for cross-machine resume.
1030
+
1031
+
**Hard Stops**: The workflow stops if the PRD content is insufficient, the tech stack is ambiguous, or clarification is needed. Address the issue and re-run.
Templates are reusable prompt files that generate a specific artifact (code, JSON, tests, etc.). Templates carry human/CLI metadata in YAML front matter (parsed by the CLI and not sent to the LLM), while the body stays concise and model‑focused.
Architecture entries support an optional `context_urls` array that associates web documentation references with each module. When prompts are generated from the architecture (via `generate_prompt`), these URLs are emitted as `<web>` tags in the Dependencies section, enabling the LLM to fetch relevant API documentation during code generation.
{"url": "https://docs.pydantic.dev/latest/concepts/models/", "purpose": "Pydantic model validation"}
1160
+
],
1161
+
...
1162
+
}
1163
+
```
1164
+
1165
+
The `context_urls` field is populated automatically by the agentic architecture workflow (step 5: research dependencies) but can also be added manually to any architecture entry.
1166
+
1113
1167
Front Matter (YAML) metadata
1114
1168
1115
1169
- Templates include YAML front matter with human-readable metadata:
@@ -1414,6 +1468,10 @@ Arguments:
1414
1468
1415
1469
Options:
1416
1470
- `--output LOCATION`: Specify where to save the generated example code. The default file name is `<basename>_example.<language_file_extension>`. If an environment variable `PDD_EXAMPLE_OUTPUT_PATH` is set, the file will be saved in that path unless overridden by this option.
1471
+
- `--format FORMAT`: Output format for the generated example (default: `code`). Valid values:
1472
+
- `code`: Uses the language-specific file extension (e.g., `.py` for Python, `.js` for JavaScript)
1473
+
- `md`: Generates markdown format with `.md` extension
1474
+
When `--format` is specified with an explicit `--output` path, the format option constrains the output file extension accordingly.
1417
1475
1418
1476
Where used:
1419
1477
- Dependency references: Examples serve as lightweight (token efficient) interface references for other prompts and can be included as dependencies of a generate target.
@@ -1429,6 +1487,64 @@ pdd [GLOBAL OPTIONS] example --output examples/factorial_calculator_example.py f
1429
1487
1430
1488
### 4. test
1431
1489
1490
+
Generate or enhance unit tests for a given code file and its corresponding prompt file. Also supports **agentic mode** for generating UI tests from GitHub issues.
1491
+
1492
+
#### Agentic Mode (UI Test Generation)
1493
+
1494
+
Generate UI tests from a GitHub issue. The issue describes what needs to be tested (a webpage, CLI, or desktop app), and an agentic workflow analyzes the target, creates a test plan, and generates comprehensive UI tests.
1495
+
1496
+
```
1497
+
pdd [GLOBAL OPTIONS] test <github-issue-url>
1498
+
```
1499
+
1500
+
**How it works (9-step workflow with GitHub comments):**
1501
+
1502
+
1. **Duplicate check** - Search for existing issues describing the same test requirements. If found, merge content and close the duplicate. Posts comment with findings.
1503
+
1504
+
2. **Documentation check** - Review repo documentation and codebase to understand what needs to be tested. Posts comment with findings.
1505
+
1506
+
3. **Analyze & clarify** - Determine if enough information exists in the issue to create tests. Posts comment requesting clarification if needed.
1507
+
1508
+
4. **Detect frontend** - Identify the frontend type: web UI (Next.js, React, etc.), CLI, or desktop app. Determines the appropriate testing framework (e.g., Playwright for web). Posts comment with frontend analysis.
1509
+
1510
+
5. **Create test plan** - Design a comprehensive test plan and verify it's achievable. Posts comment requesting information (e.g., credential access) if plan is blocked.
1511
+
1512
+
6. **Generate tests** - Create UI tests in a new worktree following the test plan. Posts comment with generated test code.
1513
+
1514
+
7. **Run tests** - Execute the generated tests against the target. Posts comment with test results.
1515
+
1516
+
8. **Fix & iterate** - Fix any failing tests and re-run until they pass. Posts comment with fix attempts and final status.
1517
+
1518
+
9. **Submit PR** - Create a draft pull request with the UI tests linked to the issue. Posts comment with PR link.
1519
+
1520
+
**Agentic Options:**
1521
+
- `--timeout-adder FLOAT`: Add additional seconds to each step's timeout (default: 0.0)
1522
+
- `--no-github-state`: Disable GitHub issue comment-based state persistence, use local-only
1523
+
- `--manual`: Use legacy prompt-based mode instead of agentic mode
1524
+
1525
+
**Cross-Machine Resume**: By default, workflow state is stored in a hidden comment on the GitHub issue, enabling resume from any machine. Use `--no-github-state` to disable this feature. You can also set `PDD_NO_GITHUB_STATE=1` environment variable.
1526
+
1527
+
**Example (Agentic Mode):**
1528
+
```bash
1529
+
# Generate UI tests from a GitHub issue
1530
+
pdd test https://github.com/myorg/myrepo/issues/789
1531
+
1532
+
# Resume after answering clarifying questions
1533
+
pdd test https://github.com/myorg/myrepo/issues/789
1534
+
```
1535
+
1536
+
**Next Step - Fixing Test Issues:**
1537
+
1538
+
If the generated tests reveal issues that need code fixes, use `pdd fix` with the same issue URL:
- `--manual`: Use manual mode with explicit file arguments (required for legacy/single dev-unit fixing).
1614
1731
- `--verbose`: Show detailed output during processing.
1615
1732
- `--quiet`: Suppress all output except errors.
1733
+
- `--protect-tests/--no-protect-tests`: When enabled, prevents the LLM from modifying test files. The LLM will treat tests as read-only specifications and only fix the code. This is especially useful when tests created by `pdd bug` are known to be correct. Default: `--no-protect-tests`.
1616
1734
1617
1735
#### Agentic E2E Fix Options
1618
1736
- `--timeout-adder FLOAT`: Additional seconds to add to each step's timeout (default: 0.0).
5. **Root cause analysis** - Run experiments to identify the root cause. Posts comment explaining the root cause.
2056
2177
2178
+
5.5. **Prompt classification** - Determine if the bug is in the code implementation or in the prompt specification itself. If the prompt is defective, auto-fix the prompt file. Posts comment with classification and any prompt changes. Defaults to "code bug" when uncertain.
2179
+
2057
2180
6. **Test plan** - Design a plan for creating tests to detect the problem. Posts comment with the test plan.
2058
2181
2059
2182
7. **Generate test** - Create the failing unit test. Posts comment with the generated test code.
@@ -2093,6 +2216,12 @@ After `pdd bug` creates failing tests and a draft PR, use `pdd fix` with the sam
2093
2216
pdd fix https://github.com/myorg/myrepo/issues/42
2094
2217
```
2095
2218
2219
+
**Tip:** If `pdd bug` correctly identified the bug and created valid failing tests, use `--protect-tests` to prevent `pdd fix` from modifying the tests. This ensures the LLM only fixes the code to make the tests pass:
See the [fix command](#6-fix) documentation for details on the agentic E2E fix workflow.
2097
2226
2098
2227
### 15. auto-deps
@@ -2246,10 +2375,22 @@ pdd auth login
2246
2375
Displays the active account and current authentication state. Exit code is 0 if authenticated, 1 otherwise.
2247
2376
2248
2377
```bash
2378
+
pdd auth status [OPTIONS]
2379
+
```
2380
+
2381
+
**Options:**
2382
+
- `--verify`: Verify authentication by actually attempting to refresh the token. Without this flag, only cached credentials are checked.
2383
+
2384
+
**Examples:**
2385
+
```bash
2386
+
# Quick check (uses cached credentials)
2249
2387
pdd auth status
2388
+
2389
+
# Deep verification (attempts token refresh)
2390
+
pdd auth status --verify
2250
2391
```
2251
2392
2252
-
**Note:** If only a refresh token exists (no cached JWT), the status will show "Authenticated as: Unknown" since user info is extracted from the cached JWT. Run `pdd auth login` to refresh the token and display the full account information.
2393
+
**Note:** If only a refresh token exists (no cached JWT), the status will show a warning that the token is expired and will refresh on next use. Use `--verify` to actually test if the refresh will succeed, or run `pdd auth login` to refresh the token immediately.
2253
2394
2254
2395
##### auth logout
2255
2396
@@ -2418,6 +2559,7 @@ PDD automatically detects the appropriate context based on:
2418
2559
3. **Fallback**: Uses `default` context if no path matches
2419
2560
2420
2561
**Available Context Settings**:
2562
+
- `prompts_dir`: Directory where prompt files are located (default: "prompts")
2421
2563
- `generate_output_path`: Where generated code files are saved
2422
2564
- `test_output_path`: Where test files are saved
2423
2565
- `example_output_path`: Where example files are saved
@@ -2462,6 +2604,7 @@ PDD uses several environment variables to customize its behavior:
2462
2604
2463
2605
**Note**: When using `.pddrc` configuration, context-specific settings take precedence over these global environment variables.
2464
2606
2607
+
- **`PDD_PROMPTS_DIR`**: Default directory where prompt files are located (default: "prompts").
2465
2608
- **`PDD_GENERATE_OUTPUT_PATH`**: Default path for the `generate` command.
2466
2609
- **`PDD_EXAMPLE_OUTPUT_PATH`**: Default path for the `example` command.
2467
2610
- **`PDD_TEST_OUTPUT_PATH`**: Default path for the unit test file.
@@ -2486,6 +2629,7 @@ PDD uses several environment variables to customize its behavior:
2486
2629
- **`PDD_VERIFY_RESULTS_OUTPUT_PATH`**: Default path for the results log file generated by the `verify` command.
2487
2630
- **`PDD_VERIFY_CODE_OUTPUT_PATH`**: Default path for the final code file generated by the `verify` command.
2488
2631
- **`PDD_VERIFY_PROGRAM_OUTPUT_PATH`**: Default path for the final program file generated by the `verify` command.
2632
+
- **`PDD_CLOUD_TIMEOUT`**: Cloud request timeout in seconds. Default is 900 (15 minutes). Increase this value if you experience timeouts with long-running cloud operations.
2489
2633
2490
2634
### Configuration Priority
2491
2635
@@ -2599,6 +2743,7 @@ Here are some common issues and their solutions:
2599
2743
7. **Command Timeout**:
2600
2744
- Check internet connection
2601
2745
- Try running with `--local` flag to compare
2746
+
- Increase timeout with `export PDD_CLOUD_TIMEOUT=1800` (30 minutes) for long-running operations
0 commit comments