# AI Agent Instructions: `agentic_devtools/cli/setup/`

> Parent Instruction Chain
>
> 1. [agentic-devtools package instructions](../../../.github/copilot-instructions.md)
>
> [`copilot-instructions.md` Precedence Model](../../../docs/copilot-instructions-precedence-model.md)

## Scope

These instructions apply to setup-related CLI/report code under `agentic_devtools/cli/setup/**`.

## Setup Flow Guardrails

- Gate npm-specific side effects consistently: when npm is disabled, do not write npm-specific files, env vars, or manual-instruction lines.
  *Rationale: based on audit findings in PR #2771.*

- Normalize user-provided filesystem paths before use (`expanduser()`, absolute resolution where appropriate) and avoid mutating
  pre-existing directories/permissions unless explicitly required by feature behavior.
  *Rationale: based on audit findings in PR #2798.*

- Treat setup report persistence as best-effort unless the feature contract explicitly says otherwise; documentation must reflect actual failure semantics.
  *Rationale: based on audit findings in PR #2798.*
