[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7DH34BYG9894F1T0D7KKWP8":3,"skill-same:01M7DH34BYG9894F1T0D7KKWP8":64},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7DH34BYG9894F1T0D7KKWP8","simplifying-ruby-code",null,"Rewrites over-engineered Ruby and Rails classes (stateless service objects, behaviorless value objects, class-method-only classes, deep inheritance, needless metaprogramming) as Data, Struct, Hash, modules, or pure functions, after finding every caller and getting a green test baseline, or reports findings when asked to review. Use when the user says \"simplify this Ruby\", or when asked to refactor, simplify, review, or cut boilerplate from a Ruby or Rails class, value object, service object, gem, or branch diff (hand-written initialize, readers, ==, eql?, or hash; call-only classes; Struct vs Data), or when tests need heavy mocking. Not for a broad Rails tech-debt audit; use auditing-rails-tech-debt.","bostonaholic\u002Fskills","bostonaholic","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F362146?v=4","01M7DGVW4NA3AZAS7ZVN59FFTR","Matthew Boston","01M7DGVW56TS63D9MTAPRW8SCT",2,"MIT","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fengineering\u002Fsimplifying-ruby-code\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: simplifying-ruby-code\ndescription: Rewrites over-engineered Ruby and Rails classes (stateless service objects, behaviorless value objects, class-method-only classes, deep inheritance, needless metaprogramming) as Data, Struct, Hash, modules, or pure functions, after finding every caller and getting a green test baseline, or reports findings when asked to review. Use when the user says \"simplify this Ruby\", or when asked to refactor, simplify, review, or cut boilerplate from a Ruby or Rails class, value object, service object, gem, or branch diff (hand-written initialize, readers, ==, eql?, or hash; call-only classes; Struct vs Data), or when tests need heavy mocking. Not for a broad Rails tech-debt audit; use auditing-rails-tech-debt.\n---\n\n# Simplifying Ruby Code\n\nPrefer plain data (Hash, Array, Struct, Data) and pure functions over classes\nthat add no state or behavior. Separate decisions from effects: a decision\ntakes data and returns data; an effect does I\u002FO (database, network, files,\ntime). Keep them in separate methods or modules so decisions test without\nmocks.\n\nWhen the user asks for a review, report findings and edit nothing unless\nthey ask. Cite patterns by number (\"Pattern 1\") or by anti-pattern name.\n\n## Patterns\n\n1. **Command objects to module functions.** A class whose only public\n   method is `call`, `perform`, `run`, or `execute`, holding nothing beyond\n   its constructor arguments, becomes a direct call or a module function\n   (`UserCreator.new(params).call` becomes `User.create(params)`). Keep the\n   object when it holds state across calls, runs a multi-step algorithm\n   worth naming, or must be serialized, as a background job is.\n2. **Value objects to Data, Struct, or Hash.** A class that only stores\n   attributes, with hand-written `initialize`, readers, or `==` and no\n   behavior or validation:\n\n   | Use          | When                                                 |\n   | ------------ | ---------------------------------------------------- |\n   | Hash         | Transient data, varying keys, JSON in or out         |\n   | Struct       | Fixed attributes, mutation acceptable                |\n   | Data         | Fixed attributes, immutable (check `ruby -v` >= 3.2) |\n   | Custom class | Validation, invariants, or real domain behavior      |\n\n3. **Class-method-only classes to modules.** A class never instantiated,\n   defining only `self.` methods, becomes a module with `module_function`.\n4. **Deep inheritance to composition.** More than 2 levels counting only the\n   project's own classes (framework and stdlib bases such as\n   `ApplicationRecord` or `StandardError` do not count), or an abstract base\n   with a single subclass.\n5. **Missing Ruby protocols.** Callers unpack a collection-like or\n   value-like class by hand instead of it implementing `each` with\n   `Enumerable`, `to_h`, `\u003C=>` with `Comparable`, or `hash` and `eql?`.\n6. **Mixed decisions and effects.** Tests need heavy mocks, or a method\n   computes and writes in one body. Extract the computation into a pure\n   function and leave a thin method for the I\u002FO.\n\n## Rails anti-patterns\n\n- **Service objects:** a single-method, stateless service belongs in a model\n  method or module function (Pattern 1). Keep complex orchestration as a\n  service but separate decisions from effects (Pattern 6). Jobs are\n  legitimate objects because they serialize.\n- **Models:** keep ActiveRecord models as classes; move business\n  calculations into pure functions.\n- **Concerns:** a concern shares behavior across models; flag one used as a\n  dumping ground for a single model.\n- **Helpers:** view formatting only; business rules go in a module.\n- **Reinvented Rails:** custom DSLs or base classes that duplicate scopes,\n  validations, callbacks, enums, or `ActiveModel`.\n\n## Plain Ruby anti-patterns\n\n- **Template methods:** a base class with hook methods where a block would do.\n- **Builders:** for objects that keyword arguments or `Data.define` build\n  directly.\n- **Wrappers:** classes that wrap Array, Hash, Set, or another stdlib type\n  and forward most calls.\n- **Metaprogramming:** `method_missing`, `define_method`, or `instance_eval`\n  DSLs where plain methods work.\n- **Dependencies:** a gem pulled in for a few lines of stdlib code.\n\nIn a gem, every public constant is API that other projects may call.\n\n## Before removing or inlining a class\n\n- Run `bash \u003Cskill-dir>\u002Fscripts\u002Ffind-callers.sh \u003CConstant> \u003Cproject>` for\n  each class.\n- Exit 0: account for every `reference` and `require` hit, and decide for\n  each `dynamic` hit whether the name it builds can be the class; that takes\n  reading the code, so it stays with you.\n- Exit 1: no caller found. Exit 2: fix the argument. Exit 3: install the\n  named tool. Exit 4: report the grep error.\n- A controller is also reached from `config\u002Froutes.rb` by its snake_case\n  resource name, which the script does not search; read that file.\n- In a review, drop or downgrade a finding whose callers you cannot account\n  for.\n\n## Review findings\n\nRead [review findings](references\u002Freview-findings.md) when reporting a\nreview: the grouping, the fields of each finding, and the closing order.\n\n## Refactoring\n\nGet a green test baseline first. Apply one pattern at a time and run the\nsuite after each; on failure, fix or revert that step before continuing.\nUpdate tests that mocked the removed layer to call the pure function or the\ndirect API instead.\n","# Simplifying Ruby Code\n\nPrefer plain data (Hash, Array, Struct, Data) and pure functions over classes\nthat add no state or behavior. Separate decisions from effects: a decision\ntakes data and returns data; an effect does I\u002FO (database, network, files,\ntime). Keep them in separate methods or modules so decisions test without\nmocks.\n\nWhen the user asks for a review, report findings and edit nothing unless\nthey ask. Cite patterns by number (\"Pattern 1\") or by anti-pattern name.\n\n## Patterns\n\n1. **Command objects to module functions.** A class whose only public\n   method is `call`, `perform`, `run`, or `execute`, holding nothing beyond\n   its constructor arguments, becomes a direct call or a module function\n   (`UserCreator.new(params).call` becomes `User.create(params)`). Keep the\n   object when it holds state across calls, runs a multi-step algorithm\n   worth naming, or must be serialized, as a background job is.\n2. **Value objects to Data, Struct, or Hash.** A class that only stores\n   attributes, with hand-written `initialize`, readers, or `==` and no\n   behavior or validation:\n\n   | Use          | When                                                 |\n   | ------------ | ---------------------------------------------------- |\n   | Hash         | Transient data, varying keys, JSON in or out         |\n   | Struct       | Fixed attributes, mutation acceptable                |\n   | Data         | Fixed attributes, immutable (check `ruby -v` >= 3.2) |\n   | Custom class | Validation, invariants, or real domain behavior      |\n\n3. **Class-method-only classes to modules.** A class never instantiated,\n   defining only `self.` methods, becomes a module with `module_function`.\n4. **Deep inheritance to composition.** More than 2 levels counting only the\n   project's own classes (framework and stdlib bases such as\n   `ApplicationRecord` or `StandardError` do not count), or an abstract base\n   with a single subclass.\n5. **Missing Ruby protocols.** Callers unpack a collection-like or\n   value-like class by hand instead of it implementing `each` with\n   `Enumerable`, `to_h`, `\u003C=>` with `Comparable`, or `hash` and `eql?`.\n6. **Mixed decisions and effects.** Tests need heavy mocks, or a method\n   computes and writes in one body. Extract the computation into a pure\n   function and leave a thin method for the I\u002FO.\n\n## Rails anti-patterns\n\n- **Service objects:** a single-method, stateless service belongs in a model\n  method or module function (Pattern 1). Keep complex orchestration as a\n  service but separate decisions from effects (Pattern 6). Jobs are\n  legitimate objects because they serialize.\n- **Models:** keep ActiveRecord models as classes; move business\n  calculations into pure functions.\n- **Concerns:** a concern shares behavior across models; flag one used as a\n  dumping ground for a single model.\n- **Helpers:** view formatting only; business rules go in a module.\n- **Reinvented Rails:** custom DSLs or base classes that duplicate scopes,\n  validations, callbacks, enums, or `ActiveModel`.\n\n## Plain Ruby anti-patterns\n\n- **Template methods:** a base class with hook methods where a block would do.\n- **Builders:** for objects that keyword arguments or `Data.define` build\n  directly.\n- **Wrappers:** classes that wrap Array, Hash, Set, or another stdlib type\n  and forward most calls.\n- **Metaprogramming:** `method_missing`, `define_method`, or `instance_eval`\n  DSLs where plain methods work.\n- **Dependencies:** a gem pulled in for a few lines of stdlib code.\n\nIn a gem, every public constant is API that other projects may call.\n\n## Before removing or inlining a class\n\n- Run `bash \u003Cskill-dir>\u002Fscripts\u002Ffind-callers.sh \u003CConstant> \u003Cproject>` for\n  each class.\n- Exit 0: account for every `reference` and `require` hit, and decide for\n  each `dynamic` hit whether the name it builds can be the class; that takes\n  reading the code, so it stays with you.\n- Exit 1: no caller found. Exit 2: fix the argument. Exit 3: install the\n  named tool. Exit 4: report the grep error.\n- A controller is also reached from `config\u002Froutes.rb` by its snake_case\n  resource name, which the script does not search; read that file.\n- In a review, drop or downgrade a finding whose callers you cannot account\n  for.\n\n## Review findings\n\nRead [review findings](references\u002Freview-findings.md) when reporting a\nreview: the grouping, the fields of each finding, and the closing order.\n\n## Refactoring\n\nGet a green test baseline first. Apply one pattern at a time and run the\nsuite after each; on failure, fix or revert that step before continuing.\nUpdate tests that mocked the removed layer to call the pure function or the\ndirect API instead.\n",{"name":5,"description":7},"main","e8ff85fe8cec970c537bf34f0373fdff02834815","skills\u002Fengineering\u002Fsimplifying-ruby-code",0,"https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills","https:\u002F\u002Fskills.bostonaholic.dev","https:\u002F\u002Fgithub.com\u002Fbostonaholic","https:\u002F\u002Fmatthewboston.com","agility. simplicity. value.","2026-11-15 04:51:36",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add bostonaholic\u002Fskills --skill simplifying-ruby-code",{"tool":40,"command":41},"bunx","bunx skills add bostonaholic\u002Fskills --skill simplifying-ruby-code",{"tool":43,"command":44},"pnpm","pnpm dlx skills add bostonaholic\u002Fskills --skill simplifying-ruby-code","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fengineering\u002Fsimplifying-ruby-code\u002FSKILL.md",true,[48,54,58],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"agents\u002Fopenai.yaml","REFERENCE","参考文档",292,"https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fengineering\u002Fsimplifying-ruby-code\u002Fagents\u002Fopenai.yaml",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Freview-findings.md",506,"https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fengineering\u002Fsimplifying-ruby-code\u002Freferences\u002Freview-findings.md",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Ffind-callers.sh","SCRIPT","脚本",4642,"https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fengineering\u002Fsimplifying-ruby-code\u002Fscripts\u002Ffind-callers.sh",[65,72,79,86,93,100],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7DH74HXXCFEZVAGZWETR4TY","writing-system-prompts","Writes and reviews system prompts for AI tools, agents, chatbots, and LLM products using a fixed section order and a quality checklist. Use when the user says \"write a system prompt\", or when drafting a system prompt or auditing one for missing stop criteria, tool rules, constraints, or examples. Not for compressing an existing prompt; use improving-prompts.","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fwriting-system-prompts\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7DH6ZJ1RFRCGM01CGMJ10RY","writing-prose","Writes and edits prose for people in a plain, conversational, short house style with no em dashes. Use when the user says \"write this up\", or when drafting or revising documentation, READMEs, explanations, blog posts, or other human-facing prose. Not for prompts written for agents; use writing-system-prompts or composing-agent-prompts.","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fwriting-prose\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7DH6TR43CYKY8VHFQWKNDWW","writing-acceptance-criteria","Writes or rewrites acceptance criteria until each is provable: one observable outcome with a named check that can fail. Use when the user says \"write acceptance criteria\", or asks to write, rewrite, or tighten acceptance criteria or a definition of done. Not for proving work meets them; use proving-claims.","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fwriting-acceptance-criteria\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7DH6P0PC857A3W7CAGJPXSM","summarizing-shipped-work","Summarizes the user's merged GitHub PRs for a timeframe into a grouped, linked shipped-work report with highlights, and offers to update a brag document. Use when the user says \"what shipped?\", or when asked what the user shipped (this week, last month, a quarter, since a date), for a status update, or to update a brag doc.","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Fsummarizing-shipped-work\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":19},"01M7DH6H3YCJ59CZ0DMKHZ3N7S","running-retros","Mines a session transcript, past agent sessions, or named sources such as PR review comments for durable learnings, then proposes approval-gated edits to skills, AGENTS.md, or docs and tracker issues. Use when the user says \"retro\", or when the user explicitly asks for a retrospective. Never infer from session end or friction.","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Frunning-retros\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":19},"01M7DH6C68WZB8Z6DD4MH770B7","learning-from-mistakes","Codifies the latest correction or mistake in the conversation as a short imperative rule in the project or global CLAUDE.md or AGENTS.md, after the user approves it. Use when the user says \"learn from this mistake\", or when the user asks to learn from a mistake, remember a lesson for next time, add a rule to CLAUDE.md, or not repeat a behavior. Not for a whole session; use running-retros.","https:\u002F\u002Fgithub.com\u002Fbostonaholic\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fproductivity\u002Flearning-from-mistakes\u002FSKILL.md",[],[]]