@mindfoldhq/trellis 0.5.15 → 0.5.17

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.
Files changed (24) hide show
  1. package/README.md +2 -2
  2. package/dist/migrations/manifests/0.5.16.json +9 -0
  3. package/dist/migrations/manifests/0.5.17.json +9 -0
  4. package/dist/migrations/manifests/0.6.0-beta.11.json +9 -0
  5. package/dist/migrations/manifests/0.6.0-beta.12.json +9 -0
  6. package/dist/migrations/manifests/0.6.0-beta.13.json +9 -0
  7. package/dist/migrations/manifests/0.6.0-beta.14.json +9 -0
  8. package/dist/migrations/manifests/0.6.0-beta.15.json +9 -0
  9. package/dist/migrations/manifests/0.6.0-beta.16.json +9 -0
  10. package/dist/migrations/manifests/0.6.0-beta.17.json +9 -0
  11. package/dist/migrations/manifests/0.6.0-beta.18.json +16 -0
  12. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/SKILL.md +41 -0
  13. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/mcp-setup.md +90 -0
  14. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/repository-analysis.md +59 -0
  15. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-task-planning.md +61 -0
  16. package/dist/templates/common/bundled-skills/trellis-spec-bootstarp/references/spec-writing.md +70 -0
  17. package/dist/templates/cursor/hooks.json +0 -6
  18. package/dist/templates/shared-hooks/index.d.ts.map +1 -1
  19. package/dist/templates/shared-hooks/index.js +0 -1
  20. package/dist/templates/shared-hooks/index.js.map +1 -1
  21. package/dist/templates/shared-hooks/session-start.py +6 -2
  22. package/dist/templates/trellis/scripts/common/cli_adapter.py +0 -0
  23. package/dist/templates/trellis/scripts/task.py +0 -0
  24. package/package.json +26 -27
package/README.md CHANGED
@@ -7,8 +7,8 @@
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
- <strong>The harness that makes coding agents production-ready</strong><br/>
11
- <sub>Start a feature in Gemini, continue in Claude Code, ship it with Codex or hand it off to a teammate at any step. Context, specs, and standards are shared across every agent and every teammate, so anyone's best spec lifts the whole team.</sub>
10
+ <strong>Make AI coding reliable at team scale.</strong><br/>
11
+ <sub>A team AI coding harness for progressive specs, custom workflows, task context, and memory across Claude Code, Cursor, OpenCode, Codex, Kiro, Kilo, Gemini CLI, Antigravity, Windsurf, Qoder, CodeBuddy, GitHub Copilot, Droid, and Pi Agent.</sub>
12
12
  </p>
13
13
 
14
14
  <p align="center">
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.5.16",
3
+ "description": "Patch: align Cursor sessionStart hook output with Cursor's supported schema and remove the unsupported beforeSubmitPrompt injector.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Bug Fixes:**\n- fix(hooks): Cursor `sessionStart` hooks now emit top-level `additional_context`, matching Cursor's supported hook schema.\n- fix(hooks): Cursor templates no longer install the unsupported `beforeSubmitPrompt` workflow-state injector or `.cursor/hooks/inject-workflow-state.py`.",
7
+ "migrations": [],
8
+ "notes": "Run `trellis update` to refresh Cursor hook templates. No migration required because Trellis removes the unsupported Cursor workflow-state hook from generated templates."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.5.17",
3
+ "description": "Patch: bundle the Trellis spec bootstrap skill and update the marketplace/docs entry for project-specific spec generation.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(skills): `trellis-spec-bootstarp` is now a built-in bundled skill installed by `trellis init` and refreshed by `trellis update` for supported AI platforms.\n- feat(skills): the bundled skill helps AI bootstrap `.trellis/spec/` from the real repository with source-backed references for repository analysis, spec task planning, spec writing, and MCP setup.\n- docs(skills): replace the older marketplace-only `cc-codex-spec-bootstrap` docs entry with the built-in `trellis-spec-bootstarp` flow.",
7
+ "migrations": [],
8
+ "notes": "Run `trellis update` to install or refresh the bundled `trellis-spec-bootstarp` skill. No migration command is required."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.11",
3
+ "description": "Beta patch: fix uninstall manifest ownership, task archive auto-commit staging, Windows hook UTF-8 I/O, and beta-branch manifest continuity.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Bug Fixes:**\n- fix(scripts): `task.py archive` auto-commit now stages only the archived task source path, archive destination path, and child task dirs whose `task.json` was edited during parent cleanup.\n- fix(scripts): `task.py archive` now stages source-side deletes with `git rm -r --cached --ignore-unmatch` after moving a tracked task dir to `.trellis/tasks/archive/<YYYY-MM>/`.\n- fix(uninstall): `trellis init` now tracks platform/root template hashes from files actually written by Trellis instead of walking `.codex/`, `.claude/`, and other platform dirs that can contain user runtime data.\n- fix(uninstall): `trellis update` and `trellis uninstall` prune orphan `.trellis/.template-hashes.json` entries before planning, preserving user-owned files from manifests created by older versions.\n- fix(hooks): Windows hook templates force UTF-8 for stdin, stdout, and stderr so non-ASCII task names and prompt payloads do not fail under cp936/cp1252 code pages.\n\n**Internal:**\n- Restored `0.5.14.json` and added `0.5.15.json` on the beta branch so `check-manifest-continuity` passes against all published stable versions.",
7
+ "migrations": [],
8
+ "notes": "Run `trellis update` to pull in the archive auto-commit fix, manifest ownership self-heal, and updated hook templates. No migration required because file paths did not change."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.12",
3
+ "description": "Beta patch: add thread channels, project/global channel scope, linked context, and shared channel event filtering.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(channel): add `trellis channel create --type thread`, `trellis channel post`, `trellis channel threads`, and `trellis channel thread` for durable thread channels.\n- feat(channel): add `--scope project|global` resolution across channel create, send, wait, spawn, messages, list, kill, rm, and prune.\n- feat(channel): add channel and thread `description` plus `linkedContext` fields via `--linked-context-file` and `--linked-context-raw`.",
7
+ "migrations": [],
8
+ "notes": "Run `trellis update` to pull in thread channel commands and project/global scope support. No migration required because existing channel paths and project files remain valid."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.13",
3
+ "description": "Beta patch: add the trellis-core SDK package, finalize thread channel naming/context commands, and publish core with the CLI.",
4
+ "breaking": true,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(core): add `@mindfoldhq/trellis-core` with public `channel`, `task`, and `testing` exports for Node consumers.\n- feat(channel): use `trellis channel create --type threads` for thread channels and add `trellis channel context`, `trellis channel title`, and `trellis channel thread rename`.\n- feat(channel): add `--context-file` and `--context-raw` as canonical context flags while accepting `--linked-context-*` aliases.\n\n**Internal:**\n- chore(release): publish `@mindfoldhq/trellis-core` before `@mindfoldhq/trellis` with one version, one dist-tag, provenance, and packed CLI dependency checks.",
7
+ "migrations": [],
8
+ "notes": "Beta users should replace `trellis channel create --type thread` with `trellis channel create --type threads`. Run `trellis update` to pull in the core SDK-backed channel commands. No file migration is required."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.14",
3
+ "description": "Beta patch: classify Codex channel streamed deltas and verify published packages on public npm after CI publish.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Bug Fixes:**\n- fix(channel): add `detail.kind`, `detail.stream_id`, and `detail.phase` to Codex `item/agentMessage/delta` progress events so consumers can split interleaved output and commentary streams.\n\n**Internal:**\n- chore(release): verify `@mindfoldhq/trellis` and `@mindfoldhq/trellis-core` are visible on the public npm registry after CI publish.",
7
+ "migrations": [],
8
+ "notes": "Run `npm install -g @mindfoldhq/trellis@beta` and `trellis update` to use the Codex channel stream metadata fix. No file migration is required."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.15",
3
+ "description": "Beta patch: add core mem APIs, forum channel APIs, and channel worker lifecycle controls with Codex turn ordering fixes.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(core): add `@mindfoldhq/trellis-core/mem` for reusable `tl mem` session listing, search, context extraction, project aggregation, and provider adapters.\n- feat(channel): add forum channel commands and context entries with `trellis channel create --type forum`, `channel post`, `channel forum`, `channel thread`, and `channel context`.\n- feat(channel): add reusable worker runtime APIs, cursor reads, cross-channel watchers, `--inbox-policy`, and `--delivery-mode` for managed channel workers.\n\n**Bug Fixes:**\n- fix(channel): serialize normal worker turns, record `interrupt_requested` / `interrupted`, and keep workers active after turn-level `done` / `error` events.\n- fix(channel): delay Codex `done` until `final_answer` is recorded and keep `fs.watch` subscriptions alive after watcher errors.",
7
+ "migrations": [],
8
+ "notes": "Run `npm install -g @mindfoldhq/trellis@beta` and `trellis update` to use the core mem, forum channel, and channel worker lifecycle updates. No file migration is required."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.16",
3
+ "description": "Beta patch: align Trellis task artifacts with check agents and document parent/child task trees in workflow guidance.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(workflow): document parent/child task tree planning in `workflow.md`, `trellis-brainstorm`, and `trellis-meta` references. Planning breadcrumbs now remind agents that multi-deliverable work should use independently verifiable child tasks and explicit child artifact dependencies.\n\n**Bug Fixes:**\n- fix(agents): `trellis-check` agents across platforms now read task `prd.md`, `design.md` when present, and `implement.md` when present before checking code against specs. Pi implement/check agents now list the same task artifact order.",
7
+ "migrations": [],
8
+ "notes": "Run `npm install -g @mindfoldhq/trellis@beta` and `trellis update` to refresh workflow and agent templates. No file migration is required."
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": "0.6.0-beta.17",
3
+ "description": "Beta patch: add workflow template switching, worker inbox core APIs, supervisor warning controls, wait kind unions, and Cursor sessionStart schema output.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(workflow): `trellis init --workflow` and `trellis workflow` can select `native`, `tdd`, `channel-driven-subagent-dispatch`, or marketplace workflow templates for `.trellis/workflow.md`.\n- feat(channel): `trellis channel wait --kind` accepts CSV kind unions such as `done,killed`; supervisors emit `supervisor_warning`, and `trellis channel spawn --warn-before` configures or disables the warning lead time.\n- feat(core): `@mindfoldhq/trellis-core/channel` exports `readWorkerInbox()`, `watchWorkerInbox()`, and `WorkerInboxError` for durable worker inbox consumers.\n\n**Bug Fixes:**\n- fix(hooks): Cursor `sessionStart` hooks now emit top-level `additional_context` and no longer install the unsupported `beforeSubmitPrompt` workflow injector.",
7
+ "migrations": [],
8
+ "notes": "Run `npm install -g @mindfoldhq/trellis@beta` and `trellis update` to refresh CLI templates. No file migration is required."
9
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "version": "0.6.0-beta.18",
3
+ "description": "Beta patch: channel worker OOM guard, simplified channel message routing, bundled Trellis spec bootstrap skill docs, and safer task archive auto-commit failures.",
4
+ "breaking": false,
5
+ "recommendMigrate": false,
6
+ "changelog": "**Enhancements:**\n- feat(channel): default OOM guard for `trellis channel spawn`. Workers that stay continuously idle past `channel.worker_guard.idle_timeout` (default `5m`) are self-terminated with `killed{reason:\"idle-timeout\"}`. Mid-turn workers are not killed by idle cleanup.\n- feat(channel): spawn-time live-worker budget per project/scope. Default `channel.worker_guard.max_live_workers: 6`. Expired idle workers are cleaned first; if the budget is still exhausted, `spawn` rejects with live-worker details and kill / override hints.\n- feat(channel): simplified worker message routing by removing message tags from channel send/wait/run internals.\n- feat(config): `.trellis/config.yaml` gains a `channel.worker_guard` section via `trellis update`.\n- feat(skills): Trellis beta bundle includes the built-in `trellis-spec-bootstarp` skill for bootstrapping `.trellis/spec/` from the real codebase.\n**Bug Fixes:**\n- fix(cli): `task.py archive` now fails when its auto-commit fails instead of reporting a successful archive with uncommitted changes.",
7
+ "migrations": [],
8
+ "configSectionsAdded": [
9
+ {
10
+ "file": ".trellis/config.yaml",
11
+ "sentinel": "worker_guard:",
12
+ "sectionHeading": "Channel worker OOM guard"
13
+ }
14
+ ],
15
+ "notes": "Beta patch on top of 0.6.0-beta.17. `trellis update` appends `channel.worker_guard` defaults for existing projects. To opt out, set `channel.worker_guard.idle_timeout: 0` and / or `channel.worker_guard.max_live_workers: 0`, or pass `--idle-timeout 0` / `--max-live-workers 0` per spawn."
16
+ }
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: trellis-spec-bootstarp
3
+ description: "Bootstrap project-specific Trellis coding specs with a platform-neutral single-agent workflow. Use when creating or refreshing .trellis/spec guidelines, analyzing a codebase with GitNexus, ABCoder, or source inspection, decomposing package/layer spec work, and writing real codebase-backed spec docs without placeholder text."
4
+ ---
5
+
6
+ # Trellis Spec Bootstarp
7
+
8
+ Use this skill to create or refresh `.trellis/spec/` guidelines from the real codebase. One capable agent owns the full loop: analyze the repository, choose the spec boundaries, write the docs, and verify the result. The workflow does not depend on a specific host, CLI, or agent brand.
9
+
10
+ ## Workflow
11
+
12
+ 1. Confirm Trellis is initialized and inspect the current `.trellis/spec/` tree.
13
+ 2. Analyze the repository architecture with the best available tools: GitNexus, ABCoder, language tooling, and direct source reads.
14
+ 3. Decompose the spec work by package and layer only when that reflects the actual codebase.
15
+ 4. Fill or reshape the spec files with concrete patterns, file paths, examples, and anti-patterns from the project.
16
+ 5. Verify that the final specs are internally consistent and contain no template placeholders.
17
+
18
+ ## Reference Routing
19
+
20
+ | Need | Read |
21
+ |------|------|
22
+ | Repository architecture analysis | [references/repository-analysis.md](references/repository-analysis.md) |
23
+ | Spec work decomposition and task planning | [references/spec-task-planning.md](references/spec-task-planning.md) |
24
+ | Writing high-signal Trellis spec files | [references/spec-writing.md](references/spec-writing.md) |
25
+ | GitNexus and ABCoder MCP setup | [references/mcp-setup.md](references/mcp-setup.md) |
26
+
27
+ ## Operating Rules
28
+
29
+ - Treat templates as starting points, not contracts. Delete, rename, split, or add spec files when the repository calls for it.
30
+ - Prefer source-backed rules over generic advice. Every important recommendation should point at a real file or repeated local pattern.
31
+ - Keep execution single-owner by default. Optional helper agents are an implementation detail, not a requirement or user-visible dependency.
32
+ - Do not write platform-specific instructions unless the target project already standardizes on that platform.
33
+ - Do not leave placeholder text, empty headings, or copied boilerplate in `.trellis/spec/`.
34
+
35
+ ## Done Criteria
36
+
37
+ - `.trellis/spec/` describes the project as it exists now.
38
+ - Each relevant package or layer has practical coding guidance with real examples.
39
+ - Non-applicable template sections are removed.
40
+ - `index.md` files match the final spec file set.
41
+ - Any required setup or analysis assumptions are documented in the relevant spec or task notes.
@@ -0,0 +1,90 @@
1
+ # MCP Setup
2
+
3
+ GitNexus and ABCoder are recommended when bootstrapping Trellis specs because they expose architecture and AST context to the agent. They are tool choices, not platform requirements. Configure them through whatever MCP mechanism your agent host provides.
4
+
5
+ ## GitNexus
6
+
7
+ GitNexus builds a code knowledge graph from the repository. Use it for module boundaries, execution flows, dependency relationships, blast radius, and graph queries.
8
+
9
+ ### Install and Index
10
+
11
+ ```bash
12
+ # Run from the repository root.
13
+ npx gitnexus analyze
14
+
15
+ # Check index status.
16
+ npx gitnexus status
17
+
18
+ # Re-index after code changes when the analysis is stale.
19
+ npx gitnexus analyze
20
+ ```
21
+
22
+ The index is written to `.gitnexus/`. Keep embeddings only if the project already uses them; otherwise a normal index is enough for spec bootstrapping.
23
+
24
+ ### MCP Server Command
25
+
26
+ Use this server command in the host's MCP configuration:
27
+
28
+ ```bash
29
+ npx -y gitnexus mcp
30
+ ```
31
+
32
+ ### Useful Tools
33
+
34
+ | Tool | Purpose |
35
+ |------|---------|
36
+ | `gitnexus_query` | Find execution flows and functional areas by concept |
37
+ | `gitnexus_context` | Inspect callers, callees, references, and process participation for a symbol |
38
+ | `gitnexus_impact` | Understand blast radius before changing a symbol |
39
+ | `gitnexus_detect_changes` | Check changed symbols and affected flows before finishing |
40
+ | `gitnexus_cypher` | Run direct graph queries |
41
+ | `gitnexus_list_repos` | List indexed repositories |
42
+
43
+ ## ABCoder
44
+
45
+ ABCoder parses code into UniAST and gives precise package, file, and node-level structure. Use it for signatures, type shapes, implementations, dependencies, and reverse references.
46
+
47
+ ### Install
48
+
49
+ ```bash
50
+ go install github.com/cloudwego/abcoder@latest
51
+ abcoder --help
52
+ ```
53
+
54
+ ### Parse Repositories
55
+
56
+ ```bash
57
+ abcoder parse /absolute/path/to/package \
58
+ --lang typescript \
59
+ --name package-name \
60
+ --output ~/abcoder-asts
61
+ ```
62
+
63
+ For monorepos, parse each package with a stable `--name` so task notes can reference the same repository names.
64
+
65
+ ### MCP Server Command
66
+
67
+ Use this server command in the host's MCP configuration:
68
+
69
+ ```bash
70
+ abcoder mcp ~/abcoder-asts
71
+ ```
72
+
73
+ ### Useful Tools
74
+
75
+ | Tool | Layer | Purpose |
76
+ |------|-------|---------|
77
+ | `list_repos` | 1 | List parsed repositories |
78
+ | `get_repo_structure` | 2 | Inspect packages and files |
79
+ | `get_package_structure` | 3 | Inspect nodes within a package |
80
+ | `get_file_structure` | 3 | Inspect functions, classes, types, and signatures in a file |
81
+ | `get_ast_node` | 4 | Retrieve code, dependencies, references, and implementations |
82
+
83
+ ## Verification
84
+
85
+ After configuration, verify from the agent host that both MCP servers are visible. Then run one simple query against each server before starting the spec writing pass.
86
+
87
+ ```bash
88
+ ls .gitnexus/meta.json
89
+ ls ~/abcoder-asts/*.json
90
+ ```
@@ -0,0 +1,59 @@
1
+ # Repository Analysis
2
+
3
+ The goal is to discover the project's real architecture before writing rules. Do not start from generic spec templates and fill blanks. Start from the code, then let the spec structure follow.
4
+
5
+ ## Analysis Order
6
+
7
+ 1. Read the existing `.trellis/spec/` tree and note which files are templates, outdated, or already project-specific.
8
+ 2. Inspect package manifests, build scripts, workspace config, and top-level documentation to identify packages and runtime layers.
9
+ 3. Use GitNexus for execution flows, module clusters, dependency hubs, and impact-sensitive areas.
10
+ 4. Use ABCoder or language-native tooling for exact signatures, types, class boundaries, and implementation examples.
11
+ 5. Read representative source and test files directly before turning any finding into a spec rule.
12
+
13
+ ## What To Capture
14
+
15
+ | Area | Questions |
16
+ |------|-----------|
17
+ | Package boundaries | What does each package own? What imports cross boundaries? |
18
+ | Runtime layers | Which code is CLI, backend, frontend, worker, shared library, test-only, or tooling? |
19
+ | Core abstractions | Which types, services, stores, commands, routes, or adapters define the system shape? |
20
+ | Data flow | Where does user input enter, how is it validated, and where does state persist? |
21
+ | Error handling | How are failures represented, logged, surfaced, and tested? |
22
+ | Configuration | Where do defaults, environment config, generated files, and templates live? |
23
+ | Tests | Which test styles are trusted examples for new work? |
24
+
25
+ ## GitNexus Usage
26
+
27
+ Start broad, then inspect specific symbols:
28
+
29
+ ```text
30
+ gitnexus_query({query: "CLI command execution flow"})
31
+ gitnexus_query({query: "template generation and migration"})
32
+ gitnexus_context({name: "SymbolName"})
33
+ gitnexus_cypher({query: "MATCH (n)-[r]->(m) RETURN n.name, type(r), m.name LIMIT 30"})
34
+ ```
35
+
36
+ Use GitNexus results to find important files and flows. Do not quote graph output as the final authority until you have checked the relevant source files.
37
+
38
+ ## ABCoder Usage
39
+
40
+ Use ABCoder when the spec needs exact code shapes:
41
+
42
+ ```text
43
+ list_repos()
44
+ get_repo_structure({repo_name: "package-name"})
45
+ get_file_structure({repo_name: "package-name", file_path: "src/example.ts"})
46
+ get_ast_node({repo_name: "package-name", node_ids: [{mod_path: "...", pkg_path: "...", name: "SymbolName"}]})
47
+ ```
48
+
49
+ ABCoder is most valuable for documenting constructor patterns, function signatures, type contracts, and reference chains.
50
+
51
+ ## Analysis Notes
52
+
53
+ Keep short notes while analyzing. The notes should include:
54
+
55
+ - Package or layer name.
56
+ - Files that define the local pattern.
57
+ - Rules the spec should teach.
58
+ - Anti-patterns found in old code, comments, tests, or migration paths.
59
+ - Spec files that should be created, deleted, renamed, or merged.
@@ -0,0 +1,61 @@
1
+ # Spec Task Planning
2
+
3
+ Use a single agent as the default execution model. The agent may create Trellis tasks for traceability, but the skill should not require a specific platform, CLI, or parallel worker model.
4
+
5
+ ## Decomposition
6
+
7
+ Create spec work units around real ownership boundaries:
8
+
9
+ - One package when a package has its own conventions.
10
+ - One layer when the same package has distinct frontend, backend, CLI, worker, or shared-library rules.
11
+ - One cross-cutting guide when a pattern spans packages and is not owned by one layer.
12
+
13
+ Avoid artificial decomposition. A small library usually needs one focused spec pass, not several tasks.
14
+
15
+ ## Task Shape
16
+
17
+ When a Trellis task is useful, write a concise PRD with these sections:
18
+
19
+ ```markdown
20
+ # Fill <package-or-layer> Trellis Specs
21
+
22
+ ## Goal
23
+ Write project-specific `.trellis/spec/` guidance for <scope>.
24
+
25
+ ## Scope
26
+ - Spec directory:
27
+ - Source directories to inspect:
28
+ - Tests to inspect:
29
+ - Out of scope:
30
+
31
+ ## Architecture Context
32
+ Summarize the concrete findings from repository analysis.
33
+
34
+ ## Files To Create Or Update
35
+ - `.trellis/spec/.../index.md`
36
+ - `.trellis/spec/.../<topic>.md`
37
+
38
+ ## Rules
39
+ - Adapt the spec file set to the real codebase.
40
+ - Use real source examples with file paths.
41
+ - Remove template-only sections that do not apply.
42
+ - Do not modify product source code unless the task explicitly asks for it.
43
+
44
+ ## Acceptance Criteria
45
+ - [ ] Specs contain concrete examples and anti-patterns from the repository.
46
+ - [ ] No placeholder text remains.
47
+ - [ ] Index files match the final spec files.
48
+ - [ ] Claims are backed by source files, tests, or project docs.
49
+ ```
50
+
51
+ ## Optional Helper Agents
52
+
53
+ If the host supports subagents, helpers can inspect independent packages or run verification. They are optional. The main agent still owns integration and final quality.
54
+
55
+ Helper tasks must have clear ownership:
56
+
57
+ - Read-only research tasks may inspect any source needed for the assigned scope.
58
+ - Write tasks should own disjoint spec directories.
59
+ - Verification tasks should check placeholder removal, broken links, and consistency.
60
+
61
+ Do not encode helper-agent names, vendor-specific commands, or platform-specific routing in the skill. Put only the required work and acceptance criteria in the task.
@@ -0,0 +1,70 @@
1
+ # Spec Writing
2
+
3
+ Trellis specs are coding guidance for future agents. They should explain how to work in this repository, not how a generic project might be organized.
4
+
5
+ ## Write From Evidence
6
+
7
+ Each important rule should be backed by one of these:
8
+
9
+ - A source file that demonstrates the preferred pattern.
10
+ - A test file that shows expected behavior.
11
+ - A project document that defines the convention.
12
+ - A repeated pattern across multiple files.
13
+
14
+ Use short snippets only when they make the rule clearer. Prefer linking to the file path and naming the symbol or behavior.
15
+
16
+ ## File Structure
17
+
18
+ Keep the spec tree aligned with the project:
19
+
20
+ - Keep `index.md` as the navigation file for the spec directory.
21
+ - Split topics when developers would look for them independently.
22
+ - Merge topics when separate files would repeat the same rule.
23
+ - Delete template files that do not apply.
24
+ - Add new files for important local patterns the template missed.
25
+
26
+ ## Content Standards
27
+
28
+ Good spec sections include:
29
+
30
+ - When the rule applies.
31
+ - The local pattern to follow.
32
+ - The source or test files that prove the pattern.
33
+ - Common mistakes or anti-patterns.
34
+ - Verification commands or checks when they are specific and reliable.
35
+
36
+ Avoid:
37
+
38
+ - Placeholder prose.
39
+ - Generic framework advice.
40
+ - Tool instructions that only work in one agent host.
41
+ - Long copied code blocks.
42
+ - Rules based on a single accidental implementation detail.
43
+
44
+ ## Example Shape
45
+
46
+ ```markdown
47
+ ## Command Handlers
48
+
49
+ Command handlers should keep argument parsing, validation, and side effects separate. The local pattern is:
50
+
51
+ - Parse CLI flags at the command boundary.
52
+ - Convert raw inputs into typed task options before invoking core logic.
53
+ - Keep filesystem writes in the command or service layer, not in template helpers.
54
+
55
+ Reference files:
56
+ - `packages/cli/src/commands/example.ts`
57
+ - `packages/cli/test/commands/example.test.ts`
58
+
59
+ Avoid passing raw `process.argv` or unvalidated config objects into shared helpers.
60
+ ```
61
+
62
+ ## Final Pass
63
+
64
+ Before finishing:
65
+
66
+ ```bash
67
+ grep -R "To be filled\\|TODO: fill\\|placeholder" .trellis/spec
68
+ ```
69
+
70
+ Also check links, index files, and whether any spec still describes a template rather than this repository.
@@ -14,12 +14,6 @@
14
14
  "timeout": 30
15
15
  }
16
16
  ],
17
- "beforeSubmitPrompt": [
18
- {
19
- "command": "{{PYTHON_CMD}} .cursor/hooks/inject-workflow-state.py",
20
- "timeout": 15
21
- }
22
- ],
23
17
  "beforeShellExecution": [
24
18
  {
25
19
  "command": "{{PYTHON_CMD}} .cursor/hooks/inject-shell-session-context.py",
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/shared-hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,0BAA0B,GAC1B,4BAA4B,CAAC;AAEjC,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,kBAAkB,EAClB,SAAS,cAAc,EAAE,CA4B1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,EAAE,CAWnD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,kBAAkB,GAC3B,UAAU,EAAE,CAGd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/shared-hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,MAAM,WAAW,UAAU;IACzB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,cAAc,GACtB,kBAAkB,GAClB,iCAAiC,GACjC,0BAA0B,GAC1B,4BAA4B,CAAC;AAEjC,MAAM,MAAM,kBAAkB,GAC1B,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GACT,WAAW,GACX,OAAO,GACP,MAAM,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAC3C,kBAAkB,EAClB,SAAS,cAAc,EAAE,CA2B1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,UAAU,EAAE,CAWnD;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,kBAAkB,GAC3B,UAAU,EAAE,CAGd"}
@@ -44,7 +44,6 @@ export const SHARED_HOOKS_BY_PLATFORM = {
44
44
  cursor: [
45
45
  "session-start.py",
46
46
  "inject-shell-session-context.py",
47
- "inject-workflow-state.py",
48
47
  "inject-subagent-context.py",
49
48
  ],
50
49
  codex: ["inject-workflow-state.py"],
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/shared-hooks/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,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,SAAS,EAAE,YAAY,CAAC,EAAE,OAAO,CAAC,CAAC;AAC9D,CAAC;AA0BD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAGjC;IACF,MAAM,EAAE;QACN,kBAAkB;QAClB,0BAA0B;QAC1B,4BAA4B;KAC7B;IACD,MAAM,EAAE;QACN,kBAAkB;QAClB,iCAAiC;QACjC,0BAA0B;QAC1B,4BAA4B;KAC7B;IACD,KAAK,EAAE,CAAC,0BAA0B,CAAC;IACnC,MAAM,EAAE,CAAC,kBAAkB,EAAE,0BAA0B,CAAC;IAC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,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,+BAA+B,CAC7C,QAA4B;IAE5B,MAAM,OAAO,GAAG,IAAI,GAAG,CAAS,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpE,OAAO,oBAAoB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AACnE,CAAC"}
@@ -778,11 +778,15 @@ When the user sends the first message, follow <task-status> and the workflow gui
778
778
  If a task is READY, execute its Next required action without asking whether to continue.
779
779
  </ready>""")
780
780
 
781
+ context_text = output.getvalue()
781
782
  result = {
783
+ # Claude Code / Qoder / CodeBuddy / Droid / Gemini / Copilot format
782
784
  "hookSpecificOutput": {
783
785
  "hookEventName": "SessionStart",
784
- "additionalContext": output.getvalue(),
785
- }
786
+ "additionalContext": context_text,
787
+ },
788
+ # Cursor sessionStart format (top-level snake_case per Cursor docs)
789
+ "additional_context": context_text,
786
790
  }
787
791
 
788
792
  # Output JSON - stdout is already configured for UTF-8
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindfoldhq/trellis",
3
- "version": "0.5.15",
3
+ "version": "0.5.17",
4
4
  "description": "AI capabilities grow like ivy — Trellis provides the structure to guide them along a disciplined path",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -12,31 +12,6 @@
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
15
- "scripts": {
16
- "build": "pnpm run clean && tsc && pnpm run copy-templates",
17
- "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
18
- "copy-templates": "node scripts/copy-templates.js",
19
- "dev": "tsc --watch",
20
- "start": "node ./dist/cli/index.js",
21
- "test": "vitest run",
22
- "test:watch": "vitest",
23
- "test:coverage": "vitest run --coverage",
24
- "lint": "eslint src/ test/",
25
- "lint:fix": "eslint src/ test/ --fix",
26
- "format": "prettier --write src/",
27
- "format:check": "prettier --check src/",
28
- "typecheck": "tsc --noEmit",
29
- "lint:py": "basedpyright",
30
- "lint:all": "pnpm lint && pnpm lint:py",
31
- "prepublishOnly": "pnpm test && pnpm run build && cp ../../README.md ../../LICENSE .",
32
- "release": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version patch && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
33
- "release:minor": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version minor && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
34
- "release:major": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version major && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
35
- "release:beta": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type beta && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version prerelease --preid beta && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin HEAD --tags",
36
- "release:rc": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type rc && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version prerelease --preid rc && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin HEAD --tags",
37
- "release:promote": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type promote && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version \"$(node -p \"require('./package.json').version.replace(/-.*/, '')\")\" && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
38
- "manifest": "node scripts/create-manifest.js"
39
- },
40
15
  "keywords": [
41
16
  "ai",
42
17
  "workflow",
@@ -84,5 +59,29 @@
84
59
  "repository": {
85
60
  "type": "git",
86
61
  "url": "https://github.com/mindfold-ai/trellis.git"
62
+ },
63
+ "scripts": {
64
+ "build": "pnpm run clean && tsc && pnpm run copy-templates",
65
+ "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
66
+ "copy-templates": "node scripts/copy-templates.js",
67
+ "dev": "tsc --watch",
68
+ "start": "node ./dist/cli/index.js",
69
+ "test": "vitest run",
70
+ "test:watch": "vitest",
71
+ "test:coverage": "vitest run --coverage",
72
+ "lint": "eslint src/ test/",
73
+ "lint:fix": "eslint src/ test/ --fix",
74
+ "format": "prettier --write src/",
75
+ "format:check": "prettier --check src/",
76
+ "typecheck": "tsc --noEmit",
77
+ "lint:py": "basedpyright",
78
+ "lint:all": "pnpm lint && pnpm lint:py",
79
+ "release": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version patch && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
80
+ "release:minor": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version minor && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
81
+ "release:major": "node scripts/check-manifest-continuity.js && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version major && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
82
+ "release:beta": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type beta && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version prerelease --preid beta && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin HEAD --tags",
83
+ "release:rc": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type rc && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version prerelease --preid rc && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin HEAD --tags",
84
+ "release:promote": "node scripts/check-manifest-continuity.js && node scripts/check-docs-changelog.js --type promote && pnpm test && git add -A -- ':!docs-site' && (git diff-index --quiet HEAD || git commit -m 'chore: pre-release updates') && pnpm version --no-git-tag-version \"$(node -p \"require('./package.json').version.replace(/-.*/, '')\")\" && V=$(node -p \"require('./package.json').version\") && git add package.json && git commit -m \"$V\" && git tag \"v$V\" && git push origin main --tags",
85
+ "manifest": "node scripts/create-manifest.js"
87
86
  }
88
- }
87
+ }