@letta-ai/letta-code 0.7.4-next.2 → 0.7.4-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/letta.js +8 -8
- package/package.json +1 -1
- package/skills/{skill-creator → creating-skills}/SKILL.md +33 -19
- package/skills/{skill-creator → creating-skills}/scripts/validate-skill.ts +28 -9
- package/skills/{memory-init → initializing-memory}/SKILL.md +2 -2
- /package/skills/{skill-creator → creating-skills}/references/output-patterns.md +0 -0
- /package/skills/{skill-creator → creating-skills}/references/workflows.md +0 -0
- /package/skills/{skill-creator → creating-skills}/scripts/init-skill.ts +0 -0
- /package/skills/{skill-creator → creating-skills}/scripts/package-skill.ts +0 -0
package/letta.js
CHANGED
|
@@ -3233,7 +3233,7 @@ var package_default;
|
|
|
3233
3233
|
var init_package = __esm(() => {
|
|
3234
3234
|
package_default = {
|
|
3235
3235
|
name: "@letta-ai/letta-code",
|
|
3236
|
-
version: "0.7.4-next.
|
|
3236
|
+
version: "0.7.4-next.3",
|
|
3237
3237
|
description: "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
|
|
3238
3238
|
type: "module",
|
|
3239
3239
|
bin: {
|
|
@@ -5905,7 +5905,7 @@ Remember: Your memory blocks persist across sessions. What you store now will in
|
|
|
5905
5905
|
var init_remember = () => {};
|
|
5906
5906
|
|
|
5907
5907
|
// src/agent/prompts/skill_creator_mode.md
|
|
5908
|
-
var skill_creator_mode_default = '# Skill Creation Mode\n\nThe user has invoked the `/skill` command. Your task is to help them **design and create a new Skill** for this project.\n\nYou are a Letta Code agent with:\n- Access to the current conversation, project files, and memory blocks\n- Access to the `Skill` tool (for loading skills) and `AskUserQuestion` (for asking clarifying questions)\n- Access to file tools (Read, Write, Edit, ApplyPatch, etc.) via the toolset\n\nYour goal is to guide the user through a **focused, collaborative workflow** to create or update a Skill that will be reused in the future.\n\n## 1. Load the
|
|
5908
|
+
var skill_creator_mode_default = '# Skill Creation Mode\n\nThe user has invoked the `/skill` command. Your task is to help them **design and create a new Skill** for this project.\n\nYou are a Letta Code agent with:\n- Access to the current conversation, project files, and memory blocks\n- Access to the `Skill` tool (for loading skills) and `AskUserQuestion` (for asking clarifying questions)\n- Access to file tools (Read, Write, Edit, ApplyPatch, etc.) via the toolset\n\nYour goal is to guide the user through a **focused, collaborative workflow** to create or update a Skill that will be reused in the future.\n\n## 1. Load the creating-skills Skill (if available)\n\n1. Inspect your memory blocks:\n - `skills` – list of available skills and their descriptions\n - `loaded_skills` – SKILL.md contents for currently loaded skills\n2. If a `creating-skills` skill is **not already loaded** in `loaded_skills`, you should **attempt to load it** using the `Skill` tool:\n - Call the `Skill` tool with:\n - `command: "load", skills: ["creating-skills"]`\n - The environment may resolve this from either the project’s `.skills` directory or a bundled `skills/skills/creating-skills/SKILL.md` location.\n3. If loading `creating-skills` fails (for example, the tool errors or the file is missing), or if the environment does not provide it, continue using your own judgment based on these instructions.\n\nDo **not** load unrelated skills unless clearly relevant to the user’s request.\n\n## 2. Understand the requested skill\n\nThe `/skill` command may have been invoked in two ways:\n\n1. `/skill` (no description)\n2. `/skill <description>` (with a short description, e.g. `/skill image editor for marketing screenshots`)\n\nYou should always:\n\n1. Consider:\n - The current conversation and what the user has been working on\n - Relevant project context from files and memory blocks (especially `project` and `skills`)\n2. If a description was provided:\n - Treat it as the **initial specification** of the skill.\n - Restate it briefly in your own words to confirm understanding.\n\n## 3. Ask upfront clarifying questions (using AskUserQuestion)\n\nBefore you start proposing a concrete skill design, you MUST ask a small bundle of **high‑value upfront questions** using the `AskUserQuestion` tool.\n\nKeep the initial question set small (3–6 questions) and focused. Examples:\n\n1. Purpose and scope:\n - “What is the main purpose of this skill?”\n - “Is this skill meant for a specific project or to be reused across many projects?”\n2. Implementation details:\n - “Do you want this skill to be mostly guidance (instructions) or to include reusable scripts/templates?”\n - “Where should the skill live? (e.g. `.skills/your-skill-id` in this repo)”\n\nBundle these together in a single `AskUserQuestion` call. After you receive answers, you can ask follow‑up questions as needed, but avoid overwhelming the user.\n\n## 4. Propose a concrete skill design\n\nUsing:\n- The user’s description (if provided)\n- Answers to your questions\n- The current project and conversation context\n\nYou should propose a **concrete skill design**, including at minimum:\n\n- A skill ID (directory name), e.g. `image-editor`, `pdf-workflow`, `webapp-testing`\n- A concise human‑readable name\n- A one‑paragraph description focused on:\n - What the skill does\n - When it should be used\n - Who is likely to use it\n- Example triggering queries (how users will invoke it in natural language)\n- The planned structure of the skill:\n - `SKILL.md` contents (sections, key instructions)\n - Any `scripts/` you recommend (and what each script does)\n - Any `references/` files (and when to read them)\n - Any `assets/` (templates, fonts, icons, starter projects, etc.)\n\nValidate this design with the user before you start writing files. If something is ambiguous or high‑impact, ask a brief follow‑up question using `AskUserQuestion`.\n\n## 5. Create or update the skill files\n\nOnce the design is agreed upon:\n\n1. Determine the target directory for the skill (in this order):\n - First, check whether the host environment or CLI has configured a default skills directory for this agent (for example via a `--skills` flag or project settings). If such a directory is provided, use it as the base directory for the new skill unless the user explicitly requests a different path.\n - If no explicit skills directory is configured, check the `skills` memory block for a `Skills Directory: <path>` line and use that as the base directory.\n - If neither is available, default to a local `.skills/<skill-id>/` directory in the current project root (or another path the user has requested).\n2. Create or update:\n - `.skills/<skill-id>/SKILL.md` – the main entry point for the skill\n - Optional: `.skills/<skill-id>/scripts/` – reusable scripts\n - Optional: `.skills/<skill-id>/references/` – longer documentation, schemas, or examples\n - Optional: `.skills/<skill-id>/assets/` – templates, fonts, images, or other resources\n3. Use file tools (Write, Edit, ApplyPatch, etc.) to create and refine these files instead of asking the user to do it manually.\n\nWhen writing `SKILL.md`, follow the conventions used by existing skills in this repository:\n\n- YAML frontmatter at the top, including at least:\n - `name`: human‑readable name\n - `description`: when and how the skill should be used\n- Clear sections that:\n - Explain when to use the skill\n - Describe the recommended workflows\n - Link to `scripts/`, `references/`, and `assets/` as needed\n - Emphasize progressive disclosure (only load detailed references as needed)\n\nKeep `SKILL.md` focused and concise; move long reference content into separate files.\n\n## 6. Keep questions focused and iterative\n\nThroughout the process:\n\n- Prefer a small number of **high‑impact questions** over many tiny questions.\n- When you need more detail, group follow‑up questions into a single `AskUserQuestion` call.\n- Use concrete examples from the user’s project or repository when possible.\n\nYour goal is to:\n\n1. Understand the desired skill thoroughly.\n2. Propose a clear, reusable design.\n3. Implement or update the actual skill files in the repository.\n4. After creating or updating the skill files, use the `Skill` tool with `command: "refresh"` to re-scan the skills directory and update the `skills` memory block.\n5. Leave the user with a ready‑to‑use skill that appears in the `skills` memory block and can be loaded with the `Skill` tool.';
|
|
5909
5909
|
var init_skill_creator_mode = () => {};
|
|
5910
5910
|
|
|
5911
5911
|
// src/agent/prompts/skill_unload_reminder.txt
|
|
@@ -67691,7 +67691,7 @@ Press Enter to continue, or type anything to cancel.`, false, "running");
|
|
|
67691
67691
|
const cmdId2 = uid4("cmd");
|
|
67692
67692
|
const [, ...rest] = trimmed.split(/\s+/);
|
|
67693
67693
|
const description = rest.join(" ").trim();
|
|
67694
|
-
const initialOutput = description ? `Starting skill creation for: ${description}` : "Starting skill creation. I’ll load the
|
|
67694
|
+
const initialOutput = description ? `Starting skill creation for: ${description}` : "Starting skill creation. I’ll load the creating-skills skill and ask a few questions about the skill you want to build...";
|
|
67695
67695
|
buffersRef.current.byId.set(cmdId2, {
|
|
67696
67696
|
kind: "command",
|
|
67697
67697
|
id: cmdId2,
|
|
@@ -67868,10 +67868,10 @@ ${recentCommits}
|
|
|
67868
67868
|
const initMessage = `<system-reminder>
|
|
67869
67869
|
The user has requested memory initialization via /init.
|
|
67870
67870
|
|
|
67871
|
-
## 1. Load the memory
|
|
67871
|
+
## 1. Load the initializing-memory skill
|
|
67872
67872
|
|
|
67873
|
-
First, check your \`loaded_skills\` memory block. If the \`memory
|
|
67874
|
-
1. Use the \`Skill\` tool with \`command: "load", skills: ["memory
|
|
67873
|
+
First, check your \`loaded_skills\` memory block. If the \`initializing-memory\` skill is not already loaded:
|
|
67874
|
+
1. Use the \`Skill\` tool with \`command: "load", skills: ["initializing-memory"]\`
|
|
67875
67875
|
2. The skill contains comprehensive instructions for memory initialization
|
|
67876
67876
|
|
|
67877
67877
|
If the skill fails to load, proceed with your best judgment based on these guidelines:
|
|
@@ -67882,7 +67882,7 @@ If the skill fails to load, proceed with your best judgment based on these guide
|
|
|
67882
67882
|
|
|
67883
67883
|
## 2. Follow the loaded skill instructions
|
|
67884
67884
|
|
|
67885
|
-
Once loaded, follow the instructions in the \`memory
|
|
67885
|
+
Once loaded, follow the instructions in the \`initializing-memory\` skill to complete the initialization.
|
|
67886
67886
|
${gitContext}
|
|
67887
67887
|
</system-reminder>`;
|
|
67888
67888
|
await processConversation([
|
|
@@ -71599,4 +71599,4 @@ Error during initialization: ${message}`);
|
|
|
71599
71599
|
}
|
|
71600
71600
|
main();
|
|
71601
71601
|
|
|
71602
|
-
//# debugId=
|
|
71602
|
+
//# debugId=CAAC5BC4B213F90764756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: creating-skills
|
|
3
3
|
description: 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.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# Creating Skills
|
|
7
7
|
|
|
8
|
-
This skill provides guidance for creating effective skills in Letta Code.
|
|
8
|
+
This skill provides guidance for creating effective skills in Letta Code. For the complete official specification, see [agentskills.io](https://agentskills.io/specification).
|
|
9
9
|
|
|
10
10
|
## About Skills
|
|
11
11
|
|
|
@@ -48,10 +48,10 @@ Think of the Letta Code agent as exploring a path: a narrow bridge with cliffs n
|
|
|
48
48
|
Every skill consists of a required SKILL.md file and optional bundled resources:
|
|
49
49
|
|
|
50
50
|
```
|
|
51
|
-
|
|
51
|
+
processing-pdfs/
|
|
52
52
|
├── SKILL.md (required)
|
|
53
53
|
│ ├── YAML frontmatter metadata (required)
|
|
54
|
-
│ │ ├── name: (required)
|
|
54
|
+
│ │ ├── name: (required, must match directory name)
|
|
55
55
|
│ │ └── description: (required)
|
|
56
56
|
│ └── Markdown instructions (required)
|
|
57
57
|
└── Bundled Resources (optional)
|
|
@@ -148,9 +148,9 @@ The Letta Code agent loads FORMS.md, REFERENCE.md, or EXAMPLES.md only when need
|
|
|
148
148
|
For Skills with multiple domains, organize content by domain to avoid loading irrelevant context:
|
|
149
149
|
|
|
150
150
|
```
|
|
151
|
-
bigquery
|
|
151
|
+
querying-bigquery/
|
|
152
152
|
├── SKILL.md (overview and navigation)
|
|
153
|
-
└──
|
|
153
|
+
└── references/
|
|
154
154
|
├── finance.md (revenue, billing metrics)
|
|
155
155
|
├── sales.md (opportunities, pipeline)
|
|
156
156
|
├── product.md (API usage, features)
|
|
@@ -162,7 +162,7 @@ When a user asks about sales metrics, the Letta Code agent only reads sales.md.
|
|
|
162
162
|
Similarly, for skills supporting multiple frameworks or variants, organize by variant:
|
|
163
163
|
|
|
164
164
|
```
|
|
165
|
-
cloud
|
|
165
|
+
deploying-to-cloud/
|
|
166
166
|
├── SKILL.md (workflow + provider selection)
|
|
167
167
|
└── references/
|
|
168
168
|
├── aws.md (AWS deployment patterns)
|
|
@@ -217,9 +217,9 @@ Skip this step only when the skill's usage patterns are already clearly understo
|
|
|
217
217
|
|
|
218
218
|
To create an effective skill, clearly understand concrete examples of how the skill will be used. This understanding can come from either direct user examples or generated examples that are validated with user feedback.
|
|
219
219
|
|
|
220
|
-
For example, when building an
|
|
220
|
+
For example, when building an `editing-images` skill, relevant questions include:
|
|
221
221
|
|
|
222
|
-
- "What functionality should the
|
|
222
|
+
- "What functionality should the editing-images skill support? Editing, rotating, anything else?"
|
|
223
223
|
- "Can you give some examples of how this skill would be used?"
|
|
224
224
|
- "I can imagine users asking for things like 'Remove the red-eye from this image' or 'Rotate this image'. Are there other ways you imagine this skill being used?"
|
|
225
225
|
- "What would a user say that should trigger this skill?"
|
|
@@ -235,17 +235,17 @@ To turn concrete examples into an effective skill, analyze each example by:
|
|
|
235
235
|
1. Considering how to execute on the example from scratch
|
|
236
236
|
2. Identifying what scripts, references, and assets would be helpful when executing these workflows repeatedly
|
|
237
237
|
|
|
238
|
-
Example: When building
|
|
238
|
+
Example: When building an `editing-pdfs` skill to handle queries like "Help me rotate this PDF," the analysis shows:
|
|
239
239
|
|
|
240
240
|
1. Rotating a PDF requires re-writing the same code each time
|
|
241
241
|
2. A `scripts/rotate-pdf.ts` script would be helpful to store in the skill
|
|
242
242
|
|
|
243
|
-
Example: When designing a `frontend-
|
|
243
|
+
Example: When designing a `building-frontend-apps` skill for queries like "Build me a todo app" or "Build me a dashboard to track my steps," the analysis shows:
|
|
244
244
|
|
|
245
245
|
1. Writing a frontend webapp requires the same boilerplate HTML/React each time
|
|
246
246
|
2. An `assets/hello-world/` template containing the boilerplate HTML/React project files would be helpful to store in the skill
|
|
247
247
|
|
|
248
|
-
Example: When building a `
|
|
248
|
+
Example: When building a `querying-bigquery` skill to handle queries like "How many users have logged in today?" the analysis shows:
|
|
249
249
|
|
|
250
250
|
1. Querying BigQuery requires re-discovering the table schemas and relationships each time
|
|
251
251
|
2. A `references/schema.md` file documenting the table schemas would be helpful to store in the skill
|
|
@@ -304,13 +304,27 @@ Any example files and directories not needed for the skill should be deleted. Th
|
|
|
304
304
|
|
|
305
305
|
Write the YAML frontmatter with `name` and `description`:
|
|
306
306
|
|
|
307
|
-
|
|
308
|
-
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
**`name`** (required):
|
|
308
|
+
- Use gerund form: `processing-pdfs`, `analyzing-data`, `creating-reports` (not `pdf-processor`)
|
|
309
|
+
- Lowercase letters, numbers, and hyphens only
|
|
310
|
+
- Must match the directory name exactly
|
|
311
|
+
- Max 64 characters
|
|
312
|
+
|
|
313
|
+
**`description`** (required):
|
|
314
|
+
- Write in third person: "Processes PDF files..." (not "I help process..." or "You can use this to...")
|
|
315
|
+
- Include both what the skill does AND when to use it
|
|
316
|
+
- Include trigger keywords that help the agent identify relevant tasks
|
|
317
|
+
- Max 1024 characters
|
|
318
|
+
|
|
319
|
+
Example:
|
|
320
|
+
```yaml
|
|
321
|
+
---
|
|
322
|
+
name: processing-pdfs
|
|
323
|
+
description: Extracts text and tables from PDF files, fills forms, and merges documents. Use when working with PDF files or when the user mentions PDFs, forms, or document extraction.
|
|
324
|
+
---
|
|
325
|
+
```
|
|
312
326
|
|
|
313
|
-
|
|
327
|
+
**Note:** The spec allows optional fields (`license`, `compatibility`, `metadata`, `allowed-tools`) but most skills don't need them. See [agentskills.io/specification](https://agentskills.io/specification) for details.
|
|
314
328
|
|
|
315
329
|
##### Body
|
|
316
330
|
|
|
@@ -10,20 +10,22 @@
|
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
import { existsSync, readFileSync } from "node:fs";
|
|
13
|
-
import { join } from "node:path";
|
|
13
|
+
import { basename, join } from "node:path";
|
|
14
14
|
import { parse as parseYaml } from "yaml";
|
|
15
15
|
|
|
16
16
|
interface ValidationResult {
|
|
17
17
|
valid: boolean;
|
|
18
18
|
message: string;
|
|
19
|
+
warnings?: string[];
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
const ALLOWED_PROPERTIES = new Set([
|
|
22
23
|
"name",
|
|
23
24
|
"description",
|
|
24
25
|
"license",
|
|
25
|
-
"
|
|
26
|
+
"compatibility",
|
|
26
27
|
"metadata",
|
|
28
|
+
"allowed-tools",
|
|
27
29
|
]);
|
|
28
30
|
|
|
29
31
|
export function validateSkill(skillPath: string): ValidationResult {
|
|
@@ -63,15 +65,15 @@ export function validateSkill(skillPath: string): ValidationResult {
|
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
|
|
66
|
-
// Check for unexpected properties
|
|
68
|
+
// Check for unexpected properties (warn but don't fail for forward-compatibility)
|
|
69
|
+
const warnings: string[] = [];
|
|
67
70
|
const unexpectedKeys = Object.keys(frontmatter).filter(
|
|
68
71
|
(key) => !ALLOWED_PROPERTIES.has(key),
|
|
69
72
|
);
|
|
70
73
|
if (unexpectedKeys.length > 0) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
74
|
+
warnings.push(
|
|
75
|
+
`Unknown frontmatter key(s): ${unexpectedKeys.sort().join(", ")}. Known properties are: ${[...ALLOWED_PROPERTIES].sort().join(", ")}`,
|
|
76
|
+
);
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
// Check required fields
|
|
@@ -116,6 +118,14 @@ export function validateSkill(skillPath: string): ValidationResult {
|
|
|
116
118
|
message: `Name is too long (${trimmedName.length} characters). Maximum is 64 characters.`,
|
|
117
119
|
};
|
|
118
120
|
}
|
|
121
|
+
|
|
122
|
+
// Check name matches directory name (warn if not)
|
|
123
|
+
const dirName = basename(skillPath);
|
|
124
|
+
if (trimmedName !== dirName) {
|
|
125
|
+
warnings.push(
|
|
126
|
+
`Name '${trimmedName}' doesn't match directory name '${dirName}'. For portability, these should match.`,
|
|
127
|
+
);
|
|
128
|
+
}
|
|
119
129
|
}
|
|
120
130
|
|
|
121
131
|
// Validate description
|
|
@@ -144,7 +154,11 @@ export function validateSkill(skillPath: string): ValidationResult {
|
|
|
144
154
|
}
|
|
145
155
|
}
|
|
146
156
|
|
|
147
|
-
return {
|
|
157
|
+
return {
|
|
158
|
+
valid: true,
|
|
159
|
+
message: "Skill is valid!",
|
|
160
|
+
warnings: warnings.length > 0 ? warnings : undefined,
|
|
161
|
+
};
|
|
148
162
|
}
|
|
149
163
|
|
|
150
164
|
// CLI entry point
|
|
@@ -155,7 +169,12 @@ if (require.main === module) {
|
|
|
155
169
|
process.exit(1);
|
|
156
170
|
}
|
|
157
171
|
|
|
158
|
-
const { valid, message } = validateSkill(args[0] as string);
|
|
172
|
+
const { valid, message, warnings } = validateSkill(args[0] as string);
|
|
159
173
|
console.log(message);
|
|
174
|
+
if (warnings && warnings.length > 0) {
|
|
175
|
+
for (const warning of warnings) {
|
|
176
|
+
console.warn(`Warning: ${warning}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
160
179
|
process.exit(valid ? 0 : 1);
|
|
161
180
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
2
|
+
name: initializing-memory
|
|
3
3
|
description: Comprehensive guide for initializing or reorganizing agent memory. Load this skill when running /init, when the user asks you to set up your memory, or when you need guidance on creating effective memory blocks.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# Memory
|
|
6
|
+
# Initializing Memory
|
|
7
7
|
|
|
8
8
|
The user has requested that you initialize or reorganize your memory state. You have access to the `memory` tool which allows you to create, edit, and manage memory blocks.
|
|
9
9
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|