Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/algovate/xhs-mcp/typescript-standardsgit clone --depth 1 https://github.com/Algovate/xhs-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/algovate/xhs-mcp/typescript-standards)<a href="https://agentmods.dev/rules/algovate/xhs-mcp/typescript-standards"><img src="https://agentmods.dev/badge/rules/algovate/xhs-mcp/typescript-standards.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00544 |
| Opus 5 | $0.00000 | $0.00272 |
| Sonnet 5 | $0.00000 | $0.00109 |
| Haiku 4.5 | $0.00000 | $0.00054 |
Grade A, and why
typescript-standards scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 53 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Standards for XHS MCP
Type Safety
- Strict Mode: Always use strict TypeScript configuration
- Explicit Types: Use explicit return types for public methods:
method(): ReturnType - No Any: Avoid
anytype - useunknownor specific types - Nullish Coalescing: Use
??operator instead of||for null/undefined checks - Optional Chaining: Use
?.operator for safe property access
Import/Export Patterns
- ES Modules: Use ES module syntax (
import/export) - Named Exports: Prefer named exports over default exports
- Index Files: Use index files for clean module boundaries
- Type Imports: Use
import typefor type-only imports
Interface Design
- Consistent Naming: Use PascalCase for interfaces (
XHSResponse,BrowserConfig) - Generic Types: Use generics for reusable interfaces (
XHSResponse<T>) - Optional Properties: Mark optional properties with
? - Readonly: Use
readonlyfor immutable properties
Error Handling
- Custom Errors: Extend
XHSErrorbase class for domain-specific errors - Error Context: Include context objects with error information
- Type-Safe Errors: Use specific error types (
AuthenticationError,BrowserError)
Service Patterns
- Base Service: All services extend
BaseService - Dependency Injection: Inject dependencies via constructor
- Protected Methods: Use
protectedfor internal service methods - Abstract Classes: Use abstract base classes for common functionality
Code Organization
- Single Responsibility: One class/service per file
- Co-location: Keep related types and implementations together
- Barrel Exports: Use index files for clean imports
- File Naming: Use kebab-case for files (
auth.service.ts,browser.manager.ts)
Async Patterns
- Async/Await: Prefer async/await over Promises
- Error Propagation: Let errors bubble up naturally
- Timeout Handling: Use proper timeout configurations
- Resource Cleanup: Ensure proper cleanup in finally blocks
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 4d ago First seen · 53 lines · 544 tokens per session scan A 200c44e13abf
typescript-standards is a cursor rule published in the GitHub repository Algovate/xhs-mcp (54 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 544 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
development-conventions
Development conventions, code style, and best practices for the Kaneo project.
ts
Cursor rule "ts" from un-pany/v3-admin-vite, covering ts 开发规范, 类型, 命名, 代码组织 and 错误处理.
app_feature_first_architecture
Feature-first architecture is a design pattern that organizes code by business features rather than technical layers. This approach promotes better maintainability, scalability, and team collaboration by keeping related functionality together and reducing coupling between different parts of the application.
bundling
The project uses a custom type bundling system to provide full TypeScript IntelliSense support in the Monaco editor for @bubblelab/bubble-core and its dependencies. This is necessary because Monaco cannot directly resolve workspace packages or external dependencies.
best_practices
Advanced Best Practices covering Error Handling, Environment Variables, Performance, and Accessibility rules.
typescript-patterns
TypeScript patterns for code organization, classes, types, and symbols as it relates to this project.