Skip to content

Commit 0ec392e

Browse files
Tsvetan StoychevTsvetan Stoychev
authored andcommitted
Add project agent skills and privacy guidance
1 parent caed894 commit 0ec392e

28 files changed

Lines changed: 605 additions & 2 deletions

File tree

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
name: audit-basicrum-privacy
3+
description: Audit Basicrum's privacy implementation and disclosures. Use for GDPR, ePrivacy, cookies, consent, telemetry data flows, collector roles, retention, transfers, privacy-policy text, plugin descriptions, or release privacy reviews.
4+
---
5+
6+
# Audit Basicrum Privacy
7+
8+
## Purpose
9+
10+
Perform an evidence-based privacy engineering and compliance-readiness review of
11+
the WordPress plugin, its bundled browser code, and its documented collector
12+
relationship. Do not certify the plugin or a site as "GDPR compliant" and do not
13+
replace advice from qualified counsel.
14+
15+
## Establish Scope
16+
17+
1. Identify the deployment model: hosted or self-hosted collector, applicable
18+
jurisdictions, target visitors, and enabled Basicrum features.
19+
2. Identify the likely roles of the site operator, Basicrum, hosting providers,
20+
and other recipients. Record unknown controller, processor, joint-controller,
21+
subprocessor, contract, transfer, retention, and lawful-basis questions as
22+
`NEEDS LEGAL DECISION`; do not guess.
23+
3. Review current official primary sources. At minimum, consult the WordPress
24+
Plugin Handbook privacy guidance, GDPR text, ePrivacy Article 5(3), and EDPB
25+
consent guidance. Record source links, jurisdiction, and access date.
26+
4. Treat ePrivacy storage or terminal-access rules separately from GDPR lawful
27+
basis. Do not assume that a GDPR lawful basis automatically permits cookies.
28+
29+
## Trace the Real Data Flow
30+
31+
Inspect code and runtime behavior rather than relying on documentation alone.
32+
Include `src/Assets.php`, `src/Admin/Privacy.php`, settings and validation code,
33+
both loader variants, bundled Boomerang code and plugins, consent adapters,
34+
uninstall behavior, PHP tests, browser tests, and an intercepted representative
35+
beacon.
36+
37+
Create an inventory with one row per data element or storage operation:
38+
39+
- source and trigger;
40+
- exact field, identifier, URL component, or cookie/storage key;
41+
- purpose and feature dependency;
42+
- recipient and onward recipient;
43+
- transmission security and access boundary;
44+
- retention and deletion path;
45+
- behavior before consent, after opt-in, after denial, and after withdrawal;
46+
- corresponding public disclosure and unresolved legal decision.
47+
48+
Pay particular attention to full page and resource URLs, query strings,
49+
referrers, IP addresses observed by the collector, user agents, device and
50+
network attributes, performance and interaction timings, Brum Site ID, page
51+
type, cross-page identifiers, and accidental sensitive data in URLs. Minimize or
52+
remove collection that is not necessary for the documented purpose.
53+
54+
## Audit Cookies and Consent
55+
56+
1. Enumerate every cookie and browser-storage value read, created, refreshed,
57+
or removed by Basicrum or bundled code. Record name, host/domain, path,
58+
lifetime, Secure, SameSite, purpose, and proposed essential/non-essential
59+
classification.
60+
2. Verify that a new installation uses the privacy-protective loading default.
61+
3. In consent-controlled mode, verify that no monitoring request, identifier,
62+
or non-essential storage occurs before the external tool's authoritative
63+
opt-in callback.
64+
4. Verify opt-in is idempotent and cannot load duplicate instrumentation.
65+
5. Verify denial and withdrawal stop future collection and remove Basicrum
66+
cookies across the supported host and parent-domain cases. Clearly document
67+
any collection that cannot be undone without a page reload.
68+
6. Verify immediate mode is intentional, plainly warned, and never described as
69+
automatically lawful.
70+
7. Test granted, denied, unknown, and region-dependent consent states for each
71+
supported adapter, using both readable and minified production loaders.
72+
73+
## Audit WordPress Integration and Disclosures
74+
75+
Compare actual behavior with all public and administrator-facing statements:
76+
77+
- the plugin header `Description`;
78+
- the `readme.txt` short and long descriptions and FAQ;
79+
- repository documentation and consent integration examples;
80+
- settings labels, warnings, and help text;
81+
- editable WordPress Privacy Policy Guide content registered through
82+
`wp_add_privacy_policy_content()`.
83+
84+
Require an explicit privacy-first statement in the plugin header and WordPress
85+
readme, but reject blanket compliance claims. Disclose the actual data
86+
categories, purposes, recipients, cookies, consent modes, withdrawal limits,
87+
and site-operator responsibilities in language a webmaster can act on.
88+
89+
Determine from evidence whether WordPress personal-data exporter and eraser
90+
callbacks apply. If the plugin stores no visitor personal data in WordPress,
91+
mark them `NOT APPLICABLE` with evidence and separately assess rights handling
92+
at the remote collector. Verify uninstall removes plugin settings without
93+
silently claiming that remote telemetry was erased.
94+
95+
## Verify With Tests
96+
97+
Add or run proportionate tests for every changed privacy boundary:
98+
99+
- PHP tests for privacy-safe defaults, disabled/missing-setting runtime gates,
100+
settings validation, and Privacy Policy Guide content;
101+
- browser tests for pre-consent silence, one-time opt-in, denial, withdrawal,
102+
cookie cleanup, HTTP/HTTPS behavior, subdomains, and both loader variants;
103+
- runtime interception that records the actual request URL, headers, payload,
104+
cookies, and browser storage without contacting a production collector;
105+
- packaging checks that confirm the reviewed privacy text and production
106+
assets are present in the release ZIP.
107+
108+
Run the narrow tests first, then the repository checks affected by the change.
109+
Never treat a passing automated test as legal approval.
110+
111+
## Report the Audit
112+
113+
Use only these statuses:
114+
115+
- `PASS` - code, runtime evidence, tests, and disclosure agree.
116+
- `FAIL` - a concrete privacy, consent, cookie, security, or disclosure defect.
117+
- `NEEDS LEGAL DECISION` - the answer depends on jurisdiction, contracts,
118+
purpose, legal basis, retention, transfers, or operator configuration.
119+
- `NOT APPLICABLE` - supported by evidence, not assumption.
120+
121+
For each item, report requirement or risk, status, code/runtime evidence,
122+
current official source, remediation, and owner. Separate plugin engineering
123+
work from collector/backend work and site-operator or counsel decisions. End
124+
with residual risks and the exact tests run. Never conclude with an unqualified
125+
claim of GDPR or cookie-law compliance.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Audit Basicrum Privacy"
3+
short_description: "Audit privacy, cookies, consent, and disclosures"
4+
default_prompt: "Use $audit-basicrum-privacy to audit Basicrum's data flows, cookies, consent behavior, and public privacy disclosures."
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: change-basicrum-settings
3+
description: Change Basicrum WordPress settings across defaults, admin UI, validation, migrations, and runtime gates. Use for Beacon URL, Brum Site ID, monitoring enablement, HTTP Strictness, Script Position, or any basicrum_settings option.
4+
---
5+
6+
# Change Basicrum Settings
7+
8+
Treat a setting as one behavior spanning storage, administration, validation,
9+
runtime use, upgrades, tests, documentation, and translations.
10+
11+
## Map the setting
12+
13+
1. Inspect `plugins/basicrum/src/Helpers.php` for keys and defaults.
14+
2. Inspect `Admin/Settings/Page.php` and `Validate.php` for rendering,
15+
sanitization, validation, and error messages.
16+
3. Inspect `Admin/Upgrades.php` before changing an existing stored value.
17+
4. Find every runtime consumer and existing test with `rg`.
18+
5. Define behavior for new installs, existing installs, enabled monitoring, and
19+
disabled monitoring before editing.
20+
21+
## Implement the complete behavior
22+
23+
- Keep the `basicrum_settings` schema synchronized across defaults, UI,
24+
validation, migrations, runtime code, tests, docs, and translations.
25+
- Make server-side validation authoritative. Client-side disabled states and
26+
invalid-field styling are usability aids, not security controls.
27+
- Require a valid Beacon URL and Brum Site ID when monitoring is enabled. Keep
28+
frontend injection gated when either required value is absent.
29+
- Disable dependent controls when monitoring is disabled, and preserve a clear
30+
visual hierarchy between general, performance, privacy, and developer fields.
31+
- Keep Script Position outside Developer Settings. Keep HTTP Strictness disabled
32+
by default and describe it as local HTTP testing support, not a production
33+
mode.
34+
- Use WordPress Settings API errors and accessible field associations. Align any
35+
invalid icon with the field it describes and render it only while invalid.
36+
- Sanitize by data type, escape for the final output context, and preserve
37+
capability and nonce protections already supplied by the settings flow.
38+
- Add a version-gated migration when stored data must change. Make migrations
39+
idempotent.
40+
41+
If user-facing text changes, also apply `$update-basicrum-copy`.
42+
43+
## Verify
44+
45+
Run focused tests while iterating, then run:
46+
47+
```bash
48+
make lint-php
49+
make lint
50+
make analyse
51+
make unit
52+
make conventions
53+
```
54+
55+
Run `make translations` for changed strings and require a second generation to
56+
produce no diff. Manually verify enabled, disabled, invalid, and valid form
57+
states when layout or browser behavior changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Change Basicrum Settings"
3+
short_description: "Change and verify Basicrum administrator settings"
4+
default_prompt: "Use $change-basicrum-settings to implement and verify a Basicrum administrator setting change."
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: extend-basicrum-page-types
3+
description: Add and test Basicrum p_type detection for WordPress and WooCommerce. Use for PageTypeDetector.php or shop, product, cart, checkout, order-pay, order-received, account, archive, and other page classifications.
4+
---
5+
6+
# Extend Basicrum Page Types
7+
8+
Treat `p_type` as a public analytics taxonomy whose names and precedence must be
9+
stable, observable in real beacons, and safe when optional plugins are absent.
10+
11+
## Define the classification
12+
13+
1. Inspect `plugins/basicrum/src/PageTypeDetector.php` and its unit tests.
14+
2. Confirm the platform's official conditional functions and the lifecycle point
15+
at which the main query makes them reliable.
16+
3. Choose a stable `p_type` label and place the condition in specificity order.
17+
WooCommerce order-received and order-pay checks must precede general checkout;
18+
product checks must precede general WordPress single-page checks.
19+
4. Guard optional plugin classes and functions so Basicrum works without
20+
WooCommerce.
21+
5. Preserve the `basicrum_page_type` filter and the `unknown` fallback.
22+
23+
Use external projects only to inform taxonomy ideas. Implement the Basicrum
24+
logic independently and acknowledge inspiration accurately when adding a new
25+
external source.
26+
27+
## Cover three layers
28+
29+
- Add unit coverage for the new condition, false path, overlapping-condition
30+
precedence, optional-plugin absence, and filter behavior when applicable.
31+
- Confirm `Assets` serializes the value into inline configuration.
32+
- For commerce routes, extend the isolated WooCommerce browser suite so it
33+
visits the real page anonymously and asserts the actual emitted beacon.
34+
35+
The E2E assertion must verify `p_type`, `p_gen=wp`, and `brum_site_id`, not only
36+
DOM markup. Seed the minimum product, cart, or order state needed for the route.
37+
Keep Coming soon mode disabled so anonymous storefront visibility is part of the
38+
test.
39+
40+
## Verify
41+
42+
```bash
43+
make lint-php
44+
make lint
45+
make analyse
46+
make unit
47+
make woocommerce-e2e
48+
make conventions
49+
git diff --check
50+
```
51+
52+
When changing the WooCommerce environment, keep its version and checksum paired
53+
in `tools/setup-woocommerce-e2e.sh` and keep Docker tags paired with immutable
54+
digests in `docker/woocommerce-e2e.yml`.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Extend Basicrum Page Types"
3+
short_description: "Add and test WordPress page classifications"
4+
default_prompt: "Use $extend-basicrum-page-types to add and verify a Basicrum page type."
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: integrate-basicrum-consent
3+
description: Integrate and test external consent tools with Basicrum's opt-in and opt-out wrappers. Use for Borlabs Cookie, WP Consent API, Complianz, CookieYes, consent events, regional defaults, withdrawal, cookie cleanup, or adapter tests.
4+
---
5+
6+
# Integrate Basicrum Consent
7+
8+
Keep Basicrum as a small execution gate around an external consent tool's
9+
authoritative decision.
10+
11+
## Establish the provider contract
12+
13+
1. Read the provider's current official documentation and shipped public source.
14+
2. Use community reports to identify initialization, caching, aggregation, and
15+
version edge cases, not as the sole contract source.
16+
3. Record the supported provider version and review date in documentation when
17+
behavior can change.
18+
4. Confirm initial state, stored state on later page loads, event names, payload
19+
shapes, category IDs, callback timing, regional defaults, withdrawal, and
20+
whether the provider signals on every page.
21+
5. Separate an explicit visitor opt-in from a provider reporting that monitoring
22+
is allowed under an opt-out regional policy.
23+
24+
## Build the adapter
25+
26+
- Keep exactly two Basicrum public callbacks:
27+
`OPT_IN_BASICRUM_LOADER_WRAPPER()` and
28+
`OPT_OUT_BASICRUM_LOADER_WRAPPER()`.
29+
- Make the provider adapter call exactly one callback on every page after the
30+
consent loader is available. Check that the selected callback exists before
31+
calling it.
32+
- Do not add a second Basicrum consent state, `BRUM_CONSENT` API, cookie, or
33+
state lookup inside the Boomerang loader.
34+
- Keep opt-in loading idempotent. Keep opt-out idempotent, disable collection,
35+
and remove the documented Boomerang cookies for the current host and parent
36+
domains.
37+
- Put webmaster adapters in `examples/integrations/`, outside the installable
38+
plugin. Do not modify a production loader merely to accommodate a test.
39+
- Document script ordering and cache/minification exclusions. Do not claim that
40+
an adapter replaces legal review or consent-tool configuration.
41+
42+
## Test the real boundary
43+
44+
- Execute the exact example adapter against a thin test double that models only
45+
the provider's documented public API, defaults, events, and payloads.
46+
- Cover adapter-before-provider and provider-before-adapter initialization,
47+
saved grant, saved denial, new grant, withdrawal, duplicate events, and
48+
irrelevant categories.
49+
- Cover opt-in and opt-out regional defaults for region-aware APIs.
50+
- Run the privacy-critical loader suite against both minified and unminified
51+
loader variants while intercepting Boomerang and blocking unexpected network
52+
requests.
53+
54+
```bash
55+
make js-test
56+
make unit
57+
make conventions
58+
git diff --check
59+
```
60+
61+
Update `examples/integrations/README.md`, the main README, plugin readme, privacy
62+
guidance, and translations when the administrator-visible contract changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Integrate Basicrum Consent"
3+
short_description: "Integrate and test external consent tools"
4+
default_prompt: "Use $integrate-basicrum-consent to add or review a Basicrum consent-tool adapter and its contract tests."
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
name: release-basicrum-plugin
3+
description: Build and verify installable Basicrum WordPress releases. Use for packaging, Composer production autoloading, version metadata, Tested up to, compatibility matrices, action pins, permissions, checksums, ZIP smoke tests, or release gates.
4+
---
5+
6+
# Release Basicrum Plugin
7+
8+
Test the artifact users install, not only the source checkout.
9+
10+
## Preserve the package boundary
11+
12+
- Treat `plugins/basicrum/` as the installable plugin and repository root files
13+
as development tooling unless explicitly copied by the release builder.
14+
- Build through `tools/build-release.sh`. Install Composer production
15+
dependencies in a temporary tree with an optimized authoritative autoloader;
16+
do not replace normal Composer PSR-4 loading with a handwritten runtime
17+
autoloader.
18+
- Include referenced runtime PHP, JavaScript, CSS, images, translations, readme,
19+
license, and production vendor files.
20+
- Exclude tests, Playwright and Node files, examples, Docker files, agent skills,
21+
local configuration, caches, and development dependencies.
22+
- Generate the SHA-256 checksum from the exact ZIP that passed smoke testing.
23+
24+
## Keep release metadata and support claims honest
25+
26+
Keep the plugin header Version, `BASICRUM_VERSION`, `Stable tag`, top changelog
27+
version, and `v<version>` release tag identical. Advance `Tested up to` only
28+
after blocking integration rows for that stable WordPress train pass. Never use
29+
beta, nightly, trunk, or a patch version for that field.
30+
31+
Keep PHP unit coverage continuous from 7.4 through the newest supported release.
32+
Keep minimum WordPress, current stable, and non-blocking trunk integration roles
33+
explicit and use combinations supported by WordPress core.
34+
35+
## Harden release automation
36+
37+
- Pin third-party GitHub Actions to reviewed full commit SHAs and keep adjacent
38+
release-tag comments synchronized.
39+
- Review Dependabot release notes, permissions, runtime changes, and CI before
40+
merging updates.
41+
- Keep default workflow permissions read-only. Grant `contents: write` only to
42+
release jobs that attach artifacts.
43+
- Run Composer validation, auditing, PHPStan, translation reproducibility,
44+
repository conventions, and generated-asset checks.
45+
46+
## Exercise the artifact
47+
48+
```bash
49+
make package
50+
make package-verify
51+
make package-smoke
52+
```
53+
54+
Inspect the ZIP listing, install it into clean WordPress, activate through
55+
WP-CLI, render an admin and frontend request, confirm the loader appears with
56+
valid settings, and reject PHP warnings or fatals.
57+
58+
Before a production release, run every check listed in `AGENTS.md`, confirm the
59+
blocking CI matrix is green, and exercise release-workflow-only dependency
60+
updates through a prerelease. Report any gate not actually run.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "Release Basicrum Plugin"
3+
short_description: "Build and verify installable Basicrum releases"
4+
default_prompt: "Use $release-basicrum-plugin to prepare and verify an installable Basicrum WordPress release."

0 commit comments

Comments
 (0)