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/jrpribs/smarterstarter/300-angular-servicesgit clone --depth 1 https://github.com/JrPribs/SmarterStarterWhat 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.00004 | $0.02299 |
| Opus 5 | $0.00002 | $0.01149 |
| Sonnet 5 | $0.00001 | $0.00460 |
| Haiku 4.5 | $0.00000 | $0.00230 |
Grade A, and why
300-angular-services 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 2d 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 — 381 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Angular Services Best Practices
- Injectable Services: Always use the
@Injectable()decorator withprovidedIn: 'root'for singleton services.
@Injectable({
providedIn: 'root'
})
export class DataService {
// Service implementation
}
- State Management Role: Services should act as mediators between components and global state. They should contain business logic but not store state themselves.
@Injectable({
providedIn: 'root'
})
export class OrderService {
constructor(private orderStore: OrderStore, private http: HttpClient) {}
// Handle business logic and API communication before updating state
submitOrder(orderData: OrderData): Observable<Order> {
// Validate data
if (!this.validateOrder(orderData)) {
return throwError(() => new Error('Invalid order data'));
}
// Call API
return this.http.post<Order>('/api/orders', orderData).pipe(
tap(newOrder => {
// Update store on success
this.orderStore.addOrder(newOrder);
})
);
}
private validateOrder(order: OrderData): boolean {
// Business logic validation
return !!order.items.length && !!order.shippingAddress;
}
}
- Stateless Services: Services should be stateless and not maintain their own state - delegate state management to stores.
// ❌ AVOID: Service with internal state
@Injectable({ providedIn: 'root' })
export class BadCartService {
private items: CartItem[] = []; // Don't store state here
addItem(item: CartItem): void {
this.items.push(item); // State in service is bad
}
}
// ✅ GOOD: Stateless service that updates store
@Injectable({ providedIn: 'root' })
export class GoodCartService {
constructor(private cartStore: CartStore) {}
addItem(item: CartItem): void {
// Business logic, validation, etc.
if (!item.quantity) item.quantity = 1;
// Update state in store, not service
this.cartStore.addItem(item);
}
}
- Business Logic: Place all business logic in services, not in components or stores.
@Injectable({
providedIn: 'root'
})
export class PaymentService {
constructor(
private paymentStore: PaymentStore,
private http: HttpClient,
private authService: AuthService
) {}
processPayment(paymentInfo: PaymentInfo): Observable<PaymentResult> {
// Business logic
const enrichedPayment = this.enrichPaymentData(paymentInfo);
// Start processing - update UI state
this.paymentStore.setProcessing(true);
// Call API
return this.http.post<PaymentResult>('/api/payments', enrichedPayment).pipe(
tap(result => {
if (result.success) {
// Update multiple states based on business rules
this.paymentStore.addPayment(result);
} else {
this.paymentStore.setError(result.error);
}
}),
finalize(() => {
this.paymentStore.setProcessing(false);
})
);
}
private enrichPaymentData(paymentInfo: PaymentInfo): EnrichedPaymentInfo {
// Complex business logic
return {
...paymentInfo,
userId: this.authService.getCurrentUserId(),
timestamp: new Date().toISOString(),
// Add other derived properties
};
}
}
- Signal/Observable Interop: Use toSignal() and toObservable() for interop between RxJS observables and signals.
@Injectable({
providedIn: 'root'
})
export class ProductService {
constructor(
private http: HttpClient,
private productStore: ProductStore
) {}
// Load products and update store
loadProducts(): Observable<Product[]> {
return this.http.get<Product[]>('/api/products').pipe(
tap(products => {
this.productStore.setProducts(products);
})
);
}
// Perform business logic before updating store
addProduct(product: Product): Observable<Product> {
// Enrichment and validation
const enrichedProduct = this.prepareProductData(product);
return this.http.post<Product>('/api/products', enrichedProduct).pipe(
tap(newProduct => {
this.productStore.addProduct(newProduct);
})
);
}
private prepareProductData(product: Product): Product {
// Business logic to prepare data
return {
...product,
createdAt: new Date().toISOString(),
// Other transformations
};
}
}
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.
- 2d ago First seen · 381 lines · 4 tokens per session scan A a3b9b1465e5b
300-angular-services is a cursor rule published in the GitHub repository JrPribs/SmarterStarter (2 stars, last pushed 1y ago), licensed MIT. It adds 4 tokens to every session and 2,299 once invoked, about $0.0000 per session on Opus 5. 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-31.
Other cursor rules, from other repositories
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
cli-error-handling
CLI command error handling patterns.
prefer-direct-imports-over-module-mocks
Prefer extracting a testable core over vi.mock / vi.resetModules when unit tests need to reach production logic entangled with config, env, or singletons.
control-plane-descriptors
Control plane descriptor and instance implementation patterns.
family-instance-domain-actions
Family instance domain action implementation patterns.