ADinsights Persona Router
Overview
Route ADinsights planning and review requests to the right persona profile, then generate a structured report using repo-defined ownership, tests, and escalation rules. Keep source-of-truth in repo docs and avoid inventing personas, scopes, or contracts.
Recontext Load Order
- Open
AGENTS.md.
- Open
docs/ops/doc-index.md.
- Open
docs/workstreams.md.
- Open
docs/project/phase0-backlog-validation.md.
- Open
docs/project/phase0-simulated-reviews.md.
- Open
docs/project/feature-ownership-map.md.
- Open
docs/project/phase1-execution-backlog.md when task status matters.
Persona Catalog
Load references/persona-catalog.yaml and use it as the canonical list of:
- Persona identity and role.
- Scope ownership and review focus.
- Required tests and doc links.
- Escalation behavior.
Router Resolution Rules
Resolve persona in this exact order:
- Explicit persona mention by name (
Maya, Lina, Raj, etc.).
- Explicit stream/workstream ID (
S1, Stream 4, etc.).
- Folder path hint (
backend/analytics, frontend/src, dbt/, etc.).
- Domain keyword hint (
airbyte, dbt, snapshot, frontend, etc.).
- Ask a clarification question only if unresolved after steps 1-4.
If a request spans multiple top-level folders, route to cross-stream behavior and apply Raj/Mira escalation guidance.
Confidence and Conflict Handling
- Base scores: explicit persona
1.00, explicit stream 0.90, folder 0.80, keyword 0.60.
- Penalties:
-0.20 per strong conflict, -0.15 for cross-stream ambiguity.
- Use
confidence_policy from references/persona-catalog.yaml:
auto_resolve_min: 0.75
clarify_min: 0.55
- Return
action=clarify when confidence is low and risk is high (conflicts/cross-stream).
Operating Mode
- Default mode: planning/review simulation.
- Do not default to code-writing roleplay.
- Simulate owner reasoning, then return action-ready findings tied to real docs/tests.
- CLI entrypoint:
scripts/persona_router.py.
--mode resolve|preflight
--format json|markdown
--path <path> (repeatable)
--changed-file <path> (repeatable)
--changed-files-from-git (optional)
Output Contract
Default output is a decision packet with:
schema_version (2.1.0)
selected_persona
backup_persona
resolved_by
confidence
conflict_flags
touched_streams
required_tests
docs_to_open
escalation_decision
recommended_report_template
clarifying_question (only when needed)
downstream_recommendations
invoke_scope_gatekeeper (true when cross-stream or low confidence)
invoke_contract_guard (true when contract-sensitive prompt/path hints are present)
invoke_release_readiness (true only when release/go-live intent is explicit)
evidence entries (type, value, strength, source)
decision_trace explainability string
For backward compatibility, the top-level invoke_scope_gatekeeper mirrors downstream_recommendations.invoke_scope_gatekeeper.
Handoff Policy
- Persona router remains advisory-only and never hard-blocks.
- Scope concerns are delegated to
adinsights-scope-gatekeeper.
- Contract validation is delegated to
adinsights-contract-guard.
- Final go/no-go advisory is delegated to
adinsights-release-readiness.
Use the templates in references/report-templates.md:
- Phase 0 backlog simulation template.
- Implementation planning template.
- Cross-stream escalation template.
Guardrails
- Preserve tenant isolation and RLS assumptions from
AGENTS.md.
- Never expose user-level PII; keep analytics aggregated.
- Never log or suggest logging secrets/tokens.
- Keep changes scoped to one top-level folder unless Raj/Mira escalation path is explicit.
- Use the canonical per-folder tests from
docs/workstreams.md and docs/ops/testing-cheat-sheet.md.
Maintenance
- Keep persona records in
references/persona-catalog.yaml synchronized with docs/workstreams.md.
- Run
scripts/validate_persona_catalog.py after catalog edits.
- Use
scripts/run_router_golden_tests.py to verify routing behavior against golden cases.
- Use
scripts/smoke_resolve_persona.py "your prompt" for backward-compatible smoke checks.
- Run
scripts/sync_to_codex_home.sh to sync this repo source-of-truth to $HOME/.codex/skills/adinsights-persona-router/.
1---2name: adinsights-persona-router3description: Simulate ADinsights owner personas for planning and review workflows. Use when asked for persona simulation, workstream review, owner-style planning, backlog gap review, dependency analysis, or cross-stream escalation guidance tied to ADinsights docs.4---5
6# ADinsights Persona Router
7
8## Overview
9
10Route ADinsights planning and review requests to the right persona profile, then generate a structured report using repo-defined ownership, tests, and escalation rules. Keep source-of-truth in repo docs and avoid inventing personas, scopes, or contracts.
11
12## Recontext Load Order
13
141. Open `AGENTS.md`.
152. Open `docs/ops/doc-index.md`.
163. Open `docs/workstreams.md`.
174. Open `docs/project/phase0-backlog-validation.md`.
185. Open `docs/project/phase0-simulated-reviews.md`.
196. Open `docs/project/feature-ownership-map.md`.
207. Open `docs/project/phase1-execution-backlog.md` when task status matters.
21
22## Persona Catalog
23
24Load `references/persona-catalog.yaml` and use it as the canonical list of:
25
26- Persona identity and role.
27- Scope ownership and review focus.
28- Required tests and doc links.
29- Escalation behavior.
30
31## Router Resolution Rules
32
33Resolve persona in this exact order:
34
351. Explicit persona mention by name (`Maya`, `Lina`, `Raj`, etc.).
362. Explicit stream/workstream ID (`S1`, `Stream 4`, etc.).
373. Folder path hint (`backend/analytics`, `frontend/src`, `dbt/`, etc.).
384. Domain keyword hint (`airbyte`, `dbt`, `snapshot`, `frontend`, etc.).
395. Ask a clarification question only if unresolved after steps 1-4.
40
41If a request spans multiple top-level folders, route to cross-stream behavior and apply Raj/Mira escalation guidance.
42
43### Confidence and Conflict Handling
44
45- Base scores: explicit persona `1.00`, explicit stream `0.90`, folder `0.80`, keyword `0.60`.
46- Penalties: `-0.20` per strong conflict, `-0.15` for cross-stream ambiguity.
47- Use `confidence_policy` from `references/persona-catalog.yaml`:
48 - `auto_resolve_min: 0.75`
49 - `clarify_min: 0.55`
50- Return `action=clarify` when confidence is low and risk is high (conflicts/cross-stream).
51
52## Operating Mode
53
54- Default mode: planning/review simulation.
55- Do not default to code-writing roleplay.
56- Simulate owner reasoning, then return action-ready findings tied to real docs/tests.
57- CLI entrypoint: `scripts/persona_router.py`.
58 - `--mode resolve|preflight`
59 - `--format json|markdown`
60 - `--path <path>` (repeatable)
61 - `--changed-file <path>` (repeatable)
62 - `--changed-files-from-git` (optional)
63
64## Output Contract
65
66Default output is a **decision packet** with:
67
68- `schema_version` (`2.1.0`)
69- `selected_persona`
70- `backup_persona`
71- `resolved_by`
72- `confidence`
73- `conflict_flags`
74- `touched_streams`
75- `required_tests`
76- `docs_to_open`
77- `escalation_decision`
78- `recommended_report_template`
79- `clarifying_question` (only when needed)
80- `downstream_recommendations`
81 - `invoke_scope_gatekeeper` (`true` when cross-stream or low confidence)
82 - `invoke_contract_guard` (`true` when contract-sensitive prompt/path hints are present)
83 - `invoke_release_readiness` (`true` only when release/go-live intent is explicit)
84- `evidence` entries (`type`, `value`, `strength`, `source`)
85- `decision_trace` explainability string
86
87For backward compatibility, the top-level `invoke_scope_gatekeeper` mirrors `downstream_recommendations.invoke_scope_gatekeeper`.
88
89## Handoff Policy
90
91- Persona router remains advisory-only and never hard-blocks.
92- Scope concerns are delegated to `adinsights-scope-gatekeeper`.
93- Contract validation is delegated to `adinsights-contract-guard`.
94- Final go/no-go advisory is delegated to `adinsights-release-readiness`.
95
96Use the templates in `references/report-templates.md`:
97
98- Phase 0 backlog simulation template.
99- Implementation planning template.
100- Cross-stream escalation template.
101
102## Guardrails
103
104- Preserve tenant isolation and RLS assumptions from `AGENTS.md`.
105- Never expose user-level PII; keep analytics aggregated.
106- Never log or suggest logging secrets/tokens.
107- Keep changes scoped to one top-level folder unless Raj/Mira escalation path is explicit.
108- Use the canonical per-folder tests from `docs/workstreams.md` and `docs/ops/testing-cheat-sheet.md`.
109
110## Maintenance
111
112- Keep persona records in `references/persona-catalog.yaml` synchronized with `docs/workstreams.md`.
113- Run `scripts/validate_persona_catalog.py` after catalog edits.
114- Use `scripts/run_router_golden_tests.py` to verify routing behavior against golden cases.
115- Use `scripts/smoke_resolve_persona.py "your prompt"` for backward-compatible smoke checks.
116- Run `scripts/sync_to_codex_home.sh` to sync this repo source-of-truth to `$HOME/.codex/skills/adinsights-persona-router/`.