universal-agent-memory 4.4.3 → 4.5.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/dist/cli/generate.js +22 -7
- package/dist/cli/generate.js.map +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.template.md +63 -401
- package/templates/CLAUDE_ARCHITECTURE.template.md +103 -0
- package/templates/CLAUDE_CODING.template.md +125 -0
- package/templates/CLAUDE_DROIDS.template.md +109 -0
- package/templates/CLAUDE_MEMORY.template.md +130 -0
- package/templates/CLAUDE_WORKFLOWS.template.md +136 -0
package/dist/cli/generate.js
CHANGED
|
@@ -383,7 +383,7 @@ async function generatePlatformFiles(cwd, platform, analysis, config, dryRun) {
|
|
|
383
383
|
}
|
|
384
384
|
case 'opencode': {
|
|
385
385
|
// Generate opencode.json for OpenCode CLI
|
|
386
|
-
// OpenCode config only supports: $schema, provider, model,
|
|
386
|
+
// OpenCode config only supports: $schema, provider, model, agent (singular), mcp
|
|
387
387
|
// Project context (memory, git, commands) belongs in CLAUDE.md, not here
|
|
388
388
|
if (!dryRun) {
|
|
389
389
|
const opencodeConfigPath = join(cwd, 'opencode.json');
|
|
@@ -399,12 +399,27 @@ async function generatePlatformFiles(cwd, platform, analysis, config, dryRun) {
|
|
|
399
399
|
}
|
|
400
400
|
const opencodeConfig = {
|
|
401
401
|
$schema: 'https://opencode.ai/config.json',
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
402
|
+
provider: existingOpencodeConfig.provider ?? {
|
|
403
|
+
'llama.cpp': {
|
|
404
|
+
npm: '@ai-sdk/openai-compatible',
|
|
405
|
+
name: 'llama-server (local)',
|
|
406
|
+
options: {
|
|
407
|
+
baseURL: 'http://localhost:8080/v1',
|
|
408
|
+
apiKey: 'sk-qwen35b',
|
|
409
|
+
},
|
|
410
|
+
models: {
|
|
411
|
+
'qwen35-a3b-iq4xs': {
|
|
412
|
+
name: 'Qwen3.5 35B A3B (IQ4_XS)',
|
|
413
|
+
limit: { context: 262144, output: 16384 },
|
|
414
|
+
},
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
model: existingOpencodeConfig.model ?? 'llama.cpp/qwen35-a3b-iq4xs',
|
|
419
|
+
agent: (existingOpencodeConfig.agent ?? existingOpencodeConfig.agents) ?? {
|
|
420
|
+
build: { model: 'llama.cpp/qwen35-a3b-iq4xs', temperature: 0.1 },
|
|
421
|
+
plan: { model: 'llama.cpp/qwen35-a3b-iq4xs', temperature: 0.2 },
|
|
422
|
+
memory: { model: 'llama.cpp/qwen35-a3b-iq4xs', temperature: 0.0 },
|
|
408
423
|
},
|
|
409
424
|
...(existingOpencodeConfig.mcp ? { mcp: existingOpencodeConfig.mcp } : {}),
|
|
410
425
|
};
|
package/dist/cli/generate.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/cli/generate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAkB3E,SAAS,iBAAiB;IACxB,MAAM,MAAM,GAAqB;QAC/B,GAAG,EAAE,KAAK;QACV,MAAM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sB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,sBAAsB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;iBAC3E,CAAC;gBACF,aAAa,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7E,CAAC;YACD,MAAM;QACR,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "universal-agent-memory",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "Universal AI agent memory system - CLAUDE.md templates, memory, worktrees for Claude Code, Factory.AI, VSCode, OpenCode",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
CLAUDE.md Universal Template -
|
|
3
|
-
|
|
2
|
+
CLAUDE.md Universal Template - v12.0-modular
|
|
3
|
+
|
|
4
4
|
Core Variables:
|
|
5
5
|
{{PROJECT_NAME}}, {{DESCRIPTION}}, {{DEFAULT_BRANCH}}, {{STRUCTURE_DATE}}
|
|
6
6
|
|
|
7
7
|
Memory System:
|
|
8
|
-
{{MEMORY_DB_PATH}}, {{MEMORY_QUERY_CMD}}, {{MEMORY_STORE_CMD}},
|
|
9
|
-
{{
|
|
10
|
-
{{LONG_TERM_COLLECTION}}, {{SHORT_TERM_LIMIT}}
|
|
8
|
+
{{MEMORY_DB_PATH}}, {{MEMORY_QUERY_CMD}}, {{MEMORY_STORE_CMD}},
|
|
9
|
+
{{LONG_TERM_BACKEND}}, {{LONG_TERM_ENDPOINT}}, {{SHORT_TERM_LIMIT}}
|
|
11
10
|
|
|
12
11
|
Worktree:
|
|
13
12
|
{{WORKTREE_CREATE_CMD}}, {{WORKTREE_PR_CMD}}, {{WORKTREE_CLEANUP_CMD}},
|
|
14
|
-
{{WORKTREE_DIR}}
|
|
15
|
-
|
|
16
|
-
Paths:
|
|
17
|
-
{{SKILLS_PATH}}, {{DROIDS_PATH}}, {{COMMANDS_PATH}}, {{DOCS_PATH}}, {{SCREENSHOTS_PATH}},
|
|
18
|
-
{{DOCKER_COMPOSE_PATH}}
|
|
13
|
+
{{WORKTREE_DIR}}
|
|
19
14
|
|
|
20
15
|
Commands:
|
|
21
16
|
{{TEST_COMMAND}}, {{BUILD_COMMAND}}, {{LINT_COMMAND}}
|
|
22
17
|
|
|
23
|
-
Pattern RAG
|
|
18
|
+
Pattern RAG:
|
|
24
19
|
{{PATTERN_RAG_ENABLED}}, {{PATTERN_RAG_COLLECTION}}, {{PATTERN_RAG_QUERY_CMD}},
|
|
25
20
|
{{PATTERN_RAG_INDEX_CMD}}, {{PATTERN_RAG_TOP_K}}, {{PATTERN_RAG_THRESHOLD}}
|
|
26
|
-
-->
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
Modular Documentation:
|
|
23
|
+
CLAUDE_ARCHITECTURE.md - Cluster topology, IaC rules
|
|
24
|
+
CLAUDE_CODING.md - Coding standards, security
|
|
25
|
+
CLAUDE_WORKFLOWS.md - Task workflows, completion gates
|
|
26
|
+
CLAUDE_MEMORY.md - Memory system, Pattern RAG
|
|
27
|
+
CLAUDE_DROIDS.md - Available droids/skills
|
|
28
|
+
|
|
29
|
+
Patterns are dynamically retrieved from .factory/patterns/ via Pattern RAG.
|
|
30
|
+
-->
|
|
29
31
|
|
|
30
|
-
# {{PROJECT_NAME}} -
|
|
32
|
+
# {{PROJECT_NAME}} - Core Directives
|
|
31
33
|
|
|
32
34
|
{{#if DESCRIPTION}}
|
|
33
35
|
> {{DESCRIPTION}}
|
|
@@ -39,7 +41,7 @@
|
|
|
39
41
|
|
|
40
42
|
| Priority | Source | Override |
|
|
41
43
|
|----------|--------|----------|
|
|
42
|
-
| 1-HIGHEST | This
|
|
44
|
+
| 1-HIGHEST | This file | Never |
|
|
43
45
|
| 2-HIGH | Anthropic safety | Only by #1 |
|
|
44
46
|
| 3-MEDIUM | User instructions | By #1-2 |
|
|
45
47
|
| 4-LOW | Best practices | By #1-3 |
|
|
@@ -48,67 +50,11 @@
|
|
|
48
50
|
|
|
49
51
|
---
|
|
50
52
|
|
|
51
|
-
## CODE PRINCIPLES
|
|
52
|
-
|
|
53
|
-
- State assumptions before writing code
|
|
54
|
-
- Verify correctness -- do not claim it
|
|
55
|
-
- Handle error paths, not just the happy path
|
|
56
|
-
- Do not import complexity you do not need
|
|
57
|
-
- Produce code you would want to debug at 3am
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
{{#if HAS_INFRA}}
|
|
62
|
-
## INFRASTRUCTURE AS CODE POLICY - IaC PARITY REQUIRED
|
|
63
|
-
|
|
64
|
-
**Local testing is ALLOWED for proving solutions. IaC parity is MANDATORY before completion.**
|
|
65
|
-
|
|
66
|
-
### Critical: Secrets Are in GitHub
|
|
67
|
-
|
|
68
|
-
**ALL secrets are stored in GitHub Actions secrets.** Operations requiring secrets MUST use pipelines:
|
|
69
|
-
|
|
70
|
-
| If operation needs... | Use this pipeline |
|
|
71
|
-
|-----------------------|-------------------|
|
|
72
|
-
| Terraform with secrets | `iac-terraform-cicd.yml` or `ops-ephemeral-terraform.yml` |
|
|
73
|
-
| kubectl with secrets | `ops-approved-operations.yml` |
|
|
74
|
-
| One-time secret operation | `ops-create-ephemeral.yml` (self-destructs after run) |
|
|
75
|
-
|
|
76
|
-
### Two-Phase Infrastructure Workflow
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
PHASE 1: LOCAL PROOF (ALLOWED - NO SECRETS)
|
|
80
|
-
- kubectl get/describe/logs (read-only operations)
|
|
81
|
-
- terraform plan (uses GitHub pipeline for secrets)
|
|
82
|
-
- Direct cloud console changes for rapid prototyping
|
|
83
|
-
- SECRETS REQUIRED? -> Use pipeline, not local commands
|
|
84
|
-
|
|
85
|
-
PHASE 2: IaC PARITY (MANDATORY - VIA PIPELINE)
|
|
86
|
-
- Translate ALL manual changes to Terraform/Kubernetes YAML
|
|
87
|
-
- Commit IaC changes to feature branch
|
|
88
|
-
- Run terraform plan via pipeline (has secrets)
|
|
89
|
-
- Deploy via pipeline to confirm 100% match
|
|
90
|
-
- Delete any manual/ephemeral resources
|
|
91
|
-
- RULE: Work is NOT complete until IaC matches live state
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
### Approved Pipelines
|
|
95
|
-
|
|
96
|
-
| Task | Pipeline | Trigger |
|
|
97
|
-
|------|----------|---------|
|
|
98
|
-
| Kubernetes operations | `ops-approved-operations.yml` | Manual dispatch |
|
|
99
|
-
| Ephemeral environments | `ops-create-ephemeral.yml` | Manual dispatch |
|
|
100
|
-
| Terraform changes | `iac-terraform-cicd.yml` | PR to {{DEFAULT_BRANCH}} |
|
|
101
|
-
| Ephemeral Terraform | `ops-ephemeral-terraform.yml` | Manual dispatch |
|
|
102
|
-
{{/if}}
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
53
|
## SESSION START
|
|
107
54
|
|
|
108
55
|
```bash
|
|
109
56
|
uam task ready
|
|
110
57
|
sqlite3 ./{{MEMORY_DB_PATH}} "SELECT * FROM memories ORDER BY id DESC LIMIT 10;"
|
|
111
|
-
sqlite3 ./{{MEMORY_DB_PATH}} "SELECT * FROM session_memories WHERE session_id='current' ORDER BY id DESC LIMIT 5;"
|
|
112
58
|
uam agent status
|
|
113
59
|
```
|
|
114
60
|
|
|
@@ -119,311 +65,39 @@ uam agent status
|
|
|
119
65
|
## DECISION LOOP
|
|
120
66
|
|
|
121
67
|
```
|
|
122
|
-
1. CLASSIFY -> complexity? backup
|
|
123
|
-
2. PROTECT -> cp file file.bak (
|
|
124
|
-
3. MEMORY -> query
|
|
125
|
-
4.
|
|
126
|
-
5.
|
|
127
|
-
6.
|
|
128
|
-
7.
|
|
129
|
-
8. TEST -> completion gates pass
|
|
130
|
-
9. LEARN -> store outcome in memory
|
|
68
|
+
1. CLASSIFY -> complexity? backup? tools?
|
|
69
|
+
2. PROTECT -> cp file file.bak (configs, DBs)
|
|
70
|
+
3. MEMORY -> query context + past failures
|
|
71
|
+
4. WORK -> implement (ALWAYS use worktree)
|
|
72
|
+
5. REVIEW -> self-review diff
|
|
73
|
+
6. TEST -> completion gates pass
|
|
74
|
+
7. LEARN -> store outcome
|
|
131
75
|
```
|
|
132
76
|
|
|
133
77
|
---
|
|
134
78
|
|
|
135
|
-
##
|
|
79
|
+
## WORKTREE (MANDATORY)
|
|
136
80
|
|
|
137
|
-
|
|
138
|
-
L1 Working | SQLite memories | {{SHORT_TERM_LIMIT}} max | <1ms
|
|
139
|
-
L2 Session | SQLite session_mem | current session | <5ms
|
|
140
|
-
L3 Semantic | {{LONG_TERM_BACKEND}}| search | ~50ms
|
|
141
|
-
L4 Knowledge| SQLite entities/rels | graph | <20ms
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### Commands
|
|
81
|
+
**ALL file changes require a worktree.** No exceptions.
|
|
145
82
|
|
|
146
83
|
```bash
|
|
147
|
-
|
|
148
|
-
sqlite3 ./{{MEMORY_DB_PATH}} "INSERT INTO memories (timestamp,type,content) VALUES (datetime('now'),'action','...');"
|
|
149
|
-
|
|
150
|
-
# L2: Session Memory
|
|
151
|
-
sqlite3 ./{{MEMORY_DB_PATH}} "INSERT INTO session_memories (session_id,timestamp,type,content,importance) VALUES ('current',datetime('now'),'decision','...',7);"
|
|
152
|
-
|
|
153
|
-
# L3: Semantic Memory
|
|
154
|
-
{{MEMORY_STORE_CMD}} lesson "..." --tags t1,t2 --importance 8
|
|
155
|
-
|
|
156
|
-
# L4: Knowledge Graph
|
|
157
|
-
sqlite3 ./{{MEMORY_DB_PATH}} "INSERT INTO entities (type,name,first_seen,last_seen,mention_count) VALUES ('file','x.ts',datetime('now'),datetime('now'),1);"
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Decay: `effective_importance = importance * (0.95 ^ days_since_access)`
|
|
161
|
-
|
|
162
|
-
{{#if PATTERN_RAG_ENABLED}}
|
|
163
|
-
### Pattern RAG (On-Demand)
|
|
164
|
-
|
|
165
|
-
Patterns are retrieved dynamically from the `{{PATTERN_RAG_COLLECTION}}` Qdrant collection instead of being embedded statically. Top-{{PATTERN_RAG_TOP_K}} relevant patterns are injected per task (score >= {{PATTERN_RAG_THRESHOLD}}).
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
{{PATTERN_RAG_QUERY_CMD}} "task description" # Query relevant patterns
|
|
169
|
-
{{PATTERN_RAG_INDEX_CMD}} # Re-index after CLAUDE.md changes
|
|
170
|
-
uam patterns status # Check collection status
|
|
171
|
-
```
|
|
172
|
-
{{/if}}
|
|
173
|
-
|
|
174
|
-
{{#if RELEVANT_PATTERNS}}
|
|
175
|
-
{{#unless PATTERN_RAG_ENABLED}}
|
|
176
|
-
### Active Patterns
|
|
177
|
-
|
|
178
|
-
{{{RELEVANT_PATTERNS}}}
|
|
179
|
-
{{/unless}}
|
|
180
|
-
{{/if}}
|
|
181
|
-
|
|
182
|
-
---
|
|
183
|
-
|
|
184
|
-
## WORKTREE WORKFLOW — MANDATORY
|
|
185
|
-
|
|
186
|
-
> **MANDATORY**: ALL file changes MUST use a worktree. No exceptions. Never commit directly to any branch without a worktree. After PR is merged, worktree cleanup is MANDATORY — never leave stale worktrees.
|
|
187
|
-
|
|
188
|
-
| Change Scope | Workflow |
|
|
189
|
-
|-------------|----------|
|
|
190
|
-
| ANY file change (even single-file) | **Worktree REQUIRED** |
|
|
191
|
-
|
|
192
|
-
```bash
|
|
193
|
-
{{WORKTREE_CREATE_CMD}} <slug> # ALWAYS create first
|
|
84
|
+
{{WORKTREE_CREATE_CMD}} <slug>
|
|
194
85
|
cd {{WORKTREE_DIR}}/NNN-<slug>/
|
|
195
86
|
git add -A && git commit -m "type: description"
|
|
196
|
-
{{WORKTREE_PR_CMD}} <id>
|
|
197
|
-
# After
|
|
198
|
-
{{WORKTREE_CLEANUP_CMD}} <id>
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
**Applies to**: {{WORKTREE_APPLIES_TO}} — ALL changes without exception
|
|
202
|
-
|
|
203
|
-
**Cleanup is MANDATORY**: After every PR merge, immediately run `{{WORKTREE_CLEANUP_CMD}} <id>`. Never leave merged worktrees behind.
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## MULTI-AGENT COORDINATION
|
|
208
|
-
|
|
209
|
-
**Skip for single-agent sessions.** Only activate when multiple agents work concurrently.
|
|
210
|
-
|
|
211
|
-
```bash
|
|
212
|
-
uam agent overlaps --resource "<files-or-directories>"
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
| Risk Level | Action |
|
|
216
|
-
|------------|--------|
|
|
217
|
-
| `none` | Proceed immediately |
|
|
218
|
-
| `low` | Proceed, note merge order |
|
|
219
|
-
| `medium` | Announce, coordinate sections |
|
|
220
|
-
| `high`/`critical` | Wait or split work |
|
|
221
|
-
|
|
222
|
-
### Agent Routing
|
|
223
|
-
|
|
224
|
-
| Task Type | Route To |
|
|
225
|
-
|-----------|----------|
|
|
226
|
-
| Security review | `security-auditor` |
|
|
227
|
-
| Performance | `performance-optimizer` |
|
|
228
|
-
| Documentation | `documentation-expert` |
|
|
229
|
-
| Code quality | `code-quality-guardian` |
|
|
230
|
-
|
|
231
|
-
{{#if LANGUAGE_DROIDS}}
|
|
232
|
-
### Language Droids
|
|
233
|
-
| Droid | Purpose |
|
|
234
|
-
|-------|---------|
|
|
235
|
-
{{{LANGUAGE_DROIDS}}}
|
|
236
|
-
{{/if}}
|
|
237
|
-
|
|
238
|
-
{{#if MCP_PLUGINS}}
|
|
239
|
-
### MCP Plugins
|
|
240
|
-
| Plugin | Purpose |
|
|
241
|
-
|--------|---------|
|
|
242
|
-
{{{MCP_PLUGINS}}}
|
|
243
|
-
{{/if}}
|
|
244
|
-
|
|
245
|
-
### Parallel Execution
|
|
246
|
-
|
|
247
|
-
When safe, run independent tool calls in parallel. When using parallel subagents:
|
|
248
|
-
1. Decompose into discrete work items. Map dependencies.
|
|
249
|
-
2. Parallelize dependency-free items with separate agents and explicit file boundaries.
|
|
250
|
-
3. Gate edits with `uam agent overlaps` before touching any file.
|
|
251
|
-
4. Merge in dependency order (upstream first).
|
|
252
|
-
|
|
253
|
-
---
|
|
254
|
-
|
|
255
|
-
## PARALLEL REVIEW PROTOCOL
|
|
256
|
-
|
|
257
|
-
**Before ANY commit/PR, invoke quality droids in PARALLEL:**
|
|
258
|
-
|
|
259
|
-
```bash
|
|
260
|
-
Task(subagent_type: "code-quality-guardian", prompt: "Review: <files>")
|
|
261
|
-
Task(subagent_type: "security-auditor", prompt: "Audit: <files>")
|
|
262
|
-
Task(subagent_type: "performance-optimizer", prompt: "Analyze: <files>")
|
|
263
|
-
Task(subagent_type: "documentation-expert", prompt: "Check: <files>")
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
| Droid | Blocks PR | Fix Before Merge |
|
|
267
|
-
|-------|-----------|------------------|
|
|
268
|
-
| security-auditor | CRITICAL/HIGH | Always |
|
|
269
|
-
| code-quality-guardian | CRITICAL only | CRITICAL |
|
|
270
|
-
| performance-optimizer | Advisory | Optional |
|
|
271
|
-
| documentation-expert | Advisory | Optional |
|
|
272
|
-
|
|
273
|
-
---
|
|
274
|
-
|
|
275
|
-
## CODE QUALITY
|
|
276
|
-
|
|
277
|
-
### Pre-Commit Checklist
|
|
278
|
-
- Functions <= 30 lines
|
|
279
|
-
- Self-documenting names
|
|
280
|
-
- Error paths handled explicitly
|
|
281
|
-
- No debug prints or commented-out code left behind
|
|
282
|
-
- Consistent with surrounding code style
|
|
283
|
-
- No hardcoded values that should be constants
|
|
284
|
-
- Imports are minimal
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
## AUTOMATIC TRIGGERS
|
|
289
|
-
|
|
290
|
-
| Pattern | Action |
|
|
291
|
-
|---------|--------|
|
|
292
|
-
| work request (fix/add/change/update/create/implement/build) | `uam task create --type task` |
|
|
293
|
-
| bug report/error | `uam task create --type bug` |
|
|
294
|
-
| feature request | `uam task create --type feature` |
|
|
295
|
-
| ANY file change | **create worktree (MANDATORY)** |
|
|
296
|
-
| review/check/look | query memory first |
|
|
297
|
-
| ANY code change | tests required |
|
|
298
|
-
|
|
299
|
-
---
|
|
300
|
-
|
|
301
|
-
## UAM VISUAL STATUS FEEDBACK
|
|
302
|
-
|
|
303
|
-
**When UAM tools are in use, show visual feedback:**
|
|
304
|
-
|
|
305
|
-
```bash
|
|
306
|
-
uam dashboard overview # Full overview at session start
|
|
307
|
-
uam dashboard progress # After task operations
|
|
308
|
-
uam task stats # After task state changes
|
|
309
|
-
uam memory status # After memory operations
|
|
310
|
-
uam dashboard agents # After agent/coordination operations
|
|
87
|
+
{{WORKTREE_PR_CMD}} <id>
|
|
88
|
+
# After merge:
|
|
89
|
+
{{WORKTREE_CLEANUP_CMD}} <id> # MANDATORY
|
|
311
90
|
```
|
|
312
91
|
|
|
313
92
|
---
|
|
314
93
|
|
|
315
|
-
|
|
316
|
-
{{> PROJECT}}
|
|
317
|
-
{{else}}
|
|
318
|
-
## REPOSITORY STRUCTURE
|
|
319
|
-
|
|
320
|
-
```
|
|
321
|
-
{{PROJECT_NAME}}/
|
|
322
|
-
{{{REPOSITORY_STRUCTURE}}}
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
{{#if ARCHITECTURE_OVERVIEW}}
|
|
326
|
-
## Architecture
|
|
327
|
-
{{{ARCHITECTURE_OVERVIEW}}}
|
|
328
|
-
{{/if}}
|
|
329
|
-
|
|
330
|
-
{{#if CORE_COMPONENTS}}
|
|
331
|
-
## Components
|
|
332
|
-
{{{CORE_COMPONENTS}}}
|
|
333
|
-
{{/if}}
|
|
334
|
-
|
|
335
|
-
{{#if AUTH_FLOW}}
|
|
336
|
-
## Authentication
|
|
337
|
-
{{{AUTH_FLOW}}}
|
|
338
|
-
{{/if}}
|
|
339
|
-
|
|
340
|
-
{{#if CLUSTER_CONTEXTS}}
|
|
341
|
-
## Quick Reference
|
|
94
|
+
## COMPLETION GATES
|
|
342
95
|
|
|
343
|
-
|
|
344
|
-
```bash
|
|
345
|
-
{{{CLUSTER_CONTEXTS}}}
|
|
346
|
-
```
|
|
347
|
-
{{/if}}
|
|
96
|
+
**CANNOT say "done" until ALL pass:**
|
|
348
97
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
{{{KEY_WORKFLOWS}}}
|
|
353
|
-
```
|
|
354
|
-
{{/if}}
|
|
355
|
-
|
|
356
|
-
{{#if ESSENTIAL_COMMANDS}}
|
|
357
|
-
### Commands
|
|
358
|
-
```bash
|
|
359
|
-
{{{ESSENTIAL_COMMANDS}}}
|
|
360
|
-
```
|
|
361
|
-
{{/if}}
|
|
362
|
-
{{/if}}
|
|
363
|
-
|
|
364
|
-
---
|
|
365
|
-
|
|
366
|
-
{{#if HAS_INFRA}}
|
|
367
|
-
## Infrastructure Workflow
|
|
368
|
-
|
|
369
|
-
{{{INFRA_WORKFLOW}}}
|
|
370
|
-
{{/if}}
|
|
371
|
-
|
|
372
|
-
## Testing Requirements
|
|
373
|
-
1. Create worktree
|
|
374
|
-
2. Update/create tests
|
|
375
|
-
3. Run `{{TEST_COMMAND}}`
|
|
376
|
-
4. Run linting
|
|
377
|
-
5. Create PR
|
|
378
|
-
|
|
379
|
-
---
|
|
380
|
-
|
|
381
|
-
{{#if TROUBLESHOOTING}}
|
|
382
|
-
## Troubleshooting
|
|
383
|
-
{{{TROUBLESHOOTING}}}
|
|
384
|
-
{{/if}}
|
|
385
|
-
|
|
386
|
-
{{#if KEY_CONFIG_FILES}}
|
|
387
|
-
## Config Files
|
|
388
|
-
| File | Purpose |
|
|
389
|
-
|------|---------|
|
|
390
|
-
{{{KEY_CONFIG_FILES}}}
|
|
391
|
-
{{/if}}
|
|
392
|
-
|
|
393
|
-
---
|
|
394
|
-
|
|
395
|
-
## COMMANDS
|
|
396
|
-
|
|
397
|
-
```bash
|
|
398
|
-
{{TEST_COMMAND}} # Tests
|
|
399
|
-
{{BUILD_COMMAND}} # Build
|
|
400
|
-
{{LINT_COMMAND}} # Lint
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
**Paths:** Memory: `{{MEMORY_DB_PATH}}` | Skills: `{{SKILLS_PATH}}` | Droids: `{{DROIDS_PATH}}`
|
|
404
|
-
|
|
405
|
-
---
|
|
406
|
-
|
|
407
|
-
## COMPLETION GATES - MANDATORY
|
|
408
|
-
|
|
409
|
-
**CANNOT say "done" until ALL gates pass.**
|
|
410
|
-
|
|
411
|
-
### GATE 1: Output Existence
|
|
412
|
-
```bash
|
|
413
|
-
for f in $EXPECTED_OUTPUTS; do
|
|
414
|
-
[ -f "$f" ] && echo "ok $f" || echo "MISSING: $f"
|
|
415
|
-
done
|
|
416
|
-
```
|
|
417
|
-
If missing: CREATE IT immediately.
|
|
418
|
-
|
|
419
|
-
### GATE 2: Constraint Compliance
|
|
420
|
-
Extract ALL constraints from task ("exactly", "only", "single", "must be", "no more than"). Verify EACH.
|
|
421
|
-
|
|
422
|
-
### GATE 3: Tests Pass
|
|
423
|
-
```bash
|
|
424
|
-
{{TEST_COMMAND}} 2>&1 | tail -30
|
|
425
|
-
```
|
|
426
|
-
If < 100%: iterate (fix specific failure, re-run). Reserve 20% of time for iteration.
|
|
98
|
+
1. **Output Existence** - All expected files exist
|
|
99
|
+
2. **Constraint Compliance** - All constraints verified
|
|
100
|
+
3. **Tests Pass** - `{{TEST_COMMAND}}` 100%
|
|
427
101
|
|
|
428
102
|
---
|
|
429
103
|
|
|
@@ -431,63 +105,51 @@ If < 100%: iterate (fix specific failure, re-run). Reserve 20% of time for itera
|
|
|
431
105
|
|
|
432
106
|
```
|
|
433
107
|
☐ Tests pass
|
|
434
|
-
☐ Lint
|
|
435
|
-
☐ Worktree used
|
|
436
|
-
☐
|
|
437
|
-
☐ Self-review completed
|
|
108
|
+
☐ Lint pass
|
|
109
|
+
☐ Worktree used + cleaned up
|
|
110
|
+
☐ Self-reviewed
|
|
438
111
|
☐ Memory updated
|
|
439
112
|
☐ PR created
|
|
440
|
-
☐
|
|
113
|
+
☐ Reviews passed
|
|
441
114
|
{{#if HAS_INFRA}}
|
|
442
115
|
☐ IaC parity verified
|
|
443
116
|
{{/if}}
|
|
444
117
|
☐ No secrets in code
|
|
445
|
-
☐ No debug artifacts left
|
|
446
118
|
```
|
|
447
119
|
|
|
448
120
|
---
|
|
449
121
|
|
|
450
|
-
##
|
|
122
|
+
## QUICK REFERENCE
|
|
451
123
|
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
124
|
+
| Commands | |
|
|
125
|
+
|----------|-|
|
|
126
|
+
| Tests | `{{TEST_COMMAND}}` |
|
|
127
|
+
| Build | `{{BUILD_COMMAND}}` |
|
|
128
|
+
| Lint | `{{LINT_COMMAND}}` |
|
|
455
129
|
|
|
456
|
-
|
|
130
|
+
| Paths | |
|
|
131
|
+
|-------|-|
|
|
132
|
+
| Memory | `{{MEMORY_DB_PATH}}` |
|
|
133
|
+
| Patterns | `.factory/patterns/` |
|
|
134
|
+
| Droids | `.factory/droids/` |
|
|
135
|
+
| Skills | `.factory/skills/` |
|
|
457
136
|
|
|
458
137
|
---
|
|
459
138
|
|
|
460
|
-
|
|
461
|
-
## PROJECT KNOWLEDGE
|
|
462
|
-
|
|
463
|
-
{{#if RECENT_ACTIVITY}}
|
|
464
|
-
### Recent Activity
|
|
465
|
-
{{{RECENT_ACTIVITY}}}
|
|
466
|
-
{{/if}}
|
|
139
|
+
## KEY MODULES
|
|
467
140
|
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
{{#if KNOWN_GOTCHAS}}
|
|
474
|
-
### Gotchas
|
|
475
|
-
{{{KNOWN_GOTCHAS}}}
|
|
476
|
-
{{/if}}
|
|
477
|
-
|
|
478
|
-
{{#if HOT_SPOTS}}
|
|
479
|
-
### Hot Spots
|
|
480
|
-
{{{HOT_SPOTS}}}
|
|
481
|
-
{{/if}}
|
|
482
|
-
{{/if}}
|
|
141
|
+
- `CLAUDE_ARCHITECTURE.md` - Cluster topology, IaC rules
|
|
142
|
+
- `CLAUDE_CODING.md` - Security, multi-tenancy, testing
|
|
143
|
+
- `CLAUDE_WORKFLOWS.md` - Workflows, parallel review
|
|
144
|
+
- `CLAUDE_MEMORY.md` - Pattern RAG, reinforcement learning
|
|
145
|
+
- `CLAUDE_DROIDS.md` - Droid routing, skills
|
|
483
146
|
|
|
484
147
|
---
|
|
485
148
|
|
|
486
|
-
##
|
|
487
|
-
|
|
488
|
-
- Prefer concise, high-signal responses
|
|
489
|
-
- Summarize command output; quote only decision-relevant lines
|
|
490
|
-
- Use parallel tool calls to reduce back-and-forth
|
|
491
|
-
- Check `{{SKILLS_PATH}}` for domain-specific skills before re-inventing approaches
|
|
149
|
+
## CODE PRINCIPLES
|
|
492
150
|
|
|
493
|
-
|
|
151
|
+
- State assumptions before writing
|
|
152
|
+
- Verify correctness, don't claim it
|
|
153
|
+
- Handle error paths, not just happy path
|
|
154
|
+
- Don't import complexity you don't need
|
|
155
|
+
- Produce code you'd debug at 3am
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Architecture Guide Template
|
|
2
|
+
|
|
3
|
+
**Version**: {{VERSION}}
|
|
4
|
+
**Branch**: {{DEFAULT_BRANCH}}
|
|
5
|
+
**Last Updated**: {{STRUCTURE_DATE}}
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Cluster Topology
|
|
10
|
+
|
|
11
|
+
{{#if HAS_MULTI_CLUSTER}}
|
|
12
|
+
This project operates multiple dedicated clusters - **one concern per cluster**.
|
|
13
|
+
|
|
14
|
+
| Cluster | Context | Purpose | Services |
|
|
15
|
+
|---------|---------|---------|----------|
|
|
16
|
+
{{#each CLUSTERS}}
|
|
17
|
+
| **{{name}}** | `{{context}}` | {{purpose}} | {{services}} |
|
|
18
|
+
{{/each}}
|
|
19
|
+
{{else}}
|
|
20
|
+
Single cluster deployment.
|
|
21
|
+
|
|
22
|
+
### Cluster Commands
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
kubectl config use-context {{MAIN_CLUSTER_CONTEXT}}
|
|
26
|
+
```
|
|
27
|
+
{{/if}}
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Cross-Cluster Communication Rules
|
|
32
|
+
|
|
33
|
+
{{#if HAS_MULTI_CLUSTER}}
|
|
34
|
+
**CRITICAL**: Always use public HTTPS URLs for cross-cluster communication.
|
|
35
|
+
|
|
36
|
+
### Do's and Don'ts
|
|
37
|
+
|
|
38
|
+
| ✅ DO | ❌ DON'T |
|
|
39
|
+
|-------|----------|
|
|
40
|
+
| Use public HTTPS URLs | Use cluster-internal DNS across clusters |
|
|
41
|
+
| Use service accounts for auth | Use internal IPs for cross-cluster |
|
|
42
|
+
|
|
43
|
+
### Whitelisted URLs
|
|
44
|
+
{{#each WHITELISTED_URLS}}
|
|
45
|
+
- `{{this}}`
|
|
46
|
+
{{/each}}
|
|
47
|
+
{{/if}}
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Technology Stack
|
|
52
|
+
|
|
53
|
+
| Layer | Technology | Version |
|
|
54
|
+
|-------|------------|---------|
|
|
55
|
+
{{#each TECH_STACK}}
|
|
56
|
+
| **{{layer}}** | {{technology}} | {{version}} |
|
|
57
|
+
{{/each}}
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## High Availability
|
|
62
|
+
|
|
63
|
+
| Component | Configuration |
|
|
64
|
+
|-----------|---------------|
|
|
65
|
+
{{#each HA_CONFIG}}
|
|
66
|
+
| **{{component}}** | {{configuration}} |
|
|
67
|
+
{{/each}}
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Infrastructure as Code Policy
|
|
72
|
+
|
|
73
|
+
### Two-Phase Infrastructure Workflow
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
PHASE 1: LOCAL PROOF (ALLOWED - NO SECRETS)
|
|
77
|
+
- Read-only operations
|
|
78
|
+
- terraform plan (via pipeline for secrets)
|
|
79
|
+
|
|
80
|
+
PHASE 2: IaC PARITY (MANDATORY - VIA PIPELINE)
|
|
81
|
+
- Translate manual changes to Terraform/K8s YAML
|
|
82
|
+
- Deploy via pipeline
|
|
83
|
+
- Delete manual/ephemeral resources
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Secrets
|
|
87
|
+
|
|
88
|
+
**ALL secrets are stored in GitHub Actions secrets.** Operations requiring secrets MUST use pipelines.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Service URLs
|
|
93
|
+
|
|
94
|
+
{{#each SERVICE_URLS}}
|
|
95
|
+
| {{name}} | {{url}} |
|
|
96
|
+
{{/each}}
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## See Also
|
|
101
|
+
|
|
102
|
+
- `docs/ARCHITECTURE-OVERVIEW.md` - Detailed architecture
|
|
103
|
+
- `.factory/compliance_rules.yaml` - Architecture constraints (if applicable)
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# Coding Standards Template
|
|
2
|
+
|
|
3
|
+
**Version**: 1.0
|
|
4
|
+
**Last Updated**: {{STRUCTURE_DATE}}
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Core Principles
|
|
9
|
+
|
|
10
|
+
1. **State assumptions** before writing code
|
|
11
|
+
2. **Verify correctness** -- do not claim it
|
|
12
|
+
3. **Handle error paths**, not just the happy path
|
|
13
|
+
4. **Do not import complexity** you do not need
|
|
14
|
+
5. **Produce code you would want to debug at 3am**
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Pre-Commit Checklist
|
|
19
|
+
|
|
20
|
+
- [ ] Functions <= 30 lines
|
|
21
|
+
- [ ] Self-documenting names
|
|
22
|
+
- [ ] Error paths handled explicitly
|
|
23
|
+
- [ ] No debug prints or commented-out code
|
|
24
|
+
- [ ] Consistent with surrounding code style
|
|
25
|
+
- [ ] No hardcoded values that should be constants
|
|
26
|
+
- [ ] Imports are minimal
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
{{#if HAS_MULTI_TENANCY}}
|
|
31
|
+
## Multi-Tenancy
|
|
32
|
+
|
|
33
|
+
All database queries must include organization scope.
|
|
34
|
+
|
|
35
|
+
### Correct Patterns
|
|
36
|
+
|
|
37
|
+
```sql
|
|
38
|
+
-- ✅ Organization-scoped query
|
|
39
|
+
SELECT * FROM products WHERE owner_id = $1;
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Incorrect Patterns
|
|
43
|
+
|
|
44
|
+
```sql
|
|
45
|
+
-- ❌ Cross-tenant access
|
|
46
|
+
SELECT * FROM products;
|
|
47
|
+
```
|
|
48
|
+
{{/if}}
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Security
|
|
53
|
+
|
|
54
|
+
### Secrets
|
|
55
|
+
|
|
56
|
+
Never hardcode secrets. Use environment variables.
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
// ✅ Correct
|
|
60
|
+
const dbPassword = process.env.DB_PASSWORD;
|
|
61
|
+
|
|
62
|
+
// ❌ Wrong
|
|
63
|
+
const dbPassword = "hardcoded_password";
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Input Validation
|
|
67
|
+
|
|
68
|
+
Always validate and sanitize inputs.
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// ✅ Parameterized queries
|
|
72
|
+
db.query('SELECT * FROM users WHERE id = $1', [userId]);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Error Handling
|
|
78
|
+
|
|
79
|
+
Log with context for debugging.
|
|
80
|
+
|
|
81
|
+
```typescript
|
|
82
|
+
// ✅ Correct
|
|
83
|
+
logger.error('Failed to fetch', {
|
|
84
|
+
error: error.message,
|
|
85
|
+
correlationId: req.id
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Testing
|
|
92
|
+
|
|
93
|
+
### Running Tests
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
{{TEST_COMMAND}}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Code Quality Tools
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
{{LINT_COMMAND}}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Naming Conventions
|
|
110
|
+
|
|
111
|
+
| Type | Convention | Example |
|
|
112
|
+
|------|------------|---------|
|
|
113
|
+
| Variables | camelCase | `userName` |
|
|
114
|
+
| Constants | SCREAMING_SNAKE_CASE | `MAX_RETRY_COUNT` |
|
|
115
|
+
| Functions | camelCase | `getUserById` |
|
|
116
|
+
| Classes | PascalCase | `UserService` |
|
|
117
|
+
| Files | kebab-case | `user-service.ts` |
|
|
118
|
+
| Database | snake_case | `user_accounts` |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## See Also
|
|
123
|
+
|
|
124
|
+
- `CLAUDE_WORKFLOWS.md` - Task workflows and testing
|
|
125
|
+
- `.factory/skills/code-reviewer/` - Code review checklists (if applicable)
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Droids and Skills Guide Template
|
|
2
|
+
|
|
3
|
+
**Version**: 1.0
|
|
4
|
+
**Last Updated**: {{STRUCTURE_DATE}}
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Available Droids
|
|
9
|
+
|
|
10
|
+
Droids are specialized AI agents for specific tasks.
|
|
11
|
+
|
|
12
|
+
### Language Specialists
|
|
13
|
+
|
|
14
|
+
| Droid | Purpose |
|
|
15
|
+
|-------|---------|
|
|
16
|
+
| `cpp-pro` | C++ development, RAII, STL, templates |
|
|
17
|
+
| `python-pro` | Python, async/await, decorators |
|
|
18
|
+
| `javascript-pro` | JavaScript/TypeScript, ES6+, async |
|
|
19
|
+
|
|
20
|
+
### Review Droids
|
|
21
|
+
|
|
22
|
+
| Droid | Purpose | Blocks PR |
|
|
23
|
+
|-------|---------|-----------|
|
|
24
|
+
| `security-code-reviewer` | OWASP, secrets, injection | CRITICAL/HIGH |
|
|
25
|
+
| `code-quality-reviewer` | Naming, complexity, style | CRITICAL only |
|
|
26
|
+
| `performance-reviewer` | Algorithms, N+1, caching | Advisory |
|
|
27
|
+
| `test-coverage-reviewer` | Test gaps, brittle tests | Advisory |
|
|
28
|
+
|
|
29
|
+
### Utility Droids
|
|
30
|
+
|
|
31
|
+
| Droid | Purpose |
|
|
32
|
+
|-------|---------|
|
|
33
|
+
| `worktree-manager` | Git worktree lifecycle, PR creation |
|
|
34
|
+
| `git-summarizer` | Repository context for reviewers |
|
|
35
|
+
| `release-notes-writer` | Generate release notes from commits |
|
|
36
|
+
| `project-analyzer` | Extract project metadata |
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Available Skills
|
|
41
|
+
|
|
42
|
+
Skills provide domain-specific guidance.
|
|
43
|
+
|
|
44
|
+
{{#each SKILLS}}
|
|
45
|
+
| `{{name}}` | {{purpose}} |
|
|
46
|
+
{{/each}}
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Agent Routing
|
|
51
|
+
|
|
52
|
+
| Task Type | Route To |
|
|
53
|
+
|-----------|----------|
|
|
54
|
+
| Security review | `security-code-reviewer` |
|
|
55
|
+
| Performance analysis | `performance-reviewer` |
|
|
56
|
+
| Code quality | `code-quality-reviewer` |
|
|
57
|
+
| C++ code | `cpp-pro` |
|
|
58
|
+
| Python code | `python-pro` |
|
|
59
|
+
| JavaScript/TypeScript | `javascript-pro` |
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## Parallel Execution
|
|
64
|
+
|
|
65
|
+
When safe, run independent droids in parallel:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Before PR - run all reviewers
|
|
69
|
+
Task(subagent_type: "security-code-reviewer", prompt: "Audit: <files>")
|
|
70
|
+
Task(subagent_type: "code-quality-reviewer", prompt: "Review: <files>")
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Multi-Agent Coordination
|
|
76
|
+
|
|
77
|
+
**Skip for single-agent sessions.** Only activate when multiple agents work concurrently.
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
# Check for overlaps
|
|
81
|
+
uam agent overlaps --resource "<files-or-directories>"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
| Risk Level | Action |
|
|
85
|
+
|------------|--------|
|
|
86
|
+
| `none` | Proceed immediately |
|
|
87
|
+
| `low` | Proceed, note merge order |
|
|
88
|
+
| `medium` | Announce, coordinate sections |
|
|
89
|
+
| `high`/`critical` | Wait or split work |
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Invoking Droids
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Via Task tool
|
|
97
|
+
Task(subagent_type: "python-pro", prompt: "Refactor this code: <code>")
|
|
98
|
+
|
|
99
|
+
# Via Skill tool
|
|
100
|
+
Skill(skill: "openobserve-expert")
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## See Also
|
|
106
|
+
|
|
107
|
+
- `.factory/droids/` - Droid definitions
|
|
108
|
+
- `.factory/skills/` - Skill definitions
|
|
109
|
+
- `CLAUDE_WORKFLOWS.md` - Review protocols
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# Memory System Guide Template
|
|
2
|
+
|
|
3
|
+
**Version**: 1.0
|
|
4
|
+
**Last Updated**: {{STRUCTURE_DATE}}
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Memory Layers
|
|
9
|
+
|
|
10
|
+
| Layer | Storage | Capacity | Latency |
|
|
11
|
+
|-------|---------|----------|---------|
|
|
12
|
+
| L1 Working | SQLite `memories` | {{SHORT_TERM_LIMIT}} max | <1ms |
|
|
13
|
+
| L2 Session | SQLite `session_memories` | Current session | <5ms |
|
|
14
|
+
| L3 Semantic | {{LONG_TERM_BACKEND}} | Unlimited | ~50ms |
|
|
15
|
+
| L4 Knowledge | SQLite `entities/rels` | Graph | <20ms |
|
|
16
|
+
|
|
17
|
+
**Database**: `./{{MEMORY_DB_PATH}}`
|
|
18
|
+
**Vector DB**: {{LONG_TERM_BACKEND}} at `{{LONG_TERM_ENDPOINT}}`
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Working Memory (L1)
|
|
23
|
+
|
|
24
|
+
Quick actions stored directly in SQLite.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# Store action
|
|
28
|
+
sqlite3 ./{{MEMORY_DB_PATH}} "INSERT INTO memories (timestamp,type,content) VALUES (datetime('now'),'action','...');"
|
|
29
|
+
|
|
30
|
+
# Query recent
|
|
31
|
+
sqlite3 ./{{MEMORY_DB_PATH}} "SELECT * FROM memories ORDER BY id DESC LIMIT 10;"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Session Memory (L2)
|
|
37
|
+
|
|
38
|
+
Session-specific context for current task.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Store decision
|
|
42
|
+
sqlite3 ./{{MEMORY_DB_PATH}} "INSERT INTO session_memories (session_id,timestamp,type,content,importance) VALUES ('current',datetime('now'),'decision','...',7);"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Semantic Memory (L3)
|
|
48
|
+
|
|
49
|
+
Long-term lessons stored in Qdrant vector database.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Store lesson
|
|
53
|
+
{{MEMORY_STORE_CMD}} lesson "..." --tags t1,t2 --importance 8
|
|
54
|
+
|
|
55
|
+
# Query relevant lessons
|
|
56
|
+
{{MEMORY_QUERY_CMD}} "security best practices"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Pattern RAG
|
|
62
|
+
|
|
63
|
+
Patterns are retrieved dynamically from the `{{PATTERN_RAG_COLLECTION}}` collection.
|
|
64
|
+
|
|
65
|
+
Top-2 relevant patterns are injected per task (score >= {{PATTERN_RAG_THRESHOLD}}).
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
# Query patterns
|
|
69
|
+
{{PATTERN_RAG_QUERY_CMD}} "task description"
|
|
70
|
+
|
|
71
|
+
# Re-index patterns
|
|
72
|
+
{{PATTERN_RAG_INDEX_CMD}}
|
|
73
|
+
|
|
74
|
+
# Check status
|
|
75
|
+
uam patterns status
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Pattern Files
|
|
81
|
+
|
|
82
|
+
Patterns are defined in `.factory/patterns/`:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
.factory/patterns/
|
|
86
|
+
├── P12_output_existence.md
|
|
87
|
+
├── P13_iterative_refinement.md
|
|
88
|
+
├── ...
|
|
89
|
+
├── IaC-Parity.md
|
|
90
|
+
└── index.json
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
To add a new pattern:
|
|
94
|
+
1. Create `P37_new_pattern.md` in `.factory/patterns/`
|
|
95
|
+
2. Add entry to `index.json`
|
|
96
|
+
3. Run `python agents/scripts/index_patterns.py`
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Reinforcement Learning
|
|
101
|
+
|
|
102
|
+
Pattern effectiveness is tracked for self-improvement.
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# View pattern effectiveness
|
|
106
|
+
sqlite3 ./agents/data/memory/reinforcement.db "SELECT * FROM v_pattern_effectiveness;"
|
|
107
|
+
|
|
108
|
+
# View recent outcomes
|
|
109
|
+
sqlite3 ./agents/data/memory/reinforcement.db "SELECT * FROM v_recent_outcomes;"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Qdrant Setup
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Start Qdrant
|
|
118
|
+
docker run -p 6333:6333 qdrant/qdrant
|
|
119
|
+
|
|
120
|
+
# Or with persistence
|
|
121
|
+
docker run -p 6333:6333 -v $(pwd)/qdrant_data:/qdrant/storage qdrant/qdrant
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## See Also
|
|
127
|
+
|
|
128
|
+
- `.factory/patterns/` - Pattern definitions
|
|
129
|
+
- `agents/scripts/index_patterns.py` - Pattern indexing
|
|
130
|
+
- `agents/scripts/query_patterns.py` - Pattern query
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# Workflows Guide Template
|
|
2
|
+
|
|
3
|
+
**Version**: 1.0
|
|
4
|
+
**Last Updated**: {{STRUCTURE_DATE}}
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Session Start
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
uam task ready
|
|
12
|
+
sqlite3 ./{{MEMORY_DB_PATH}} "SELECT * FROM memories ORDER BY id DESC LIMIT 10;"
|
|
13
|
+
uam agent status
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Decision Loop
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
1. CLASSIFY -> complexity? backup? tools?
|
|
22
|
+
2. PROTECT -> cp file file.bak (configs, DBs)
|
|
23
|
+
3. MEMORY -> query context + past failures
|
|
24
|
+
4. WORK -> implement (ALWAYS use worktree)
|
|
25
|
+
5. REVIEW -> self-review diff
|
|
26
|
+
6. TEST -> completion gates pass
|
|
27
|
+
7. LEARN -> store outcome
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Worktree Workflow (MANDATORY)
|
|
33
|
+
|
|
34
|
+
**ALL file changes MUST use a worktree.** No exceptions.
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
{{WORKTREE_CREATE_CMD}} <slug>
|
|
38
|
+
cd {{WORKTREE_DIR}}/NNN-<slug>/
|
|
39
|
+
git add -A && git commit -m "type: description"
|
|
40
|
+
{{WORKTREE_PR_CMD}} <id>
|
|
41
|
+
# After merge:
|
|
42
|
+
{{WORKTREE_CLEANUP_CMD}} <id> # MANDATORY
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Testing Requirements
|
|
48
|
+
|
|
49
|
+
1. Create worktree
|
|
50
|
+
2. Update/create tests
|
|
51
|
+
3. Run `{{TEST_COMMAND}}`
|
|
52
|
+
4. Run linting: `{{LINT_COMMAND}}`
|
|
53
|
+
5. Create PR
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## Completion Gates
|
|
58
|
+
|
|
59
|
+
**CANNOT say "done" until ALL gates pass.**
|
|
60
|
+
|
|
61
|
+
### GATE 1: Output Existence
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
for f in $EXPECTED_OUTPUTS; do
|
|
65
|
+
[ -f "$f" ] && echo "ok $f" || echo "MISSING: $f"
|
|
66
|
+
done
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### GATE 2: Constraint Compliance
|
|
70
|
+
|
|
71
|
+
Extract ALL constraints from task:
|
|
72
|
+
- "exactly", "only", "must be", "no more than"
|
|
73
|
+
- Verify EACH constraint
|
|
74
|
+
|
|
75
|
+
### GATE 3: Tests Pass
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
{{TEST_COMMAND}}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If < 100%: iterate (fix specific failure, re-run).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Completion Checklist
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
☐ Tests pass
|
|
89
|
+
☐ Lint pass
|
|
90
|
+
☐ Worktree used (MANDATORY)
|
|
91
|
+
☐ Worktree cleaned up after PR merge (MANDATORY)
|
|
92
|
+
☐ Self-review completed
|
|
93
|
+
☐ Memory updated
|
|
94
|
+
☐ PR created
|
|
95
|
+
☐ Reviews passed
|
|
96
|
+
☐ No secrets in code
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Parallel Review Protocol
|
|
102
|
+
|
|
103
|
+
**Before ANY commit/PR, invoke quality droids in PARALLEL:**
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
Task(subagent_type: "code-quality-reviewer", prompt: "Review: <files>")
|
|
107
|
+
Task(subagent_type: "security-code-reviewer", prompt: "Audit: <files>")
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Automatic Triggers
|
|
113
|
+
|
|
114
|
+
| Pattern | Action |
|
|
115
|
+
|---------|--------|
|
|
116
|
+
| work request | `uam task create --type task` |
|
|
117
|
+
| bug report | `uam task create --type bug` |
|
|
118
|
+
| feature request | `uam task create --type feature` |
|
|
119
|
+
| ANY file change | **create worktree (MANDATORY)** |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Completion Protocol
|
|
124
|
+
|
|
125
|
+
```
|
|
126
|
+
MERGE -> CLEANUP WORKTREE -> DEPLOY -> MONITOR -> FIX (iterate until 100%)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**Never "done" until:** PR merged + worktree cleaned up + deployed + verified working
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## See Also
|
|
134
|
+
|
|
135
|
+
- `CLAUDE_CODING.md` - Coding standards
|
|
136
|
+
- `.factory/droids/worktree-manager.md` - Worktree automation (if applicable)
|