|
| 1 | +# Project Documentation and Workflow Improvement Guide |
| 2 | + |
| 3 | +This guide provides step-by-step instructions to implement the documentation and project management improvements tracked in issues #35 through #40. |
| 4 | + |
| 5 | +## Phase 1: README.md Enhancement |
| 6 | + |
| 7 | +### **Issue #35: Create Professional README.md with Header and Description** |
| 8 | + |
| 9 | +1. **Create the `README.md` file** in the root of the `js-chess-engine` repository. |
| 10 | +2. **Add the following content** to create the header and description: |
| 11 | + |
| 12 | + ```markdown |
| 13 | + # ♟️ JS Chess Engine |
| 14 | + |
| 15 | + > A pure JavaScript chess engine inspired by Atari Video Chess, designed for modern browsers and AI integration. |
| 16 | + |
| 17 | + ## Description |
| 18 | + |
| 19 | + This project is a complete, modern JavaScript chess engine built from the ground up. It honors the efficient, minimalist design of the original Atari Video Chess for the Atari 2600 while leveraging modern JavaScript features like ES2022. The primary goal is to create a robust, performant engine that can be used for browser-based chess games and serve as a platform for developing and testing chess AI. |
| 20 | + ``` |
| 21 | + |
| 22 | +### **Issue #36: Add Installation and Usage Sections** |
| 23 | + |
| 24 | +1. **Append the following sections** to your `README.md` file: |
| 25 | + |
| 26 | + ```markdown |
| 27 | + ## 🚀 Getting Started |
| 28 | + |
| 29 | + ### Prerequisites |
| 30 | + |
| 31 | + Ensure you have Node.js installed on your system. |
| 32 | + - **Node.js** (v18.x or higher recommended) |
| 33 | + |
| 34 | + ### Installation |
| 35 | + |
| 36 | + 1. Clone the repository to your local machine: |
| 37 | + ```bash |
| 38 | + git clone https://github.com/jane-alesi/js-chess-engine.git |
| 39 | + ``` |
| 40 | + 2. Navigate to the project directory: |
| 41 | + ```bash |
| 42 | + cd js-chess-engine |
| 43 | + ``` |
| 44 | + 3. Install the required dependencies: |
| 45 | + ```bash |
| 46 | + npm install |
| 47 | + ``` |
| 48 | + |
| 49 | + ## Usage |
| 50 | + |
| 51 | + To run the project and see the chess engine in action, you can open the `index.html` file in the `src/ui/` directory in your web browser. |
| 52 | + |
| 53 | + To run the automated tests: |
| 54 | + ```bash |
| 55 | + npm test |
| 56 | + ``` |
| 57 | + ``` |
| 58 | + |
| 59 | +### **Issue #37: Add Architecture Diagram and Contribution Guidelines** |
| 60 | + |
| 61 | +1. **Create a new file named `CONTRIBUTING.md`** in the repository root with the following content: |
| 62 | + |
| 63 | + ```markdown |
| 64 | + # Contributing to JS Chess Engine |
| 65 | + |
| 66 | + We welcome contributions from the community! Whether you're a developer, a chess enthusiast, or an AI researcher, your input is valuable. |
| 67 | + |
| 68 | + ## Development Workflow |
| 69 | + |
| 70 | + 1. **Fork the repository** and clone it to your local machine. |
| 71 | + 2. **Create a new branch** for your feature or bug fix: `git checkout -b feature/your-feature-name`. |
| 72 | + 3. **Make your changes**, adhering to the project's coding standards. |
| 73 | + 4. **Run tests** to ensure your changes don't break existing functionality: `npm test`. |
| 74 | + 5. **Commit your changes** with a descriptive commit message. |
| 75 | + 6. **Push your branch** to your fork and **submit a pull request** to the `main` branch of the original repository. |
| 76 | + |
| 77 | + ## Code Standards |
| 78 | + |
| 79 | + - We use ESLint and Prettier for code consistency. Please run `npm run quality:check` before committing. |
| 80 | + - Follow the existing code patterns and conventions. |
| 81 | + - All new features should have corresponding tests. |
| 82 | + ``` |
| 83 | + |
| 84 | +2. **Append the following sections** to your `README.md` file: |
| 85 | + |
| 86 | + ```markdown |
| 87 | + ## 🏗️ Architecture |
| 88 | + |
| 89 | + The project follows a modular architecture, separating concerns into distinct components: |
| 90 | + |
| 91 | + ```mermaid |
| 92 | + graph TD |
| 93 | + A[UI Layer] --> B[Core Engine] |
| 94 | + C[AI Player] --> B |
| 95 | + B --> D[Utilities] |
| 96 | + |
| 97 | + subgraph "src/ui" |
| 98 | + A(BoardRenderer.js, InputHandler.js) |
| 99 | + end |
| 100 | + |
| 101 | + subgraph "src/core" |
| 102 | + B(Board.js, GameState.js, MoveGenerator.js) |
| 103 | + end |
| 104 | + |
| 105 | + subgraph "src/ai" |
| 106 | + C(AIPlayer.js, Evaluation.js) |
| 107 | + end |
| 108 | + |
| 109 | + subgraph "src/utils" |
| 110 | + D(Constants.js, Notation.js) |
| 111 | + end |
| 112 | + ``` |
| 113 | + |
| 114 | + ## 🤝 Contributing |
| 115 | + |
| 116 | + Contributions are welcome! Please read our [Contributing Guidelines](CONTRIBUTING.md) to get started. |
| 117 | + |
| 118 | + ## 📜 License |
| 119 | + |
| 120 | + This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
| 121 | + ``` |
| 122 | + |
| 123 | +### **Issue #38: Add Status Badges and Roadmap** |
| 124 | + |
| 125 | +1. **Insert the following badges** at the top of your `README.md`, right below the title: |
| 126 | + |
| 127 | + ```markdown |
| 128 | + [](https://github.com/jane-alesi/js-chess-engine/actions/workflows/ci.yml) |
| 129 | + [](https://opensource.org/licenses/MIT) |
| 130 | + ``` |
| 131 | + |
| 132 | +2. **Append the following "Roadmap" section** to your `README.md` file: |
| 133 | + |
| 134 | + ```markdown |
| 135 | + ## 🗺️ Roadmap |
| 136 | + |
| 137 | + - [ ] **Phase 1: Core Move Generation** |
| 138 | + - [ ] Rook Move Generation (#2) |
| 139 | + - [ ] Bishop Move Generation (#1) |
| 140 | + - [ ] Knight Move Generation (#9) |
| 141 | + - [ ] King Move Generation (#7) |
| 142 | + - [ ] Queen Move Generation (#6) |
| 143 | + - [ ] **Phase 2: Core Game Logic** |
| 144 | + - [ ] Self-Check Prevention |
| 145 | + - [ ] Check/Checkmate Detection |
| 146 | + - [ ] **Phase 3: AI Implementation** |
| 147 | + - [ ] Minimax Algorithm with Alpha-Beta Pruning |
| 148 | + - [ ] **Phase 4: Advanced Features** |
| 149 | + - [ ] Castling, En Passant, and Promotion |
| 150 | + - [ ] UI Enhancements |
| 151 | + |
| 152 | + See the [open issues](https://github.com/jane-alesi/js-chess-engine/issues) for a full list of proposed features and known issues. |
| 153 | + ``` |
| 154 | + |
| 155 | +## Phase 2: Issue Management Improvement |
| 156 | + |
| 157 | +### **Issue #39: Create Standardized GitHub Issue Templates** |
| 158 | + |
| 159 | +1. **Create the directory `.github/ISSUE_TEMPLATE`** in the root of your repository. |
| 160 | +2. Inside this directory, create a file named `bug_report.md` with the following content: |
| 161 | + |
| 162 | + ```markdown |
| 163 | + --- |
| 164 | + name: Bug Report |
| 165 | + about: Create a report to help us improve |
| 166 | + title: 'Bug: ' |
| 167 | + labels: 'type:bug' |
| 168 | + --- |
| 169 | + |
| 170 | + **Describe the bug** |
| 171 | + A clear and concise description of what the bug is. |
| 172 | + |
| 173 | + **To Reproduce** |
| 174 | + Steps to reproduce the behavior: |
| 175 | + 1. Go to '...' |
| 176 | + 2. Click on '....' |
| 177 | + 3. Scroll down to '....' |
| 178 | + 4. See error |
| 179 | + |
| 180 | + **Expected behavior** |
| 181 | + A clear and concise description of what you expected to happen. |
| 182 | + |
| 183 | + **Screenshots** |
| 184 | + If applicable, add screenshots to help explain your problem. |
| 185 | + |
| 186 | + **Environment (please complete the following information):** |
| 187 | + - OS: [e.g. iOS] |
| 188 | + - Browser [e.g. chrome, safari] |
| 189 | + - Version [e.g. 22] |
| 190 | + ``` |
| 191 | + |
| 192 | +3. Create another file named `feature_request.md` with the following content: |
| 193 | + |
| 194 | + ```markdown |
| 195 | + --- |
| 196 | + name: Feature Request |
| 197 | + about: Suggest an idea for this project |
| 198 | + title: 'Feature: ' |
| 199 | + labels: 'type:feature' |
| 200 | + --- |
| 201 | + |
| 202 | + **Is your feature request related to a problem? Please describe.** |
| 203 | + A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] |
| 204 | + |
| 205 | + **Describe the solution you'd like** |
| 206 | + A clear and concise description of what you want to happen. |
| 207 | + |
| 208 | + **Describe alternatives you've considered** |
| 209 | + A clear and concise description of any alternative solutions or features you've considered. |
| 210 | + |
| 211 | + **Acceptance Criteria** |
| 212 | + - [ ] Criteria 1 |
| 213 | + - [ ] Criteria 2 |
| 214 | + |
| 215 | + **Additional context** |
| 216 | + Add any other context or screenshots about the feature request here. |
| 217 | + ``` |
| 218 | + |
| 219 | +### **Issue #40: Implement Intelligent Issue Labeling and Automation** |
| 220 | + |
| 221 | +1. **Create the required labels** in your repository's `Labels` settings (`https://github.com/jane-alesi/js-chess-engine/labels`): |
| 222 | + * `priority:critical` (Color: `#b60205`) |
| 223 | + * `priority:high` (Color: `#d93f0b`) |
| 224 | + * `priority:medium` (Color: `#fbca04`) |
| 225 | + * `priority:low` (Color: `#0e8a16`) |
| 226 | + * `type:bug` 🐛 (Color: `#d73a4a`) |
| 227 | + * `type:feature` ✨ (Color: `#a2eeef`) |
| 228 | + * `type:security` 🔒 (Color: `#ee0701`) |
| 229 | + * `type:docs` 📚 (Color: `#0075ca`) |
| 230 | + * `stale` 🏷️ (Color: `#ededed`) |
| 231 | + |
| 232 | +2. **Create the directory `.github/workflows`** if it doesn't exist. |
| 233 | +3. Inside this directory, create a file named `auto-triage.yml` with the following content: |
| 234 | + |
| 235 | + ```yaml |
| 236 | + name: Issue Triage |
| 237 | + on: |
| 238 | + issues: |
| 239 | + types: [opened] |
| 240 | + jobs: |
| 241 | + label: |
| 242 | + runs-on: ubuntu-latest |
| 243 | + steps: |
| 244 | + - uses: actions/github-script@v6 |
| 245 | + with: |
| 246 | + script: | |
| 247 | + const issueBody = context.payload.issue.body; |
| 248 | + const labels = []; |
| 249 | + if (issueBody.includes('crash') || issueBody.includes('error')) { |
| 250 | + labels.push('type:bug'); |
| 251 | + } |
| 252 | + if (issueBody.includes('feature request')) { |
| 253 | + labels.push('type:feature'); |
| 254 | + } |
| 255 | + if (labels.length > 0) { |
| 256 | + await github.rest.issues.addLabels({ |
| 257 | + issue_number: context.issue.number, |
| 258 | + owner: context.repo.owner, |
| 259 | + repo: context.repo.repo, |
| 260 | + labels: labels |
| 261 | + }); |
| 262 | + } |
| 263 | + ``` |
| 264 | + |
| 265 | +4. Create another file named `stale.yml` with the following content: |
| 266 | + |
| 267 | + ```yaml |
| 268 | + name: Stale Issues |
| 269 | + on: |
| 270 | + schedule: |
| 271 | + - cron: "0 0 * * *" |
| 272 | + jobs: |
| 273 | + stale: |
| 274 | + uses: actions/stale@v8 |
| 275 | + with: |
| 276 | + days-before-stale: 60 |
| 277 | + days-before-close: 14 |
| 278 | + stale-issue-label: 'stale' |
| 279 | + stale-issue-message: 'This issue is stale because it has been open for 60 days with no activity. Remove stale label or comment or this will be closed in 14 days.' |
| 280 | + ``` |
| 281 | + |
| 282 | +5. **Update `CONTRIBUTING.md`** to include a section on the new labeling strategy. |
0 commit comments