Skip to content

Commit 3346c19

Browse files
committed
Drop integration rules duplicated from the context-mill commandments
The prompt lines about shipping a plugin instead of editing functions.php, the ABSPATH guard, esc_js on the token, and flushing after capture are all in the wordpress block of context-mill's commandments.yaml, which reaches the agent with the skill. Repeating them here duplicates integration knowledge across the boundary AGENTS.md draws between the two repos, and would drift the moment either side is edited. getAdditionalContextLines now carries only what the skill cannot know: the project shape this run is pointed at. pnpm build, pnpm test (1576 passing), pnpm fix — clean.
1 parent 7f2f72d commit 3346c19

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/frameworks/wordpress/wordpress-wizard-agent.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,12 @@ export const WORDPRESS_AGENT_CONFIG: FrameworkConfig<WordPressContext> = {
8989
? getWordPressProjectTypeName(context.projectType)
9090
: 'unknown';
9191

92+
// Integration rules (plugin over functions.php, ABSPATH, esc_js, flush)
93+
// live in context-mill's wordpress commandments and reach the agent with
94+
// the skill. Only project-shape facts the skill cannot know belong here.
9295
const lines = [
9396
`Project type: ${projectTypeName}`,
9497
`Framework docs ID: php (use posthog://docs/frameworks/php for documentation)`,
95-
"Ship the integration as a standalone plugin. Do NOT edit the active theme's functions.php — a theme switch or theme update silently removes the tracking.",
96-
"Guard every plugin entry file with `if (!defined('ABSPATH')) { exit; }` before any other code.",
97-
'Print the client snippet from a wp_head hook and escape the interpolated token with esc_js().',
98-
'Capture pageviews client-side. Reserve PostHog::capture for server-side WordPress actions such as comment_post, user_register, or woocommerce_thankyou, and call PostHog::flush() after each capture — a web request has no single exit point like a CLI script.',
9998
];
10099

101100
if (context.pluginsDir) {

0 commit comments

Comments
 (0)