agentleFS
vasilievyakovvasilievyakov/miracle-infrastructure/skills/memory-init/SKILL.md

memory-init

Skill17 starsChanged 9 months agoMITView on GitHub

First-run setup wizard for the memory system. Creates directory structure, config, and starter files. Use when: (1) First time using Miracle Infrastructure, (2) "Initialize memory", (3) Setting up on new machine. Triggers: "/memory-init", "initialize memory", "setup memory".

6 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 6

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the directory exists and has content, warn:

    line 21
  2. Distinctive:

    Wait for confirmation before proceeding.

    line 30
  3. Very specific:

    Check for GitHub remote: git -C {path} remote get-url origin 2>/dev/null

    line 72
  4. Distinctive:

    Create the fallback "general" project:

    line 132
  5. Distinctive:

    If the test file exists in the Miracle Infrastructure installation:

    line 184
  6. Distinctive:

    If not available, inform the user where to find it.

    line 190
  7. Distinctive:

    Run a quick health check:

    line 196

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Memory Init - Setup Wizard

Creates the full memory directory structure, configuration, and starter files. Safe to re-run (idempotent).


Step 1: Check existing setup

ls ~/.claude/memory/ 2>/dev/null

If the directory exists and has content, warn:

Memory system already exists at ~/.claude/memory/
Found: {N} dossiers, {N} observation files, MEMORY.md

Re-running will not overwrite existing files. Only missing pieces will be created.
Continue? (yes/no)

Wait for confirmation before proceeding.


Step 2: Create directory structure

mkdir -p ~/.claude/memory/projects
mkdir -p ~/.claude/memory/tests

Step 3: Create memory-config.json

Write ~/.claude/memory/memory-config.json

Content:

{
  "memory_path": "~/.claude/memory",
  "projects": {},
  "fallback_project": "general",
  "max_dossier_lines": 200,
  "observation_types": ["decision", "bugfix", "feature", "discovery", "problem"]
}

Step 4: Auto-detect projects

Scan for git repositories to pre-populate the config:

find ~ -maxdepth 3 -name ".git" -type d 2>/dev/null | head -20

For each found repo:

  1. Extract the directory name as project slug
  2. Check for GitHub remote: git -C {path} remote get-url origin 2>/dev/null
  3. Generate keyword suggestions from the directory name

Present findings to user:

Found {N} git repositories. Want to add any to memory?

1. ~/projects/my-app (github.com/user/my-app)
2. ~/work/dashboard (no remote)
3. ~/experiments/chatbot (github.com/user/chatbot)

Enter numbers to add (e.g., 1 3), or skip:

For selected projects, update memory-config.json with entries:

{
  "project-slug": {
    "keywords": ["project", "slug"],
    "github": "user/repo",
    "path": "~/projects/my-app"
  }
}

Step 5: Create starter MEMORY.md

Write ~/.claude/memory/MEMORY.md

Content:

# Memory Index

## Active Projects
| Project | Dossier | Observations | GitHub |
|---------|---------|-------------|--------|
| General | `projects/general.md` | `*.observations.md` (0 entries) | - |

## Open Problems
(none yet)

## Workflow
- On project mention: load dossier + observations from memory/projects/
- During work: record significant observations (auto-observe rule)
- End of session: run /session-save

## Infrastructure
- Config: ~/.claude/memory/memory-config.json
- Skills: session-save, search-memory, memory-health, project-status
- Rules: session-start, session-end, auto-observe

Step 6: Create general dossier and observations

Create the fallback "general" project:

Write ~/.claude/memory/projects/general.md
# General

## Status
Permanent. Catch-all for sessions not tied to a specific project.

## Description
Default dossier for miscellaneous work: infrastructure setup, research, experiments, one-off tasks.

## Current State
- Last session: {today}
- Done: Memory system initialized
- Uncommitted: no

## Unresolved Problems
(none)

## Decisions Made
- [{today}] Initialized Miracle Infrastructure memory system

## Next Steps
1. Add projects to memory-config.json
2. Start using /session-save at end of work sessions

## Session History
- [{today}] Memory system initialized
Write ~/.claude/memory/projects/general.observations.md
# Observations - general

## Index
| # | Date | Type | Summary | Files |
|---|------|------|---------|-------|

## Details

Step 7: Copy integrity tests

If the test file exists in the Miracle Infrastructure installation:

cp {miracle_infra_path}/packs/memory/tests/test_memory_integrity.py ~/.claude/memory/tests/

If not available, inform the user where to find it.


Step 8: Verify

Run a quick health check:

python3 ~/.claude/memory/tests/test_memory_integrity.py 2>&1

Step 9: Confirmation

Memory system initialized!

Created:
- ~/.claude/memory/MEMORY.md
- ~/.claude/memory/memory-config.json
- ~/.claude/memory/projects/general.md
- ~/.claude/memory/projects/general.observations.md
- ~/.claude/memory/tests/test_memory_integrity.py

{N} projects detected and added to config.

Quick start:
- Work on a project, then run /session-save
- Search past work with /search-memory
- Check integrity with /memory-health

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.