Add architecture and code-level discipline guidelines#110
Open
hashangit wants to merge 2 commits intoforrestchang:mainfrom
Open
Add architecture and code-level discipline guidelines#110hashangit wants to merge 2 commits intoforrestchang:mainfrom
hashangit wants to merge 2 commits intoforrestchang:mainfrom
Conversation
…pline
CLAUDE.md has been substantially expanded from a concise set of four
guidelines into a comprehensive coding standards document:
- Rename top-level heading from "CLAUDE.md" to "Guidelines" to better
describe the file's purpose as a general behavioral reference
- Normalize Unicode arrows (→) to ASCII (->) for broader editor
compatibility
- Add Section 5 (Architecture & Boundaries): layer rules, size budgets,
singleton/initialization constraints, module shape, types-as-contracts,
boundary contracts, test/fixture separation, ownership rules,
infrastructure and effects placement, schema-as-contract, cross-cutting
concerns, and detailed checklists for new endpoints and domain concepts
- Add Section 6 (Code-Level Discipline): naming conventions, comment
policy, error handling strategy, logging standards, type hygiene rules,
async/promise patterns, dependency approval process, and database
migration discipline
- Remove the informal closing paragraph ("These guidelines are working
if:") as the expanded self-check checklist in Section 5 replaces it
Also add .gitignore to exclude macOS .DS_Store files from version control.
Expand the README to document the two new guidelines sections added to CLAUDE.md: - Update summary table from four to six principles, adding entries for Architecture & Boundaries and Code-Level Discipline - Rename section header from "Four Principles" to "Six Principles" - Add Principle 5 (Architecture & Boundaries) detail section covering layer rules, size budgets, types as contracts, ownership, effects at the edges, where new code goes, and the self-check checklist - Add Principle 6 (Code-Level Discipline) detail section covering naming conventions, comment policy, error handling, logging, type hygiene, async/promise patterns, dependency approval, and database migration discipline
tredondo
reviewed
Apr 28, 2026
| **Define success criteria. Loop until verified.** | ||
|
|
||
| Transform tasks into verifiable goals: | ||
| - "Add validation" → "Write tests for invalid inputs, then make them pass" |
There was a problem hiding this comment.
What was wrong with the Unicode arrow?
|
|
||
| ### Singletons & Initialization | ||
|
|
||
| - Do not use module-level nullable globals like `let foo: T | null = null` initialized elsewhere. They force `foo!` or guards that hide contract violations. |
There was a problem hiding this comment.
These seem to be language-specific, beyond the scope of the project.
|
|
||
| - Make illegal states unrepresentable. | ||
| - Use discriminated unions for status instead of boolean clusters. | ||
| - Use `{ kind: 'success', data } | { kind: 'error', error }` instead of optional `data`, `error`, and `success`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.gitignoreto exclude.DS_StoreTest plan