Skip to content

Instantly share code, notes, and snippets.

View mfaiz0591's full-sized avatar

Mohd Faiz mfaiz0591

  • Malaysia
  • 15:17 (UTC +08:00)
View GitHub Profile
@mfaiz0591
mfaiz0591 / code-quality.mdc
Created April 14, 2025 15:46
Cursor Rules For Code Quality
---
description: Code Quality Guidelines. Apply these rules when writing or reviewing code to ensure consistency and quality
globs:
---
# Code Quality Guidelines
## Verify Information
- Always verify information before presenting it
- Do not make assumptions or speculate without clear evidence
@mfaiz0591
mfaiz0591 / git-workflow.mdc
Created April 14, 2025 15:45
Cursor Rules For Git Workflow
---
description: Git Workflow Guidelines. Apply these rules when performing git operations
globs:
---
# Git Workflow Guidelines
## Main Branches
### Main (or Master)
@mfaiz0591
mfaiz0591 / clean-code.mdc
Created April 14, 2025 15:43
Cursor Rules For Clean Code
---
description: Clean Code Guidelines. Guidelines for writing clean, maintainable, and human-readable code. Apply these rules when writing or reviewing code to ensure consistency and quality
globs:
---
# Clean Code Guidelines
## Constants Over Magic Numbers
- Replace hard-coded values with named constants
- Use descriptive constant names that explain the value's purpose
@mfaiz0591
mfaiz0591 / convex.mdc
Created April 14, 2025 15:34
Cursor Rules For Convex
---
description: Guidelines and best practices for building Convex projects, including database schema design, queries, mutations, and real-world examples
globs: **/*.ts,**/*.tsx,**/*.js,**/*.jsx
---
# Convex guidelines
## Function guidelines
### New function syntax
- ALWAYS use the new function syntax for Convex functions. For example:
```typescript
@mfaiz0591
mfaiz0591 / addNestedField.js
Last active April 14, 2025 15:40
GraphQL Nested Field
const addNestedField = (schema, typeName, fieldName) => {
const typeInfo = new GRAPHQL.TypeInfo(schema);
return (request) => {
const document = GRAPHQL.visit(
request.document,
GRAPHQL.visitWithTypeInfo(typeInfo, {
[GRAPHQL.Kind.SELECTION_SET]: (node) => {
const parentType = typeInfo.getParentType();
const matchType = parentType && parentType.name === typeName;