scrolls-remove

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Removing docs/.scrolls/

移除 docs/.scrolls/

This skill undoes
/scrolls-setup
. It removes the scrolls folder and the pointer chain (
SCROLLS.md
→
CLAUDE.md
→
AGENTS.md
) that setup installed. The removal goes into a single commit whose message names the commit before it, which is the restore point.
This is destructive. Never apply without showing the user the plan first, unless they passed
-y
/
--yes
.
Everything is relative to the current working directory unless
-t
/
--reporoot
says otherwise, not relative to this skill's own location.
此 skill 撤销
/scrolls-setup
。它会移除 scrolls 文件夹,以及 setup 安装的指针链(
SCROLLS.md
→
CLAUDE.md
→
AGENTS.md
)。移除操作会进入单个 commit,其 message 中会写明此前的 commit,也就是还原点。
此操作具有破坏性。除非用户传入
-y
/
--yes
,否则绝不执行,必须先向用户展示计划。
除非
-t
/
--reporoot
另有指定,所有路径均相对于当前工作目录,而不是相对于此 skill 自身所在位置。

Cross-platform

跨平台

All of the logic is in one stdlib-only Python file,
scripts/remove.py
.
remove.sh
(bash: macOS, Linux, or Windows with Git Bash/WSL) and
remove.ps1
(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
bash --version
, and if that succeeds use
.sh
. Otherwise use
.ps1
via
pwsh
(preferred), or
powershell.exe
only if
pwsh
isn't installed.
所有逻辑都位于一个仅使用 Python 标准库的文件
scripts/remove.py
中。
remove.sh
(bash:macOS、Linux,或带 Git Bash/WSL 的 Windows)和
remove.ps1
(PowerShell 7+)只是轻量启动器;它们会查找 Python 3.9+,原样传递所有 flag,因此两者不会产生不同行为。按可用情况选择:先尝试
bash --version
;如果成功,使用
.sh
。否则通过
pwsh
使用
.ps1
(推荐);仅在未安装
pwsh
时才使用
powershell.exe
。

Options

Options

Read these from the invocation text, in any order:
  • -p <path>
    /
    --path=<path>
    /
    --path <path>
    : where to look, instead of the current directory. Repeatable. The path may be a project folder (
    <path>/docs/.scrolls
    ), a docs folder (
    <path>/.scrolls
    , the same form
    /scrolls-setup -p
    takes), or the scrolls folder itself.
  • -t
    /
    --reporoot
    : look under the git repository's top level, whichever subdirectory you're in.
  • -l
    /
    --local
    : look in the current directory explicitly. This is the default anyway.
  • -r
    /
    --recurse
    : find every scrolls folder (
    .scrolls
    or
    scrolls
    , containing a
    STARTER.md
    ) 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 way
    /scrolls-hide
    and
    /scrolls-unhide
    sweep. Without
    -r
    , only the exact spots above are checked.
  • -x [targets]
    /
    --purge[=targets]
    : also delete these files outright, even when they contain content setup didn't write.
    targets
    is a comma-separated list, and the flag can be repeated:
    • SCROLLS.md
      ,
      CLAUDE.md
      ,
      AGENTS.md
    • any other plain file name that sits next to the
      docs
      folder, e.g.
      GEMINI.md
      . Paths are rejected.
    • all
      , which is what a bare
      -x
      means:
      SCROLLS.md
      +
      CLAUDE.md
      +
      AGENTS.md
  • -n
    /
    --dry-run
    : show the plan and stop.
  • -y
    /
    --yes
    : skip the confirmation step (step 2).
  • --no-commit
    : apply and stage the changes, but leave the commit to the user. The script prints the
    git commit -F …
    command to finish with.
You can pass at most one of
-p
,
-t
, and
-l
.
-r
and
-x
combine with any of them. No
-u
is needed: both
.scrolls
and
scrolls
are found.
从调用文本中按任意顺序读取以下选项:
  • -p <path>
    /
    --path=<path>
    /
    --path <path>
    :在当前目录之外指定查找位置。可重复传入。路径可以是项目目录(
    <path>/docs/.scrolls
    )、docs 目录(
    <path>/.scrolls
    ,与
    /scrolls-setup -p
    接受的形式相同),或 scrolls 文件夹本身。
  • -t
    /
    --reporoot
    :从 Git 仓库顶层查找,无论当前位于哪个子目录。
  • -l
    /
    --local
    :明确在当前目录中查找。这本来就是默认行为。
  • -r
    /
    --recurse
    :在基准目录下查找每一个 scrolls 文件夹(
    .scrolls
    或
    scrolls
    ,且包含
    STARTER.md
    ),并在单个 commit 中将它们及其各自的指针文件全部移除。搜索最深 8 层,并跳过 vendor 和 build 文件夹,与
    /scrolls-hide
    和
    /scrolls-unhide
    的扫描方式相同。未使用
    -r
    时,只检查上述确切位置。
  • -x [targets]
    /
    --purge[=targets]
    :直接删除指定文件,即使其中包含 setup 未写入的内容。
    targets
    是以逗号分隔的列表,该 flag 可以重复传入:
    • SCROLLS.md
      、
      CLAUDE.md
      、
      AGENTS.md
    • 位于
      docs
      文件夹旁的任何其他普通文件名,例如
      GEMINI.md
      。不接受路径。
    • all
      ,这也是仅传入
      -x
      时的含义:
      SCROLLS.md
      +
      CLAUDE.md
      +
      AGENTS.md
  • -n
    /
    --dry-run
    :显示计划并停止。
  • -y
    /
    --yes
    :跳过确认步骤(步骤 2)。
  • --no-commit
    :执行并暂存更改,但将 commit 留给用户完成。脚本会打印用于完成提交的
    git commit -F …
    命令。
最多只能传入
-p
、
-t
和
-l
中的一个。
-r
和
-x
可与其中任意一个组合使用。无需
-u
:
.scrolls
和
scrolls
都会被找到。

What happens to each file

每个文件的处理方式

FileWithout
-x
With
-x
naming it
Scrolls folder
git rm -r
(same)
docs/
(its parent)
Removed only if nothing else is left in it(same)
SCROLLS.md
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 reviewDeleted
CLAUDE.md
The
## Access Scrolls Agentic Memory
/
See @SCROLLS.md.
stub is cut out, along with a pre-1.2.0 embedded
SCROLLS.md
block if there is one. The file is deleted if nothing is left
Deleted
AGENTS.md
Kept while
CLAUDE.md
still exists, because
See @CLAUDE.md
still works. If
CLAUDE.md
is deleted, the pointer line is cut out (the file is deleted if that empties it)
Deleted
Other
-x
names
—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
SCROLLS.md
, such as a README or a CI config, is reported but never edited.
文件不使用
-x
使用
-x
指定该文件
Scrolls 文件夹
git rm -r
(相同)
docs/
(其父目录)
仅当其中没有其他内容时才移除(相同)
SCROLLS.md
如果仅包含 setup 写入的区块,则删除。如果含有其他内容,则切除该区块。如果它以 setup 未写入的措辞提及 scrolls 文件夹,则保持不变并标记为 需要审查删除
CLAUDE.md
切除
## Access Scrolls Agentic Memory
/
See @SCROLLS.md.
片段;如果存在 1.2.0 之前版本嵌入的
SCROLLS.md
区块,也一并切除。如果文件内没有剩余内容,则删除该文件
删除
AGENTS.md
只要
CLAUDE.md
仍然存在就予以保留,因为
See @CLAUDE.md
仍然有效。如果
CLAUDE.md
被删除,则切除指针行;如果文件因此变空,则删除该文件
删除
其他
-x
名称
—删除
匹配时忽略尾部空白和多余空行,并接受任意层级的标题(setup 在插入现有文件时会下调其标题层级)。其他仍提及该文件夹或
SCROLLS.md
的内容,例如 README 或 CI 配置,只会被报告,绝不会被编辑。

Steps

Steps

1. Preview

1. 预览

Run the script without
-y
, passing the user's other flags through:
bash <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
    -t
    , or
    -r
    ), and stop.
  • Exit 2: a usage error, such as
    -p
    combined with
    -t
    , or a path given to
    -x
    . Report it and stop.
  • 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
不带
-y
运行脚本,并原样传递用户的其他 flags:
bash <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
-y
/
--yes
. If they passed
-n
/
--dry-run
, stop after step 1.
向用户展示计划,然后询问是否继续。明确指出所有标记为 已清除(setup 之外的内容将会丢失)或 需要审查 的项。只有当用户传入
-y
/
--yes
时才跳过此步骤。如果用户传入
-n
/
--dry-run
,则在步骤 1 后停止。

3. Apply

3. 执行

Run the same command again, with
-y
added. The script:
  1. records
    git rev-parse HEAD
    as the previous commit
  2. runs
    git rm
    and edits the files as planned
  3. 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: docs
The
Notes:
section is for people. The final paragraph is standard git trailers, for tools: one
Scrolls-<Kind>:
line per path, with paths relative to the repository root. Kinds are
Folder
,
Deleted
,
Stripped
,
Purged
,
Kept
,
Review
, and
Pruned
.
/scrolls-restore
reads these with
git log --format='%(trailers:unfold,only)'
(finding removal commits with
--grep='^Scrolls-Action:'
), and uses them to put back exactly what was removed. Never hand-edit or reword this message.
If
git commit
fails (exit 4, usually a pre-commit or commit-msg hook), the removal stays staged. Report the hook's output and the
git commit -F <git-dir>/SCROLLS_REMOVE_MSG
command to finish with. Never retry with
--no-verify
.
This skill never pushes.
再次运行同一命令,并添加
-y
。脚本将:
  1. 记录
    git rev-parse HEAD
    作为 previous commit
  2. 按计划运行
    git rm
    并编辑文件
  3. 仅提交这些路径,并使用以下 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: docs
Notes:
部分供人阅读。最后一段是标准 git trailers,供工具使用:每个路径对应一行
Scrolls-<Kind>:
,路径相对于仓库根目录。Kind 包括
Folder
、
Deleted
、
Stripped
、
Purged
、
Kept
、
Review
和
Pruned
。
/scrolls-restore
会使用
git log --format='%(trailers:unfold,only)'
读取这些信息(通过
--grep='^Scrolls-Action:'
查找移除 commit),并据此精确还原被移除的内容。绝不手动编辑或改写此 message。
如果
git commit
失败(退出码 4,通常由 pre-commit 或 commit-msg hook 引起),移除结果会保持暂存状态。报告 hook 的输出,以及用于完成提交的
git 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
/scrolls-hide
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。将其作为单独更改,并且仅在用户同意后才执行。

5. 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:
    /scrolls-restore
    , which brings back just the memory into the repo as it is now, or
    git revert --no-edit <new-sha>
    straight away
提供以下信息:
  • 新的 commit SHA,以及其中记录的 previous-commit SHA
  • 被移除、删除、剥离、清除、保留或清理的内容
  • 所有被标记为需要审查的项
  • 撤销方法:
    /scrolls-restore
    会仅将记忆内容恢复到当前仓库中,也可以立即执行
    git 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
    -p
    , pointer files are looked for only next to the
    docs
    folder that contains the scrolls folder. That's where setup puts them for
    -t
    ,
    -l
    , and the default. A custom-
    --path
    setup that put them elsewhere will have them reported as other references rather than cleaned.
  • The commit type
    maint
    isn't a standard Conventional Commits type, so a strict commitlint hook may reject it (exit 4, above).
  • 仅适用于至少包含一个 commit 的 Git 仓库。否则将无法撤销移除操作。
  • 只能从 previous commit 中恢复已提交的内容,因此目标路径下任何未提交、未跟踪或被忽略的内容都会阻止运行。
  • 使用
    -p
    时,只会在包含 scrolls 文件夹的
    docs
    文件夹旁查找指针文件。对于
    -t
    、
    -l
    和默认模式,setup 会将指针文件放在该位置。通过自定义
    --path
    设置的 setup 如果将指针文件放在其他位置,它们会被报告为其他引用,而不会被清理。
  • commit 类型
    maint
    并非标准 Conventional Commits 类型,因此严格的 commitlint hook 可能会拒绝它(退出码 4,见上文)。

Examples

Examples

Worked examples are in
assets/EXAMPLES.md
. 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,或用户要求提供示例时。

Development

Development

See
meta/MAINTAINERS.md
for the layout, running the
tests/
regression suite, and versioning notes. Don't read or act on
meta/MAINTAINERS.md
or
tests/
while carrying out a user's
/scrolls-remove
request.
有关目录结构、运行
tests/
回归测试套件和版本说明,请参阅
meta/MAINTAINERS.md
。在处理用户的
/scrolls-remove
请求时,不要读取或执行
meta/MAINTAINERS.md
或
tests/
中的任何内容。