@letta-ai/letta-code 0.7.3 → 0.7.4-next.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letta-ai/letta-code",
3
- "version": "0.7.3",
3
+ "version": "0.7.4-next.2",
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": {
@@ -0,0 +1,310 @@
1
+ ---
2
+ name: Memory Initialization
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
+ ---
5
+
6
+ # Memory Initialization Guide
7
+
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
+
10
+ ## Understanding Your Context
11
+
12
+ **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.
13
+
14
+ This command may be run in different scenarios:
15
+ - **Fresh agent**: You may have default memory blocks that were created when you were initialized
16
+ - **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
17
+ - **Shared blocks**: Some memory blocks may be shared across multiple agents - be careful about modifying these
18
+
19
+ Before making changes, use the `memory` tool to inspect your current memory blocks and understand what already exists.
20
+
21
+ ## What Coding Agents Should Remember
22
+
23
+ ### 1. Procedures (Rules & Workflows)
24
+ Explicit rules and workflows that should always be followed:
25
+ - "Never commit directly to main - always use feature branches"
26
+ - "Always run lint before running tests"
27
+ - "Use conventional commits format for all commit messages"
28
+ - "Always check for existing tests before adding new ones"
29
+
30
+ ### 2. Preferences (Style & Conventions)
31
+ User and project coding style preferences:
32
+ - "Never use try/catch for control flow"
33
+ - "Always add JSDoc comments to exported functions"
34
+ - "Prefer functional components over class components"
35
+ - "Use early returns instead of nested conditionals"
36
+
37
+ ### 3. History & Context
38
+ Important historical context that informs current decisions:
39
+ - "We fixed this exact pagination bug two weeks ago - check PR #234"
40
+ - "This monorepo used to have 3 modules before the consolidation"
41
+ - "The auth system was refactored in v2.0 - old patterns are deprecated"
42
+ - "User prefers verbose explanations when debugging"
43
+
44
+ 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.
45
+
46
+ ## Memory Scope Considerations
47
+
48
+ Consider whether information is:
49
+
50
+ **Project-scoped** (store in `project` block):
51
+ - Build commands, test commands, lint configuration
52
+ - Project architecture and key directories
53
+ - Team conventions specific to this codebase
54
+ - Technology stack and framework choices
55
+
56
+ **User-scoped** (store in `human` block):
57
+ - Personal coding preferences that apply across projects
58
+ - Communication style preferences
59
+ - General workflow habits
60
+
61
+ **Session/Task-scoped** (consider separate blocks like `ticket` or `context`):
62
+ - Current branch or ticket being worked on
63
+ - Debugging context for an ongoing investigation
64
+ - Temporary notes about a specific task
65
+
66
+ ## Recommended Memory Structure
67
+
68
+ ### Core Blocks (Usually Present)
69
+
70
+ **`persona`**: Your behavioral guidelines that augment your base system prompt.
71
+ - Your system prompt already contains comprehensive instructions for how to code and behave
72
+ - The persona block is for **learned adaptations** - things you discover about how the user wants you to behave
73
+ - Examples: "User said never use emojis", "User prefers terse responses", "Always explain reasoning before making changes"
74
+ - This block may start empty and grow over time as you learn the user's preferences
75
+
76
+ **`project`**: Project-specific information, conventions, and commands
77
+ - Build/test/lint commands
78
+ - Key directories and architecture
79
+ - Project-specific conventions from README, AGENTS.md, etc.
80
+
81
+ **`human`**: User preferences, communication style, general habits
82
+ - Cross-project preferences
83
+ - Working style and communication preferences
84
+
85
+ ### Optional Blocks (Create as Needed)
86
+
87
+ **`ticket`** or **`task`**: Scratchpad for current work item context.
88
+ - **Important**: This is different from the TODO or Plan tools!
89
+ - TODO/Plan tools track active task lists and implementation plans (structured lists of what to do)
90
+ - A ticket/task memory block is a **scratchpad** for pinned context that should stay visible
91
+ - Examples: Linear ticket ID and URL, Jira issue key, branch name, PR number, relevant links
92
+ - Information that's useful to keep in context but doesn't fit in a TODO list
93
+
94
+ **`context`**: Debugging or investigation scratchpad
95
+ - Current hypotheses being tested
96
+ - Files already examined
97
+ - Clues and observations
98
+
99
+ **`decisions`**: Architectural decisions and their rationale
100
+ - Why certain approaches were chosen
101
+ - Trade-offs that were considered
102
+
103
+ ## Writing Good Memory Blocks
104
+
105
+ **This is critical**: In the future, you (or a future version of yourself) will only see three things about each memory block:
106
+ 1. The **label** (name)
107
+ 2. The **description**
108
+ 3. The **value** (content)
109
+
110
+ 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:
111
+
112
+ **Labels should be:**
113
+ - Clear and descriptive (e.g., `project-conventions` not `stuff`)
114
+ - Consistent in style (e.g., all lowercase with hyphens)
115
+
116
+ **Descriptions are especially important:**
117
+ - Explain *what* this block is for and *when* to use it
118
+ - Explain *how* this block should influence your behavior
119
+ - Write as if explaining to a future version of yourself who has no context
120
+ - Good: "User's coding style preferences that should be applied to all code I write or review. Update when user expresses new preferences."
121
+ - Bad: "Preferences"
122
+
123
+ **Values should be:**
124
+ - Well-organized and scannable
125
+ - Updated regularly to stay relevant
126
+ - Pruned of outdated information
127
+
128
+ 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.
129
+
130
+ ## Research Depth
131
+
132
+ You can ask the user if they want a standard or deep research initialization:
133
+
134
+ **Standard initialization** (~5-20 tool calls):
135
+ - Inspect existing memory blocks
136
+ - Scan README, package.json/config files, AGENTS.md, CLAUDE.md
137
+ - Review git status and recent commits (from context below)
138
+ - Explore key directories and understand project structure
139
+ - 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.
140
+
141
+ **Deep research initialization** (~100+ tool calls):
142
+ - Everything in standard initialization, plus:
143
+ - Use your TODO or Plan tool to create a systematic research plan
144
+ - Deep dive into git history for patterns, conventions, and context
145
+ - Analyze commit message conventions and branching strategy
146
+ - Explore multiple directories and understand architecture thoroughly
147
+ - Search for and read key source files to understand patterns
148
+ - Create multiple specialized memory blocks
149
+ - May involve multiple rounds of exploration
150
+
151
+ **What deep research can uncover:**
152
+ - **Contributors & team dynamics**: Who works on what areas? Who are the main contributors? (`git shortlog -sn`)
153
+ - **Coding habits**: When do people commit? (time patterns) What's the typical commit size?
154
+ - **Writing & commit style**: How verbose are commit messages? What conventions are followed?
155
+ - **Code evolution**: How has the architecture changed? What major refactors happened?
156
+ - **Review patterns**: Are there PR templates? What gets reviewed carefully vs rubber-stamped?
157
+ - **Pain points**: What areas have lots of bug fixes? What code gets touched frequently?
158
+ - **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.
159
+
160
+ This kind of deep context can make you significantly more effective as a long-term collaborator on the project.
161
+
162
+ 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.
163
+
164
+ ## Research Techniques
165
+
166
+ **File-based research:**
167
+ - README.md, CONTRIBUTING.md, AGENTS.md, CLAUDE.md
168
+ - Package manifests (package.json, Cargo.toml, pyproject.toml, go.mod)
169
+ - Config files (.eslintrc, tsconfig.json, .prettierrc)
170
+ - CI/CD configs (.github/workflows/, .gitlab-ci.yml)
171
+
172
+ **Git-based research** (if in a git repo):
173
+ - `git log --oneline -20` - Recent commit history and patterns
174
+ - `git branch -a` - Branching strategy
175
+ - `git log --format="%s" -50 | head -20` - Commit message conventions
176
+ - `git shortlog -sn --all | head -10` - Main contributors
177
+ - `git log --format="%an <%ae>" | sort -u` - Contributors with emails (more reliable for deduplication)
178
+ - Recent PRs or merge commits for context on ongoing work
179
+
180
+ **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.
181
+
182
+ ## How to Do Thorough Research
183
+
184
+ **Don't just collect data - analyze and cross-reference it.**
185
+
186
+ Shallow research (bad):
187
+ - Run commands, copy output
188
+ - Take everything at face value
189
+ - List facts without understanding
190
+
191
+ Thorough research (good):
192
+ - **Cross-reference findings**: If two pieces of data seem inconsistent, dig deeper
193
+ - **Resolve ambiguities**: Don't leave questions unanswered (e.g., "are these two contributors the same person?")
194
+ - **Read actual content**: Don't just list file names - read key files to understand them
195
+ - **Look for patterns**: What do the commit messages tell you about workflow? What do file structures tell you about architecture?
196
+ - **Form hypotheses and verify**: "I think this team uses feature branches" → check git branch patterns to confirm
197
+ - **Think like a new team member**: What would you want to know on your first day?
198
+
199
+ **Questions to ask yourself during research:**
200
+ - Does this make sense? (e.g., why would there be two contributors with similar names?)
201
+ - What's missing? (e.g., no tests directory - is testing not done, or done differently?)
202
+ - What can I infer? (e.g., lots of "fix:" commits in one area → that area is buggy or complex)
203
+ - Am I just listing facts, or do I understand the project?
204
+
205
+ 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.
206
+
207
+ ## On Asking Questions
208
+
209
+ **Ask important questions upfront, then be autonomous during execution.**
210
+
211
+ ### Recommended Upfront Questions
212
+
213
+ You should ask these questions at the start (bundle them together in one AskUserQuestion call):
214
+
215
+ 1. **Research depth**: "Standard or deep research (comprehensive, as long as needed)?"
216
+ 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?")
217
+ 3. **Related repos**: "Are there other repositories I should know about and consider in my research?" (e.g., backend monorepo, shared libraries)
218
+ 4. **Workflow style**: "How proactive should I be?" (auto-commit vs ask-first)
219
+ 5. **Communication style**: "Terse or detailed responses?"
220
+ 6. **Any specific rules**: "Rules I should always follow?"
221
+
222
+ **Why these matter:**
223
+ - Identity lets you correlate git history to the user (their commits, PRs, coding style)
224
+ - Related repos provide crucial context (many projects span multiple repos)
225
+ - Workflow/communication style should be stored in the `human` block
226
+ - Rules go in `persona` block
227
+
228
+ ### What NOT to ask
229
+
230
+ - Things you can find by reading files ("What's your test framework?")
231
+ - "What kind of work do you do? Reviewing PRs vs writing code?" - obvious from git log, most devs do everything
232
+ - Permission for obvious actions - just do them
233
+ - Questions one at a time - bundle them (but don't exhaust the user with too many questions at once)
234
+
235
+ **During execution**, be autonomous. Make reasonable choices and proceed.
236
+
237
+ ## Memory Block Strategy
238
+
239
+ ### Split Large Blocks
240
+
241
+ **Don't create monolithic blocks.** If a block is getting long (>50-100 lines), split it:
242
+
243
+ Instead of one huge `project` block, consider:
244
+ - `project-overview`: High-level description, tech stack, repo links
245
+ - `project-commands`: Build, test, lint, dev commands
246
+ - `project-conventions`: Commit style, PR process, code style
247
+ - `project-architecture`: Directory structure, key modules
248
+ - `project-gotchas`: Footguns, things to watch out for
249
+
250
+ This makes memory more scannable and easier to update and share with other agents.
251
+
252
+ ### Update Memory Incrementally
253
+
254
+ **For deep research: Update memory as you go, not all at once at the end.**
255
+
256
+ Why this matters:
257
+ - Deep research can take many turns and millions of tokens
258
+ - Context windows overflow and trigger rolling summaries
259
+ - If you wait until the end to write memory, you may lose important details
260
+ - Write findings to memory blocks as you discover them
261
+
262
+ Good pattern:
263
+ 1. Create block structure early (even with placeholder content)
264
+ 2. Update blocks after each research phase
265
+ 3. Refine and consolidate at the end
266
+
267
+ 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.
268
+
269
+ ### Initialize ALL Relevant Blocks
270
+
271
+ Don't just update a single memory block. Based on your upfront questions, also update:
272
+
273
+ - **`human`**: Store the user's identity, workflow preferences, communication style
274
+ - **`persona`**: Store rules the user wants you to follow, behavioral adaptations
275
+ - **`project-*`**: Split project info across multiple focused blocks
276
+
277
+ 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).
278
+
279
+ ## Your Task
280
+
281
+ 1. **Ask upfront questions**: Use AskUserQuestion with the recommended questions above (bundled together). This is critical - don't skip it.
282
+ 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.
283
+ 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.
284
+ 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.
285
+ 5. **Research the project**: Explore based on chosen depth. Use your TODO or plan tool to create a systematic research plan.
286
+ 6. **Create/update project blocks incrementally**: Don't wait until the end - write findings as you go.
287
+ 7. **Reflect and review**: See "Reflection Phase" below - this is critical for deep research.
288
+ 8. **Ask user if done**: Check if they're satisfied or want you to continue refining.
289
+
290
+ ## Reflection Phase (Critical for Deep Research)
291
+
292
+ 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:
293
+
294
+ 1. **Redundancy check**: Are there blocks with overlapping content? Either literally overlapping (due to errors while making memory edits), or semantically/conceptually overlapping?
295
+
296
+ 2. **Completeness check**: Did you actually update ALL relevant blocks? For example:
297
+ - Did you update `human` with the user's identity and preferences?
298
+ - Did you update `persona` with behavioral rules they expressed?
299
+ - Or did you only update project blocks and forget the rest?
300
+
301
+ 3. **Quality check**: Are there typos, formatting issues, or unclear descriptions in your blocks?
302
+
303
+ 4. **Structure check**: Would this make sense to your future self? Is anything missing? Is anything redundant?
304
+
305
+ **After reflection**, fix any issues you found. Then ask the user:
306
+ > "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?"
307
+
308
+ This gives the user a chance to provide feedback or ask for adjustments before you finish.
309
+
310
+ 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.