<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
# Dark Pattern Detection — API Reference

## Scan HTML

```bash
node scripts/agent.js --action scan-html --input /tmp/consent_page.html
```

## Analyze Flow Asymmetry

```bash
node scripts/agent.js --action analyze-flow --subscribe-steps 2 --unsubscribe-steps 7
```

## Check Language

```bash
node scripts/agent.js --action check-language --input /tmp/modal_text.txt
```

## Generate Report

```bash
node scripts/agent.js --action report --findings /tmp/dark_patterns.json
```

## Dark Pattern Types Detected

| Type | Severity | Detection Method |
|------|----------|-----------------|
| Confirm-shaming | High | Regex on text content |
| Hidden options | Medium | CSS analysis |
| Pre-selected options | High | HTML attribute detection |
| Asymmetric flow | Medium-High | Step count comparison |

## Output Format

```json
{
  "tool": "dark-pattern-detector",
  "action": "scan-html",
  "total_findings": 3,
  "by_type": {"confirm_shaming": 2, "preselected_option": 1}
}
```
