agentic-loadout 0.7.2__tar.gz → 0.7.4__tar.gz

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 (100) hide show
  1. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/CHANGELOG.md +24 -0
  2. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/PKG-INFO +2 -2
  3. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/README.md +1 -1
  4. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/pyproject.toml +1 -1
  5. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/overlays/memory-1/export_sessions.entire-code.py +8 -4
  6. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/overlays/overlays.toml +0 -9
  7. agentic_loadout-0.7.4/src/agentic_loadout/__init__.py +1 -0
  8. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/UPSTREAM.md +6 -7
  9. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/docs-1/SKILL.md +29 -0
  10. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/SKILL.md +42 -8
  11. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/scripts/export_sessions.py +81 -20
  12. agentic_loadout-0.7.4/src/agentic_loadout/assets/skills/memory-1/templates/.gitignore +2 -0
  13. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/memory-legacy.md +1 -1
  14. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/pins.py +2 -2
  15. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_export_sessions_entire.py +12 -7
  16. agentic_loadout-0.7.4/tests/test_export_sessions_worktree.py +124 -0
  17. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_memory_docs.py +3 -2
  18. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_vendored_skills.py +1 -1
  19. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/uv.lock +1 -1
  20. agentic_loadout-0.7.2/scripts/overlays/memory-1/export_sessions.entire-import.py +0 -1
  21. agentic_loadout-0.7.2/src/agentic_loadout/__init__.py +0 -1
  22. agentic_loadout-0.7.2/src/agentic_loadout/assets/skills/memory-1/templates/sessions/.gitignore +0 -3
  23. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.codex/hooks.json +0 -0
  24. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.entire/.gitignore +0 -0
  25. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.entire/settings.json +0 -0
  26. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.gitattributes +0 -0
  27. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.github/workflows/ci.yml +0 -0
  28. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.github/workflows/release.yaml +0 -0
  29. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/.gitignore +0 -0
  30. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/LICENSE +0 -0
  31. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/PLAN.md +0 -0
  32. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/PLAN.orig.md +0 -0
  33. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/docs/agentic-loadout.jpeg +0 -0
  34. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/docs/entire-investigation.md +0 -0
  35. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/docs/memory-1-docs-1-integration.md +0 -0
  36. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/docs/original-implementation-plan.md +0 -0
  37. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/overlays/memory-1/SKILL.entire-note.md +0 -0
  38. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/overlays/memory-1/export_sessions.entire-flag.py +0 -0
  39. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/overlays/memory-1/export_sessions.entire-only.py +0 -0
  40. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/overlays/memory-1/export_sessions.entire-run.py +0 -0
  41. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/release_notes.py +0 -0
  42. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/scripts/sync_skills.py +0 -0
  43. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/agents.py +0 -0
  44. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/agents/architect.md +0 -0
  45. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/agents/code-grader.head.md +0 -0
  46. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/agents/coder.md +0 -0
  47. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/agents/tiers/code-reviewer.md +0 -0
  48. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/agents/tiers/coder-small.supplement.md +0 -0
  49. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/agents/utility.md +0 -0
  50. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/development-workflow.md +0 -0
  51. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/docs-1/scripts/docs_index.py +0 -0
  52. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/docs-1/templates/doc.md +0 -0
  53. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/scripts/memory_check.py +0 -0
  54. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/templates/LATER.md +0 -0
  55. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/templates/MEMORY.md +0 -0
  56. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/templates/NOW.md +0 -0
  57. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/templates/notes/_example.md +0 -0
  58. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/skills/memory-1/templates/sessions/INDEX.md +0 -0
  59. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/agents-rules.md +0 -0
  60. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/coders/go.md +0 -0
  61. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/coders/python.md +0 -0
  62. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/coders/swift.md +0 -0
  63. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/coders/typescript.md +0 -0
  64. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/docs-rules.md +0 -0
  65. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/entire-rules.md +0 -0
  66. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/entire-sessions.md +0 -0
  67. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/memory-rules.md +0 -0
  68. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/sdd-rules.md +0 -0
  69. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/small-delegation.md +0 -0
  70. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/assets/templates/worktree-rules.md +0 -0
  71. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/brew.py +0 -0
  72. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/cli.py +0 -0
  73. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/coders.py +0 -0
  74. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/detect.py +0 -0
  75. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/entire.py +0 -0
  76. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/files.py +0 -0
  77. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/git_state.py +0 -0
  78. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/install.py +0 -0
  79. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/instructions.py +0 -0
  80. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/legacy.py +0 -0
  81. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/mcp_config.py +0 -0
  82. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/options.py +0 -0
  83. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/preflight.py +0 -0
  84. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/runners.py +0 -0
  85. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/skills.py +0 -0
  86. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/ui.py +0 -0
  87. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/src/agentic_loadout/vendors.py +0 -0
  88. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/__init__.py +0 -0
  89. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/baseline-agent-hashes.json +0 -0
  90. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/conftest.py +0 -0
  91. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_detect_and_brew.py +0 -0
  92. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_entire.py +0 -0
  93. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_entire_optin.py +0 -0
  94. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_export_sessions_opencode.py +0 -0
  95. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_install.py +0 -0
  96. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_instructions.py +0 -0
  97. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_mcp_config.py +0 -0
  98. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_skill_upgrade.py +0 -0
  99. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_small_agents.py +0 -0
  100. {agentic_loadout-0.7.2 → agentic_loadout-0.7.4}/tests/test_sync_skills.py +0 -0
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.7.4] - 2026-11-17
4
+
5
+ ### Changed
6
+ - memory-1 no longer special-cases one memory tool. When memory is first set up, the skill looks for an existing
7
+ project memory (another `memory/` layout, `memory-bank/`, `.agemem/`, status files, memory sections in `AGENTS.md` or
8
+ `CLAUDE.md`) and proposes a migration to `NOW.md`, `LATER.md` and dated notes, keeping the old files until you
9
+ confirm. The legacy-memory item no longer mentions a shortcut to ignore.
10
+ - memory-1 gains frontmatter metadata (license, author, version, tags), a Scripts table, and a Requirements and limits
11
+ section that states what the session export reads and keeps (memory-1 at `4fbbd81`).
12
+ - docs-1 gains the same metadata (license, author, version, tags), a Scripts table, a Requirements and limits section
13
+ (git history needed for staleness checks, what `check` reads and runs, which output lines are failures) and a setup
14
+ step to create `docs/` first (docs-1 at `c1f75fc`).
15
+
16
+ ## [0.7.3] - 2026-11-17
17
+
18
+ ### Changed
19
+ - memory-1's session archive, `INDEX.md` included, is now always local: the ignore rule is `/sessions` in
20
+ `memory/.gitignore` (the exporter adds it when missing) instead of a `.gitignore` inside `memory/sessions/` that kept
21
+ the index tracked. Projects that already track it need `git rm -r --cached memory/sessions` (old copies stay in git
22
+ history); the skill says so (memory-1 at `ab2f497`).
23
+ - Worktree sessions are collected into the main checkout: from a linked git worktree the export writes to the main
24
+ checkout's `memory/sessions`, links the worktree's folder to it when it can, and matches the sessions of every
25
+ worktree of the repository, including worktrees outside the project folder.
26
+
3
27
  ## [0.7.2] - 2026-11-16
4
28
 
5
29
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: agentic-loadout
3
- Version: 0.7.2
3
+ Version: 0.7.4
4
4
  Summary: One command that gives a project an agent setup: memory and docs skills, the SDD skill, subagents and language coders with code-navigation MCPs. Project-scoped, for Claude Code, Cursor and Codex.
5
5
  Project-URL: Repository, https://github.com/illescasDaniel/agentic-loadout
6
6
  Project-URL: Issues, https://github.com/illescasDaniel/agentic-loadout/issues
@@ -52,7 +52,7 @@ Needs Node.js 20+ for the `sdd-feature` and `worktree` skills and the TypeScript
52
52
  with gopls for the Go coder. memory-1 and docs-1 need nothing but Python 3 (their scripts use the standard library).
53
53
 
54
54
  `--python 3.12` makes `uvx` use a tested Python instead of whichever is newest on your machine. To pin the loadout
55
- version, run `uvx --python 3.12 agentic-loadout@0.7.2 .`; individual dependencies may have their own version policy.
55
+ version, run `uvx --python 3.12 agentic-loadout@0.7.4 .`; individual dependencies may have their own version policy.
56
56
 
57
57
  > [!NOTE]
58
58
  > Claude Code has its own built-in auto memory. To keep one shared memory in the repository (memory-1's `memory/`), turn
@@ -30,7 +30,7 @@ Needs Node.js 20+ for the `sdd-feature` and `worktree` skills and the TypeScript
30
30
  with gopls for the Go coder. memory-1 and docs-1 need nothing but Python 3 (their scripts use the standard library).
31
31
 
32
32
  `--python 3.12` makes `uvx` use a tested Python instead of whichever is newest on your machine. To pin the loadout
33
- version, run `uvx --python 3.12 agentic-loadout@0.7.2 .`; individual dependencies may have their own version policy.
33
+ version, run `uvx --python 3.12 agentic-loadout@0.7.4 .`; individual dependencies may have their own version policy.
34
34
 
35
35
  > [!NOTE]
36
36
  > Claude Code has its own built-in auto memory. To keep one shared memory in the repository (memory-1's `memory/`), turn
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentic-loadout"
3
- version = "0.7.2"
3
+ version = "0.7.4"
4
4
  description = "One command that gives a project an agent setup: memory and docs skills, the SDD skill, subagents and language coders with code-navigation MCPs. Project-scoped, for Claude Code, Cursor and Codex."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -105,11 +105,15 @@ def render_entire(slot, session_id, data, max_chars, warn):
105
105
 
106
106
 
107
107
  def entire_gitignore(out):
108
- """A fresh archive is git-ignored like the template; an archive that was shared on purpose is left alone."""
109
- if (out / ".gitignore").exists() or any(p.name != "INDEX.md" for p in out.glob("*.md")):
108
+ """Keep a fresh archive out of git like the template: a `/sessions` line in the memory folder's .gitignore."""
109
+ if out.name != "sessions":
110
110
  return
111
- out.mkdir(parents=True, exist_ok=True)
112
- (out / ".gitignore").write_text("*\n!.gitignore\n!INDEX.md\n", encoding="utf-8")
111
+ gitignore = out.parent / ".gitignore"
112
+ old = gitignore.read_text(encoding="utf-8") if gitignore.exists() else ""
113
+ if any(line.strip() in ("/sessions", "/sessions/", "sessions", "sessions/") for line in old.splitlines()):
114
+ return
115
+ out.parent.mkdir(parents=True, exist_ok=True)
116
+ gitignore.write_text(old + ("\n" if old and not old.endswith("\n") else "") + "/sessions\n", encoding="utf-8")
113
117
 
114
118
 
115
119
  def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=print, warn=None, planned=()):
@@ -3,15 +3,6 @@
3
3
  # `agentic-loadout:end NAME` marker lines. `blank_after` blank lines follow the end marker; stripping the blocks removes
4
4
  # them again. `body` is a file in this folder. Never change an upstream line: only add blocks.
5
5
 
6
- [[insert]]
7
- skill = "memory-1"
8
- file = "scripts/export_sessions.py"
9
- name = "entire-import"
10
- before = "HOME = Path.home()"
11
- body = "memory-1/export_sessions.entire-import.py"
12
- blank_after = 1
13
- description = "imports `subprocess` for the Entire pass"
14
-
15
6
  [[insert]]
16
7
  skill = "memory-1"
17
8
  file = "scripts/export_sessions.py"
@@ -0,0 +1 @@
1
+ __version__ = "0.7.4"
@@ -4,15 +4,14 @@ agentic-loadout ships adapted copies of two Agent Skills. Each copy is made from
4
4
 
5
5
  | Skill | Upstream repository | Commit |
6
6
  |---|---|---|
7
- | `memory-1` | https://github.com/illescasDaniel/memory-1-skill | `9572f47adf262f262600e2e36fd58f3af19be43f` |
8
- | `docs-1` | https://github.com/illescasDaniel/docs-1-skill | `0fdbd5fbc39a7f5e6f8efb76a688ba3b734fcde9` |
7
+ | `memory-1` | https://github.com/illescasDaniel/memory-1-skill | `cc8af695783d69982433bf8537f053bb7da1f4bc` |
8
+ | `docs-1` | https://github.com/illescasDaniel/docs-1-skill | `c1f75fc38a04ba8b8dc0c9a3cc8621c48d893c11` |
9
9
 
10
10
  ## What differs from upstream
11
11
 
12
12
  Every difference is an insertion between an `agentic-loadout:begin NAME` and an `agentic-loadout:end NAME` marker line (`#` comments in Python, HTML comments in Markdown). Removing the marked blocks, and the blank lines right after each end marker, gives the upstream file byte for byte. Nothing else is changed.
13
13
 
14
14
  - `memory-1/SKILL.md`, block `entire-note`: one paragraph about the opt-in `--entire` flag, in the Session archive section
15
- - `memory-1/scripts/export_sessions.py`, block `entire-import`: imports `subprocess` for the Entire pass
16
15
  - `memory-1/scripts/export_sessions.py`, block `entire-code`: the opt-in Entire pass (functions that read checkpoints from git data, same output format and redaction)
17
16
  - `memory-1/scripts/export_sessions.py`, block `entire-flag`: the `--entire` flag
18
17
  - `memory-1/scripts/export_sessions.py`, block `entire-only`: with `--entire` and no native sessions, run only the Entire pass instead of failing
@@ -24,16 +23,16 @@ Every difference is an insertion between an `agentic-loadout:begin NAME` and an
24
23
 
25
24
  | File | sha256 | Differs |
26
25
  |---|---|---|
27
- | `memory-1/SKILL.md` | `67c33009adacee1e6de690f272b9a45a106b7a42011a08ed52f0e2eb3dd5a804` | yes |
28
- | `memory-1/scripts/export_sessions.py` | `7b98729c9a2c7033f86d890d9849da0670149167545cd7f93f734d31d7b83073` | yes |
26
+ | `memory-1/SKILL.md` | `141885cce17e650ba47a6c713fee7a68f97fcd5504493f2a0237619d779250a7` | yes |
27
+ | `memory-1/scripts/export_sessions.py` | `477ce237882de4642f17c9fecf020cfa024598559000ba77aff436c391b335f8` | yes |
29
28
  | `memory-1/scripts/memory_check.py` | `4e617dbb339f4a67b9d0cb9c9db70b2e61ff51cb0c6580db9ac59f41f0f67522` | no |
29
+ | `memory-1/templates/.gitignore` | `36cb3e2d2fdb2bad956337d5649c75b20cabb3c505cb728fefcbe3cb8b5dee6c` | no |
30
30
  | `memory-1/templates/LATER.md` | `b215b01ed2f7434b1287a2ebfc8dd7d69b89a97d0d464b7aa1ba7d0d65c1a676` | no |
31
31
  | `memory-1/templates/MEMORY.md` | `71375e4b3012cb78b1854265f9612752e8ca91e8bb59917b5642d4bddf0d9ad4` | no |
32
32
  | `memory-1/templates/NOW.md` | `33a49515e4993add3398dd761a2757678bed98e76de0bfa830ca7179ca72145f` | no |
33
33
  | `memory-1/templates/notes/_example.md` | `dfef86ac833702c9889b4fc3ec5200ac99538abb9421a9639d2e23ea873cb54e` | no |
34
- | `memory-1/templates/sessions/.gitignore` | `aed9e7d4a63ff17f621b0d7a501eb7177e4d2ea5831e66d2eff6d9e21b210b43` | no |
35
34
  | `memory-1/templates/sessions/INDEX.md` | `41bcbc17607e29348915c7eec91520310416437de7ed1016564e8b9586be0c4d` | no |
36
- | `docs-1/SKILL.md` | `4ee9cea6a5ae5113326cbe9bc5aaaf024ca6ddaf6802c66c2e3286b5dd516dc5` | no |
35
+ | `docs-1/SKILL.md` | `a876a0b44c49cb1e3d1bd85db625ac8dbb6256d454dc0367aa0dcc76d80924f0` | no |
37
36
  | `docs-1/scripts/docs_index.py` | `50997305b0be70550d196f10d7563c657b16cd1302c96818d4faec8d1d3ecca4` | no |
38
37
  | `docs-1/templates/doc.md` | `e184b65699e4c8044d077bd6b6ff6d4b65eadf22556b7db76bd4b520bd965829` | no |
39
38
 
@@ -1,6 +1,11 @@
1
1
  ---
2
2
  name: docs-1
3
3
  description: Set up and maintain project documentation that AI agents can navigate fast and trust - one subject per Markdown doc with a stable ID, status, dates and the code paths it covers, a generated one-line-per-doc index, and a checker for stale docs, broken links and duplicate IDs. Use when asked to set up, organize, restructure or index project docs, write or update a doc (architecture, how-to, reference, runbook, decision record), find the docs for a file, or check that docs are up to date.
4
+ license: MIT
5
+ metadata:
6
+ author: Daniel Illescas Romero <illescas.daniel@protonmail.com>
7
+ version: "1.1.0"
8
+ tags: [documentation, docs, index, frontmatter, staleness]
4
9
  ---
5
10
 
6
11
  # docs-1
@@ -91,6 +96,7 @@ Use this when cutting a release or fixing a failed one.
91
96
 
92
97
  ## Setting up or reorganizing existing docs
93
98
 
99
+ 0. Create the `docs/` folder if the project has none; the script exits with `no docs folder at docs` without it.
94
100
  1. Inventory: list the Markdown docs (`docs/`, `README.md`, `ARCHITECTURE.md`, other top-level guides). Leave `README.md`,
95
101
  `AGENTS.md`, `CLAUDE.md`, `CHANGELOG.md` and license files where they are; they are not indexed docs.
96
102
  2. Show the user the plan before moving files: which files get frontmatter, which move into which area, which are split.
@@ -100,6 +106,29 @@ Use this when cutting a release or fixing a failed one.
100
106
  4. Run `docs_index.py write` and `docs_index.py check`, and fix what it reports.
101
107
  5. Add the docs paragraph from this skill's README to `AGENTS.md` (or `CLAUDE.md`) so every agent starts at the index.
102
108
 
109
+ ## Scripts
110
+
111
+ Run it with `python3 <skill dir>/scripts/docs_index.py [--docs DIR] <command>`.
112
+
113
+ | Script | Purpose | Main arguments |
114
+ | --- | --- | --- |
115
+ | `docs_index.py write` | Regenerate `INDEX.md` from the docs' frontmatter | none |
116
+ | `docs_index.py check` | Print `ERROR`, `STALE?` and `WARN` lines; exit 1 if there are errors | none |
117
+ | `docs_index.py covers` | List the docs whose `covers` match the given files | one or more paths |
118
+ | `docs_index.py next-id` | Print the next free `DOC-n` | none |
119
+ | `docs_index.py verify` | Stamp `verified: <today> <HEAD>` on the given docs; exit 1 if an ID is unknown | one or more IDs |
120
+
121
+ `--docs DIR` defaults to `docs`; run from the repository root.
122
+
123
+ ## Requirements and limits
124
+
125
+ - Python 3.9 or newer, standard library only. Without a shell, keep the frontmatter and `docs/INDEX.md` consistent by hand.
126
+ - Staleness needs a git repository with history: outside git, or if `git` is missing, `check` still validates fields and
127
+ links but cannot flag stale docs. A shallow clone may lack the `verified` commit; it then compares by date.
128
+ - `check` reads every Markdown file under the repository (skipping `node_modules`, `vendor`, `dist`, `build`, `target`
129
+ and virtualenvs). It only reads files and runs read-only `git` commands; `write` regenerates the index files and `verify` edits the frontmatter of the docs you name.
130
+ - `ERROR` lines must be fixed (`check` exits 1). `STALE?` and `WARN` lines are prompts to re-check, not failures.
131
+
103
132
  ## Rules
104
133
 
105
134
  - Never delete a doc that has history value; supersede or deprecate it and move it to `docs/archive/`.
@@ -1,6 +1,11 @@
1
1
  ---
2
2
  name: memory-1
3
3
  description: Keep a portable, git-tracked memory of what the code cannot tell a future session (what we are doing and what is next, decisions and why, reversals, user preferences, incidents) as a short status file plus one-fact Markdown notes with dates and supersession, and an optional archive of condensed session transcripts. Use at session start, when the user asks why something is the way it is or what was decided before, after a decision or reversal, when the user states a preference or corrects you, after an incident is resolved, before ending a session, and when asked to set up memory or export past sessions.
4
+ license: MIT
5
+ metadata:
6
+ author: Daniel Illescas Romero <illescas.daniel@protonmail.com>
7
+ version: "1.1.0"
8
+ tags: [memory, notes, decisions, sessions]
4
9
  ---
5
10
 
6
11
  # memory-1
@@ -15,8 +20,9 @@ memory/
15
20
  MEMORY.md index: one line per note (small memory) or one line per topic page (large memory)
16
21
  notes/<slug>.md one fact per file, dated, with status and supersession links
17
22
  topics/<topic>.md optional wiki page per subject: summary, how it evolved, links to its notes (see Growing)
18
- sessions/ optional: condensed transcripts of past sessions (exported, redacted)
19
- sessions/INDEX.md one line per session: date, file, what it was about
23
+ sessions/ optional, local only (git-ignored): condensed transcripts of past sessions (exported, redacted)
24
+ sessions/INDEX.md one line per session: date, file, what it was about (also local, never committed)
25
+ .gitignore one line, `/sessions`: keeps the archive out of git
20
26
  ```
21
27
 
22
28
  ## How to trust what you read
@@ -34,7 +40,12 @@ memory/
34
40
 
35
41
  1. Read `memory/NOW.md` and `memory/MEMORY.md`. Check `NOW.md` against `git log` and `git status` since its date:
36
42
  work listed as next may already be done. If `memory/` is missing and the user wants memory, set it up from
37
- `templates/` next to this file (NOW.md, MEMORY.md, and sessions/INDEX.md only if transcripts will be archived).
43
+ `templates/` next to this file (NOW.md, MEMORY.md, and, only if transcripts will be archived, sessions/INDEX.md and
44
+ `templates/.gitignore` as `memory/.gitignore`; if that file exists already, append its `/sessions` line instead).
45
+ While setting up, look for an existing project memory: a `memory/` folder in another layout, `memory-bank/`,
46
+ `.agemem/`, notes or status files, memory sections in `AGENTS.md` or `CLAUDE.md`. If you find one, tell the user what
47
+ it is and propose a migration: current status to `NOW.md`, open items to `LATER.md`, each durable fact or decision to
48
+ a note with its original date, then the index. Keep the old files until the user confirms they can be removed.
38
49
  2. When the user says "continue" or "where were we", answer from `NOW.md` (checked against git), then the notes.
39
50
  3. Open individual notes only when the task touches them. For history questions, read the topic page if there is
40
51
  one, then search `memory/notes/` and `memory/sessions/` with grep before answering. Topic pages summarise: take
@@ -219,7 +230,7 @@ Help pages render in a bundled Chromium (CEF) view ([help-view-cef](../notes/hel
219
230
  The archive keeps the detail that notes summarise away. Export past sessions with the script next to this file:
220
231
 
221
232
  ```bash
222
- python3 <skill dir>/scripts/export_sessions.py --project . --out memory/sessions
233
+ python3 <skill dir>/scripts/export_sessions.py --project .
223
234
  ```
224
235
 
225
236
  It reads Claude Code (`~/.claude/projects/`), Codex (`~/.codex/sessions/`) and opencode (its SQLite database,
@@ -238,8 +249,13 @@ same way. Entire needs a commit before a session has a checkpoint.
238
249
  After exporting, add one line per new session to `memory/sessions/INDEX.md` (and refresh the line of an updated one):
239
250
  `- 2026-10-05 [2026-10-05-1a2b3c4d.md](2026-10-05-1a2b3c4d.md): secret scanner batching vs per-line requests; moved v0.3.0 tag`.
240
251
 
241
- Transcripts are personal working history. By default `memory/sessions/` is git-ignored (the template ships a
242
- `.gitignore`); remove it to share the archive with the team, after checking that the redaction is enough.
252
+ Transcripts are personal working history: the whole archive, `INDEX.md` included, stays on this machine, ignored by
253
+ `memory/.gitignore` (`/sessions`). To share a decision or a reason with the team, write a note in `memory/notes/`.
254
+ In a linked git worktree the archive lives in the main checkout: the exporter writes there, collects the sessions of
255
+ every worktree, and links `memory/sessions` to it when it can.
256
+
257
+ If `git ls-files memory/sessions` lists anything (an older setup committed it), run `git rm -r --cached memory/sessions`
258
+ and add the `/sessions` rule to `memory/.gitignore`; the old copies stay in git history.
243
259
 
244
260
  ## End of session
245
261
 
@@ -258,7 +274,25 @@ Without a shell, count instead: `NOW.md` at most 50 lines, `LATER.md` at most 40
258
274
 
259
275
  ## Alongside other memory
260
276
 
261
- - If memory-bank is installed, its `activeContext.md` and `progress.md` play the role of `NOW.md`: use them instead
262
- and skip `NOW.md`. Do not copy decision notes into them.
263
277
  - Rules the agent must always follow belong in `AGENTS.md` or `CLAUDE.md`. Point `AGENTS.md` at `memory/MEMORY.md`
264
278
  so agents that do not load skills still find the memory.
279
+
280
+ ## Scripts
281
+
282
+ Run them with `python3 <skill dir>/scripts/<name>`.
283
+
284
+ | Script | Purpose | Main arguments |
285
+ | --- | --- | --- |
286
+ | `memory_check.py` | Check the memory folder: size limits, index coverage, supersession links; prints `FIX` lines | `--memory DIR` (default `memory`) |
287
+ | `export_sessions.py` | Export condensed, redacted transcripts of this project's past sessions | `--project DIR`, `--out DIR`, `--since YYYY-MM-DD`, `--max-chars N`, `--claude-dir DIR` (repeatable), `--dry-run` |
288
+
289
+ ## Requirements and limits
290
+
291
+ - Python 3.9 or newer, standard library only. Without a shell, do the checks by hand (limits are under End of session).
292
+ - Transcript export is opt-in: run it only when the user wants an archive.
293
+ - It reads the local transcript stores of Claude Code, Codex and opencode, read-only, and keeps only sessions whose
294
+ working directory is inside this project or one of its git worktrees. Other projects' sessions are not written.
295
+ - The output stays on this machine, in the git-ignored `memory/sessions/`.
296
+ - Redaction is pattern-based and can miss things: skim an export before sharing anything from it.
297
+ - If a source is missing, or opencode's database is locked or unreadable, the script skips it with a note on stderr.
298
+ Re-run it later.
@@ -8,6 +8,9 @@ session has grown, so the script is safe to run at the end of every session.
8
8
  usage: export_sessions.py [--project DIR] [--out DIR] [--since YYYY-MM-DD] [--max-chars N] [--dry-run]
9
9
  export_sessions.py --claude-dir DIR ... (moved project, or worktrees outside it; repeatable)
10
10
  Prints one line per new or updated file; add those to sessions/INDEX.md.
11
+ In a git repository the sessions of all its worktrees are collected, and from a linked worktree the default --out is
12
+ the main checkout's memory/sessions (linked from the worktree when possible). The archive is kept out of git by a
13
+ `/sessions` line in memory/.gitignore, which the script adds when it is missing.
11
14
  Standard library only; Python 3.9+.
12
15
  """
13
16
  import argparse
@@ -15,15 +18,12 @@ import json
15
18
  import os
16
19
  import re
17
20
  import sqlite3
21
+ import subprocess
18
22
  import sys
19
23
  from datetime import datetime, timezone
20
24
  from functools import partial
21
25
  from pathlib import Path
22
26
 
23
- # agentic-loadout:begin entire-import
24
- import subprocess
25
- # agentic-loadout:end entire-import
26
-
27
27
  HOME = Path.home()
28
28
  CLAUDE_ROOT = Path(os.environ.get("CLAUDE_CONFIG_DIR", HOME / ".claude")) / "projects"
29
29
  CODEX_ROOT = Path(os.environ.get("CODEX_HOME", HOME / ".codex")) / "sessions"
@@ -130,8 +130,8 @@ def opencode_db(note=True):
130
130
  return None
131
131
 
132
132
 
133
- def opencode_sessions(project):
134
- """Return ids of opencode's own (not subagent) sessions whose working directory is inside the project."""
133
+ def opencode_sessions(roots):
134
+ """Return ids of opencode's own (not subagent) sessions whose working directory is inside the project or a worktree."""
135
135
  db = opencode_db()
136
136
  if not db:
137
137
  return []
@@ -143,7 +143,7 @@ def opencode_sessions(project):
143
143
  return []
144
144
  finally:
145
145
  db.close()
146
- return [sid for sid, directory in rows if inside(directory, project)]
146
+ return [sid for sid, directory in rows if any(inside(directory, root) for root in roots)]
147
147
 
148
148
 
149
149
  def read_opencode(sid, path):
@@ -190,25 +190,74 @@ def inside(cwd, project):
190
190
  return bool(cwd) and (Path(cwd) == project or project in Path(cwd).parents)
191
191
 
192
192
 
193
- def find_sessions(project, claude_dirs):
193
+ def git_out(project, *args):
194
+ """Stdout of `git -C project args`, or None when git is missing, fails or is not a repository."""
195
+ try:
196
+ done = subprocess.run(["git", "-C", str(project), *args], capture_output=True, text=True, check=False, timeout=30)
197
+ except (OSError, subprocess.SubprocessError):
198
+ return None
199
+ return done.stdout.strip() if done.returncode == 0 else None
200
+
201
+
202
+ def git_layout(project):
203
+ """Return (in_repo, main checkout when project is a linked worktree else None, every worktree path of the repo)."""
204
+ git_dir, common, top = (git_out(project, "rev-parse", *a) for a in (("--git-dir",), ("--git-common-dir",), ("--show-toplevel",)))
205
+ if not (git_dir and common and top and Path(top).resolve() == project):
206
+ return False, None, [project]
207
+ git_dir, common = (Path(project, d).resolve() for d in (git_dir, common)) # relative answers are relative to project
208
+ main = common.parent if git_dir != common and common.name == ".git" else None
209
+ roots = [project] + [Path(line[9:]).resolve() for line in (git_out(project, "worktree", "list", "--porcelain") or "").splitlines()
210
+ if line.startswith("worktree ")]
211
+ return True, main, list(dict.fromkeys(roots))
212
+
213
+
214
+ def link_archive(local, target):
215
+ """Best effort: make a worktree's memory/sessions a symlink to the main checkout's archive."""
216
+ try:
217
+ if local.is_symlink() or (local.exists() and (not local.is_dir() or any(local.iterdir()))):
218
+ return
219
+ target.mkdir(parents=True, exist_ok=True)
220
+ if local.exists():
221
+ local.rmdir()
222
+ local.parent.mkdir(parents=True, exist_ok=True)
223
+ local.symlink_to(target, target_is_directory=True)
224
+ except OSError as err:
225
+ print(f"could not link {local} to {target} ({err}); sessions are still written there", file=sys.stderr)
226
+
227
+
228
+ def ensure_ignored(out):
229
+ """Keep the archive out of git: a `/sessions` line in the memory folder's .gitignore (no slash at the end, so it
230
+ also matches a symlink)."""
231
+ gitignore = out.parent / ".gitignore"
232
+ try:
233
+ old = gitignore.read_text(encoding="utf-8") if gitignore.exists() else ""
234
+ if any(line.strip() in ("/sessions", "/sessions/", "sessions", "sessions/") for line in old.splitlines()):
235
+ return
236
+ gitignore.write_text(old + ("\n" if old and not old.endswith("\n") else "") + "/sessions\n", encoding="utf-8")
237
+ except OSError as err:
238
+ print(f"could not update {gitignore} ({err}); keep {out.name}/ out of git yourself", file=sys.stderr)
239
+
240
+
241
+ def find_sessions(project, claude_dirs, roots=None):
242
+ roots = roots or [project]
194
243
  found = []
195
244
  if claude_dirs:
196
245
  found += [("claude", p, read_claude) for d in claude_dirs for p in sorted(Path(d).glob("*.jsonl"))]
197
246
  elif CLAUDE_ROOT.is_dir():
198
247
  # Claude Code keeps a project's sessions under its absolute path with every non-alphanumeric character as "-";
199
248
  # worktrees inside the project get sibling folders with a longer name. Confirm each by its recorded cwd.
200
- enc = re.sub(r"[^A-Za-z0-9]", "-", str(project))
249
+ encoded = [re.sub(r"[^A-Za-z0-9]", "-", str(root)) for root in roots]
201
250
  for cdir in sorted(CLAUDE_ROOT.iterdir()):
202
- if cdir.name == enc or cdir.name.startswith(enc + "-"):
251
+ if any(cdir.name == enc or cdir.name.startswith(enc + "-") for enc in encoded):
203
252
  found += [("claude", p, read_claude) for p in sorted(cdir.glob("*.jsonl"))
204
- if cdir.name == enc or inside(claude_cwd(p), project)]
253
+ if cdir.name in encoded or any(inside(claude_cwd(p), root) for root in roots)]
205
254
  if CODEX_ROOT.is_dir():
206
255
  for path in sorted(CODEX_ROOT.rglob("*.jsonl")):
207
256
  meta = codex_meta(path)
208
257
  # Codex stores each subagent and automatic review as its own rollout; only the user's own sessions count.
209
- if inside(meta.get("cwd"), project) and not (isinstance(meta.get("source"), dict) and "subagent" in meta["source"]):
258
+ if any(inside(meta.get("cwd"), root) for root in roots) and not (isinstance(meta.get("source"), dict) and "subagent" in meta["source"]):
210
259
  found.append(("codex", path, read_codex))
211
- found += [("opencode", OPENCODE_DB, partial(read_opencode, sid)) for sid in opencode_sessions(project)]
260
+ found += [("opencode", OPENCODE_DB, partial(read_opencode, sid)) for sid in opencode_sessions(roots)]
212
261
  return found
213
262
 
214
263
 
@@ -339,11 +388,15 @@ def render_entire(slot, session_id, data, max_chars, warn):
339
388
 
340
389
 
341
390
  def entire_gitignore(out):
342
- """A fresh archive is git-ignored like the template; an archive that was shared on purpose is left alone."""
343
- if (out / ".gitignore").exists() or any(p.name != "INDEX.md" for p in out.glob("*.md")):
391
+ """Keep a fresh archive out of git like the template: a `/sessions` line in the memory folder's .gitignore."""
392
+ if out.name != "sessions":
344
393
  return
345
- out.mkdir(parents=True, exist_ok=True)
346
- (out / ".gitignore").write_text("*\n!.gitignore\n!INDEX.md\n", encoding="utf-8")
394
+ gitignore = out.parent / ".gitignore"
395
+ old = gitignore.read_text(encoding="utf-8") if gitignore.exists() else ""
396
+ if any(line.strip() in ("/sessions", "/sessions/", "sessions", "sessions/") for line in old.splitlines()):
397
+ return
398
+ out.parent.mkdir(parents=True, exist_ok=True)
399
+ gitignore.write_text(old + ("\n" if old and not old.endswith("\n") else "") + "/sessions\n", encoding="utf-8")
347
400
 
348
401
 
349
402
  def export_entire(project, out, since=None, max_chars=6000, dry_run=False, log=print, warn=None, planned=()):
@@ -413,7 +466,8 @@ def entire_main(project, out, args, planned=()):
413
466
  def main(argv=None):
414
467
  ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
415
468
  ap.add_argument("--project", default=".", help="project root whose sessions to export (default: .)")
416
- ap.add_argument("--out", default="memory/sessions", help="output folder (default: memory/sessions)")
469
+ ap.add_argument("--out", help="output folder (default: memory/sessions, or the main checkout's when run in a "
470
+ "linked git worktree)")
417
471
  ap.add_argument("--claude-dir", action="append", help="Claude Code transcript folder to use instead of the "
418
472
  "default lookup (repeatable; for moved projects or worktrees outside the project)")
419
473
  ap.add_argument("--since", help="only sessions whose first message is on or after this date (YYYY-MM-DD)")
@@ -426,8 +480,13 @@ def main(argv=None):
426
480
  args = ap.parse_args(argv)
427
481
 
428
482
  project = Path(args.project).resolve()
429
- out = Path(args.out)
430
- sessions = find_sessions(project, args.claude_dir)
483
+ in_repo, main_checkout, roots = git_layout(project)
484
+ out = Path(args.out) if args.out else Path("memory/sessions")
485
+ if not args.out and main_checkout:
486
+ out = main_checkout / "memory" / "sessions"
487
+ if not args.dry_run:
488
+ link_archive(project / "memory" / "sessions", out)
489
+ sessions = find_sessions(project, args.claude_dir, roots)
431
490
  # agentic-loadout:begin entire-only
432
491
  if args.entire and not sessions:
433
492
  return entire_main(project, out, args)
@@ -452,6 +511,8 @@ def main(argv=None):
452
511
  if not args.dry_run:
453
512
  out.mkdir(parents=True, exist_ok=True)
454
513
  target.write_text(text, encoding="utf-8")
514
+ if in_repo and out.name == "sessions" and inside(out.resolve(), main_checkout or project):
515
+ ensure_ignored(out.resolve())
455
516
  print(f"{state:8} {target} ({client}, {len(text) // 1024} KB)")
456
517
  print(", ".join(f"{v} {k}" for k, v in counts.items()), file=sys.stderr)
457
518
  # agentic-loadout:begin entire-run
@@ -0,0 +1,2 @@
1
+ # Session transcripts stay on this machine. No trailing slash, so a worktree symlink matches too.
2
+ /sessions
@@ -1,5 +1,5 @@
1
1
  - This project's `memory/` still holds files from the previous memory system (agemem): `activeContext.md`,
2
2
  `progress.md`, `decisions.md`, `archive.md` and the `.agemem/` folder. They are not memory-1 files: do not read them
3
- at session start, and ignore the skill's memory-bank shortcut (here `NOW.md` is the status file). When the user
3
+ at session start (`NOW.md` is the status file). When the user
4
4
  agrees, migrate them (current state to `NOW.md` and `LATER.md`, each dated decision to a note under `memory/notes/`,
5
5
  keeping its date and why), then delete the old files and `.agemem/` and re-run agentic-loadout to drop this item.
@@ -8,10 +8,10 @@ WORKTREE_SKILL = "illescasDaniel/worktree-skill"
8
8
  WORKTREE_SKILL_REF = "37674c26b84eca9df37d8dafccc367da7455d079"
9
9
  WORKTREE_SKILL_NAME = "worktree"
10
10
  MEMORY_SKILL = "illescasDaniel/memory-1-skill"
11
- MEMORY_SKILL_REF = "9572f47adf262f262600e2e36fd58f3af19be43f"
11
+ MEMORY_SKILL_REF = "cc8af695783d69982433bf8537f053bb7da1f4bc"
12
12
  MEMORY_SKILL_NAME = "memory-1"
13
13
  DOCS_SKILL = "illescasDaniel/docs-1-skill"
14
- DOCS_SKILL_REF = "0fdbd5fbc39a7f5e6f8efb76a688ba3b734fcde9"
14
+ DOCS_SKILL_REF = "c1f75fc38a04ba8b8dc0c9a3cc8621c48d893c11"
15
15
  DOCS_SKILL_NAME = "docs-1"
16
16
  LEGACY_WRAPUP_SKILL_NAME = "memory-wrapup" # installed by loadout 0.6.x from the agemem repo; removed on upgrade
17
17
  CODENAV_SPEC = "codenav-mcp>=0.2.1,<0.3"
@@ -151,15 +151,20 @@ def test_an_existing_session_file_is_never_rewritten(repo):
151
151
  assert (out / "2026-11-02-b09edd59.md").read_text() == "from the agent's own transcript"
152
152
 
153
153
 
154
- def test_fresh_archive_is_git_ignored_but_a_shared_archive_is_left_alone(repo):
154
+ def test_fresh_archive_is_git_ignored_through_the_memory_folder(repo):
155
155
  commit_ref(repo, "refs/entire/checkpoints/7X/01AAAA", session_files(CODEX_ID, "codex", TURNS))
156
156
  assert run(repo) == 0
157
- assert (repo / "memory/sessions/.gitignore").read_text().startswith("*")
158
- shared = repo / "other/sessions"
159
- shared.mkdir(parents=True)
160
- (shared / "2026-10-01-aaaaaaaa.md").write_text("an earlier shared session")
161
- assert exporter.main(["--project", str(repo), "--out", str(shared), "--entire"]) == 0
162
- assert not (shared / ".gitignore").exists()
157
+ assert (repo / "memory/.gitignore").read_text().splitlines() == ["/sessions"]
158
+ assert not (repo / "memory/sessions/.gitignore").exists()
159
+ # an existing memory/.gitignore is extended, not replaced, and not extended twice
160
+ (repo / "memory/.gitignore").write_text("scratch")
161
+ other = repo / "memory/sessions"
162
+ exporter.entire_gitignore(other)
163
+ exporter.entire_gitignore(other)
164
+ assert (repo / "memory/.gitignore").read_text() == "scratch\n/sessions\n"
165
+ # an archive folder with another name is not touched
166
+ exporter.entire_gitignore(repo / "other/archive")
167
+ assert not (repo / "other/.gitignore").exists()
163
168
 
164
169
 
165
170
  def test_unknown_transcript_format_is_skipped_with_a_warning(repo, capsys):
@@ -0,0 +1,124 @@
1
+ """The session archive of the adapted memory-1 export_sessions.py stays out of git and is shared across git worktrees.
2
+ Everything is synthetic: the agents' folders are monkeypatched to temporary ones, so no real transcript is read."""
3
+
4
+ import importlib.util
5
+ import json
6
+ import re
7
+ import shutil
8
+ import subprocess
9
+ import sys
10
+ from pathlib import Path
11
+
12
+ import pytest
13
+
14
+ SCRIPT = Path(__file__).parent.parent / "src/agentic_loadout/assets/skills/memory-1/scripts/export_sessions.py"
15
+ spec = importlib.util.spec_from_file_location("export_sessions_worktree", SCRIPT)
16
+ exporter = importlib.util.module_from_spec(spec)
17
+ sys.modules[spec.name] = exporter
18
+ spec.loader.exec_module(exporter)
19
+
20
+ pytestmark = pytest.mark.skipif(shutil.which("git") is None, reason="git is not on PATH")
21
+
22
+
23
+ def git(repo, *args):
24
+ done = subprocess.run(["git", "-C", str(repo), "-c", "user.email=a@b", "-c", "user.name=x", *args],
25
+ capture_output=True, text=True, check=True)
26
+ return done.stdout.strip()
27
+
28
+
29
+ @pytest.fixture
30
+ def claude_root(tmp_path, monkeypatch):
31
+ home = tmp_path / "agent-home"
32
+ monkeypatch.setattr(exporter, "HOME", home)
33
+ monkeypatch.setattr(exporter, "CLAUDE_ROOT", home / ".claude/projects")
34
+ monkeypatch.setattr(exporter, "CODEX_ROOT", home / ".codex/sessions")
35
+ monkeypatch.setattr(exporter, "OPENCODE_DB", home / "opencode/opencode.db")
36
+ return home / ".claude/projects"
37
+
38
+
39
+ def write_session(claude_root, cwd, sid):
40
+ """A Claude Code transcript whose recorded working directory is `cwd`, in the folder Claude Code would use."""
41
+ folder = claude_root / re.sub(r"[^A-Za-z0-9]", "-", str(cwd))
42
+ folder.mkdir(parents=True, exist_ok=True)
43
+ events = [{"type": "user", "cwd": str(cwd), "timestamp": "2026-11-01T10:00:00Z", "message": {"content": f"question {sid}"}},
44
+ {"type": "assistant", "timestamp": "2026-11-01T10:01:00Z", "message": {"content": [{"type": "text", "text": "answer"}]}}]
45
+ (folder / f"{sid}.jsonl").write_text("\n".join(json.dumps(e) for e in events) + "\n", encoding="utf-8")
46
+
47
+
48
+ def init_repo(path):
49
+ path.mkdir(parents=True)
50
+ git(path, "init", "-q")
51
+ (path / "README.md").write_text("x")
52
+ git(path, "add", "-A")
53
+ git(path, "commit", "-qm", "init")
54
+ return path.resolve()
55
+
56
+
57
+ def test_a_fresh_repo_gets_a_gitignore_for_the_archive_and_no_session_file_shows_in_git(tmp_path, claude_root, monkeypatch):
58
+ repo = init_repo(tmp_path / "proj")
59
+ write_session(claude_root, repo, "aaaaaaaa-1111")
60
+ monkeypatch.chdir(repo)
61
+ assert exporter.main(["--project", str(repo)]) == 0
62
+ assert (repo / "memory/.gitignore").read_text().splitlines() == ["/sessions"]
63
+ assert not (repo / "memory/sessions/.gitignore").exists()
64
+ assert list((repo / "memory/sessions").glob("*.md"))
65
+ assert git(repo, "status", "--porcelain", "--untracked-files=all").splitlines() == ["?? memory/.gitignore"]
66
+ # an existing memory/.gitignore keeps its lines; the rule is appended once
67
+ (repo / "memory/.gitignore").write_text("scratch")
68
+ assert exporter.main(["--project", str(repo), "--since", "2000-01-01"]) == 0
69
+ (repo / "memory/sessions/2026-11-01-aaaaaaaa.md").write_text("old")
70
+ assert exporter.main(["--project", str(repo)]) == 0
71
+ assert (repo / "memory/.gitignore").read_text() == "scratch\n/sessions\n"
72
+
73
+
74
+ def test_b_linked_worktree_writes_to_the_main_checkout_and_both_see_every_session(tmp_path, claude_root, monkeypatch):
75
+ main = init_repo(tmp_path / "main")
76
+ (main / "memory").mkdir()
77
+ (main / "memory/.gitignore").write_text("/sessions\n")
78
+ git(main, "add", "-A")
79
+ git(main, "commit", "-qm", "memory")
80
+ wt = tmp_path / "elsewhere" / "wt"
81
+ git(main, "worktree", "add", "-q", str(wt))
82
+ wt = wt.resolve()
83
+ write_session(claude_root, wt, "aaaaaaaa-1111")
84
+ write_session(claude_root, main, "bbbbbbbb-2222")
85
+
86
+ monkeypatch.chdir(wt)
87
+ assert exporter.main(["--project", str(wt)]) == 0
88
+ archive = main / "memory/sessions"
89
+ assert sorted(p.name for p in archive.glob("*.md")) == ["2026-11-01-aaaaaaaa.md", "2026-11-01-bbbbbbbb.md"]
90
+ assert git(main, "status", "--porcelain", "--untracked-files=all") == ""
91
+ assert git(wt, "status", "--porcelain", "--untracked-files=all") == ""
92
+ link = wt / "memory/sessions"
93
+ if link.is_symlink(): # a symlink can fail on Windows without privileges; the export must not
94
+ assert link.resolve() == archive.resolve()
95
+ assert git(wt, "status", "--porcelain", "--untracked-files=all") == ""
96
+
97
+ for p in archive.glob("*.md"):
98
+ p.unlink()
99
+ monkeypatch.chdir(main)
100
+ assert exporter.main(["--project", str(main)]) == 0
101
+ assert sorted(p.name for p in archive.glob("*.md")) == ["2026-11-01-aaaaaaaa.md", "2026-11-01-bbbbbbbb.md"]
102
+ assert git(main, "status", "--porcelain", "--untracked-files=all") == ""
103
+
104
+
105
+ def test_an_explicit_out_is_respected_in_a_worktree(tmp_path, claude_root, monkeypatch):
106
+ main = init_repo(tmp_path / "main")
107
+ wt = tmp_path / "wt"
108
+ git(main, "worktree", "add", "-q", str(wt))
109
+ wt = wt.resolve()
110
+ write_session(claude_root, wt, "aaaaaaaa-1111")
111
+ assert exporter.main(["--project", str(wt), "--out", str(tmp_path / "mine")]) == 0
112
+ assert (tmp_path / "mine/2026-11-01-aaaaaaaa.md").is_file()
113
+ assert not (main / "memory").exists() and not (wt / "memory").exists()
114
+
115
+
116
+ def test_without_git_it_behaves_as_before(tmp_path, claude_root, monkeypatch):
117
+ project = (tmp_path / "plain").resolve()
118
+ project.mkdir()
119
+ write_session(claude_root, project, "aaaaaaaa-1111")
120
+ monkeypatch.chdir(project)
121
+ monkeypatch.setenv("PATH", str(tmp_path / "no-git-here"))
122
+ assert exporter.main(["--project", str(project)]) == 0
123
+ assert (project / "memory/sessions/2026-11-01-aaaaaaaa.md").is_file()
124
+ assert not (project / "memory/.gitignore").exists()
@@ -53,7 +53,7 @@ def test_memory_and_docs_skills_are_copied_from_the_shipped_files_without_npx(re
53
53
  for folder in (".claude/skills", ".agents/skills"):
54
54
  for rel, data in skills.vendored_files(name).items():
55
55
  assert (repo / folder / name / rel).read_bytes() == data, (folder, name, rel)
56
- assert (repo / ".claude/skills/memory-1/templates/sessions/.gitignore").is_file()
56
+ assert (repo / ".claude/skills/memory-1/templates/.gitignore").is_file()
57
57
  installed = {c[c.index("add") + 1].split("#")[0] for c, _env in executor.calls if "add" in c}
58
58
  assert installed == {pins.SDD_SKILL, pins.WORKTREE_SKILL} # memory-1 and docs-1 need no download
59
59
  assert not any("uvx" in c[0] for c, _env in executor.calls)
@@ -126,7 +126,7 @@ def test_upgrade_removes_only_agemem_entries_and_leaves_the_users_memory(repo):
126
126
  assert "Left on disk" in out and ".agemem/" in out and "memory/activeContext.md" in out
127
127
  rules = (repo / "AGENTS.md").read_text()
128
128
  assert "Agemem" not in rules and "project_memory" not in rules and "# mine" in rules
129
- assert "previous memory system (agemem)" in rules and "ignore the skill's memory-bank shortcut" in rules
129
+ assert "previous memory system (agemem)" in rules
130
130
 
131
131
 
132
132
  def test_upgrade_is_idempotent(repo):
@@ -244,6 +244,7 @@ def test_rules_and_agents_mention_no_agemem_tools():
244
244
  text = path.read_text(encoding="utf-8")
245
245
  if path.name == "memory-legacy.md":
246
246
  continue
247
+ text = text.replace(".agemem/", "") # memory-1 names the old folder when it looks for a memory to migrate
247
248
  assert "project_memory" not in text and "mcp__agemem" not in text and "agemem" not in text.lower(), path
248
249
 
249
250
 
@@ -28,7 +28,7 @@ def vendored_files():
28
28
  def test_the_manifest_lists_exactly_the_vendored_files():
29
29
  assert set(MANIFEST) == vendored_files()
30
30
  assert {"memory-1/SKILL.md", "memory-1/scripts/export_sessions.py", "memory-1/scripts/memory_check.py",
31
- "memory-1/templates/sessions/.gitignore", "docs-1/SKILL.md", "docs-1/scripts/docs_index.py"} <= set(MANIFEST)
31
+ "memory-1/templates/.gitignore", "docs-1/SKILL.md", "docs-1/scripts/docs_index.py"} <= set(MANIFEST)
32
32
 
33
33
 
34
34
  def test_stripping_the_marked_blocks_reproduces_the_recorded_upstream_hashes():
@@ -4,7 +4,7 @@ requires-python = ">=3.11"
4
4
 
5
5
  [[package]]
6
6
  name = "agentic-loadout"
7
- version = "0.7.2"
7
+ version = "0.7.4"
8
8
  source = { editable = "." }
9
9
  dependencies = [
10
10
  { name = "pyyaml" },
@@ -1 +0,0 @@
1
- __version__ = "0.7.2"
File without changes
File without changes