@pennixrv/trellis 0.7.2-beta.10 → 0.7.2-beta.11

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 (62) hide show
  1. package/README.md +14 -0
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +94 -96
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/commands/update.d.ts.map +1 -1
  6. package/dist/commands/update.js +34 -44
  7. package/dist/commands/update.js.map +1 -1
  8. package/dist/configurators/workflow.d.ts.map +1 -1
  9. package/dist/configurators/workflow.js +15 -52
  10. package/dist/configurators/workflow.js.map +1 -1
  11. package/dist/templates/claude/agents/trellis-implement.md +1 -1
  12. package/dist/templates/codebuddy/agents/trellis-implement.md +1 -1
  13. package/dist/templates/codex/hooks/session-start.py +10 -29
  14. package/dist/templates/common/bundled-skills/trellis-spec-bootstrap/references/spec-writing.md +6 -0
  15. package/dist/templates/common/bundled-skills/trellis-teamwork/references/teamwork-plan-construction.md +6 -2
  16. package/dist/templates/common/commands/continue.md +6 -0
  17. package/dist/templates/common/skills/before-dev.md +3 -1
  18. package/dist/templates/common/skills/check.md +3 -1
  19. package/dist/templates/copilot/hooks/session-start.py +10 -29
  20. package/dist/templates/cursor/agents/trellis-implement.md +1 -1
  21. package/dist/templates/droid/droids/trellis-implement.md +1 -1
  22. package/dist/templates/dsh/agents/trellis-implement.md +1 -1
  23. package/dist/templates/gemini/agents/trellis-implement.md +1 -1
  24. package/dist/templates/grok/agents/trellis-implement.md +1 -1
  25. package/dist/templates/kimi/agents/trellis-implement.md +1 -1
  26. package/dist/templates/kiro/agents/trellis-implement.json +1 -1
  27. package/dist/templates/markdown/agents.md +9 -0
  28. package/dist/templates/markdown/index.d.ts +1 -0
  29. package/dist/templates/markdown/index.d.ts.map +1 -1
  30. package/dist/templates/markdown/index.js +1 -0
  31. package/dist/templates/markdown/index.js.map +1 -1
  32. package/dist/templates/markdown/spec/index.md.txt +19 -0
  33. package/dist/templates/opencode/agents/trellis-implement.md +1 -1
  34. package/dist/templates/opencode/lib/session-utils.js +17 -5
  35. package/dist/templates/qoder/agents/trellis-implement.md +1 -1
  36. package/dist/templates/shared-hooks/session-start.py +7 -5
  37. package/dist/templates/snow/agents/trellis-implement.md +1 -1
  38. package/dist/templates/trae/agents/trellis-implement.md +1 -1
  39. package/dist/templates/trellis/scripts/common/packages_context.py +29 -1
  40. package/dist/templates/zcode/agents/trellis-implement.md +1 -1
  41. package/dist/utils/asset-backup.d.ts.map +1 -1
  42. package/dist/utils/asset-backup.js +22 -20
  43. package/dist/utils/asset-backup.js.map +1 -1
  44. package/dist/utils/file-writer.d.ts +2 -0
  45. package/dist/utils/file-writer.d.ts.map +1 -1
  46. package/dist/utils/file-writer.js +1 -1
  47. package/dist/utils/file-writer.js.map +1 -1
  48. package/dist/utils/managed-markdown.d.ts +5 -0
  49. package/dist/utils/managed-markdown.d.ts.map +1 -0
  50. package/dist/utils/managed-markdown.js +64 -0
  51. package/dist/utils/managed-markdown.js.map +1 -0
  52. package/dist/utils/managed-removal.d.ts +2 -0
  53. package/dist/utils/managed-removal.d.ts.map +1 -1
  54. package/dist/utils/managed-removal.js +26 -2
  55. package/dist/utils/managed-removal.js.map +1 -1
  56. package/dist/utils/manifest-prune.d.ts.map +1 -1
  57. package/dist/utils/manifest-prune.js +5 -12
  58. package/dist/utils/manifest-prune.js.map +1 -1
  59. package/dist/utils/uninstall-scrubbers.d.ts.map +1 -1
  60. package/dist/utils/uninstall-scrubbers.js +5 -11
  61. package/dist/utils/uninstall-scrubbers.js.map +1 -1
  62. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"workflow.js","sourceRoot":"","sources":["../../src/configurators/workflow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACzD,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IAAI,kBAAkB,EAAE,GAAG,CAAC,OAAO,CAAC;gBAAE,SAAS;YAC/C,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,CAAC;YAC/D,SAAS,CAAC,WAAW,CAAC,CAAC;YACvB,MAAM,cAAc,CAAC,WAAW,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;SAAM,CAAC;QACN,mBAAmB;QACnB,MAAM,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
@@ -56,7 +56,7 @@ Before implementing, read:
56
56
 
57
57
  Read relevant specs based on task type:
58
58
 
59
- - Spec layers: `.trellis/spec/<package>/<layer>/`
59
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
60
60
  - Shared guides: `.trellis/spec/guides/`
61
61
 
62
62
  ### 2. Understand Requirements
@@ -56,7 +56,7 @@ Before implementing, read:
56
56
 
57
57
  Read relevant specs based on task type:
58
58
 
59
- - Spec layers: `.trellis/spec/<package>/<layer>/`
59
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
60
60
  - Shared guides: `.trellis/spec/guides/`
61
61
 
62
62
  ### 2. Understand Requirements
@@ -268,9 +268,9 @@ def _get_task_status(trellis_dir: Path, hook_input: dict) -> str:
268
268
  if task_status == "planning":
269
269
  next_action = (
270
270
  "Follow the current per-turn workflow-state. Task lifecycle status and artifact presence "
271
- "do not identify the business phase. If no phase route is initialized, load "
272
- "`trellis-goal-exploration-and-requirements` and confirm the requirements baseline "
273
- "before initializing the route."
271
+ "do not identify the business phase. If no phase route is initialized, inspect recorded "
272
+ "requirements and authorization, choose applicable ordered phases with evidence for omissions, "
273
+ "then initialize through Trellis CLI and load the current phase Skill. Reuse valid confirmations."
274
274
  )
275
275
  if any(
276
276
  path.is_file() and not _has_curated_jsonl_entry(path)
@@ -325,31 +325,12 @@ def _repo_relative(repo_root: Path, path: Path) -> str:
325
325
  return str(path)
326
326
 
327
327
 
328
- def _collect_spec_index_paths(trellis_dir: Path) -> list[str]:
329
- paths: list[str] = []
330
- guides_index = trellis_dir / "spec" / "guides" / "index.md"
331
- if guides_index.is_file():
332
- paths.append(".trellis/spec/guides/index.md")
333
-
334
- spec_dir = trellis_dir / "spec"
335
- if not spec_dir.is_dir():
336
- return paths
337
-
338
- for sub in sorted(spec_dir.iterdir()):
339
- if not sub.is_dir() or sub.name.startswith(".") or sub.name == "guides":
340
- continue
341
- index_file = sub / "index.md"
342
- if index_file.is_file():
343
- paths.append(f".trellis/spec/{sub.name}/index.md")
344
- continue
345
- for nested in sorted(sub.iterdir()):
346
- if not nested.is_dir():
347
- continue
348
- nested_index = nested / "index.md"
349
- if nested_index.is_file():
350
- paths.append(f".trellis/spec/{sub.name}/{nested.name}/index.md")
351
-
352
- return paths
328
+ def _collect_spec_index_paths(trellis_dir: Path, input_data: dict | None = None) -> list[str]:
329
+ scripts = str(trellis_dir / "scripts")
330
+ if scripts not in sys.path:
331
+ sys.path.insert(0, scripts)
332
+ from common.packages_context import collect_spec_index_paths # type: ignore[import-not-found]
333
+ return collect_spec_index_paths(trellis_dir.parent, input_data, platform="codex")
353
334
 
354
335
 
355
336
  def _build_compact_current_state(
@@ -529,7 +510,7 @@ def main() -> None:
529
510
  configure_project_encoding(project_dir)
530
511
 
531
512
  trellis_dir = project_dir / ".trellis"
532
- spec_index_paths = _collect_spec_index_paths(trellis_dir)
513
+ spec_index_paths = _collect_spec_index_paths(trellis_dir, hook_input)
533
514
 
534
515
  output = StringIO()
535
516
 
@@ -18,6 +18,8 @@ Use short snippets only when they make the rule clearer. Prefer linking to the f
18
18
  Keep the spec tree aligned with the project:
19
19
 
20
20
  - Keep `index.md` as the navigation file for the spec directory.
21
+ - Keep the root index and configured package indexes connected to the real
22
+ topic files. Do not assume frontend/backend layers or recreate deleted layers.
21
23
  - Split topics when developers would look for them independently.
22
24
  - Merge topics when separate files would repeat the same rule.
23
25
  - Delete template files that do not apply.
@@ -25,6 +27,10 @@ Keep the spec tree aligned with the project:
25
27
 
26
28
  ## Content Standards
27
29
 
30
+ Use a minimal topic structure: scope, project conventions with source evidence,
31
+ and verification. For an empty project, record confirmed boundaries and pending
32
+ evidence; do not invent conventions or generate empty domain documents.
33
+
28
34
  Good spec sections include:
29
35
 
30
36
  - When the rule applies.
@@ -197,8 +197,12 @@ answer. Retention may remove failed-attempt artifacts. Main-agent semantic
197
197
  review checks the answer and evidence against the acceptance criteria; shape
198
198
  validation does not perform that review or change native task acceptance.
199
199
 
200
- The coordinator returns `ALL_ACCEPTED`, `SETTLED_WITH_FAILURE`, or
201
- `RECONCILIATION_REQUIRED`. For `ALL_ACCEPTED`, review every accepted report
200
+ The coordinator returns `AWAITING_REVIEW`, `ALL_ACCEPTED`, `SETTLED_WITH_FAILURE`, or
201
+ `RECONCILIATION_REQUIRED`. For `AWAITING_REVIEW`, read every report and its
202
+ evidence, limitations and unresolved items, then use `trellis teamwork review`
203
+ with the exact task, batch and assignment identity (see `review --help`).
204
+ Accept or request rework through that native interface; do not edit receipts.
205
+ For `ALL_ACCEPTED`, review every accepted report
202
206
  against the phase contract, record the evidence in the task-owned artifact, and
203
207
  use the native task acceptance gate before advancing. For
204
208
  `SETTLED_WITH_FAILURE`, review the failure reports and blockers, do not accept
@@ -12,6 +12,12 @@ Resume from the active Trellis task and its current phase. The task record and p
12
12
 
13
13
  Follow the active phase breadcrumb to the matching bundled phase Skill and its workflow.md. Use the task CLI to inspect or change phase state. A resume does not itself accept an artifact, grant authorization, or move the task.
14
14
 
15
+ Without hook context, use `{{PYTHON_CMD}} ./.trellis/scripts/task.py phase show <task>`
16
+ and explicitly read the applicable spec indexes and guidelines. If the route is
17
+ missing, inspect recorded requirements and authorization, choose the ordered
18
+ phases with evidence for omissions, then initialize through the native CLI.
19
+ Reuse existing confirmations; resume only the known unfinished action.
20
+
15
21
  Task lifecycle status and business phase are separate. A planning task may remain in Goal Exploration and Requirements Confirmation Phase, Decision Space Construction and Consolidation Phase, or Solution Design and Convergence Phase. `in_progress` marks authorized Task Implementation and Test Verification Phase; `completed` and `cancelled` are terminal lifecycle states. Delivery Review and On-Site Closeout Phase remains explicit.
16
22
 
17
23
  ## Phase operations
@@ -14,7 +14,9 @@ Execute these steps:
14
14
  - What type of work (backend, frontend, unit-test, docs, etc.)
15
15
  - Any spec/research paths referenced by the task artifacts
16
16
 
17
- 4. **Read the spec index** for each relevant module:
17
+ 4. **Read the available spec indexes**: `.trellis/spec/index.md`, then
18
+ `.trellis/spec/<package>/index.md` for the affected configured packages,
19
+ and existing layer indexes where applicable. Older projects need no migration:
18
20
  ```bash
19
21
  cat .trellis/spec/<package>/<layer>/index.md
20
22
  ```
@@ -19,7 +19,9 @@ Read the current native phase, accepted contract and its actual artifact referen
19
19
  python3 ./.trellis/scripts/get_context.py --mode packages
20
20
  ```
21
21
 
22
- For each changed package/layer, read the spec index and follow its **Quality Check** section:
22
+ Read the available `.trellis/spec/index.md`, affected configured package
23
+ indexes (`.trellis/spec/<package>/index.md`), and existing layer indexes.
24
+ Follow their **Quality Check** sections; older projects need no migration:
23
25
 
24
26
  ```bash
25
27
  cat .trellis/spec/<package>/<layer>/index.md
@@ -267,9 +267,9 @@ def _get_task_status(trellis_dir: Path, hook_input: dict) -> str:
267
267
  if task_status == "planning":
268
268
  next_action = (
269
269
  "Follow the current per-turn workflow-state. Task lifecycle status and artifact presence "
270
- "do not identify the business phase. If no phase route is initialized, load "
271
- "`trellis-goal-exploration-and-requirements` and confirm the requirements baseline "
272
- "before initializing the route."
270
+ "do not identify the business phase. If no phase route is initialized, inspect recorded "
271
+ "requirements and authorization, choose applicable ordered phases with evidence for omissions, "
272
+ "then initialize through Trellis CLI and load the current phase Skill. Reuse valid confirmations."
273
273
  )
274
274
  if any(
275
275
  path.is_file() and not _has_curated_jsonl_entry(path)
@@ -324,31 +324,12 @@ def _repo_relative(repo_root: Path, path: Path) -> str:
324
324
  return str(path)
325
325
 
326
326
 
327
- def _collect_spec_index_paths(trellis_dir: Path) -> list[str]:
328
- paths: list[str] = []
329
- guides_index = trellis_dir / "spec" / "guides" / "index.md"
330
- if guides_index.is_file():
331
- paths.append(".trellis/spec/guides/index.md")
332
-
333
- spec_dir = trellis_dir / "spec"
334
- if not spec_dir.is_dir():
335
- return paths
336
-
337
- for sub in sorted(spec_dir.iterdir()):
338
- if not sub.is_dir() or sub.name.startswith(".") or sub.name == "guides":
339
- continue
340
- index_file = sub / "index.md"
341
- if index_file.is_file():
342
- paths.append(f".trellis/spec/{sub.name}/index.md")
343
- continue
344
- for nested in sorted(sub.iterdir()):
345
- if not nested.is_dir():
346
- continue
347
- nested_index = nested / "index.md"
348
- if nested_index.is_file():
349
- paths.append(f".trellis/spec/{sub.name}/{nested.name}/index.md")
350
-
351
- return paths
327
+ def _collect_spec_index_paths(trellis_dir: Path, input_data: dict | None = None) -> list[str]:
328
+ scripts = str(trellis_dir / "scripts")
329
+ if scripts not in sys.path:
330
+ sys.path.insert(0, scripts)
331
+ from common.packages_context import collect_spec_index_paths # type: ignore[import-not-found]
332
+ return collect_spec_index_paths(trellis_dir.parent, input_data, platform="copilot")
352
333
 
353
334
 
354
335
  def _build_compact_current_state(
@@ -514,7 +495,7 @@ def main() -> None:
514
495
  configure_project_encoding(project_dir)
515
496
 
516
497
  trellis_dir = project_dir / ".trellis"
517
- spec_index_paths = _collect_spec_index_paths(trellis_dir)
498
+ spec_index_paths = _collect_spec_index_paths(trellis_dir, hook_input)
518
499
 
519
500
  output = StringIO()
520
501
 
@@ -55,7 +55,7 @@ Before implementing, read:
55
55
 
56
56
  Read relevant specs based on task type:
57
57
 
58
- - Spec layers: `.trellis/spec/<package>/<layer>/`
58
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
59
59
  - Shared guides: `.trellis/spec/guides/`
60
60
 
61
61
  ### 2. Understand Requirements
@@ -48,7 +48,7 @@ Before implementing, read:
48
48
 
49
49
  Read relevant specs based on task type:
50
50
 
51
- - Spec layers: `.trellis/spec/<package>/<layer>/`
51
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
52
52
  - Shared guides: `.trellis/spec/guides/`
53
53
 
54
54
  ### 2. Understand Requirements
@@ -52,7 +52,7 @@ Before implementing, read:
52
52
 
53
53
  Read relevant specs based on task type:
54
54
 
55
- - Spec layers: `.trellis/spec/<package>/<layer>/`
55
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
56
56
  - Shared guides: `.trellis/spec/guides/`
57
57
 
58
58
  ### 2. Understand Requirements
@@ -48,7 +48,7 @@ Before implementing, read:
48
48
 
49
49
  Read relevant specs based on task type:
50
50
 
51
- - Spec layers: `.trellis/spec/<package>/<layer>/`
51
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
52
52
  - Shared guides: `.trellis/spec/guides/`
53
53
 
54
54
  ### 2. Understand Requirements
@@ -62,7 +62,7 @@ Before implementing, read:
62
62
 
63
63
  Read relevant specs based on task type:
64
64
 
65
- - Spec layers: `.trellis/spec/<package>/<layer>/`
65
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
66
66
  - Shared guides: `.trellis/spec/guides/`
67
67
 
68
68
  ### 2. Understand Requirements
@@ -61,7 +61,7 @@ Before implementing, read:
61
61
 
62
62
  Read relevant specs based on task type:
63
63
 
64
- - Spec layers: `.trellis/spec/<package>/<layer>/`
64
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
65
65
  - Shared guides: `.trellis/spec/guides/`
66
66
 
67
67
  ### 2. Understand Requirements
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "trellis-implement",
3
3
  "description": "Code implementation expert. Understands specs and requirements, then implements features. No git commit allowed.",
4
- "prompt": "# Implement Agent\n\nYou are the Implement Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.\n\n- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore implementing, read:\n- `.trellis/workflow.md` - Project workflow\n- `.trellis/spec/` - Development guidelines\n- Task `prd.md` - Requirements document\n- Task `design.md` - Technical design (if exists)\n- Task `implement.md` - Execution plan (if exists)\n\n## Core Responsibilities\n\n1. **Understand specs** - Read relevant spec files in `.trellis/spec/`\n2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present\n3. **Implement features** - Write code following specs and task artifacts\n4. **Self-check** - Ensure code quality\n5. **Report results** - Report completion status\n\n## Forbidden Operations\n\n**Do NOT execute these git commands:**\n\n- `git commit`\n- `git push`\n- `git merge`\n\n---\n\n## Workflow\n\n### 1. Understand Specs\n\nRead relevant specs based on task type:\n\n- Spec layers: `.trellis/spec/<package>/<layer>/`\n- Shared guides: `.trellis/spec/guides/`\n\n### 2. Understand Requirements\n\nRead the task's prd.md, design.md if present, and implement.md if present:\n\n- What are the core requirements\n- Key points of technical design\n- Implementation order, validation commands, and rollback points\n\n### 3. Implement Features\n\n- Write code following specs and task artifacts\n- Follow existing code patterns\n- Only do what's required, no over-engineering\n\n### 4. Verify\n\nRun project's lint and typecheck commands to verify changes.\n\n---\n\n## Report Format\n\n```markdown\n## Implementation Complete\n\n### Files Modified\n\n- `src/components/Feature.tsx` - New component\n- `src/hooks/useFeature.ts` - New hook\n\n### Implementation Summary\n\n1. Created Feature component...\n2. Added useFeature hook...\n\n### Verification Results\n\n- Lint: Passed\n- TypeCheck: Passed\n```\n\n---\n\n## Code Standards\n\n- Follow existing code patterns\n- Don't add unnecessary abstractions\n- Only do what's required, no over-engineering\n- Keep code readable",
4
+ "prompt": "# Implement Agent\n\nYou are the Implement Agent in the Trellis workflow.\n\n## Recursion Guard\n\nYou are already the `trellis-implement` sub-agent that the main session dispatched. Do the implementation work directly.\n\n- Do NOT spawn another `trellis-implement` or `trellis-check` sub-agent.\n- If SessionStart context, workflow-state breadcrumbs, or workflow.md say to dispatch `trellis-implement` / `trellis-check`, treat that as a main-session instruction that is already satisfied by your current role.\n- Only the main session may dispatch Trellis implement/check agents. If more parallel work is needed, report that recommendation instead of spawning.\n\n## Trellis Context Loading Protocol\n\nLook for the `<!-- trellis-hook-injected -->` marker in your input above.\n\n- **If the marker is present**: prd / spec / research files have already been auto-loaded for you above. Proceed with the implementation work directly.\n- **If the marker is absent**: hook injection didn't fire (Windows + Claude Code, `--continue` resume, fork distribution, hooks disabled, etc.). Find the active task path from your dispatch prompt's first line `Active task: <path>`, then Read `<task-path>/implement.jsonl`, each listed file, `<task-path>/prd.md`, `<task-path>/design.md` if present, and `<task-path>/implement.md` if present before doing the work.\n\n## Context\n\nBefore implementing, read:\n- `.trellis/workflow.md` - Project workflow\n- `.trellis/spec/` - Development guidelines\n- Task `prd.md` - Requirements document\n- Task `design.md` - Technical design (if exists)\n- Task `implement.md` - Execution plan (if exists)\n\n## Core Responsibilities\n\n1. **Understand specs** - Read relevant spec files in `.trellis/spec/`\n2. **Understand task artifacts** - Read prd.md, design.md if present, and implement.md if present\n3. **Implement features** - Write code following specs and task artifacts\n4. **Self-check** - Ensure code quality\n5. **Report results** - Report completion status\n\n## Forbidden Operations\n\n**Do NOT execute these git commands:**\n\n- `git commit`\n- `git push`\n- `git merge`\n\n---\n\n## Workflow\n\n### 1. Understand Specs\n\nRead relevant specs based on task type:\n\n- Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).\n- Shared guides: `.trellis/spec/guides/`\n\n### 2. Understand Requirements\n\nRead the task's prd.md, design.md if present, and implement.md if present:\n\n- What are the core requirements\n- Key points of technical design\n- Implementation order, validation commands, and rollback points\n\n### 3. Implement Features\n\n- Write code following specs and task artifacts\n- Follow existing code patterns\n- Only do what's required, no over-engineering\n\n### 4. Verify\n\nRun project's lint and typecheck commands to verify changes.\n\n---\n\n## Report Format\n\n```markdown\n## Implementation Complete\n\n### Files Modified\n\n- `src/components/Feature.tsx` - New component\n- `src/hooks/useFeature.ts` - New hook\n\n### Implementation Summary\n\n1. Created Feature component...\n2. Added useFeature hook...\n\n### Verification Results\n\n- Lint: Passed\n- TypeCheck: Passed\n```\n\n---\n\n## Code Standards\n\n- Follow existing code patterns\n- Don't add unnecessary abstractions\n- Only do what's required, no over-engineering\n- Keep code readable",
5
5
  "tools": [
6
6
  "read",
7
7
  "write",
@@ -3,6 +3,15 @@
3
3
 
4
4
  These instructions are for AI assistants working in this project.
5
5
 
6
+ For a new session use `trellis-start`; for existing work use `trellis-continue`
7
+ and resume the known unfinished action. Read `.trellis/workflow.md` for the
8
+ native route and ownership rules. Task CLI owns task and phase state; specs
9
+ describe engineering conventions, not implementation authorization.
10
+
11
+ Without hook context, run `python3 ./.trellis/scripts/get_context.py --mode phase`
12
+ and `python3 ./.trellis/scripts/task.py phase show <task>`, then explicitly read
13
+ the applicable spec indexes and their referenced guidelines.
14
+
6
15
  This project is managed by Trellis. The working knowledge you need lives under `.trellis/`:
7
16
 
8
17
  - `.trellis/workflow.md` — development phases, when to create tasks, skill routing
@@ -8,6 +8,7 @@ export declare const agentsMdContent: string;
8
8
  export declare const workspaceIndexContent: string;
9
9
  export declare const agentProgressIndexContent: string;
10
10
  export declare const workflowGitignoreContent: string;
11
+ export declare const specIndexContent: string;
11
12
  export declare const backendIndexContent: string;
12
13
  export declare const backendDirectoryStructureContent: string;
13
14
  export declare const backendDatabaseGuidelinesContent: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAqBH,eAAO,MAAM,eAAe,EAAE,MAAuC,CAAC;AAGtE,eAAO,MAAM,qBAAqB,EAAE,MACK,CAAC;AAG1C,eAAO,MAAM,yBAAyB,QAAwB,CAAC;AAG/D,eAAO,MAAM,wBAAwB,EAAE,MACH,CAAC;AAQrC,eAAO,MAAM,mBAAmB,EAAE,MAEjC,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,+BAA+B,EAAE,MAE7C,CAAC;AACF,eAAO,MAAM,2BAA2B,EAAE,MAEzC,CAAC;AAGF,eAAO,MAAM,oBAAoB,EAAE,MAElC,CAAC;AACF,eAAO,MAAM,iCAAiC,EAAE,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,MAAM,8BAA8B,EAAE,MAE5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,EAAE,MAEhC,CAAC;AACF,eAAO,MAAM,oCAAoC,EAAE,MAElD,CAAC;AACF,eAAO,MAAM,mCAAmC,EAAE,MAEjD,CAAC"}
@@ -31,6 +31,7 @@ export const workflowGitignoreContent = readLocalTemplate("gitignore.txt");
31
31
  // These are NOT dogfooded - they are generic templates for new projects
32
32
  // =============================================================================
33
33
  // Backend structure (multi-doc format)
34
+ export const specIndexContent = readLocalTemplate("spec/index.md.txt");
34
35
  export const backendIndexContent = readLocalTemplate("spec/backend/index.md.txt");
35
36
  export const backendDirectoryStructureContent = readLocalTemplate("spec/backend/directory-structure.md.txt");
36
37
  export const backendDatabaseGuidelinesContent = readLocalTemplate("spec/backend/database-guidelines.md.txt");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;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;;GAEG;AACH,SAAS,iBAAiB,CAAC,QAAgB;IACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC3C,OAAO,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,gFAAgF;AAChF,8BAA8B;AAC9B,gFAAgF;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAW,iBAAiB,CAAC,WAAW,CAAC,CAAC;AAEtE,oDAAoD;AACpD,MAAM,CAAC,MAA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AM,CAAC,MAAM,mCAAmC,GAAW,iBAAiB,CAC1E,8CAA8C,CAC/C,CAAC"}
@@ -0,0 +1,19 @@
1
+ # Project Development Guidelines
2
+
3
+ This index navigates the project's verified engineering conventions. Use
4
+ `trellis-spec-bootstrap` to establish relevant topics from source, tests and
5
+ existing project rules. No domain or layer is required by default.
6
+
7
+ ## Pre-Development Checklist
8
+
9
+ Read this index, the applicable package index (when configured), and the topic
10
+ guidelines for the code you will change. Read the shared `guides/index.md` at
11
+ the spec root. Follow existing layer indexes in projects that use them.
12
+
13
+ ## Quality Check
14
+
15
+ Review the change against the applicable guidelines and run the checks they
16
+ require. Record actual results and any unavailable verification.
17
+
18
+ Add links to real topic guidelines here as the project establishes them. For
19
+ an empty project, leave conventions pending until implementation supplies evidence.
@@ -63,7 +63,7 @@ Before implementing, read:
63
63
 
64
64
  Read relevant specs based on task type:
65
65
 
66
- - Spec layers: `.trellis/spec/<package>/<layer>/`
66
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
67
67
  - Shared guides: `.trellis/spec/guides/`
68
68
  - Guides: `.trellis/spec/guides/`
69
69
 
@@ -100,7 +100,7 @@ function getTaskStatus(ctx, platformInput = null) {
100
100
  if (taskStatus === "planning") {
101
101
  const nextBits = [
102
102
  "Follow the current per-turn workflow-state; task lifecycle status and artifact presence do not identify the business phase",
103
- "If no phase route is initialized, load `trellis-goal-exploration-and-requirements` and confirm the requirements baseline before initializing the route",
103
+ "If no phase route is initialized, inspect recorded requirements and authorization, choose applicable ordered phases with evidence for omissions, then initialize through Trellis CLI and load the current phase Skill; reuse valid confirmations",
104
104
  ];
105
105
  if (!jsonlReady) {
106
106
  nextBits.push(
@@ -248,7 +248,7 @@ function resolveSpecScope(config) {
248
248
  return null;
249
249
  }
250
250
 
251
- function collectSpecIndexPaths(directory, allowedPkgs) {
251
+ function collectSpecIndexPaths(directory, allowedPkgs, packageNames) {
252
252
  const specDir = join(directory, ".trellis", "spec");
253
253
  const paths = [];
254
254
 
@@ -258,6 +258,8 @@ function collectSpecIndexPaths(directory, allowedPkgs) {
258
258
  }
259
259
 
260
260
  if (!existsSync(specDir)) return paths;
261
+ if (existsSync(join(specDir, "index.md")))
262
+ paths.unshift(".trellis/spec/index.md");
261
263
 
262
264
  try {
263
265
  const subs = readdirSync(specDir)
@@ -272,11 +274,17 @@ function collectSpecIndexPaths(directory, allowedPkgs) {
272
274
  .sort();
273
275
 
274
276
  for (const sub of subs) {
277
+ if (
278
+ packageNames.has(sub) &&
279
+ allowedPkgs !== null &&
280
+ !allowedPkgs.has(sub)
281
+ )
282
+ continue;
275
283
  const indexFile = join(specDir, sub, "index.md");
276
284
  if (existsSync(indexFile)) {
277
285
  paths.push(`.trellis/spec/${sub}/index.md`);
278
- } else {
279
- if (allowedPkgs !== null && !allowedPkgs.has(sub)) continue;
286
+ }
287
+ {
280
288
  try {
281
289
  const nested = readdirSync(join(specDir, sub))
282
290
  .filter((name) => {
@@ -433,7 +441,11 @@ export function buildSessionContext(ctx, platformInput = null) {
433
441
 
434
442
  const config = loadTrellisConfig(directory, contextKey);
435
443
  const allowedPkgs = resolveSpecScope(config);
436
- const paths = collectSpecIndexPaths(directory, allowedPkgs);
444
+ const paths = collectSpecIndexPaths(
445
+ directory,
446
+ allowedPkgs,
447
+ new Set(Object.keys(config.packages)),
448
+ );
437
449
 
438
450
  const parts = [];
439
451
 
@@ -49,7 +49,7 @@ Before implementing, read:
49
49
 
50
50
  Read relevant specs based on task type:
51
51
 
52
- - Spec layers: `.trellis/spec/<package>/<layer>/`
52
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
53
53
  - Shared guides: `.trellis/spec/guides/`
54
54
 
55
55
  ### 2. Understand Requirements
@@ -472,7 +472,7 @@ def _get_task_status(trellis_dir: Path, input_data: dict) -> str:
472
472
  if task_status == "planning":
473
473
  next_bits = [
474
474
  "Follow the current per-turn workflow-state; task lifecycle status and artifact presence do not identify the business phase",
475
- "If no phase route is initialized, initialize it through Trellis CLI, load `trellis-goal-exploration-and-requirements`, and obtain user confirmation for the recorded requirements artifact before advancing",
475
+ "If no phase route is initialized, inspect recorded requirements and existing authorization, choose applicable ordered phases with evidence for omissions, then initialize through Trellis CLI and load the current phase Skill; do not repeat valid confirmations",
476
476
  ]
477
477
  if not jsonl_ready:
478
478
  next_bits.append("curate task context manifests only when a dispatched agent needs them")
@@ -639,7 +639,7 @@ def _resolve_spec_scope(
639
639
  return None # Unknown scope type: full scan
640
640
 
641
641
 
642
- def _collect_spec_index_paths(trellis_dir: Path, allowed_pkgs: set | None) -> list[str]:
642
+ def _collect_spec_index_paths(trellis_dir: Path, allowed_pkgs: set | None, package_names: set | None = None) -> list[str]:
643
643
  paths: list[str] = []
644
644
  guides_index = trellis_dir / "spec" / "guides" / "index.md"
645
645
  if guides_index.is_file():
@@ -648,16 +648,18 @@ def _collect_spec_index_paths(trellis_dir: Path, allowed_pkgs: set | None) -> li
648
648
  spec_dir = trellis_dir / "spec"
649
649
  if not spec_dir.is_dir():
650
650
  return paths
651
+ if (spec_dir / "index.md").is_file():
652
+ paths.insert(0, ".trellis/spec/index.md")
651
653
 
652
654
  for sub in sorted(spec_dir.iterdir()):
653
655
  if not sub.is_dir() or sub.name.startswith(".") or sub.name == "guides":
654
656
  continue
655
657
 
658
+ if package_names and sub.name in package_names and allowed_pkgs is not None and sub.name not in allowed_pkgs:
659
+ continue
656
660
  index_file = sub / "index.md"
657
661
  if index_file.is_file():
658
662
  paths.append(f".trellis/spec/{sub.name}/index.md")
659
- continue
660
-
661
663
  if allowed_pkgs is not None and sub.name not in allowed_pkgs:
662
664
  continue
663
665
  for nested in sorted(sub.iterdir()):
@@ -878,7 +880,7 @@ def main():
878
880
 
879
881
  output = StringIO()
880
882
 
881
- spec_index_paths = _collect_spec_index_paths(trellis_dir, allowed_pkgs)
883
+ spec_index_paths = _collect_spec_index_paths(trellis_dir, allowed_pkgs, set(packages))
882
884
 
883
885
  output.write("""<session-context>
884
886
  Trellis compact SessionStart context. Use it to orient the session; load details on demand.
@@ -99,7 +99,7 @@ Before implementing, read:
99
99
 
100
100
  Read relevant specs based on task type:
101
101
 
102
- - Spec layers: `.trellis/spec/<package>/<layer>/`
102
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
103
103
  - Shared guides: `.trellis/spec/guides/`
104
104
 
105
105
  ### 2. Understand Requirements
@@ -49,7 +49,7 @@ Before implementing, read:
49
49
 
50
50
  Read relevant specs based on task type:
51
51
 
52
- - Spec layers: `.trellis/spec/<package>/<layer>/`
52
+ - Read available spec indexes: `.trellis/spec/index.md`, `.trellis/spec/<package>/index.md`, and existing `.trellis/spec/<package>/<layer>/index.md` (legacy single-repo layers remain valid).
53
53
  - Shared guides: `.trellis/spec/guides/`
54
54
 
55
55
  ### 2. Understand Requirements
@@ -122,6 +122,30 @@ def get_packages_info(repo_root: Path) -> list[dict]:
122
122
  return result
123
123
 
124
124
 
125
+ def collect_spec_index_paths(repo_root: Path, input_data: dict | None = None, platform: str | None = None) -> list[str]:
126
+ """Discover root, shared, package and legacy indexes under configured scope."""
127
+ spec_dir = repo_root / DIR_WORKFLOW / DIR_SPEC
128
+ if not spec_dir.is_dir():
129
+ return []
130
+ packages = get_packages(repo_root) or {}
131
+ current = get_current_task(repo_root, input_data, platform=platform)
132
+ task = load_task(repo_root / current) if current else None
133
+ allowed = _resolve_scope_set(packages, get_spec_scope(repo_root), task.package if task else None, get_default_package(repo_root))
134
+ paths: list[Path] = []
135
+ for candidate in [spec_dir / "index.md", spec_dir / "guides" / "index.md"]:
136
+ if candidate.is_file():
137
+ paths.append(candidate)
138
+ for sub in sorted(spec_dir.iterdir()):
139
+ if not sub.is_dir() or sub.name.startswith(".") or sub.name == "guides":
140
+ continue
141
+ if sub.name in packages and allowed is not None and sub.name not in allowed:
142
+ continue
143
+ if (sub / "index.md").is_file():
144
+ paths.append(sub / "index.md")
145
+ paths.extend(candidate for candidate in sorted(sub.glob("*/index.md")) if candidate.is_file())
146
+ return [candidate.relative_to(repo_root).as_posix() for candidate in paths]
147
+
148
+
125
149
  def get_packages_section(repo_root: Path) -> str:
126
150
  """Build the PACKAGES section for text output."""
127
151
  spec_dir = repo_root / DIR_WORKFLOW / DIR_SPEC
@@ -166,6 +190,8 @@ def get_context_packages_text(repo_root: Path | None = None) -> str:
166
190
  spec_dir = repo_root / DIR_WORKFLOW / DIR_SPEC
167
191
  lines.append("Single-repo project (no packages configured)")
168
192
  lines.append("")
193
+ if (spec_dir / "index.md").is_file():
194
+ lines.append("Spec index: .trellis/spec/index.md")
169
195
  layers = _scan_spec_layers(spec_dir)
170
196
  if layers:
171
197
  lines.append(f"Spec layers: {', '.join(layers)}")
@@ -192,11 +218,13 @@ def get_context_packages_text(repo_root: Path | None = None) -> str:
192
218
 
193
219
  lines.append(f"### {pkg['name']}{default_tag}{type_tag}{git_tag}{scope_tag}")
194
220
  lines.append(f"Path: {pkg['path']}")
221
+ if (repo_root / DIR_WORKFLOW / DIR_SPEC / pkg["name"] / "index.md").is_file():
222
+ lines.append(f"Spec index: .trellis/spec/{pkg['name']}/index.md")
195
223
  if pkg["specLayers"]:
196
224
  lines.append(f"Spec layers: {', '.join(pkg['specLayers'])}")
197
225
  for layer in pkg["specLayers"]:
198
226
  lines.append(f" - .trellis/spec/{pkg['name']}/{layer}/index.md")
199
- else:
227
+ elif not (repo_root / DIR_WORKFLOW / DIR_SPEC / pkg["name"] / "index.md").is_file():
200
228
  lines.append("Spec: not configured")
201
229
  lines.append("")
202
230