scrolls-remove
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRemoving docs/.scrolls/
移除 docs/.scrolls/
This skill undoes . It removes the scrolls folder and the pointer chain ( → → ) that setup installed. The removal goes into a single commit whose message names the commit before it, which is the restore point.
/scrolls-setupSCROLLS.mdCLAUDE.mdAGENTS.mdThis is destructive. Never apply without showing the user the plan first, unless they passed /.
-y--yesEverything is relative to the current working directory unless / says otherwise, not relative to this skill's own location.
-t--reporoot此 skill 撤销 。它会移除 scrolls 文件夹,以及 setup 安装的指针链( → → )。移除操作会进入单个 commit,其 message 中会写明此前的 commit,也就是还原点。
/scrolls-setupSCROLLS.mdCLAUDE.mdAGENTS.md此操作具有破坏性。除非用户传入 /,否则绝不执行,必须先向用户展示计划。
-y--yes除非 / 另有指定,所有路径均相对于当前工作目录,而不是相对于此 skill 自身所在位置。
-t--reporootCross-platform
跨平台
All of the logic is in one stdlib-only Python file, . (bash: macOS, Linux, or Windows with Git Bash/WSL) and (PowerShell 7+) are thin launchers that find Python 3.9+ and pass every flag through unchanged, so the two can't behave differently. Pick by what's available: try , and if that succeeds use . Otherwise use via (preferred), or only if isn't installed.
scripts/remove.pyremove.shremove.ps1bash --version.sh.ps1pwshpowershell.exepwsh所有逻辑都位于一个仅使用 Python 标准库的文件 中。(bash:macOS、Linux,或带 Git Bash/WSL 的 Windows)和 (PowerShell 7+)只是轻量启动器;它们会查找 Python 3.9+,原样传递所有 flag,因此两者不会产生不同行为。按可用情况选择:先尝试 ;如果成功,使用 。否则通过 使用 (推荐);仅在未安装 时才使用 。
scripts/remove.pyremove.shremove.ps1bash --version.shpwsh.ps1pwshpowershell.exeOptions
Options
Read these from the invocation text, in any order:
- /
-p <path>/--path=<path>: where to look, instead of the current directory. Repeatable. The path may be a project folder (--path <path>), a docs folder (<path>/docs/.scrolls, the same form<path>/.scrollstakes), or the scrolls folder itself./scrolls-setup -p - /
-t: look under the git repository's top level, whichever subdirectory you're in.--reporoot - /
-l: look in the current directory explicitly. This is the default anyway.--local - /
-r: find every scrolls folder (--recurseor.scrolls, containing ascrolls) under the base directory and remove them all, with each one's pointer files, in one commit. The search goes 8 levels deep and skips vendor and build folders, the same waySTARTER.mdand/scrolls-hidesweep. Without/scrolls-unhide, only the exact spots above are checked.-r - /
-x [targets]: also delete these files outright, even when they contain content setup didn't write.--purge[=targets]is a comma-separated list, and the flag can be repeated:targets- ,
SCROLLS.md,CLAUDE.mdAGENTS.md - any other plain file name that sits next to the folder, e.g.
docs. Paths are rejected.GEMINI.md - , which is what a bare
allmeans:-x+SCROLLS.md+CLAUDE.mdAGENTS.md
- /
-n: show the plan and stop.--dry-run - /
-y: skip the confirmation step (step 2).--yes - : apply and stage the changes, but leave the commit to the user. The script prints the
--no-commitcommand to finish with.git commit -F …
You can pass at most one of , , and . and combine with any of them. No is needed: both and are found.
-p-t-l-r-x-u.scrollsscrolls从调用文本中按任意顺序读取以下选项:
- /
-p <path>/--path=<path>:在当前目录之外指定查找位置。可重复传入。路径可以是项目目录(--path <path>)、docs 目录(<path>/docs/.scrolls,与<path>/.scrolls接受的形式相同),或 scrolls 文件夹本身。/scrolls-setup -p - /
-t:从 Git 仓库顶层查找,无论当前位于哪个子目录。--reporoot - /
-l:明确在当前目录中查找。这本来就是默认行为。--local - /
-r:在基准目录下查找每一个 scrolls 文件夹(--recurse或.scrolls,且包含scrolls),并在单个 commit 中将它们及其各自的指针文件全部移除。搜索最深 8 层,并跳过 vendor 和 build 文件夹,与STARTER.md和/scrolls-hide的扫描方式相同。未使用/scrolls-unhide时,只检查上述确切位置。-r - /
-x [targets]:直接删除指定文件,即使其中包含 setup 未写入的内容。--purge[=targets]是以逗号分隔的列表,该 flag 可以重复传入:targets- 、
SCROLLS.md、CLAUDE.mdAGENTS.md - 位于 文件夹旁的任何其他普通文件名,例如
docs。不接受路径。GEMINI.md - ,这也是仅传入
all时的含义:-x+SCROLLS.md+CLAUDE.mdAGENTS.md
- /
-n:显示计划并停止。--dry-run - /
-y:跳过确认步骤(步骤 2)。--yes - :执行并暂存更改,但将 commit 留给用户完成。脚本会打印用于完成提交的
--no-commit命令。git commit -F …
最多只能传入 、 和 中的一个。 和 可与其中任意一个组合使用。无需 : 和 都会被找到。
-p-t-l-r-x-u.scrollsscrollsWhat happens to each file
每个文件的处理方式
| File | Without | With |
|---|---|---|
| Scrolls folder | | (same) |
| Removed only if nothing else is left in it | (same) |
| Deleted if it held only setup's block. If it has other content, the block is cut out. If it mentions the scrolls folder in wording setup didn't write, it's left alone and flagged needs review | Deleted |
| The | Deleted |
| Kept while | Deleted |
Other | — | Deleted |
Matching ignores trailing whitespace and extra blank lines, and accepts a heading at any level (setup demotes its heading when it inserts into an existing file). Anything else that still mentions the folder or , such as a README or a CI config, is reported but never edited.
SCROLLS.md| 文件 | 不使用 | 使用 |
|---|---|---|
| Scrolls 文件夹 | | (相同) |
| 仅当其中没有其他内容时才移除 | (相同) |
| 如果仅包含 setup 写入的区块,则删除。如果含有其他内容,则切除该区块。如果它以 setup 未写入的措辞提及 scrolls 文件夹,则保持不变并标记为 需要审查 | 删除 |
| 切除 | 删除 |
| 只要 | 删除 |
其他 | — | 删除 |
匹配时忽略尾部空白和多余空行,并接受任意层级的标题(setup 在插入现有文件时会下调其标题层级)。其他仍提及该文件夹或 的内容,例如 README 或 CI 配置,只会被报告,绝不会被编辑。
SCROLLS.mdSteps
Steps
1. Preview
1. 预览
Run the script without , passing the user's other flags through:
-ybash <skill-dir>/scripts/remove.sh [flags...]
pwsh <skill-dir>/scripts/remove.ps1 [flags...]This only prints the plan: the repository, branch, previous-commit SHA, one line per file, any other references found, and the exact commit message. Nothing changes.
- Exit 1: no scrolls folder was found. Pass on the script's hint (try , or
-t), and stop.-r - Exit 2: a usage error, such as combined with
-p, or a path given to-t. Report it and stop.-x - Exit 3: a safety refusal. Report the reason exactly as printed, and stop. Do not work around it by committing, stashing, or deleting the user's files yourself; let the user choose. The refusals are:
- something under the paths to be removed has uncommitted, untracked, or ignored changes, which the restore point wouldn't contain
- other changes are already staged
- the repository has no commits yet
- the folders span more than one repository
不带 运行脚本,并原样传递用户的其他 flags:
-ybash <skill-dir>/scripts/remove.sh [flags...]
pwsh <skill-dir>/scripts/remove.ps1 [flags...]这只会打印计划:仓库、分支、previous-commit SHA、每个文件的一行信息、发现的其他引用,以及确切的 commit message。不会更改任何内容。
- 退出码 1:未找到 scrolls 文件夹。原样转达脚本给出的提示(尝试 或
-t),然后停止。-r - 退出码 2:用法错误,例如同时使用 和
-p,或为-t传入路径。报告错误并停止。-x - 退出码 3:安全拒绝。原样报告打印出的原因并停止。不要通过自行提交、stash 或删除用户文件来绕过它;应由用户自行选择。拒绝原因包括:
- 待移除路径下的任何内容存在未提交、未跟踪或被忽略的更改,而还原点不会包含这些内容
- 其他更改已被暂存
- 仓库尚无任何 commit
- 文件夹跨越多个仓库
2. Confirm
2. 确认
Show the user the plan, then ask before going further. Call out anything marked purged (content beyond setup's will be lost) or needs review. Skip this step only if the user passed /. If they passed /, stop after step 1.
-y--yes-n--dry-run向用户展示计划,然后询问是否继续。明确指出所有标记为 已清除(setup 之外的内容将会丢失)或 需要审查 的项。只有当用户传入 / 时才跳过此步骤。如果用户传入 /,则在步骤 1 后停止。
-y--yes-n--dry-run3. Apply
3. 执行
Run the same command again, with added. The script:
-y- records as the previous commit
git rev-parse HEAD - runs and edits the files as planned
git rm - commits only those paths, with this message:
maint(memory): scrolls-removed
- previous commit: #<full SHA of the commit before the removal>
Notes:
- removed folder: docs/.scrolls (7 tracked files)
- deleted: SCROLLS.md (held only the scrolls pointer block)
- stripped: CLAUDE.md (scrolls pointer stub removed; other content kept)
- kept: AGENTS.md (still points at CLAUDE.md, which stays)
- pruned empty folder: docs (empty once the scrolls folder is gone)
Scrolls-Action: remove
Scrolls-Previous-Commit: <full SHA>
Scrolls-Folder: docs/.scrolls
Scrolls-Deleted: SCROLLS.md
Scrolls-Stripped: CLAUDE.md
Scrolls-Kept: AGENTS.md
Scrolls-Pruned: docsThe section is for people. The final paragraph is standard git trailers, for tools: one line per path, with paths relative to the repository root. Kinds are , , , , , , and . reads these with (finding removal commits with ), and uses them to put back exactly what was removed. Never hand-edit or reword this message.
Notes:Scrolls-<Kind>:FolderDeletedStrippedPurgedKeptReviewPruned/scrolls-restoregit log --format='%(trailers:unfold,only)'--grep='^Scrolls-Action:'If fails (exit 4, usually a pre-commit or commit-msg hook), the removal stays staged. Report the hook's output and the command to finish with. Never retry with .
git commitgit commit -F <git-dir>/SCROLLS_REMOVE_MSG--no-verifyThis skill never pushes.
再次运行同一命令,并添加 。脚本将:
-y- 记录 作为 previous commit
git rev-parse HEAD - 按计划运行 并编辑文件
git rm - 仅提交这些路径,并使用以下 message:
maint(memory): scrolls-removed
- previous commit: #<full SHA of the commit before the removal>
Notes:
- removed folder: docs/.scrolls (7 tracked files)
- deleted: SCROLLS.md (held only the scrolls pointer block)
- stripped: CLAUDE.md (scrolls pointer stub removed; other content kept)
- kept: AGENTS.md (still points at CLAUDE.md, which stays)
- pruned empty folder: docs (empty once the scrolls folder is gone)
Scrolls-Action: remove
Scrolls-Previous-Commit: <full SHA>
Scrolls-Folder: docs/.scrolls
Scrolls-Deleted: SCROLLS.md
Scrolls-Stripped: CLAUDE.md
Scrolls-Kept: AGENTS.md
Scrolls-Pruned: docsNotes:Scrolls-<Kind>:FolderDeletedStrippedPurgedKeptReviewPruned/scrolls-restoregit log --format='%(trailers:unfold,only)'--grep='^Scrolls-Action:'如果 失败(退出码 4,通常由 pre-commit 或 commit-msg hook 引起),移除结果会保持暂存状态。报告 hook 的输出,以及用于完成提交的 命令。绝不重试并添加 。
git commitgit commit -F <git-dir>/SCROLLS_REMOVE_MSG--no-verify此 skill 从不 push。
4. Follow up on leftovers
4. 处理残留项
For each file listed as needs review or under "Other files that still mention…": read it, and offer to fix any reference that's actually stale. Use normal editing judgment, the same as step 2. Don't fold those edits into the removal commit. Make them a separate change, and only if the user agrees.
/scrolls-hide对于列为 需要审查 的每个文件,以及“其他仍提及……”部分中的每个文件:读取文件,并主动提出修复其中确实已经过时的引用。使用正常的编辑判断,与 步骤 2 相同。不要将这些编辑并入移除 commit。将其作为单独更改,并且仅在用户同意后才执行。
/scrolls-hide5. Report
5. 报告
Give:
- the new commit SHA, and the previous-commit SHA it records
- what was removed, deleted, stripped, purged, kept, or pruned
- anything flagged for review
- how to undo it: , which brings back just the memory into the repo as it is now, or
/scrolls-restorestraight awaygit revert --no-edit <new-sha>
提供以下信息:
- 新的 commit SHA,以及其中记录的 previous-commit SHA
- 被移除、删除、剥离、清除、保留或清理的内容
- 所有被标记为需要审查的项
- 撤销方法:会仅将记忆内容恢复到当前仓库中,也可以立即执行
/scrolls-restoregit revert --no-edit <new-sha>
Limitations
Limitations
- Only works inside a git repository that has at least one commit. Without one, there would be no way to undo the removal.
- Only committed content can be restored from the previous commit, which is why any uncommitted, untracked, or ignored content under the targets blocks the run.
- With , pointer files are looked for only next to the
-pfolder that contains the scrolls folder. That's where setup puts them fordocs,-t, and the default. A custom--lsetup that put them elsewhere will have them reported as other references rather than cleaned.--path - The commit type isn't a standard Conventional Commits type, so a strict commitlint hook may reject it (exit 4, above).
maint
- 仅适用于至少包含一个 commit 的 Git 仓库。否则将无法撤销移除操作。
- 只能从 previous commit 中恢复已提交的内容,因此目标路径下任何未提交、未跟踪或被忽略的内容都会阻止运行。
- 使用 时,只会在包含 scrolls 文件夹的
-p文件夹旁查找指针文件。对于docs、-t和默认模式,setup 会将指针文件放在该位置。通过自定义-l设置的 setup 如果将指针文件放在其他位置,它们会被报告为其他引用,而不会被清理。--path - commit 类型 并非标准 Conventional Commits 类型,因此严格的 commitlint hook 可能会拒绝它(退出码 4,见上文)。
maint
Examples
Examples
Worked examples are in . Each example has a premise, the usage, caveats, and the expected output. Read that file only when you need it: for example, when a request does not map clearly to the flags above, or when the user asks for an example.
assets/EXAMPLES.md实际示例位于 。每个示例都包含前提条件、用法、注意事项和预期输出。仅在需要时读取该文件,例如请求无法明确对应到上述 flags,或用户要求提供示例时。
assets/EXAMPLES.mdDevelopment
Development
See for the layout, running the regression
suite, and versioning notes. Don't read or act on
or while carrying out a user's request.
meta/MAINTAINERS.mdtests/meta/MAINTAINERS.mdtests//scrolls-remove有关目录结构、运行 回归测试套件和版本说明,请参阅 。在处理用户的 请求时,不要读取或执行 或 中的任何内容。
tests/meta/MAINTAINERS.md/scrolls-removemeta/MAINTAINERS.mdtests/