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/madebyaris/poinf-of-sales/performance-optimization-patternsgit clone --depth 1 https://github.com/madebyaris/poinf-of-salesWhat 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.00016 | $0.08737 |
| Opus 5 | $0.00008 | $0.04369 |
| Sonnet 5 | $0.00003 | $0.01747 |
| Haiku 4.5 | $0.00002 | $0.00874 |
Grade A, and why
performance-optimization-patterns 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 yesterday.
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 — 1,223 lines — stays where its author put it; the contents beside it link to each section on GitHub.
⚡ Performance Optimization Patterns
🎯 Performance Philosophy for POS Systems
Critical Performance Metrics
- Order Creation: < 500ms from click to confirmation
- Payment Processing: < 2s for complete transaction
- Kitchen Updates: Real-time (< 100ms propagation)
- Product Search: < 200ms for instant results
- Database Queries: < 100ms for typical CRUD operations
Performance Monitoring Strategy
// Performance monitoring utilities
class PerformanceMonitor {
static timeOperation<T>(name: string, operation: () => Promise<T>): Promise<T> {
console.time(name);
return operation().finally(() => console.timeEnd(name));
}
static measureRender(componentName: string) {
return (Component: React.ComponentType<any>) => {
return React.memo(Component, (prevProps, nextProps) => {
const start = performance.now();
const shouldUpdate = !Object.is(prevProps, nextProps);
const end = performance.now();
if (end - start > 1) {
console.warn(`${componentName} render check took ${end - start}ms`);
}
return !shouldUpdate;
});
};
}
}
🗄️ Database Performance Patterns
Optimized Query Patterns
// ✅ CORRECT: Efficient query with proper indexing
func (h *OrderHandler) GetOrdersWithPagination(c *gin.Context) {
page := getIntParam(c, "page", 1)
perPage := getIntParam(c, "per_page", 20)
status := c.Query("status")
// Use indexed columns in WHERE clause
query := `
SELECT
o.id, o.order_number, o.status, o.total_amount, o.created_at,
u.username, t.table_number,
COUNT(*) OVER() as total_count
FROM orders o
LEFT JOIN users u ON o.user_id = u.id
LEFT JOIN dining_tables t ON o.table_id = t.id
WHERE ($1 = '' OR o.status = $1)
AND o.created_at >= CURRENT_DATE - INTERVAL '7 days'
ORDER BY o.created_at DESC
LIMIT $2 OFFSET $3
`
offset := (page - 1) * perPage
rows, err := h.db.Query(query, status, perPage, offset)
// ... handle results
}
// ✅ CORRECT: Batch insert for order items
func (h *OrderHandler) CreateOrderWithItems(c *gin.Context) {
tx, err := h.db.Begin()
if err != nil {
// handle error
return
}
defer tx.Rollback()
// Create order
var orderID string
err = tx.QueryRow(`
INSERT INTO orders (customer_name, order_type, status, total_amount)
VALUES ($1, $2, $3, $4)
RETURNING id
`, req.CustomerName, req.OrderType, "pending", req.TotalAmount).Scan(&orderID)
// Batch insert order items (much faster than individual inserts)
if len(req.Items) > 0 {
valueStrings := make([]string, 0, len(req.Items))
valueArgs := make([]interface{}, 0, len(req.Items)*4)
for i, item := range req.Items {
valueStrings = append(valueStrings, fmt.Sprintf("($%d, $%d, $%d, $%d)",
i*4+1, i*4+2, i*4+3, i*4+4))
valueArgs = append(valueArgs, orderID, item.ProductID, item.Quantity, item.Price)
}
stmt := fmt.Sprintf(`
INSERT INTO order_items (order_id, product_id, quantity, price)
VALUES %s
`, strings.Join(valueStrings, ","))
_, err = tx.Exec(stmt, valueArgs...)
if err != nil {
return // Rollback automatically called
}
}
err = tx.Commit()
// ... handle success
}
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.
- yesterday First seen · 1,223 lines · 16 tokens per session scan A 841d4978fe9e
performance-optimization-patterns is a cursor rule published in the GitHub repository madebyaris/poinf-of-sales (133 stars, last pushed 1y ago), licensed MIT. It adds 16 tokens to every session and 8,737 once invoked, about $0.0001 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-30.
Other cursor rules, from other repositories
compat-ui
WWorkbench Compat 平台交互层约定(press / Select / Modal / FocusGate).
unit-tests-tdd
TDD required for behavior changes; ≥80% package coverage on touched packages; unit-test conventions.
write
Writing style guide with AI detection avoidance. For tweets, LinkedIn, blogs, READMEs, commits. Activate with @write.
feature-flags
Feature flag patterns — use when working with feature toggles.
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.