用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill code-memory命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | code-memory |
| description | >- Use when this capability is needed. |
Persist understanding of code structure and implementation details gained during investigations so future sessions can ramp up quickly without re-reading source files.
| Input | Required | Description |
|---|---|---|
| Source file path(s) | Yes | The file(s) that were investigated or need investigation |
| Mode | No | save (write/update context), load (retrieve context), or auto (load first, save after investigation). Default: auto |
Map the source file path to a memory file path. The memory file mirrors the source path structure
inside the memory/ directory within this skill's folder.
Path mapping rule:
/ for consistency.md extensionExample mappings (repository root: D:\git\CoreWCF):
| Source File | Memory File |
|---|---|
src\CoreWCF.Http\src\ServiceModelHttpMiddleware.cs | memory/src/CoreWCF.Http/src/ServiceModelHttpMiddleware.cs.md |
src\CoreWCF.Primitives\src\Dispatcher\DispatchRuntime.cs | memory/src/CoreWCF.Primitives/src/Dispatcher/DispatchRuntime.cs.md |
The memory directory base path is: .copilot/skills/code-memory/memory/
Before reading a source file during an investigation:
Read and understand the source file(s). Focus on capturing:
Create or update the memory file with the gained understanding.
Memory file format:
# {ClassName} — {Brief one-line purpose}
**Source:** `{relative/path/to/source.cs}`
**Namespace:** `{Namespace}`
**Last validated:** {YYYY-MM-DD}
## Purpose
{1-3 sentences describing what this class does and why it exists}
## Key API
{List the important public methods/properties with brief descriptions of what they do,
their parameters, and return values. Focus on what callers need to know.}
## Internal Structure
{Describe how the class works internally. Key fields, state management,
the flow of important operations. This is the "how" that saves future readers
from having to trace through the code.}
## Dependencies
{What does this class depend on? DI-injected services, static helpers, base classes.
Note how dependencies are obtained and used.}
## Design Notes
{Patterns used, threading model, non-obvious behavior, gotchas, important
invariants that must be maintained. Only include if there's something
worth noting.}
## Relationships
{How does this class fit into the broader system? What calls it?
What does it call? Key interaction flows.}
Writing guidelines:
When updating an existing memory file:
Before writing the memory file, ensure all parent directories in the memory path exist.
New-Item -ItemType Directory -Path "{parent_directory}" -Force
After saving context:
After loading context:
| Pitfall | Solution |
|---|---|
| Writing too much detail | Focus on structure and "why", not line-by-line description. Under 200 lines. |
| Stale context misleads | Always check source file timestamp against memory file timestamp |
| Context too shallow to be useful | Include internal structure and non-obvious behavior, not just public API |
| Forgetting to update after investigation | Always save/update context after gaining new understanding |
| Absolute paths in memory files | Use repository-relative paths in the Source field |
| Missing parent directories | Create directories with -Force before writing |
Source: CoreWCF/CoreWCF — distributed by TomeVault.