agentleFS
KshitijpalsinghtomarKshitijpalsinghtomar/depth-skills/skills/ds-emergence/SKILL.md

emergence

Skill5 starsChanged 44 days agoMITView on GitHub

Analyzes what components create together that none intended — feedback loops, contention, timing bugs, and assumption collisions. Now with mathematical depth metrics, emergence risk quantification, interaction topology , and verification gates.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If recursion_depth > 1, apply this entire protocol to your own output from Steps 1-7.

    line 462
  2. Distinctive:

    Treat your previous output as the "answer under review"

    line 465
  3. Distinctive:

    Run Steps 1-7 on it

    line 466
  4. Distinctive:

    If RSM > 0.95 AND SI_d ≥ SI_{d-1} for 2 consecutive depths → CONVERGED, stop

    line 472
  5. Distinctive:

    If RSM < 0.80 OR SI_d < SI_{d-1} for 2 consecutive depths → DIVERGED, stop, use best depth

    line 473
  6. Distinctive:

    If d = max_depth → stop, use current

    line 474

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

EMERGENCE v2.0 — Interaction-Level Analyzer (Premium)

Mathematical Compliance: This skill implements the DEPTH-MATHEMATICS specification. It computes and outputs ADS phase activation, CEI components, SI components, cognitive traces (emergence risk quantification, interaction topology ), and verifies Gates V3, V4, V6. It quantifies emergence risk as a measurable metric.

You've analyzed each component. Each one is correct in isolation. Each passes its tests.

Now: what happens when they interact?

Emergence is what systems do that no individual part was designed to do. It is the traffic jam no car intended. The cascading failure no single service caused. The security vulnerability living in the gap between two correct components.

Component-level analysis cannot see this. These behaviors exist only in the interaction.

New in v2.0: Mathematical depth metrics, emergence risk quantification, interaction topology , recursive self-audit, verification gates.


The Failure Mode You Must Recognize

You just reviewed each component separately and declared them all correct. You are about to say "the system should work" without checking:

  • Whether component A and component B both write to the same resource (contention)
  • Whether component A's error handling triggers component B's error handling (feedback loop)
  • Whether component A assumes it's the only consumer of a resource that component C also uses (assumption collision)
  • Whether the behavior changes when component A responds in 5000ms instead of 50ms (timing dependency)

Individual correctness does not guarantee system correctness.

Cargo cult emergence lists components without quantifying interaction risk. This skill rejects it.


The Protocol

0 — PARAMETERIZE: Read Thinking Parameters

Read thinking_parameters:

  • min_components (default 3) — minimum components to analyze
  • min_hidden_interactions (default 2) — minimum hidden interactions to find
  • require_risk_quantification (default true) — compute emergence risk quantification
  • require_topology_ (default true) — issue interaction topology
  • recursion_depth (default 1) — recursive self-audit rounds

Step 1 — MAP ALL INTERACTIONS (Minimum = min_components components)

List every component in THIS system. Then map every interaction — both designed and hidden:

INTERACTION MAP
────────────────────────────────────────
COMPONENTS:
  1. [name — what it does]
  2. [name — what it does]
  3. [name — what it does]
  ...

DESIGNED INTERACTIONS (explicit — the intended interfaces):
  [A] → [B]: [what data/signal flows and how]
  [B] → [C]: [what data/signal flows and how]

HIDDEN INTERACTIONS (implicit — not designed but real):
  [A] and [C]: both write to [shared resource]
  [B] and [D]: both consume from [shared queue/pool/API]
  [A] and [D]: compete for [shared capacity — network/memory/CPU]
  [B] and [E]: both process [same request/data] with different assumptions

Minimum `min_components` components, `min_hidden_interactions` hidden interactions.
────────────────────────────────────────

The hidden interactions are where emergence lives. Designed interactions are tested. Hidden interactions are not.

Artifact: The interaction map.

CEI Component: Interaction Map (weight 3.0)


Step 2 — SCAN FOR FEEDBACK LOOPS

A feedback loop exists when A's output affects B's input, AND B's output affects A's input.

For each loop found:

FEEDBACK LOOP [N]:
  Path:     [A → B → A] or [A → B → C → A]
  Type:     [STABILIZING — self-correcting / AMPLIFYING — self-destroying]
  Mechanism:[how the loop operates — specifically]
  Example:  [concrete scenario where this loop activates]
  Gain:     [loop gain — 0.0-1.0 for stabilizing, >1.0 for amplifying]
  If amplifying:
    Circuit breaker: [how to break the loop — backoff, hard limit, timeout]
    Gain Margin: [how much gain can increase before instability]
────────────────────────────────────────

Amplifying loops are system killers. They must be identified and broken.

Real-world amplifying loops to scan for:

  • Retry → overload → failure → retry (retry amplification)
  • Cache expires → all requests hit origin → overload → can't refill (cache stampede)
  • Alerts fire → humans dismiss → failures missed → more alerts (alert fatigue)

Artifact: Feedback loop scan with gain metrics.

CEI Component: Feedback Loop Scan (weight 4.0)

SI Component: Boundary violations (amplifying loops count)


Step 3 — SCAN FOR RESOURCE CONTENTION

Multiple components sharing a limited resource:

CONTENTION [N]:
  Resource:         [what is shared — connections, memory, CPU, rate limit, queue]
  Shared by:        [which components]
  Peak per component:[usage at their individual worst case]
  Peak total:       [sum of all components' worst cases]
  Resource limit:   [actual capacity]
  Headroom:         [limit minus peak total — positive = safe, negative = contention]
  Contention Ratio: [peak total / limit = 0.XX]
  Mitigation:       [connection pooling, rate limiting, partitioning, etc.]
────────────────────────────────────────

Test at peak, not average. The 99th percentile of ALL consumers simultaneously is the real stress point.

Artifact: Contention analysis with contention ratios.

CEI Component: Contention Analysis (weight 4.0)

SI Component: Boundary violations (contentions with ratio > 1.0)


Step 4 — SCAN FOR TIMING DEPENDENCIES

Behaviors that exist only because of timing:

TIMING DEPENDENCY [N]:
  Scenario A:    [what happens if X completes before Y]
  Scenario B:    [what happens if Y completes before X]
  In testing:    [which scenario occurs in test environments]
  In production: [which scenario could occur under real conditions]
  Race Condition: [YES/NO — if different outcomes]
  Synchronization: [what prevents the race — locks, ordering, idempotency]
  Timing Window: [duration of vulnerability — milliseconds/seconds]
────────────────────────────────────────

Specific timing risks to check:

  • Database migration timing vs. code deployment timing
  • Cache expiry timing vs. read/write timing
  • Webhook arrival timing vs. local state update timing
  • Dependent service response time variation (50ms → 5000ms)

Artifact: Timing dependency scan with race condition flags.

CEI Component: Timing Dependency Scan (weight 4.0)

SI Component: Boundary violations (race conditions count)


Step 5 — SCAN FOR ASSUMPTION COLLISIONS

Each component was designed with assumptions about its environment. When combined:

ASSUMPTION COLLISION [N]:
  Component [A] assumes: [X]
  Component [B] assumes: [contradicts X — e.g., "NOT X" or "Y ≠ X"]
  Consequence:           [what breaks when both operate simultaneously]
  Collision Severity:    [0.0-1.0 — based on consequence impact]
  Resolution:            [how to align assumptions — contract, adapter, redesign]
────────────────────────────────────────

Common collision types:

  • A assumes exclusive write access. B also writes.
  • A assumes idempotent responses. B has side effects.
  • A assumes single-user concurrency. B allows multi-user.
  • Library A uses UTC. Library B uses local time.

Artifact: Assumption collision scan with severity scores.

CEI Component: Assumption Collision Scan (weight 4.0)

SI Component: Boundary violations (collisions with high severity)


Step 6 — EMERGENCE RISK QUANTIFICATION (if require_risk_quantification = true)

NEW IN v2.0 — Quantify emergence risk as a measurable metric.

EMERGENCE RISK QUANTIFICATION
────────────────────────────────────────
Components: [count]
Designed Interactions: [count]
Hidden Interactions: [count]

Risk Factors:
  Feedback Loops: [count]
    Amplifying: [count] — Weight: 0.30
    Stabilizing: [count] — Weight: -0.10
  Resource Contentions: [count]
    Over Capacity: [count] — Weight: 0.25
  Timing Dependencies: [count]
    Race Conditions: [count] — Weight: 0.20
  Assumption Collisions: [count]
    High Severity: [count] — Weight: 0.25

Emergence Risk Score = Σ (Count × Weight) = [0.0-1.0+]

Risk Level:
  LOW:      Score < 0.2
  MODERATE: 0.2 ≤ Score < 0.5
  HIGH:     0.5 ≤ Score < 0.8
  CRITICAL: Score ≥ 0.8

Predicted Emergent Behaviors:
  E1: [behavior that no component was designed to create, arising from interactions]
  E2: [behavior]
  ...

Mitigation Priority: [ranked list of highest-weight risks]
────────────────────────────────────────

Artifact: emergence_risk_quantification — quantified emergence risk.

CEI Component: Emergence Risk Quantification (weight 5.0)

SI Component: Boundary violations (weighted risk score)


Step 7 — INTERACTION TOPOLOGY (if require_topology_ = true)

NEW IN v2.0 — Formal of interaction topology analysis.

INTERACTION TOPOLOGY 
────────────────────────────────────────
 ID: itc_<timestamp>_<hash>
System: [description]

Topology:
  Components: [count]
  Designed Interactions: [count]
  Hidden Interactions: [count]
  Interaction Density: [hidden / (components × (components-1)/2) = 0.XX]

Risk Summary:
  Feedback Loops: [count] (Amplifying: [count])
  Resource Contentions: [count] (Over Capacity: [count])
  Timing Dependencies: [count] (Race Conditions: [count])
  Assumption Collisions: [count] (High Severity: [count])

Emergence Risk Score: [0.XX]
Risk Level: [LOW / MODERATE / HIGH / CRITICAL]

Mitigation Coverage:
  Amplifying Loops with Circuit Breakers: [XX%]
  Contentions with Mitigation: [XX%]
  Race Conditions with Synchronization: [XX%]
  Collisions with Resolution: [XX%]

Overall: [COMPLETE / PARTIAL / INCOMPLETE]
Valid Until: [date or condition]
────────────────────────────────────────

Artifact: interaction_topology_ — formal verification of interaction analysis.

CEI Component: Interaction Topology (weight 3.0)


Step 8 — WRITE THE EMERGENCE MAP

EMERGENCE MAP
────────────────────────────────────────
Components:           [count]
Designed interactions:[count]
Hidden interactions:  [count]

FEEDBACK LOOPS:       [count found]
  Amplifying:         [count — each needs circuit breaker]

RESOURCE CONTENTIONS: [count found]
  Over capacity:      [count — each needs mitigation]

TIMING DEPENDENCIES:  [count found]
  Race conditions:    [count — each needs synchronization or tolerance]

ASSUMPTION COLLISIONS:[count found]
  Active conflicts:   [count — each needs resolution]

PREDICTED EMERGENT BEHAVIORS:
  E1: [behavior that no component was designed to create, arising from interactions]
  E2: [behavior]

Overall emergence risk: [low / moderate / high / critical]
────────────────────────────────────────

Artifact: The emergence map.

CEI Component: Emergence Map (weight 2.0)


8 — METRICS: Compute and Output Depth Metrics

8.1 Phase Activation (for ADS)

{
  "phase": 3,
  "skill": "emergence",
  "artifact_completeness": 0.XX,
  "gate_pass_rate": 0.XX,
  "external_validity": 0.XX,
  "human_eval": 0.XX,
  "phase_activation": 0.XX
}

8.2 CEI Components

{
  "cei_components": {
    "interaction_map": 3.0,
    "feedback_loop_scan": 4.0,
    "contention_analysis": 4.0,
    "timing_dependency_scan": 4.0,
    "assumption_collision_scan": 4.0,
    "emergence_risk_quantification": 5.0,
    "topology_": 3.0,
    "emergence_map": 2.0,
    "total_complexity_weight": 29.0,
    "output_tokens": N,
    "wall_time_seconds": T,
    "cei": 0.XX
  }
}

8.3 SI Components

{
  "si_components": {
    "c2_c3_count": 0,
    "contrarian_viable": false,
    "fatal_attacks": 0,
    "boundary_violations": N,
    "assumption_reversals": 0,
    "si_total": N
  }
}

8.4 Cognitive Traces

Emergence Risk Quantification:

{
  "type": "emergence_risk_quantification",
  "components": N,
  "designed_interactions": N,
  "hidden_interactions": N,
  "risk_factors": {
    "feedback_loops": {"total": N, "amplifying": N, "weight": 0.30},
    "contentions": {"total": N, "over_capacity": N, "weight": 0.25},
    "timing_dependencies": {"total": N, "race_conditions": N, "weight": 0.20},
    "assumption_collisions": {"total": N, "high_severity": N, "weight": 0.25}
  },
  "emergence_risk_score": 0.XX,
  "risk_level": "LOW/MODERATE/HIGH/CRITICAL",
  "predicted_behaviors": ["E1: ...", "E2: ..."]
}

Interaction Topology : (as defined in Step 7)

8.5 Depth Contribution

{
  "skill": "emergence",
  "version": "2.0",
  "metrics": {"ads_contribution": 0.XX, "cei": 0.XX, "si": N, "ec": 0.XX},
  "gates_verified": {"V3": true, "V4": true, "V6": true},
  "limitations": ["..."]
}

9 — GATES: Verify Before Delivery

MANDATORY — Verify these gates PASS:

GateCheckPass Condition
V3Opposition AuthenticityEvery risk factor references specific interaction + cites mechanism
V4Temporal ConsistencyIf TEMPORAL ran: predicted emergent behaviors tested across futures
V6Recursive StabilityIf recursion: RSM > 0.95 ∧ SI not decreasing

If any gate FAILS: Return to relevant step and fix. Do not deliver.


10 — RECURSIVE SELF-AUDIT (if recursion_depth > 1)

If recursion_depth > 1, apply this entire protocol to your own output from Steps 1-7.

For each recursion level d = 2 to recursion_depth:

  1. Treat your previous output as the "answer under review"
  2. Run Steps 1-7 on it
  3. Compute RSM (Recursive Stability Metric):
    RSM = 1 - Semantic_Distance(output_d, output_{d-1})
  4. Convergence Check:
    • If RSM > 0.95 AND SI_d ≥ SI_{d-1} for 2 consecutive depths → CONVERGED, stop
    • If RSM < 0.80 OR SI_d < SI_{d-1} for 2 consecutive depths → DIVERGED, stop, use best depth
    • If d = max_depth → stop, use current

Artifact: recursion_log with RSM and SI at each depth.

CEI Component: Recursive Audit (weight 5.0 per level)


11 — INTERFERENCE: Receive and Provide

Receive from prior skills:

From SkillInterferenceUse
NEGATIVE-SPACECritical silencesAdd as hidden interactions / assumption collisions
TEMPORALFuture scenariosTest emergent behaviors across futures
EXCAVATEC2/C3 assumptionsAdd as assumption collisions
ADVERSARYFatal attacksAdd as predicted emergent behaviors
BOUNDARY-DETECTORKnowledge gapsAdd as hidden interactions

Provide to later skills:

To SkillInterferenceMinimum ADS Gain
NEGATIVE-SPACEPredicted emergent behaviors → failure categories+0.15
THRESHOLDEmergence risk → reversal cost function+0.15
CONDUCTORRisk score, topology+0.20
META-LEARNINGEmergence patterns → skill synthesis+0.10

Artifact: interference_log (received and provided).


The Deeper Purpose

The model analyzes components individually. It checks if A is correct. It checks if B is correct. It rarely checks what A and B create together that neither intended. This is the deepest failure mode in system design — individual correctness does not guarantee system correctness. The bugs that cause outages, the vulnerabilities that get exploited, and the performance problems that only appear in production — they almost all live in the interactions, not the components. This skill looks where component analysis cannot. Now it's quantified (risk score), certified (topology ), and verified (gates).


MATHEMATICS COMPLIANCE

Phase Activation Output

This skill contributes to Phase 3. It outputs:

{
  "phase": 3,
  "skill": "emergence",
  "artifact_completeness": 0.XX,
  "gate_pass_rate": 0.XX,
  "external_validity": 0.XX,
  "human_eval": 0.XX,
  "phase_activation": 0.XX
}

CEI Components

  • Artifacts produced: interaction_map (3.0), feedback_loop_scan (4.0), contention_analysis (4.0), timing_dependency_scan (4.0), assumption_collision_scan (4.0), emergence_risk_quantification (5.0), topology_ (3.0), emergence_map (2.0)
  • Total complexity weight: 29.0

SI Components

  • C2/C3 assumptions: 0
  • Contrarian viable: false
  • Fatal attacks: 0
  • Boundary violations: [amplifying loops + over-capacity contentions + race conditions + high-severity collisions]
  • Assumption reversals: 0

Cognitive Traces Produced

  • Emergence Risk Quantification
  • Interaction Topology
  • Decision Landscape

Gates Verified

  • V1 [ ] V2 [x] V3 [x] V4 [ ] V5 [x] V6
  • Human Eval [ ] Held-Out [ ] Ensemble

Required Interferences

  • From NEGATIVE-SPACE: Critical silences → hidden interactions / assumption collisions
  • From TEMPORAL: Future scenarios → emergent behavior testing
  • From EXCAVATE: C2/C3 assumptions → assumption collisions
  • From ADVERSARY: Fatal attacks → predicted emergent behaviors
  • From BOUNDARY-DETECTOR: Knowledge gaps → hidden interactions

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.