-
Notifications
You must be signed in to change notification settings - Fork 36
New example for onboarding people + template for generating pddrc file #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Added the pddrc generation template (works based on the architecture json file) |
|
Some initial quick thoughts (without hands-on with the example):
|
|
Thanks for the suggestions, James! I’ll try to implement these. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a comprehensive template system for the PDD (Prompt Driven Development) linter project, providing both an example onboarding workflow and a generic template for generating .pddrc configuration files. The additions enhance the developer experience by providing clear documentation patterns and automated configuration generation capabilities.
Key Changes:
- Added generic
.pddrcgeneration template to help projects adopt PDD practices - Introduced extensive test suite for the prompts_linter example application
- Added core implementation files for the linter (rules, models, pipeline, report, llm, helpers, fix modules)
- Created CLI and frontend interfaces for the linter application
Reviewed changes
Copilot reviewed 49 out of 49 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| pdd/templates/generic/generate_pddrc_YAML.prompt | Template for generating PDD configuration files from architecture.json |
| examples/prompts_linter/tests/*.py | Comprehensive test suite covering models, rules, pipeline, report, llm, helpers, fix, cli, and frontend |
| examples/prompts_linter/src/utils/*.py | Core utility modules implementing linting logic, LLM integration, models, and reporting |
| examples/prompts_linter/src/cli/cli.py | Command-line interface implementation |
| examples/prompts_linter/src/frontend/frontend_streamlit.py | Streamlit web interface |
| examples/prompts_linter/src/backend/backend_api.py | FastAPI backend service |
| examples/prompts_linter/prompts/*.prompt | Prompt definitions for generating each module |
Comments suppressed due to low confidence (1)
examples/prompts_linter/src/utils/llm.py:1
- The key "gemini" should be "google" to match the provider name used in
get_provider_and_modelfunction (lines 96-105) where it checks for "google" and referencesDEFAULT_MODELS["google"].
import os
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gltanaka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice job!!
The prompts can be more compact but this might be a more of a function of the generate prompt template needing to be improved
| You are an expert Python developer specializing in CLI tools using Typer and Rich. Your task is to implement the Command Line Interface (CLI) for the PDD Prompt Linter. This module, located at `src/cli/cli.py`, serves as the primary entry point for users interacting with the tool via the terminal. It is responsible for parsing arguments, configuring the runtime environment based on flags, invoking the central pipeline orchestrator, rendering the final report to the user, and handling fixed prompt output. | ||
|
|
||
| Requirements | ||
| 1. **Argument Parsing**: Use `Typer` to define the CLI application. The main command must accept a mandatory `PROMPT_FILE` argument (path to the file to lint). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe including the spec would have made the list of args unnecessary and prompt more compact?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would have increased the tokens, so decided not to include it for now - should the PDD prompt generation template have included the spec automatically? Or can it only include files from prompts, contexts/examples, code, and tests?
| @@ -0,0 +1,108 @@ | |||
| <prompt> | |||
| You are an expert Python developer architecting the `src/utils/fix.py` module for the PDD Prompt Linter. This module is the remediation engine responsible for transforming an original prompt text into a compliant version based on the analysis provided in a `Report` object. It operates in two modes: applying specific text replacements suggested by the LLM (patching) and enforcing structural integrity when critical PDD elements are missing (scaffolding). | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a preamble might eliminate redundancies between prompts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A preamble generated by PDD? - could be a new template in the future maybe?
|
Updates:
Note: Fixing the project dependency bug improved both project generation time and output quality |
|
thanks for your, can you address the copilot comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 52 out of 52 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Addressed the comments |
|
I'm unable to file an issue against your fork so I'll comment bugs here... The requirements.txt includes a clone of your personal pdd fork. That should not be a dependency (& also contradicts the installation steps in the README.) Like this- -e git+https://github.com/Frostday/pdd.git@8df53aa2da1bc000832ad8038c2c092d99135bf1#egg=pdd_cli |
|
Bug: linter cli exits with error and warning. pwd/home/james/dhrub-example/pdd/examples/prompts_linter pdd --versionpdd, version 0.0.105 cat /etc/issueUbuntu 24.04.3 LTS \n \l python -m src.cli.cli prompts/backend_api_python.promptUnexpected error during pipeline execution: 1 validation error for Issue |
|
Thanks for raising the issue, James. I've updated the requirements and README to install pdd separately for now. Also, the issue was caused by a rare edge case where the LLM returned an empty rule. This has now been addressed by adding a test and regenerating. One additional point to note is that I’ve only been able to use this tool with Vertex models, as those are the only ones I currently have access to. Noticed a potential issue: when I run pdd sync, it always extends the test cases first - even when the current tests are failing (maybe it should only extend if the current tests are passing?) |
|
Installation fails on dependency versions - when pdd-cli is installed with pip. Pdd 0.0.106. Try creating a clean environment from scratch, install pdd-cli with pip, then install the example according to the README instructions. Dependency installation (pip install -r ...) will fail on version issues. I hand edited requirements.text multiple times to loosen version restrictions, but there's a bit of a cascade of dependency issues I ran into. |
|
Did you try the alternate installation method? |
|
Cleaned up the requirements so that file should also work now. |
Did you test this fix in a clean environment? |
Yeah - Python 3.12 |
still seeing some conflicts (boldfaced)[stuff removed] |
|
Another thing the --fix option doesn't seem to do much. Other than that, I was able to test cli and web UIs (after working around the requiements.txt issue). |
I built this tool using PDD v0.0.104 I think. I recommend using that version, as I don’t have control over dependency updates in future versions of the PDD package. It should work reliably with v0.0.104 or v0.0.100. Also, the pydantic and rich packages should generally be compatible even if you’re using different versions. Could you share what changes you had to make to your environment to get the tool running? |
Yes, I’m planning further model optimization and prompt refinements to improve the --fix functionality in v2. For now, the primary purpose of this example is to help with onboarding. |







Issue - #135 and #244