@mindfoldhq/trellis 0.5.0-beta.8 → 0.5.0-rc.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/README.md +60 -95
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +474 -210
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +295 -54
- package/dist/commands/update.js.map +1 -1
- package/dist/configurators/antigravity.d.ts.map +1 -1
- package/dist/configurators/antigravity.js +2 -8
- package/dist/configurators/antigravity.js.map +1 -1
- package/dist/configurators/claude.d.ts.map +1 -1
- package/dist/configurators/claude.js +4 -10
- package/dist/configurators/claude.js.map +1 -1
- package/dist/configurators/codebuddy.d.ts.map +1 -1
- package/dist/configurators/codebuddy.js +3 -3
- package/dist/configurators/codebuddy.js.map +1 -1
- package/dist/configurators/codex.d.ts.map +1 -1
- package/dist/configurators/codex.js +5 -13
- package/dist/configurators/codex.js.map +1 -1
- package/dist/configurators/copilot.d.ts.map +1 -1
- package/dist/configurators/copilot.js +5 -19
- package/dist/configurators/copilot.js.map +1 -1
- package/dist/configurators/cursor.d.ts.map +1 -1
- package/dist/configurators/cursor.js +3 -3
- package/dist/configurators/cursor.js.map +1 -1
- package/dist/configurators/droid.d.ts.map +1 -1
- package/dist/configurators/droid.js +3 -3
- package/dist/configurators/droid.js.map +1 -1
- package/dist/configurators/gemini.d.ts.map +1 -1
- package/dist/configurators/gemini.js +3 -5
- package/dist/configurators/gemini.js.map +1 -1
- package/dist/configurators/index.d.ts.map +1 -1
- package/dist/configurators/index.js +44 -55
- package/dist/configurators/index.js.map +1 -1
- package/dist/configurators/kilo.d.ts.map +1 -1
- package/dist/configurators/kilo.js +2 -8
- package/dist/configurators/kilo.js.map +1 -1
- package/dist/configurators/kiro.d.ts.map +1 -1
- package/dist/configurators/kiro.js +3 -3
- package/dist/configurators/kiro.js.map +1 -1
- package/dist/configurators/opencode.d.ts.map +1 -1
- package/dist/configurators/opencode.js +7 -4
- package/dist/configurators/opencode.js.map +1 -1
- package/dist/configurators/pi.d.ts +3 -0
- package/dist/configurators/pi.d.ts.map +1 -0
- package/dist/configurators/pi.js +44 -0
- package/dist/configurators/pi.js.map +1 -0
- package/dist/configurators/qoder.d.ts +7 -6
- package/dist/configurators/qoder.d.ts.map +1 -1
- package/dist/configurators/qoder.js +18 -12
- package/dist/configurators/qoder.js.map +1 -1
- package/dist/configurators/shared.d.ts +30 -6
- package/dist/configurators/shared.d.ts.map +1 -1
- package/dist/configurators/shared.js +65 -15
- package/dist/configurators/shared.js.map +1 -1
- package/dist/configurators/windsurf.d.ts.map +1 -1
- package/dist/configurators/windsurf.js +2 -8
- package/dist/configurators/windsurf.js.map +1 -1
- package/dist/constants/paths.d.ts +2 -0
- package/dist/constants/paths.d.ts.map +1 -1
- package/dist/constants/paths.js +2 -0
- package/dist/constants/paths.js.map +1 -1
- package/dist/migrations/manifests/0.5.0-beta.0.json +2 -0
- package/dist/migrations/manifests/0.5.0-beta.10.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.11.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.12.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.13.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.14.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.15.json +116 -0
- package/dist/migrations/manifests/0.5.0-beta.16.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.17.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.18.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.19.json +9 -0
- package/dist/migrations/manifests/0.5.0-beta.5.json +2 -0
- package/dist/migrations/manifests/0.5.0-beta.9.json +48 -0
- package/dist/migrations/manifests/0.5.0-rc.0.json +9 -0
- package/dist/templates/claude/agents/trellis-research.md +1 -1
- package/dist/templates/claude/settings.json +0 -4
- package/dist/templates/codebuddy/agents/trellis-research.md +1 -1
- package/dist/templates/codex/agents/trellis-research.toml +3 -2
- package/dist/templates/codex/hooks/session-start.py +126 -26
- package/dist/templates/codex/skills/finish-work/SKILL.md +41 -109
- package/dist/templates/codex/skills/start/SKILL.md +12 -9
- package/dist/templates/common/bundled-skills/trellis-meta/SKILL.md +73 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/add-project-local-conventions.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-agents.md +54 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-context-loading.md +81 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-hooks.md +57 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-skills-or-commands.md +78 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-spec-structure.md +83 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-task-lifecycle.md +90 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/change-workflow.md +64 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/customize-local/overview.md +55 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/context-injection.md +68 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/generated-files.md +80 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/overview.md +51 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/spec-system.md +102 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/task-system.md +101 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workflow.md +75 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/local-architecture/workspace-memory.md +71 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/agents.md +79 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/hooks-and-settings.md +69 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/overview.md +59 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/platform-map.md +74 -0
- package/dist/templates/common/bundled-skills/trellis-meta/references/platform-files/skills-and-commands.md +83 -0
- package/dist/templates/common/commands/continue.md +9 -5
- package/dist/templates/common/commands/finish-work.md +34 -10
- package/dist/templates/common/index.d.ts +22 -2
- package/dist/templates/common/index.d.ts.map +1 -1
- package/dist/templates/common/index.js +53 -4
- package/dist/templates/common/index.js.map +1 -1
- package/dist/templates/common/skills/brainstorm.md +50 -4
- package/dist/templates/copilot/hooks/session-start.py +127 -30
- package/dist/templates/copilot/prompts/finish-work.prompt.md +44 -112
- package/dist/templates/copilot/prompts/start.prompt.md +12 -9
- package/dist/templates/cursor/agents/trellis-check.md +1 -1
- package/dist/templates/cursor/agents/trellis-implement.md +1 -1
- package/dist/templates/cursor/agents/trellis-research.md +2 -2
- package/dist/templates/cursor/hooks.json +7 -1
- package/dist/templates/droid/droids/trellis-research.md +1 -1
- package/dist/templates/extract.d.ts +6 -0
- package/dist/templates/extract.d.ts.map +1 -1
- package/dist/templates/extract.js +14 -0
- package/dist/templates/extract.js.map +1 -1
- package/dist/templates/gemini/agents/trellis-research.md +1 -1
- package/dist/templates/kiro/agents/trellis-research.json +1 -1
- package/dist/templates/markdown/agents.md +19 -12
- package/dist/templates/markdown/gitignore.txt +3 -0
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md.txt +24 -0
- package/dist/templates/opencode/agents/trellis-check.md +1 -1
- package/dist/templates/opencode/agents/trellis-implement.md +7 -4
- package/dist/templates/opencode/agents/trellis-research.md +2 -2
- package/dist/templates/opencode/lib/trellis-context.js +100 -13
- package/dist/templates/opencode/plugins/inject-subagent-context.js +70 -5
- package/dist/templates/opencode/plugins/inject-workflow-state.js +38 -44
- package/dist/templates/opencode/plugins/session-start.js +76 -31
- package/dist/templates/pi/agents/trellis-check.md +28 -0
- package/dist/templates/pi/agents/trellis-implement.md +33 -0
- package/dist/templates/pi/agents/trellis-research.md +25 -0
- package/dist/templates/pi/extensions/trellis/index.ts.txt +997 -0
- package/dist/templates/pi/index.d.ts +5 -0
- package/dist/templates/pi/index.d.ts.map +1 -0
- package/dist/templates/pi/index.js +12 -0
- package/dist/templates/pi/index.js.map +1 -0
- package/dist/templates/pi/settings.json +12 -0
- package/dist/templates/qoder/agents/trellis-research.md +1 -1
- package/dist/templates/shared-hooks/index.d.ts +31 -0
- package/dist/templates/shared-hooks/index.d.ts.map +1 -1
- package/dist/templates/shared-hooks/index.js +59 -0
- package/dist/templates/shared-hooks/index.js.map +1 -1
- package/dist/templates/shared-hooks/inject-shell-session-context.py +180 -0
- package/dist/templates/shared-hooks/inject-subagent-context.py +156 -27
- package/dist/templates/shared-hooks/inject-workflow-state.py +85 -92
- package/dist/templates/shared-hooks/session-start.py +232 -36
- package/dist/templates/trellis/config.yaml +6 -0
- package/dist/templates/trellis/gitignore.txt +3 -0
- package/dist/templates/trellis/index.d.ts +1 -1
- package/dist/templates/trellis/index.d.ts.map +1 -1
- package/dist/templates/trellis/index.js +2 -2
- package/dist/templates/trellis/index.js.map +1 -1
- package/dist/templates/trellis/scripts/common/__init__.py +8 -0
- package/dist/templates/trellis/scripts/common/active_task.py +593 -0
- package/dist/templates/trellis/scripts/common/cli_adapter.py +72 -14
- package/dist/templates/trellis/scripts/common/paths.py +61 -58
- package/dist/templates/trellis/scripts/common/session_context.py +12 -0
- package/dist/templates/trellis/scripts/common/task_context.py +27 -194
- package/dist/templates/trellis/scripts/common/task_store.py +102 -26
- package/dist/templates/trellis/scripts/common/tasks.py +4 -1
- package/dist/templates/trellis/scripts/common/types.py +0 -2
- package/dist/templates/trellis/scripts/common/workflow_phase.py +15 -3
- package/dist/templates/trellis/scripts/task.py +99 -34
- package/dist/templates/trellis/workflow.md +332 -64
- package/dist/types/ai-tools.d.ts +12 -3
- package/dist/types/ai-tools.d.ts.map +1 -1
- package/dist/types/ai-tools.js +29 -0
- package/dist/types/ai-tools.js.map +1 -1
- package/dist/utils/file-writer.d.ts.map +1 -1
- package/dist/utils/file-writer.js +7 -2
- package/dist/utils/file-writer.js.map +1 -1
- package/dist/utils/posix.d.ts +13 -0
- package/dist/utils/posix.d.ts.map +1 -0
- package/dist/utils/posix.js +15 -0
- package/dist/utils/posix.js.map +1 -0
- package/dist/utils/project-detector.d.ts +2 -0
- package/dist/utils/project-detector.d.ts.map +1 -1
- package/dist/utils/project-detector.js +120 -11
- package/dist/utils/project-detector.js.map +1 -1
- package/dist/utils/task-json.d.ts +46 -0
- package/dist/utils/task-json.d.ts.map +1 -0
- package/dist/utils/task-json.js +49 -0
- package/dist/utils/task-json.js.map +1 -0
- package/dist/utils/template-fetcher.d.ts +22 -6
- package/dist/utils/template-fetcher.d.ts.map +1 -1
- package/dist/utils/template-fetcher.js +405 -27
- package/dist/utils/template-fetcher.js.map +1 -1
- package/dist/utils/template-hash.d.ts +22 -3
- package/dist/utils/template-hash.d.ts.map +1 -1
- package/dist/utils/template-hash.js +99 -19
- package/dist/utils/template-hash.js.map +1 -1
- package/package.json +7 -7
- package/dist/templates/markdown/spec/backend/directory-structure.md +0 -292
- package/dist/templates/markdown/spec/backend/index.md +0 -40
- package/dist/templates/markdown/spec/backend/script-conventions.md +0 -742
- package/dist/templates/markdown/spec/guides/code-reuse-thinking-guide.md +0 -118
- package/dist/templates/markdown/spec/guides/cross-platform-thinking-guide.md +0 -394
- package/dist/templates/shared-hooks/statusline.py +0 -218
- package/dist/templates/trellis/scripts/create_bootstrap.py +0 -298
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Skills, Commands, Prompts, And Workflows
|
|
2
|
+
|
|
3
|
+
Skills and commands are textual entry points for user interaction with Trellis. Different platforms use different names, but their core purpose is the same: tell the AI how to enter the Trellis flow when the user expresses a certain intent.
|
|
4
|
+
|
|
5
|
+
## Conceptual Differences
|
|
6
|
+
|
|
7
|
+
| Type | Trigger mode | Best for |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| skill | AI auto-match or explicit user mention | Long-term capabilities, workflow rules, modification guides. |
|
|
10
|
+
| command | Explicit user invocation | Clear operation entry points such as continue and finish-work. |
|
|
11
|
+
| prompt | Explicit user invocation or platform selection | Similar to command, but in a platform prompt format. |
|
|
12
|
+
| workflow | Explicit user selection or platform auto-match | Guides the main session when no sub-agent/hook exists. |
|
|
13
|
+
|
|
14
|
+
Trellis workflow skills usually share one semantic set: brainstorm, before-dev, check, update-spec, break-loop. Multi-file built-in skills such as `trellis-meta` use layered references.
|
|
15
|
+
|
|
16
|
+
## Common Paths
|
|
17
|
+
|
|
18
|
+
| Platform | Common entries |
|
|
19
|
+
| --- | --- |
|
|
20
|
+
| Claude Code | `.claude/skills/`, `.claude/commands/` |
|
|
21
|
+
| Cursor | `.cursor/skills/`, `.cursor/commands/` |
|
|
22
|
+
| OpenCode | `.opencode/skills/`, `.opencode/commands/` |
|
|
23
|
+
| Codex | `.agents/skills/`, `.codex/skills/` |
|
|
24
|
+
| Kilo | `.kilocode/skills/`, `.kilocode/workflows/` |
|
|
25
|
+
| Kiro | `.kiro/skills/` |
|
|
26
|
+
| Gemini CLI | `.gemini/skills/`, `.gemini/commands/` |
|
|
27
|
+
| Antigravity | `.agent/skills/`, `.agent/workflows/` |
|
|
28
|
+
| Windsurf | `.windsurf/skills/`, `.windsurf/workflows/` |
|
|
29
|
+
| Qoder | `.qoder/skills/`, `.qoder/commands/` |
|
|
30
|
+
| CodeBuddy | `.codebuddy/skills/`, `.codebuddy/commands/` |
|
|
31
|
+
| GitHub Copilot | `.github/skills/`, `.github/prompts/` |
|
|
32
|
+
| Factory Droid | `.factory/skills/`, `.factory/commands/` |
|
|
33
|
+
| Pi Agent | `.pi/skills/` |
|
|
34
|
+
|
|
35
|
+
In a user project, use the files actually generated by init as authoritative.
|
|
36
|
+
|
|
37
|
+
## Skill Structure
|
|
38
|
+
|
|
39
|
+
A common skill is a directory:
|
|
40
|
+
|
|
41
|
+
```text
|
|
42
|
+
trellis-meta/
|
|
43
|
+
├── SKILL.md
|
|
44
|
+
└── references/
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`SKILL.md` should tell the AI:
|
|
48
|
+
|
|
49
|
+
- When to use this skill.
|
|
50
|
+
- Which reference to read first for the current task.
|
|
51
|
+
- What not to do.
|
|
52
|
+
|
|
53
|
+
References hold longer explanations so the entry file does not contain everything.
|
|
54
|
+
|
|
55
|
+
## Command/Prompt/Workflow Structure
|
|
56
|
+
|
|
57
|
+
Commands, prompts, and workflows are usually single files. Their content should include:
|
|
58
|
+
|
|
59
|
+
- When to use it.
|
|
60
|
+
- Which `.trellis/` files to read.
|
|
61
|
+
- Which scripts to run.
|
|
62
|
+
- How to report after completion.
|
|
63
|
+
|
|
64
|
+
They should not store task state; task state belongs in `.trellis/tasks/` and `.trellis/.runtime/`.
|
|
65
|
+
|
|
66
|
+
## Local Change Scenarios
|
|
67
|
+
|
|
68
|
+
| User need | Edit location |
|
|
69
|
+
| --- | --- |
|
|
70
|
+
| Change AI auto-trigger rules | The corresponding skill's frontmatter description. |
|
|
71
|
+
| Change user command behavior | The corresponding command/prompt/workflow file. |
|
|
72
|
+
| Add a project-local skill | Platform skill directory, or shared `.agents/skills/`. |
|
|
73
|
+
| Let multiple platforms share one capability | Write equivalent skills in each platform skill directory, or use the `.agents/skills/` shared layer on platforms that support it. |
|
|
74
|
+
| Change finish/continue entry points | Platform commands/prompts/workflows. |
|
|
75
|
+
|
|
76
|
+
## Modification Principles
|
|
77
|
+
|
|
78
|
+
1. **Keep entry files short; references carry long content**. This matters especially for multi-file skills like `trellis-meta`.
|
|
79
|
+
2. **Make trigger descriptions specific**. A description that is too broad can mis-trigger; one that is too narrow may not trigger.
|
|
80
|
+
3. **Keep the same semantics consistent across platforms**. File formats can differ, but behavior descriptions should match.
|
|
81
|
+
4. **Put project-specific capabilities in local skills**. Do not put team-private flows into public `trellis-meta`.
|
|
82
|
+
|
|
83
|
+
If the user only wants local AI to know one more project rule, usually create a project-local skill or update `.trellis/spec/` instead of changing a Trellis built-in workflow skill.
|
|
@@ -22,16 +22,20 @@ Shows the Phase Index (Plan / Execute / Finish) with routing + skill mapping.
|
|
|
22
22
|
|
|
23
23
|
## Step 3: Decide Where You Are
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
`get_context.py` shows the active task's `status` field. Route by `status` + artifact presence:
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
- `prd.md` exists +
|
|
29
|
-
-
|
|
27
|
+
- `status=planning` + no `prd.md` → **1.1** (load `trellis-brainstorm`)
|
|
28
|
+
- `status=planning` + `prd.md` exists + `implement.jsonl` not curated (only the seed `_example` row) → **1.3**
|
|
29
|
+
- `status=planning` + `prd.md` + curated `implement.jsonl` → **1.4** (run `task.py start` to enter Phase 2)
|
|
30
|
+
- `status=in_progress` + implementation not started → **2.1**
|
|
31
|
+
- `status=in_progress` + implementation done, not yet checked → **2.2**
|
|
32
|
+
- `status=in_progress` + check passed → **3.1**
|
|
33
|
+
- `status=completed` (rare; usually archived immediately) → archive flow
|
|
30
34
|
|
|
31
35
|
Phase rules (full detail in `.trellis/workflow.md`):
|
|
32
36
|
|
|
33
37
|
1. Run steps **in order** within a phase — `[required]` steps must not be skipped
|
|
34
|
-
2. `[once]` steps are already done if the output exists (e.g., `prd.md
|
|
38
|
+
2. `[once]` steps are already done if the output exists (e.g., `prd.md` for 1.1; `implement.jsonl` with curated entries for 1.3) — skip them
|
|
35
39
|
3. You may go back to an earlier phase if discoveries require it
|
|
36
40
|
|
|
37
41
|
## Step 4: Load the Specific Step
|
|
@@ -1,28 +1,48 @@
|
|
|
1
1
|
# Finish Work
|
|
2
2
|
|
|
3
|
-
Wrap up the current session.
|
|
3
|
+
Wrap up the current session: archive the active task (and any other completed-but-unarchived tasks the user wants to clean up) and record the session journal. Code commits are NOT done here — those happen in workflow Phase 3.4 before you invoke this command.
|
|
4
4
|
|
|
5
|
-
## Step 1:
|
|
5
|
+
## Step 1: Survey current state
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```bash
|
|
8
|
+
{{PYTHON_CMD}} ./.trellis/scripts/get_context.py --mode record
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This prints:
|
|
12
|
+
|
|
13
|
+
- **My active tasks** — review whether any besides the current one are actually done (code merged, AC met) and should be archived this round.
|
|
14
|
+
- **Git status** — quick visual on what's dirty.
|
|
15
|
+
- **Recent commits** — you'll need their hashes in Step 4 for `--commit`.
|
|
8
16
|
|
|
9
|
-
|
|
17
|
+
If `--mode record` surfaces other completed tasks not tied to the current session, surface them to the user with a one-shot confirmation: "These N tasks look done — archive them too in this round? [y/N]". Default is no; the current active task is always archived in Step 3 regardless.
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
## Step 2: Sanity check — working tree must be clean
|
|
12
20
|
|
|
13
|
-
|
|
21
|
+
Run:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git status --porcelain
|
|
25
|
+
```
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
Filter out paths under `.trellis/workspace/` and `.trellis/tasks/` — those are managed by `add_session.py` and `task.py archive` auto-commits and will appear dirty as part of this skill's own work.
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
If anything else is dirty (any path outside those two prefixes), **stop and bail out** with:
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
> "Working tree has uncommitted code changes. Return to workflow Phase 3.4 to commit them before running `{{CMD_REF:finish-work}}`."
|
|
32
|
+
|
|
33
|
+
Do NOT run `git commit` here. Do NOT prompt the user to commit. The user goes back to Phase 3.4 and the AI drives the batched commit there.
|
|
34
|
+
|
|
35
|
+
## Step 3: Archive task(s)
|
|
20
36
|
|
|
21
37
|
```bash
|
|
22
38
|
{{PYTHON_CMD}} ./.trellis/scripts/task.py archive <task-name>
|
|
23
39
|
```
|
|
24
40
|
|
|
25
|
-
|
|
41
|
+
At minimum: the current active task (if any). Plus any extra tasks the user confirmed in Step 1. Each archive produces a `chore(task): archive ...` commit via the script's auto-commit.
|
|
42
|
+
|
|
43
|
+
If there is no active task and the user did not confirm any cleanup archives, skip this step.
|
|
44
|
+
|
|
45
|
+
## Step 4: Record session journal
|
|
26
46
|
|
|
27
47
|
```bash
|
|
28
48
|
{{PYTHON_CMD}} ./.trellis/scripts/add_session.py \
|
|
@@ -30,3 +50,7 @@ Append a session entry (auto-handles journal rotation, line count, index update)
|
|
|
30
50
|
--commit "hash1,hash2" \
|
|
31
51
|
--summary "Brief summary"
|
|
32
52
|
```
|
|
53
|
+
|
|
54
|
+
Use the work-commit hashes produced in Phase 3.4 (visible in Step 1's `Recent commits` list, or via `git log --oneline`) for `--commit`. Do not include the archive commit hashes from Step 3. This produces a `chore: record journal` commit.
|
|
55
|
+
|
|
56
|
+
Final git log order: `<work commits from 3.4>` → `chore(task): archive ...` (one or more) → `chore: record journal`.
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Directory structure:
|
|
8
8
|
* common/
|
|
9
|
-
* ├── commands/
|
|
10
|
-
*
|
|
9
|
+
* ├── commands/ # Templates that stay as slash commands
|
|
10
|
+
* ├── skills/ # Single-file templates that become auto-triggered skills
|
|
11
|
+
* └── bundled-skills/ # Multi-file built-in skills with references/assets
|
|
11
12
|
*/
|
|
12
13
|
export interface CommonTemplate {
|
|
13
14
|
/** Template name without extension (e.g., "start", "before-dev") */
|
|
@@ -15,6 +16,18 @@ export interface CommonTemplate {
|
|
|
15
16
|
/** Raw content with {{placeholders}} — must be resolved before writing */
|
|
16
17
|
content: string;
|
|
17
18
|
}
|
|
19
|
+
export interface CommonBundledSkillFile {
|
|
20
|
+
/** POSIX path relative to the skill directory, e.g. "references/core.md" */
|
|
21
|
+
relativePath: string;
|
|
22
|
+
/** Raw content with {{placeholders}} — must be resolved before writing */
|
|
23
|
+
content: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CommonBundledSkill {
|
|
26
|
+
/** Skill directory name, e.g. "trellis-meta" */
|
|
27
|
+
name: string;
|
|
28
|
+
/** Files that must be written under the skill directory */
|
|
29
|
+
files: CommonBundledSkillFile[];
|
|
30
|
+
}
|
|
18
31
|
/**
|
|
19
32
|
* Get all command templates (stay as slash commands on all platforms).
|
|
20
33
|
* Results are cached after first call.
|
|
@@ -25,4 +38,11 @@ export declare function getCommandTemplates(): CommonTemplate[];
|
|
|
25
38
|
* Results are cached after first call.
|
|
26
39
|
*/
|
|
27
40
|
export declare function getSkillTemplates(): CommonTemplate[];
|
|
41
|
+
/**
|
|
42
|
+
* Get all multi-file built-in skills.
|
|
43
|
+
*
|
|
44
|
+
* These are copied as complete skill directories so references and assets stay
|
|
45
|
+
* lazy-loadable instead of being flattened into one oversized SKILL.md.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getBundledSkillTemplates(): CommonBundledSkill[];
|
|
28
48
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAuBH,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb,2DAA2D;IAC3D,KAAK,EAAE,sBAAsB,EAAE,CAAC;CACjC;AAOD;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,cAAc,EAAE,CAMtD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,cAAc,EAAE,CAMpD;AAuCD;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,kBAAkB,EAAE,CAM/D"}
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Directory structure:
|
|
8
8
|
* common/
|
|
9
|
-
* ├── commands/
|
|
10
|
-
*
|
|
9
|
+
* ├── commands/ # Templates that stay as slash commands
|
|
10
|
+
* ├── skills/ # Single-file templates that become auto-triggered skills
|
|
11
|
+
* └── bundled-skills/ # Multi-file built-in skills with references/assets
|
|
11
12
|
*/
|
|
12
|
-
import { readdirSync, readFileSync } from "node:fs";
|
|
13
|
-
import { dirname, join } from "node:path";
|
|
13
|
+
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
14
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
14
15
|
import { fileURLToPath } from "node:url";
|
|
15
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
16
17
|
const __dirname = dirname(__filename);
|
|
@@ -30,6 +31,7 @@ function listMarkdownFiles(dir) {
|
|
|
30
31
|
// Cached results — files don't change during a CLI run
|
|
31
32
|
let cachedCommands;
|
|
32
33
|
let cachedSkills;
|
|
34
|
+
let cachedBundledSkills;
|
|
33
35
|
/**
|
|
34
36
|
* Get all command templates (stay as slash commands on all platforms).
|
|
35
37
|
* Results are cached after first call.
|
|
@@ -52,4 +54,51 @@ export function getSkillTemplates() {
|
|
|
52
54
|
}));
|
|
53
55
|
return cachedSkills;
|
|
54
56
|
}
|
|
57
|
+
function listDirectories(dir) {
|
|
58
|
+
try {
|
|
59
|
+
return readdirSync(join(__dirname, dir))
|
|
60
|
+
.filter((entry) => statSync(join(__dirname, dir, entry)).isDirectory())
|
|
61
|
+
.sort();
|
|
62
|
+
}
|
|
63
|
+
catch {
|
|
64
|
+
return [];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
function toPosixRelativePath(root, filePath) {
|
|
68
|
+
return relative(root, filePath).split(sep).join("/");
|
|
69
|
+
}
|
|
70
|
+
function listBundledSkillFiles(skillDir) {
|
|
71
|
+
const root = join(__dirname, "bundled-skills", skillDir);
|
|
72
|
+
const files = [];
|
|
73
|
+
function walk(dir) {
|
|
74
|
+
for (const entry of readdirSync(dir)) {
|
|
75
|
+
const fullPath = join(dir, entry);
|
|
76
|
+
const stat = statSync(fullPath);
|
|
77
|
+
if (stat.isDirectory()) {
|
|
78
|
+
walk(fullPath);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
files.push({
|
|
82
|
+
relativePath: toPosixRelativePath(root, fullPath),
|
|
83
|
+
content: readFileSync(fullPath, "utf-8"),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
walk(root);
|
|
89
|
+
return files.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Get all multi-file built-in skills.
|
|
93
|
+
*
|
|
94
|
+
* These are copied as complete skill directories so references and assets stay
|
|
95
|
+
* lazy-loadable instead of being flattened into one oversized SKILL.md.
|
|
96
|
+
*/
|
|
97
|
+
export function getBundledSkillTemplates() {
|
|
98
|
+
cachedBundledSkills ??= listDirectories("bundled-skills").map((name) => ({
|
|
99
|
+
name,
|
|
100
|
+
files: listBundledSkillFiles(name),
|
|
101
|
+
}));
|
|
102
|
+
return cachedBundledSkills;
|
|
103
|
+
}
|
|
55
104
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/common/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM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AAC;oBACjD,OAAO,EAAE,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC;iBACzC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,CAAC;IACX,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,mBAAmB,KAAK,eAAe,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACvE,IAAI;QACJ,KAAK,EAAE,qBAAqB,CAAC,IAAI,CAAC;KACnC,CAAC,CAAC,CAAC;IACJ,OAAO,mBAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -57,6 +57,9 @@ Before any Q&A, ensure a task exists. If none exists, create one immediately.
|
|
|
57
57
|
TASK_DIR=$(python3 ./.trellis/scripts/task.py create "brainstorm: <short goal>" --slug <auto>)
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
Use a slug without a date prefix. `task.py create` adds the `MM-DD-`
|
|
61
|
+
directory prefix automatically.
|
|
62
|
+
|
|
60
63
|
Create/seed `prd.md` immediately with what you know:
|
|
61
64
|
|
|
62
65
|
```markdown
|
|
@@ -184,18 +187,61 @@ Examples:
|
|
|
184
187
|
* The user asks for "best practice", "how others do it", "recommendation"
|
|
185
188
|
* The user can't reasonably enumerate options
|
|
186
189
|
|
|
187
|
-
###
|
|
190
|
+
### Delegate to `trellis-research` sub-agent (don't research inline)
|
|
191
|
+
|
|
192
|
+
For each research topic, **spawn a `trellis-research` sub-agent via the Task tool** — don't do WebFetch / WebSearch / `gh api` inline in the main conversation.
|
|
193
|
+
|
|
194
|
+
Why:
|
|
195
|
+
- The sub-agent has its own context window → doesn't pollute brainstorm context with raw tool output
|
|
196
|
+
- It persists findings to `{TASK_DIR}/research/<topic>.md` (the contract — see `workflow.md` Phase 1.2)
|
|
197
|
+
- It returns only `{file path, one-line summary}` to the main agent
|
|
198
|
+
- Independent topics can be **parallelized** — spawn multiple sub-agents in one tool call
|
|
199
|
+
|
|
200
|
+
Agent type: `trellis-research`
|
|
201
|
+
Task description template: "Research <specific question>; persist findings to `{TASK_DIR}/research/<topic-slug>.md`."
|
|
202
|
+
|
|
203
|
+
❌ Bad (what you must NOT do):
|
|
204
|
+
```
|
|
205
|
+
Main agent: WebFetch(url-A) → WebFetch(url-B) → Bash(gh api ...)
|
|
206
|
+
→ WebSearch(q1) → WebSearch(q2) → ... (10+ inline calls)
|
|
207
|
+
→ Write(research/topic.md)
|
|
208
|
+
```
|
|
209
|
+
→ Pollutes main context with raw HTML/JSON, burns tokens.
|
|
210
|
+
|
|
211
|
+
✅ Good:
|
|
212
|
+
```
|
|
213
|
+
Main agent: Task(subagent_type="trellis-research",
|
|
214
|
+
prompt="Research topic A; persist to research/topic-a.md")
|
|
215
|
+
+ Task(subagent_type="trellis-research",
|
|
216
|
+
prompt="Research topic B; persist to research/topic-b.md")
|
|
217
|
+
+ Task(subagent_type="trellis-research",
|
|
218
|
+
prompt="Research topic C; persist to research/topic-c.md")
|
|
219
|
+
→ Reads research/topic-{a,b,c}.md after they finish.
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Research steps (to pass into each sub-agent prompt)
|
|
223
|
+
|
|
224
|
+
Each `trellis-research` sub-agent should:
|
|
188
225
|
|
|
189
|
-
1. Identify 2–4 comparable tools/patterns
|
|
226
|
+
1. Identify 2–4 comparable tools/patterns for its topic
|
|
190
227
|
2. Summarize common conventions and why they exist
|
|
191
228
|
3. Map conventions onto our repo constraints
|
|
192
|
-
4.
|
|
229
|
+
4. Write findings to `{TASK_DIR}/research/<topic>.md`
|
|
230
|
+
|
|
231
|
+
Main agent then reads the persisted files and produces **2–3 feasible approaches** in PRD.
|
|
193
232
|
|
|
194
233
|
### Research output format (PRD)
|
|
195
234
|
|
|
196
|
-
|
|
235
|
+
The PRD itself should only reference the persisted research files, not duplicate their content. Add a `## Research References` section pointing at `research/*.md`.
|
|
236
|
+
|
|
237
|
+
Optionally, add a convergence section with feasible approaches derived from the research:
|
|
197
238
|
|
|
198
239
|
```markdown
|
|
240
|
+
## Research References
|
|
241
|
+
|
|
242
|
+
* [`research/<topic-a>.md`](research/<topic-a>.md) — <one-line takeaway>
|
|
243
|
+
* [`research/<topic-b>.md`](research/<topic-b>.md) — <one-line takeaway>
|
|
244
|
+
|
|
199
245
|
## Research Notes
|
|
200
246
|
|
|
201
247
|
### What similar tools do
|