### Factorio Visualization Setup Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/python-flask-json-guide-cursorrules-prompt-file/README.md This snippet details the environment setup and core Python module usage for visualizing Factorio data. It includes importing the Drawscape Factorio module, loading FUE5 MOD JSON, and generating SVG with custom themes and layers. ```python import drawscape_factorio import json # Load Factorio data from FUE5 MOD JSON file with open('path/to/your/factorio_data.json', 'r') as f: factorio_data = json.load(f) # Initialize Drawscape Factorio with specific settings # Example settings: theme='default', color_scheme='blue', layers=['belts', 'inserters'] visualization = drawscape_factorio.DrawscapeFactorio( theme='default', color_scheme='blue', layers=['belts', 'inserters'] ) # Generate SVG visualization from parsed JSON data svg_output = visualization.generate_svg(factorio_data) # Save the SVG to a file with open('factorio_visualization.svg', 'w') as f: f.write(svg_output) print("Factorio visualization generated successfully.") ``` ```bash # Example environment.yml for project dependencies # This file lists required libraries and Python version. # Example content: # name: factorio-viz # channels: # - conda-forge # dependencies: # - python=3.9 # - pip # - flask # - svgwrite # - numpy # - drawscape-factorio # Assuming this is a package name # - pip: # - "drawscape-factorio @ git+https://github.com/your/repo.git" # Example if installed from git ``` ```json # Example FUE5 MOD JSON structure (simplified) # This is the input data format expected by the Drawscape Factorio module. { "entities": [ { "name": "underground-belt", "position": {"x": 10, "y": 5}, "direction": 0, "type": "underground-belt" }, { "name": "inserter", "position": {"x": 12, "y": 5}, "direction": 2, "type": "inserter" } ], "tiles": [ { "name": "stone-wall", "position": {"x": 11, "y": 6}, "type": "tile" } ] } ``` -------------------------------- ### Rails 8 Development Server Start Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/rails-cursorrules-prompt-file/rails-basics.mdx Command to start the Rails development server. This is the recommended way to run the application locally. ```Shell bin/dev ``` -------------------------------- ### Starting Rails Server Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/rails-cursorrules-prompt-file/rails-basics.mdx Specifies the command to start the Rails development server, which utilizes Procfile.dev for managing development processes. This ensures all necessary services are initiated correctly. ```shell bin/dev ``` -------------------------------- ### Python GitHub Setup Rules Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/README.md Cursor rules for Python development, providing guidance on GitHub setup. Streamlines the process of configuring Python projects for GitHub integration. ```cursorrules rules/python-github-setup-cursorrules-prompt-file/.cursorrules ``` -------------------------------- ### GitHub Instructions Rules Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/README.md Cursor rules for GitHub development, providing integrated instructions to guide users. Enhances collaboration and project onboarding on GitHub. ```cursorrules rules/github-cursorrules-prompt-file-instructions/.cursorrules ``` -------------------------------- ### Rails Development Rules Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/README.md Cursor rules for Rails development, providing a basic setup guide for Ruby on Rails applications. ```Ruby ./rules/rails-cursorrules-prompt-file/rails-basics.mdx ``` -------------------------------- ### Langchain Integration Toolkit for Next.js Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/nextjs-tailwind-typescript-apps-cursorrules-prompt/README.md A toolkit guiding developers in integrating Langchain features into Next.js applications. Provides examples for RAG applications using TypeScript and Tailwind CSS. ```TypeScript // Example Langchain RAG setup in Next.js // import { ChatOpenAI } from '@langchain/openai'; // import { createStuffDocumentsChain } from 'langchain/chains/combine_documents'; // import { ChatPromptTemplate } from '@langchain/core/prompts'; // const model = new ChatOpenAI({ temperature: 0.9 }); // const prompt = ChatPromptTemplate.fromTemplate(`Answer the question based on the context: {context} Question: {input}`) ``` ```Tailwind CSS /* Example Tailwind CSS for chat interface */ /* .chat-bubble { @apply p-3 rounded-lg max-w-xs; } .user-bubble { @apply bg-blue-500 text-white ml-auto; } .assistant-bubble { @apply bg-gray-200 text-black mr-auto; } */ ``` -------------------------------- ### Cypress Shadow Report Configuration Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/cypress-defect-tracking-cursorrules-prompt-file/use-case-example.md This JavaScript configuration file defines settings for the qa-shadow-report package. It specifies team names, test types, categories, and paths for test data and reporting, enabling structured defect tracking and analysis. ```javascript // shadowReportConfig.js module.exports = { teamNames: ['CartTeam', 'CheckoutTeam', 'ProductTeam'], testTypes: ['api', 'ui', 'accessibility', 'mobile'], testCategories: ['smoke', 'regression', 'usability', 'performance'], googleSpreadsheetUrl: 'https://docs.google.com/spreadsheets/d/your-sheet-id/edit', googleKeyFilePath: './googleCredentials.json', testData: './cypress/results/output.json', csvDownloadsPath: './downloads', weeklySummaryStartDay: 'Monday', }; ``` -------------------------------- ### Real-time Chat Application with Next.js & Supabase Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/nextjs-tailwind-typescript-apps-cursorrules-prompt/README.md Demonstrates building a real-time chat application using Next.js, Tailwind CSS, TypeScript, and Supabase's real-time database. Covers environment setup, authentication, and message storage. ```TypeScript // Example Supabase real-time subscription // supabase.channel('chat').on('postgres_changes', { event: 'INSERT', schema: 'public', table: 'messages' }, payload => { // console.log('New message:', payload.new); // }).subscribe(); ``` ```Tailwind CSS /* Example Tailwind CSS for message input area */ /* .message-input { @apply flex items-center p-4 border-t; } */ ``` -------------------------------- ### Customized Tutorial Creator Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/next-type-llm/README.md A tool that automatically creates tutorials based on codebase input, using LLMs to form readable, step-by-step guides for specific programming tasks or app functionalities in Next.js and TypeScript. ```TypeScript createTutorial(codebase: string, task: string, language: string): Tutorial Tutorial: title: string steps: TutorialStep[] TutorialStep: stepNumber: number description: string codeExample?: string explanation: string ``` -------------------------------- ### Tauri Svelte TypeScript Guide Rules Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/README.md Cursor rules for Tauri development, offering a guide for Svelte and TypeScript integration. Aids in building cross-platform desktop applications. ```cursorrules rules/tauri-svelte-typescript-guide-cursorrules-prompt-f/.cursorrules ``` -------------------------------- ### Hardhat Development Workflow Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/solidity-hardhat-cursorrules-prompt-file/README.md This entry outlines the typical development workflow using Hardhat, a popular Ethereum development environment. It covers compilation, testing, and deployment aspects. ```APIDOC Hardhat Development Workflow: 1. **Project Setup**: - Initialize a new Hardhat project: `npx hardhat` - Install necessary dependencies: `npm install` or `yarn add` 2. **Writing Contracts**: - Place Solidity files in the `contracts/` directory. - Use recommended patterns and libraries (e.g., OpenZeppelin). 3. **Compilation**: - Compile contracts: `npx hardhat compile` - Artifacts (ABI, bytecode) are generated in the `artifacts/` directory. 4. **Testing**: - Write tests in JavaScript or TypeScript in the `test/` directory. - Run tests: `npx hardhat test` 5. **Deployment**: - Write deployment scripts in the `scripts/` directory. - Deploy to a local network (Hardhat Network): `npx hardhat run scripts/deploy.js` - Deploy to testnets/mainnet using network configurations in `hardhat.config.js`: `npx hardhat run scripts/deploy.js --network goerli` 6. **Task Execution**: - Create custom Hardhat tasks for specific operations. Related Tools: - Slither: For static analysis. - Mythril: For security analysis. - Ethers.js/Web3.js: For frontend interaction. ``` -------------------------------- ### .cursorrules Prompt Guidelines Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/next-type-llm/README.md Outlines guidelines for AI-assisted software development, emphasizing holistic understanding of tech stack (Next.js, TypeScript, Tailwind CSS, Python), modularity, DRY principles, performance, security, and a methodical step-by-step coding process. ```APIDOC CursorRules: description: "Guidelines for AI-assisted software development." principles: - "Holistic understanding of tech stack (Next.js, TypeScript, Tailwind CSS, Python for LLM integration)." - "Modularity, DRY principles, performance, and security." - "Methodical, step-by-step coding process." - "Clear coding standards: balance verbosity and brevity." - "Accountability via TODO comments." assistantRole: "Senior pair programmer." assistantCapabilities: - "Expertise in programming language used." - "Concise summary of requirements." - "Code history analysis." deployment: status: "Undetermined." ``` -------------------------------- ### Cypress Shopping Cart Tests with Hierarchical Tagging Source: https://github.com/patrickjs/awesome-cursorrules/blob/main/rules/cypress-defect-tracking-cursorrules-prompt-file/use-case-example.md This Cypress test file demonstrates hierarchical tagging for defect tracking and reporting. It includes team names, test categories, and case IDs within the test descriptions, leveraging the qa-shadow-report package for enhanced reporting capabilities. ```javascript // ui/shopping-cart.cy.js // Import the qa-shadow-report package const { ReportTracker } = require('qa-shadow-report'); describe('[CartTeam][regression] Shopping Cart Tests', () => { beforeEach(() => { cy.visit('/cart'); }); context('cart management', () => { it('should add item to cart correctly [smoke][C5001]', () => { cy.get('[data-testid="product-list"]') .find('.product-item') .first() .click(); cy.get('[data-testid="add-to-cart"]').click(); cy.get('[data-testid="cart-count"]').should('contain', '1'); cy.get('[data-testid="cart-items"]').should('contain', 'Product Name'); }); it('should remove item from cart correctly [smoke][C5002]', () => { // Setup: First add an item cy.get('[data-testid="product-list"]') .find('.product-item') .first() .click(); cy.get('[data-testid="add-to-cart"]').click(); // Test removal cy.get('[data-testid="cart-items"]') .find('[data-testid="remove-item"]') .click(); cy.get('[data-testid="cart-count"]').should('contain', '0'); cy.get('[data-testid="cart-items"]').should( 'not.contain', 'Product Name' ); }); // Example of a test with a different category than its parent it('should apply discount code correctly [C5003][performance]', () => { // Setup: First add an item cy.get('[data-testid="product-list"]') .find('.product-item') .first() .click(); cy.get('[data-testid="add-to-cart"]').click(); // Apply discount cy.get('[data-testid="discount-code"]').type('SAVE20'); cy.get('[data-testid="apply-discount"]').click(); cy.get('[data-testid="cart-total"]').should( 'contain', 'Discount applied' ); cy.get('[data-testid="final-price"]').should('contain', '$80.00'); // 20% off $100 }); }); }); ```