@riligar/agents-kit 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/.agent/skills/riligar-design-system/assets/theme.js +23 -18
  2. package/.agent/skills/riligar-dev-api/SKILL.md +81 -0
  3. package/.agent/skills/riligar-dev-api/api-style.md +42 -0
  4. package/.agent/skills/riligar-dev-api/auth.md +24 -0
  5. package/.agent/skills/riligar-dev-api/documentation.md +26 -0
  6. package/.agent/skills/riligar-dev-api/graphql.md +41 -0
  7. package/.agent/skills/riligar-dev-api/rate-limiting.md +31 -0
  8. package/.agent/skills/riligar-dev-api/response.md +37 -0
  9. package/.agent/skills/riligar-dev-api/rest.md +40 -0
  10. package/.agent/skills/riligar-dev-api/scripts/api_validator.py +211 -0
  11. package/.agent/skills/riligar-dev-api/security-testing.md +122 -0
  12. package/.agent/skills/riligar-dev-api/trpc.md +41 -0
  13. package/.agent/skills/riligar-dev-api/versioning.md +22 -0
  14. package/.agent/skills/riligar-dev-architecture/SKILL.md +55 -0
  15. package/.agent/skills/riligar-dev-architecture/context-discovery.md +43 -0
  16. package/.agent/skills/riligar-dev-architecture/examples.md +94 -0
  17. package/.agent/skills/riligar-dev-architecture/pattern-selection.md +68 -0
  18. package/.agent/skills/riligar-dev-architecture/patterns-reference.md +50 -0
  19. package/.agent/skills/riligar-dev-architecture/trade-off-analysis.md +77 -0
  20. package/.agent/skills/riligar-dev-autopilot/SKILL.md +24 -24
  21. package/.agent/skills/riligar-dev-clean-code/SKILL.md +201 -0
  22. package/.agent/skills/riligar-dev-code-review/SKILL.md +109 -0
  23. package/.agent/skills/riligar-dev-database/SKILL.md +52 -0
  24. package/.agent/skills/riligar-dev-database/database-selection.md +43 -0
  25. package/.agent/skills/riligar-dev-database/indexing.md +39 -0
  26. package/.agent/skills/riligar-dev-database/migrations.md +48 -0
  27. package/.agent/skills/riligar-dev-database/optimization.md +36 -0
  28. package/.agent/skills/riligar-dev-database/orm-selection.md +30 -0
  29. package/.agent/skills/riligar-dev-database/schema-design.md +56 -0
  30. package/.agent/skills/riligar-dev-database/scripts/schema_validator.py +172 -0
  31. package/.agent/skills/riligar-dev-react/SKILL.md +198 -0
  32. package/.agent/skills/riligar-plan-writing/SKILL.md +152 -0
  33. package/package.json +1 -1
@@ -0,0 +1,172 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Schema Validator - Database schema validation
4
+ Validates Prisma schemas and checks for common issues.
5
+
6
+ Usage:
7
+ python schema_validator.py <project_path>
8
+
9
+ Checks:
10
+ - Prisma schema syntax
11
+ - Missing relations
12
+ - Index recommendations
13
+ - Naming conventions
14
+ """
15
+
16
+ import sys
17
+ import json
18
+ import re
19
+ from pathlib import Path
20
+ from datetime import datetime
21
+
22
+ # Fix Windows console encoding
23
+ try:
24
+ sys.stdout.reconfigure(encoding='utf-8', errors='replace')
25
+ except:
26
+ pass
27
+
28
+
29
+ def find_schema_files(project_path: Path) -> list:
30
+ """Find database schema files."""
31
+ schemas = []
32
+
33
+ # Prisma schema
34
+ prisma_files = list(project_path.glob('**/prisma/schema.prisma'))
35
+ schemas.extend([('prisma', f) for f in prisma_files])
36
+
37
+ # Drizzle schema files
38
+ drizzle_files = list(project_path.glob('**/drizzle/*.ts'))
39
+ drizzle_files.extend(project_path.glob('**/schema/*.ts'))
40
+ for f in drizzle_files:
41
+ if 'schema' in f.name.lower() or 'table' in f.name.lower():
42
+ schemas.append(('drizzle', f))
43
+
44
+ return schemas[:10] # Limit
45
+
46
+
47
+ def validate_prisma_schema(file_path: Path) -> list:
48
+ """Validate Prisma schema file."""
49
+ issues = []
50
+
51
+ try:
52
+ content = file_path.read_text(encoding='utf-8', errors='ignore')
53
+
54
+ # Find all models
55
+ models = re.findall(r'model\s+(\w+)\s*{([^}]+)}', content, re.DOTALL)
56
+
57
+ for model_name, model_body in models:
58
+ # Check naming convention (PascalCase)
59
+ if not model_name[0].isupper():
60
+ issues.append(f"Model '{model_name}' should be PascalCase")
61
+
62
+ # Check for id field
63
+ if '@id' not in model_body and 'id' not in model_body.lower():
64
+ issues.append(f"Model '{model_name}' might be missing @id field")
65
+
66
+ # Check for createdAt/updatedAt
67
+ if 'createdAt' not in model_body and 'created_at' not in model_body:
68
+ issues.append(f"Model '{model_name}' missing createdAt field (recommended)")
69
+
70
+ # Check for @relation without fields
71
+ relations = re.findall(r'@relation\([^)]*\)', model_body)
72
+ for rel in relations:
73
+ if 'fields:' not in rel and 'references:' not in rel:
74
+ pass # Implicit relation, ok
75
+
76
+ # Check for @@index suggestions
77
+ foreign_keys = re.findall(r'(\w+Id)\s+\w+', model_body)
78
+ for fk in foreign_keys:
79
+ if f'@@index([{fk}])' not in content and f'@@index(["{fk}"])' not in content:
80
+ issues.append(f"Consider adding @@index([{fk}]) for better query performance in {model_name}")
81
+
82
+ # Check for enum definitions
83
+ enums = re.findall(r'enum\s+(\w+)\s*{', content)
84
+ for enum_name in enums:
85
+ if not enum_name[0].isupper():
86
+ issues.append(f"Enum '{enum_name}' should be PascalCase")
87
+
88
+ except Exception as e:
89
+ issues.append(f"Error reading schema: {str(e)[:50]}")
90
+
91
+ return issues
92
+
93
+
94
+ def main():
95
+ project_path = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
96
+
97
+ print(f"\n{'='*60}")
98
+ print(f"[SCHEMA VALIDATOR] Database Schema Validation")
99
+ print(f"{'='*60}")
100
+ print(f"Project: {project_path}")
101
+ print(f"Time: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}")
102
+ print("-"*60)
103
+
104
+ # Find schema files
105
+ schemas = find_schema_files(project_path)
106
+ print(f"Found {len(schemas)} schema files")
107
+
108
+ if not schemas:
109
+ output = {
110
+ "script": "schema_validator",
111
+ "project": str(project_path),
112
+ "schemas_checked": 0,
113
+ "issues_found": 0,
114
+ "passed": True,
115
+ "message": "No schema files found"
116
+ }
117
+ print(json.dumps(output, indent=2))
118
+ sys.exit(0)
119
+
120
+ # Validate each schema
121
+ all_issues = []
122
+
123
+ for schema_type, file_path in schemas:
124
+ print(f"\nValidating: {file_path.name} ({schema_type})")
125
+
126
+ if schema_type == 'prisma':
127
+ issues = validate_prisma_schema(file_path)
128
+ else:
129
+ issues = [] # Drizzle validation could be added
130
+
131
+ if issues:
132
+ all_issues.append({
133
+ "file": str(file_path.name),
134
+ "type": schema_type,
135
+ "issues": issues
136
+ })
137
+
138
+ # Summary
139
+ print("\n" + "="*60)
140
+ print("SCHEMA ISSUES")
141
+ print("="*60)
142
+
143
+ if all_issues:
144
+ for item in all_issues:
145
+ print(f"\n{item['file']} ({item['type']}):")
146
+ for issue in item["issues"][:5]: # Limit per file
147
+ print(f" - {issue}")
148
+ if len(item["issues"]) > 5:
149
+ print(f" ... and {len(item['issues']) - 5} more issues")
150
+ else:
151
+ print("No schema issues found!")
152
+
153
+ total_issues = sum(len(item["issues"]) for item in all_issues)
154
+ # Schema issues are warnings, not failures
155
+ passed = True
156
+
157
+ output = {
158
+ "script": "schema_validator",
159
+ "project": str(project_path),
160
+ "schemas_checked": len(schemas),
161
+ "issues_found": total_issues,
162
+ "passed": passed,
163
+ "issues": all_issues
164
+ }
165
+
166
+ print("\n" + json.dumps(output, indent=2))
167
+
168
+ sys.exit(0)
169
+
170
+
171
+ if __name__ == "__main__":
172
+ main()
@@ -0,0 +1,198 @@
1
+ ---
2
+ name: react-patterns
3
+ description: Modern React patterns and principles. Hooks, composition, performance, TypeScript best practices.
4
+ allowed-tools: Read, Write, Edit, Glob, Grep
5
+ ---
6
+
7
+ # React Patterns
8
+
9
+ > Principles for building production-ready React applications.
10
+
11
+ ---
12
+
13
+ ## 1. Component Design Principles
14
+
15
+ ### Component Types
16
+
17
+ | Type | Use | State |
18
+ |------|-----|-------|
19
+ | **Server** | Data fetching, static | None |
20
+ | **Client** | Interactivity | useState, effects |
21
+ | **Presentational** | UI display | Props only |
22
+ | **Container** | Logic/state | Heavy state |
23
+
24
+ ### Design Rules
25
+
26
+ - One responsibility per component
27
+ - Props down, events up
28
+ - Composition over inheritance
29
+ - Prefer small, focused components
30
+
31
+ ---
32
+
33
+ ## 2. Hook Patterns
34
+
35
+ ### When to Extract Hooks
36
+
37
+ | Pattern | Extract When |
38
+ |---------|-------------|
39
+ | **useLocalStorage** | Same storage logic needed |
40
+ | **useDebounce** | Multiple debounced values |
41
+ | **useFetch** | Repeated fetch patterns |
42
+ | **useForm** | Complex form state |
43
+
44
+ ### Hook Rules
45
+
46
+ - Hooks at top level only
47
+ - Same order every render
48
+ - Custom hooks start with "use"
49
+ - Clean up effects on unmount
50
+
51
+ ---
52
+
53
+ ## 3. State Management Selection
54
+
55
+ | Complexity | Solution |
56
+ |------------|----------|
57
+ | Simple | useState, useReducer |
58
+ | Shared local | Context |
59
+ | Server state | React Query, SWR |
60
+ | Complex global | Zustand, Redux Toolkit |
61
+
62
+ ### State Placement
63
+
64
+ | Scope | Where |
65
+ |-------|-------|
66
+ | Single component | useState |
67
+ | Parent-child | Lift state up |
68
+ | Subtree | Context |
69
+ | App-wide | Global store |
70
+
71
+ ---
72
+
73
+ ## 4. React 19 Patterns
74
+
75
+ ### New Hooks
76
+
77
+ | Hook | Purpose |
78
+ |------|---------|
79
+ | **useActionState** | Form submission state |
80
+ | **useOptimistic** | Optimistic UI updates |
81
+ | **use** | Read resources in render |
82
+
83
+ ### Compiler Benefits
84
+
85
+ - Automatic memoization
86
+ - Less manual useMemo/useCallback
87
+ - Focus on pure components
88
+
89
+ ---
90
+
91
+ ## 5. Composition Patterns
92
+
93
+ ### Compound Components
94
+
95
+ - Parent provides context
96
+ - Children consume context
97
+ - Flexible slot-based composition
98
+ - Example: Tabs, Accordion, Dropdown
99
+
100
+ ### Render Props vs Hooks
101
+
102
+ | Use Case | Prefer |
103
+ |----------|--------|
104
+ | Reusable logic | Custom hook |
105
+ | Render flexibility | Render props |
106
+ | Cross-cutting | Higher-order component |
107
+
108
+ ---
109
+
110
+ ## 6. Performance Principles
111
+
112
+ ### When to Optimize
113
+
114
+ | Signal | Action |
115
+ |--------|--------|
116
+ | Slow renders | Profile first |
117
+ | Large lists | Virtualize |
118
+ | Expensive calc | useMemo |
119
+ | Stable callbacks | useCallback |
120
+
121
+ ### Optimization Order
122
+
123
+ 1. Check if actually slow
124
+ 2. Profile with DevTools
125
+ 3. Identify bottleneck
126
+ 4. Apply targeted fix
127
+
128
+ ---
129
+
130
+ ## 7. Error Handling
131
+
132
+ ### Error Boundary Usage
133
+
134
+ | Scope | Placement |
135
+ |-------|-----------|
136
+ | App-wide | Root level |
137
+ | Feature | Route/feature level |
138
+ | Component | Around risky component |
139
+
140
+ ### Error Recovery
141
+
142
+ - Show fallback UI
143
+ - Log error
144
+ - Offer retry option
145
+ - Preserve user data
146
+
147
+ ---
148
+
149
+ ## 8. TypeScript Patterns
150
+
151
+ ### Props Typing
152
+
153
+ | Pattern | Use |
154
+ |---------|-----|
155
+ | Interface | Component props |
156
+ | Type | Unions, complex |
157
+ | Generic | Reusable components |
158
+
159
+ ### Common Types
160
+
161
+ | Need | Type |
162
+ |------|------|
163
+ | Children | ReactNode |
164
+ | Event handler | MouseEventHandler |
165
+ | Ref | RefObject<Element> |
166
+
167
+ ---
168
+
169
+ ## 9. Testing Principles
170
+
171
+ | Level | Focus |
172
+ |-------|-------|
173
+ | Unit | Pure functions, hooks |
174
+ | Integration | Component behavior |
175
+ | E2E | User flows |
176
+
177
+ ### Test Priorities
178
+
179
+ - User-visible behavior
180
+ - Edge cases
181
+ - Error states
182
+ - Accessibility
183
+
184
+ ---
185
+
186
+ ## 10. Anti-Patterns
187
+
188
+ | ❌ Don't | ✅ Do |
189
+ |----------|-------|
190
+ | Prop drilling deep | Use context |
191
+ | Giant components | Split smaller |
192
+ | useEffect for everything | Server components |
193
+ | Premature optimization | Profile first |
194
+ | Index as key | Stable unique ID |
195
+
196
+ ---
197
+
198
+ > **Remember:** React is about composition. Build small, combine thoughtfully.
@@ -0,0 +1,152 @@
1
+ ---
2
+ name: plan-writing
3
+ description: Structured task planning with clear breakdowns, dependencies, and verification criteria. Use when implementing features, refactoring, or any multi-step work.
4
+ allowed-tools: Read, Glob, Grep
5
+ ---
6
+
7
+ # Plan Writing
8
+
9
+ > Source: obra/superpowers
10
+
11
+ ## Overview
12
+ This skill provides a framework for breaking down work into clear, actionable tasks with verification criteria.
13
+
14
+ ## Task Breakdown Principles
15
+
16
+ ### 1. Small, Focused Tasks
17
+ - Each task should take 2-5 minutes
18
+ - One clear outcome per task
19
+ - Independently verifiable
20
+
21
+ ### 2. Clear Verification
22
+ - How do you know it's done?
23
+ - What can you check/test?
24
+ - What's the expected output?
25
+
26
+ ### 3. Logical Ordering
27
+ - Dependencies identified
28
+ - Parallel work where possible
29
+ - Critical path highlighted
30
+ - **Phase X: Verification is always LAST**
31
+
32
+ ### 4. Dynamic Naming in Project Root
33
+ - Plan files are saved as `{task-slug}.md` in the PROJECT ROOT
34
+ - Name derived from task (e.g., "add auth" → `auth-feature.md`)
35
+ - **NEVER** inside `.claude/`, `docs/`, or temp folders
36
+
37
+ ## Planning Principles (NOT Templates!)
38
+
39
+ > 🔴 **NO fixed templates. Each plan is UNIQUE to the task.**
40
+
41
+ ### Principle 1: Keep It SHORT
42
+
43
+ | ❌ Wrong | ✅ Right |
44
+ |----------|----------|
45
+ | 50 tasks with sub-sub-tasks | 5-10 clear tasks max |
46
+ | Every micro-step listed | Only actionable items |
47
+ | Verbose descriptions | One-line per task |
48
+
49
+ > **Rule:** If plan is longer than 1 page, it's too long. Simplify.
50
+
51
+ ---
52
+
53
+ ### Principle 2: Be SPECIFIC, Not Generic
54
+
55
+ | ❌ Wrong | ✅ Right |
56
+ |----------|----------|
57
+ | "Set up project" | "Run `npx create-next-app`" |
58
+ | "Add authentication" | "Install next-auth, create `/api/auth/[...nextauth].ts`" |
59
+ | "Style the UI" | "Add Tailwind classes to `Header.tsx`" |
60
+
61
+ > **Rule:** Each task should have a clear, verifiable outcome.
62
+
63
+ ---
64
+
65
+ ### Principle 3: Dynamic Content Based on Project Type
66
+
67
+ **For NEW PROJECT:**
68
+ - What tech stack? (decide first)
69
+ - What's the MVP? (minimal features)
70
+ - What's the file structure?
71
+
72
+ **For FEATURE ADDITION:**
73
+ - Which files are affected?
74
+ - What dependencies needed?
75
+ - How to verify it works?
76
+
77
+ **For BUG FIX:**
78
+ - What's the root cause?
79
+ - What file/line to change?
80
+ - How to test the fix?
81
+
82
+ ---
83
+
84
+ ### Principle 4: Scripts Are Project-Specific
85
+
86
+ > 🔴 **DO NOT copy-paste script commands. Choose based on project type.**
87
+
88
+ | Project Type | Relevant Scripts |
89
+ |--------------|------------------|
90
+ | Frontend/React | `ux_audit.py`, `accessibility_checker.py` |
91
+ | Backend/API | `api_validator.py`, `security_scan.py` |
92
+ | Mobile | `mobile_audit.py` |
93
+ | Database | `schema_validator.py` |
94
+ | Full-stack | Mix of above based on what you touched |
95
+
96
+ **Wrong:** Adding all scripts to every plan
97
+ **Right:** Only scripts relevant to THIS task
98
+
99
+ ---
100
+
101
+ ### Principle 5: Verification is Simple
102
+
103
+ | ❌ Wrong | ✅ Right |
104
+ |----------|----------|
105
+ | "Verify the component works correctly" | "Run `npm run dev`, click button, see toast" |
106
+ | "Test the API" | "curl localhost:3000/api/users returns 200" |
107
+ | "Check styles" | "Open browser, verify dark mode toggle works" |
108
+
109
+ ---
110
+
111
+ ## Plan Structure (Flexible, Not Fixed!)
112
+
113
+ ```
114
+ # [Task Name]
115
+
116
+ ## Goal
117
+ One sentence: What are we building/fixing?
118
+
119
+ ## Tasks
120
+ - [ ] Task 1: [Specific action] → Verify: [How to check]
121
+ - [ ] Task 2: [Specific action] → Verify: [How to check]
122
+ - [ ] Task 3: [Specific action] → Verify: [How to check]
123
+
124
+ ## Done When
125
+ - [ ] [Main success criteria]
126
+ ```
127
+
128
+ > **That's it.** No phases, no sub-sections unless truly needed.
129
+ > Keep it minimal. Add complexity only when required.
130
+
131
+ ## Notes
132
+ [Any important considerations]
133
+ ```
134
+
135
+ ---
136
+
137
+ ## Best Practices (Quick Reference)
138
+
139
+ 1. **Start with goal** - What are we building/fixing?
140
+ 2. **Max 10 tasks** - If more, break into multiple plans
141
+ 3. **Each task verifiable** - Clear "done" criteria
142
+ 4. **Project-specific** - No copy-paste templates
143
+ 5. **Update as you go** - Mark `[x]` when complete
144
+
145
+ ---
146
+
147
+ ## When to Use
148
+
149
+ - New project from scratch
150
+ - Adding a feature
151
+ - Fixing a bug (if complex)
152
+ - Refactoring multiple files
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riligar/agents-kit",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },