Hiding docs/scrolls/
Some projects run their scrolls folder visible (
, e.g. via
or a prior
) and later want it back to the dotfile-hidden default. This skill renames
→
and fixes every reference to the old path that it can find with confidence, without guessing at edits to files outside its scope. It's the mirror image of
— same mechanics, opposite direction.
Everything operates relative to the current working directory unless
/
says otherwise — not relative to this skill's own location.
Cross-platform
The bundled script ships in two forms:
(bash — macOS, Linux, or Windows with Git Bash/WSL) and
(PowerShell 7+ — Windows, or macOS/Linux with
installed). Both accept the exact same flags in the exact same forms (
/
,
/
,
/
,
/
) and produce the same output — only the launcher differs. Pick by what's actually available: try
; if that succeeds, use
; otherwise use
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).
Options
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:
- / / — a base directory to operate on, instead of the current directory. Repeatable, to target several locations in one run (e.g.
-p packages/api -p packages/web
in a monorepo).
- / — use the git repository's top level (
$(git rev-parse --show-toplevel)
) as the base directory, regardless of which subdirectory you actually invoked this from. Fails with a clear message if the current directory isn't inside a git repository.
- / — use the current working directory as the base directory explicitly. This is what happens by default anyway when none of // are given — the flag exists to say so on purpose.
- / — search recursively under the base directory for scrolls folders, instead of checking only its exact . Matches the usual meaning of on tools like //: off by default, opt in to widen the blast radius. Combine with any of the above (or with none, recursing from cwd).
,
, and
are three different ways to pick a base directory —
and
each resolve to a single one and can't be combined with
or with each other; pass
(repeatably) for anything more specific.
is independent and stacks with any of them. If no base directory is given, the bundled script defaults to the
environment variable if the user has it set, otherwise the current directory — and if that default isn't recursive and differs from the repo's top level (in a git repo), the script prints a note about
/
as alternatives, since a scrolls folder living elsewhere in the repo would otherwise go unnoticed rather than erroring.
Because a directory literally named
(no dot) is a more generic name than
, false positives are more plausible here than in
— the
-presence guard described below is what keeps recursion safe regardless.
Steps
1. Run the bundled script
bash <skill-dir>/scripts/hide.sh [-p BASE ...] [-t] [-l] [-r]
pwsh <skill-dir>/scripts/hide.ps1 [-p BASE ...] [-t] [-l] [-r]
Pass through whatever flags the user gave, in the same forms, to whichever of the two matches the environment (see "Cross-platform" above). Omit them entirely to use the default. The script, for each resolved base directory:
- Without (default): checks exactly one spot — the base directory itself if it already is a scrolls folder (has ), otherwise . Fast, and matches the location / use by default, so a bare invocation targets the obvious place first.
- With /: searches a bounded number of levels deep under the base directory for directories literally named containing a — that guard is what makes recursing from a broad base (even the whole repo) safe: coincidentally-named directories without a are ignored, and common heavy/vendor directories (, , , , , , , , , , ) are pruned rather than descended into.
For each match found (either way):
- Skips it (reporting why) if a folder already sits alongside it; otherwise renames it with when the repo and file are git-tracked (preserving history), falling back to a plain otherwise.
- Rewrites the reference to the old path inside the moved folder's own files (this catches , which references its own path throughout) and, if present, in the one file that's an exact sibling of for that folder — never a broader search for . writes a short, portable reference () relative to wherever itself lives, so in a multi-location sweep two different scrolls folders can legitimately share that exact same short string; a "helpfully" broader search for matching files would risk rewriting an unrelated sibling package's file. (The rewrite also tries the full path as discovered, for scrolls folders set up with a custom under the older convention.)
- Prints any other files nearby that still mention the old path — these are reported, not edited, and are excluded from inside other scrolls folders (a common source of false positives under the shared short-form convention) but can still include a false-positive sibling occasionally — that's expected, see step 2 below. The script deliberately doesn't touch files outside the scrolls folder and its own , since rewriting arbitrary prose (READMEs, CI configs, other docs) without reading it first risks corrupting unrelated content.
Exits with an error if a given base directory has no matching folder — without
, that's the signal to check the path, try
if you expected the repo root, or add
if it might be nested deeper; otherwise point the user at
.
2. Handle the leftover references it reports
For each file the script lists under "Other references... left for manual review" — read it and update the reference yourself if it's a genuine stale path (a README, a CONTRIBUTING doc, a CI script), using normal editing judgment rather than blind find-and-replace. Skip anything that isn't actually about this project's scrolls folder (e.g. a coincidental string match).
3. Report back
List each folder that was hidden (old path → new path), what was auto-fixed for each (its own files,
), any that were skipped and why (target already existed), and what you fixed manually in step 2, if anything.
Development
holds this script's Red/Green regression suite (bash + PowerShell), for maintaining
/
themselves — it plays no part in carrying out a user's
request. Don't read or run it while executing this skill.