Skip to content

Add architecture and code-level discipline guidelines#110

Open
hashangit wants to merge 2 commits intoforrestchang:mainfrom
hashangit:main
Open

Add architecture and code-level discipline guidelines#110
hashangit wants to merge 2 commits intoforrestchang:mainfrom
hashangit:main

Conversation

@hashangit
Copy link
Copy Markdown

Summary

  • Expand CLAUDE.md with two new major sections: Architecture & Boundaries (layer rules, size budgets, types as contracts, ownership, effects at edges, boundary contracts, cross-cutting concerns, and a 12-item self-check checklist) and Code-Level Discipline (naming conventions, comment policy, error handling, logging, type hygiene, async/promise patterns, dependency approval, and database migration discipline)
  • Update README.md to document all six principles (was four), adding detailed summaries for the two new sections and updating the solution table
  • Add .gitignore to exclude .DS_Store

Test plan

  • Verify CLAUDE.md renders correctly (headings, bullet lists, code blocks)
  • Verify README.md table and new principle sections read coherently
  • Confirm no content was lost from the original four principles

…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
Comment thread CLAUDE.md
**Define success criteria. Loop until verified.**

Transform tasks into verifiable goals:
- "Add validation" "Write tests for invalid inputs, then make them pass"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was wrong with the Unicode arrow?

Comment thread CLAUDE.md

### 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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem to be language-specific, beyond the scope of the project.

Comment thread CLAUDE.md

- 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`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, TypeScript-specific

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.

2 participants