Built-in Prompts
SwissArmyHammer includes a comprehensive set of built-in prompts designed to assist with various development tasks. These prompts use Liquid templating for dynamic, customizable assistance and are organized by category for easy discovery.
Overview
All built-in prompts:
- Support customizable arguments with sensible defaults
- Use Liquid syntax for variable substitution and control flow
- Are organized into logical categories for easy discovery
- Follow a standardized YAML front matter format
Categories
System Management
are_issues_complete
Check if the plan is complete.
Arguments: None
Example:
swissarmyhammer prompt test are_issues_complete
are_reviews_done
Check if all the code review items are complete.
Arguments: None
Example:
swissarmyhammer prompt test are_reviews_done
are_tests_passing
Check if all tests are passing.
Arguments: None
Example:
swissarmyhammer prompt test are_tests_passing
Issue Management
branch (issue_branch)
Create an issue work branch for the next issue to work
Arguments: None
Example:
swissarmyhammer prompt test branch
issue_complete
Mark an issue as complete
Arguments: None
Example:
swissarmyhammer prompt test issue_complete
Code Development
code/issue (do_issue)
Code up an issue
Arguments: None
Example:
swissarmyhammer prompt test code/issue
code/review
Do Code Review
Arguments: None
Example:
swissarmyhammer prompt test code/review
Version Control
commit
Commit your work to git.
Arguments: None
Example:
swissarmyhammer prompt test commit
merge
Merge your work into the main branch.
Arguments: None
Example:
swissarmyhammer prompt test merge
Testing & Quality
coverage
Improve coverage.
Arguments: None
Example:
swissarmyhammer prompt test coverage
test
Iterate to correct test failures in the codebase.
Arguments: None
Example:
swissarmyhammer prompt test test
Debugging
debug/error
Analyze error messages and provide debugging guidance with potential solutions.
Arguments:
error_message
(required) - The error message or stack trace to analyzelanguage
(default: “auto-detect”) - The programming languagecontext
(optional) - Additional context about when the error occurs
Example:
swissarmyhammer prompt test debug/error --arg error_message="TypeError: cannot read property 'name' of undefined" --arg language="javascript"
debug/logs
Analyze log files to identify issues and patterns.
Arguments:
log_content
(required) - The log content to analyzeissue_description
(default: “general analysis”) - Description of the issue you’re investigatingtime_range
(default: “all”) - Specific time range to focus onlog_format
(default: “auto-detect”) - Log format (json, plaintext, syslog, etc.)
Example:
swissarmyhammer prompt test debug/logs --arg log_content="$(cat application.log)" --arg issue_description="API timeout errors"
Documentation
document
Create documentation for the project
Arguments: None
Example:
swissarmyhammer prompt test document
docs/comments
Add comprehensive comments and documentation to code.
Arguments:
code
(required) - The code to documentcomment_style
(default: “auto-detect”) - Comment style (inline, block, jsdoc, docstring, rustdoc)detail_level
(default: “standard”) - Level of detail (minimal, standard, comprehensive)audience
(default: “developers”) - Target audience for the comments
Example:
swissarmyhammer prompt test docs/comments --arg code="$(cat utils.js)" --arg comment_style="jsdoc" --arg detail_level="comprehensive"
docs/readme
Create comprehensive README documentation for a project.
Arguments:
project_name
(required) - Name of the projectproject_description
(required) - Brief description of what the project doeslanguage
(default: “auto-detect”) - Primary programming languagefeatures
(default: “”) - Key features of the project (comma-separated)target_audience
(default: “developers”) - Who this project is for
Example:
swissarmyhammer prompt test docs/readme --arg project_name="MyLib" --arg project_description="A library for awesome things" --arg features="fast,reliable,easy"
Planning
plan
Generate a step by step development plan from a specification.
Arguments: None
Example:
swissarmyhammer prompt test plan
Code Review
review/accessibility
Review code for accessibility compliance and best practices.
Arguments:
code
(required) - The UI/frontend code to reviewwcag_level
(default: “AA”) - WCAG compliance level target (A, AA, AAA)component_type
(default: “general”) - Type of component (form, navigation, content, interactive)target_users
(default: “all users”) - Specific user needs to consider
Example:
swissarmyhammer prompt test review/accessibility --arg code="$(cat form.html)" --arg component_type="form" --arg wcag_level="AA"
review/branch
Review code
Arguments: None
Example:
swissarmyhammer prompt test review/branch
review/code
Review code for quality, bugs, and improvements.
Arguments: None
Example:
swissarmyhammer prompt test review/code
review/documentation
Review documentation
Arguments: None
Example:
swissarmyhammer prompt test review/documentation
review/patterns
Perform a comprehensive review of the code to improve pattern use.
Arguments: None
Example:
swissarmyhammer prompt test review/patterns
review/security
Perform a comprehensive security review of code to identify vulnerabilities.
Arguments:
code
(required) - The code to review for security issuescontext
(default: “general purpose code”) - Context about the codelanguage
(default: “auto-detect”) - Programming languageseverity_threshold
(default: “low”) - Minimum severity to report (critical, high, medium, low)
Example:
swissarmyhammer prompt test review/security --arg code="$(cat login.php)" --arg context="handles user authentication"
Prompt Management
prompts/create
Help create effective prompts for swissarmyhammer.
Arguments:
purpose
(required) - What the prompt should accomplishcategory
(default: “general”) - Category for the promptinputs_needed
(default: “”) - What information the prompt needs from userscomplexity
(default: “moderate”) - Complexity level (simple, moderate, advanced)
Example:
swissarmyhammer prompt test prompts/create --arg purpose="Generate database migrations" --arg category="database"
prompts/improve
Analyze and enhance existing prompts for better effectiveness.
Arguments:
prompt_content
(required) - The current prompt content (including YAML front matter)improvement_goals
(default: “overall enhancement”) - What aspects to improveuser_feedback
(default: “”) - Any feedback or issues users have reported
Example:
swissarmyhammer prompt test prompts/improve --arg prompt_content="$(cat my-prompt.md)" --arg improvement_goals="clarity,flexibility"
General Purpose
help
A prompt for providing helpful assistance and guidance to users.
Arguments:
topic
(default: “general assistance”) - The topic to get help aboutdetail_level
(default: “normal”) - How detailed the help should be (basic, normal, detailed)
Example:
swissarmyhammer prompt test help --arg topic="git workflows" --arg detail_level="detailed"
example
An example prompt for testing.
Arguments:
topic
(default: “general topic”) - The topic to ask about
Example:
swissarmyhammer prompt test example --arg topic="testing prompts"
say-hello
A simple greeting prompt that can be customized with name and language.
Arguments:
name
(default: “friend”) - Name to greetlanguage
(default: “english”) - Language for the greeting
Example:
swissarmyhammer prompt test say-hello --arg name="Alice" --arg language="spanish"
Template Partials
These .md
files are partial templates used by other prompts for consistency:
code.md
- Partial template for reuse in other promptscoding_standards.md
- Coding Standards templatedocumentation.md
- Documentation templateempty.md
- Empty templateprincipals.md
- Principals templatereview_format.md
- Review Format templatetodo.md
- Todo template
Usage Patterns
Basic Usage
# Use a prompt with default arguments
swissarmyhammer prompt test review/code
# Specify custom arguments
swissarmyhammer prompt test debug/error --arg error_message="NullPointerException" --arg language="java"
Piping Content
# Use command substitution to pass file content
swissarmyhammer prompt test docs/comments --arg code="$(cat utils.py)" --arg comment_style="docstring"
# Pipe log content for analysis
cat error.log | xargs -I {} swissarmyhammer prompt test debug/logs --arg log_content="{}" --arg issue_description="memory leak"
Non-Interactive Mode
# Run prompts non-interactively with all arguments specified
swissarmyhammer prompt test help --arg topic="git" --arg detail_level="detailed"
Debugging Prompts
# Use debug mode to see template processing
swissarmyhammer prompt test debug/error --debug --arg error_message="Sample error"
Best Practices
- Choose the Right Prompt - Select prompts that match your specific task
- Provide Context - Use optional arguments to give more context when available
- Combine Prompts - Use multiple prompts in sequence for comprehensive workflows
- Test Arguments - Use the test command to verify prompt behavior before using in workflows
- Review Output - Always review and validate generated content before using it
Creating Custom Prompts
If the built-in prompts don’t meet your needs:
- Use the
prompts/create
prompt to generate a template - Save it in your
~/.swissarmyhammer/prompts/
directory - Follow the YAML front matter format for consistency
- Test with various inputs to ensure reliability
For more information on creating custom prompts, see Creating Prompts.