aayushus-skills 1.0.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/LICENSE +21 -0
- package/README.md +31 -0
- package/Solo Developer AI SOP.md +268 -0
- package/agent-config/CLAUDE.md +68 -0
- package/agent-config/README.md +89 -0
- package/agent-config/copilot-instructions.md +51 -0
- package/agent-config/howto.md +194 -0
- package/agent-config/project-templates/windsurfrules-blank +50 -0
- package/agent-config/project-templates/windsurfrules-node-prisma +73 -0
- package/agent-config/windsurfrules-global.md +128 -0
- package/agent-config/windsurfrules.md +155 -0
- package/cli.js +214 -0
- package/design/Icons.tsx +188 -0
- package/design/PRISM_MANIFESTO.md +131 -0
- package/design/README.md +55 -0
- package/design/SKILL.md +44 -0
- package/design/ai-surfaces.md +364 -0
- package/design/checklist.md +151 -0
- package/design/components.css +3163 -0
- package/design/components.tsx +2487 -0
- package/design/implementation-guide.md +181 -0
- package/design/mobile.css +550 -0
- package/design/package.json +28 -0
- package/design/patterns-desktop.md +752 -0
- package/design/patterns-mobile.md +480 -0
- package/design/tokens.css +225 -0
- package/design/tokens.md +515 -0
- package/guidelines/API-Design.md +95 -0
- package/guidelines/Architecture.md +1536 -0
- package/guidelines/Code-Quality.md +1776 -0
- package/guidelines/Container-Guidelines.md +72 -0
- package/guidelines/DECISION-Modular-Monolith.md +26 -0
- package/guidelines/Documentation.md +1330 -0
- package/guidelines/Engineering-Workflow.md +92 -0
- package/guidelines/Incident-Response.md +121 -0
- package/guidelines/Performance.md +1801 -0
- package/guidelines/Product-Management.md +88 -0
- package/guidelines/Security.md +1570 -0
- package/guidelines/TEMPLATE-Decision.md +20 -0
- package/guidelines/Testing.md +72 -0
- package/package.json +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aayush Mediratta
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# aayushus-skills
|
|
2
|
+
|
|
3
|
+
A zero-dependency interactive CLI to install custom AI agent configurations, design system templates, engineering guidelines, and SOPs into any target repository.
|
|
4
|
+
|
|
5
|
+
## Installation / Usage
|
|
6
|
+
|
|
7
|
+
Run the following command in your target project directory:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx aayushus-skills
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or to bypass the interactive menu and install everything automatically:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx aayushus-skills all
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Included Components
|
|
20
|
+
|
|
21
|
+
- **AI Agent Configurations**: Configures `.claudecoderc` (for global rules/prompts), `.windsurfrules`, `.windsurfrules-global`, `CLAUDE.md`, and `.github/copilot-instructions.md`.
|
|
22
|
+
- **Prism Design System**: Copies zero-decision B2B/SaaS design components and styling tokens (CSS/TSX) to `./src/design/` or `./design/`.
|
|
23
|
+
- **Development Guidelines**: Copies standard development docs (API Design, Architecture, Code Quality, Container Guidelines, Performance, Security, etc.) to `./docs/guidelines/`.
|
|
24
|
+
- **Solo Developer AI SOP**: Installs the `Solo-Developer-AI-SOP.md` file in the project root containing guidelines for budget management and AI escalation.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Attribution & Disclaimer
|
|
29
|
+
|
|
30
|
+
Please note that the design elements, guidelines, and templates included in the Prism Design System are not entirely original works. They have been collected, aggregated, and adapted from various online resources, design frameworks, and community best practices, and subsequently customized and refined to suit specific project requirements and agent workflows.
|
|
31
|
+
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
# Solo Developer AI SOP
|
|
2
|
+
|
|
3
|
+
### Standard Operating Procedure for AI-Assisted Development
|
|
4
|
+
|
|
5
|
+
_Budget: $20/mo ยท Stack: Multi-language ยท Intensity: Heavy (9-hour days)_
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Tool Stack
|
|
10
|
+
|
|
11
|
+
|Tool|Model|Cost|Purpose|
|
|
12
|
+
|---|---|---|---|
|
|
13
|
+
|**Claude Code** (terminal)|Opus 4.6|๐ฐ High โ use sparingly|Deep thinking, architecture, hard bugs|
|
|
14
|
+
|**Windsurf** (IDE)|SWE-1.5|๐ข Free|Daily coding, tab autocomplete|
|
|
15
|
+
|**Windsurf** (IDE)|Sonnet 4.6|๐ก Medium|Bridge when SWE-1.5 falls short|
|
|
16
|
+
|**Antigravity** (IDE)|Gemini Flash|๐ข Free|Workhorse โ routine work, large context|
|
|
17
|
+
|**Antigravity** (IDE)|Gemini Flash|๐ข Free|Parallel agents, background tasks|
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## The Golden Rule
|
|
22
|
+
|
|
23
|
+
> **Never jump straight to Opus.**
|
|
24
|
+
>
|
|
25
|
+
> The escalation ladder is: **SWE-1.5 โ Gemini Flash โ Sonnet 4.6 โ Opus 4.6**
|
|
26
|
+
>
|
|
27
|
+
> Most problems resolve at step 1 or 2. Opus is the last rung, not the first. If you reach for Opus out of habit, your monthly budget is gone by Wednesday.
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## The Decision Gate
|
|
32
|
+
|
|
33
|
+
Run this before every task:
|
|
34
|
+
|
|
35
|
+
### Is it mechanical?
|
|
36
|
+
|
|
37
|
+
_(generate, scaffold, rename, format, document, convert)_ โ **Gemini Flash** or **SWE-1.5** โ do not open Claude Code.
|
|
38
|
+
|
|
39
|
+
### Does it require reading a large codebase?
|
|
40
|
+
|
|
41
|
+
_(many files, orientation, blast radius analysis)_ โ **Gemini Flash in Antigravity** โ 2M token context, free. Dump the whole codebase.
|
|
42
|
+
|
|
43
|
+
### Is it ambiguous or complex with real tradeoffs?
|
|
44
|
+
|
|
45
|
+
- Hard to reverse โ **Opus 4.6** (architecture, data model, security design)
|
|
46
|
+
- Reversible โ Try **Sonnet 4.6** first. Escalate to Opus only if the answer feels wrong.
|
|
47
|
+
|
|
48
|
+
### Is it a hard bug with unclear root cause?
|
|
49
|
+
|
|
50
|
+
โ Try Flash + Sonnet first (30 min). Still stuck? โ **Opus 4.6** with a scoped prompt.
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 9-Hour Day Structure
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
09:00 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
58
|
+
Morning Opus Block [Opus 4.6]
|
|
59
|
+
Attack your hardest problem first.
|
|
60
|
+
Fresh 5-hour window โ don't waste it on easy tasks.
|
|
61
|
+
Use the prompt you wrote the night before.
|
|
62
|
+
|
|
63
|
+
10:30 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
64
|
+
Implementation Block [SWE-1.5 + Gemini Flash]
|
|
65
|
+
Execute what Opus designed.
|
|
66
|
+
Antigravity Manager running background tasks in parallel.
|
|
67
|
+
Stay in flow โ free models keep you there.
|
|
68
|
+
|
|
69
|
+
13:00 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
70
|
+
Lunch + Reset Window
|
|
71
|
+
5-hour Opus window resets at ~14:00 if you started at 09:00.
|
|
72
|
+
Don't tinker during lunch โ save the reset for the afternoon.
|
|
73
|
+
|
|
74
|
+
14:00 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
75
|
+
Afternoon Opus Block [Opus 4.6]
|
|
76
|
+
Second hard problem of the day โ if one exists.
|
|
77
|
+
If no hard problem: skip Opus entirely, use Flash/Sonnet.
|
|
78
|
+
|
|
79
|
+
15:30 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
80
|
+
Wind-Down Block [Gemini Flash + SWE-1.5]
|
|
81
|
+
Feature work, tests, cleanup, PR prep, docs.
|
|
82
|
+
Dispatch async tasks to Antigravity Manager.
|
|
83
|
+
Check on morning background agent results.
|
|
84
|
+
|
|
85
|
+
17:30 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
86
|
+
End-of-Day Ritual
|
|
87
|
+
Update CLAUDE.md with today's decisions.
|
|
88
|
+
Write tomorrow's Opus prompt while context is fresh.
|
|
89
|
+
Close all Antigravity agent sessions.
|
|
90
|
+
|
|
91
|
+
18:00 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Task Routing by Type
|
|
97
|
+
|
|
98
|
+
### ๐ข Free โ Gemini Flash (Antigravity) or SWE-1.5 (Windsurf)
|
|
99
|
+
|
|
100
|
+
|Task|Best Tool|Notes|
|
|
101
|
+
|---|---|---|
|
|
102
|
+
|New project setup โ structure, configs, CI, env|Gemini Flash|Any language|
|
|
103
|
+
|CRUD, endpoints, forms, simple components|SWE-1.5|In Windsurf|
|
|
104
|
+
|Tab autocomplete as you type|SWE-1-mini|Always on in Windsurf|
|
|
105
|
+
|Unit + integration test generation|Gemini Flash|Dispatch and forget|
|
|
106
|
+
|"What does this whole codebase do?"|Gemini Flash|2M context window โ best tool for this|
|
|
107
|
+
|Code review โ style, consistency, obvious bugs|Gemini Flash|Load full diff in Antigravity|
|
|
108
|
+
|Documentation, README, inline comments, changelogs|Gemini Flash||
|
|
109
|
+
|Exploring a library / summarising docs|Gemini Flash|Antigravity browser agent|
|
|
110
|
+
|Batch migrations โ rename, restructure, update imports|Gemini Flash|Antigravity parallel agents|
|
|
111
|
+
|Frontend visual testing / screenshots|Gemini Flash|Antigravity browser agent|
|
|
112
|
+
|
|
113
|
+
### ๐ก Medium โ Sonnet 4.6 (Windsurf)
|
|
114
|
+
|
|
115
|
+
|Task|When to escalate from Flash/SWE|
|
|
116
|
+
|---|---|
|
|
117
|
+
|Medium refactors, API integration|SWE-1.5 gives a wrong or incomplete answer|
|
|
118
|
+
|State management, data transforms|Needs more reasoning than SWE-1.5 can provide|
|
|
119
|
+
|Cross-file logic changes|More than ~5 files involved|
|
|
120
|
+
|
|
121
|
+
### ๐ด High โ Opus 4.6 (Claude Code terminal)
|
|
122
|
+
|
|
123
|
+
|Task|Why Opus|Notes|
|
|
124
|
+
|---|---|---|
|
|
125
|
+
|System architecture โ services, data flow, tech choices|Hard to reverse, high stakes|Spend budget here|
|
|
126
|
+
|Database schema, API contracts, auth strategy|Foundational decisions||
|
|
127
|
+
|Cross-language design decisions|Ambiguous, multiple valid approaches|Python vs Go, REST vs GraphQL|
|
|
128
|
+
|Hard bug โ unclear root cause|Multi-layer reasoning needed|After 30 min of Flash/Sonnet|
|
|
129
|
+
|Ambiguous requirement โ high-stakes design|Multiple valid designs, need tradeoff analysis||
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Opus 4.6 โ Before You Invoke
|
|
134
|
+
|
|
135
|
+
Before opening Claude Code for an Opus session, check:
|
|
136
|
+
|
|
137
|
+
- [ ] Have I already tried **Gemini Flash or SWE-1.5** on this? If not, start there.
|
|
138
|
+
- [ ] Is this decision **hard to reverse**? If easily rewritten in 10 min, it doesn't need Opus.
|
|
139
|
+
- [ ] Is the problem **ambiguous** or **complex**? Tedious โ complex. Large โ complex.
|
|
140
|
+
- [ ] Have I written a **tight, scoped prompt**? "Given X with constraint Y, what's the right approach for Z?" Not "look at my code and tell me what's wrong."
|
|
141
|
+
- [ ] Will I use `/compact` to keep the session lean? Don't carry yesterday's context.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Antigravity โ Parallel Agent Workflow
|
|
146
|
+
|
|
147
|
+
Antigravity's Manager view lets you run multiple agents asynchronously while you work on something else. These all run on Gemini Flash โ free.
|
|
148
|
+
|
|
149
|
+
**Dispatch and forget โ check back in 20โ30 min:**
|
|
150
|
+
|
|
151
|
+
- Generate test suite for a module you just finished
|
|
152
|
+
- Explore an unfamiliar library and summarise the API
|
|
153
|
+
- Migrate a naming pattern across all files in a directory
|
|
154
|
+
- Write docs for a module while you code the next one
|
|
155
|
+
- Run browser agent to visually test a UI change
|
|
156
|
+
- Orientation pass on a new codebase before you start work
|
|
157
|
+
|
|
158
|
+
**How to dispatch effectively:**
|
|
159
|
+
|
|
160
|
+
1. Give the agent a clear, bounded task with a defined deliverable
|
|
161
|
+
2. Point it at specific files or directories โ don't say "look at the whole project"
|
|
162
|
+
3. Specify the output format: "summarise as bullet points", "write as JSDoc", "output as a table"
|
|
163
|
+
4. Move on. Don't babysit it.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Claude Code โ Getting the Most from the 44K Window
|
|
168
|
+
|
|
169
|
+
The 5-hour token window is your most constrained resource. Protect it:
|
|
170
|
+
|
|
171
|
+
**Before the session:**
|
|
172
|
+
|
|
173
|
+
- Write your prompt the day before while context is fresh
|
|
174
|
+
- Scope it tightly โ one specific problem, not a broad investigation
|
|
175
|
+
- Use Gemini Flash to orient first ("what files are involved in X?"), then bring the specific question to Opus
|
|
176
|
+
|
|
177
|
+
**During the session:**
|
|
178
|
+
|
|
179
|
+
- Use `/compact` after each distinct problem โ don't accumulate a massive context thread
|
|
180
|
+
- Start a fresh session for each new problem
|
|
181
|
+
- If the session wanders, stop and restart with a tighter prompt
|
|
182
|
+
|
|
183
|
+
**CLAUDE.md saves you 30โ50% of your window:** Every session Claude re-discovers your project from scratch if you don't have one. A good CLAUDE.md means Claude starts with full context and spends the window reasoning, not orienting.
|
|
184
|
+
|
|
185
|
+
---
|
|
186
|
+
|
|
187
|
+
## CLAUDE.md Template
|
|
188
|
+
|
|
189
|
+
Create this file at the root of every project:
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
# Project: [name]
|
|
193
|
+
|
|
194
|
+
## What this is
|
|
195
|
+
[One sentence description]
|
|
196
|
+
|
|
197
|
+
## Stack
|
|
198
|
+
- Frontend: [language/framework]
|
|
199
|
+
- Backend: [language/framework]
|
|
200
|
+
- Database: [type + name]
|
|
201
|
+
- Infrastructure: [cloud/hosting]
|
|
202
|
+
|
|
203
|
+
## Key files
|
|
204
|
+
- Entry point: [path]
|
|
205
|
+
- Config: [path]
|
|
206
|
+
- Core logic: [path]
|
|
207
|
+
- Tests: [path]
|
|
208
|
+
|
|
209
|
+
## Conventions
|
|
210
|
+
- Naming: [camelCase / snake_case / PascalCase]
|
|
211
|
+
- Error handling: [pattern โ throw vs return, custom errors]
|
|
212
|
+
- Auth: [approach โ JWT, sessions, API keys]
|
|
213
|
+
- API style: [REST / GraphQL / RPC]
|
|
214
|
+
|
|
215
|
+
## Patterns to follow
|
|
216
|
+
- [example: always use repository pattern for DB access]
|
|
217
|
+
- [example: prefer composition over inheritance]
|
|
218
|
+
|
|
219
|
+
## Patterns to avoid
|
|
220
|
+
- [example: no direct DB queries in route handlers]
|
|
221
|
+
- [example: no global state outside store]
|
|
222
|
+
|
|
223
|
+
## Architecture decisions
|
|
224
|
+
- [date]: [decision and why โ e.g. "2026-04-01: chose PostgreSQL over MongoDB for
|
|
225
|
+
relational data integrity across user/order/payment tables"]
|
|
226
|
+
- [date]: [decision and why]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Rules for CLAUDE.md:**
|
|
230
|
+
|
|
231
|
+
- Update it every time you make a significant architectural decision
|
|
232
|
+
- Keep it under 500 lines โ it should be a reference, not a novel
|
|
233
|
+
- When you change a pattern, update the doc the same day
|
|
234
|
+
- Include the _why_ behind decisions, not just the _what_
|
|
235
|
+
|
|
236
|
+
---
|
|
237
|
+
|
|
238
|
+
## Multi-Language Context Switching
|
|
239
|
+
|
|
240
|
+
When switching between languages mid-day:
|
|
241
|
+
|
|
242
|
+
1. **Don't cold-start Opus on a new language.** Use Gemini Flash first to re-orient โ "here's the existing Python backend, I'm now adding a Go service that calls it. Explain how they currently communicate."
|
|
243
|
+
|
|
244
|
+
2. **Language boundary bugs โ Opus.** When a bug lives at the interface between two languages (serialisation, type mismatches, protocol differences), it's often genuinely complex. This is a legitimate Opus use case.
|
|
245
|
+
|
|
246
|
+
3. **Keep per-language context in CLAUDE.md.** If your project spans Python + TypeScript, add a section per language with its own conventions and key files.
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## Non-Negotiable Rules
|
|
252
|
+
|
|
253
|
+
1. **CLAUDE.md is mandatory** โ every project, always. No exceptions.
|
|
254
|
+
|
|
255
|
+
2. **Never use Opus for tasks you can describe as "generate", "write", "rename", "convert", or "document"** โ those go to Flash or SWE-1.5.
|
|
256
|
+
|
|
257
|
+
3. **Write tomorrow's Opus prompt today** โ end every day by crystallising your hardest current problem into a tight question while your brain is still warm.
|
|
258
|
+
|
|
259
|
+
4. **Antigravity background = free throughput** โ any task that doesn't need your attention right now gets dispatched to Antigravity Manager. You're running a free second developer.
|
|
260
|
+
|
|
261
|
+
5. **Escalation ladder always** โ SWE-1.5 โ Flash โ Sonnet โ Opus. Never skip steps.
|
|
262
|
+
|
|
263
|
+
6. **/compact aggressively** โ one session per problem. Don't carry context threads across your whole day.
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
_Last updated: April 2026_
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Project rules for Claude Code
|
|
2
|
+
|
|
3
|
+
## Skills to load
|
|
4
|
+
This project uses two Claude Code skills. Load them at the start of relevant tasks:
|
|
5
|
+
|
|
6
|
+
- **Design system**: `@prism-design` โ load when building any UI, component, screen, or styling
|
|
7
|
+
- **Architecture + guidelines**: read the relevant file from `04_Resources/Skills/guidelines/` when making architectural decisions, writing security-sensitive code, or optimising performance
|
|
8
|
+
|
|
9
|
+
## Hard rules (never ask โ always follow these)
|
|
10
|
+
|
|
11
|
+
### Data integrity
|
|
12
|
+
- Every Prisma query on tenant data must filter by `tenantId` (middleware enforces it, but verify)
|
|
13
|
+
- No raw SQL concatenation โ `$queryRaw` with tagged templates only, requires ticket to replace
|
|
14
|
+
- Soft deletes only โ `deletedAt`, never hard DELETE on tenant data
|
|
15
|
+
- ULIDs for all primary keys โ not auto-increment, not UUID
|
|
16
|
+
- Cursor-based pagination only โ no offset/limit
|
|
17
|
+
- `tenantId` always comes from the session โ never from URL params or request body
|
|
18
|
+
- Unauthorized reads return 404, not 403
|
|
19
|
+
|
|
20
|
+
### Auth & secrets
|
|
21
|
+
- Argon2id for passwords (`time=3, memory=64MB, parallelism=4`) โ never bcrypt
|
|
22
|
+
- Opaque session tokens in Redis โ not JWTs for user sessions
|
|
23
|
+
- Secrets in Doppler or AWS Secrets Manager โ never in code, never logged
|
|
24
|
+
- Session rotation on: login, logout, MFA, role change
|
|
25
|
+
|
|
26
|
+
### Input validation
|
|
27
|
+
- Zod validation with `.strict()` on every input boundary (HTTP, queue, file upload)
|
|
28
|
+
- All strings have max length โ prevents DoS
|
|
29
|
+
|
|
30
|
+
### Async & queuing
|
|
31
|
+
- Any work > 1 second uses BullMQ โ never block an HTTP handler
|
|
32
|
+
- Outbox pattern for events โ never `queue.add()` directly from HTTP handlers
|
|
33
|
+
- Every network call has a timeout (10s internal, 5s fast external, 30s slow, 60s AI)
|
|
34
|
+
- Retries only on 5xx and network errors โ never on 4xx
|
|
35
|
+
|
|
36
|
+
### Logging & observability
|
|
37
|
+
- Structured JSON logs only โ `correlationId` + `tenantId` + `userId` on every line
|
|
38
|
+
- No secrets in logs
|
|
39
|
+
- Audit log is append-only โ never UPDATE/DELETE audit records
|
|
40
|
+
|
|
41
|
+
### Code quality
|
|
42
|
+
- TypeScript `strict: true` + `noUncheckedIndexedAccess`
|
|
43
|
+
- Never use `any` โ use `unknown` with narrowing
|
|
44
|
+
- No N+1 queries โ use Prisma `include/select`
|
|
45
|
+
- Error handling: throw for programming errors, return Result type for expected failures
|
|
46
|
+
- No `console.log` โ use the structured logger
|
|
47
|
+
|
|
48
|
+
## When to read full guidelines
|
|
49
|
+
|
|
50
|
+
| Task | File to read |
|
|
51
|
+
|---|---|
|
|
52
|
+
| New service, module extraction, DB schema | `guidelines/architecture-guidelines.md` |
|
|
53
|
+
| Auth, file upload, AI integration, external API | `guidelines/security-guidelines.md` |
|
|
54
|
+
| Tests, refactoring, PR review | `guidelines/code-quality-guidelines.md` |
|
|
55
|
+
| Performance, caching, queries | `guidelines/performance-guidelines.md` |
|
|
56
|
+
| ADRs, READMEs, API docs | `guidelines/documentation-guidelines.md` |
|
|
57
|
+
| Any UI work | Load `@prism-design` skill |
|
|
58
|
+
|
|
59
|
+
## Decisions already made โ don't re-open
|
|
60
|
+
|
|
61
|
+
- DB: Prisma + shared Postgres + `tenantId` column (not schema-per-tenant)
|
|
62
|
+
- Queue: BullMQ on Redis (not Kafka, SQS, or RabbitMQ)
|
|
63
|
+
- Sessions: opaque tokens in Redis (not JWTs)
|
|
64
|
+
- Search: PostgreSQL FTS (until 100k users, then Typesense)
|
|
65
|
+
- API: REST + JSON (not GraphQL)
|
|
66
|
+
- Passwords: Argon2id (bcrypt is deprecated for this use case)
|
|
67
|
+
- IDs: ULIDs (not auto-increment, not UUID v4)
|
|
68
|
+
- Deployment: Fly Machines โ ECS โ K8s only with dedicated SRE
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Agent config โ setup instructions
|
|
2
|
+
|
|
3
|
+
Three files in this folder. One per tool. Copy them into each new project.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Windsurf
|
|
8
|
+
|
|
9
|
+
### Option A โ Global (recommended, one-time setup, applies to all projects)
|
|
10
|
+
|
|
11
|
+
1. Open Windsurf
|
|
12
|
+
2. `Cmd+,` โ Settings โ search "Rules" โ click **"Edit Global Rules"**
|
|
13
|
+
3. Paste the entire contents of `windsurfrules` into the editor
|
|
14
|
+
4. Save
|
|
15
|
+
|
|
16
|
+
Every Cascade conversation in every workspace will now follow these rules automatically.
|
|
17
|
+
|
|
18
|
+
### Option B โ Per-project (for project-specific additions on top of global)
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
cp windsurfrules /your-project/.windsurfrules
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Windsurf reads `.windsurfrules` from the project root automatically โ no configuration needed.
|
|
25
|
+
|
|
26
|
+
**Use both**: set global rules for the universal hard rules, and add project-specific context (repo structure, active sprint focus) in `.windsurfrules`.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## VS Code โ GitHub Copilot
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
mkdir -p /your-project/.github
|
|
34
|
+
cp copilot-instructions.md /your-project/.github/copilot-instructions.md
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Copilot reads `.github/copilot-instructions.md` automatically in Chat and inline completions (VS Code โฅ 1.90). No setting required.
|
|
38
|
+
|
|
39
|
+
For **user-level instructions** (applies to all projects):
|
|
40
|
+
1. `Cmd+,` โ search "Copilot Instructions"
|
|
41
|
+
2. Click **"Edit in settings.json"**
|
|
42
|
+
3. Add:
|
|
43
|
+
```json
|
|
44
|
+
"github.copilot.chat.codeGeneration.instructions": [
|
|
45
|
+
{
|
|
46
|
+
"text": "PASTE CONTENTS OF copilot-instructions.md HERE"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Claude Code
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cp CLAUDE.md /your-project/CLAUDE.md
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Claude Code reads `CLAUDE.md` from the project root automatically at the start of every session.
|
|
60
|
+
|
|
61
|
+
For **global rules** (applies to all projects):
|
|
62
|
+
```bash
|
|
63
|
+
cp CLAUDE.md ~/.claude/CLAUDE.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The project-level `CLAUDE.md` is merged with the global one โ use global for universal rules, project-level for repo-specific context.
|
|
67
|
+
|
|
68
|
+
The design system skill (`@prism-design`) is already set up in your Obsidian vault and Claude Code loads it automatically when referenced.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Which file is which
|
|
73
|
+
|
|
74
|
+
| File | Tool | Where it goes | Scope |
|
|
75
|
+
|---|---|---|---|
|
|
76
|
+
| `windsurfrules` | Windsurf | Windsurf global settings OR `.windsurfrules` in project root | All conversations |
|
|
77
|
+
| `copilot-instructions.md` | VS Code Copilot | `.github/copilot-instructions.md` in project root | Workspace |
|
|
78
|
+
| `CLAUDE.md` | Claude Code | `CLAUDE.md` in project root OR `~/.claude/CLAUDE.md` | Project or global |
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Keeping rules in sync
|
|
83
|
+
|
|
84
|
+
When the guidelines change (new security rule, architectural decision, etc.):
|
|
85
|
+
1. Update the source in `guidelines/` or `design/`
|
|
86
|
+
2. Update the condensed rules in `windsurfrules`, `copilot-instructions.md`, and `CLAUDE.md`
|
|
87
|
+
3. Re-paste into Windsurf global settings if you used Option A
|
|
88
|
+
|
|
89
|
+
The source of truth is always the full guidelines. These files are distillations.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# GitHub Copilot workspace instructions
|
|
2
|
+
|
|
3
|
+
This codebase uses an opinionated stack with hard rules that must never be broken.
|
|
4
|
+
Always follow these. When in doubt, check the full guidelines in the Skills folder.
|
|
5
|
+
|
|
6
|
+
## Stack
|
|
7
|
+
TypeScript strict + Node.js + Express + Prisma + PostgreSQL + Redis + BullMQ.
|
|
8
|
+
AI service: Python 3.12 + FastAPI. Frontend: Next.js + React + Prism design system.
|
|
9
|
+
|
|
10
|
+
## Critical rules (catastrophic if missed)
|
|
11
|
+
|
|
12
|
+
1. **Every Prisma query on tenant data filters by `tenantId`** โ the middleware enforces it, but always include it explicitly
|
|
13
|
+
2. **No raw SQL concatenation** โ parameterised Prisma queries only; `$queryRaw` requires explicit review
|
|
14
|
+
3. **`tenantId` comes from the session** โ never from URL params or request body
|
|
15
|
+
4. **Unauthorized reads return 404** โ never 403 (prevents existence leak)
|
|
16
|
+
5. **Soft deletes only** โ `deletedAt` timestamp, never hard DELETE on tenant data
|
|
17
|
+
6. **ULIDs for all primary keys** โ not auto-increment, not UUID
|
|
18
|
+
7. **Cursor pagination only** โ never offset/limit
|
|
19
|
+
8. **Async anything > 1 second** โ use BullMQ, never block an HTTP handler
|
|
20
|
+
9. **Argon2id for passwords** (`time=3, memory=64MB, parallelism=4`) โ never bcrypt
|
|
21
|
+
10. **Opaque session tokens in Redis** โ not JWTs for user sessions
|
|
22
|
+
11. **Zod validation on every input boundary** โ with `.strict()`, including max lengths
|
|
23
|
+
12. **Structured JSON logs only** โ with `correlationId` + `tenantId` on every line
|
|
24
|
+
13. **Secrets in Doppler/KMS** โ never in code, never logged
|
|
25
|
+
14. **No `any` in TypeScript** โ use `unknown` with narrowing
|
|
26
|
+
15. **No N+1 queries** โ use Prisma `include/select`
|
|
27
|
+
|
|
28
|
+
## Design system rules
|
|
29
|
+
- Use CSS tokens (`var(--token-name)`) โ never hardcode colours, radii, or font names
|
|
30
|
+
- Use components from `components.tsx` โ never import Tailwind or shadcn
|
|
31
|
+
- Sparkle star is the only AI glyph โ no robots, brains, or lightbulbs
|
|
32
|
+
- Touch targets: 44ร44px minimum on mobile
|
|
33
|
+
- Spacing: multiples of 4px only (4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 48, 56, 64)
|
|
34
|
+
|
|
35
|
+
## Error handling
|
|
36
|
+
- Throw exceptions for programming errors (bugs)
|
|
37
|
+
- Return Result types for expected failures (validation, not-found, rate-limit)
|
|
38
|
+
- Never silence errors โ always log or rethrow
|
|
39
|
+
|
|
40
|
+
## Code style
|
|
41
|
+
- TypeScript `strict: true` + `noUncheckedIndexedAccess`
|
|
42
|
+
- Functions โค 80 lines, files โค 500 lines
|
|
43
|
+
- No `console.log` โ use the structured logger
|
|
44
|
+
- No commented-out code โ delete it
|
|
45
|
+
- Boolean variables: `is/has/can/should` prefix
|
|
46
|
+
- No TypeScript `enum` โ use string literal unions
|
|
47
|
+
|
|
48
|
+
## Performance hard caps
|
|
49
|
+
- UI response: โค 100ms | API p95: < 300ms | DB indexed lookup: โค 10ms
|
|
50
|
+
- JS bundle gzipped: โค 170KB | CSS gzipped: โค 30KB
|
|
51
|
+
- LCP: โค 2.5s | INP: โค 200ms | CLS: โค 0.1
|