From 790f0959705203d60934472bed816946cab66e8b Mon Sep 17 00:00:00 2001 From: Kahhow Lee Date: Fri, 3 Apr 2026 12:11:39 +0800 Subject: [PATCH 1/3] Document planned co-contributor push automation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a new section describing an automated workflow to detect when co-contributor JulesWyrm pushes raw HTML tool changes. Includes problem statement, goals, and a design: a GitHub Actions trigger on push with two jobs — Notify (detect commits by JulesWyrm and call Beeper) and Auto-issue (generate a diff, send to Anthropic Claude for analysis, create a structured GitHub issue assigned to Copilot to perform Next.js wiring). Notes required secrets (ANTHROPIC_API_KEY, BEEPER_*, GITHUB_TOKEN) and rationale for using Claude for analysis and Copilot for implementation. Status marked as Planned. --- dev.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dev.md b/dev.md index 66c81d5..d08773f 100644 --- a/dev.md +++ b/dev.md @@ -152,3 +152,41 @@ Run with `npm test`. 20 tests across 3 suites, all passing. | B001 | Fixed | Circuit suite iframe state loss on tab switch | Fixed by rendering both iframes simultaneously, toggling with CSS display:none | | B002 | Fixed | Electromagnet coil flat rendering (no depth) | Fixed draw order: back arches → rod (white fill) → front arches | | B003 | Reverted | Electromagnet integration removed from circuit tools | Symbol style did not match required exam format (hatched steel rod + stacked cell symbols). To be redesigned before re-integrating. | + +--- + +## Planned: Co-contributor Push Automation + +### Problem +JulesWyrm (co-contributor) pushes raw HTML tool additions/enhancements directly. These changes need Next.js wiring (new page, `tool-id`, tracker meta, tests) before they are production-ready. Currently this wiring is done manually after noticing her push. + +### Goal +Automate detection, notification, and issue creation whenever JulesWyrm pushes, so nothing falls through the cracks. + +### Design + +**Trigger:** GitHub Actions workflow on `push` to any branch. + +**Job 1 — Notify** +- Check if any commit author in the push is `JulesWyrm` +- If yes, call Beeper API to send a push notification to Kahhow + +**Job 2 — Auto-issue (runs only on JulesWyrm pushes)** +- Generate a diff of her changes (`git diff HEAD~1..HEAD`) +- Send the diff to Claude API (Anthropic) with a structured prompt that checks for: + - New HTML files in `public/tools/` → needs a Next.js page + `tool-id` added to `VALID_TOOLS` + - Missing `` or `\` tag before \`\` +- Every new tool also needs: + 3. A new route at \`app/tools//page.tsx\` that renders a full-viewport iframe + 4. A new tool-id string added to the VALID_TOOLS Set in \`app/api/event/route.ts\` + 5. A Jest test suite in \`__tests__/canvas/.test.js\` using + \`loadCircuitScript\` (non-IIFE) or \`loadIifeScript\` (IIFE scripts) + from \`__tests__/canvas/helpers.js\` +- When canvas logic functions change (snap, gcd, componentSize, getComponentNodes, + rotatePoint, getLocalNodes), the corresponding __tests__/canvas/ suite likely + needs updating. +- GRID=28, COMPONENT_SCALE=0.8 for circuit_diagram_creatorv2.html +- GRID=22.4 for circuit_diagram_secjc.html; includes transistor (3-node) and transformer (2-node) +- object_circuitv2.html: COMPONENT_SCALE=0.8 for battery/switch, BULB_SCALE=1 (bulb nodes unscaled) +` + +// Truncate at 48 000 chars to avoid runaway costs on huge diffs +const diffSnippet = diff.length > 48_000 + ? diff.slice(0, 48_000) + '\n\n[... diff truncated at 48 000 chars ...]' + : diff + +const USER_PROMPT = `\ +Below is a git diff from a push by JulesWyrm. Analyse it and produce a GitHub +issue body in Markdown describing the Next.js wiring work needed. + +Structure your response as: +1. A short (2-3 sentence) **Summary** of what changed. +2. A **Checklist** of actionable tasks (GitHub task-list syntax: \`- [ ] ...\`), + covering where relevant: + - New \`public/tools/\` HTML files that need a Next.js page + - Missing or incorrect \`\` tags + - Missing \`