```skill
---
name: conventional-commit
description: Conventional commit message format with mandatory JIRA ID for all commits in the pipeline.
---

# Mobi Commit Convention

## Format

```
{commit_type}({jira}): {description}
```

- `{commit_type}` — conventional commit type (see table below)
- `{jira}` — JIRA ticket ID (e.g., `CACTUS-1234`) — **MANDATORY**
- `{description}` — imperative mood, lowercase, no trailing period

## Work Type → Commit Type Mapping

| Work Type (from prompt.yaml) | Commit Type | Example |
|------------------------------|-------------|---------|
| feature | `feat` | `feat(CACTUS-1234): add OAuth login flow` |
| fix | `fix` | `fix(PROJ-567): resolve null pointer in auth handler` |
| chore | `chore` | `chore(CACTUS-890): update dependency versions` |

For iteration-level commits where multiple changes are bundled:
```
{commit_type}({jira}): complete iteration {N} — {brief summary}
```

Example: `feat(CACTUS-1234): complete iteration 0 — implement user auth endpoints`

## Rules

1. JIRA ID is **MANDATORY** in every commit — a commit without JIRA is a CRITICAL ERROR
2. Imperative mood: "add" not "added" or "adds"
3. Total first line under 72 characters
4. No period at end of description
5. Scope field is always the JIRA ticket ID
6. Description must summarize WHAT changed, not HOW

## Multi-line Commits (Optional)

For complex iterations, use a body:

```
{commit_type}({jira}): {summary}

- {change 1}
- {change 2}
- {change 3}
```

## Pipeline Integration

After iteration acceptance (Orchestrator step O6):

```sh
git add -u && git add $(git ls-files --others --exclude-standard) && git commit -m "{commit_type}({jira}): complete iteration {N} — {summary}"
```

**Staging rules**:
- `git add -u` stages all tracked file modifications and deletions.
- `git add $(git ls-files --others --exclude-standard)` stages new untracked files respecting `.gitignore`.
- This replaces `git add -A` to avoid accidentally staging untracked artifacts outside the working tree.
- NEVER stage files outside the project root or in `prompts/` (should be in `.gitignore`).

Where:
- `{commit_type}` is derived from `type` field in `prompt.yaml`
- `{jira}` is the ticket ID
- `{N}` is the iteration number
- `{summary}` is a brief description of what was accomplished (2-5 words)
```
