The Goal: To create a CI/CD pipeline that automatically:
- Lints all prompts to check for syntax and schema errors.
- Verifies the integrity of all locked prompts to prevent unauthorized changes.
The Key Commands
This entire workflow is powered by two key Prompt Lockbox commands that are designed for automation:Lint
Lint
The
plb lint
command scans every single .yml file in your prompts/
directory. It checks for a wide range of issues, including:- Invalid YAML syntax.
- Missing required fields (like
name
orversion
). - Incorrect data types (e.g., a string where a list should be).
- Invalid
Jinja2
syntax in your templates.
(1)
, which is the signal that tells a CI/CD system to fail the job.Verify
Verify
The
plb verify
command is your security guard. It reads your project’s .plb.lock
file and compares the stored secure hashes against the current hashes of the files on disk.It specifically checks for two dangerous conditions:- A TAMPERED file: A prompt that is locked but has been modified.
- A MISSING file: A prompt that is locked but has been deleted.
1
, failing the CI/CD job and protecting your production environment.Setting Up the GitHub Workflow
Now, let’s put these commands together in an automated workflow.1
Create the Workflow File
In your project’s root directory, create a new folder path:
.github/workflows/
. Inside that workflows folder, create a new file named prompt_qa.yml
.2
Add the Workflow Content
Copy and paste the following content into your
prompt_qa.yml file
. This YAML defines a GitHub Actions job that will run on every pull request targeting your main branch.3
Commit and Push
Commit the
prompt_qa.yml
file and push it to your repository.Automation is Now Active!That’s it! From now on, whenever someone opens a Pull Request, GitHub will automatically run these checks. You’ll see a new “Prompt Quality Assurance” check on your PR page. If it passes, you’ll get a
green checkmark
. If it fails, you’ll get a red "X"
, and you can click “Details” to see the output from plb lint
or plb verify
to understand what went wrong.