@mindfoldhq/trellis 0.1.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.
Files changed (122) hide show
  1. package/LICENSE +110 -0
  2. package/README.md +149 -0
  3. package/bin/trellis.js +3 -0
  4. package/dist/cli/index.d.ts +2 -0
  5. package/dist/cli/index.d.ts.map +1 -0
  6. package/dist/cli/index.js +42 -0
  7. package/dist/cli/index.js.map +1 -0
  8. package/dist/commands/init.d.ts +11 -0
  9. package/dist/commands/init.d.ts.map +1 -0
  10. package/dist/commands/init.js +236 -0
  11. package/dist/commands/init.js.map +1 -0
  12. package/dist/configurators/claude.d.ts +35 -0
  13. package/dist/configurators/claude.d.ts.map +1 -0
  14. package/dist/configurators/claude.js +83 -0
  15. package/dist/configurators/claude.js.map +1 -0
  16. package/dist/configurators/cursor.d.ts +8 -0
  17. package/dist/configurators/cursor.d.ts.map +1 -0
  18. package/dist/configurators/cursor.js +22 -0
  19. package/dist/configurators/cursor.js.map +1 -0
  20. package/dist/configurators/templates.d.ts +40 -0
  21. package/dist/configurators/templates.d.ts.map +1 -0
  22. package/dist/configurators/templates.js +67 -0
  23. package/dist/configurators/templates.js.map +1 -0
  24. package/dist/configurators/workflow.d.ts +16 -0
  25. package/dist/configurators/workflow.d.ts.map +1 -0
  26. package/dist/configurators/workflow.js +169 -0
  27. package/dist/configurators/workflow.js.map +1 -0
  28. package/dist/constants/paths.d.ts +69 -0
  29. package/dist/constants/paths.d.ts.map +1 -0
  30. package/dist/constants/paths.js +80 -0
  31. package/dist/constants/paths.js.map +1 -0
  32. package/dist/index.d.ts +9 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +9 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/templates/agents/check.txt +120 -0
  37. package/dist/templates/agents/debug.txt +121 -0
  38. package/dist/templates/agents/dispatch.txt +201 -0
  39. package/dist/templates/agents/implement.txt +114 -0
  40. package/dist/templates/agents/index.d.ts +35 -0
  41. package/dist/templates/agents/index.d.ts.map +1 -0
  42. package/dist/templates/agents/index.js +71 -0
  43. package/dist/templates/agents/index.js.map +1 -0
  44. package/dist/templates/agents/research.txt +258 -0
  45. package/dist/templates/commands/claude/start.md.txt +127 -0
  46. package/dist/templates/commands/common/before-backend-dev.txt +13 -0
  47. package/dist/templates/commands/common/before-frontend-dev.txt +13 -0
  48. package/dist/templates/commands/common/break-loop.txt +107 -0
  49. package/dist/templates/commands/common/check-backend.txt +13 -0
  50. package/dist/templates/commands/common/check-cross-layer.txt +153 -0
  51. package/dist/templates/commands/common/check-frontend.txt +13 -0
  52. package/dist/templates/commands/common/create-command.txt +154 -0
  53. package/dist/templates/commands/common/finish-work.txt +129 -0
  54. package/dist/templates/commands/common/integrate-skill.txt +219 -0
  55. package/dist/templates/commands/common/onboard-developer.txt +355 -0
  56. package/dist/templates/commands/common/record-agent-flow.txt +62 -0
  57. package/dist/templates/commands/cursor/start.md.txt +94 -0
  58. package/dist/templates/commands/index.d.ts +46 -0
  59. package/dist/templates/commands/index.d.ts.map +1 -0
  60. package/dist/templates/commands/index.js +151 -0
  61. package/dist/templates/commands/index.js.map +1 -0
  62. package/dist/templates/extract.d.ts +22 -0
  63. package/dist/templates/extract.d.ts.map +1 -0
  64. package/dist/templates/extract.js +34 -0
  65. package/dist/templates/extract.js.map +1 -0
  66. package/dist/templates/hooks/index.d.ts +33 -0
  67. package/dist/templates/hooks/index.d.ts.map +1 -0
  68. package/dist/templates/hooks/index.js +53 -0
  69. package/dist/templates/hooks/index.js.map +1 -0
  70. package/dist/templates/hooks/inject-subagent-context.py +620 -0
  71. package/dist/templates/hooks/settings.json +16 -0
  72. package/dist/templates/markdown/agent-traces-index.md.txt +124 -0
  73. package/dist/templates/markdown/agents.md.txt +18 -0
  74. package/dist/templates/markdown/gitignore.txt +3 -0
  75. package/dist/templates/markdown/index.d.ts +26 -0
  76. package/dist/templates/markdown/index.d.ts.map +1 -0
  77. package/dist/templates/markdown/index.js +33 -0
  78. package/dist/templates/markdown/index.js.map +1 -0
  79. package/dist/templates/markdown/init-agent.md.txt +315 -0
  80. package/dist/templates/markdown/structure/backend/database-guidelines.md.txt +51 -0
  81. package/dist/templates/markdown/structure/backend/directory-structure.md.txt +54 -0
  82. package/dist/templates/markdown/structure/backend/error-handling.md.txt +51 -0
  83. package/dist/templates/markdown/structure/backend/index.md.txt +38 -0
  84. package/dist/templates/markdown/structure/backend/logging-guidelines.md.txt +51 -0
  85. package/dist/templates/markdown/structure/backend/quality-guidelines.md.txt +51 -0
  86. package/dist/templates/markdown/structure/frontend/component-guidelines.md.txt +59 -0
  87. package/dist/templates/markdown/structure/frontend/directory-structure.md.txt +54 -0
  88. package/dist/templates/markdown/structure/frontend/hook-guidelines.md.txt +51 -0
  89. package/dist/templates/markdown/structure/frontend/index.md.txt +39 -0
  90. package/dist/templates/markdown/structure/frontend/quality-guidelines.md.txt +51 -0
  91. package/dist/templates/markdown/structure/frontend/state-management.md.txt +51 -0
  92. package/dist/templates/markdown/structure/frontend/type-safety.md.txt +51 -0
  93. package/dist/templates/markdown/structure/guides/code-reuse-thinking-guide.md.txt +92 -0
  94. package/dist/templates/markdown/structure/guides/cross-layer-thinking-guide.md.txt +94 -0
  95. package/dist/templates/markdown/structure/guides/index.md.txt +79 -0
  96. package/dist/templates/markdown/workflow.md.txt +335 -0
  97. package/dist/templates/scripts/add-session.sh.txt +384 -0
  98. package/dist/templates/scripts/common/developer.sh.txt +130 -0
  99. package/dist/templates/scripts/common/git-context.sh.txt +237 -0
  100. package/dist/templates/scripts/common/paths.sh.txt +201 -0
  101. package/dist/templates/scripts/create-bootstrap.sh.txt +298 -0
  102. package/dist/templates/scripts/feature.sh.txt +700 -0
  103. package/dist/templates/scripts/get-context.sh.txt +7 -0
  104. package/dist/templates/scripts/get-developer.sh.txt +15 -0
  105. package/dist/templates/scripts/index.d.ts +25 -0
  106. package/dist/templates/scripts/index.d.ts.map +1 -0
  107. package/dist/templates/scripts/index.js +28 -0
  108. package/dist/templates/scripts/index.js.map +1 -0
  109. package/dist/templates/scripts/init-developer.sh.txt +34 -0
  110. package/dist/types/ai-tools.d.ts +35 -0
  111. package/dist/types/ai-tools.d.ts.map +1 -0
  112. package/dist/types/ai-tools.js +31 -0
  113. package/dist/types/ai-tools.js.map +1 -0
  114. package/dist/utils/file-writer.d.ts +23 -0
  115. package/dist/utils/file-writer.d.ts.map +1 -0
  116. package/dist/utils/file-writer.js +140 -0
  117. package/dist/utils/file-writer.js.map +1 -0
  118. package/dist/utils/project-detector.d.ts +16 -0
  119. package/dist/utils/project-detector.d.ts.map +1 -0
  120. package/dist/utils/project-detector.js +186 -0
  121. package/dist/utils/project-detector.js.map +1 -0
  122. package/package.json +71 -0
@@ -0,0 +1,124 @@
1
+ # Agent Progress Index
2
+
3
+ > Records of all AI Agent work sessions across all developers
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ This directory tracks progress for all developers working with AI Agents on this project.
10
+
11
+ ### File Structure
12
+
13
+ ```
14
+ agent-traces/
15
+ |-- index.md # This file - main index
16
+ \-- {developer}/ # Per-developer directory
17
+ |-- index.md # Personal index with session history
18
+ |-- features/ # Feature files
19
+ | |-- *.json # Active features
20
+ | \-- archive/ # Archived features by month
21
+ \-- progress-N.md # Progress files (sequential: 1, 2, 3...)
22
+ ```
23
+
24
+ ---
25
+
26
+ ## Active Developers
27
+
28
+ | Developer | Last Active | Sessions | Active File |
29
+ |-----------|-------------|----------|-------------|
30
+ | (none yet) | - | - | - |
31
+
32
+ ---
33
+
34
+ ## Getting Started
35
+
36
+ ### For New Developers
37
+
38
+ Run the initialization script:
39
+
40
+ ```bash
41
+ ./.trellis/scripts/init-developer.sh <your-name>
42
+ ```
43
+
44
+ This will:
45
+ 1. Create your identity file (gitignored)
46
+ 2. Create your progress directory
47
+ 3. Create your personal index
48
+ 4. Create initial progress file
49
+
50
+ ### For Returning Developers
51
+
52
+ 1. Get your developer name:
53
+ ```bash
54
+ ./.trellis/scripts/get-developer.sh
55
+ ```
56
+
57
+ 2. Read your personal index:
58
+ ```bash
59
+ cat .trellis/agent-traces/$(./.trellis/scripts/get-developer.sh)/index.md
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Guidelines
65
+
66
+ ### Progress File Rules
67
+
68
+ - **Max 2000 lines** per progress file
69
+ - When limit is reached, create `progress-{N+1}.md`
70
+ - Update your personal `index.md` when creating new files
71
+
72
+ ### Session Record Format
73
+
74
+ Each session should include:
75
+ - Summary: One-line description
76
+ - Main Changes: What was modified
77
+ - Git Commits: Commit hashes and messages
78
+ - Next Steps: What to do next
79
+
80
+ ---
81
+
82
+ ## Session Template
83
+
84
+ Use this template when recording sessions:
85
+
86
+ ```markdown
87
+ ## Session {N}: {Title}
88
+
89
+ **Date**: YYYY-MM-DD
90
+ **Feature**: {feature-name}
91
+
92
+ ### Summary
93
+
94
+ {One-line summary}
95
+
96
+ ### Main Changes
97
+
98
+ - {Change 1}
99
+ - {Change 2}
100
+
101
+ ### Git Commits
102
+
103
+ | Hash | Message |
104
+ |------|---------|
105
+ | `abc1234` | {commit message} |
106
+
107
+ ### Testing
108
+
109
+ - [OK] {Test result}
110
+
111
+ ### Status
112
+
113
+ [OK] **Completed** / # **In Progress** / [P] **Blocked**
114
+
115
+ ### Next Steps
116
+
117
+ - {Next step 1}
118
+ - {Next step 2}
119
+ ```
120
+
121
+ ---
122
+
123
+ **Language**: All documentation must be written in **English**.
124
+
@@ -0,0 +1,18 @@
1
+ <!-- TRELLIS:START -->
2
+ # Trellis Instructions
3
+
4
+ These instructions are for AI assistants working in this project.
5
+
6
+ Use the `/start` command when starting a new session to:
7
+ - Initialize your developer identity
8
+ - Understand current project context
9
+ - Read relevant guidelines
10
+
11
+ Use `@/.trellis/` to learn:
12
+ - Development workflow (`workflow.md`)
13
+ - Project structure guidelines (`structure/`)
14
+ - Progress tracking (`agent-traces/`)
15
+
16
+ Keep this managed block so 'trellis update' can refresh the instructions.
17
+
18
+ <!-- TRELLIS:END -->
@@ -0,0 +1,3 @@
1
+ # Developer identity (local only)
2
+ .developer
3
+
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Markdown templates for Trellis workflow
3
+ * Each template is stored as a .txt file
4
+ */
5
+ export declare const agentProgressIndexContent: string;
6
+ export declare const workflowMdContent: string;
7
+ export declare const workflowGitignoreContent: string;
8
+ export declare const initAgentContent: string;
9
+ export declare const agentsMdContent: string;
10
+ export declare const backendIndexContent: string;
11
+ export declare const backendDirectoryStructureContent: string;
12
+ export declare const backendDatabaseGuidelinesContent: string;
13
+ export declare const backendLoggingGuidelinesContent: string;
14
+ export declare const backendQualityGuidelinesContent: string;
15
+ export declare const backendErrorHandlingContent: string;
16
+ export declare const frontendIndexContent: string;
17
+ export declare const frontendDirectoryStructureContent: string;
18
+ export declare const frontendTypeSafetyContent: string;
19
+ export declare const frontendHookGuidelinesContent: string;
20
+ export declare const frontendComponentGuidelinesContent: string;
21
+ export declare const frontendQualityGuidelinesContent: string;
22
+ export declare const frontendStateManagementContent: string;
23
+ export declare const guidesIndexContent: string;
24
+ export declare const guidesCrossLayerThinkingGuideContent: string;
25
+ export declare const guidesCodeReuseThinkingGuideContent: string;
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AAGF,eAAO,MAAM,iBAAiB,EAAE,MAAwC,CAAC;AACzE,eAAO,MAAM,wBAAwB,EAAE,MAAsC,CAAC;AAG9E,eAAO,MAAM,gBAAgB,EAAE,MAA0C,CAAC;AAC1E,eAAO,MAAM,eAAe,EAAE,MAAsC,CAAC;AAGrE,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,MAE/C,CAAC;AACF,eAAO,MAAM,yBAAyB,EAAE,MAEvC,CAAC;AACF,eAAO,MAAM,6BAA6B,EAAE,MAE3C,CAAC;AACF,eAAO,MAAM,kCAAkC,EAAE,MAEhD,CAAC;AACF,eAAO,MAAM,gCAAgC,EAAE,MAE9C,CAAC;AACF,eAAO,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"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Markdown templates for Trellis workflow
3
+ * Each template is stored as a .txt file
4
+ */
5
+ import { readMarkdown } from "../extract.js";
6
+ // Agent progress
7
+ export const agentProgressIndexContent = readMarkdown("agent-traces-index.md.txt");
8
+ // Workflow documentation
9
+ export const workflowMdContent = readMarkdown("workflow.md.txt");
10
+ export const workflowGitignoreContent = readMarkdown("gitignore.txt");
11
+ // Root files
12
+ export const initAgentContent = readMarkdown("init-agent.md.txt");
13
+ export const agentsMdContent = readMarkdown("agents.md.txt");
14
+ // Backend structure (multi-doc format)
15
+ export const backendIndexContent = readMarkdown("structure/backend/index.md.txt");
16
+ export const backendDirectoryStructureContent = readMarkdown("structure/backend/directory-structure.md.txt");
17
+ export const backendDatabaseGuidelinesContent = readMarkdown("structure/backend/database-guidelines.md.txt");
18
+ export const backendLoggingGuidelinesContent = readMarkdown("structure/backend/logging-guidelines.md.txt");
19
+ export const backendQualityGuidelinesContent = readMarkdown("structure/backend/quality-guidelines.md.txt");
20
+ export const backendErrorHandlingContent = readMarkdown("structure/backend/error-handling.md.txt");
21
+ // Frontend structure (multi-doc format)
22
+ export const frontendIndexContent = readMarkdown("structure/frontend/index.md.txt");
23
+ export const frontendDirectoryStructureContent = readMarkdown("structure/frontend/directory-structure.md.txt");
24
+ export const frontendTypeSafetyContent = readMarkdown("structure/frontend/type-safety.md.txt");
25
+ export const frontendHookGuidelinesContent = readMarkdown("structure/frontend/hook-guidelines.md.txt");
26
+ export const frontendComponentGuidelinesContent = readMarkdown("structure/frontend/component-guidelines.md.txt");
27
+ export const frontendQualityGuidelinesContent = readMarkdown("structure/frontend/quality-guidelines.md.txt");
28
+ export const frontendStateManagementContent = readMarkdown("structure/frontend/state-management.md.txt");
29
+ // Guides structure
30
+ export const guidesIndexContent = readMarkdown("structure/guides/index.md.txt");
31
+ export const guidesCrossLayerThinkingGuideContent = readMarkdown("structure/guides/cross-layer-thinking-guide.md.txt");
32
+ export const guidesCodeReuseThinkingGuideContent = readMarkdown("structure/guides/code-reuse-thinking-guide.md.txt");
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/templates/markdown/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,iBAAiB;AACjB,MAAM,CAAC,MAAM,yBAAyB,GAAW,YAAY,CAC3D,2BAA2B,CAC5B,CAAC;AAEF,yBAAyB;AACzB,MAAM,CAAC,MAAM,iBAAiB,GAAW,YAAY,CAAC,iBAAiB,CAAC,CAAC;AACzE,MAAM,CAAC,MAAM,wBAAwB,GAAW,YAAY,CAAC,eAAe,CAAC,CAAC;AAE9E,aAAa;AACb,MAAM,CAAC,MAAM,gBAAgB,GAAW,YAAY,CAAC,mBAAmB,CAAC,CAAC;AAC1E,MAAM,CAAC,MAAM,eAAe,GAAW,YAAY,CAAC,eAAe,CAAC,CAAC;AAErE,uCAAuC;AACvC,MAAM,CAAC,MAAM,mBAAmB,GAAW,YAAY,CACrD,gCAAgC,CACjC,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,YAAY,CAClE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,YAAY,CAClE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAW,YAAY,CACjE,6CAA6C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAW,YAAY,CACjE,6CAA6C,CAC9C,CAAC;AACF,MAAM,CAAC,MAAM,2BAA2B,GAAW,YAAY,CAC7D,yCAAyC,CAC1C,CAAC;AAEF,wCAAwC;AACxC,MAAM,CAAC,MAAM,oBAAoB,GAAW,YAAY,CACtD,iCAAiC,CAClC,CAAC;AACF,MAAM,CAAC,MAAM,iCAAiC,GAAW,YAAY,CACnE,+CAA+C,CAChD,CAAC;AACF,MAAM,CAAC,MAAM,yBAAyB,GAAW,YAAY,CAC3D,uCAAuC,CACxC,CAAC;AACF,MAAM,CAAC,MAAM,6BAA6B,GAAW,YAAY,CAC/D,2CAA2C,CAC5C,CAAC;AACF,MAAM,CAAC,MAAM,kCAAkC,GAAW,YAAY,CACpE,gDAAgD,CACjD,CAAC;AACF,MAAM,CAAC,MAAM,gCAAgC,GAAW,YAAY,CAClE,8CAA8C,CAC/C,CAAC;AACF,MAAM,CAAC,MAAM,8BAA8B,GAAW,YAAY,CAChE,4CAA4C,CAC7C,CAAC;AAEF,mBAAmB;AACnB,MAAM,CAAC,MAAM,kBAAkB,GAAW,YAAY,CACpD,+BAA+B,CAChC,CAAC;AACF,MAAM,CAAC,MAAM,oCAAoC,GAAW,YAAY,CACtE,oDAAoD,CACrD,CAAC;AACF,MAAM,CAAC,MAAM,mCAAmC,GAAW,YAAY,CACrE,mDAAmD,CACpD,CAAC"}
@@ -0,0 +1,315 @@
1
+ # AI Agent Initialization Guide
2
+
3
+ > **Purpose**: Quick onboarding document for new AI Agent sessions. Read this first to understand the project and workflow.
4
+
5
+ ---
6
+
7
+ ## Quick Start (Do This First)
8
+
9
+ ### Step 0: Initialize Developer Identity (First Time Only)
10
+
11
+ > **Multi-developer support**: Each developer/Agent needs to initialize their identity first
12
+
13
+ ```bash
14
+ # Check if already initialized
15
+ ./.trellis/scripts/get-developer.sh
16
+
17
+ # If not initialized, run:
18
+ ./.trellis/scripts/init-developer.sh <your-name>
19
+ # Example: ./.trellis/scripts/init-developer.sh cursor-agent
20
+ ```
21
+
22
+ This creates:
23
+ - `.trellis/.developer` - Your identity file (gitignored, not committed)
24
+ - `.trellis/agent-traces/<your-name>/` - Your personal progress directory
25
+
26
+ **Naming suggestions**:
27
+ - Human developers: Use your name, e.g., `john-doe`
28
+ - Cursor AI: `cursor-agent` or `cursor-<feature>`
29
+ - Claude Code: `claude-agent` or `claude-<feature>`
30
+
31
+ ### Step 1: Understand Current Context (5 min)
32
+
33
+ ```bash
34
+ # Get full context in one command
35
+ ./.trellis/scripts/get-context.sh
36
+
37
+ # Or check manually:
38
+ ./.trellis/scripts/get-developer.sh # Your identity
39
+ ./.trellis/scripts/feature.sh list # Active features
40
+ git status && git log --oneline -10 # Git state
41
+ ```
42
+
43
+ ### Step 2: Read Project Guidelines (10 min) [MANDATORY]
44
+
45
+ **CRITICAL**: Read BOTH frontend and backend guideline indexes to understand the project:
46
+
47
+ ```bash
48
+ # Read frontend guidelines index (REQUIRED - even for backend tasks)
49
+ cat .trellis/structure/frontend/index.md
50
+
51
+ # Read backend guidelines index (REQUIRED - even for frontend tasks)
52
+ cat .trellis/structure/backend/index.md
53
+ ```
54
+
55
+ **Why read both?**
56
+ - Understand the full project architecture
57
+ - Know coding standards for the entire codebase
58
+ - See how frontend and backend interact
59
+ - Learn the overall code quality requirements
60
+
61
+ ### Step 3: Read Workflow Guide (5 min)
62
+
63
+ ```bash
64
+ cat .trellis/workflow.md
65
+ ```
66
+
67
+ **CRITICAL**: This document defines the entire development workflow. You MUST follow it.
68
+
69
+ ### Step 4: Before Coding - Read Specific Guidelines (Required)
70
+
71
+ Based on your task, read the **detailed** guidelines:
72
+
73
+ **Frontend Task**:
74
+ ```bash
75
+ cat .trellis/structure/frontend/hook-guidelines.md # For hooks
76
+ cat .trellis/structure/frontend/component-guidelines.md # For components
77
+ cat .trellis/structure/frontend/type-safety.md # For types
78
+ ```
79
+
80
+ **Backend Task**:
81
+ ```bash
82
+ cat .trellis/structure/backend/database-guidelines.md # For DB operations
83
+ cat .trellis/structure/backend/type-safety.md # For Zod/types
84
+ cat .trellis/structure/backend/logging-guidelines.md # For logging
85
+ ```
86
+
87
+ ---
88
+
89
+ ## Project Overview
90
+
91
+ ### What is This Project?
92
+
93
+ [Fill in your project description here after running `trellis init`]
94
+
95
+ ### Tech Stack
96
+
97
+ [Fill in your tech stack here]
98
+
99
+ ### Key Information
100
+
101
+ - **Main Branch**: Check with `git branch`
102
+ - **Current Branch**: Check `git status`
103
+ - **Package Manager**: Check for package-lock.json (npm), yarn.lock (yarn), or pnpm-lock.yaml (pnpm)
104
+ - **Linter**: Check package.json scripts
105
+
106
+ ---
107
+
108
+ ## Directory Structure
109
+
110
+ ```
111
+ your-project/
112
+ ├── .trellis/ # [!] Agent-Human collaboration system
113
+ │ ├── workflow.md # Workflow guide (MUST READ)
114
+ │ ├── scripts/ # Workflow scripts
115
+ │ │ ├── common/ # Shared utilities
116
+ │ │ ├── feature.sh # Feature management
117
+ │ │ ├── get-context.sh # Get session context
118
+ │ │ └── add-session.sh # Record session
119
+ │ ├── agent-traces/ # Work progress records
120
+ │ │ └── {developer}/ # Per-developer directories
121
+ │ │ ├── features/ # Feature directories
122
+ │ │ │ └── {day}-{name}/
123
+ │ │ │ └── feature.json
124
+ │ │ └── progress-N.md
125
+ │ ├── structure/ # [!] Development guidelines (MUST READ)
126
+ │ │ ├── frontend/
127
+ │ │ │ ├── index.md # Frontend guidelines index
128
+ │ │ │ └── *.md # Topic-specific docs
129
+ │ │ ├── backend/
130
+ │ │ │ ├── index.md # Backend guidelines index
131
+ │ │ │ └── *.md # Topic-specific docs
132
+ │ │ └── guides/ # Thinking guides
133
+ ├── init-agent.md # This initialization guide
134
+ └── AGENTS.md # Compatible with agents.md protocol
135
+ ```
136
+
137
+ ---
138
+
139
+ ## Development Workflow System
140
+
141
+ ### Overview
142
+
143
+ This project uses a structured workflow system based on [Anthropic's best practices](https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents).
144
+
145
+ ### Core Files
146
+
147
+ | File | Purpose | When to Update |
148
+ |------|---------|----------------|
149
+ | `.trellis/workflow.md` | Complete workflow guide | Read at session start |
150
+ | `.trellis/agent-traces/{developer}/features/` | Feature tracking | When creating/completing features |
151
+ | `.trellis/agent-traces/{developer}/progress-N.md` | Session work records | After each session |
152
+
153
+ ### Key Rules (CRITICAL - Must Follow)
154
+
155
+ **1. Read Guidelines Before Coding**
156
+ - Frontend: `.trellis/structure/frontend/index.md` -> specific docs
157
+ - Backend: `.trellis/structure/backend/index.md` -> specific docs
158
+ - This is **mandatory**, not optional
159
+
160
+ **2. Document Limits** **CRITICAL RULE**
161
+ - `agent-traces/{developer}/progress-N.md` max 2000 lines
162
+ - **IMPORTANT: Only create new file when current file EXCEEDS 2000 lines**
163
+ - File naming: Use sequential numbers (`progress-1.md`, `progress-2.md`...)
164
+
165
+ **3. Update Tracking Files**
166
+ - After completing work: Update `agent-traces` (include commit hashes)
167
+ - When feature changes: Use `feature.sh` commands
168
+
169
+ ---
170
+
171
+ ## How to Use the Workflow System
172
+
173
+ ### At Session Start
174
+
175
+ 1. **Get context** - Run `./.trellis/scripts/get-context.sh`
176
+ 2. **Read ALL guideline indexes** (see Quick Start Step 2 above)
177
+ - **MANDATORY**: Read both frontend AND backend indexes
178
+ 3. **Read workflow guide** - `cat .trellis/workflow.md`
179
+ 4. **Identify your task** from feature list
180
+ 5. **Read specific guidelines** for your task
181
+ 6. **Create or select feature** to work on
182
+
183
+ ### During Development
184
+
185
+ 1. **Create feature** (if new)
186
+ ```bash
187
+ ./.trellis/scripts/feature.sh create <feature-name>
188
+ ```
189
+
190
+ 2. **Follow guidelines strictly**
191
+ - Frontend: Type safety, Hook standards, Component standards
192
+ - Backend: Directory structure, Type safety, Database operations
193
+
194
+ 3. **Test before commit**
195
+ ```bash
196
+ npm run lint # or pnpm lint / yarn lint - Must pass
197
+ npm run type-check # or pnpm type-check - Must pass
198
+ ```
199
+
200
+ 4. **Commit with convention**
201
+ ```bash
202
+ git commit -m "type(scope): description"
203
+ # Types: feat, fix, docs, refactor, test, chore
204
+ ```
205
+
206
+ ### At Session End (REQUIRED)
207
+
208
+ **Record your session**:
209
+ ```bash
210
+ ./.trellis/scripts/add-session.sh \
211
+ --title "Session Title" \
212
+ --commit "abc1234" \
213
+ --summary "Brief summary"
214
+ ```
215
+
216
+ This automatically:
217
+ - Appends session to current progress file
218
+ - Creates new file if 2000-line limit exceeded
219
+ - Updates index.md
220
+
221
+ **Archive completed feature**:
222
+ ```bash
223
+ ./.trellis/scripts/feature.sh archive <feature-name>
224
+ ```
225
+
226
+ ---
227
+
228
+ ## Common Commands
229
+
230
+ ### Workflow Scripts
231
+ ```bash
232
+ ./.trellis/scripts/get-context.sh # Get full context
233
+ ./.trellis/scripts/get-developer.sh # Get current developer
234
+ ./.trellis/scripts/init-developer.sh <name> # Initialize developer
235
+ ./.trellis/scripts/feature.sh list # List features
236
+ ./.trellis/scripts/feature.sh create <name> # Create feature
237
+ ./.trellis/scripts/feature.sh archive <name># Archive feature
238
+ ./.trellis/scripts/add-session.sh # Record session
239
+ ```
240
+
241
+ ### Development
242
+ ```bash
243
+ npm run dev # Start dev server
244
+ npm run build # Production build
245
+ npm run lint # Run linter
246
+ npm run format # Format code
247
+ npm run type-check # Type checking
248
+ ```
249
+
250
+ ### Git
251
+ ```bash
252
+ git status
253
+ git log --oneline -20
254
+ git diff main...HEAD
255
+ ```
256
+
257
+ ---
258
+
259
+ ## Critical Reminders
260
+
261
+ ### DO (Follow These)
262
+
263
+ 1. **Read BOTH guideline indexes** at session start (frontend AND backend)
264
+ 2. **Read .trellis/workflow.md** at session start
265
+ 3. **Read specific docs** before coding (based on task)
266
+ 4. **Update tracking files** after work
267
+ 5. **Test thoroughly** before committing
268
+ 6. **Follow guidelines strictly**
269
+
270
+ ### DON'T (Avoid These)
271
+
272
+ 1. **Don't skip reading guideline indexes** at initialization (CRITICAL VIOLATION)
273
+ 2. **Don't skip reading specific guidelines** before coding
274
+ 3. **Don't exceed 2000 lines** in agent-traces files
275
+ 4. **Don't commit with lint errors**
276
+ 5. **Don't use non-null assertions** (`!`)
277
+ 6. **Don't skip updating tracking files**
278
+ 7. **Don't execute `git commit`** - AI should not commit code (only suggest)
279
+
280
+ ---
281
+
282
+ ## Your First Task Checklist
283
+
284
+ ### Before You Start Coding
285
+
286
+ - [ ] Run `./.trellis/scripts/get-context.sh` - Understand context
287
+ - [ ] Read `.trellis/workflow.md` - Understand the workflow
288
+ - [ ] Read `.trellis/structure/[frontend|backend]/index.md` - Find relevant guidelines
289
+ - [ ] Read specific guideline docs based on your task
290
+ - [ ] Create or select a feature with `feature.sh`
291
+ - [ ] Start coding following the guidelines
292
+
293
+ ### After Completing Your Work
294
+
295
+ - [ ] Run lint and type-check - Must pass
296
+ - [ ] Commit with proper message format
297
+ - [ ] Run `add-session.sh` to record progress
298
+ - [ ] Archive feature if completed with `feature.sh archive`
299
+
300
+ ---
301
+
302
+ ## Success Criteria
303
+
304
+ You're doing well if:
305
+
306
+ - [x] All lint and type checks pass
307
+ - [x] Code follows the guidelines
308
+ - [x] Session is recorded via `add-session.sh`
309
+ - [x] Features are tracked via `feature.sh`
310
+ - [x] Commits are well-formatted
311
+ - [x] Documentation is up-to-date
312
+
313
+ ---
314
+
315
+ **Ready to start? Follow the Quick Start section at the top!**
@@ -0,0 +1,51 @@
1
+ # Database Guidelines
2
+
3
+ > Database patterns and conventions for this project.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's database conventions here.
11
+
12
+ Questions to answer:
13
+ - What ORM/query library do you use?
14
+ - How are migrations managed?
15
+ - What are the naming conventions for tables/columns?
16
+ - How do you handle transactions?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Query Patterns
24
+
25
+ <!-- How should queries be written? Batch operations? -->
26
+
27
+ (To be filled by the team)
28
+
29
+ ---
30
+
31
+ ## Migrations
32
+
33
+ <!-- How to create and run migrations -->
34
+
35
+ (To be filled by the team)
36
+
37
+ ---
38
+
39
+ ## Naming Conventions
40
+
41
+ <!-- Table names, column names, index names -->
42
+
43
+ (To be filled by the team)
44
+
45
+ ---
46
+
47
+ ## Common Mistakes
48
+
49
+ <!-- Database-related mistakes your team has made -->
50
+
51
+ (To be filled by the team)
@@ -0,0 +1,54 @@
1
+ # Directory Structure
2
+
3
+ > How backend code is organized in this project.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's backend directory structure here.
11
+
12
+ Questions to answer:
13
+ - Where do API routes/handlers live?
14
+ - Where does business logic go?
15
+ - How are database-related files organized?
16
+ - Where are shared utilities?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Directory Layout
24
+
25
+ ```
26
+ <!-- Replace with your actual structure -->
27
+ server/
28
+ ├── ...
29
+ └── ...
30
+ ```
31
+
32
+ ---
33
+
34
+ ## Module Organization
35
+
36
+ <!-- How should new features be organized? -->
37
+
38
+ (To be filled by the team)
39
+
40
+ ---
41
+
42
+ ## Naming Conventions
43
+
44
+ <!-- File and folder naming rules -->
45
+
46
+ (To be filled by the team)
47
+
48
+ ---
49
+
50
+ ## Examples
51
+
52
+ <!-- Link to well-organized modules as examples -->
53
+
54
+ (To be filled by the team)
@@ -0,0 +1,51 @@
1
+ # Error Handling
2
+
3
+ > How errors are handled in this project's backend.
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ <!--
10
+ Document your project's error handling conventions here.
11
+
12
+ Questions to answer:
13
+ - What error types do you use?
14
+ - How are errors logged?
15
+ - How are errors returned to clients?
16
+ - How do you handle unexpected errors?
17
+ -->
18
+
19
+ (To be filled by the team)
20
+
21
+ ---
22
+
23
+ ## Error Types
24
+
25
+ <!-- Custom error classes, error codes -->
26
+
27
+ (To be filled by the team)
28
+
29
+ ---
30
+
31
+ ## Error Response Format
32
+
33
+ <!-- How errors are formatted in API responses -->
34
+
35
+ (To be filled by the team)
36
+
37
+ ---
38
+
39
+ ## Logging Errors
40
+
41
+ <!-- How and where errors should be logged -->
42
+
43
+ (To be filled by the team)
44
+
45
+ ---
46
+
47
+ ## Common Mistakes
48
+
49
+ <!-- Error handling mistakes your team has made -->
50
+
51
+ (To be filled by the team)