@riligar/agents-kit 1.10.0 → 1.11.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.
- package/.agent/skills/riligar-business-startup/SKILL.md +70 -0
- package/.agent/skills/{riligar-business-startup-analyst/SKILL.md → riligar-business-startup/references/business-case.md} +24 -251
- package/.agent/skills/riligar-business-startup/references/financial-model.md +215 -0
- package/.agent/skills/riligar-business-startup/references/market-analysis.md +151 -0
- package/.agent/skills/riligar-dev-clean-code/SKILL.md +81 -133
- package/package.json +1 -1
- package/.agent/skills/riligar-business-startup-financial/SKILL.md +0 -391
- package/.agent/skills/riligar-business-startup-market/SKILL.md +0 -265
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
# Financial Projections
|
|
2
|
+
|
|
3
|
+
Create comprehensive 3-5 year financial model with revenue projections, cost structure, headcount planning, cash flow analysis, and three-scenario modeling.
|
|
4
|
+
|
|
5
|
+
## What This Module Creates
|
|
6
|
+
|
|
7
|
+
1. Cohort-based revenue projections
|
|
8
|
+
2. Detailed cost structure (COGS, S&M, R&D, G&A)
|
|
9
|
+
3. Headcount planning by role
|
|
10
|
+
4. Monthly cash flow analysis
|
|
11
|
+
5. Key metrics (CAC, LTV, burn rate, runway)
|
|
12
|
+
6. Three-scenario analysis
|
|
13
|
+
|
|
14
|
+
## Step 1: Gather Inputs
|
|
15
|
+
|
|
16
|
+
**Business Model:**
|
|
17
|
+
- Revenue model (SaaS, marketplace, transaction)
|
|
18
|
+
- Pricing structure (tiers, average price)
|
|
19
|
+
- Target customer segments
|
|
20
|
+
|
|
21
|
+
**Starting Point:**
|
|
22
|
+
- Current MRR/ARR (if any)
|
|
23
|
+
- Current customer count
|
|
24
|
+
- Current team size
|
|
25
|
+
- Current cash balance
|
|
26
|
+
|
|
27
|
+
**Growth Assumptions:**
|
|
28
|
+
- Expected monthly customer acquisition
|
|
29
|
+
- Customer retention/churn rate
|
|
30
|
+
- Average contract value (ACV)
|
|
31
|
+
- Sales cycle length
|
|
32
|
+
|
|
33
|
+
**Cost Assumptions:**
|
|
34
|
+
- Gross margin or COGS %
|
|
35
|
+
- S&M budget or CAC target
|
|
36
|
+
- Current burn rate
|
|
37
|
+
|
|
38
|
+
**Funding:**
|
|
39
|
+
- Planned fundraising (amount, timing)
|
|
40
|
+
- Pre/post-money valuation
|
|
41
|
+
|
|
42
|
+
## Step 2: Build Revenue Model
|
|
43
|
+
|
|
44
|
+
### Cohort-Based Approach
|
|
45
|
+
|
|
46
|
+
For each month, track:
|
|
47
|
+
1. New customers acquired
|
|
48
|
+
2. Existing customers retained (apply churn)
|
|
49
|
+
3. Revenue per cohort (customers × ARPU)
|
|
50
|
+
4. Expansion revenue (upsells)
|
|
51
|
+
|
|
52
|
+
**Formula:**
|
|
53
|
+
```
|
|
54
|
+
MRR (Month N) = Σ across all cohorts:
|
|
55
|
+
(Cohort Size × Retention Rate × ARPU) + Expansion
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Project:**
|
|
59
|
+
- Monthly detail for Year 1-2
|
|
60
|
+
- Quarterly detail for Year 3
|
|
61
|
+
- Annual for Years 4-5
|
|
62
|
+
|
|
63
|
+
## Step 3: Cost Structure
|
|
64
|
+
|
|
65
|
+
### 1. Cost of Goods Sold (COGS)
|
|
66
|
+
- Hosting/infrastructure
|
|
67
|
+
- Payment processing
|
|
68
|
+
- Variable customer support
|
|
69
|
+
- Third-party services
|
|
70
|
+
|
|
71
|
+
Target gross margin:
|
|
72
|
+
- SaaS: 75-85%
|
|
73
|
+
- Marketplace: 60-70%
|
|
74
|
+
- E-commerce: 40-60%
|
|
75
|
+
|
|
76
|
+
### 2. Sales & Marketing (S&M)
|
|
77
|
+
- Sales team compensation
|
|
78
|
+
- Marketing programs
|
|
79
|
+
- Tools and software
|
|
80
|
+
- Target: 40-60% of revenue (early stage)
|
|
81
|
+
|
|
82
|
+
### 3. Research & Development (R&D)
|
|
83
|
+
- Engineering team
|
|
84
|
+
- Product management
|
|
85
|
+
- Design
|
|
86
|
+
- Target: 30-40% of revenue
|
|
87
|
+
|
|
88
|
+
### 4. General & Administrative (G&A)
|
|
89
|
+
- Executive team
|
|
90
|
+
- Finance, legal, HR
|
|
91
|
+
- Office and facilities
|
|
92
|
+
- Target: 15-25% of revenue
|
|
93
|
+
|
|
94
|
+
## Step 4: Headcount Planning
|
|
95
|
+
|
|
96
|
+
**For each role:**
|
|
97
|
+
- Title and department
|
|
98
|
+
- Start date (month/quarter)
|
|
99
|
+
- Base salary
|
|
100
|
+
- Fully-loaded cost (salary × 1.3-1.4)
|
|
101
|
+
|
|
102
|
+
**Departmental ratios:**
|
|
103
|
+
- Engineering: 40-50% of team
|
|
104
|
+
- Sales & Marketing: 25-35%
|
|
105
|
+
- G&A: 10-15%
|
|
106
|
+
- Product/CS: 10-15%
|
|
107
|
+
|
|
108
|
+
## Step 5: Cash Flow
|
|
109
|
+
|
|
110
|
+
Monthly cash flow projection:
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
Beginning Cash Balance
|
|
114
|
+
+ Cash Collected (revenue, consider payment terms)
|
|
115
|
+
- Operating Expenses
|
|
116
|
+
- CapEx
|
|
117
|
+
= Ending Cash Balance
|
|
118
|
+
|
|
119
|
+
Monthly Burn = Revenue - Expenses (if negative)
|
|
120
|
+
Runway = Cash Balance / Monthly Burn Rate
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**Include Funding Events:**
|
|
124
|
+
- Timing of raises
|
|
125
|
+
- Amount raised
|
|
126
|
+
- Impact on cash balance
|
|
127
|
+
|
|
128
|
+
## Step 6: Key Metrics
|
|
129
|
+
|
|
130
|
+
### Unit Economics
|
|
131
|
+
- CAC (S&M spend / new customers)
|
|
132
|
+
- LTV (ARPU × margin% / churn rate)
|
|
133
|
+
- LTV:CAC ratio (target > 3.0)
|
|
134
|
+
- CAC payback period (target < 18 months)
|
|
135
|
+
|
|
136
|
+
### Efficiency Metrics
|
|
137
|
+
- Burn multiple (net burn / net new ARR) - target < 2.0
|
|
138
|
+
- Magic number (net new ARR / S&M spend) - target > 0.5
|
|
139
|
+
- Rule of 40 (growth% + margin%) - target > 40%
|
|
140
|
+
|
|
141
|
+
### Cash Metrics
|
|
142
|
+
- Monthly burn rate
|
|
143
|
+
- Runway in months
|
|
144
|
+
|
|
145
|
+
## Step 7: Three Scenarios
|
|
146
|
+
|
|
147
|
+
### Conservative (P10)
|
|
148
|
+
- New customers: -30% vs. base
|
|
149
|
+
- Churn: +20% vs. base
|
|
150
|
+
- Pricing: -15% vs. base
|
|
151
|
+
- CAC: +25% vs. base
|
|
152
|
+
|
|
153
|
+
### Base (P50)
|
|
154
|
+
- Most likely assumptions
|
|
155
|
+
- Primary planning scenario
|
|
156
|
+
|
|
157
|
+
### Optimistic (P90)
|
|
158
|
+
- New customers: +30% vs. base
|
|
159
|
+
- Churn: -20% vs. base
|
|
160
|
+
- Pricing: +15% vs. base
|
|
161
|
+
- CAC: -25% vs. base
|
|
162
|
+
|
|
163
|
+
## Report Tables
|
|
164
|
+
|
|
165
|
+
### Revenue Projections
|
|
166
|
+
```
|
|
167
|
+
| Month | New Customers | Total Customers | MRR | ARR | Growth % |
|
|
168
|
+
|-------|---------------|-----------------|-----|-----|----------|
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Cost Breakdown
|
|
172
|
+
```
|
|
173
|
+
| Department | Year 1 | Year 2 | Year 3 | % Revenue |
|
|
174
|
+
|------------|--------|--------|--------|-----------|
|
|
175
|
+
| COGS | $X | $Y | $Z | XX% |
|
|
176
|
+
| S&M | $X | $Y | $Z | XX% |
|
|
177
|
+
| R&D | $X | $Y | $Z | XX% |
|
|
178
|
+
| G&A | $X | $Y | $Z | XX% |
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### Key Metrics
|
|
182
|
+
```
|
|
183
|
+
| Metric | Year 1 | Year 2 | Year 3 | Target |
|
|
184
|
+
|--------|--------|--------|--------|--------|
|
|
185
|
+
| CAC | $X | $Y | $Z | <$A |
|
|
186
|
+
| LTV | $X | $Y | $Z | >$B |
|
|
187
|
+
| LTV:CAC | X | Y | Z | >3.0 |
|
|
188
|
+
| Burn Multiple | X | Y | Z | <2.0 |
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Scenario Comparison
|
|
192
|
+
```
|
|
193
|
+
| Scenario | Year 3 ARR | Customers | Burn | Runway |
|
|
194
|
+
|----------|------------|-----------|------|--------|
|
|
195
|
+
| Conservative | $X | Y | $Z | W mo |
|
|
196
|
+
| Base | $X | Y | $Z | W mo |
|
|
197
|
+
| Optimistic | $X | Y | $Z | W mo |
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Best Practices
|
|
201
|
+
|
|
202
|
+
**Do:**
|
|
203
|
+
- Use cohort-based revenue model
|
|
204
|
+
- Include 3 scenarios
|
|
205
|
+
- Show monthly detail (Year 1-2)
|
|
206
|
+
- Calculate key metrics
|
|
207
|
+
- Validate against benchmarks
|
|
208
|
+
- Document all assumptions
|
|
209
|
+
|
|
210
|
+
**Don't:**
|
|
211
|
+
- Be overly optimistic on growth
|
|
212
|
+
- Underestimate costs
|
|
213
|
+
- Forget fully-loaded compensation
|
|
214
|
+
- Ignore cash timing
|
|
215
|
+
- Skip scenario analysis
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# Market Opportunity Analysis
|
|
2
|
+
|
|
3
|
+
Generate comprehensive market opportunity analysis with TAM/SAM/SOM calculations using both bottom-up and top-down methodologies.
|
|
4
|
+
|
|
5
|
+
## Process Overview
|
|
6
|
+
|
|
7
|
+
1. Define the target market and customer segments
|
|
8
|
+
2. Gather relevant market data
|
|
9
|
+
3. Calculate TAM using bottom-up methodology
|
|
10
|
+
4. Validate with top-down analysis
|
|
11
|
+
5. Narrow to SAM with appropriate filters
|
|
12
|
+
6. Estimate realistic SOM (3-5 year opportunity)
|
|
13
|
+
7. Present findings in a formatted report
|
|
14
|
+
|
|
15
|
+
## Step 1: Gather Context
|
|
16
|
+
|
|
17
|
+
Ask for essential information:
|
|
18
|
+
|
|
19
|
+
**Product/Service:**
|
|
20
|
+
- What problem is being solved?
|
|
21
|
+
- How does pricing work? (subscription, transaction, etc.)
|
|
22
|
+
|
|
23
|
+
**Target Customers:**
|
|
24
|
+
- Who is the ideal customer? (industry, size, geography)
|
|
25
|
+
- Initial target market (US, North America, Global)
|
|
26
|
+
|
|
27
|
+
**Stage:**
|
|
28
|
+
- What stage is the company? (pre-launch, seed, Series A)
|
|
29
|
+
|
|
30
|
+
## Step 2: Bottom-Up Analysis
|
|
31
|
+
|
|
32
|
+
### For B2B/SaaS
|
|
33
|
+
|
|
34
|
+
1. Define customer segments (company size, industry, use case)
|
|
35
|
+
2. Estimate number of companies in each segment
|
|
36
|
+
3. Determine average contract value (ACV) per segment
|
|
37
|
+
4. Calculate TAM: Σ (Segment Size × ACV)
|
|
38
|
+
|
|
39
|
+
### For Consumer/Marketplace
|
|
40
|
+
|
|
41
|
+
1. Define target user demographics
|
|
42
|
+
2. Estimate total addressable users
|
|
43
|
+
3. Determine average revenue per user (ARPU)
|
|
44
|
+
4. Calculate TAM: Total Users × ARPU × Frequency
|
|
45
|
+
|
|
46
|
+
### For Transactions/E-commerce
|
|
47
|
+
|
|
48
|
+
1. Estimate total transaction volume (GMV)
|
|
49
|
+
2. Determine take rate or margin
|
|
50
|
+
3. Calculate TAM: Total GMV × Take Rate
|
|
51
|
+
|
|
52
|
+
## Step 3: Data Sources
|
|
53
|
+
|
|
54
|
+
Recommended sources:
|
|
55
|
+
- Government data (Census, BLS)
|
|
56
|
+
- Industry reports (Gartner, Forrester, Statista)
|
|
57
|
+
- Public company filings (10-K reports)
|
|
58
|
+
- Trade associations
|
|
59
|
+
- Academic research
|
|
60
|
+
|
|
61
|
+
**Always cite sources with URLs and publication dates.**
|
|
62
|
+
|
|
63
|
+
## Step 4: Top-Down Validation
|
|
64
|
+
|
|
65
|
+
1. Find total market category size from research
|
|
66
|
+
2. Apply geographic filters
|
|
67
|
+
3. Apply segment/product filters
|
|
68
|
+
4. Compare to bottom-up TAM (should be within 30%)
|
|
69
|
+
|
|
70
|
+
If variance > 30%, investigate and explain differences.
|
|
71
|
+
|
|
72
|
+
## Step 5: Calculate SAM
|
|
73
|
+
|
|
74
|
+
Apply realistic filters to narrow TAM:
|
|
75
|
+
|
|
76
|
+
- **Geographic:** Regions actually serviceable
|
|
77
|
+
- **Product Capability:** Features needed to serve
|
|
78
|
+
- **Market Readiness:** Customers ready to adopt
|
|
79
|
+
- **Addressable Switching:** Can reach and convert
|
|
80
|
+
|
|
81
|
+
Formula:
|
|
82
|
+
```
|
|
83
|
+
SAM = TAM × Geographic % × Product Fit % × Market Readiness %
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Step 6: Estimate SOM
|
|
87
|
+
|
|
88
|
+
Calculate realistic obtainable market share:
|
|
89
|
+
|
|
90
|
+
**Conservative Approach (Recommended):**
|
|
91
|
+
- Year 3: 2-3% of SAM
|
|
92
|
+
- Year 5: 4-6% of SAM
|
|
93
|
+
|
|
94
|
+
**Consider:**
|
|
95
|
+
- Competitive intensity
|
|
96
|
+
- Available resources (funding, team)
|
|
97
|
+
- Go-to-market effectiveness
|
|
98
|
+
- Differentiation strength
|
|
99
|
+
|
|
100
|
+
## Report Structure
|
|
101
|
+
|
|
102
|
+
### Section 1: Executive Summary
|
|
103
|
+
- Market opportunity in one paragraph
|
|
104
|
+
- TAM/SAM/SOM headline numbers
|
|
105
|
+
|
|
106
|
+
### Section 2: Market Definition
|
|
107
|
+
- Problem being solved
|
|
108
|
+
- Target customer profile
|
|
109
|
+
- Geographic scope
|
|
110
|
+
|
|
111
|
+
### Section 3: Bottom-Up Analysis
|
|
112
|
+
- Customer segment breakdown
|
|
113
|
+
- Segment sizing with sources
|
|
114
|
+
- TAM calculation with formula
|
|
115
|
+
|
|
116
|
+
### Section 4: Top-Down Validation
|
|
117
|
+
- Industry category and size
|
|
118
|
+
- Validated TAM
|
|
119
|
+
- Comparison to bottom-up
|
|
120
|
+
|
|
121
|
+
### Section 5: SAM Calculation
|
|
122
|
+
- Filters applied with rationale
|
|
123
|
+
- SAM formula and result
|
|
124
|
+
|
|
125
|
+
### Section 6: SOM Projection
|
|
126
|
+
- Market share assumptions
|
|
127
|
+
- Year 3 and Year 5 estimates
|
|
128
|
+
- Revenue projections
|
|
129
|
+
|
|
130
|
+
### Section 7: Market Growth
|
|
131
|
+
- Industry growth rate (CAGR)
|
|
132
|
+
- Key growth drivers
|
|
133
|
+
|
|
134
|
+
### Section 8: Validation
|
|
135
|
+
- Public company comparisons
|
|
136
|
+
- Competitive context
|
|
137
|
+
|
|
138
|
+
## Best Practices
|
|
139
|
+
|
|
140
|
+
**Do:**
|
|
141
|
+
- Start with bottom-up (most credible)
|
|
142
|
+
- Always triangulate with top-down
|
|
143
|
+
- Cite all data sources
|
|
144
|
+
- Be conservative on SOM
|
|
145
|
+
- Compare to public company benchmarks
|
|
146
|
+
|
|
147
|
+
**Don't:**
|
|
148
|
+
- Rely solely on top-down
|
|
149
|
+
- Cherry-pick optimistic data
|
|
150
|
+
- Claim >10% SOM without strong justification
|
|
151
|
+
- Skip validation steps
|
|
@@ -4,184 +4,132 @@ type: development
|
|
|
4
4
|
description: Pragmatic coding standards - concise, direct, no over-engineering, no unnecessary comments. CRITICAL skill that defines RiLiGar coding standards. Use when writing or reviewing any code.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Clean Code -
|
|
7
|
+
# Clean Code - RiLiGar Standards
|
|
8
8
|
|
|
9
|
-
> **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
|
|
9
|
+
> **CRITICAL SKILL** - Be **concise, direct, and solution-focused**.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
## Rules Reference
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
This skill builds on the foundational rules defined in `.agent/rules/`:
|
|
14
14
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
15
|
+
| Rule File | Content |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [code-style.md](../../rules/code-style.md) | Prettier formatting (4 spaces, no semi, single quotes) |
|
|
18
|
+
| [javascript-only.md](../../rules/javascript-only.md) | ES6+ only, no TypeScript |
|
|
19
|
+
| [naming-conventions.md](../../rules/naming-conventions.md) | PascalCase, camelCase, SCREAMING_SNAKE |
|
|
20
|
+
| [conventional-commits.md](../../rules/conventional-commits.md) | Commit message format |
|
|
21
|
+
| [pr-guidelines.md](../../rules/pr-guidelines.md) | Pull request standards |
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
| Prop | Value |
|
|
28
|
-
| ------------------ | -------- |
|
|
29
|
-
| **Indent Size** | 4 spaces |
|
|
30
|
-
| **Semicolons** | `false` |
|
|
31
|
-
| **Quotes** | Single |
|
|
32
|
-
| **Print Width** | 300 |
|
|
33
|
-
| **Trailing Comma** | `es5` |
|
|
25
|
+
## Core Principles
|
|
34
26
|
|
|
35
|
-
|
|
27
|
+
| Principle | Rule |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| **SRP** | Single Responsibility - each function/class does ONE thing |
|
|
30
|
+
| **DRY** | Don't Repeat Yourself - extract duplicates, reuse |
|
|
31
|
+
| **KISS** | Keep It Simple - simplest solution that works |
|
|
32
|
+
| **YAGNI** | You Aren't Gonna Need It - don't build unused features |
|
|
33
|
+
| **Boy Scout** | Leave code cleaner than you found it |
|
|
36
34
|
|
|
37
35
|
---
|
|
38
36
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
| Element | Convention |
|
|
42
|
-
| ------------- | ----------------------------------------------------- |
|
|
43
|
-
| **Variables** | Reveal intent: `userCount` not `n` |
|
|
44
|
-
| **Functions** | Verb + noun: `getUserById()` not `user()` |
|
|
45
|
-
| **Booleans** | Question form: `isActive`, `hasPermission`, `canEdit` |
|
|
46
|
-
| **Constants** | SCREAMING_SNAKE: `MAX_RETRY_COUNT` |
|
|
37
|
+
## Function Rules
|
|
47
38
|
|
|
48
|
-
|
|
39
|
+
| Rule | Description |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| **Small** | Max 20 lines, ideally 5-10 |
|
|
42
|
+
| **One Thing** | Does one thing, does it well |
|
|
43
|
+
| **One Level** | One level of abstraction per function |
|
|
44
|
+
| **Few Args** | Max 3 arguments, prefer 0-2 |
|
|
45
|
+
| **No Side Effects** | Don't mutate inputs unexpectedly |
|
|
46
|
+
| **Async/Await** | Prefer `async/await` over `.then()` chains |
|
|
49
47
|
|
|
50
48
|
---
|
|
51
49
|
|
|
52
|
-
##
|
|
50
|
+
## Code Structure
|
|
53
51
|
|
|
54
|
-
|
|
|
55
|
-
|
|
|
56
|
-
| **
|
|
57
|
-
| **
|
|
58
|
-
| **
|
|
59
|
-
| **
|
|
60
|
-
| **No Side Effects** | Don't mutate inputs unexpectedly |
|
|
61
|
-
| **Async/Await** | Prefer `async/await` over `.then()` chains |
|
|
52
|
+
| Pattern | Apply |
|
|
53
|
+
| --- | --- |
|
|
54
|
+
| **Guard Clauses** | Early returns for edge cases |
|
|
55
|
+
| **Flat > Nested** | Avoid deep nesting (max 2 levels) |
|
|
56
|
+
| **Composition** | Small functions composed together |
|
|
57
|
+
| **Colocation** | Keep related code close |
|
|
62
58
|
|
|
63
59
|
---
|
|
64
60
|
|
|
65
61
|
## Component & Framework Rules (React/Elysia)
|
|
66
62
|
|
|
67
|
-
| Situation
|
|
68
|
-
|
|
|
69
|
-
| **Complex Logic**
|
|
63
|
+
| Situation | Action |
|
|
64
|
+
| --- | --- |
|
|
65
|
+
| **Complex Logic** | Extract to a Custom Hook if logic > 15 lines |
|
|
70
66
|
| **State Management** | Use **Zustand** for global, `useState` for local |
|
|
71
|
-
| **UI Components**
|
|
72
|
-
| **API Endpoints**
|
|
73
|
-
| **Early Returns**
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Code Structure
|
|
78
|
-
|
|
79
|
-
| Pattern | Apply |
|
|
80
|
-
| ----------------- | --------------------------------- |
|
|
81
|
-
| **Guard Clauses** | Early returns for edge cases |
|
|
82
|
-
| **Flat > Nested** | Avoid deep nesting (max 2 levels) |
|
|
83
|
-
| **Composition** | Small functions composed together |
|
|
84
|
-
| **Colocation** | Keep related code close |
|
|
67
|
+
| **UI Components** | **ALWAYS** use Mantine. No custom/raw CSS. |
|
|
68
|
+
| **API Endpoints** | Extract complex handler logic to `services/` |
|
|
69
|
+
| **Early Returns** | Use Guard Clauses to avoid deep nesting |
|
|
85
70
|
|
|
86
71
|
---
|
|
87
72
|
|
|
88
73
|
## AI Coding Style
|
|
89
74
|
|
|
90
|
-
| Situation
|
|
91
|
-
|
|
|
92
|
-
| User asks for feature | Write it directly
|
|
93
|
-
| User reports bug
|
|
94
|
-
| No clear requirement
|
|
75
|
+
| Situation | Action |
|
|
76
|
+
| --- | --- |
|
|
77
|
+
| User asks for feature | Write it directly |
|
|
78
|
+
| User reports bug | Fix it, don't explain |
|
|
79
|
+
| No clear requirement | Ask, don't assume |
|
|
95
80
|
|
|
96
81
|
---
|
|
97
82
|
|
|
98
83
|
## Anti-Patterns (DON'T)
|
|
99
84
|
|
|
100
|
-
|
|
|
101
|
-
|
|
|
102
|
-
| Comment every line
|
|
103
|
-
| Helper for one-liner
|
|
104
|
-
| Factory for 2 objects
|
|
105
|
-
| `utils.js` (1 function) | Put code where used
|
|
106
|
-
| "First we import..."
|
|
107
|
-
| Deep nesting
|
|
108
|
-
| Magic numbers
|
|
109
|
-
| God functions
|
|
110
|
-
| TypeScript / `.ts` | Use Vanilla JavaScript (`.js`) |
|
|
85
|
+
| Pattern | Fix |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| Comment every line | Delete obvious comments |
|
|
88
|
+
| Helper for one-liner | Inline the code |
|
|
89
|
+
| Factory for 2 objects | Direct instantiation |
|
|
90
|
+
| `utils.js` (1 function) | Put code where used |
|
|
91
|
+
| "First we import..." | Just write code |
|
|
92
|
+
| Deep nesting | Guard clauses |
|
|
93
|
+
| Magic numbers | Named constants |
|
|
94
|
+
| God functions | Split by responsibility |
|
|
111
95
|
|
|
112
96
|
---
|
|
113
97
|
|
|
114
|
-
##
|
|
98
|
+
## Before Editing ANY File
|
|
115
99
|
|
|
116
|
-
**
|
|
100
|
+
**Ask yourself:**
|
|
117
101
|
|
|
118
|
-
| Question
|
|
119
|
-
|
|
|
120
|
-
| **What imports this file?**
|
|
121
|
-
| **What does this file import?** | Interface changes
|
|
102
|
+
| Question | Why |
|
|
103
|
+
| --- | --- |
|
|
104
|
+
| **What imports this file?** | They might break |
|
|
105
|
+
| **What does this file import?** | Interface changes |
|
|
122
106
|
| **Is this a shared component?** | Multiple places affected |
|
|
123
107
|
|
|
124
|
-
**
|
|
125
|
-
|
|
126
|
-
```
|
|
127
|
-
File to edit: user-service.js
|
|
128
|
-
└── Who imports this? → user-controller.js
|
|
129
|
-
└── Do they need changes too? → Check function signatures
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
> 🔴 **Rule:** Edit the file + all dependent files in the SAME task.
|
|
108
|
+
> **Rule:** Edit the file + all dependent files in the SAME task.
|
|
133
109
|
|
|
134
110
|
---
|
|
135
111
|
|
|
136
|
-
##
|
|
137
|
-
|
|
138
|
-
| Do | Don't |
|
|
139
|
-
| ---------------------- | ------------------------- |
|
|
140
|
-
| Write code directly | Write tutorials |
|
|
141
|
-
| Let code self-document | Add obvious comments |
|
|
142
|
-
| Fix bugs immediately | Explain the fix first |
|
|
143
|
-
| Inline small things | Create unnecessary files |
|
|
144
|
-
| Name things clearly | Use abbreviations |
|
|
145
|
-
| Keep functions small | Write 100+ line functions |
|
|
112
|
+
## Self-Check Before Completing (MANDATORY)
|
|
146
113
|
|
|
147
|
-
|
|
114
|
+
| Check | Question |
|
|
115
|
+
| --- | --- |
|
|
116
|
+
| **Goal met?** | Did I do exactly what user asked? |
|
|
117
|
+
| **Files edited?** | Did I modify all necessary files? |
|
|
118
|
+
| **Code works?** | Did I test/verify the change? |
|
|
119
|
+
| **No TypeScript?** | Verified no `.ts` or type syntax? |
|
|
120
|
+
| **Formatting?** | 4 spaces, no semi, single quotes? |
|
|
148
121
|
|
|
149
122
|
---
|
|
150
123
|
|
|
151
|
-
##
|
|
152
|
-
|
|
153
|
-
**Before saying "task complete", verify:**
|
|
154
|
-
|
|
155
|
-
| Check | Question |
|
|
156
|
-
| --------------------- | --------------------------------- |
|
|
157
|
-
| ✅ **Goal met?** | Did I do exactly what user asked? |
|
|
158
|
-
| ✅ **Files edited?** | Did I modify all necessary files? |
|
|
159
|
-
| ✅ **Code works?** | Did I test/verify the change? |
|
|
160
|
-
| ✅ **No TypeScript?** | Verified no `.ts` or type syntax? |
|
|
161
|
-
| ✅ **Formatting?** | 4 spaces, no semi, single quotes? |
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Verification Scripts (MANDATORY)
|
|
166
|
-
|
|
167
|
-
> 🔴 **CRITICAL:** Run only valid scripts found in `.agent/skills/*/scripts`.
|
|
168
|
-
|
|
169
|
-
### Agent → Script Mapping
|
|
170
|
-
|
|
171
|
-
| Agent | Script | Command |
|
|
172
|
-
| ---------------------- | --------------- | ------------------------------------------------------------------------- |
|
|
173
|
-
| **backend-specialist** | API Validator | `python .agent/skills/riligar-dev-backend/scripts/api_validator.py .` |
|
|
174
|
-
| **database-architect** | Schema Validate | `python .agent/skills/riligar-dev-database/scripts/schema_validator.py .` |
|
|
175
|
-
| **Any agent** | Lint Check | `bun x eslint .` |
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### 🔴 Script Output Handling (READ → SUMMARIZE → ASK)
|
|
180
|
-
|
|
181
|
-
**When running a validation script, you MUST:**
|
|
124
|
+
## Summary
|
|
182
125
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
126
|
+
| Do | Don't |
|
|
127
|
+
| --- | --- |
|
|
128
|
+
| Write code directly | Write tutorials |
|
|
129
|
+
| Let code self-document | Add obvious comments |
|
|
130
|
+
| Fix bugs immediately | Explain the fix first |
|
|
131
|
+
| Inline small things | Create unnecessary files |
|
|
132
|
+
| Name things clearly | Use abbreviations |
|
|
133
|
+
| Keep functions small | Write 100+ line functions |
|
|
186
134
|
|
|
187
|
-
>
|
|
135
|
+
> **Remember: The user wants working code, not a programming lesson.**
|