typefully-eve-template
AGENTS.md8 starsChanged 21 days agoMITView on GitHub
Guidance for AI coding agents working in this repository. A Slack-based social media agent built on the eve agent framework. Users @mention it in Slack; it drafts, schedules, and manages social posts across X, LinkedIn, Threads, Bluesky, and Mastodon through the Typefully MCP connection (static API key via TYPEFULLY_API_KEY), pulls briefs and source material from Notion (user-scoped OAuth via Vercel Connect), and stores files in Vercel Blob. Its workflow lives in agent/instructions.md. The whole agent is defined under agent/. eve…
- Reads credentials
- Installs packages
- Sends data out
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,700 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository8 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- bluesky-styleSkill
- linkedin-styleSkill
- mastodon-styleSkill
- threads-styleSkill
- writing-qualitySkill
- x-styleSkill
- writing-qualitySkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
After editing, check LSP diagnostics / pnpm typecheck and fix type errors before moving on.
- Very specific: line 43
Document exported config with TSDoc (@remarks, @param, @returns, @defaultValue, @see).
- Very specific: line 51
If you ever build a RegExp from data, escape it (literal match) and bound the input length.
- Very specific: line 59
No secrets, node_modules, or build output (.eve, .vercel, .output) staged.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Guidance for AI coding agents working in this repository.
Project overview
A Slack-based social media agent built on the eve agent framework. Users @mention it in Slack; it drafts, schedules, and manages social posts across X, LinkedIn, Threads, Bluesky, and Mastodon through the Typefully MCP connection (static API key via TYPEFULLY_API_KEY), pulls briefs and source material from Notion (user-scoped OAuth via Vercel Connect), and stores files in Vercel Blob. Its workflow lives in agent/instructions.md.
The whole agent is defined under agent/. eve discovers capabilities from the filesystem. See ARCHITECTURE.md for the component map, data flow, and boundaries.
Setup & commands
pnpm install # install dependencies (Node 24.x)
pnpm dev # eve dev — local TUI; run /model once to link a model provider
pnpm typecheck # tsc (TypeScript, no emit)
pnpm check # ultracite (Biome) lint + format check
pnpm fix # ultracite (Biome) auto-fix
pnpm build # eve build
eve deploy # deploy to Vercel production (use this, not raw `vercel deploy`)
npx eve info # print the discovered surface + discovery diagnostics
pnpm validate # check + typecheck + eve info in one commandThere is no unit-test suite. Verify changes with pnpm validate (lint, typecheck, and discovery diagnostics must all report 0 errors / 0 warnings), then exercise the agent in the pnpm dev TUI.
eve conventions
- Read the relevant guide in
node_modules/eve/docs/before writing code. Don't invent framework APIs; confirm them against the docs. - Identity comes from the filesystem, never a
namefield. A tool atagent/tools/upload_asset.tsis the toolupload_asset; a connection atagent/connections/typefully.tsregisters astypefully. - Authored slots:
agent/agent.ts(model),agent/instructions.md(system prompt),agent/tools/*.ts(defineTool, ordefineWorkflowToolfor durable tools such asresearcher.tsandreviewer.ts),agent/connections/*.ts,agent/channels/*.ts,agent/schedules/*.ts(defineSchedule, root-only cron tasks),agent/skills/<name>/SKILL.md,agent/subagents/<id>/agent.ts(defineAgent),agent/sandbox.ts(export theenvironmentand default-exportdefineSandbox(() => environment.open())). This repo also hasagent/subagents/<id>/skills/andagent/subagents/draft-reviewer/sandbox.ts: subagent sandboxes don't inherit from the root, and the reviewer needs one to read its skill's reference files. - Tools run in the app runtime (full
process.env), one default export per file. Gate destructive tools withapprovalfromeve/tools/approval. Connections accept the sameapprovalfield: bothtypefully.tsandnotion.tspass a policy that substring-matches the qualified tool name. Typefully always gates the delete tools (typefully_delete_draft,typefully_delete_comment,typefully_delete_thread) and gatestypefully_create_draft/typefully_edit_draftonly whenrequestBody.publish_atis set (scheduling or publishing), so plain drafting stays friction-free; Notion gatesupdate-pages,move-pages,update-data-source, andupdate-viewagainst anAPPROVAL_REQUIRED_TOOLSlist (creation is ungated). - Schedules are root-only cron tasks under
agent/schedules/*.ts(defineSchedule, onecronplusmarkdownorrun); each becomes a Vercel Cron Job evaluated in UTC. Here:weekly-analytics(Mondays 14:00 UTC; a markdown schedule cannot ask for approval, so its tools must stay ungated) prompts the agent to pull Typefully analytics and callpost_analytics_report, which posts a posts table and a followers table as Slackdata_tableblocks (falling back to fixed-width text if the blocks are rejected) to the channel inTYPEFULLY_ANALYTICS_CHANNELviacallSlackApi. That tool's destination is env-fixed, never model input, so it can only ever post to the one analytics channel.eve devdoes not fire schedules on their cadence; dispatch one withcurl -X POST http://localhost:3000/eve/v1/dev/schedules/<name>. - Skills are load-on-demand. A packaged skill (
<name>/SKILL.md) requiresdescriptionfrontmatter; that description is the routing hint. Skills here:writing-quality(generic prose quality plus the AI-phrases and plain-English reference lists) and five platform style skills (x-style,linkedin-style,threads-style,bluesky-style,mastodon-style), each carrying that platform's conventions plus areferences/banned-words.json. The model reads those files from the sandbox; thelint_against_styletool imports them throughagent/lib/banned-words.ts, because tool code has no skill file API (ctx.getSkill()was removed in eve 0.66). - Subagents are declared under
agent/subagents/<id>/agent.ts(defineAgent, requireddescription— the routing hint). The directory name is the identity and the lowered tool name (no namespace). It must not collide with a tool name, even when the subagent setstool: false. A declared subagent runs in a fresh child session and inherits nothing from the root (no skills, connections, tools, or sandbox), so the caller passes everything it needs in themessage.defineAgentno longer acceptsoutputSchema; request structured output per turn from a workflow tool withctx.agent(name).send(message, { outputSchema }). Here:web-researcheranddraft-reviewer, bothtool: falseand reached through theresearcherandreviewerworkflow tools, which request their structured results. The draft reviewer carries its own copy of thewriting-qualityskill underagent/subagents/draft-reviewer/skills/plus its ownsandbox.ts. The two copies are byte-identical, duplicated by hand; when editing either, mirror the change so they stay identical. - After editing, check LSP diagnostics /
pnpm typecheckand fix type errors before moving on.
Code style
- Linting and formatting are handled by Ultracite (a Biome preset). Run
pnpm checkbefore finishing andpnpm fixto auto-fix. Config is inbiome.jsonc; the kebab-case filename rule is disabled there because eve tools use snake_case names. Keep@biomejs/biomeon the version line Ultracite's preset supports (currently 2.5.x): Biome 2.6 renamed a nursery rule the preset still enables, and the config fails to load. - TypeScript strict; ESM with
bundlermodule resolution (file extensions are optional in imports). Preferconst, arrow functions, optional chaining / nullish coalescing. - Validate tool input/output with
zodschemas. - Document exported config with TSDoc (
@remarks,@param,@returns,@defaultValue,@see). Avoid inline//comments — put rationale in the TSDoc block instead. - Prose in markdown files is not hard-wrapped: write each paragraph or bullet as one line.
- Agent-facing text (instructions, skill bodies, tool and subagent descriptions) follows the "How you write" rules in
agent/instructions.md: no em dashes, no machine-made words, no bold for emphasis. It carries behavior only, never framework plumbing (sign-in flows, how approvals render) or references to tools and skills the reading agent can't access.
Security
- Never ask the user for API keys, client secrets, or any other credentials.
- Never commit secrets.
.env*is gitignored. Connector UIDs are read from env (SLACK_CONNECTOR,NOTION_CONNECTOR); Typefully auth is a static API key read from theTYPEFULLY_API_KEYenv var viagetToken, Notion auth is per-user OAuth via Vercel Connect, and Blob auth is via the project's OIDC token. The weekly digest reads its destination channel id fromTYPEFULLY_ANALYTICS_CHANNEL(config, not a secret). The Typefully key is the only credential to manage; it belongs in env vars, never in source files. - If you ever build a
RegExpfrom data, escape it (literal match) and bound the input length. - Gate irreversible or high-impact actions behind
approval: destructive tools (delete_asset,clear_user_preferences) and connection writes (thetypefullyandnotionconnections gate the tools listed above). - For per-user storage, derive the key from the resolved principal (
ctx.session.auth.current), never from model input — seeagent/lib/user-preferences.ts. The preference files live under the reserveduser-preferences/Blob prefix, which the general asset tools refuse so they can't read or overwrite another user's file. download_assetonly fetches URLs on*.blob.vercel-storage.com.
Before committing
pnpm validatepasses (Ultracite check,tsc, andeve infowith 0 errors / 0 warnings).- No secrets,
node_modules, or build output (.eve,.vercel,.output) staged.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

