@elevasis/sdk 1.37.0 → 1.38.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 (51) hide show
  1. package/dist/cli.cjs +4 -2
  2. package/dist/index.d.ts +12 -0
  3. package/dist/index.js +3 -1
  4. package/dist/test-utils/index.js +3 -1
  5. package/package.json +2 -2
  6. package/reference/claude-config/Overview.md +140 -32
  7. package/reference/claude-config/rules/active-change-index.md +13 -2
  8. package/reference/claude-config/rules/agent-start-here.md +13 -2
  9. package/reference/claude-config/rules/deployment.md +13 -2
  10. package/reference/claude-config/rules/error-handling.md +13 -2
  11. package/reference/claude-config/rules/execution.md +13 -2
  12. package/reference/claude-config/rules/frontend.md +13 -2
  13. package/reference/claude-config/rules/observability.md +13 -2
  14. package/reference/claude-config/rules/operations.md +13 -2
  15. package/reference/claude-config/rules/organization-model.md +1 -1
  16. package/reference/claude-config/rules/organization-os.md +1 -1
  17. package/reference/claude-config/rules/package-taxonomy.md +13 -2
  18. package/reference/claude-config/rules/platform.md +13 -2
  19. package/reference/claude-config/rules/shared-types.md +13 -2
  20. package/reference/claude-config/rules/task-tracking.md +13 -2
  21. package/reference/claude-config/rules/topbar-actions.md +2 -2
  22. package/reference/claude-config/rules/ui.md +13 -2
  23. package/reference/claude-config/rules/vibe.md +13 -2
  24. package/reference/claude-config/settings.json +30 -34
  25. package/reference/claude-config/skills/deploy/SKILL.md +159 -156
  26. package/reference/claude-config/skills/elevasis/SKILL.md +11 -4
  27. package/reference/claude-config/skills/explore/SKILL.md +78 -78
  28. package/reference/claude-config/skills/git-sync/SKILL.md +166 -126
  29. package/reference/claude-config/skills/om/SKILL.md +15 -15
  30. package/reference/claude-config/skills/om/operations/build.md +2 -2
  31. package/reference/claude-config/skills/project/SKILL.md +1 -1
  32. package/reference/claude-config/skills/save/SKILL.md +183 -183
  33. package/reference/claude-config/skills/setup/SKILL.md +9 -3
  34. package/reference/claude-config/skills/status/SKILL.md +59 -59
  35. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  36. package/reference/claude-config/skills/tutorial/SKILL.md +1 -1
  37. package/reference/claude-config/skills/tutorial/technical.md +11 -11
  38. package/reference/claude-config/sync-notes/2026-06-25-shared-page-scroll-contract-guard.md +52 -0
  39. package/reference/claude-config/sync-notes/2026-06-26-leadgen-overview-om-telemetry.md +47 -0
  40. package/reference/claude-config/sync-notes/2026-07-21-agent-scaffold-hardening.md +75 -0
  41. package/reference/rules/active-change-index.md +5 -5
  42. package/reference/rules/agent-start-here.md +34 -30
  43. package/reference/rules/deployment.md +21 -8
  44. package/reference/rules/frontend.md +4 -4
  45. package/reference/rules/observability.md +1 -1
  46. package/reference/rules/organization-model.md +1 -1
  47. package/reference/rules/organization-os.md +29 -29
  48. package/reference/rules/ui.md +205 -202
  49. package/reference/rules/vibe.md +4 -4
  50. package/reference/scaffold/operations/propagation-pipeline.md +1 -1
  51. package/reference/scaffold/recipes/extend-lead-gen.md +13 -0
@@ -6,6 +6,17 @@ description: Compatibility pointer for the canonical Ui rule bundled with @eleva
6
6
 
7
7
  Canonical rule source:
8
8
 
9
- `node_modules/@elevasis/sdk/reference/rules/ui.md`
9
+ `operations/node_modules/@elevasis/sdk/reference/rules/ui.md`
10
10
 
11
- Read that bundled rule before applying this rule. This local file is intentionally kept as a thin compatibility pointer for existing local rule references in skills, sync notes, and older prompts.
11
+ When working in the monorepo template snapshot before dependencies are installed,
12
+ use the repo-local generated fallback:
13
+
14
+ `packages/sdk/reference/rules/ui.md`
15
+
16
+ If the generated fallback is stale or missing, use the source:
17
+
18
+ `packages/sdk/docs/agent-rules/ui.md`
19
+
20
+ Read the bundled rule first when available. This local file is intentionally kept
21
+ as a thin compatibility pointer for existing local rule references in skills,
22
+ sync notes, and older prompts.
@@ -6,6 +6,17 @@ description: Compatibility pointer for the canonical Vibe rule bundled with @ele
6
6
 
7
7
  Canonical rule source:
8
8
 
9
- `node_modules/@elevasis/sdk/reference/rules/vibe.md`
9
+ `operations/node_modules/@elevasis/sdk/reference/rules/vibe.md`
10
10
 
11
- Read that bundled rule before applying this rule. This local file is intentionally kept as a thin compatibility pointer for existing local rule references in skills, sync notes, and older prompts.
11
+ When working in the monorepo template snapshot before dependencies are installed,
12
+ use the repo-local generated fallback:
13
+
14
+ `packages/sdk/reference/rules/vibe.md`
15
+
16
+ If the generated fallback is stale or missing, use the source:
17
+
18
+ `packages/sdk/docs/agent-rules/vibe.md`
19
+
20
+ Read the bundled rule first when available. This local file is intentionally kept
21
+ as a thin compatibility pointer for existing local rule references in skills,
22
+ sync notes, and older prompts.
@@ -1,34 +1,30 @@
1
- {
2
- "statusLine": {
3
- "type": "command",
4
- "command": "node .claude/scripts/statusline-command.js"
5
- },
6
- "hooks": {
7
- "PostToolUse": [
8
- {
9
- "matcher": "Write|Edit|MultiEdit",
10
- "hooks": [
11
- {
12
- "type": "command",
13
- "command": "node .claude/hooks/post-edit-validate.mjs"
14
- },
15
- {
16
- "type": "command",
17
- "command": "node .claude/hooks/scaffold-registry-reminder.mjs"
18
- }
19
- ]
20
- }
21
- ],
22
- "PostToolUseFailure": [
23
- {
24
- "matcher": "Bash",
25
- "hooks": [
26
- {
27
- "type": "command",
28
- "command": "node .claude/hooks/tool-failure-recovery.mjs"
29
- }
30
- ]
31
- }
32
- ]
33
- }
34
- }
1
+ {
2
+ "statusLine": {
3
+ "type": "command",
4
+ "command": "node .claude/scripts/statusline-command.js"
5
+ },
6
+ "hooks": {
7
+ "PostToolUse": [
8
+ {
9
+ "matcher": "Write|Edit|MultiEdit",
10
+ "hooks": [
11
+ {
12
+ "type": "command",
13
+ "command": "node .claude/hooks/post-edit-validate.mjs"
14
+ }
15
+ ]
16
+ }
17
+ ],
18
+ "PostToolUseFailure": [
19
+ {
20
+ "matcher": "Bash",
21
+ "hooks": [
22
+ {
23
+ "type": "command",
24
+ "command": "node .claude/hooks/tool-failure-recovery.mjs"
25
+ }
26
+ ]
27
+ }
28
+ ]
29
+ }
30
+ }
@@ -1,156 +1,159 @@
1
- ---
2
- name: deploy
3
- description: Test, build, fix issues, then commit and push
4
- ---
5
-
6
- # Deploy
7
-
8
- Test, build, fix issues, then commit and push.
9
-
10
- **Usage:** `/deploy [--skip] [--minor | --major] [commit message]`
11
-
12
- ## Flags
13
-
14
- - `--skip` -- Skip tests, type checking, and build (Steps 2-4). Go straight from pre-flight to commit and push.
15
- - `--minor` -- Bump the minor version instead of patch (e.g. 1.0.0 -> 1.1.0).
16
- - `--major` -- Bump the major version instead of patch (e.g. 1.0.0 -> 2.0.0).
17
-
18
- ## Process
19
-
20
- ### Step 1: Pre-flight Check
21
-
22
- Run in parallel:
23
-
24
- ```bash
25
- git status
26
- git diff --stat
27
- ```
28
-
29
- If there are no changes, report "Nothing to deploy" and stop.
30
-
31
- ### Step 1b: Version Bump
32
-
33
- Read the current version from `package.json`, then bump it:
34
-
35
- - Default: bump **patch** (e.g. 1.0.0 -> 1.0.1)
36
- - `--minor`: bump **minor** (e.g. 1.0.0 -> 1.1.0)
37
- - `--major`: bump **major** (e.g. 1.0.0 -> 2.0.0)
38
-
39
- Use the Edit tool to update the `"version"` field in `package.json` directly. Do not use `npm version` or any CLI command.
40
-
41
- ### Step 2: Run Tests
42
-
43
- ```bash
44
- pnpm test
45
- ```
46
-
47
- If tests fail:
48
-
49
- 1. Read the failing test output
50
- 2. Attempt to fix the issue
51
- 3. Re-run tests
52
- 4. If still failing after 2 attempts, stop and report the failures
53
-
54
- ### Step 3: Type Check
55
-
56
- ```bash
57
- pnpm lint
58
- ```
59
-
60
- If type errors exist:
61
-
62
- 1. Read the errors
63
- 2. Attempt to fix
64
- 3. Re-run
65
- 4. If still failing after 2 attempts, stop and report
66
-
67
- ### Step 4: Build
68
-
69
- ```bash
70
- pnpm build
71
- ```
72
-
73
- If build fails:
74
-
75
- 1. Read the error output
76
- 2. Attempt to fix
77
- 3. Re-run
78
- 4. If still failing after 2 attempts, stop and report
79
-
80
- ### Step 5: Commit
81
-
82
- 1. Stage all changed files: `git add -A`
83
- 2. Create commit with the provided message (or auto-generate from changes)
84
- 3. Format: conventional commits (feat:, fix:, chore:, docs:, etc.)
85
-
86
- ```bash
87
- git add -A
88
- git commit -m "<message>"
89
- ```
90
-
91
- ### Step 6: Push
92
-
93
- ```bash
94
- git push
95
- ```
96
-
97
- If push fails (e.g., remote has new commits):
98
-
99
- 1. `git pull --rebase`
100
- 2. Re-run tests to verify no conflicts broke anything
101
- 3. `git push`
102
-
103
- ### Step 7: Report
104
-
105
- ```
106
- Deploy Complete
107
- ===============
108
- Version: <old> -> <new>
109
- Tests: passed
110
- Types: clean
111
- Build: success
112
- Commit: <hash> - <message>
113
- Push: pushed to <branch>
114
- ```
115
-
116
- ### Step 8: Project Task Status Transition
117
-
118
- After a successful push, mark any linked project task as `submitted`. This is a best-effort fanout -- it must never fail the deploy.
119
-
120
- 1. **Resolve the task ID.** Look for a `prj_tasks` UUID tied to the current work, in this order:
121
- - A task UUID explicitly captured in the current conversation (e.g. from a previous `/save`, `/project work`, or `project:task:*` invocation).
122
- - The most recent in-progress task on the most-recently-touched project, via:
123
-
124
- ```bash
125
- pnpm elevasis-sdk project:list --status active --pretty
126
- pnpm elevasis-sdk project:list --status blocked --pretty
127
- pnpm elevasis-sdk project:task:list --project <project-id> --status in_progress --pretty
128
- ```
129
-
130
- - If the session produced an ambiguous or empty result, PROMPT the user once: "Mark a project task as submitted? (task UUID, or 'skip')". Default is skip.
131
-
132
- 2. **Fire the transition** (only when a single confident task ID is resolved):
133
-
134
- ```bash
135
- pnpm elevasis-sdk project:task:update <task-id> --status submitted
136
- ```
137
-
138
- 3. **Failure handling.** If the CLI call errors, no task ID can be resolved, or the user declines, emit a single warning line and continue:
139
-
140
- ```
141
- Warning: skipped project:task status transition (<reason>). Deploy itself succeeded.
142
- ```
143
-
144
- Never retry, never block the deploy report, never exit non-zero on this step.
145
-
146
- ## Error Recovery
147
-
148
- If any step fails and cannot be auto-fixed:
149
-
150
- ```
151
- Deploy Failed at Step N: [step name]
152
- =====================================
153
- Error: [description]
154
- Attempted fixes: [what was tried]
155
- Manual action needed: [what the user should do]
156
- ```
1
+ ---
2
+ name: deploy
3
+ description: Test, build, fix issues, then commit and push
4
+ ---
5
+
6
+ # Deploy
7
+
8
+ Test, build, fix issues, then commit and push.
9
+
10
+ **Usage:** `/deploy [--skip] [--minor | --major] [commit message]`
11
+
12
+ ## Flags
13
+
14
+ - `--skip` -- Skip tests, type checking, and build (Steps 2-4). Go straight from pre-flight to commit and push.
15
+ - `--minor` -- Bump the minor version instead of patch (e.g. 1.0.0 -> 1.1.0).
16
+ - `--major` -- Bump the major version instead of patch (e.g. 1.0.0 -> 2.0.0).
17
+
18
+ ## Process
19
+
20
+ ### Step 1: Pre-flight Check
21
+
22
+ Run in parallel:
23
+
24
+ ```bash
25
+ git status
26
+ git diff --stat
27
+ ```
28
+
29
+ If there are no changes, report "Nothing to deploy" and stop.
30
+
31
+ ### Step 1b: Version Bump
32
+
33
+ Read the current version from `package.json`, then bump it:
34
+
35
+ - Default: bump **patch** (e.g. 1.0.0 -> 1.0.1)
36
+ - `--minor`: bump **minor** (e.g. 1.0.0 -> 1.1.0)
37
+ - `--major`: bump **major** (e.g. 1.0.0 -> 2.0.0)
38
+
39
+ Use the Edit tool to update the `"version"` field in `package.json` directly. Do not use `npm version` or any CLI command.
40
+
41
+ ### Step 2: Run Tests
42
+
43
+ ```bash
44
+ pnpm test
45
+ ```
46
+
47
+ If tests fail:
48
+
49
+ 1. Read the failing test output
50
+ 2. Attempt to fix the issue
51
+ 3. Re-run tests
52
+ 4. If still failing after 2 attempts, stop and report the failures
53
+
54
+ ### Step 3: Type Check
55
+
56
+ Root has no `lint` script -- `lint` only exists in `ui/package.json` (`tsc --noEmit`). `operations/package.json` has an equivalent `check-types` script; `core/package.json` has neither `lint` nor `check-types` (only `test`). Run:
57
+
58
+ ```bash
59
+ pnpm -C ui lint
60
+ pnpm -C operations check-types
61
+ ```
62
+
63
+ If type errors exist:
64
+
65
+ 1. Read the errors
66
+ 2. Attempt to fix
67
+ 3. Re-run
68
+ 4. If still failing after 2 attempts, stop and report
69
+
70
+ ### Step 4: Build
71
+
72
+ ```bash
73
+ pnpm build
74
+ ```
75
+
76
+ If build fails:
77
+
78
+ 1. Read the error output
79
+ 2. Attempt to fix
80
+ 3. Re-run
81
+ 4. If still failing after 2 attempts, stop and report
82
+
83
+ ### Step 5: Commit
84
+
85
+ 1. Stage all changed files: `git add -A`
86
+ 2. Create commit with the provided message (or auto-generate from changes)
87
+ 3. Format: conventional commits (feat:, fix:, chore:, docs:, etc.)
88
+
89
+ ```bash
90
+ git add -A
91
+ git commit -m "<message>"
92
+ ```
93
+
94
+ ### Step 6: Push
95
+
96
+ ```bash
97
+ git push
98
+ ```
99
+
100
+ If push fails (e.g., remote has new commits):
101
+
102
+ 1. `git pull --rebase`
103
+ 2. Re-run tests to verify no conflicts broke anything
104
+ 3. `git push`
105
+
106
+ ### Step 7: Report
107
+
108
+ ```
109
+ Deploy Complete
110
+ ===============
111
+ Version: <old> -> <new>
112
+ Tests: passed
113
+ Types: clean
114
+ Build: success
115
+ Commit: <hash> - <message>
116
+ Push: pushed to <branch>
117
+ ```
118
+
119
+ ### Step 8: Project Task Status Transition
120
+
121
+ After a successful push, mark any linked project task as `submitted`. This is a best-effort fanout -- it must never fail the deploy.
122
+
123
+ 1. **Resolve the task ID.** Look for a `prj_tasks` UUID tied to the current work, in this order:
124
+ - A task UUID explicitly captured in the current conversation (e.g. from a previous `/save`, `/project work`, or `project:task:*` invocation).
125
+ - The most recent in-progress task on the most-recently-touched project, via:
126
+
127
+ ```bash
128
+ pnpm elevasis-sdk project:list --status active --pretty
129
+ pnpm elevasis-sdk project:list --status blocked --pretty
130
+ pnpm elevasis-sdk project:task:list --project <project-id> --status in_progress --pretty
131
+ ```
132
+
133
+ - If the session produced an ambiguous or empty result, PROMPT the user once: "Mark a project task as submitted? (task UUID, or 'skip')". Default is skip.
134
+
135
+ 2. **Fire the transition** (only when a single confident task ID is resolved):
136
+
137
+ ```bash
138
+ pnpm elevasis-sdk project:task:update <task-id> --status submitted
139
+ ```
140
+
141
+ 3. **Failure handling.** If the CLI call errors, no task ID can be resolved, or the user declines, emit a single warning line and continue:
142
+
143
+ ```
144
+ Warning: skipped project:task status transition (<reason>). Deploy itself succeeded.
145
+ ```
146
+
147
+ Never retry, never block the deploy report, never exit non-zero on this step.
148
+
149
+ ## Error Recovery
150
+
151
+ If any step fails and cannot be auto-fixed:
152
+
153
+ ```
154
+ Deploy Failed at Step N: [step name]
155
+ =====================================
156
+ Error: [description]
157
+ Attempted fixes: [what was tried]
158
+ Manual action needed: [what the user should do]
159
+ ```
@@ -27,11 +27,18 @@ Manage SDK resources in the `operations/` workspace via the `elevasis-sdk` CLI.
27
27
 
28
28
  The CLI authenticates via `ELEVASIS_PLATFORM_KEY` in the root `.env` file. The CLI walks up directories to find `.env`, so it works from both the project root and `operations/`.
29
29
 
30
- For dev vs prod targeting:
30
+ **API URL resolution priority** (highest wins, first match applies):
31
31
 
32
- - Default: production (`https://api.elevasis.io`)
33
- - `--prod` flag: explicitly targets production (overrides `NODE_ENV=development`)
34
- - `ELEVASIS_API_URL` env var: override to any custom URL
32
+ 1. `--api-url <url>` CLI flag -- explicit override, always wins
33
+ 2. `--prod` flag -- forces `https://api.elevasis.io`
34
+ 3. `ELEVASIS_API_URL` env var -- custom URL override
35
+ 4. `NODE_ENV` default -- `http://localhost:5170` only when `NODE_ENV=development`; otherwise `https://api.elevasis.io`
36
+
37
+ **The default target is production.** Unless `NODE_ENV=development` is set in the environment, every command hits `https://api.elevasis.io` even with no flags at all.
38
+
39
+ **`NODE_ENV=development` is what selects the dev API** (`http://localhost:5170`). Setting `NODE_ENV=development` also switches the credential lookup: `ELEVASIS_PLATFORM_KEY_DEV` is used if set, falling back to `ELEVASIS_PLATFORM_KEY` if not.
40
+
41
+ **`--prod` forces production, even under `NODE_ENV=development`.** It overrides the dev API URL back to `https://api.elevasis.io` AND forces the credential lookup to use `ELEVASIS_PLATFORM_KEY` (never the `_DEV` variant), regardless of `NODE_ENV`.
35
42
 
36
43
  ## Operations
37
44
 
@@ -1,78 +1,78 @@
1
- ---
2
- name: explore
3
- description: Codebase exploration anchored to project documentation
4
- ---
5
-
6
- # Explore
7
-
8
- Codebase exploration anchored to project documentation.
9
-
10
- **Usage:** `/explore [area or question]`
11
-
12
- ## Process
13
-
14
- ### Step 0: OS-Vocab Classification
15
-
16
- Before orienting, scan the user's query for Organization OS terminology. If any of the following appear, classify the query as **OS-relevant** and follow the OS context steps below; otherwise skip to Step 1.
17
-
18
- **OS vocabulary triggers:**
19
-
20
- - System layer: `system`, `systems`, `SystemModule`, `system key`, `system gate`, `system access`, `gate`, `gating`, `access`, `enable`, `disable`
21
- - Shell / nav: `manifest`, `shell`, `sub-shell`, `sidebar`, `nav`, `navigation`, `route`
22
- - Auth / guards: `guard`, `SystemGuard`, `AdminGuard`, `ProtectedRoute`, `admin`
23
- - Org model: `organization`, `org model`, `organization model`, `domain`, `surface`
24
- - Foundations: `foundation`, `foundations`, `@core/`, `adapter`
25
- - Platform ops: `workflow`, `agent`, `deployment`, `resource`
26
-
27
- **If OS-relevant:**
28
-
29
- 1. Read `.claude/rules/active-change-index.md` immediately. If the target area is flagged as under active refactor, surface the watch-area warning to the user before proceeding — include the "Load:" doc paths listed in that entry so investigation does not rely on stale scaffold prose.
30
- 2. Build the OS context bundle to pass into Step 3:
31
- - Always: `node_modules/@elevasis/sdk/reference/scaffold/reference/glossary.md`, `.claude/rules/active-change-index.md`, `.claude/rules/agent-start-here.md`
32
- - Systems / Shell / Gating queries: add `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` + `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
33
- - Workflow / Operations queries: add `.claude/rules/operations.md` + glob `operations/src/**`
34
- - Organization-model queries: add `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` + `core/config/README.md`
35
-
36
- **OS layer → query intent map** (guides which reference docs the investigator loads first):
37
-
38
- | Query intent | Primary OS layers | Key reference |
39
- | ---------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
40
- | "Why doesn't my system show up?" | Systems + UI Shell Runtime | `glossary.md` (SystemModule, SystemGuard), `feature-flags-and-gating.md` |
41
- | "How do I add a nav item?" | Systems + Toolkit | `feature-flags-and-gating.md`, `contracts.md` |
42
- | "How does admin gating work?" | Systems + UI Shell Runtime | `glossary.md` (AdminGuard, requiresAdmin, ProtectedRoute), `feature-flags-and-gating.md` |
43
- | "What runs when this workflow triggers?" | Platform Public API + Operations | `.claude/rules/operations.md`, `resources.md` |
44
- | "Why does the foundations adapter fail?" | Foundations | `glossary.md` (domain vs surface, settings asymmetry), `core/config/README.md` |
45
-
46
- ### Step 1: Orient
47
-
48
- 1. Read `.claude/rules/agent-start-here.md` for project structure, task-class routing, and boundary resolution
49
- 2. Determine which domain the user's question falls into
50
-
51
- ### Step 2: Load Domain Context
52
-
53
- Read the relevant doc(s) and source directories based on the area being explored. Use the Navigation table in `CLAUDE.md` for quick reference.
54
-
55
- For OS-relevant queries, also inject the OS context bundle assembled in Step 0 into the investigator's starting context.
56
-
57
- ### Step 3: Investigate
58
-
59
- For targeted questions:
60
-
61
- - Use Grep to search for specific patterns, function names, or strings
62
- - Use Glob to find files by pattern
63
- - Read specific files for detailed understanding
64
-
65
- For broad exploration:
66
-
67
- - Dispatch a `general-purpose` subagent with the domain context and exploration question
68
- - The subagent should read files, trace data flow, and return a structured report
69
- - For OS-relevant queries, pass the preloaded OS context bundle so the subagent starts with terminology already resolved
70
-
71
- ### Step 4: Report
72
-
73
- Present findings with:
74
-
75
- - Direct answers to the question
76
- - Relevant code locations (file:function format)
77
- - Connections to other parts of the system
78
- - Suggestions for related areas to explore (if relevant)
1
+ ---
2
+ name: explore
3
+ description: Codebase exploration anchored to project documentation
4
+ ---
5
+
6
+ # Explore
7
+
8
+ Codebase exploration anchored to project documentation.
9
+
10
+ **Usage:** `/explore [area or question]`
11
+
12
+ ## Process
13
+
14
+ ### Step 0: OS-Vocab Classification
15
+
16
+ Before orienting, scan the user's query for Organization OS terminology. If any of the following appear, classify the query as **OS-relevant** and follow the OS context steps below; otherwise skip to Step 1.
17
+
18
+ **OS vocabulary triggers:**
19
+
20
+ - System layer: `system`, `systems`, `SystemModule`, `system key`, `system gate`, `system access`, `gate`, `gating`, `access`, `enable`, `disable`
21
+ - Shell / nav: `manifest`, `shell`, `sub-shell`, `sidebar`, `nav`, `navigation`, `route`
22
+ - Auth / guards: `guard`, `SystemGuard`, `AdminGuard`, `ProtectedRoute`, `admin`
23
+ - Org model: `organization`, `org model`, `organization model`, `domain`, `surface`
24
+ - Foundations: `foundation`, `foundations`, `@core/`, `adapter`
25
+ - Platform ops: `workflow`, `agent`, `deployment`, `resource`
26
+
27
+ **If OS-relevant:**
28
+
29
+ 1. Read `.claude/rules/active-change-index.md` immediately. If the target area is flagged as under active refactor, surface the watch-area warning to the user before proceeding — include the "Load:" doc paths listed in that entry so investigation does not rely on stale scaffold prose.
30
+ 2. Build the OS context bundle to pass into Step 3:
31
+ - Always: `operations/node_modules/@elevasis/sdk/reference/scaffold/reference/glossary.md`, `.claude/rules/active-change-index.md`, `.claude/rules/agent-start-here.md`
32
+ - Systems / Shell / Gating queries: add `operations/node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` + `operations/node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
33
+ - Workflow / Operations queries: add `.claude/rules/operations.md` + glob `operations/src/**`
34
+ - Organization-model queries: add `operations/node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` + `core/config/README.md`
35
+
36
+ **OS layer → query intent map** (guides which reference docs the investigator loads first):
37
+
38
+ | Query intent | Primary OS layers | Key reference |
39
+ | ---------------------------------------- | -------------------------------- | ---------------------------------------------------------------------------------------- |
40
+ | "Why doesn't my system show up?" | Systems + UI Shell Runtime | `glossary.md` (SystemModule, SystemGuard), `feature-flags-and-gating.md` |
41
+ | "How do I add a nav item?" | Systems + Toolkit | `feature-flags-and-gating.md`, `contracts.md` |
42
+ | "How does admin gating work?" | Systems + UI Shell Runtime | `glossary.md` (AdminGuard, requiresAdmin, ProtectedRoute), `feature-flags-and-gating.md` |
43
+ | "What runs when this workflow triggers?" | Platform Public API + Operations | `.claude/rules/operations.md`, `resources.md` |
44
+ | "Why does the foundations adapter fail?" | Foundations | `glossary.md` (domain vs surface, settings asymmetry), `core/config/README.md` |
45
+
46
+ ### Step 1: Orient
47
+
48
+ 1. Read `.claude/rules/agent-start-here.md` for project structure, task-class routing, and boundary resolution
49
+ 2. Determine which domain the user's question falls into
50
+
51
+ ### Step 2: Load Domain Context
52
+
53
+ Read the relevant doc(s) and source directories based on the area being explored. Use the Navigation table in `CLAUDE.md` for quick reference.
54
+
55
+ For OS-relevant queries, also inject the OS context bundle assembled in Step 0 into the investigator's starting context.
56
+
57
+ ### Step 3: Investigate
58
+
59
+ For targeted questions:
60
+
61
+ - Use Grep to search for specific patterns, function names, or strings
62
+ - Use Glob to find files by pattern
63
+ - Read specific files for detailed understanding
64
+
65
+ For broad exploration:
66
+
67
+ - Dispatch a `general-purpose` subagent with the domain context and exploration question
68
+ - The subagent should read files, trace data flow, and return a structured report
69
+ - For OS-relevant queries, pass the preloaded OS context bundle so the subagent starts with terminology already resolved
70
+
71
+ ### Step 4: Report
72
+
73
+ Present findings with:
74
+
75
+ - Direct answers to the question
76
+ - Relevant code locations (file:function format)
77
+ - Connections to other parts of the system
78
+ - Suggestions for related areas to explore (if relevant)