| Specific filenames | Stage those files | `git add <files>` |
For natural language inputs (like "the auth changes"), cross-reference the `git status` output and `git diff` to identify relevant files. Show the user which files you're staging and why.
```bash
git add <determined files>
```
After staging, verify:
```bash
git diff --cached --stat
```
If nothing staged, stop: "No files matched your description."
---
## Phase 3 — COMMIT
Craft a single-line commit message in imperative mood:
```
{type}: {description}
```
Types:
-`feat` — New feature or capability
-`fix` — Bug fix
-`refactor` — Code restructuring without behavior change
-`docs` — Documentation changes
-`test` — Adding or updating tests
-`chore` — Build, config, dependencies
-`perf` — Performance improvement
-`ci` — CI/CD changes
Rules:
- Imperative mood ("add feature" not "added feature")
- Lowercase after the type prefix
- No period at the end
- Under 72 characters
- Describe WHAT changed, not HOW
```bash
git commit -m "{type}: {description}"
```
---
## Phase 4 — OUTPUT
Report to user:
```
Committed: {hash_short}
Message: {type}: {description}
Files: {count} file(s) changed
Next steps:
- git push → push to remote
- /prp-pr → create a pull request
- /code-review → review before pushing
```
---
## Examples
| You say | What happens |
|---|---|
| `/prp-commit` | Stages all, auto-generates message |
| `/prp-commit staged` | Commits only what's already staged |
| `/prp-commit *.ts` | Stages all TypeScript files, commits |