From jupiter
Consolidate the master spec into a single file (per module in multi-module mode), emit a sidecar consolidated-index.json, and prompt the user whether to delete the source spec files. Never deletes without explicit consent.
How this skill is triggered — by the user, by Claude, or both
Slash command
/jupiter:rewriteThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are orchestrating the Jupiter rewrite pipeline. The output is a consolidated document built from the same cataloger + scanner pipeline used by adopt.
You are orchestrating the Jupiter rewrite pipeline. The output is a consolidated document built from the same cataloger + scanner pipeline used by adopt.
Run git status --porcelain. If output is non-empty:
Warning: working tree has uncommitted changes:
<output>
jupiter:rewrite commits on completion. Continue anyway? (Y/n)
Default N. On N, STOP.
Apply the same detection signals as jupiter:adopt Step 1d. Print: Module detection: <mode> (signal: <which>).
Apply the same enumeration as jupiter:adopt Step 1e. Store as detected_modules. The scanner in Step 1 uses this list for its modules input. The write phase in Step 3 uses all_buckets = union(keys(catalog.proposed_layout), detected_modules[].name) so that surface-only buckets (like gamma in the multi-module fixture) also get a minimal consolidated file.
Dispatch jupiter-spec-cataloger and jupiter-surface-scanner exactly as jupiter:adopt Steps 2 and 3 do. Use the same prompts, parsing, validation, and retry policy.
Rewrite runs the pipeline fresh every time -- it does not read an existing docs/master-spec/index.json. Pass already_adopted: [] to the cataloger and deep: false to the scanner (rewrite has no --deep flag).
For each bucket in all_buckets (may include buckets that have zero specs but had surface stubs -- they get a minimal consolidated file containing only the surface section):
mode == "module": docs/master-spec/CONSOLIDATED-<bucket>.mdmode == "feature": docs/master-spec/CONSOLIDATED.md (single file across all feature buckets)mtime, oldest first.For each target output file:
Open for writing (overwrite if exists).
Write the header:
# Consolidated Spec: <bucket or "Main">
Generated by jupiter:rewrite on <ISO 8601 timestamp>.
Source files are listed in the order shown below; originals preserved unless you chose cleanup at the end of this run.
For each ordered spec, write:
<!-- source: <original path> -->
## <basename without .md>
<original file contents, with each `#` heading demoted by one level: `#` -> `##`, `##` -> `###`, etc.>
Do NOT demote headings inside any <!-- jupiter:surface-begin --> ... <!-- jupiter:surface-end --> block. If the spec already contains such a block from a prior jupiter:adopt run, copy its contents through verbatim -- the block will be regenerated in full by step 3.4 below.
After all specs in a bucket, append the surface stubs for that bucket using the matching rule from jupiter:adopt Step 4c. Inline stubs live inside the same <!-- jupiter:surface-begin --> / <!-- jupiter:surface-end --> markers, within the consolidated file.
In multi-module mode, repeat for each bucket -- one output file per bucket.
Compute docs/master-spec/consolidated-index.json:
generated_at: current ISO 8601jupiter_version: from plugin.json#versionmode: from Step 0broot: "docs/master-spec/"consolidated_files: list of every consolidated file written in Step 3buckets[<name>]:
summary: top-3 topics joined with " / "source_file: the consolidated file that contains this bucketsections[]: for each spec in the bucket, emit
{
"anchor": "#<slugified h2 heading>",
"original_path": "<original path of the spec>",
"heading": "## <basename without .md>",
"line": <line number inside the consolidated file>,
"loc": <loc of that section in the consolidated file>,
"topics": <from catalog>
}
gaps_count: number of surface stubs appended to this buckettotal_loc: sum of every consolidated file's LOCscan_summary: counts across all modulesSlugify: lowercase; replace runs of non-alphanumerics with -; trim leading/trailing -.
Validate the object against plugins/jupiter/schemas/consolidated-index.schema.json. On failure, STOP with the offending JSONPath.
Write to docs/master-spec/consolidated-index.json using 2-space indentation.
Compute:
total_sources: number of distinct source spec paths read by the catalogeroutput_paths: list of consolidated file paths written in Step 3total_loc: the value from the indexPrompt:
Rewrite complete. <total_sources> source files consolidated into:
<output path 1>
<output path 2>
...
Total: <total_loc> LOC.
Delete the original spec files now? (y/N)
Default N. The default is keep -- never delete on blank input.
Commit only the consolidated files + sidecar index:
git add docs/master-spec/
git commit -m "jupiter: rewrite <total_sources> specs into <count> consolidated file(s) (originals kept)"
Run git rm on every original spec path from the catalog. Do NOT remove anything outside catalog.specs[].path.
git rm <original path 1> <original path 2> ...
git add docs/master-spec/
git commit -m "jupiter: rewrite + cleanup <total_sources> originals into <count> consolidated file(s)"
Print:
jupiter:rewrite complete
========================
Mode: <mode>
Sources: <total_sources>
Consolidated: <count> file(s)
Total LOC: <total_loc>
Originals: <kept | deleted>
Index: docs/master-spec/consolidated-index.json
Commit: <short sha>
STOP.
Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub mistervitopro/qa-claude-market --plugin jupiter