Skip to content

Conversation

@privateJiangyaokai
Copy link

@privateJiangyaokai privateJiangyaokai commented Jan 6, 2026

Summary by CodeRabbit

  • Documentation

    • Added Cursor rules configuration and comprehensive rule documentation covering backend architecture, GraphQL API interactions, authentication flows, actionflows, AI agents, Stripe payment integration, and binary asset uploads.
  • Chores

    • Updated README with Momen.app backend-as-a-service entry.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a comprehensive suite of Cursor rules documentation and configuration for Momen.app, a Backend-as-a-Service platform. It adds end-to-end integration guidance covering architecture, GraphQL API patterns, actionflows, AI agents, Stripe payments, binary asset uploads, third-party API integration, and development best practices.

Changes

Cohort / File(s) Summary
Root Documentation
README.md
Added new entry for Momen.app Backend-as-a-Service with duplicate entries noted; documents Cursor rules for building custom frontends.
Cursor Rules Foundation
rules/momen-cursorrules-prompt-file/.cursorrules, rules/momen-cursorrules-prompt-file/README.md
Introduced comprehensive .cursorrules configuration file documenting end-to-end frontend-backend integration blueprint and repository README explaining structure, usage, and eight rule files.
Development Guidelines
rules/momen-cursorrules-prompt-file/common.mdc
Added frontend development guidelines covering Vite + Tailwind CSS integration, GraphQL subscription best practices, caching policies, and debugging guidance.
GraphQL & Database Rules
rules/momen-cursorrules-prompt-file/momen-database-gql-api-rules.mdc
Comprehensive documentation of GraphQL API rules, database model mapping, schema generation, filtering, ordering, and complex querying patterns.
Actionflows & AI Agents
rules/momen-cursorrules-prompt-file/momen-actionflow-gql-api-rules.mdc, rules/momen-cursorrules-prompt-file/momen-ai-agent-gql-api-rules.mdc
Documentation on synchronous/asynchronous actionflow invocation lifecycle and AI Agent interaction patterns with streaming and structured outputs.
Backend Architecture & Integration
rules/momen-cursorrules-prompt-file/momen-backend-architecture.mdc, rules/momen-cursorrules-prompt-file/momen-tpa-gql-api-rules.mdc
Described headless backend architecture, core components, Apollo Client implementation, authentication flows, and third-party API invocation via GraphQL.
Asset & Payment Rules
rules/momen-cursorrules-prompt-file/momen-binary-asset-upload-rules.mdc, rules/momen-cursorrules-prompt-file/momen-stripe-payment-rules.mdc
Documented two-step binary asset upload workflow with presigned URLs and Stripe payment integration for one-time and recurring payments.
Branding
rules/momen-cursorrules-prompt-file/momen-publicity-rules.mdc
Added static HTML/SVG "Powered by Momen" badge snippet for project branding.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • PatrickJS

Poem

🐰 A rabbit hops through rules so grand,
GraphQL schemas across the land!
From actionflows to Stripe's delight,
Momen shines with integration bright—
May your cursors dance with joy! ✨

Pre-merge checks

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'add momen' is vague and provides minimal context about the actual changes being made to the repository. Consider using a more descriptive title that reflects the main contribution, such as 'Add Momen.app Cursor rules documentation and backend integration guide' to better summarize the extensive additions.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

🤖 Fix all issues with AI Agents
In @rules/momen-cursurrules-prompt-file/.cursorrules:
- Around line 139-140: Update the Stripe integration guidance to use the correct
Stripe.js CDN URL: replace the incorrect URL string
"https://js.stripe.com/clover/stripe.js" with the official
"https://js.stripe.com/v3" in the guidance line that mentions
"@stripe/react-stripe-js and @stripe/stripe-js for React" so the documentation
references the valid Stripe.js endpoint.

In @rules/momen-cursurrules-prompt-file/common.mdc:
- Line 7: Fix the duplicated word in the sentence by replacing "make make sure"
with "make sure" so the sentence reads: "When using graphql subscription, make
sure that is only one active websocket that is reused across the entire app."
Edit the string in the common.mdc content where the sentence appears to remove
the extra "make".
- Line 11: Replace the incorrect abbreviation "chrome cdt" with the correct term
"Chrome CDP" in the documentation string on the line that currently reads "When
initiating a chrome cdt debugging session, make sure to clear existing state
such as local storage or cookies."—update that sentence to use "Chrome CDP"
(Chrome DevTools Protocol) to correct the terminology.

In @rules/momen-cursurrules-prompt-file/momen-actionflow-gql-api-rules.mdc:
- Around line 76-85: The subscription example contains a syntax error: remove
the stray double-quote after __typename in the fz_listen_action_flow_result
subscription example (i.e., change `__typename"` to `__typename`) or replace it
with a comma if you intend to list additional fields; ensure the selection set
remains valid and braces remain balanced for the subscription
`fz_listen_action_flow_result`.
- Around line 70-74: The JSON mutation response example starting at the object
with "data": { "fz_create_action_flow_task": 1150000000000148 } is missing the
opening code fence; add an opening ```json fence immediately before that JSON
object and a closing ``` fence after it so the example is properly fenced and
consistent with other examples in the file (refer to the JSON block containing
fz_create_action_flow_task).

In @rules/momen-cursurrules-prompt-file/momen-ai-agent-gql-api-rules.mdc:
- Line 42: There's a typo in the documentation sentence describing inputArgs key
naming: replace "wihtin" with "within" in the line that discusses how
Image/video or binary asset keys in the inputArgs object have an `_id` suffix
(the sentence mentioning inputArgs and `_id` suffix should read "...their key
names within the inputArgs object...").
- Line 14: Fix the typo "dpending" to "depending" in the heading/context that
references the "Invocation process for streaming output" in
momen-ai-agent-gql-api-rules.mdc (and also correct the same typo in
momen-backend-architecture.mdc line 14); search for the string "dpending" and
replace it with "depending" so both files use the correct spelling.
- Around line 180-183: The paragraph about models with image output is cut off;
rewrite the sentences around "Except that in the COMPLETED message, the field
images will be filled with content. The images" so it becomes one complete
sentence explaining that the only difference for image-capable models (e.g.,
gemini-2.5-flash-image) is that the COMPLETED payload includes an images field
populated with image data/URIs, and that otherwise the invocation and streaming
behavior is identical to plain-text models; remove the orphaned fragment and
ensure the example COMPLETED message description follows the corrected sentence.

In @rules/momen-cursurrules-prompt-file/momen-backend-architecture.mdc:
- Line 62: Fix the typo in the sentence "For other languages, infer
implemenation from the above example." by replacing "implemenation" with
"implementation" so the line reads "For other languages, infer implementation
from the above example." Ensure the corrected word is updated wherever the
misspelling "implemenation" appears in the document (search for that exact
token).
- Line 14: In the bullet under "**AI Agent**" correct the typo "dpending" to
"depending" so the phrase reads "multi-modal input/output (depending on model)";
update the exact text fragment "* **AI Agent**: AI agent builder / runtime
capable of RAG, tool use (depending on model), multi-modal input/output
(depending on model), structured JSON output (depending on model)."
- Line 179: Fix the typo in the sentence that reads 'Always ensure
momen-database-gql-api-rules is read before writing code to interact with the
databse.' by changing "databse" to "database" in the
momen-backend-architecture.mdc content so it reads "...interact with the
database."

In @rules/momen-cursurrules-prompt-file/momen-database-gql-api-rules.mdc:
- Around line 860-863: Remove the duplicated phrase in the sentence about
type-specific operators: change "the operand type is **implicit, **the operand
type is implicit." to a single, correct phrase such as "the operand type is
implicit." in the paragraph describing type-specific operators (reference: the
sentence that starts "For **type-specific operators** (e.g., `_ilike`,
`_contains`)"). Ensure punctuation and spacing are correct after the edit.
- Around line 674-679: The markdown contains an empty fenced code block at the
location where the GraphQL field examples for post_tags should appear; replace
the empty block with a fenced code block specifying the language as "graphql"
and include the two GraphQL field signatures for post_tags and
post_tags_aggregate (the signatures shown after the empty block) inside that
fenced block so the example is rendered correctly.

In @rules/momen-cursurrules-prompt-file/momen-stripe-payment-rules.mdc:
- Line 9: Replace the malformed reference
"@https://docs.stripe.com/sdks/stripejs-react" with a proper Markdown link; for
example change it to [Stripe React SDK
docs](https://docs.stripe.com/sdks/stripejs-react) so the URL is clickable and
readable in the momen-stripe-payment-rules.mdc content line that currently
references the Stripe docs.

In @rules/momen-cursurrules-prompt-file/momen-tpa-gql-api-rules.mdc:
- Around line 91-104: The example GraphQL mutation is inconsistent and
incomplete: replace the unnamed/unused variables ($_1,$_2) and mismatched args
with explicit declared variables (e.g., $body and $Authorization), pass them
into operation_lzb3ownk as fz_body: $body and fz_Authorization: $Authorization,
and replace the placeholder {subFieldSelections} inside field_200_json with
concrete expected fields (for example id, htmlLink, status or other outputs)
while ensuring responseCode is always checked since field_200_json may be empty
on non-2xx responses.
🧹 Nitpick comments (6)
rules/momen-cursurrules-prompt-file/README.md (4)

22-31: Add language identifier to code block.

Line 22 should specify a language for the fenced code block (e.g., text or plaintext).

🔎 Proposed fix
-```
+```text
 .cursor/rules/
 ├── momen-backend-architecture.mdc      # Core architecture & GraphQL setup
 ├── momen-database-gql-api-rules.mdc    # Database CRUD operations
 ├── momen-actionflow-gql-api-rules.mdc  # Backend workflows & business logic
 ├── momen-tpa-gql-api-rules.mdc         # Third-party API integration
 ├── momen-ai-agent-gql-api-rules.mdc    # AI agent capabilities
 ├── momen-stripe-payment-rules.mdc      # Payment processing
 └── momen-binary-asset-upload-rules.mdc # File management
</details>

---

`105-113`: **Add language identifier to prompt example code block.**

Line 105 should specify a language identifier (e.g., `text` or `plaintext`) for the fenced code block.


<details>
<summary>🔎 Proposed fix</summary>

```diff
-```
+```text
 My Momen project is:  my-ecommerce-app (or exId: abc123xyz)
 
 Build an ecommerce website based on the Momen project's backend structure. 
 Use username authentication. 
 
 + Other misc requirements
 e.g. Use Stripe publishable key: pk_test_51RQRPTCO2XREqHNZr8Vz0T1CNciMnXCM4I2qxb3ZYOi4GTHtbPnW8OJxGM9GR9L67jEngDUoBTMWOdr9W2AzMoKa00AzoEc7qr
</details>

---

`292-296`: **Add language identifier to directory listing code block.**

Line 292 should specify a language identifier (e.g., `text` or `plaintext`) for the fenced code block.


<details>
<summary>🔎 Proposed fix</summary>

```diff
-```
+```text
 .momen-mcp/
 ├── credentials.json
 └── config.json
</details>

---

`235-240`: **Optional: Use hyphen in compound adjectives.**

Consider hyphenating compound adjectives for grammatical accuracy (e.g., "request/response logging" and "automated decision-making"). However, the document's conversational tone makes this optional.


<details>
<summary>🔎 Proposed improvements</summary>

```diff
-  - Request/response logging
+  - Request/response logging
   - Rate limiting control
-  - Automated decision making
+  - Automated decision-making
rules/momen-cursurrules-prompt-file/momen-database-gql-api-rules.mdc (1)

110-149: Missing language identifier for code block.

The RelationMetadata code block should have a language identifier for proper syntax highlighting.

Suggested fix
-```
+```json
 [
   {
     "targetTable": "post_tag",
rules/momen-cursurrules-prompt-file/momen-ai-agent-gql-api-rules.mdc (1)

259-264: Misleading mutation operation name.

The mutation is named "continue" but it performs "fz_zai_stop_responding". Consider renaming to "stopConversation" for clarity.

Suggested fix
   mutation request:  
   ```gql
-  mutation continue($conversationId: Long!) {
+  mutation stopConversation($conversationId: Long!) {
     fz_zai_stop_responding(conversationId: $conversationId)
   }
</details>

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used**: defaults

**Review profile**: CHILL

**Plan**: Pro

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between fc2ce049c55b369b498eef396506a7a269a1b461 and 2cd1eddb5c3631775c703776d0a254b13368ef6f.

</details>

<details>
<summary>📒 Files selected for processing (12)</summary>

* `README.md`
* `rules/momen-cursurrules-prompt-file/.cursorrules`
* `rules/momen-cursurrules-prompt-file/README.md`
* `rules/momen-cursurrules-prompt-file/common.mdc`
* `rules/momen-cursurrules-prompt-file/momen-actionflow-gql-api-rules.mdc`
* `rules/momen-cursurrules-prompt-file/momen-ai-agent-gql-api-rules.mdc`
* `rules/momen-cursurrules-prompt-file/momen-backend-architecture.mdc`
* `rules/momen-cursurrules-prompt-file/momen-binary-asset-upload-rules.mdc`
* `rules/momen-cursurrules-prompt-file/momen-database-gql-api-rules.mdc`
* `rules/momen-cursurrules-prompt-file/momen-publicity-rules.mdc`
* `rules/momen-cursurrules-prompt-file/momen-stripe-payment-rules.mdc`
* `rules/momen-cursurrules-prompt-file/momen-tpa-gql-api-rules.mdc`

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>📓 Path-based instructions (4)</summary>

<details>
<summary>**/*.md</summary>


**📄 CodeRabbit inference engine (.cursorrules)**

> Always use Markdown for documentation and README files

Files:
- `rules/momen-cursurrules-prompt-file/README.md`
- `README.md`

</details>
<details>
<summary>rules/*/README.md</summary>


**📄 CodeRabbit inference engine (.cursorrules)**

> `rules/*/README.md`: Refer to the README in each folder for guidance on naming conventions and descriptions
> Each .cursorrules file may have an accompanying README.md file in its folder; use this README to provide credit to the original author and a brief description of the .cursorrules file's purpose

Files:
- `rules/momen-cursurrules-prompt-file/README.md`

</details>
<details>
<summary>**/*.{md,cursorrules}</summary>


**📄 CodeRabbit inference engine (.cursorrules)**

> `**/*.{md,cursorrules}`: Use clear and concise language in all documentation and .cursorrules files
> When adding examples or explanations, focus on practical use cases for Cursor AI users

Files:
- `rules/momen-cursurrules-prompt-file/README.md`
- `README.md`

</details>
<details>
<summary>README.md</summary>


**📄 CodeRabbit inference engine (.cursorrules)**

> `README.md`: Maintain the existing structure of the README.md file
> Maintain the following structure in the README.md file: 1. Title and Awesome badge 2. Logo 3. Short description 4. "Why .cursorrules?" section 5. Table of Contents 6. Rules section (with subcategories) 7. How to Use section 8. Contributing section 9. License section
> Maintain alphabetical order within each category in the README.md file
> Use consistent formatting for list items in the README.md file
> Update the README.md file when adding new .cursorrules files, placing them in the correct category
> Ensure all links in the README.md file are relative and correct
> When updating the README.md, ensure the table of contents remains accurate
> When adding new categories, update both the 'Contents' and 'Rules' sections of the README.md

Files:
- `README.md`

</details>

</details><details>
<summary>🪛 LanguageTool</summary>

<details>
<summary>rules/momen-cursurrules-prompt-file/README.md</summary>

[uncategorized] ~237-~237: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...r handling - Request/response logging - Rate limiting control  ### 5. `momen-ai-agent-gql-api...

(EN_COMPOUND_ADJECTIVE_INTERNAL)

---

[grammar] ~253-~253: Use a hyphen to join words.
Context: ...ysis and generation - Automated decision making - Data extraction from unstructur...

(QB_NEW_EN_HYPHEN)

---

[style] ~492-~492: Consider using a less common alternative to make your writing sound more unique and professional.
Context: ...tory is provided under the MIT License. Feel free to use, modify, and distribute these rules...

(FEEL_FREE_TO_STYLE_ME)

---

[style] ~501-~501: Consider using a more formal and expressive alternative to ‘amazing’.
Context: ...anks to: - The Cursor team for building an amazing AI-first editor - Anthropic for Claude ...

(AWESOME)

</details>

</details>
<details>
<summary>🪛 markdownlint-cli2 (0.18.1)</summary>

<details>
<summary>rules/momen-cursurrules-prompt-file/README.md</summary>

22-22: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

105-105: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

---

139-139: Multiple headings with the same content

(MD024, no-duplicate-heading)

---

292-292: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

</details>

</details>

</details>

<details>
<summary>🔇 Additional comments (10)</summary><blockquote>

<details>
<summary>README.md (1)</summary><blockquote>

`142-142`: **✅ Correct alphabetical placement and formatting.**

The Momen.app entry is properly positioned between Manifest and Node.js, uses a relative link path, and follows the README's consistent list formatting.

</blockquote></details>
<details>
<summary>rules/momen-cursurrules-prompt-file/momen-publicity-rules.mdc (1)</summary><blockquote>

`1-20`: **✅ LGTM!**

The SVG badge documentation is clear and well-formatted. The YAML frontmatter correctly marks this rule as always-applicable.

</blockquote></details>
<details>
<summary>rules/momen-cursurrules-prompt-file/README.md (1)</summary><blockquote>

`134-147`: **Remove duplicate heading section.**

Lines 139–147 repeat the entire "What are Cursor Rules?" section that appears at lines 134–138, including identical bullet points. This is a Markdown linting violation (MD024). Delete the duplicate block.


<details>
<summary>🔎 Proposed fix</summary>

```diff
 By creating a `.cursorrules` file in your project's root directory, you can leverage these benefits and enhance your coding experience with Cursor AI.

 ## 🎓 What are Cursor Rules?

 **Cursor Rules** (`.cursor/rules/*.mdc` files) are specialized instructions that teach AI assistants about your project's architecture, APIs, and best practices. They enable AI to:

 - Generate accurate code without extensive prompting
 - Understand complex backend architectures
 - Follow best practices automatically
 - Produce production-ready code on first attempt

-### Why MDC Format?
+### Why MDC Format?

(Delete lines 139–147 entirely)

rules/momen-cursurrules-prompt-file/.cursorrules (1)

1-369: Comprehensive cursor rules configuration.

This is a well-structured and thorough configuration file that covers all aspects of integrating with Momen.app as a headless BaaS. The documentation includes clear examples for authentication, actionflows, AI agents, and payment processing.

rules/momen-cursurrules-prompt-file/momen-binary-asset-upload-rules.mdc (1)

1-78: Clear and comprehensive binary asset upload documentation.

This document provides excellent guidance for the two-step upload workflow with clear examples for all asset types (image, video, file). The enum values for CannedAccessControlList and MediaFormat are well-documented.

rules/momen-cursurrules-prompt-file/momen-backend-architecture.mdc (1)

1-263: Well-structured backend architecture documentation.

This document provides a comprehensive overview of Momen.app's headless BaaS architecture with good reference implementations and authentication examples. The cross-references to other rule files help maintain consistency.

rules/momen-cursurrules-prompt-file/momen-stripe-payment-rules.mdc (4)

11-23: Clarify that clientSecret is a placeholder in the example code.

Line 12 declares const clientSecret; without initialization. While the context makes it clear this comes from the GraphQL API response, adding a brief comment would improve clarity for developers copy-pasting this snippet.

🔎 Suggested improvement
 const clientSecret; // obtained via GraphQL API

This is already present in line 12, so no change needed — the placeholder is already well-annotated.


26-28: Guidance on order creation is clear and well-reasoned.

The note that orders should be created via actionflows (not frontend direct insertion) is sound security and business logic architecture. This is good guidance for developers.


30-70: One-time payment documentation is complete and well-structured.

Mutation signature, variable types, and example payloads are all provided and properly formatted. The amount-in-minor-unit guidance (line 31) is particularly helpful for common currency mistakes.


113-114: Key handling guidance is explicit and appropriate.

The instruction to embed the Stripe publishable key directly in source files (line 114) is correct — this key is intended for public exposure. The emphasis on avoiding environment variable abstraction is good practice documentation.

Comment on lines +139 to +140
1. Include Stripe JavaScript/TypeScript client: @stripe/react-stripe-js and @stripe/stripe-js for React, https://js.stripe.com/clover/stripe.js for ES modules.
2. Initialize Stripe with publishable key (write directly in source file - publicly exposed by design).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Stripe.js correct URL https://js.stripe.com official documentation

💡 Result:

The official Stripe.js script URL is https://js.stripe.com (commonly used as the versioned path https://js.stripe.com/v3). See Stripe's Stripe.js docs and versioning page for details and integration examples. [1][2]

Sources:
[1] Stripe.js docs — Stripe Elements / Stripe.js.
[2] Stripe.js versioning and support policy (js.stripe.com / v3 and versioned script examples).


Fix the Stripe.js URL in the Stripe integration guidance.

The URL https://js.stripe.com/clover/stripe.js is incorrect. The official Stripe.js URL is https://js.stripe.com/v3 (or https://js.stripe.com). The "/clover/" path does not exist in Stripe's CDN.

Change line 139 from:

Include Stripe JavaScript/TypeScript client: @stripe/react-stripe-js and @stripe/stripe-js for React, https://js.stripe.com/clover/stripe.js for ES modules.

To use the correct URL: https://js.stripe.com/v3

🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/.cursorrules around lines 139 - 140,
Update the Stripe integration guidance to use the correct Stripe.js CDN URL:
replace the incorrect URL string "https://js.stripe.com/clover/stripe.js" with
the official "https://js.stripe.com/v3" in the guidance line that mentions
"@stripe/react-stripe-js and @stripe/stripe-js for React" so the documentation
references the valid Stripe.js endpoint.


When using vite + tailwindcss, check online for newest integration method.
When generating frontends, make sure the UI is modern and beautiful.
When using graphql subscription, make make sure that is only one active websocket that is reused across the entire app. There should be a single instance of apollo client for the entire app.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: duplicated word.

"make make sure" should be "make sure".

Suggested fix
-When using graphql subscription, make make sure that is only one active websocket that is reused across the entire app. There should be a single instance of apollo client for the entire app.
+When using graphql subscription, make sure that there is only one active websocket that is reused across the entire app. There should be a single instance of apollo client for the entire app.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
When using graphql subscription, make make sure that is only one active websocket that is reused across the entire app. There should be a single instance of apollo client for the entire app.
When using graphql subscription, make sure that there is only one active websocket that is reused across the entire app. There should be a single instance of apollo client for the entire app.
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/common.mdc at line 7, Fix the duplicated
word in the sentence by replacing "make make sure" with "make sure" so the
sentence reads: "When using graphql subscription, make sure that is only one
active websocket that is reused across the entire app." Edit the string in the
common.mdc content where the sentence appears to remove the extra "make".

Never cache anything at the GraphQL level.
When debugging, make sure to check both console and network when unexpected things occur. When dealing with asynchronous requests, check the messages of the relevant websockets.
When using graphql with apollo client 3.x, make sure to run `apollo client:codegen --includes='src/path/to/files/containing/gql/**' --target typescript --outputFlat ./src/graphQL/__generated__` after writing/modifying the requests. Ensure the types are correctly generated. And use the types whenever appropriate.
When initiating a chrome cdt debugging session, make sure to clear existing state such as local storage or cookies. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: incorrect abbreviation.

"chrome cdt" should be "Chrome CDP" (Chrome DevTools Protocol).

Suggested fix
-When initiating a chrome cdt debugging session, make sure to clear existing state such as local storage or cookies.
+When initiating a Chrome CDP debugging session, make sure to clear existing state such as local storage or cookies.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
When initiating a chrome cdt debugging session, make sure to clear existing state such as local storage or cookies.
When initiating a Chrome CDP debugging session, make sure to clear existing state such as local storage or cookies.
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/common.mdc at line 11, Replace the
incorrect abbreviation "chrome cdt" with the correct term "Chrome CDP" in the
documentation string on the line that currently reads "When initiating a chrome
cdt debugging session, make sure to clear existing state such as local storage
or cookies."—update that sentence to use "Chrome CDP" (Chrome DevTools Protocol)
to correct the terminology.

Comment on lines +70 to +74
{
"data": {
"fz_create_action_flow_task": 1150000000000148
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing code fence marker for JSON response example.

Line 70 shows the start of the mutation response JSON but lacks the opening \``json` code fence marker. This inconsistency with other examples in the file makes it harder to parse and copy-paste.

🔎 Proposed fix
 Mutation response:
-{
+```json
+{

And add closing fence after line 74:

   }
 }
+```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
"data": {
"fz_create_action_flow_task": 1150000000000148
}
}
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-actionflow-gql-api-rules.mdc
around lines 70 - 74, The JSON mutation response example starting at the object
with "data": { "fz_create_action_flow_task": 1150000000000148 } is missing the
opening code fence; add an opening ```json fence immediately before that JSON
object and a closing ``` fence after it so the example is properly fenced and
consistent with other examples in the file (refer to the JSON block containing
fz_create_action_flow_task).

Comment on lines +76 to +85
Subscription request:
```gql
subscription fz_listen_action_flow_result($taskId: Long!) {
fz_listen_action_flow_result(taskId: $taskId) {
__typename"
output
status
}
}
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix GraphQL syntax error in subscription query example.

Line 80 contains __typename" with an errant double-quote character. This is shown as example code developers would copy, so the syntax must be valid. The quote should be removed or replaced with a comma if additional fields follow.

🔎 Proposed fix
subscription fz_listen_action_flow_result($taskId: Long!) {
  fz_listen_action_flow_result(taskId: $taskId) {
-    __typename"
+    __typename
     output
     status
   }
 }
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-actionflow-gql-api-rules.mdc
around lines 76 - 85, The subscription example contains a syntax error: remove
the stray double-quote after __typename in the fz_listen_action_flow_result
subscription example (i.e., change `__typename"` to `__typename`) or replace it
with a comma if you intend to list additional fields; ensure the selection set
remains valid and braces remain balanced for the subscription
`fz_listen_action_flow_result`.

Use the momen MCP server for this.

### Database
Always ensure momen-database-gql-api-rules is read before writing code to interact with the databse.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Typo: "databse".

"databse" should be "database".

Suggested fix
-Always ensure momen-database-gql-api-rules is read before writing code to interact with the databse.
+Always ensure momen-database-gql-api-rules is read before writing code to interact with the database.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Always ensure momen-database-gql-api-rules is read before writing code to interact with the databse.
Always ensure momen-database-gql-api-rules is read before writing code to interact with the database.
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-backend-architecture.mdc at line
179, Fix the typo in the sentence that reads 'Always ensure
momen-database-gql-api-rules is read before writing code to interact with the
databse.' by changing "databse" to "database" in the
momen-backend-architecture.mdc content so it reads "...interact with the
database."

Comment on lines +674 to +679
```
```

post_tags(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): [post_tag]!
post_tags_aggregate(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): post_tag_aggregate!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Empty code block appears to be an error.

Lines 675-676 contain an empty code block that seems incomplete. The text following it suggests there should be a GraphQL field example here.

Suggested fix
    1. One-To-Many Relationships**: **A single post record is associated with multiple records in the related table (post_tag).

-   ```
-   ```
-
-post_tags(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): [post_tag]!
+   ```graphql
+   post_tags(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): [post_tag]!
+   post_tags_aggregate(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): post_tag_aggregate!
+   ```
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
```
post_tags(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): [post_tag]!
post_tags_aggregate(where: post_tag_bool_exp, order_by: [post_tag_order_by!], distinct_on: [post_tag_select_column!], offset: Int, limit: Int): post_tag_aggregate!
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-database-gql-api-rules.mdc around
lines 674 - 679, The markdown contains an empty fenced code block at the
location where the GraphQL field examples for post_tags should appear; replace
the empty block with a fenced code block specifying the language as "graphql"
and include the two GraphQL field signatures for post_tags and
post_tags_aggregate (the signatures shown after the empty block) inside that
fenced block so the example is rendered correctly.

Comment on lines +860 to +863

- For **generic operators** (e.g., `_eq`, `_gt`) that can compare multiple data types, this principle is critical. You **must** choose the operand type based on the final data type of the values being compared. For instance, extracting the `MONTH` (a number) from a `created_at` (a timestamp) requires wrapping the entire comparison in `bigint_operand`.
- For **type-specific operators** (e.g., `_ilike`, `_contains`), the operand type is **implicit, **the operand type is implicit. The system already knows that `_ilike` operates on text, so you do not need to specify it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Duplicate phrase in documentation.

The phrase "the operand type is implicit" appears twice in the same sentence.

Suggested fix
-- For **type-specific operators** (e.g., `_ilike`, `_contains`), the operand type is **implicit, **the operand type is implicit. The system already knows that `_ilike` operates on text, so you do not need to specify it.
+- For **type-specific operators** (e.g., `_ilike`, `_contains`), the operand type is **implicit**. The system already knows that `_ilike` operates on text, so you do not need to specify it.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- For **generic operators** (e.g., `_eq`, `_gt`) that can compare multiple data types, this principle is critical. You **must** choose the operand type based on the final data type of the values being compared. For instance, extracting the `MONTH` (a number) from a `created_at` (a timestamp) requires wrapping the entire comparison in `bigint_operand`.
- For **type-specific operators** (e.g., `_ilike`, `_contains`), the operand type is **implicit, **the operand type is implicit. The system already knows that `_ilike` operates on text, so you do not need to specify it.
- For **generic operators** (e.g., `_eq`, `_gt`) that can compare multiple data types, this principle is critical. You **must** choose the operand type based on the final data type of the values being compared. For instance, extracting the `MONTH` (a number) from a `created_at` (a timestamp) requires wrapping the entire comparison in `bigint_operand`.
- For **type-specific operators** (e.g., `_ilike`, `_contains`), the operand type is **implicit**. The system already knows that `_ilike` operates on text, so you do not need to specify it.
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-database-gql-api-rules.mdc around
lines 860 - 863, Remove the duplicated phrase in the sentence about
type-specific operators: change "the operand type is **implicit, **the operand
type is implicit." to a single, correct phrase such as "the operand type is
implicit." in the paragraph describing type-specific operators (reference: the
sentence that starts "For **type-specific operators** (e.g., `_ilike`,
`_contains`)"). Ensure punctuation and spacing are correct after the edit.

# Overview
Momen.app supports native Stripe integration so that the end users of projects built on momen can pay for orders using credit card.
There are two supported modes of payment, one-time and recurring (subscription). An conceptual order table must be present in the project's database for both modes as an order id must be associated with every payment. This also means that an order must be created before invoking the actual call to stripe. At different stages of the payment process, such as order creation, payment initialiation, payment success or payment failure, HTTP requests will be sent from stripe's server to pre-configured URLs that point to the project built on momen, triggering corresponding actionflows, which are ultimately responsbile for modifying the database (such as updating order status, sending notification).
If a project needs stripe integration, stripe's Javascript / Typescript client must be included. For react, use @stripe/react-stripe-js and @stripe/stripe-js, for ES module, use https://js.stripe.com/clover/stripe.js. It must be then initialized using the publishable key which must be provided by the user. refer to @https://docs.stripe.com/sdks/stripejs-react
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Fix Markdown URL reference format.

Line 9 uses @https://docs.stripe.com/sdks/stripejs-react with an @ prefix instead of standard Markdown link syntax. This should be formatted as a proper link for better readability and clickability.

🔎 Proposed fix
-refer to @https://docs.stripe.com/sdks/stripejs-react
+refer to [Stripe React SDK docs](https://docs.stripe.com/sdks/stripejs-react)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
If a project needs stripe integration, stripe's Javascript / Typescript client must be included. For react, use @stripe/react-stripe-js and @stripe/stripe-js, for ES module, use https://js.stripe.com/clover/stripe.js. It must be then initialized using the publishable key which must be provided by the user. refer to @https://docs.stripe.com/sdks/stripejs-react
If a project needs stripe integration, stripe's Javascript / Typescript client must be included. For react, use @stripe/react-stripe-js and @stripe/stripe-js, for ES module, use https://js.stripe.com/clover/stripe.js. It must be then initialized using the publishable key which must be provided by the user. refer to [Stripe React SDK docs](https://docs.stripe.com/sdks/stripejs-react)
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-stripe-payment-rules.mdc at line
9, Replace the malformed reference
"@https://docs.stripe.com/sdks/stripejs-react" with a proper Markdown link; for
example change it to [Stripe React SDK
docs](https://docs.stripe.com/sdks/stripejs-react) so the URL is clickable and
readable in the momen-stripe-payment-rules.mdc content line that currently
references the Stripe docs.

Comment on lines +91 to +104
The corresponding GraphQL query should be
```gql
mutation request_${nonce}($summary: String, $location: String, $description: String, $start_dateTime: String, $start_timeZone: String, $end_dateTime: String, $end_timeZone: String, $attendees:[String], $Authorization: String) {
operation_lzb3ownk(fz_body: {}, arg1: $_1, arg2: $_2) {
responseCode
field_200_json {
{subFieldSelections}
}
}
}
```
field_200_json is a fixed fields for all third-party API derived GraphQL operation. It means the response that's valid for all 2xx response codes.

The responseCode subfield should always be checked, in case 5xx or 4xx codes are returned, which means field_200_json would be empty.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Incomplete/inconsistent GraphQL example.

The example mutation has several issues:

  1. Variables $_1, $_2 are used but not declared in the mutation signature
  2. fz_body, arg1, arg2 don't match the declared variables from the TPA configuration
  3. {subFieldSelections} is a placeholder that isn't explained

Consider providing a complete, working example that matches the TPA configuration shown above.

Suggested fix
 The corresponding GraphQL query should be
 ```gql
-mutation request_${nonce}($summary: String, $location: String, $description: String, $start_dateTime: String, $start_timeZone: String, $end_dateTime: String, $end_timeZone: String, $attendees:[String], $Authorization: String) {
-  operation_lzb3ownk(fz_body: {}, arg1: $_1, arg2: $_2) {
+mutation CreateCalendarEvent(
+  $body: Json!,
+  $Authorization: String!
+) {
+  operation_lzb3ownk(
+    fz_body: $body,
+    fz_Authorization: $Authorization
+  ) {
     responseCode
     field_200_json {
-      {subFieldSelections}
+      id
+      htmlLink
+      status
+      # ... other fields as needed from outputs
     }
- }
+  }
 }
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
The corresponding GraphQL query should be
🤖 Prompt for AI Agents
In @rules/momen-cursurrules-prompt-file/momen-tpa-gql-api-rules.mdc around lines
91 - 104, The example GraphQL mutation is inconsistent and incomplete: replace
the unnamed/unused variables ($_1,$_2) and mismatched args with explicit
declared variables (e.g., $body and $Authorization), pass them into
operation_lzb3ownk as fz_body: $body and fz_Authorization: $Authorization, and
replace the placeholder {subFieldSelections} inside field_200_json with concrete
expected fields (for example id, htmlLink, status or other outputs) while
ensuring responseCode is always checked since field_200_json may be empty on
non-2xx responses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant