@mindfoldhq/trellis 0.6.9 → 0.7.0-beta.0
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/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +0 -8
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/workflow.d.ts +6 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +124 -0
- package/dist/commands/workflow.js.map +1 -1
- package/dist/configurators/workflow.d.ts +0 -14
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +1 -37
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/manifests/0.6.10.json +9 -0
- package/dist/migrations/manifests/0.7.0-beta.0.json +9 -0
- package/dist/templates/claude/settings.json +22 -0
- package/dist/templates/codex/agents/trellis-check.toml +7 -5
- package/dist/templates/codex/agents/trellis-implement.toml +7 -5
- package/dist/templates/codex/agents/trellis-research.toml +13 -8
- package/dist/templates/codex/hooks/session-start.py +20 -1
- package/dist/templates/codex/hooks.json +25 -0
- package/dist/templates/copilot/hooks/session-start.py +20 -1
- package/dist/templates/opencode/plugins/inject-workflow-state.js +111 -10
- package/dist/templates/pi/extensions/trellis/index.ts.txt +4 -3
- package/dist/templates/shared-hooks/index.d.ts +5 -1
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +10 -1
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-spec-context.py +840 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +4 -3
- package/dist/templates/shared-hooks/inject-workflow-state.py +35 -9
- package/dist/templates/shared-hooks/session-start.py +22 -1
- package/dist/templates/trellis/config.yaml +47 -0
- package/dist/templates/trellis/index.d.ts +4 -3
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +7 -3
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +0 -45
- package/dist/templates/trellis/scripts/common/active_task.py +5 -2
- package/dist/templates/trellis/scripts/common/config.py +18 -0
- package/dist/templates/trellis/scripts/common/git_context.py +34 -2
- package/dist/templates/trellis/scripts/common/paths.py +28 -0
- package/dist/templates/trellis/scripts/common/spec_inject.py +439 -0
- package/dist/templates/trellis/scripts/common/spec_match.py +395 -0
- package/dist/templates/trellis/scripts/common/task_context.py +10 -8
- package/dist/templates/trellis/scripts/common/task_store.py +30 -0
- package/dist/templates/trellis/scripts/common/workflow_phase.py +3 -2
- package/dist/templates/trellis/scripts/common/workflow_selection.py +177 -0
- package/dist/templates/trellis/scripts/task.py +82 -0
- package/package.json +2 -2
- package/dist/templates/trellis/gitattributes.txt +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/commands/workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,GAGrB,MAAM,+BAA+B,CAAC;AAUvC,SAAS,gBAAgB,CAAC,GAAW;IACnC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAA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IAAI,GAAG,YAAY,oBAAoB,EAAE,CAAC;YACxC,MAAM,IAAI,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QACD,MAAM,GAAG,CAAC;IACZ,CAAC;IAED,MAAM,aAAa,CAAC,GAAG,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IAE5C,2DAA2D;IAC3D,6EAA6E;IAC7E,6EAA6E;IAC7E,8DAA8D;IAC9D,sBAAsB,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,sBAAsB,CAAC,GAAW,EAAE,eAAuB;IAClE,MAAM,OAAO,GAAG,oBAAoB,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC;IAC3D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IACjC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,KAAK,CAAC,MAAM,CACV,yDAAyD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,0CAA0C,CACrH;QACC,KAAK,CAAC,MAAM,CACV,4FAA4F,KAAK,CAAC,MAAM,MAAM,CAC/G,CACJ,CAAC;AACJ,CAAC"}
|
|
@@ -20,20 +20,6 @@ export interface WorkflowOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
workflowMdOverride?: string;
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
24
|
-
* Ensure the project-root `.gitattributes` carries the journal `merge=union`
|
|
25
|
-
* rule, without ever overwriting a user's existing file wholesale.
|
|
26
|
-
*
|
|
27
|
-
* - No `.gitattributes` yet: write the bundled template directly.
|
|
28
|
-
* - Existing file that already has a `journal-*.md merge=union` rule (user's
|
|
29
|
-
* own or from a previous `trellis init`/`update`): no-op, avoids duplicates.
|
|
30
|
-
* - Existing file without that rule: append the bundled template content.
|
|
31
|
-
*
|
|
32
|
-
* Intentionally does NOT go through the standard `writeFile` conflict-prompt
|
|
33
|
-
* flow — this file is additive-only and never a candidate for whole-file
|
|
34
|
-
* overwrite.
|
|
35
|
-
*/
|
|
36
|
-
export declare function ensureGitattributes(cwd: string): void;
|
|
37
23
|
/**
|
|
38
24
|
* Create workflow structure based on project type
|
|
39
25
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAuCA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,8BAA8B,CAAC;AAOtC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yCAAyC;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,kEAAkE;IAClE,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACjC;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,MAAM,EACX,OAAO,CAAC,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CA+Df"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
1
|
import path from "node:path";
|
|
3
2
|
import { DIR_NAMES, PATHS } from "../constants/paths.js";
|
|
4
3
|
import { copyTrellisDir } from "../templates/extract.js";
|
|
5
4
|
// Import trellis templates (generic, not project-specific)
|
|
6
|
-
import { workflowMdTemplate, configYamlTemplate, gitignoreTemplate,
|
|
5
|
+
import { workflowMdTemplate, configYamlTemplate, gitignoreTemplate, getAllAgents, } from "../templates/trellis/index.js";
|
|
7
6
|
// Import markdown templates
|
|
8
7
|
import { agentProgressIndexContent,
|
|
9
8
|
// Backend structure (multi-doc)
|
|
@@ -15,38 +14,6 @@ guidesIndexContent, guidesCrossLayerThinkingGuideContent, guidesCodeReuseThinkin
|
|
|
15
14
|
import { writeFile, ensureDir } from "../utils/file-writer.js";
|
|
16
15
|
import { replacePythonCommandLiterals } from "./shared.js";
|
|
17
16
|
import { sanitizePkgName, } from "../utils/project-detector.js";
|
|
18
|
-
/**
|
|
19
|
-
* Regex used to detect an existing `journal-*.md merge=union` gitattributes
|
|
20
|
-
* rule (any whitespace variant), so `ensureGitattributes` never appends a
|
|
21
|
-
* duplicate entry to a project's pre-existing `.gitattributes`.
|
|
22
|
-
*/
|
|
23
|
-
const JOURNAL_MERGE_UNION_PATTERN = /journal-\*\.md\s+merge=union/;
|
|
24
|
-
/**
|
|
25
|
-
* Ensure the project-root `.gitattributes` carries the journal `merge=union`
|
|
26
|
-
* rule, without ever overwriting a user's existing file wholesale.
|
|
27
|
-
*
|
|
28
|
-
* - No `.gitattributes` yet: write the bundled template directly.
|
|
29
|
-
* - Existing file that already has a `journal-*.md merge=union` rule (user's
|
|
30
|
-
* own or from a previous `trellis init`/`update`): no-op, avoids duplicates.
|
|
31
|
-
* - Existing file without that rule: append the bundled template content.
|
|
32
|
-
*
|
|
33
|
-
* Intentionally does NOT go through the standard `writeFile` conflict-prompt
|
|
34
|
-
* flow — this file is additive-only and never a candidate for whole-file
|
|
35
|
-
* overwrite.
|
|
36
|
-
*/
|
|
37
|
-
export function ensureGitattributes(cwd) {
|
|
38
|
-
const targetPath = path.join(cwd, ".gitattributes");
|
|
39
|
-
if (!fs.existsSync(targetPath)) {
|
|
40
|
-
fs.writeFileSync(targetPath, gitattributesTemplate);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
const existing = fs.readFileSync(targetPath, "utf-8");
|
|
44
|
-
if (JOURNAL_MERGE_UNION_PATTERN.test(existing)) {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
const separator = existing.endsWith("\n") ? "\n" : "\n\n";
|
|
48
|
-
fs.writeFileSync(targetPath, existing + separator + gitattributesTemplate);
|
|
49
|
-
}
|
|
50
17
|
/**
|
|
51
18
|
* Create workflow structure based on project type
|
|
52
19
|
*
|
|
@@ -78,9 +45,6 @@ export async function createWorkflowStructure(cwd, options) {
|
|
|
78
45
|
await writeFile(path.join(cwd, DIR_NAMES.WORKFLOW, ".gitignore"), gitignoreTemplate);
|
|
79
46
|
// Copy config.yaml from templates
|
|
80
47
|
await writeFile(path.join(cwd, DIR_NAMES.WORKFLOW, "config.yaml"), configYamlTemplate);
|
|
81
|
-
// Ensure project-root .gitattributes carries the journal merge=union rule
|
|
82
|
-
// (additive-only — never overwrites a user's existing file wholesale).
|
|
83
|
-
ensureGitattributes(cwd);
|
|
84
48
|
// Dispatch channel runtime agent definitions. These are platform-agnostic
|
|
85
49
|
// Trellis runtime files consumed by `trellis channel spawn --agent <name>`
|
|
86
50
|
// through `packages/cli/src/commands/channel/agent-loader.ts`. They are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,2DAA2D;AAC3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,+BAA+B,CAAC;AAEvC,4BAA4B;AAC5B,OAAO,EACL,yBAAyB;AACzB,gCAAgC;AAChC,mBAAmB,EACnB,gCAAgC,EAChC,gCAAgC,EAChC,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B;AAC3B,iCAAiC;AAC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IAAI,EAAE,8BAA8B;YACpC,OAAO,EAAE,mCAAmC;SAC7C;KACF,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACpC,sDAAsD;QACtD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,MAAM,OAAO,GAAG,eAAe,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC1C,IAAI,kBAAkB,EAAE,GAAG,CAAC,OAAO,CAAC;gBAAE,SAAS;YAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;YAC/D,SAAS,CAAC,WAAW,CAAC,CAAC;YACvB,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC;YAChE,MAAM,gBAAgB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;SAAM,CAAC;QACN,mBAAmB;QACnB,MAAM,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC,CAAC;IAClE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.6.10",
|
|
3
|
+
"description": "Python 3.9–3.11 task script compatibility, complete Codex hook context recovery, and correct fallback-session cleanup.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Bug Fixes:**\n- fix(scripts): restore Python 3.9–3.11 compatibility in `.trellis/scripts/common/task_context.py` by removing multiline nested f-strings (#476)\n- fix(codex): make `trellis-{implement,check,research}` recover saved `SubagentStart` output before trusting the injected marker (#465)\n- fix(scripts): make `task.py finish` clear the resolved fallback session while preserving ambiguous or unresolved sessions (#469)",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "Run `trellis update` to refresh task scripts and Codex sub-agent templates. No `--migrate` required."
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.7.0-beta.0",
|
|
3
|
+
"description": "Path-scoped dynamic spec loading for Claude Code and Codex, plus layered workflow selection per task, developer, and team.",
|
|
4
|
+
"breaking": false,
|
|
5
|
+
"recommendMigrate": false,
|
|
6
|
+
"changelog": "**Enhancements:**\n- feat(hooks): deliver path-scoped specs dynamically through Claude Code PostToolUse and Codex PreToolUse hooks, with documented session reset handling\n- feat(workflow): save workflow variants and resolve task, developer, team, and global selections through one runtime chain",
|
|
7
|
+
"migrations": [],
|
|
8
|
+
"notes": "Run `trellis update` to install the new spec-injection hooks, workflow library support, and layered workflow resolver. No `--migrate` required."
|
|
9
|
+
}
|
|
@@ -21,6 +21,11 @@
|
|
|
21
21
|
"type": "command",
|
|
22
22
|
"command": "{{PYTHON_CMD}} .claude/hooks/session-start.py",
|
|
23
23
|
"timeout": 30
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "command",
|
|
27
|
+
"command": "{{PYTHON_CMD}} .claude/hooks/inject-spec-context.py",
|
|
28
|
+
"timeout": 30
|
|
24
29
|
}
|
|
25
30
|
]
|
|
26
31
|
},
|
|
@@ -31,6 +36,11 @@
|
|
|
31
36
|
"type": "command",
|
|
32
37
|
"command": "{{PYTHON_CMD}} .claude/hooks/session-start.py",
|
|
33
38
|
"timeout": 30
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"type": "command",
|
|
42
|
+
"command": "{{PYTHON_CMD}} .claude/hooks/inject-spec-context.py",
|
|
43
|
+
"timeout": 30
|
|
34
44
|
}
|
|
35
45
|
]
|
|
36
46
|
}
|
|
@@ -57,6 +67,18 @@
|
|
|
57
67
|
]
|
|
58
68
|
}
|
|
59
69
|
],
|
|
70
|
+
"PostToolUse": [
|
|
71
|
+
{
|
|
72
|
+
"matcher": "Read|Edit|Write|MultiEdit",
|
|
73
|
+
"hooks": [
|
|
74
|
+
{
|
|
75
|
+
"type": "command",
|
|
76
|
+
"command": "{{PYTHON_CMD}} .claude/hooks/inject-spec-context.py",
|
|
77
|
+
"timeout": 15
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
],
|
|
60
82
|
"UserPromptSubmit": [
|
|
61
83
|
{
|
|
62
84
|
"hooks": [
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
name = "trellis-check"
|
|
2
2
|
description = "Workspace-write Trellis reviewer that self-fixes spec drift, lint/type-check failures, and missing tests."
|
|
3
3
|
sandbox_mode = "workspace-write"
|
|
4
|
-
# model = "gpt-5.
|
|
5
|
-
# model_reasoning_effort = "
|
|
4
|
+
# model = "gpt-5.4"
|
|
5
|
+
# model_reasoning_effort = "low"
|
|
6
6
|
|
|
7
7
|
developer_instructions = """
|
|
8
8
|
You are running as the `trellis-check` sub-agent. The main session has dispatched you to review and self-fix.
|
|
@@ -17,9 +17,11 @@ CRITICAL — Recursion guard (read first):
|
|
|
17
17
|
You are the Trellis reviewer agent.
|
|
18
18
|
|
|
19
19
|
Trellis Context Loading Protocol:
|
|
20
|
-
-
|
|
21
|
-
- If the
|
|
22
|
-
- If
|
|
20
|
+
- First look for `Full hook output saved to: <path>` in your input above. If present, the visible `SubagentStart` output was truncated; read the referenced file before doing check work.
|
|
21
|
+
- If the referenced file cannot be read, use the active-task fallback below.
|
|
22
|
+
- If there is no saved-output notice and the `<!-- trellis-hook-injected -->` marker is present, the hook loaded the complete role-specific task artifacts and spec context.
|
|
23
|
+
- If there is no saved-output notice and the marker is absent, use the active-task fallback below.
|
|
24
|
+
- For the fallback, find `Active task: <path>` in your dispatch prompt. Read `<path>/check.jsonl`, each file listed there, `<path>/prd.md`, `<path>/design.md` if present, and `<path>/implement.md` if present before checking. If the dispatch prompt has no active-task path, ask the main session; do not guess or use another session's task.
|
|
23
25
|
|
|
24
26
|
Your job is to review code changes against specs AND fix issues directly — not just report them. You have write access; use it.
|
|
25
27
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
name = "trellis-implement"
|
|
2
2
|
description = "Workspace-write Trellis implementer that follows specs and keeps generated templates in sync."
|
|
3
3
|
sandbox_mode = "workspace-write"
|
|
4
|
-
# model = "gpt-5.
|
|
5
|
-
# model_reasoning_effort = "
|
|
4
|
+
# model = "gpt-5.4"
|
|
5
|
+
# model_reasoning_effort = "low"
|
|
6
6
|
|
|
7
7
|
developer_instructions = """
|
|
8
8
|
You are running as the `trellis-implement` sub-agent. The main session has dispatched you to do the work.
|
|
@@ -17,9 +17,11 @@ CRITICAL — Recursion guard (read first):
|
|
|
17
17
|
You are the Trellis implementer agent.
|
|
18
18
|
|
|
19
19
|
Trellis Context Loading Protocol:
|
|
20
|
-
-
|
|
21
|
-
- If the
|
|
22
|
-
- If
|
|
20
|
+
- First look for `Full hook output saved to: <path>` in your input above. If present, the visible `SubagentStart` output was truncated; read the referenced file before doing implementation work.
|
|
21
|
+
- If the referenced file cannot be read, use the active-task fallback below.
|
|
22
|
+
- If there is no saved-output notice and the `<!-- trellis-hook-injected -->` marker is present, the hook loaded the complete role-specific task artifacts and spec context.
|
|
23
|
+
- If there is no saved-output notice and the marker is absent, use the active-task fallback below.
|
|
24
|
+
- For the fallback, find `Active task: <path>` in your dispatch prompt. Read `<path>/implement.jsonl`, each file listed there, `<path>/prd.md`, `<path>/design.md` if present, and `<path>/implement.md` if present before doing the work. If the dispatch prompt has no active-task path, ask the main session; do not guess or use another session's task.
|
|
23
25
|
|
|
24
26
|
Rules:
|
|
25
27
|
- Read before write. Follow `.trellis/spec/` guidance relevant to the task.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
name = "trellis-research"
|
|
2
2
|
description = "Trellis researcher for specs, code patterns, and affected files. Writes findings into {TASK_DIR}/research/ — read-only elsewhere."
|
|
3
3
|
sandbox_mode = "workspace-write"
|
|
4
|
-
# model = "gpt-5.
|
|
5
|
-
# model_reasoning_effort = "
|
|
4
|
+
# model = "gpt-5.4"
|
|
5
|
+
# model_reasoning_effort = "low"
|
|
6
6
|
|
|
7
7
|
developer_instructions = """
|
|
8
8
|
You are the Trellis researcher agent.
|
|
@@ -15,12 +15,17 @@ through the chat reply is a failure.
|
|
|
15
15
|
|
|
16
16
|
## Trellis Context Loading Protocol
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- If
|
|
23
|
-
|
|
18
|
+
- First look for `Full hook output saved to: <path>` in your input above. If
|
|
19
|
+
present, the visible `SubagentStart` output was truncated; read the referenced
|
|
20
|
+
file before doing research work.
|
|
21
|
+
- If the referenced file cannot be read, use the active-task fallback below.
|
|
22
|
+
- If there is no saved-output notice and the
|
|
23
|
+
`<!-- trellis-hook-injected -->` marker is present, the hook supplied the
|
|
24
|
+
complete `Active task: <path>` header and research-only context.
|
|
25
|
+
- If there is no saved-output notice and the marker is absent, use the
|
|
26
|
+
active-task fallback below.
|
|
27
|
+
- For the fallback, find `Active task: <path>` in your dispatch prompt. If it
|
|
28
|
+
is absent too, ask the main session for the path; do not run
|
|
24
29
|
`task.py current`, guess, or use another session's task.
|
|
25
30
|
- Do not load `implement.jsonl` or `check.jsonl`; research is role-isolated.
|
|
26
31
|
|
|
@@ -452,6 +452,25 @@ def _strip_breadcrumb_tag_blocks(content: str) -> str:
|
|
|
452
452
|
return re.sub(r"\n{3,}", "\n\n", stripped).strip()
|
|
453
453
|
|
|
454
454
|
|
|
455
|
+
def _resolve_workflow_md(root: Path, input_data: dict) -> Path:
|
|
456
|
+
"""Resolve the active task's workflow file, falling back to the global one.
|
|
457
|
+
|
|
458
|
+
The per-task resolution rule lives in common.workflow_selection inside
|
|
459
|
+
.trellis/scripts. Older installed projects may not ship that module, and
|
|
460
|
+
hooks must never crash the session — ANY failure (import error, old
|
|
461
|
+
scripts tree, resolver bug) falls back to the global workflow.md.
|
|
462
|
+
"""
|
|
463
|
+
try:
|
|
464
|
+
scripts_dir = root / ".trellis" / "scripts"
|
|
465
|
+
if str(scripts_dir) not in sys.path:
|
|
466
|
+
sys.path.insert(0, str(scripts_dir))
|
|
467
|
+
from common.workflow_selection import resolve_workflow_md # type: ignore[import-not-found]
|
|
468
|
+
|
|
469
|
+
return resolve_workflow_md(root, input_data, platform="codex")
|
|
470
|
+
except Exception:
|
|
471
|
+
return root / ".trellis" / "workflow.md"
|
|
472
|
+
|
|
473
|
+
|
|
455
474
|
def _build_workflow_toc(workflow_path: Path) -> str:
|
|
456
475
|
"""Inject only the compact Phase Index summary for SessionStart."""
|
|
457
476
|
content = read_file(workflow_path)
|
|
@@ -505,7 +524,7 @@ Trellis compact SessionStart context. Use it to orient the session; load details
|
|
|
505
524
|
output.write("\n</current-state>\n\n")
|
|
506
525
|
|
|
507
526
|
output.write("<trellis-workflow>\n")
|
|
508
|
-
output.write(_build_workflow_toc(
|
|
527
|
+
output.write(_build_workflow_toc(_resolve_workflow_md(project_dir, hook_input)))
|
|
509
528
|
output.write("\n</trellis-workflow>\n\n")
|
|
510
529
|
|
|
511
530
|
output.write("<guidelines>\n")
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"hooks": {
|
|
3
|
+
"SessionStart": [
|
|
4
|
+
{
|
|
5
|
+
"matcher": "^(?:clear|compact)$",
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "{{PYTHON_CMD}} -X utf8 .codex/hooks/inject-spec-context.py",
|
|
10
|
+
"timeout": 15
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
3
15
|
"UserPromptSubmit": [
|
|
4
16
|
{
|
|
5
17
|
"hooks": [
|
|
@@ -22,6 +34,19 @@
|
|
|
22
34
|
}
|
|
23
35
|
]
|
|
24
36
|
}
|
|
37
|
+
],
|
|
38
|
+
"PreToolUse": [
|
|
39
|
+
{
|
|
40
|
+
"matcher": "Edit|Write",
|
|
41
|
+
"hooks": [
|
|
42
|
+
{
|
|
43
|
+
"type": "command",
|
|
44
|
+
"command": "{{PYTHON_CMD}} -X utf8 .codex/hooks/inject-spec-context.py",
|
|
45
|
+
"timeout": 15,
|
|
46
|
+
"additionalContextLimit": 0
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
25
50
|
]
|
|
26
51
|
}
|
|
27
52
|
}
|
|
@@ -451,6 +451,25 @@ def _strip_breadcrumb_tag_blocks(content: str) -> str:
|
|
|
451
451
|
return re.sub(r"\n{3,}", "\n\n", stripped).strip()
|
|
452
452
|
|
|
453
453
|
|
|
454
|
+
def _resolve_workflow_md(root: Path, input_data: dict) -> Path:
|
|
455
|
+
"""Resolve the active task's workflow file, falling back to the global one.
|
|
456
|
+
|
|
457
|
+
The per-task resolution rule lives in common.workflow_selection inside
|
|
458
|
+
.trellis/scripts. Older installed projects may not ship that module, and
|
|
459
|
+
hooks must never crash the session — ANY failure (import error, old
|
|
460
|
+
scripts tree, resolver bug) falls back to the global workflow.md.
|
|
461
|
+
"""
|
|
462
|
+
try:
|
|
463
|
+
scripts_dir = root / ".trellis" / "scripts"
|
|
464
|
+
if str(scripts_dir) not in sys.path:
|
|
465
|
+
sys.path.insert(0, str(scripts_dir))
|
|
466
|
+
from common.workflow_selection import resolve_workflow_md # type: ignore[import-not-found]
|
|
467
|
+
|
|
468
|
+
return resolve_workflow_md(root, input_data, platform="copilot")
|
|
469
|
+
except Exception:
|
|
470
|
+
return root / ".trellis" / "workflow.md"
|
|
471
|
+
|
|
472
|
+
|
|
454
473
|
def _build_workflow_toc(workflow_path: Path) -> str:
|
|
455
474
|
"""Inject only the compact Phase Index summary for SessionStart."""
|
|
456
475
|
content = read_file(workflow_path)
|
|
@@ -502,7 +521,7 @@ Trellis compact SessionStart context. Use it to orient the session; load details
|
|
|
502
521
|
output.write("\n</current-state>\n\n")
|
|
503
522
|
|
|
504
523
|
output.write("<trellis-workflow>\n")
|
|
505
|
-
output.write(_build_workflow_toc(
|
|
524
|
+
output.write(_build_workflow_toc(_resolve_workflow_md(project_dir, hook_input)))
|
|
506
525
|
output.write("\n</trellis-workflow>\n\n")
|
|
507
526
|
|
|
508
527
|
output.write("<guidelines>\n")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* global process */
|
|
1
|
+
/* global process, console */
|
|
2
2
|
/**
|
|
3
3
|
* Trellis Workflow State Injection Plugin
|
|
4
4
|
*
|
|
@@ -8,7 +8,12 @@
|
|
|
8
8
|
* <workflow-state> breadcrumb reminding the main AI what task is
|
|
9
9
|
* active and its expected flow. Breadcrumb text is pulled exclusively
|
|
10
10
|
* from the project's workflow.md [workflow-state:STATUS] tag blocks —
|
|
11
|
-
* workflow.md is the single source of truth.
|
|
11
|
+
* workflow.md is the single source of truth. When the active task's
|
|
12
|
+
* task.json selects a workflow variant ("workflow": "<id>"), the tag
|
|
13
|
+
* blocks are read from .trellis/workflows/<id>.md instead (missing
|
|
14
|
+
* variant file → one stderr warning + fallback through personal/team/global
|
|
15
|
+
* defaults; see
|
|
16
|
+
* resolveWorkflowMd). There are no fallback
|
|
12
17
|
* tables in this plugin: when workflow.md is missing or a tag is
|
|
13
18
|
* absent, the breadcrumb degrades to a generic
|
|
14
19
|
* "Refer to workflow.md for current step." line so users see (and fix)
|
|
@@ -23,7 +28,7 @@
|
|
|
23
28
|
* - task.json malformed or missing status
|
|
24
29
|
*/
|
|
25
30
|
|
|
26
|
-
import { existsSync, readFileSync } from "fs"
|
|
31
|
+
import { existsSync, readFileSync, statSync } from "fs"
|
|
27
32
|
import { join } from "path"
|
|
28
33
|
import { TrellisContext, debugLog, isTrellisSubagent } from "../lib/trellis-context.js"
|
|
29
34
|
|
|
@@ -107,17 +112,113 @@ function promptHasSkipKeyword(text, keyword) {
|
|
|
107
112
|
return pattern.test(text)
|
|
108
113
|
}
|
|
109
114
|
|
|
115
|
+
// Per-task workflow selection (mirrors the Python resolver in
|
|
116
|
+
// .trellis/scripts/common/workflow_selection.py). Ids are restricted to
|
|
117
|
+
// [A-Za-z0-9_-]+ so a task.json value can never traverse outside
|
|
118
|
+
// .trellis/workflows/.
|
|
119
|
+
const WORKFLOW_ID_RE = /^[A-Za-z0-9_-]+$/
|
|
120
|
+
|
|
121
|
+
// Map a workflow id to its .trellis/workflows/<id>.md file if valid and
|
|
122
|
+
// present, else "". Shared by every resolution layer. Never throws.
|
|
123
|
+
function libraryVariant(directory, workflowId) {
|
|
124
|
+
if (!workflowId || !WORKFLOW_ID_RE.test(workflowId)) return ""
|
|
125
|
+
const variantPath = join(directory, ".trellis", "workflows", `${workflowId}.md`)
|
|
126
|
+
try {
|
|
127
|
+
if (statSync(variantPath).isFile()) return variantPath
|
|
128
|
+
} catch {
|
|
129
|
+
// ENOENT etc. — missing variant file.
|
|
130
|
+
}
|
|
131
|
+
return ""
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Personal override id from the gitignored .developer file (`workflow=<id>`
|
|
135
|
+
// line). "" when absent/unreadable. Never throws.
|
|
136
|
+
function developerWorkflowId(directory) {
|
|
137
|
+
try {
|
|
138
|
+
const text = readFileSync(join(directory, ".trellis", ".developer"), "utf-8")
|
|
139
|
+
for (const line of text.split(/\r?\n/)) {
|
|
140
|
+
if (line.startsWith("workflow=")) return line.slice("workflow=".length).trim()
|
|
141
|
+
}
|
|
142
|
+
} catch {
|
|
143
|
+
// No .developer / unreadable — no personal override.
|
|
144
|
+
}
|
|
145
|
+
return ""
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Team-shared default id from config.yaml's top-level `default_workflow:` key.
|
|
149
|
+
// Commented lines (starting with '#') are naturally excluded by the anchor.
|
|
150
|
+
// "" when unset/unreadable. Never throws.
|
|
151
|
+
const DEFAULT_WORKFLOW_RE = /^default_workflow:\s*(['"]?)([A-Za-z0-9_-]+)\1\s*(?:#.*)?$/m
|
|
152
|
+
function configDefaultWorkflowId(directory) {
|
|
153
|
+
try {
|
|
154
|
+
const text = readFileSync(join(directory, ".trellis", "config.yaml"), "utf-8")
|
|
155
|
+
const m = text.match(DEFAULT_WORKFLOW_RE)
|
|
156
|
+
if (m) return m[2]
|
|
157
|
+
} catch {
|
|
158
|
+
// No config.yaml / unreadable — no team default.
|
|
159
|
+
}
|
|
160
|
+
return ""
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Resolve which workflow markdown file feeds this turn's breadcrumbs.
|
|
165
|
+
*
|
|
166
|
+
* Precedence (identical across all Trellis consumers), highest to lowest —
|
|
167
|
+
* each layer resolves an id to .trellis/workflows/<id>.md and falls through
|
|
168
|
+
* when unset, invalid, or naming a missing file:
|
|
169
|
+
* 1. Per-task pin — active task's task.json "workflow" (session-bound; a
|
|
170
|
+
* bad id / missing file warns once on stderr, then falls through).
|
|
171
|
+
* 2. Personal — .developer `workflow=<id>` (gitignored, per-developer).
|
|
172
|
+
* 3. Team default — config.yaml `default_workflow` (git-tracked, shared).
|
|
173
|
+
* 4. Global — .trellis/workflow.md.
|
|
174
|
+
* With neither a pin nor the personal/team keys set, this is the global path.
|
|
175
|
+
* Never throws.
|
|
176
|
+
*/
|
|
177
|
+
function resolveWorkflowMd(ctx, directory, platformInput) {
|
|
178
|
+
const globalPath = join(directory, ".trellis", "workflow.md")
|
|
179
|
+
|
|
180
|
+
// 1. Per-task pin (session-bound explicit choice).
|
|
181
|
+
let workflowId = ""
|
|
182
|
+
try {
|
|
183
|
+
const active = ctx.getActiveTask(platformInput)
|
|
184
|
+
if (active.taskPath && !active.stale) {
|
|
185
|
+
const taskDir = ctx.resolveTaskDir(active.taskPath)
|
|
186
|
+
if (taskDir) {
|
|
187
|
+
const data = JSON.parse(readFileSync(join(taskDir, "task.json"), "utf-8"))
|
|
188
|
+
if (data && typeof data.workflow === "string") workflowId = data.workflow
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
} catch {
|
|
192
|
+
// No active task / unreadable task.json — not a selection.
|
|
193
|
+
workflowId = ""
|
|
194
|
+
}
|
|
195
|
+
if (workflowId) {
|
|
196
|
+
const pinned = libraryVariant(directory, workflowId)
|
|
197
|
+
if (pinned) return pinned
|
|
198
|
+
console.error(
|
|
199
|
+
`Warning: active task selects workflow ${JSON.stringify(workflowId)} but .trellis/workflows/ has no matching file; using default workflow resolution`,
|
|
200
|
+
)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// 2. Personal override, then 3. team default — silent on miss (defaults,
|
|
204
|
+
// not an explicit per-task choice). 4. Global fallback.
|
|
205
|
+
const personal = libraryVariant(directory, developerWorkflowId(directory))
|
|
206
|
+
if (personal) return personal
|
|
207
|
+
const team = libraryVariant(directory, configDefaultWorkflowId(directory))
|
|
208
|
+
if (team) return team
|
|
209
|
+
return globalPath
|
|
210
|
+
}
|
|
211
|
+
|
|
110
212
|
/**
|
|
111
|
-
* Parse workflow
|
|
213
|
+
* Parse the resolved workflow markdown for [workflow-state:STATUS] blocks.
|
|
112
214
|
*
|
|
113
|
-
* Returns {status: body}. workflow
|
|
114
|
-
* there are no fallback tables here. Missing tags (or a missing /
|
|
115
|
-
* unreadable workflow
|
|
215
|
+
* Returns {status: body}. The workflow file is the single source of
|
|
216
|
+
* truth — there are no fallback tables here. Missing tags (or a missing /
|
|
217
|
+
* unreadable workflow file) fall back to a generic line in
|
|
116
218
|
* buildBreadcrumb so users see the broken state and fix workflow.md
|
|
117
219
|
* rather than the plugin silently masking it.
|
|
118
220
|
*/
|
|
119
|
-
function loadBreadcrumbs(
|
|
120
|
-
const workflowPath = join(directory, ".trellis", "workflow.md")
|
|
221
|
+
function loadBreadcrumbs(workflowPath) {
|
|
121
222
|
if (!existsSync(workflowPath)) return {}
|
|
122
223
|
let content
|
|
123
224
|
try {
|
|
@@ -214,7 +315,7 @@ export default async ({ directory }) => {
|
|
|
214
315
|
return
|
|
215
316
|
}
|
|
216
317
|
|
|
217
|
-
const templates = loadBreadcrumbs(directory)
|
|
318
|
+
const templates = loadBreadcrumbs(resolveWorkflowMd(ctx, directory, input))
|
|
218
319
|
const task = getActiveTask(ctx, input)
|
|
219
320
|
const breadcrumb = task
|
|
220
321
|
? buildBreadcrumb(task.id, task.status, templates, task.source)
|
|
@@ -758,10 +758,11 @@ function truncateUtf8(buf: Buffer, cap: number): Buffer {
|
|
|
758
758
|
if ((lead & 0xe0) === 0xc0) seqLen = 2;
|
|
759
759
|
else if ((lead & 0xf0) === 0xe0) seqLen = 3;
|
|
760
760
|
else if ((lead & 0xf8) === 0xf0) seqLen = 4;
|
|
761
|
-
//
|
|
762
|
-
|
|
761
|
+
// Cut before the lead byte when its full sequence didn't fit;
|
|
762
|
+
// otherwise the trailing sequence is complete — keep it whole.
|
|
763
|
+
if (i - 1 + seqLen > cap) return buf.subarray(0, i - 1);
|
|
763
764
|
}
|
|
764
|
-
return buf.subarray(0,
|
|
765
|
+
return buf.subarray(0, cap);
|
|
765
766
|
}
|
|
766
767
|
|
|
767
768
|
function stripInlineComment(value: string): string {
|
|
@@ -11,7 +11,7 @@ export interface HookScript {
|
|
|
11
11
|
/** Script content — no placeholders, ready to write directly */
|
|
12
12
|
content: string;
|
|
13
13
|
}
|
|
14
|
-
export type SharedHookName = "session-start.py" | "inject-shell-session-context.py" | "inject-workflow-state.py" | "inject-subagent-context.py";
|
|
14
|
+
export type SharedHookName = "session-start.py" | "inject-shell-session-context.py" | "inject-workflow-state.py" | "inject-subagent-context.py" | "inject-spec-context.py";
|
|
15
15
|
export type SharedHookPlatform = "claude" | "cursor" | "codex" | "gemini" | "qoder" | "copilot" | "codebuddy" | "droid" | "kiro" | "trae" | "zcode";
|
|
16
16
|
/**
|
|
17
17
|
* Which shared hooks each platform actually invokes. Single source of truth
|
|
@@ -38,6 +38,10 @@ export type SharedHookPlatform = "claude" | "cursor" | "codex" | "gemini" | "qod
|
|
|
38
38
|
* (per-turn breadcrumb), and `inject-subagent-context.py` (sub-agent
|
|
39
39
|
* spawn). The scripts emit a plain-text Kiro branch — Kiro adds a hook's
|
|
40
40
|
* stdout directly to the conversation context (no JSON envelope).
|
|
41
|
+
* - `inject-spec-context.py` — path-scoped spec injection. Claude Code uses
|
|
42
|
+
* PostToolUse Read/Edit/Write/MultiEdit; Codex uses PreToolUse Edit|Write
|
|
43
|
+
* and parses the native apply_patch payload. Class-2 platforms use
|
|
44
|
+
* `get_context.py --mode spec` pull mode instead.
|
|
41
45
|
* - Claude Code `statusLine` is intentionally not installed by default.
|
|
42
46
|
* Users can add their own statusLine command in `.claude/settings.json`,
|
|
43
47
|
* or opt in to the Trellis one via `trellis init --with-statusline`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/shared-hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,0BAA0B,GAC1B,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/shared-hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,0BAA0B,GAC1B,4BAA4B,GAC5B,wBAAwB,CAAC;AAE7B,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,GACN,MAAM,GACN,OAAO,CAAC;AAEZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,kBAAkB,EAClB,SAAS,cAAc,EAAE,CA0C1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,EAAE,CAWnD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,kBAAkB,GAC3B,UAAU,EAAE,CAGd"}
|