@elevasis/sdk 1.8.2 → 1.8.3

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 (57) hide show
  1. package/dist/cli.cjs +1 -1
  2. package/dist/index.d.ts +88 -39
  3. package/dist/types/worker/adapters/lead.d.ts +1 -1
  4. package/dist/worker/index.js +2 -0
  5. package/package.json +2 -2
  6. package/reference/_navigation.md +7 -1
  7. package/reference/_reference-manifest.json +14 -0
  8. package/reference/claude-config/logs/scaffold-registry-reminder.log +3 -0
  9. package/reference/claude-config/rules/agent-start-here.md +254 -254
  10. package/reference/claude-config/rules/frontend.md +43 -43
  11. package/reference/claude-config/rules/operations.md +64 -64
  12. package/reference/claude-config/rules/organization-model.md +42 -43
  13. package/reference/claude-config/rules/organization-os.md +107 -107
  14. package/reference/claude-config/rules/shared-types.md +2 -2
  15. package/reference/claude-config/rules/task-tracking.md +1 -1
  16. package/reference/claude-config/rules/ui.md +202 -202
  17. package/reference/claude-config/rules/vibe.md +202 -202
  18. package/reference/claude-config/skills/configure/SKILL.md +98 -98
  19. package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -100
  20. package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -158
  21. package/reference/claude-config/skills/configure/operations/customers.md +150 -150
  22. package/reference/claude-config/skills/configure/operations/features.md +162 -162
  23. package/reference/claude-config/skills/configure/operations/goals.md +147 -147
  24. package/reference/claude-config/skills/configure/operations/identity.md +133 -133
  25. package/reference/claude-config/skills/configure/operations/labels.md +128 -128
  26. package/reference/claude-config/skills/configure/operations/offerings.md +159 -159
  27. package/reference/claude-config/skills/configure/operations/roles.md +153 -153
  28. package/reference/claude-config/skills/configure/operations/techStack.md +139 -139
  29. package/reference/claude-config/skills/explore/SKILL.md +78 -78
  30. package/reference/claude-config/skills/git-sync/SKILL.md +126 -0
  31. package/reference/claude-config/skills/save/SKILL.md +183 -183
  32. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  33. package/reference/claude-config/skills/sync/SKILL.md +10 -44
  34. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -0
  35. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -0
  36. package/reference/claude-config/sync-notes/README.md +43 -0
  37. package/reference/packages/core/src/README.md +39 -36
  38. package/reference/packages/core/src/business/README.md +52 -52
  39. package/reference/packages/core/src/organization-model/README.md +97 -97
  40. package/reference/packages/core/src/test-utils/README.md +42 -0
  41. package/reference/scaffold/core/organization-graph.mdx +272 -272
  42. package/reference/scaffold/core/organization-model.mdx +320 -320
  43. package/reference/scaffold/index.mdx +64 -64
  44. package/reference/scaffold/operations/propagation-pipeline.md +125 -104
  45. package/reference/scaffold/operations/scaffold-maintenance.md +122 -122
  46. package/reference/scaffold/operations/workflow-recipes.md +436 -436
  47. package/reference/scaffold/recipes/add-a-feature.md +158 -158
  48. package/reference/scaffold/recipes/add-a-resource.md +158 -158
  49. package/reference/scaffold/recipes/customize-organization-model.md +400 -400
  50. package/reference/scaffold/recipes/extend-a-base-entity.md +140 -140
  51. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +158 -158
  52. package/reference/scaffold/recipes/index.md +32 -32
  53. package/reference/scaffold/reference/contracts.md +608 -607
  54. package/reference/scaffold/reference/feature-registry.md +2 -0
  55. package/reference/scaffold/reference/glossary.md +105 -105
  56. package/reference/scaffold/ui/composition-extensibility.mdx +1 -1
  57. package/reference/scaffold/ui/feature-flags-and-gating.md +1 -1
@@ -1,64 +1,64 @@
1
- ---
2
- title: Scaffold Reference
3
- description: Universal scaffold documentation for Elevasis SDK projects -- recipes, patterns, architecture, and reference materials that apply to all workspaces.
4
- ---
5
-
6
- ## Overview
7
-
8
- This scaffold reference contains universal documentation that applies to all Elevasis SDK projects. Content is organized by package ownership:
9
-
10
- - **recipes/** -- Cross-package pathway recipes (add a feature, add a resource, gating patterns)
11
- - **ui/** -- UI patterns, feature shell architecture, composition, and customization
12
- - **core/** -- Organization model architecture, graph layer, and semantic contracts
13
- - **operations/** -- Workflow authoring patterns and adapter usage
14
- - **reference/** -- Glossary, auto-generated contracts, and feature registry
15
-
16
- ## Quick Navigation
17
-
18
- ### Pathway Recipes
19
-
20
- - [Add a Feature](./recipes/add-a-feature.md) -- end-to-end from org model key through manifest, routes, gating
21
- - [Add a Resource](./recipes/add-a-resource.md) -- author and deploy a workflow or agent
22
- - [Extend a Base Entity](./recipes/extend-a-base-entity.md) -- add project-specific metadata to canonical entity shapes via the TMeta slot
23
- - [Gate by Feature or Admin](./recipes/gate-by-feature-or-admin.md) -- decision table for access control patterns
24
-
25
- ### UI Patterns
26
-
27
- - [UI Recipes](./ui/recipes.md) -- copy-paste recipes for pages, nav items, components, theme tokens
28
- - [Feature Flags & Gating](./ui/feature-flags-and-gating.md) -- three-concept model for feature access
29
- - [Customizing Features](./ui/customization.md) -- sidebar composition via manifest overrides
30
- - [Feature Shell & Provider](./ui/feature-shell.mdx) -- FeatureModule manifest contract, provider runtime
31
- - [Composition & Extensibility](./ui/composition-extensibility.mdx) -- layout primitives, router abstraction
32
-
33
- ### Core Architecture
34
-
35
- - [Organization Model](./core/organization-model.mdx) -- semantic contract, schema, authoring helpers
36
- - [Organization Graph](./core/organization-graph.mdx) -- graph derivation, node/edge taxonomy, lenses
37
-
38
- ### Operations
39
-
40
- - [Workflow Recipes](./operations/workflow-recipes.md) -- workflow anatomy, adapter patterns, trigger patterns
41
- - [Propagation Pipeline](./operations/propagation-pipeline.md) -- three-layer sync pipeline, verification checks, integration points
42
- - [Scaffold Maintenance](./operations/scaffold-maintenance.md) -- content placement, auto-generation, adding new scaffold docs
43
-
44
- ### Reference
45
-
46
- - [Glossary](./reference/glossary.md) -- term definitions for Organization OS concepts
47
- - [Contracts](./reference/contracts.md) -- auto-generated TypeScript contract shapes
48
- - [Feature Registry](./reference/feature-registry.md) -- auto-generated feature manifest catalog
49
-
50
- ## Source Locations
51
-
52
- Content is co-located with its owning package and copied here during SDK build:
53
-
54
- | Bundle Path | Source Location | Owner |
55
- | --------------------------------------------- | --------------------------------------------------------- | --------------- |
56
- | `scaffold/recipes/` | `packages/sdk/docs/scaffold/recipes/` | SDK |
57
- | `scaffold/operations/` | `packages/sdk/docs/scaffold/operations/` | SDK |
58
- | `scaffold/operations/propagation-pipeline.md` | `packages/sdk/docs/scaffold/operations/` | SDK |
59
- | `scaffold/operations/scaffold-maintenance.md` | `packages/sdk/docs/scaffold/operations/` | SDK |
60
- | `scaffold/ui/` | `packages/ui/src/scaffold/` | UI |
61
- | `scaffold/core/` | `packages/core/src/organization-model/` | Core |
62
- | `scaffold/reference/glossary.md` | `packages/core/src/reference/glossary.md` | Core |
63
- | `scaffold/reference/contracts.md` | `packages/core/src/reference/_generated/contracts.md` | Core (auto-gen) |
64
- | `scaffold/reference/feature-registry.md` | `packages/ui/src/scaffold/_generated/feature-registry.md` | UI (auto-gen) |
1
+ ---
2
+ title: Scaffold Reference
3
+ description: Universal scaffold documentation for Elevasis SDK projects -- recipes, patterns, architecture, and reference materials that apply to all workspaces.
4
+ ---
5
+
6
+ ## Overview
7
+
8
+ This scaffold reference contains universal documentation that applies to all Elevasis SDK projects. Content is organized by package ownership:
9
+
10
+ - **recipes/** -- Cross-package pathway recipes (add a feature, add a resource, gating patterns)
11
+ - **ui/** -- UI patterns, feature shell architecture, composition, and customization
12
+ - **core/** -- Organization model architecture, graph layer, and semantic contracts
13
+ - **operations/** -- Workflow authoring patterns and adapter usage
14
+ - **reference/** -- Glossary, auto-generated contracts, and feature registry
15
+
16
+ ## Quick Navigation
17
+
18
+ ### Pathway Recipes
19
+
20
+ - [Add a Feature](./recipes/add-a-feature.md) -- end-to-end from org model key through manifest, routes, gating
21
+ - [Add a Resource](./recipes/add-a-resource.md) -- author and deploy a workflow or agent
22
+ - [Extend a Base Entity](./recipes/extend-a-base-entity.md) -- add project-specific metadata to canonical entity shapes via the TMeta slot
23
+ - [Gate by Feature or Admin](./recipes/gate-by-feature-or-admin.md) -- decision table for access control patterns
24
+
25
+ ### UI Patterns
26
+
27
+ - [UI Recipes](./ui/recipes.md) -- copy-paste recipes for pages, nav items, components, theme tokens
28
+ - [Feature Flags & Gating](./ui/feature-flags-and-gating.md) -- three-concept model for feature access
29
+ - [Customizing Features](./ui/customization.md) -- sidebar composition via manifest overrides
30
+ - [Feature Shell & Provider](./ui/feature-shell.mdx) -- FeatureModule manifest contract, provider runtime
31
+ - [Composition & Extensibility](./ui/composition-extensibility.mdx) -- layout primitives, router abstraction
32
+
33
+ ### Core Architecture
34
+
35
+ - [Organization Model](./core/organization-model.mdx) -- semantic contract, schema, authoring helpers
36
+ - [Organization Graph](./core/organization-graph.mdx) -- graph derivation, node/edge taxonomy, lenses
37
+
38
+ ### Operations
39
+
40
+ - [Workflow Recipes](./operations/workflow-recipes.md) -- workflow anatomy, adapter patterns, trigger patterns
41
+ - [Propagation Pipeline](./operations/propagation-pipeline.md) -- three-layer sync pipeline, verification checks, integration points
42
+ - [Scaffold Maintenance](./operations/scaffold-maintenance.md) -- content placement, auto-generation, adding new scaffold docs
43
+
44
+ ### Reference
45
+
46
+ - [Glossary](./reference/glossary.md) -- term definitions for Organization OS concepts
47
+ - [Contracts](./reference/contracts.md) -- auto-generated TypeScript contract shapes
48
+ - [Feature Registry](./reference/feature-registry.md) -- auto-generated feature manifest catalog
49
+
50
+ ## Source Locations
51
+
52
+ Content is co-located with its owning package and copied here during SDK build:
53
+
54
+ | Bundle Path | Source Location | Owner |
55
+ | --------------------------------------------- | --------------------------------------------------------- | --------------- |
56
+ | `scaffold/recipes/` | `packages/sdk/docs/scaffold/recipes/` | SDK |
57
+ | `scaffold/operations/` | `packages/sdk/docs/scaffold/operations/` | SDK |
58
+ | `scaffold/operations/propagation-pipeline.md` | `packages/sdk/docs/scaffold/operations/` | SDK |
59
+ | `scaffold/operations/scaffold-maintenance.md` | `packages/sdk/docs/scaffold/operations/` | SDK |
60
+ | `scaffold/ui/` | `packages/ui/src/scaffold/` | UI |
61
+ | `scaffold/core/` | `packages/core/src/organization-model/` | Core |
62
+ | `scaffold/reference/glossary.md` | `packages/core/src/reference/glossary.md` | Core |
63
+ | `scaffold/reference/contracts.md` | `packages/core/src/reference/_generated/contracts.md` | Core (auto-gen) |
64
+ | `scaffold/reference/feature-registry.md` | `packages/ui/src/scaffold/_generated/feature-registry.md` | UI (auto-gen) |
@@ -1,132 +1,153 @@
1
- ---
2
- title: Propagation Pipeline
3
- description: Three-layer pipeline that keeps Organization OS artifacts current across the monorepo and all template-derived external projects -- source generation, template sync, and verification.
4
- ---
5
-
6
- # Propagation Pipeline
7
-
8
- `🟢 Stable` -- These pipelines run automatically. Understand them when debugging sync issues or extending the scaffold.
9
-
10
- ---
11
-
12
- ## Architecture
13
-
1
+ ---
2
+ title: Propagation Pipeline
3
+ description: Three-layer pipeline that keeps Organization OS artifacts current across the monorepo and all template-derived external projects -- source generation, registry-driven sync planning/apply, and verification.
4
+ ---
5
+
6
+ # Propagation Pipeline
7
+
8
+ `🟢 Stable` -- These pipelines run automatically. Understand them when debugging sync issues or extending the scaffold.
9
+
10
+ ---
11
+
12
+ ## Architecture
13
+
14
14
  The Organization OS propagation pipeline has three layers. Each has its own scripts, triggers, and failure modes.
15
15
 
16
16
  ```
17
17
  Layer 1: Source Generation (pnpm scaffold:sync)
18
18
  Regenerates derived docs from TypeScript types and manifests
19
19
 
20
- Layer 2: Template Sync (/external sync)
21
- Propagates template to downstream external projects
20
+ Layer 2: Registry-Driven Sync Planning + Apply (/external sync)
21
+ Plans registry-backed writes/deletes, then applies the approved scope
22
22
 
23
23
  Layer 3: Sync Verification (pnpm sync:verify)
24
- Asserts correctness across all template-derived projects
24
+ Asserts correctness across all template-derived projects after apply
25
25
  ```
26
+
27
+ ---
28
+
29
+ ## Layer 1: Source Generation
30
+
31
+ `pnpm scaffold:sync` is the meta-script that regenerates all derived documentation and validates the output. It chains three sub-scripts:
32
+
33
+ | Script | Input | Output |
34
+ | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
35
+ | `generate-scaffold-contracts.js` | `packages/core/src/organization-model/types.ts`, `packages/ui/src/features/registry/types.ts`, `packages/core/src/platform/registry/types.ts` | `packages/core/src/reference/_generated/contracts.md` |
36
+ | `generate-scaffold-feature-registry.js` | `packages/ui/src/features/*/manifest.ts`, `packages/core/src/organization-model/domains/features.ts` | `packages/ui/src/scaffold/_generated/feature-registry.md` |
37
+ | `generate-reference-artifacts.js` | SDK manifest, navigation sources | `packages/sdk/reference/_reference-manifest.json`, `_navigation.md` |
38
+
39
+ After generation, `validate-reference-artifacts.js` checks that the outputs are consistent. Exit 1 if drifted.
40
+
41
+ ### Trigger Points
42
+
43
+ - **`/external sync` Phase 0 (Scaffold Sync Preflight):** Runs before any writes. Generated file changes fold into the sync scope so they propagate naturally to `_template` and downstream projects.
44
+ - **`/sdk release` Step 1 (Shared Reference Preflight):** Runs before publish. Generated changes must be committed; validator failure is a hard blocker.
45
+ - **Manual:** `pnpm scaffold:sync` is idempotent and safe to run anytime.
46
+ - **Opt-out:** `--skip-scaffold-sync` on `/external sync` (rare).
47
+
48
+ ### Design: Regenerate-on-Propagation
49
+
50
+ Drift is healed at the moment it would otherwise leak downstream. This is cheaper and more reliable than CI-only checks. The single meta-script gives one command to reason about, while the chained sub-scripts remain individually callable for debugging.
51
+
52
+ ---
53
+
54
+ ## Layer 2: Registry-Driven Sync Planning + Apply
55
+
56
+ `/external sync` now treats the scaffold registry as the execution contract rather than relying on tier prose alone.
57
+ The canonical ownership vocabulary is:
58
+
59
+ | Category | Strategy examples | Meaning |
60
+ | --------------- | ----------------------------------------------- | ----------------------------------------------------------------------- |
61
+ | `replace` | `replace-all` | Template-managed surface; copy from template baseline |
62
+ | `merge` | `merge-baseline`, `merge-regions` | Merge-aware surface; preserve project customizations where required |
63
+ | `never-touch` | `verify-only` | Project-owned surface; planner may report drift but never writes |
64
+ | `generated` | `generated-freshness` | Generated surface; verify/regen instead of copying |
65
+
66
+ Current command helpers:
26
67
 
27
- ---
28
-
29
- ## Layer 1: Source Generation
30
-
31
- `pnpm scaffold:sync` is the meta-script that regenerates all derived documentation and validates the output. It chains three sub-scripts:
32
-
33
- | Script | Input | Output |
34
- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
35
- | `generate-scaffold-contracts.js` | `packages/core/src/organization-model/types.ts`, `packages/ui/src/features/registry/types.ts`, `packages/core/src/platform/registry/types.ts` | `packages/core/src/reference/_generated/contracts.md` |
36
- | `generate-scaffold-feature-registry.js` | `packages/ui/src/features/*/manifest.ts`, `packages/core/src/organization-model/domains/features.ts` | `packages/ui/src/scaffold/_generated/feature-registry.md` |
37
- | `generate-reference-artifacts.js` | SDK manifest, navigation sources | `packages/sdk/reference/_reference-manifest.json`, `_navigation.md` |
38
-
39
- After generation, `validate-reference-artifacts.js` checks that the outputs are consistent. Exit 1 if drifted.
40
-
41
- ### Trigger Points
42
-
43
- - **`/external sync` Phase 0 (Scaffold Sync Preflight):** Runs before any writes. Generated file changes fold into the sync scope so they propagate naturally to `_template` and downstream projects.
44
- - **`/sdk release` Step 1 (Shared Reference Preflight):** Runs before publish. Generated changes must be committed; validator failure is a hard blocker.
45
- - **Manual:** `pnpm scaffold:sync` is idempotent and safe to run anytime.
46
- - **Opt-out:** `--skip-scaffold-sync` on `/external sync` (rare).
47
-
48
- ### Design: Regenerate-on-Propagation
49
-
50
- Drift is healed at the moment it would otherwise leak downstream. This is cheaper and more reliable than CI-only checks. The single meta-script gives one command to reason about, while the chained sub-scripts remain individually callable for debugging.
51
-
52
- ---
53
-
54
- ## Layer 2: Template Sync
55
-
56
- `/external sync` propagates the `external/_template` to downstream projects. It uses a three-tier model:
57
-
58
- | Tier | Policy | Examples |
59
- | ------------------------------ | ----------------------------------------- | --------------------------------------------------------------------- |
60
- | **Tier 1 (Infrastructure)** | Always replaced from template | Configs, shared runtime surfaces, `lib/`, `test-utils/`, entry points |
61
- | **Tier 2 (Standard Features)** | Synced unless project has customized them | Standard UI features, common patterns |
62
- | **Tier 3 (Project-Specific)** | Never touched | `nav-items.ts`, `operations/src/`, `docs/`, `CLAUDE.md` |
68
+ ```bash
69
+ pnpm sync:plan -- --all # registry-backed dry-run plan
70
+ pnpm sync:apply -- --all # registry-backed apply pass
71
+ pnpm sync:verify # post-apply verification
72
+ ```
63
73
 
64
- The sync skill doc (`.claude/skills/external/SKILL.md`) defines the full tier model and phase sequence.
74
+ Per-project or scoped runs pass the project name and optional `--path` / `--source` filters through to the planner/apply script.
65
75
 
66
- ---
76
+ Delete behavior is explicit:
67
77
 
68
- ## Layer 3: Sync Verification
78
+ - managed deletes apply only to `replace` surfaces
79
+ - deletion is allowed only when the path appears in the manifest-backed tombstone list
80
+ - absence from the template alone is not enough to delete a downstream file
69
81
 
70
- `pnpm sync:verify` runs 86+ automated checks to assert propagation correctness. The script lives at `scripts/external/verify-sync.js`.
82
+ Generated surfaces are also explicit:
71
83
 
72
- ### Per-Project Checks (auto-discovered)
84
+ - they are planned as `generated`
85
+ - apply does not copy them as normal source files
86
+ - the relevant regen command must run, then `pnpm sync:verify` checks freshness
73
87
 
88
+ The external skill doc (`.claude/skills/external/SKILL.md`) remains the workflow authority, but it should be read as planner/apply/verify orchestration over the registry model above.
89
+
90
+ ---
91
+
92
+ ## Layer 3: Sync Verification
93
+
94
+ `pnpm sync:verify` runs 86+ automated checks to assert propagation correctness. The script lives at `scripts/external/verify-sync.js`.
95
+
96
+ ### Per-Project Checks (auto-discovered)
97
+
74
98
  | Category | What It Checks |
75
99
  | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
76
100
  | `deps` | `@elevasis/ui`, `@elevasis/sdk`, `@elevasis/core` versions match template |
77
- | `tier1` | 9 config files match template (with placeholder resolution for project slug/name) |
101
+ | `tier1` | registry-backed replace surfaces match template where verification still models them as exact baselines |
78
102
  | `org-os` | Organization model exists, exports canonical symbols, imports from `@elevasis/core/organization-model`, calls `defineOrganizationModel` + `resolveOrganizationModel`, app-config references org model, `__root.tsx` uses `ElevasisFeaturesProvider` + `canonicalOrganizationModel`, `main.tsx` uses `ElevasisUIProvider`, all 3 CSS subpath imports present |
79
103
  | `placeholders` | No unresolved `__PROJECT_SLUG__`, `__PROJECT_NAME__`, `__PROJECT_DESCRIPTION__` in key config files |
80
104
  | `scripts` | `ui` and `operations` `package.json` have required npm scripts |
81
105
  | `lib` | `ui/src/lib/`, `lib/`, `test-utils/` exist with minimum file counts |
82
- | `tier3` | `nav-items.ts` has project-specific customization (not overwritten by template) |
106
+ | `tier3` | project-owned preservation boundaries such as `nav-items.ts` remain intact |
83
107
  | `conflicts` | No merge conflict markers in source files |
84
108
  | `git` | Working tree is clean |
85
109
  | `lockfile` | `pnpm-lock.yaml` and `node_modules` exist |
86
-
87
- ### Monorepo-Level Checks
88
-
89
- | Category | What It Checks |
90
- | ----------- | ----------------------------------------------- |
91
- | `scaffold` | `pnpm scaffold:sync` passes (artifacts current) |
92
- | `artifacts` | 5 generated artifacts exist and have content |
93
-
94
- ### Usage
95
-
96
- ```bash
97
- pnpm sync:verify # Post-sync assertion (exit 1 on failures)
98
- pnpm sync:verify --pre # Pre-sync drift report (always exit 0)
99
- pnpm sync:verify -- ZentaraHQ # Single project
100
- ```
101
-
110
+
111
+ ### Monorepo-Level Checks
112
+
113
+ | Category | What It Checks |
114
+ | ----------- | ----------------------------------------------- |
115
+ | `scaffold` | `pnpm scaffold:sync` passes (artifacts current) |
116
+ | `artifacts` | 5 generated artifacts exist and have content |
117
+
118
+ ### Usage
119
+
120
+ ```bash
121
+ pnpm sync:verify # Post-sync assertion (exit 1 on failures)
122
+ pnpm sync:verify --pre # Pre-sync drift report (always exit 0)
123
+ pnpm sync:verify -- ZentaraHQ # Single project
124
+ ```
125
+
102
126
  ### Integration Points
103
127
 
104
- - **`/external sync` Phase 0:** Runs `pnpm sync:verify --pre` to show drift before writes
105
- - **`/external sync` Phase 5/7:** Runs `pnpm sync:verify` to assert correctness after sync
106
- - **Vitest suite:** Tests at `scripts/external/__tests__/verify-sync.test.js` (project: `scripts-external`)
107
-
108
- ### Known Acceptable Drifts
109
-
110
- Some failures are expected and intentional:
111
-
112
- - **`style.css` in nirvana-marketing:** Project-specific sidebar logo rounding customization
113
- - **`.gitignore` in ZentaraHQ:** Minor project-specific additions
114
- - **SDK patch versions:** Template may bump to a patch ahead of downstream projects between syncs
115
-
116
- These do not indicate sync failures.
117
-
118
- ### Tier Ownership Note
119
-
120
- Local `.claude/` guidance remains valuable inside the template, but it is project-owned documentation and agent configuration rather than a Tier 1 sync contract. Template propagation should treat the generated docs, published package surfaces, and runtime entrypoints as the authoritative shared scaffold surface.
121
-
122
- ---
123
-
124
- ## Remaining Gaps (Future Work)
125
-
126
- | Gap | Priority |
127
- | ------------------------------------------------------------------------- | -------- |
128
- | Feature manifest validation (all manifests imported in `__root.tsx`) | Medium |
129
- | TypeScript verification (`check-types` per project) | Medium |
130
- | Template docs surface validation (`docs/index.md`, `agent-start-here.md`) | Medium |
131
- | Environment variable template validation (`.env.example` completeness) | Low |
132
- | CI drift check (fail if worktree dirty after `scaffold:sync`) | Low |
128
+ - **`/external sync` preflight:** Runs `pnpm sync:verify --pre` before planning so current drift is visible before any writes
129
+ - **`/external sync` planner/apply:** `pnpm sync:plan` previews registry-backed writes/deletes, then `pnpm sync:apply` executes the approved plan
130
+ - **`/external sync` post-apply:** Runs `pnpm sync:verify` to assert correctness after the planner/apply pass
131
+ - **Automated coverage:** tests live under `scripts/external/__tests__/` including planner/apply coverage
132
+
133
+ ### Planner Interpretation Note
134
+
135
+ `pnpm sync:verify` still carries some historical `tier1` / `tier3` labels in its output, but the ownership semantics now come from the registry-backed categories used by the planner:
136
+
137
+ - `.claude/commands/**`, `hooks/**`, `rules/**`, `scripts/**`, `skills/**`, and `.claude/settings.json` are managed `replace` surfaces
138
+ - `nav-items.ts`, `operations/src/**`, `shared/src/**`, `CLAUDE.md`, and extension files are `never-touch`
139
+ - generated surfaces are verified for freshness, not copied
140
+
141
+ Treat the old tier labels as display shorthand inside the verifier, not as the canonical execution contract.
142
+
143
+ ---
144
+
145
+ ## Remaining Gaps (Future Work)
146
+
147
+ | Gap | Priority |
148
+ | ------------------------------------------------------------------------- | -------- |
149
+ | Feature manifest validation (all manifests imported in `__root.tsx`) | Medium |
150
+ | TypeScript verification (`check-types` per project) | Medium |
151
+ | Template docs surface validation (`docs/index.md`, `agent-start-here.md`) | Medium |
152
+ | Environment variable template validation (`.env.example` completeness) | Low |
153
+ | CI drift check (fail if worktree dirty after `scaffold:sync`) | Low |