Overview
A typical prompt development workflow involves:Complete example
Let’s create a prompt for generating API documentation from code.1. Authentication
First, authenticate with GitHub:~/.prompts/config.json (see main.go:395-403).
You can also use
--provider google for Google OAuth (see main.go:155).2. Create package structure
Initialize a new prompt package:3. Configure the manifest
Editprompt.yaml to define your prompt’s metadata and required inputs:
prompt.yaml
The manifest must include
name and version fields for publishing (see main.go:417-425).4. Write the prompt template
Editprompt.md to create your prompt with variable placeholders:
prompt.md
{{variable}} syntax for template variables (see main.go:326-329).
5. Document your prompt
UpdateREADME.md with usage instructions:
README.md
Tags
- documentation
- api
- code-generation
- Validate your
prompt.yamlmanifest (see main.go:209-211) - Create a tarball of your package (see main.go:226-230)
- Upload it to the registry (see main.go:236-238)
7. Install in another project
Now you can install and use your prompt in any project:.prompts/api-doc-generator/ (see main.go:286).
Expected output:
8. Run the prompt
Render the prompt with your variables:Publishing updates
To publish a new version:Publish
Published [email protected]Working with versions
Install specific versions or always get the latest:Searching for prompts
Discover prompts created by the community:Best practices
Package structure
Keep prompts focused
Keep prompts focused
Each prompt package should solve one specific problem. Instead of a general “code-helper” prompt, create:
code-reviewer- Review code for bugs and improvementscode-documenter- Generate documentationcode-explainer- Explain complex code
Use semantic versioning
Use semantic versioning
Follow semver for versions:
1.0.0→1.0.1- Bug fixes or minor improvements1.0.0→1.1.0- New features, backward compatible1.0.0→2.0.0- Breaking changes
Document required inputs
Document required inputs
Always explain what each input does in your README:
Tag appropriately
Tag appropriately
Use descriptive tags to help users find your prompt:
Test before publishing
Test before publishing
Run your prompt locally before publishing:
Variable naming
Use clear, descriptive names
Use clear, descriptive names
❌ Bad:✅ Good:
Mark truly required inputs
Mark truly required inputs
Only mark inputs as
required: true if the prompt cannot function without them (see main.go:318-324):Integration examples
CI/CD pipeline
CI/CD pipeline
Publish prompts automatically:
.github/workflows/publish.yml
NPM scripts
NPM scripts
Add prompt commands to
package.json:package.json
Shell scripts
Shell scripts
Automate prompt rendering:
generate-docs.sh
Troubleshooting
Login timeout
Login timeout
Problem: Login times out after 2 minutes (see main.go:149-151)Solution:
- Ensure port 9876 is not blocked by firewall
- Try
--provider googleif GitHub is blocked - Check that your browser isn’t blocking the callback
Missing required variable
Missing required variable
Problem: Provide all required variables:
error: missing required --var [name]Solution:
Check the manifest for required inputs (see main.go:318-324):Prompt already exists
Prompt already exists
Problem:
prompt already exists; fetch prompt id and publish a new versionSolution:
You’re trying to publish a prompt with a name that’s already taken (see main.go:223). Either:- Choose a different name in
prompt.yaml - If you own the prompt, increment the version and publish again
File exists error
File exists error
Problem:
file exists: [path] (use --force to overwrite)Solution:
The directory already contains files (see main.go:182-186). Use:Next steps
API Reference
Learn about the underlying REST API
Concepts
Understand core concepts of Prompts.dev