/generating-mod-envs
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,
$ npx -y skills add letta-ai/letta-code --skill generating-mod-envs --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/generating-mod-envs
Context preview
The summary Claude sees to decide when to auto-load this skill.
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,
SKILL.md
generating-mod-envs.SKILL.mdname: generating-mod-envs
description: 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.
disable-model-invocation: true
user-invocable: true
Generating mod learning envs
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.
Workflow
1. Define the behavior and eval before writing JSON.
- What should the mod do? Tool, turn event, tool event, provider, command, status, etc.
- What would a placebo/no-op mod fail?
- What unique sentinel strings make success unambiguous?
2. Choose a path:
- Repo example: `docs/examples/mods/learning/<slug>.env.json`
- Local/private: any user-requested path
3. Draft strict JSON. Start from `assets/mod-learning-env.template.json` if useful. No comments or trailing commas. 4. Prefer `evaluation.scenarios` with at least:
- happy path
- discrimination/exact-target path
- negative control
5. Validate:
bun src/skills/builtin/generating-mod-envs/scripts/validate-mod-env.ts path/to/env.json
If this skill is installed outside the source tree, run the same script from this skill directory: `scripts/validate-mod-env.ts`.
6. If asked to run it:
/mods learn --env=path/to/env.json --model=auto --backend=api --out=/tmp/<slug>-learn
The 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.
Env shape
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.
- In scenario-suite envs, do not add a top-level `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.
Quality rules
- Design the eval first. A useful env distinguishes success from a no-op mod.
- Use unique sentinels, e.g. `MY-MOD-CANARY-OK`, not common phrases.
- Seed `memoryFiles` rather than depending on real user memory or repo files.
- Include negative controls for non-use. If behavior should be conditional, verify it stays silent when not triggered.
- Include discrimination scenarios when paths, IDs, or sources matter. Put a tempting wrong sentinel in an irrelevant fixture and forbid it in the final answer.
- Put load failures in `forbiddenTraceMarkers`, usually:
- `[mods] failed to load`
- `[extensions] failed to load`
- `loaded 0 mod(s)`
- `loaded 0 extension(s)`
- For eval-facing tools, require `requiresApproval: false`, `parallelSafe: true`, and a strict no-argument schema when applicable.
- Avoid over-brittle trace markers. Prefer stable substrings like the tool name plus `"message_type":"tool_return_message"`.
- Keep requirements behavioral; put fragile implementation details in `modApiHints` only when needed.
Minimal scenario-suite example
{
"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: whatRead more
name: generating-mod-envs description: 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. disable-model-invocation: true user-invocable: true
Generating mod learning envs
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.
Workflow
1. Define the behavior and eval before writing JSON.
- What should the mod do? Tool, turn event, tool event, provider, command, status, etc.
- What would a placebo/no-op mod fail?
- What unique sentinel strings make success unambiguous?
2. Choose a path:
- Repo example: `docs/examples/mods/learning/<slug>.env.json`
- Local/private: any user-requested path
3. Draft strict JSON. Start from `assets/mod-learning-env.template.json` if useful. No comments or trailing commas. 4. Prefer `evaluation.scenarios` with at least:
- happy path
- discrimination/exact-target path
- negative control
5. Validate:
bun src/skills/builtin/generating-mod-envs/scripts/validate-mod-env.ts path/to/env.json
If this skill is installed outside the source tree, run the same script from this skill directory: `scripts/validate-mod-env.ts`.
6. If asked to run it:
/mods learn --env=path/to/env.json --model=auto --backend=api --out=/tmp/<slug>-learn
The 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.
Env shape
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.
- In scenario-suite envs, do not add a top-level `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.
Quality rules
- Design the eval first. A useful env distinguishes success from a no-op mod.
- Use unique sentinels, e.g. `MY-MOD-CANARY-OK`, not common phrases.
- Seed `memoryFiles` rather than depending on real user memory or repo files.
- Include negative controls for non-use. If behavior should be conditional, verify it stays silent when not triggered.
- Include discrimination scenarios when paths, IDs, or sources matter. Put a tempting wrong sentinel in an irrelevant fixture and forbid it in the final answer.
- Put load failures in `forbiddenTraceMarkers`, usually:
- `[mods] failed to load`
- `[extensions] failed to load`
- `loaded 0 mod(s)`
- `loaded 0 extension(s)`
- For eval-facing tools, require `requiresApproval: false`, `parallelSafe: true`, and a strict no-argument schema when applicable.
- Avoid over-brittle trace markers. Prefer stable substrings like the tool name plus `"message_type":"tool_return_message"`.
- Keep requirements behavioral; put fragile implementation details in `modApiHints` only when needed.
Minimal scenario-suite example
{
"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: whatLetta Code is a stateful agent harness for creating agents that are more like people than tools. Letta Code agents have memory, identity, and a sense of experience over time.
Repo: letta-ai/letta-code
Other skills on letta-code.
- /acquiring-skills
Discover and install skills from Hermes, ClawHub, GitHub, and other registries. Load this skill whenever a user asks for a capability you don't already have — image generation, social media, email, calendar, finance, DevOps, search, browser automation, etc.
Open skill - /context-doctor
Identify and repair degradation in system prompt, external memory, and skills preventing you from following instructions or remembering information as well as you should.
Open skill - /converting-mcps-to-skills
Connect to MCP (Model Context Protocol) servers and create skills for repeated use. Load when a user wants to use an MCP server, connect to external tools via MCP, or when they mention MCP, model context protocol, or specific MCP servers.
Open skill - /creating-mods
Creates and edits trusted local Letta Code mods, including tools, slash commands, local-only model providers, lifecycle/turn events, scoped conversation helpers, panels, and capability-gated behavior. Use when asked to make a mod, add an agent-callable tool, add a slash command,
Open skill - /creating-skills
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Letta Code's capabilities with specialized knowledge, workflows, or tool integrations.
Open skill - /customizing-commands
Creates, edits, and enables Letta Code mod-provided slash commands. Use when the user asks to add a custom /command, slash command, command shortcut, scoped conversation-backed command, or command-driven panel behavior.
Open skill

