memory-init

Initialize the Memory Hub for a project: create .memory/ skeleton, scan the project, and populate initial knowledge files and catalog.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "memory-init" with this command: npx skills add iyangl/memory-hub/iyangl-memory-hub-memory-init

Purpose

Initialize the Memory Hub for a project: create .memory/ skeleton, scan the project, and populate initial knowledge files and catalog.

Input

No arguments required. Run from the project root.

Required Flow

Step 1: Create skeleton

memory-hub init

If ALREADY_INITIALIZED error, stop and inform the user.

Step 2: Scan project and generate tech-stack knowledge

  • Read the project root file listing

  • Read package manager files (package.json , pyproject.toml , Cargo.toml , go.mod , pom.xml , etc.)

  • Read entry files (main.* , index.* , app.* , server.* , etc.)

  • Read config files (.env.example , tsconfig.json , webpack.config.* , etc.)

Generate tech-stack.md content, write it to .memory/architect/tech-stack.md , then register it:

memory-hub index architect tech-stack.md
--topic tech-stack --summary "技术栈、关键依赖、使用方式与限制"

Step 3: Generate code conventions knowledge

Based on project structure from Step 2, generate conventions.md , write it to .memory/dev/conventions.md , then register it:

memory-hub index dev conventions.md
--topic conventions --summary "目录命名规则、模块组织方式、代码约定"

Step 4: Scan project modules and generate Catalog

Analyze directory structure, identify functional domains and key files, construct JSON:

Write the JSON to a temporary file, then run:

memory-hub catalog-update --file /tmp/modules.json

Step 5: Quality gate

  • List unknowns — files/directories that don't clearly belong to any functional domain

  • Check catalog.repair output (auto-triggered by catalog-update):

  • ai_actions non-empty → execute self-healing, then run memory-hub catalog-repair again to confirm cleared

  • manual_actions non-empty → report to user

Step 6: Output summary

Report: files created, modules identified, unknowns requiring user confirmation.

Output

JSON envelope from each command. Final summary to user.

Error Handling

  • ALREADY_INITIALIZED → inform user, do not proceed

  • Any command failure → stop and report the error

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

catalog-repair

No summary provided by upstream source.

Repository SourceNeeds Review
General

memory-read

No summary provided by upstream source.

Repository SourceNeeds Review
General

memory-search

No summary provided by upstream source.

Repository SourceNeeds Review