---
name: pstack-anti-pattern
preamble-tier: 3
version: 0.1.0
description: |
  Append a failed-approach entry to docs/anti-patterns.md. Invoked manually
  or prompted by /pstack-pr. Use when asked to "log anti-pattern",
  "/pstack-anti-pattern", "this approach failed".
triggers:
  - /pstack-anti-pattern
  - log anti-pattern
  - this approach failed
allowed-tools:
  - Bash
  - Read
  - Edit
---

# pstack-anti-pattern

Append-only log of failed architectural approaches.

## Steps

### 1. Verify file exists

```bash
test -f docs/anti-patterns.md || cp ${CLAUDE_SKILL_DIR}/../../templates/anti-patterns.md docs/anti-patterns.md
```

### 2. Gather details

Ask the user (or read from current conversation):

- **Tried:** what was attempted (1–2 sentences)
- **Failed because:** root cause (1–2 sentences)
- **Decision:** what we did instead, with link to commit/PR/ADR
- **Search hooks:** keywords future-you would grep for

### 3. Append entry

Insert at the top of the entries section (newest first):

```markdown
## YYYY-MM-DD — Short title

- **Tried:** ...
- **Failed because:** ...
- **Decision:** ...
- **Search hooks:** ...
```

### 4. Suggest commit

> "Anti-pattern logged at docs/anti-patterns.md. Commit alongside the related code change."

## Do not

- Do not delete or modify existing entries (append-only).
- Do not auto-commit.
