|
| 1 | +--- |
| 2 | +trigger: always_on |
| 3 | +--- |
| 4 | + |
| 5 | +Tusk Architecture Philosophy |
| 6 | + |
| 7 | +Tusk should feel like Go, not like Laravel, Spring Boot, or ASP.NET. |
| 8 | + |
| 9 | +Every package should have one clear responsibility. |
| 10 | + |
| 11 | +Every module should own its business domain. |
| 12 | + |
| 13 | +Avoid deep abstractions. |
| 14 | + |
| 15 | +Avoid framework magic. |
| 16 | + |
| 17 | +Avoid hidden behavior. |
| 18 | + |
| 19 | +Avoid reflection unless absolutely necessary. |
| 20 | + |
| 21 | +Avoid code generation unless it clearly improves developer experience. |
| 22 | + |
| 23 | +Every dependency should be visible in constructors. |
| 24 | + |
| 25 | +Use dependency injection through constructors. |
| 26 | + |
| 27 | +Keep APIs small. |
| 28 | + |
| 29 | +Keep exported APIs intentional. |
| 30 | + |
| 31 | +Write code that is obvious to read. |
| 32 | + |
| 33 | +If a design becomes difficult to explain, it is probably too complicated. |
| 34 | + |
| 35 | +Prefer standard library solutions over third-party packages unless the package provides significant value. |
| 36 | + |
| 37 | +The framework should teach good Go by example. |
| 38 | + |
| 39 | +Whenever you improve my code: |
| 40 | + |
| 41 | +Do not only rewrite it. |
| 42 | + |
| 43 | +Explain: |
| 44 | + |
| 45 | +- why the original design was less idiomatic |
| 46 | +- why the new design is preferred |
| 47 | +- what Go principle it follows |
| 48 | +- whether the change improves readability, simplicity, testing, or maintainability |
| 49 | + |
| 50 | +Assume I am learning advanced Go architecture. |
| 51 | + |
| 52 | +Prioritize helping me become a better Go engineer over simply producing code. |
| 53 | + |
| 54 | +Before introducing any abstraction, ask: |
| 55 | + |
| 56 | +- Does this abstraction reduce complexity? |
| 57 | +- Or does it merely hide complexity? |
| 58 | + |
| 59 | +Avoid abstractions that exist only for future possibilities. |
| 60 | + |
| 61 | +Follow the Go principle: |
| 62 | + |
| 63 | +"A little copying is better than a little dependency." |
| 64 | + |
| 65 | +Prefer duplication over premature abstraction when it leads to simpler, more readable code. |
0 commit comments