Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
"command": "python3 \"$HOME/.claude/hooks/pretool-prompt-injection-scanner.py\"",
"description": "Advisory scan for prompt injection patterns in agent context files (ADR-070)",
"timeout": 3000
},
{
"type": "command",
"command": "python3 hooks/pipeline-phase-gate.py",
"description": "Pipeline phase gate: blocks edits that skip required pipeline phases",
"timeout": 3000
}
]
},
Expand Down Expand Up @@ -304,6 +310,12 @@
"command": "python3 \"$HOME/.claude/hooks/review-capture.py\"",
"description": "Capture CRITICAL/HIGH review findings to learning DB",
"timeout": 3000
},
{
"type": "command",
"command": "python3 hooks/instruction-compliance.py",
"description": "Instruction compliance measurement after agent dispatch",
"timeout": 5000
}
]
},
Expand Down Expand Up @@ -340,6 +352,12 @@
"type": "command",
"command": "python3 \"$HOME/.claude/hooks/sql-injection-detector.py\"",
"timeout": 5000
},
{
"type": "command",
"command": "python3 hooks/posttool-auto-test.py",
"description": "Auto-test after source edits",
"timeout": 20000
}
]
}
Expand Down
10 changes: 10 additions & 0 deletions docs/PHILOSOPHY.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,16 @@ Model choice is a routing policy, not an ego signal.

Do not treat `opus` as the default upgrade path. If a component can only perform adequately on `opus`, inspect its prompt shape, references, and task decomposition before raising model cost.

**Token costs are not fungible.** One Opus token costs ~30x one Haiku token. Saving 1,000 Haiku tokens while causing one Opus rework loop (10,000+ tokens) is a net loss. Optimization targets the expensive model, not the cheap one.

This means:
- "Saves Haiku calls" is not a valid justification for any change. Haiku is the cheapest operation in the system.
- Pre-routing's value is **determinism and reliability** (regex can't misroute), not token savings.
- Phase gates' value is **preventing Opus rework** (catching missing artifacts before the expensive agent runs), not reducing hook overhead.
- Skip-rate measurement's value is **identifying which instructions fail** so they can become gates, not counting compliance events.

The test: does this optimization reduce Opus/Sonnet token waste from rework, misroutes, or hallucination? If it only saves Haiku tokens, it is not worth the complexity.

### Prompt Phrasing Does Not Replace Domain Knowledge

Four A/B experiments tested ego-boosting prompts ("IQ 200+"), urgency framing ("production is down"), and emotional prompt engineering.
Expand Down
16 changes: 16 additions & 0 deletions skills/meta/do/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,22 @@ If ANY creation signal found AND complexity Simple+: set `is_creation = true`, P

**Goal**: Select the correct agent + skill via a single Haiku routing agent. FORCE-labeled entries are preferred when intent matches semantically (not keyword-based).

**Step 0: Deterministic pre-routing**

Run the deterministic pre-router first:
```bash
python3 scripts/pre-route.py --request "{user_request}" --json-compact
```

If the result has `"matched": true` and `"confidence": "high"`:
- Use the returned `agent` and `skill` directly
- Skip the Haiku routing agent entirely
- Record `match_type` in routing decision tags

If `"matched": false` or `"confidence"` is "low"/"medium":
- Proceed to Step 1 (Haiku routing) as normal
- The pre-router result is informational only

**Step 1: Dispatch Haiku routing agent**

Generate the manifest, then dispatch:
Expand Down