@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,73 @@
1
+ ---
2
+ name: trellis-meta
3
+ description: "Understand and customize the local Trellis architecture inside a user project. Use when modifying .trellis plus platform hooks, settings, agents, skills, commands, prompts, or workflows generated by trellis init."
4
+ ---
5
+
6
+ # Trellis Meta
7
+
8
+ This skill is for local Trellis users who have already run `trellis init` in a project. After reading it, an AI should understand the Trellis architecture, operating model, and customization entry points inside that user project, then modify the generated `.trellis/` and platform directory files according to the user's request.
9
+
10
+ The default operating scope is local files in the user project:
11
+
12
+ - `.trellis/`: workflow, config, tasks, spec, workspace, scripts, and runtime state.
13
+ - Platform directories: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, and similar directories.
14
+ - Shared skill layer: `.agents/skills/`.
15
+
16
+ Do not assume the user has the Trellis source repository. Do not default to modifying the global npm install directory or `node_modules`.
17
+
18
+ ## How To Use
19
+
20
+ 1. Read `references/local-architecture/overview.md` first to establish the local Trellis system model.
21
+ 2. If the request involves a specific AI tool, read `references/platform-files/platform-map.md` and the relevant platform file notes.
22
+ 3. If the user wants to change behavior, read `references/customize-local/overview.md`, then open the specific customization topic.
23
+ 4. Before editing, read the actual files in the user project and treat local content as authoritative.
24
+
25
+ ## References
26
+
27
+ ### Local Architecture
28
+
29
+ - `references/local-architecture/overview.md`: The three-layer local Trellis architecture and customization principles.
30
+ - `references/local-architecture/generated-files.md`: Files generated by `trellis init` and their customization boundaries.
31
+ - `references/local-architecture/workflow.md`: Phases, routing, and workflow-state blocks in `.trellis/workflow.md`.
32
+ - `references/local-architecture/task-system.md`: Task directories, active tasks, JSONL context, and task runtime.
33
+ - `references/local-architecture/spec-system.md`: How `.trellis/spec/` is organized and injected.
34
+ - `references/local-architecture/workspace-memory.md`: `.trellis/workspace/`, journals, and cross-session memory.
35
+ - `references/local-architecture/context-injection.md`: Hooks, sub-agent preludes, and context injection paths.
36
+
37
+ ### Platform Files
38
+
39
+ - `references/platform-files/overview.md`: How shared `.trellis/` files relate to platform directories.
40
+ - `references/platform-files/platform-map.md`: Platform directories and paths for skills, agents, hooks, and extensions.
41
+ - `references/platform-files/hooks-and-settings.md`: How settings/config files, hooks, plugins, and extensions connect to Trellis.
42
+ - `references/platform-files/agents.md`: Local file responsibilities for `trellis-research`, `trellis-implement`, and `trellis-check`.
43
+ - `references/platform-files/skills-and-commands.md`: Differences between skills, commands, prompts, and workflows, plus how to change them.
44
+
45
+ ### Local Customization
46
+
47
+ - `references/customize-local/overview.md`: Choose the right local customization entry point for the user's request.
48
+ - `references/customize-local/change-workflow.md`: Change phases, routing, next actions, and workflow-state.
49
+ - `references/customize-local/change-task-lifecycle.md`: Change task creation, status, archive behavior, and hooks.
50
+ - `references/customize-local/change-context-loading.md`: Change how tasks, specs, journals, and hook context are loaded.
51
+ - `references/customize-local/change-hooks.md`: Change platform hooks, settings, and shell session bridges.
52
+ - `references/customize-local/change-agents.md`: Change research, implement, and check agent behavior.
53
+ - `references/customize-local/change-skills-or-commands.md`: Add or modify local skills, commands, prompts, and workflows.
54
+ - `references/customize-local/change-spec-structure.md`: Adjust the project spec structure under `.trellis/spec/`.
55
+ - `references/customize-local/add-project-local-conventions.md`: Put team rules into project-local specs or local skills.
56
+
57
+ ## Current Rules
58
+
59
+ - `.trellis/workflow.md` is the local workflow source of truth.
60
+ - `.trellis/config.yaml` is the project-level Trellis configuration and task hook configuration entry point.
61
+ - `.trellis/spec/` stores the user's project-specific coding conventions and design constraints.
62
+ - `.trellis/tasks/` stores task PRDs, technical notes, research files, and JSONL context.
63
+ - `.trellis/workspace/` stores developer journals and cross-session memory.
64
+ - Platform settings/config files decide which hooks, agents, skills, commands, prompts, and workflows actually run.
65
+ - `.trellis/.template-hashes.json` and `.trellis/.runtime/` are management/runtime state files. Confirm necessity before editing them.
66
+
67
+ ## Do Not
68
+
69
+ - Do not treat Trellis upstream source code as the default target for local customization.
70
+ - Do not modify the global npm install directory or `node_modules/@mindfoldhq/trellis` to implement project needs.
71
+ - Do not overwrite user-modified local files with default templates.
72
+ - Do not put team-private project rules into the public `trellis-meta`; put project rules in `.trellis/spec/` or a project-local skill.
73
+ - Do not describe removed historical mechanisms as current Trellis behavior.
@@ -0,0 +1,83 @@
1
+ # Add Project-Local Conventions
2
+
3
+ Often the user does not need to change Trellis mechanics; they need local AI to understand their team's conventions. In that case, prefer `.trellis/spec/` or a project-local skill instead of editing `trellis-meta`.
4
+
5
+ ## Where To Put Things
6
+
7
+ | Content type | Location |
8
+ | --- | --- |
9
+ | Rules code must follow | `.trellis/spec/<layer>/` |
10
+ | Cross-layer thinking methods | `.trellis/spec/guides/` |
11
+ | AI capability for a project-specific flow | Platform-local skill |
12
+ | One-off task material | `.trellis/tasks/<task>/` |
13
+ | Session summary | `.trellis/workspace/<developer>/journal-N.md` |
14
+
15
+ ## Create A Project-Local Skill
16
+
17
+ If the user wants AI to know "how this project customizes Trellis," create a local skill:
18
+
19
+ ```text
20
+ .claude/skills/trellis-local/
21
+ └── SKILL.md
22
+ ```
23
+
24
+ Example:
25
+
26
+ ```md
27
+ ---
28
+ name: trellis-local
29
+ description: "Project-local Trellis customizations for this repository. Use when changing this project's Trellis workflow, hooks, local agents, or team-specific conventions."
30
+ ---
31
+
32
+ # Trellis Local
33
+
34
+ ## Local Scope
35
+
36
+ This skill documents this repository's Trellis customizations only.
37
+
38
+ ## Custom Workflow Rules
39
+
40
+ - ...
41
+
42
+ ## Local Hook Changes
43
+
44
+ - ...
45
+
46
+ ## Local Agent Changes
47
+
48
+ - ...
49
+ ```
50
+
51
+ For multi-platform projects, place equivalent versions in other platform skill directories, or use `.agents/skills/` for platforms that support the shared layer.
52
+
53
+ ## Write To `.trellis/spec/`
54
+
55
+ If the content is a coding convention, write it to spec. Examples:
56
+
57
+ ```text
58
+ .trellis/spec/backend/error-handling.md
59
+ .trellis/spec/frontend/components.md
60
+ .trellis/spec/guides/cross-platform-thinking-guide.md
61
+ ```
62
+
63
+ After writing it, update the corresponding `index.md` so AI can find the new rule from the entry point.
64
+
65
+ ## Make The Current Task Use New Conventions
66
+
67
+ After writing a spec, add it to the current task context:
68
+
69
+ ```bash
70
+ python3 ./.trellis/scripts/task.py add-context <task> implement ".trellis/spec/backend/error-handling.md" "Error handling conventions"
71
+ python3 ./.trellis/scripts/task.py add-context <task> check ".trellis/spec/backend/error-handling.md" "Review error handling"
72
+ ```
73
+
74
+ ## Do Not Store Project-Private Rules In `trellis-meta`
75
+
76
+ `trellis-meta` is a public skill for understanding Trellis architecture and local customization entry points. Put project-private content in:
77
+
78
+ - `.trellis/spec/`
79
+ - a project-local skill
80
+ - the current task
81
+ - workspace journal
82
+
83
+ This prevents future updates to Trellis's built-in `trellis-meta` from overwriting the team's own conventions.
@@ -0,0 +1,54 @@
1
+ # Change Local Agents
2
+
3
+ When the user wants to change `trellis-research`, `trellis-implement`, or `trellis-check` behavior, edit platform agent files in the user project.
4
+
5
+ ## Read These Files First
6
+
7
+ 1. Target platform agent directory
8
+ 2. `.trellis/workflow.md` Phase 2 / research routing
9
+ 3. Current task `prd.md`
10
+ 4. Current task `implement.jsonl` / `check.jsonl`
11
+ 5. Relevant hook or agent prelude
12
+
13
+ ## Common Paths
14
+
15
+ | Platform | Path |
16
+ | --- | --- |
17
+ | Claude Code | `.claude/agents/trellis-*.md` |
18
+ | Cursor | `.cursor/agents/trellis-*.md` |
19
+ | OpenCode | `.opencode/agents/trellis-*.md` |
20
+ | Codex | `.codex/agents/trellis-*.toml` |
21
+ | Kiro | `.kiro/agents/trellis-*.json` |
22
+ | Gemini CLI | `.gemini/agents/trellis-*.md` |
23
+ | Qoder | `.qoder/agents/trellis-*.md` |
24
+ | CodeBuddy | `.codebuddy/agents/trellis-*.md` |
25
+ | Factory Droid | `.factory/droids/trellis-*.md` |
26
+ | Pi Agent | `.pi/agents/trellis-*.md` |
27
+
28
+ Use the actual paths in the user project as authoritative.
29
+
30
+ ## Common Needs
31
+
32
+ | Need | Which agent to edit |
33
+ | --- | --- |
34
+ | Research must write files, not only reply in chat | `trellis-research` |
35
+ | Certain local specs must be read before implementation | `trellis-implement` + `implement.jsonl` configuration rules |
36
+ | Specific commands must run during checking | `trellis-check` |
37
+ | Agent must not modify certain directories | The corresponding agent's write boundary instructions |
38
+ | Agent output format must be fixed | The corresponding agent's final/reporting instructions |
39
+
40
+ ## Modification Principles
41
+
42
+ 1. **Preserve role boundaries**: research investigates and persists; implement writes implementation; check reviews and fixes.
43
+ 2. **Do not hard-code project specs into agents**: long-term specs belong in `.trellis/spec/`; agents are responsible for reading them.
44
+ 3. **Make read order explicit**: active task -> PRD -> info -> JSONL -> spec/research.
45
+ 4. **Make write boundaries explicit**: which directories may be written and which may not.
46
+ 5. **Synchronize across platforms**: when the user configured multiple platforms, decide whether to change only the current platform or all platform agents.
47
+
48
+ ## Agent Pull Platforms
49
+
50
+ If an agent file contains a prelude for "read task/context after startup," do not remove those steps when editing. Otherwise the agent will work only from chat context and bypass Trellis's core mechanism.
51
+
52
+ ## Hook Push Platforms
53
+
54
+ If context is injected by a hook, the agent file should still retain responsibility boundaries. Do not remove PRD/spec requirements from the agent just because a hook injects context.
@@ -0,0 +1,81 @@
1
+ # Change Local Context Loading
2
+
3
+ Context loading determines when AI reads workflow, task, spec, research, workspace, and git status. Read this page when the user says "AI does not know the current task," "the agent did not read specs," or "there is too much/too little context."
4
+
5
+ ## Read These Files First
6
+
7
+ 1. `.trellis/workflow.md`
8
+ 2. `.trellis/scripts/get_context.py`
9
+ 3. `.trellis/scripts/common/session_context.py`
10
+ 4. `.trellis/scripts/common/task_context.py`
11
+ 5. `.trellis/scripts/common/active_task.py`
12
+ 6. Current platform hooks or agent files
13
+ 7. The current task's `implement.jsonl` / `check.jsonl`
14
+
15
+ ## Context Sources
16
+
17
+ | Source | Purpose |
18
+ | --- | --- |
19
+ | `.trellis/workflow.md` | Workflow and next-action hints. |
20
+ | `.trellis/tasks/<task>/prd.md` | Current task requirements. |
21
+ | `.trellis/tasks/<task>/implement.jsonl` | Spec/research to read before implementation. |
22
+ | `.trellis/tasks/<task>/check.jsonl` | Spec/research to read during checking. |
23
+ | `.trellis/spec/` | Project specs. |
24
+ | `.trellis/workspace/` | Session records. |
25
+ | git status | Current working tree changes. |
26
+
27
+ ## Common Needs And Edit Points
28
+
29
+ | Need | Edit point |
30
+ | --- | --- |
31
+ | Inject more/less information in new sessions | `session_context.py` or the platform `session-start` hook. |
32
+ | Change hints on each user input | State blocks in `.trellis/workflow.md` and `inject-workflow-state` hook. |
33
+ | Agent did not read specs | Task JSONL, agent prelude, `inject-subagent-context` hook. |
34
+ | Active task is lost | `active_task.py` and platform session identity propagation. |
35
+ | Change JSONL validation rules | `task_context.py`. |
36
+
37
+ ## JSONL Rules
38
+
39
+ `implement.jsonl` / `check.jsonl` are the key context loading interface:
40
+
41
+ ```jsonl
42
+ {"file": ".trellis/spec/backend/index.md", "reason": "Backend conventions"}
43
+ {"file": ".trellis/tasks/04-28-x/research/api.md", "reason": "API research"}
44
+ ```
45
+
46
+ Include only spec/research files. Do not put code files that will be modified into these manifests; agents read code files themselves during implementation.
47
+
48
+ ## Change Session Context
49
+
50
+ If the user wants every new session to see more project state, edit:
51
+
52
+ - `.trellis/scripts/common/session_context.py`
53
+ - the corresponding platform `session-start` hook
54
+
55
+ Context cannot grow without bound. Prefer injecting indexes and paths so the AI can read detailed files on demand.
56
+
57
+ ## Change Sub-Agent Context
58
+
59
+ First determine which mode the platform uses:
60
+
61
+ - hook push: edit the `inject-subagent-context` hook.
62
+ - agent pull: edit the read steps in the corresponding `trellis-implement` / `trellis-check` agent file.
63
+
64
+ In both modes, make sure the agent ultimately reads:
65
+
66
+ 1. active task
67
+ 2. `prd.md`
68
+ 3. `info.md` if present
69
+ 4. the corresponding JSONL
70
+ 5. spec/research referenced by the JSONL
71
+
72
+ ## Troubleshooting Order
73
+
74
+ ```bash
75
+ python3 ./.trellis/scripts/task.py current --source
76
+ python3 ./.trellis/scripts/task.py list-context <task>
77
+ python3 ./.trellis/scripts/task.py validate <task>
78
+ python3 ./.trellis/scripts/get_context.py --mode packages
79
+ ```
80
+
81
+ Confirm the task and JSONL are correct before editing hooks/agents.
@@ -0,0 +1,57 @@
1
+ # Change Local Hooks
2
+
3
+ Hooks are the automation layer that connects a platform to Trellis. When the user wants to change "when context is injected," "how shell commands inherit a session," or "which files are read before an agent starts," hooks are usually the edit point.
4
+
5
+ ## Read These Files First
6
+
7
+ 1. Target platform settings/config, such as `.claude/settings.json`, `.codex/hooks.json`, `.cursor/hooks.json`
8
+ 2. Target platform hooks directory
9
+ 3. `.trellis/scripts/common/active_task.py`
10
+ 4. `.trellis/scripts/common/session_context.py`
11
+ 5. `.trellis/workflow.md`
12
+
13
+ ## Common Hook Types
14
+
15
+ | Hook | Purpose |
16
+ | --- | --- |
17
+ | session-start | Injects a Trellis overview when a session starts, clears, or compacts. |
18
+ | workflow-state | Injects a state hint on each user input. |
19
+ | sub-agent context | Injects PRD/spec/research before an agent starts. |
20
+ | shell session bridge | Lets `task.py` commands in shell see the same session identity. |
21
+
22
+ ## Modification Steps
23
+
24
+ 1. Find the hook registration in settings/config.
25
+ 2. Confirm the registered script path exists.
26
+ 3. Read the hook script and identify inputs, outputs, and called `.trellis/scripts/`.
27
+ 4. Modify hook behavior.
28
+ 5. If the hook depends on workflow content, synchronize `.trellis/workflow.md`.
29
+
30
+ ## Example: Change New-Session Injection Content
31
+
32
+ First find the session-start hook:
33
+
34
+ ```text
35
+ .claude/settings.json
36
+ .claude/hooks/session-start.py
37
+ ```
38
+
39
+ If the hook ultimately calls `.trellis/scripts/get_context.py` or `session_context.py`, editing the local script is usually more robust than hard-coding content in the hook.
40
+
41
+ ## Example: Agent Did Not Read JSONL
42
+
43
+ First confirm:
44
+
45
+ ```bash
46
+ python3 ./.trellis/scripts/task.py current --source
47
+ python3 ./.trellis/scripts/task.py validate <task>
48
+ ```
49
+
50
+ If the task and JSONL are correct, determine whether the platform uses hook push or agent pull. For hook push, edit `inject-subagent-context`; for agent pull, edit the agent file.
51
+
52
+ ## Notes
53
+
54
+ - Settings handle registration, hook scripts handle behavior; inspect both together.
55
+ - Different platforms support different hook events. Do not directly copy another platform's settings.
56
+ - Hooks should read project-local `.trellis/`; they should not depend on Trellis upstream source paths.
57
+ - Hook failures should produce visible errors so AI does not silently lose context.
@@ -0,0 +1,78 @@
1
+ # Change Local Skills, Commands, Prompts, And Workflows
2
+
3
+ When the user wants to change AI entry points, auto-trigger rules, or explicit command behavior, edit skills, commands, prompts, or workflows in local platform directories.
4
+
5
+ ## Read These Files First
6
+
7
+ 1. `.trellis/workflow.md`
8
+ 2. Target platform skill/command/prompt/workflow directory
9
+ 3. Related agent or hook files
10
+ 4. Whether project rules already exist in `.trellis/spec/`
11
+
12
+ ## Which Entry Type To Choose
13
+
14
+ | Goal | Recommendation |
15
+ | --- | --- |
16
+ | AI should automatically know a capability | Add or modify a skill. |
17
+ | User wants to trigger manually with a command | Add or modify a command/prompt/workflow. |
18
+ | Team project conventions | Prefer `.trellis/spec/` or a project-local skill. |
19
+ | Change Trellis flow semantics | Synchronize `.trellis/workflow.md`. |
20
+
21
+ ## Modify A Skill
22
+
23
+ A skill is usually:
24
+
25
+ ```text
26
+ <skill-name>/
27
+ ├── SKILL.md
28
+ └── references/
29
+ ```
30
+
31
+ `SKILL.md` should be short and responsible for triggering/routing. Put long content in `references/` so AI can read it on demand.
32
+
33
+ The frontmatter description should specify when to use the skill. Example:
34
+
35
+ ```yaml
36
+ description: "Use when customizing this project's deployment workflow and release checklist."
37
+ ```
38
+
39
+ Do not write vague descriptions such as "helpful project skill"; they can trigger incorrectly.
40
+
41
+ ## Modify A Command/Prompt/Workflow
42
+
43
+ Explicit entry points should state:
44
+
45
+ - How the user triggers it.
46
+ - Which `.trellis/` files to read.
47
+ - Which scripts to run.
48
+ - How to report after completion.
49
+
50
+ If a command only repeats workflow rules, prefer making it reference/read `.trellis/workflow.md` instead of maintaining a second copy of the flow.
51
+
52
+ ## Common Paths
53
+
54
+ | Platform | Entry directories |
55
+ | --- | --- |
56
+ | Claude Code | `.claude/skills/`, `.claude/commands/` |
57
+ | Cursor | `.cursor/skills/`, `.cursor/commands/` |
58
+ | OpenCode | `.opencode/skills/`, `.opencode/commands/` |
59
+ | Codex | `.agents/skills/`, `.codex/skills/` |
60
+ | GitHub Copilot | `.github/skills/`, `.github/prompts/` |
61
+ | Kilo / Antigravity / Windsurf | workflows + skills |
62
+
63
+ ## Add A Project-Local Skill
64
+
65
+ If the user wants to document team-private customizations, create a project-local skill, for example:
66
+
67
+ ```text
68
+ .claude/skills/project-trellis-local/
69
+ └── SKILL.md
70
+ ```
71
+
72
+ For multi-platform projects, add equivalent versions in each platform skill directory, or use `.agents/skills/` on platforms that support the shared layer.
73
+
74
+ ## Notes
75
+
76
+ - Do not mix every platform's syntax into one file.
77
+ - Do not change only one platform entry point while claiming all platforms are supported.
78
+ - Do not hide long-term engineering conventions inside a command; write them to `.trellis/spec/`.
@@ -0,0 +1,83 @@
1
+ # Change Local Spec Structure
2
+
3
+ When the user wants to change the engineering conventions AI follows, add new spec layers, or adjust monorepo package mapping, edit `.trellis/spec/` and `.trellis/config.yaml`.
4
+
5
+ ## Read These Files First
6
+
7
+ 1. `.trellis/config.yaml`
8
+ 2. `.trellis/spec/`
9
+ 3. `.trellis/workflow.md` Phase 1.3 and Phase 3.3
10
+ 4. Current task `implement.jsonl` / `check.jsonl`
11
+
12
+ ## Common Needs
13
+
14
+ | Need | Edit location |
15
+ | --- | --- |
16
+ | Add backend/frontend/docs/test spec layer | `.trellis/spec/<layer>/` or `.trellis/spec/<package>/<layer>/` |
17
+ | Add shared thinking guides | `.trellis/spec/guides/` |
18
+ | Adjust monorepo packages | `packages` in `.trellis/config.yaml` |
19
+ | Change default package | `default_package` in `.trellis/config.yaml` |
20
+ | Control spec scanning scope | `spec_scope` in `.trellis/config.yaml` |
21
+ | Make a task read a new spec | Task `implement.jsonl` / `check.jsonl` |
22
+
23
+ ## Add A Spec Layer
24
+
25
+ Single-repository example:
26
+
27
+ ```text
28
+ .trellis/spec/security/
29
+ ├── index.md
30
+ └── auth.md
31
+ ```
32
+
33
+ Monorepo example:
34
+
35
+ ```text
36
+ .trellis/spec/webapp/security/
37
+ ├── index.md
38
+ └── auth.md
39
+ ```
40
+
41
+ `index.md` should include:
42
+
43
+ - What code this layer applies to.
44
+ - Pre-Development Checklist.
45
+ - Quality Check.
46
+ - Links to specific guideline files.
47
+
48
+ ## Update Context
49
+
50
+ Adding a spec does not mean every task automatically reads it. The current task must reference it in JSONL:
51
+
52
+ ```bash
53
+ python3 ./.trellis/scripts/task.py add-context <task> implement ".trellis/spec/webapp/security/index.md" "Security conventions"
54
+ python3 ./.trellis/scripts/task.py add-context <task> check ".trellis/spec/webapp/security/index.md" "Security review rules"
55
+ ```
56
+
57
+ ## Change Monorepo Packages
58
+
59
+ Example `.trellis/config.yaml`:
60
+
61
+ ```yaml
62
+ packages:
63
+ webapp:
64
+ path: apps/web
65
+ api:
66
+ path: apps/api
67
+ default_package: webapp
68
+ ```
69
+
70
+ After editing, run:
71
+
72
+ ```bash
73
+ python3 ./.trellis/scripts/get_context.py --mode packages
74
+ ```
75
+
76
+ Use this output to confirm AI can see the correct packages and spec layers.
77
+
78
+ ## Notes
79
+
80
+ - Specs are user project conventions and can be changed according to project needs.
81
+ - Do not put temporary task information into specs; put temporary information in the task.
82
+ - Do not put long-term conventions only in agents or commands; preserve them in specs.
83
+ - After changing spec structure, check whether existing task JSONL files still point to files that exist.
@@ -0,0 +1,79 @@
1
+ # Change Local Task Lifecycle
2
+
3
+ Task lifecycle includes creation, start, context configuration, finish, archive, parent/child tasks, and lifecycle hooks. The default customization targets are `.trellis/tasks/`, `.trellis/config.yaml`, and `.trellis/scripts/`.
4
+
5
+ ## Read These Files First
6
+
7
+ 1. `.trellis/workflow.md`
8
+ 2. `.trellis/config.yaml`
9
+ 3. `.trellis/scripts/task.py`
10
+ 4. `.trellis/scripts/common/task_store.py`
11
+ 5. `.trellis/scripts/common/task_utils.py`
12
+ 6. The current task's `.trellis/tasks/<task>/task.json`
13
+
14
+ ## Common Needs And Edit Points
15
+
16
+ | Need | Edit point |
17
+ | --- | --- |
18
+ | Automatically sync an external system after task creation | `hooks.after_create` in `.trellis/config.yaml`. |
19
+ | Automatically update status after task start | `hooks.after_start` in `.trellis/config.yaml`. |
20
+ | Run a script after task finish | `hooks.after_finish` in `.trellis/config.yaml`. |
21
+ | Clean external resources after archive | `hooks.after_archive` in `.trellis/config.yaml`. |
22
+ | Change default task fields | `.trellis/scripts/common/task_store.py`. |
23
+ | Change task parsing/search | `.trellis/scripts/common/task_utils.py`. |
24
+ | Change active task behavior | `.trellis/scripts/common/active_task.py`. |
25
+
26
+ ## lifecycle hooks
27
+
28
+ `.trellis/config.yaml` supports:
29
+
30
+ ```yaml
31
+ hooks:
32
+ after_create:
33
+ - "python3 .trellis/scripts/hooks/my_sync.py create"
34
+ after_start:
35
+ - "python3 .trellis/scripts/hooks/my_sync.py start"
36
+ after_finish:
37
+ - "python3 .trellis/scripts/hooks/my_sync.py finish"
38
+ after_archive:
39
+ - "python3 .trellis/scripts/hooks/my_sync.py archive"
40
+ ```
41
+
42
+ Hook commands receive the `TASK_JSON_PATH` environment variable, pointing to the current task's `task.json`. Hook failures should usually warn, but not block the main task operation.
43
+
44
+ ## Change Task Fields
45
+
46
+ If the user wants to add project-local fields, prefer putting them under `meta` in `task.json` to avoid breaking existing scripts' assumptions about standard fields.
47
+
48
+ Example:
49
+
50
+ ```json
51
+ "meta": {
52
+ "linearIssue": "ENG-123",
53
+ "risk": "high"
54
+ }
55
+ ```
56
+
57
+ If standard fields really need to change, inspect every local script that reads `task.json`.
58
+
59
+ ## Change Active Task
60
+
61
+ Active task is session-level state stored in `.trellis/.runtime/sessions/`. Do not fall back to a global `.current-task` model. If the user wants to change active task behavior, edit:
62
+
63
+ - `.trellis/scripts/common/active_task.py`
64
+ - platform hooks or shell session bridges
65
+ - active task descriptions in `.trellis/workflow.md`
66
+
67
+ ## Modification Steps
68
+
69
+ 1. Confirm the current task with `python3 ./.trellis/scripts/task.py current --source`.
70
+ 2. Read the current task's `task.json` and confirm status and fields.
71
+ 3. For configuration needs, edit `.trellis/config.yaml` first.
72
+ 4. For script behavior needs, then edit `.trellis/scripts/`.
73
+ 5. If the AI flow changed, synchronize `.trellis/workflow.md`.
74
+
75
+ ## Do Not
76
+
77
+ - Do not directly edit `.trellis/.runtime/sessions/` to "fix" business state.
78
+ - Do not hard-code project-private fields into scripts; prefer `meta`.
79
+ - Do not default to asking the user to fork Trellis CLI.
@@ -0,0 +1,48 @@
1
+ # Change Local Workflow
2
+
3
+ When the user wants to change Trellis phases, next-action hints, whether to create tasks, whether to use sub-agents, or when to check/wrap up, edit `.trellis/workflow.md` first.
4
+
5
+ ## Read These Files First
6
+
7
+ 1. `.trellis/workflow.md`
8
+ 2. Entry files for the current platform, such as skills/commands/prompts/workflows
9
+ 3. The current task's `task.json` and `prd.md`
10
+
11
+ ## Common Needs And Edit Points
12
+
13
+ | Need | Edit point |
14
+ | --- | --- |
15
+ | Change phase names or phase order | `Phase Index` and the corresponding Phase sections. |
16
+ | Change whether to create a task when there is no task | `[workflow-state:no_task]` state block. |
17
+ | Change the next step during planning | Phase 1 and `[workflow-state:planning]`. |
18
+ | Change whether an agent is required during in_progress | Phase 2 and `[workflow-state:in_progress]`. |
19
+ | Change wrap-up after completion | Phase 3 and `[workflow-state:completed]`. |
20
+ | Change which skill a user intent triggers | `Skill Routing` table. |
21
+
22
+ ## Modification Steps
23
+
24
+ 1. Find the relevant section in `.trellis/workflow.md`.
25
+ 2. When changing rules, keep explicit trigger conditions and next actions.
26
+ 3. If adding or renaming a skill/agent, synchronize the corresponding files in platform directories.
27
+ 4. If workflow-state prompt blocks change, confirm hooks can still read blocks by status.
28
+ 5. Make the AI reread `.trellis/workflow.md`; do not keep using rules from the old conversation.
29
+
30
+ ## Example: Relax Task Creation Requirements
31
+
32
+ To change when task creation can be skipped, usually edit `[workflow-state:no_task]`:
33
+
34
+ ```md
35
+ [workflow-state:no_task]
36
+ Task is not required when the answer is a one-reply explanation, no files are changed, and no research is needed.
37
+ [/workflow-state:no_task]
38
+ ```
39
+
40
+ If the formal Phase 1 flow also needs to change, synchronize the Phase 1 section.
41
+
42
+ ## Example: One Platform Does Not Use Sub-Agents
43
+
44
+ If the user wants only one platform to avoid sub-agents, first confirm whether that platform has a separate group in the workflow. Then change Phase 2 routing for that platform group instead of deleting all `trellis-implement` / `trellis-check` instructions across platforms.
45
+
46
+ ## Notes
47
+
48
+ `.trellis/workflow.md` is the local project workflow, not an immutable template. The user can adapt it to team habits. After editing it, platform entry files may still contain old descriptions, so inspect them too.