Skip to content

docs: Add CLAUDE.md and mark safeServerCall with warning#509

Open
theodorklauritzen wants to merge 2 commits intomainfrom
docs/update-claude-md-and-mark-warnings
Open

docs: Add CLAUDE.md and mark safeServerCall with warning#509
theodorklauritzen wants to merge 2 commits intomainfrom
docs/update-claude-md-and-mark-warnings

Conversation

@theodorklauritzen
Copy link
Member

Summary

  • Add comprehensive CLAUDE.md file to guide future Claude Code instances working in this repository
  • Mark safeServerCall function with @warning JSDoc tag to indicate it should only be used internally by the service operation system

Details

CLAUDE.md

The new CLAUDE.md file includes:

  • Development commands (running, testing, linting, database operations)
  • Architecture overview (ServiceOperation pattern, Prisma schema organization, authentication)
  • Project structure and path aliases
  • Important patterns (server-only code, error handling, form handling)
  • Testing setup information

safeServerCall Warning

Updated the JSDoc comment for safeServerCall to include a warning that it should not be called directly, as the service operation system handles this internally.

Test plan

  • Review CLAUDE.md for accuracy and completeness
  • Verify the @warning JSDoc tag displays correctly in IDE tooltips

🤖 Generated with Claude Code

- Add comprehensive CLAUDE.md file for Claude Code integration
- Mark safeServerCall function with @warning as it should only be used internally by the service operation system

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@theodorklauritzen
Copy link
Member Author

theodorklauritzen commented Feb 11, 2026

Jeg har fått et nytt leketøy jeg måtte teste hehe. Nå håper jeg refactoring blir en lek.

Men jeg er faktisk fasinert over hvor greit den oppsummerte prosjektet vårt. Det er faktisk mega nyttig som et overblikk over hvordan vi koder.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive documentation for Claude Code instances and marks an internal function with a warning annotation to prevent direct usage.

Changes:

  • Added CLAUDE.md with development setup, architecture patterns, and project structure documentation
  • Added @warning JSDoc tag to safeServerCall function indicating it's for internal use only

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
CLAUDE.md New comprehensive guide covering development commands, ServiceOperation architecture pattern, project structure, path aliases, and important coding conventions
src/services/actionError.ts Added @warning JSDoc tag to safeServerCall function to indicate it should not be called directly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Change function name from defineServiceOperation to defineOperation
- Add required authorizer parameter to match actual API

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@Paulijuz Paulijuz left a comment

Choose a reason for hiding this comment

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

Nice. Now we can just have a Claude subscription instead of taking on new people next year.

- **ServiceOperation**: Core abstraction defined in `src/services/serviceOperation.ts`. All business logic is wrapped in ServiceOperations.
- **Server Actions**: Client-callable functions created by wrapping ServiceOperations with `makeAction()` from `src/services/serverAction.ts`.
- **Authorization**: Custom authorization system with Authorizer classes (see `src/auth/authorizer/`). Each ServiceOperation specifies its required permissions.
- **Transaction Management**: ServiceOperations can open database transactions via the `opensTransaction` option.
Copy link
Member

Choose a reason for hiding this comment

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

This is wrong. opensTransaction indicates that the service is going to open a transaction. This does not open a transaction automatically. Such an argument is needed as nesting transactions is not possible, thus to make the typing and internal validation work a service need to know it can be called from within another transaction. If you have a better name suggestion go ahead.

Copy link
Member

Choose a reason for hiding this comment

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

It looks like the doc string for define Operation disappeared at some point... 😞

Copy link
Member

Choose a reason for hiding this comment

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

It looks like the doc string for define Operation disappeared at some point... 😞

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