@mindfoldhq/trellis 0.3.0-rc.5 → 0.3.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 (121) hide show
  1. package/README.md +16 -4
  2. package/dist/cli/index.js +4 -0
  3. package/dist/cli/index.js.map +1 -1
  4. package/dist/commands/init.d.ts +4 -0
  5. package/dist/commands/init.d.ts.map +1 -1
  6. package/dist/commands/init.js +29 -15
  7. package/dist/commands/init.js.map +1 -1
  8. package/dist/commands/update.d.ts.map +1 -1
  9. package/dist/commands/update.js +19 -11
  10. package/dist/commands/update.js.map +1 -1
  11. package/dist/configurators/antigravity.d.ts +8 -0
  12. package/dist/configurators/antigravity.d.ts.map +1 -0
  13. package/dist/configurators/antigravity.js +18 -0
  14. package/dist/configurators/antigravity.js.map +1 -0
  15. package/dist/configurators/gemini.d.ts +8 -0
  16. package/dist/configurators/gemini.d.ts.map +1 -0
  17. package/dist/configurators/gemini.js +52 -0
  18. package/dist/configurators/gemini.js.map +1 -0
  19. package/dist/configurators/index.d.ts.map +1 -1
  20. package/dist/configurators/index.js +49 -1
  21. package/dist/configurators/index.js.map +1 -1
  22. package/dist/configurators/kilo.d.ts +8 -0
  23. package/dist/configurators/kilo.d.ts.map +1 -0
  24. package/dist/configurators/kilo.js +51 -0
  25. package/dist/configurators/kilo.js.map +1 -0
  26. package/dist/configurators/kiro.d.ts +8 -0
  27. package/dist/configurators/kiro.d.ts.map +1 -0
  28. package/dist/configurators/kiro.js +20 -0
  29. package/dist/configurators/kiro.js.map +1 -0
  30. package/dist/migrations/manifests/0.3.0-rc.6.json +9 -0
  31. package/dist/migrations/manifests/0.3.0.json +11 -0
  32. package/dist/templates/antigravity/index.d.ts +12 -0
  33. package/dist/templates/antigravity/index.d.ts.map +1 -0
  34. package/dist/templates/antigravity/index.js +29 -0
  35. package/dist/templates/antigravity/index.js.map +1 -0
  36. package/dist/templates/claude/agents/implement.md +1 -1
  37. package/dist/templates/claude/commands/trellis/brainstorm.md +16 -18
  38. package/dist/templates/claude/commands/trellis/start.md +73 -48
  39. package/dist/templates/codex/skills/brainstorm/SKILL.md +16 -18
  40. package/dist/templates/codex/skills/start/SKILL.md +80 -46
  41. package/dist/templates/cursor/commands/trellis-brainstorm.md +16 -18
  42. package/dist/templates/cursor/commands/trellis-start.md +191 -23
  43. package/dist/templates/extract.d.ts +52 -0
  44. package/dist/templates/extract.d.ts.map +1 -1
  45. package/dist/templates/extract.js +90 -0
  46. package/dist/templates/extract.js.map +1 -1
  47. package/dist/templates/gemini/commands/trellis/before-backend-dev.toml +17 -0
  48. package/dist/templates/gemini/commands/trellis/before-frontend-dev.toml +17 -0
  49. package/dist/templates/gemini/commands/trellis/brainstorm.toml +420 -0
  50. package/dist/templates/gemini/commands/trellis/break-loop.toml +129 -0
  51. package/dist/templates/gemini/commands/trellis/check-backend.toml +17 -0
  52. package/dist/templates/gemini/commands/trellis/check-cross-layer.toml +147 -0
  53. package/dist/templates/gemini/commands/trellis/check-frontend.toml +17 -0
  54. package/dist/templates/gemini/commands/trellis/create-command.toml +119 -0
  55. package/dist/templates/gemini/commands/trellis/finish-work.toml +133 -0
  56. package/dist/templates/gemini/commands/trellis/integrate-skill.toml +104 -0
  57. package/dist/templates/gemini/commands/trellis/onboard.toml +111 -0
  58. package/dist/templates/gemini/commands/trellis/record-session.toml +66 -0
  59. package/dist/templates/gemini/commands/trellis/start.toml +292 -0
  60. package/dist/templates/gemini/commands/trellis/update-spec.toml +132 -0
  61. package/dist/templates/gemini/index.d.ts +21 -0
  62. package/dist/templates/gemini/index.d.ts.map +1 -0
  63. package/dist/templates/gemini/index.js +44 -0
  64. package/dist/templates/gemini/index.js.map +1 -0
  65. package/dist/templates/iflow/agents/implement.md +1 -1
  66. package/dist/templates/iflow/commands/trellis/brainstorm.md +16 -18
  67. package/dist/templates/iflow/commands/trellis/finish-work.md +9 -0
  68. package/dist/templates/iflow/commands/trellis/start.md +108 -50
  69. package/dist/templates/iflow/index.d.ts +3 -2
  70. package/dist/templates/iflow/index.d.ts.map +1 -1
  71. package/dist/templates/iflow/index.js +7 -9
  72. package/dist/templates/iflow/index.js.map +1 -1
  73. package/dist/templates/kilo/commands/trellis/before-backend-dev.md +13 -0
  74. package/dist/templates/kilo/commands/trellis/before-frontend-dev.md +13 -0
  75. package/dist/templates/kilo/commands/trellis/brainstorm.md +474 -0
  76. package/dist/templates/kilo/commands/trellis/break-loop.md +125 -0
  77. package/dist/templates/kilo/commands/trellis/check-backend.md +13 -0
  78. package/dist/templates/kilo/commands/trellis/check-cross-layer.md +153 -0
  79. package/dist/templates/kilo/commands/trellis/check-frontend.md +13 -0
  80. package/dist/templates/kilo/commands/trellis/create-command.md +152 -0
  81. package/dist/templates/kilo/commands/trellis/finish-work.md +129 -0
  82. package/dist/templates/kilo/commands/trellis/integrate-skill.md +219 -0
  83. package/dist/templates/kilo/commands/trellis/onboard.md +358 -0
  84. package/dist/templates/kilo/commands/trellis/parallel.md +194 -0
  85. package/dist/templates/kilo/commands/trellis/record-session.md +62 -0
  86. package/dist/templates/kilo/commands/trellis/start.md +321 -0
  87. package/dist/templates/kilo/commands/trellis/update-spec.md +285 -0
  88. package/dist/templates/kilo/index.d.ts +16 -0
  89. package/dist/templates/kilo/index.d.ts.map +1 -0
  90. package/dist/templates/kilo/index.js +39 -0
  91. package/dist/templates/kilo/index.js.map +1 -0
  92. package/dist/templates/kiro/index.d.ts +18 -0
  93. package/dist/templates/kiro/index.d.ts.map +1 -0
  94. package/dist/templates/kiro/index.js +40 -0
  95. package/dist/templates/kiro/index.js.map +1 -0
  96. package/dist/templates/kiro/skills/before-backend-dev/SKILL.md +18 -0
  97. package/dist/templates/kiro/skills/before-frontend-dev/SKILL.md +18 -0
  98. package/dist/templates/kiro/skills/brainstorm/SKILL.md +479 -0
  99. package/dist/templates/kiro/skills/break-loop/SKILL.md +130 -0
  100. package/dist/templates/kiro/skills/check-backend/SKILL.md +18 -0
  101. package/dist/templates/kiro/skills/check-cross-layer/SKILL.md +158 -0
  102. package/dist/templates/kiro/skills/check-frontend/SKILL.md +18 -0
  103. package/dist/templates/kiro/skills/create-command/SKILL.md +101 -0
  104. package/dist/templates/kiro/skills/finish-work/SKILL.md +148 -0
  105. package/dist/templates/kiro/skills/integrate-skill/SKILL.md +221 -0
  106. package/dist/templates/kiro/skills/onboard/SKILL.md +363 -0
  107. package/dist/templates/kiro/skills/record-session/SKILL.md +67 -0
  108. package/dist/templates/kiro/skills/start/SKILL.md +330 -0
  109. package/dist/templates/kiro/skills/update-spec/SKILL.md +335 -0
  110. package/dist/templates/opencode/agents/implement.md +1 -1
  111. package/dist/templates/opencode/agents/research.md +1 -2
  112. package/dist/templates/opencode/commands/trellis/brainstorm.md +16 -18
  113. package/dist/templates/opencode/commands/trellis/start.md +71 -48
  114. package/dist/templates/trellis/scripts/common/cli_adapter.py +100 -12
  115. package/dist/templates/trellis/scripts/common/registry.py +1 -1
  116. package/dist/templates/trellis/scripts/task.py +1 -8
  117. package/dist/types/ai-tools.d.ts +4 -4
  118. package/dist/types/ai-tools.d.ts.map +1 -1
  119. package/dist/types/ai-tools.js +32 -0
  120. package/dist/types/ai-tools.js.map +1 -1
  121. package/package.json +3 -2
@@ -0,0 +1,129 @@
1
+ description = "Deep bug analysis to break the fix-forget-repeat cycle"
2
+
3
+ prompt = """
4
+ # Break the Loop - Deep Bug Analysis
5
+
6
+ When debug is complete, use this command for deep analysis to break the "fix bug -> forget -> repeat" cycle.
7
+
8
+ ---
9
+
10
+ ## Analysis Framework
11
+
12
+ Analyze the bug you just fixed from these 5 dimensions:
13
+
14
+ ### 1. Root Cause Category
15
+
16
+ Which category does this bug belong to?
17
+
18
+ | Category | Characteristics | Example |
19
+ |----------|-----------------|---------|
20
+ | **A. Missing Spec** | No documentation on how to do it | New feature without checklist |
21
+ | **B. Cross-Layer Contract** | Interface between layers unclear | API returns different format than expected |
22
+ | **C. Change Propagation Failure** | Changed one place, missed others | Changed function signature, missed call sites |
23
+ | **D. Test Coverage Gap** | Unit test passes, integration fails | Works alone, breaks when combined |
24
+ | **E. Implicit Assumption** | Code relies on undocumented assumption | Timestamp seconds vs milliseconds |
25
+
26
+ ### 2. Why Fixes Failed (if applicable)
27
+
28
+ If you tried multiple fixes before succeeding, analyze each failure:
29
+
30
+ - **Surface Fix**: Fixed symptom, not root cause
31
+ - **Incomplete Scope**: Found root cause, didn't cover all cases
32
+ - **Tool Limitation**: grep missed it, type check wasn't strict
33
+ - **Mental Model**: Kept looking in same layer, didn't think cross-layer
34
+
35
+ ### 3. Prevention Mechanisms
36
+
37
+ What mechanisms would prevent this from happening again?
38
+
39
+ | Type | Description | Example |
40
+ |------|-------------|---------|
41
+ | **Documentation** | Write it down so people know | Update thinking guide |
42
+ | **Architecture** | Make the error impossible structurally | Type-safe wrappers |
43
+ | **Compile-time** | TypeScript strict, no any | Signature change causes compile error |
44
+ | **Runtime** | Monitoring, alerts, scans | Detect orphan entities |
45
+ | **Test Coverage** | E2E tests, integration tests | Verify full flow |
46
+ | **Code Review** | Checklist, PR template | "Did you check X?" |
47
+
48
+ ### 4. Systematic Expansion
49
+
50
+ What broader problems does this bug reveal?
51
+
52
+ - **Similar Issues**: Where else might this problem exist?
53
+ - **Design Flaw**: Is there a fundamental architecture issue?
54
+ - **Process Flaw**: Is there a development process improvement?
55
+ - **Knowledge Gap**: Is the team missing some understanding?
56
+
57
+ ### 5. Knowledge Capture
58
+
59
+ Solidify insights into the system:
60
+
61
+ - [ ] Update `.trellis/spec/guides/` thinking guides
62
+ - [ ] Update `.trellis/spec/backend/` or `frontend/` docs
63
+ - [ ] Create issue record (if applicable)
64
+ - [ ] Create feature ticket for root fix
65
+ - [ ] Update check commands if needed
66
+
67
+ ---
68
+
69
+ ## Output Format
70
+
71
+ Please output analysis in this format:
72
+
73
+ ```markdown
74
+ ## Bug Analysis: [Short Description]
75
+
76
+ ### 1. Root Cause Category
77
+ - **Category**: [A/B/C/D/E] - [Category Name]
78
+ - **Specific Cause**: [Detailed description]
79
+
80
+ ### 2. Why Fixes Failed (if applicable)
81
+ 1. [First attempt]: [Why it failed]
82
+ 2. [Second attempt]: [Why it failed]
83
+ ...
84
+
85
+ ### 3. Prevention Mechanisms
86
+ | Priority | Mechanism | Specific Action | Status |
87
+ |----------|-----------|-----------------|--------|
88
+ | P0 | ... | ... | TODO/DONE |
89
+
90
+ ### 4. Systematic Expansion
91
+ - **Similar Issues**: [List places with similar problems]
92
+ - **Design Improvement**: [Architecture-level suggestions]
93
+ - **Process Improvement**: [Development process suggestions]
94
+
95
+ ### 5. Knowledge Capture
96
+ - [ ] [Documents to update / tickets to create]
97
+ ```
98
+
99
+ ---
100
+
101
+ ## Core Philosophy
102
+
103
+ > **The value of debugging is not in fixing the bug, but in making this class of bugs never happen again.**
104
+
105
+ Three levels of insight:
106
+ 1. **Tactical**: How to fix THIS bug
107
+ 2. **Strategic**: How to prevent THIS CLASS of bugs
108
+ 3. **Philosophical**: How to expand thinking patterns
109
+
110
+ 30 minutes of analysis saves 30 hours of future debugging.
111
+
112
+ ---
113
+
114
+ ## After Analysis: Immediate Actions
115
+
116
+ **IMPORTANT**: After completing the analysis above, you MUST immediately:
117
+
118
+ 1. **Update spec/guides** - Don't just list TODOs, actually update the relevant files:
119
+ - If it's a cross-platform issue -> update `cross-platform-thinking-guide.md`
120
+ - If it's a cross-layer issue -> update `cross-layer-thinking-guide.md`
121
+ - If it's a code reuse issue -> update `code-reuse-thinking-guide.md`
122
+ - If it's domain-specific -> update `backend/*.md` or `frontend/*.md`
123
+
124
+ 2. **Sync templates** - After updating `.trellis/spec/`, sync to `src/templates/markdown/spec/`
125
+
126
+ 3. **Commit the spec updates** - This is the primary output, not just the analysis text
127
+
128
+ > **The analysis is worthless if it stays in chat. The value is in the updated specs.**
129
+ """
@@ -0,0 +1,17 @@
1
+ description = "Check if your code follows the backend development guidelines"
2
+
3
+ prompt = """
4
+ Check if the code you just wrote follows the backend development guidelines.
5
+
6
+ Execute these steps:
7
+ 1. Run `git status` to see modified files
8
+ 2. Read `.trellis/spec/backend/index.md` to understand which guidelines apply
9
+ 3. Based on what you changed, read the relevant guideline files:
10
+ - Database changes -> `.trellis/spec/backend/database-guidelines.md`
11
+ - Error handling -> `.trellis/spec/backend/error-handling.md`
12
+ - Logging changes -> `.trellis/spec/backend/logging-guidelines.md`
13
+ - Type changes -> `.trellis/spec/backend/type-safety.md`
14
+ - Any changes -> `.trellis/spec/backend/quality-guidelines.md`
15
+ 4. Review your code against the guidelines
16
+ 5. Report any violations and fix them if found
17
+ """
@@ -0,0 +1,147 @@
1
+ description = "Cross-layer verification check for multi-dimension changes"
2
+
3
+ prompt = """
4
+ # Cross-Layer Check
5
+
6
+ Check if your changes considered all dimensions. Most bugs come from "didn't think of it", not lack of technical skill.
7
+
8
+ > **Note**: This is a **post-implementation** safety net. Ideally, read the Pre-Implementation Checklist **before** writing code.
9
+
10
+ ---
11
+
12
+ ## Execution Steps
13
+
14
+ ### 1. Identify Change Scope
15
+
16
+ ```bash
17
+ git status
18
+ git diff --name-only
19
+ ```
20
+
21
+ ### 2. Select Applicable Check Dimensions
22
+
23
+ Based on your change type, execute relevant checks below:
24
+
25
+ ---
26
+
27
+ ## Dimension A: Cross-Layer Data Flow (Required when 3+ layers)
28
+
29
+ **Trigger**: Changes involve 3 or more layers
30
+
31
+ | Layer | Common Locations |
32
+ |-------|------------------|
33
+ | API/Routes | `routes/`, `api/`, `handlers/`, `controllers/` |
34
+ | Service/Business Logic | `services/`, `lib/`, `core/`, `domain/` |
35
+ | Database/Storage | `db/`, `models/`, `repositories/`, `schema/` |
36
+ | UI/Presentation | `components/`, `views/`, `templates/`, `pages/` |
37
+ | Utility | `utils/`, `helpers/`, `common/` |
38
+
39
+ **Checklist**:
40
+ - [ ] Read flow: Database -> Service -> API -> UI
41
+ - [ ] Write flow: UI -> API -> Service -> Database
42
+ - [ ] Types/schemas correctly passed between layers?
43
+ - [ ] Errors properly propagated to caller?
44
+ - [ ] Loading/pending states handled at each layer?
45
+
46
+ **Detailed Guide**: `.trellis/spec/guides/cross-layer-thinking-guide.md`
47
+
48
+ ---
49
+
50
+ ## Dimension B: Code Reuse (Required when modifying constants/config)
51
+
52
+ **Trigger**:
53
+ - Modifying UI constants (label, icon, color)
54
+ - Modifying any hardcoded value
55
+ - Seeing similar code in multiple places
56
+ - Creating a new utility/helper function
57
+ - Just finished batch modifications across files
58
+
59
+ **Checklist**:
60
+ - [ ] Search first: How many places define this value?
61
+ ```bash
62
+ # Search in source files (adjust extensions for your project)
63
+ grep -r "value-to-change" src/
64
+ ```
65
+ - [ ] If 2+ places define same value -> Should extract to shared constant
66
+ - [ ] After modification, all usage sites updated?
67
+ - [ ] If creating utility: Does similar utility already exist?
68
+
69
+ **Detailed Guide**: `.trellis/spec/guides/code-reuse-thinking-guide.md`
70
+
71
+ ---
72
+
73
+ ## Dimension B2: New Utility Functions
74
+
75
+ **Trigger**: About to create a new utility/helper function
76
+
77
+ **Checklist**:
78
+ - [ ] Search for existing similar utilities first
79
+ ```bash
80
+ grep -r "functionNamePattern" src/
81
+ ```
82
+ - [ ] If similar exists, can you extend it instead?
83
+ - [ ] If creating new, is it in the right location (shared vs domain-specific)?
84
+
85
+ ---
86
+
87
+ ## Dimension B3: After Batch Modifications
88
+
89
+ **Trigger**: Just modified similar patterns in multiple files
90
+
91
+ **Checklist**:
92
+ - [ ] Did you check ALL files with similar patterns?
93
+ ```bash
94
+ grep -r "patternYouChanged" src/
95
+ ```
96
+ - [ ] Any files missed that should also be updated?
97
+ - [ ] Should this pattern be abstracted to prevent future duplication?
98
+
99
+ ---
100
+
101
+ ## Dimension C: Import/Dependency Paths (Required when creating new files)
102
+
103
+ **Trigger**: Creating new source files
104
+
105
+ **Checklist**:
106
+ - [ ] Using correct import paths (relative vs absolute)?
107
+ - [ ] No circular dependencies?
108
+ - [ ] Consistent with project's module organization?
109
+
110
+ ---
111
+
112
+ ## Dimension D: Same-Layer Consistency
113
+
114
+ **Trigger**:
115
+ - Modifying display logic or formatting
116
+ - Same domain concept used in multiple places
117
+
118
+ **Checklist**:
119
+ - [ ] Search for other places using same concept
120
+ ```bash
121
+ grep -r "ConceptName" src/
122
+ ```
123
+ - [ ] Are these usages consistent?
124
+ - [ ] Should they share configuration/constants?
125
+
126
+ ---
127
+
128
+ ## Common Issues Quick Reference
129
+
130
+ | Issue | Root Cause | Prevention |
131
+ |-------|------------|------------|
132
+ | Changed one place, missed others | Didn't search impact scope | `grep` before changing |
133
+ | Data lost at some layer | Didn't check data flow | Trace data source to destination |
134
+ | Type/schema mismatch | Cross-layer types inconsistent | Use shared type definitions |
135
+ | UI/output inconsistent | Same concept in multiple places | Extract shared constants |
136
+ | Similar utility exists | Didn't search first | Search before creating |
137
+ | Batch fix incomplete | Didn't verify all occurrences | grep after fixing |
138
+
139
+ ---
140
+
141
+ ## Output
142
+
143
+ Report:
144
+ 1. Which dimensions your changes involve
145
+ 2. Check results for each dimension
146
+ 3. Issues found and fix suggestions
147
+ """
@@ -0,0 +1,17 @@
1
+ description = "Check if your code follows the frontend development guidelines"
2
+
3
+ prompt = """
4
+ Check if the code you just wrote follows the frontend development guidelines.
5
+
6
+ Execute these steps:
7
+ 1. Run `git status` to see modified files
8
+ 2. Read `.trellis/spec/frontend/index.md` to understand which guidelines apply
9
+ 3. Based on what you changed, read the relevant guideline files:
10
+ - Component changes -> `.trellis/spec/frontend/component-guidelines.md`
11
+ - Hook changes -> `.trellis/spec/frontend/hook-guidelines.md`
12
+ - State changes -> `.trellis/spec/frontend/state-management.md`
13
+ - Type changes -> `.trellis/spec/frontend/type-safety.md`
14
+ - Any changes -> `.trellis/spec/frontend/quality-guidelines.md`
15
+ 4. Review your code against the guidelines
16
+ 5. Report any violations and fix them if found
17
+ """
@@ -0,0 +1,119 @@
1
+ description = "Create a new slash command in the Gemini CLI commands directory"
2
+
3
+ prompt = """
4
+ # Create New Slash Command
5
+
6
+ Create a new slash command in `.gemini/commands/trellis/` directory based on user requirements.
7
+
8
+ ## Usage
9
+
10
+ ```
11
+ /trellis:create-command <command-name> <description>
12
+ ```
13
+
14
+ **Example**:
15
+ ```
16
+ /trellis:create-command review-pr Check PR code changes against project guidelines
17
+ ```
18
+
19
+ ## Execution Steps
20
+
21
+ ### 1. Parse Input
22
+
23
+ Extract from user input:
24
+ - **Command name**: Use kebab-case (e.g., `review-pr`)
25
+ - **Description**: What the command should accomplish
26
+
27
+ ### 2. Analyze Requirements
28
+
29
+ Determine command type based on description:
30
+ - **Initialization**: Read docs, establish context
31
+ - **Pre-development**: Read guidelines, check dependencies
32
+ - **Code check**: Validate code quality and guideline compliance
33
+ - **Recording**: Record progress, questions, structure changes
34
+ - **Generation**: Generate docs, code templates
35
+
36
+ ### 3. Generate Command Content
37
+
38
+ Based on command type, generate appropriate TOML content:
39
+
40
+ **Simple command**:
41
+ ```toml
42
+ description = "Short description"
43
+
44
+ prompt = \"\"\"
45
+ Concise instruction describing what to do
46
+ \"\"\"
47
+ ```
48
+
49
+ **Complex command** (with steps):
50
+ ```toml
51
+ description = "Short description"
52
+
53
+ prompt = \"\"\"
54
+ # Command Title
55
+
56
+ Command description
57
+
58
+ ## Steps
59
+
60
+ ### 1. First Step
61
+ Specific action
62
+
63
+ ### 2. Second Step
64
+ Specific action
65
+
66
+ ## Output Format (if needed)
67
+
68
+ Template
69
+ \"\"\"
70
+ ```
71
+
72
+ ### 4. Create File
73
+
74
+ Create the TOML file:
75
+ - `.gemini/commands/trellis/<command-name>.toml`
76
+
77
+ ### 5. Confirm Creation
78
+
79
+ Output result:
80
+ ```
81
+ [OK] Created Slash Command: /trellis:<command-name>
82
+
83
+ File path:
84
+ - .gemini/commands/trellis/<command-name>.toml
85
+
86
+ Usage:
87
+ /trellis:<command-name>
88
+
89
+ Description:
90
+ <description>
91
+ ```
92
+
93
+ ## Command Content Guidelines
94
+
95
+ ### [OK] Good command content
96
+
97
+ 1. **Clear and concise**: Immediately understandable
98
+ 2. **Executable**: AI can follow steps directly
99
+ 3. **Well-scoped**: Clear boundaries of what to do and not do
100
+ 4. **Has output**: Specifies expected output format (if needed)
101
+
102
+ ### [X] Avoid
103
+
104
+ 1. **Too vague**: e.g., "optimize code"
105
+ 2. **Too complex**: Single command should not exceed 100 lines
106
+ 3. **Duplicate functionality**: Check if similar command exists first
107
+
108
+ ## Naming Conventions
109
+
110
+ | Command Type | Prefix | Example |
111
+ |--------------|--------|---------|
112
+ | Session Start | `start` | `start` |
113
+ | Pre-development | `before-` | `before-frontend-dev` |
114
+ | Check | `check-` | `check-frontend` |
115
+ | Record | `record-` | `record-session` |
116
+ | Generate | `generate-` | `generate-api-doc` |
117
+ | Update | `update-` | `update-changelog` |
118
+ | Other | Verb-first | `review-code`, `sync-data` |
119
+ """
@@ -0,0 +1,133 @@
1
+ description = "Pre-commit checklist to ensure work completeness before submitting"
2
+
3
+ prompt = """
4
+ # Finish Work - Pre-Commit Checklist
5
+
6
+ Before submitting or committing, use this checklist to ensure work completeness.
7
+
8
+ **Timing**: After code is written and tested, before commit
9
+
10
+ ---
11
+
12
+ ## Checklist
13
+
14
+ ### 1. Code Quality
15
+
16
+ ```bash
17
+ # Must pass
18
+ pnpm lint
19
+ pnpm type-check
20
+ pnpm test
21
+ ```
22
+
23
+ - [ ] `pnpm lint` passes with 0 errors?
24
+ - [ ] `pnpm type-check` passes with no type errors?
25
+ - [ ] Tests pass?
26
+ - [ ] No `console.log` statements (use logger)?
27
+ - [ ] No non-null assertions (the `x!` operator)?
28
+ - [ ] No `any` types?
29
+
30
+ ### 2. Documentation Sync
31
+
32
+ **Structure Docs**:
33
+ - [ ] Does `.trellis/spec/backend/` need updates?
34
+ - New patterns, new modules, new conventions
35
+ - [ ] Does `.trellis/spec/frontend/` need updates?
36
+ - New components, new hooks, new patterns
37
+ - [ ] Does `.trellis/spec/guides/` need updates?
38
+ - New cross-layer flows, lessons from bugs
39
+
40
+ **Key Question**:
41
+ > "If I fixed a bug or discovered something non-obvious, should I document it so future me (or others) won't hit the same issue?"
42
+
43
+ If YES -> Update the relevant spec doc.
44
+
45
+ ### 3. API Changes
46
+
47
+ If you modified API endpoints:
48
+
49
+ - [ ] Input schema updated?
50
+ - [ ] Output schema updated?
51
+ - [ ] API documentation updated?
52
+ - [ ] Client code updated to match?
53
+
54
+ ### 4. Database Changes
55
+
56
+ If you modified database schema:
57
+
58
+ - [ ] Migration file created?
59
+ - [ ] Schema file updated?
60
+ - [ ] Related queries updated?
61
+ - [ ] Seed data updated (if applicable)?
62
+
63
+ ### 5. Cross-Layer Verification
64
+
65
+ If the change spans multiple layers:
66
+
67
+ - [ ] Data flows correctly through all layers?
68
+ - [ ] Error handling works at each boundary?
69
+ - [ ] Types are consistent across layers?
70
+ - [ ] Loading states handled?
71
+
72
+ ### 6. Manual Testing
73
+
74
+ - [ ] Feature works in browser/app?
75
+ - [ ] Edge cases tested?
76
+ - [ ] Error states tested?
77
+ - [ ] Works after page refresh?
78
+
79
+ ---
80
+
81
+ ## Quick Check Flow
82
+
83
+ ```bash
84
+ # 1. Code checks
85
+ pnpm lint && pnpm type-check
86
+
87
+ # 2. View changes
88
+ git status
89
+ git diff --name-only
90
+
91
+ # 3. Based on changed files, check relevant items above
92
+ ```
93
+
94
+ ---
95
+
96
+ ## Common Oversights
97
+
98
+ | Oversight | Consequence | Check |
99
+ |-----------|-------------|-------|
100
+ | Structure docs not updated | Others don't know the change | Check .trellis/spec/ |
101
+ | Migration not created | Schema out of sync | Check db/migrations/ |
102
+ | Types not synced | Runtime errors | Check shared types |
103
+ | Tests not updated | False confidence | Run full test suite |
104
+ | Console.log left in | Noisy production logs | Search for console.log |
105
+
106
+ ---
107
+
108
+ ## Relationship to Other Commands
109
+
110
+ ```
111
+ Development Flow:
112
+ Write code -> Test -> /trellis:finish-work -> git commit -> /trellis:record-session
113
+ | |
114
+ Ensure completeness Record progress
115
+
116
+ Debug Flow:
117
+ Hit bug -> Fix -> /trellis:break-loop -> Knowledge capture
118
+ |
119
+ Deep analysis
120
+ ```
121
+
122
+ - `/trellis:finish-work` - Check work completeness (this command)
123
+ - `/trellis:record-session` - Record session and commits
124
+ - `/trellis:break-loop` - Deep analysis after debugging
125
+
126
+ ---
127
+
128
+ ## Core Principle
129
+
130
+ > **Delivery includes not just code, but also documentation, verification, and knowledge capture.**
131
+
132
+ Complete work = Code + Docs + Tests + Verification
133
+ """
@@ -0,0 +1,104 @@
1
+ description = "Adapt and integrate an external skill into project development guidelines"
2
+
3
+ prompt = """
4
+ # Integrate Skill into Project Guidelines
5
+
6
+ Adapt and integrate an external skill into your project's development guidelines (not directly into project code).
7
+
8
+ ## Usage
9
+
10
+ ```
11
+ /trellis:integrate-skill <skill-name>
12
+ ```
13
+
14
+ **Examples**:
15
+ ```
16
+ /trellis:integrate-skill frontend-design
17
+ /trellis:integrate-skill mcp-builder
18
+ ```
19
+
20
+ ## Core Principle
21
+
22
+ > [!] **Important**: The goal of skill integration is to update **development guidelines**, not to generate project code directly.
23
+ >
24
+ > - Guidelines content -> Write to `.trellis/spec/{target}/doc.md`
25
+ > - Code examples -> Place in `.trellis/spec/{target}/examples/skills/<skill-name>/`
26
+ > - Example files -> Use `.template` suffix (e.g., `component.tsx.template`) to avoid IDE errors
27
+ >
28
+ > Where `{target}` is `frontend` or `backend`, determined by skill type.
29
+
30
+ ## Execution Steps
31
+
32
+ ### 1. Read Skill Content
33
+
34
+ Locate and read the skill definition. If the skill doesn't exist, prompt user to check available skills.
35
+
36
+ ### 2. Determine Integration Target
37
+
38
+ Based on skill type, determine which guidelines to update:
39
+
40
+ | Skill Category | Integration Target |
41
+ |----------------|-------------------|
42
+ | UI/Frontend (`frontend-design`, `web-artifacts-builder`) | `.trellis/spec/frontend/` |
43
+ | Backend/API (`mcp-builder`) | `.trellis/spec/backend/` |
44
+ | Documentation (`doc-coauthoring`, `docx`, `pdf`) | `.trellis/` or create dedicated guidelines |
45
+ | Testing (`webapp-testing`) | `.trellis/spec/frontend/` (E2E) |
46
+
47
+ ### 3. Analyze Skill Content
48
+
49
+ Extract from the skill:
50
+ - **Core concepts**: How the skill works and key concepts
51
+ - **Best practices**: Recommended approaches
52
+ - **Code patterns**: Reusable code templates
53
+ - **Caveats**: Common issues and solutions
54
+
55
+ ### 4. Execute Integration
56
+
57
+ #### 4.1 Update Guidelines Document
58
+
59
+ Add a new section to the corresponding `doc.md`.
60
+
61
+ #### 4.2 Create Examples Directory (if code examples exist)
62
+
63
+ ```bash
64
+ # Directory structure ({target} = frontend or backend)
65
+ .trellis/spec/{target}/
66
+ |-- doc.md # Add skill-related section
67
+ |-- index.md # Update index
68
+ +-- examples/
69
+ +-- skills/
70
+ +-- <skill-name>/
71
+ |-- README.md # Example documentation
72
+ |-- example-1.ts.template # Code example (use .template suffix)
73
+ +-- example-2.tsx.template
74
+ ```
75
+
76
+ **File naming conventions**:
77
+ - Code files: `<name>.<ext>.template` (e.g., `component.tsx.template`)
78
+ - Config files: `<name>.config.template` (e.g., `tailwind.config.template`)
79
+ - Documentation: `README.md` (normal suffix)
80
+
81
+ #### 4.3 Update Index File
82
+
83
+ Add to the Quick Navigation table in `index.md`.
84
+
85
+ ### 5. Generate Integration Report
86
+
87
+ Report:
88
+ - Skill description and integration target
89
+ - Tech stack compatibility
90
+ - Integration locations (files modified)
91
+ - Dependencies needed (if any)
92
+ - Completed changes checklist
93
+
94
+ ---
95
+
96
+ ## Common Skill Integration Reference
97
+
98
+ | Skill | Integration Target | Examples Directory |
99
+ |-------|-------------------|-------------------|
100
+ | `frontend-design` | `frontend` | `examples/skills/frontend-design/` |
101
+ | `mcp-builder` | `backend` | `examples/skills/mcp-builder/` |
102
+ | `webapp-testing` | `frontend` | `examples/skills/webapp-testing/` |
103
+ | `doc-coauthoring` | `.trellis/` | N/A (documentation workflow only) |
104
+ """