@mindfoldhq/trellis 0.3.8 → 0.3.10-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/init.d.ts +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +203 -31
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +154 -6
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/workflow.d.ts +6 -2
- package/dist/configurators/workflow.d.ts.map +1 -1
- package/dist/configurators/workflow.js +88 -58
- package/dist/configurators/workflow.js.map +1 -1
- package/dist/migrations/index.d.ts +1 -0
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +2 -0
- package/dist/migrations/index.js.map +1 -1
- package/dist/migrations/manifests/0.3.9.json +9 -0
- package/dist/migrations/manifests/0.4.0-beta.1.json +228 -0
- package/dist/templates/claude/agents/dispatch.md +1 -2
- package/dist/templates/claude/agents/implement.md +2 -3
- package/dist/templates/claude/commands/trellis/before-dev.md +29 -0
- package/dist/templates/claude/commands/trellis/check.md +25 -0
- package/dist/templates/claude/commands/trellis/create-command.md +2 -2
- package/dist/templates/claude/commands/trellis/onboard.md +13 -13
- package/dist/templates/claude/commands/trellis/parallel.md +1 -2
- package/dist/templates/claude/commands/trellis/record-session.md +1 -1
- package/dist/templates/claude/commands/trellis/start.md +8 -4
- package/dist/templates/claude/hooks/inject-subagent-context.py +21 -13
- package/dist/templates/claude/hooks/session-start.py +170 -2
- package/dist/templates/codex/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/codex/skills/check/SKILL.md +30 -0
- package/dist/templates/codex/skills/create-command/SKILL.md +2 -2
- package/dist/templates/codex/skills/onboard/SKILL.md +11 -11
- package/dist/templates/codex/skills/record-session/SKILL.md +1 -1
- package/dist/templates/codex/skills/start/SKILL.md +8 -3
- package/dist/templates/cursor/commands/trellis-before-dev.md +29 -0
- package/dist/templates/cursor/commands/trellis-check.md +25 -0
- package/dist/templates/cursor/commands/trellis-create-command.md +2 -2
- package/dist/templates/cursor/commands/trellis-onboard.md +13 -13
- package/dist/templates/cursor/commands/trellis-record-session.md +1 -1
- package/dist/templates/cursor/commands/trellis-start.md +7 -16
- package/dist/templates/gemini/commands/trellis/before-dev.toml +33 -0
- package/dist/templates/gemini/commands/trellis/check.toml +29 -0
- package/dist/templates/gemini/commands/trellis/create-command.toml +2 -2
- package/dist/templates/gemini/commands/trellis/onboard.toml +2 -2
- package/dist/templates/gemini/commands/trellis/record-session.toml +1 -1
- package/dist/templates/gemini/commands/trellis/start.toml +9 -4
- package/dist/templates/iflow/agents/dispatch.md +1 -2
- package/dist/templates/iflow/agents/implement.md +2 -3
- package/dist/templates/iflow/commands/trellis/before-dev.md +29 -0
- package/dist/templates/iflow/commands/trellis/check.md +25 -0
- package/dist/templates/iflow/commands/trellis/create-command.md +2 -2
- package/dist/templates/iflow/commands/trellis/onboard.md +13 -13
- package/dist/templates/iflow/commands/trellis/parallel.md +1 -2
- package/dist/templates/iflow/commands/trellis/record-session.md +1 -1
- package/dist/templates/iflow/commands/trellis/start.md +8 -4
- package/dist/templates/iflow/hooks/inject-subagent-context.py +21 -13
- package/dist/templates/iflow/hooks/session-start.py +156 -1
- package/dist/templates/iflow/settings.json +2 -2
- package/dist/templates/kilo/workflows/before-dev.md +29 -0
- package/dist/templates/kilo/workflows/check.md +25 -0
- package/dist/templates/kilo/workflows/create-command.md +2 -2
- package/dist/templates/kilo/workflows/onboard.md +13 -13
- package/dist/templates/kilo/workflows/parallel.md +1 -2
- package/dist/templates/kilo/workflows/record-session.md +1 -1
- package/dist/templates/kilo/workflows/start.md +8 -3
- package/dist/templates/kiro/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/kiro/skills/check/SKILL.md +30 -0
- package/dist/templates/kiro/skills/create-command/SKILL.md +2 -2
- package/dist/templates/kiro/skills/onboard/SKILL.md +11 -11
- package/dist/templates/kiro/skills/record-session/SKILL.md +1 -1
- package/dist/templates/kiro/skills/start/SKILL.md +8 -3
- package/dist/templates/markdown/spec/backend/script-conventions.md +93 -0
- package/dist/templates/opencode/agents/dispatch.md +1 -2
- package/dist/templates/opencode/agents/implement.md +2 -2
- package/dist/templates/opencode/agents/research.md +1 -2
- package/dist/templates/opencode/commands/trellis/before-dev.md +29 -0
- package/dist/templates/opencode/commands/trellis/check.md +25 -0
- package/dist/templates/opencode/commands/trellis/create-command.md +2 -2
- package/dist/templates/opencode/commands/trellis/onboard.md +13 -13
- package/dist/templates/opencode/commands/trellis/parallel.md +1 -2
- package/dist/templates/opencode/commands/trellis/record-session.md +1 -1
- package/dist/templates/opencode/commands/trellis/start.md +8 -3
- package/dist/templates/opencode/plugin/inject-subagent-context.js +45 -18
- package/dist/templates/opencode/plugin/session-start.js +149 -1
- package/dist/templates/qoder/skills/before-dev/SKILL.md +34 -0
- package/dist/templates/qoder/skills/check/SKILL.md +30 -0
- package/dist/templates/qoder/skills/create-command/SKILL.md +2 -2
- package/dist/templates/qoder/skills/onboard/SKILL.md +13 -13
- package/dist/templates/qoder/skills/record-session/SKILL.md +1 -1
- package/dist/templates/qoder/skills/start/SKILL.md +8 -3
- package/dist/templates/trellis/config.yaml +20 -0
- package/dist/templates/trellis/index.d.ts +11 -0
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +22 -0
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/add_session.py +52 -7
- package/dist/templates/trellis/scripts/common/cli_adapter.py +33 -45
- package/dist/templates/trellis/scripts/common/config.py +152 -0
- package/dist/templates/trellis/scripts/common/git.py +31 -0
- package/dist/templates/trellis/scripts/common/git_context.py +23 -586
- package/dist/templates/trellis/scripts/common/io.py +37 -0
- package/dist/templates/trellis/scripts/common/log.py +45 -0
- package/dist/templates/trellis/scripts/common/packages_context.py +233 -0
- package/dist/templates/trellis/scripts/common/paths.py +46 -0
- package/dist/templates/trellis/scripts/common/phase.py +50 -49
- package/dist/templates/trellis/scripts/common/registry.py +41 -72
- package/dist/templates/trellis/scripts/common/session_context.py +466 -0
- package/dist/templates/trellis/scripts/common/task_context.py +384 -0
- package/dist/templates/trellis/scripts/common/task_queue.py +27 -98
- package/dist/templates/trellis/scripts/common/task_store.py +534 -0
- package/dist/templates/trellis/scripts/common/task_utils.py +96 -6
- package/dist/templates/trellis/scripts/common/tasks.py +109 -0
- package/dist/templates/trellis/scripts/common/types.py +112 -0
- package/dist/templates/trellis/scripts/create_bootstrap.py +31 -26
- package/dist/templates/trellis/scripts/hooks/linear_sync.py +243 -0
- package/dist/templates/trellis/scripts/multi_agent/_bootstrap.py +17 -0
- package/dist/templates/trellis/scripts/multi_agent/cleanup.py +43 -48
- package/dist/templates/trellis/scripts/multi_agent/create_pr.py +336 -45
- package/dist/templates/trellis/scripts/multi_agent/plan.py +2 -26
- package/dist/templates/trellis/scripts/multi_agent/start.py +126 -57
- package/dist/templates/trellis/scripts/multi_agent/status.py +12 -753
- package/dist/templates/trellis/scripts/multi_agent/status_display.py +542 -0
- package/dist/templates/trellis/scripts/multi_agent/status_monitor.py +225 -0
- package/dist/templates/trellis/scripts/task.py +50 -975
- package/dist/templates/trellis/workflow.md +21 -34
- package/dist/types/migration.d.ts +3 -1
- package/dist/types/migration.d.ts.map +1 -1
- package/dist/utils/project-detector.d.ts +23 -0
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +364 -0
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/template-fetcher.d.ts +2 -2
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +5 -5
- package/dist/utils/template-fetcher.js.map +1 -1
- package/package.json +1 -1
- package/dist/templates/claude/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/claude/commands/trellis/check-backend.md +0 -13
- package/dist/templates/claude/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/codex/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/codex/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/codex/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/codex/skills/check-frontend/SKILL.md +0 -18
- package/dist/templates/cursor/commands/trellis-before-backend-dev.md +0 -13
- package/dist/templates/cursor/commands/trellis-before-frontend-dev.md +0 -13
- package/dist/templates/cursor/commands/trellis-check-backend.md +0 -13
- package/dist/templates/cursor/commands/trellis-check-frontend.md +0 -13
- package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +0 -17
- package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +0 -17
- package/dist/templates/gemini/commands/trellis/check-backend.toml +0 -17
- package/dist/templates/gemini/commands/trellis/check-frontend.toml +0 -17
- package/dist/templates/iflow/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/iflow/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/iflow/commands/trellis/check-backend.md +0 -13
- package/dist/templates/iflow/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/kilo/workflows/before-backend-dev.md +0 -13
- package/dist/templates/kilo/workflows/before-frontend-dev.md +0 -13
- package/dist/templates/kilo/workflows/check-backend.md +0 -13
- package/dist/templates/kilo/workflows/check-frontend.md +0 -13
- package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/kiro/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/kiro/skills/check-frontend/SKILL.md +0 -18
- package/dist/templates/opencode/commands/trellis/before-backend-dev.md +0 -13
- package/dist/templates/opencode/commands/trellis/before-frontend-dev.md +0 -13
- package/dist/templates/opencode/commands/trellis/check-backend.md +0 -13
- package/dist/templates/opencode/commands/trellis/check-frontend.md +0 -13
- package/dist/templates/qoder/skills/before-backend-dev/SKILL.md +0 -18
- package/dist/templates/qoder/skills/before-frontend-dev/SKILL.md +0 -18
- package/dist/templates/qoder/skills/check-backend/SKILL.md +0 -18
- package/dist/templates/qoder/skills/check-frontend/SKILL.md +0 -18
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check
|
|
3
|
+
description: "Check if the code you just wrote follows the development guidelines."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Check if the code you just wrote follows the development guidelines.
|
|
7
|
+
|
|
8
|
+
Execute these steps:
|
|
9
|
+
|
|
10
|
+
1. **Identify changed files**:
|
|
11
|
+
```bash
|
|
12
|
+
git diff --name-only HEAD
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
2. **Determine which spec modules apply** based on the changed file paths:
|
|
16
|
+
```bash
|
|
17
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
3. **Read the spec index** for each relevant module:
|
|
21
|
+
```bash
|
|
22
|
+
cat .trellis/spec/<package>/<layer>/index.md
|
|
23
|
+
```
|
|
24
|
+
Follow the **"Quality Check"** section in the index.
|
|
25
|
+
|
|
26
|
+
4. **Read the specific guideline files** referenced in the Quality Check section (e.g., `quality-guidelines.md`, `conventions.md`). The index is NOT the goal — it points you to the actual guideline files. Read those files and review your code against them.
|
|
27
|
+
|
|
28
|
+
5. **Run lint and typecheck** for the affected package.
|
|
29
|
+
|
|
30
|
+
6. **Report any violations** and fix them if found.
|
|
@@ -93,8 +93,8 @@ Description:
|
|
|
93
93
|
| Skill Type | Prefix | Example |
|
|
94
94
|
|------------|--------|---------|
|
|
95
95
|
| Session Start | `start` | `start` |
|
|
96
|
-
| Pre-development | `before-` | `before-
|
|
97
|
-
| Check | `check-` | `check
|
|
96
|
+
| Pre-development | `before-` | `before-dev` |
|
|
97
|
+
| Check | `check-` | `check` |
|
|
98
98
|
| Record | `record-` | `record-session` |
|
|
99
99
|
| Generate | `generate-` | `generate-api-doc` |
|
|
100
100
|
| Update | `update-` | `update-changelog` |
|
|
@@ -131,13 +131,13 @@ AI needs the same onboarding - but compressed into seconds at session start.
|
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
134
|
-
### $before-
|
|
134
|
+
### $before-dev - Inject Specialized Knowledge
|
|
135
135
|
|
|
136
136
|
**WHY IT EXISTS**:
|
|
137
137
|
AI models have "pre-trained knowledge" - general patterns from millions of codebases. But YOUR project has specific conventions that differ from generic patterns.
|
|
138
138
|
|
|
139
139
|
**WHAT IT ACTUALLY DOES**:
|
|
140
|
-
1.
|
|
140
|
+
1. Discovers spec layers via `get_context.py --mode packages` and reads relevant guidelines
|
|
141
141
|
2. Loads project-specific patterns into AI's working context:
|
|
142
142
|
- Component naming conventions
|
|
143
143
|
- State management patterns
|
|
@@ -145,12 +145,12 @@ AI models have "pre-trained knowledge" - general patterns from millions of codeb
|
|
|
145
145
|
- Error handling standards
|
|
146
146
|
|
|
147
147
|
**WHY THIS MATTERS**:
|
|
148
|
-
- Without before
|
|
149
|
-
- With before
|
|
148
|
+
- Without before-dev: AI writes generic code that doesn't match project style.
|
|
149
|
+
- With before-dev: AI writes code that looks like the rest of the codebase.
|
|
150
150
|
|
|
151
151
|
---
|
|
152
152
|
|
|
153
|
-
### $check
|
|
153
|
+
### $check - Combat Context Drift
|
|
154
154
|
|
|
155
155
|
**WHY IT EXISTS**:
|
|
156
156
|
AI context window has limited capacity. As conversation progresses, guidelines injected at session start become less influential. This causes "context drift."
|
|
@@ -216,9 +216,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
216
216
|
|
|
217
217
|
**[1/8] $start** - AI needs project context before touching code
|
|
218
218
|
**[2/8] python3 ./.trellis/scripts/task.py create "Fix bug" --slug fix-bug** - Track work for future reference
|
|
219
|
-
**[3/8] $before-
|
|
219
|
+
**[3/8] $before-dev** - Inject project-specific development guidelines
|
|
220
220
|
**[4/8] Investigate and fix the bug** - Actual development work
|
|
221
|
-
**[5/8] $check
|
|
221
|
+
**[5/8] $check** - Re-verify code against guidelines
|
|
222
222
|
**[6/8] $finish-work** - Holistic cross-layer review
|
|
223
223
|
**[7/8] Human tests and commits** - Human validates before code enters repo
|
|
224
224
|
**[8/8] $record-session** - Persist memory for future sessions
|
|
@@ -233,9 +233,9 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
233
233
|
### Example 3: Code Review Fixes
|
|
234
234
|
|
|
235
235
|
**[1/6] $start** - Resume context from previous session
|
|
236
|
-
**[2/6] $before-
|
|
236
|
+
**[2/6] $before-dev** - Re-inject guidelines before fixes
|
|
237
237
|
**[3/6] Fix each CR issue** - Address feedback with guidelines in context
|
|
238
|
-
**[4/6] $check
|
|
238
|
+
**[4/6] $check** - Verify fixes did not introduce new issues
|
|
239
239
|
**[5/6] $finish-work** - Document lessons from CR
|
|
240
240
|
**[6/6] Human commits, then $record-session** - Preserve CR lessons
|
|
241
241
|
|
|
@@ -243,16 +243,16 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
243
243
|
|
|
244
244
|
**[1/5] $start** - Clear baseline before major changes
|
|
245
245
|
**[2/5] Plan phases** - Break into verifiable chunks
|
|
246
|
-
**[3/5] Execute phase by phase with
|
|
246
|
+
**[3/5] Execute phase by phase with $check after each** - Incremental verification
|
|
247
247
|
**[4/5] $finish-work** - Check if new patterns should be documented
|
|
248
248
|
**[5/5] Record with multiple commit hashes** - Link all commits to one feature
|
|
249
249
|
|
|
250
250
|
### Example 5: Debug Session
|
|
251
251
|
|
|
252
252
|
**[1/6] $start** - See if this bug was investigated before
|
|
253
|
-
**[2/6] $before-
|
|
253
|
+
**[2/6] $before-dev** - Guidelines might document known gotchas
|
|
254
254
|
**[3/6] Investigation** - Actual debugging work
|
|
255
|
-
**[4/6] $check
|
|
255
|
+
**[4/6] $check** - Verify debug changes do not break other things
|
|
256
256
|
**[5/6] $finish-work** - Debug findings might need documentation
|
|
257
257
|
**[6/6] Human commits, then $record-session** - Debug knowledge is valuable
|
|
258
258
|
|
|
@@ -261,7 +261,7 @@ All the context AI built during this session will be lost when session ends. The
|
|
|
261
261
|
## KEY RULES TO EMPHASIZE
|
|
262
262
|
|
|
263
263
|
1. **AI NEVER commits** - Human tests and approves. AI prepares, human validates.
|
|
264
|
-
2. **Guidelines before code** -
|
|
264
|
+
2. **Guidelines before code** - $before-dev command injects project knowledge.
|
|
265
265
|
3. **Check after code** - /check-* commands catch context drift.
|
|
266
266
|
4. **Record everything** - $record-session persists memory.
|
|
267
267
|
|
|
@@ -36,7 +36,7 @@ python3 ./.trellis/scripts/add_session.py \
|
|
|
36
36
|
--summary "Brief summary of what was done"
|
|
37
37
|
|
|
38
38
|
# Method 2: Pass detailed content via stdin
|
|
39
|
-
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --title "Title" --commit "hash"
|
|
39
|
+
cat << 'EOF' | python3 ./.trellis/scripts/add_session.py --stdin --title "Title" --commit "hash"
|
|
40
40
|
| Feature | Description |
|
|
41
41
|
|---------|-------------|
|
|
42
42
|
| New API | Added user authentication endpoint |
|
|
@@ -45,9 +45,14 @@ This shows: developer identity, git status, current task (if any), active tasks.
|
|
|
45
45
|
### Step 3: Read Guidelines Index
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
python3 ./.trellis/scripts/get_context.py --mode packages
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
This shows available packages and their spec layers. Read the relevant spec indexes:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
cat .trellis/spec/<package>/<layer>/index.md # Package-specific guidelines
|
|
55
|
+
cat .trellis/spec/guides/index.md # Thinking guides (always read)
|
|
51
56
|
```
|
|
52
57
|
|
|
53
58
|
> **Important**: The index files are navigation — they list the actual guideline files (e.g., `error-handling.md`, `conventions.md`, `mock-strategies.md`).
|
|
@@ -31,3 +31,23 @@ max_journal_lines: 2000
|
|
|
31
31
|
# - "echo 'Task finished'"
|
|
32
32
|
# after_archive:
|
|
33
33
|
# - "echo 'Task archived'"
|
|
34
|
+
|
|
35
|
+
#-------------------------------------------------------------------------------
|
|
36
|
+
# Monorepo / Packages
|
|
37
|
+
#-------------------------------------------------------------------------------
|
|
38
|
+
|
|
39
|
+
# Declare packages for monorepo projects.
|
|
40
|
+
# Trellis auto-detects workspaces during `trellis init`, but you can also
|
|
41
|
+
# configure them manually here.
|
|
42
|
+
#
|
|
43
|
+
# packages:
|
|
44
|
+
# frontend:
|
|
45
|
+
# path: packages/frontend
|
|
46
|
+
# backend:
|
|
47
|
+
# path: packages/backend
|
|
48
|
+
# docs:
|
|
49
|
+
# path: docs-site
|
|
50
|
+
# type: submodule
|
|
51
|
+
|
|
52
|
+
# Default package used when --package is not specified.
|
|
53
|
+
# default_package: frontend
|
|
@@ -29,12 +29,23 @@ export declare const commonPhase: string;
|
|
|
29
29
|
export declare const commonRegistry: string;
|
|
30
30
|
export declare const commonCliAdapter: string;
|
|
31
31
|
export declare const commonConfig: string;
|
|
32
|
+
export declare const commonIo: string;
|
|
33
|
+
export declare const commonLog: string;
|
|
34
|
+
export declare const commonGit: string;
|
|
35
|
+
export declare const commonTypes: string;
|
|
36
|
+
export declare const commonTasks: string;
|
|
37
|
+
export declare const commonTaskContext: string;
|
|
38
|
+
export declare const commonTaskStore: string;
|
|
39
|
+
export declare const commonSessionContext: string;
|
|
40
|
+
export declare const commonPackagesContext: string;
|
|
32
41
|
export declare const multiAgentInit: string;
|
|
33
42
|
export declare const multiAgentStart: string;
|
|
34
43
|
export declare const multiAgentCleanup: string;
|
|
35
44
|
export declare const multiAgentStatus: string;
|
|
36
45
|
export declare const multiAgentCreatePr: string;
|
|
37
46
|
export declare const multiAgentPlan: string;
|
|
47
|
+
export declare const multiAgentStatusDisplay: string;
|
|
48
|
+
export declare const multiAgentStatusMonitor: string;
|
|
38
49
|
export declare const getDeveloperScript: string;
|
|
39
50
|
export declare const initDeveloperScript: string;
|
|
40
51
|
export declare const taskScript: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,cAAc,QAA6C,CAAC;AACzE,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,cAAc,QAA6C,CAAC;AACzE,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,YAAY,QAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAcH,eAAO,MAAM,WAAW,QAAsC,CAAC;AAG/D,eAAO,MAAM,UAAU,QAA6C,CAAC;AACrE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,eAAe,QAA8C,CAAC;AAC3E,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,cAAc,QAA6C,CAAC;AACzE,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,cAAc,QAA6C,CAAC;AACzE,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,YAAY,QAA2C,CAAC;AACrE,eAAO,MAAM,QAAQ,QAAuC,CAAC;AAC7D,eAAO,MAAM,SAAS,QAAwC,CAAC;AAC/D,eAAO,MAAM,SAAS,QAAwC,CAAC;AAC/D,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,WAAW,QAA0C,CAAC;AACnE,eAAO,MAAM,iBAAiB,QAAiD,CAAC;AAChF,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,oBAAoB,QAEhC,CAAC;AACF,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AAGF,eAAO,MAAM,cAAc,QAAkD,CAAC;AAC9E,eAAO,MAAM,eAAe,QAA+C,CAAC;AAC5E,eAAO,MAAM,iBAAiB,QAAiD,CAAC;AAChF,eAAO,MAAM,gBAAgB,QAAgD,CAAC;AAC9E,eAAO,MAAM,kBAAkB,QAE9B,CAAC;AACF,eAAO,MAAM,cAAc,QAA8C,CAAC;AAC1E,eAAO,MAAM,uBAAuB,QAEnC,CAAC;AACF,eAAO,MAAM,uBAAuB,QAEnC,CAAC;AAGF,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAC3E,eAAO,MAAM,mBAAmB,QAA4C,CAAC;AAC7E,eAAO,MAAM,UAAU,QAAkC,CAAC;AAC1D,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AACvE,eAAO,MAAM,gBAAgB,QAAyC,CAAC;AACvE,eAAO,MAAM,qBAAqB,QAEjC,CAAC;AAGF,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,kBAAkB,QAA8B,CAAC;AAC9D,eAAO,MAAM,oBAAoB,QAAgC,CAAC;AAClE,eAAO,MAAM,iBAAiB,QAAgC,CAAC;AAE/D;;GAEG;AACH,wBAAgB,aAAa,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CA+CnD"}
|
|
@@ -39,6 +39,15 @@ export const commonPhase = readTemplate("scripts/common/phase.py");
|
|
|
39
39
|
export const commonRegistry = readTemplate("scripts/common/registry.py");
|
|
40
40
|
export const commonCliAdapter = readTemplate("scripts/common/cli_adapter.py");
|
|
41
41
|
export const commonConfig = readTemplate("scripts/common/config.py");
|
|
42
|
+
export const commonIo = readTemplate("scripts/common/io.py");
|
|
43
|
+
export const commonLog = readTemplate("scripts/common/log.py");
|
|
44
|
+
export const commonGit = readTemplate("scripts/common/git.py");
|
|
45
|
+
export const commonTypes = readTemplate("scripts/common/types.py");
|
|
46
|
+
export const commonTasks = readTemplate("scripts/common/tasks.py");
|
|
47
|
+
export const commonTaskContext = readTemplate("scripts/common/task_context.py");
|
|
48
|
+
export const commonTaskStore = readTemplate("scripts/common/task_store.py");
|
|
49
|
+
export const commonSessionContext = readTemplate("scripts/common/session_context.py");
|
|
50
|
+
export const commonPackagesContext = readTemplate("scripts/common/packages_context.py");
|
|
42
51
|
// Python scripts - multi_agent
|
|
43
52
|
export const multiAgentInit = readTemplate("scripts/multi_agent/__init__.py");
|
|
44
53
|
export const multiAgentStart = readTemplate("scripts/multi_agent/start.py");
|
|
@@ -46,6 +55,8 @@ export const multiAgentCleanup = readTemplate("scripts/multi_agent/cleanup.py");
|
|
|
46
55
|
export const multiAgentStatus = readTemplate("scripts/multi_agent/status.py");
|
|
47
56
|
export const multiAgentCreatePr = readTemplate("scripts/multi_agent/create_pr.py");
|
|
48
57
|
export const multiAgentPlan = readTemplate("scripts/multi_agent/plan.py");
|
|
58
|
+
export const multiAgentStatusDisplay = readTemplate("scripts/multi_agent/status_display.py");
|
|
59
|
+
export const multiAgentStatusMonitor = readTemplate("scripts/multi_agent/status_monitor.py");
|
|
49
60
|
// Python scripts - main
|
|
50
61
|
export const getDeveloperScript = readTemplate("scripts/get_developer.py");
|
|
51
62
|
export const initDeveloperScript = readTemplate("scripts/init_developer.py");
|
|
@@ -77,6 +88,15 @@ export function getAllScripts() {
|
|
|
77
88
|
scripts.set("common/registry.py", commonRegistry);
|
|
78
89
|
scripts.set("common/cli_adapter.py", commonCliAdapter);
|
|
79
90
|
scripts.set("common/config.py", commonConfig);
|
|
91
|
+
scripts.set("common/io.py", commonIo);
|
|
92
|
+
scripts.set("common/log.py", commonLog);
|
|
93
|
+
scripts.set("common/git.py", commonGit);
|
|
94
|
+
scripts.set("common/types.py", commonTypes);
|
|
95
|
+
scripts.set("common/tasks.py", commonTasks);
|
|
96
|
+
scripts.set("common/task_context.py", commonTaskContext);
|
|
97
|
+
scripts.set("common/task_store.py", commonTaskStore);
|
|
98
|
+
scripts.set("common/session_context.py", commonSessionContext);
|
|
99
|
+
scripts.set("common/packages_context.py", commonPackagesContext);
|
|
80
100
|
// Multi-agent
|
|
81
101
|
scripts.set("multi_agent/__init__.py", multiAgentInit);
|
|
82
102
|
scripts.set("multi_agent/start.py", multiAgentStart);
|
|
@@ -84,6 +104,8 @@ export function getAllScripts() {
|
|
|
84
104
|
scripts.set("multi_agent/status.py", multiAgentStatus);
|
|
85
105
|
scripts.set("multi_agent/create_pr.py", multiAgentCreatePr);
|
|
86
106
|
scripts.set("multi_agent/plan.py", multiAgentPlan);
|
|
107
|
+
scripts.set("multi_agent/status_display.py", multiAgentStatusDisplay);
|
|
108
|
+
scripts.set("multi_agent/status_monitor.py", multiAgentStatusMonitor);
|
|
87
109
|
// Main
|
|
88
110
|
scripts.set("get_developer.py", getDeveloperScript);
|
|
89
111
|
scripts.set("init_developer.py", initDeveloperScript);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/trellis/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,SAAS,YAAY,CAAC,YAAoB;IACxC,OAAO,YAAY,CAAC,IAAI,CAAC,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C,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,uBAAuB,CAAC,CAAC;IAEtE,OAAO;IACP,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACnC,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAE,qBAAqB,CAAC,CAAC;IAE1D,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -4,13 +4,18 @@
|
|
|
4
4
|
Add a new session to journal file and update index.md.
|
|
5
5
|
|
|
6
6
|
Usage:
|
|
7
|
-
python3 add_session.py --title "Title" --commit "hash" --summary "Summary"
|
|
8
|
-
|
|
7
|
+
python3 add_session.py --title "Title" --commit "hash" --summary "Summary" [--package cli]
|
|
8
|
+
|
|
9
|
+
# Pipe detailed content via stdin (use --stdin to opt in):
|
|
10
|
+
cat << 'EOF' | python3 add_session.py --stdin --title "Title" --summary "Summary"
|
|
11
|
+
<session content here>
|
|
12
|
+
EOF
|
|
9
13
|
"""
|
|
10
14
|
|
|
11
15
|
from __future__ import annotations
|
|
12
16
|
|
|
13
17
|
import argparse
|
|
18
|
+
import json
|
|
14
19
|
import re
|
|
15
20
|
import subprocess
|
|
16
21
|
import sys
|
|
@@ -20,11 +25,20 @@ from pathlib import Path
|
|
|
20
25
|
from common.paths import (
|
|
21
26
|
FILE_JOURNAL_PREFIX,
|
|
22
27
|
get_repo_root,
|
|
28
|
+
get_current_task,
|
|
23
29
|
get_developer,
|
|
24
30
|
get_workspace_dir,
|
|
25
31
|
)
|
|
26
32
|
from common.developer import ensure_developer
|
|
27
|
-
from common.
|
|
33
|
+
from common.tasks import load_task
|
|
34
|
+
from common.config import (
|
|
35
|
+
get_packages,
|
|
36
|
+
get_session_commit_message,
|
|
37
|
+
get_max_journal_lines,
|
|
38
|
+
is_monorepo,
|
|
39
|
+
resolve_package,
|
|
40
|
+
validate_package,
|
|
41
|
+
)
|
|
28
42
|
|
|
29
43
|
|
|
30
44
|
# =============================================================================
|
|
@@ -123,7 +137,8 @@ def generate_session_content(
|
|
|
123
137
|
commit: str,
|
|
124
138
|
summary: str,
|
|
125
139
|
extra_content: str,
|
|
126
|
-
today: str
|
|
140
|
+
today: str,
|
|
141
|
+
package: str | None = None,
|
|
127
142
|
) -> str:
|
|
128
143
|
"""Generate session content."""
|
|
129
144
|
if commit and commit != "-":
|
|
@@ -135,12 +150,14 @@ def generate_session_content(
|
|
|
135
150
|
else:
|
|
136
151
|
commit_table = "(No commits - planning session)"
|
|
137
152
|
|
|
153
|
+
package_line = f"\n**Package**: {package}" if package else ""
|
|
154
|
+
|
|
138
155
|
return f"""
|
|
139
156
|
|
|
140
157
|
## Session {session_num}: {title}
|
|
141
158
|
|
|
142
159
|
**Date**: {today}
|
|
143
|
-
**Task**: {title}
|
|
160
|
+
**Task**: {title}{package_line}
|
|
144
161
|
|
|
145
162
|
### Summary
|
|
146
163
|
|
|
@@ -305,6 +322,7 @@ def add_session(
|
|
|
305
322
|
summary: str = "(Add summary)",
|
|
306
323
|
extra_content: str = "(Add details)",
|
|
307
324
|
auto_commit: bool = True,
|
|
325
|
+
package: str | None = None,
|
|
308
326
|
) -> int:
|
|
309
327
|
"""Add a new session."""
|
|
310
328
|
repo_root = get_repo_root()
|
|
@@ -330,7 +348,7 @@ def add_session(
|
|
|
330
348
|
new_session = current_session + 1
|
|
331
349
|
|
|
332
350
|
session_content = generate_session_content(
|
|
333
|
-
new_session, title, commit, summary, extra_content, today
|
|
351
|
+
new_session, title, commit, summary, extra_content, today, package
|
|
334
352
|
)
|
|
335
353
|
content_lines = len(session_content.splitlines())
|
|
336
354
|
|
|
@@ -400,8 +418,11 @@ def main() -> int:
|
|
|
400
418
|
parser.add_argument("--commit", default="-", help="Comma-separated commit hashes")
|
|
401
419
|
parser.add_argument("--summary", default="(Add summary)", help="Brief summary")
|
|
402
420
|
parser.add_argument("--content-file", help="Path to file with detailed content")
|
|
421
|
+
parser.add_argument("--package", help="Package name tag (e.g., cli, docs-site)")
|
|
403
422
|
parser.add_argument("--no-commit", action="store_true",
|
|
404
423
|
help="Skip auto-commit of workspace changes")
|
|
424
|
+
parser.add_argument("--stdin", action="store_true",
|
|
425
|
+
help="Read extra content from stdin (explicit opt-in)")
|
|
405
426
|
|
|
406
427
|
args = parser.parse_args()
|
|
407
428
|
|
|
@@ -410,12 +431,36 @@ def main() -> int:
|
|
|
410
431
|
content_path = Path(args.content_file)
|
|
411
432
|
if content_path.is_file():
|
|
412
433
|
extra_content = content_path.read_text(encoding="utf-8")
|
|
413
|
-
elif
|
|
434
|
+
elif args.stdin:
|
|
414
435
|
extra_content = sys.stdin.read()
|
|
415
436
|
|
|
437
|
+
# Resolve package: CLI → active task → default_package → None
|
|
438
|
+
repo_root = get_repo_root()
|
|
439
|
+
package = args.package
|
|
440
|
+
if package:
|
|
441
|
+
# CLI source: fail-fast in monorepo, ignore in single-repo
|
|
442
|
+
if not is_monorepo(repo_root):
|
|
443
|
+
print("Warning: --package ignored in single-repo project", file=sys.stderr)
|
|
444
|
+
package = None
|
|
445
|
+
elif not validate_package(package, repo_root):
|
|
446
|
+
packages = get_packages(repo_root)
|
|
447
|
+
available = ", ".join(sorted(packages.keys())) if packages else "(none)"
|
|
448
|
+
print(f"Error: unknown package '{package}'. Available: {available}", file=sys.stderr)
|
|
449
|
+
return 1
|
|
450
|
+
else:
|
|
451
|
+
# Inferred: active task's task.json.package → default_package → None
|
|
452
|
+
task_package = None
|
|
453
|
+
current = get_current_task(repo_root)
|
|
454
|
+
if current:
|
|
455
|
+
ct = load_task(repo_root / current)
|
|
456
|
+
if ct and ct.package:
|
|
457
|
+
task_package = ct.package
|
|
458
|
+
package = resolve_package(task_package, repo_root)
|
|
459
|
+
|
|
416
460
|
return add_session(
|
|
417
461
|
args.title, args.commit, args.summary, extra_content,
|
|
418
462
|
auto_commit=not args.no_commit,
|
|
463
|
+
package=package,
|
|
419
464
|
)
|
|
420
465
|
|
|
421
466
|
|
|
@@ -175,7 +175,7 @@ class CLIAdapter:
|
|
|
175
175
|
"""Get relative path to a trellis command file.
|
|
176
176
|
|
|
177
177
|
Args:
|
|
178
|
-
name: Command name without extension (e.g., 'finish-work', 'check
|
|
178
|
+
name: Command name without extension (e.g., 'finish-work', 'check')
|
|
179
179
|
|
|
180
180
|
Returns:
|
|
181
181
|
Relative path string for use in JSONL entries
|
|
@@ -492,6 +492,29 @@ def get_cli_adapter(platform: str = "claude") -> CLIAdapter:
|
|
|
492
492
|
return CLIAdapter(platform=platform) # type: ignore
|
|
493
493
|
|
|
494
494
|
|
|
495
|
+
_ALL_PLATFORM_CONFIG_DIRS = (
|
|
496
|
+
".claude",
|
|
497
|
+
".cursor",
|
|
498
|
+
".iflow",
|
|
499
|
+
".opencode",
|
|
500
|
+
".agents",
|
|
501
|
+
".kilocode",
|
|
502
|
+
".kiro",
|
|
503
|
+
".gemini",
|
|
504
|
+
".agent",
|
|
505
|
+
)
|
|
506
|
+
"""All platform config directory names (used by detect_platform exclusion checks)."""
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
def _has_other_platform_dir(project_root: Path, exclude: set[str]) -> bool:
|
|
510
|
+
"""Check if any platform config dir exists besides those in *exclude*."""
|
|
511
|
+
return any(
|
|
512
|
+
(project_root / d).is_dir()
|
|
513
|
+
for d in _ALL_PLATFORM_CONFIG_DIRS
|
|
514
|
+
if d not in exclude
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
|
|
495
518
|
def detect_platform(project_root: Path) -> Platform:
|
|
496
519
|
"""Auto-detect platform based on existing config directories.
|
|
497
520
|
|
|
@@ -533,12 +556,10 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
533
556
|
return env_platform # type: ignore
|
|
534
557
|
|
|
535
558
|
# Check for .opencode directory (OpenCode-specific)
|
|
536
|
-
# Note: .claude might exist in both platforms during migration
|
|
537
559
|
if (project_root / ".opencode").is_dir():
|
|
538
560
|
return "opencode"
|
|
539
561
|
|
|
540
562
|
# Check for .iflow directory (iFlow-specific)
|
|
541
|
-
# Note: .claude might exist in both platforms during migration
|
|
542
563
|
if (project_root / ".iflow").is_dir():
|
|
543
564
|
return "iflow"
|
|
544
565
|
|
|
@@ -552,20 +573,9 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
552
573
|
return "gemini"
|
|
553
574
|
|
|
554
575
|
# Check for Codex skills directory only when no other platform config exists
|
|
555
|
-
|
|
556
|
-
".
|
|
557
|
-
|
|
558
|
-
".iflow",
|
|
559
|
-
".opencode",
|
|
560
|
-
".kilocode",
|
|
561
|
-
".kiro",
|
|
562
|
-
".gemini",
|
|
563
|
-
".agent",
|
|
564
|
-
)
|
|
565
|
-
has_other_platform_config = any(
|
|
566
|
-
(project_root / directory).is_dir() for directory in other_platform_dirs_codex
|
|
567
|
-
)
|
|
568
|
-
if (project_root / ".agents" / "skills").is_dir() and not has_other_platform_config:
|
|
576
|
+
if (project_root / ".agents" / "skills").is_dir() and not _has_other_platform_dir(
|
|
577
|
+
project_root, {".agents"}
|
|
578
|
+
):
|
|
569
579
|
return "codex"
|
|
570
580
|
|
|
571
581
|
# Check for .kilocode directory (Kilo-specific)
|
|
@@ -573,39 +583,17 @@ def detect_platform(project_root: Path) -> Platform:
|
|
|
573
583
|
return "kilo"
|
|
574
584
|
|
|
575
585
|
# Check for Kiro skills directory only when no other platform config exists
|
|
576
|
-
|
|
577
|
-
".
|
|
578
|
-
|
|
579
|
-
".iflow",
|
|
580
|
-
".opencode",
|
|
581
|
-
".agents",
|
|
582
|
-
".kilocode",
|
|
583
|
-
".gemini",
|
|
584
|
-
".agent",
|
|
585
|
-
)
|
|
586
|
-
has_other_platform_config = any(
|
|
587
|
-
(project_root / directory).is_dir() for directory in other_platform_dirs_kiro
|
|
588
|
-
)
|
|
589
|
-
if (project_root / ".kiro" / "skills").is_dir() and not has_other_platform_config:
|
|
586
|
+
if (project_root / ".kiro" / "skills").is_dir() and not _has_other_platform_dir(
|
|
587
|
+
project_root, {".kiro"}
|
|
588
|
+
):
|
|
590
589
|
return "kiro"
|
|
591
590
|
|
|
592
591
|
# Check for Antigravity workflow directory only when no other platform config exists
|
|
593
|
-
other_platform_dirs_antigravity = (
|
|
594
|
-
".claude",
|
|
595
|
-
".cursor",
|
|
596
|
-
".iflow",
|
|
597
|
-
".opencode",
|
|
598
|
-
".agents",
|
|
599
|
-
".kilocode",
|
|
600
|
-
".kiro",
|
|
601
|
-
)
|
|
602
|
-
has_other_platform_config = any(
|
|
603
|
-
(project_root / directory).is_dir()
|
|
604
|
-
for directory in other_platform_dirs_antigravity
|
|
605
|
-
)
|
|
606
592
|
if (
|
|
607
593
|
project_root / ".agent" / "workflows"
|
|
608
|
-
).is_dir() and not
|
|
594
|
+
).is_dir() and not _has_other_platform_dir(
|
|
595
|
+
project_root, {".agent", ".gemini"}
|
|
596
|
+
):
|
|
609
597
|
return "antigravity"
|
|
610
598
|
|
|
611
599
|
# Check for .qoder directory (Qoder-specific)
|