

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
123456# Go Coding Standards78<role>9You are an expert in Go, microservices architecture, and clean backend development practices. Your role is to ensure code is idiomatic, modular, testable, and aligned with Compozy's established patterns and best practices.10</role>1112## Project Structure and Organization1314- Group code by feature/domain when appropriate (agent, task, tool, workflow)15- Keep package names simple and descriptive16- Follow the established pattern of separating interfaces from implementations1718## Code Style and Standards1920<limits type="mandatory">21- Adhere to Go's official style guide and the project's `.golangci.yml` configuration22- Function length should not exceed 30 lines for business logic23- Line length should not exceed 120 characters24- Cyclomatic complexity should be kept below 1025</limits>2627<documentation_policy>28- **DON'T ADD** comments to explain code changes - explanation belongs in text responses29- Only add code comments when user explicitly requests them or code is complex and requires context for future developers30</documentation_policy>3132## Error Handling3334<unified_strategy type="mandatory">35**UNIFIED ERROR HANDLING STRATEGY - SINGLE SOURCE OF TRUTH**36371. **Internal Error Propagation (within domains):**38 - Use `fmt.Errorf()` for all internal error propagation within a domain39 - Always wrap errors with context: `fmt.Errorf("failed to load user: %w", err)`40 - This keeps internal code simple and avoids unnecessary abstraction41422. **Domain Boundaries (public service methods):**43 - Use `core.NewError()` ONLY when returning errors from public service methods44 - These are the methods exposed to other domains or external consumers45 - Provides structured error information for cross-domain communication46473. **Always Required:**48 - Check and handle errors explicitly - never ignore errors49 - Return early on errors to avoid deep nesting50 - Avoid naked returns in longer functions (as enforced by nakedret linter)51</unified_strategy>5253<examples type="implementation">54```go55// ✅ INTERNAL: Use fmt.Errorf within domain56func (s *userService) validateUser(ctx context.Context, user *User) error {57 if user.Email == "" {58 return fmt.Errorf("email is required")59 }60 if err := s.repo.CheckEmailExists(ctx, user.Email); err != nil {61 return fmt.Errorf("failed to check email existence: %w", err)62 }63 return nil64}6566// ✅ DOMAIN BOUNDARY: Use core.NewError for public methods67func (s *userService) CreateUser(ctx context.Context, req CreateUserRequest) (*User, error) {68 user := &User{Email: req.Email, Name: req.Name}69 if err := s.validateUser(ctx, user); err != nil {70 return nil, core.NewError(err, "USER_VALIDATION_FAILED", map[string]any{71 "email": req.Email,72 })73 }74 // ... rest of implementation using fmt.Errorf internally75}76```77</examples>7879<pattern type="transaction">80```go81defer func() {82 if err != nil { tx.Rollback(ctx) } else { tx.Commit(ctx) }83}()84```85</pattern>8687## Dependencies and Interfaces8889- Prefer explicit dependency injection through constructor functions90- Use interfaces to define behavior and enable testing9192<pattern type="interface_implementation">93```go94// Define interface95type Service interface {96 DoSomething(ctx context.Context, param string) error97}9899// Implement interface100type ServiceImpl struct {101 dependency Dependency102}103104// Constructor function105func NewService(dependency Dependency) Service {106 return &serviceImpl{107 dependency: dependency,108 }109}110```111</pattern>112113## Context and Concurrency114115<requirements type="context">116- Use `context.Context` for request-scoped values, deadlines, and cancellations117- Pass context as the first parameter to functions that make external calls118- Use the noctx linter to enforce context propagation119- Ensure goroutines are properly managed and cleaned up120</requirements>121
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| compozy/gograph.cursor/rules/architecture.mdc · 9 | Cursor rules | styletesting-strategydependenciesdo-not | 57/100 | 14 days ago | |
| compozy/gograph.cursor/rules/api-standards.mdc · 9 | Cursor rules | lint-formatapidocs | 54/100 | 14 days ago | |
| compozy/gograph.cursor/rules/backwards-compatibility.mdc · 9 | Cursor rules | do-notagent-behaviour | 32/100 | 14 days ago | |
| compozy/gograph.cursor/rules/compozy-agent-config.mdc · 9 | Cursor rules | agent-behaviour | 45/100 | 14 days ago | |
| compozy/gograph.cursor/rules/compozy-examples.mdc · 9 | Cursor rules | stylearchtypesagent-behaviour | 58/100 | 14 days ago | |
| compozy/gograph.cursor/rules/compozy-project-config.mdc · 9 | Cursor rules | setupstyle | 54/100 | 14 days ago | |
| compozy/gograph.cursor/rules/compozy-shared-patterns.mdc · 9 | Cursor rules | styleagent-behaviour | 54/100 | 14 days ago | |
| compozy/gograph.cursor/rules/compozy-task-patterns.mdc · 9 | Cursor rules | stylearchagent-behaviour | 70/100 | 14 days ago | |
| compozy/gograph.cursor/rules/core-libraries.mdc · 9 | Cursor rules | testing-strategydependenciesdo-not | 60/100 | 14 days ago | |
| compozy/gograph.cursor/rules/critical-validation.mdc · 9 | Cursor rules | no sections | 24/100 | 14 days ago | |
| compozy/gograph.cursor/rules/cursor_rules.mdc · 9 | Cursor rules | no sections | 40/100 | 14 days ago | |
| compozy/gograph.cursor/rules/go-patterns.mdc · 9 | Cursor rules | style | 66/100 | 14 days ago | |
| compozy/gograph.cursor/rules/no_linebreaks.mdc · 9 | Cursor rules | no sections | 31/100 | 14 days ago | |
| compozy/gograph.cursor/rules/prd-create.mdc · 9 | Cursor rules | stylearchagent-behaviour | 48/100 | 14 days ago | |
| compozy/gograph.cursor/rules/prd-tech-spec.mdc · 9 | Cursor rules | setuptestarchagent-behaviour | 56/100 | 14 days ago | |
| compozy/gograph.cursor/rules/quality-security.mdc · 9 | Cursor rules | securityperformancedo-not | 46/100 | 14 days ago | |
| compozy/gograph.cursor/rules/review-checklist.mdc · 9 | Cursor rules | testing-strategygit | 52/100 | 14 days ago | |
| compozy/gograph.cursor/rules/section_comments.mdc · 9 | Cursor rules | no sections | 31/100 | 14 days ago | |
| compozy/gograph.cursor/rules/task-developing.mdc · 9 | Cursor rules | agent-behaviour | 47/100 | 14 days ago | |
| compozy/gograph.cursor/rules/task-generate-list.mdc · 9 | Cursor rules | testlint-formatarchdo-not+1 | 85/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 46 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 14 days ago | |
| dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| deifos/clipmira-subtitles.cursor/rules/frontend.mdc · 1 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| markstev/mark-starter.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+6 | 99/100 | 14 days ago | |
| Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0 | Cursor rules | setuptestlint-formatstyle+7 | 99/100 | 14 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 14 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 46 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/compozy-gograph-cursor-rules-go-coding-standards)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.