@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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Local Spec System
|
|
2
|
+
|
|
3
|
+
`.trellis/spec/` is the user's project-specific engineering spec library. Trellis is not about making AI memorize conventions; it injects relevant specs or requires the AI to read them at the right time.
|
|
4
|
+
|
|
5
|
+
## Directory Model
|
|
6
|
+
|
|
7
|
+
A common single-repository structure:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
.trellis/spec/
|
|
11
|
+
├── backend/
|
|
12
|
+
│ ├── index.md
|
|
13
|
+
│ └── ...
|
|
14
|
+
├── frontend/
|
|
15
|
+
│ ├── index.md
|
|
16
|
+
│ └── ...
|
|
17
|
+
└── guides/
|
|
18
|
+
├── index.md
|
|
19
|
+
└── ...
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
A common monorepo structure:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
.trellis/spec/
|
|
26
|
+
├── cli/
|
|
27
|
+
│ ├── backend/
|
|
28
|
+
│ │ ├── index.md
|
|
29
|
+
│ │ └── ...
|
|
30
|
+
│ └── unit-test/
|
|
31
|
+
│ ├── index.md
|
|
32
|
+
│ └── ...
|
|
33
|
+
├── docs-site/
|
|
34
|
+
│ └── docs/
|
|
35
|
+
│ ├── index.md
|
|
36
|
+
│ └── ...
|
|
37
|
+
└── guides/
|
|
38
|
+
├── index.md
|
|
39
|
+
└── ...
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`index.md` is the entry point for each layer. It should list the Pre-Development Checklist and Quality Check. Specific guidelines live in other Markdown files in the same directory.
|
|
43
|
+
|
|
44
|
+
## Package Configuration
|
|
45
|
+
|
|
46
|
+
`.trellis/config.yaml` can declare packages:
|
|
47
|
+
|
|
48
|
+
```yaml
|
|
49
|
+
packages:
|
|
50
|
+
cli:
|
|
51
|
+
path: packages/cli
|
|
52
|
+
docs-site:
|
|
53
|
+
path: docs-site
|
|
54
|
+
type: submodule
|
|
55
|
+
default_package: cli
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The AI can run:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
This command lists packages and spec layers for the current project. Use this output as the reference when configuring context JSONL.
|
|
65
|
+
|
|
66
|
+
## How Specs Enter Tasks
|
|
67
|
+
|
|
68
|
+
Before a task enters implementation, Phase 1.3 should write relevant specs into `implement.jsonl` / `check.jsonl`:
|
|
69
|
+
|
|
70
|
+
```jsonl
|
|
71
|
+
{"file": ".trellis/spec/cli/backend/index.md", "reason": "CLI backend conventions"}
|
|
72
|
+
{"file": ".trellis/spec/cli/unit-test/conventions.md", "reason": "Test expectations"}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Sub-agents or platform preludes read these JSONL files and load the referenced specs. On platforms without sub-agent support, the AI should read the relevant specs directly according to the workflow.
|
|
76
|
+
|
|
77
|
+
## What Specs Should Contain
|
|
78
|
+
|
|
79
|
+
Specs should contain executable engineering conventions for the project, not generic best practices:
|
|
80
|
+
|
|
81
|
+
- Where files should live.
|
|
82
|
+
- How error handling should be expressed.
|
|
83
|
+
- Input/output contracts for APIs, hooks, and commands.
|
|
84
|
+
- Patterns that are forbidden.
|
|
85
|
+
- Cases that require tests.
|
|
86
|
+
- Project-specific pitfalls and how to avoid them.
|
|
87
|
+
|
|
88
|
+
When the AI learns a new rule during implementation or debugging, it should update `.trellis/spec/` rather than only summarizing it in chat.
|
|
89
|
+
|
|
90
|
+
## Local Customization Points
|
|
91
|
+
|
|
92
|
+
| Need | Edit location |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| Add a new spec layer | `.trellis/spec/<package>/<layer>/index.md` and corresponding guideline files. |
|
|
95
|
+
| Change monorepo spec mapping | `packages` / `default_package` / `spec_scope` in `.trellis/config.yaml`. |
|
|
96
|
+
| Change which specs AI reads before implementation | The task's `implement.jsonl`. |
|
|
97
|
+
| Change which specs AI reads during checking | The task's `check.jsonl`. |
|
|
98
|
+
| Change when specs should be updated | Phase 3.3 in `.trellis/workflow.md` and the `trellis-update-spec` skill. |
|
|
99
|
+
|
|
100
|
+
## Boundaries
|
|
101
|
+
|
|
102
|
+
`.trellis/spec/` is the user's project specification, not a permanent copy of Trellis built-in templates. The AI should encourage the user to update it according to the actual project code instead of treating Trellis default templates as immutable documents.
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# Local Task System
|
|
2
|
+
|
|
3
|
+
The Trellis task system is stored entirely under `.trellis/tasks/` in the user project. Each task is a directory containing requirements, context, research, state, and relationship information.
|
|
4
|
+
|
|
5
|
+
## Task Directory Structure
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.trellis/tasks/
|
|
9
|
+
├── 04-28-example-task/
|
|
10
|
+
│ ├── task.json
|
|
11
|
+
│ ├── prd.md
|
|
12
|
+
│ ├── info.md
|
|
13
|
+
│ ├── implement.jsonl
|
|
14
|
+
│ ├── check.jsonl
|
|
15
|
+
│ └── research/
|
|
16
|
+
└── archive/
|
|
17
|
+
└── 2026-04/
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
| File | Purpose |
|
|
21
|
+
| --- | --- |
|
|
22
|
+
| `task.json` | Task metadata: status, assignee, priority, branch, parent/child tasks, and similar fields. |
|
|
23
|
+
| `prd.md` | Requirements document; the most important business context during implementation. |
|
|
24
|
+
| `info.md` | Optional technical design. |
|
|
25
|
+
| `implement.jsonl` | List of spec/research files the implement agent must read first. |
|
|
26
|
+
| `check.jsonl` | List of spec/research files the check agent must read first. |
|
|
27
|
+
| `research/` | Research artifacts. Complex findings should not live only in chat. |
|
|
28
|
+
|
|
29
|
+
## `task.json`
|
|
30
|
+
|
|
31
|
+
`task.json` records task status and metadata. Common fields:
|
|
32
|
+
|
|
33
|
+
| Field | Meaning |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| `id` / `name` / `title` | Task identity and title. |
|
|
36
|
+
| `status` | Status such as `planning`, `in_progress`, `review`, or `completed`. |
|
|
37
|
+
| `priority` | `P0`, `P1`, `P2`, `P3`. |
|
|
38
|
+
| `creator` / `assignee` | Creator and assignee. |
|
|
39
|
+
| `package` | Target package in a monorepo; may be empty. |
|
|
40
|
+
| `branch` / `base_branch` | Working branch and PR target branch. |
|
|
41
|
+
| `children` / `parent` | Parent/child task relationships. |
|
|
42
|
+
| `commit` / `pr_url` | Commit and PR information after completion. |
|
|
43
|
+
| `meta` | Extension fields. |
|
|
44
|
+
|
|
45
|
+
The AI should not treat phase numbers as task status. Task progress is mainly determined by `status`, `prd.md`, whether JSONL context is configured, and the phase descriptions in `workflow.md`.
|
|
46
|
+
|
|
47
|
+
## Active Task
|
|
48
|
+
|
|
49
|
+
The user sees a "current task," but Trellis stores active task state per session.
|
|
50
|
+
|
|
51
|
+
```text
|
|
52
|
+
.trellis/.runtime/sessions/<context-key>.json
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
`task.py start` writes the task path into the runtime session file for the current session. `task.py current --source` shows the current task and where it came from. Different AI windows can point to different tasks without overwriting each other.
|
|
56
|
+
|
|
57
|
+
If the platform or shell environment has no stable session identity, `task.py start` may be unable to set the active task. The AI should read the error, inspect the platform hook/session environment, and not fall back to a shared global pointer.
|
|
58
|
+
|
|
59
|
+
## JSONL Context
|
|
60
|
+
|
|
61
|
+
`implement.jsonl` and `check.jsonl` are context manifests for sub-agents to read first.
|
|
62
|
+
|
|
63
|
+
Format:
|
|
64
|
+
|
|
65
|
+
```jsonl
|
|
66
|
+
{"file": ".trellis/spec/cli/backend/index.md", "reason": "Backend conventions"}
|
|
67
|
+
{"file": ".trellis/tasks/04-28-example/research/api.md", "reason": "API research"}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Rules:
|
|
71
|
+
|
|
72
|
+
- Include spec and research files.
|
|
73
|
+
- Do not include code files that are about to be modified.
|
|
74
|
+
- Do not treat temporary conclusions in chat as the only context.
|
|
75
|
+
- Seed rows have no `file` field; they only prompt the AI to fill in real entries.
|
|
76
|
+
|
|
77
|
+
## Common Commands
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
python3 ./.trellis/scripts/task.py create "<title>" --slug <slug>
|
|
81
|
+
python3 ./.trellis/scripts/task.py start <task>
|
|
82
|
+
python3 ./.trellis/scripts/task.py current --source
|
|
83
|
+
python3 ./.trellis/scripts/task.py add-context <task> implement <file> <reason>
|
|
84
|
+
python3 ./.trellis/scripts/task.py validate <task>
|
|
85
|
+
python3 ./.trellis/scripts/task.py finish
|
|
86
|
+
python3 ./.trellis/scripts/task.py archive <task>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When modifying the task system, the AI should prefer script commands to maintain structure. Edit JSON/Markdown directly only when scripts do not cover the need.
|
|
90
|
+
|
|
91
|
+
## Local Customization Points
|
|
92
|
+
|
|
93
|
+
| Need | Edit location |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| Change the default task template | `.trellis/scripts/common/task_store.py` and task creation instructions. |
|
|
96
|
+
| Change status semantics | `.trellis/workflow.md`, workflow-state hook logic, and task usage conventions. |
|
|
97
|
+
| Add task lifecycle actions | `hooks.after_*` in `.trellis/config.yaml`. |
|
|
98
|
+
| Change context rules | Phase 1.3 in `.trellis/workflow.md` and related platform agent/hook instructions. |
|
|
99
|
+
| Change archive policy | `.trellis/scripts/common/task_store.py` / `task_utils.py`. |
|
|
100
|
+
|
|
101
|
+
These are local files in the user project. Do not default to editing Trellis CLI source code unless the user wants to contribute upstream.
|
package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Local Workflow System
|
|
2
|
+
|
|
3
|
+
`.trellis/workflow.md` is the Trellis workflow source of truth inside the user project. An AI does not need Trellis source code to understand how the current project should move tasks forward; this file is enough.
|
|
4
|
+
|
|
5
|
+
## File Responsibilities
|
|
6
|
+
|
|
7
|
+
`.trellis/workflow.md` has three responsibilities:
|
|
8
|
+
|
|
9
|
+
1. **Explain workflow phases**: Plan, Execute, Finish.
|
|
10
|
+
2. **Define skill routing**: which skill or agent the AI should use when the user expresses a certain intent.
|
|
11
|
+
3. **Provide workflow-state prompt blocks**: hooks can inject the prompt block for the current state into the conversation.
|
|
12
|
+
|
|
13
|
+
## Current Phase Model
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
Phase 1: Plan -> clarify what to build, produce prd.md and required research
|
|
17
|
+
Phase 2: Execute -> implement against the PRD and specs, then check
|
|
18
|
+
Phase 3: Finish -> final verification, preserve lessons, and wrap up
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Each phase contains numbered steps, such as `1.3 Configure context`. These numbers are not runtime fields in `task.json`; they are workflow structure for AI and humans to read.
|
|
22
|
+
|
|
23
|
+
## Skill Routing
|
|
24
|
+
|
|
25
|
+
`workflow.md` separates routing by platform capability:
|
|
26
|
+
|
|
27
|
+
- Platforms with sub-agent support: dispatch `trellis-implement` by default for implementation and `trellis-check` for checking.
|
|
28
|
+
- Platforms without sub-agent support: the main session reads skills such as `trellis-before-dev`, then executes directly.
|
|
29
|
+
|
|
30
|
+
When changing local AI behavior, update the routing descriptions in `workflow.md` first, then check whether the corresponding platform skill, command, or agent files need to stay in sync.
|
|
31
|
+
|
|
32
|
+
## Workflow-State Prompt Blocks
|
|
33
|
+
|
|
34
|
+
The bottom of `workflow.md` can contain state blocks like this:
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
[workflow-state:no_task]
|
|
38
|
+
...
|
|
39
|
+
[/workflow-state:no_task]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Hooks choose the right block based on current task status and inject it into the conversation. Common states include:
|
|
43
|
+
|
|
44
|
+
| State | Meaning |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `no_task` | The current session has no active task. |
|
|
47
|
+
| `planning` | The task is still in requirements, research, or context configuration. |
|
|
48
|
+
| `in_progress` | The task has entered implementation and checking. |
|
|
49
|
+
| `completed` | The task is complete and waiting for wrap-up or archive. |
|
|
50
|
+
|
|
51
|
+
If the user wants to change policies such as "whether to create a task when there is no task," "when task creation may be skipped," or "whether sub-agents are required," edit these state blocks and the routing table above them.
|
|
52
|
+
|
|
53
|
+
## Local Modification Patterns
|
|
54
|
+
|
|
55
|
+
Common changes:
|
|
56
|
+
|
|
57
|
+
| Goal | Edit point |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| Add a phase | Update the Phase Index, phase body, routing, and state blocks. |
|
|
60
|
+
| Change task creation policy | Update the `no_task` state block and Phase 1 description. |
|
|
61
|
+
| Change the default implementation/check path | Update Phase 2 and skill routing. |
|
|
62
|
+
| Change the wrap-up flow | Update Phase 3 and `finish-work` related descriptions. Note the current split: Phase 3.4 = AI-driven code commits (batched, user-confirmed), Phase 3.5 = `/finish-work` (archive + record session). `/finish-work` refuses to run if the working tree is dirty. |
|
|
63
|
+
| Change platform differences | Update routing descriptions grouped by platform. |
|
|
64
|
+
|
|
65
|
+
After editing, make the AI reread `.trellis/workflow.md`; do not assume the flow from the old conversation is still valid.
|
|
66
|
+
|
|
67
|
+
## Relationship To Platform Files
|
|
68
|
+
|
|
69
|
+
`workflow.md` is the semantic center of the local workflow, but each platform can also have its own entry files:
|
|
70
|
+
|
|
71
|
+
- skills, such as `trellis-brainstorm` and `trellis-check`.
|
|
72
|
+
- commands/prompts/workflows, such as continue and finish-work.
|
|
73
|
+
- hooks, such as session-start or workflow-state injection.
|
|
74
|
+
|
|
75
|
+
If only `workflow.md` changes, platform entry files may still contain old language. When the user wants to change "what the AI actually does," also inspect the relevant platform directory.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Local Workspace Memory System
|
|
2
|
+
|
|
3
|
+
`.trellis/workspace/` stores cross-session memory. Its purpose is to let AI and humans understand what happened before across different windows and different days.
|
|
4
|
+
|
|
5
|
+
## Directory Structure
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.trellis/workspace/
|
|
9
|
+
├── index.md
|
|
10
|
+
└── <developer>/
|
|
11
|
+
├── index.md
|
|
12
|
+
├── journal-1.md
|
|
13
|
+
└── journal-2.md
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| File | Purpose |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `.trellis/.developer` | Current developer identity. |
|
|
19
|
+
| `.trellis/workspace/index.md` | Global workspace overview. |
|
|
20
|
+
| `.trellis/workspace/<developer>/index.md` | Session index for a developer. |
|
|
21
|
+
| `.trellis/workspace/<developer>/journal-N.md` | Session journal. |
|
|
22
|
+
|
|
23
|
+
## Developer Identity
|
|
24
|
+
|
|
25
|
+
Run this the first time:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
python3 ./.trellis/scripts/init_developer.py <name>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This creates `.trellis/.developer` and the corresponding workspace directory. The AI should not change developer identity casually; if the identity is wrong, first confirm who is using the current project.
|
|
32
|
+
|
|
33
|
+
## Journal
|
|
34
|
+
|
|
35
|
+
`journal-N.md` records completed or partially completed work from each session. By default, each journal holds about 2000 lines; after that it rotates to the next file.
|
|
36
|
+
|
|
37
|
+
Common command for recording a session:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python3 ./.trellis/scripts/add_session.py \
|
|
41
|
+
--title "Session title" \
|
|
42
|
+
--summary "What changed" \
|
|
43
|
+
--commit "abc1234"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Planning or review work without a commit can also be recorded by using `--no-commit` or an empty commit value.
|
|
47
|
+
|
|
48
|
+
## Relationship Between Workspace Memory And Tasks
|
|
49
|
+
|
|
50
|
+
| System | What it stores |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| `.trellis/tasks/` | Requirements, design, research, and state for a specific task. |
|
|
53
|
+
| `.trellis/workspace/` | Work records across tasks and sessions. |
|
|
54
|
+
| `.trellis/spec/` | Engineering knowledge preserved as long-term conventions. |
|
|
55
|
+
|
|
56
|
+
If information is only useful for the current task, put it in the task directory.
|
|
57
|
+
If information describes what happened in the current session, put it in the workspace journal.
|
|
58
|
+
If information should be followed every time code is written in the future, put it in spec.
|
|
59
|
+
|
|
60
|
+
## Local Customization Points
|
|
61
|
+
|
|
62
|
+
| Need | Edit location |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| Change maximum journal lines | `max_journal_lines` in `.trellis/config.yaml`. |
|
|
65
|
+
| Change session auto-commit message | `session_commit_message` in `.trellis/config.yaml`. |
|
|
66
|
+
| Change session content format | `.trellis/scripts/add_session.py`. |
|
|
67
|
+
| Change how workspace is displayed in context | `.trellis/scripts/common/session_context.py`. |
|
|
68
|
+
|
|
69
|
+
## AI Usage Rules
|
|
70
|
+
|
|
71
|
+
The AI should not treat workspace as the only source of truth. When resuming a task, read the current task first, then use workspace for background. After a task is complete, record important process notes in workspace; if long-term rules emerged, update spec.
|
|
@@ -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.
|
package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md
ADDED
|
@@ -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.
|
package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
ADDED
|
@@ -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.
|