scrolls-update
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUpdating docs/.scrolls/
更新docs/.scrolls/
docs/.scrolls/STARTER.mddocs/.scrolls/STARTER.mdCross-platform
跨平台支持
The one bundled script (step 3) ships in two forms: (bash — macOS, Linux, or Windows with Git Bash/WSL) and (PowerShell 7+ — Windows, or macOS/Linux with installed). Everything else in this skill — the flags, resolution, locating the scrolls folder — is plain prose you follow directly; it only ever invokes , which behaves identically regardless of which shell is running it, so none of that needs a shell-specific variant. Pick the script by what's actually available: try ; if that succeeds, use the script; otherwise use the script via (preferred — install from https://aka.ms/powershell if missing) or, only if genuinely isn't available, the built-in Windows PowerShell (untested against that older version; is what this was written and verified against).
session_diff.shsession_diff.ps1pwshBASE_DIRgitbash --version.sh.ps1pwshpwshpowershell.exepwsh附带的单个脚本(步骤3)有两种形式:(bash——适用于macOS、Linux或安装了Git Bash/WSL的Windows)和(PowerShell 7+——适用于Windows,或安装了的macOS/Linux)。此技能中的其他所有内容——标志、解析、定位卷轴文件夹——都是直接遵循的纯文本说明;它只会调用,而在任何shell中运行的行为都相同,因此无需针对不同shell提供变体。根据实际可用环境选择脚本:尝试运行;如果成功,使用脚本;否则通过(推荐——如果缺失,请从https://aka.ms/powershell安装)使用`.ps1`脚本,或者仅在`pwsh`确实不可用时,使用内置的Windows PowerShell (未针对该旧版本测试;是编写和验证此脚本所使用的环境)。
session_diff.shsession_diff.ps1pwshBASE_DIRgitgitbash --version.shpwshpowershell.exepwshOptions
选项
Read the invocation text for these, in any order — there's no real argv parser here, so pull them out of the plain text yourself:
- /
-p <path>/--path=<path>— a custom docs folder to look in, relative to the current working directory unless given as an absolute path.--path <path> - /
-t— look under the git repository's top level (--reporoot) regardless of which subdirectory you actually invoked this from. Fails with a clear message if the current directory isn't inside a git repository.$(git rev-parse --show-toplevel) - /
-l— look explicitly in the current working directory. This is what happens by default anyway when none of--local/-p/-tare given — the flag exists to say so on purpose, e.g. to skip the mismatch check below.-l - /
-r— if the scrolls folder isn't at the obvious exact location (--recurseorBASE_DIR/docs/.scrolls), search recursively underBASE_DIR/docs/scrollsfor one instead of giving up. Off by default — matches the usual meaning ofBASE_DIRon tools like-r/grep/cp.rm
There's no / option here — this skill locates whichever scrolls folder already exists rather than choosing between them (see step 1). , , and are three different ways to answer the same question ("where's the docs folder?") — pass at most one; if more than one is given, ask which was meant. is independent and combines freely with any of them (or with none).
-u--unhide-p-t-l-r阅读调用文本中的这些选项,顺序不限——此处没有真正的argv解析器,因此请自行从纯文本中提取:
- /
-p <path>/--path=<path>——指定自定义docs文件夹路径,除非给定绝对路径,否则相对于当前工作目录。--path <path> - /
-t——在Git仓库的顶层目录(--reporoot)下查找,无论实际从哪个子目录调用。如果当前目录不在Git仓库内,会给出明确的失败提示。$(git rev-parse --show-toplevel) - /
-l——明确在当前工作目录查找。当未指定--local/-p/-t时,默认就是此行为——该标志用于明确指定此操作,例如跳过下文的不匹配检查。-l - /
-r——如果卷轴文件夹不在明显的精确位置(--recurse或BASE_DIR/docs/.scrolls),则在BASE_DIR/docs/scrolls下递归搜索,而非直接放弃。默认关闭——与BASE_DIR/grep/cp等工具中rm的常见含义一致。-r
此处没有/选项——此技能会定位已存在的卷轴文件夹,而非在它们之间选择(见步骤1)。、和是回答同一问题(“docs文件夹在哪里?”)的三种不同方式——最多传递一个;如果指定多个,请询问用户的意图。是独立选项,可与其中任意一个(或不与任何一个)组合使用。
-u--unhide-p-t-l-rSteps
步骤
1. Resolve BASE_DIR, then locate the scrolls, trying both names
1. 解析BASE_DIR,然后定位卷轴文件夹,尝试两种命名方式
Compute :
BASE_DIR- /
-tgiven:--reporoot. If that fails (not inside a git repository), stop and tell the user — suggestBASE_DIR = $(git rev-parse --show-toplevel)instead.--path - /
-lgiven:--local.BASE_DIR = $(pwd) - Nothing given (the common case): . But first, if the current directory is inside a git repository, run
BASE_DIR = $(pwd)and compare it togit rev-parse --show-toplevel. If they're the same, or this isn't a git repo, proceed with cwd as usual. If they differ, mention it before searching — running from here will only look under$(pwd), and a scrolls folder that lives at the repository root ($(pwd)/docs) instead would be missed entirely (not just skipped — it'll look like the project was never set up). Ask if that's intended, defaulting to proceeding with cwd (this skill's documented default) if there's no strong preference.<repo-root>
Then let be the value if was given, else . The scrolls folder under it may be named either (hidden, the default from ) or (after , or at setup time) — check for first, then . Whichever exists is for the rest of this skill.
DOCS_BASE--path-p${BASE_DIR}/docs.scrolls/scrolls-setupscrolls/scrolls-unhide--unhideDOCS_BASE/.scrollsDOCS_BASE/scrollsSCROLLS_PATHIf neither exists at that exact spot:
- /
-rwas given: search recursively under--recurseinstead — a bounded number of levels deep, pruning the same heavy/vendor directoriesBASE_DIR//scrolls-hideprune (/scrolls-unhide,node_modules,.git,vendor,dist,build,.venv,venv,__pycache__,target,.next), for a directory named.cacheor.scrollscontaining ascrolls. If exactly one turns up, that'sSTARTER.md. If more than one turns up (a monorepo with several independent scrolls setups under thisSCROLLS_PATH), list them and ask the user which one this session's update is actually about — don't guess, and don't update more than one, since a session's narrative belongs to a specific project, not every project it happens to be nested near.BASE_DIR - wasn't given, or the recursive search above also found nothing: don't create one here. Tell the user this project (or this path) hasn't been set up yet and point them at
-r— and if you resolved/scrolls-setupto cwd (by default orBASE_DIR) rather than the repo root, mention-l/-tas something to try, and mention--reporoot/-rif you haven't already used it, in case the scrolls live somewhere other than the exact expected spot.--recurse
If somehow both and exist at the exact , stop and ask the user which one is current — that's an inconsistent state this skill shouldn't silently paper over.
.scrollsscrollsDOCS_BASE计算:
BASE_DIR- 指定了/
-t:--reporoot。如果失败(不在Git仓库内),停止操作并告知用户——建议使用BASE_DIR = $(git rev-parse --show-toplevel)替代。--path - 指定了/
-l:--local。BASE_DIR = $(pwd) - 未指定任何选项(常见情况):。但首先,如果当前目录在Git仓库内,运行
BASE_DIR = $(pwd)并与git rev-parse --show-toplevel比较。如果两者相同,或者当前不在Git仓库中,则照常使用当前工作目录。如果两者不同,在搜索前告知用户——从当前目录运行只会在$(pwd)下查找,而位于仓库根目录($(pwd)/docs)的卷轴文件夹会被完全遗漏(不仅是跳过——看起来像是项目从未设置过)。询问用户是否有意如此,如果没有明确偏好,默认使用当前工作目录(此技能文档中记录的默认行为)。<repo-root>
然后,如果指定了,则为的值,否则为。其下的卷轴文件夹可能命名为(隐藏,/scrolls-setup的默认名称)或(在/scrolls-unhide之后,或设置时使用)——先检查,再检查。存在的那个即为后续步骤中的。
-pDOCS_BASE--path${BASE_DIR}/docs.scrollsscrolls--unhideDOCS_BASE/.scrollsDOCS_BASE/scrollsSCROLLS_PATH如果该精确位置不存在任何一个:
- 指定了/
-r:改为在--recurse下递归搜索——搜索有限的深度,排除与BASE_DIR//scrolls-hide相同的大型/供应商目录(/scrolls-unhide、node_modules、.git、vendor、dist、build、.venv、venv、__pycache__、target、.next),查找名为.cache或.scrolls且包含scrolls的目录。如果恰好找到一个,那就是STARTER.md。如果找到多个(此SCROLLS_PATH下有多个独立卷轴设置的单体仓库),列出它们并询问用户本次会话更新针对的是哪一个——不要猜测,也不要更新多个,因为会话的记录属于特定项目,而非它所在的所有嵌套项目。BASE_DIR - 未指定,或上述递归搜索也未找到任何内容:不要在此创建。告知用户此项目(或此路径)尚未设置,并引导其使用/scrolls-setup——如果
-r解析为当前工作目录(默认或BASE_DIR)而非仓库根目录,建议尝试-l/-t,如果尚未使用--reporoot/-r,也建议尝试,因为卷轴文件夹可能位于非预期的位置。--recurse
如果下同时存在和,停止操作并询问用户哪一个是当前在用的——这种不一致状态不应被此技能无声地掩盖。
DOCS_BASE.scrollsscrolls2. Read STARTER.md as the authoritative map
2. 读取STARTER.md作为权威指南
Don't assume the minimal six-file set from is still the whole story — says explicitly that projects grow additional scrolls over time (architecture decisions, security reviews, subsystem deep-dives), each listed with its own read/update rule. Read the current in full and use its numbered list and "When to update" section as the source of truth for what files exist and how each one wants to be updated. If a file's update convention differs from the generic rules below (e.g. an append-only dated log that must never be edited in place, like this repo's own ), follow that file's specific convention over the generic one.
/scrolls-setupSTARTER.mdSTARTER.mdSECURITY_ANALYSIS.md不要假设/scrolls-setup中的最小六文件集合仍然是全部内容——明确说明项目会随时间增加更多卷轴文件(架构决策、安全审查、子系统深入分析),每个文件都列出了自己的读取/更新规则。完整读取当前的,并以其编号列表和“何时更新”部分作为文件存在情况及每个文件更新方式的唯一依据。如果某个文件的更新约定与以下通用规则不同(例如,像本仓库自身的那样,是仅可追加的日期日志,绝不能就地编辑),则遵循该文件的特定约定而非通用规则。
STARTER.mdSTARTER.mdSECURITY_ANALYSIS.md3. Establish what actually happened this session
3. 确定本次会话实际发生的内容
Conversation context is the primary source — you were there. But don't rely on it alone, especially if context has been compacted, the session was resumed, or you're being asked to update scrolls for work that happened before this conversation started. Run the bundled script to cross-check against git — pick whichever of the two ships in matches the current environment (see "Cross-platform" below):
<skill-dir>/scripts/bash <skill-dir>/scripts/session_diff.sh SCROLLS_PATH
pwsh <skill-dir>/scripts/session_diff.ps1 -ScrollsDir SCROLLS_PATHIt shows uncommitted changes, commits since was last touched, and a stat summary of what files changed — enough to catch things conversation memory missed, without dumping full diffs into context. Pull specific / slices yourself if you need more detail on a particular change.
docs/.scrolls/git diffgit log -p对话上下文是主要来源——你全程参与了会话。但不要仅依赖上下文,尤其是在上下文已压缩、会话已恢复,或者被要求更新会话开始前完成的工作的卷轴文件时。运行附带的脚本与git交叉验证——选择中与当前环境匹配的脚本(见下文“跨平台支持”):
<skill-dir>/scripts/bash <skill-dir>/scripts/session_diff.sh SCROLLS_PATH
pwsh <skill-dir>/scripts/session_diff.ps1 -ScrollsDir SCROLLS_PATH它会显示未提交的更改、自上次修改以来的提交,以及文件更改的统计摘要——足以捕捉对话记忆遗漏的内容,而不会将完整差异转储到上下文中。如果需要特定更改的更多细节,可自行提取/的具体内容。
docs/.scrolls/git diffgit log -p4. Update each file that needs it, following its own rule
4. 更新每个需要修改的文件,遵循其自身规则
The core six's generic rules (from ):
STARTER.md- — overwrite, don't append. It's a snapshot: current state, what just happened, known issues/open threads. If nothing meaningfully changed this session, it's fine to leave it as-is rather than padding it with a no-op entry.
HANDOFF.md - — append a section only for features that actually shipped (working, not just started). Describe what it does for a user, not how it's implemented.
SPEC.md - +
GAP_ANALYSIS.md— keep these two in lockstep. Closed a gap → delete itsGAP_CONTEXT.mdline (don't mark it done, remove it) and itsGAP_ANALYSIS.mdentry. Found a new gap → add a terse line toGAP_CONTEXT.mdand the reasoning (deliberate cut / oversight / blocker) toGAP_ANALYSIS.md.GAP_CONTEXT.md - — flip
PLAN.md→[ ]for completed tickets, re-prioritize if new requests changed the order, add new tickets for newly surfaced work.[x] - — add an entry under the right section (Constraints / Traps / Ditches / Wisdom) only when something genuinely new was learned — a bug that bit you, a pattern worth reusing, a hard constraint discovered. Don't force an entry if the session didn't teach anything new.
WISDOM.md
For any project-specific scrolls beyond this core set, use the convention documents for that specific file — don't default to the generic rules above for a file that says it works differently.
STARTER.md核心六个文件的通用规则(来自):
STARTER.md- ——覆盖,而非追加。它是一个快照:当前状态、刚刚发生的事情、已知问题/未完成事项。如果本次会话没有实质性变化,可以保持原样,无需添加无意义的条目。
HANDOFF.md - ——仅为实际交付(可正常工作,而非仅启动开发)的功能追加章节。描述该功能对用户的作用,而非实现方式。
SPEC.md - +
GAP_ANALYSIS.md——保持这两个文件同步。关闭一个差距→删除GAP_CONTEXT.md中的对应行(不要标记为已完成,直接移除)和GAP_ANALYSIS.md中的对应条目。发现新差距→在GAP_CONTEXT.md中添加简洁的一行,并在GAP_ANALYSIS.md中添加原因(故意删减/疏忽/障碍)。GAP_CONTEXT.md - ——将已完成任务的
PLAN.md改为[ ],如果有新请求改变了优先级,则重新排序,为新出现的工作添加新任务。[x] - ——仅当真正学到新内容时,在相应章节(Constraints / Traps / Ditches / Wisdom)下添加条目——比如遇到的bug、值得复用的模式、发现的硬性约束。如果会话没有学到新内容,不要强行添加条目。
WISDOM.md
对于核心集合之外的任何项目专属卷轴文件,使用中记录的该文件的约定——不要对声明了不同工作方式的文件默认使用上述通用规则。
STARTER.md5. Don't fabricate or over-claim
5. 不要编造或过度断言
If it's unclear whether something shipped versus just started, treat it as unshipped — note it in 's "known issues / open threads" or , not as a finished entry. When genuinely ambiguous (e.g. whether a gap was actually closed or just worked around), ask rather than guessing — these files are load-bearing for every future session.
HANDOFF.mdPLAN.mdSPEC.md如果不清楚某项功能是已交付还是仅启动开发,视为未交付——在的“已知问题/未完成事项”或中记录,而非作为中的已完成条目。当确实存在歧义时(例如,某个差距是真正关闭还是仅被 workaround),询问用户而非猜测——这些文件对未来的每一次会话都至关重要。
HANDOFF.mdPLAN.mdSPEC.md6. Report what changed
6. 报告更改内容
List which scrolls files were touched and a one-line reason for each. If a file was deliberately left alone despite session activity (e.g. nothing shipped, so didn't need a new entry), it's fine to just not mention it — no need to enumerate every file that wasn't touched.
SPEC.md列出被修改的卷轴文件及每个文件的修改原因。如果尽管会话有活动,但某个文件被故意保留原样(例如,没有功能交付,因此无需添加新条目),无需提及该文件——无需枚举所有未被修改的文件。
SPEC.mdDevelopment
开发
tests/scripts/session_diff.shscripts/session_diff.ps1/scrolls-updatetests/scripts/session_diff.shscripts/session_diff.ps1