feat(cli): add Snow CLI as class-1 Trellis platform - #443
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughSnow CLI support is added across CLI flags, platform metadata, template generation, Snow agents and hooks, session-context resolution, documentation, ignore rules, and integration tests. ChangesSnow CLI platform integration
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant SnowCLI
participant SnowHook
participant TrellisTaskScript
participant SnowProjectFiles
SnowCLI->>SnowHook: invoke session, user, or subagent hook
SnowHook->>TrellisTaskScript: resolve current task and runtime context
TrellisTaskScript-->>SnowHook: return task and workflow data
SnowHook->>SnowProjectFiles: write breadcrumb log
SnowHook-->>SnowCLI: return additionalContext and display JSON
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
packages/cli/test/configurators/platforms.test.ts (1)
836-845: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExecute the generated hook instead of only scanning its source.
These assertions pass even when mode resolution, JSON output, byte limits, session isolation, or log persistence are broken. Add fixture-based executions for
session,user, andsubagent, asserting parsed stdout andtrellis-context.txt; verify Python availability in the declared CI toolchain.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/test/configurators/platforms.test.ts` around lines 836 - 845, Replace the source-string checks in the hookPy test with fixture-based executions of the generated write-trellis-context.py hook for session, user, and subagent modes. Assert parsed stdout plus trellis-context.txt contents, covering mode resolution, JSON output, byte limits, session isolation, and implement.jsonl persistence; also verify Python is available in the declared CI toolchain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli/src/templates/snow/hooks/write-trellis-context.py`:
- Around line 539-545: Update the user-message hook’s log-writing flow around
trellis-context.txt so it never overwrites the full breadcrumb with compact
user-mode context. Preserve the existing full snapshot when available, or
generate and write refreshed full log context separately, while keeping the
compact context for injection behavior.
- Around line 369-381: Update the session-file fallback in the context-writing
flow to select only the runtime session identified by TRELLIS_CONTEXT_ID or
SNOW_SESSION_ID, rather than sorting all files by modification time. If neither
identifier is available or no matching session file exists, omit this fallback
and do not populate body from another session.
- Around line 67-85: Reduce the subprocess timeout in _run from 15 seconds to a
value below Snow’s hook timeout, such as five seconds, so stalled task.py
executions finish fail-open before the parent hook is terminated. Keep the
existing output and exception handling unchanged.
- Around line 522-525: Update _truncate to enforce max_bytes using UTF-8 encoded
byte length rather than character count. Preserve text unchanged when its UTF-8
representation fits; otherwise truncate on a valid UTF-8 character boundary and
append the existing truncation marker while ensuring the final encoded result
does not exceed max_bytes.
---
Nitpick comments:
In `@packages/cli/test/configurators/platforms.test.ts`:
- Around line 836-845: Replace the source-string checks in the hookPy test with
fixture-based executions of the generated write-trellis-context.py hook for
session, user, and subagent modes. Assert parsed stdout plus trellis-context.txt
contents, covering mode resolution, JSON output, byte limits, session isolation,
and implement.jsonl persistence; also verify Python is available in the declared
CI toolchain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 50196b64-e496-4e95-a1a9-17a308572df9
📒 Files selected for processing (21)
.agents/skills/trellis-meta/references/platform-files/platform-map.md.trellis/scripts/common/active_task.pypackages/cli/src/cli/index.tspackages/cli/src/commands/init.tspackages/cli/src/configurators/index.tspackages/cli/src/configurators/shared.tspackages/cli/src/configurators/snow.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/snow/SNOW.mdpackages/cli/src/templates/snow/agents/trellis-check.mdpackages/cli/src/templates/snow/agents/trellis-implement.mdpackages/cli/src/templates/snow/agents/trellis-research.mdpackages/cli/src/templates/snow/hooks/beforeSubAgentStart.jsonpackages/cli/src/templates/snow/hooks/onSessionStart.jsonpackages/cli/src/templates/snow/hooks/onUserMessage.jsonpackages/cli/src/templates/snow/hooks/write-trellis-context.pypackages/cli/src/templates/snow/index.tspackages/cli/src/templates/template-utils.tspackages/cli/src/templates/trellis/scripts/common/active_task.pypackages/cli/src/types/ai-tools.tspackages/cli/test/configurators/platforms.test.ts
Follow-up: CodeRabbit review fixesPushed Addressed
Validation
|
Note on PR base branchThis PR is intentionally opened as:
I do not have push permission on If maintainers prefer this work to land onto a dedicated integration branch first (e.g. |
请维护者确认 base 分支@taosu0216 你好 👋 本 PR 当前是:
我这边对 如果你们希望先合到独立功能分支(而不是直接进 git checkout main && git pull
git checkout -b feat/snow-cli
git push origin feat/snow-cli建好后我可以立刻把本 PR retarget 到 感谢! |
f8edeec to
462f232
Compare
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/skills/trellis-meta/references/platform-files/platform-map.md:
- Line 50: Synchronize the two platform maps: in
.agents/skills/trellis-meta/references/platform-files/platform-map.md at line
50, remove the inaccurate “pull-based prelude” wording while retaining Snow’s
auto-discovered hooks and optional legacy sub-agent configuration; in
packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
at line 27, add Snow to the “Trellis Sub-Agent Support” list using the same
hook-injection wording.
In `@packages/cli/src/templates/snow/hooks/write-trellis-context.py`:
- Around line 115-145: The _jsonl_summaries function currently retains the
earliest entries despite callers expecting recent entries. Continue scanning the
entire JSONL file, maintain only the latest max_items summaries in file order,
and return those retained entries while preserving existing parsing, truncation,
and formatting behavior.
In `@packages/cli/test/configurators/platforms.test.ts`:
- Line 886: Update the agents declaration in the affected test fixture to use
the repository-approved array type syntax required by the
`@typescript-eslint/array-type` rule, preserving the existing element shape of id
and tools.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 4fb36383-05ed-4da5-b1c5-7f50ba9e57a4
📒 Files selected for processing (22)
.agents/skills/trellis-meta/references/platform-files/platform-map.md.trellis/scripts/common/active_task.pypackages/cli/src/cli/index.tspackages/cli/src/commands/init.tspackages/cli/src/configurators/index.tspackages/cli/src/configurators/shared.tspackages/cli/src/configurators/snow.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/markdown/agents.mdpackages/cli/src/templates/snow/SNOW.mdpackages/cli/src/templates/snow/agents/trellis-check.mdpackages/cli/src/templates/snow/agents/trellis-implement.mdpackages/cli/src/templates/snow/agents/trellis-research.mdpackages/cli/src/templates/snow/hooks/beforeSubAgentStart.jsonpackages/cli/src/templates/snow/hooks/onSessionStart.jsonpackages/cli/src/templates/snow/hooks/onUserMessage.jsonpackages/cli/src/templates/snow/hooks/write-trellis-context.pypackages/cli/src/templates/snow/index.tspackages/cli/src/templates/template-utils.tspackages/cli/src/templates/trellis/scripts/common/active_task.pypackages/cli/src/types/ai-tools.tspackages/cli/test/configurators/platforms.test.ts
🚧 Files skipped from review as they are similar to previous changes (14)
- packages/cli/src/templates/snow/hooks/onUserMessage.json
- packages/cli/src/templates/snow/hooks/onSessionStart.json
- packages/cli/src/templates/snow/hooks/beforeSubAgentStart.json
- packages/cli/src/templates/template-utils.ts
- .trellis/scripts/common/active_task.py
- packages/cli/src/templates/snow/agents/trellis-research.md
- packages/cli/src/configurators/shared.ts
- packages/cli/src/templates/snow/index.ts
- packages/cli/src/templates/snow/SNOW.md
- packages/cli/src/cli/index.ts
- packages/cli/src/templates/snow/agents/trellis-implement.md
- packages/cli/src/types/ai-tools.ts
- packages/cli/src/templates/snow/agents/trellis-check.md
- packages/cli/src/configurators/index.ts
| "utf-8", | ||
| ), | ||
| ) as { | ||
| agents: Array<{ id: string; tools: string[] }>; |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Use the repository-approved array type syntax.
This declaration violates the configured @typescript-eslint/array-type rule.
Proposed fix
- agents: Array<{ id: string; tools: string[] }>;
+ agents: { id: string; tools: string[] }[];📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| agents: Array<{ id: string; tools: string[] }>; | |
| agents: { id: string; tools: string[] }[]; |
🧰 Tools
🪛 ESLint
[error] 886-886: Array type using 'Array' is forbidden. Use 'T[]' instead.
(@typescript-eslint/array-type)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/cli/test/configurators/platforms.test.ts` at line 886, Update the
agents declaration in the affected test fixture to use the repository-approved
array type syntax required by the `@typescript-eslint/array-type` rule, preserving
the existing element shape of id and tools.
Source: Linters/SAST tools
462f232 to
d55bd58
Compare
Follow-up: rebased onto latest upstream/main + review hardeningPR tip rewritten on top of current What changed since previous tip
Validationpnpm --filter @mindfoldhq/trellis exec vitest run test/configurators/platforms.test.ts -t "snow"
pnpm --filter @mindfoldhq/trellis exec vitest run test/templates/snow-write-trellis-context.test.ts
python -m py_compile packages/cli/src/templates/snow/hooks/write-trellis-context.pyNote for reviewers
|
|
Thanks for the PR — this is a serious integration effort, and we've verified the core work is solid: the hook contract matches upstream snow-cli (checked against Before we can merge, four things need to change: 1. Remove 2. Regenerate or drop the 3. Drop the 4. Fix the configured-platform detection to match its own comment One more process note: platform additions normally go through the tracking epic #349 first (comment there to claim) — we'll add a Snow evaluation entry there. Given snow-cli's traction the evaluation itself isn't a concern, but note this integration depends on the hook contract that only landed in snow-ai 0.8.18 a few days ago, so we'd like to see it hold stable on the user side before shipping. |
Wire trellis init --snow/--snocli to write .snow skills, prompt commands, project agents, and inject hooks (session/user/beforeSubAgentStart) that emit additionalContext for snow-cli#194-compatible hosts.
Drain host-piped hook context with a short timeout on Windows so manual CLI runs and TTY invocations do not block on stdin.read().
- Teach active_task resolver about snow platform + SNOW_SESSION_ID - Expand write-trellis-context modes (session/user/subagent) - Document session identity env contract in SNOW.md - Strengthen Snow platform configurator tests Note: full-suite pre-commit has pre-existing unrelated failures (cursor/trae/reasonix/omp/atomic-write). Snow-specific tests pass.
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.agents/skills/trellis-meta/references/platform-files/platform-map.md:
- Line 22: The Pi Agent skill directory must be consistent across both platform
maps. Keep the
`.agents/skills/trellis-meta/references/platform-files/platform-map.md` entry as
`.pi/skills/`; update the Pi Agent Skill directory entry at
`packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md:22-22`
from `.agents/skills/` to `.pi/skills/`.
In `@packages/cli/src/configurators/snow.ts`:
- Around line 62-69: Update collectSnowStaticFiles and the hook-writing path in
configureSnow to apply replacePythonCommandLiterals(hook.content) consistently
when building tracked Snow hook content and writing files, matching the existing
command handling. Preserve shebang-aware substitution and ensure the
.snow/hooks/* template content exactly matches the bytes configureSnow writes.
In `@packages/cli/src/templates/snow/hooks/write-trellis-context.py`:
- Around line 478-483: Memoize the task.py current --source result for the
duration of a single hook invocation. Update build_context and its callers so
the first build_context call performs the _run invocation and the second reuses
the cached current output, while preserving _parse_active_task_path behavior and
existing user-mode compact/full context generation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 64f5900d-7074-44f6-a45c-627e4c33485e
📒 Files selected for processing (25)
.agents/skills/trellis-meta/references/platform-files/platform-map.md.gitignore.trellis/scripts/common/active_task.pypackages/cli/src/cli/index.tspackages/cli/src/commands/init.tspackages/cli/src/configurators/index.tspackages/cli/src/configurators/shared.tspackages/cli/src/configurators/snow.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.mdpackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/snow/SNOW.mdpackages/cli/src/templates/snow/agents/trellis-check.mdpackages/cli/src/templates/snow/agents/trellis-implement.mdpackages/cli/src/templates/snow/agents/trellis-research.mdpackages/cli/src/templates/snow/hooks/beforeSubAgentStart.jsonpackages/cli/src/templates/snow/hooks/onSessionStart.jsonpackages/cli/src/templates/snow/hooks/onUserMessage.jsonpackages/cli/src/templates/snow/hooks/write-trellis-context.pypackages/cli/src/templates/snow/index.tspackages/cli/src/templates/template-utils.tspackages/cli/src/templates/trellis/scripts/common/active_task.pypackages/cli/src/types/ai-tools.tspackages/cli/test/configurators/index.test.tspackages/cli/test/configurators/platforms.test.tspackages/cli/test/templates/snow-write-trellis-context.test.ts
🚧 Files skipped from review as they are similar to previous changes (10)
- packages/cli/src/templates/snow/hooks/onUserMessage.json
- packages/cli/src/templates/snow/hooks/onSessionStart.json
- packages/cli/src/templates/snow/hooks/beforeSubAgentStart.json
- packages/cli/src/templates/snow/index.ts
- packages/cli/src/configurators/shared.ts
- packages/cli/src/templates/snow/SNOW.md
- packages/cli/src/templates/template-utils.ts
- packages/cli/src/templates/snow/agents/trellis-research.md
- packages/cli/src/templates/snow/agents/trellis-check.md
- packages/cli/src/templates/snow/agents/trellis-implement.md
| | CodeBuddy | `--codebuddy` | `.codebuddy/` | `.codebuddy/skills/` | `.codebuddy/agents/` | `.codebuddy/hooks/` + `.codebuddy/settings.json` | | ||
| | GitHub Copilot | `--copilot` | `.github/` | `.github/skills/` | `.github/agents/` | `.github/copilot/hooks/` + prompts | | ||
| | Factory Droid | `--droid` | `.factory/` | `.factory/skills/` | `.factory/droids/` | `.factory/hooks/` + settings | | ||
| | Pi Agent | `--pi` | `.pi/` | `.pi/skills/` | `.pi/agents/` | `.pi/extensions/trellis/` (native `trellis_subagent` tool) + `.pi/settings.json` | |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Pi Agent's Skill directory disagrees between the two platform maps. One canonical doc says .pi/skills/, the other says .agents/skills/; the "Shared .agents/skills/" section in both files names only Codex and Gemini CLI as writers of that shared layer, so the bundled copy's .agents/skills/ entry for Pi Agent looks like a stale copy/paste from the Codex/Gemini rows.
.agents/skills/trellis-meta/references/platform-files/platform-map.md#L22-L22: keep as.pi/skills/(consistent with the Shared-skills section).packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md#L22-L22: change Pi Agent's Skill directory column from.agents/skills/to.pi/skills/to match.
📍 Affects 2 files
.agents/skills/trellis-meta/references/platform-files/platform-map.md#L22-L22(this comment)packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md#L22-L22
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.agents/skills/trellis-meta/references/platform-files/platform-map.md at
line 22, The Pi Agent skill directory must be consistent across both platform
maps. Keep the
`.agents/skills/trellis-meta/references/platform-files/platform-map.md` entry as
`.pi/skills/`; update the Pi Agent Skill directory entry at
`packages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md:22-22`
from `.agents/skills/` to `.pi/skills/`.
| task_py = repo / ".trellis" / "scripts" / "task.py" | ||
| current = "" | ||
| task_dir: Path | None = None | ||
| if task_py.is_file(): | ||
| py = sys.executable or "python3" | ||
| current = _run([py, "-X", "utf8", str(task_py), "current", "--source"], repo) |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
User-mode hook now runs task.py twice, doubling timeout exposure.
When mode == "user", build_context() is invoked twice (compact at Line 591, full at Line 601), and each call independently re-invokes _run(...) against task.py (Line 483). The _run timeout was deliberately set to 5s specifically to leave headroom under Snow's 15s hook timeout (comment at Lines 77-79), but two sequential 5s-bounded subprocess calls can now consume up to ~10s before the rest of the hook logic even runs — eroding most of that headroom on the most frequently-fired hook (every user message).
Memoize the task.py current --source output for the duration of one hook invocation so the second build_context call reuses it instead of re-spawning the process.
🔧 Proposed fix: memoize the task.py subprocess call
+import functools
+
+
+@functools.lru_cache(maxsize=4)
+def _cached_task_current(task_py: Path, repo: Path) -> str:
+ py = sys.executable or "python3"
+ return _run([py, "-X", "utf8", str(task_py), "current", "--source"], repo)
+
+
def build_context(
repo: Path,
*,
mode: str,
stdin_ctx: dict[str, Any],
) -> str:
...
task_py = repo / ".trellis" / "scripts" / "task.py"
current = ""
task_dir: Path | None = None
if task_py.is_file():
- py = sys.executable or "python3"
- current = _run([py, "-X", "utf8", str(task_py), "current", "--source"], repo)
+ current = _cached_task_current(task_py, repo)
lines.extend(["## task.py current --source", "```", current, "```", ""])
task_dir = _parse_active_task_path(current, repo)Also applies to: 591-602
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/cli/src/templates/snow/hooks/write-trellis-context.py` around lines
478 - 483, Memoize the task.py current --source result for the duration of a
single hook invocation. Update build_context and its callers so the first
build_context call performs the _run invocation and the second reuses the cached
current output, while preserving _parse_active_task_path behavior and existing
user-mode compact/full context generation.
2860d05 to
e5bb249
Compare
…ce mirror sync Snow is class-1 hook-backed like ZCode but was absent from every workflow.md platform list after the PR slim-down, so Snow sessions would miss the sub-agent dispatch and jsonl-curation guidance. Added beside ZCode in all 13 marker lists + the dispatch-protocol prose (template + dogfood), with the marketplace mirror synced and the submodule pointer bumped.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
packages/cli/src/configurators/snow.ts (1)
62-69: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
collectSnowStaticFilesstill diverges from whatconfigureSnowwrites — unresolved from a prior review round.
collectSnowStaticFiles(used bycollectSnowTemplatesfortrellis updatehash tracking) stores rawhook.content, whileconfigureSnow(Lines 138-143) writesreplacePythonCommandLiterals(hook.content)to disk. Whenever the resolved Python command differs from the literal in the template, the tracked hash for.snow/hooks/*won't match the actual file bytes, breakingtrellis update's modification detection for Snow hooks — same as flagged previously; the code here is unchanged.🐛 Proposed fix
function collectSnowStaticFiles(): Map<string, string> { const files = new Map<string, string>(); for (const hook of getAllHooks()) { - files.set(`.snow/hooks/${hook.targetPath}`, hook.content); + files.set( + `.snow/hooks/${hook.targetPath}`, + replacePythonCommandLiterals(hook.content), + ); } files.set(".snow/SNOW.md", getSnowGuide()); return files; }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/cli/src/configurators/snow.ts` around lines 62 - 69, Update collectSnowStaticFiles to store each hook’s content after applying replacePythonCommandLiterals, matching the transformation used by configureSnow before writing .snow/hooks files. Keep the existing hook target paths and Snow guide handling unchanged so update hash tracking reflects the actual disk contents.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@packages/cli/src/configurators/snow.ts`:
- Around line 62-69: Update collectSnowStaticFiles to store each hook’s content
after applying replacePythonCommandLiterals, matching the transformation used by
configureSnow before writing .snow/hooks files. Keep the existing hook target
paths and Snow guide handling unchanged so update hash tracking reflects the
actual disk contents.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 5ac5210d-771b-46af-94ad-37d1b7c9cc83
📒 Files selected for processing (25)
.agents/skills/trellis-meta/references/platform-files/platform-map.md.gitignore.trellis/scripts/common/active_task.pypackages/cli/src/cli/index.tspackages/cli/src/commands/init.tspackages/cli/src/configurators/index.tspackages/cli/src/configurators/shared.tspackages/cli/src/configurators/snow.tspackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.mdpackages/cli/src/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.mdpackages/cli/src/templates/snow/SNOW.mdpackages/cli/src/templates/snow/agents/trellis-check.mdpackages/cli/src/templates/snow/agents/trellis-implement.mdpackages/cli/src/templates/snow/agents/trellis-research.mdpackages/cli/src/templates/snow/hooks/beforeSubAgentStart.jsonpackages/cli/src/templates/snow/hooks/onSessionStart.jsonpackages/cli/src/templates/snow/hooks/onUserMessage.jsonpackages/cli/src/templates/snow/hooks/write-trellis-context.pypackages/cli/src/templates/snow/index.tspackages/cli/src/templates/template-utils.tspackages/cli/src/templates/trellis/scripts/common/active_task.pypackages/cli/src/types/ai-tools.tspackages/cli/test/configurators/index.test.tspackages/cli/test/configurators/platforms.test.tspackages/cli/test/templates/snow-write-trellis-context.test.ts
🚧 Files skipped from review as they are similar to previous changes (14)
- packages/cli/src/cli/index.ts
- .trellis/scripts/common/active_task.py
- packages/cli/test/configurators/index.test.ts
- packages/cli/src/templates/template-utils.ts
- packages/cli/src/templates/snow/hooks/onUserMessage.json
- packages/cli/src/configurators/index.ts
- .agents/skills/trellis-meta/references/platform-files/platform-map.md
- .gitignore
- packages/cli/src/templates/snow/agents/trellis-implement.md
- packages/cli/src/templates/snow/agents/trellis-check.md
- packages/cli/src/templates/snow/agents/trellis-research.md
- packages/cli/src/configurators/shared.ts
- packages/cli/src/templates/snow/index.ts
- packages/cli/src/templates/snow/SNOW.md
* feat(cli): add Snow CLI (snocli) class-1 platform support Wire trellis init --snow/--snocli to write .snow skills, prompt commands, project agents, and inject hooks (session/user/beforeSubAgentStart) that emit additionalContext for snow-cli#194-compatible hosts. * fix(snow): avoid hanging write-trellis-context.py on empty stdin Drain host-piped hook context with a short timeout on Windows so manual CLI runs and TTY invocations do not block on stdin.read(). * feat(snow): complete latest Snow session-identity adaptation - Teach active_task resolver about snow platform + SNOW_SESSION_ID - Expand write-trellis-context modes (session/user/subagent) - Document session identity env contract in SNOW.md - Strengthen Snow platform configurator tests Note: full-suite pre-commit has pre-existing unrelated failures (cursor/trae/reasonix/omp/atomic-write). Snow-specific tests pass. * feat(snow): drop legacy sub-agent JSON and class-2 pull prelude * fix(snow): harden class-1 inject and align agent docs * chore(snow): dogfood project .snow assets for clone-and-use * test(snow): execute write-trellis-context session/user/subagent modes * fix(snow): address maintainer review blockers * test(cli): align platform expectations after rebase * feat(snow): add Snow to workflow.md platform marker lists + marketplace mirror sync Snow is class-1 hook-backed like ZCode but was absent from every workflow.md platform list after the PR slim-down, so Snow sessions would miss the sub-agent dispatch and jsonl-curation guidance. Added beside ZCode in all 13 marker lists + the dispatch-protocol prose (template + dogfood), with the marketplace mirror synced and the submodule pointer bumped. * test: include Snow in hook-platform marker expectations --------- Co-authored-by: BaSui <basui0103@gmail.com> Co-authored-by: taosu <taosu@mindfold.ai>
Summary
Add Snow CLI as a first-class Trellis platform.
This enables class-1 Trellis hosting on Snow without hardcoding Trellis into Snow itself:
.snow/agents/beforeSubAgentStartprompt enrichmentWhy
Snow CLI now supports the contracts Trellis needs for automatic workflow context:
additionalContext.snow/agents/**/*.mdbeforeSubAgentStartSNOW_SESSION_ID/TRELLIS_CONTEXT_ID/SNOW_CWD/SNOW_PLATFORMWithout a Trellis platform configurator, users still have to hand-wire skills/hooks/agents.
What this PR adds
Platform registration
AI_TOOLS.snow/ CLI flag:--snowconfigureSnow()writes project assets under.snow/.snow/skills(avoids false positive on bare.snow/settings.json)Generated project layout
.snow/skills/trellis-*.snow/commands/trellis-*.jsoncontinue/finish-work, …).snow/agents/*.mdtrellis-implement/trellis-check/trellis-research.snow/hooks/*onSessionStart/onUserMessage/beforeSubAgentStart.snow/hooks/write-trellis-context.py.snow/SNOW.mdHook inject protocol
Stdout JSON (exit 0):
{ "additionalContext": "...", "display": "..." }Modes:
onSessionStartsessiononUserMessageuserbeforeSubAgentStartsubagentAlso writes
.snow/log/trellis-context.txtfor pull-based agent reads.Session identity
active_task.pynow knows platformsnowSNOW_SESSION_IDsnowTRELLIS_CONTEXT_IDwhen presentReview hardening (latest tip)
upstream/main(resolved prior conflicts).snow/sub-agents.trellis.jsonUsage
Expected behavior:
#trellis-implement/ project agents are schedulableSNOW_SESSION_ID+TRELLIS_CONTEXT_ID=snow-<id>Tests
Notes / compatibility
trellis-startis filtered for Snow (hasHooks=true).snow/project assets are intentionally not tracked in this repositoryTest plan
trellis init --snowwrites skills/commands/agents/hooks/SNOW.mdtrellis-startskill/command for Snowsession/user/subagentpresentactive_taskresolvesSNOW_SESSION_IDtrellis init --snowin a clean project and open Snow session#trellis-implement/ beforeSubAgentStart injecttask.py current/startworks under Snow-injected env without manualTRELLIS_CONTEXT_IDSummary by CodeRabbit
--snow) support to initialization and platform configuration..snow/skills, commands, agents, hooks, andSNOW.md.