@mindfoldhq/trellis 0.5.0-beta.16 → 0.5.0-beta.18
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 +60 -98
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +1 -29
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +92 -5
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/antigravity.d.ts.map +1 -1
- package/dist/configurators/antigravity.js +2 -8
- package/dist/configurators/antigravity.js.map +1 -1
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +3 -9
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts.map +1 -1
- package/dist/configurators/codebuddy.js +2 -2
- package/dist/configurators/codebuddy.js.map +1 -1
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +2 -7
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +2 -9
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +2 -2
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/droid.d.ts.map +1 -1
- package/dist/configurators/droid.js +2 -2
- package/dist/configurators/droid.js.map +1 -1
- package/dist/configurators/gemini.d.ts.map +1 -1
- package/dist/configurators/gemini.js +2 -2
- package/dist/configurators/gemini.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +13 -11
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/kilo.d.ts.map +1 -1
- package/dist/configurators/kilo.js +2 -8
- package/dist/configurators/kilo.js.map +1 -1
- package/dist/configurators/kiro.d.ts.map +1 -1
- package/dist/configurators/kiro.js +2 -2
- package/dist/configurators/kiro.js.map +1 -1
- package/dist/configurators/opencode.d.ts.map +1 -1
- package/dist/configurators/opencode.js +3 -3
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/pi.d.ts.map +1 -1
- package/dist/configurators/pi.js +9 -4
- package/dist/configurators/pi.js.map +1 -1
- package/dist/configurators/qoder.d.ts.map +1 -1
- package/dist/configurators/qoder.js +2 -2
- package/dist/configurators/qoder.js.map +1 -1
- package/dist/configurators/shared.d.ts +21 -2
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +32 -3
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/windsurf.d.ts.map +1 -1
- package/dist/configurators/windsurf.js +2 -8
- package/dist/configurators/windsurf.js.map +1 -1
- package/dist/constants/paths.d.ts +2 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +2 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.5.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.18.json +9 -0
- package/dist/templates/codex/skills/finish-work/SKILL.md +41 -109
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +81 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +78 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +79 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +48 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +101 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +79 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +74 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +83 -0
- package/dist/templates/common/commands/finish-work.md +34 -10
- package/dist/templates/common/index.d.ts +22 -2
- package/dist/templates/common/index.d.ts.map +1 -1
- package/dist/templates/common/index.js +53 -4
- package/dist/templates/common/index.js.map +1 -1
- package/dist/templates/common/skills/brainstorm.md +3 -0
- package/dist/templates/copilot/prompts/finish-work.prompt.md +44 -112
- package/dist/templates/markdown/agents.md +8 -0
- package/dist/templates/opencode/plugins/inject-subagent-context.js +20 -5
- package/dist/templates/opencode/plugins/inject-workflow-state.js +6 -1
- package/dist/templates/pi/extensions/trellis/index.ts.txt +499 -51
- package/dist/templates/shared-hooks/inject-workflow-state.py +6 -1
- package/dist/templates/trellis/scripts/common/task_store.py +4 -16
- package/dist/templates/trellis/scripts/common/tasks.py +4 -1
- package/dist/templates/trellis/workflow.md +59 -3
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +19 -1
- package/dist/utils/template-hash.js.map +1 -1
- package/package.json +1 -1
package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md
ADDED
|
@@ -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.
|
package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Local Customization Overview
|
|
2
|
+
|
|
3
|
+
This directory is for local AI working in a user project where Trellis was installed through npm and `trellis init` has already been run. The AI should modify generated `.trellis/` and platform directories inside the project, not Trellis CLI upstream source code.
|
|
4
|
+
|
|
5
|
+
## First Determine What The User Actually Wants To Change
|
|
6
|
+
|
|
7
|
+
| User wording | Read first |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| "Change the Trellis flow / phases / next prompt" | `change-workflow.md` |
|
|
10
|
+
| "Change task creation, status, archive, or hooks" | `change-task-lifecycle.md` |
|
|
11
|
+
| "AI did not read context / change injected content" | `change-context-loading.md` |
|
|
12
|
+
| "A platform hook is not behaving as expected" | `change-hooks.md` |
|
|
13
|
+
| "Change implement/check/research agent behavior" | `change-agents.md` |
|
|
14
|
+
| "Add a skill/command/workflow/prompt" | `change-skills-or-commands.md` |
|
|
15
|
+
| "Adjust the project spec structure" | `change-spec-structure.md` |
|
|
16
|
+
| "Add team conventions and local notes" | `add-project-local-conventions.md` |
|
|
17
|
+
|
|
18
|
+
## General Operation Order
|
|
19
|
+
|
|
20
|
+
1. **Confirm platform and directories**: inspect which directories exist, such as `.claude/`, `.codex/`, `.cursor/`.
|
|
21
|
+
2. **Confirm the current active task**: run `python3 ./.trellis/scripts/task.py current --source`.
|
|
22
|
+
3. **Read the local source of truth**: prefer `.trellis/workflow.md`, `.trellis/config.yaml`, and relevant platform files.
|
|
23
|
+
4. **Modify narrowly**: edit only files related to the user's request.
|
|
24
|
+
5. **Synchronize semantics**: if a shared flow changes, check whether platform entry points also need changes; if a platform entry changes, check whether `.trellis/workflow.md` still agrees.
|
|
25
|
+
|
|
26
|
+
## Local File Priority
|
|
27
|
+
|
|
28
|
+
| Layer | Files |
|
|
29
|
+
| --- | --- |
|
|
30
|
+
| Workflow | `.trellis/workflow.md` |
|
|
31
|
+
| Project configuration | `.trellis/config.yaml` |
|
|
32
|
+
| Task material | `.trellis/tasks/<task>/` |
|
|
33
|
+
| Project specs | `.trellis/spec/` |
|
|
34
|
+
| Runtime scripts | `.trellis/scripts/` |
|
|
35
|
+
| Platform integration | `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, and similar directories |
|
|
36
|
+
| Shared skill | `.agents/skills/` |
|
|
37
|
+
|
|
38
|
+
## Things Not To Do By Default
|
|
39
|
+
|
|
40
|
+
- Do not edit the global npm install directory.
|
|
41
|
+
- Do not edit `node_modules/@mindfoldhq/trellis`.
|
|
42
|
+
- Do not assume the user has the Trellis GitHub repository.
|
|
43
|
+
- Do not overwrite local files already modified by the user with default templates.
|
|
44
|
+
- Do not put team project rules into public `trellis-meta`; project rules belong in `.trellis/spec/` or a local skill.
|
|
45
|
+
|
|
46
|
+
## When To Inspect Upstream Source
|
|
47
|
+
|
|
48
|
+
Switch to an upstream source-code perspective only when the user explicitly expresses one of these goals:
|
|
49
|
+
|
|
50
|
+
- "I want to open a PR to Trellis"
|
|
51
|
+
- "I want to change npm package publish contents"
|
|
52
|
+
- "I want to fork Trellis"
|
|
53
|
+
- "I want to modify the generation logic for `trellis init/update`"
|
|
54
|
+
|
|
55
|
+
Otherwise, default to modifying local Trellis files inside the user project.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Local Context Injection System
|
|
2
|
+
|
|
3
|
+
Trellis context injection aims to make AI read the right files at the right time instead of relying on model memory. In a user project, injection is implemented by `.trellis/` scripts together with platform hooks, agents, and skills.
|
|
4
|
+
|
|
5
|
+
## Injected Context Types
|
|
6
|
+
|
|
7
|
+
| Type | Source | Purpose |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| session context | `.trellis/scripts/get_context.py` | Current developer, git status, active task, active tasks, journal, packages. |
|
|
10
|
+
| workflow context | `.trellis/workflow.md` | Current Trellis flow and next action. |
|
|
11
|
+
| spec context | `.trellis/spec/` + task JSONL | Specs that must be followed during implementation/checking. |
|
|
12
|
+
| task context | `.trellis/tasks/<task>/prd.md`, `info.md`, `research/` | Current task requirements, design, and research. |
|
|
13
|
+
| platform context | Platform hooks/settings/agents | Lets different AI tools read the files above through their own mechanisms. |
|
|
14
|
+
|
|
15
|
+
## session-start
|
|
16
|
+
|
|
17
|
+
Platforms with session-start support inject a Trellis overview when a session starts, clears, compacts, or receives a similar event. Injected content usually includes:
|
|
18
|
+
|
|
19
|
+
- workflow summary.
|
|
20
|
+
- current task status.
|
|
21
|
+
- active tasks.
|
|
22
|
+
- spec index paths.
|
|
23
|
+
- developer identity and git status.
|
|
24
|
+
|
|
25
|
+
If the user feels the AI does not know the current task in a new session, first check whether the platform's session-start hook or equivalent mechanism is installed and running.
|
|
26
|
+
|
|
27
|
+
## workflow-state
|
|
28
|
+
|
|
29
|
+
workflow-state is a lightweight hint injected around each user turn. Based on current task status, it selects a block from `.trellis/workflow.md`, such as `no_task`, `planning`, `in_progress`, or `completed`.
|
|
30
|
+
|
|
31
|
+
If the user wants to change "what the AI should do next in a given state," edit the corresponding state block in `.trellis/workflow.md` first.
|
|
32
|
+
|
|
33
|
+
## sub-agent context
|
|
34
|
+
|
|
35
|
+
Implement and check agents need task context. Trellis has two loading modes:
|
|
36
|
+
|
|
37
|
+
1. **hook push**: a platform hook injects `prd.md` and the files referenced by `implement.jsonl` / `check.jsonl` before the agent starts.
|
|
38
|
+
2. **agent pull**: the agent definition instructs the agent to read the active task, PRD, and JSONL context after startup.
|
|
39
|
+
|
|
40
|
+
In both modes, JSONL files in the task directory are the key interface.
|
|
41
|
+
|
|
42
|
+
## JSONL Reading Rules
|
|
43
|
+
|
|
44
|
+
`implement.jsonl` and `check.jsonl` contain one JSON object per line:
|
|
45
|
+
|
|
46
|
+
```jsonl
|
|
47
|
+
{"file": ".trellis/spec/backend/index.md", "reason": "Backend rules"}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Readers should skip seed rows without a `file` field. When configuring JSONL, the AI should include only spec/research files, not pre-register code files that will be modified.
|
|
51
|
+
|
|
52
|
+
## Active Task And Context Key
|
|
53
|
+
|
|
54
|
+
Active task state lives in `.trellis/.runtime/sessions/` and is isolated per session. Hooks try to resolve the context key from platform events, environment variables, transcript paths, or `TRELLIS_CONTEXT_ID`.
|
|
55
|
+
|
|
56
|
+
If shell commands cannot see the same context key, `task.py current --source` may report no active task. In that case, check whether the platform passes session identity into the shell instead of hand-writing a global current-task file.
|
|
57
|
+
|
|
58
|
+
## Local Customization Points
|
|
59
|
+
|
|
60
|
+
| Need | Edit location |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| Change session-start injected content | The platform's `session-start` hook or plugin file. |
|
|
63
|
+
| Change per-turn workflow-state rules | State blocks in `.trellis/workflow.md` and the platform workflow-state hook. |
|
|
64
|
+
| Change how sub-agents read context | Platform agent definitions, the `inject-subagent-context` hook, or agent preludes. |
|
|
65
|
+
| Change JSONL validation/display | `.trellis/scripts/common/task_context.py`. |
|
|
66
|
+
| Change active task resolution | `.trellis/scripts/common/active_task.py`. |
|
|
67
|
+
|
|
68
|
+
When modifying context injection, verify two things: new sessions can see the correct task, and sub-agents can see the correct PRD/spec/research.
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Local Files Generated After Init
|
|
2
|
+
|
|
3
|
+
`trellis init` writes the Trellis runtime into the user project. Later, `trellis update` tries to update Trellis-managed template files, but it uses `.trellis/.template-hashes.json` to determine which files have already been modified by the user.
|
|
4
|
+
|
|
5
|
+
This page only describes files that are visible and editable inside the user project.
|
|
6
|
+
|
|
7
|
+
## `.trellis/`
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
.trellis/
|
|
11
|
+
├── workflow.md
|
|
12
|
+
├── config.yaml
|
|
13
|
+
├── .developer
|
|
14
|
+
├── .version
|
|
15
|
+
├── .template-hashes.json
|
|
16
|
+
├── .runtime/
|
|
17
|
+
├── scripts/
|
|
18
|
+
├── spec/
|
|
19
|
+
├── tasks/
|
|
20
|
+
└── workspace/
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| Path | Usually editable? | Notes |
|
|
24
|
+
| --- | --- | --- |
|
|
25
|
+
| `.trellis/workflow.md` | Yes | Local workflow documentation and AI routing rules. |
|
|
26
|
+
| `.trellis/config.yaml` | Yes | Project configuration, hooks, packages, journal line limits, and related settings. |
|
|
27
|
+
| `.trellis/spec/` | Yes | Project specs, intended to be updated regularly by users and AI. |
|
|
28
|
+
| `.trellis/tasks/` | Yes | Task material and research artifacts, maintained by the task workflow. |
|
|
29
|
+
| `.trellis/workspace/` | Yes | Session records, usually written by `add_session.py`. |
|
|
30
|
+
| `.trellis/scripts/` | Carefully | Local runtime. It can be customized, but only after understanding the call chain. |
|
|
31
|
+
| `.trellis/.runtime/` | No | Runtime state, usually written automatically by hooks/scripts. |
|
|
32
|
+
| `.trellis/.developer` | Carefully | Current developer identity. |
|
|
33
|
+
| `.trellis/.version` | No | Trellis version record used by update/migration logic. |
|
|
34
|
+
| `.trellis/.template-hashes.json` | No | Template hash record. Do not hand-write business rules here. |
|
|
35
|
+
|
|
36
|
+
## Platform Directories
|
|
37
|
+
|
|
38
|
+
Different platforms generate different directories. Common categories:
|
|
39
|
+
|
|
40
|
+
| Category | Example paths | Purpose |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| hooks | `.claude/hooks/`, `.codex/hooks/`, `.cursor/hooks/` | Inject session context, workflow-state, and sub-agent context. |
|
|
43
|
+
| settings | `.claude/settings.json`, `.codex/hooks.json`, `.qoder/settings.json` | Tell the platform when to run hooks or plugins. |
|
|
44
|
+
| agents | `.claude/agents/`, `.codex/agents/`, `.kiro/agents/` | Define agents such as `trellis-research`, `trellis-implement`, and `trellis-check`. |
|
|
45
|
+
| skills | `.claude/skills/`, `.agents/skills/`, `.qoder/skills/` | Skills that auto-trigger or can be read by AI. |
|
|
46
|
+
| commands/prompts/workflows | `.cursor/commands/`, `.github/prompts/`, `.windsurf/workflows/` | Explicit user-invoked command or workflow entry points. |
|
|
47
|
+
|
|
48
|
+
When modifying a platform directory, also confirm whether `.trellis/workflow.md` still describes the same flow.
|
|
49
|
+
|
|
50
|
+
## Meaning Of Template Hashes
|
|
51
|
+
|
|
52
|
+
`.trellis/.template-hashes.json` records the content hash from the last time Trellis wrote a template file. `trellis update` uses it to distinguish three cases:
|
|
53
|
+
|
|
54
|
+
| Case | Update behavior |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| File was not modified by the user | It can be updated automatically. |
|
|
57
|
+
| File was modified by the user | Prompt the user to overwrite, keep, or generate `.new`. |
|
|
58
|
+
| File is no longer a current template | It may be deleted, renamed, or preserved according to migration rules. |
|
|
59
|
+
|
|
60
|
+
When an AI customizes local Trellis files, it does not need to maintain hashes manually. It is normal for Trellis update to recognize the result as "modified by the user."
|
|
61
|
+
|
|
62
|
+
## Local Customization Boundaries
|
|
63
|
+
|
|
64
|
+
Editable by default:
|
|
65
|
+
|
|
66
|
+
- `.trellis/workflow.md`
|
|
67
|
+
- `.trellis/config.yaml`
|
|
68
|
+
- `.trellis/spec/**`
|
|
69
|
+
- `.trellis/scripts/**`
|
|
70
|
+
- Platform hooks, settings, agents, skills, commands, prompts, and workflows
|
|
71
|
+
|
|
72
|
+
Do not edit by default:
|
|
73
|
+
|
|
74
|
+
- Global npm install directory
|
|
75
|
+
- `node_modules/@mindfoldhq/trellis`
|
|
76
|
+
- Trellis GitHub repository source code
|
|
77
|
+
- Concrete state files under `.trellis/.runtime/**`
|
|
78
|
+
- Hash contents inside `.trellis/.template-hashes.json`
|
|
79
|
+
|
|
80
|
+
Switch to the Trellis CLI source-code perspective only when the user explicitly wants to contribute upstream.
|
package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Local Trellis Architecture Overview
|
|
2
|
+
|
|
3
|
+
`trellis-meta` is for user projects that have already run `trellis init`. The user's machine usually has only the npm-installed `trellis` command plus the Trellis files generated inside the project; it may not have the Trellis CLI source code.
|
|
4
|
+
|
|
5
|
+
Therefore, when an AI uses this skill, the default customization target is local files inside the user project:
|
|
6
|
+
|
|
7
|
+
- `.trellis/`: workflow, tasks, specs, memory, scripts, and runtime state.
|
|
8
|
+
- Platform directories: `.claude/`, `.codex/`, `.cursor/`, `.opencode/`, `.kiro/`, `.gemini/`, `.qoder/`, `.codebuddy/`, `.github/`, `.factory/`, `.pi/`, `.kilocode/`, `.agent/`, `.windsurf/`, and similar directories.
|
|
9
|
+
- Shared skill layer: `.agents/skills/`.
|
|
10
|
+
|
|
11
|
+
Do not default to guiding the user to fork the Trellis CLI repository. Treat upstream source code as the operating target only when the user explicitly says they want to change Trellis upstream source, publish an npm package, or contribute a PR.
|
|
12
|
+
|
|
13
|
+
## Local System Model
|
|
14
|
+
|
|
15
|
+
Trellis provides three layers inside a user project:
|
|
16
|
+
|
|
17
|
+
1. **Workflow layer**: `.trellis/workflow.md` defines phases, routing, next actions, and prompt blocks.
|
|
18
|
+
2. **Persistence layer**: `.trellis/tasks/`, `.trellis/spec/`, and `.trellis/workspace/` store tasks, specs, and session memory.
|
|
19
|
+
3. **Platform integration layer**: hooks, settings, agents, skills, commands, prompts, and workflows in platform directories connect the Trellis workflow to different AI tools.
|
|
20
|
+
|
|
21
|
+
All three layers live inside the user project, so an AI can read and modify them directly.
|
|
22
|
+
|
|
23
|
+
## Core Paths
|
|
24
|
+
|
|
25
|
+
| Path | Purpose |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `.trellis/workflow.md` | Workflow phases, skill routing, and workflow-state prompt blocks. |
|
|
28
|
+
| `.trellis/config.yaml` | Project configuration, task lifecycle hooks, monorepo package configuration, and journal configuration. |
|
|
29
|
+
| `.trellis/spec/` | The user's project-specific coding conventions and thinking guides. |
|
|
30
|
+
| `.trellis/tasks/` | Each task's PRD, technical notes, research files, and JSONL context. |
|
|
31
|
+
| `.trellis/workspace/` | Per-developer journals and cross-session memory. |
|
|
32
|
+
| `.trellis/scripts/` | Local Python runtime used by commands, hooks, and context injection. |
|
|
33
|
+
| `.trellis/.runtime/` | Session-level runtime state, such as the current task pointer. |
|
|
34
|
+
| `.trellis/.template-hashes.json` | Template hashes for Trellis-managed files, used by update to determine whether local files were modified by the user. |
|
|
35
|
+
|
|
36
|
+
## AI Customization Principles
|
|
37
|
+
|
|
38
|
+
1. **Find the local source of truth first**: Do not edit from memory. Read `.trellis/workflow.md`, `.trellis/config.yaml`, the relevant platform directory, and related task files first.
|
|
39
|
+
2. **Edit the user project, not the npm package cache**: Modify generated files inside the project, not `node_modules` or the global npm install directory.
|
|
40
|
+
3. **Keep platform files aligned with `.trellis/`**: If workflow routing changes, also check whether platform skills or commands still describe the same flow.
|
|
41
|
+
4. **Put project-specific rules in `.trellis/spec/` or a local skill**: Do not put team conventions into `trellis-meta`.
|
|
42
|
+
5. **Preserve user changes**: If a file was already modified locally, work from the current content instead of overwriting it with a default template.
|
|
43
|
+
|
|
44
|
+
## How To Use This Directory
|
|
45
|
+
|
|
46
|
+
- To understand which files exist after init, read `generated-files.md`.
|
|
47
|
+
- To change phases, routing, or next actions, read `workflow.md`.
|
|
48
|
+
- To change the task model, JSONL context, or active task behavior, read `task-system.md`.
|
|
49
|
+
- To change coding convention injection, read `spec-system.md`.
|
|
50
|
+
- To understand journals and cross-session memory, read `workspace-memory.md`.
|
|
51
|
+
- To change hooks or sub-agent context loading, read `context-injection.md`.
|