Skip to content

Add package API surface rule and skill guidance#4578

Merged
jerm-dro merged 3 commits intomainfrom
jerm-dro/skill-and-rule-updates
Apr 7, 2026
Merged

Add package API surface rule and skill guidance#4578
jerm-dro merged 3 commits intomainfrom
jerm-dro/skill-and-rule-updates

Conversation

@jerm-dro
Copy link
Copy Markdown
Contributor

@jerm-dro jerm-dro commented Apr 6, 2026

Summary

Lessons from implementing #4551 (rate limiting) surfaced gaps in our
Go style rules, operator rules, and implement-story skill that led to
avoidable review friction.

  • Go style: New "Package API Surface" rule — packages should expose
    interfaces, result types, and constructors. Start without intermediate
    config types; introduce them when a concrete need arises. Public
    functions are a smell when they just convert external types to
    internal state.
  • Operator rules: CRD duration fields should use metav1.Duration
    (standard Kubernetes convention with built-in OpenAPI support), not
    string or integer seconds.
  • Skill planning: Present the high-level PR split first and get
    alignment before detailing each PR. Plan subsequent PRs after the
    previous PR's CI is green, not all upfront.
  • Skill implementation: Core domain logic can ship standalone, but
    integration concerns (protocol adapters, middleware glue) should
    ship alongside their consumers. Don't add config fields or CRD
    attributes for explicitly out-of-scope functionality.

Type of change

  • Documentation

Test plan

  • Manual testing (describe below)

Verified rules and skill files parse correctly. No code changes.

Generated with Claude Code

Add Go style rule for package API surface: prefer interfaces,
constructors, and result types over public intermediate config types.
Start without extra types and introduce them when a concrete need
arises.

Update implement-story skill with three improvements:
- Present high-level PR split first, then enter plan mode for each PR's
  details (plan subsequent PRs after previous PR's CI is green)
- Core domain logic can be introduced standalone, but integration
  concerns should ship alongside their consumers
- Don't add config fields or CRD attributes for out-of-scope
  functionality, even to prepare for sibling stories

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Apr 6, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.87%. Comparing base (8c70343) to head (13f105a).
⚠️ Report is 20 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4578      +/-   ##
==========================================
- Coverage   68.87%   68.87%   -0.01%     
==========================================
  Files         505      505              
  Lines       52380    52380              
==========================================
- Hits        36076    36075       -1     
+ Misses      13516    13515       -1     
- Partials     2788     2790       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

jerm-dro and others added 2 commits April 6, 2026 17:05
Plans presented by agents must be checked against all applicable
.claude/rules/ files to catch convention violations early, before
code is written.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CRD types should use metav1.Duration for duration fields instead of
string or integer seconds. This is the standard Kubernetes convention
and has built-in OpenAPI schema support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions github-actions bot added size/XS Extra small PR: < 100 lines changed and removed size/XS Extra small PR: < 100 lines changed labels Apr 7, 2026
@jerm-dro jerm-dro merged commit 4bb35be into main Apr 7, 2026
38 checks passed
@jerm-dro jerm-dro deleted the jerm-dro/skill-and-rule-updates branch April 7, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants