@mindfoldhq/trellis 0.6.0-beta.9 → 0.6.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.
- package/README.md +49 -49
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/channel/adapters/claude.d.ts +29 -0
- package/dist/commands/channel/adapters/claude.d.ts.map +1 -0
- package/dist/commands/channel/adapters/claude.js +203 -0
- package/dist/commands/channel/adapters/claude.js.map +1 -0
- package/dist/commands/channel/adapters/codex.d.ts +85 -0
- package/dist/commands/channel/adapters/codex.d.ts.map +1 -0
- package/dist/commands/channel/adapters/codex.js +505 -0
- package/dist/commands/channel/adapters/codex.js.map +1 -0
- package/dist/commands/channel/adapters/index.d.ts +84 -0
- package/dist/commands/channel/adapters/index.d.ts.map +1 -0
- package/dist/commands/channel/adapters/index.js +115 -0
- package/dist/commands/channel/adapters/index.js.map +1 -0
- package/dist/commands/channel/adapters/types.d.ts +33 -0
- package/dist/commands/channel/adapters/types.d.ts.map +1 -0
- package/dist/commands/channel/adapters/types.js +2 -0
- package/dist/commands/channel/adapters/types.js.map +1 -0
- package/dist/commands/channel/agent-loader.d.ts +32 -0
- package/dist/commands/channel/agent-loader.d.ts.map +1 -0
- package/dist/commands/channel/agent-loader.js +154 -0
- package/dist/commands/channel/agent-loader.js.map +1 -0
- package/dist/commands/channel/context-loader.d.ts +26 -0
- package/dist/commands/channel/context-loader.d.ts.map +1 -0
- package/dist/commands/channel/context-loader.js +290 -0
- package/dist/commands/channel/context-loader.js.map +1 -0
- package/dist/commands/channel/context.d.ts +16 -0
- package/dist/commands/channel/context.d.ts.map +1 -0
- package/dist/commands/channel/context.js +83 -0
- package/dist/commands/channel/context.js.map +1 -0
- package/dist/commands/channel/create.d.ts +27 -0
- package/dist/commands/channel/create.d.ts.map +1 -0
- package/dist/commands/channel/create.js +39 -0
- package/dist/commands/channel/create.js.map +1 -0
- package/dist/commands/channel/dev-parse-trace.d.ts +14 -0
- package/dist/commands/channel/dev-parse-trace.d.ts.map +1 -0
- package/dist/commands/channel/dev-parse-trace.js +70 -0
- package/dist/commands/channel/dev-parse-trace.js.map +1 -0
- package/dist/commands/channel/guard.d.ts +150 -0
- package/dist/commands/channel/guard.d.ts.map +1 -0
- package/dist/commands/channel/guard.js +474 -0
- package/dist/commands/channel/guard.js.map +1 -0
- package/dist/commands/channel/index.d.ts +3 -0
- package/dist/commands/channel/index.d.ts.map +1 -0
- package/dist/commands/channel/index.js +531 -0
- package/dist/commands/channel/index.js.map +1 -0
- package/dist/commands/channel/interrupt.d.ts +10 -0
- package/dist/commands/channel/interrupt.d.ts.map +1 -0
- package/dist/commands/channel/interrupt.js +22 -0
- package/dist/commands/channel/interrupt.js.map +1 -0
- package/dist/commands/channel/kill.d.ts +7 -0
- package/dist/commands/channel/kill.d.ts.map +1 -0
- package/dist/commands/channel/kill.js +121 -0
- package/dist/commands/channel/kill.js.map +1 -0
- package/dist/commands/channel/list.d.ts +17 -0
- package/dist/commands/channel/list.d.ts.map +1 -0
- package/dist/commands/channel/list.js +233 -0
- package/dist/commands/channel/list.js.map +1 -0
- package/dist/commands/channel/messages.d.ts +15 -0
- package/dist/commands/channel/messages.d.ts.map +1 -0
- package/dist/commands/channel/messages.js +245 -0
- package/dist/commands/channel/messages.js.map +1 -0
- package/dist/commands/channel/rm.d.ts +27 -0
- package/dist/commands/channel/rm.d.ts.map +1 -0
- package/dist/commands/channel/rm.js +216 -0
- package/dist/commands/channel/rm.js.map +1 -0
- package/dist/commands/channel/run.d.ts +30 -0
- package/dist/commands/channel/run.d.ts.map +1 -0
- package/dist/commands/channel/run.js +130 -0
- package/dist/commands/channel/run.js.map +1 -0
- package/dist/commands/channel/send.d.ts +11 -0
- package/dist/commands/channel/send.d.ts.map +1 -0
- package/dist/commands/channel/send.js +24 -0
- package/dist/commands/channel/send.js.map +1 -0
- package/dist/commands/channel/spawn.d.ts +40 -0
- package/dist/commands/channel/spawn.d.ts.map +1 -0
- package/dist/commands/channel/spawn.js +244 -0
- package/dist/commands/channel/spawn.js.map +1 -0
- package/dist/commands/channel/store/events.d.ts +39 -0
- package/dist/commands/channel/store/events.d.ts.map +1 -0
- package/dist/commands/channel/store/events.js +87 -0
- package/dist/commands/channel/store/events.js.map +1 -0
- package/dist/commands/channel/store/filter.d.ts +3 -0
- package/dist/commands/channel/store/filter.d.ts.map +1 -0
- package/dist/commands/channel/store/filter.js +2 -0
- package/dist/commands/channel/store/filter.js.map +1 -0
- package/dist/commands/channel/store/lock.d.ts +23 -0
- package/dist/commands/channel/store/lock.d.ts.map +1 -0
- package/dist/commands/channel/store/lock.js +99 -0
- package/dist/commands/channel/store/lock.js.map +1 -0
- package/dist/commands/channel/store/paths.d.ts +63 -0
- package/dist/commands/channel/store/paths.d.ts.map +1 -0
- package/dist/commands/channel/store/paths.js +246 -0
- package/dist/commands/channel/store/paths.js.map +1 -0
- package/dist/commands/channel/store/schema.d.ts +27 -0
- package/dist/commands/channel/store/schema.d.ts.map +1 -0
- package/dist/commands/channel/store/schema.js +34 -0
- package/dist/commands/channel/store/schema.js.map +1 -0
- package/dist/commands/channel/store/thread-state.d.ts +5 -0
- package/dist/commands/channel/store/thread-state.d.ts.map +1 -0
- package/dist/commands/channel/store/thread-state.js +16 -0
- package/dist/commands/channel/store/thread-state.js.map +1 -0
- package/dist/commands/channel/store/watch.d.ts +19 -0
- package/dist/commands/channel/store/watch.d.ts.map +1 -0
- package/dist/commands/channel/store/watch.js +146 -0
- package/dist/commands/channel/store/watch.js.map +1 -0
- package/dist/commands/channel/supervisor/idle.d.ts +46 -0
- package/dist/commands/channel/supervisor/idle.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/idle.js +72 -0
- package/dist/commands/channel/supervisor/idle.js.map +1 -0
- package/dist/commands/channel/supervisor/inbox.d.ts +30 -0
- package/dist/commands/channel/supervisor/inbox.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/inbox.js +160 -0
- package/dist/commands/channel/supervisor/inbox.js.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts +68 -0
- package/dist/commands/channel/supervisor/shutdown.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/shutdown.js +146 -0
- package/dist/commands/channel/supervisor/shutdown.js.map +1 -0
- package/dist/commands/channel/supervisor/stdout.d.ts +51 -0
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/stdout.js +121 -0
- package/dist/commands/channel/supervisor/stdout.js.map +1 -0
- package/dist/commands/channel/supervisor/turns.d.ts +31 -0
- package/dist/commands/channel/supervisor/turns.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/turns.js +45 -0
- package/dist/commands/channel/supervisor/turns.js.map +1 -0
- package/dist/commands/channel/supervisor/warning.d.ts +48 -0
- package/dist/commands/channel/supervisor/warning.d.ts.map +1 -0
- package/dist/commands/channel/supervisor/warning.js +77 -0
- package/dist/commands/channel/supervisor/warning.js.map +1 -0
- package/dist/commands/channel/supervisor.d.ts +59 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -0
- package/dist/commands/channel/supervisor.js +344 -0
- package/dist/commands/channel/supervisor.js.map +1 -0
- package/dist/commands/channel/text-body.d.ts +13 -0
- package/dist/commands/channel/text-body.d.ts.map +1 -0
- package/dist/commands/channel/text-body.js +47 -0
- package/dist/commands/channel/text-body.js.map +1 -0
- package/dist/commands/channel/threads.d.ts +39 -0
- package/dist/commands/channel/threads.d.ts.map +1 -0
- package/dist/commands/channel/threads.js +106 -0
- package/dist/commands/channel/threads.js.map +1 -0
- package/dist/commands/channel/title.d.ts +12 -0
- package/dist/commands/channel/title.d.ts.map +1 -0
- package/dist/commands/channel/title.js +24 -0
- package/dist/commands/channel/title.js.map +1 -0
- package/dist/commands/channel/wait.d.ts +17 -0
- package/dist/commands/channel/wait.d.ts.map +1 -0
- package/dist/commands/channel/wait.js +75 -0
- package/dist/commands/channel/wait.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +162 -43
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mem.d.ts +13 -217
- package/dist/commands/mem.d.ts.map +1 -1
- package/dist/commands/mem.js +142 -1587
- package/dist/commands/mem.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +28 -2
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +102 -5
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts +35 -0
- package/dist/commands/workflow.d.ts.map +1 -0
- package/dist/commands/workflow.js +232 -0
- package/dist/commands/workflow.js.map +1 -0
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +1 -0
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +5 -0
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/reasonix.d.ts +23 -0
- package/dist/configurators/reasonix.d.ts.map +1 -0
- package/dist/configurators/reasonix.js +60 -0
- package/dist/configurators/reasonix.js.map +1 -0
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +8 -0
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/workflow.d.ts +8 -0
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +14 -3
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +4 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +4 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.5.14.json +9 -0
- package/dist/migrations/manifests/0.5.15.json +9 -0
- package/dist/migrations/manifests/0.5.16.json +9 -0
- package/dist/migrations/manifests/0.5.17.json +9 -0
- package/dist/migrations/manifests/0.5.18.json +9 -0
- package/dist/migrations/manifests/0.5.19.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
- package/dist/migrations/manifests/0.6.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.20.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.21.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.22.json +9 -0
- package/dist/migrations/manifests/0.6.0-beta.23.json +88 -0
- package/dist/migrations/manifests/0.6.0-rc.0.json +9 -0
- package/dist/migrations/manifests/0.6.0.json +1 -0
- package/dist/templates/claude/agents/trellis-check.md +12 -6
- package/dist/templates/claude/agents/trellis-implement.md +1 -1
- package/dist/templates/claude/agents/trellis-research.md +1 -1
- package/dist/templates/codebuddy/agents/trellis-check.md +12 -6
- package/dist/templates/codebuddy/agents/trellis-implement.md +1 -1
- package/dist/templates/codebuddy/agents/trellis-research.md +1 -1
- package/dist/templates/codex/agents/trellis-check.toml +0 -25
- package/dist/templates/codex/agents/trellis-implement.toml +0 -25
- package/dist/templates/codex/config.toml +9 -16
- package/dist/templates/codex/hooks/session-start.py +22 -0
- package/dist/templates/codex/hooks.json +1 -1
- package/dist/templates/common/bundled-skills/trellis-channel/SKILL.md +67 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/command-reference.md +480 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/forum.md +233 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/progress-debugging.md +226 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/workers.md +276 -0
- package/dist/templates/common/bundled-skills/trellis-channel/references/workflows.md +128 -0
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +46 -34
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +47 -3
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +146 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/multi-agent-channel.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +27 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +11 -1
- package/dist/templates/common/bundled-skills/trellis-session-insight/SKILL.md +81 -0
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/cli-quick-reference.md +66 -0
- package/dist/templates/common/bundled-skills/trellis-session-insight/references/triggering-patterns.md +93 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/SKILL.md +41 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/mcp-setup.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/repository-analysis.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-task-planning.md +61 -0
- package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +70 -0
- package/dist/templates/copilot/hooks/session-start.py +24 -0
- package/dist/templates/cursor/agents/trellis-check.md +12 -6
- package/dist/templates/cursor/agents/trellis-implement.md +1 -1
- package/dist/templates/cursor/agents/trellis-research.md +1 -1
- package/dist/templates/cursor/hooks.json +0 -6
- package/dist/templates/droid/droids/trellis-check.md +12 -6
- package/dist/templates/droid/droids/trellis-implement.md +1 -1
- package/dist/templates/droid/droids/trellis-research.md +1 -1
- package/dist/templates/gemini/agents/trellis-check.md +11 -5
- package/dist/templates/kiro/agents/trellis-check.json +1 -1
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md.txt +127 -9
- package/dist/templates/markdown/spec/guides/cross-layer-thinking-guide.md.txt +130 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +38 -0
- package/dist/templates/markdown/spec/guides/index.md.txt +18 -0
- package/dist/templates/opencode/agents/trellis-check.md +11 -5
- package/dist/templates/pi/agents/trellis-check.md +5 -4
- package/dist/templates/pi/agents/trellis-implement.md +5 -4
- package/dist/templates/pi/extensions/trellis/index.ts.txt +1339 -913
- package/dist/templates/pi/settings.json +0 -9
- package/dist/templates/qoder/agents/trellis-check.md +12 -6
- package/dist/templates/qoder/agents/trellis-implement.md +1 -1
- package/dist/templates/qoder/agents/trellis-research.md +1 -1
- package/dist/templates/reasonix/agents/trellis-check.md +36 -0
- package/dist/templates/reasonix/agents/trellis-implement.md +41 -0
- package/dist/templates/reasonix/index.d.ts +13 -0
- package/dist/templates/reasonix/index.d.ts.map +1 -0
- package/dist/templates/reasonix/index.js +16 -0
- package/dist/templates/reasonix/index.js.map +1 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +0 -1
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-workflow-state.py +22 -0
- package/dist/templates/shared-hooks/session-start.py +25 -8
- package/dist/templates/trellis/agents/check.md +70 -0
- package/dist/templates/trellis/agents/implement.md +71 -0
- package/dist/templates/trellis/config.yaml +20 -0
- package/dist/templates/trellis/index.d.ts +13 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +22 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/safe_commit.py +49 -19
- package/dist/templates/trellis/scripts/common/task_store.py +94 -16
- package/dist/templates/trellis/workflow.md +21 -0
- package/dist/types/ai-tools.d.ts +4 -4
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +16 -0
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/agent-refs.d.ts +31 -0
- package/dist/utils/agent-refs.d.ts.map +1 -0
- package/dist/utils/agent-refs.js +63 -0
- package/dist/utils/agent-refs.js.map +1 -0
- package/dist/utils/cwd-guard.d.ts +38 -0
- package/dist/utils/cwd-guard.d.ts.map +1 -0
- package/dist/utils/cwd-guard.js +62 -0
- package/dist/utils/cwd-guard.js.map +1 -0
- package/dist/utils/file-writer.d.ts +13 -0
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +59 -1
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/manifest-prune.d.ts +61 -0
- package/dist/utils/manifest-prune.d.ts.map +1 -0
- package/dist/utils/manifest-prune.js +136 -0
- package/dist/utils/manifest-prune.js.map +1 -0
- package/dist/utils/registry-config.d.ts +7 -0
- package/dist/utils/registry-config.d.ts.map +1 -0
- package/dist/utils/registry-config.js +171 -0
- package/dist/utils/registry-config.js.map +1 -0
- package/dist/utils/task-json.d.ts +9 -42
- package/dist/utils/task-json.d.ts.map +1 -1
- package/dist/utils/task-json.js +8 -45
- package/dist/utils/task-json.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +11 -0
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +51 -2
- package/dist/utils/template-fetcher.js.map +1 -1
- package/dist/utils/template-hash.d.ts +32 -6
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +53 -31
- package/dist/utils/template-hash.js.map +1 -1
- package/dist/utils/workflow-resolver.d.ts +86 -0
- package/dist/utils/workflow-resolver.d.ts.map +1 -0
- package/dist/utils/workflow-resolver.js +265 -0
- package/dist/utils/workflow-resolver.js.map +1 -0
- package/package.json +9 -8
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Bundled Skills
|
|
2
|
+
|
|
3
|
+
"Bundled skills" are multi-file built-in skills shipped inside the Trellis CLI npm package. Unlike marketplace skills (which a user installs separately into their own `.claude/skills/` or other platform skill root), bundled skills are written automatically into every supported platform's skill root by `trellis init` and kept in sync by `trellis update`. They are part of Trellis itself, not third-party content.
|
|
4
|
+
|
|
5
|
+
A bundled skill is a directory under `packages/cli/src/templates/common/bundled-skills/<skill>/` that already contains its own `SKILL.md` (with YAML frontmatter) plus optional `references/`, assets, or other supporting files. Trellis copies the whole directory tree as-is into each platform's skill root, so references stay lazy-loadable instead of being flattened into one oversized `SKILL.md`.
|
|
6
|
+
|
|
7
|
+
## What Counts As Bundled (vs. Adjacent Concepts)
|
|
8
|
+
|
|
9
|
+
| Source path | Type | How it ships |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `templates/common/bundled-skills/<name>/` | Bundled skill (multi-file) | Whole directory copied to every platform skill root |
|
|
12
|
+
| `templates/common/skills/<name>.md` | Single-file workflow skill | Wrapped with frontmatter, written as `<root>/<name>/SKILL.md` |
|
|
13
|
+
| `templates/common/commands/<name>.md` | Slash command / prompt | Written to each platform's command directory (`.claude/commands/trellis/`, `.cursor/commands/trellis-*.md`, `.gemini/commands/trellis/*.toml`, etc.) |
|
|
14
|
+
| `templates/<platform>/skills/` | Platform-specific skill | Written only into that platform's directory (e.g. `.codex/skills/`) |
|
|
15
|
+
| User skills under `.claude/skills/<my-skill>/` etc. | Marketplace or user-authored | Not managed by Trellis at all |
|
|
16
|
+
|
|
17
|
+
The Trellis CLI never touches anything that is not produced by one of its own template loaders. Anything a user drops into a platform skill root by hand is left alone.
|
|
18
|
+
|
|
19
|
+
## Current Bundled Skills (v0.6.0)
|
|
20
|
+
|
|
21
|
+
The set is discovered at runtime by listing directories under `templates/common/bundled-skills/`:
|
|
22
|
+
|
|
23
|
+
| Skill | Purpose |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| `trellis-meta` | This skill. Explains the local Trellis architecture and customization entry points to an AI working inside a user project. |
|
|
26
|
+
| `trellis-session-insight` | Wraps the `trellis mem` CLI so an AI knows when and how to reach into past Claude Code / Codex conversation logs. |
|
|
27
|
+
| `trellis-spec-bootstrap` | Platform-neutral workflow for creating or refreshing `.trellis/spec/` from the real codebase (with optional GitNexus / ABCoder integration). |
|
|
28
|
+
| `trellis-channel` | Capability skill teaching an AI when to reach for `trellis channel` for multi-agent collaboration, forum/thread persistent boards, and dispatcher-wait patterns. |
|
|
29
|
+
|
|
30
|
+
The list is discovered at runtime, so adding a new directory under `bundled-skills/` is the only step required to register a new skill (see "Adding a New Bundled Skill" below).
|
|
31
|
+
|
|
32
|
+
## Where Bundled Skills Land Per Platform
|
|
33
|
+
|
|
34
|
+
Each platform configurator calls `writeSkills(<root>, <workflowSkills>, resolveBundledSkills(ctx))` during `trellis init`. `resolveBundledSkills` reads every directory under `templates/common/bundled-skills/`, resolves placeholders, and returns a flat list of `{relativePath, content}` entries. `writeSkills` then mirrors them under the platform's skill root.
|
|
35
|
+
|
|
36
|
+
| Platform | Bundled skill root | Notes |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Claude Code | `.claude/skills/<skill>/` | `configureClaude` |
|
|
39
|
+
| Cursor | `.cursor/skills/<skill>/` | `configureCursor` |
|
|
40
|
+
| Codex | `.agents/skills/<skill>/` | `configureCodex` writes the shared `.agents/skills/` root, which Gemini CLI 0.40+ also reads |
|
|
41
|
+
| Gemini CLI | `.agents/skills/<skill>/` | Same shared root as Codex; the two configurators are required to produce byte-identical output |
|
|
42
|
+
| Kiro | `.kiro/skills/<skill>/` | `configureKiro` (skills-based platform — no commands) |
|
|
43
|
+
| Qoder | `.qoder/skills/<skill>/` | `configureQoder` |
|
|
44
|
+
| Codebuddy | `.codebuddy/skills/<skill>/` | `configureCodebuddy` |
|
|
45
|
+
| Copilot | `.github/skills/<skill>/` | `configureCopilot` |
|
|
46
|
+
| Droid | `.factory/skills/<skill>/` | `configureDroid` |
|
|
47
|
+
| Antigravity | `.agent/skills/<skill>/` | `configureAntigravity` |
|
|
48
|
+
| Windsurf | `.windsurf/skills/<skill>/` | `configureWindsurf` |
|
|
49
|
+
| Kilo | `.kilocode/skills/<skill>/` | `configureKilo` |
|
|
50
|
+
| OpenCode | (handled by `collectOpenCodeTemplates`) | Uses the same `resolveBundledSkills(ctx)` output |
|
|
51
|
+
| Pi, Reasonix | (their own collectors) | Same `resolveBundledSkills(ctx)` output |
|
|
52
|
+
|
|
53
|
+
Two paths exercise the same data:
|
|
54
|
+
|
|
55
|
+
1. `configureX(cwd)` writes files during `trellis init`.
|
|
56
|
+
2. `collectPlatformTemplates(platformId)` (in `configurators/index.ts`) returns a `Map<filePath, content>` that `trellis update` uses to detect drift and to populate `.trellis/.template-hashes.json`. Both must produce byte-identical output, so they both call `resolveBundledSkills(ctx)` and `collectSkillTemplates(root, …, resolveBundledSkills(ctx))`.
|
|
57
|
+
|
|
58
|
+
## Dispatch Wiring (Code Path)
|
|
59
|
+
|
|
60
|
+
The mechanism that auto-dispatches bundled skills to platform skill roots lives in two files:
|
|
61
|
+
|
|
62
|
+
1. `packages/cli/src/templates/common/index.ts`
|
|
63
|
+
- `listDirectories("bundled-skills")` enumerates the on-disk skills.
|
|
64
|
+
- `listBundledSkillFiles(skillDir)` walks each skill's directory recursively and returns `{relativePath, content}` for every file.
|
|
65
|
+
- `getBundledSkillTemplates()` returns the cached `CommonBundledSkill[]`.
|
|
66
|
+
|
|
67
|
+
2. `packages/cli/src/configurators/shared.ts`
|
|
68
|
+
- `resolveBundledSkills(ctx)` flattens that list into `ResolvedSkillFile[]` with `<skill>/<relativePath>` paths and resolved placeholders.
|
|
69
|
+
- `writeSkills(skillsRoot, workflowSkills, bundledSkills)` writes both workflow skills and bundled skill files under `skillsRoot`.
|
|
70
|
+
- `collectSkillTemplates(skillsRoot, workflowSkills, bundledSkills)` returns the same shape as a `Map<filePath, content>` for the update / hash pipeline.
|
|
71
|
+
|
|
72
|
+
Every platform configurator that supports skills imports both helpers (see `claude.ts`, `cursor.ts`, `codex.ts`, `gemini.ts`, `kiro.ts`, `qoder.ts`, `codebuddy.ts`, `copilot.ts`, `droid.ts`, `antigravity.ts`, `windsurf.ts`, `kilo.ts`). The `index.ts` `PLATFORM_FUNCTIONS` registry also calls `resolveBundledSkills(ctx)` inside each `collectTemplates` closure so `trellis update` tracking stays consistent.
|
|
73
|
+
|
|
74
|
+
## Adding a New Bundled Skill
|
|
75
|
+
|
|
76
|
+
The shape and dispatch wiring are already generic, so adding a skill requires only file changes plus distribution verification.
|
|
77
|
+
|
|
78
|
+
1. **Create the directory tree.**
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
packages/cli/src/templates/common/bundled-skills/<my-skill>/
|
|
82
|
+
SKILL.md # YAML frontmatter + body
|
|
83
|
+
references/ # optional
|
|
84
|
+
<topic>.md
|
|
85
|
+
assets/ # optional (anything readable as utf-8)
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
2. **Write a valid `SKILL.md` header.** The frontmatter must include at minimum:
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
---
|
|
92
|
+
name: <my-skill>
|
|
93
|
+
description: "When the AI should reach for this skill. Triggering phrases go here."
|
|
94
|
+
---
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
The `description` is what each platform's auto-trigger mechanism matches against, so it should describe the user-intent triggers, not the skill's internals.
|
|
98
|
+
|
|
99
|
+
3. **Use placeholders where appropriate.** Bundled skill content runs through `resolvePlaceholders(file.content, ctx)`. Any `{{platform_name}}`, `{{python_cmd}}`, etc. token supported by `resolvePlaceholders` will be substituted per platform.
|
|
100
|
+
|
|
101
|
+
4. **No dispatch wiring is required.** `listDirectories("bundled-skills")` discovers the new directory automatically, so all platforms receive it on the next `trellis init` or `trellis update`.
|
|
102
|
+
|
|
103
|
+
5. **Verify the distribution path** before shipping. Skipping any of these steps has historically caused features to be documented as bundled while the published npm tarball was missing the files:
|
|
104
|
+
|
|
105
|
+
- Source files exist on the branch being tagged.
|
|
106
|
+
- `pnpm --filter @mindfoldhq/trellis build` copies the asset into `dist/templates/common/bundled-skills/<skill>/`.
|
|
107
|
+
- `npm pack --dry-run --json` includes the expected `dist/**` paths.
|
|
108
|
+
- In a fresh temp project, `trellis init` writes `.claude/skills/<skill>/SKILL.md`, `.agents/skills/<skill>/SKILL.md`, etc.
|
|
109
|
+
- `.trellis/.template-hashes.json` lists the generated files.
|
|
110
|
+
- `trellis update --dry-run` in that temp project reports "Already up to date!".
|
|
111
|
+
|
|
112
|
+
6. **Add a migration manifest entry** if the skill is added in a release that other projects will upgrade into. Without an explicit manifest entry the file will land via the standard "missing file" branch of `trellis update`, but a manifest makes the change visible in the changelog.
|
|
113
|
+
|
|
114
|
+
## Overriding a Bundled Skill Locally
|
|
115
|
+
|
|
116
|
+
There is no formal "project-local skill" mechanism (e.g. `.trellis/skills/`). Bundled skills are platform-rooted, so any override is platform-rooted too.
|
|
117
|
+
|
|
118
|
+
The supported pattern relies on the existing template-hash diff in `trellis update`:
|
|
119
|
+
|
|
120
|
+
1. Edit the local file directly. Example: `.claude/skills/trellis-meta/SKILL.md`.
|
|
121
|
+
2. The file's hash now diverges from the entry in `.trellis/.template-hashes.json`.
|
|
122
|
+
3. The next `trellis update` detects the user modification and leaves the file untouched (Trellis never overwrites user-modified files without an explicit `--force`).
|
|
123
|
+
|
|
124
|
+
Caveats:
|
|
125
|
+
|
|
126
|
+
- The override only applies to the one platform whose directory you edited. To override the same skill across, for example, Claude Code and Codex, you must edit both `.claude/skills/<name>/` and `.agents/skills/<name>/`.
|
|
127
|
+
- A future `trellis update --force` will overwrite local edits. Keep the override under version control so it can be reapplied if needed.
|
|
128
|
+
- Marketplace skills installed under the same platform skill root with a different folder name (e.g. `.claude/skills/my-custom-meta/`) are untouched by Trellis and are the cleaner option when the goal is to add behavior, not to mutate the bundled skill.
|
|
129
|
+
- Team-private conventions belong in `.trellis/spec/` or in a separate marketplace-style local skill, not in modifications to `trellis-meta` itself. See `customize-local/add-project-local-conventions.md`.
|
|
130
|
+
|
|
131
|
+
## Removing a Bundled Skill From a Project
|
|
132
|
+
|
|
133
|
+
There is no per-project opt-out flag for bundled skills. Two options:
|
|
134
|
+
|
|
135
|
+
1. **Delete the directory in each platform skill root.** `trellis update` will see the file missing, compare against `.template-hashes.json`, and treat the deletion the same as any other user modification — it will not silently re-create the directory unless `--force` is passed.
|
|
136
|
+
|
|
137
|
+
2. **Pin a Trellis version that did not ship the skill.** The bundled-skill set is determined at build time, so installing an older release of the CLI is the only way to permanently exclude a skill that the current release ships.
|
|
138
|
+
|
|
139
|
+
A third option — globally disabling all bundled skills — is not supported. The dispatch is unconditional in every configurator. Adding such a flag would require changing `PLATFORM_FUNCTIONS` in `configurators/index.ts` and every `configureX` function.
|
|
140
|
+
|
|
141
|
+
## Operating Rules
|
|
142
|
+
|
|
143
|
+
- Treat `templates/common/bundled-skills/` as the single source of truth for what bundled skills exist. Do not hand-maintain platform-by-platform skill lists.
|
|
144
|
+
- Do not add platform-specific logic inside a bundled `SKILL.md`. If a behavior is platform-specific, put it in `templates/<platform>/skills/` instead.
|
|
145
|
+
- Do not couple bundled skills to a specific CLI binary (e.g. `trellis mem`) without surfacing the dependency in the skill's description and references — users on older releases may not have the command.
|
|
146
|
+
- Do not store project-private content in a bundled skill. Bundled skills are public, shipped to every user; project rules belong in `.trellis/spec/` or a local skill.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Local Multi-Agent Channel Runtime
|
|
2
|
+
|
|
3
|
+
`trellis channel` is the local multi-agent collaboration runtime shipped with the Trellis CLI. It lets the main AI session spawn peer workers (Claude Code, Codex, or any agent definition under `.trellis/agents/`), exchange durable messages through an event log, and coordinate review or brainstorm loops without hand-stitching shell pipelines.
|
|
4
|
+
|
|
5
|
+
This reference covers how channels are wired into the user project so an AI customizing the project knows what to edit. For runtime usage (commands, forum/thread patterns, worker spawn flags), defer to the bundled `trellis-channel` capability skill.
|
|
6
|
+
|
|
7
|
+
## Local System Model
|
|
8
|
+
|
|
9
|
+
The channel runtime spans three local surfaces:
|
|
10
|
+
|
|
11
|
+
1. **Storage layer** in the user's home directory: durable event logs and worker state files.
|
|
12
|
+
2. **Agent definitions** inside the project at `.trellis/agents/`: platform-agnostic role cards consumed by `trellis channel spawn --agent <name>`.
|
|
13
|
+
3. **Project configuration** in `.trellis/config.yaml`: worker guard thresholds and other channel knobs.
|
|
14
|
+
|
|
15
|
+
## Core Paths
|
|
16
|
+
|
|
17
|
+
| Path | Purpose |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `~/.trellis/channels/<project>/<channel>/events.jsonl` | Per-channel append-only event log. Sequence-locked, replay-safe. |
|
|
20
|
+
| `~/.trellis/channels/<project>/<channel>/<channel>.lock` | Channel-level write lock. |
|
|
21
|
+
| `~/.trellis/channels/<project>/<channel>/<worker>.spawnlock` | Per-worker spawn lock used by the OOM guard. |
|
|
22
|
+
| `~/.trellis/channels/<project>/<channel>/.seq` | Sequence sidecar for ordered event assignment. |
|
|
23
|
+
| `~/.trellis/channels/_global/<channel>/...` | Channels created with `--scope global`. The project bucket is replaced by a shared key. |
|
|
24
|
+
| `.trellis/agents/check.md` | Default Check Agent role definition consumed by `--agent check`. |
|
|
25
|
+
| `.trellis/agents/implement.md` | Default Implement Agent role definition consumed by `--agent implement`. |
|
|
26
|
+
| `.trellis/config.yaml` (`channel.*` block) | Worker guard thresholds and channel defaults. |
|
|
27
|
+
|
|
28
|
+
The project bucket name is derived from the absolute project path (slashes flattened, non-alphanumerics replaced with `-`), matching Claude Code's `~/.claude/projects/<sanitized-cwd>/` convention. Override with `TRELLIS_CHANNEL_ROOT` (root directory) or `TRELLIS_CHANNEL_PROJECT` (bucket name) for testing or sandboxing.
|
|
29
|
+
|
|
30
|
+
## When To Reach For The Channel Runtime
|
|
31
|
+
|
|
32
|
+
Channels are heavier than a single Bash call or a one-shot sub-agent dispatch. Use them only when at least one of these conditions holds:
|
|
33
|
+
|
|
34
|
+
- The work needs **two or more agents to converse** through more than one turn (cross-AI brainstorm, peer review, dispatcher + worker).
|
|
35
|
+
- A worker should run as a **peer process** that the main session can interrupt, watch progress on, or wait for asynchronously.
|
|
36
|
+
- The conversation must be **durable and inspectable** later (forum/thread channels, issue boards, decision trails).
|
|
37
|
+
- Multiple workers must **share an event log** so each can see what the others reported.
|
|
38
|
+
|
|
39
|
+
Prefer cheaper primitives when:
|
|
40
|
+
|
|
41
|
+
- A single-shot Bash command or single Agent tool call is enough -> do that directly.
|
|
42
|
+
- The user just needs a static review against a file -> read the file and reply inline.
|
|
43
|
+
- The need is "remember what we discussed last week" -> use `trellis mem` instead of a channel.
|
|
44
|
+
|
|
45
|
+
## Customization Points
|
|
46
|
+
|
|
47
|
+
| Need | Edit location |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| Change default channel worker idle timeout | `channel.worker_guard.idle_timeout` in `.trellis/config.yaml`. Accepts `5m`, `30s`, etc. Set `0` to disable idle cleanup. |
|
|
50
|
+
| Change live worker budget | `channel.worker_guard.max_live_workers` in `.trellis/config.yaml`. Set `0` to disable the spawn-time budget check. |
|
|
51
|
+
| Override worker guard per spawn | Pass `--idle-timeout` / `--max-live-workers` on `trellis channel spawn`, or set `TRELLIS_CHANNEL_WORKER_IDLE_TIMEOUT` / `TRELLIS_CHANNEL_MAX_LIVE_WORKERS` in the environment. |
|
|
52
|
+
| Change what the default Check or Implement worker does | Edit `.trellis/agents/check.md` or `.trellis/agents/implement.md`. These are platform-agnostic role cards; the channel runtime injects them when `--agent check|implement` is passed. |
|
|
53
|
+
| Add a new role card | Drop `<name>.md` into `.trellis/agents/`. `trellis channel spawn --agent <name>` will pick it up. |
|
|
54
|
+
| Relocate channel storage (CI sandbox, ephemeral runs) | Set `TRELLIS_CHANNEL_ROOT=/path/to/dir`. Channel events move with it; existing channels stay at the old root. |
|
|
55
|
+
| Switch storage scope | Pass `--scope project` (default) or `--scope global` on every channel subcommand. The bucket directory changes; nothing else does. |
|
|
56
|
+
|
|
57
|
+
Precedence for the worker guard is: CLI flag > environment variable > `.trellis/config.yaml` > built-in default. Built-in defaults are `idle_timeout: 5m` and `max_live_workers: 6`.
|
|
58
|
+
|
|
59
|
+
## Relationship To Other Local Layers
|
|
60
|
+
|
|
61
|
+
- **Workflow layer**: workflows that use channel dispatch (such as `channel-driven-subagent-dispatch`) instruct the main agent to call `trellis channel spawn --agent check` or `--agent implement` instead of a platform sub-agent. If `.trellis/agents/check.md` or `implement.md` is missing, `trellis workflow --template <id>` prints a non-blocking warning at install time. Restore them with `trellis update` if they are deleted by accident.
|
|
62
|
+
- **Task layer**: channel workers do not own task state. The supervising main session passes the active task path through the worker inbox; the worker resolves task artifacts from disk.
|
|
63
|
+
- **Spec layer**: workers read `.trellis/spec/` the same way the main session does. Channel runtime does not bypass spec context loading.
|
|
64
|
+
- **Platform integration layer**: channel runtime is platform-neutral. It does not depend on `.claude/`, `.codex/`, or any other platform directory. The adapters that normalize provider output (Claude `stream-json`, Codex `app-server`) live inside the Trellis CLI binary, not in the project.
|
|
65
|
+
- **Platform sub-agent files vs. channel workers**: editing `.claude/agents/trellis-implement.md` (and its peers in other platform `.X/agents/` directories) does NOT change channel-runtime worker behavior — channel workers load `.trellis/agents/<name>.md`. The platform-specific agent files are for direct sub-agent dispatch from the main AI session, not for channel-spawned workers. See `platform-files/agents.md` for the per-platform agent surface, and the `trellis-meta/SKILL.md` rule that codifies this split.
|
|
66
|
+
|
|
67
|
+
## Runtime Usage
|
|
68
|
+
|
|
69
|
+
For command syntax, forum/thread patterns, worker handles, progress inspection, and the `--kind done` / `--kind turn_finished` dispatcher wait pattern, load the bundled `trellis-channel` skill (auto-installed under each platform's skills directory after `trellis init` / `trellis update`). This reference only covers the local file layout and customization knobs; it does not duplicate command syntax that may change between releases.
|
|
@@ -44,6 +44,33 @@ The Trellis task system is stored entirely under `.trellis/tasks/` in the user p
|
|
|
44
44
|
| `commit` / `pr_url` | Commit and PR information after completion. |
|
|
45
45
|
| `meta` | Extension fields. |
|
|
46
46
|
|
|
47
|
+
## Parent / Child Task Trees
|
|
48
|
+
|
|
49
|
+
Parent/child task relationships are for work structure. A parent task groups related deliverables under one source requirement set; it is not a dependency scheduler and does not replace the child task's own planning artifacts.
|
|
50
|
+
|
|
51
|
+
Use a parent task when a request has multiple independently verifiable deliverables. The parent owns:
|
|
52
|
+
|
|
53
|
+
- Source requirements and user-facing scope.
|
|
54
|
+
- The map of child tasks and their responsibility boundaries.
|
|
55
|
+
- Cross-child acceptance criteria and final integration review.
|
|
56
|
+
|
|
57
|
+
Use child tasks for deliverables that can move through planning, implementation, check, and archive independently. If one child depends on another, write that dependency in the child `prd.md` / `implement.md`; do not rely on tree position to imply ordering.
|
|
58
|
+
|
|
59
|
+
Create new children with:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
python3 ./.trellis/scripts/task.py create "<child title>" --slug <child-slug> --parent <parent-dir>
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Link or unlink existing tasks with:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
python3 ./.trellis/scripts/task.py add-subtask <parent-dir> <child-dir>
|
|
69
|
+
python3 ./.trellis/scripts/task.py remove-subtask <parent-dir> <child-dir>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`children` on the parent is a historical list. When a child is archived, Trellis keeps that child name in the parent so progress like `[2/3 done]` remains meaningful after completed children move to `archive/`.
|
|
73
|
+
|
|
47
74
|
The AI should not treat phase numbers as task status. Task progress is mainly determined by `status`, artifact presence (`prd.md`, optional `design.md` / `implement.md`), whether JSONL context is configured for sub-agent mode, and the phase descriptions in `workflow.md`.
|
|
48
75
|
|
|
49
76
|
## Active Task
|
package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
CHANGED
|
@@ -19,7 +19,8 @@ This page lists common Trellis file locations in a user project by platform. Whe
|
|
|
19
19
|
| CodeBuddy | `--codebuddy` | `.codebuddy/` | `.codebuddy/skills/` | `.codebuddy/agents/` | `.codebuddy/hooks/` + `.codebuddy/settings.json` |
|
|
20
20
|
| GitHub Copilot | `--copilot` | `.github/` | `.github/skills/` | `.github/agents/` | `.github/copilot/hooks/` + prompts |
|
|
21
21
|
| Factory Droid | `--droid` | `.factory/` | `.factory/skills/` | `.factory/droids/` | `.factory/hooks/` + settings |
|
|
22
|
-
| Pi Agent | `--pi` | `.pi/` | `.pi/skills/` | `.pi/agents/` | `.pi/extensions/trellis/` + `.pi/settings.json` |
|
|
22
|
+
| Pi Agent | `--pi` | `.pi/` | `.pi/skills/` | `.pi/agents/` | `.pi/extensions/trellis/` (native `trellis_subagent` tool) + `.pi/settings.json` |
|
|
23
|
+
| Reasonix | `--reasonix` | `.reasonix/` | `.reasonix/skills/` | None — sub-agents are skills with `runAs: subagent` frontmatter | None |
|
|
23
24
|
|
|
24
25
|
## Capability Groups
|
|
25
26
|
|
|
@@ -38,9 +39,18 @@ These platforms usually have `trellis-research`, `trellis-implement`, and `trell
|
|
|
38
39
|
- GitHub Copilot
|
|
39
40
|
- Factory Droid
|
|
40
41
|
- Pi Agent
|
|
42
|
+
- Reasonix (delivered as skills with `runAs: subagent` under `.reasonix/skills/`, not as a separate `agents/` directory)
|
|
41
43
|
|
|
42
44
|
When changing implementation/check/research behavior, look for the corresponding platform agent files first.
|
|
43
45
|
|
|
46
|
+
### Native Trellis Sub-Agent Tool
|
|
47
|
+
|
|
48
|
+
Some platforms expose a first-class tool that the host runtime understands. The model calls it like any other tool and the host renders progress cards, validates the agent name against `.<platform>/agents/`, and enforces dispatch modes.
|
|
49
|
+
|
|
50
|
+
- Pi Agent — `trellis_subagent` tool, defined in `.pi/extensions/trellis/index.ts`. Supports `single` / `parallel` / `chain` dispatch modes and emits live `trellis-subagent-progress` events.
|
|
51
|
+
|
|
52
|
+
When changing sub-agent dispatch behavior on these platforms, edit the extension file, **not** the agent markdown — the agent markdown defines responsibilities, but the host extension owns dispatch, validation, and progress rendering.
|
|
53
|
+
|
|
44
54
|
### Main-Session Workflow Platforms
|
|
45
55
|
|
|
46
56
|
These platforms rely more on workflows/skills to guide the main session:
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-session-insight
|
|
3
|
+
description: "Reach into past AI conversation history through the `trellis mem` CLI. Use whenever the user asks 'how did we solve X last time', 'have we discussed this before', 'what was the decision on X', 'remind me what we did in this task', '上次怎么解的', '之前讨论过吗', '想起一段对话', or when starting a brainstorm that overlaps prior work, debugging a familiar bug, continuing a task across sessions, or doing a finish-work review. Returns raw past dialogue; decide for the moment whether to update spec, append to task notes, quote inline in the answer, or just internalize."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Trellis Session Insight
|
|
7
|
+
|
|
8
|
+
This skill teaches an AI **how to call `trellis mem`** — the project's cross-session memory feedstock — and **when reaching for it is the right move**.
|
|
9
|
+
|
|
10
|
+
It is intentionally a **capability skill, not a workflow**. There is no fixed output file, no required write-back step, no "always run after finish-work" rule. What to do with what `mem` returns is a judgement call made in the moment of the conversation. The skill exists so the AI knows the capability is there and can decide.
|
|
11
|
+
|
|
12
|
+
## What `trellis mem` is
|
|
13
|
+
|
|
14
|
+
A local CLI that indexes the user's past Claude Code and Codex conversation logs (the JSONL files each platform stores under `~/.claude/projects/` and `~/.codex/sessions/`) and lets you list, search, slice by Trellis task boundaries, and dump cleaned dialogue from them. OpenCode logs are not yet indexable (provider adapter pending) — when an OpenCode session is the obvious target, surface that limitation rather than guessing.
|
|
15
|
+
|
|
16
|
+
Nothing in `mem` is uploaded. All reads are local.
|
|
17
|
+
|
|
18
|
+
## When to reach for it
|
|
19
|
+
|
|
20
|
+
The bar is "would a senior teammate ask 'didn't we already talk about this?'" — those are the moments. Some concrete patterns:
|
|
21
|
+
|
|
22
|
+
- **Brainstorm rerun risk.** Starting a new task that touches an area the user has been in before, and you want to check whether a decision was already made — before re-asking the user.
|
|
23
|
+
- **Familiar-bug debugging.** The current bug pattern feels like one the user reported / fixed before. Pulling the relevant past session can save a full debugging loop.
|
|
24
|
+
- **Cross-session continuation.** The user resumes work after a gap and says "where were we" / "继续上次的" without being specific.
|
|
25
|
+
- **Decision retrieval.** The user references "the decision we made about X" but the decision lives in an old brainstorm, not in any `prd.md` / `spec/`.
|
|
26
|
+
- **Finish-work retrospective.** When the user explicitly asks for a wrap-up of what was decided / what hurt / what surprised them in this task — not as a forced step on every finish-work.
|
|
27
|
+
- **Pattern-spotting across past work.** The user asks "do I keep making the same mistake on X" / "我每次都踩这个坑吗" — search across sessions answers that.
|
|
28
|
+
|
|
29
|
+
If none of these apply, don't call `mem`. It is a tool, not a ceremony.
|
|
30
|
+
|
|
31
|
+
## When NOT to reach for it
|
|
32
|
+
|
|
33
|
+
- The relevant context is already in the current turn, `prd.md`, `design.md`, recent `git log`, or the open files. `mem` is for stuff that has fallen out of immediate reach.
|
|
34
|
+
- The user is asking about a fact in the code, not a fact from a past conversation. `git log -p` / `grep` / reading the file directly is faster and more authoritative.
|
|
35
|
+
- You are in a sub-agent (`trellis-implement` / `trellis-check`) whose dispatch prompt already includes the curated `implement.jsonl` / `check.jsonl` context. Adding `mem` on top usually just clutters.
|
|
36
|
+
- The user has explicitly said "don't dig through history, just answer what I asked".
|
|
37
|
+
|
|
38
|
+
## What to do with what `mem` returns
|
|
39
|
+
|
|
40
|
+
Treat the output as **raw material**, not a deliverable. Once you have it, decide based on the live conversation:
|
|
41
|
+
|
|
42
|
+
- **Quote inline in your reply** if a specific past exchange answers the user's current question — and cite the session-id / phase so the user can verify.
|
|
43
|
+
- **Update `<task>/prd.md` or `<task>/design.md`** if `mem` surfaced a load-bearing decision that should have been written down but wasn't. Surface the proposed edit to the user first.
|
|
44
|
+
- **Append to a task-local notes file** (e.g. `<task>/notes.md` or extending an existing one) if the finding belongs to the current task's record but doesn't fit the PRD.
|
|
45
|
+
- **Update `.trellis/spec/`** if the finding is a project-wide convention or gotcha that would help future tasks. Run the `trellis-update-spec` skill for that — `session-insight` ends at the discovery.
|
|
46
|
+
- **Just absorb it** for the next few turns and answer better, without writing anything. This is often the right move for one-off recall.
|
|
47
|
+
|
|
48
|
+
Trellis does not prescribe a single destination. Forcing every recall into a fixed file makes the file grow into noise. Let the situation decide.
|
|
49
|
+
|
|
50
|
+
## How to call it
|
|
51
|
+
|
|
52
|
+
Full CLI reference is in `references/cli-quick-reference.md`. The 80% case is one of:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
# Find sessions whose contents mention a keyword (project-scope is default;
|
|
56
|
+
# add --global to search every project on this machine).
|
|
57
|
+
trellis mem search "<keyword>"
|
|
58
|
+
|
|
59
|
+
# Dump dialogue from one session, optionally filtered by phase or keyword.
|
|
60
|
+
trellis mem extract <session-id> --phase brainstorm
|
|
61
|
+
trellis mem extract <session-id> --grep "<keyword>"
|
|
62
|
+
|
|
63
|
+
# Drill into a session: top-N hit turns + surrounding context.
|
|
64
|
+
trellis mem context <session-id> --turns 3 --around 2
|
|
65
|
+
|
|
66
|
+
# When you do not know the session id yet, start with list + filter.
|
|
67
|
+
trellis mem list --task <task-dir>
|
|
68
|
+
trellis mem projects # → list active project cwds, then narrow
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Phase slicing (`--phase brainstorm|implement|all`) cuts the session at `task.py create` and `task.py start` boundaries. For a finish-work review of the current task, `--phase brainstorm` recovers the planning discussion and `--phase implement` recovers the execution loop. Default is `all`.
|
|
72
|
+
|
|
73
|
+
## Triggering patterns
|
|
74
|
+
|
|
75
|
+
`references/triggering-patterns.md` lists more verbatim user phrasings (English + Chinese) that should make you think "reach for `mem`" — keep that handy when training instinct.
|
|
76
|
+
|
|
77
|
+
## Out of scope
|
|
78
|
+
|
|
79
|
+
- `mem` does not edit code or update files. Any write-back is your decision in the moment.
|
|
80
|
+
- `mem` is read-only on the platform JSONL stores. It does not push or sync to remote.
|
|
81
|
+
- This skill does not replace `trellis-update-spec` (which is the right tool for promoting a finding into project-wide guidance) or the platform-native task / spec workflow.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# `trellis mem` CLI Reference
|
|
2
|
+
|
|
3
|
+
Full flag reference for the five subcommands. Pin this as the authoritative source — `trellis mem help` prints the same content at runtime, so anything here that drifts is a bug.
|
|
4
|
+
|
|
5
|
+
## Subcommands
|
|
6
|
+
|
|
7
|
+
| Command | Purpose |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `list` | List sessions. Default subcommand when none is given. |
|
|
10
|
+
| `search <keyword>` | Find sessions whose contents match a keyword. |
|
|
11
|
+
| `context <session-id>` | Drill into one session: top-N hit turns + surrounding context. Pair with `--grep` for keyword anchoring. |
|
|
12
|
+
| `extract <session-id>` | Dump cleaned dialogue. Combine with `--phase` / `--grep` to slice. |
|
|
13
|
+
| `projects` | List active project `cwd` values with session counts. Use this to discover which `--cwd` to pass to other subcommands. |
|
|
14
|
+
|
|
15
|
+
## Flags (apply where meaningful)
|
|
16
|
+
|
|
17
|
+
| Flag | Subcommands | Meaning |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `--platform claude\|codex\|opencode\|all` | all | Default `all`. OpenCode adapter is currently a stub on `0.6.0-beta.*` — see "Caveats" below. |
|
|
20
|
+
| `--since YYYY-MM-DD` | list / search | Inclusive lower date bound. |
|
|
21
|
+
| `--until YYYY-MM-DD` | list / search | Inclusive upper date bound. |
|
|
22
|
+
| `--global` | list / search | Include sessions from every project on this machine. Default is the current project `cwd`. |
|
|
23
|
+
| `--cwd <path>` | list / search | Force a specific project cwd instead of inferring from where you are. |
|
|
24
|
+
| `--limit N` | list / search | Cap output rows. Default `50`. |
|
|
25
|
+
| `--grep KW` | extract / context | Filter turns by keyword. Multi-token AND when whitespace-separated. |
|
|
26
|
+
| `--phase brainstorm\|implement\|all` | extract | Slice session by Trellis task boundaries. `brainstorm` = `[task.py create, task.py start)`. `implement` = `[task.py start, task.py finish)` window. Default `all`. |
|
|
27
|
+
| `--turns N` | context | Number of hit turns to return. Default `3`. |
|
|
28
|
+
| `--around N` | context | Surrounding turns to include per hit. Default `1`. |
|
|
29
|
+
| `--max-chars N` | context | Total character budget. Default `6000` (~1500 tokens). |
|
|
30
|
+
| `--include-children` | search / context | Merge OpenCode sub-agent sessions into their parent session. |
|
|
31
|
+
| `--json` | all | Emit machine-parseable JSON instead of human-readable output. |
|
|
32
|
+
| `--task <task-dir>` | list | Narrow to sessions whose context-key resolved to a given task directory (uses `.trellis/.runtime/sessions/*.json`). |
|
|
33
|
+
|
|
34
|
+
## Common one-liners
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# What past sessions discussed "deadlock" anywhere on this machine?
|
|
38
|
+
trellis mem search "deadlock" --global --limit 20
|
|
39
|
+
|
|
40
|
+
# Inside a specific session, surface the top 5 turns that mention "lock contention"
|
|
41
|
+
# plus 2 turns of surrounding context.
|
|
42
|
+
trellis mem context 5842592d --grep "lock contention" --turns 5 --around 2
|
|
43
|
+
|
|
44
|
+
# Recover the brainstorm window for a session — useful when continuing a task
|
|
45
|
+
# the user started a week ago.
|
|
46
|
+
trellis mem extract 5842592d --phase brainstorm
|
|
47
|
+
|
|
48
|
+
# List every project this machine has Trellis sessions for, with counts.
|
|
49
|
+
trellis mem projects
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Output shapes
|
|
53
|
+
|
|
54
|
+
- **Default human output** (no `--json`): wrapped to a terminal, with session ids highlighted and turn markers visible. Suitable to read inline but messy to paste into a markdown file.
|
|
55
|
+
- **`--json`**: stable schema, safe to parse and process. When piping `mem` output into a follow-up step (e.g. summarizing for a Lessons section), prefer `--json`.
|
|
56
|
+
|
|
57
|
+
## Caveats
|
|
58
|
+
|
|
59
|
+
- **OpenCode adapter is a stub on `0.6.0-beta.*`.** When `--platform` resolves to OpenCode (or `all` and OpenCode would be included), `mem` prints a one-line "reader unavailable" notice and continues with the other platforms. Don't promise OpenCode coverage in your reply until the adapter ships.
|
|
60
|
+
- **`--phase` slicing depends on `task.py create` / `task.py start` invocations appearing in the recorded bash calls of the session.** Sessions where the user ran `task.py` from a different terminal — outside the recorded AI loop — will not have phase boundaries. `--phase all` is the safe fallback.
|
|
61
|
+
- **`mem` indexes platform JSONL files directly.** If the user has cleared their Claude / Codex session storage, `mem` cannot recover what is no longer on disk.
|
|
62
|
+
- **`mem` is read-only.** No remote sync, no edits to platform JSONL. Any write you do based on `mem` findings is your own follow-up call into the editing tools available to you.
|
|
63
|
+
|
|
64
|
+
## When you need more than this reference
|
|
65
|
+
|
|
66
|
+
Run `trellis mem help` in the user's shell. The runtime help is authoritative and will be ahead of this reference during fast-moving beta releases.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Triggering Patterns
|
|
2
|
+
|
|
3
|
+
Verbatim user phrasings that should make an AI reach for `trellis mem`. Calibrate instinct against these — if a user message hits one of these patterns and you do not reach for `mem`, you probably missed an obvious recall.
|
|
4
|
+
|
|
5
|
+
Patterns are grouped by the *intent* behind the phrasing, not the surface words. The same intent shows up in different languages and registers.
|
|
6
|
+
|
|
7
|
+
## Past-solution recall
|
|
8
|
+
|
|
9
|
+
The user is asking "how did we (or I) solve this before". Past dialogue holds the answer; the codebase shows the result but not the reasoning.
|
|
10
|
+
|
|
11
|
+
- "How did we solve this last time?"
|
|
12
|
+
- "What did we end up doing about X?"
|
|
13
|
+
- "We dealt with this once already, didn't we?"
|
|
14
|
+
- "上次怎么解的?"
|
|
15
|
+
- "之前是怎么搞定 X 的?"
|
|
16
|
+
- "我记得以前修过类似的"
|
|
17
|
+
|
|
18
|
+
Reach: `trellis mem search "<symptom keyword>" --global --limit 10`, then `context` into the hit that looks closest.
|
|
19
|
+
|
|
20
|
+
## Decision retrieval
|
|
21
|
+
|
|
22
|
+
The user is referencing a decision that lives in old dialogue, not in any committed file. Look in brainstorm windows.
|
|
23
|
+
|
|
24
|
+
- "What was the decision on X?"
|
|
25
|
+
- "Did we decide to use Postgres or SQLite?"
|
|
26
|
+
- "The rationale for choosing X over Y was…?"
|
|
27
|
+
- "我们当时为啥选了 X 而不是 Y?"
|
|
28
|
+
- "关于 X 我们之前是怎么定的?"
|
|
29
|
+
- "之前讨论过 X 的方案吗?"
|
|
30
|
+
|
|
31
|
+
Reach: `trellis mem search "<decision keyword>"` to find the session, then `extract <id> --phase brainstorm` to recover the discussion.
|
|
32
|
+
|
|
33
|
+
## Cross-session continuation
|
|
34
|
+
|
|
35
|
+
The user resumed work after a gap and the context is implicit.
|
|
36
|
+
|
|
37
|
+
- "Where were we?"
|
|
38
|
+
- "Continue from last time."
|
|
39
|
+
- "Pick up where we left off."
|
|
40
|
+
- "继续上次的"
|
|
41
|
+
- "我们上次做到哪了"
|
|
42
|
+
- "接着昨天那个任务"
|
|
43
|
+
|
|
44
|
+
Reach: `trellis mem list --task <current-task-dir>` to find the most recent sessions tied to the active task, then `extract` the last one.
|
|
45
|
+
|
|
46
|
+
## Familiar-bug debugging
|
|
47
|
+
|
|
48
|
+
The current bug feels like one already seen. Past sessions probably hold the resolution path.
|
|
49
|
+
|
|
50
|
+
- "I feel like I've hit this before."
|
|
51
|
+
- "Doesn't this look like that bug from last month?"
|
|
52
|
+
- "Same kind of timeout I had in X."
|
|
53
|
+
- "这个错好像之前见过"
|
|
54
|
+
- "这个 bug 是不是上次那个?"
|
|
55
|
+
- "怎么又是这个 error?"
|
|
56
|
+
|
|
57
|
+
Reach: `trellis mem search "<error message fragment>" --global`. Anchor on a short, distinctive token from the actual error string.
|
|
58
|
+
|
|
59
|
+
## Self-pattern spotting
|
|
60
|
+
|
|
61
|
+
The user is asking whether they keep repeating the same kind of mistake or decision.
|
|
62
|
+
|
|
63
|
+
- "Do I always make this mistake?"
|
|
64
|
+
- "How often have I run into X?"
|
|
65
|
+
- "Is this a recurring thing for me?"
|
|
66
|
+
- "我每次都踩这个坑吗?"
|
|
67
|
+
- "我老犯这个错?"
|
|
68
|
+
- "这类问题之前出现过几次?"
|
|
69
|
+
|
|
70
|
+
Reach: `trellis mem search "<topic>" --global --limit 50` and scan the dates / projects in the listing. Optionally `extract` two or three for comparison.
|
|
71
|
+
|
|
72
|
+
## Finish-work retrospective (on demand)
|
|
73
|
+
|
|
74
|
+
The user explicitly wants to look back at this task — not as a forced step, only when they ask.
|
|
75
|
+
|
|
76
|
+
- "Summarize what we did in this task."
|
|
77
|
+
- "What were the key decisions / surprises?"
|
|
78
|
+
- "Write up the lessons from this round."
|
|
79
|
+
- "总结一下这次的经验"
|
|
80
|
+
- "记一下这次踩的坑"
|
|
81
|
+
- "复盘下这个任务"
|
|
82
|
+
|
|
83
|
+
Reach: identify the current task's session id (from `.trellis/.runtime/sessions/*.json` or `mem list --task <task-dir>`), then `extract <id> --phase brainstorm` and `--phase implement`. Present a summary — surface concrete file:line citations where possible. Whether to also write the summary somewhere (PRD, spec, notes file) is the user's call; offer, don't auto-write.
|
|
84
|
+
|
|
85
|
+
## Anti-patterns: do NOT reach for `mem` here
|
|
86
|
+
|
|
87
|
+
- "What does this function do?" → read the file.
|
|
88
|
+
- "Why is this test failing?" → read the test output and the file.
|
|
89
|
+
- "What's the right pattern for X in our codebase?" → grep / read spec files.
|
|
90
|
+
- "What's the latest npm version of Y?" → call `npm view`.
|
|
91
|
+
- "Fix this bug." → debug. Reach for `mem` only if you suspect prior context exists; otherwise it is noise.
|
|
92
|
+
|
|
93
|
+
The bar stays: would a senior teammate ask "didn't we already talk about this?" before answering? If yes, reach for `mem`. If no, don't.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-spec-bootstrap
|
|
3
|
+
description: "Bootstrap project-specific Trellis coding specs with a platform-neutral single-agent workflow. Use when creating or refreshing .trellis/spec guidelines, analyzing a codebase with GitNexus, ABCoder, or source inspection, decomposing package/layer spec work, and writing real codebase-backed spec docs without placeholder text."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Trellis Spec Bootstrap
|
|
7
|
+
|
|
8
|
+
Use this skill to create or refresh `.trellis/spec/` guidelines from the real codebase. One capable agent owns the full loop: analyze the repository, choose the spec boundaries, write the docs, and verify the result. The workflow does not depend on a specific host, CLI, or agent brand.
|
|
9
|
+
|
|
10
|
+
## Workflow
|
|
11
|
+
|
|
12
|
+
1. Confirm Trellis is initialized and inspect the current `.trellis/spec/` tree.
|
|
13
|
+
2. Analyze the repository architecture with the best available tools: GitNexus, ABCoder, language tooling, and direct source reads.
|
|
14
|
+
3. Decompose the spec work by package and layer only when that reflects the actual codebase.
|
|
15
|
+
4. Fill or reshape the spec files with concrete patterns, file paths, examples, and anti-patterns from the project.
|
|
16
|
+
5. Verify that the final specs are internally consistent and contain no template placeholders.
|
|
17
|
+
|
|
18
|
+
## Reference Routing
|
|
19
|
+
|
|
20
|
+
| Need | Read |
|
|
21
|
+
|------|------|
|
|
22
|
+
| Repository architecture analysis | [references/repository-analysis.md](references/repository-analysis.md) |
|
|
23
|
+
| Spec work decomposition and task planning | [references/spec-task-planning.md](references/spec-task-planning.md) |
|
|
24
|
+
| Writing high-signal Trellis spec files | [references/spec-writing.md](references/spec-writing.md) |
|
|
25
|
+
| GitNexus and ABCoder MCP setup | [references/mcp-setup.md](references/mcp-setup.md) |
|
|
26
|
+
|
|
27
|
+
## Operating Rules
|
|
28
|
+
|
|
29
|
+
- Treat templates as starting points, not contracts. Delete, rename, split, or add spec files when the repository calls for it.
|
|
30
|
+
- Prefer source-backed rules over generic advice. Every important recommendation should point at a real file or repeated local pattern.
|
|
31
|
+
- Keep execution single-owner by default. Optional helper agents are an implementation detail, not a requirement or user-visible dependency.
|
|
32
|
+
- Do not write platform-specific instructions unless the target project already standardizes on that platform.
|
|
33
|
+
- Do not leave placeholder text, empty headings, or copied boilerplate in `.trellis/spec/`.
|
|
34
|
+
|
|
35
|
+
## Done Criteria
|
|
36
|
+
|
|
37
|
+
- `.trellis/spec/` describes the project as it exists now.
|
|
38
|
+
- Each relevant package or layer has practical coding guidance with real examples.
|
|
39
|
+
- Non-applicable template sections are removed.
|
|
40
|
+
- `index.md` files match the final spec file set.
|
|
41
|
+
- Any required setup or analysis assumptions are documented in the relevant spec or task notes.
|