Repository navigation
Skill: pass the template source on MCP uploads #511
Copy link
Copy link
Closed
Labels
Description
Map: Map: send code-managed email templates with one PostHog call
Spec: Spec: copy-as-code and open-a-PR for code-managed templates (revision 2), section "The skill's MCP upload"
Cast: Opus 5.5, high
Repository: PostHog/context-mill (a commit on the branch of PostHog/context-mill#433)
Question
Does an agent following the send-transactional-email skill record where a template's file lives when it uploads through MCP?
Delivers end to end.
- Upload step. The skill's upload step tells the agent to pass
sourceon every MCP upload:repositoryfromgit remote get-url origin, normalized tohost/owner/namewithout credentials;pathrelative to the repository root;reffromgit rev-parse HEAD.
- SDK note. The skill says posthog-node fills these on its own when the app sends with
templateFile()(posthog-node: fill the template source repository, path and ref on upload #510). - Changing a template. The skill says to change a code-managed template by editing its file in the repository, never through PostHog's template update tools and never through
workflows-request-email-template-change, which is for agents without repository access. A person may also start a change from the template page with "Edit with your agent"; the prompt names the file and the key. - Evals. If the skill has evals, its upload eval checks that
sourceis passed.
Test seams. The skill's existing eval or trigger checks in context-mill. No new harness.
Write scope. The send-transactional-email skill files on #433's branch.
Proof.
- Local: an agent session following the skill uploads a template from a git checkout through the local MCP. The template API then shows all three source fields. Paste the transcript excerpt and the API response in the PR.
Acceptance criteria
- An agent following the skill uploads with repository, path and ref.
- The skill's wording matches posthog-node: fill the template source repository, path and ref on upload #510's released behavior.
- The skill sends a template change to the file, not to PostHog.
Blockers
Blocked by #510 (the SDK behavior the skill describes).
How to build (map #461)
/writing-skillsrules for the skill text.- Public repo: no usage numbers, customer names, internal metrics or Slack content. Examples use
example.comandgithub.com/example/app. - Shipped means a pushed commit on feat(loops): offer a ci failed trigger in desktop's loop form #433's branch handed off for review. Never merge.
Reactions are currently unavailable
Activity
Silthus commentedon Oct 17, 2026
Runtime: T3 child task
Task:
node:delegated-task:command%3Amcp%3A1778d880-5a25-404c-80d0-25fc5ccca3b2%3Adelegate-task%3Awf-email-impl-511-1Cast: Opus 5.5, high. Cap 150 minutes.
Silthus commentedon Oct 17, 2026
Resolution
Shipped: four commits on
Silthus:feat/send-transactional-email-skill, the branch of draft PostHog/context-mill#433. The PR stays a draft. Head8b236c30c6774e3b77163ff626f3c242c041902c.fleet proof gatepasses (HEAD reviewed in final read 6).5127da7feat(skills): record a template's file on upload and change it in the file99eaa9afix(skills): cover undo, early publish and no-repository changesc128595fix(skills): scope undo to templateFile and order the by-key upload8b236c3fix(skills): name a published revert in STEP 8 and split the fallbackWhat shipped
One file changed:
context/skills/omnibus/send-transactional-email/description.md.sourceon every MCP upload:repository: thegit remote get-url originURL ashost/owner/name, without the scheme, user name, token or.gitending. There is an SSH example and an HTTPS-with-token example.path: from the repository root (git rev-parse --show-toplevel), with a monorepo example.ref:git rev-parse HEAD.templateFile(), from CI and hosting variables or the git checkout. It always sends apath, which falls back to the app's working directory. Arepositoryorrefit can't find keeps the stored value. I checked this against_write_sourceintemplate_uploads.py.403 immutable), and leave the template managed by code.templateFile(), the first send from the changed code uploads it, and a local run publishes it too.workflows-request-email-template-change, call it and share the task link. An agent that can edit the file never calls it. This is true before and after Request a change: start a PostHog Code task that opens a PR for a code-managed template #513.immutableline now point at the new section.Proof
pnpm testpassed 220 tests andpnpm buildpassed at8b236c3, both throughfleet heavy. The bundle test is unchanged. I added no test of the wording.SkillCatalogover the overlaid catalog gives rank 1 for all five trigger prompts at8b236c3. The output is byte-identical to Agent skill: verify a sender, upload the template from the repo, send by key #476's. The description is unchanged.spec/code-managed-templates07d7e0ee544with the flag forced on. Each run had its own project with a verified sender. The scratch repo was a monorepo with the app inapps/web, andoriginwashttps://x-access-token:ghp_…@github.com/example/acme.gitwith a fake token. Red runs used the skill at965a656.965a656)github.com/example/acme,apps/web/emails/welcome.html, HEADapps/webTemplate API read-back after the green run at
c128595(personal API key):~/.local/state/fleet/proof/PostHog/context-mill/433/c128595…/live-run/.Review
Opus 5.5 at high effort, each round in a fresh subagent, recorded with
fleet proof review-startandreview-finish.5127da7), FAIL: 4 medium and 4 low findings.99eaa9a:templateFile();path;refmay name a commit without the file. The spec definesrefas HEAD, and the next SDK or deploy upload corrects it.c128595.8b236c3, and one follow-up for Edit with your agent: copy a prompt for a code-managed template's file #503 (see below).Calls made
designing-email-templates), and the ranking stays as Agent skill: verify a sender, upload the template from the repo, send by key #476 measured it.templateFile()change itself? Only when the person asks for it before the deploy, with a warning that every running copy sends it.if_not_superseded.spec/code-managed-templatesand a database cloned from a migrated scratch database. Nothing sends, so there was no CDP worker.c86c7a6, which still answers 404 on posthog.com.Follow-ups
c86c7a6still sayssource.pathdefaults to the working directory. It should describe posthog-node: fill the template source repository, path and ref on upload #510's detection.