Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
caf360a
feat(agents): add `agents` content type, built and served alongside s…
gewenyu99 Jun 9, 2026
e70da8b
feat(orchestrator): agent prompts + mini-skills for the integration flow
gewenyu99 Jun 9, 2026
ba51465
refine the orchestrator integration flow
gewenyu99 Jun 9, 2026
b8e66ec
feat(agents): per-flow registry markers — flow + seed frontmatter
gewenyu99 Jun 10, 2026
5ddce45
feat(skills): emit framework commandments as references/COMMANDMENTS.md
gewenyu99 Jun 10, 2026
0a62554
feat(agents): dashboard is not a CI task
gewenyu99 Jun 10, 2026
464c6fd
revert ci awareness from agent content — the harness owns run-mode po…
gewenyu99 Jun 10, 2026
5a3d5e4
feat(orchestrator): parallel error-tracking, seed full graph, cache p…
gewenyu99 Jun 17, 2026
8092ddb
fix(skills): SDK error integration + personless anon events
gewenyu99 Jun 17, 2026
3f7325e
revert: drop hardcoded Django middleware prose from error-tracking-step
gewenyu99 Jun 17, 2026
3a9a57d
fix(build skill): don't fight install, report and move on
gewenyu99 Jun 17, 2026
08a91ca
feat(docs): reference identity-resolution.md everywhere identity is
gewenyu99 Jun 17, 2026
5d937f5
build skill: leave pre-existing errors in untouched files alone
gewenyu99 Jun 17, 2026
0132217
Merge origin/main into experiment/orchestrator
gewenyu99 Jun 18, 2026
46e04e7
fix: drop stale identity-resolution shared_doc to match main
gewenyu99 Jun 18, 2026
1744e83
refactor: nest orchestrator step-skills under basic-integration/, dro…
gewenyu99 Jun 18, 2026
a16ed9b
fix(orchestrator): keep basic-integration step-skills goal-oriented
gewenyu99 Jun 18, 2026
4d4a682
feat(orchestrator): per-framework variants for the SDK-divergent step…
gewenyu99 Jun 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions context/agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Agent prompts

One `<type>.md` per orchestrator task — the WHAT of the task. The frontmatter
carries the artifacts the executor configures the run with: the model, the
mini-skills to load (the HOW), the tools the task may and may not use, and the
tasks it depends on. `flow` names the program the agent belongs to — the
wizard's registry is scoped per flow, so audit or migration agents live
alongside these — and one prompt per flow is marked `seed: true`: the planner
that seeds the queue, not an enqueueable task type.

The body is intent only — what to do and what done looks like. The client
injects the basics (project context, how to report, how to surface progress),
so a prompt never restates them.

This README is documentation, not data: the build serves every other `.md` in
this folder as an agent prompt.

```markdown
---
type: example
flow: my-flow
model: claude-haiku-4-5-20251001
skills: []
allowedTools: [Read, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: []
---

## Goal

What this task does, in plain prose.

## How you know you succeeded

Plain-text success criteria live here. State what done looks like, and what to
do when the task cannot be completed.
```
25 changes: 25 additions & 0 deletions context/agents/build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
type: build
flow: posthog-integration
label: Install dependencies and build
model: claude-sonnet-4-6
skills: [basic-integration-build]
allowedTools: [Read, Edit, Glob, Grep, Bash]
disallowedTools: [enqueue_task]
dependsOn: [install, init, identify, error-tracking, capture]
---

## Goal

Bring the integration together: install the dependencies the earlier steps
declared, then verify the project builds, lints, and passes its tests. Until now
the steps only edited code and the manifest — this is where it actually installs
and is checked.

## How you know you succeeded

The install completes and the build, lint, and tests pass. If you hit a conflict
you cannot cleanly resolve — a dependency clash, a build error from the new code —
fix what you safely can, then report it: put a one-line summary in your handoff's
`conflict` field and the full detail in what you did. The user sees the one-liner
in the outro and the detail in the report.
22 changes: 22 additions & 0 deletions context/agents/capture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
type: capture
flow: posthog-integration
label: Capture events
model: claude-sonnet-4-6
skills: [basic-integration-capture]
allowedTools: [Read, Edit, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: [install, init]
---

## Goal

Decide which events are worth capturing in this app, then instrument them in the
same pass — read each file once, choose the events, and add the capture calls
while the file is already open.

## How you know you succeeded

The meaningful user actions across the app have capture calls that fire on the
real action, not on page load, and `.posthog-wizard-cache/.posthog-events.json`
lists the events you instrumented.
20 changes: 20 additions & 0 deletions context/agents/dashboard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
type: dashboard
flow: posthog-integration
label: Create a starter dashboard
model: claude-sonnet-4-6
skills: [basic-integration-dashboard]
allowedTools: [Read, Glob, Grep]
disallowedTools: [Write, Edit, Bash, enqueue_task]
dependsOn: [build]
---

## Goal

Create a starter PostHog dashboard with a few insights built on the events this
integration instruments, using the PostHog MCP.

## How you know you succeeded

A dashboard exists with a handful of insights on the captured events, and you hand
off its URL for the report to link.
28 changes: 28 additions & 0 deletions context/agents/error-tracking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
type: error-tracking
flow: posthog-integration
label: Add error tracking
model: claude-sonnet-4-6
skills: [basic-integration-error-tracking-step]
allowedTools: [Read, Write, Edit, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: [install, init]
---

## Goal

Set up the framework's single global error boundary so uncaught errors reach
PostHog. One place — the init or app entry — following the docs and the reference
example, not manual capture calls sprinkled across files. The SDK is already
installed and initialized (see the context from previous steps); build on that,
do not re-check it.

This is an instrument-only task. Do not install dependencies, run the build, run
tests, or start the app — a later `build` step does all verification. Stay inside
this project's directory and edit the one global handler; that is the whole job.

## How you know you succeeded

A global error handler forwards exceptions to PostHog. You did not install
anything, run a build or tests, search outside the project, or read through the
whole app or hand-wrap individual components or routes.
20 changes: 20 additions & 0 deletions context/agents/identify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
type: identify
flow: posthog-integration
label: Wire user identification
model: claude-sonnet-4-6
skills: [basic-integration-identify]
allowedTools: [Read, Edit, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: [install, init]
---

## Goal

Wire user identification: call PostHog identify wherever the app establishes who
the user is, typically at login and signup.

## How you know you succeeded

An identify call fires at the point the user becomes known, with a stable
distinct id. If the app has no auth or user concept, say so and stop.
21 changes: 21 additions & 0 deletions context/agents/init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
type: init
flow: posthog-integration
label: Set up PostHog initialization
model: claude-haiku-4-5-20251001
skills: [basic-integration-init]
allowedTools: [Read, Write, Edit, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: []
---

## Goal

Initialize PostHog: create the framework's init point so the SDK is configured
once and available across the app, and set the PostHog environment variables
through the wizard tools.

## How you know you succeeded

The init file exists and the PostHog env keys are present. Keys live in the env
file, never hardcoded in source.
21 changes: 21 additions & 0 deletions context/agents/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
type: install
flow: posthog-integration
label: Add the PostHog SDK to the manifest
model: claude-haiku-4-5-20251001
skills: [basic-integration-install]
allowedTools: [Read, Edit, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: []
---

## Goal

Declare the PostHog SDK in the project's package manifest. Do not run the package
manager and do not build — the build task installs and verifies everything at the
end.

## How you know you succeeded

The SDK is listed in the manifest's dependencies at a sensible version. If it is
already declared, leave it and say so.
31 changes: 31 additions & 0 deletions context/agents/integrate-posthog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
type: integrate-posthog
flow: posthog-integration
seed: true
model: claude-sonnet-4-6
skills: []
allowedTools: [Read, Glob, Grep]
disallowedTools: [Write, Edit, Bash, complete_task]
dependsOn: []
---

## Goal

Plan a PostHog integration and seed the task queue with this graph:

- `install` and `init`, independent of each other.
- `identify`, `capture`, and `error-tracking`, each after `install` and `init`
and independent of one another, so they run in parallel. `capture` decides the
events and instruments them; `error-tracking` wires the single global error
boundary — it needs the SDK installed and initialized, not the events.
- `build`, after `install`, `init`, `identify`, `capture`, and `error-tracking` —
it installs the dependencies and verifies the project builds, lints, and passes
its tests.
- `dashboard`, after `build` — only once the integration is confirmed building,
linting, and testing cleanly.
- `report`, after `dashboard` — it writes the setup report last.

## How you know you succeeded

Every task in the graph is queued with that dependency shape, the report last,
and the first task runnable. Keep labels short — the action in a few words.
23 changes: 23 additions & 0 deletions context/agents/report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
type: report
flow: posthog-integration
label: Write the setup report
model: claude-sonnet-4-6
skills: [basic-integration-report]
allowedTools: [Read, Write, Glob, Grep]
disallowedTools: [enqueue_task]
dependsOn: [dashboard]
---

## Goal

Write the setup report summarizing what this integration did, drawing only on the
run's queue log and event plan in `.posthog-wizard-cache/` (`queue.json` and
`.posthog-events.json`).

## How you know you succeeded

`posthog-setup-report.md` exists at the project root: what was installed and
initialized, the events captured, whether identify was wired or skipped, error
tracking added, the dashboard link, any build conflict in full, and the next
steps for the user.
1 change: 1 addition & 0 deletions context/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ docs:
tags: [core, users, identity]
urls:
- https://posthog.com/docs/getting-started/identify-users.md
- https://posthog.com/docs/product-analytics/identity-resolution.md

- id: cloudflare-workers
display_name: Cloudflare Workers
Expand Down
9 changes: 9 additions & 0 deletions context/skills/basic-integration/build/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: docs-only
template: description.md
description: Install dependencies and verify the project builds
tags: [orchestrator, build]
variants:
- id: all
display_name: PostHog build step
tags: [orchestrator, build]
docs_urls: []
35 changes: 35 additions & 0 deletions context/skills/basic-integration/build/description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Install and build

Install the declared dependencies, then verify the project builds. Be quick and
decisive — this step must not spiral.

## Install

Detect the package manager from the project's lockfile and run its install once,
in this project directory. The manifest already declares PostHog. If install is
slow, errors, or can't resolve a package, do not retry with offline flags and do
not poke the package manager's global store or cache — a failed install is a
conflict to report (below), not a problem to fight.

## Build and verify

Run the project's build (or typecheck), lint, and test scripts if they exist
(check the manifest's scripts). Only errors in the files this integration changed
are yours to fix — a missing import, a wrong call shape.
An error in a file the integration never touched is pre-existing: note it and
move on (below). Do not re-run build, typecheck, or lint hoping a pre-existing
failure clears — it will not, and each re-run is slow.

## Flag out-of-scope conflicts and move on

Work only inside this project's own directory. Never read, search, or write
anywhere outside it — not other repos, not the OS, not the package manager's
global store or cache.

A build or install you can't cleanly finish is a perfectly acceptable outcome —
**as long as you report it.** If you hit a conflict that is excessively difficult
or outside the scope of this integration — a dependency clash, a pre-existing
build break, an install that won't resolve, an environment issue unrelated to the
PostHog code — stop fighting it: put a one-line summary in your handoff `conflict`
field and the full detail in `did`, then complete the task. The user sees it in
the outro and the report; reporting it and moving on is the right outcome.
Loading
Loading