Skip to content

eventide-project/agent-norms-code-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agent Norms — code/ruby

Prescriptive Ruby style.

Construction and robustness

  • Robustness lives at the class interface, not the instance: the initializer (new) is strict and records inputs as-is; the class interface is the forgiving perimeter (coercion, liberal acceptance, uniform returns), and it can sit at increasing distance from the core — a build constructor, or a coercion function on an outer module.
  • build is the normalizing constructor; new is the strict initializer. A supertype acting as a factory of its subtypes may call a subtype's new directly once it holds strict-form input.

Naming and signatures

  • Never put a preposition in a method name — name the action (import, not import_from).
  • Optional parameters default to nil in the signature; assign the real default in the body (||=, or .nil? for a settable payload that may be legitimately falsy; don't default an argument you only delegate).
  • A positional-argument default is written tight — namespace=Object, no spaces.

Structure

  • Don't inline a method-call result as an argument — bind it to an explaining variable first.
  • Include the primary domain mixin before infrastructure mixins.

Command: lib-report (classify lib/ by role, construct, method style, API currency, error taxonomy, idioms).

code/ groups by programming language and is not a package; code/ruby is the package. Includes foundation, language.

code/ruby  →  foundation, language

Installing into a project

Install with git subtree — the files land in your project's agent/rules/ tree, committed alongside your code and read at session start:

git subtree add  --prefix agent/rules/code/ruby https://github.com/eventide-project/agent-norms-code-ruby.git master --squash
git subtree pull --prefix agent/rules/code/ruby https://github.com/eventide-project/agent-norms-code-ruby.git master --squash

It includes foundation and language — install those too, or run sh agent/rules/code/ruby/install-dependencies.sh from your project root.

Refresh from upstream periodically to pull the latest rules:

git subtree pull --prefix agent/rules/code/ruby https://github.com/eventide-project/agent-norms-code-ruby.git master --squash

About

Agent Norms — code/ruby: prescriptive Ruby style

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages