

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
12345# Copilot instructions (English — concise)67Purpose: provide short, actionable guidance so Copilot suggestions match project conventions.89## Common Development Commands1011### Development Server12- `bin/dev` - Start development server (Rails, Sidekiq, Tailwind CSS watcher)13- `bin/rails server` - Start Rails server only14- `bin/rails console` - Open Rails console1516### Testing17- `bin/rails test` - Run all tests18- `bin/rails test:db` - Run tests with database reset19- `DISABLE_PARALLELIZATION=true bin/rails test:system` - Run system tests only (use sparingly - they take longer)20- `bin/rails test test/models/account_test.rb` - Run specific test file21- `bin/rails test test/models/account_test.rb:42` - Run specific test at line2223### Linting & Formatting24- `bin/rubocop` - Run Ruby linter25- `npm run lint` - Check JavaScript/TypeScript code26- `npm run lint:fix` - Fix JavaScript/TypeScript issues27- `npm run format` - Format JavaScript/TypeScript code28- `bin/brakeman` - Run security analysis2930### Database31- `bin/rails db:prepare` - Create and migrate database32- `bin/rails db:migrate` - Run pending migrations33- `bin/rails db:rollback` - Rollback last migration34- `bin/rails db:seed` - Load seed data3536### Setup37- `bin/setup` - Initial project setup (installs dependencies, prepares database)3839## Pre-PR workflow (run locally before opening PR)40- Tests: bin/rails test (all), DISABLE_PARALLELIZATION=true bin/rails test:system (when applicable)41- Linters: bin/rubocop -f github -a; bundle exec erb_lint ./app/**/*.erb -a42- Security: bin/brakeman --no-pager4344## High-Level Architecture4546### Application Modes47The app runs in two modes:48- **Managed** (Rails.application.config.app_mode = "managed")49- **Self-hosted** (Rails.application.config.app_mode = "self_hosted")5051### Core Domain Model52The application is built around financial data management with these key relationships:53- **User** → has many **Accounts** → has many **Transactions**54- **Account** types: checking, savings, credit cards, investments, crypto, loans, properties55- **Transaction** → belongs to **Category**, can have **Tags** and **Rules**56- **Investment accounts** → have **Holdings** → track **Securities** via **Trades**5758### API Architecture59The application provides both internal and external APIs:60- Internal API: Controllers serve JSON via Turbo for SPA-like interactions61- External API: `/api/v1/` namespace with Doorkeeper OAuth and API key authentication62- API responses use Jbuilder templates for JSON rendering.63- Rate limiting via Rack::Attack with configurable limits per API key6465### Sync & Import System66Two primary data ingestion methods:671. **Plaid Integration**: Real-time bank account syncing68 - `PlaidItem` manages connections69 - `Sync` tracks sync operations70 - Background jobs handle data updates712. **CSV Import**: Manual data import with mapping72 - `Import` manages import sessions73 - Supports transaction and balance imports74 - Custom field mapping with transformation rules7576### Background Processing77Sidekiq handles asynchronous tasks:78- Account syncing (`SyncJob`)79- Import processing (`ImportJob`)80- AI chat responses (`AssistantResponseJob`)81- Scheduled maintenance via sidekiq-cron8283### Frontend Architecture84- **Hotwire Stack**: Turbo + Stimulus for reactive UI without heavy JavaScript85- **ViewComponents**: Reusable UI components in `app/components/`86- **Stimulus Controllers**: Handle interactivity, organized alongside components87- **Charts**: D3.js for financial visualizations (time series, donut, sankey)88- **Styling**: Tailwind CSS v4.x with custom design system89 - Design system defined in `app/assets/tailwind/sure-design-system.css`90 - Always use functional tokens (e.g., `text-primary` not `text-white`)91 - Prefer semantic HTML elements over JS components92 - Use `icon` helper for icons, never `lucide_icon` directly9394### Multi-Currency Support95- All monetary values stored in base currency (user's primary currency)96- `Money` objects handle currency conversion and formatting97- Historical exchange rates for accurate reporting9899### Security & Authentication100- Session-based auth for web users101- API authentication via:102 - OAuth2 (Doorkeeper) for third-party apps103 - API keys with JWT tokens for direct API access104- Scoped permissions system for API access105- Strong parameters and CSRF protection throughout106107## Key rules108- Project modes: "managed" or "self_hosted".109- Domain: User → Accounts → Transactions. Keep business logic in models, controllers thin.110111Authentication & context112- Use Current.user and Current.family (never current_user / current_family).113114Testing conventions115- Use Minitest + fixtures (no RSpec, no FactoryBot).116- Use mocha for mocks where needed; VCR for external API tests.117118Frontend conventions119- Hotwire-first: Turbo + Stimulus.120- Prefer semantic HTML, Turbo Frames, server-side formatting.121- Use the helper icon for icons (do not use lucide_icon directly).122- Use Tailwind design tokens (text-primary, bg-container, etc.).123124Backend & architecture125- Skinny controllers, fat models.126- Prefer built-in Rails patterns; add dependencies only with strong justification.127- Sidekiq for background jobs (e.g., SyncJob, ImportJob, AssistantResponseJob).128129API & security130- External API under /api/v1 with Doorkeeper / API keys; respect CSRF and strong params.131- Follow rate limits and auth strategies already in project.132133Stimulus & components134- Keep controllers small (< 7 targets); pass data via data-*-value.135- Prefer ViewComponents for reusable or complex UI.136137## Component Architecture138139### ViewComponent vs Partials Decision Making140141**Use ViewComponents when:**142- Element has complex logic or styling patterns143- Element will be reused across multiple views/contexts144- Element needs structured styling with variants/sizes145- Element requires interactive behavior or Stimulus controllers146- Element has configurable slots or complex APIs147- Element needs accessibility features or ARIA support148149**Use Partials when:**150- Element is primarily static HTML with minimal logic151- Element is used in only one or few specific contexts152- Element is simple template content153- Element doesn't need variants, sizes, or complex configuration154- Element is more about content organization than reusable functionality155156**Component Guidelines:**157- Prefer components over partials when available158- Keep domain logic OUT of view templates159- Logic belongs in component files, not template files160161### Stimulus Controller Guidelines162163**Declarative Actions (Required):**164```erb165<!-- GOOD: Declarative - HTML declares what happens -->166<div data-controller="toggle">167 <button data-action="click->toggle#toggle" data-toggle-target="button">Show</button>168 <div data-toggle-target="content" class="hidden">Hello World!</div>169</div>170```171172**Controller Best Practices:**173- Keep controllers lightweight and simple (< 7 targets)174- Use private methods and expose clear public API175- Single responsibility or highly related responsibilities176- Component controllers stay in component directory, global controllers in `app/javascript/controllers/`177- Pass data via `data-*-value` attributes, not inline JavaScript178179## Testing Philosophy180181### General Testing Rules182- **ALWAYS use Minitest + fixtures + Mocha** (NEVER RSpec or FactoryBot)183- Keep fixtures minimal (2-3 per model for base cases)184- Create edge cases on-the-fly within test context185- Use Rails helpers for large fixture creation needs186187### Test Quality Guidelines188- **Write minimal, effective tests** - system tests sparingly189- **Only test critical and important code paths**190- **Test boundaries correctly:**191 - Commands: test they were called with correct params192 - Queries: test output193 - Don't test implementation details of other classes194195### Testing Examples196197```ruby198# GOOD - Testing critical domain business logic199test "syncs balances" do200 Holding::Syncer.any_instance.expects(:sync_holdings).returns([]).once201 assert_difference "@account.balances.count", 2 do202 Balance::Syncer.new(@account, strategy: :forward).sync_balances203 end204end205206# BAD - Testing ActiveRecord functionality207test "saves balance" do208 balance_record = Balance.new(balance: 100, currency: "USD")209 assert balance_record.save210end211```212213### Stubs and Mocks214- Use `mocha` gem215- Prefer `OpenStruct` for mock instances216- Only mock what's necessary217218## Performance Considerations219- Database queries optimized with proper indexes220- N+1 queries prevented via includes/joins221- Background jobs for heavy operations222- Caching strategies for expensive calculations223- Turbo Frames for partial page updates224225## Development Workflow226- Feature branches merged to `main`227- Docker support for consistent environments228- Environment variables via `.env` files229- Lookbook for component development (`/design-system`)230- Letter Opener for email preview in development231232## Project Conventions233234### Convention 1: Minimize Dependencies235- Push Rails to its limits before adding new dependencies236- Strong technical/business reason required for new dependencies237- Favor old and reliable over new and flashy238239### Convention 2: Skinny Controllers, Fat Models240- Business logic in `app/models/` folder, avoid `app/services/`241- Use Rails concerns and POROs for organization242- Models should answer questions about themselves: `account.balance_series` not `AccountSeries.new(account).call`243244### Convention 3: Hotwire-First Frontend245- **Native HTML preferred over JS components**246 - Use `<dialog>` for modals, `<details><summary>` for disclosures247 - **Leverage Turbo frames** for page sections over client-side solutions248 - **Query params for state** over localStorage/sessions249 - **Server-side formatting** for currencies, numbers, dates250 - **Always use `icon` helper** in `application_helper.rb`, NEVER `lucide_icon` directly251252### Convention 4: Optimize for Simplicity253- Prioritize good OOP domain design over performance254- Focus performance only on critical/global areas (avoid N+1 queries, mindful of global layouts)255256### Convention 5: Database vs ActiveRecord Validations257- Simple validations (null checks, unique indexes) in DB258- ActiveRecord validations for convenience in forms (prefer client-side when possible)259- Complex validations and business logic in ActiveRecord260261## TailwindCSS Design System262263### Design System Rules264- **Always reference `app/assets/tailwind/sure-design-system.css`** for primitives and tokens265- **Use functional tokens** defined in design system:266 - `text-primary` instead of `text-white`267 - `bg-container` instead of `bg-white`268 - `border border-secondary` instead of `border border-gray-200`269- **NEVER create new styles** in design system files without permission270- **Always generate semantic HTML**271272Disallowed suggestions / behaviors273- Do NOT propose running system commands in PRs (rails server, rails credentials, touching tmp files, auto-running migrations).274- Avoid adding new global styles to design system without permission.275- Do not produce offensive, dangerous, or non-technical content.276277Style for suggestions278- Make changes atomic and testable; explain impact briefly.279- Keep suggestions concise and aligned with existing code.280- Respect existing tests; add tests when changing critical logic.281282Notes from repository config283- If .gemini/config.yaml disables automated code_review, still provide clear summaries and fix suggestions in PRs.284
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| we-promise/sure.cursor/rules/api-endpoint-consistency.mdc · 9.5k | Cursor rules | styletesting-strategygitsecurity+2 | 57/100 | 13 days ago | |
| we-promise/sure.cursor/rules/cursor_rules.mdc · 9.5k | Cursor rules | no sections | 36/100 | 13 days ago | |
| we-promise/sure.cursor/rules/general-rules.mdc · 9.5k | Cursor rules | styledo-not | 44/100 | 13 days ago | |
| we-promise/sure.cursor/rules/project-conventions.mdc · 9.5k | Cursor rules | styledependenciesdatabaseui+2 | 59/100 | 13 days ago | |
| we-promise/sure.cursor/rules/project-design.mdc · 9.5k | Cursor rules | style | 58/100 | 13 days ago | |
| we-promise/sure.cursor/rules/self_improve.mdc · 9.5k | Cursor rules | no sections | 36/100 | 13 days ago | |
| we-promise/sure.cursor/rules/stimulus_conventions.mdc · 9.5k | Cursor rules | no sections | 44/100 | 13 days ago | |
| we-promise/sure.cursor/rules/testing.mdc · 9.5k | Cursor rules | styletesting-strategy | 52/100 | 13 days ago | |
| we-promise/sure.cursor/rules/ui-ux-design-guidelines.mdc · 9.5k | Cursor rules | styledo-not | 49/100 | 13 days ago | |
| we-promise/sure.cursor/rules/view_conventions.mdc · 9.5k | Cursor rules | style | 52/100 | 13 days ago | |
| we-promise/sureAGENTS.md · 9.5k | AGENTS.md | buildtestlint-formatstyle+7 | 78/100 | 13 days ago | |
| we-promise/sureCLAUDE.md · 9.5k | CLAUDE.md | setuptestlint-formatstyle+11 | 93/100 | 13 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| darkmatter/nixmac.github/copilot-instructions.md · 25 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 14 days ago | |
| activeadmin/activeadmin.github/copilot-instructions.md · 9.7k | Copilot instructions | setupbuildtestlint-format+5 | 89/100 | 13 days ago | |
| ant-design/ant-design.github/copilot-instructions.md · 99k | Copilot instructions | buildtestlint-formatstyle+10 | 83/100 | today | |
| yigitkonur/cli-continues.github/instructions/ci.instructions.md · 1.4k | Copilot instructions | setupbuildteststyle+4 | 82/100 | 14 days ago | |
| cline/cline.github/copilot-instructions.md · 66k | Copilot instructions | buildteststyleapi+1 | 75/100 | 14 days ago | |
| opf/openproject.github/copilot-instructions.md · 16k | Copilot instructions | setuplint-formatgitdatabase+1 | 73/100 | 14 days ago | |
| forem/forem.github/copilot-instructions.md · 23k | Copilot instructions | teststyletypesdatabase+4 | 71/100 | 14 days ago | |
| rapid7/metasploit-framework.github/instructions/tests.instructions.md · 39k | Copilot instructions | teststyleagent-behaviour | 67/100 | today |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/we-promise-sure-github-copilot-instructions)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.