-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Labels
ai-generateddocumentationImprovements or additions to documentationImprovements or additions to documentationplan
Description
Objective
Update developer documentation to reflect the new type patterns and provide guidance on when to use different typing approaches in the codebase.
Context
The Typist analysis identified both good patterns to follow and appropriate uses of any. Documentation should:
- Explain when to use semantic type aliases (like
FeatureFlag,LineLength) - Clarify when
map[string]anyis appropriate (dynamic YAML/JSON) - Document the new
ValidatableToolinterface pattern - Provide guidelines to prevent future type name collisions
Implementation Steps
-
Update
AGENTS.mdDeveloper Instructions section:- Add section on "Type Patterns and Best Practices"
- Document semantic type aliases pattern
- Explain appropriate uses of
anytypes - Add guidelines for avoiding type name collisions
-
Create or update
specs/go-type-patterns.md:- Document
ValidatableToolinterface pattern - Explain
FeatureFlagtype alias pattern - Show examples of when to use each approach
- Include anti-patterns (what NOT to do)
- Document
-
Add inline code documentation:
- Document
ValidatableToolinterface with usage examples - Document
FeatureFlagtype with usage examples - Add comments explaining why
map[string]anyis used for YAML parsing
- Document
Files to Create/Modify
AGENTS.md- Add type patterns sectionspecs/go-type-patterns.md(new) - Detailed type pattern guidepkg/workflow/permissions_validator.go- Add interface documentationpkg/constants/constants.go- Add type alias documentation
Acceptance Criteria
- Developer documentation updated with type patterns
- New spec file created with detailed guidance
- Interface and type aliases have clear documentation
- Examples show both correct and incorrect usage
- Guidelines prevent future type collisions
- Documentation reviewed for clarity
Estimated Effort
1 hour
Priority
Low-Medium - Important for maintainability and future contributors
Dependencies
Should be completed last, after all code changes are finalized
Related to #6836
AI generated by Plan Command for discussion #6829
Copilot
Metadata
Metadata
Labels
ai-generateddocumentationImprovements or additions to documentationImprovements or additions to documentationplan