Skip to content

chore: Create a skill file that captures the wizard architecture principles#438

Merged
daniloc merged 12 commits into
mainfrom
wizard-dev-skill
May 11, 2026
Merged

chore: Create a skill file that captures the wizard architecture principles#438
daniloc merged 12 commits into
mainfrom
wizard-dev-skill

Conversation

@daniloc
Copy link
Copy Markdown
Collaborator

@daniloc daniloc commented May 5, 2026

Let's make it easy for other teams to extend the wizard, with pull requests that are easy to approve.

This skill is a collaboration between myself and Opus 4.7:

  • Core wizard architecture loaded into context
  • Adversarial example code loaded into context
  • Design principles exposed and refined
  • Implicit things we've been building into the project over two quarters made explicit

After extended discussion, the model took a swing at SKILL.md, which I edited closely. I think it's pretty good!

ARCHITECTURE.md cues future agents with a low-cost survey of the project, sparing it around a dozen tool calls of reading. ANTI-PATTERNS.md illuminates the failure modes of breaking the architecture bargains.

Questions

  • Seem about right? Anything you meaningfully take issue with?
  • Do we need ANTI-PATTERNS? It certainly follows the redirect strategy we know works well at a micro level (instead of useEffect, do…)

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

🧙 Wizard CI

Run the Wizard CI and test your changes against wizard-workbench example apps by replying with a GitHub comment using one of the following commands:

Test all apps:

  • /wizard-ci all

Test all apps in a directory:

  • /wizard-ci basic-integration
  • /wizard-ci misc
  • /wizard-ci revenue

Test an individual app:

  • /wizard-ci basic-integration/android
  • /wizard-ci basic-integration/angular
  • /wizard-ci basic-integration/astro
Show more apps
  • /wizard-ci basic-integration/django
  • /wizard-ci basic-integration/fastapi
  • /wizard-ci basic-integration/flask
  • /wizard-ci basic-integration/javascript-node
  • /wizard-ci basic-integration/javascript-web
  • /wizard-ci basic-integration/laravel
  • /wizard-ci basic-integration/next-js
  • /wizard-ci basic-integration/nuxt
  • /wizard-ci basic-integration/python
  • /wizard-ci basic-integration/rails
  • /wizard-ci basic-integration/react-native
  • /wizard-ci basic-integration/react-router
  • /wizard-ci basic-integration/sveltekit
  • /wizard-ci basic-integration/swift
  • /wizard-ci basic-integration/tanstack-router
  • /wizard-ci basic-integration/tanstack-start
  • /wizard-ci basic-integration/vue
  • /wizard-ci misc/quack-quack
  • /wizard-ci revenue/stripe

Results will be posted here when complete.

@daniloc daniloc requested a review from a team May 5, 2026 21:01
Copy link
Copy Markdown
Collaborator

@gewenyu99 gewenyu99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things to think about:

  • Somewhere, maybe many places, we should tell it to update this if it makes conflicting hcnages
  • What about tests? What needs tests?
  • We should run this on PostHog Code with cloud runner on 4.7 max and let it do some iterative refactoring. I know for a fact we break these rules some places (probably my fault too)


**New agent tool (in-process MCP):** Add it to `wizard-tools.ts` alongside `check_env_keys`, `set_env_values`, etc. The tool runs locally — secret values never leave the machine. Register the tool name in `WIZARD_TOOL_NAMES` so the SDK allowlist includes it. Follow the existing tool pattern: zod schema, path-traversal protection, logging.

**New security rule:** Add a `YaraRule` object to the `RULES` array in `yara-scanner.ts`. Each rule has a name, description, severity, category, `appliesTo` (which hook+tool combinations), and `patterns` (compiled regex). One match per rule is sufficient. The hooks in `yara-hooks.ts` don't need to change — they iterate the rules array automatically.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right extension surface always or should some go in the warlock repo?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .claude/skills/wizard-development/SKILL.md Outdated

These are the early warning signs that a change is drifting from the discipline:

- **The runner is getting longer.** If you're adding lines to `agent-runner.ts` or `agent-interface.ts`, ask whether the concern belongs in a `WorkflowRun` config, a middleware, a post-run hook, or a skill file.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost nothing should go into the agent runners anymore. I find that this is a common trip up for agents

Comment thread .claude/skills/wizard-development/references/ARCHITECTURE.md Outdated
Comment thread .claude/skills/wizard-development/references/ARCHITECTURE.md Outdated
@daniloc
Copy link
Copy Markdown
Collaborator Author

daniloc commented May 6, 2026

@gewenyu99 I just added a whole skill maintenance reference, plus guidance in the SKILL.md: update on architecture changes

https://github.com/PostHog/wizard/pull/438/changes#diff-c58cc86b3b47b85f6df701d3463e7f27a2f7ccebc8e6542695ba612dea8ad897

@daniloc daniloc changed the title Create a skill file that captures the wizard architecture principles chore: Create a skill file that captures the wizard architecture principles May 6, 2026
@daniloc
Copy link
Copy Markdown
Collaborator Author

daniloc commented May 6, 2026

plus a note about tests in SKILL.md

Copy link
Copy Markdown
Collaborator

@sarahxsanders sarahxsanders left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warlock stuff is gooooooood 🚀

@daniloc daniloc enabled auto-merge (squash) May 11, 2026 22:36
@daniloc daniloc disabled auto-merge May 11, 2026 22:36
@daniloc daniloc merged commit 77fae72 into main May 11, 2026
17 checks passed
@daniloc daniloc deleted the wizard-dev-skill branch May 11, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants