Skip to content

docs: add CLAUDE.md with engineering guidance for AI-assisted changes#35

Closed
hozblok wants to merge 1 commit into
masterfrom
docs/add-claude-md-engineering-guidance
Closed

docs: add CLAUDE.md with engineering guidance for AI-assisted changes#35
hozblok wants to merge 1 commit into
masterfrom
docs/add-claude-md-engineering-guidance

Conversation

@hozblok
Copy link
Copy Markdown
Owner

@hozblok hozblok commented May 11, 2026

Adds a CLAUDE.md at the repo root documenting the engineering principles AI-assisted changes should follow.

Lead principle. Prefer obvious failures over silent acceptance of wrong-shaped input. If a caller passes the wrong type or shape to a public API, the wrapper must raise a clear, named exception whose message identifies both the parameter and the offending value's type — no coercion, no silent fallback, no sentinel return.

Other sections:

  • Right exception type (TypeError vs ValueError vs RuntimeError; no bare Exception).
  • Breaking-change contract for public-API tightening.
  • Test discipline — every behavior change comes with a regression test that fails pre-change and passes post-change.
  • Don'ts — no drive-by reformatting, no touching unrelated files, no loosening type contracts for ergonomics, no bypassing safety checks to clear an obstacle.
  • Practical pointers for building the C++ extension and running the suite.

Incoming PR #16 (fix/02-solver-rejects-scalar-no-vars) is being amended to follow the lead principle (replace silent scalar-coercion with a clean TypeError); this doc should land first so that PR's body can link to it.

Lead principle: prefer obvious failures over silent acceptance of
wrong-shaped input. The doc covers exception-type discipline, the
breaking-change contract for public APIs, regression-test expectations,
and a Don'ts list (no drive-by reformatting, no loosening type
contracts for ergonomics, no bypassing safety checks).

Referenced from incoming PRs that tighten input-validation contracts so
the rationale lives next to the rule rather than in a single commit
body.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hozblok
Copy link
Copy Markdown
Owner Author

hozblok commented Jun 2, 2026

Closing as obsolete.

A different CLAUDE.md was added to master independently with substantive content of its own (minimalism / zen style, rules around comment brevity, code simplicity, no flattery, verify-before-assert). This branch's AI-engineering-principles content does not apply as-written on top of what's there now — they're different documents with different framing.

If any of the principles here (loud failures over silent acceptance, exception-type discipline, test-discipline rule, the Don'ts list) are still wanted, they belong as a small additive edit to the current CLAUDE.md in a fresh PR — not as a replacement of it.

@hozblok hozblok closed this Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant