Skip to content

fix(cli): detect platform installs from Trellis-owned files - #501

Merged
taosu0216 merged 1 commit into
mainfrom
fix/issue-500-platform-detection
Jul 30, 2026
Merged

taosu0216 merged 1 commit into
mainfrom
fix/issue-500-platform-detection

Conversation

@taosu0216

@taosu0216 taosu0216 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Root cause

getConfiguredPlatforms() treated any native platform directory as proof that Trellis had configured that platform. Existing .claude, .codex, or other tool directories therefore caused re-init to skip the requested platform even when its Trellis files had never been generated.

Validation

  • pnpm test
  • pnpm lint
  • pnpm typecheck
  • pnpm build

Fixes #500

Summary by CodeRabbit

  • Bug Fixes

    • Platform detection now recognizes only Trellis-managed templates, avoiding false positives from native platform directories or files.
    • Improved backward compatibility for legacy Windsurf workflow detection.
    • Re-initializing with different platforms now preserves existing native configuration files.
  • Documentation

    • Clarified platform detection rules, template ownership, and expected integration behavior.
  • Tests

    • Expanded coverage for platform detection, Snow, legacy Windsurf workflows, and cross-platform initialization scenarios.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f715b75-be00-44bd-9950-479ea3374205

📥 Commits

Reviewing files that changed from the base of the PR and between e4ed585 and 52298ca.

📒 Files selected for processing (8)
  • .trellis/spec/cli/backend/commands-platforms.md
  • .trellis/spec/cli/backend/commands-update.md
  • .trellis/spec/cli/backend/platform-integration.md
  • packages/cli/src/configurators/index.ts
  • packages/cli/src/types/ai-tools.ts
  • packages/cli/test/commands/init.integration.test.ts
  • packages/cli/test/commands/platforms.integration.test.ts
  • packages/cli/test/configurators/platforms.test.ts

📝 Walkthrough

Walkthrough

Changes

Platform detection

Layer / File(s) Summary
Hash-based detection contract
.trellis/spec/cli/backend/commands-platforms.md, .trellis/spec/cli/backend/commands-update.md, packages/cli/src/configurators/index.ts, packages/cli/src/types/ai-tools.ts
Platform detection now requires Trellis-owned template hashes under each platform’s configured template layout, with legacy Devin workflow compatibility.
Detection and CLI validation
packages/cli/test/configurators/platforms.test.ts, packages/cli/test/commands/platforms.integration.test.ts, .trellis/spec/cli/backend/platform-integration.md
Tests cover tracked templates, ignored native directories, Snow, legacy workflows, and human or JSON platform output.
Re-init behavior validation
packages/cli/test/commands/init.integration.test.ts
Re-initialization preserves native Claude settings while creating Trellis-managed skills only when Claude is explicitly initialized.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant getConfiguredPlatforms
  participant TemplateManifest
  CLI->>getConfiguredPlatforms: request configured platforms
  getConfiguredPlatforms->>TemplateManifest: load tracked template hashes
  TemplateManifest-->>getConfiguredPlatforms: return owned template paths
  getConfiguredPlatforms-->>CLI: return matching platform IDs
Loading

Possibly related PRs

Suggested reviewers: cnhlaia

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states the main change: detecting platform installs from Trellis-owned files.
Linked Issues check ✅ Passed The new detection logic and regression test address #500 by ignoring native .claude/.codex dirs unless Trellis-owned hashes exist.
Out of Scope Changes check ✅ Passed The other code changes support the same platform-detection refactor and added coverage, with no clearly unrelated functionality.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-500-platform-detection

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@taosu0216
taosu0216 merged commit c41c8bd into main Jul 30, 2026
2 checks passed
@Hheihi

Hheihi commented Jul 30, 2026

Copy link
Copy Markdown

thank you

BaSui01 pushed a commit to BaSui01/Trellis that referenced this pull request Aug 5, 2026
Co-authored-by: taosu <taosu@mindfold.ai>
(cherry picked from commit c41c8bd)
Xio-Shark pushed a commit to Xio-Shark/Trellis that referenced this pull request Sep 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

init的时候 如果我项目中已有.cluade/.codex目录 他就会默认配置成功不会生成skill

2 participants