--- name: shadow-detection description: Use when monitoring agent behavior for dysfunction, when an agent seems stuck, or when orchestration quality is degrading. Detects and corrects Jungian shadow activation in archetypes. --- # Shadow Detection Every archetype has a virtue and a shadow (its destructive inversion). Shadow activates when the virtue is pushed too far. | Archetype | Virtue | Shadow | |-----------|--------|--------| | Explorer | Contextual Clarity | Rabbit Hole | | Creator | Decisive Framing | Over-Architect | | Maker | Execution Discipline | Rogue | | Guardian | Threat Intuition | Paranoid | | Skeptic | Assumption Surfacing | Paralytic | | Trickster | Adversarial Creativity | False Alarm | | Sage | Maintainability Judgment | Bureaucrat | --- ### Explorer -> Rabbit Hole **Detect** (any): output >2000w without Recommendation | >3 tangents | >15 files no patterns | no synthesis in final 25% **Correct**: "Summarize top 3 findings and one recommendation in under 300 words." ### Creator -> Over-Architect **Detect** (any): >2 new abstractions for a single feature | "future-proof" in rationale | scope exceeds task by >50% | >1 new package for one feature **Correct**: "Design for the current order of magnitude. Remove abstractions that serve hypothetical requirements." ### Maker -> Rogue **Detect** (any): zero test files with >=3 files changed | single monolithic commit | diff contains files not in proposal | no evidence of running tests **Correct**: "Read the proposal. Write a test. Commit what you have. Revert changes to files not in the proposal." ### Guardian -> Paranoid **Detect** (any): CRITICAL:WARNING ratio >2:1 (min 3 findings) | zero APPROVED in 3+ reviews | <50% findings include a fix | findings require already-compromised systems **Correct**: "For each CRITICAL: would a senior engineer block a PR for this? If not, downgrade. Every rejection must include a specific fix." ### Skeptic -> Paralytic **Detect** (any): >7 challenges in a single review | <50% include alternatives | same concern appears 2+ times reworded | >3 findings outside task scope **Correct**: "Rank challenges by impact. Keep top 3. Each must include a specific alternative. Delete the rest." ### Trickster -> False Alarm **Detect** (any): findings reference code untouched by diff | >10 findings for <5 files | impossible deployment scenarios | >3 findings without repro steps **Correct**: "Delete findings outside the diff. Rank remaining by likelihood x impact. Keep top 3-5." ### Sage -> Bureaucrat **Detect** (any): review words >2x diff lines | findings reference files not in changeset | >2 "consider" without concrete action | suggesting docs for <5-line functions **Correct**: "Limit to issues affecting maintainability in the next 6 months. Every finding must end with a specific action." --- ## Escalation Protocol 1. **1st detection:** Log the shadow, apply the correction prompt, let the agent continue 2. **2nd detection (same agent, same shadow):** Replace the agent -- the shadow is entrenched 3. **3+ agents shadowed in same cycle:** Escalate to user -- the task may need to be broken down ## Shadow Immunity Some behaviors look like shadows but are not. **Rule of thumb:** shadow = behavior disconnected from the goal. Intensity alone is not a shadow. - Explorer reading 20 files in a monorepo with scattered dependencies -- not a rabbit hole if each file is genuinely relevant - Creator adding an abstraction -- not over-architect if the current task genuinely needs it - Guardian blocking with 2 CRITICALs -- not paranoid if both are genuine security vulnerabilities - Trickster finding 5 edge cases -- not false alarm if all are in changed code with repro steps - Sage writing a long review -- not bureaucrat if the change is large and every finding is actionable