Cline rules
.clinerules/project-guidelines.mdCline rules
Quality
65/100
Scores the file, not the repository.Length
1,558 words
34 headings · 9 code blocksRepository
0
— · pushed 73 days agoLast changed
2 days ago
First indexed 2 days ago.1# Paper Games Project Guidelines23This document provides comprehensive guidelines for creating new game projects in the paper-games repository and maintaining consistency across all projects.45## Project Structure Overview67```8paper-games/9├── common/ # Shared resources (DO NOT DUPLICATE)10│ ├── styles.css # Common CSS styles11│ ├── utils.js # Common JavaScript utilities12│ ├── assets/ # Shared assets13│ │ └── colored-pencil.png14│ └── README.md15├── [project-name]/ # Individual game projects16│ ├── index.html17│ ├── style.css # Project-specific styles ONLY18│ ├── script.js # Project-specific JavaScript19│ └── assets/ # Project-specific assets20│ └── banner_image_generated.png21├── index.html # Landing page22└── landing-style.css23```2425## Creating a New Project: Step-by-Step2627### Step 1: Create Project Directory2829```bash30mkdir [project-name]31mkdir [project-name]/assets32```3334**Naming Convention:**35- Use lowercase with hyphens (kebab-case): `bouncing-balls`, `order-chaos`36- Keep names descriptive but concise37- Avoid spaces and special characters3839### Step 2: Create HTML File4041Create `[project-name]/index.html` with this structure:4243```html44<!DOCTYPE html>45<html lang="en">46<head>47 <meta charset="UTF-8">48 <meta name="viewport" content="width=device-width, initial-scale=1.0">4950 <!-- SEO Meta Tags -->51 <meta name="description" content="[Write compelling 150-160 char description]">52 <meta name="keywords" content="[game type], strategy game, board game, paper game">53 <meta name="author" content="Prabhakar Gupta">54 <meta name="robots" content="index, follow">55 <meta name="language" content="English">5657 <!-- Open Graph / Social Media -->58 <meta property="og:title" content="[Game Name] - [Tagline]">59 <meta property="og:description" content="[Brief description for social sharing]">60 <meta property="og:type" content="website">61 <meta property="og:image" content="https://prabhakar267.github.io/paper-games/[project-name]/assets/banner_image_generated.png">62 <meta property="og:image:width" content="1200">63 <meta property="og:image:height" content="630">6465 <!-- Twitter Card -->66 <meta name="twitter:card" content="summary_large_image">67 <meta name="twitter:title" content="[Game Name] - [Tagline]">68 <meta name="twitter:description" content="[Brief description]">69 <meta name="twitter:image" content="https://prabhakar267.github.io/paper-games/[project-name]/assets/banner_image_generated.png">7071 <title>[Game Name] - [Tagline]</title>7273 <!-- Favicon -->74 <link rel="icon" type="image/png" href="https://prabhakar267.github.io/paper-games/common/assets/colored-pencil.png">75 <link rel="apple-touch-icon" href="https://prabhakar267.github.io/paper-games/common/assets/colored-pencil.png">7677 <!-- Google Fonts - Always use Open Sans -->78 <link rel="preconnect" href="https://fonts.googleapis.com">79 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>80 <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet">8182 <!-- Stylesheets: CRITICAL ORDER -->83 <link rel="stylesheet" href="../common/styles.css">84 <link rel="stylesheet" href="style.css">8586 <!-- Google Analytics -->87 <script>88 (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){89 (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),90 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)91 })(window,document,'script','//www.google-analytics.com/analytics.js','ga');9293 ga('create', 'UA-57220954-1', 'auto');94 ga('send', 'pageview');95 </script>96</head>97<body>98 <div class="container">99 <h1>[Game Title with Emoji] 🎮</h1>100101 <!-- OPTIONAL: Game Setup Section -->102 <div class="game-setup" id="gameSetup">103 <h2>Game Setup</h2>104105 <div class="setup-section">106 <h3>[Setting Category]</h3>107 <div class="radio-group">108 <label>109 <input type="radio" name="[setting]" value="[value]" checked>110 [Option 1 Description]111 </label>112 <label>113 <input type="radio" name="[setting]" value="[value2]">114 [Option 2 Description]115 </label>116 </div>117 </div>118119 <button id="startGame" class="btn-primary">Start Game</button>120 <div style="text-align: center; margin-top: 15px;">121 <a href="../" class="btn-secondary" style="display: inline-block; text-decoration: none;">Explore More Games</a>122 </div>123 </div>124125 <!-- Game Area -->126 <div class="game-area" id="gameArea" style="display: none;">127 <div class="game-info">128 <div class="game-status" id="gameStatus">129 [Status text]130 </div>131 </div>132133 <!-- Your game board/canvas/grid here -->134135 <div class="game-controls">136 <button id="resetGame" class="btn-secondary">New Game</button>137 <a href="../" class="btn-secondary" style="display: inline-block; text-decoration: none;">Explore More Games</a>138 </div>139 </div>140141 <!-- Info Sections - REQUIRED -->142 <div class="info-sections">143 <div class="collapsible-section">144 <div class="section-header" onclick="toggleSection('rules')">145 <h3>Rules</h3>146 <span class="toggle-icon" id="rules-icon">▼</span>147 </div>148 <div class="section-content" id="rules-content">149 <ul>150 <li>[Rule 1]</li>151 <li>[Rule 2]</li>152 <li>[Rule 3]</li>153 </ul>154155 <div class="reference">156 <p><strong>Game Reference:</strong> <a href="[url]" target="_blank" rel="noopener noreferrer">[Link Text]</a></p>157 </div>158 </div>159 </div>160161 <!-- Add more collapsible sections as needed -->162 </div>163 </div>164165 <!-- Scripts: CRITICAL ORDER -->166 <script src="../common/utils.js"></script>167 <script src="script.js"></script>168</body>169</html>170```171172### Step 3: Create CSS File173174Create `[project-name]/style.css` - **ONLY include project-specific styles:**175176```css177/* [Project Name] Specific Styles */178179/* RULES:180 * 1. DO NOT redefine common styles (body, .container, h1, h2, h3, buttons, etc.)181 * 2. Only add styles unique to this project182 * 3. Use the same color scheme: #667eea, #764ba2, #e74c3c, #3498db183 * 4. Follow the existing naming conventions184 */185186/* Example: Game-specific board styles */187.game-board {188 /* Your unique styles here */189}190191/* Example: Game-specific cell styles */192.cell {193 /* Your unique styles here */194}195196/* Always include responsive design */197@media (max-width: 768px) {198 /* Mobile-specific adjustments */199}200201@media (max-width: 600px) {202 /* Small mobile adjustments */203}204```205206### Step 4: Create JavaScript File207208Create `[project-name]/script.js`:209210```javascript211// [Project Name] Game Logic212213// IMPORTANT: Do not redefine toggleSection() - it's in common/utils.js214215// Game state variables216let gameState = {217 // Your state here218};219220// Initialize game221function initGame() {222 // Setup code223}224225// Game logic functions226// ...227228// Event listeners229document.addEventListener('DOMContentLoaded', () => {230 // Setup event listeners231});232```233234### Step 5: Add Assets2352361. **Banner Image** (REQUIRED): Create `assets/banner_image_generated.png`237 - Size: 1200x630px238 - Format: PNG239 - Purpose: Social media sharing (Open Graph)2402412. **Favicon**: Always use the shared favicon from `common/assets/colored-pencil.png`242 - DO NOT copy colored-pencil.png to individual project directories243 - Reference it from common directory in HTML: `https://prabhakar267.github.io/paper-games/common/assets/colored-pencil.png`244 - Projects can create custom favicons if needed, but the default colored-pencil.png should remain only in common/assets/245246### Step 6: Update Landing Page247248Add your project to the main `index.html`:249250```html251<div class="game-tile" style="background-image: url('[project-name]/assets/banner_image_generated.png');">252 <a href="[project-name]/">253 <div class="tile-overlay">254 <h3>[Game Name]</h3>255 <p>[One-line description from your game]</p>256 </div>257 </a>258</div>259```260261### Step 7: Update README.md262263Add your project to the main `README.md` file in the games table:264265```markdown266| [<img src="[project-name]/assets/banner_image_generated.png" width="400" alt="[Game Name]">](https://prabhakar267.github.io/paper-games/[project-name]/) | **[[Game Name]](https://prabhakar267.github.io/paper-games/[project-name]/)**<br>[One-line description from your game] |267```268269**Important:**270- Add the new game entry as a new row in the table271- Use the same one-line description as used in the landing page272- Images are fixed at 400px width using HTML img tags273- The banner image should be clickable and link to the live game URL274- The game name should also be a clickable link275276## Common Resources - DO NOT DUPLICATE277278### Available from common/styles.css279280**DO NOT redefine these in your project CSS:**281282- CSS Reset (`* { margin: 0; padding: 0; box-sizing: border-box; }`)283- `body` styling (gradient background, flexbox layout)284- `.container` (white card with shadow)285- Typography: `h1`, `h2`, `h3`286- Buttons: `.btn-primary`, `.btn-secondary`287- `.setup-section`288- `.radio-group` and radio button styling289- `.info-sections` and collapsible sections290- `.collapsible-section`, `.section-header`, `.toggle-icon`, `.section-content`291- `.reference` links styling292- `.game-info`, `.game-status`, `.game-controls`293- `@keyframes pulse` animation294- Base responsive breakpoints (@media queries)295296### Available from common/utils.js297298**DO NOT redefine these in your project JavaScript:**299300- `toggleSection(sectionId)` - Handles collapsible section toggling301302### Available from common/assets/303304- `colored-pencil.png` - Default favicon/icon305306## Design Guidelines307308### Color Palette (Use Consistently)309310```css311--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);312--primary-color: #667eea;313--secondary-color: #764ba2;314--error-red: #e74c3c;315--info-blue: #3498db;316--success-green: #27ae60;317--warning-yellow: #f1c40f;318--text-dark: #333;319--text-medium: #555;320--text-light: #666;321--bg-light: #f8f9fa;322--border-color: #ddd;323```324325### Typography326327- **Font**: Open Sans (already loaded via Google Fonts)328- **H1**: 2.5em, center-aligned329- **H2**: 1.5-2em, center-aligned330- **H3**: 1.2em331- **Body**: 1em, line-height 1.6332333### Spacing334335- Use consistent padding/margin: 10px, 15px, 20px, 30px, 40px336- Container padding: 30px (20px on mobile)337- Section margins: 20-25px338339### Interactive Elements340341- **Hover effects**: Use `transform: translateY(-2px)` or `transform: scale(1.05)`342- **Transitions**: Keep under 0.3s (`transition: all 0.3s ease`)343- **Cursor**: Always use `cursor: pointer` on clickable elements344345## File Naming Conventions346347- **Directories**: `lowercase-with-hyphens`348- **HTML files**: `index.html` (always)349- **CSS files**: `style.css` (project-specific)350- **JS files**: `script.js` (project-specific)351- **Images**: `descriptive-name.png` or `descriptive-name.jpg`352- **Banner images**: Always `banner_image_generated.png`353354## Code Style Guidelines355356### HTML357- Use 4-space indentation358- Include semantic HTML5 elements359- Always include proper meta tags360- Use meaningful IDs and class names361- Close all tags properly362363### CSS364- Use 4-space indentation365- Group related styles together366- Comment major sections367- Mobile-first responsive design368- Use class selectors over IDs for styling369370### JavaScript371- Use 4-space indentation or 2-space (be consistent within file)372- Use `const` and `let`, avoid `var`373- Use descriptive variable/function names374- Comment complex logic375- Use modern ES6+ features where appropriate376377## Testing Checklist378379Before committing a new project:380381- [ ] All HTML validates (no errors)382- [ ] CSS doesn't override common styles unnecessarily383- [ ] JavaScript works without console errors384- [ ] Responsive design works on mobile (test at 320px, 768px, 1024px)385- [ ] All buttons and interactive elements work386- [ ] Collapsible sections toggle correctly387- [ ] "Back to Games" links work388- [ ] Meta tags are complete and accurate389- [ ] Banner image exists and displays correctly390- [ ] Game is playable end-to-end391- [ ] Browser console has no errors392- [ ] Landing page updated with new game card393- [ ] README.md updated with new game entry394395## Common Pitfalls to Avoid3963971. **❌ Redefining common styles** - Always check `common/styles.css` first3982. **❌ Wrong stylesheet order** - common/styles.css MUST come before style.css3993. **❌ Wrong script order** - common/utils.js MUST come before script.js4004. **❌ Hardcoding paths** - Use relative paths (`../common/...`)4015. **❌ Inconsistent color schemes** - Stick to the defined palette4026. **❌ Missing responsive design** - Always include mobile breakpoints4037. **❌ Forgetting analytics** - Include Google Analytics script4048. **❌ Missing meta tags** - SEO and social sharing require complete meta tags4059. **❌ Not testing mobile** - Always test on small screens40610. **❌ Forgetting to update landing page** - Add your game to index.html407408## Quick Reference Commands409410```bash411# Create new project structure412mkdir [project-name]413mkdir [project-name]/assets414415# Copy common files as templates (don't use these directly!)416# Create your own versions based on guidelines above417418# Test locally419open [project-name]/index.html420421# Test landing page422open index.html423```424425## Questions or Issues?426427If you encounter inconsistencies or need clarification:4284291. Check existing projects for examples (bouncing-balls, order-chaos, etc.)4302. Review `common/README.md` for shared resources documentation4313. Ensure you're following the structure of successful existing projects432433## Version History434435- **v1.0** (2025-12-28): Initial guidelines created after refactoring common resources436
Also in prabhakar267/paper-games
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| prabhakar267/paper-games.clinerules/git-commit-guidelines.md · 0 | Cline rules | lint-formatstylearchgit+3 | 93/100 | 2 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| bashdeban/fastmind.clinerules/.project-consistency-keeper2.md · 5 | Cline rules | setupbuildtestlint-format+11 | 100/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.clinerules · 31k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0 | Cline rules | buildstylearchgit+2 | 96/100 | 3 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 6 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| prabhakar267/paper-games.clinerules/git-commit-guidelines.md · 0 | Cline rules | lint-formatstylearchgit+3 | 93/100 | 2 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | yesterday | |
| HerringtonDarkholme/megarepo.clinerules/02-development.md · 17 | Cline rules | setupbuildteststyle+3 | 92/100 | 3 days ago |
