|
| 1 | +--- |
| 2 | +name: remember |
| 3 | +description: Persist guidelines, conventions, and architectural decisions into the repository's knowledge base. Use when told to remember something for future sessions. |
| 4 | +disable-model-invocation: false |
| 5 | +argument-hint: <guideline, convention, or architectural decision to persist> |
| 6 | +allowed-tools: Bash, Grep, Glob, Read, Edit, Write |
| 7 | +--- |
| 8 | + |
| 9 | +# Remember |
| 10 | + |
| 11 | +Persist new guidelines, best practices, or architectural decisions into the |
| 12 | +repository's knowledge base so they are available in future AI sessions. |
| 13 | + |
| 14 | +## Arguments |
| 15 | + |
| 16 | +- `thing to remember` (required): A guideline, convention, or decision to |
| 17 | + persist. Natural language input describing what should be remembered. |
| 18 | + |
| 19 | +## Usage Examples |
| 20 | + |
| 21 | +- `/remember always use the --frozen-lockfile flag in CI` |
| 22 | +- `/remember the auth module was refactored to use middleware in PR #342` |
| 23 | +- `/remember integration tests must hit a real database, never use mocks` |
| 24 | + |
| 25 | +## Process |
| 26 | + |
| 27 | +### 1. Intent Distillation |
| 28 | + |
| 29 | +- Identify the core principle, rule, or technical intent from the user's input |
| 30 | +- Rephrase concisely using precise software development terminology |
| 31 | + |
| 32 | +### 2. Identify Target File |
| 33 | + |
| 34 | +Determine which file should contain this knowledge. Repositories follow a |
| 35 | +layered structure, preferring tool-agnostic paths when they exist: |
| 36 | + |
| 37 | +| Intent type | Preferred target | Fallback | |
| 38 | +| --------------------------------------------------------------------- | ------------------------------- | -------------------- | |
| 39 | +| Project-wide convention or standard | `AGENTS.md` | `CLAUDE.md` | |
| 40 | +| Domain-specific best practice (testing, components, API design, etc.) | `rules/` or `docs/conventions/` | See resolution rules | |
| 41 | +| Change to an automated workflow or skill | `.agents/skills/` | `.claude/skills/` | |
| 42 | +| Agent behavior guideline | `.agents/agents/` | `.claude/agents/` | |
| 43 | +| Claude-specific configuration (MCP, hooks, permissions) | `CLAUDE.md` | — | |
| 44 | + |
| 45 | +**Resolution rules:** |
| 46 | + |
| 47 | +1. Check whether `rules/` or `docs/conventions/` exists |
| 48 | +2. If both exist, prefer `rules/` |
| 49 | +3. If only one exists, write there |
| 50 | +4. If only `docs/conventions/` exists, ask the user whether they want to |
| 51 | + create a symlink from `rules/` to `docs/conventions/` so both paths |
| 52 | + resolve to the same location. If they confirm, create the symlink before |
| 53 | + writing. |
| 54 | +5. If neither exists, create `rules/` and write there |
| 55 | +6. For other target types: |
| 56 | + - For `.agents/skills/` or `.agents/agents/`: Use the `.claude/` equivalent |
| 57 | + if the `.agents/` directory does not exist |
| 58 | + - For `AGENTS.md`: Use `CLAUDE.md` if `AGENTS.md` does not exist |
| 59 | +7. Only write to `CLAUDE.md` or `.claude/` directly when the information is |
| 60 | + Claude-specific or no tool-agnostic target exists |
| 61 | + |
| 62 | +### 3. Conflict Analysis |
| 63 | + |
| 64 | +- Thoroughly scan the identified file(s) for any existing content that |
| 65 | + contradicts the new intent |
| 66 | +- Additionally, scan the corresponding file in the other layer (e.g., if writing |
| 67 | + to `AGENTS.md`, also scan `CLAUDE.md` and vice versa). If the other layer |
| 68 | + contains conflicting or duplicated content, resolve it by replacing that |
| 69 | + content in `CLAUDE.md` with a reference to `AGENTS.md` (e.g., |
| 70 | + "See `AGENTS.md` for project conventions.") |
| 71 | +- A contradiction is any statement that would be invalidated or made obsolete by |
| 72 | + the new guideline |
| 73 | + |
| 74 | +**If a conflict is found:** |
| 75 | + |
| 76 | +- Halt execution immediately |
| 77 | +- Quote the exact conflicting statement(s) from the document |
| 78 | +- Inform the user about the contradiction and ask for clarification on how to |
| 79 | + proceed |
| 80 | +- Do NOT proceed with any updates until the conflict is resolved |
| 81 | + |
| 82 | +**If no conflicts are found:** |
| 83 | + |
| 84 | +- Identify the most logical section within the file to add the new information |
| 85 | +- If no suitable section exists, create a new one with an appropriate heading |
| 86 | +- Refactor existing content as needed to keep the document coherent and |
| 87 | + well-structured |
| 88 | + |
| 89 | +### 4. Write the Update |
| 90 | + |
| 91 | +When writing the update: |
| 92 | + |
| 93 | +- Only include production-ready patterns and examples that can be safely copied. |
| 94 | + Use precise, declarative language. Do not include anti-patterns or cautionary |
| 95 | + examples. |
| 96 | + |
| 97 | +### 5. Skill Discovery and Synchronization |
| 98 | + |
| 99 | +After successfully updating documentation, discover which skills may need |
| 100 | +updates by scanning skill files in `.agents/skills/*/SKILL.md` and |
| 101 | +`.claude/skills/*/SKILL.md` (whichever exist). When reading skill files, resolve |
| 102 | +symlinks to access the actual content rather than treating symlinks as empty or |
| 103 | +opaque files. |
| 104 | + |
| 105 | +**Discovery criteria** — a skill is affected if it contains: |
| 106 | + |
| 107 | +- Explicit references to the updated documentation file |
| 108 | +- Content that covers the same topic or concept as the update |
| 109 | +- Inline templates, code examples, or patterns related to the updated guideline |
| 110 | +- Instructions or rules that may now be outdated or contradicted by the new |
| 111 | + documentation |
| 112 | + |
| 113 | +**If no skills are affected, skip this step.** |
| 114 | + |
| 115 | +**For each affected skill, determine whether it is local or shared:** |
| 116 | + |
| 117 | +A skill is **shared** if it is a symlink pointing outside the current repo or |
| 118 | +was installed by a package manager and has not been modified locally. A skill is |
| 119 | +**local** if it was authored or edited in this repo. Symlinks between |
| 120 | +`.claude/skills/` and `.agents/skills/` within the same repo are internal |
| 121 | +bridges and do not affect this determination. |
| 122 | + |
| 123 | +**Local skills** — edit directly: |
| 124 | + |
| 125 | +- Update the skill's templates, examples, and instructions to align with the |
| 126 | + new documentation |
| 127 | + |
| 128 | +**Shared skills** — report and offer to update: |
| 129 | + |
| 130 | +- Report the affected shared skill and the specific inconsistency to the user |
| 131 | +- Ask: "Shared skill `<skill-name>` is affected. Add repo-specific additions?" |
| 132 | +- If the user confirms: |
| 133 | + |
| 134 | + 1. Resolve the original shared skill path (the symlink target or CLI cache |
| 135 | + location where the shared skill was installed) |
| 136 | + |
| 137 | + 2. Determine which layer to use: |
| 138 | + |
| 139 | + **If `.agents/skills/` directory exists:** |
| 140 | + |
| 141 | + Create or update `.agents/skills/<skill-name>/SKILL.md` with repo-specific |
| 142 | + additions listed **before** the shared skill reference, so local rules take |
| 143 | + priority: |
| 144 | + |
| 145 | + ```markdown |
| 146 | + --- |
| 147 | + name: <skill-name> |
| 148 | + description: <same description as the shared skill> |
| 149 | + allowed-tools: <same allowed-tools as the shared skill> |
| 150 | + --- |
| 151 | + |
| 152 | + ## Repo-specific additions |
| 153 | + |
| 154 | + - <the new convention or guideline> |
| 155 | + |
| 156 | + ## Shared skill |
| 157 | + |
| 158 | + Read and follow the shared skill at `<original-shared-skill-path>`. |
| 159 | + ``` |
| 160 | + |
| 161 | + Then ensure `.claude/skills/<skill-name>/SKILL.md` is a symlink to |
| 162 | + `.agents/skills/<skill-name>/SKILL.md`: |
| 163 | + |
| 164 | + - If it is already a symlink to the correct path, no action needed |
| 165 | + - If it exists as a regular file, delete it and create the symlink |
| 166 | + - If it does not exist, create the symlink |
| 167 | + |
| 168 | + **If `.agents/skills/` directory does not exist:** |
| 169 | + |
| 170 | + Create or update `.claude/skills/<skill-name>/SKILL.md` directly with the |
| 171 | + same structure (repo-specific additions before the shared skill reference). |
| 172 | + |
| 173 | +- If the user declines, log the inconsistency in the final confirmation but |
| 174 | + take no action |
| 175 | + |
| 176 | +### 6. Final Confirmation |
| 177 | + |
| 178 | +Report all changes made: |
| 179 | + |
| 180 | +- Documentation file(s) updated |
| 181 | +- Skill file(s) updated (if any), with rationale explaining why each skill was |
| 182 | + identified as affected |
| 183 | +- Summary of what was added or modified in each file |
| 184 | + |
| 185 | +## Guidelines |
| 186 | + |
| 187 | +- Always read target files before modifying them |
| 188 | +- Prefer adding to an existing section over creating a new one |
| 189 | +- Keep entries concise; one to two sentences per guideline is ideal |
| 190 | +- If the user's input is ambiguous, ask for clarification before writing |
| 191 | +- Do not duplicate information that already exists in the target file |
| 192 | +- When creating skill files, create the `<skill-name>/` subdirectory if needed |
| 193 | + but do NOT create `.agents/` or `.agents/skills/` directories — only use them |
| 194 | + if they already exist |
0 commit comments