Generates and reviews mod learning env JSON files for Letta Code local mods. Use when asked to teach, learn, or optimize a mod behavior; create, draft, validate, improve, or explain envs for `/mods learn --env`; or design evaluation scenarios, memory fixtures, requiredResultMarkers, requiredTraceMarkers, negative controls, and candidate diversity hints.
73
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill to create JSON envs consumed by /mods learn --env=<path> or bun scripts/mod-learning/learn-mod.ts --env <path>. An env describes the mod behavior to learn and the scenario-suite eval used to score candidates.
docs/examples/mods/learning/<slug>.env.jsonassets/mod-learning-env.template.json if useful. No comments or trailing commas.evaluation.scenarios with at least:
bun src/skills/builtin/generating-mod-envs/scripts/validate-mod-env.ts path/to/env.jsonIf this skill is installed outside the source tree, run the same script from this skill directory: scripts/validate-mod-env.ts.
/mods learn --env=path/to/env.json --model=auto --backend=api --out=/tmp/<slug>-learnThe raw scripts/mod-learning/learn-mod.ts dev script detaches by default. Add --foreground only when a blocking pass/fail exit code is needed.
Use single-line --flag=value commands for TUI instructions.
Required top-level fields:
name: human display name.slug: stable kebab-case run/candidate slug.objective: one-paragraph target for the generation agent.requirements: concrete pass/fail behavior constraints.evaluation: either a single prompt eval or a scenario suite.Common optional fields:
targetModName: display metadata for the intended mod filename. The harness still chooses the candidate filename from slug unless --candidate-file-name is passed.candidateDiversityHints: strategies assigned across multi-candidate runs.modApiHints: concise API reminders that prevent bad generated code.examples: small input/expected demos for the generation prompt.Evaluation fields:
evaluation.outputFormat: use stream-json when checking trace markers.evaluation.timeoutMs, evaluation.maxTurns: per-scenario defaults.evaluation.memoryFiles: files seeded under eval $MEMORY_DIR.evaluation.scenarios[]: scenario-specific overrides and fixtures.evaluation.prompt unless that prompt must run for every scenario. Assertion-only scenarios should have assertions and no prompt; only scenarios that require model behavior should define scenario.prompt.requiredResultMarkers: literal strings required in the final answer.requiredTraceMarkers: literal strings required in raw stdout/stderr.forbiddenResultMarkers: final-answer strings that fail the run.forbiddenTraceMarkers: raw trace strings that fail the run.MY-MOD-CANARY-OK, not common phrases.memoryFiles rather than depending on real user memory or repo files.forbiddenTraceMarkers, usually:
[mods] failed to load[extensions] failed to loadloaded 0 mod(s)loaded 0 extension(s)requiresApproval: false, parallelSafe: true, and a strict no-argument schema when applicable."message_type":"tool_return_message".modApiHints only when needed.{
"name": "Hello tool mod learner demo",
"slug": "hello-tool",
"objective": "Learn a trusted local mod that registers a read-only hello_mod_ping tool returning a fixed sentinel.",
"requirements": [
"Register a tool named hello_mod_ping.",
"The tool must accept no parameters, require no approval, be parallelSafe, and return the exact string HELLO-MOD-OK."
],
"candidateDiversityHints": [
"Use the smallest possible tool-only implementation.",
"Add explicit defensive checks around the tool schema."
],
"modApiHints": [
"Use export function activate(letta) or a default export.",
"Use letta.tools.register({ name, description, parameters, requiresApproval, parallelSafe, run }).",
"A no-argument tool schema is { \"type\": \"object\", \"properties\": {}, \"additionalProperties\": false }."
],
"evaluation": {
"outputFormat": "stream-json",
"timeoutMs": 900000,
"maxTurns": 6,
"forbiddenTraceMarkers": ["[mods] failed to load", "loaded 0 mod(s)"],
"scenarios": [
{
"name": "happy-path",
"prompt": "Call the hello_mod_ping tool, then answer with the exact text HELLO-MOD-OK.",
"requiredResultMarkers": ["HELLO-MOD-OK"],
"requiredTraceMarkers": ["hello_mod_ping", "\"message_type\":\"tool_return_message\""]
},
{
"name": "negative-control",
"prompt": "Answer without calling tools: what is 2 + 2?",
"requiredResultMarkers": ["4"],
"forbiddenTraceMarkers": ["hello_mod_ping"]
}
]
}
}051b47f
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.