@letta-ai/letta-code 0.7.4-next.1 → 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 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.1",
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: {
@@ -3244,6 +3244,7 @@ var init_package = __esm(() => {
3244
3244
  "README.md",
3245
3245
  "letta.js",
3246
3246
  "scripts",
3247
+ "skills",
3247
3248
  "vendor"
3248
3249
  ],
3249
3250
  repository: {
@@ -5904,7 +5905,7 @@ Remember: Your memory blocks persist across sessions. What you store now will in
5904
5905
  var init_remember = () => {};
5905
5906
 
5906
5907
  // src/agent/prompts/skill_creator_mode.md
5907
- 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 skill-creator 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 `skill-creator` 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: ["skill-creator"]`\n - The environment may resolve this from either the project’s `.skills` directory or a bundled `skills/skills/skill-creator/SKILL.md` location.\n3. If loading `skill-creator` 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.';
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.';
5908
5909
  var init_skill_creator_mode = () => {};
5909
5910
 
5910
5911
  // src/agent/prompts/skill_unload_reminder.txt
@@ -16592,320 +16593,6 @@ var init_context = __esm(() => {
16592
16593
  context2 = getContext2();
16593
16594
  });
16594
16595
 
16595
- // src/skills/builtin/memory-init/SKILL.md
16596
- var SKILL_default = `---
16597
- name: Memory Initialization
16598
- 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.
16599
- ---
16600
-
16601
- # Memory Initialization Guide
16602
-
16603
- 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.
16604
-
16605
- ## Understanding Your Context
16606
-
16607
- **Important**: You are a Letta Code agent, which is fundamentally different from typical AI coding assistants. Letta Code agents are **stateful** - users expect to work with the same agent over extended periods, potentially for the entire lifecycle of a project or even longer. Your memory is not just a convenience; it's how you get better over time and maintain continuity across sessions.
16608
-
16609
- This command may be run in different scenarios:
16610
- - **Fresh agent**: You may have default memory blocks that were created when you were initialized
16611
- - **Existing agent**: You may have been working with the user for a while, and they want you to reorganize or significantly update your memory structure
16612
- - **Shared blocks**: Some memory blocks may be shared across multiple agents - be careful about modifying these
16613
-
16614
- Before making changes, use the \`memory\` tool to inspect your current memory blocks and understand what already exists.
16615
-
16616
- ## What Coding Agents Should Remember
16617
-
16618
- ### 1. Procedures (Rules & Workflows)
16619
- Explicit rules and workflows that should always be followed:
16620
- - "Never commit directly to main - always use feature branches"
16621
- - "Always run lint before running tests"
16622
- - "Use conventional commits format for all commit messages"
16623
- - "Always check for existing tests before adding new ones"
16624
-
16625
- ### 2. Preferences (Style & Conventions)
16626
- User and project coding style preferences:
16627
- - "Never use try/catch for control flow"
16628
- - "Always add JSDoc comments to exported functions"
16629
- - "Prefer functional components over class components"
16630
- - "Use early returns instead of nested conditionals"
16631
-
16632
- ### 3. History & Context
16633
- Important historical context that informs current decisions:
16634
- - "We fixed this exact pagination bug two weeks ago - check PR #234"
16635
- - "This monorepo used to have 3 modules before the consolidation"
16636
- - "The auth system was refactored in v2.0 - old patterns are deprecated"
16637
- - "User prefers verbose explanations when debugging"
16638
-
16639
- Note: For historical recall, you may also have access to \`conversation_search\` which can search past conversations. Memory blocks are for distilled, important information worth persisting permanently.
16640
-
16641
- ## Memory Scope Considerations
16642
-
16643
- Consider whether information is:
16644
-
16645
- **Project-scoped** (store in \`project\` block):
16646
- - Build commands, test commands, lint configuration
16647
- - Project architecture and key directories
16648
- - Team conventions specific to this codebase
16649
- - Technology stack and framework choices
16650
-
16651
- **User-scoped** (store in \`human\` block):
16652
- - Personal coding preferences that apply across projects
16653
- - Communication style preferences
16654
- - General workflow habits
16655
-
16656
- **Session/Task-scoped** (consider separate blocks like \`ticket\` or \`context\`):
16657
- - Current branch or ticket being worked on
16658
- - Debugging context for an ongoing investigation
16659
- - Temporary notes about a specific task
16660
-
16661
- ## Recommended Memory Structure
16662
-
16663
- ### Core Blocks (Usually Present)
16664
-
16665
- **\`persona\`**: Your behavioral guidelines that augment your base system prompt.
16666
- - Your system prompt already contains comprehensive instructions for how to code and behave
16667
- - The persona block is for **learned adaptations** - things you discover about how the user wants you to behave
16668
- - Examples: "User said never use emojis", "User prefers terse responses", "Always explain reasoning before making changes"
16669
- - This block may start empty and grow over time as you learn the user's preferences
16670
-
16671
- **\`project\`**: Project-specific information, conventions, and commands
16672
- - Build/test/lint commands
16673
- - Key directories and architecture
16674
- - Project-specific conventions from README, AGENTS.md, etc.
16675
-
16676
- **\`human\`**: User preferences, communication style, general habits
16677
- - Cross-project preferences
16678
- - Working style and communication preferences
16679
-
16680
- ### Optional Blocks (Create as Needed)
16681
-
16682
- **\`ticket\`** or **\`task\`**: Scratchpad for current work item context.
16683
- - **Important**: This is different from the TODO or Plan tools!
16684
- - TODO/Plan tools track active task lists and implementation plans (structured lists of what to do)
16685
- - A ticket/task memory block is a **scratchpad** for pinned context that should stay visible
16686
- - Examples: Linear ticket ID and URL, Jira issue key, branch name, PR number, relevant links
16687
- - Information that's useful to keep in context but doesn't fit in a TODO list
16688
-
16689
- **\`context\`**: Debugging or investigation scratchpad
16690
- - Current hypotheses being tested
16691
- - Files already examined
16692
- - Clues and observations
16693
-
16694
- **\`decisions\`**: Architectural decisions and their rationale
16695
- - Why certain approaches were chosen
16696
- - Trade-offs that were considered
16697
-
16698
- ## Writing Good Memory Blocks
16699
-
16700
- **This is critical**: In the future, you (or a future version of yourself) will only see three things about each memory block:
16701
- 1. The **label** (name)
16702
- 2. The **description**
16703
- 3. The **value** (content)
16704
-
16705
- The reasoning you have *right now* about why you're creating a block will be lost. Your future self won't easily remember this initialization conversation (it can be searched, but it will no longer be in-context). Therefore:
16706
-
16707
- **Labels should be:**
16708
- - Clear and descriptive (e.g., \`project-conventions\` not \`stuff\`)
16709
- - Consistent in style (e.g., all lowercase with hyphens)
16710
-
16711
- **Descriptions are especially important:**
16712
- - Explain *what* this block is for and *when* to use it
16713
- - Explain *how* this block should influence your behavior
16714
- - Write as if explaining to a future version of yourself who has no context
16715
- - Good: "User's coding style preferences that should be applied to all code I write or review. Update when user expresses new preferences."
16716
- - Bad: "Preferences"
16717
-
16718
- **Values should be:**
16719
- - Well-organized and scannable
16720
- - Updated regularly to stay relevant
16721
- - Pruned of outdated information
16722
-
16723
- Think of memory block descriptions as documentation for your future self. The better you write them now, the more effective you'll be in future sessions.
16724
-
16725
- ## Research Depth
16726
-
16727
- You can ask the user if they want a standard or deep research initialization:
16728
-
16729
- **Standard initialization** (~5-20 tool calls):
16730
- - Inspect existing memory blocks
16731
- - Scan README, package.json/config files, AGENTS.md, CLAUDE.md
16732
- - Review git status and recent commits (from context below)
16733
- - Explore key directories and understand project structure
16734
- - Create/update your memory block structure to contain the essential information you need to know about the user, your behavior (learned preferences), the project you're working in, and any other information that will help you be an effective collaborator.
16735
-
16736
- **Deep research initialization** (~100+ tool calls):
16737
- - Everything in standard initialization, plus:
16738
- - Use your TODO or Plan tool to create a systematic research plan
16739
- - Deep dive into git history for patterns, conventions, and context
16740
- - Analyze commit message conventions and branching strategy
16741
- - Explore multiple directories and understand architecture thoroughly
16742
- - Search for and read key source files to understand patterns
16743
- - Create multiple specialized memory blocks
16744
- - May involve multiple rounds of exploration
16745
-
16746
- **What deep research can uncover:**
16747
- - **Contributors & team dynamics**: Who works on what areas? Who are the main contributors? (\`git shortlog -sn\`)
16748
- - **Coding habits**: When do people commit? (time patterns) What's the typical commit size?
16749
- - **Writing & commit style**: How verbose are commit messages? What conventions are followed?
16750
- - **Code evolution**: How has the architecture changed? What major refactors happened?
16751
- - **Review patterns**: Are there PR templates? What gets reviewed carefully vs rubber-stamped?
16752
- - **Pain points**: What areas have lots of bug fixes? What code gets touched frequently?
16753
- - **Related repositories**: Ask the user if there are other repos you should know about (e.g., a backend monorepo, shared libraries, documentation repos). These relationships can be crucial context.
16754
-
16755
- This kind of deep context can make you significantly more effective as a long-term collaborator on the project.
16756
-
16757
- If the user says "take as long as you need" or explicitly wants deep research, use your TODO or Plan tool to orchestrate a thorough, multi-step research process.
16758
-
16759
- ## Research Techniques
16760
-
16761
- **File-based research:**
16762
- - README.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md
16763
- - Package manifests (package.json, Cargo.toml, pyproject.toml, go.mod)
16764
- - Config files (.eslintrc, tsconfig.json, .prettierrc)
16765
- - CI/CD configs (.github/workflows/, .gitlab-ci.yml)
16766
-
16767
- **Git-based research** (if in a git repo):
16768
- - \`git log --oneline -20\` - Recent commit history and patterns
16769
- - \`git branch -a\` - Branching strategy
16770
- - \`git log --format="%s" -50 | head -20\` - Commit message conventions
16771
- - \`git shortlog -sn --all | head -10\` - Main contributors
16772
- - \`git log --format="%an <%ae>" | sort -u\` - Contributors with emails (more reliable for deduplication)
16773
- - Recent PRs or merge commits for context on ongoing work
16774
-
16775
- **Important: Deduplicate contributors!** Git groups by exact author string, so the same person may appear multiple times with different names (e.g., "jsmith" and "John Smith" are likely the same person). Use emails to deduplicate, and apply common sense - usernames often match parts of full names.
16776
-
16777
- ## How to Do Thorough Research
16778
-
16779
- **Don't just collect data - analyze and cross-reference it.**
16780
-
16781
- Shallow research (bad):
16782
- - Run commands, copy output
16783
- - Take everything at face value
16784
- - List facts without understanding
16785
-
16786
- Thorough research (good):
16787
- - **Cross-reference findings**: If two pieces of data seem inconsistent, dig deeper
16788
- - **Resolve ambiguities**: Don't leave questions unanswered (e.g., "are these two contributors the same person?")
16789
- - **Read actual content**: Don't just list file names - read key files to understand them
16790
- - **Look for patterns**: What do the commit messages tell you about workflow? What do file structures tell you about architecture?
16791
- - **Form hypotheses and verify**: "I think this team uses feature branches" → check git branch patterns to confirm
16792
- - **Think like a new team member**: What would you want to know on your first day?
16793
-
16794
- **Questions to ask yourself during research:**
16795
- - Does this make sense? (e.g., why would there be two contributors with similar names?)
16796
- - What's missing? (e.g., no tests directory - is testing not done, or done differently?)
16797
- - What can I infer? (e.g., lots of "fix:" commits in one area → that area is buggy or complex)
16798
- - Am I just listing facts, or do I understand the project?
16799
-
16800
- The goal isn't to produce a report - it's to genuinely understand the project and how this human(s) works so you can be an effective collaborator.
16801
-
16802
- ## On Asking Questions
16803
-
16804
- **Ask important questions upfront, then be autonomous during execution.**
16805
-
16806
- ### Recommended Upfront Questions
16807
-
16808
- You should ask these questions at the start (bundle them together in one AskUserQuestion call):
16809
-
16810
- 1. **Research depth**: "Standard or deep research (comprehensive, as long as needed)?"
16811
- 2. **Identity**: "Which contributor are you?" (You can often infer this from git logs - e.g., if git shows "cpacker" as a top contributor, ask "Are you cpacker?")
16812
- 3. **Related repos**: "Are there other repositories I should know about and consider in my research?" (e.g., backend monorepo, shared libraries)
16813
- 4. **Workflow style**: "How proactive should I be?" (auto-commit vs ask-first)
16814
- 5. **Communication style**: "Terse or detailed responses?"
16815
- 6. **Any specific rules**: "Rules I should always follow?"
16816
-
16817
- **Why these matter:**
16818
- - Identity lets you correlate git history to the user (their commits, PRs, coding style)
16819
- - Related repos provide crucial context (many projects span multiple repos)
16820
- - Workflow/communication style should be stored in the \`human\` block
16821
- - Rules go in \`persona\` block
16822
-
16823
- ### What NOT to ask
16824
-
16825
- - Things you can find by reading files ("What's your test framework?")
16826
- - "What kind of work do you do? Reviewing PRs vs writing code?" - obvious from git log, most devs do everything
16827
- - Permission for obvious actions - just do them
16828
- - Questions one at a time - bundle them (but don't exhaust the user with too many questions at once)
16829
-
16830
- **During execution**, be autonomous. Make reasonable choices and proceed.
16831
-
16832
- ## Memory Block Strategy
16833
-
16834
- ### Split Large Blocks
16835
-
16836
- **Don't create monolithic blocks.** If a block is getting long (>50-100 lines), split it:
16837
-
16838
- Instead of one huge \`project\` block, consider:
16839
- - \`project-overview\`: High-level description, tech stack, repo links
16840
- - \`project-commands\`: Build, test, lint, dev commands
16841
- - \`project-conventions\`: Commit style, PR process, code style
16842
- - \`project-architecture\`: Directory structure, key modules
16843
- - \`project-gotchas\`: Footguns, things to watch out for
16844
-
16845
- This makes memory more scannable and easier to update and share with other agents.
16846
-
16847
- ### Update Memory Incrementally
16848
-
16849
- **For deep research: Update memory as you go, not all at once at the end.**
16850
-
16851
- Why this matters:
16852
- - Deep research can take many turns and millions of tokens
16853
- - Context windows overflow and trigger rolling summaries
16854
- - If you wait until the end to write memory, you may lose important details
16855
- - Write findings to memory blocks as you discover them
16856
-
16857
- Good pattern:
16858
- 1. Create block structure early (even with placeholder content)
16859
- 2. Update blocks after each research phase
16860
- 3. Refine and consolidate at the end
16861
-
16862
- Remember, your memory tool allows you to easily add, edit, and remove blocks. There's no reason to wait until you "know everything" to write memory. Treat your memory blocks as a living scratchpad.
16863
-
16864
- ### Initialize ALL Relevant Blocks
16865
-
16866
- Don't just update a single memory block. Based on your upfront questions, also update:
16867
-
16868
- - **\`human\`**: Store the user's identity, workflow preferences, communication style
16869
- - **\`persona\`**: Store rules the user wants you to follow, behavioral adaptations
16870
- - **\`project-*\`**: Split project info across multiple focused blocks
16871
-
16872
- And add memory blocks that you think make sense to add (e.g., \`project-architecture\`, \`project-conventions\`, \`project-gotchas\`, etc, or even splitting the \`human\` block into more focused blocks, or even multiple blocks for multiple users).
16873
-
16874
- ## Your Task
16875
-
16876
- 1. **Ask upfront questions**: Use AskUserQuestion with the recommended questions above (bundled together). This is critical - don't skip it.
16877
- 2. **Inspect existing memory**: You may already have some memory blocks initialized. See what already exists, and analyze how it is or is not insufficient or incomplete.
16878
- 3. **Identify the user**: From git logs and their answer, figure out who they are and store in \`human\` block. If relevant, ask questions to gather information about their preferences that will help you be a useful assistant to them.
16879
- 4. **Update human/persona early**: Based on answers, update your memory blocks eagerly before diving into project research. You can always change them as you go, you're not locked into any memory configuration.
16880
- 5. **Research the project**: Explore based on chosen depth. Use your TODO or plan tool to create a systematic research plan.
16881
- 6. **Create/update project blocks incrementally**: Don't wait until the end - write findings as you go.
16882
- 7. **Reflect and review**: See "Reflection Phase" below - this is critical for deep research.
16883
- 8. **Ask user if done**: Check if they're satisfied or want you to continue refining.
16884
-
16885
- ## Reflection Phase (Critical for Deep Research)
16886
-
16887
- Before finishing, you MUST do a reflection step. **Your memory blocks are visible to you in your system prompt right now.** Look at them carefully and ask yourself:
16888
-
16889
- 1. **Redundancy check**: Are there blocks with overlapping content? Either literally overlapping (due to errors while making memory edits), or semantically/conceptually overlapping?
16890
-
16891
- 2. **Completeness check**: Did you actually update ALL relevant blocks? For example:
16892
- - Did you update \`human\` with the user's identity and preferences?
16893
- - Did you update \`persona\` with behavioral rules they expressed?
16894
- - Or did you only update project blocks and forget the rest?
16895
-
16896
- 3. **Quality check**: Are there typos, formatting issues, or unclear descriptions in your blocks?
16897
-
16898
- 4. **Structure check**: Would this make sense to your future self? Is anything missing? Is anything redundant?
16899
-
16900
- **After reflection**, fix any issues you found. Then ask the user:
16901
- > "I've completed the initialization. Here's a brief summary of what I set up: [summary]. Should I continue refining, or is this good to proceed?"
16902
-
16903
- This gives the user a chance to provide feedback or ask for adjustments before you finish.
16904
-
16905
- Remember: Good memory management is an investment. The effort you put into organizing your memory now will pay dividends as you work with this user over time.
16906
- `;
16907
- var init_SKILL = () => {};
16908
-
16909
16596
  // src/agent/skills.ts
16910
16597
  var exports_skills = {};
16911
16598
  __export(exports_skills, {
@@ -16917,40 +16604,19 @@ __export(exports_skills, {
16917
16604
  });
16918
16605
  import { existsSync as existsSync3 } from "node:fs";
16919
16606
  import { readdir as readdir4, readFile as readFile3 } from "node:fs/promises";
16920
- import { join as join7 } from "node:path";
16921
- function parseBundledSkill(id, content) {
16922
- const { frontmatter, body } = parseFrontmatter(content);
16923
- const name = (typeof frontmatter.name === "string" ? frontmatter.name : null) || id.split("/").pop()?.replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()) || id;
16924
- let description = typeof frontmatter.description === "string" ? frontmatter.description : null;
16925
- if (!description) {
16926
- const firstParagraph = body.trim().split(`
16927
-
16928
- `)[0];
16929
- description = firstParagraph || "No description available";
16930
- }
16931
- description = description.trim();
16932
- if (description.startsWith('"') && description.endsWith('"') || description.startsWith("'") && description.endsWith("'")) {
16933
- description = description.slice(1, -1);
16934
- }
16935
- let tags;
16936
- if (Array.isArray(frontmatter.tags)) {
16937
- tags = frontmatter.tags;
16938
- } else if (typeof frontmatter.tags === "string") {
16939
- tags = [frontmatter.tags];
16607
+ import { dirname as dirname4, join as join7 } from "node:path";
16608
+ import { fileURLToPath as fileURLToPath5 } from "node:url";
16609
+ function getBundledSkillsPath() {
16610
+ const thisDir = dirname4(fileURLToPath5(import.meta.url));
16611
+ if (thisDir.includes("src/agent") || thisDir.includes("src\\agent")) {
16612
+ return join7(thisDir, "../skills/builtin");
16940
16613
  }
16941
- return {
16942
- id,
16943
- name,
16944
- description,
16945
- category: typeof frontmatter.category === "string" ? frontmatter.category : undefined,
16946
- tags,
16947
- path: "",
16948
- source: "bundled",
16949
- content
16950
- };
16614
+ return join7(thisDir, "skills");
16951
16615
  }
16952
- function getBundledSkills() {
16953
- return BUNDLED_SKILL_SOURCES.map(({ id, content }) => parseBundledSkill(id, content));
16616
+ async function getBundledSkills() {
16617
+ const bundledPath = getBundledSkillsPath();
16618
+ const result = await discoverSkillsFromDir(bundledPath, "bundled");
16619
+ return result.skills;
16954
16620
  }
16955
16621
  async function discoverSkillsFromDir(skillsPath, source) {
16956
16622
  const errors = [];
@@ -16971,7 +16637,8 @@ async function discoverSkillsFromDir(skillsPath, source) {
16971
16637
  async function discoverSkills(projectSkillsPath = join7(process.cwd(), SKILLS_DIR)) {
16972
16638
  const allErrors = [];
16973
16639
  const skillsById = new Map;
16974
- for (const skill of getBundledSkills()) {
16640
+ const bundledSkills = await getBundledSkills();
16641
+ for (const skill of bundledSkills) {
16975
16642
  skillsById.set(skill.id, skill);
16976
16643
  }
16977
16644
  const globalResult = await discoverSkillsFromDir(GLOBAL_SKILLS_DIR, "global");
@@ -17177,12 +16844,8 @@ function formatSkillsForMemory(skills, skillsDirectory) {
17177
16844
  }
17178
16845
  return formatSkillsAsTree(skills, skillsDirectory);
17179
16846
  }
17180
- var BUNDLED_SKILL_SOURCES, SKILLS_DIR = ".skills", GLOBAL_SKILLS_DIR, SKILLS_BLOCK_CHAR_LIMIT = 20000;
16847
+ var SKILLS_DIR = ".skills", GLOBAL_SKILLS_DIR, SKILLS_BLOCK_CHAR_LIMIT = 20000;
17181
16848
  var init_skills2 = __esm(() => {
17182
- init_SKILL();
17183
- BUNDLED_SKILL_SOURCES = [
17184
- { id: "memory-init", content: SKILL_default }
17185
- ];
17186
16849
  GLOBAL_SKILLS_DIR = join7(process.env.HOME || process.env.USERPROFILE || "~", ".letta/skills");
17187
16850
  });
17188
16851
 
@@ -17246,10 +16909,12 @@ function extractSkillsDir(skillsBlockValue) {
17246
16909
  return match2 ? match2[1]?.trim() || null : null;
17247
16910
  }
17248
16911
  async function readSkillContent(skillId, skillsDir) {
17249
- const bundledSkills = getBundledSkills();
16912
+ const bundledSkills = await getBundledSkills();
17250
16913
  const bundledSkill = bundledSkills.find((s) => s.id === skillId);
17251
- if (bundledSkill?.content) {
17252
- return bundledSkill.content;
16914
+ if (bundledSkill?.path) {
16915
+ try {
16916
+ return await readFile4(bundledSkill.path, "utf-8");
16917
+ } catch {}
17253
16918
  }
17254
16919
  const globalSkillPath = join8(GLOBAL_SKILLS_DIR, skillId, "SKILL.md");
17255
16920
  try {
@@ -21381,7 +21046,7 @@ var exports_analyzer = {};
21381
21046
  __export(exports_analyzer, {
21382
21047
  analyzeApprovalContext: () => analyzeApprovalContext
21383
21048
  });
21384
- import { dirname as dirname5, resolve as resolve13 } from "node:path";
21049
+ import { dirname as dirname6, resolve as resolve13 } from "node:path";
21385
21050
  function analyzeApprovalContext(toolName, toolArgs, workingDirectory) {
21386
21051
  const resolveFilePath = () => {
21387
21052
  const candidate = toolArgs.file_path ?? toolArgs.path ?? toolArgs.notebook_path ?? "";
@@ -21413,7 +21078,7 @@ function analyzeApprovalContext(toolName, toolArgs, workingDirectory) {
21413
21078
  function analyzeReadApproval(filePath, workingDir) {
21414
21079
  const absolutePath = resolve13(workingDir, filePath);
21415
21080
  if (!absolutePath.startsWith(workingDir)) {
21416
- const dirPath = dirname5(absolutePath);
21081
+ const dirPath = dirname6(absolutePath);
21417
21082
  const displayPath = dirPath.replace(__require("node:os").homedir(), "~");
21418
21083
  return {
21419
21084
  recommendedRule: `Read(/${dirPath}/**)`,
@@ -21425,7 +21090,7 @@ function analyzeReadApproval(filePath, workingDir) {
21425
21090
  };
21426
21091
  }
21427
21092
  const relativePath = absolutePath.slice(workingDir.length + 1);
21428
- const relativeDir = dirname5(relativePath);
21093
+ const relativeDir = dirname6(relativePath);
21429
21094
  const pattern = relativeDir === "." ? "**" : `${relativeDir}/**`;
21430
21095
  return {
21431
21096
  recommendedRule: `Read(${pattern})`,
@@ -21448,7 +21113,7 @@ function analyzeWriteApproval(_filePath, _workingDir) {
21448
21113
  }
21449
21114
  function analyzeEditApproval(filePath, workingDir) {
21450
21115
  const absolutePath = resolve13(workingDir, filePath);
21451
- const dirPath = dirname5(absolutePath);
21116
+ const dirPath = dirname6(absolutePath);
21452
21117
  if (!dirPath.startsWith(workingDir)) {
21453
21118
  const displayPath = dirPath.replace(__require("node:os").homedir(), "~");
21454
21119
  return {
@@ -22404,40 +22069,19 @@ __export(exports_skills2, {
22404
22069
  });
22405
22070
  import { existsSync as existsSync4 } from "node:fs";
22406
22071
  import { readdir as readdir5, readFile as readFile5 } from "node:fs/promises";
22407
- import { join as join10 } from "node:path";
22408
- function parseBundledSkill2(id, content) {
22409
- const { frontmatter, body } = parseFrontmatter(content);
22410
- const name = (typeof frontmatter.name === "string" ? frontmatter.name : null) || id.split("/").pop()?.replace(/-/g, " ").replace(/\b\w/g, (l) => l.toUpperCase()) || id;
22411
- let description = typeof frontmatter.description === "string" ? frontmatter.description : null;
22412
- if (!description) {
22413
- const firstParagraph = body.trim().split(`
22414
-
22415
- `)[0];
22416
- description = firstParagraph || "No description available";
22417
- }
22418
- description = description.trim();
22419
- if (description.startsWith('"') && description.endsWith('"') || description.startsWith("'") && description.endsWith("'")) {
22420
- description = description.slice(1, -1);
22421
- }
22422
- let tags;
22423
- if (Array.isArray(frontmatter.tags)) {
22424
- tags = frontmatter.tags;
22425
- } else if (typeof frontmatter.tags === "string") {
22426
- tags = [frontmatter.tags];
22072
+ import { dirname as dirname7, join as join10 } from "node:path";
22073
+ import { fileURLToPath as fileURLToPath6 } from "node:url";
22074
+ function getBundledSkillsPath2() {
22075
+ const thisDir = dirname7(fileURLToPath6(import.meta.url));
22076
+ if (thisDir.includes("src/agent") || thisDir.includes("src\\agent")) {
22077
+ return join10(thisDir, "../skills/builtin");
22427
22078
  }
22428
- return {
22429
- id,
22430
- name,
22431
- description,
22432
- category: typeof frontmatter.category === "string" ? frontmatter.category : undefined,
22433
- tags,
22434
- path: "",
22435
- source: "bundled",
22436
- content
22437
- };
22079
+ return join10(thisDir, "skills");
22438
22080
  }
22439
- function getBundledSkills2() {
22440
- return BUNDLED_SKILL_SOURCES2.map(({ id, content }) => parseBundledSkill2(id, content));
22081
+ async function getBundledSkills2() {
22082
+ const bundledPath = getBundledSkillsPath2();
22083
+ const result = await discoverSkillsFromDir2(bundledPath, "bundled");
22084
+ return result.skills;
22441
22085
  }
22442
22086
  async function discoverSkillsFromDir2(skillsPath, source) {
22443
22087
  const errors = [];
@@ -22458,7 +22102,8 @@ async function discoverSkillsFromDir2(skillsPath, source) {
22458
22102
  async function discoverSkills2(projectSkillsPath = join10(process.cwd(), SKILLS_DIR2)) {
22459
22103
  const allErrors = [];
22460
22104
  const skillsById = new Map;
22461
- for (const skill2 of getBundledSkills2()) {
22105
+ const bundledSkills = await getBundledSkills2();
22106
+ for (const skill2 of bundledSkills) {
22462
22107
  skillsById.set(skill2.id, skill2);
22463
22108
  }
22464
22109
  const globalResult = await discoverSkillsFromDir2(GLOBAL_SKILLS_DIR2, "global");
@@ -22664,12 +22309,8 @@ function formatSkillsForMemory2(skills, skillsDirectory) {
22664
22309
  }
22665
22310
  return formatSkillsAsTree2(skills, skillsDirectory);
22666
22311
  }
22667
- var BUNDLED_SKILL_SOURCES2, SKILLS_DIR2 = ".skills", GLOBAL_SKILLS_DIR2, SKILLS_BLOCK_CHAR_LIMIT2 = 20000;
22312
+ var SKILLS_DIR2 = ".skills", GLOBAL_SKILLS_DIR2, SKILLS_BLOCK_CHAR_LIMIT2 = 20000;
22668
22313
  var init_skills3 = __esm(() => {
22669
- init_SKILL();
22670
- BUNDLED_SKILL_SOURCES2 = [
22671
- { id: "memory-init", content: SKILL_default }
22672
- ];
22673
22314
  GLOBAL_SKILLS_DIR2 = join10(process.env.HOME || process.env.USERPROFILE || "~", ".letta/skills");
22674
22315
  });
22675
22316
 
@@ -22689,12 +22330,12 @@ import {
22689
22330
  writeFileSync as fsWriteFileSync2,
22690
22331
  mkdirSync as mkdirSync2
22691
22332
  } from "node:fs";
22692
- import { dirname as dirname6 } from "node:path";
22333
+ import { dirname as dirname8 } from "node:path";
22693
22334
  async function readFile6(path15) {
22694
22335
  return fsReadFileSync2(path15, { encoding: "utf-8" });
22695
22336
  }
22696
22337
  async function writeFile2(path15, content) {
22697
- const dir = dirname6(path15);
22338
+ const dir = dirname8(path15);
22698
22339
  if (!existsSync5(dir)) {
22699
22340
  mkdirSync2(dir, { recursive: true });
22700
22341
  }
@@ -47843,7 +47484,7 @@ __export(exports_open, {
47843
47484
  import process18 from "node:process";
47844
47485
  import { Buffer as Buffer3 } from "node:buffer";
47845
47486
  import path15 from "node:path";
47846
- import { fileURLToPath as fileURLToPath5 } from "node:url";
47487
+ import { fileURLToPath as fileURLToPath7 } from "node:url";
47847
47488
  import { promisify as promisify8 } from "node:util";
47848
47489
  import childProcess from "node:child_process";
47849
47490
  import fs14, { constants as fsConstants2 } from "node:fs/promises";
@@ -48067,7 +47708,7 @@ var init_open = __esm(() => {
48067
47708
  init_default_browser();
48068
47709
  init_is_inside_container();
48069
47710
  execFile6 = promisify8(childProcess.execFile);
48070
- __dirname2 = path15.dirname(fileURLToPath5(import.meta.url));
47711
+ __dirname2 = path15.dirname(fileURLToPath7(import.meta.url));
48071
47712
  localXdgOpenPath = path15.join(__dirname2, "xdg-open");
48072
47713
  ({ platform: platform2, arch } = process18);
48073
47714
  apps = {};
@@ -68050,7 +67691,7 @@ Press Enter to continue, or type anything to cancel.`, false, "running");
68050
67691
  const cmdId2 = uid4("cmd");
68051
67692
  const [, ...rest] = trimmed.split(/\s+/);
68052
67693
  const description = rest.join(" ").trim();
68053
- const initialOutput = description ? `Starting skill creation for: ${description}` : "Starting skill creation. I’ll load the skill-creator skill and ask a few questions about the skill you want to build...";
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...";
68054
67695
  buffersRef.current.byId.set(cmdId2, {
68055
67696
  kind: "command",
68056
67697
  id: cmdId2,
@@ -68227,10 +67868,10 @@ ${recentCommits}
68227
67868
  const initMessage = `<system-reminder>
68228
67869
  The user has requested memory initialization via /init.
68229
67870
 
68230
- ## 1. Load the memory-init skill
67871
+ ## 1. Load the initializing-memory skill
68231
67872
 
68232
- First, check your \`loaded_skills\` memory block. If the \`memory-init\` skill is not already loaded:
68233
- 1. Use the \`Skill\` tool with \`command: "load", skills: ["memory-init"]\`
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"]\`
68234
67875
  2. The skill contains comprehensive instructions for memory initialization
68235
67876
 
68236
67877
  If the skill fails to load, proceed with your best judgment based on these guidelines:
@@ -68241,7 +67882,7 @@ If the skill fails to load, proceed with your best judgment based on these guide
68241
67882
 
68242
67883
  ## 2. Follow the loaded skill instructions
68243
67884
 
68244
- Once loaded, follow the instructions in the \`memory-init\` skill to complete the initialization.
67885
+ Once loaded, follow the instructions in the \`initializing-memory\` skill to complete the initialization.
68245
67886
  ${gitContext}
68246
67887
  </system-reminder>`;
68247
67888
  await processConversation([
@@ -71958,4 +71599,4 @@ Error during initialization: ${message}`);
71958
71599
  }
71959
71600
  main();
71960
71601
 
71961
- //# debugId=AB315140F646E6AE64756E2164756E21
71602
+ //# debugId=CAAC5BC4B213F90764756E2164756E21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.7.4-next.1",
3
+ "version": "0.7.4-next.3",
4
4
  "description": "Letta Code is a CLI tool for interacting with stateful Letta agents from the terminal.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,6 +11,7 @@
11
11
  "README.md",
12
12
  "letta.js",
13
13
  "scripts",
14
+ "skills",
14
15
  "vendor"
15
16
  ],
16
17
  "repository": {