# Development Workflow

> This file extends `common/git-workflow.md` with the work that happens before git operations.

## Feature Implementation Workflow

### 1. Inspect Before Editing

- Read project instructions and the code paths involved.
- Search the repository for existing patterns and reusable utilities.
- For library-specific behavior, use an available documentation skill or primary vendor documentation.
- Search external repositories or package registries only when reuse would materially reduce risk or effort.

### 2. Plan Proportionally

For complex work, identify scope, dependencies, risks, and verification steps before editing. Use a task tool supplied by a Pi extension when available; otherwise keep a concise plan in the conversation or in a project file when persistence is needed.

Do not require plan mode or a collection of planning documents for small, well-scoped changes; Pi has no built-in plan mode.

### 3. Test-Driven Changes

For new behavior and bug fixes:

1. Add or update a focused test.
2. Run it and confirm it fails for the expected reason.
3. Implement the smallest correct change.
4. Run the test again and refactor while it remains green.
5. Run the broader relevant suite and coverage checks.

Load a matching testing skill when one is available. Do not assume a named TDD agent exists.

### 4. Review

After modifying code, inspect the diff and review correctness, security, maintainability, and test coverage. Use a review skill or extension-provided reviewer only when the current Pi session exposes one; otherwise review directly.

Address all critical and high-severity findings before completion.

### 5. Verify

Run the repository's configured type, lint, test, build, and packaging checks as applicable. Do not claim success when checks were skipped or failed.

### 6. Commit and Push

Commit or push only when requested or clearly part of the user's task. Follow `common/git-workflow.md`, preserve unrelated user changes, and report the commands and results accurately.
