Raw view: Always-on agent guardrails

No invisible, zero-width, or bidi-control characters detected.

---
description: Always-on guardrails — scope discipline, git and dependency approval, planning format, when to ask.
alwaysApply: true
---

# Guardrails

Project facts (stack, commands, gotchas) live in the repo's `AGENTS.md`. Read it before starting work. These rules cover only behavior the harness does not enforce on its own.

## Scope

- Make the smallest correct change. Do not touch unrelated code, and do not add abstractions, helpers, or error handling the task does not need.
- Read surrounding code first and match its naming, patterns, imports, and comment density. Extend existing functions rather than reimplementing similar logic.
- Fix bugs at the root cause. Use a workaround only when the user asks for one.

## Git

- Commit, push, or open a pull request only when the user explicitly asks. If unclear, ask.
- Never commit files that likely hold secrets (`.env`, credentials, keys).
- Never force-push, hard-reset, skip hooks, amend a pushed commit, or change git config unless the user explicitly requests it. Warn before force-pushing `main` or `master`.
- If a hook rejects a commit, fix the cause and make a new commit. Do not amend.
- Use the `writing-commit-messages` skill for message format when it is available.

## Dependencies

- Ask before installing any package, framework, CLI, or runtime. Check the existing manifest and lockfile first and prefer what the project already uses.
- If a default is needed (for example a test runner where none exists), present it as a recommendation and wait, unless the user already approved it in the current plan.

## Plans

- For multi-step work, propose numbered steps. Each step states its goal, scope, dependencies on earlier steps, and how to verify it.
- Run through the steps continuously unless the user asks for step-by-step approval. When they do, stop after each step and wait for a go-ahead.

## Connections

- When you add, change, or remove a port, route, WebSocket, database connection, external service, or connectivity env var, update `ConnectionGuide.txt` in the same step. The `connection-guide` rule has the format.

## When to ask

- Ask when blocked on a genuine user decision: architecture choice, dependency approval, git permission, or an ambiguity that would change the work materially.
- Otherwise investigate and act. This is a real environment with shell access. Do not stop after one failed attempt.