@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
|
@@ -14,7 +14,7 @@ Mechanism:
|
|
|
14
14
|
|
|
15
15
|
State file: .trellis/.ralph-state.json
|
|
16
16
|
- Tracks current iteration count per session
|
|
17
|
-
- Resets when
|
|
17
|
+
- Resets when task changes
|
|
18
18
|
"""
|
|
19
19
|
|
|
20
20
|
import json
|
|
@@ -33,7 +33,7 @@ STATE_TIMEOUT_MINUTES = 30 # Reset state if older than this
|
|
|
33
33
|
STATE_FILE = ".trellis/.ralph-state.json"
|
|
34
34
|
WORKTREE_YAML = ".trellis/worktree.yaml"
|
|
35
35
|
DIR_WORKFLOW = ".trellis"
|
|
36
|
-
|
|
36
|
+
FILE_CURRENT_TASK = ".current-task"
|
|
37
37
|
|
|
38
38
|
# Only control loop for check agent
|
|
39
39
|
TARGET_AGENT = "check"
|
|
@@ -49,14 +49,14 @@ def find_repo_root(start_path: str) -> str | None:
|
|
|
49
49
|
return None
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
def
|
|
53
|
-
"""Read current
|
|
54
|
-
|
|
55
|
-
if not os.path.exists(
|
|
52
|
+
def get_current_task(repo_root: str) -> str | None:
|
|
53
|
+
"""Read current task directory path"""
|
|
54
|
+
current_task_file = os.path.join(repo_root, DIR_WORKFLOW, FILE_CURRENT_TASK)
|
|
55
|
+
if not os.path.exists(current_task_file):
|
|
56
56
|
return None
|
|
57
57
|
|
|
58
58
|
try:
|
|
59
|
-
with open(
|
|
59
|
+
with open(current_task_file, "r", encoding="utf-8") as f:
|
|
60
60
|
content = f.read().strip()
|
|
61
61
|
return content if content else None
|
|
62
62
|
except Exception:
|
|
@@ -149,14 +149,14 @@ def run_verify_commands(repo_root: str, commands: list[str]) -> tuple[bool, str]
|
|
|
149
149
|
return True, "All verify commands passed"
|
|
150
150
|
|
|
151
151
|
|
|
152
|
-
def get_completion_markers(repo_root: str,
|
|
152
|
+
def get_completion_markers(repo_root: str, task_dir: str) -> list[str]:
|
|
153
153
|
"""
|
|
154
154
|
Read check.jsonl and generate completion markers from reasons.
|
|
155
155
|
|
|
156
156
|
Each entry's "reason" field becomes {REASON}_FINISH marker.
|
|
157
157
|
Example: {"file": "...", "reason": "TypeCheck"} -> "TYPECHECK_FINISH"
|
|
158
158
|
"""
|
|
159
|
-
check_jsonl_path = os.path.join(repo_root,
|
|
159
|
+
check_jsonl_path = os.path.join(repo_root, task_dir, "check.jsonl")
|
|
160
160
|
markers = []
|
|
161
161
|
|
|
162
162
|
if not os.path.exists(check_jsonl_path):
|
|
@@ -193,13 +193,13 @@ def load_state(repo_root: str) -> dict:
|
|
|
193
193
|
"""Load Ralph Loop state from file"""
|
|
194
194
|
state_path = os.path.join(repo_root, STATE_FILE)
|
|
195
195
|
if not os.path.exists(state_path):
|
|
196
|
-
return {"
|
|
196
|
+
return {"task": None, "iteration": 0, "started_at": None}
|
|
197
197
|
|
|
198
198
|
try:
|
|
199
199
|
with open(state_path, "r", encoding="utf-8") as f:
|
|
200
200
|
return json.load(f)
|
|
201
201
|
except Exception:
|
|
202
|
-
return {"
|
|
202
|
+
return {"task": None, "iteration": 0, "started_at": None}
|
|
203
203
|
|
|
204
204
|
|
|
205
205
|
def save_state(repo_root: str, state: dict) -> None:
|
|
@@ -262,17 +262,17 @@ def main():
|
|
|
262
262
|
if not repo_root:
|
|
263
263
|
sys.exit(0)
|
|
264
264
|
|
|
265
|
-
# Get current
|
|
266
|
-
|
|
267
|
-
if not
|
|
265
|
+
# Get current task
|
|
266
|
+
task_dir = get_current_task(repo_root)
|
|
267
|
+
if not task_dir:
|
|
268
268
|
sys.exit(0)
|
|
269
269
|
|
|
270
270
|
# Load state
|
|
271
271
|
state = load_state(repo_root)
|
|
272
272
|
|
|
273
|
-
# Reset state if
|
|
273
|
+
# Reset state if task changed or state is too old
|
|
274
274
|
should_reset = False
|
|
275
|
-
if state.get("
|
|
275
|
+
if state.get("task") != task_dir:
|
|
276
276
|
should_reset = True
|
|
277
277
|
elif state.get("started_at"):
|
|
278
278
|
try:
|
|
@@ -284,7 +284,7 @@ def main():
|
|
|
284
284
|
|
|
285
285
|
if should_reset:
|
|
286
286
|
state = {
|
|
287
|
-
"
|
|
287
|
+
"task": task_dir,
|
|
288
288
|
"iteration": 0,
|
|
289
289
|
"started_at": datetime.now().isoformat(),
|
|
290
290
|
}
|
|
@@ -335,7 +335,7 @@ def main():
|
|
|
335
335
|
sys.exit(0)
|
|
336
336
|
else:
|
|
337
337
|
# No verify commands, fall back to completion markers
|
|
338
|
-
markers = get_completion_markers(repo_root,
|
|
338
|
+
markers = get_completion_markers(repo_root, task_dir)
|
|
339
339
|
all_complete, missing = check_completion(agent_output, markers)
|
|
340
340
|
|
|
341
341
|
if all_complete:
|
|
@@ -5,7 +5,7 @@ Session Start Hook - Inject structured context
|
|
|
5
5
|
Matcher: "startup" - only runs on normal startup (not resume/clear/compact)
|
|
6
6
|
|
|
7
7
|
This hook injects:
|
|
8
|
-
1. Current state (git status, current
|
|
8
|
+
1. Current state (git status, current task, task queue)
|
|
9
9
|
2. Workflow guide
|
|
10
10
|
3. Guidelines index (frontend/backend/guides)
|
|
11
11
|
4. Session instructions (start.md)
|
|
@@ -86,21 +86,21 @@ Read and follow all instructions below carefully.
|
|
|
86
86
|
|
|
87
87
|
print("## Frontend")
|
|
88
88
|
frontend_index = read_file(
|
|
89
|
-
trellis_dir / "
|
|
89
|
+
trellis_dir / "spec" / "frontend" / "index.md", "Not configured"
|
|
90
90
|
)
|
|
91
91
|
print(frontend_index)
|
|
92
92
|
print()
|
|
93
93
|
|
|
94
94
|
print("## Backend")
|
|
95
95
|
backend_index = read_file(
|
|
96
|
-
trellis_dir / "
|
|
96
|
+
trellis_dir / "spec" / "backend" / "index.md", "Not configured"
|
|
97
97
|
)
|
|
98
98
|
print(backend_index)
|
|
99
99
|
print()
|
|
100
100
|
|
|
101
101
|
print("## Guides")
|
|
102
102
|
guides_index = read_file(
|
|
103
|
-
trellis_dir / "
|
|
103
|
+
trellis_dir / "spec" / "guides" / "index.md", "Not configured"
|
|
104
104
|
)
|
|
105
105
|
print(guides_index)
|
|
106
106
|
|
|
@@ -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
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Check if your changes considered all dimensions. Most bugs come from "didn't think of it", not lack of technical skill.
|
|
4
4
|
|
|
5
|
-
> **Note**: This is a **post-implementation** safety net. Ideally, read the [Pre-Implementation Checklist](.trellis/
|
|
5
|
+
> **Note**: This is a **post-implementation** safety net. Ideally, read the [Pre-Implementation Checklist](.trellis/spec/guides/pre-implementation-checklist.md) **before** writing code.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -10,8 +10,8 @@ Check if your changes considered all dimensions. Most bugs come from "didn't thi
|
|
|
10
10
|
|
|
11
11
|
| Document | Purpose | Timing |
|
|
12
12
|
|----------|---------|--------|
|
|
13
|
-
| [Pre-Implementation Checklist](.trellis/
|
|
14
|
-
| [Code Reuse Thinking Guide](.trellis/
|
|
13
|
+
| [Pre-Implementation Checklist](.trellis/spec/guides/pre-implementation-checklist.md) | Questions before coding | **Before** writing code |
|
|
14
|
+
| [Code Reuse Thinking Guide](.trellis/spec/guides/code-reuse-thinking-guide.md) | Pattern recognition | During implementation |
|
|
15
15
|
| **`/check-cross-layer`** (this) | Verification check | **After** implementation |
|
|
16
16
|
|
|
17
17
|
---
|
|
@@ -50,7 +50,7 @@ Based on your change type, execute relevant checks below:
|
|
|
50
50
|
- [ ] Errors properly propagated to caller?
|
|
51
51
|
- [ ] Loading/pending states handled at each layer?
|
|
52
52
|
|
|
53
|
-
**Detailed Guide**: `.trellis/
|
|
53
|
+
**Detailed Guide**: `.trellis/spec/guides/cross-layer-thinking-guide.md`
|
|
54
54
|
|
|
55
55
|
---
|
|
56
56
|
|
|
@@ -73,7 +73,7 @@ Based on your change type, execute relevant checks below:
|
|
|
73
73
|
- [ ] After modification, all usage sites updated?
|
|
74
74
|
- [ ] If creating utility: Does similar utility already exist?
|
|
75
75
|
|
|
76
|
-
**Detailed Guide**: `.trellis/
|
|
76
|
+
**Detailed Guide**: `.trellis/spec/guides/code-reuse-thinking-guide.md`
|
|
77
77
|
|
|
78
78
|
---
|
|
79
79
|
|
|
@@ -2,12 +2,12 @@ Check if the code you just wrote follows the frontend 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/frontend/index.md` to understand which guidelines apply
|
|
6
6
|
3. Based on what you changed, read the relevant guideline files:
|
|
7
|
-
- Component changes → `.trellis/
|
|
8
|
-
- Hook changes → `.trellis/
|
|
9
|
-
- State changes → `.trellis/
|
|
10
|
-
- Type changes → `.trellis/
|
|
11
|
-
- Any changes → `.trellis/
|
|
7
|
+
- Component changes → `.trellis/spec/frontend/component-guidelines.md`
|
|
8
|
+
- Hook changes → `.trellis/spec/frontend/hook-guidelines.md`
|
|
9
|
+
- State changes → `.trellis/spec/frontend/state-management.md`
|
|
10
|
+
- Type changes → `.trellis/spec/frontend/type-safety.md`
|
|
11
|
+
- Any changes → `.trellis/spec/frontend/quality-guidelines.md`
|
|
12
12
|
4. Review your code against the guidelines
|
|
13
13
|
5. Report any violations and fix them if found
|
|
@@ -103,7 +103,7 @@ Description:
|
|
|
103
103
|
| Session Start | `start` | `start` |
|
|
104
104
|
| Pre-development | `before-` | `before-frontend-dev` |
|
|
105
105
|
| Check | `check-` | `check-frontend` |
|
|
106
|
-
| Record | `record-` | `record-
|
|
106
|
+
| Record | `record-` | `record-session` |
|
|
107
107
|
| Generate | `generate-` | `generate-api-doc` |
|
|
108
108
|
| Update | `update-` | `update-changelog` |
|
|
109
109
|
| Other | Verb-first | `review-code`, `sync-data` |
|
|
@@ -131,10 +131,10 @@ git diff main...HEAD --name-only
|
|
|
131
131
|
### 2. Categorized Review
|
|
132
132
|
|
|
133
133
|
**Frontend files** (`apps/web/`):
|
|
134
|
-
- Reference `.trellis/
|
|
134
|
+
- Reference `.trellis/spec/frontend/index.md`
|
|
135
135
|
|
|
136
136
|
**Backend files** (`packages/api/`):
|
|
137
|
-
- Reference `.trellis/
|
|
137
|
+
- Reference `.trellis/spec/backend/index.md`
|
|
138
138
|
|
|
139
139
|
### 3. Output Review Report
|
|
140
140
|
|
|
@@ -27,11 +27,11 @@ pnpm test
|
|
|
27
27
|
### 2. Documentation Sync
|
|
28
28
|
|
|
29
29
|
**Structure Docs**:
|
|
30
|
-
- [ ] Does `.trellis/
|
|
30
|
+
- [ ] Does `.trellis/spec/backend/` need updates?
|
|
31
31
|
- New patterns, new modules, new conventions
|
|
32
|
-
- [ ] Does `.trellis/
|
|
32
|
+
- [ ] Does `.trellis/spec/frontend/` need updates?
|
|
33
33
|
- New components, new hooks, new patterns
|
|
34
|
-
- [ ] Does `.trellis/
|
|
34
|
+
- [ ] Does `.trellis/spec/guides/` need updates?
|
|
35
35
|
- New cross-layer flows, lessons from bugs
|
|
36
36
|
|
|
37
37
|
**Key Question**:
|
|
@@ -94,7 +94,7 @@ git diff --name-only
|
|
|
94
94
|
|
|
95
95
|
| Oversight | Consequence | Check |
|
|
96
96
|
|-----------|-------------|-------|
|
|
97
|
-
| Structure docs not updated | Others don't know the change | Check .trellis/
|
|
97
|
+
| Structure docs not updated | Others don't know the change | Check .trellis/spec/ |
|
|
98
98
|
| Migration not created | Schema out of sync | Check db/migrations/ |
|
|
99
99
|
| Types not synced | Runtime errors | Check shared types |
|
|
100
100
|
| Tests not updated | False confidence | Run full test suite |
|
|
@@ -106,7 +106,7 @@ git diff --name-only
|
|
|
106
106
|
|
|
107
107
|
```
|
|
108
108
|
Development Flow:
|
|
109
|
-
Write code -> Test -> /finish-work -> git commit -> /record-
|
|
109
|
+
Write code -> Test -> /finish-work -> git commit -> /record-session
|
|
110
110
|
| |
|
|
111
111
|
Ensure completeness Record progress
|
|
112
112
|
|
|
@@ -117,7 +117,7 @@ Debug Flow:
|
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
- `/finish-work` - Check work completeness (this command)
|
|
120
|
-
- `/record-
|
|
120
|
+
- `/record-session` - Record session and commits
|
|
121
121
|
- `/break-loop` - Deep analysis after debugging
|
|
122
122
|
|
|
123
123
|
---
|
|
@@ -18,8 +18,8 @@ Adapt and integrate a Claude global skill into your project's development guidel
|
|
|
18
18
|
|
|
19
19
|
> [!] **Important**: The goal of skill integration is to update **development guidelines**, not to generate project code directly.
|
|
20
20
|
>
|
|
21
|
-
> - Guidelines content -> Write to `.trellis/
|
|
22
|
-
> - Code examples -> Place in `.trellis/
|
|
21
|
+
> - Guidelines content -> Write to `.trellis/spec/{target}/doc.md`
|
|
22
|
+
> - Code examples -> Place in `.trellis/spec/{target}/examples/skills/<skill-name>/`
|
|
23
23
|
> - Example files -> Use `.template` suffix (e.g., `component.tsx.template`) to avoid IDE errors
|
|
24
24
|
>
|
|
25
25
|
> Where `{target}` is `frontend` or `backend`, determined by skill type.
|
|
@@ -43,10 +43,10 @@ Based on skill type, determine which guidelines to update:
|
|
|
43
43
|
|
|
44
44
|
| Skill Category | Integration Target |
|
|
45
45
|
|----------------|-------------------|
|
|
46
|
-
| UI/Frontend (`frontend-design`, `web-artifacts-builder`) | `.trellis/
|
|
47
|
-
| Backend/API (`mcp-builder`) | `.trellis/
|
|
46
|
+
| UI/Frontend (`frontend-design`, `web-artifacts-builder`) | `.trellis/spec/frontend/` |
|
|
47
|
+
| Backend/API (`mcp-builder`) | `.trellis/spec/backend/` |
|
|
48
48
|
| Documentation (`doc-coauthoring`, `docx`, `pdf`) | `.trellis/` or create dedicated guidelines |
|
|
49
|
-
| Testing (`webapp-testing`) | `.trellis/
|
|
49
|
+
| Testing (`webapp-testing`) | `.trellis/spec/frontend/` (E2E) |
|
|
50
50
|
|
|
51
51
|
### 3. Analyze Skill Content
|
|
52
52
|
|
|
@@ -90,7 +90,7 @@ See `examples/skills/<skill-name>/`
|
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
92
|
# Directory structure ({target} = frontend or backend)
|
|
93
|
-
.trellis/
|
|
93
|
+
.trellis/spec/{target}/
|
|
94
94
|
|-- doc.md # Add skill-related section
|
|
95
95
|
|-- index.md # Update index
|
|
96
96
|
\-- examples/
|
|
@@ -122,7 +122,7 @@ Add to the Quick Navigation table in `index.md`:
|
|
|
122
122
|
|
|
123
123
|
### # Overview
|
|
124
124
|
- **Skill description**: [Functionality description]
|
|
125
|
-
- **Integration target**: `.trellis/
|
|
125
|
+
- **Integration target**: `.trellis/spec/{target}/`
|
|
126
126
|
|
|
127
127
|
### # Tech Stack Compatibility
|
|
128
128
|
|
|
@@ -134,9 +134,9 @@ Add to the Quick Navigation table in `index.md`:
|
|
|
134
134
|
|
|
135
135
|
| Type | Path |
|
|
136
136
|
|------|------|
|
|
137
|
-
| Guidelines doc | `.trellis/
|
|
138
|
-
| Code examples | `.trellis/
|
|
139
|
-
| Index update | `.trellis/
|
|
137
|
+
| Guidelines doc | `.trellis/spec/{target}/doc.md` (section: `skill-<name>`) |
|
|
138
|
+
| Code examples | `.trellis/spec/{target}/examples/skills/<name>/` |
|
|
139
|
+
| Index update | `.trellis/spec/{target}/index.md` |
|
|
140
140
|
|
|
141
141
|
> `{target}` = `frontend` or `backend`
|
|
142
142
|
|
|
@@ -186,7 +186,7 @@ If this skill is frequently used, create a shortcut command:
|
|
|
186
186
|
### Directory Structure
|
|
187
187
|
|
|
188
188
|
```
|
|
189
|
-
.trellis/
|
|
189
|
+
.trellis/spec/backend/
|
|
190
190
|
|-- doc.md # Add MCP section
|
|
191
191
|
|-- index.md # Add index entry
|
|
192
192
|
\-- examples/
|
|
@@ -41,7 +41,7 @@ Every AI session starts with a blank slate. Unlike human engineers who accumulat
|
|
|
41
41
|
|
|
42
42
|
**The Problem**: Without memory, AI asks the same questions repeatedly, makes the same mistakes, and can't build on previous work.
|
|
43
43
|
|
|
44
|
-
**The Solution**: The `.trellis/
|
|
44
|
+
**The Solution**: The `.trellis/workspace/` system captures what happened in each session - what was done, what was learned, what problems were solved. The `/start` command reads this history at session start, giving AI "artificial memory."
|
|
45
45
|
|
|
46
46
|
### Challenge 2: AI Has Generic Knowledge, Not Project-Specific Knowledge
|
|
47
47
|
|
|
@@ -49,7 +49,7 @@ AI models are trained on millions of codebases - they know general patterns for
|
|
|
49
49
|
|
|
50
50
|
**The Problem**: AI writes code that "works" but doesn't match your project's style. It uses patterns that conflict with existing code. It makes decisions that violate unwritten team rules.
|
|
51
51
|
|
|
52
|
-
**The Solution**: The `.trellis/
|
|
52
|
+
**The Solution**: The `.trellis/spec/` directory contains project-specific guidelines. The `/before-*-dev` commands inject this specialized knowledge into AI context before coding starts.
|
|
53
53
|
|
|
54
54
|
### Challenge 3: AI Context Window Is Limited
|
|
55
55
|
|
|
@@ -66,21 +66,24 @@ Even after injecting guidelines, AI has limited context window. As conversation
|
|
|
66
66
|
```
|
|
67
67
|
.trellis/
|
|
68
68
|
|-- .developer # Your identity (gitignored)
|
|
69
|
-
|-- workflow.md
|
|
70
|
-
|--
|
|
69
|
+
|-- workflow.md # Complete workflow documentation
|
|
70
|
+
|-- workspace/ # "AI Memory" - session history
|
|
71
71
|
| |-- index.md # All developers' progress
|
|
72
72
|
| \-- {developer}/ # Per-developer directory
|
|
73
73
|
| |-- index.md # Personal progress index
|
|
74
|
-
|
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
| \-- journal-N.md # Session records (max 2000 lines)
|
|
75
|
+
|-- tasks/ # Task tracking (unified)
|
|
76
|
+
| \-- {MM}-{DD}-{slug}/ # Task directory
|
|
77
|
+
| |-- task.json # Task metadata
|
|
78
|
+
| \-- prd.md # Requirements doc
|
|
79
|
+
|-- spec/ # "AI Training Data" - project knowledge
|
|
77
80
|
| |-- frontend/ # Frontend conventions
|
|
78
81
|
| |-- backend/ # Backend conventions
|
|
79
82
|
| \-- guides/ # Thinking patterns
|
|
80
83
|
\-- scripts/ # Automation tools
|
|
81
84
|
```
|
|
82
85
|
|
|
83
|
-
### Understanding
|
|
86
|
+
### Understanding spec/ subdirectories
|
|
84
87
|
|
|
85
88
|
**frontend/** - Single-layer frontend knowledge:
|
|
86
89
|
- Component patterns (how to write components in THIS project)
|
|
@@ -113,7 +116,7 @@ AI needs the same onboarding - but compressed into seconds at session start.
|
|
|
113
116
|
**WHAT IT ACTUALLY DOES**:
|
|
114
117
|
1. Reads developer identity (who am I in this project?)
|
|
115
118
|
2. Checks git status (what branch? uncommitted changes?)
|
|
116
|
-
3. Reads recent session history from `
|
|
119
|
+
3. Reads recent session history from `workspace/` (what happened before?)
|
|
117
120
|
4. Identifies active features (what's in progress?)
|
|
118
121
|
5. Understands current project state before making any changes
|
|
119
122
|
|
|
@@ -129,7 +132,7 @@ AI needs the same onboarding - but compressed into seconds at session start.
|
|
|
129
132
|
AI models have "pre-trained knowledge" - general patterns from millions of codebases. But YOUR project has specific conventions that differ from generic patterns.
|
|
130
133
|
|
|
131
134
|
**WHAT IT ACTUALLY DOES**:
|
|
132
|
-
1. Reads `.trellis/
|
|
135
|
+
1. Reads `.trellis/spec/frontend/` or `.trellis/spec/backend/`
|
|
133
136
|
2. Loads project-specific patterns into AI's working context:
|
|
134
137
|
- Component naming conventions
|
|
135
138
|
- State management patterns
|
|
@@ -190,13 +193,13 @@ The `/check-*` commands focus on code quality within a single layer. But real ch
|
|
|
190
193
|
|
|
191
194
|
---
|
|
192
195
|
|
|
193
|
-
### /record-
|
|
196
|
+
### /record-session - Persist Memory for Future
|
|
194
197
|
|
|
195
198
|
**WHY IT EXISTS**:
|
|
196
199
|
All the context AI built during this session will be lost when session ends. The next session's `/start` needs this information.
|
|
197
200
|
|
|
198
201
|
**WHAT IT ACTUALLY DOES**:
|
|
199
|
-
1. Records session summary to `
|
|
202
|
+
1. Records session summary to `workspace/{developer}/journal-N.md`
|
|
200
203
|
2. Captures what was done, learned, and what's remaining
|
|
201
204
|
3. Updates index files for quick lookup
|
|
202
205
|
|
|
@@ -207,20 +210,20 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
207
210
|
### Example 1: Bug Fix Session
|
|
208
211
|
|
|
209
212
|
**[1/8] /start** - AI needs project context before touching code
|
|
210
|
-
**[2/8] ./.trellis/scripts/
|
|
213
|
+
**[2/8] ./.trellis/scripts/task.sh create "Fix bug" --slug fix-bug** - Track work for future reference
|
|
211
214
|
**[3/8] /before-frontend-dev** - Inject project-specific frontend knowledge
|
|
212
215
|
**[4/8] Investigate and fix the bug** - Actual development work
|
|
213
216
|
**[5/8] /check-frontend** - Re-verify code against guidelines
|
|
214
217
|
**[6/8] /finish-work** - Holistic cross-layer review
|
|
215
218
|
**[7/8] Human tests and commits** - Human validates before code enters repo
|
|
216
|
-
**[8/8] /record-
|
|
219
|
+
**[8/8] /record-session** - Persist memory for future sessions
|
|
217
220
|
|
|
218
221
|
### Example 2: Planning Session (No Code)
|
|
219
222
|
|
|
220
223
|
**[1/4] /start** - Context needed even for non-coding work
|
|
221
|
-
**[2/4] ./.trellis/scripts/
|
|
224
|
+
**[2/4] ./.trellis/scripts/task.sh create "Planning task" --slug planning-task** - Planning is valuable work
|
|
222
225
|
**[3/4] Review docs, create subtask list** - Actual planning work
|
|
223
|
-
**[4/4] /record-
|
|
226
|
+
**[4/4] /record-session (with --summary)** - Planning decisions must be recorded
|
|
224
227
|
|
|
225
228
|
### Example 3: Code Review Fixes
|
|
226
229
|
|
|
@@ -229,7 +232,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
229
232
|
**[3/6] Fix each CR issue** - Address feedback with guidelines in context
|
|
230
233
|
**[4/6] /check-backend** - Verify fixes didn't introduce new issues
|
|
231
234
|
**[5/6] /finish-work** - Document lessons from CR
|
|
232
|
-
**[6/6] Human commits, then /record-
|
|
235
|
+
**[6/6] Human commits, then /record-session** - Preserve CR lessons
|
|
233
236
|
|
|
234
237
|
### Example 4: Large Refactoring
|
|
235
238
|
|
|
@@ -246,7 +249,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
246
249
|
**[3/6] Investigation** - Actual debugging work
|
|
247
250
|
**[4/6] /check-backend** - Verify debug changes don't break other things
|
|
248
251
|
**[5/6] /finish-work** - Debug findings might need documentation
|
|
249
|
-
**[6/6] Human commits, then /record-
|
|
252
|
+
**[6/6] Human commits, then /record-session** - Debug knowledge is valuable
|
|
250
253
|
|
|
251
254
|
---
|
|
252
255
|
|
|
@@ -255,7 +258,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
255
258
|
1. **AI NEVER commits** - Human tests and approves. AI prepares, human validates.
|
|
256
259
|
2. **Guidelines before code** - /before-*-dev commands inject project knowledge.
|
|
257
260
|
3. **Check after code** - /check-* commands catch context drift.
|
|
258
|
-
4. **Record everything** - /record-
|
|
261
|
+
4. **Record everything** - /record-session persists memory.
|
|
259
262
|
|
|
260
263
|
---
|
|
261
264
|
|
|
@@ -265,12 +268,12 @@ After explaining Part 1 and Part 2, check if the project's development guideline
|
|
|
265
268
|
|
|
266
269
|
## Step 1: Check Current Guidelines Status
|
|
267
270
|
|
|
268
|
-
Check if `.trellis/
|
|
271
|
+
Check if `.trellis/spec/` contains empty templates or customized guidelines:
|
|
269
272
|
|
|
270
273
|
```bash
|
|
271
274
|
# Check if files are still empty templates (look for placeholder text)
|
|
272
|
-
grep -l "To be filled by the team" .trellis/
|
|
273
|
-
grep -l "To be filled by the team" .trellis/
|
|
275
|
+
grep -l "To be filled by the team" .trellis/spec/backend/*.md 2>/dev/null | wc -l
|
|
276
|
+
grep -l "To be filled by the team" .trellis/spec/frontend/*.md 2>/dev/null | wc -l
|
|
274
277
|
```
|
|
275
278
|
|
|
276
279
|
## Step 2: Determine Situation
|
|
@@ -281,7 +284,7 @@ If guidelines are empty templates (contain "To be filled by the team"), this is
|
|
|
281
284
|
|
|
282
285
|
Explain to the developer:
|
|
283
286
|
|
|
284
|
-
"I see that the development guidelines in `.trellis/
|
|
287
|
+
"I see that the development guidelines in `.trellis/spec/` are still empty templates. This is normal for a new Trellis setup!
|
|
285
288
|
|
|
286
289
|
The templates contain placeholder text that needs to be replaced with YOUR project's actual conventions. Without this, `/before-*-dev` commands won't provide useful guidance.
|
|
287
290
|
|
|
@@ -291,7 +294,7 @@ The templates contain placeholder text that needs to be replaced with YOUR proje
|
|
|
291
294
|
2. Identify the patterns and conventions already in use
|
|
292
295
|
3. Document them in the guideline files
|
|
293
296
|
|
|
294
|
-
For example, for `.trellis/
|
|
297
|
+
For example, for `.trellis/spec/backend/database-guidelines.md`:
|
|
295
298
|
- What ORM/query library does your project use?
|
|
296
299
|
- How are migrations managed?
|
|
297
300
|
- What naming conventions for tables/columns?
|
|
@@ -306,14 +309,14 @@ Explain to the developer:
|
|
|
306
309
|
|
|
307
310
|
"Great! Your team has already customized the development guidelines. You can start using `/before-*-dev` commands right away.
|
|
308
311
|
|
|
309
|
-
I recommend reading through `.trellis/
|
|
312
|
+
I recommend reading through `.trellis/spec/` to familiarize yourself with the team's coding standards."
|
|
310
313
|
|
|
311
314
|
## Step 3: Help Fill Guidelines (If Empty)
|
|
312
315
|
|
|
313
316
|
If the developer wants help filling guidelines, create a feature to track this:
|
|
314
317
|
|
|
315
318
|
```bash
|
|
316
|
-
./.trellis/scripts/
|
|
319
|
+
./.trellis/scripts/task.sh create "Fill structure guidelines" --slug fill-structure-guidelines
|
|
317
320
|
```
|
|
318
321
|
|
|
319
322
|
Then systematically analyze the codebase and fill each guideline file:
|
|
@@ -348,8 +351,8 @@ After covering all three parts, summarize:
|
|
|
348
351
|
- Part 3: Guidelines status (empty templates need filling / already customized)
|
|
349
352
|
|
|
350
353
|
**Next steps** (tell user):
|
|
351
|
-
1. Run `/record-
|
|
352
|
-
2. [If guidelines empty] Start filling in `.trellis/
|
|
354
|
+
1. Run `/record-session` to record this onboard session
|
|
355
|
+
2. [If guidelines empty] Start filling in `.trellis/spec/` guidelines
|
|
353
356
|
3. [If guidelines ready] Start your first development task
|
|
354
357
|
|
|
355
358
|
What would you like to do first?"
|
|
@@ -35,18 +35,18 @@ EOF
|
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
**Auto-completes**:
|
|
38
|
-
- [OK] Appends session to
|
|
38
|
+
- [OK] Appends session to journal-N.md
|
|
39
39
|
- [OK] Auto-detects line count, creates new file if >2000 lines
|
|
40
40
|
- [OK] Updates index.md (Total Sessions +1, Last Active, line stats, history)
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
## Archive Completed
|
|
44
|
+
## Archive Completed Task (if any)
|
|
45
45
|
|
|
46
|
-
If a
|
|
46
|
+
If a task was completed this session:
|
|
47
47
|
|
|
48
48
|
```bash
|
|
49
|
-
./.trellis/scripts/
|
|
49
|
+
./.trellis/scripts/task.sh archive <task-name>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
52
|
---
|
|
@@ -57,6 +57,6 @@ If a feature was completed this session:
|
|
|
57
57
|
|---------|---------|
|
|
58
58
|
| `get-context.sh` | Get all context info |
|
|
59
59
|
| `add-session.sh --title "..." --commit "..."` | **One-click add session (recommended)** |
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
60
|
+
| `task.sh create "<title>" [--slug <name>]` | Create new task directory |
|
|
61
|
+
| `task.sh archive <name>` | Archive completed task |
|
|
62
|
+
| `task.sh list` | List active tasks |
|