Commit Graph

3 Commits

Author SHA1 Message Date
Tu Shaokun b14b3f657f fix: correct review-guide errors and sync skill metadata
Correctness fixes in the reference guides:
- django: len()/count() caching explanation was reversed; fix slicing/index
  cache example; replace nonexistent __acall__ async middleware with the
  documented markcoroutinefunction pattern; drop removed
  SECURE_BROWSER_XSS_FILTER; REFERRER_POLICY -> SECURE_REFERRER_POLICY
- security: path-traversal guard compared a relative path to an absolute one
  (rejected every valid file); compare absolute-vs-absolute
- nestjs: e2e ValidationPipe needs forbidNonWhitelisted/transform for the
  "extra field -> 400" test to pass
- rust: select! cancel-safety example used read on both sides; bad case now
  uses non-cancel-safe read_exact
- code-quality: "read less" example still read the whole file; use readline()
- svelte: drop nonexistent unstate() (use $state.snapshot); fix devalue/Date
  note; comma-operator each-key -> template literal
- c/cpp/qt: restore mangled markers that rendered as a literal ?
- csharp: drop fabricated perf numbers
- java: scope HashMap infinite-loop note to Java 7 and earlier
- kotlin: closeableScope -> built-in viewModelScope
- css: deprecated darken()/clip:rect() -> color.adjust/clip-path
- typescript: legacy .eslintrc -> flat config (typescript-eslint v8)

Tooling and metadata:
- pr-analyzer.py: filename regex corrupted lib//web//db/ paths; parse the diff
  header via backreference and add utf-8/error handling; add test
- SKILL.md: canonical name code-review-skill; document severity tiers; wire in
  pr-analyzer.py
- README/CONTRIBUTING: fix stale skill name and line counts; complete the guide
  tree; add a conventions section
2026-06-05 09:44:47 +08:00
xronocode 52d6a14cd3 fix: address review feedback on universal quality + perf guides
- code-quality-universal.md: drop broken TS lookup-table example whose
  one-key {key:true} object always evaluated to `true`; promote the
  bgMap variant to the single ✅ block
- code-quality-universal.md: rename `## Review Checklist` to
  `## 通用质量审查清单` (and TOC anchor) for consistency with peer
  reference files that close with a Chinese checklist heading
- performance-review-guide.md: move `## 低级别效率反模式` above
  `## 参考资源` so the references section remains the file's terminal
  section, matching every other reference file
- performance-review-guide.md: slim `## 低级别效率反模式` from heavy
  ❌/✅ examples to a checklist with two illustrative snippets, and
  cross-link the resource-management overlap into
  common-bugs-checklist.md#resource-management

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-09 11:31:08 +06:00
xronocode 836d467978 feat. (feat) Add universal quality anti-patterns guide + low-level efficiency patterns
New guide: reference/code-quality-universal.md (~320 lines)
- Code reuse audit: search existing utilities before accepting new code
- Parameter sprawl: options object / dataclass instead of 4+ params
- Leaky abstractions: hide ORM/HTTP/file format internals
- Stringly-typed code: use enum/constant/union type over raw strings
- Nested conditionals: flatten ternary chains and nested if/else
- Copy-paste variants: unify near-duplicate code with shared abstraction
- No-op updates: add change-detection guards to polling/intervals
- TOCTOU: replace check-then-act with try-act-catch
- Overly broad operations: push filtering to DB/storage layer
- Redundant state: derive values instead of storing duplicates

Updated SKILL.md Phase 3 with Reuse Check dimension + cross-cutting guide table.
Extended performance-review-guide.md with low-level efficiency patterns:
unnecessary work, missed concurrency, hot-path bloat, unbounded data structures.
Updated README.md bilingual tables, trees, and badges.
2026-05-09 10:50:28 +06:00