universal-agent-memory 0.1.0
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/LICENSE +21 -0
- package/README.md +321 -0
- package/dist/analyzers/index.d.ts +3 -0
- package/dist/analyzers/index.d.ts.map +1 -0
- package/dist/analyzers/index.js +373 -0
- package/dist/analyzers/index.js.map +1 -0
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +119 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/cli/analyze.d.ts +7 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +103 -0
- package/dist/cli/analyze.js.map +1 -0
- package/dist/cli/droids.d.ts +9 -0
- package/dist/cli/droids.d.ts.map +1 -0
- package/dist/cli/droids.js +227 -0
- package/dist/cli/droids.js.map +1 -0
- package/dist/cli/generate.d.ts +9 -0
- package/dist/cli/generate.d.ts.map +1 -0
- package/dist/cli/generate.js +203 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/cli/init.d.ts +12 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +260 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/memory.d.ts +15 -0
- package/dist/cli/memory.d.ts.map +1 -0
- package/dist/cli/memory.js +274 -0
- package/dist/cli/memory.js.map +1 -0
- package/dist/cli/sync.d.ts +7 -0
- package/dist/cli/sync.d.ts.map +1 -0
- package/dist/cli/sync.js +26 -0
- package/dist/cli/sync.js.map +1 -0
- package/dist/cli/worktree.d.ts +9 -0
- package/dist/cli/worktree.d.ts.map +1 -0
- package/dist/cli/worktree.js +175 -0
- package/dist/cli/worktree.js.map +1 -0
- package/dist/generators/claude-md.d.ts +3 -0
- package/dist/generators/claude-md.d.ts.map +1 -0
- package/dist/generators/claude-md.js +643 -0
- package/dist/generators/claude-md.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/memory/backends/base.d.ts +18 -0
- package/dist/memory/backends/base.d.ts.map +1 -0
- package/dist/memory/backends/base.js +2 -0
- package/dist/memory/backends/base.js.map +1 -0
- package/dist/memory/backends/factory.d.ts +4 -0
- package/dist/memory/backends/factory.d.ts.map +1 -0
- package/dist/memory/backends/factory.js +52 -0
- package/dist/memory/backends/factory.js.map +1 -0
- package/dist/memory/backends/github.d.ts +22 -0
- package/dist/memory/backends/github.d.ts.map +1 -0
- package/dist/memory/backends/github.js +118 -0
- package/dist/memory/backends/github.js.map +1 -0
- package/dist/memory/backends/qdrant-cloud.d.ts +19 -0
- package/dist/memory/backends/qdrant-cloud.d.ts.map +1 -0
- package/dist/memory/backends/qdrant-cloud.js +111 -0
- package/dist/memory/backends/qdrant-cloud.js.map +1 -0
- package/dist/memory/prepopulate.d.ts +76 -0
- package/dist/memory/prepopulate.d.ts.map +1 -0
- package/dist/memory/prepopulate.js +815 -0
- package/dist/memory/prepopulate.js.map +1 -0
- package/dist/memory/short-term/factory.d.ts +23 -0
- package/dist/memory/short-term/factory.d.ts.map +1 -0
- package/dist/memory/short-term/factory.js +28 -0
- package/dist/memory/short-term/factory.js.map +1 -0
- package/dist/memory/short-term/indexeddb.d.ts +25 -0
- package/dist/memory/short-term/indexeddb.d.ts.map +1 -0
- package/dist/memory/short-term/indexeddb.js +64 -0
- package/dist/memory/short-term/indexeddb.js.map +1 -0
- package/dist/memory/short-term/sqlite.d.ts +40 -0
- package/dist/memory/short-term/sqlite.d.ts.map +1 -0
- package/dist/memory/short-term/sqlite.js +136 -0
- package/dist/memory/short-term/sqlite.js.map +1 -0
- package/dist/types/analysis.d.ts +82 -0
- package/dist/types/analysis.d.ts.map +1 -0
- package/dist/types/analysis.js +2 -0
- package/dist/types/analysis.js.map +1 -0
- package/dist/types/config.d.ts +923 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +97 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/merge-claude-md.d.ts +15 -0
- package/dist/utils/merge-claude-md.d.ts.map +1 -0
- package/dist/utils/merge-claude-md.js +149 -0
- package/dist/utils/merge-claude-md.js.map +1 -0
- package/package.json +90 -0
- package/templates/CLAUDE.template.md +632 -0
|
@@ -0,0 +1,643 @@
|
|
|
1
|
+
import Handlebars from 'handlebars';
|
|
2
|
+
export async function generateClaudeMd(analysis, config) {
|
|
3
|
+
const template = getTemplate(config);
|
|
4
|
+
const compiled = Handlebars.compile(template);
|
|
5
|
+
const context = buildContext(analysis, config);
|
|
6
|
+
return compiled(context);
|
|
7
|
+
}
|
|
8
|
+
function buildContext(analysis, config) {
|
|
9
|
+
// Detect web platform by checking memory config for web database setting
|
|
10
|
+
const hasWebDatabase = !!config.memory?.shortTerm?.webDatabase;
|
|
11
|
+
const forceDesktop = config.memory?.shortTerm?.forceDesktop;
|
|
12
|
+
const isWebPlatform = hasWebDatabase && !forceDesktop;
|
|
13
|
+
const isDesktopPlatform = !isWebPlatform;
|
|
14
|
+
// Determine long-term memory provider
|
|
15
|
+
let longTermProvider = 'qdrant';
|
|
16
|
+
let longTermEndpoint = config.memory?.longTerm?.endpoint || 'localhost:6333';
|
|
17
|
+
let longTermCollection = config.memory?.longTerm?.collection || 'agent_memory';
|
|
18
|
+
if (config.memory?.longTerm?.provider === 'github') {
|
|
19
|
+
longTermProvider = 'github';
|
|
20
|
+
longTermEndpoint = `${config.memory?.longTerm?.github?.repo || 'owner/repo'}/${config.memory?.longTerm?.github?.path || '.uam/memory'}`;
|
|
21
|
+
}
|
|
22
|
+
else if (config.memory?.longTerm?.provider === 'qdrant-cloud') {
|
|
23
|
+
longTermProvider = 'qdrant-cloud';
|
|
24
|
+
longTermEndpoint = config.memory?.longTerm?.qdrantCloud?.url || 'https://xxxxxx.aws.cloud.qdrant.io:6333';
|
|
25
|
+
}
|
|
26
|
+
// GitHub repo info for web memory
|
|
27
|
+
const githubRepo = config.memory?.longTerm?.github?.repo || '';
|
|
28
|
+
const githubMemoryPath = config.memory?.longTerm?.github?.path || '.uam/memory';
|
|
29
|
+
return {
|
|
30
|
+
PROJECT_NAME: analysis.projectName || config.project.name,
|
|
31
|
+
DESCRIPTION: analysis.description || config.project.description || '',
|
|
32
|
+
DEFAULT_BRANCH: analysis.defaultBranch || config.project.defaultBranch || 'main',
|
|
33
|
+
// Platform detection
|
|
34
|
+
IS_WEB_PLATFORM: isWebPlatform,
|
|
35
|
+
IS_DESKTOP_PLATFORM: isDesktopPlatform,
|
|
36
|
+
// Issue tracker
|
|
37
|
+
HAS_ISSUE_TRACKER: !!analysis.issueTracker,
|
|
38
|
+
ISSUE_TRACKER_NAME: analysis.issueTracker?.name || 'GitHub Issues',
|
|
39
|
+
ISSUE_TRACKER_URL: analysis.issueTracker?.url || '',
|
|
40
|
+
// Memory config - ALWAYS shown, differs by platform
|
|
41
|
+
SHORT_TERM_PATH: config.memory?.shortTerm?.path || './agents/data/memory/short_term.db',
|
|
42
|
+
SHORT_TERM_MAX_ENTRIES: config.memory?.shortTerm?.maxEntries || 50,
|
|
43
|
+
LONG_TERM_PROVIDER: longTermProvider,
|
|
44
|
+
LONG_TERM_ENDPOINT: longTermEndpoint,
|
|
45
|
+
LONG_TERM_COLLECTION: longTermCollection,
|
|
46
|
+
GITHUB_REPO: githubRepo,
|
|
47
|
+
GITHUB_MEMORY_PATH: githubMemoryPath,
|
|
48
|
+
HAS_GITHUB_MEMORY: !!githubRepo,
|
|
49
|
+
// Worktree config - ALWAYS enabled for desktop
|
|
50
|
+
WORKTREE_DIR: config.worktrees?.directory || '.worktrees',
|
|
51
|
+
WORKTREE_PREFIX: config.worktrees?.branchPrefix || 'feature/',
|
|
52
|
+
// URLs
|
|
53
|
+
URLS: analysis.urls,
|
|
54
|
+
HAS_URLS: analysis.urls.length > 0,
|
|
55
|
+
// Clusters
|
|
56
|
+
HAS_CLUSTERS: analysis.clusters?.enabled,
|
|
57
|
+
CLUSTERS: analysis.clusters?.contexts || [],
|
|
58
|
+
// Components
|
|
59
|
+
COMPONENTS: analysis.components,
|
|
60
|
+
HAS_COMPONENTS: analysis.components.length > 0,
|
|
61
|
+
// Commands
|
|
62
|
+
TEST_COMMAND: analysis.commands.test || 'npm test',
|
|
63
|
+
LINT_COMMAND: analysis.commands.lint || 'npm run lint',
|
|
64
|
+
BUILD_COMMAND: analysis.commands.build || 'npm run build',
|
|
65
|
+
// Infrastructure
|
|
66
|
+
INFRA_PATH: analysis.directories.infrastructure[0] || 'infra/',
|
|
67
|
+
HAS_TERRAFORM: analysis.infrastructure.iac === 'Terraform',
|
|
68
|
+
HAS_KUBERNETES: analysis.infrastructure.containerOrchestration === 'Kubernetes',
|
|
69
|
+
// Databases
|
|
70
|
+
DATABASES: analysis.databases,
|
|
71
|
+
HAS_DATABASES: analysis.databases.length > 0,
|
|
72
|
+
// Auth
|
|
73
|
+
HAS_AUTH: !!analysis.authentication,
|
|
74
|
+
AUTH_PROVIDER: analysis.authentication?.provider,
|
|
75
|
+
AUTH_DESCRIPTION: analysis.authentication?.description,
|
|
76
|
+
// CI/CD
|
|
77
|
+
HAS_CICD: !!analysis.ciCd,
|
|
78
|
+
CICD_PLATFORM: analysis.ciCd?.platform,
|
|
79
|
+
WORKFLOWS: analysis.ciCd?.workflows || [],
|
|
80
|
+
// Existing agents
|
|
81
|
+
DROIDS: analysis.existingDroids,
|
|
82
|
+
HAS_DROIDS: analysis.existingDroids.length > 0,
|
|
83
|
+
SKILLS: analysis.existingSkills,
|
|
84
|
+
HAS_SKILLS: analysis.existingSkills.length > 0,
|
|
85
|
+
COMMANDS: analysis.existingCommands,
|
|
86
|
+
HAS_COMMANDS: analysis.existingCommands.length > 0,
|
|
87
|
+
// Troubleshooting
|
|
88
|
+
TROUBLESHOOTING_HINTS: analysis.troubleshootingHints,
|
|
89
|
+
HAS_TROUBLESHOOTING: analysis.troubleshootingHints.length > 0,
|
|
90
|
+
// Key files
|
|
91
|
+
KEY_FILES: analysis.keyFiles,
|
|
92
|
+
HAS_KEY_FILES: analysis.keyFiles.length > 0,
|
|
93
|
+
// Security
|
|
94
|
+
SECURITY_NOTES: analysis.securityNotes,
|
|
95
|
+
HAS_SECURITY_NOTES: analysis.securityNotes.length > 0,
|
|
96
|
+
// Languages/Frameworks
|
|
97
|
+
LANGUAGES: analysis.languages.join(', '),
|
|
98
|
+
FRAMEWORKS: analysis.frameworks.join(', '),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function getTemplate(_config) {
|
|
102
|
+
return `<coding_guidelines>
|
|
103
|
+
|
|
104
|
+
# {{#if IS_WEB_PLATFORM}}AGENT.md{{else}}CLAUDE.md{{/if}} - {{PROJECT_NAME}} Development Guide
|
|
105
|
+
|
|
106
|
+
You are Autonomous Claude, a self-directed AI agent with full control over this environment. You operate continuously, making your own decisions.
|
|
107
|
+
{{#if DESCRIPTION}}
|
|
108
|
+
|
|
109
|
+
> {{DESCRIPTION}}
|
|
110
|
+
{{/if}}
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## ⛔ MANDATORY RULES - READ BEFORE ANY ACTION ⛔
|
|
115
|
+
|
|
116
|
+
**STOP! Before making ANY code/infrastructure changes, you MUST follow these rules:**
|
|
117
|
+
|
|
118
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
119
|
+
### 1. WORKTREE REQUIREMENT (NO EXCEPTIONS)
|
|
120
|
+
|
|
121
|
+
\`\`\`
|
|
122
|
+
❌ FORBIDDEN: Direct commits to {{DEFAULT_BRANCH}} branch
|
|
123
|
+
✅ REQUIRED: Create worktree → Make changes → Create PR → Merge via PR
|
|
124
|
+
\`\`\`
|
|
125
|
+
|
|
126
|
+
**Before ANY code change:**
|
|
127
|
+
|
|
128
|
+
\`\`\`bash
|
|
129
|
+
# Step 1: Create worktree
|
|
130
|
+
uam worktree create <descriptive-slug>
|
|
131
|
+
|
|
132
|
+
# Step 2: cd into worktree and make changes
|
|
133
|
+
cd {{WORKTREE_DIR}}/NNN-<slug>/
|
|
134
|
+
|
|
135
|
+
# Step 3: Commit and create PR
|
|
136
|
+
uam worktree pr <id>
|
|
137
|
+
\`\`\`
|
|
138
|
+
|
|
139
|
+
**Applies to:** All code, configs, workflows, documentation
|
|
140
|
+
{{else}}
|
|
141
|
+
### 1. BRANCH REQUIREMENT (NO EXCEPTIONS)
|
|
142
|
+
|
|
143
|
+
\`\`\`
|
|
144
|
+
❌ FORBIDDEN: Direct commits to {{DEFAULT_BRANCH}} branch
|
|
145
|
+
✅ REQUIRED: Create branch → Make changes → Create PR → Merge via PR
|
|
146
|
+
\`\`\`
|
|
147
|
+
|
|
148
|
+
**Before ANY code change:**
|
|
149
|
+
|
|
150
|
+
\`\`\`bash
|
|
151
|
+
git checkout -b {{WORKTREE_PREFIX}}<descriptive-slug>
|
|
152
|
+
# Make changes, commit, push
|
|
153
|
+
git push -u origin {{WORKTREE_PREFIX}}<descriptive-slug>
|
|
154
|
+
# Create PR via UI
|
|
155
|
+
\`\`\`
|
|
156
|
+
{{/if}}
|
|
157
|
+
|
|
158
|
+
### 2. MEMORY REQUIREMENT (AFTER SIGNIFICANT ACTIONS)
|
|
159
|
+
|
|
160
|
+
\`\`\`bash
|
|
161
|
+
# Store learnings after: fixes, discoveries, architecture decisions, gotchas
|
|
162
|
+
uam memory store lesson "What you learned" --tags tag1,tag2 --importance 7
|
|
163
|
+
\`\`\`
|
|
164
|
+
|
|
165
|
+
**Must store memories for:**
|
|
166
|
+
- Infrastructure changes (cost savings, scaling decisions, fixes)
|
|
167
|
+
- Bug fixes and their root causes
|
|
168
|
+
- Architecture decisions and rationale
|
|
169
|
+
- Gotchas and workarounds discovered
|
|
170
|
+
- Performance optimizations
|
|
171
|
+
|
|
172
|
+
### 3. TODO LIST REQUIREMENT
|
|
173
|
+
|
|
174
|
+
- Create todo list for multi-step tasks (3+ steps)
|
|
175
|
+
- Update status IMMEDIATELY after completing each item
|
|
176
|
+
- Never let todos go stale (update every 5-10 tool calls)
|
|
177
|
+
|
|
178
|
+
### 4. VERIFICATION BEFORE COMPLETION
|
|
179
|
+
|
|
180
|
+
- [ ] Used {{#if IS_DESKTOP_PLATFORM}}worktree{{else}}feature branch{{/if}} for code changes? (or explain why not applicable)
|
|
181
|
+
- [ ] Stored significant learnings in memory?
|
|
182
|
+
- [ ] Updated/completed todo list?
|
|
183
|
+
- [ ] Created PR instead of direct commit?
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## MEMORY SYSTEM
|
|
188
|
+
|
|
189
|
+
> **CRITICAL**: Memory updates are MANDATORY, not optional. Every significant discovery, fix, or lesson learned MUST be stored before completing a task.
|
|
190
|
+
|
|
191
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
192
|
+
### Short-term Memory (SQLite: \`{{SHORT_TERM_PATH}}\`)
|
|
193
|
+
|
|
194
|
+
Table: \`memories\`
|
|
195
|
+
- \`id\`: INTEGER PRIMARY KEY
|
|
196
|
+
- \`timestamp\`: TEXT (ISO8601)
|
|
197
|
+
- \`type\`: TEXT (action|observation|thought|goal)
|
|
198
|
+
- \`content\`: TEXT
|
|
199
|
+
|
|
200
|
+
**BEFORE EACH DECISION**: Query recent entries (last {{SHORT_TERM_MAX_ENTRIES}}) to understand context:
|
|
201
|
+
\`\`\`sql
|
|
202
|
+
SELECT * FROM memories ORDER BY id DESC LIMIT {{SHORT_TERM_MAX_ENTRIES}};
|
|
203
|
+
\`\`\`
|
|
204
|
+
|
|
205
|
+
**AFTER EACH ACTION**: Record what you did and the outcome:
|
|
206
|
+
\`\`\`sql
|
|
207
|
+
INSERT INTO memories (timestamp, type, content) VALUES (datetime('now'), 'action', 'Description...');
|
|
208
|
+
\`\`\`
|
|
209
|
+
|
|
210
|
+
### Long-term Memory ({{LONG_TERM_PROVIDER}}: \`{{LONG_TERM_ENDPOINT}}\`, collection: \`{{LONG_TERM_COLLECTION}}\`)
|
|
211
|
+
|
|
212
|
+
**Start services**: \`uam memory start\`
|
|
213
|
+
|
|
214
|
+
Vector schema:
|
|
215
|
+
- \`id\`: UUID
|
|
216
|
+
- \`vector\`: 384-dim embedding (all-MiniLM-L6-v2)
|
|
217
|
+
- \`payload\`: {type, tags[], content, importance (1-10), timestamp}
|
|
218
|
+
|
|
219
|
+
**Query memories** (semantic search):
|
|
220
|
+
\`\`\`bash
|
|
221
|
+
uam memory query "search term"
|
|
222
|
+
\`\`\`
|
|
223
|
+
|
|
224
|
+
**Store new memory** (MANDATORY for significant learnings):
|
|
225
|
+
\`\`\`bash
|
|
226
|
+
uam memory store <type> "content" --tags tag1,tag2 --importance N
|
|
227
|
+
\`\`\`
|
|
228
|
+
|
|
229
|
+
Memory types: \`fact\`, \`lesson\`, \`skill\`, \`discovery\`, \`preference\`
|
|
230
|
+
|
|
231
|
+
### MANDATORY Memory Triggers
|
|
232
|
+
|
|
233
|
+
**ALWAYS store to long-term memory when you:**
|
|
234
|
+
1. Fix a bug or resolve an error (lesson)
|
|
235
|
+
2. Discover how a system/component works (discovery)
|
|
236
|
+
3. Learn a configuration requirement (fact)
|
|
237
|
+
4. Find a successful approach to a problem (skill)
|
|
238
|
+
5. Identify a coding pattern or convention (preference)
|
|
239
|
+
6. Complete infrastructure changes (fact)
|
|
240
|
+
7. Debug authentication/networking issues (lesson)
|
|
241
|
+
|
|
242
|
+
**Memory storage is part of task completion.** A task is NOT complete until learnings are stored.
|
|
243
|
+
|
|
244
|
+
### Agent Services Setup
|
|
245
|
+
|
|
246
|
+
\`\`\`bash
|
|
247
|
+
# Start services (auto-creates collection and migrates memories)
|
|
248
|
+
uam memory start
|
|
249
|
+
|
|
250
|
+
# Check status
|
|
251
|
+
uam memory status
|
|
252
|
+
|
|
253
|
+
# Stop services
|
|
254
|
+
uam memory stop
|
|
255
|
+
\`\`\`
|
|
256
|
+
|
|
257
|
+
{{else}}
|
|
258
|
+
### Short-term Memory (localStorage)
|
|
259
|
+
|
|
260
|
+
You have access to browser localStorage for maintaining context across messages.
|
|
261
|
+
|
|
262
|
+
Key: \`agent_context_{{PROJECT_NAME}}\`
|
|
263
|
+
|
|
264
|
+
Structure:
|
|
265
|
+
\`\`\`json
|
|
266
|
+
{
|
|
267
|
+
"memories": [
|
|
268
|
+
{"timestamp": "ISO8601", "type": "action|observation|thought|goal", "content": "..."}
|
|
269
|
+
],
|
|
270
|
+
"maxEntries": {{SHORT_TERM_MAX_ENTRIES}}
|
|
271
|
+
}
|
|
272
|
+
\`\`\`
|
|
273
|
+
|
|
274
|
+
**BEFORE EACH DECISION**: Review recent memories for context
|
|
275
|
+
**AFTER EACH ACTION**: Add a memory describing what you did and the outcome
|
|
276
|
+
|
|
277
|
+
### Long-term Memory (GitHub: \`.uam/memory/\`)
|
|
278
|
+
|
|
279
|
+
Memories stored as JSON files in the project repository under \`.uam/memory/\`
|
|
280
|
+
|
|
281
|
+
File format: \`{YYYY-MM-DD}_{type}_{short-id}.json\`
|
|
282
|
+
\`\`\`json
|
|
283
|
+
{
|
|
284
|
+
"id": "uuid",
|
|
285
|
+
"timestamp": "ISO8601",
|
|
286
|
+
"type": "fact|lesson|skill|discovery|preference",
|
|
287
|
+
"content": "Learning or discovery",
|
|
288
|
+
"tags": ["tag1", "tag2"],
|
|
289
|
+
"importance": 8
|
|
290
|
+
}
|
|
291
|
+
\`\`\`
|
|
292
|
+
|
|
293
|
+
Memory types: \`fact\`, \`lesson\`, \`skill\`, \`discovery\`, \`preference\`
|
|
294
|
+
|
|
295
|
+
### MANDATORY Memory Triggers
|
|
296
|
+
|
|
297
|
+
**ALWAYS store to long-term memory when you:**
|
|
298
|
+
1. Fix a bug or resolve an error (lesson)
|
|
299
|
+
2. Discover how a system/component works (discovery)
|
|
300
|
+
3. Learn a configuration requirement (fact)
|
|
301
|
+
4. Find a successful approach to a problem (skill)
|
|
302
|
+
5. Identify a coding pattern or convention (preference)
|
|
303
|
+
6. Complete infrastructure changes (fact)
|
|
304
|
+
7. Debug authentication/networking issues (lesson)
|
|
305
|
+
|
|
306
|
+
**Memory storage is part of task completion.** A task is NOT complete until learnings are stored.
|
|
307
|
+
|
|
308
|
+
When you discover something significant, recommend the user commit a memory file to \`.uam/memory/\`.
|
|
309
|
+
{{/if}}
|
|
310
|
+
|
|
311
|
+
---
|
|
312
|
+
|
|
313
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
314
|
+
## BROWSER USAGE
|
|
315
|
+
|
|
316
|
+
When using browser automation:
|
|
317
|
+
|
|
318
|
+
- ALWAYS save a screenshot after EVERY browser action
|
|
319
|
+
- Save screenshots to: \`agents/data/screenshots/\`
|
|
320
|
+
- Filename format: \`{timestamp}_{action}.png\`
|
|
321
|
+
|
|
322
|
+
---
|
|
323
|
+
|
|
324
|
+
{{/if}}
|
|
325
|
+
## DECISION LOOP
|
|
326
|
+
|
|
327
|
+
1. **READ** short-term memory (recent context)
|
|
328
|
+
2. **QUERY** long-term memory (semantic search for relevant learnings)
|
|
329
|
+
3. **THINK** about what to do next
|
|
330
|
+
4. **ACT** - execute your decision
|
|
331
|
+
5. **RECORD** - write to short-term memory
|
|
332
|
+
6. **STORE** - add significant learnings to long-term memory (MANDATORY, not optional)
|
|
333
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
334
|
+
7. **IF BROWSER ACTION**: Save screenshot to \`/agents/data/screenshots/\`
|
|
335
|
+
{{/if}}
|
|
336
|
+
|
|
337
|
+
**Task Completion Checklist:**
|
|
338
|
+
- [ ] Short-term memory updated with action outcome
|
|
339
|
+
- [ ] Long-term memory updated with any lessons/discoveries/facts learned
|
|
340
|
+
- [ ] Tests pass (if code changes)
|
|
341
|
+
- [ ] Documentation updated (if applicable)
|
|
342
|
+
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
{{#if HAS_SKILLS}}
|
|
346
|
+
## SKILLS
|
|
347
|
+
|
|
348
|
+
You have access to reusable skills. Before attempting complex tasks:
|
|
349
|
+
|
|
350
|
+
1. Check if a skill exists for it (see \`.factory/skills/\`)
|
|
351
|
+
2. Follow the skill's patterns - they're tested and reliable
|
|
352
|
+
3. If you discover a better approach, consider creating/updating a skill
|
|
353
|
+
|
|
354
|
+
Available skills are auto-discovered. When you see a SKILL.md, follow its instructions.
|
|
355
|
+
|
|
356
|
+
{{#each SKILLS}}
|
|
357
|
+
- \`{{this}}\`
|
|
358
|
+
{{/each}}
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
{{/if}}
|
|
363
|
+
**MANDATORY WORKFLOW REQUIREMENTS**:
|
|
364
|
+
|
|
365
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
366
|
+
1. **Git Worktrees**: ALL code changes MUST use isolated git worktrees (\`{{WORKTREE_PREFIX}}NNN-slug\` branches)
|
|
367
|
+
2. **PR-Based Merges**: NO direct commits to \`{{DEFAULT_BRANCH}}\`. All changes via PR with automated review
|
|
368
|
+
3. **CI/CD Pipelines**: ALWAYS use CI/CD pipelines to deploy. Create ephemeral pipelines when needed
|
|
369
|
+
4. **Automated Review**: PRs require signoff from reviewer agents before merge
|
|
370
|
+
{{else}}
|
|
371
|
+
1. **Feature Branches**: ALL code changes MUST use isolated feature branches (\`{{WORKTREE_PREFIX}}description\`)
|
|
372
|
+
2. **PR-Based Merges**: NO direct commits to \`{{DEFAULT_BRANCH}}\`. All changes via PR
|
|
373
|
+
3. **Code Review**: PRs should be reviewed before merge
|
|
374
|
+
{{/if}}
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
## Quick Reference
|
|
380
|
+
|
|
381
|
+
{{#if HAS_CLUSTERS}}
|
|
382
|
+
### Cluster Contexts
|
|
383
|
+
|
|
384
|
+
\`\`\`bash
|
|
385
|
+
{{#each CLUSTERS}}
|
|
386
|
+
kubectl config use-context {{this.context}} # {{this.name}} ({{this.purpose}})
|
|
387
|
+
{{/each}}
|
|
388
|
+
\`\`\`
|
|
389
|
+
|
|
390
|
+
{{/if}}
|
|
391
|
+
{{#if HAS_URLS}}
|
|
392
|
+
### URLs
|
|
393
|
+
|
|
394
|
+
{{#each URLS}}
|
|
395
|
+
- **{{this.name}}**: {{this.value}}
|
|
396
|
+
{{/each}}
|
|
397
|
+
|
|
398
|
+
{{/if}}
|
|
399
|
+
{{#if HAS_KEY_FILES}}
|
|
400
|
+
### Key Files
|
|
401
|
+
|
|
402
|
+
{{#each KEY_FILES}}
|
|
403
|
+
- \`{{this.path}}\` - {{this.description}}
|
|
404
|
+
{{/each}}
|
|
405
|
+
|
|
406
|
+
{{/if}}
|
|
407
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
408
|
+
### Essential Commands
|
|
409
|
+
|
|
410
|
+
\`\`\`bash
|
|
411
|
+
# Create worktree for new task (MANDATORY for all changes)
|
|
412
|
+
uam worktree create <slug>
|
|
413
|
+
|
|
414
|
+
# Testing
|
|
415
|
+
{{TEST_COMMAND}}
|
|
416
|
+
|
|
417
|
+
# Linting
|
|
418
|
+
{{LINT_COMMAND}}
|
|
419
|
+
|
|
420
|
+
# Building
|
|
421
|
+
{{BUILD_COMMAND}}
|
|
422
|
+
{{#if HAS_TERRAFORM}}
|
|
423
|
+
|
|
424
|
+
# Terraform
|
|
425
|
+
cd {{INFRA_PATH}} && terraform plan
|
|
426
|
+
{{/if}}
|
|
427
|
+
\`\`\`
|
|
428
|
+
|
|
429
|
+
{{/if}}
|
|
430
|
+
---
|
|
431
|
+
|
|
432
|
+
{{#if HAS_COMPONENTS}}
|
|
433
|
+
## Architecture
|
|
434
|
+
|
|
435
|
+
{{#each COMPONENTS}}
|
|
436
|
+
### {{this.name}} (\`{{this.path}}\`)
|
|
437
|
+
|
|
438
|
+
- **Language**: {{this.language}}
|
|
439
|
+
{{#if this.framework}}- **Framework**: {{this.framework}}{{/if}}
|
|
440
|
+
- {{this.description}}
|
|
441
|
+
|
|
442
|
+
{{/each}}
|
|
443
|
+
---
|
|
444
|
+
|
|
445
|
+
{{/if}}
|
|
446
|
+
{{#if HAS_DATABASES}}
|
|
447
|
+
## Data Layer
|
|
448
|
+
|
|
449
|
+
{{#each DATABASES}}
|
|
450
|
+
- **{{this.type}}**: {{this.purpose}}
|
|
451
|
+
{{/each}}
|
|
452
|
+
|
|
453
|
+
---
|
|
454
|
+
|
|
455
|
+
{{/if}}
|
|
456
|
+
{{#if HAS_AUTH}}
|
|
457
|
+
## Authentication
|
|
458
|
+
|
|
459
|
+
**Provider**: {{AUTH_PROVIDER}}
|
|
460
|
+
|
|
461
|
+
{{AUTH_DESCRIPTION}}
|
|
462
|
+
|
|
463
|
+
---
|
|
464
|
+
|
|
465
|
+
{{/if}}
|
|
466
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
467
|
+
{{#if HAS_CICD}}
|
|
468
|
+
## CI/CD ({{CICD_PLATFORM}})
|
|
469
|
+
|
|
470
|
+
| Workflow | Purpose |
|
|
471
|
+
|----------|---------|
|
|
472
|
+
{{#each WORKFLOWS}}
|
|
473
|
+
| \`{{this.file}}\` | {{this.purpose}} |
|
|
474
|
+
{{/each}}
|
|
475
|
+
|
|
476
|
+
---
|
|
477
|
+
|
|
478
|
+
{{/if}}
|
|
479
|
+
{{/if}}
|
|
480
|
+
{{#if HAS_TROUBLESHOOTING}}
|
|
481
|
+
## Troubleshooting
|
|
482
|
+
|
|
483
|
+
| Symptom | Solution |
|
|
484
|
+
|---------|----------|
|
|
485
|
+
{{#each TROUBLESHOOTING_HINTS}}
|
|
486
|
+
| {{this.symptom}} | {{this.solution}} |
|
|
487
|
+
{{/each}}
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
{{/if}}
|
|
492
|
+
## Required Workflow (MANDATORY)
|
|
493
|
+
|
|
494
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
495
|
+
### Git Worktree Workflow (ALL Changes)
|
|
496
|
+
|
|
497
|
+
**Every code change MUST follow this workflow:**
|
|
498
|
+
|
|
499
|
+
\`\`\`
|
|
500
|
+
1. CREATE WORKTREE
|
|
501
|
+
uam worktree create <slug>
|
|
502
|
+
→ Creates {{WORKTREE_PREFIX}}NNN-slug branch in {{WORKTREE_DIR}}/NNN-slug/
|
|
503
|
+
|
|
504
|
+
2. DEVELOP
|
|
505
|
+
cd {{WORKTREE_DIR}}/NNN-slug/
|
|
506
|
+
→ Make changes, commit locally
|
|
507
|
+
|
|
508
|
+
3. CREATE PR (runs tests + triggers reviewers)
|
|
509
|
+
uam worktree pr <id>
|
|
510
|
+
→ Runs all offline tests (blocks if fail)
|
|
511
|
+
→ Pushes to origin
|
|
512
|
+
→ Creates PR with auto-generated description
|
|
513
|
+
→ Triggers reviewer agents
|
|
514
|
+
|
|
515
|
+
4. AUTOMATED REVIEW
|
|
516
|
+
→ Reviewer agents run in parallel (quality, security, performance, tests)
|
|
517
|
+
→ PR labeled: reviewer-approved OR needs-work
|
|
518
|
+
→ Auto-merge on approval
|
|
519
|
+
|
|
520
|
+
5. CLEANUP
|
|
521
|
+
uam worktree cleanup <id>
|
|
522
|
+
→ Removes worktree and deletes branch
|
|
523
|
+
\`\`\`
|
|
524
|
+
{{else}}
|
|
525
|
+
### Git Branch Workflow (ALL Changes)
|
|
526
|
+
|
|
527
|
+
**Every code change MUST follow this workflow:**
|
|
528
|
+
|
|
529
|
+
\`\`\`
|
|
530
|
+
1. CREATE BRANCH
|
|
531
|
+
git checkout -b {{WORKTREE_PREFIX}}<description>
|
|
532
|
+
→ Creates isolated feature branch
|
|
533
|
+
|
|
534
|
+
2. DEVELOP
|
|
535
|
+
→ Make changes, commit locally
|
|
536
|
+
→ Keep commits atomic and well-described
|
|
537
|
+
|
|
538
|
+
3. CREATE PR
|
|
539
|
+
git push -u origin {{WORKTREE_PREFIX}}<description>
|
|
540
|
+
→ Push to remote
|
|
541
|
+
→ Create PR via GitHub/GitLab UI
|
|
542
|
+
|
|
543
|
+
4. CODE REVIEW
|
|
544
|
+
→ Request review from team members
|
|
545
|
+
→ Address feedback
|
|
546
|
+
|
|
547
|
+
5. MERGE & CLEANUP
|
|
548
|
+
→ Merge PR after approval
|
|
549
|
+
→ Delete feature branch
|
|
550
|
+
\`\`\`
|
|
551
|
+
{{/if}}
|
|
552
|
+
|
|
553
|
+
### Before ANY Task
|
|
554
|
+
|
|
555
|
+
1. Read relevant docs in \`/docs\` and component folders
|
|
556
|
+
2. Check for known issues in troubleshooting section
|
|
557
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
558
|
+
3. **Create a worktree for your changes**
|
|
559
|
+
{{else}}
|
|
560
|
+
3. **Create a feature branch for your changes**
|
|
561
|
+
{{/if}}
|
|
562
|
+
|
|
563
|
+
### For Code Changes
|
|
564
|
+
|
|
565
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
566
|
+
1. **Create worktree**: \`uam worktree create <slug>\`
|
|
567
|
+
{{else}}
|
|
568
|
+
1. **Create branch**: \`git checkout -b {{WORKTREE_PREFIX}}<description>\`
|
|
569
|
+
{{/if}}
|
|
570
|
+
2. Update/create tests
|
|
571
|
+
3. Run \`{{TEST_COMMAND}}\`
|
|
572
|
+
4. Run linting and type checking
|
|
573
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
574
|
+
5. **Create PR**: \`uam worktree pr <id>\`
|
|
575
|
+
{{else}}
|
|
576
|
+
5. **Create PR**: Push branch and open PR
|
|
577
|
+
{{/if}}
|
|
578
|
+
|
|
579
|
+
{{#if HAS_TERRAFORM}}
|
|
580
|
+
### For Infrastructure Changes
|
|
581
|
+
|
|
582
|
+
{{#if IS_DESKTOP_PLATFORM}}
|
|
583
|
+
1. **Create worktree** for Terraform changes
|
|
584
|
+
{{else}}
|
|
585
|
+
1. **Create branch** for Terraform changes
|
|
586
|
+
{{/if}}
|
|
587
|
+
2. Update Terraform in \`{{INFRA_PATH}}\`
|
|
588
|
+
3. Update CI/CD workflows if needed
|
|
589
|
+
4. Run \`terraform plan\`
|
|
590
|
+
5. Update secrets via GitHub Actions (not locally)
|
|
591
|
+
6. **Create PR** with review
|
|
592
|
+
|
|
593
|
+
{{/if}}
|
|
594
|
+
### Before Completing
|
|
595
|
+
|
|
596
|
+
1. All tests pass
|
|
597
|
+
2. PR created and reviewed
|
|
598
|
+
3. Update relevant documentation
|
|
599
|
+
|
|
600
|
+
---
|
|
601
|
+
|
|
602
|
+
|
|
603
|
+
{{#if HAS_DROIDS}}
|
|
604
|
+
## Augmented Agent Capabilities
|
|
605
|
+
|
|
606
|
+
### Custom Droids (\`.factory/droids/\`)
|
|
607
|
+
|
|
608
|
+
{{#each DROIDS}}
|
|
609
|
+
- \`{{this}}\`
|
|
610
|
+
{{/each}}
|
|
611
|
+
|
|
612
|
+
{{#if HAS_COMMANDS}}
|
|
613
|
+
### Commands (\`.factory/commands/\`)
|
|
614
|
+
|
|
615
|
+
{{#each COMMANDS}}
|
|
616
|
+
- \`/{{this}}\`
|
|
617
|
+
{{/each}}
|
|
618
|
+
{{/if}}
|
|
619
|
+
|
|
620
|
+
---
|
|
621
|
+
|
|
622
|
+
{{/if}}
|
|
623
|
+
## Completion Checklist
|
|
624
|
+
|
|
625
|
+
\`\`\`
|
|
626
|
+
[ ] Tests updated and passing
|
|
627
|
+
[ ] Linting/type checking passed
|
|
628
|
+
{{#if HAS_TERRAFORM}}
|
|
629
|
+
[ ] Terraform plan verified (if infra changed)
|
|
630
|
+
{{/if}}
|
|
631
|
+
[ ] Documentation updated
|
|
632
|
+
[ ] No secrets in code/commits
|
|
633
|
+
\`\`\`
|
|
634
|
+
|
|
635
|
+
---
|
|
636
|
+
|
|
637
|
+
**Languages**: {{LANGUAGES}}
|
|
638
|
+
**Frameworks**: {{FRAMEWORKS}}
|
|
639
|
+
|
|
640
|
+
</coding_guidelines>
|
|
641
|
+
`;
|
|
642
|
+
}
|
|
643
|
+
//# sourceMappingURL=claude-md.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-md.js","sourceRoot":"","sources":["../../src/generators/claude-md.ts"],"names":[],"mappings":"AAAA,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2hBR,CAAC;AACF,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface MemoryEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
timestamp: string;
|
|
4
|
+
type: 'action' | 'observation' | 'thought' | 'goal';
|
|
5
|
+
content: string;
|
|
6
|
+
embedding?: number[];
|
|
7
|
+
tags?: string[];
|
|
8
|
+
importance?: number;
|
|
9
|
+
metadata?: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export interface MemoryBackend {
|
|
12
|
+
isConfigured(): Promise<boolean>;
|
|
13
|
+
store(entry: MemoryEntry): Promise<void>;
|
|
14
|
+
query(query: string, limit?: number): Promise<MemoryEntry[]>;
|
|
15
|
+
getRecent(limit?: number): Promise<MemoryEntry[]>;
|
|
16
|
+
prune(olderThan: Date): Promise<number>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/memory/backends/base.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,QAAQ,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAE5B,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAGjC,KAAK,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAGzC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAG7D,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAGlD,KAAK,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/memory/backends/base.ts"],"names":[],"mappings":""}
|