

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# OpenCredits VS Code Extension - Project Rules23## Project Overview4A VS Code extension that monitors API credits for multiple providers (OpenRouter, OpenAI, Anthropic, Gemini) and displays them in the status bar.56## Architecture Guidelines78### Core Principles9- **Modular Design**: Each provider implements the same interface10- **Type Safety**: Full TypeScript implementation with strict typing11- **Security**: API keys stored in VS Code's SecretStorage12- **Error Resilience**: Graceful handling of API failures with visual feedback13- **Performance**: Efficient polling with configurable intervals1415### Code Structure16```17src/18├── extension.ts # Main entry point19├── providers/20│ ├── interfaces/21│ │ └── ICreditProvider.ts # Provider interface22│ ├── base/23│ │ └── BaseProvider.ts # Common functionality24│ ├── OpenRouterProvider.ts25│ ├── OpenAIProvider.ts26│ ├── AnthropicProvider.ts27│ └── GeminiProvider.ts28├── statusBar/29│ └── StatusBarManager.ts30├── config/31│ └── ConfigurationManager.ts32└── utils/33 └── apiClient.ts34```3536### Provider Interface Contract37All providers must implement:38- `getCredits(): Promise<CreditInfo>`39- `validateApiKey(): Promise<boolean>`40- `getName(): string`41- `getShortName(): string`42- `getIcon(): string`4344### Status Bar Display Rules45- 1 provider: `OpenRouter: $5.20`46- 2 providers: `OR: $5.20 | OA: $10.50`47- 3+ providers: `OR: $5.20 | OA: $10.50 | AN: 1.2M`48- Error states: Show error icon with tooltip4950### Configuration51- API keys: Stored securely in VS Code SecretStorage52- Update intervals: 1min, 5min, 15min, 30min, 1h, 6h, 24h53- Provider toggles: Individual enable/disable per provider54- Native credit formats: Mix of dollars, tokens, etc.5556### Error Handling57- Network failures: Show error icon in status bar58- Invalid API keys: Visual feedback with configuration prompt59- Rate limiting: Respect provider rate limits60- Timeout handling: 10-second timeout for all API calls6162### Development Standards63- **No console.log**: Use VS Code's output channel for logging64- **Async/await**: Preferred over Promises65- **Error boundaries**: Catch and handle all async errors66- **Memory cleanup**: Proper disposal of timers and subscriptions67- **Testing**: Unit tests for all providers and core logic6869### Security70- Never log API keys71- Use VS Code SecretStorage for sensitive data72- Validate all user inputs73- Sanitize error messages before display7475## Implementation Priority761. Core architecture (interfaces, base classes)772. OpenRouter provider (primary focus)783. Status bar integration794. Configuration management805. Other providers (stubs initially)816. Polish and testing82
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 14 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 32k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 7 days ago | |
| BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0 | Cline rules | buildstylearchgit+2 | 96/100 | 14 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 14 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 14 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | 12 days ago | |
| HerringtonDarkholme/megarepo.clinerules/02-development.md · 17 | Cline rules | setupbuildteststyle+3 | 92/100 | 14 days ago | |
| blendsdk/codeops-mcp.clinerules/project.md · 0 | Cline rules | buildteststylearch+7 | 91/100 | 14 days ago |
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/antiu-org-opencredits-clinerules-project)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.