A repository containing command specifications for git operations and planning workflows. These specifications define slash commands that follow structured workflows for an AI coding assistant.
This repository contains Markdown files with YAML frontmatter that define slash commands for an AI coding assistant. Each command specification provides a structured workflow for common development tasks, ensuring consistent and safe git operations.
The repository provides pre-defined command specifications that:
- Guide git operations with conventional commit standards
- Ensure safe practices through pre-flight checks
- Provide user approval workflows before destructive operations
- Standardize commit message formatting across projects
- Facilitate feature planning through structured interviews
This repository exists to:
- Standardize Git Workflows: Ensure consistent commit messages and git operations across all projects
- Prevent Mistakes: Implement pre-flight checks and user approval steps to prevent accidental commits
- Enforce Best Practices: Use conventional commit formats and protect sensitive branches
- Streamline Planning: Provide structured workflows for feature specification and planning
| Term | Definition |
|---|---|
| Command Specification | A Markdown file with YAML frontmatter that defines a slash command's behavior |
| Conventional Commit | A commit message format following <type>(<scope>): <subject> pattern |
| Pre-flight Check | Validation steps run before executing a command (e.g., git config verification) |
| Agent | The AI assistant type that should execute the command (e.g., build, general) |
| Frontmatter | YAML metadata at the top of command specification files |
| Command | Description | Agent |
|---|---|---|
/commit-all |
Create a conventional commit from all changes with user approval | build |
/commit-staged |
Create a conventional commit from staged changes with user approval | build |
/push-all |
Commit all changes and push to remote with user approval | build |
/push-staged |
Commit staged changes and push to remote with user approval | build |
/add-documentation |
Add comprehensive documentation for code/features | build |
/plan-interview |
Interview to expand a spec from prompt | build |
Each command specification follows this structure:
---
description: Brief description of the command
agent: build
---
## Pre-flight Checks
[Validation steps]
## Workflow
[Step-by-step instructions]
## Error Handling
[Common errors and responses]| Field | Required | Description |
|---|---|---|
description |
Yes | Brief description shown in command help |
agent |
Yes | AI assistant type that should execute (e.g., build, general) |
All git commands in this repository use conventional commit messages.
<type>(<scope>): <subject>
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Changes that do not affect the meaning of the code (white-space, formatting, etc) |
refactor |
A code change that neither fixes a bug nor adds a feature |
test |
Adding missing tests or correcting existing tests |
chore |
Changes to the build process or auxiliary tools |
perf |
A code change that improves performance |
feat(auth): add user authentication module
fix(database): resolve connection timeout issue
docs(readme): update installation instructions
refactor(utils): simplify date formatting logic
- Maximum 72 characters
- Use imperative mood (e.g., "add" not "added")
- No period at the end
- Focus on what the change does
Commands use special syntax for tool execution:
| Syntax | Purpose |
|---|---|
!`command` |
Execute a bash command |
!question |
Prompt the user for input |
When user interaction is needed, use the question tool with:
question: "Clear question about what to do next"
header: "Short context header"
options:
- label: "Action 1"
description: "What this action does"
- label: "Cancel"
description: "Abort the operation"The following git commands are used across commands:
| Command | Purpose |
|---|---|
git config user.name |
Get configured git username |
git config user.email |
Get configured git email |
git branch --show-current |
Get current branch name |
git remote get-url origin |
Get remote repository URL |
git status |
Show working tree status |
git diff --cached |
Show staged changes |
git diff |
Show unstaged changes |
git log --oneline -5 |
Show recent commits |
git add . |
Stage all changes |
git commit -m "<msg>" |
Create a commit |
git push origin <branch> |
Push to remote |
The repository follows a simple structure:
opencode-commands/
βββ .opencode/
β βββ commands/
β β βββ commit-all.md
β β βββ commit-staged.md
β β βββ push-all.md
β β βββ push-staged.md
β β βββ add-documentation.md
β β βββ plan-interview.md
β βββ package.json
βββ AGENTS.md
βββ README.md
- Markdown with Frontmatter: Chosen for readability and ease of parsing
- Agent Type Specification: Ensures commands are executed by appropriate AI assistants
- User Approval Workflows: All destructive operations require explicit user confirmation
- Parallel Execution: Independent git commands run in parallel for efficiency
- Error Handling First: Pre-flight checks run before any action to fail fast
This repository has no runtime dependencies. It is a documentation-only repository containing command specifications.
- Make changes to your files
- Execute
/commit-allcommand - AI assistant runs pre-flight checks
- Review generated commit message
- Accept or suggest alternatives
- Commit is created with approval
- Stage specific files:
git add <file> - Execute
/push-stagedcommand - AI assistant verifies staged changes
- Generate conventional commit message
- Get user approval
- Commit and push to remote
- Execute
/plan-interview <feature-description> - AI assistant asks clarifying questions
- Review and confirm final spec outline
- Git branch is created (if in git repo)
- Spec is written to
plan.md
- Always include pre-flight checks: Verify git config, branch status, and remote availability
- Use user approval workflows: Never perform destructive operations without confirmation
- Follow conventional commits: Use standardized commit message format
- Handle errors gracefully: Provide clear error messages and suggestions
- Use parallel execution: Run independent commands simultaneously
- Feature branches:
feat/<short-description> - Use lowercase, hyphens only
- Keep descriptions to 3-5 words
The following branches are protected and trigger warnings:
mainmasterdeveloprelease/*
Don't: Skip git config verification
Do: Always verify user.name and user.email before operations
Don't: Use vague messages like "fixed stuff" or "update" Do: Follow conventional commit format with clear subject lines
Don't: Commit directly to protected branches Do: Warn users and require explicit confirmation
Don't: Skip user approval for destructive operations Do: Always present changes for review before executing
Don't: Ignore errors or provide unhelpful messages Do: Provide clear error messages with suggestions for resolution
# Check frontmatter structure
grep -n "^---" *.md
# Validate YAML syntax
yq eval 'select(document_index == 0)' *.md
# Check required fields
grep -l "description:" *.md
grep -l "agent:" *.md# Verify git configuration
git config user.name && git config user.email
# Check current branch
git branch --show-current
# Verify remote exists
git remote get-url originTo add a new command:
- Create a new Markdown file in
.opencode/commands/ - Use the naming pattern
<action>-<target>.md - Include YAML frontmatter with
descriptionandagent - Follow the established workflow format
- Add comprehensive error handling
- Test the workflow manually
This repository is used for AI-assisted software engineering workflows.