@istmx/skills 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CODE_OF_CONDUCT.md +47 -0
  2. package/LICENSE +30 -0
  3. package/README.md +16 -8
  4. package/RELEASE_v1.2.0.md +40 -0
  5. package/bin/cli.js +99 -114
  6. package/istm-animate/SKILL.md +25 -60
  7. package/istm-architecture/SKILL.md +10 -1
  8. package/istm-awwward-designer/SKILL.md +16 -20
  9. package/istm-design/SKILL.md +2 -1
  10. package/istm-workflow/istm-audit/SKILL.md +7 -7
  11. package/istm-workflow/istm-audit/agent-prompt.md +20 -20
  12. package/istm-workflow/istm-audit/modes/area.md +1 -1
  13. package/istm-workflow/istm-audit/modes/greenfield.md +4 -4
  14. package/istm-workflow/istm-audit/modes/tool-skills.md +1 -1
  15. package/istm-workflow/istm-check/SKILL.md +10 -10
  16. package/istm-workflow/istm-check/modes/review.md +9 -9
  17. package/istm-workflow/istm-check/modes/verify.md +19 -19
  18. package/istm-workflow/istm-check/review-agent-prompt.md +2 -2
  19. package/istm-workflow/istm-check/review-guide.md +4 -4
  20. package/istm-workflow/istm-craft/SKILL.md +20 -11
  21. package/istm-workflow/istm-craft/agent-modes/architecture.md +1 -1
  22. package/istm-workflow/istm-craft/agent-prompt.md +8 -8
  23. package/istm-workflow/istm-craft/internal/after-subagent.md +11 -11
  24. package/istm-workflow/istm-craft/internal/design-conversation.md +9 -9
  25. package/istm-workflow/istm-craft/internal/tool-discovery.md +2 -2
  26. package/istm-workflow/istm-craft/spec-template.md +18 -18
  27. package/istm-workflow/istm-debug/SKILL.md +6 -6
  28. package/istm-workflow/istm-develop/SKILL.md +31 -16
  29. package/istm-workflow/istm-develop/checklist.md +1 -1
  30. package/istm-workflow/istm-develop/flow/build.md +21 -21
  31. package/istm-workflow/istm-develop/flow/git.md +4 -4
  32. package/istm-workflow/istm-develop/logical-guide.md +5 -5
  33. package/istm-workflow/istm-develop/ui/implementation.md +2 -2
  34. package/istm-workflow/istm-develop/ui-guide.md +3 -3
  35. package/istm-workflow/istm-document/SKILL.md +6 -6
  36. package/istm-workflow/istm-document/templates/postmortem.md +1 -1
  37. package/istm-workflow/istm-scope/SKILL.md +20 -20
  38. package/istm-workflow/istm-scope/modes/add.md +1 -1
  39. package/istm-workflow/istm-scope/modes/plan-brownfield.md +2 -2
  40. package/istm-workflow/istm-scope/modes/plan-greenfield.md +4 -4
  41. package/istm-workflow/istm-scope/modes/plan-monorepo.md +3 -3
  42. package/istm-workflow/istm-scope/modes/plan.md +16 -16
  43. package/istm-workflow/istm-scope/modes/replan.md +2 -2
  44. package/istm-workflow/istm-scope/scope-template.md +29 -29
  45. package/istm-workflow/istm-sync/SKILL.md +37 -25
  46. package/istm-workflow/istm-sync/agent-prompt.md +37 -19
  47. package/istm-workflow/istm-test/SKILL.md +12 -12
  48. package/istm-workflow/istm-test/modes/setup.md +6 -6
  49. package/istm-workflow/istm-test/writing-guide.md +1 -1
  50. package/package.json +1 -1
@@ -1,8 +1,8 @@
1
1
  # Scope Plan Route: monorepo
2
2
 
3
3
  Monorepo (workspaces config: `pnpm-workspace.yaml`, `turbo.json`, `nx.json`, `lerna.json`, `workspaces` in root `package.json`; or multiple manifests under `apps/*` / `packages/*`): plan per workspace, never mix apps:
4
- - Each workspace: `.istm-context/scope/<workspace>/` (`scope.md`, or `index.md` + epics if large). Repo wide planning (monorepo tooling, cross cutting infra, e.g. a shared design system in `packages/ui`): `.istm-context/scope/_root/`.
5
- - Top level `.istm-context/scope/index.md` maps the monorepo: one line per workspace (and `_root`) linking its scope with a status rollup (features done / total); create or update whenever a workspace scope is added or its rollup changes.
6
- - `/scope web <idea>` plans the `web` app; bare `/scope` on a monorepo asks which workspace(s) (or "repo wide") as a panel. Read that workspace's nested `.istm-context/agents.md` for its stack/conventions; apps differ, don't assume one.
4
+ - Each workspace: `.istm-context/istm-scope/<workspace>/` (`scope.md`, or `index.md` + epics if large). Repo wide planning (monorepo tooling, cross cutting infra, e.g. a shared design system in `packages/ui`): `.istm-context/istm-scope/_root/`.
5
+ - Top level `.istm-context/istm-scope/index.md` maps the monorepo: one line per workspace (and `_root`) linking its scope with a status rollup (features done / total); create or update whenever a workspace scope is added or its rollup changes.
6
+ - `/istm-scope web <idea>` plans the `web` app; bare `/istm-scope` on a monorepo asks which workspace(s) (or "repo wide") as a panel. Read that workspace's nested `.istm-context/agents.md` for its stack/conventions; apps differ, don't assume one.
7
7
  - Each feature's `Code area` points into its workspace (`apps/web/...`). Foundations are per workspace, except genuinely shared ones (monorepo tooling, a shared UI package), which live in `_root` and the apps depend on. A greenfield workspace (no code yet) follows the foundations first sequencing in `modes/plan-greenfield.md`, applied per workspace; an already built workspace enrolls per `modes/plan-brownfield.md`.
8
8
  - Feature spanning workspaces: plan in `_root` (tag intent by workspace) or split into coordinated per workspace features; never bury cross app work in one app's scope.
@@ -2,7 +2,7 @@
2
2
 
3
3
  ### Step 1: Locate the scope; greenfield / brownfield / monorepo
4
4
 
5
- Detect (skip `node_modules/` and `.git/`): source files (any `.ts`, `.tsx`, `.js`, `.py`, `.go`, `.rs`; presence ⇒ brownfield, none ⇒ greenfield); root `.istm-context/agents.md`; existing scope under `.istm-context/scope/` (`scope.md`, or `index.md` + epic files; monorepo: `.istm-context/scope/<workspace>/`), noting the shape.
5
+ Detect (skip `node_modules/` and `.git/`): source files (any `.ts`, `.tsx`, `.js`, `.py`, `.go`, `.rs`; presence ⇒ brownfield, none ⇒ greenfield); root `.istm-context/agents.md`; existing scope under `.istm-context/istm-scope/` (`scope.md`, or `index.md` + epic files; monorepo: `.istm-context/istm-scope/<workspace>/`), noting the shape.
6
6
 
7
7
  Read exactly one route file before continuing to Step 2:
8
8
 
@@ -37,7 +37,7 @@ Reason out the pick, never hardcode it or its mechanics: default for a proper pr
37
37
 
38
38
  **Once the approach is chosen, read its persona file and adopt that engineer's role for decomposition** (`approaches/tracer-bullet.md`, `approaches/skateboard.md`, `approaches/facade.md`, or `approaches/journey.md`). Read only the chosen one. Each persona defines how that engineer slices, what the first slice or deliverable is, what is real vs deferred, and the sequencing, with a worked example. All slicing and sequencing in Step 4 and Step 5 follows that persona, so the four approaches produce genuinely different scopes for the same product, not the same list relabeled. A per feature override (Step 5) reads that feature's chosen persona and applies it to that feature only.
39
39
 
40
- Record it (the propagation source) in the scope header: `Build approach: <name> (<one-line principle>)`. A project wide convention: `/audit` and `/sync` persist it into root `.istm-context/agents.md`; `/architect`, `/develop`, `/check verify` read and honor it. It also sets each feature's Phase (its slice / journey), shown in the At a glance table and as section grouping.
40
+ Record it (the propagation source) in the scope header: `Build approach: <name> (<one-line principle>)`. A project wide convention: `/istm-audit` and `/istm-sync` persist it into root `.istm-context/agents.md`; `/architect`, `/istm-develop`, `/istm-check verify` read and honor it. It also sets each feature's Phase (its slice / journey), shown in the At a glance table and as section grouping.
41
41
 
42
42
  Header value = project default; a single feature may override via the optional per feature Approach (Step 5), a tag beside its heading (e.g. `· Facade`). Precedence: own tag if set, else project default; tag only when it differs (no tag = inherit).
43
43
 
@@ -60,36 +60,36 @@ From the answers, produce the feature list: foundations first (Step 4), then sli
60
60
  - **Needs spec?**: the invent test: would building it require a decision the engineer hasn't made? Yes for a provider/library choice, a data model, a cross cutting pattern, the design system, a whole page/screen with no spec yet, or behavior that is not trivial (search, filtering, recommendations). No only for genuinely pure implementation an existing `.istm-context/design.md`/spec/convention covers. Unsure → yes; an unflagged decision is the expensive miss. `Full`/`Medium` tier → almost always yes.
61
61
  - One decision per spec: multiple distinct decisions in one feature → one `Needs spec: yes` item each, never one lumped "strategy" spec. Several sharing one broad decision that then splits → an umbrella that dependents reference; never mark a dependent `no` when it carries its own decision.
62
62
 
63
- No build task breakdown here. A not yet designed feature gets exactly one checkbox, its entry command: `/architect <feature>` when it `needs a decision`, else `/develop <feature>` (the coding standards and tooling foundation's first box is `/audit`, never `/develop`). Never enumerate UI / data model / API / test sub tasks; `/architect` fills the built ready shape on spec capture (see What this skill does; atomic tasks stay in the spec). The next step is then always the first unticked box, always a command or tracked milestone (no separate `Next:` line). See the lifecycle table in `scope-template.md`.
63
+ No build task breakdown here. A not yet designed feature gets exactly one checkbox, its entry command: `/architect <feature>` when it `needs a decision`, else `/istm-develop <feature>` (the coding standards and tooling foundation's first box is `/istm-audit`, never `/istm-develop`). Never enumerate UI / data model / API / test sub tasks; `/architect` fills the built ready shape on spec capture (see What this skill does; atomic tasks stay in the spec). The next step is then always the first unticked box, always a command or tracked milestone (no separate `Next:` line). See the lifecycle table in `scope-template.md`.
64
64
 
65
- Analysis/inventory is not a scope row: cataloguing duplication, listing call sites, auditing current state is decision support research living with the spec (`/architect` puts it in the spec's `rationale.md`). Never plan a row or step that writes a `.md` into `.istm-context/scope/`.
65
+ Analysis/inventory is not a scope row: cataloguing duplication, listing call sites, auditing current state is decision support research living with the spec (`/architect` puts it in the spec's `rationale.md`). Never plan a row or step that writes a `.md` into `.istm-context/istm-scope/`.
66
66
 
67
67
  ### Step 5b: Recommend the workflow depth (decision panel)
68
68
 
69
- Now that the features exist, propose the project's default **workflow depth**: how many stages a feature normally runs after `/develop`. This is a recommendation, not a question you ask cold: reason from the product (throwaway prototype vs internal tool vs real product vs payments/auth/compliance/regulated/team work) and the mix of feature weights you just assigned, then present a panel with exactly one recommended. Each level names the stages it runs, so the tradeoff is visible. Frame it: "Based on what you're building, here's the workflow I recommend. You can override, and any single feature can still run heavier."
69
+ Now that the features exist, propose the project's default **workflow depth**: how many stages a feature normally runs after `/istm-develop`. This is a recommendation, not a question you ask cold: reason from the product (throwaway prototype vs internal tool vs real product vs payments/auth/compliance/regulated/team work) and the mix of feature weights you just assigned, then present a panel with exactly one recommended. Each level names the stages it runs, so the tradeoff is visible. Frame it: "Based on what you're building, here's the workflow I recommend. You can override, and any single feature can still run heavier."
70
70
 
71
- Depth governs only the stages **after** `/develop` (verify, test, review, document). It does **not** turn off the `/architect` gate: at every depth, a feature that needs a load bearing decision still runs `/architect` first (or records an `Assumed` spec). Lean does not mean "skip architect"; it means lean features are usually `Needs spec: no`, so you rarely reach it.
71
+ Depth governs only the stages **after** `/istm-develop` (verify, test, review, document). It does **not** turn off the `/architect` gate: at every depth, a feature that needs a load bearing decision still runs `/architect` first (or records an `Assumed` spec). Lean does not mean "skip architect"; it means lean features are usually `Needs spec: no`, so you rarely reach it.
72
72
 
73
- - **question**: "How much workflow do you want by default for this project? Each level sets the stages a feature normally runs after `/develop`; a risky feature can still be bumped up, and `/architect` still applies whenever a decision is owed."
73
+ - **question**: "How much workflow do you want by default for this project? Each level sets the stages a feature normally runs after `/istm-develop`; a risky feature can still be bumped up, and `/architect` still applies whenever a decision is owed."
74
74
  - **header**: "Workflow"
75
75
  - **options** (mark exactly one `(recommended)` by the product signals, one line why):
76
- - `Vibe`: "Just `/develop`. Nothing after it, you rely on `/develop`'s own build time self check (typecheck, and rendering the screen when it can) and your own eye. No `/check verify`, no test suite, no review. `/develop` can mark the feature `done` itself. Best for throwaway prototypes, experiments, and personal projects."
77
- - `Lean`: "After `/develop`, `/check verify` on the real app. No separate test suite or second model review unless a feature needs it. Best for low risk features and internal tools you still want proven."
78
- - `Medium`: "After `/develop`, `/check verify` then `/test`. No fresh model review by default. Best for most real products."
79
- - `Full`: "After `/develop`, `/check verify`, `/test`, a fresh model `/check review`, then `/document`; and most features are treated as needing a spec. Best for high risk, payments, auth, compliance, regulated, or team projects."
76
+ - `Vibe`: "Just `/istm-develop`. Nothing after it, you rely on `/istm-develop`'s own build time self check (typecheck, and rendering the screen when it can) and your own eye. No `/istm-check verify`, no test suite, no review. `/istm-develop` can mark the feature `done` itself. Best for throwaway prototypes, experiments, and personal projects."
77
+ - `Lean`: "After `/istm-develop`, `/istm-check verify` on the real app. No separate test suite or second model review unless a feature needs it. Best for low risk features and internal tools you still want proven."
78
+ - `Medium`: "After `/istm-develop`, `/istm-check verify` then `/istm-test`. No fresh model review by default. Best for most real products."
79
+ - `Full`: "After `/istm-develop`, `/istm-check verify`, `/istm-test`, a fresh model `/istm-check review`, then `/istm-document`; and most features are treated as needing a spec. Best for high risk, payments, auth, compliance, regulated, or team projects."
80
80
 
81
81
  The picker appends a free text Other automatically; in a plain text fallback offer the same four. Recommend by signal: throwaway prototype, experiment, or a personal one off → `Vibe`; a low risk product or internal tool you still want proven → `Lean`; a normal production product → `Medium`; payments, auth, PII, compliance, regulated, or a team codebase → `Full`.
82
82
 
83
- Each tier also sets what `done` means (see `scope-template.md`): `Vibe` closes on build plus self check (`/develop` marks it), `Lean` on `/check verify` passing, `Medium`/`Full` on the tests being in (and the review for `Full`). The `Assumed` spec done gate still holds at every tier: a feature built on an unratified assumption cannot be `done` until `/architect` ratifies it.
83
+ Each tier also sets what `done` means (see `scope-template.md`): `Vibe` closes on build plus self check (`/istm-develop` marks it), `Lean` on `/istm-check verify` passing, `Medium`/`Full` on the tests being in (and the review for `Full`). The `Assumed` spec done gate still holds at every tier: a feature built on an unratified assumption cannot be `done` until `/architect` ratifies it.
84
84
 
85
- Record the pick as the project default in the scope header `**Workflow:**` line (see `scope-template.md`). It sets the baseline each feature inherits; a feature tagged with a higher tier than the project default (Step 5) runs its heavier path, and one tagged lower runs lighter. This default is what `/develop` reads (via the effective tier) to scale the next steps it recommends after a build.
85
+ Record the pick as the project default in the scope header `**Workflow:**` line (see `scope-template.md`). It sets the baseline each feature inherits; a feature tagged with a higher tier than the project default (Step 5) runs its heavier path, and one tagged lower runs lighter. This default is what `/istm-develop` reads (via the effective tier) to scale the next steps it recommends after a build.
86
86
 
87
87
  ### Step 6: Write the scope (single file or epic split)
88
88
 
89
89
  List the scope location again immediately before writing (a teammate may have changed it), then write per `scope-template.md`:
90
90
 
91
- - Small product → single file `.istm-context/scope/scope.md` (monorepo: `.istm-context/scope/<workspace>/scope.md`): At a glance table (including brownfield enrolled features) + phase grouped feature sections + legend.
92
- - Large product → epic split per Artifact ownership (`.istm-context/scope/index.md` + `.istm-context/scope/<epic>.md`); promote only when `scope.md` has outgrown a comfortable scan, else stay single file.
91
+ - Small product → single file `.istm-context/istm-scope/istm-scope.md` (monorepo: `.istm-context/istm-scope/<workspace>/istm-scope.md`): At a glance table (including brownfield enrolled features) + phase grouped feature sections + legend.
92
+ - Large product → epic split per Artifact ownership (`.istm-context/istm-scope/index.md` + `.istm-context/istm-scope/<epic>.md`); promote only when `scope.md` has outgrown a comfortable scan, else stay single file.
93
93
  - Run again (living update): edit in place, never a dated file: append new rows with the next free `#`, sharpen existing rows' intent/seeds, leave existing statuses untouched; set a now out of scope row to `dropped` (never delete). Brownfield: append enrolled `existing`/`in-progress` rows above the `planned` ones.
94
94
 
95
95
  Citations are gated by Step 6b: ask that panel first (or confirm the chosen level) before adding any `(basis: …)` or `## References` content, and honor its level.
@@ -117,4 +117,4 @@ Sources plus web verified links: as Sources only, then verify the links with a r
117
117
 
118
118
  ### Step 7: Report and hand off
119
119
 
120
- Print the completion report using the `## /scope complete` block in `scope-template.md`, filled with this run's specifics. `/scope` does not run `/architect` or `/develop` for you; it hands you the ordered, coarse, weighted list to walk feature by feature (architect the `Needs spec: yes` ones, then build).
120
+ Print the completion report using the `## /istm-scope complete` block in `scope-template.md`, filled with this run's specifics. `/istm-scope` does not run `/architect` or `/istm-develop` for you; it hands you the ordered, coarse, weighted list to walk feature by feature (architect the `Needs spec: yes` ones, then build).
@@ -5,9 +5,9 @@
5
5
  The default cadence, not rare: run each time a feature or phase lands, keeping the scope matching reality and queueing the next slice. Reconciles in place, never spawns a new file; coarse and surgical (reconcile cells, append rows, don't rewrite the file).
6
6
 
7
7
  1. Read the whole scope again (single file, or `index.md` + epics; the workspace's in a monorepo) and the code/specs for what just shipped.
8
- 2. Reconcile what shipped: mark completed features `done` (verify from code/spec, don't stamp); tick nothing unconfirmed; leave rows `/develop`/`/sync` already advanced. **A feature whose governing spec is `Assumed` cannot be `done`**: it was built on a decision that was recorded but not deliberated. Leave it `in-progress` with its `assumed decision (spec NNNN)` note, and surface it (below) as decision debt.
8
+ 2. Reconcile what shipped: mark completed features `done` (verify from code/spec, don't stamp); tick nothing unconfirmed; leave rows `/istm-develop`/`/istm-sync` already advanced. **A feature whose governing spec is `Assumed` cannot be `done`**: it was built on a decision that was recorded but not deliberated. Leave it `in-progress` with its `assumed decision (spec NNNN)` note, and surface it (below) as decision debt.
9
9
  2a. Surface assumed decisions in the readout and report: for each feature with an `Assumed` spec, list it as "built, awaiting ratification (spec NNNN)" and point to `/architect <feature>`. They block `done` until ratified.
10
10
  3. Enroll needs surfaced during the build: read shipped features' spec `## Consequences` and `## Follow-up` sections; a follow-up (e.g. "add rate limiting") not yet a scope row becomes a new `planned` row with intent, tier, `Needs spec?`; the scope grows from real build feedback.
11
11
  4. Reprioritize / reorder: sequence `Order` again, adjust `Phasing` for work not yet built; foundations stay first; work dropped from scope → `dropped`. If the project's risk profile has clearly shifted (e.g. payments or auth were added), recommend the `**Workflow:**` default again via the plan Step 5b panel; otherwise leave it.
12
- 5. Queue the next slice: which feature(s) are next (lowest `Order` `planned` rows), each `Needs spec: yes` (→ `/architect` next) or `no` (→ `/develop`).
12
+ 5. Queue the next slice: which feature(s) are next (lowest `Order` `planned` rows), each `Needs spec: yes` (→ `/architect` next) or `no` (→ `/istm-develop`).
13
13
  6. Report via the completion block (mode: replan): marked done, enrolled from spec follow-up items, reordered/dropped, next step.
@@ -1,12 +1,12 @@
1
- Scope structure `/scope` writes to: the reference shapes read while writing the scope and the completion report. All rules and guidance live in `SKILL.md`.
1
+ Scope structure `/istm-scope` writes to: the reference shapes read while writing the scope and the completion report. All rules and guidance live in `SKILL.md`.
2
2
 
3
3
  ## What keeps it readable (the format rules)
4
4
 
5
5
  - **Two parts:** a slim **At a glance** table for a quick scan, then **the plan** as clean feature sections grouped by phase. Build order is just the section order. There is no separate "build order" list to keep in sync.
6
6
  - **Clean headings.** A heading is `### <N>. <Feature name>` plus a short status word and short tags **only when they carry real information** (`needs a decision`, a per feature approach override, a workflow tier override like `· Full`). Never a pipe delimited metadata row like `Title | P0 | inherit | …`.
7
7
  - **Each fact appears once.** Intent, the definition of done, tasks, and pointers live in the section; the At a glance table is the quick index. Status is shown in the table and beside the heading, and nowhere else.
8
- - **Only what is set.** No `n/a`, no `inherit`, no empty fields. A pointer line (`spec <n> · code in <path>`) appears **only once those exist**: the spec link added by `/architect` at capture, the code path by `/develop`.
9
- - **A feature grows a defined shape.** It has a one or two line **intent**, a single **Done when:** line (the acceptance criteria seeds), and **checkbox steps**. A **not yet designed** feature has **one box** (its entry command: `/architect` when it `needs a decision`, else `/develop`, or `/audit` for standards & tooling). **When its spec is captured, `/architect` fills in the built ready shape:** `Design it` (ticked) → `Build it: /develop <feature>` with **2 to 5 milestone sub items rolled up from the spec** → `Verify it: /check verify <feature>` → `Test it: /test <feature>`. **The atomic build tasks stay in the spec's `## Build plan`, never here**. The scope carries only the milestone rollup. The next step is always the first unticked box.
8
+ - **Only what is set.** No `n/a`, no `inherit`, no empty fields. A pointer line (`spec <n> · code in <path>`) appears **only once those exist**: the spec link added by `/architect` at capture, the code path by `/istm-develop`.
9
+ - **A feature grows a defined shape.** It has a one or two line **intent**, a single **Done when:** line (the acceptance criteria seeds), and **checkbox steps**. A **not yet designed** feature has **one box** (its entry command: `/architect` when it `needs a decision`, else `/istm-develop`, or `/istm-audit` for standards & tooling). **When its spec is captured, `/architect` fills in the built ready shape:** `Design it` (ticked) → `Build it: /istm-develop <feature>` with **2 to 5 milestone sub items rolled up from the spec** → `Verify it: /istm-check verify <feature>` → `Test it: /istm-test <feature>`. **The atomic build tasks stay in the spec's `## Build plan`, never here**. The scope carries only the milestone rollup. The next step is always the first unticked box.
10
10
 
11
11
  ## Single file scope
12
12
 
@@ -36,16 +36,16 @@ Scope structure `/scope` writes to: the reference shapes read while writing the
36
36
  Decide the stack and scaffold a runnable project so every later slice builds on real structure.
37
37
  **Done when:** the stack is recorded in a spec and the empty scaffold boots locally and passes build.
38
38
  - [x] Decide the stack (spec): `/architect stack & architecture`
39
- - [x] Scaffold from the decision: `/develop stack & architecture`
40
- - [ ] Smoke-check it runs: `/test`
39
+ - [x] Scaffold from the decision: `/istm-develop stack & architecture`
40
+ - [ ] Smoke-check it runs: `/istm-test`
41
41
  Spec 0001 · code in `./`
42
42
 
43
43
  ### 2. Coding standards & tooling
44
44
  Capture conventions, then install lint, format, and pre-commit enforcement from the real scaffolded project.
45
45
  **Done when:** root `.istm-context/agents.md` reflects the real stack, and lint/format/pre-commit run clean.
46
- - [ ] Capture conventions + tooling choices: `/audit`
47
- - [ ] Install the tooling: `/develop tooling`
48
- - [ ] Check it runs clean: `/test`
46
+ - [ ] Capture conventions + tooling choices: `/istm-audit`
47
+ - [ ] Install the tooling: `/istm-develop tooling`
48
+ - [ ] Check it runs clean: `/istm-test`
49
49
 
50
50
  ### 3. Data model · in-progress
51
51
  <!-- DESIGNED: /architect captured spec 0002 and filled in the shape below. The 2 to 5 boxes under
@@ -54,13 +54,13 @@ Capture conventions, then install lint, format, and pre-commit enforcement from
54
54
  Core entities every feature builds on: users, teams, memberships, standup entries, template.
55
55
  **Done when:** entities and relationships support later slices (reminders, templates, history) without a breaking migration.
56
56
  - [x] Design it (spec): `/architect data model`
57
- - [ ] Build it: `/develop data model`
58
- - [ ] Schema + constraints: tables, keys, unique/check, cascades (AC-1..6)
57
+ - [ ] Build it: `/istm-develop data model`
58
+ - [ ] Schema + constraints: tables, keys, unique/istm-check, cascades (AC-1..6)
59
59
  - [ ] Row-level security: per-table policies + helpers (AC-7..9)
60
60
  - [ ] Apply migration, confirm live, generate types (AC-1..9)
61
- - [ ] Verify it: `/check verify data model`
62
- - [ ] Test it: `/test data model`
63
- Spec 0002 · code (filled by /develop)
61
+ - [ ] Verify it: `/istm-check verify data model`
62
+ - [ ] Test it: `/istm-test data model`
63
+ Spec 0002 · code (filled by /istm-develop)
64
64
 
65
65
  ### 4. Design system & UI foundation · needs a decision
66
66
  Visual language, layout primitives, and base components so the flows feel cohesive and accessible.
@@ -96,53 +96,53 @@ Out of scope for the current build pass, kept so the plan stays honest.
96
96
 
97
97
  | State | Set by | The feature shows |
98
98
  |---|---|---|
99
- | `planned` · needs a decision | `/scope` | one box: `Design it (spec): /architect <feature>` |
100
- | `in-progress` (designed) | **`/architect` at spec capture** | `Design it` ticked; spec linked; `Build it: /develop <feature>` + **2 to 5 milestones**; the tier's closing boxes (`Verify it` Lean+, `Test it` Medium+, `Review it` + `Document it` Full); any surfaced follow-up enrolled |
101
- | `in-progress` (building) | `/develop` | milestone sub-boxes tick one by one; code pointer filled |
102
- | `in-progress` (verified) | `/check verify` | `Build it` + milestones ticked; `Verify it` ticked |
103
- | `done` | the tier's last required stage (`Vibe` → `/develop`; `Lean` → `/check verify`; `Medium`/`Full` → `/test`), then `/sync` | required boxes ticked; `Review it`/`Document it` (Full) ticked by `/check review`/`/document`, tracked but not part of the `done` gate (Design/Build/Verify/Test); `/sync` captures conventions |
99
+ | `planned` · needs a decision | `/istm-scope` | one box: `Design it (spec): /architect <feature>` |
100
+ | `in-progress` (designed) | **`/architect` at spec capture** | `Design it` ticked; spec linked; `Build it: /istm-develop <feature>` + **2 to 5 milestones**; the tier's closing boxes (`Verify it` Lean+, `Test it` Medium+, `Review it` + `Document it` Full); any surfaced follow-up enrolled |
101
+ | `in-progress` (building) | `/istm-develop` | milestone sub-boxes tick one by one; code pointer filled |
102
+ | `in-progress` (verified) | `/istm-check verify` | `Build it` + milestones ticked; `Verify it` ticked |
103
+ | `done` | the tier's last required stage (`Vibe` → `/istm-develop`; `Lean` → `/istm-check verify`; `Medium`/`Full` → `/istm-test`), then `/istm-sync` | required boxes ticked; `Review it`/`Document it` (Full) ticked by `/istm-check review`/`/istm-document`, tracked but not part of the `done` gate (Design/Build/Verify/Test); `/istm-sync` captures conventions |
104
104
 
105
105
  - **Next step** = the first unticked box (always a command or a tracked milestone).
106
- - **needs a decision** = run `/architect` first; otherwise straight to `/develop` (or `/audit` for standards & tooling). The tag drops once the spec is captured.
106
+ - **needs a decision** = run `/architect` first; otherwise straight to `/istm-develop` (or `/istm-audit` for standards & tooling). The tag drops once the spec is captured.
107
107
  - **Atomic build tasks live in the spec's `## Build plan`, not here**: the scope carries only the milestone rollup.
108
108
  - **Status** `planned` → `in-progress` → `done`, plus `existing` (pre-workflow) and `dropped` (de-scoped, kept for history).
109
109
  - **Approach tag** beside a heading (e.g. `· Facade`) overrides the project default for that feature; no tag = inherits it.
110
110
  - **Workflow tier tag** beside a heading (e.g. `· Full`, `· Vibe`) overrides the project default `**Workflow:**` tier for that one feature; no tag = inherit. It is the single rigor dial (there is no separate "weight").
111
- - **Workflow** (header line) is the project default tier, the stages each feature runs **after** `/develop`: **Vibe** = nothing after `/develop` (rely on its build time self check); **Lean** = `/check verify`; **Medium** = `/check verify` then `/test`; **Full** = `/check verify`, `/test`, a fresh model `/check review`, then `/document` (and most features need a spec). The tier also sets what closes a feature to `done`, the last required stage marks it: **Vibe** → `/develop` (build + self check); **Lean** → `/check verify` on PASS; **Medium**/**Full** → `/test` (with verify passed). At every tier an `Assumed` spec still blocks `done` until `/architect` ratifies it, and `/architect` still gates any feature that needs a decision (tier does not turn the gate off). A feature's own tier tag overrides this default. `/develop` reads the effective tier to scale the next steps it recommends.
112
- - **Pointer line** (`spec <n> · code in <path>`): the spec link added by `/architect`, the code path by `/develop`.
111
+ - **Workflow** (header line) is the project default tier, the stages each feature runs **after** `/istm-develop`: **Vibe** = nothing after `/istm-develop` (rely on its build time self check); **Lean** = `/istm-check verify`; **Medium** = `/istm-check verify` then `/istm-test`; **Full** = `/istm-check verify`, `/istm-test`, a fresh model `/istm-check review`, then `/istm-document` (and most features need a spec). The tier also sets what closes a feature to `done`, the last required stage marks it: **Vibe** → `/istm-develop` (build + self check); **Lean** → `/istm-check verify` on PASS; **Medium**/**Full** → `/istm-test` (with verify passed). At every tier an `Assumed` spec still blocks `done` until `/architect` ratifies it, and `/architect` still gates any feature that needs a decision (tier does not turn the gate off). A feature's own tier tag overrides this default. `/istm-develop` reads the effective tier to scale the next steps it recommends.
112
+ - **Pointer line** (`spec <n> · code in <path>`): the spec link added by `/architect`, the code path by `/istm-develop`.
113
113
  ```
114
114
 
115
115
  ## Brownfield enrollment
116
116
 
117
- Already built features are enrolled **for context**, above the planned ones, with status `existing` (complete, no task list) or `in-progress` (partial, finish via `/develop`), each with a code pointer. They also appear in the At a glance table.
117
+ Already built features are enrolled **for context**, above the planned ones, with status `existing` (complete, no task list) or `in-progress` (partial, finish via `/istm-develop`), each with a code pointer. They also appear in the At a glance table.
118
118
 
119
119
  ```markdown
120
120
  ### A. Auth · existing
121
121
  Pre-workflow auth: sign in, sessions, reset. code in `src/auth/`
122
122
 
123
123
  ### B. Product catalog · in-progress
124
- Partial catalog; finish the remaining pieces via /develop. code in `src/catalog/`
124
+ Partial catalog; finish the remaining pieces via /istm-develop. code in `src/catalog/`
125
125
  ```
126
126
 
127
- `existing` is not `done`: it predates the workflow, so `/develop` and `/sync` leave it alone.
127
+ `existing` is not `done`: it predates the workflow, so `/istm-develop` and `/istm-sync` leave it alone.
128
128
 
129
129
  ## Large product: epic split
130
130
 
131
- When `scope.md` outgrows a comfortable scan (roughly a dozen plus features across clearly distinct areas), split by epic: **rename `scope.md` to `.istm-context/scope/index.md`** (keep the At a glance table across all epics + a one line status rollup per epic, each linking its file), and **move each area's feature sections out into its own `.istm-context/scope/<epic>.md`**. Promote **on demand**; don't split a small product early. File names are always **semantic** (`scope.md` / `index.md` / `<epic>.md`), never numbered. In a monorepo, each workspace gets its own `.istm-context/scope/<workspace>/` the same way, with a top level `.istm-context/scope/index.md` mapping the workspaces (one line + rollup each).
131
+ When `scope.md` outgrows a comfortable scan (roughly a dozen plus features across clearly distinct areas), split by epic: **rename `scope.md` to `.istm-context/istm-scope/index.md`** (keep the At a glance table across all epics + a one line status rollup per epic, each linking its file), and **move each area's feature sections out into its own `.istm-context/istm-scope/<epic>.md`**. Promote **on demand**; don't split a small product early. File names are always **semantic** (`scope.md` / `index.md` / `<epic>.md`), never numbered. In a monorepo, each workspace gets its own `.istm-context/istm-scope/<workspace>/` the same way, with a top level `.istm-context/istm-scope/index.md` mapping the workspaces (one line + rollup each).
132
132
 
133
133
  ## Completion report block
134
134
 
135
135
  ```
136
- ## /scope complete
136
+ ## /istm-scope complete
137
137
 
138
138
  **Product**: <one line>
139
139
  **Behavior**: <plan | replan | add (inferred from the situation, not a typed subcommand)>
140
140
  **Build approach**: <name (one-line principle)> · **Per-feature overrides**: <feature → approach, … (or "none, all inherit")>
141
141
  **Workflow**: <Vibe | Lean | Medium | Full> (<the stages it runs; why recommended for this product>) · **Per-feature tier overrides**: <feature → tier, … (or "none, all inherit")>
142
- **Scope file**: <.istm-context/scope/scope.md> (<created new | updated in place | new epic file for <area>>)
142
+ **Scope file**: <.istm-context/istm-scope/istm-scope.md> (<created new | updated in place | new epic file for <area>>)
143
143
  **Scope (this pass)**: <N> new features to build, <M> already on the scope, <K> deferred
144
144
  **Build order**: <feature 1> → <feature 2> → …
145
- **First step**: <run `/clear` first, then the first unticked box, usually `/architect <first feature>` (or `/audit` if a brownfield repo has no root .istm-context/agents.md), each skill reads its inputs from the files just written, so a fresh session keeps every step cheap>
145
+ **First step**: <run `/clear` first, then the first unticked box, usually `/architect <first feature>` (or `/istm-audit` if a brownfield repo has no root .istm-context/agents.md), each skill reads its inputs from the files just written, so a fresh session keeps every step cheap>
146
146
  ```
147
147
 
148
- _Context hygiene: the scope, the specs, and `.istm-context/agents.md` are the durable state, so the workflow hands off through files, not the chat. Advise `/clear` between units (after `/scope`, after each `/architect`, between features) and `/compact` mid unit if one run gets long. On Claude Code use `/clear` / `/compact`; use your agent's fresh session equivalent elsewhere._
148
+ _Context hygiene: the scope, the specs, and `.istm-context/agents.md` are the durable state, so the workflow hands off through files, not the chat. Advise `/clear` between units (after `/istm-scope`, after each `/architect`, between features) and `/compact` mid unit if one run gets long. On Claude Code use `/clear` / `/compact`; use your agent's fresh session equivalent elsewhere._
@@ -1,7 +1,7 @@
1
1
  ---
2
- name: sync
2
+ name: istm-sync
3
3
  allowed-tools: Bash, Read, Grep, Glob, Write, Edit, Agent
4
- description: "Run /sync as the last step after a change is complete, around merge, to keep durable knowledge current. Updates root and nested .istm-context/agents.md, reconciles the scope from repo evidence, and flags specs the change made stale. Surgical edits only: it adds lines, and rewrites single lines it owns. Never a whole section, never curated prose."
4
+ description: "Run /istm-sync as the last step after a change is complete, around merge, to keep durable knowledge current. Updates root and nested .istm-context/agents.md, reconciles the scope from repo evidence, and flags specs the change made stale. Surgical edits only: it adds lines, and rewrites single lines it owns. Never a whole section, never curated prose."
5
5
  ---
6
6
 
7
7
  ## Output style (plain words, no dashes, no hyphens)
@@ -12,30 +12,32 @@ Write everything this skill produces, files and messages alike, in plain simple
12
12
 
13
13
  ## What this skill does
14
14
 
15
- Closes the loop on a completed change: syncs .istm-context/agents.md files, the scope, and linked spec `**Status**:` lines to what the repo now shows, and flags what it must not edit (stale specs, curated prose). The Boundaries table below is the exact contract.
15
+ Dual-mode orchestrator:
16
+ 1. **Save mode** (default): Closes the loop on a completed change, syncing `.istm-context/agents.md`, the scope, and linked spec `**Status**:` lines to repo evidence.
17
+ 2. **Restore mode** (`/istm-sync restore`): Reads all progress files (`progress.md`, `memory.md`, `.istm-context/istm-scope/*`, and `agents.md`) to fully rehydrate the AI's context for a new session, establishing exactly what was last completed and what is pending.
16
18
 
17
19
  **`agent-prompt.md`** is the single source of truth for the maintenance rules; SKILL.md covers only orchestration. The main thread reads it and does the maintenance itself (see Step 3).
18
20
 
19
- **Canonical file:** durable context lives in the tool agnostic **`.istm-context/agents.md`**; **`CLAUDE.md` is only a pointer** to it. /sync edits/creates both, treating them only as targets, never as a change source.
21
+ **Canonical file:** durable context lives in the tool agnostic **`.istm-context/agents.md`**; **`CLAUDE.md` is only a pointer** to it. /istm-sync edits/creates both, treating them only as targets, never as a change source.
20
22
 
21
23
  ## Boundaries (these keep the skill from sprawling)
22
24
 
23
- | Action | /sync | Owner |
25
+ | Action | /istm-sync | Owner |
24
26
  |---|---|---|
25
- | Edit existing root/nested .istm-context/agents.md | ✅ maintains | /sync |
26
- | Reconcile root .istm-context/agents.md's `## Build approach` line to the scope header's approach (surgical single line edit, like the stack) | ✅ maintains; flags a curated divergence | /sync |
27
- | Add a one line pointer to `.istm-context/design.md` (the UI design system) in the nearest .istm-context/agents.md when a change establishes one | ✅ maintains (pointer only) | /sync |
28
- | Create nested `<area>/.istm-context/agents.md` for an area **net new in this change** | ✅ creates (diff = full area context) + adds root pointer | /sync |
29
- | Create nested doc for an **already existing** undocumented area (only sliced by the diff) | ❌ flags "run /audit" | /audit |
30
- | Create or restructure the **root** .istm-context/agents.md | ❌ flags "run /audit" | /audit |
31
- | Reconcile a spec's `**Status**:` line to its feature's scope status (`planned`→`Proposed`, `in-progress`→`In Progress`, `done`→`Accepted`) | ✅ Status line only | /sync |
27
+ | Edit existing root/nested .istm-context/agents.md | ✅ maintains | /istm-sync |
28
+ | Reconcile root .istm-context/agents.md's `## Build approach` line to the scope header's approach (surgical single line edit, like the stack) | ✅ maintains; flags a curated divergence | /istm-sync |
29
+ | Add a one line pointer to `.istm-context/design.md` (the UI design system) in the nearest .istm-context/agents.md when a change establishes one | ✅ maintains (pointer only) | /istm-sync |
30
+ | Create nested `<area>/.istm-context/agents.md` for an area **net new in this change** | ✅ creates (diff = full area context) + adds root pointer | /istm-sync |
31
+ | Create nested doc for an **already existing** undocumented area (only sliced by the diff) | ❌ flags "run /istm-audit" | /istm-audit |
32
+ | Create or restructure the **root** .istm-context/agents.md | ❌ flags "run /istm-audit" | /istm-audit |
33
+ | Reconcile a spec's `**Status**:` line to its feature's scope status (`planned`→`Proposed`, `in-progress`→`In Progress`, `done`→`Accepted`) | ✅ Status line only | /istm-sync |
32
34
  | Clear an `Assumed` spec (move it out of `Assumed`) | ❌ flags as decision debt "run /architect to ratify" (never reconciled to the feature status; only ratification clears it) | /architect |
33
35
  | Edit a spec's **content** / supersede it | ❌ flags as stale | /architect |
34
- | Reconcile the scope, for the **relevant workspace's** scope file only (not all of `.istm-context/scope/`), tick **any** completed sub task from repo **evidence** (code, tests, .istm-context/agents.md), advance status | ✅ corrects | /sync |
35
- | Add / reorder features or sub tasks in the scope | ❌ leaves alone | /scope |
36
+ | Reconcile the scope, for the **relevant workspace's** scope file only (not all of `.istm-context/istm-scope/`), tick **any** completed sub task from repo **evidence** (code, tests, .istm-context/agents.md), advance status | ✅ corrects | /istm-sync |
37
+ | Add / reorder features or sub tasks in the scope | ❌ leaves alone | /istm-scope |
36
38
  | Overwrite or rewrite curated .istm-context/agents.md prose | ❌ flags conflict instead | human |
37
39
 
38
- The dividing line on creation is **context, not policy**: create only when this change shows you the whole area; defer to /audit when the area predates the change and you've seen only a slice. When unsure, **flag instead of creating**.
40
+ The dividing line on creation is **context, not policy**: create only when this change shows you the whole area; defer to /istm-audit when the area predates the change and you've seen only a slice. When unsure, **flag instead of creating**.
39
41
 
40
42
  ## Asks vs acts
41
43
 
@@ -43,7 +45,7 @@ The dividing line on creation is **context, not policy**: create only when this
43
45
 
44
46
  ## Artifact ownership
45
47
 
46
- Owns exactly what the Boundaries table grants and writes nothing else. As the **universal sub task reconciler** it ticks any scope sub task it can verify from repo evidence (sweeping the `/test`/`/audit`/`/sync` sub tasks other skills don't tick) and advances feature status; exact rules in `agent-prompt.md`.
48
+ Owns exactly what the Boundaries table grants and writes nothing else. As the **universal sub task reconciler** it ticks any scope sub task it can verify from repo evidence (sweeping the `/istm-test`/`/istm-audit`/`/istm-sync` sub tasks other skills don't tick) and advances feature status; exact rules in `agent-prompt.md`.
47
49
 
48
50
 
49
51
 
@@ -55,7 +57,17 @@ Owns exactly what the Boundaries table grants and writes nothing else. As the **
55
57
  - **Bundled files**: referenced by paths relative to this skill's folder. Resolve the folder to an absolute path (you already resolve these relative paths) and read `agent-prompt.md` yourself at write time (Step 3), not during the earlier steps.
56
58
  - The whole maintenance runs inline on the main thread, following the exact rules in **`agent-prompt.md`** (authoritative).
57
59
 
58
- ## Execution
60
+
61
+ ## Execution Modes
62
+
63
+ ### Mode: Restore (`/istm-sync restore`)
64
+ Run this on a fresh session to instantly restore context.
65
+ 1. **Find all context files**: Using glob tools, locate `progress.md`, `memory.md`, `.istm-context/decisions.md`, `.istm-context/istm-scope/**/*.md`, and all `.istm-context/agents.md` files.
66
+ 2. **Read them all**: Ingest these files completely so you have maximum context on architectural decisions, the last completed task, pending specs, and active TODOs.
67
+ 3. **Output Rehydration Summary**: Output a structured "You Are Here" block summarizing the current architecture, completed tasks, active spec, and immediate next steps. Do not run any Git commands or try to write files in this mode.
68
+
69
+ ### Mode: Save (Default)
70
+ Run after completing a change.
59
71
 
60
72
  ### 1. Scope the change set (cheap, with per file status)
61
73
 
@@ -69,7 +81,7 @@ Base: `main` if `git rev-parse --verify main` succeeds, else `master`. Current b
69
81
  Either way, add untracked files from `git ls-files --others --exclude-standard`, each prefixed with an `A` status (matching the `--name-status` format). Note the mode, base, and merge base for the write step.
70
82
 
71
83
  Remove duplicates, then **filter to source files** to sync *from*:
72
- - **Drop documentation and config** (`.istm-context/agents.md` at any level, `.istm-context/**`, `*.md`, `test-preferences.json`, lock files, generated output); /sync reads these as targets/context, never as a change source.
84
+ - **Drop documentation and config** (`.istm-context/agents.md` at any level, `.istm-context/**`, `*.md`, `test-preferences.json`, lock files, generated output); /istm-sync reads these as targets/context, never as a change source.
73
85
  - **Drop test files** (`*.test.*`, `*.spec.*`, `__tests__/`, etc.); tests aren't durable area conventions.
74
86
  - **Keep the `D` (deleted) entries** in a separate list; they drive orphan cleanup (Step 3) though they aren't synced *from*.
75
87
  - **Keep dependency manifest changes in a separate list** for tool discovery, even if they are config rather than source: `package.json`, `pyproject.toml`, `requirements*.txt`, `go.mod`, `Cargo.toml`, `composer.json`, `Gemfile`, `pubspec.yaml`, `mix.exs`, `*.csproj`, and equivalent package manifests. Lock files are signals only; do not pass lockfile contents.
@@ -82,7 +94,7 @@ Using your agent's file search/glob tools:
82
94
  - Note whether a root `.istm-context/agents.md` exists.
83
95
  - Find every `.istm-context/agents.md` (root + nested), excluding `node_modules/` and `.git/`.
84
96
  - Find all specs under `.istm-context/specs/` whose names start with a digit, sorted.
85
- - Find the scope file(s) whose workspace/features the diff actually touches (in a monorepo, a changed file's workspace `apps/<x>/…` selects `.istm-context/scope/<x>/`); never read or pass all of `.istm-context/scope/`.
97
+ - Find the scope file(s) whose workspace/features the diff actually touches (in a monorepo, a changed file's workspace `apps/<x>/…` selects `.istm-context/istm-scope/<x>/`); never read or pass all of `.istm-context/istm-scope/`.
86
98
 
87
99
  Note the **paths** plus the changed file list and diff command; read the files at write time. Read root .istm-context/agents.md contents now (short and useful to anchor on). For each changed file, note its nearest enclosing directory with a `.istm-context/agents.md` (root or nested); that's the context file most likely to need an update.
88
100
 
@@ -94,12 +106,12 @@ Run only when dependency manifests changed or the diff clearly adds a significan
94
106
  - Filter out anything already covered by installed skills, connected MCPs, or `.istm-context/agents.md` declined entries.
95
107
  - **Ask before you search.**
96
108
 
97
- <!-- TOOL-CONSENT:START (identical in /architect, /audit and /sync; edit all or none) -->
109
+ <!-- TOOL-CONSENT:START (identical in /architect, /istm-audit and /istm-sync; edit all or none) -->
98
110
  **Asking is mandatory. Searching is not.** Nothing is searched, fetched, installed, or spawned for Agent Skill and MCP discovery until the engineer has picked. Offer four choices: find them for me, I will name the ones I want, no and record the decline, or not now. Only the first may run a search command. Never silently skip the offer, and never run a search before the engineer agrees to one.
99
111
  <!-- TOOL-CONSENT:END -->
100
112
 
101
113
  Name the tools this change added, say in one line that an Agent Skill gives the agent that tool's real conventions and an MCP server gives it live access to the real system, then ask: "Want me to find Agent Skills and MCP servers for the tools this change added?" (header `Agent skills`), with `Yes, find them for me` (recommended) · `I'll name the ones I want` · `No, skip it` · `Not now, later`. On `Yes` continue below. On `I'll name the ones I want`, take the list and go straight to the install step, searching for nothing. On `No, skip it` run nothing and record the decline. On `Not now, later` run nothing and note the candidate tools in the report.
102
- - **Isolate the searches in a read only subagent (capability first, only after `Yes`).** Hand the remaining set to a discovery subagent rather than searching on the main thread: spawn it in the background (it does not block) if your agent supports that, else blocking; set its model explicitly to a fast, low cost tier (do not inherit the session model; on Claude Code spawn it as the `researcher` subagent type, which pins the model); it returns only the compact candidate list. This keeps the search output out of `/sync`'s bounded context. No subagent → search inline; no search capability → skip and note it. The offer panel stays on the main thread.
114
+ - **Isolate the searches in a read only subagent (capability first, only after `Yes`).** Hand the remaining set to a discovery subagent rather than searching on the main thread: spawn it in the background (it does not block) if your agent supports that, else blocking; set its model explicitly to a fast, low cost tier (do not inherit the session model; on Claude Code spawn it as the `researcher` subagent type, which pins the model); it returns only the compact candidate list. This keeps the search output out of `/istm-sync`'s bounded context. No subagent → search inline; no search capability → skip and note it. The offer panel stays on the main thread.
103
115
  - For each remaining item, run `npx skills find <tool-or-package>`; if weak, retry aliases from package/org names. Collect every credible Agent Skill candidate and confirm with `npx skills add <owner>/<repo> --list` when practical. If the CLI is interactive/unavailable, search `"<tool>" "agent skill"` and confirm before offering.
104
116
  - MCP search is optional: connector list first, else `"<tool>" "MCP server"` per item. MCP is recommended upside, not required.
105
117
  - Keep discovery capped and cacheable: max 5 web searches and 8 fetched pages total, official registry/docs first. Reuse `.istm-context/.agent-cache/tool-discovery/<slug>.md` when under 30 days old, after filtering installed/declined items.
@@ -117,7 +129,7 @@ The inputs to apply:
117
129
  3. `ROOT_AGENTS_MD` (root .istm-context/agents.md contents), `NESTED_PATHS` (nested .istm-context/agents.md paths)
118
130
  4. `SPEC_PATHS` (all spec paths, for Status line reconciliation and staleness flagging)
119
131
  5. `FILE_TO_CONTEXT_MAP` (changed file → nearest context file)
120
- 6. `SCOPE_PATH_OR_NONE` (relevant workspace scope path(s), not all of `.istm-context/scope/`; also the source of each linked feature's status for spec Status line reconciliation)
132
+ 6. `SCOPE_PATH_OR_NONE` (relevant workspace scope path(s), not all of `.istm-context/istm-scope/`; also the source of each linked feature's status for spec Status line reconciliation)
121
133
  7. `INSTALLED_SKILLS_OR_NONE`, `MCP_SERVERS_OR_NONE`, `DECLINED_TOOLS_OR_NONE` from Step 2.5
122
134
 
123
135
  ### 4. Relay the result
@@ -125,7 +137,7 @@ The inputs to apply:
125
137
  **If the maintenance failed or produced no parseable summary**, report that and do it again, don't fabricate a result (a genuine `NOTHING_TO_SYNC` is a valid success; a crash or empty output is not). Otherwise relay the compact summary:
126
138
 
127
139
  ```
128
- ## /sync complete
140
+ ## /istm-sync complete
129
141
 
130
142
  **Scope**: <N> changed files
131
143
 
@@ -150,14 +162,14 @@ The inputs to apply:
150
162
  **Assumed decisions, not yet ratified** (run /architect to ratify; the feature can't be `done` until then):
151
163
  - `.istm-context/specs/<file>`, <feature> built on an assumption, decision not deliberated
152
164
 
153
- **Context gaps** (run /audit, area too established for /sync to document from the diff alone):
165
+ **Context gaps** (run /istm-audit, area too established for /istm-sync to document from the diff alone):
154
166
  - `<area>`, <pre-existing undocumented area only sliced by this change>
155
167
 
156
168
  **Conflicts left for you** (not auto-edited):
157
169
  - `<path>`, <curated content that would need rewriting; decide manually>
158
170
  ```
159
171
 
160
- Omit any section with no items. If everything was already current and nothing is stale, say so in one line. /sync does not run /architect or /audit for you; it points, you decide.
172
+ Omit any section with no items. If everything was already current and nothing is stale, say so in one line. /istm-sync does not run /architect or /istm-audit for you; it points, you decide.
161
173
 
162
174
  ---
163
175
 
@@ -16,6 +16,24 @@ Claude Code loads it via the import below:
16
16
  @.istm-context/agents.md
17
17
  ```
18
18
 
19
+
20
+ ## If MODE is Restore
21
+
22
+ If you were invoked as `/istm-sync restore`:
23
+ 1. Read all the loaded files (`progress.md`, `memory.md`, scope files, agents.md).
24
+ 2. Synthesize the project state.
25
+ 3. Output a "Context Restored" summary containing:
26
+ - **Architecture & Tech Stack**: Core technologies in use.
27
+ - **Recent Decisions**: From memory or decisions logs.
28
+ - **Progress**: What was just finished (from `progress.md` or scope `[x]`).
29
+ - **Active Task**: What is currently `In Progress`.
30
+ - **Next Steps**: The immediate TODOs to tackle next.
31
+ 4. Stop execution here. Do not attempt to reconcile git diffs or edit files.
32
+
33
+ ---
34
+
35
+ ## If MODE is Save (Default Maintenance)
36
+
19
37
  ## The change
20
38
 
21
39
  - **Scope mode**: MODE
@@ -44,7 +62,7 @@ ROOT_AGENTS_MD
44
62
 
45
63
  SPEC_PATHS
46
64
 
47
- ## Feature scope for the relevant workspace(s) the diff touches, NOT all of .istm-context/scope/ (you may RECONCILE status only, never add/remove/reorder features)
65
+ ## Feature scope for the relevant workspace(s) the diff touches, NOT all of .istm-context/istm-scope/ (you may RECONCILE status only, never add/remove/reorder features)
48
66
 
49
67
  SCOPE_PATH_OR_NONE
50
68
 
@@ -60,7 +78,7 @@ SCOPE_PATH_OR_NONE
60
78
 
61
79
  ### 1. Update existing .istm-context/agents.md files (only where the change made them inaccurate)
62
80
 
63
- Read the diff. For each existing root/nested .istm-context/agents.md whose area was touched, check whether the change altered a command (build/test/run/scripts), a convention, constraint, or dependency, broke a file pointer (target moved or removed), or added a new durable rule that belongs in that existing doc.
81
+ Read the diff. For each existing root/nested .istm-context/agents.md whose area was touched, check whether the change altered a command (build/istm-test/run/scripts), a convention, constraint, or dependency, broke a file pointer (target moved or removed), or added a new durable rule that belongs in that existing doc.
64
82
 
65
83
  Make the edit only if it is:
66
84
  - **Surgical**: change or add specific lines, never rewrite sections.
@@ -69,21 +87,21 @@ Make the edit only if it is:
69
87
 
70
88
  ### The mirrored root fields
71
89
 
72
- <!-- ROOT-FIELD-CONTRACT:START (identical in /audit and /sync; edit both or neither) -->
90
+ <!-- ROOT-FIELD-CONTRACT:START (identical in /istm-audit and /istm-sync; edit both or neither) -->
73
91
  Root `.istm-context/agents.md` carries two mirrored fields. Each has exactly one source of truth outside the file, and no skill may invent a value for either:
74
92
 
75
93
  - `## Stack` mirrors the architecture spec, the one under `.istm-context/specs/` with a `## Proposed stack` section.
76
- - `## Build approach` mirrors the scope header's build approach line, the one `/scope` records.
94
+ - `## Build approach` mirrors the scope header's build approach line, the one `/istm-scope` records.
77
95
 
78
96
  Three rules bind every skill that touches them. Never overwrite curated prose in either field. Fill a field only when it is missing or still a placeholder. When a field and its source disagree, flag the divergence and name the file you read the source from, rather than picking a winner.
79
97
  <!-- ROOT-FIELD-CONTRACT:END -->
80
98
 
81
- What `/sync` does with them: reconcile, one line at a time.
99
+ What `/istm-sync` does with them: reconcile, one line at a time.
82
100
 
83
101
  - **Missing the value its source sets** (e.g. a greenfield root seeded before the architecture spec landed, or a root with no build approach line while the scope header names one): add that one line surgically, and record it under `AGENTS_UPDATED`.
84
102
  - **Field and source disagree**, or root's version is elaborated curated prose, or you cannot tell which side is authoritative: do not overwrite. Flag it under `CONFLICTS`, naming the spec or scope file you compared against.
85
103
 
86
- `/sync` never restructures root or creates it; that is `/audit`'s job (see the Boundaries table in `SKILL.md`).
104
+ `/istm-sync` never restructures root or creates it; that is `/istm-audit`'s job (see the Boundaries table in `SKILL.md`).
87
105
 
88
106
  **Agent Skill and MCP records:** if `INSTALLED_SKILLS_OR_NONE`, `MCP_SERVERS_OR_NONE`, or `DECLINED_TOOLS_OR_NONE` is not `none`, record it surgically in the most specific relevant .istm-context/agents.md:
89
107
  - Project wide tools (framework, ORM, styling, core DB, hosting, test runner) belong in root .istm-context/agents.md.
@@ -96,7 +114,7 @@ What `/sync` does with them: reconcile, one line at a time.
96
114
  **Design system pointer:** if this change added or established a `.istm-context/design.md` (the UI design system, art direction plus the build mandate) and the nearest .istm-context/agents.md has no pointer to it, add one surgical line so the mandate is discoverable and loads automatically for UI work: `` - Design system: build all UI to `.istm-context/design.md` (art direction and the maximalist product bar); token values live in CSS. `` Put it in root .istm-context/agents.md for a project-wide `.istm-context/design.md`, or the UI area's nested .istm-context/agents.md if the system is area-scoped. Idempotent: skip if a `.istm-context/design.md` pointer already exists. Never paste .istm-context/design.md content into .istm-context/agents.md; it is a pointer, not a copy.
97
115
 
98
116
  Rules you must not break:
99
- - **Idempotent, check before you add.** Read the target doc again now (a teammate or another session may have edited it). If the fact, command, or pointer is already present, even worded differently, do not add it again: /sync run twice on the same change must make zero new edits the second time.
117
+ - **Idempotent, check before you add.** Read the target doc again now (a teammate or another session may have edited it). If the fact, command, or pointer is already present, even worded differently, do not add it again: /istm-sync run twice on the same change must make zero new edits the second time.
100
118
  - **Never overwrite or rewrite curated prose.** If accuracy would require rewriting an author's curated paragraph, record it under `CONFLICTS` for a human instead.
101
119
  - Keep root .istm-context/agents.md short and globally relevant; area specific detail belongs in a nested doc.
102
120
 
@@ -104,15 +122,15 @@ Rules you must not break:
104
122
 
105
123
  You may create **one** nested `<area>/.istm-context/agents.md` for an area the change introduced wholesale. The test is **context, not policy**:
106
124
 
107
- - **Create it** when every source file in that area carries status `A` (added) in CHANGED_FILES: the diff shows you the entire area. If any file in the area is `M` (modified), the area already existed: do NOT create. Write a focused doc: local file pointers, local commands, conventions/constraints visible in the new code, links to any governing spec. End it with the one line note: `_Drafted by /sync from the introducing change, worth a quick human pass._` Then add exactly one pointer line to root .istm-context/agents.md under `## Context files`:
125
+ - **Create it** when every source file in that area carries status `A` (added) in CHANGED_FILES: the diff shows you the entire area. If any file in the area is `M` (modified), the area already existed: do NOT create. Write a focused doc: local file pointers, local commands, conventions/constraints visible in the new code, links to any governing spec. End it with the one line note: `_Drafted by /istm-sync from the introducing change, worth a quick human pass._` Then add exactly one pointer line to root .istm-context/agents.md under `## Context files`:
108
126
  ```
109
127
  - [<area>/.istm-context/agents.md](<area>/.istm-context/agents.md): <one-line description>
110
128
  ```
111
129
  **Idempotency + missing section**: skip the pointer if already present; if root has no `## Context files` heading, create it (append near the end of root) and add the pointer under it.
112
130
 
113
131
  Also create the sibling **`<area>/CLAUDE.md` pointer** (a one line note plus `@.istm-context/agents.md`) so Claude Code picks up the new area too.
114
- - **Area that already exists, defer to /audit**: the diff shows only a slice of an area that predates this change, so you lack the whole area context to write a good doc. Record it under `CONTEXT_GAPS`.
115
- - **Never create or restructure the root .istm-context/agents.md.** If the repo has no root .istm-context/agents.md at all, that's /audit's job; record under `CONTEXT_GAPS`.
132
+ - **Area that already exists, defer to /istm-audit**: the diff shows only a slice of an area that predates this change, so you lack the whole area context to write a good doc. Record it under `CONTEXT_GAPS`.
133
+ - **Never create or restructure the root .istm-context/agents.md.** If the repo has no root .istm-context/agents.md at all, that's /istm-audit's job; record under `CONTEXT_GAPS`.
116
134
  - One nested doc per genuinely distinct new area, never one per folder.
117
135
 
118
136
  ### 3. Clean up orphans from deletions
@@ -149,29 +167,29 @@ Be **strict**, noise erodes trust. Read a spec only if the changed paths plausib
149
167
 
150
168
  ### 6. Reconcile the feature scope (only if SCOPE_PATH_OR_NONE is a path)
151
169
 
152
- **Scope:** only the scope file(s) you were handed. Never hunt for or reconcile other files under `.istm-context/scope/`; one workspace's change does not license editing another's.
170
+ **Scope:** only the scope file(s) you were handed. Never hunt for or reconcile other files under `.istm-context/istm-scope/`; one workspace's change does not license editing another's.
153
171
 
154
- You are the **universal sub task reconciler**: `/develop` ticks its own sub tasks; `/test`, `/audit`, and `/sync` sub tasks have no one else. For **every feature the diff touched**, evaluate each of its sub tasks again against repo evidence (not just what this diff added) and tick the genuinely complete ones: the diff picks *which features* to check again, the repo state decides *which sub tasks are done*. Look directly with Read/Bash/Grep/Glob.
172
+ You are the **universal sub task reconciler**: `/istm-develop` ticks its own sub tasks; `/istm-test`, `/istm-audit`, and `/istm-sync` sub tasks have no one else. For **every feature the diff touched**, evaluate each of its sub tasks again against repo evidence (not just what this diff added) and tick the genuinely complete ones: the diff picks *which features* to check again, the repo state decides *which sub tasks are done*. Look directly with Read/Bash/Grep/Glob.
155
173
 
156
- **Malformed scope** (no `At-a-glance` table or feature sections, a status that is not standard, broken headings, a bad hand edit): do not edit it; note `scope malformed: <file>, needs a human or /scope re-run` under `SCOPE_RECONCILED` and skip it. Never act on a misread.
174
+ **Malformed scope** (no `At-a-glance` table or feature sections, a status that is not standard, broken headings, a bad hand edit): do not edit it; note `scope malformed: <file>, needs a human or /istm-scope re-run` under `SCOPE_RECONCILED` and skip it. Never act on a misread.
157
175
 
158
176
  > Step 1's source file filtering (dropping `*.test.*`, `.istm-context/**`) governs what you sync .istm-context/agents.md from; it does not limit reconciliation. Here you may and should inspect test files, .istm-context/agents.md, and config to judge completion.
159
177
 
160
178
  Evidence per sub task type (tick `[ ]` → `[x]` when the evidence is clearly present):
161
179
  - **UI / data model / backend / integration / data integration** → the corresponding files exist in the feature's code area (components/pages, schema/migrations, services/endpoints, the mock replaced by a real query).
162
- - **Build it (+ milestones)** → the feature's code exists in its area (milestone chunks present); `/develop` usually ticks these itself.
180
+ - **Build it (+ milestones)** → the feature's code exists in its area (milestone chunks present); `/istm-develop` usually ticks these itself.
163
181
  - **Verify it** → a `verify.md` beside the spec, or a recorded passing runtime verification for the feature.
164
182
  - **Test it** → test files cover this feature's area (search the area + test dirs).
165
- - **Review it (fresh model)** → a findings file for this feature under `.istm-context/reviews/` (`/check review`'s output).
166
- - **Document it** → a PR body, a `CHANGELOG.md` entry, or a release note covering this feature (`/document`'s output).
183
+ - **Review it (fresh model)** → a findings file for this feature under `.istm-context/reviews/` (`/istm-check review`'s output).
184
+ - **Document it** → a PR body, a `CHANGELOG.md` entry, or a release note covering this feature (`/istm-document`'s output).
167
185
  - **SEO & metadata** → metadata/structured data present on the feature's pages.
168
186
  - **Sync (record conventions)** → the area's `.istm-context/agents.md` exists and reflects the feature.
169
187
  - **Coding standards / tooling** → linter/formatter/`pre-commit` config present in the repo.
170
188
 
171
189
  Then update the feature's **status**, in the `At-a-glance` table AND beside its heading: `in-progress` while any box (`Build it` + its milestones, `Verify it`, `Test it`) is unticked; `done` **only when `Design`, `Build` (+ milestones), `Verify`, and `Test` are all ticked**.
172
190
 
173
- - **Strictly status only.** Never add, remove, rename, or reorder features or checkboxes (that's /scope's). Skip `existing` and `dropped` features entirely. Never invent a feature for code that has no section; if shipped code clearly matches no feature, note "unmapped: <area>, run /scope to enroll this off plan work" under `SCOPE_RECONCILED`.
174
- - **Attribution across features and workspaces.** Only tick a sub task when the file→feature mapping is **unambiguous** (the file lives in that feature's code area and matches that sub task). In a monorepo, a changed file's **workspace** (`apps/<x>/…`) selects the scope to update, `.istm-context/scope/<x>/`; never tick a feature in the wrong workspace's scope. If an area maps to more than one feature, do not guess; note `ambiguous: <area> → <featureA> / <featureB>` under `SCOPE_RECONCILED`.
191
+ - **Strictly status only.** Never add, remove, rename, or reorder features or checkboxes (that's /istm-scope's). Skip `existing` and `dropped` features entirely. Never invent a feature for code that has no section; if shipped code clearly matches no feature, note "unmapped: <area>, run /istm-scope to enroll this off plan work" under `SCOPE_RECONCILED`.
192
+ - **Attribution across features and workspaces.** Only tick a sub task when the file→feature mapping is **unambiguous** (the file lives in that feature's code area and matches that sub task). In a monorepo, a changed file's **workspace** (`apps/<x>/…`) selects the scope to update, `.istm-context/istm-scope/<x>/`; never tick a feature in the wrong workspace's scope. If an area maps to more than one feature, do not guess; note `ambiguous: <area> → <featureA> / <featureB>` under `SCOPE_RECONCILED`.
175
193
  - **Idempotent**: a box already `[x]` stays `[x]`; running it again changes nothing.
176
194
  - **Conservative**: tick only on clearly present evidence; when unsure, leave it.
177
195
  - **Git**: if root `.istm-context/agents.md` `## Git` says `integration: on` and `commit` is not `manual`, offer to commit the reconciliation with a one line subject (`chore(sync): reconcile docs`) plus the `Co-Authored-By` trailer; never push.
@@ -202,7 +220,7 @@ STALE_SPECS:
202
220
  - <.istm-context/specs/file>, <why the change makes it stale, or a status mismatch you couldn't safely reconcile>
203
221
 
204
222
  CONTEXT_GAPS:
205
- - <area>, <pre-existing undocumented area only sliced by this change; suggest /audit>
223
+ - <area>, <pre-existing undocumented area only sliced by this change; suggest /istm-audit>
206
224
 
207
225
  CONFLICTS:
208
226
  - <path>, <curated content that would need rewriting; left for a human>