@iamem/amem 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +98 -4
  2. package/desktop/icons/icon-1024.png +0 -0
  3. package/desktop/icons/icon.icns +0 -0
  4. package/desktop/icons/icon.png +0 -0
  5. package/desktop/main.js +100 -0
  6. package/desktop/package.json +16 -0
  7. package/desktop/preload.js +4 -0
  8. package/desktop/scripts/ensure-electron.mjs +122 -0
  9. package/dist/api/routes.js +331 -1
  10. package/dist/app-shell.d.ts +13 -0
  11. package/dist/app-shell.js +126 -0
  12. package/dist/attest.d.ts +13 -0
  13. package/dist/attest.js +44 -0
  14. package/dist/cli.js +258 -2
  15. package/dist/context.d.ts +10 -1
  16. package/dist/context.js +105 -3
  17. package/dist/db.d.ts +141 -0
  18. package/dist/db.js +398 -0
  19. package/dist/embed.js +5 -14
  20. package/dist/hook.js +8 -1
  21. package/dist/hygiene.d.ts +1 -2
  22. package/dist/hygiene.js +1 -2
  23. package/dist/install/hosts.js +8 -0
  24. package/dist/install/skills.js +10 -5
  25. package/dist/license.d.ts +1 -0
  26. package/dist/license.js +21 -19
  27. package/dist/mcp.js +221 -0
  28. package/dist/policy.d.ts +6 -0
  29. package/dist/policy.js +16 -1
  30. package/dist/publish.d.ts +1 -1
  31. package/dist/publish.js +1 -0
  32. package/dist/skill-capture.d.ts +43 -0
  33. package/dist/skill-capture.js +146 -0
  34. package/dist/skills.d.ts +106 -0
  35. package/dist/skills.js +422 -0
  36. package/docs/backlog.md +9 -0
  37. package/docs/npm-release.md +1 -1
  38. package/package.json +7 -2
  39. package/scripts/postinstall.js +62 -0
  40. package/skills/amem-tasks/SKILL.md +100 -0
  41. package/skills/amem-write-skill/SKILL.md +99 -0
  42. package/templates/cursor-rule.mdc +16 -6
  43. package/templates/policy.deny-default.toml +5 -0
  44. package/templates/policy.example.toml +8 -0
  45. package/ui-static/app.js +435 -227
  46. package/ui-static/index.html +11 -34
  47. package/ui-static/styles.css +299 -0
@@ -0,0 +1,99 @@
1
+ ---
2
+ name: amem-write-skill
3
+ description: Write a durable procedure from this session into local amem skills.
4
+ ---
5
+
6
+ # amem-write-skill
7
+
8
+ Turn a non-trivial workflow you just worked out into a reusable skill stored in local amem.
9
+
10
+ Use this when an amem context packet shows a **Worth saving as a skill** or **Skill worth
11
+ revising** nudge, or when you notice on your own that you solved something worth repeating.
12
+
13
+ ## Privacy
14
+
15
+ - Skills are stored locally under `~/.amem/skills` and never leave this machine.
16
+ - Do not store secrets, tokens, credentials, connection strings, or private personal data.
17
+ amem scans content and will refuse writes that look like credentials.
18
+ - Do not paste proprietary company LLM instructions — write the procedure, not the prompt.
19
+
20
+ ## When to write one
21
+
22
+ Write a skill when at least one of these is true:
23
+
24
+ - You worked out a multi-step workflow that will come up again.
25
+ - You hit errors or dead ends and found the path that actually works.
26
+ - The user corrected your approach and the correction generalizes.
27
+
28
+ Do **not** write a skill for a one-off fix, a single command, or anything already obvious
29
+ from the repo's README. A small durable fact belongs in memory (`amem_remember`), not here.
30
+ The split: memory holds facts that should always be in context; skills hold procedures that
31
+ should load only when relevant.
32
+
33
+ ## Steps
34
+
35
+ 1. Check what already exists so you update instead of duplicating:
36
+
37
+ ```bash
38
+ amem skills list
39
+ ```
40
+
41
+ If a related skill exists, load it and revise it rather than writing a second one:
42
+
43
+ ```bash
44
+ amem skills show <name>
45
+ ```
46
+
47
+ 2. Draft the SKILL.md. Keep the description under about 80 characters — it is the only
48
+ thing agents see until they load the body, so it must say *when to use this*, not just
49
+ what it is.
50
+
51
+ 3. Save it with the `amem_skill_save` MCP tool, passing `name`, `description`, and
52
+ `content`. Prefer that over writing files directly so the content scan runs.
53
+
54
+ ## Format
55
+
56
+ ```markdown
57
+ ---
58
+ name: deploy-staging
59
+ description: Deploy the staging server and verify the health endpoint
60
+ tags: [deploy, staging]
61
+ ---
62
+
63
+ # Deploy Staging
64
+
65
+ ## When to use
66
+ Trigger conditions — the situation where this procedure applies.
67
+
68
+ ## Procedure
69
+ 1. Concrete step with the real command.
70
+ 2. Next step.
71
+
72
+ ## Pitfalls
73
+ - The dead end you hit, and what got you past it.
74
+
75
+ ## Verification
76
+ How to confirm it actually worked.
77
+ ```
78
+
79
+ ## Pitfalls
80
+
81
+ - **Vague descriptions.** "Helps with deploys" is useless for ranking. Name the trigger.
82
+ - **Transcribing the chat.** Write the procedure that worked, not the exploration that led
83
+ to it. Skip the wrong turns except as entries under Pitfalls.
84
+ - **Inventing steps.** Only include commands you actually ran and saw work.
85
+ - **Duplicates.** Revising an existing skill beats adding a near-copy.
86
+
87
+ ## Verification
88
+
89
+ ```bash
90
+ amem skills list # your skill appears with its description
91
+ amem skills show <name> # body reads as a procedure someone else could follow
92
+ ```
93
+
94
+ If a write is staged instead of saved, an approval gate is on. Review it with:
95
+
96
+ ```bash
97
+ amem skills drafts
98
+ amem skills approve <draft-id>
99
+ ```
@@ -1,23 +1,33 @@
1
1
  ---
2
- description: Use local personal amem memory before broad codebase exploration
2
+ description: Use local personal amem memory and tasks before broad codebase exploration
3
3
  globs:
4
4
  alwaysApply: true
5
5
  ---
6
6
 
7
7
  <!-- Generated by amem. Safe to commit: contains no memory contents. -->
8
8
 
9
- # amem local memory
9
+ # amem local memory & tasks
10
10
 
11
- amem injects matching local memory into Cursor automatically (session start + each prompt). Treat that packet as the first map of this repo.
11
+ amem injects matching local memory and open tasks into Cursor automatically (session start + each prompt). Treat that packet as the first map of this repo.
12
12
 
13
13
  1. Prefer amem file anchors over broad greps and multi-folder reads.
14
14
  2. Still verify current code before editing — memory can be stale. Trust **fresh** claims more; re-check anything marked **stale**.
15
15
  3. Use the **Why:** line as ranking explainability, not as proof.
16
- 4. After durable learnings, the stop hook queues a compact **session draft** (and may queue **miss→learn** drafts). Approve in `amem ui` → Memory, or run `amem-update-working-memory` for higher-quality facts.
17
- 5. Cross-repo personal prefs may appear with Why reason `personal` they are local “how I work” notes, not org wiki.
16
+ 4. **Agent Tasks & Kanban:**
17
+ - Use `amem_task_add` to record deferred work, follow-ups, or multi-step tasks so they don't get lost across chat sessions.
18
+ - Update tasks to `doing` with `amem_task_update` when starting work.
19
+ - Mark completed tasks with `amem_task_complete` as soon as finished so completed tasks are preserved in history and context retrieval.
20
+ - Query `amem_task_list` (or check `## Open tasks` in context) to see pending and completed tasks.
21
+ 5. **Skills (procedural memory):**
22
+ - A `## Relevant skills` section lists names and descriptions only. If one looks like it applies, call `amem_skill_view` to load the procedure **before** working it out yourself.
23
+ - When you solve something worth repeating — a multi-step workflow, a dead end you found the way past, or a correction the user gave you — save it with `amem_skill_save`. The `amem-write-skill` skill has the format.
24
+ - A `## Worth saving as a skill` or `## Skill worth revising` note in the packet means amem already spotted one. Write it up if you agree; it is a suggestion, not an order.
25
+ - Skills are procedures. Small durable facts still belong in memory via `amem_remember`.
26
+ 6. After durable learnings, the stop hook queues a compact **session draft** (and may queue **miss→learn** drafts). Approve in `amem ui` → Memory, or run `amem-update-working-memory` for higher-quality facts.
27
+ 7. Cross-repo personal prefs may appear with Why reason `personal` — they are local “how I work” notes, not org wiki.
18
28
 
19
29
  Do not re-run `amem context` unless the injected packet is empty or clearly wrong.
20
30
 
21
31
  Memory is personal and stored under `~/.amem` on this machine. Do not commit exports, backups, or database copies to shared remotes.
22
32
 
23
- Open the local UI anytime with `amem ui` (Setup, Memory drafts, Stats).
33
+ Open the local UI anytime with `amem ui` (Setup, Memory drafts, Tasks, Skills, Stats).
@@ -18,3 +18,8 @@ allowed_platforms = ["cursor", "claude"]
18
18
 
19
19
  # Empty = Memory must approve every draft. Do not auto-apply on managed fleets.
20
20
  auto_apply_kinds = []
21
+
22
+ # Skills are instructions agents follow, so nothing reaches disk without a human.
23
+ skills_enabled = true
24
+ skill_write_approval = true
25
+ skill_capture = true
@@ -20,3 +20,11 @@ allowed_platforms = ["cursor", "claude"]
20
20
  # Optional: auto-apply low-risk draft kinds without Memory approve (empty = never).
21
21
  # Prefer leaving this empty on managed fleets.
22
22
  # auto_apply_kinds = ["structure"]
23
+
24
+ # Skills — reusable procedures agents load on demand from ~/.amem/skills.
25
+ # These are instructions an agent will follow, so treat them like code, not notes.
26
+ skills_enabled = true
27
+ # true = agent writes are staged for review instead of hitting disk.
28
+ skill_write_approval = false
29
+ # false = stop suggesting skills at session end.
30
+ skill_capture = true