agentleFS
sebyx07sebyx07/ruby2html/.claude/skills/review/SKILL.md

review

Skill23 starsChanged 12 days agoMITView on GitHub

Review checklist for ruby2html changes, especially ext/ (C) and the renderer - GC safety, escaping, Native/PureRuby parity, allocations, benchmark before/after. Use when reviewing a diff, a PR, or your own work before declaring it done.

192 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use close-spec, design-with-images and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • dzhngSkill

    close-spec

    When a spec under specs/<feature>/ is done shipping (a write-spec build, or any planned task that produced a spec), archive it to specs/done/ and rewrite it from a build-plan into a durable rationale — the why, the principles, the invariants — pointing back to the real code for the how. Use when implementation has landed and the plan no longer matches what shipped, or the user says a feature/spec is finished. Pairs with [write-spec](../write-spec/SKILL.md) (the plan this closes) and [review](../review/SKILL.md) (run before closing).

    Also in 5 projects that use this

  • dzhngSkill

    design-with-images

    Explore UI and visual design with image generation, then iterate the real implementation against the user-selected concept. Use when brainstorming visual directions, offering mockup variants, or implementing an approved generated design; do not stop at the mockups or the first code approximation.

    Also in 5 projects that use this

  • LambenthanSkill

    daily-arxiv

    每日从 arXiv 拉取新论文,过滤相关性,auto-ingest 高优先级论文,检测 SOTA 更新

    Also in 5 projects that use this

  • LambenthanSkill

    exp-eval

    实验判决门:Review LLM 独立评判实验结果 → 4 种判决路径 → 自动更新 claims confidence、ideas status、graph edges

    Also in 5 projects that use this

  • +3 more from dzhng
  • +5 more from Lambenthan

The file

Files
SKILL.md

Review a ruby2html change

Scope: git diff (uncommitted) or git diff main...HEAD. Read AGENTS.md "Sharp edges / invariants" first. Report findings as file:line + why + fix; say explicitly which checklist sections passed.

C extension (ext/ruby2html/)

  • GC safety: every VALUE whose pointer (RSTRING_PTR, RARRAY_CONST_PTR) is used across a call that may allocate/yield/raise has RB_GC_GUARD after its last use. Temporaries from rb_obj_as_string, rb_sym2str, rb_String, r2h_utf8_compatible included.
  • Stale pointers: no RSTRING_PTR(buf) cached across r2h_buf_reserve, rb_yield*, rb_funcall or any append (buffer may move).
  • Buffer writes go through buffer.h (r2h_buf_reserve → write → r2h_buf_commit); reserved size ≥ bytes written (escaping: exact extra computed first).
  • Types: long for Ruby lengths, casts to size_t only for memcpy; no signed overflow on size math.
  • Exceptions: no C-side state left inconsistent if a Ruby call raises (rb_yield, to_s, html_safe?).
  • IDs interned at Init (r2h_id_*), no rb_intern in hot paths; no new rb_funcall per byte/attribute if avoidable.
  • Encoding: output stays UTF-8; inputs go through r2h_utf8_compatible.
  • SIMD: SSE2 / NEON / scalar paths agree (rebuild with RUBY2HTML_NO_SIMD=1 and run specs).
  • bin/build-ext --werror (and --cc=clang --werror) passes; for memory-sensitive changes run the sanitizer build (debug-render skill).

Escaping (C and Ruby)

  • Text and attribute values escaped (& < > " ') unless html_safe?; exact String never treated as safe.
  • Attribute/tag names validated, invalid names raise ArgumentError.
  • New raw-output paths are documented and justified; consider an xss-auditor subagent pass.

Parity (Native vs PureRuby)

  • Every rule change exists in both ext/ruby2html/*.c and lib/gem/ruby2html/render/pure_ruby.rb.
  • Specs pass in both modes: CI=1 bundle exec rspec spec/gem and RUBY2HTML_DISABLE_EXT=1 bundle exec rspec spec/gem. Same exceptions too.
  • Suspicious cases diffed with the debug-render skill.

Ruby / performance

  • No per-call allocations added on hot paths (splats, arrays, interpolation, define_method at call time, method_missing in loops).
  • No cache keyed by Object#hash.
  • Benchmarks before/after (benchmark skill) for any hot-path change; numbers in the PR. Or a perf-reviewer subagent pass.

Rails integration

  • TemplateCompiler edits never insert newlines; skips def/class/module; explicit receivers untouched.
  • Helper wrappers capture block output (OutputCapture) and append exactly once.
  • CI=1 bundle exec rspec spec/gem/rails spec/features.

Hygiene

  • bundle exec rubocop clean; no Ruby syntax newer than the gemspec required_ruby_version floor in lib/.
  • CHANGELOG ## [Unreleased] entry for user-visible changes (breaking → "Upgrading to 2.0").
  • llms.txt updated if user-facing behavior changed.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.