0a3aaa5798
Stack matches sibling buildfor_life_* apps: SvelteKit 5 with adapter-node, Svelte 5 runes, TypeScript, Tailwind v4 with @theme inline tokens, PostgreSQL via Drizzle ORM, Argon2id sessions via @node-rs/argon2 and @oslojs/crypto, EasyMDE ready for wiki/decision markdown, Sharp for thumbnails. Included in this commit: - Config: package.json, svelte.config.js, vite.config.ts, tsconfig.json, drizzle.config.ts, .gitignore, .env.example, .gitattributes, .npmrc - Tenancy schema: companies, users, company_users, sessions (10 enums pre-declared for the full domain so downstream migrations don't re-diff them; decision_scope widened to include asset + work_package per product decision) - Auth: password hashing + SHA-256-hashed session cookies, session lifetime 30d with sliding renewal at T-15d, login + logout + session refresh in hooks - Storage: StorageAdapter interface + LocalDiskStorage with HMAC-signed URLs served by /api/files, S3 drop-in with zero schema change - UI shell: dark-mode bootstrap in app.html identical to siblings, sidebar (w-64, h-14 header, amber attention band pattern from repair), topbar with breadcrumbs, theme toggle with cross-tab sync via storage event, blue-600 primary, responsive drawer - Routes: (app) authed group with auto-redirect to /login, (auth) login group, dashboard placeholder, error page, signed-file API - Scripts: create-user script for bootstrapping first admin user - Drizzle: initial migration generated (0000_init.sql) - Shared agents and skills committed under .claude/; per-user permissions gitignored Typecheck: 0 errors / 0 warnings across 555 files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
Coding Standards
Overview
This reference guide provides comprehensive information for code reviewer.
Patterns and Practices
Pattern 1: Best Practice Implementation
Description: Detailed explanation of the pattern.
When to Use:
- Scenario 1
- Scenario 2
- Scenario 3
Implementation:
// Example code implementation
export class Example {
// Implementation details
}
Benefits:
- Benefit 1
- Benefit 2
- Benefit 3
Trade-offs:
- Consider 1
- Consider 2
- Consider 3
Pattern 2: Advanced Technique
Description: Another important pattern for code reviewer.
Implementation:
// Advanced example
async function advancedExample() {
// Code here
}
Guidelines
Code Organization
- Clear structure
- Logical separation
- Consistent naming
- Proper documentation
Performance Considerations
- Optimization strategies
- Bottleneck identification
- Monitoring approaches
- Scaling techniques
Security Best Practices
- Input validation
- Authentication
- Authorization
- Data protection
Common Patterns
Pattern A
Implementation details and examples.
Pattern B
Implementation details and examples.
Pattern C
Implementation details and examples.
Anti-Patterns to Avoid
Anti-Pattern 1
What not to do and why.
Anti-Pattern 2
What not to do and why.
Tools and Resources
Recommended Tools
- Tool 1: Purpose
- Tool 2: Purpose
- Tool 3: Purpose
Further Reading
- Resource 1
- Resource 2
- Resource 3
Conclusion
Key takeaways for using this reference guide effectively.