TypeAgent / taskflow
CLAUDE.md745 starsChanged 5 months agoMITView on GitHub
TaskFlow runs user-taught multi-step macros over existing TypeAgent actions. Flows are pure JSON — no TypeScript logic. A deterministic compile script handles all boilerplate generation (TypeScript type, grammar rule, manifest entry). When asked to "compile pending recipes" or similar: That's it. scripts/compileRecipes.mjs reads pending/*.recipe.json and: If the build fails, fix the error in the generated files and re-run pnpm run build. When asked to write a recipe for a new flow (or if you notice a missing flow): Do NOT…
In this repository11 other files it gives its agents.
- ts/packages/agents/onboarding/AGENTS.mdAGENTS.md
- ts/packages/typeagent-core/AGENTS.mdAGENTS.md
- ts/packages/typeagent-studio/AGENTS.mdAGENTS.md
- ts/CLAUDE.mdCLAUDE.md
- ts/examples/planValidationDemo/CLAUDE.mdCLAUDE.md
- ts/packages/agents/powershell/CLAUDE.mdCLAUDE.md
- dotnet/autoShell/.github/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- typeagent-memorySkill
- typeagent-macrosSkill
- typeagent-setupSkill
The file
We split this CLAUDE.md into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 11
When asked to "compile pending recipes" or similar:
- Very specific: line 26
If the build fails, fix the error in the generated files and re-run pnpm run build.
- Distinctive: line 32
When asked to write a recipe for a new flow (or if you notice a missing flow):
- Very specific: line 34
Use discover_actions to confirm exact schemaName + actionName + parameter types
- Very specific: line 36
Write pending/ACTION_NAME.recipe.json using the format below
- Very specific: line 39
Do NOT write TypeScript files.
- Very specific: line 84
All return Promise<ActionStepResult> with { text, data, error?
- Very specific: line 97
Use discover_actions schemaName to see exact parameter types.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.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
TaskFlow Agent — Claude Code Instructions
TaskFlow runs user-taught multi-step macros over existing TypeAgent actions. Flows are pure JSON — no TypeScript logic. A deterministic compile script handles all boilerplate generation (TypeScript type, grammar rule, manifest entry).
Compiling Pending Recipes
When asked to "compile pending recipes" or similar:
pnpm run compileThat's it. scripts/compileRecipes.mjs reads pending/*.recipe.json and:
- Writes
flows/ACTION_NAME.flow.json - Appends TypeScript type to
src/schema/userActions.mts - Appends grammar rule to
src/taskflowSchema.agr - Updates
manifest.jsonflows entry - Runs
pnpm run asc && pnpm run agc && npx tsc -b - Moves processed recipes to
pending/processed/
If the build fails, fix the error in the generated files and re-run pnpm run build.
Writing a Recipe
When asked to write a recipe for a new flow (or if you notice a missing flow):
- Use
discover_actionsto confirm exact schemaName + actionName + parameter types - Devise the step sequence — keep it linear; each step's output feeds the next
- Write
pending/ACTION_NAME.recipe.jsonusing the format below - Tell the user: "Recipe written — run
pnpm run compilefrompackages/agents/taskflow"
Do NOT write TypeScript files. Do NOT edit userActions.mts, taskflowSchema.agr,
manifest.json, or actionHandler.mts by hand — the compile script does all of that.
Recipe Format
Scripts must be written in TypeScript. The sandbox provides these types globally — do NOT add import statements.
{
"name": "camelCaseActionName",
"description": "what this flow does",
"parameters": [
{
"name": "paramName",
"type": "string | number | boolean",
"required": true,
"description": "shown in grammar and type"
},
{
"name": "optionalParam",
"type": "string",
"required": false,
"default": "default value",
"description": "..."
}
],
"script": "async function execute(api: TaskFlowScriptAPI, params: FlowParams): Promise<TaskFlowScriptResult> {\n const result = await api.webSearch(params.paramName);\n return { success: true, message: result.text };\n}",
"grammarPatterns": [
"3-5 natural ways to invoke this, with $(param:wildcard) or $(param:number) captures"
]
}Script API
The api parameter implements TaskFlowScriptAPI:
api.callAction(schemaName, actionName, params)— call any TypeAgent agent actionapi.queryLLM(prompt, { input?, parseJson?, model? })— LLM transformapi.webSearch(query)— web searchapi.webFetch(url)— fetch a URL
All return Promise<ActionStepResult> with { text, data, error? }.
Grammar pattern syntax
- Captures:
$(varName:wildcard)or$(varName:number) - Optional tokens:
(word)? - Alternatives within a pattern:
(this | that) - Bare words only — no quotes around words
Available Actions for Flows
Use discover_actions schemaName to see exact parameter types. Key schemas:
utility — webSearch(query), webFetch(url), readFile(path), writeFile(path, content),
llmTransform(input, prompt, parseJson?, model?), claudeTask(goal, parseJson?, model?, maxTurns?)
email — findEmail(messageRef), sendEmail(subject, body?, to[], genContent),
replyEmail(...), forwardEmail(...)
player — music/Spotify actions (see discover_actions)
Note: sendEmail with to: ["me"] automatically resolves to the user's own email address.
genContent: { generateBody: false } tells the handler to use the provided body as-is.
LLM Model Selection for llmTransform / claudeTask
| Task | Model |
| Simple extraction, formatting, summarisation | claude-haiku-4-5-20251001 |
| Complex multi-step reasoning | claude-sonnet-4-6 |
Default to Haiku.
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.

