audit_logging
π―Skillfrom cityfish91159/maihouses
Logs and tracks critical actions with comprehensive user, action, and resource metadata for enhanced traceability and security.
Installation
npx skills add https://github.com/cityfish91159/maihouses --skill audit_loggingSkill Details
Ensure every critical action is logged (vital for UAG/Trust Room).
Overview
# Audit Logging Protocol
1. Principles
- No Invisible Actions: Every state-changing API call (POST, PUT, DELETE) must produce a log entry.
- Traceability: Logs must include
userId,action,resourceId, andmetadata.
2. Implementation Standards
- Backend (API):
- Use the project's standard Logger service (e.g., src/services/logger.ts or similar).
- Example:
```typescript
await Logger.info({
event: 'POST_CREATED',
userId: user.id,
metadata: { postId: newPost.id }
});
```
- Database (Supabase):
- Ensure tables have created_at, updated_at, and created_by columns.
- Check if specific Audit Table inserts are required (e.g. audit_logs table).
3. Verification Checklist
- [ ] Does the new API endpoint call
Logger? - [ ] Are logs visible in Supabase/Dashboards?
- [ ] Is the log level appropriate (Info vs Error)?
- [ ] Does the log contain enough context to debug issues later?
More from this repository10
Enforces comprehensive testing by mandating tests for every code change, bug fix, and new feature implementation.
read-before-edit skill from cityfish91159/maihouses
Enforces architectural best practices by guiding developers to think systematically about data flow, component boundaries, and scalability before writing code.
Enforces strict Row Level Security (RLS) policies in Supabase, mandating default-deny access and comprehensive security checks.
Validates and sanitizes backend API inputs, preventing injection attacks and ensuring robust data integrity across server-side endpoints
Validates TypeScript/React code quality for maihouses projects, ensuring adherence to CLAUDE.md standards through comprehensive automated checks.
Checks and fixes TypeScript type errors by identifying, analyzing, and resolving type mismatches across project files.
Enforces strict React performance guidelines by policing re-renders, optimizing bundle size, and preventing performance bottlenecks.
Maintains a persistent memory file to track project context, architecture, issues, and operational rules across AI agent sessions.
pre-commit-validator skill from cityfish91159/maihouses