# Digital Duty of Care & Humane Engineering Skill
# Source: https://philgear.dev/duty-of-care
# License: CC-BY-4.0 / MIT Open Specification
# Compatible with: Antigravity (SKILL.md), Claude Code (CLAUDE.md), Cursor (.cursorrules), GitHub Copilot

---
name: digital-duty-of-care
version: "1.0.0"
description: >-
  Enforces the Statutory Digital Duty of Care, Australia eSafety Safety by Design (SbD),
  STRIDE-H (Human Harms) threat modeling, 4-Slot Cognitive Hospitality, WCAG 2.2 AAA ergonomics,
  and Zero-Egress Local-First privacy across all UI, API, and AI agent code generation.
---

## 1. Zero Dark Patterns (Compile-Time Prohibition)
- **No Manufactured Urgency or Artificial Scarcity**: Never generate fake countdown timers, artificial stock counters, or panic-inducing prompts.
- **No Confirmshaming or Deceptive Affirmation**: Never write manipulative opt-out copy (e.g., "No thanks, I don't care about my safety"). All choices must be neutral, plain-spoken, and dignified.
- **No Infinite Scroll or Dopamine Traps**: Interfaces must provide clear, finite stopping cues, paginated boundaries, and reverse-chronological feed parity ("My Feed, My Way").
- **Symmetric Cancellation (1-Click Parity)**: Account deletion, cancellation, and data export must require less than or equal to the steps required for onboarding (`cancellationStepCount <= registrationStepCount`).
- **Private & Quiet by Default**: Geolocation sharing, stranger DMs, cross-site telemetry, and unscheduled notifications must default to `false` (Opt-In Only).

---

## 2. Cognitive Hospitality & The 4-Slot Working Memory Ceiling
- **The Cognitive Golden Rule**: "If my own child, an elderly parent, or a tired, stressed friend were using this, would it treat them with kindness, honesty, and dignity?"
- **4-Slot Working Memory Limit**: Never present more than 4 concurrent focal actions, modal choices, or unchunked form sections at once.
- **WCAG 2.2 AAA Optical Contrast**: Enforce minimum 7:1 contrast for body copy and strive for 16:1 high-legibility contrast for primary telemetry. Use `font-variant-numeric: tabular-nums` for numeric readouts.
- **Sensory & Somatic Calm**: Always honor `prefers-reduced-motion: reduce`. Avoid jarring popups, auto-playing video/audio, or alarmist pacing; pace rhythmic animations to 0.1 Hz parasympathetic coherence where appropriate.

---

## 3. Radical Privacy, Zero-Egress & Provenance
- **Local-First Client Computation**: Execute sensitive calculations, PII redaction, and vector search client-side (Web Crypto API, WebAssembly, local models) whenever feasible.
- **Zero Third-Party Behavioral Trackers**: Never inject third-party ad pixels, keystroke loggers, session replay beacons, or data-broker telemetry.
- **Open Data Portability**: Always provide 1-click user export to open, non-proprietary formats (JSON, Markdown, CSV, FHIR R4).
- **Ecological & Residential Geofencing**: Scrub private residential GPS coordinates from public media and replace fragile wilderness micro-locations with regional waypoints.

---

## 4. STRIDE-H (Human Harms) Pre-Commit Threat Verification
Before completing any user-facing feature or AI prompt workflow, audit against the 6 STRIDE-H vectors:
1. **S — Sycophancy & Epistemic Drift**: Does the AI validate false or harmful user premises instead of maintaining grounded, compassionate truth?
2. **T — Temporal & Attention Extraction**: Does the feature hijack circadian rest or use variable-ratio reward loops?
3. **R — Reputational & Relational Injury**: Could this endpoint be weaponized for harassment swarms, non-consensual synthetic media, or doxxing?
4. **I — Information Asymmetry & Coercion**: Are terms, costs, or data flows hidden behind dark nudges or pre-checked consent boxes?
5. **D — Dependency & Parasocial Attachment**: Does the system foster unhealthy emotional dependency rather than supporting human autonomy and real-world kinship?
6. **E — Environmental & Physical Endangerment**: Does telemetry leakage expose domestic violence survivors, children, or fragile ecological habitats?
