Automattic/wordpress-atmosphere / .agents/skills/review
review
UnverifiedShared base for reviewing a diff, a branch or a PR in this plugin. How to read the diff, which repo guidelines to load for the changed paths, and the shape of a finding. Used by the code-review and security-audit agents.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.1 KB |
| guidelines/accessibility.md | markdown | 781 B |
| guidelines/authorization.md | markdown | 2.8 KB |
| guidelines/content-exposure.md | markdown | 6.8 KB |
| guidelines/cron.md | markdown | 1.9 KB |
| guidelines/hooks.md | markdown | 2.3 KB |
| guidelines/oauth.md | markdown | 3.6 KB |
| guidelines/output.md | markdown | 610 B |
| guidelines/records.md | markdown | 2.1 KB |
| guidelines/remote-fetch.md | markdown | 5.3 KB |
| guidelines/supply-chain.md | markdown | 582 B |
| guidelines/uninstall.md | markdown | 2.0 KB |
| guidelines/well-known.md | markdown | 1.4 KB |
| judge.md | markdown | 1.2 KB |
guidelines/hooks.md
View on GitHub# Hooks and filters
`atmosphere_` hooks that other plugins can use to weaken a gate, and what the plugin does with a filter's return value.
Applies to: any added or changed `apply_filters()`, `do_action()` or `add_filter()` call
## Past issues
- **Type confusion through filters** (ActivityPub): third-party plugins returned `null` into filters that expected arrays, which caused a class of `array_keys(null)` fatals. The same pattern can break ATmosphere.
## Rules
- Catalog the `atmosphere_` filters and actions the change adds or touches, and name the ones that could weaken a security check if hooked (disabling an auth check, changing token handling).
- A filtered value is checked before it is used as the documented type.
- Hooks that carry tokens or keys cannot be observed by lower-privilege code.
- A boolean filter that gates sensitive behavior (for example `atmosphere_should_publish_comment`) is cast to `bool` at the call site, so a truthy string does not widen the gate.
- The `atmosphere_publishing` action's loop guard cannot be bypassed by a third-party hook that resets it.
## Container validation is not content validation
A filter that builds OAuth client metadata or any other security-sensitive structure validates every entry inside the container, not just its shape. `is_array( $filtered ) && ! empty( $filtered['redirect_uris'] )` accepts `['']`, `[null]`, `[['nested']]` and `['https://evil.example/cb']`. For public-client metadata, where `token_endpoint_auth_method: 'none'` lets anyone use the advertised `client_id`, an off-site `redirect_uris` entry leaks tokens. Run every entry through the gate the equivalent inbound filter applies (for example an `admin_url('')` prefix match).
## Say when a filter broke its contract
A silent fallback on a wrong-shaped return leaves third-party developers looking at a no-op with no log. Every `apply_filters` site that validates the return shape and falls back calls `_doing_it_wrong()`: visible under `WP_DEBUG`, silent in production.
## Scope a filter to the call it protects
`add_filter( 'allowed_redirect_hosts', $closure )` immediately before `wp_safe_redirect()` and `remove_filter(...)` immediately after, instead of relying on the `exit` that ends the script. Production behaves the same; tests or `wp_die()` handlers that intercept the redirect cannot leak the filter into later redirects in the same request.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |