@mindfoldhq/trellis 0.5.0-beta.16 → 0.5.0-beta.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/commands/init.d.ts.map +1 -1
  2. package/dist/commands/init.js +0 -28
  3. package/dist/commands/init.js.map +1 -1
  4. package/dist/configurators/antigravity.d.ts.map +1 -1
  5. package/dist/configurators/antigravity.js +2 -8
  6. package/dist/configurators/antigravity.js.map +1 -1
  7. package/dist/configurators/claude.d.ts.map +1 -1
  8. package/dist/configurators/claude.js +3 -9
  9. package/dist/configurators/claude.js.map +1 -1
  10. package/dist/configurators/codebuddy.d.ts.map +1 -1
  11. package/dist/configurators/codebuddy.js +2 -2
  12. package/dist/configurators/codebuddy.js.map +1 -1
  13. package/dist/configurators/codex.d.ts.map +1 -1
  14. package/dist/configurators/codex.js +2 -7
  15. package/dist/configurators/codex.js.map +1 -1
  16. package/dist/configurators/copilot.d.ts.map +1 -1
  17. package/dist/configurators/copilot.js +2 -9
  18. package/dist/configurators/copilot.js.map +1 -1
  19. package/dist/configurators/cursor.d.ts.map +1 -1
  20. package/dist/configurators/cursor.js +2 -2
  21. package/dist/configurators/cursor.js.map +1 -1
  22. package/dist/configurators/droid.d.ts.map +1 -1
  23. package/dist/configurators/droid.js +2 -2
  24. package/dist/configurators/droid.js.map +1 -1
  25. package/dist/configurators/gemini.d.ts.map +1 -1
  26. package/dist/configurators/gemini.js +2 -2
  27. package/dist/configurators/gemini.js.map +1 -1
  28. package/dist/configurators/index.d.ts.map +1 -1
  29. package/dist/configurators/index.js +13 -11
  30. package/dist/configurators/index.js.map +1 -1
  31. package/dist/configurators/kilo.d.ts.map +1 -1
  32. package/dist/configurators/kilo.js +2 -8
  33. package/dist/configurators/kilo.js.map +1 -1
  34. package/dist/configurators/kiro.d.ts.map +1 -1
  35. package/dist/configurators/kiro.js +2 -2
  36. package/dist/configurators/kiro.js.map +1 -1
  37. package/dist/configurators/opencode.d.ts.map +1 -1
  38. package/dist/configurators/opencode.js +3 -3
  39. package/dist/configurators/opencode.js.map +1 -1
  40. package/dist/configurators/pi.d.ts.map +1 -1
  41. package/dist/configurators/pi.js +9 -4
  42. package/dist/configurators/pi.js.map +1 -1
  43. package/dist/configurators/qoder.d.ts.map +1 -1
  44. package/dist/configurators/qoder.js +2 -2
  45. package/dist/configurators/qoder.js.map +1 -1
  46. package/dist/configurators/shared.d.ts +21 -2
  47. package/dist/configurators/shared.d.ts.map +1 -1
  48. package/dist/configurators/shared.js +32 -3
  49. package/dist/configurators/shared.js.map +1 -1
  50. package/dist/configurators/windsurf.d.ts.map +1 -1
  51. package/dist/configurators/windsurf.js +2 -8
  52. package/dist/configurators/windsurf.js.map +1 -1
  53. package/dist/migrations/manifests/0.5.0-beta.17.json +9 -0
  54. package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
  55. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
  56. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
  57. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +81 -0
  58. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
  59. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +78 -0
  60. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
  61. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +79 -0
  62. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +48 -0
  63. package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
  64. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
  65. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
  66. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
  67. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
  68. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +101 -0
  69. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
  70. package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
  71. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +79 -0
  72. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
  73. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +59 -0
  74. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +74 -0
  75. package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +83 -0
  76. package/dist/templates/common/index.d.ts +22 -2
  77. package/dist/templates/common/index.d.ts.map +1 -1
  78. package/dist/templates/common/index.js +53 -4
  79. package/dist/templates/common/index.js.map +1 -1
  80. package/dist/templates/common/skills/brainstorm.md +3 -0
  81. package/dist/templates/markdown/agents.md +8 -0
  82. package/dist/templates/pi/extensions/trellis/index.ts.txt +499 -51
  83. package/dist/templates/trellis/workflow.md +3 -0
  84. package/package.json +1 -1
@@ -0,0 +1,79 @@
1
+ # Agents
2
+
3
+ Trellis agent files define specialized roles. Common Trellis agents in a user project are:
4
+
5
+ - `trellis-research`
6
+ - `trellis-implement`
7
+ - `trellis-check`
8
+
9
+ File locations and formats differ by platform, but responsibility boundaries should stay consistent.
10
+
11
+ ## Agent Responsibilities
12
+
13
+ | Agent | Responsibility |
14
+ | --- | --- |
15
+ | `trellis-research` | Investigate the question and write findings into the current task's `research/`. |
16
+ | `trellis-implement` | Implement against `prd.md`, `info.md`, `implement.jsonl`, and related spec/research. |
17
+ | `trellis-check` | Review changes, fix discovered issues, and run necessary checks. |
18
+
19
+ Agent files should not become generic chat prompts. They should define input sources, write boundaries, whether code may be changed, and how results are reported.
20
+
21
+ ## Common Paths
22
+
23
+ | Platform | Agent path |
24
+ | --- | --- |
25
+ | Claude Code | `.claude/agents/trellis-*.md` |
26
+ | Cursor | `.cursor/agents/trellis-*.md` |
27
+ | OpenCode | `.opencode/agents/trellis-*.md` |
28
+ | Codex | `.codex/agents/trellis-*.toml` |
29
+ | Kiro | `.kiro/agents/trellis-*.json` |
30
+ | Gemini CLI | `.gemini/agents/trellis-*.md` |
31
+ | Qoder | `.qoder/agents/trellis-*.md` |
32
+ | CodeBuddy | `.codebuddy/agents/trellis-*.md` |
33
+ | Factory Droid | `.factory/droids/trellis-*.md` |
34
+ | Pi Agent | `.pi/agents/trellis-*.md` |
35
+
36
+ GitHub Copilot agent/prompt support is provided by a combination of directories such as `.github/agents/`, `.github/prompts/`, and `.github/skills/`; inspect the files actually generated in the user project.
37
+
38
+ Main-session workflow platforms such as Kilo, Antigravity, and Windsurf may not have Trellis sub-agent files. They usually rely on workflows/skills to guide the main session.
39
+
40
+ ## Two Context Loading Modes
41
+
42
+ ### hook push
43
+
44
+ The platform hook injects task context before the agent starts. The agent file itself can focus more on responsibilities and boundaries.
45
+
46
+ Common on platforms that support agent hooks.
47
+
48
+ ### agent pull
49
+
50
+ The agent file instructs the agent to read after startup:
51
+
52
+ - `python3 ./.trellis/scripts/task.py current --source`
53
+ - current task `prd.md`
54
+ - `info.md`
55
+ - `implement.jsonl` or `check.jsonl`
56
+ - spec/research files referenced by JSONL
57
+
58
+ This mode fits platforms whose hooks cannot reliably rewrite sub-agent prompts.
59
+
60
+ ## Local Change Scenarios
61
+
62
+ | User need | Edit location |
63
+ | --- | --- |
64
+ | Implement agent must follow extra restrictions | The platform's `trellis-implement` agent file. |
65
+ | Check agent must run project-specific commands | `trellis-check` agent file, and `.trellis/spec/` if needed. |
66
+ | Research agent must output a fixed format | `trellis-research` agent file. |
67
+ | Agent cannot read task context | Agent prelude or `inject-subagent-context` hook. |
68
+ | Add a project-specific agent | Platform agent directory + related workflow/command/skill entry point. |
69
+
70
+ ## Modification Principles
71
+
72
+ 1. **Keep responsibilities single-purpose**. Do not mix research, implement, and check responsibilities into one agent.
73
+ 2. **Specify the read order**. Agents must know to start from the active task and then find the PRD and JSONL.
74
+ 3. **Specify write boundaries**. Research usually only writes `research/`; implement can write code; check can fix issues.
75
+ 4. **Keep semantics synchronized in multi-platform projects**. If the user configured Claude, Codex, and Cursor together, decide whether changes to one platform's agent also need to be applied to others.
76
+
77
+ ## Do Not Default To Editing Upstream Templates
78
+
79
+ Local AI should default to modifying platform agent files inside the user project. Discuss upstream template source only when the user explicitly wants to contribute the change back to Trellis.
@@ -0,0 +1,69 @@
1
+ # Hooks And Settings
2
+
3
+ Hooks/settings are the entry layer that connects a platform to Trellis. They decide which scripts, plugins, or extensions a platform runs for which events.
4
+
5
+ ## Settings Responsibilities
6
+
7
+ settings/config files usually register:
8
+
9
+ - session-start hook: injects a Trellis overview when a new session starts or context resets.
10
+ - workflow-state hook: injects the next-action hint for the current state on each user input.
11
+ - sub-agent context hook: injects task context when implementation/check/research agents start.
12
+ - shell/session bridge: lets shell commands see the same Trellis session identity.
13
+ - platform plugin or extension entry points.
14
+
15
+ Common files:
16
+
17
+ | Platform | settings/config |
18
+ | --- | --- |
19
+ | Claude Code | `.claude/settings.json` |
20
+ | Cursor | `.cursor/hooks.json` |
21
+ | Codex | `.codex/hooks.json`, `.codex/config.toml` |
22
+ | OpenCode | `.opencode/package.json`, `.opencode/plugins/*` |
23
+ | Kiro | `.kiro/hooks/` + platform config |
24
+ | Gemini CLI | `.gemini/settings.json` |
25
+ | Qoder | `.qoder/settings.json` |
26
+ | CodeBuddy | `.codebuddy/settings.json` |
27
+ | GitHub Copilot | `.github/copilot/hooks.json` |
28
+ | Factory Droid | `.factory/settings.json` |
29
+ | Pi Agent | `.pi/settings.json`, `.pi/extensions/trellis/` |
30
+
31
+ Whether these files exist in a project depends on which `trellis init --<platform>` flags the user ran.
32
+
33
+ ## Hook Script Types
34
+
35
+ | Script | Purpose |
36
+ | --- | --- |
37
+ | `session-start.py` | Generates session-start context. |
38
+ | `inject-workflow-state.py` | Injects the next-action hint based on active task status. |
39
+ | `inject-subagent-context.py` | Injects PRD, JSONL context, and related spec/research into sub-agents. |
40
+ | `inject-shell-session-context.py` | Lets shell commands inherit Trellis session identity. |
41
+
42
+ Not every platform has every hook. Do not copy files from another platform just because a platform lacks a hook; first confirm whether that platform supports the corresponding event.
43
+
44
+ ## Local Change Scenarios
45
+
46
+ | User need | Edit location |
47
+ | --- | --- |
48
+ | AI should see more/less context in a new session | Platform `session-start` hook. |
49
+ | Per-turn hint policy should change | State blocks in `.trellis/workflow.md` + `inject-workflow-state` hook. |
50
+ | Sub-agent cannot read PRD/spec | `inject-subagent-context` hook or agent prelude. |
51
+ | `task.py current` in shell has no active task | Shell/session bridge hook or platform environment variable configuration. |
52
+ | Disable an automatic injection | The corresponding hook registration in settings/config. |
53
+
54
+ ## Modification Principles
55
+
56
+ 1. **Settings wire things up; hooks define behavior**. If only the hook changes, the platform may never call it. If only settings change, behavior may not change.
57
+ 2. **Confirm platform event names first**. Different platforms use different names for SessionStart, UserPromptSubmit, AgentSpawn, shell execution, and similar events.
58
+ 3. **Hooks read local `.trellis/`, not upstream source**. `.trellis/scripts/` and `.trellis/workflow.md` in the user project are the default targets.
59
+ 4. **Errors must be visible**. Hook failures should tell the user what was not injected instead of silently leaving the AI without context.
60
+
61
+ ## Troubleshooting Path
62
+
63
+ If the user says "AI did not read Trellis state":
64
+
65
+ 1. Check whether the platform settings register the hook.
66
+ 2. Check whether the hook file exists.
67
+ 3. Manually run the `.trellis/scripts/get_context.py` or `task.py current --source` command that the hook depends on.
68
+ 4. Check whether active task state exists in `.trellis/.runtime/sessions/`.
69
+ 5. Check whether the platform shell passes session identity.
@@ -0,0 +1,59 @@
1
+ # Platform Files Overview
2
+
3
+ Trellis connects the same local architecture to different AI tools. `.trellis/` stores the shared runtime; platform directories store adapter files that define how each AI tool enters Trellis.
4
+
5
+ When a local AI modifies Trellis, it should distinguish two file categories first:
6
+
7
+ - **Shared files**: `.trellis/workflow.md`, `.trellis/tasks/`, `.trellis/spec/`, `.trellis/scripts/`.
8
+ - **Platform files**: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, and similar directories.
9
+
10
+ Platform files do not store business state. They let the corresponding AI tool read Trellis state, call Trellis scripts, and load Trellis skills/agents/hooks.
11
+
12
+ ## Platform File Categories
13
+
14
+ | Category | Common paths | Purpose |
15
+ | --- | --- | --- |
16
+ | settings/config | `.claude/settings.json`, `.codex/hooks.json`, `.qoder/settings.json` | Register hooks, plugins, extensions, or platform behavior. |
17
+ | hooks/plugins/extensions | `.claude/hooks/`, `.opencode/plugins/`, `.pi/extensions/` | Inject context at session start, user input, agent startup, shell execution, and similar events. |
18
+ | agents | `.claude/agents/`, `.codex/agents/`, `.kiro/agents/` | Define `trellis-research`, `trellis-implement`, and `trellis-check`. |
19
+ | skills | `.claude/skills/`, `.agents/skills/`, `.qoder/skills/` | Capability descriptions that auto-trigger or can be read on demand. |
20
+ | commands/prompts/workflows | `.cursor/commands/`, `.github/prompts/`, `.windsurf/workflows/` | Entry points explicitly invoked by the user. |
21
+
22
+ ## Three Platform Integration Modes
23
+
24
+ ### 1. Hook / Extension Driven
25
+
26
+ These platforms can trigger scripts or plugins on specific events and actively inject Trellis context into AI.
27
+
28
+ Common capabilities:
29
+
30
+ - session-start injection of a `.trellis/` overview.
31
+ - workflow-state hints for each user turn.
32
+ - PRD/spec/research injection when sub-agents start.
33
+ - Shell commands inheriting session identity.
34
+
35
+ To change "when the AI knows what," inspect hooks/plugins/extensions and settings first.
36
+
37
+ ### 2. Agent Prelude / Pull-Based
38
+
39
+ Some platforms cannot reliably let hooks rewrite sub-agent prompts, so the agent file itself instructs the agent to read the active task, PRD, and JSONL context after startup.
40
+
41
+ To change how sub-agents load context, inspect the agent files themselves.
42
+
43
+ ### 3. Main-Session Workflow
44
+
45
+ Some platforms do not have Trellis sub-agent or hook capabilities. They rely on workflows/skills/commands to guide the main-session AI to read files, run scripts, and move tasks forward.
46
+
47
+ To change behavior, inspect platform workflows/skills/commands and `.trellis/workflow.md`.
48
+
49
+ ## Local Modification Order
50
+
51
+ When the user asks to customize behavior for a platform, the AI should inspect files in this order:
52
+
53
+ 1. Read `.trellis/workflow.md` to confirm the shared flow.
54
+ 2. Read the target platform's settings/config to see which hooks/agents/skills/commands are registered.
55
+ 3. Read the target platform's agents/skills/commands/hooks.
56
+ 4. Modify the local file closest to the user's need.
57
+ 5. If the change affects the shared flow, synchronize `.trellis/workflow.md` or `.trellis/spec/`.
58
+
59
+ Do not modify only platform files and forget the shared workflow. Do not modify only `.trellis/workflow.md` and forget that platform entry points may still contain old descriptions.
@@ -0,0 +1,74 @@
1
+ # Platform File Map
2
+
3
+ This page lists common Trellis file locations in a user project by platform. Whether a platform directory exists in an actual project depends on which `trellis init --<platform>` commands the user ran.
4
+
5
+ ## Matrix
6
+
7
+ | Platform | CLI flag | Main directory | Skill directory | Agent directory | Hooks/extensions |
8
+ | --- | --- | --- | --- | --- | --- |
9
+ | Claude Code | `--claude` | `.claude/` | `.claude/skills/` | `.claude/agents/` | `.claude/hooks/` + `.claude/settings.json` |
10
+ | Cursor | `--cursor` | `.cursor/` | `.cursor/skills/` | `.cursor/agents/` | `.cursor/hooks.json` + `.cursor/hooks/` |
11
+ | OpenCode | `--opencode` | `.opencode/` | `.opencode/skills/` | `.opencode/agents/` | `.opencode/plugins/` |
12
+ | Codex | `--codex` | `.codex/` | `.agents/skills/` | `.codex/agents/` | `.codex/hooks/` + `.codex/hooks.json` |
13
+ | Kilo | `--kilo` | `.kilocode/` | `.kilocode/skills/` | Usually none | `.kilocode/workflows/` |
14
+ | Kiro | `--kiro` | `.kiro/` | `.kiro/skills/` | `.kiro/agents/` | `.kiro/hooks/` |
15
+ | Gemini CLI | `--gemini` | `.gemini/` | `.gemini/skills/` | `.gemini/agents/` | `.gemini/settings.json` + `.gemini/hooks/` |
16
+ | Antigravity | `--antigravity` | `.agent/` | `.agent/skills/` | Usually none | `.agent/workflows/` |
17
+ | Windsurf | `--windsurf` | `.windsurf/` | `.windsurf/skills/` | Usually none | `.windsurf/workflows/` |
18
+ | Qoder | `--qoder` | `.qoder/` | `.qoder/skills/` | `.qoder/agents/` | `.qoder/hooks/` + `.qoder/settings.json` |
19
+ | CodeBuddy | `--codebuddy` | `.codebuddy/` | `.codebuddy/skills/` | `.codebuddy/agents/` | `.codebuddy/hooks/` + `.codebuddy/settings.json` |
20
+ | GitHub Copilot | `--copilot` | `.github/` | `.github/skills/` | `.github/agents/` | `.github/copilot/hooks/` + prompts |
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` |
23
+
24
+ ## Capability Groups
25
+
26
+ ### Trellis Sub-Agent Support
27
+
28
+ These platforms usually have `trellis-research`, `trellis-implement`, and `trellis-check` files:
29
+
30
+ - Claude Code
31
+ - Cursor
32
+ - OpenCode
33
+ - Codex
34
+ - Kiro
35
+ - Gemini CLI
36
+ - Qoder
37
+ - CodeBuddy
38
+ - GitHub Copilot
39
+ - Factory Droid
40
+ - Pi Agent
41
+
42
+ When changing implementation/check/research behavior, look for the corresponding platform agent files first.
43
+
44
+ ### Main-Session Workflow Platforms
45
+
46
+ These platforms rely more on workflows/skills to guide the main session:
47
+
48
+ - Kilo
49
+ - Antigravity
50
+ - Windsurf
51
+
52
+ When changing behavior, inspect workflows and skills first. Do not assume Trellis sub-agents exist.
53
+
54
+ ### Shared `.agents/skills/`
55
+
56
+ Codex writes the shared `.agents/skills/` layer. Some tools that support agentskills.io can also read this directory. If the user wants multiple compatible tools to share one skill, consider `.agents/skills/` first, but do not assume every platform reads it.
57
+
58
+ ## Decision Rules When Modifying Platform Files
59
+
60
+ 1. User specified a platform: modify only that platform directory unless shared workflow/spec files must also change.
61
+ 2. User says "all platforms should do this": synchronize equivalent entry points platform by platform; do not modify only one directory.
62
+ 3. User only says "my AI": inspect the configuration directories that actually exist in the project and infer the current AI platform.
63
+ 4. User wants project rules: prefer `.trellis/spec/` or a project-local skill.
64
+ 5. User wants Trellis behavior: edit `.trellis/workflow.md` plus platform hooks/agents/skills/commands.
65
+
66
+ ## When Paths Differ
67
+
68
+ Platform ecosystems change, and user projects may already be customized. If this table disagrees with local files, use the actual settings/config in the user project as authoritative:
69
+
70
+ - Check the hook that settings registers.
71
+ - Check the script that a command/prompt/workflow points to.
72
+ - Judge behavior by the read rules currently written in the agent file.
73
+
74
+ Do not delete a custom file just because it is not listed in this path table.
@@ -0,0 +1,83 @@
1
+ # Skills, Commands, Prompts, And Workflows
2
+
3
+ Skills and commands are textual entry points for user interaction with Trellis. Different platforms use different names, but their core purpose is the same: tell the AI how to enter the Trellis flow when the user expresses a certain intent.
4
+
5
+ ## Conceptual Differences
6
+
7
+ | Type | Trigger mode | Best for |
8
+ | --- | --- | --- |
9
+ | skill | AI auto-match or explicit user mention | Long-term capabilities, workflow rules, modification guides. |
10
+ | command | Explicit user invocation | Clear operation entry points such as continue and finish-work. |
11
+ | prompt | Explicit user invocation or platform selection | Similar to command, but in a platform prompt format. |
12
+ | workflow | Explicit user selection or platform auto-match | Guides the main session when no sub-agent/hook exists. |
13
+
14
+ Trellis workflow skills usually share one semantic set: brainstorm, before-dev, check, update-spec, break-loop. Multi-file built-in skills such as `trellis-meta` use layered references.
15
+
16
+ ## Common Paths
17
+
18
+ | Platform | Common entries |
19
+ | --- | --- |
20
+ | Claude Code | `.claude/skills/`, `.claude/commands/` |
21
+ | Cursor | `.cursor/skills/`, `.cursor/commands/` |
22
+ | OpenCode | `.opencode/skills/`, `.opencode/commands/` |
23
+ | Codex | `.agents/skills/`, `.codex/skills/` |
24
+ | Kilo | `.kilocode/skills/`, `.kilocode/workflows/` |
25
+ | Kiro | `.kiro/skills/` |
26
+ | Gemini CLI | `.gemini/skills/`, `.gemini/commands/` |
27
+ | Antigravity | `.agent/skills/`, `.agent/workflows/` |
28
+ | Windsurf | `.windsurf/skills/`, `.windsurf/workflows/` |
29
+ | Qoder | `.qoder/skills/`, `.qoder/commands/` |
30
+ | CodeBuddy | `.codebuddy/skills/`, `.codebuddy/commands/` |
31
+ | GitHub Copilot | `.github/skills/`, `.github/prompts/` |
32
+ | Factory Droid | `.factory/skills/`, `.factory/commands/` |
33
+ | Pi Agent | `.pi/skills/` |
34
+
35
+ In a user project, use the files actually generated by init as authoritative.
36
+
37
+ ## Skill Structure
38
+
39
+ A common skill is a directory:
40
+
41
+ ```text
42
+ trellis-meta/
43
+ ├── SKILL.md
44
+ └── references/
45
+ ```
46
+
47
+ `SKILL.md` should tell the AI:
48
+
49
+ - When to use this skill.
50
+ - Which reference to read first for the current task.
51
+ - What not to do.
52
+
53
+ References hold longer explanations so the entry file does not contain everything.
54
+
55
+ ## Command/Prompt/Workflow Structure
56
+
57
+ Commands, prompts, and workflows are usually single files. Their content should include:
58
+
59
+ - When to use it.
60
+ - Which `.trellis/` files to read.
61
+ - Which scripts to run.
62
+ - How to report after completion.
63
+
64
+ They should not store task state; task state belongs in `.trellis/tasks/` and `.trellis/.runtime/`.
65
+
66
+ ## Local Change Scenarios
67
+
68
+ | User need | Edit location |
69
+ | --- | --- |
70
+ | Change AI auto-trigger rules | The corresponding skill's frontmatter description. |
71
+ | Change user command behavior | The corresponding command/prompt/workflow file. |
72
+ | Add a project-local skill | Platform skill directory, or shared `.agents/skills/`. |
73
+ | Let multiple platforms share one capability | Write equivalent skills in each platform skill directory, or use the `.agents/skills/` shared layer on platforms that support it. |
74
+ | Change finish/continue entry points | Platform commands/prompts/workflows. |
75
+
76
+ ## Modification Principles
77
+
78
+ 1. **Keep entry files short; references carry long content**. This matters especially for multi-file skills like `trellis-meta`.
79
+ 2. **Make trigger descriptions specific**. A description that is too broad can mis-trigger; one that is too narrow may not trigger.
80
+ 3. **Keep the same semantics consistent across platforms**. File formats can differ, but behavior descriptions should match.
81
+ 4. **Put project-specific capabilities in local skills**. Do not put team-private flows into public `trellis-meta`.
82
+
83
+ If the user only wants local AI to know one more project rule, usually create a project-local skill or update `.trellis/spec/` instead of changing a Trellis built-in workflow skill.
@@ -6,8 +6,9 @@
6
6
  *
7
7
  * Directory structure:
8
8
  * common/
9
- * ├── commands/ # Templates that stay as slash commands (start, finish-work)
10
- * └── skills/ # Templates that become auto-triggered skills
9
+ * ├── commands/ # Templates that stay as slash commands
10
+ * ├── skills/ # Single-file templates that become auto-triggered skills
11
+ * └── bundled-skills/ # Multi-file built-in skills with references/assets
11
12
  */
12
13
  export interface CommonTemplate {
13
14
  /** Template name without extension (e.g., "start", "before-dev") */
@@ -15,6 +16,18 @@ export interface CommonTemplate {
15
16
  /** Raw content with {{placeholders}} — must be resolved before writing */
16
17
  content: string;
17
18
  }
19
+ export interface CommonBundledSkillFile {
20
+ /** POSIX path relative to the skill directory, e.g. "references/core.md" */
21
+ relativePath: string;
22
+ /** Raw content with {{placeholders}} — must be resolved before writing */
23
+ content: string;
24
+ }
25
+ export interface CommonBundledSkill {
26
+ /** Skill directory name, e.g. "trellis-meta" */
27
+ name: string;
28
+ /** Files that must be written under the skill directory */
29
+ files: CommonBundledSkillFile[];
30
+ }
18
31
  /**
19
32
  * Get all command templates (stay as slash commands on all platforms).
20
33
  * Results are cached after first call.
@@ -25,4 +38,11 @@ export declare function getCommandTemplates(): CommonTemplate[];
25
38
  * Results are cached after first call.
26
39
  */
27
40
  export declare function getSkillTemplates(): CommonTemplate[];
41
+ /**
42
+ * Get all multi-file built-in skills.
43
+ *
44
+ * These are copied as complete skill directories so references and assets stay
45
+ * lazy-loadable instead of being flattened into one oversized SKILL.md.
46
+ */
47
+ export declare function getBundledSkillTemplates(): CommonBundledSkill[];
28
48
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAuBH,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAMtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,EAAE,CAMpD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuBH,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAOD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAMtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,EAAE,CAMpD;AAuCD;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,EAAE,CAM/D"}
@@ -6,11 +6,12 @@
6
6
  *
7
7
  * Directory structure:
8
8
  * common/
9
- * ├── commands/ # Templates that stay as slash commands (start, finish-work)
10
- * └── skills/ # Templates that become auto-triggered skills
9
+ * ├── commands/ # Templates that stay as slash commands
10
+ * ├── skills/ # Single-file templates that become auto-triggered skills
11
+ * └── bundled-skills/ # Multi-file built-in skills with references/assets
11
12
  */
12
- import { readdirSync, readFileSync } from "node:fs";
13
- import { dirname, join } from "node:path";
13
+ import { readdirSync, readFileSync, statSync } from "node:fs";
14
+ import { dirname, join, relative, sep } from "node:path";
14
15
  import { fileURLToPath } from "node:url";
15
16
  const __filename = fileURLToPath(import.meta.url);
16
17
  const __dirname = dirname(__filename);
@@ -30,6 +31,7 @@ function listMarkdownFiles(dir) {
30
31
  // Cached results — files don't change during a CLI run
31
32
  let cachedCommands;
32
33
  let cachedSkills;
34
+ let cachedBundledSkills;
33
35
  /**
34
36
  * Get all command templates (stay as slash commands on all platforms).
35
37
  * Results are cached after first call.
@@ -52,4 +54,51 @@ export function getSkillTemplates() {
52
54
  }));
53
55
  return cachedSkills;
54
56
  }
57
+ function listDirectories(dir) {
58
+ try {
59
+ return readdirSync(join(__dirname, dir))
60
+ .filter((entry) => statSync(join(__dirname, dir, entry)).isDirectory())
61
+ .sort();
62
+ }
63
+ catch {
64
+ return [];
65
+ }
66
+ }
67
+ function toPosixRelativePath(root, filePath) {
68
+ return relative(root, filePath).split(sep).join("/");
69
+ }
70
+ function listBundledSkillFiles(skillDir) {
71
+ const root = join(__dirname, "bundled-skills", skillDir);
72
+ const files = [];
73
+ function walk(dir) {
74
+ for (const entry of readdirSync(dir)) {
75
+ const fullPath = join(dir, entry);
76
+ const stat = statSync(fullPath);
77
+ if (stat.isDirectory()) {
78
+ walk(fullPath);
79
+ }
80
+ else {
81
+ files.push({
82
+ relativePath: toPosixRelativePath(root, fullPath),
83
+ content: readFileSync(fullPath, "utf-8"),
84
+ });
85
+ }
86
+ }
87
+ }
88
+ walk(root);
89
+ return files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
90
+ }
91
+ /**
92
+ * Get all multi-file built-in skills.
93
+ *
94
+ * These are copied as complete skill directories so references and assets stay
95
+ * lazy-loadable instead of being flattened into one oversized SKILL.md.
96
+ */
97
+ export function getBundledSkillTemplates() {
98
+ cachedBundledSkills ??= listDirectories("bundled-skills").map((name) => ({
99
+ name,
100
+ files: listBundledSkillFiles(name),
101
+ }));
102
+ return cachedBundledSkills;
103
+ }
55
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAW;IACpC,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;aACrC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;aAChC,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AASD,uDAAuD;AACvD,IAAI,cAA4C,CAAC;AACjD,IAAI,YAA0C,CAAC;AAE/C;;;GAGG;AACH,MAAM,UAAU,mBAAmB;IACjC,cAAc,KAAK,iBAAiB,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC9D,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QAC/B,OAAO,EAAE,YAAY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
@@ -57,6 +57,9 @@ Before any Q&A, ensure a task exists. If none exists, create one immediately.
57
57
  TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
58
58
  ```
59
59
 
60
+ Use a slug without a date prefix. `task.py create` adds the `MM-DD-`
61
+ directory prefix automatically.
62
+
60
63
  Create/seed `prd.md` immediately with what you know:
61
64
 
62
65
  ```markdown
@@ -16,6 +16,14 @@ If you're using Codex or another agent-capable tool, additional project-scoped h
16
16
  - `.agents/skills/` — reusable Trellis skills
17
17
  - `.codex/agents/` — optional custom subagents
18
18
 
19
+ ## Subagents
20
+
21
+ - ALWAYS wait for all subagents to complete before yielding.
22
+ - Spawn subagents automatically when:
23
+ - Parallelizable work (e.g., install + verify, npm test + typecheck, multiple tasks from plan)
24
+ - Long-running or blocking tasks where a worker can run independently.
25
+ - Isolation for risky changes or checks
26
+
19
27
  Managed by Trellis. Edits outside this block are preserved; edits inside may be overwritten by a future `trellis update`.
20
28
 
21
29
  <!-- TRELLIS:END -->