Repository navigation
feat: Add Cursor mastery blog post and update post rules #82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
9acd1b5
deaaad1
f52d15c
ae35f3e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| --- | ||
| description: Create a blog post from a Notion page using the Notion MCP server | ||
| --- | ||
|
|
||
| # /notion-post Command | ||
|
|
||
| Create a blog post from a Notion page. This command will: | ||
|
|
||
| 1. Verify the Notion MCP server connection is working | ||
| 2. Fetch the specified Notion page content | ||
| 3. Convert the Notion page to a properly formatted MDX blog post | ||
| 4. Save it to `content/posts/` with appropriate frontmatter | ||
|
|
||
| ## Usage | ||
|
|
||
| ``` | ||
| /notion-post <notion-page-url-or-id> | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| - `notion-page-url-or-id`: The Notion page URL (e.g., `https://www.notion.so/2e52883bd89380f491f3fe3a2e187ee7`) or page | ||
| ID (e.g., `2e52883b-d893-80f4-91f3-fe3a2e187ee7`) | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. **Verify Notion MCP Connection** | ||
| - Use `notion-get-self` to check if the Notion MCP server is connected and working | ||
| - If connection fails, inform the user and stop | ||
|
|
||
| 2. **Fetch Notion Page** | ||
| - Use `notion-fetch` with the provided page URL or ID | ||
| - Extract the page title, content, and metadata | ||
|
|
||
| 3. **Convert to MDX Post** | ||
| - Generate a kebab-case filename from the page title | ||
| - Create frontmatter with: | ||
| - `title`: From Notion page title (remove emojis if present) | ||
| - `topics`: Infer from content or use "AI" as default | ||
| - `date`: Current date (YYYY-MM-DD) | ||
| - `excerpt`: First paragraph or a summary of the content | ||
| - `cover`: | ||
| - `banner`: Search for a relevant image URL or use placeholder | ||
| - `topic`: Primary topic | ||
| - `title`: Main title | ||
| - `subtitle`: Catchy subtitle | ||
| - Convert Notion markdown to MDX format: | ||
| - Preserve code blocks | ||
| - Convert callouts to blockquotes | ||
| - Handle images appropriately | ||
|
|
||
| 4. **Save Post** | ||
| - Save to `content/posts/{kebab-case-title}.mdx` | ||
| - Follow the structure defined in `.cursor/rules/post.mdc` | ||
|
|
||
| ## Example | ||
|
|
||
| ``` | ||
| /notion-post https://www.notion.so/2e52883bd89380f491f3fe3a2e187ee7 | ||
| ``` | ||
|
|
||
| This will: | ||
|
|
||
| - Check Notion MCP connection | ||
| - Fetch the "Mastering Cursor: From Chatbot to Pair Programmer" page | ||
| - Create `content/posts/mastering-cursor-from-chatbot-to-pair-programmer.mdx` | ||
|
|
||
| ## Error Handling | ||
|
|
||
| - If Notion MCP server is not connected, show a clear error message | ||
| - If the page is not found, inform the user | ||
| - If there's an error converting content, show the error and partial results if available | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| --- | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Excellent documentation! The |
||
| description: Analyze code changes and create a pull request with AI-powered code review | ||
| --- | ||
|
|
||
| # /pr Command | ||
|
|
||
| Analyze code changes using MCP server and create a pull request with a well-formatted title and description. The AI will | ||
| automatically: | ||
|
|
||
| - Analyze your code changes | ||
| - Generate PR title and description | ||
| - Create or update the PR on GitHub using MCP server | ||
| - **Perform AI code review** - analyze the PR code changes against all tech standards | ||
| - **Submit review comments** - leave detailed review comments on GitHub with line-specific feedback | ||
| - Provide you with the PR URL | ||
|
|
||
| ## Usage | ||
|
|
||
| ``` | ||
| /pr | ||
| ``` | ||
|
|
||
| Or with optional base branch: | ||
|
|
||
| ``` | ||
| /pr <base-branch> | ||
| ``` | ||
|
|
||
| ## Parameters | ||
|
|
||
| - `base-branch` (optional): The base branch to compare against (defaults to `main`) | ||
|
|
||
| ## Workflow | ||
|
|
||
| 1. **Analyze Code Changes** | ||
| - Check current git status and branch | ||
| - Get diff between current branch and base branch | ||
| - Identify changed files, additions, deletions | ||
| - Analyze commit history | ||
|
|
||
| 2. **Generate PR Metadata** | ||
| - Create a descriptive PR title following conventional commits format | ||
| - Generate comprehensive PR description including: | ||
| - Summary of changes | ||
| - Files changed | ||
| - Breaking changes (if any) | ||
| - Testing instructions | ||
| - Code review notes | ||
|
|
||
| 3. **Create or Update PR** | ||
| - Check if PR already exists for the current branch | ||
| - If exists, update it with new description | ||
| - If not, create new PR using GitHub MCP `create_pull_request` | ||
| - Set base branch (default: `main`) and head branch (current branch) | ||
|
|
||
| 4. **Perform AI Code Review** | ||
| - Analyze each changed file for: | ||
| - Code quality and best practices | ||
| - Adherence to project standards and rules | ||
| - Potential bugs or issues | ||
| - Performance considerations | ||
| - Security concerns | ||
| - Consistency with codebase patterns | ||
| - Check for: | ||
| - Linter errors | ||
| - Type safety issues | ||
| - Missing error handling | ||
| - Console.logs or debug code | ||
| - Memory leaks | ||
| - Adherence to project-specific rules | ||
|
|
||
| 5. **Submit Review Comments** | ||
| - Create a pending review using `pull_request_review_write` with method `create` | ||
| - Add line-specific review comments using `add_comment_to_pending_review`: | ||
| - Positive feedback for good practices | ||
| - Suggestions for improvements | ||
| - Warnings for potential issues | ||
| - Questions for clarification | ||
| - Submit the review using `pull_request_review_write` with method `submit_pending` | ||
| - Use `COMMENT` event (can't approve own PR) | ||
|
|
||
| 6. **Provide Results** | ||
| - Return PR URL | ||
| - Summarize review findings | ||
| - List any issues found | ||
|
|
||
| ## Example | ||
|
|
||
| ``` | ||
| /pr | ||
| ``` | ||
|
|
||
| This will: | ||
|
|
||
| - Analyze changes in current branch vs `main` | ||
| - Create PR with title like "feat: Add Cursor mastery blog post and update post rules" | ||
| - Generate comprehensive description | ||
| - Perform code review on all changed files | ||
| - Add review comments on GitHub | ||
| - Return PR URL: `https://github.com/wghglory/my-website/pull/82` | ||
|
|
||
| ## Code Review Standards | ||
|
|
||
| The AI will review against: | ||
|
|
||
| - **Project Rules**: Check `.cursor/rules/` for project-specific standards | ||
| - **Code Quality**: Best practices, patterns, consistency | ||
| - **Type Safety**: TypeScript/type checking issues | ||
| - **Performance**: Potential performance issues | ||
| - **Security**: Security vulnerabilities | ||
| - **Testing**: Missing tests or test coverage | ||
| - **Documentation**: Missing or unclear documentation | ||
| - **Linting**: Linter errors and warnings | ||
|
|
||
| ## Error Handling | ||
|
|
||
| - If no changes detected, inform the user | ||
| - If branch doesn't exist on remote, provide instructions to push | ||
| - If GitHub MCP server is not connected, show clear error message | ||
| - If PR creation fails, show error details | ||
| - If review submission fails, show partial results if available | ||
|
|
||
| ## Notes | ||
|
|
||
| - The command works best when changes are already committed and pushed | ||
| - For uncommitted changes, the command will analyze staged/unstaged changes | ||
| - Review comments are submitted as `COMMENT` event (not approval) since you can't approve your own PR | ||
| - The PR description follows a standard template with sections for Summary, Changes, Breaking Changes, Testing | ||
| Instructions, and Code Review Notes | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -53,15 +53,12 @@ Cover Metadata: | |
| - cover.title: usually matches the main title. | ||
| - cover.subtitle: A short, catchy sub-header relevant to the post. | ||
|
|
||
| Table Generation using below syntax instead of markdown table: | ||
| Table Generation: Use standard markdown table syntax: | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ✅ Excellent update! Changing from React
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perfect update! The rule now clearly specifies standard markdown table syntax instead of the React Table component. The example is clear and matches the format used throughout the refactored posts. This will help ensure consistency for future posts. |
||
|
|
||
| ``` | ||
| <Table | ||
| columns={['Feature', '`Partial<T>`', '`Sparse<T>`']} | ||
| data={[ | ||
| ['Top Level Properties', 'Optional', 'Optional'], | ||
| ['Nested Objects', 'Required (Must be complete)', 'Optional (Can be partial)'], | ||
| ['Use Case', 'Simple object creation', 'Patches, deep updates, large forms'], | ||
| ]} | ||
| /> | ||
| | Feature | `Partial<T>` | `Sparse<T>` | | ||
| |---------|--------------|-------------| | ||
| | Top Level Properties | Optional | Optional | | ||
| | Nested Objects | Required (Must be complete) | Optional (Can be partial) | | ||
| | Use Case | Simple object creation | Patches, deep updates, large forms | | ||
| ``` | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,6 @@ import Bilibili from './Bilibili'; | |
| import CodeFrame from './CodeFrame'; | ||
| import Pre from './Pre'; | ||
| import Quote from './Quote'; | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good cleanup! The Table import and export have been properly removed. This ensures no unused code remains in the codebase. The component removal is consistent with the migration to markdown tables. |
||
| import Table from './Table'; | ||
| import YouTube from './Youtube'; | ||
|
|
||
| export const mdxComponents = { | ||
|
|
@@ -13,6 +12,5 @@ export const mdxComponents = { | |
| CodeFrame, | ||
| Quote, | ||
| Image, | ||
| Table, | ||
| pre: Pre, | ||
| }; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ Well-documented command! The workflow is clear and the error handling section is comprehensive. Good that it references
.cursor/rules/post.mdcto ensure consistency with the updated table syntax rules.