docs(claude): trim CLAUDE.md, extract deploy/bot/browser docs, add anti-patterns #11-14#2740
Conversation
…ti-patterns #11-14 CLAUDE.md was 1133 lines, with 10 of 17 listed reference subdirectories missing and several broken doc paths (config/services.cfm, docs/src/...). Reorders, dedups, and trims to 714 lines (-37%) with all internal links now resolving. Top-of-file restructured for high-leverage content first: - Code Map: where framework/demo/CLI live and how they relate - Before-Done checklist: which test suite to run for which change type - Cross-Engine Invariants: promoted from buried Docker / Browser-Testing locations - Anti-Patterns extended Top 10 -> Top 14, all new entries sourced from recent PRs: - #11 CFML reserved scopes shadow parameters (#2591) - #12 Empty array in whereIn / whereNotIn (#2736) - #13 Comma-list config != single-value HTTP header (#2725) - #14 Strip CFML comments before source-scanning (#2595) Extracted sections, loaded only when relevant: - .ai/wheels/deploy.md (92 lines) - wheels deploy Kamal port reference - .ai/wheels/wheels-bot.md (34 lines) - bot architecture - .ai/wheels/testing/browser-testing.md (68 lines) - browser DSL Other dedups: t.timestamps() 3-column rule, mixed-argument-style rule, and the WheelsTest-only-for-new-tests reminder each appear in one canonical location now. Reference Docs list at bottom lists only verified-to-exist files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Peter Amiri <peter@alurium.com>
There was a problem hiding this comment.
Wheels Bot — Reviewer A
This PR trims CLAUDE.md from 1133 → 714 lines, adds a Code Map and Before-Done checklist, promotes cross-engine rules to a top-level section, adds four new anti-patterns (#11–14) sourced from real merged PRs (#2591, #2736, #2725, #2595), and extracts the deploy/bot/browser-testing sections into dedicated .ai/wheels/ files. The overall restructuring is well-designed: high-leverage content is front-loaded, every internal link was verified to resolve, and the Reference Docs section no longer points to non-existent directories. Verdict: comment — three minor content losses worth noting, no blockers.
Correctness
The SOFT_FAIL_DBS two-occurrence sync note was dropped without adding it to the workflow.
Old CLAUDE.md (line 688) contained:
`SOFT_FAIL_DBS` appears twice in `.github/workflows/compat-matrix.yml` — once in the
"Run test suites" step and once in the "Generate per-engine summary" step. Both must be
kept in sync since the steps don't share shell state.
The new CLAUDE.md condenses this to: "Oracle is soft-fail in CI (see SOFT_FAIL_DBS in .github/workflows/compat-matrix.yml)".
Verified: compat-matrix.yml has two hard-coded SOFT_FAIL_DBS="oracle" assignments (lines 293 and 488) with no comment about the sync requirement. An agent or contributor who adds a new soft-fail DB and only updates line 293 will get inconsistent behaviour: the first loop soft-fails while the second hard-gates. There is no surviving documentation of this constraint anywhere in the codebase.
Suggested fix — add a comment in compat-matrix.yml at line 293 (and 488):
# Update this AND the matching assignment ~195 lines below — the two steps don't share shell state
SOFT_FAIL_DBS="oracle"If not touching the workflow in this PR, restore a one-liner in the new CLAUDE.md testing section: "Update SOFT_FAIL_DBS in both the 'run suites' step and the 'summary' step — they don't share shell state."
Conventions
Anti-pattern #7 (timestamps()): code example was removed.
Old CLAUDE.md showed:
// WRONG — duplicates
t.timestamps();
t.datetime(columnNames="createdAt");
// RIGHT
t.timestamps(); // creates createdAt, updatedAt, AND deletedAt (soft-delete)New CLAUDE.md (lines 141–142) replaces this with prose only — no WRONG/RIGHT code block. The rule is accurate, but the visible wrong pattern (t.datetime(columnNames="createdAt")) no longer appears. An agent generating migration code scans code blocks before prose; without the example the mistake stays invisible until after the fact.
Old anti-pattern #8 (Database-Agnostic Dates) lost its WRONG example.
Old CLAUDE.md had a dedicated ### 8. Database-Agnostic Dates in Migrations with:
// WRONG — database-specific
execute("INSERT INTO users (name, createdAt) VALUES ('Admin', CURRENT_TIMESTAMP)");New CLAUDE.md merges this into anti-pattern #5 as a trailing // RIGHT comment only — CURRENT_TIMESTAMP is never shown as the wrong answer. An agent writing a migration that uses CURRENT_TIMESTAMP will not find a code-level warning. Suggest adding // WRONG — CURRENT_TIMESTAMP is database-specific as a preceding line, or restore the standalone heading.
Anti-pattern #3 (nested routes): flat separate declarations option was silently removed.
Old CLAUDE.md included a third valid form:
// RIGHT — flat separate declarations (no URL nesting)
.resources("posts")
.resources("comments")New CLAUDE.md drops this. The flat form is the right answer when URL nesting isn't needed, and its absence may push agents toward the callback form unnecessarily.
Docs
All 17 internal links in new CLAUDE.md were verified to resolve to existing files/directories. The Reference Docs section now correctly lists only what exists — the old version pointed to 10+ non-existent directories (.ai/wheels/models/, .ai/wheels/database/, .ai/wheels/configuration/, etc.), so this is a meaningful improvement.
The three helper function paths cited in anti-pattern #14 (cli/lucli/services/Analysis.cfc, cli/lucli/Module.cfc, cli/lucli/services/Doctor.cfc) all verified to exist.
Relative ../../docs/ links in .ai/wheels/deploy.md were verified to resolve from the repo root.
Commits
One commit: docs(claude): trim CLAUDE.md, extract deploy/bot/browser docs, add anti-patterns #11-14
- Type
docs✓ — scopeclaude✓ (unrestricted) — subject 75 chars, not ALL-CAPS ✓ - DCO sign-off present (
Signed-off-by: Peter Amiri <peter@alurium.com>) ✓ - Targets
develop✓
Wheels Bot — Reviewer B (round 1)A's review is thorough and largely accurate: the three content-loss findings are real and well-evidenced. However, A missed one factual error introduced by the extraction into SycophancyNone detected. A issued a False positivesNone detected. I verified A's four claims against the diff:
Missed issues
The actual cap is 10 rounds per SHA, as stated consistently across:
The error was pre-existing in old CLAUDE.md and was faithfully carried into the new extracted file. The extraction is an opportunity to correct it. Any agent consulting Fix: change "Loop cap = 3 rounds" to "Loop cap = 10 rounds per SHA" in the Stages table. Verdict alignmentA's ConvergenceNot aligned. A needs to verify the Reviewer B loop cap value in |
There was a problem hiding this comment.
Wheels Bot — Reviewer A response (round 1)
B confirmed all four of my original findings as valid and raised one missed issue: the Reviewer B loop cap in the newly extracted .ai/wheels/wheels-bot.md is documented as 3 rounds when every authoritative source in the repo says 10. I concede that finding; it is clearly wrong and I should have caught it. No other adjustments needed. Verdict stays at comment.
Conceded points
- Loop cap error in
.ai/wheels/wheels-bot.md: The Stages table in the extracted file readsLoop cap = 3 roundsfor Reviewer B. Verified against the diff and cross-checked with.claude/commands/review-the-review.md("Loop cap: 10 rounds per SHA"),.claude/commands/advise-on-deadlock.md("10-round inner-loop cap"),.claude/commands/respond-to-critique.md("10 rounds max per SHA"), and.github/workflows/bot-advisor.ymlheader comment. All four say 10. The extraction faithfully copied a pre-existing error from old CLAUDE.md rather than correcting it. The fix is a one-word change in the table cell:Loop cap = 3 rounds→Loop cap = 10 rounds per SHA. This should be flagged as a required correction alongside the four content-loss items from my initial review.
Defended points
- All four original findings stand (B confirmed them, no rebuttal needed):
SOFT_FAIL_DBSsync note dropped — two hard-coded assignments incompat-matrix.yml(lines 293 and 488) have no surviving documentation of their must-stay-in-sync constraint.- Anti-pattern #7 code block removed — the
t.datetime(columnNames="createdAt")counter-example is gone; prose only survives. - Anti-pattern #8 WRONG example removed —
CURRENT_TIMESTAMPno longer appears as the wrong answer; only a trailing// RIGHTcomment in anti-pattern #5 remains. - Anti-pattern #3 flat form dropped — the flat separate-declarations form (
.resources("posts") / .resources("comments")) has been silently removed.
Updated verdict
Still comment — five documentation-quality items (four content losses plus the loop cap correction), none of which are blocking defects, but all of which degrade the accuracy of the extracted docs for both humans and agents.
Summary
CLAUDE.md was 1133 lines, with 10 of 17 listed reference subdirectories missing and several broken doc paths (
config/services.cfm,docs/src/...). This PR reorders, dedups, and trims it to 714 lines (-37%) with all internal links now resolving.Top-of-file restructured so high-leverage content lands in working memory first:
whereIn/whereNotIn(feat(web/blog,model): beyond findAll post + whereIn empty-array fix #2736)Extracted to
.ai/wheels/(loaded only when relevant):.ai/wheels/deploy.md(92 lines) —wheels deployKamal-port reference.ai/wheels/wheels-bot.md(34 lines) — bot architecture.ai/wheels/testing/browser-testing.md(68 lines) — browser DSLOther dedups:
t.timestamps()3-column rule, mixed-argument-style rule, and the "WheelsTest only for new tests" reminder now each appear in one canonical location. Reference Docs list at bottom lists only verified-to-exist files.Related Issue
N/A — internal Claude-tooling improvement, no tracked issue.
Type of Change
Feature Completeness Checklist
Signed-off-by:(usedgit commit -s).ai/wheels/Test Plan
Screenshots / Output
n/a
[skip-claude]