このコミットが含まれているのは:
2026-06-07 00:14:36 +09:00
コミット a50c29cc35
2個のファイルの変更26行の追加6行の削除
+12 -2
ファイルの表示
@@ -104,10 +104,18 @@ npm run preview
- Prefer precise, minimal changes. - Prefer precise, minimal changes.
- Do not flatter or over-explain. - Do not flatter or over-explain.
- Explain risks directly. - Explain risks directly.
- Prefer single quotes for strings unless interpolation or escaping makes double quotes better. - Prefer single quotes for strings unless interpolation or escaping makes
double quotes better.
- Ruby: never put a space before method-call parentheses. - Ruby: never put a space before method-call parentheses.
- Ruby: never put a line break immediately before `)`.
- Ruby: do not use `%w` or `%i`. - Ruby: do not use `%w` or `%i`.
- TypeScript and Python: use GNU-style spacing before parentheses where syntactically valid. - Ruby hashes are not blocks; keep `}` on the same line as the final pair.
- Ruby hashes keep the first pair on the same line as `{` unless line length
requires a break.
- Ruby blocks use separate `{ ... }` rules from hashes, with 2-space body
indentation.
- TypeScript and Python: use GNU-style spacing before parentheses where
syntactically valid.
- Never write Ruby, TypeScript, or TSX lines longer than 99 characters. - Never write Ruby, TypeScript, or TSX lines longer than 99 characters.
- Aim to keep Ruby, TypeScript, and TSX lines within 79 characters where practical. - Aim to keep Ruby, TypeScript, and TSX lines within 79 characters where practical.
- TypeScript and TSX use 4-space logical indentation. - TypeScript and TSX use 4-space logical indentation.
@@ -128,6 +136,8 @@ npm run preview
- Be careful with version tables, `version_no`, optimistic concurrency, - Be careful with version tables, `version_no`, optimistic concurrency,
wiki revisions, and restore/diff behavior. wiki revisions, and restore/diff behavior.
- Be careful with tag names, tag normalization, implications, similarities, and discard behavior. - Be careful with tag names, tag normalization, implications, similarities, and discard behavior.
- Be sensitive to N+1 queries; avoid introducing them and proactively fix
existing N+1 issues in the code path being edited.
- Keep migration files and `backend/db/schema.rb` consistent when changing schema. - Keep migration files and `backend/db/schema.rb` consistent when changing schema.
## Frontend rules ## Frontend rules
+14 -4
ファイルの表示
@@ -68,15 +68,22 @@ service, representation, and spec.
- Prefer precise, minimal changes. - Prefer precise, minimal changes.
- Use single quotes unless interpolation or escaping makes double quotes better. - Use single quotes unless interpolation or escaping makes double quotes better.
- Do not put a space before Ruby method-call parentheses. - Do not put a space before Ruby method-call parentheses.
- Never put a line break immediately before `)` in Ruby.
- Do not use `%w` or `%i` in new Ruby code. - Do not use `%w` or `%i` in new Ruby code.
- Never write a Ruby line longer than 99 characters. - Never write a Ruby line longer than 99 characters.
- Aim to keep Ruby lines within 79 characters where practical. - Aim to keep Ruby lines within 79 characters where practical.
- For small Ruby method definitions that take keyword arguments, match the - For small Ruby method definitions that take keyword arguments, match the
local no-parentheses style when nearby code uses it. local no-parentheses style when nearby code uses it.
- For multi-line Ruby hashes and keyword constructors, prefer a readable - Treat Ruby hash `{ ... }` style and Ruby block `{ ... }` style as separate
vertical shape with the opening brace on its own line. rules.
- Put one logical field per line when the expression would otherwise - Do not format Ruby hashes like Ruby blocks.
become dense. - For Ruby hashes, keep the closing `}` on the same line as the final pair.
- Keep the first pair on the same line as `{` by default.
- If the hash would exceed the line limit, break after `{` and indent pairs
by 4 spaces.
- Put one logical pair per line when the expression would otherwise become
dense.
- For Ruby blocks, use 2-space indentation for the block body.
- Keep comments short and useful; avoid narrating obvious code. - Keep comments short and useful; avoid narrating obvious code.
- Do not add production dependencies without approval. - Do not add production dependencies without approval.
@@ -186,6 +193,9 @@ service, representation, and spec.
- When a controller action serializes nested associations, preload the - When a controller action serializes nested associations, preload the
associations it will touch instead of allowing N+1 queries. associations it will touch instead of allowing N+1 queries.
- Be sensitive to N+1 queries in all backend work.
- Avoid introducing N+1 queries, and proactively fix existing N+1 issues when
you find them in the code path you are editing.
- When an association may already be preloaded, prefer loaded-association - When an association may already be preloaded, prefer loaded-association
checks that reuse the preloaded data without losing the efficient database checks that reuse the preloaded data without losing the efficient database
path. path.