@mindfoldhq/trellis 0.6.4 → 0.6.6
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 +1 -1
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/channel/messages.js +1 -1
- package/dist/commands/channel/supervisor/stdout.d.ts +7 -5
- package/dist/commands/channel/supervisor/stdout.d.ts.map +1 -1
- package/dist/commands/channel/supervisor/stdout.js +65 -18
- package/dist/commands/channel/supervisor/stdout.js.map +1 -1
- package/dist/commands/channel/supervisor.d.ts +13 -0
- package/dist/commands/channel/supervisor.d.ts.map +1 -1
- package/dist/commands/channel/supervisor.js +54 -2
- package/dist/commands/channel/supervisor.js.map +1 -1
- package/dist/commands/init.d.ts +2 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +8 -1
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +83 -42
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/copilot.d.ts +1 -0
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +4 -1
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +27 -1
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/omp.d.ts +11 -0
- package/dist/configurators/omp.d.ts.map +1 -0
- package/dist/configurators/omp.js +51 -0
- package/dist/configurators/omp.js.map +1 -0
- package/dist/configurators/pi.d.ts.map +1 -1
- package/dist/configurators/pi.js +14 -4
- package/dist/configurators/pi.js.map +1 -1
- package/dist/configurators/shared.d.ts +7 -0
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +27 -0
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/trae.d.ts +17 -0
- package/dist/configurators/trae.d.ts.map +1 -0
- package/dist/configurators/trae.js +42 -0
- package/dist/configurators/trae.js.map +1 -0
- package/dist/configurators/zcode.d.ts +3 -3
- package/dist/configurators/zcode.js +12 -12
- package/dist/configurators/zcode.js.map +1 -1
- package/dist/migrations/manifests/0.6.5.json +9 -0
- package/dist/migrations/manifests/0.6.6.json +17 -0
- package/dist/templates/codex/hooks/session-start.py +6 -6
- package/dist/templates/codex/skills/brainstorm/SKILL.md +19 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/bundled-skills.md +2 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +3 -3
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +1 -1
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +1 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +5 -5
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +21 -2
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +1 -1
- package/dist/templates/common/skills/brainstorm.md +19 -1
- package/dist/templates/copilot/copilot-instructions.md +11 -0
- package/dist/templates/copilot/hooks/session-start.py +6 -6
- package/dist/templates/copilot/index.d.ts +6 -1
- package/dist/templates/copilot/index.d.ts.map +1 -1
- package/dist/templates/copilot/index.js +8 -1
- package/dist/templates/copilot/index.js.map +1 -1
- package/dist/templates/copilot/prompts/brainstorm.prompt.md +19 -1
- package/dist/templates/omp/agents/trellis-check.md +41 -0
- package/dist/templates/omp/agents/trellis-implement.md +45 -0
- package/dist/templates/omp/agents/trellis-research.md +30 -0
- package/dist/templates/omp/extensions/trellis/index.ts.txt +462 -0
- package/dist/templates/omp/index.d.ts +4 -0
- package/dist/templates/omp/index.d.ts.map +1 -0
- package/dist/templates/omp/index.js +9 -0
- package/dist/templates/omp/index.js.map +1 -0
- package/dist/templates/pi/agents/trellis-check.md +1 -1
- package/dist/templates/pi/agents/trellis-implement.md +1 -1
- package/dist/templates/pi/agents/trellis-research.md +1 -1
- package/dist/templates/pi/extensions/trellis/index.ts.txt +111 -9
- package/dist/templates/shared-hooks/index.d.ts +1 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +1 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-workflow-state.py +41 -6
- package/dist/templates/shared-hooks/session-start.py +12 -7
- package/dist/templates/trae/agents/trellis-check.md +108 -0
- package/dist/templates/trae/agents/trellis-implement.md +103 -0
- package/dist/templates/trae/agents/trellis-research.md +137 -0
- package/dist/templates/trae/hooks.json +27 -0
- package/dist/templates/trae/index.d.ts +15 -0
- package/dist/templates/trae/index.d.ts.map +1 -0
- package/dist/templates/trae/index.js +15 -0
- package/dist/templates/trae/index.js.map +1 -0
- package/dist/templates/trellis/scripts/add_session.py +65 -17
- package/dist/templates/trellis/scripts/common/active_task.py +2 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +72 -11
- package/dist/templates/trellis/scripts/common/config.py +29 -0
- package/dist/templates/trellis/scripts/common/session_context.py +1 -1
- package/dist/templates/trellis/scripts/common/task_store.py +79 -19
- package/dist/templates/trellis/scripts/task.py +8 -2
- package/dist/templates/trellis/workflow.md +22 -20
- package/dist/templates/zcode/agents/trellis-research.md +133 -0
- package/dist/templates/zcode/index.d.ts +6 -5
- package/dist/templates/zcode/index.d.ts.map +1 -1
- package/dist/templates/zcode/index.js +6 -5
- package/dist/templates/zcode/index.js.map +1 -1
- package/dist/types/ai-tools.d.ts +4 -4
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +45 -2
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/uninstall-scrubbers.d.ts +1 -0
- package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
- package/dist/utils/uninstall-scrubbers.js +19 -0
- package/dist/utils/uninstall-scrubbers.js.map +1 -1
- package/package.json +2 -2
package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md
CHANGED
|
@@ -20,8 +20,9 @@ This page lists common Trellis file locations in a user project by platform. Whe
|
|
|
20
20
|
| GitHub Copilot | `--copilot` | `.github/` | `.github/skills/` | `.github/agents/` | `.github/copilot/hooks/` + prompts |
|
|
21
21
|
| Factory Droid | `--droid` | `.factory/` | `.factory/skills/` | `.factory/droids/` | `.factory/hooks/` + settings |
|
|
22
22
|
| Pi Agent | `--pi` | `.pi/` | `.pi/skills/` | `.pi/agents/` | `.pi/extensions/trellis/` (native `trellis_subagent` tool) + `.pi/settings.json` |
|
|
23
|
+
| Trae IDE | `--trae` | `.trae/` | `.trae/skills/` | `.trae/agents/` | `.trae/hooks/` + `.trae/hooks.json` |
|
|
23
24
|
| Reasonix | `--reasonix` | `.reasonix/` | `.reasonix/skills/` | None — sub-agents are skills with `runAs: subagent` frontmatter | None |
|
|
24
|
-
| ZCode | `--zcode` | `.zcode/` | `.
|
|
25
|
+
| ZCode | `--zcode` | `.zcode/` | `.zcode/skills/` | `.zcode/agents/` | pull-based prelude (no hooks) |
|
|
25
26
|
|
|
26
27
|
## Capability Groups
|
|
27
28
|
|
|
@@ -40,6 +41,7 @@ These platforms usually have `trellis-research`, `trellis-implement`, and `trell
|
|
|
40
41
|
- GitHub Copilot
|
|
41
42
|
- Factory Droid
|
|
42
43
|
- Pi Agent
|
|
44
|
+
- Trae IDE
|
|
43
45
|
- Reasonix (delivered as skills with `runAs: subagent` under `.reasonix/skills/`, not as a separate `agents/` directory)
|
|
44
46
|
- ZCode
|
|
45
47
|
|
|
@@ -65,7 +67,7 @@ When changing behavior, inspect workflows and skills first. Do not assume Trelli
|
|
|
65
67
|
|
|
66
68
|
### Shared `.agents/skills/`
|
|
67
69
|
|
|
68
|
-
Codex
|
|
70
|
+
Codex and Gemini CLI write 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. ZCode keeps Trellis-managed skills under `.zcode/skills/`.
|
|
69
71
|
|
|
70
72
|
## Decision Rules When Modifying Platform Files
|
|
71
73
|
|
|
@@ -84,3 +86,20 @@ Platform ecosystems change, and user projects may already be customized. If this
|
|
|
84
86
|
- Judge behavior by the read rules currently written in the agent file.
|
|
85
87
|
|
|
86
88
|
Do not delete a custom file just because it is not listed in this path table.
|
|
89
|
+
|
|
90
|
+
### `.omp/` — Oh My Pi (OMP)
|
|
91
|
+
|
|
92
|
+
Extension-backed platform. OMP native provider auto-discovers all subdirectories.
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
.omp/
|
|
96
|
+
├── commands/ # Slash commands (flat .md)
|
|
97
|
+
├── skills/ # Auto-triggered skills (SKILL.md per dir)
|
|
98
|
+
├── agents/ # Agent definitions (.md)
|
|
99
|
+
└── extensions/
|
|
100
|
+
└── trellis/
|
|
101
|
+
└── index.ts # Trellis extension (context injection)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
No `settings.json` — OMP scans `.omp/` subdirectories automatically.
|
|
105
|
+
No Python hooks — hook-equivalent behavior lives in the TypeScript extension.
|
|
@@ -32,7 +32,7 @@ Trellis workflow skills usually share one semantic set: brainstorm, before-dev,
|
|
|
32
32
|
| Factory Droid | `.factory/skills/`, `.factory/commands/` |
|
|
33
33
|
| Pi Agent | `.pi/skills/` |
|
|
34
34
|
| Reasonix | `.reasonix/skills/` |
|
|
35
|
-
| ZCode | `.
|
|
35
|
+
| ZCode | `.zcode/skills/`, `.zcode/commands/` |
|
|
36
36
|
|
|
37
37
|
In a user project, use the files actually generated by init as authoritative.
|
|
38
38
|
|
|
@@ -48,6 +48,7 @@ Use a concise title from the user's request. Use a slug without a date prefix. `
|
|
|
48
48
|
5. Include your recommended answer with the question.
|
|
49
49
|
6. After each user answer, update `prd.md` before continuing.
|
|
50
50
|
7. For complex tasks, create or update `design.md` and `implement.md` before implementation starts.
|
|
51
|
+
8. Before final review or `task.py start`, run the PRD convergence pass below.
|
|
51
52
|
|
|
52
53
|
Do not invent a project-specific product/spec hierarchy. If the repository already has product, domain, or spec docs, use them. If it does not, proceed with the evidence that exists.
|
|
53
54
|
|
|
@@ -135,16 +136,33 @@ For each component of the current plan:
|
|
|
135
136
|
|
|
136
137
|
Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
|
|
137
138
|
|
|
138
|
-
`implement.md` is not a replacement for `implement.jsonl`.
|
|
139
|
+
`implement.md` is not a replacement for `implement.jsonl`. On sub-agent-dispatch workflows, `implement.jsonl` and `check.jsonl` must each contain at least one real spec/research entry before `task.py start`; the seed `_example` row does not count. Inline workflows skip this JSONL gate because Phase 2 loads context through `trellis-before-dev`.
|
|
140
|
+
|
|
141
|
+
## PRD Convergence Pass
|
|
142
|
+
|
|
143
|
+
Before declaring planning ready or running `task.py start`, rewrite `prd.md` once against the final structure described in the artifact rules above. This is not optional cleanup; it is the final planning gate.
|
|
144
|
+
|
|
145
|
+
The pass must be lossless:
|
|
146
|
+
|
|
147
|
+
- Collapse repeated facts into one authoritative section.
|
|
148
|
+
- Fold temporary brainstorm sections such as `What I already know`, `Assumptions`, and resolved `Open Questions` into Goal, Background, Requirements, Technical Notes, or Acceptance Criteria.
|
|
149
|
+
- Remove resolved open questions instead of leaving empty or already-answered sections.
|
|
150
|
+
- Merge parallel bug and requirement lists when they describe the same work; keep each defect's severity, evidence, and file:line anchors on the owning requirement.
|
|
151
|
+
- Preserve every file:line anchor, decision, constraint, requirement ID, and acceptance-criteria mapping.
|
|
152
|
+
- Keep only genuinely blocking open questions.
|
|
153
|
+
|
|
154
|
+
After the pass, read `prd.md` top to bottom and verify that no fact is repeated across sections unless the repetition adds new information.
|
|
139
155
|
|
|
140
156
|
## Quality Bar
|
|
141
157
|
|
|
142
158
|
Before declaring planning ready:
|
|
143
159
|
|
|
144
160
|
- `prd.md` contains testable acceptance criteria.
|
|
161
|
+
- `prd.md` has passed the PRD convergence pass: no unresolved temporary brainstorm sections, no duplicate facts across sections, and no lost anchors, decisions, or acceptance mappings.
|
|
145
162
|
- Repository-answerable questions have already been answered through inspection.
|
|
146
163
|
- Remaining open questions are genuinely about user intent or scope.
|
|
147
164
|
- Complex tasks have `design.md` and `implement.md`.
|
|
165
|
+
- Sub-agent-dispatch tasks have real curated entries in both `implement.jsonl` and `check.jsonl`; seed-only manifests are not ready.
|
|
148
166
|
- The user has reviewed the final planning artifacts or explicitly approved proceeding.
|
|
149
167
|
|
|
150
168
|
Do not start implementation until the user approves or asks for implementation.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<!-- TRELLIS:COPILOT-GUIDANCE:START -->
|
|
2
|
+
# Trellis Review Guidance
|
|
3
|
+
|
|
4
|
+
When reviewing a Trellis-enabled repository:
|
|
5
|
+
|
|
6
|
+
- Treat Trellis-generated runtime and platform payloads as copied integration files in consumer repositories. Examples include `.trellis/scripts/**`, `.trellis/agents/**`, `.trellis/workflow.md`, and platform Trellis files under `.agents/**`, `.claude/**`, `.codex/**`, `.cursor/**`, `.gemini/**`, `.github/**`, `.opencode/**`, `.qoder/**`, `.codebuddy/**`, `.factory/**`, `.pi/**`, `.reasonix/**`, `.trae/**`, and `.zcode/**`.
|
|
7
|
+
- Do not leave line-by-line style, wording, or local refactor comments on those copied files unless the PR explicitly changes Trellis integration, the copied file is the primary subject, it leaks secrets, it has syntax or wiring breakage, or it contradicts the PR goal.
|
|
8
|
+
- If a Trellis-generated file needs a behavior change, leave one handoff comment asking for an upstream Trellis fix. Include the affected path, expected behavior, observed evidence or reproduction steps, and why the fix belongs upstream.
|
|
9
|
+
- Continue reviewing repo-owned `.trellis/spec/**`, `.trellis/tasks/**`, application code, migrations, tests, docs, and non-Trellis scripts normally.
|
|
10
|
+
- Group duplicate root-cause findings into one comment and point to a deterministic local check when one already covers the issue class.
|
|
11
|
+
<!-- TRELLIS:COPILOT-GUIDANCE:END -->
|
|
@@ -34,12 +34,12 @@ if sys.platform.startswith("win"):
|
|
|
34
34
|
try:
|
|
35
35
|
_stream.reconfigure(encoding="utf-8", errors="replace") # type: ignore[union-attr]
|
|
36
36
|
except Exception:
|
|
37
|
-
pass
|
|
37
|
+
pass # Optional Windows stream setup; keep hook startup non-fatal.
|
|
38
38
|
elif hasattr(_stream, "detach"):
|
|
39
39
|
try:
|
|
40
40
|
setattr(sys, _stream_name, _io.TextIOWrapper(_stream.detach(), encoding="utf-8", errors="replace"))
|
|
41
41
|
except Exception:
|
|
42
|
-
pass
|
|
42
|
+
pass # Optional Windows stream setup; keep hook startup non-fatal.
|
|
43
43
|
|
|
44
44
|
import json
|
|
45
45
|
import os
|
|
@@ -121,7 +121,7 @@ def configure_project_encoding(project_dir: Path) -> None:
|
|
|
121
121
|
|
|
122
122
|
configure_encoding()
|
|
123
123
|
except Exception:
|
|
124
|
-
pass
|
|
124
|
+
pass # Optional encoding helper; host defaults are still usable.
|
|
125
125
|
|
|
126
126
|
|
|
127
127
|
def _has_curated_jsonl_entry(jsonl_path: Path) -> bool:
|
|
@@ -248,7 +248,7 @@ def _get_task_status(trellis_dir: Path, hook_input: dict) -> str:
|
|
|
248
248
|
try:
|
|
249
249
|
task_data = json.loads(task_json_path.read_text(encoding="utf-8"))
|
|
250
250
|
except (json.JSONDecodeError, PermissionError):
|
|
251
|
-
pass
|
|
251
|
+
pass # Optional task metadata; fall back to generic status.
|
|
252
252
|
|
|
253
253
|
task_title = task_data.get("title", task_ref)
|
|
254
254
|
task_status = task_data.get("status", "unknown")
|
|
@@ -391,7 +391,7 @@ def _build_compact_current_state(
|
|
|
391
391
|
if isinstance(data, dict):
|
|
392
392
|
status = str(data.get("status") or "unknown")
|
|
393
393
|
except (json.JSONDecodeError, OSError):
|
|
394
|
-
pass
|
|
394
|
+
pass # Optional task metadata; fall back to generic status.
|
|
395
395
|
lines.append(f"Current task: {_repo_relative(repo_root, task_dir)}; status={status}.")
|
|
396
396
|
else:
|
|
397
397
|
lines.append("Current task: none.")
|
|
@@ -403,7 +403,7 @@ def _build_compact_current_state(
|
|
|
403
403
|
f"Active tasks: {task_count} total. Use `python3 ./.trellis/scripts/task.py list --mine` only if needed."
|
|
404
404
|
)
|
|
405
405
|
except Exception:
|
|
406
|
-
pass
|
|
406
|
+
pass # Optional task summary; keep compact state available.
|
|
407
407
|
|
|
408
408
|
if get_active_journal_file and count_lines:
|
|
409
409
|
journal = get_active_journal_file(repo_root)
|
|
@@ -7,8 +7,12 @@
|
|
|
7
7
|
* copilot/
|
|
8
8
|
* ├── prompts/ # Slash-command prompts → .github/prompts/*.prompt.md
|
|
9
9
|
* ├── hooks/ # Hook scripts → .github/copilot/hooks/
|
|
10
|
-
*
|
|
10
|
+
* ├── hooks.json # Hooks config → .github/hooks/trellis.json
|
|
11
|
+
* └── copilot-instructions.md → .github/copilot-instructions.md
|
|
11
12
|
*/
|
|
13
|
+
export declare const COPILOT_INSTRUCTIONS_PATH = ".github/copilot-instructions.md";
|
|
14
|
+
export declare const COPILOT_INSTRUCTIONS_BLOCK_START = "<!-- TRELLIS:COPILOT-GUIDANCE:START -->";
|
|
15
|
+
export declare const COPILOT_INSTRUCTIONS_BLOCK_END = "<!-- TRELLIS:COPILOT-GUIDANCE:END -->";
|
|
12
16
|
export interface HookTemplate {
|
|
13
17
|
name: string;
|
|
14
18
|
content: string;
|
|
@@ -19,5 +23,6 @@ export interface PromptTemplate {
|
|
|
19
23
|
}
|
|
20
24
|
export declare function getAllHooks(): HookTemplate[];
|
|
21
25
|
export declare function getHooksConfig(): string;
|
|
26
|
+
export declare function getCopilotInstructions(): string;
|
|
22
27
|
export declare function getAllPrompts(): PromptTemplate[];
|
|
23
28
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/copilot/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,eAAO,MAAM,yBAAyB,oCAAoC,CAAC;AAC3E,eAAO,MAAM,gCAAgC,4CACF,CAAC;AAC5C,eAAO,MAAM,8BAA8B,0CACF,CAAC;AAc1C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,IAAI,YAAY,EAAE,CAW5C;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED,wBAAgB,aAAa,IAAI,cAAc,EAAE,CAchD"}
|
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
* copilot/
|
|
8
8
|
* ├── prompts/ # Slash-command prompts → .github/prompts/*.prompt.md
|
|
9
9
|
* ├── hooks/ # Hook scripts → .github/copilot/hooks/
|
|
10
|
-
*
|
|
10
|
+
* ├── hooks.json # Hooks config → .github/hooks/trellis.json
|
|
11
|
+
* └── copilot-instructions.md → .github/copilot-instructions.md
|
|
11
12
|
*/
|
|
12
13
|
import { readdirSync, readFileSync } from "node:fs";
|
|
13
14
|
import { dirname, join } from "node:path";
|
|
14
15
|
import { fileURLToPath } from "node:url";
|
|
15
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
17
|
const __dirname = dirname(__filename);
|
|
18
|
+
export const COPILOT_INSTRUCTIONS_PATH = ".github/copilot-instructions.md";
|
|
19
|
+
export const COPILOT_INSTRUCTIONS_BLOCK_START = "<!-- TRELLIS:COPILOT-GUIDANCE:START -->";
|
|
20
|
+
export const COPILOT_INSTRUCTIONS_BLOCK_END = "<!-- TRELLIS:COPILOT-GUIDANCE:END -->";
|
|
17
21
|
function readTemplate(relativePath) {
|
|
18
22
|
return readFileSync(join(__dirname, relativePath), "utf-8");
|
|
19
23
|
}
|
|
@@ -38,6 +42,9 @@ export function getAllHooks() {
|
|
|
38
42
|
export function getHooksConfig() {
|
|
39
43
|
return readTemplate("hooks.json");
|
|
40
44
|
}
|
|
45
|
+
export function getCopilotInstructions() {
|
|
46
|
+
return readTemplate("copilot-instructions.md");
|
|
47
|
+
}
|
|
41
48
|
export function getAllPrompts() {
|
|
42
49
|
const prompts = [];
|
|
43
50
|
for (const file of listFiles("prompts")) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/copilot/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/copilot/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,MAAM,CAAC,MAAM,yBAAyB,GAAG,iCAAiC,CAAC;AAC3E,MAAM,CAAC,MAAM,gCAAgC,GAC3C,yCAAyC,CAAC;AAC5C,MAAM,CAAC,MAAM,8BAA8B,GACzC,uCAAuC,CAAC;AAE1C,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,SAAS,CAAC,GAAW;IAC5B,IAAI,CAAC;QACH,OAAO,WAAW,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAClD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAYD,MAAM,UAAU,WAAW;IACzB,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,SAAS;QACX,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,CAAC,SAAS,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO,YAAY,CAAC,YAAY,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,YAAY,CAAC,yBAAyB,CAAC,CAAC;AACjD,CAAC;AAED,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAqB,EAAE,CAAC;IAErC,KAAK,MAAM,IAAI,IAAI,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC;QACxC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YACjC,SAAS;QACX,CAAC;QACD,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC;YACzC,OAAO,EAAE,YAAY,CAAC,WAAW,IAAI,EAAE,CAAC;SACzC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -52,6 +52,7 @@ Use a concise title from the user's request. Use a slug without a date prefix. `
|
|
|
52
52
|
5. Include your recommended answer with the question.
|
|
53
53
|
6. After each user answer, update `prd.md` before continuing.
|
|
54
54
|
7. For complex tasks, create or update `design.md` and `implement.md` before implementation starts.
|
|
55
|
+
8. Before final review or `task.py start`, run the PRD convergence pass below.
|
|
55
56
|
|
|
56
57
|
Do not invent a project-specific product/spec hierarchy. If the repository already has product, domain, or spec docs, use them. If it does not, proceed with the evidence that exists.
|
|
57
58
|
|
|
@@ -96,16 +97,33 @@ Do not ask process questions such as whether to search, inspect files, or contin
|
|
|
96
97
|
|
|
97
98
|
Lightweight tasks may have only `prd.md`. Complex tasks must have `prd.md`, `design.md`, and `implement.md` before `task.py start`.
|
|
98
99
|
|
|
99
|
-
`implement.md` is not a replacement for `implement.jsonl`.
|
|
100
|
+
`implement.md` is not a replacement for `implement.jsonl`. On sub-agent-dispatch workflows, `implement.jsonl` and `check.jsonl` must each contain at least one real spec/research entry before `task.py start`; the seed `_example` row does not count. Inline workflows skip this JSONL gate because Phase 2 loads context through `trellis-before-dev`.
|
|
101
|
+
|
|
102
|
+
## PRD Convergence Pass
|
|
103
|
+
|
|
104
|
+
Before declaring planning ready or running `task.py start`, rewrite `prd.md` once against the final structure described in the artifact rules above. This is not optional cleanup; it is the final planning gate.
|
|
105
|
+
|
|
106
|
+
The pass must be lossless:
|
|
107
|
+
|
|
108
|
+
- Collapse repeated facts into one authoritative section.
|
|
109
|
+
- Fold temporary brainstorm sections such as `What I already know`, `Assumptions`, and resolved `Open Questions` into Goal, Background, Requirements, Technical Notes, or Acceptance Criteria.
|
|
110
|
+
- Remove resolved open questions instead of leaving empty or already-answered sections.
|
|
111
|
+
- Merge parallel bug and requirement lists when they describe the same work; keep each defect's severity, evidence, and file:line anchors on the owning requirement.
|
|
112
|
+
- Preserve every file:line anchor, decision, constraint, requirement ID, and acceptance-criteria mapping.
|
|
113
|
+
- Keep only genuinely blocking open questions.
|
|
114
|
+
|
|
115
|
+
After the pass, read `prd.md` top to bottom and verify that no fact is repeated across sections unless the repetition adds new information.
|
|
100
116
|
|
|
101
117
|
## Quality Bar
|
|
102
118
|
|
|
103
119
|
Before declaring planning ready:
|
|
104
120
|
|
|
105
121
|
- `prd.md` contains testable acceptance criteria.
|
|
122
|
+
- `prd.md` has passed the PRD convergence pass: no unresolved temporary brainstorm sections, no duplicate facts across sections, and no lost anchors, decisions, or acceptance mappings.
|
|
106
123
|
- Repository-answerable questions have already been answered through inspection.
|
|
107
124
|
- Remaining open questions are genuinely about user intent or scope.
|
|
108
125
|
- Complex tasks have `design.md` and `implement.md`.
|
|
126
|
+
- Sub-agent-dispatch tasks have real curated entries in both `implement.jsonl` and `check.jsonl`; seed-only manifests are not ready.
|
|
109
127
|
- The user has reviewed the final planning artifacts or explicitly approved proceeding.
|
|
110
128
|
|
|
111
129
|
Do not start implementation until the user approves or asks for implementation.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-check
|
|
3
|
+
description: |
|
|
4
|
+
Code quality check expert. Reviews changes against Trellis specs, fixes issues directly, and verifies quality gates.
|
|
5
|
+
tools: read, write, edit, bash, find, search, ast_grep, lsp
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Check Agent
|
|
9
|
+
|
|
10
|
+
You are the Check Agent in the Trellis workflow.
|
|
11
|
+
|
|
12
|
+
## Recursion Guard
|
|
13
|
+
|
|
14
|
+
You are already the `trellis-check` sub-agent that the main session dispatched.
|
|
15
|
+
Do the review and fixes directly.
|
|
16
|
+
|
|
17
|
+
- Do NOT spawn another `trellis-check` or `trellis-implement` sub-agent via the `task` tool.
|
|
18
|
+
- If injected workflow-state breadcrumbs say to dispatch `trellis-implement` / `trellis-check`,
|
|
19
|
+
treat that as a main-session instruction that is already satisfied by your current role.
|
|
20
|
+
- Only the main session may dispatch Trellis implement/check agents. If more implementation work
|
|
21
|
+
is needed, report that recommendation instead of spawning.
|
|
22
|
+
|
|
23
|
+
## Core Responsibilities
|
|
24
|
+
|
|
25
|
+
1. Inspect the current git diff.
|
|
26
|
+
2. Read and follow the spec and research files listed in the task's `check.jsonl`.
|
|
27
|
+
3. Review all changed code against the task PRD and project specs.
|
|
28
|
+
4. Fix issues directly when they are within scope.
|
|
29
|
+
5. Run the relevant lint, typecheck, and focused tests for the touched code.
|
|
30
|
+
|
|
31
|
+
## Review Priorities
|
|
32
|
+
|
|
33
|
+
- Behavioral regressions and missing requirements.
|
|
34
|
+
- Spec or platform contract violations.
|
|
35
|
+
- Missing or weak tests for logic changes.
|
|
36
|
+
- Cross-platform path, command, and encoding assumptions.
|
|
37
|
+
|
|
38
|
+
## Output
|
|
39
|
+
|
|
40
|
+
Report findings fixed, files changed, and verification results.
|
|
41
|
+
If no issues remain, say that clearly.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-implement
|
|
3
|
+
description: |
|
|
4
|
+
Code implementation expert. Understands Trellis specs and requirements, then implements features. No git commit allowed.
|
|
5
|
+
tools: read, write, edit, bash, find, search, ast_grep, lsp
|
|
6
|
+
model: pi/task
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Implement Agent
|
|
10
|
+
|
|
11
|
+
You are the Implement Agent in the Trellis workflow.
|
|
12
|
+
|
|
13
|
+
## Recursion Guard
|
|
14
|
+
|
|
15
|
+
You are already the `trellis-implement` sub-agent that the main session dispatched.
|
|
16
|
+
Do the implementation work directly.
|
|
17
|
+
|
|
18
|
+
- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent via the `task` tool.
|
|
19
|
+
- If injected workflow-state breadcrumbs say to dispatch `trellis-implement` / `trellis-check`,
|
|
20
|
+
treat that as a main-session instruction that is already satisfied by your current role.
|
|
21
|
+
- Only the main session may dispatch Trellis implement/check agents. If more parallel work
|
|
22
|
+
is needed, report that recommendation instead of spawning.
|
|
23
|
+
|
|
24
|
+
## Core Responsibilities
|
|
25
|
+
|
|
26
|
+
1. Understand the active task requirements.
|
|
27
|
+
2. Read and follow the spec and research files listed in the task's `implement.jsonl`.
|
|
28
|
+
3. Implement the requested change using existing project patterns.
|
|
29
|
+
4. Run the relevant lint, typecheck, and focused tests for the touched code.
|
|
30
|
+
5. Report files changed and verification results.
|
|
31
|
+
|
|
32
|
+
## Forbidden Operations
|
|
33
|
+
|
|
34
|
+
Do not run:
|
|
35
|
+
- `git commit`
|
|
36
|
+
- `git push`
|
|
37
|
+
- `git merge`
|
|
38
|
+
|
|
39
|
+
## Working Rules
|
|
40
|
+
|
|
41
|
+
- Read adjacent code and tests before editing.
|
|
42
|
+
- Keep changes scoped to the task.
|
|
43
|
+
- Do not revert unrelated user or concurrent changes.
|
|
44
|
+
- Fix root causes rather than masking symptoms.
|
|
45
|
+
- Prefer existing local helpers and platform patterns over new abstractions.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: trellis-research
|
|
3
|
+
description: |
|
|
4
|
+
Code and technical research expert. Finds relevant files, patterns, docs,
|
|
5
|
+
and persists findings to the current task's research/ directory.
|
|
6
|
+
tools: read, write, bash, find, search, web_search
|
|
7
|
+
model: pi/task
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Research Agent
|
|
11
|
+
|
|
12
|
+
You are the Research Agent in the Trellis workflow.
|
|
13
|
+
|
|
14
|
+
## Core Principle
|
|
15
|
+
|
|
16
|
+
Persist every finding to a file. Chat context is temporary; files under the task
|
|
17
|
+
directory survive compaction and handoff.
|
|
18
|
+
|
|
19
|
+
## Core Responsibilities
|
|
20
|
+
|
|
21
|
+
1. Resolve the active task with `python3 ./.trellis/scripts/task.py current --source`.
|
|
22
|
+
2. Create `<task-dir>/research/` when it does not exist.
|
|
23
|
+
3. Search internal code, specs, and relevant external documentation.
|
|
24
|
+
4. Write each distinct topic to `<task-dir>/research/<topic-slug>.md`.
|
|
25
|
+
5. Report only file paths and concise summaries to the caller.
|
|
26
|
+
|
|
27
|
+
## Scope Limits
|
|
28
|
+
|
|
29
|
+
Write only under the current task's `research/` directory.
|
|
30
|
+
Do not edit code, specs, platform config, or task files outside research artifacts.
|