@mindfoldhq/trellis 0.1.9 → 0.2.1
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/init.d.ts.map +1 -1
- package/dist/commands/init.js +12 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +669 -38
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/opencode.js +1 -1
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/workflow.d.ts +4 -3
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +23 -20
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/constants/paths.d.ts +29 -30
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +32 -35
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/index.d.ts +35 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +124 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/manifests/0.1.9.json +30 -0
- package/dist/migrations/manifests/0.2.0.json +43 -0
- package/dist/templates/claude/agents/check.md +3 -3
- package/dist/templates/claude/agents/debug.md +1 -1
- package/dist/templates/claude/agents/dispatch.md +12 -12
- package/dist/templates/claude/agents/implement.md +6 -6
- package/dist/templates/claude/agents/plan.md +37 -37
- package/dist/templates/claude/agents/research.md +1 -1
- package/dist/templates/claude/commands/before-backend-dev.md +5 -5
- package/dist/templates/claude/commands/before-frontend-dev.md +5 -5
- package/dist/templates/claude/commands/break-loop.md +2 -2
- package/dist/templates/claude/commands/check-backend.md +6 -6
- package/dist/templates/claude/commands/check-cross-layer.md +5 -5
- package/dist/templates/claude/commands/check-frontend.md +6 -6
- package/dist/templates/claude/commands/create-command.md +3 -3
- package/dist/templates/claude/commands/finish-work.md +6 -6
- package/dist/templates/claude/commands/integrate-skill.md +11 -11
- package/dist/templates/claude/commands/{onboard-developer.md → onboard.md} +31 -28
- package/dist/templates/claude/commands/parallel.md +17 -17
- package/dist/templates/claude/commands/{record-agent-flow.md → record-session.md} +7 -7
- package/dist/templates/claude/commands/start.md +36 -36
- package/dist/templates/claude/hooks/inject-subagent-context.py +77 -76
- package/dist/templates/claude/hooks/ralph-loop.py +18 -18
- package/dist/templates/claude/hooks/session-start.py +4 -4
- package/dist/templates/cursor/commands/before-backend-dev.md +5 -5
- package/dist/templates/cursor/commands/before-frontend-dev.md +5 -5
- package/dist/templates/cursor/commands/break-loop.md +2 -2
- package/dist/templates/cursor/commands/check-backend.md +6 -6
- package/dist/templates/cursor/commands/check-cross-layer.md +5 -5
- package/dist/templates/cursor/commands/check-frontend.md +6 -6
- package/dist/templates/cursor/commands/create-command.md +3 -3
- package/dist/templates/cursor/commands/finish-work.md +6 -6
- package/dist/templates/cursor/commands/integrate-skill.md +11 -11
- package/dist/templates/cursor/commands/{onboard-developer.md → onboard.md} +31 -28
- package/dist/templates/cursor/commands/{record-agent-flow.md → record-session.md} +7 -7
- package/dist/templates/cursor/commands/start.md +25 -25
- package/dist/templates/extract.d.ts +2 -2
- package/dist/templates/extract.js +2 -2
- package/dist/templates/markdown/agents.md +2 -2
- package/dist/templates/markdown/gitignore.txt +2 -2
- package/dist/templates/markdown/index.d.ts +1 -0
- package/dist/templates/markdown/index.d.ts.map +1 -1
- package/dist/templates/markdown/index.js +4 -2
- package/dist/templates/markdown/index.js.map +1 -1
- package/dist/templates/markdown/{agent-traces-index.md → workspace-index.md} +14 -14
- package/dist/templates/trellis/index.d.ts +7 -1
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +14 -2
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add-session.sh +26 -26
- package/dist/templates/trellis/scripts/common/developer.sh +20 -21
- package/dist/templates/trellis/scripts/common/git-context.sh +90 -115
- package/dist/templates/trellis/scripts/common/paths.sh +53 -63
- package/dist/templates/trellis/scripts/common/phase.sh +40 -40
- package/dist/templates/trellis/scripts/common/registry.sh +13 -13
- package/dist/templates/trellis/scripts/common/task-queue.sh +142 -0
- package/dist/templates/trellis/scripts/common/task-utils.sh +151 -0
- package/dist/templates/trellis/scripts/common/worktree.sh +3 -3
- package/dist/templates/trellis/scripts/create-bootstrap.sh +43 -42
- package/dist/templates/trellis/scripts/init-developer.sh +1 -1
- package/dist/templates/trellis/scripts/multi-agent/cleanup.sh +33 -33
- package/dist/templates/trellis/scripts/multi-agent/create-pr.sh +30 -30
- package/dist/templates/trellis/scripts/multi-agent/plan.sh +28 -28
- package/dist/templates/trellis/scripts/multi-agent/start.sh +56 -56
- package/dist/templates/trellis/scripts/multi-agent/status.sh +59 -59
- package/dist/templates/trellis/scripts/{feature.sh → task.sh} +235 -185
- package/dist/templates/trellis/workflow.md +71 -74
- package/dist/types/migration.d.ts +74 -0
- package/dist/types/migration.d.ts.map +1 -0
- package/dist/types/migration.js +8 -0
- package/dist/types/migration.js.map +1 -0
- package/dist/utils/template-hash.d.ts +78 -0
- package/dist/utils/template-hash.d.ts.map +1 -0
- package/dist/utils/template-hash.js +234 -0
- package/dist/utils/template-hash.js.map +1 -0
- package/package.json +1 -1
- package/dist/templates/trellis/scripts/common/backlog.sh +0 -220
- package/dist/templates/trellis/scripts/common/feature-utils.sh +0 -194
- /package/dist/templates/trellis/{backlog → tasks}/.gitkeep +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Migration manifests for Trellis versions
|
|
3
|
+
*
|
|
4
|
+
* Each version's migrations are stored in separate JSON files under manifests/
|
|
5
|
+
* Format: manifests/{version}.json (e.g., manifests/0.1.9.json)
|
|
6
|
+
*/
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
11
|
+
const MANIFESTS_DIR = path.join(__dirname, "manifests");
|
|
12
|
+
/**
|
|
13
|
+
* Cache for loaded manifests
|
|
14
|
+
*/
|
|
15
|
+
let manifestCache = null;
|
|
16
|
+
/**
|
|
17
|
+
* Load all migration manifests from JSON files
|
|
18
|
+
*/
|
|
19
|
+
function loadManifests() {
|
|
20
|
+
if (manifestCache) {
|
|
21
|
+
return manifestCache;
|
|
22
|
+
}
|
|
23
|
+
const manifests = {};
|
|
24
|
+
// Check if manifests directory exists
|
|
25
|
+
if (!fs.existsSync(MANIFESTS_DIR)) {
|
|
26
|
+
manifestCache = manifests;
|
|
27
|
+
return manifests;
|
|
28
|
+
}
|
|
29
|
+
// Load all JSON files from manifests directory
|
|
30
|
+
const files = fs.readdirSync(MANIFESTS_DIR).filter((f) => f.endsWith(".json"));
|
|
31
|
+
for (const file of files) {
|
|
32
|
+
try {
|
|
33
|
+
const filePath = path.join(MANIFESTS_DIR, file);
|
|
34
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
35
|
+
const manifest = JSON.parse(content);
|
|
36
|
+
// Use version from manifest as key
|
|
37
|
+
if (manifest.version) {
|
|
38
|
+
manifests[manifest.version] = manifest;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// Skip invalid manifest files
|
|
43
|
+
console.warn(`Warning: Failed to load migration manifest ${file}`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
manifestCache = manifests;
|
|
47
|
+
return manifests;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Compare two semver versions
|
|
51
|
+
* Returns: -1 if a < b, 0 if a == b, 1 if a > b
|
|
52
|
+
*/
|
|
53
|
+
function compareVersions(a, b) {
|
|
54
|
+
const parseVersion = (v) => v.split(".").map((n) => parseInt(n, 10) || 0);
|
|
55
|
+
const aParts = parseVersion(a);
|
|
56
|
+
const bParts = parseVersion(b);
|
|
57
|
+
const maxLen = Math.max(aParts.length, bParts.length);
|
|
58
|
+
for (let i = 0; i < maxLen; i++) {
|
|
59
|
+
const aVal = aParts[i] ?? 0;
|
|
60
|
+
const bVal = bParts[i] ?? 0;
|
|
61
|
+
if (aVal < bVal)
|
|
62
|
+
return -1;
|
|
63
|
+
if (aVal > bVal)
|
|
64
|
+
return 1;
|
|
65
|
+
}
|
|
66
|
+
return 0;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get all migrations needed to upgrade from one version to another
|
|
70
|
+
*
|
|
71
|
+
* @param fromVersion - Current installed version
|
|
72
|
+
* @param toVersion - Target version to upgrade to
|
|
73
|
+
* @returns Array of migration items to apply, in version order
|
|
74
|
+
*/
|
|
75
|
+
export function getMigrationsForVersion(fromVersion, toVersion) {
|
|
76
|
+
const manifests = loadManifests();
|
|
77
|
+
// Get all versions that have migrations
|
|
78
|
+
const versions = Object.keys(manifests).sort(compareVersions);
|
|
79
|
+
// Filter to versions > fromVersion and <= toVersion
|
|
80
|
+
const applicableVersions = versions.filter((v) => {
|
|
81
|
+
const afterFrom = compareVersions(v, fromVersion) > 0;
|
|
82
|
+
const atOrBeforeTo = compareVersions(v, toVersion) <= 0;
|
|
83
|
+
return afterFrom && atOrBeforeTo;
|
|
84
|
+
});
|
|
85
|
+
// Collect all migrations from applicable versions
|
|
86
|
+
const allMigrations = [];
|
|
87
|
+
for (const version of applicableVersions) {
|
|
88
|
+
const manifest = manifests[version];
|
|
89
|
+
if (manifest) {
|
|
90
|
+
allMigrations.push(...manifest.migrations);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return allMigrations;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Check if there are any pending migrations between versions
|
|
97
|
+
*/
|
|
98
|
+
export function hasPendingMigrations(fromVersion, toVersion) {
|
|
99
|
+
return getMigrationsForVersion(fromVersion, toVersion).length > 0;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Get human-readable summary of pending migrations
|
|
103
|
+
*/
|
|
104
|
+
export function getMigrationSummary(fromVersion, toVersion) {
|
|
105
|
+
const migrations = getMigrationsForVersion(fromVersion, toVersion);
|
|
106
|
+
return {
|
|
107
|
+
renames: migrations.filter((m) => m.type === "rename").length,
|
|
108
|
+
deletes: migrations.filter((m) => m.type === "delete").length,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Get all registered migration versions
|
|
113
|
+
*/
|
|
114
|
+
export function getAllMigrationVersions() {
|
|
115
|
+
const manifests = loadManifests();
|
|
116
|
+
return Object.keys(manifests).sort(compareVersions);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Clear the manifest cache (useful for testing)
|
|
120
|
+
*/
|
|
121
|
+
export function clearManifestCache() {
|
|
122
|
+
manifestCache = null;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migrations/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIzC,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAExD;;GAEG;AACH,IAAI,aAAa,GAA6C,IAAI,CAAC;AAEnE;;GAEG;AACH,SAAS,aAAa;IACpB,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,MAAM,SAAS,GAAsC,EAAE,CAAC;IAExD,sCAAsC;IACtC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAClC,aAAa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AAG,QAAQ,CAAC,UAAU,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,WAAmB,EACnB,SAAiB;IAEjB,OAAO,uBAAuB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACpE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAAmB,EACnB,SAAiB;IAEjB,MAAM,UAAU,GAAG,uBAAuB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IACnE,OAAO;QACL,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM;QAC7D,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,MAAM;KAC9D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB;IACrC,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC;IAClC,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,aAAa,GAAG,IAAI,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.9",
|
|
3
|
+
"description": "Rename deprecated command files",
|
|
4
|
+
"migrations": [
|
|
5
|
+
{
|
|
6
|
+
"type": "rename",
|
|
7
|
+
"from": ".claude/commands/onboard-developer.md",
|
|
8
|
+
"to": ".claude/commands/onboard.md",
|
|
9
|
+
"description": "Shortened onboard-developer to onboard"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "rename",
|
|
13
|
+
"from": ".cursor/commands/onboard-developer.md",
|
|
14
|
+
"to": ".cursor/commands/onboard.md",
|
|
15
|
+
"description": "Shortened onboard-developer to onboard"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "rename",
|
|
19
|
+
"from": ".claude/commands/record-agent-flow.md",
|
|
20
|
+
"to": ".claude/commands/record-session.md",
|
|
21
|
+
"description": "Renamed record-agent-flow to record-session"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "rename",
|
|
25
|
+
"from": ".cursor/commands/record-agent-flow.md",
|
|
26
|
+
"to": ".cursor/commands/record-session.md",
|
|
27
|
+
"description": "Renamed record-agent-flow to record-session"
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.2.0",
|
|
3
|
+
"description": "Comprehensive naming redesign for clarity",
|
|
4
|
+
"migrations": [
|
|
5
|
+
{
|
|
6
|
+
"type": "rename-dir",
|
|
7
|
+
"from": ".trellis/agent-traces",
|
|
8
|
+
"to": ".trellis/workspace",
|
|
9
|
+
"description": "Rename agent-traces to workspace (developer work records)"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"type": "rename-dir",
|
|
13
|
+
"from": ".trellis/structure",
|
|
14
|
+
"to": ".trellis/spec",
|
|
15
|
+
"description": "Rename structure to spec (development guidelines)"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"type": "rename-dir",
|
|
19
|
+
"from": ".trellis/backlog",
|
|
20
|
+
"to": ".trellis/tasks",
|
|
21
|
+
"description": "Rename backlog to tasks (unified task tracking)"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"type": "rename",
|
|
25
|
+
"from": ".trellis/scripts/feature.sh",
|
|
26
|
+
"to": ".trellis/scripts/task.sh",
|
|
27
|
+
"description": "Rename feature.sh to task.sh"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"type": "rename",
|
|
31
|
+
"from": ".trellis/scripts/common/backlog.sh",
|
|
32
|
+
"to": ".trellis/scripts/common/task-queue.sh",
|
|
33
|
+
"description": "Rename backlog.sh to task-queue.sh"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"type": "rename",
|
|
37
|
+
"from": ".trellis/scripts/common/feature-utils.sh",
|
|
38
|
+
"to": ".trellis/scripts/common/task-utils.sh",
|
|
39
|
+
"description": "Rename feature-utils.sh to task-utils.sh"
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"notes": "Complex migrations (features→tasks, traces→journal) require running scripts/migrate-features-to-tasks.sh"
|
|
43
|
+
}
|
|
@@ -12,7 +12,7 @@ You are the Check Agent in the Trellis workflow.
|
|
|
12
12
|
## Context
|
|
13
13
|
|
|
14
14
|
Before checking, read:
|
|
15
|
-
- `.trellis/
|
|
15
|
+
- `.trellis/spec/` - Development guidelines
|
|
16
16
|
- Pre-commit checklist for quality standards
|
|
17
17
|
|
|
18
18
|
## Core Responsibilities
|
|
@@ -41,7 +41,7 @@ git diff # View specific changes
|
|
|
41
41
|
|
|
42
42
|
### Step 2: Check Against Specs
|
|
43
43
|
|
|
44
|
-
Read relevant specs in `.trellis/
|
|
44
|
+
Read relevant specs in `.trellis/spec/` to check code:
|
|
45
45
|
|
|
46
46
|
- Does it follow directory structure conventions
|
|
47
47
|
- Does it follow naming conventions
|
|
@@ -70,7 +70,7 @@ If failed, fix issues and re-run.
|
|
|
70
70
|
**CRITICAL**: You are in a loop controlled by the Ralph Loop system.
|
|
71
71
|
The loop will NOT stop until you output ALL required completion markers.
|
|
72
72
|
|
|
73
|
-
Completion markers are generated from `check.jsonl` in the
|
|
73
|
+
Completion markers are generated from `check.jsonl` in the task directory.
|
|
74
74
|
Each entry's `reason` field becomes a marker: `{REASON}_FINISH`
|
|
75
75
|
|
|
76
76
|
For example, if check.jsonl contains:
|
|
@@ -12,7 +12,7 @@ You are the Debug Agent in the Trellis workflow.
|
|
|
12
12
|
## Context
|
|
13
13
|
|
|
14
14
|
Before debugging, read:
|
|
15
|
-
- `.trellis/
|
|
15
|
+
- `.trellis/spec/` - Development guidelines
|
|
16
16
|
- Error messages or issue descriptions provided
|
|
17
17
|
|
|
18
18
|
## Core Responsibilities
|
|
@@ -11,13 +11,13 @@ You are the Dispatch Agent in the Multi-Agent Pipeline (pure dispatcher).
|
|
|
11
11
|
|
|
12
12
|
## Working Directory Convention
|
|
13
13
|
|
|
14
|
-
Current
|
|
14
|
+
Current Task is specified by `.trellis/.current-task` file, content is the relative path to task directory.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Task directory path format: `.trellis/workspace/{developer}/tasks/{MM}-{DD}-{name}/`
|
|
17
17
|
|
|
18
18
|
This directory contains all context files for the current task:
|
|
19
19
|
|
|
20
|
-
- `
|
|
20
|
+
- `task.json` - Task configuration
|
|
21
21
|
- `prd.md` - Requirements document
|
|
22
22
|
- `info.md` - Technical design (optional)
|
|
23
23
|
- `implement.jsonl` - Implement context
|
|
@@ -35,19 +35,19 @@ This directory contains all context files for the current task:
|
|
|
35
35
|
|
|
36
36
|
## Startup Flow
|
|
37
37
|
|
|
38
|
-
### Step 1: Determine Current
|
|
38
|
+
### Step 1: Determine Current Task Directory
|
|
39
39
|
|
|
40
|
-
Read `.trellis/.current-
|
|
40
|
+
Read `.trellis/.current-task` to get current task directory path:
|
|
41
41
|
|
|
42
42
|
```bash
|
|
43
|
-
|
|
44
|
-
# e.g.: .trellis/
|
|
43
|
+
TASK_DIR=$(cat .trellis/.current-task)
|
|
44
|
+
# e.g.: .trellis/workspace/taosu/tasks/12-my-feature
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
### Step 2: Read Feature Configuration
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
-
cat ${
|
|
50
|
+
cat ${TASK_DIR}/task.json
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Get the `next_action` array, which defines the list of phases to execute.
|
|
@@ -70,7 +70,7 @@ Execute each step in `phase` order.
|
|
|
70
70
|
```
|
|
71
71
|
Task(
|
|
72
72
|
subagent_type: "implement",
|
|
73
|
-
prompt: "Implement the feature described in prd.md in the
|
|
73
|
+
prompt: "Implement the feature described in prd.md in the task directory",
|
|
74
74
|
model: "opus",
|
|
75
75
|
run_in_background: true
|
|
76
76
|
)
|
|
@@ -108,7 +108,7 @@ Hook will auto-inject:
|
|
|
108
108
|
```
|
|
109
109
|
Task(
|
|
110
110
|
subagent_type: "debug",
|
|
111
|
-
prompt: "Fix the issues described in the
|
|
111
|
+
prompt: "Fix the issues described in the task context",
|
|
112
112
|
model: "opus",
|
|
113
113
|
run_in_background: true
|
|
114
114
|
)
|
|
@@ -146,10 +146,10 @@ This action creates a Pull Request from the feature branch. Run it via Bash:
|
|
|
146
146
|
```
|
|
147
147
|
|
|
148
148
|
This will:
|
|
149
|
-
1. Stage and commit all changes (excluding
|
|
149
|
+
1. Stage and commit all changes (excluding workspace)
|
|
150
150
|
2. Push to origin
|
|
151
151
|
3. Create a Draft PR using `gh pr create`
|
|
152
|
-
4. Update
|
|
152
|
+
4. Update task.json with status="review", pr_url, and current_phase
|
|
153
153
|
|
|
154
154
|
**Note**: This is the only action that performs git commit, as it's the final step after all implementation and checks are complete.
|
|
155
155
|
|
|
@@ -13,13 +13,13 @@ You are the Implement Agent in the Trellis workflow.
|
|
|
13
13
|
|
|
14
14
|
Before implementing, read:
|
|
15
15
|
- `.trellis/workflow.md` - Project workflow
|
|
16
|
-
- `.trellis/
|
|
16
|
+
- `.trellis/spec/` - Development guidelines
|
|
17
17
|
- Feature `prd.md` - Requirements document
|
|
18
18
|
- Feature `info.md` - Technical design (if exists)
|
|
19
19
|
|
|
20
20
|
## Core Responsibilities
|
|
21
21
|
|
|
22
|
-
1. **Understand specs** - Read relevant spec files in `.trellis/
|
|
22
|
+
1. **Understand specs** - Read relevant spec files in `.trellis/spec/`
|
|
23
23
|
2. **Understand requirements** - Read prd.md and info.md
|
|
24
24
|
3. **Implement features** - Write code following specs and design
|
|
25
25
|
4. **Self-check** - Ensure code quality
|
|
@@ -41,13 +41,13 @@ Before implementing, read:
|
|
|
41
41
|
|
|
42
42
|
Read relevant specs based on task type:
|
|
43
43
|
|
|
44
|
-
- Backend: `.trellis/
|
|
45
|
-
- Frontend: `.trellis/
|
|
46
|
-
- Shared: `.trellis/
|
|
44
|
+
- Backend: `.trellis/spec/backend/`
|
|
45
|
+
- Frontend: `.trellis/spec/frontend/`
|
|
46
|
+
- Shared: `.trellis/spec/shared/`
|
|
47
47
|
|
|
48
48
|
### 2. Understand Requirements
|
|
49
49
|
|
|
50
|
-
Read the
|
|
50
|
+
Read the task's prd.md and info.md:
|
|
51
51
|
|
|
52
52
|
- What are the core requirements
|
|
53
53
|
- Key points of technical design
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: plan
|
|
3
3
|
description: |
|
|
4
|
-
Multi-Agent Pipeline planner. Analyzes requirements and produces a fully configured
|
|
4
|
+
Multi-Agent Pipeline planner. Analyzes requirements and produces a fully configured task directory ready for dispatch.
|
|
5
5
|
tools: Read, Bash, Glob, Grep, Task
|
|
6
6
|
model: opus
|
|
7
7
|
---
|
|
@@ -9,7 +9,7 @@ model: opus
|
|
|
9
9
|
|
|
10
10
|
You are the Plan Agent in the Multi-Agent Pipeline.
|
|
11
11
|
|
|
12
|
-
**Your job**: Evaluate requirements and, if valid, transform them into a fully configured
|
|
12
|
+
**Your job**: Evaluate requirements and, if valid, transform them into a fully configured task directory.
|
|
13
13
|
|
|
14
14
|
**You have the power to reject** - If a requirement is unclear, incomplete, unreasonable, or potentially harmful, you MUST refuse to proceed and clean up.
|
|
15
15
|
|
|
@@ -52,15 +52,15 @@ PLAN_REQUIREMENT = <the requirement from environment>
|
|
|
52
52
|
|
|
53
53
|
### If Rejecting:
|
|
54
54
|
|
|
55
|
-
1. **Update
|
|
55
|
+
1. **Update task.json status to "rejected"**:
|
|
56
56
|
```bash
|
|
57
|
-
jq '.status = "rejected"' "$
|
|
58
|
-
&& mv "$
|
|
57
|
+
jq '.status = "rejected"' "$PLAN_TASK_DIR/task.json" > "$PLAN_TASK_DIR/task.json.tmp" \
|
|
58
|
+
&& mv "$PLAN_TASK_DIR/task.json.tmp" "$PLAN_TASK_DIR/task.json"
|
|
59
59
|
```
|
|
60
60
|
|
|
61
61
|
2. **Write rejection reason to a file** (so user can see it):
|
|
62
62
|
```bash
|
|
63
|
-
cat > "$
|
|
63
|
+
cat > "$PLAN_TASK_DIR/REJECTED.md" << 'EOF'
|
|
64
64
|
# Plan Rejected
|
|
65
65
|
|
|
66
66
|
## Reason
|
|
@@ -76,7 +76,7 @@ PLAN_REQUIREMENT = <the requirement from environment>
|
|
|
76
76
|
## To Retry
|
|
77
77
|
|
|
78
78
|
1. Delete this directory:
|
|
79
|
-
rm -rf $
|
|
79
|
+
rm -rf $PLAN_TASK_DIR
|
|
80
80
|
|
|
81
81
|
2. Run with revised requirement:
|
|
82
82
|
./.trellis/scripts/multi-agent/plan.sh --name "<name>" --type "<type>" --requirement "<revised requirement>"
|
|
@@ -90,13 +90,13 @@ PLAN_REQUIREMENT = <the requirement from environment>
|
|
|
90
90
|
Reason: <category>
|
|
91
91
|
Details: <brief explanation>
|
|
92
92
|
|
|
93
|
-
See: $
|
|
93
|
+
See: $PLAN_TASK_DIR/REJECTED.md
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
4. **Exit immediately** - Do not proceed to Step 1.
|
|
97
97
|
|
|
98
|
-
**The
|
|
99
|
-
- `
|
|
98
|
+
**The task directory is kept** with:
|
|
99
|
+
- `task.json` (status: "rejected")
|
|
100
100
|
- `REJECTED.md` (full explanation)
|
|
101
101
|
- `.plan-log` (execution log)
|
|
102
102
|
|
|
@@ -117,28 +117,28 @@ Continue to Step 1. The requirement is:
|
|
|
117
117
|
You receive input via environment variables (set by plan.sh):
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
|
-
|
|
120
|
+
PLAN_TASK_NAME # Task name (e.g., "user-auth")
|
|
121
121
|
PLAN_DEV_TYPE # Development type: backend | frontend | fullstack
|
|
122
122
|
PLAN_REQUIREMENT # Requirement description from user
|
|
123
|
-
|
|
123
|
+
PLAN_TASK_DIR # Pre-created task directory path
|
|
124
124
|
```
|
|
125
125
|
|
|
126
126
|
Read them at startup:
|
|
127
127
|
|
|
128
128
|
```bash
|
|
129
|
-
echo "
|
|
129
|
+
echo "Task: $PLAN_TASK_NAME"
|
|
130
130
|
echo "Type: $PLAN_DEV_TYPE"
|
|
131
131
|
echo "Requirement: $PLAN_REQUIREMENT"
|
|
132
|
-
echo "Directory: $
|
|
132
|
+
echo "Directory: $PLAN_TASK_DIR"
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
## Output (if accepted)
|
|
136
136
|
|
|
137
|
-
A complete
|
|
137
|
+
A complete task directory containing:
|
|
138
138
|
|
|
139
139
|
```
|
|
140
|
-
${
|
|
141
|
-
├──
|
|
140
|
+
${PLAN_TASK_DIR}/
|
|
141
|
+
├── task.json # Updated with branch, scope, dev_type
|
|
142
142
|
├── prd.md # Requirements document
|
|
143
143
|
├── implement.jsonl # Implement phase context
|
|
144
144
|
├── check.jsonl # Check phase context
|
|
@@ -152,7 +152,7 @@ ${PLAN_FEATURE_DIR}/
|
|
|
152
152
|
### Step 1: Initialize Context Files
|
|
153
153
|
|
|
154
154
|
```bash
|
|
155
|
-
./.trellis/scripts/
|
|
155
|
+
./.trellis/scripts/task.sh init-context "$PLAN_TASK_DIR" "$PLAN_DEV_TYPE"
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
This creates base jsonl files with standard specs for the dev type.
|
|
@@ -170,7 +170,7 @@ Task: ${PLAN_REQUIREMENT}
|
|
|
170
170
|
Dev Type: ${PLAN_DEV_TYPE}
|
|
171
171
|
|
|
172
172
|
Instructions:
|
|
173
|
-
1. Search .trellis/
|
|
173
|
+
1. Search .trellis/spec/ for relevant spec files
|
|
174
174
|
2. Search the codebase for related modules and patterns
|
|
175
175
|
3. Identify files that should be added to jsonl context
|
|
176
176
|
|
|
@@ -201,13 +201,13 @@ Parse research agent output and add entries to jsonl files:
|
|
|
201
201
|
|
|
202
202
|
```bash
|
|
203
203
|
# For each entry in implement.jsonl section:
|
|
204
|
-
./.trellis/scripts/
|
|
204
|
+
./.trellis/scripts/task.sh add-context "$PLAN_TASK_DIR" implement "<path>" "<reason>"
|
|
205
205
|
|
|
206
206
|
# For each entry in check.jsonl section:
|
|
207
|
-
./.trellis/scripts/
|
|
207
|
+
./.trellis/scripts/task.sh add-context "$PLAN_TASK_DIR" check "<path>" "<reason>"
|
|
208
208
|
|
|
209
209
|
# For each entry in debug.jsonl section:
|
|
210
|
-
./.trellis/scripts/
|
|
210
|
+
./.trellis/scripts/task.sh add-context "$PLAN_TASK_DIR" debug "<path>" "<reason>"
|
|
211
211
|
```
|
|
212
212
|
|
|
213
213
|
### Step 4: Write prd.md
|
|
@@ -215,8 +215,8 @@ Parse research agent output and add entries to jsonl files:
|
|
|
215
215
|
Create the requirements document:
|
|
216
216
|
|
|
217
217
|
```bash
|
|
218
|
-
cat > "$
|
|
219
|
-
#
|
|
218
|
+
cat > "$PLAN_TASK_DIR/prd.md" << 'EOF'
|
|
219
|
+
# Task: ${PLAN_TASK_NAME}
|
|
220
220
|
|
|
221
221
|
## Overview
|
|
222
222
|
[Brief description of what this feature does]
|
|
@@ -249,21 +249,21 @@ EOF
|
|
|
249
249
|
|
|
250
250
|
```bash
|
|
251
251
|
# Set branch name
|
|
252
|
-
./.trellis/scripts/
|
|
252
|
+
./.trellis/scripts/task.sh set-branch "$PLAN_TASK_DIR" "feature/${PLAN_TASK_NAME}"
|
|
253
253
|
|
|
254
254
|
# Set scope (from research agent suggestion)
|
|
255
|
-
./.trellis/scripts/
|
|
255
|
+
./.trellis/scripts/task.sh set-scope "$PLAN_TASK_DIR" "<scope>"
|
|
256
256
|
|
|
257
|
-
# Update dev_type in
|
|
257
|
+
# Update dev_type in task.json
|
|
258
258
|
jq --arg type "$PLAN_DEV_TYPE" '.dev_type = $type' \
|
|
259
|
-
"$
|
|
260
|
-
&& mv "$
|
|
259
|
+
"$PLAN_TASK_DIR/task.json" > "$PLAN_TASK_DIR/task.json.tmp" \
|
|
260
|
+
&& mv "$PLAN_TASK_DIR/task.json.tmp" "$PLAN_TASK_DIR/task.json"
|
|
261
261
|
```
|
|
262
262
|
|
|
263
263
|
### Step 6: Validate Configuration
|
|
264
264
|
|
|
265
265
|
```bash
|
|
266
|
-
./.trellis/scripts/
|
|
266
|
+
./.trellis/scripts/task.sh validate "$PLAN_TASK_DIR"
|
|
267
267
|
```
|
|
268
268
|
|
|
269
269
|
If validation fails, fix the invalid paths and re-validate.
|
|
@@ -274,15 +274,15 @@ Print a summary for the caller:
|
|
|
274
274
|
|
|
275
275
|
```bash
|
|
276
276
|
echo "=== Plan Complete ==="
|
|
277
|
-
echo "
|
|
277
|
+
echo "Task Directory: $PLAN_TASK_DIR"
|
|
278
278
|
echo ""
|
|
279
279
|
echo "Files created:"
|
|
280
|
-
ls -la "$
|
|
280
|
+
ls -la "$PLAN_TASK_DIR"
|
|
281
281
|
echo ""
|
|
282
282
|
echo "Context summary:"
|
|
283
|
-
./.trellis/scripts/
|
|
283
|
+
./.trellis/scripts/task.sh list-context "$PLAN_TASK_DIR"
|
|
284
284
|
echo ""
|
|
285
|
-
echo "Ready for: ./.trellis/scripts/multi-agent/start.sh $
|
|
285
|
+
echo "Ready for: ./.trellis/scripts/multi-agent/start.sh $PLAN_TASK_DIR"
|
|
286
286
|
```
|
|
287
287
|
|
|
288
288
|
---
|
|
@@ -328,15 +328,15 @@ If final validation fails:
|
|
|
328
328
|
|
|
329
329
|
```
|
|
330
330
|
Input:
|
|
331
|
-
|
|
331
|
+
PLAN_TASK_NAME = "add-rate-limiting"
|
|
332
332
|
PLAN_DEV_TYPE = "backend"
|
|
333
333
|
PLAN_REQUIREMENT = "Add rate limiting to API endpoints using a sliding window algorithm. Limit to 100 requests per minute per IP. Return 429 status when exceeded."
|
|
334
334
|
|
|
335
335
|
Result: ACCEPTED - Clear, specific, has defined behavior
|
|
336
336
|
|
|
337
337
|
Output:
|
|
338
|
-
.trellis/
|
|
339
|
-
├──
|
|
338
|
+
.trellis/workspace/xxx/tasks/17-add-rate-limiting/
|
|
339
|
+
├── task.json # branch: feature/add-rate-limiting, scope: api
|
|
340
340
|
├── prd.md # Detailed requirements with acceptance criteria
|
|
341
341
|
├── implement.jsonl # Backend specs + existing middleware patterns
|
|
342
342
|
├── check.jsonl # Quality guidelines + API testing specs
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Read the backend development guidelines before starting your development task.
|
|
2
2
|
|
|
3
3
|
Execute these steps:
|
|
4
|
-
1. Read `.trellis/
|
|
4
|
+
1. Read `.trellis/spec/backend/index.md` to understand available guidelines
|
|
5
5
|
2. Based on your task, read the relevant guideline files:
|
|
6
|
-
- Database work → `.trellis/
|
|
7
|
-
- Error handling → `.trellis/
|
|
8
|
-
- Logging → `.trellis/
|
|
9
|
-
- Type questions → `.trellis/
|
|
6
|
+
- Database work → `.trellis/spec/backend/database-guidelines.md`
|
|
7
|
+
- Error handling → `.trellis/spec/backend/error-handling.md`
|
|
8
|
+
- Logging → `.trellis/spec/backend/logging-guidelines.md`
|
|
9
|
+
- Type questions → `.trellis/spec/backend/type-safety.md`
|
|
10
10
|
3. Understand the coding standards and patterns you need to follow
|
|
11
11
|
4. Then proceed with your development plan
|
|
12
12
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Read the frontend development guidelines before starting your development task.
|
|
2
2
|
|
|
3
3
|
Execute these steps:
|
|
4
|
-
1. Read `.trellis/
|
|
4
|
+
1. Read `.trellis/spec/frontend/index.md` to understand available guidelines
|
|
5
5
|
2. Based on your task, read the relevant guideline files:
|
|
6
|
-
- Component work → `.trellis/
|
|
7
|
-
- Hook work → `.trellis/
|
|
8
|
-
- State management → `.trellis/
|
|
9
|
-
- Type questions → `.trellis/
|
|
6
|
+
- Component work → `.trellis/spec/frontend/component-guidelines.md`
|
|
7
|
+
- Hook work → `.trellis/spec/frontend/hook-guidelines.md`
|
|
8
|
+
- State management → `.trellis/spec/frontend/state-management.md`
|
|
9
|
+
- Type questions → `.trellis/spec/frontend/type-safety.md`
|
|
10
10
|
3. Understand the coding standards and patterns you need to follow
|
|
11
11
|
4. Then proceed with your development plan
|
|
12
12
|
|
|
@@ -55,8 +55,8 @@ What broader problems does this bug reveal?
|
|
|
55
55
|
|
|
56
56
|
Solidify insights into the system:
|
|
57
57
|
|
|
58
|
-
- [ ] Update `.trellis/
|
|
59
|
-
- [ ] Update `.trellis/
|
|
58
|
+
- [ ] Update `.trellis/spec/guides/` thinking guides
|
|
59
|
+
- [ ] Update `.trellis/spec/backend/` or `frontend/` docs
|
|
60
60
|
- [ ] Create issue record (if applicable)
|
|
61
61
|
- [ ] Create feature ticket for root fix
|
|
62
62
|
- [ ] Update check commands if needed
|
|
@@ -2,12 +2,12 @@ Check if the code you just wrote follows the backend development guidelines.
|
|
|
2
2
|
|
|
3
3
|
Execute these steps:
|
|
4
4
|
1. Run `git status` to see modified files
|
|
5
|
-
2. Read `.trellis/
|
|
5
|
+
2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
|
|
6
6
|
3. Based on what you changed, read the relevant guideline files:
|
|
7
|
-
- Database changes → `.trellis/
|
|
8
|
-
- Error handling → `.trellis/
|
|
9
|
-
- Logging changes → `.trellis/
|
|
10
|
-
- Type changes → `.trellis/
|
|
11
|
-
- Any changes → `.trellis/
|
|
7
|
+
- Database changes → `.trellis/spec/backend/database-guidelines.md`
|
|
8
|
+
- Error handling → `.trellis/spec/backend/error-handling.md`
|
|
9
|
+
- Logging changes → `.trellis/spec/backend/logging-guidelines.md`
|
|
10
|
+
- Type changes → `.trellis/spec/backend/type-safety.md`
|
|
11
|
+
- Any changes → `.trellis/spec/backend/quality-guidelines.md`
|
|
12
12
|
4. Review your code against the guidelines
|
|
13
13
|
5. Report any violations and fix them if found
|