advanced-ads
Last commit date
admin
1 day ago
assets
1 day ago
classes
1 day ago
deprecated
1 week ago
docs
1 day ago
graphify-out
1 day ago
includes
1 day ago
languages
1 day ago
modules
1 day ago
packages
1 day ago
public
1 day ago
src
1 day ago
upgrades
1 day ago
views
1 day ago
CLAUDE.md
1 month ago
LICENSE.txt
12 years ago
advanced-ads.php
1 day ago
dev.config.example.json
1 day ago
index.php
2 years ago
playwright.config.ts
1 day ago
postcss.config.js
8 months ago
readme.txt
1 day ago
webpack.config.js
1 day ago
wpml-config.xml
3 months ago
CLAUDE.md
82 lines
| 1 | # CLAUDE.md |
| 2 | |
| 3 | Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed. |
| 4 | |
| 5 | **Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment. |
| 6 | |
| 7 | ## 1. Think Before Coding |
| 8 | |
| 9 | **Don't assume. Don't hide confusion. Surface tradeoffs.** |
| 10 | |
| 11 | Before implementing: |
| 12 | |
| 13 | - State your assumptions explicitly. If uncertain, ask. |
| 14 | - If multiple interpretations exist, present them - don't pick silently. |
| 15 | - If a simpler approach exists, say so. Push back when warranted. |
| 16 | - If something is unclear, stop. Name what's confusing. Ask. |
| 17 | |
| 18 | ## 2. Simplicity First |
| 19 | |
| 20 | **Minimum code that solves the problem. Nothing speculative.** |
| 21 | |
| 22 | - No features beyond what was asked. |
| 23 | - No abstractions for single-use code. |
| 24 | - No "flexibility" or "configurability" that wasn't requested. |
| 25 | - No error handling for impossible scenarios. |
| 26 | - If you write 200 lines and it could be 50, rewrite it. |
| 27 | |
| 28 | Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify. |
| 29 | |
| 30 | ## 3. Surgical Changes |
| 31 | |
| 32 | **Touch only what you must. Clean up only your own mess.** |
| 33 | |
| 34 | When editing existing code: |
| 35 | |
| 36 | - Don't "improve" adjacent code, comments, or formatting. |
| 37 | - Don't refactor things that aren't broken. |
| 38 | - Match existing style, even if you'd do it differently. |
| 39 | - If you notice unrelated dead code, mention it - don't delete it. |
| 40 | |
| 41 | When your changes create orphans: |
| 42 | |
| 43 | - Remove imports/variables/functions that YOUR changes made unused. |
| 44 | - Don't remove pre-existing dead code unless asked. |
| 45 | |
| 46 | The test: Every changed line should trace directly to the user's request. |
| 47 | |
| 48 | ## 4. Goal-Driven Execution |
| 49 | |
| 50 | **Define success criteria. Loop until verified.** |
| 51 | |
| 52 | Transform tasks into verifiable goals: |
| 53 | |
| 54 | - "Add validation" → "Write tests for invalid inputs, then make them pass" |
| 55 | - "Fix the bug" → "Write a test that reproduces it, then make it pass" |
| 56 | - "Refactor X" → "Ensure tests pass before and after" |
| 57 | |
| 58 | For multi-step tasks, state a brief plan: |
| 59 | |
| 60 | ``` |
| 61 | 1. [Step] → verify: [check] |
| 62 | 2. [Step] → verify: [check] |
| 63 | 3. [Step] → verify: [check] |
| 64 | ``` |
| 65 | |
| 66 | Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification. |
| 67 | |
| 68 | --- |
| 69 | |
| 70 | **These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes. |
| 71 | |
| 72 | ## 5. Graphify |
| 73 | |
| 74 | This project has a graphify knowledge graph at graphify-out/. |
| 75 | |
| 76 | Rules: |
| 77 | |
| 78 | - Before answering architecture or codebase questions, read graphify-out/GRAPH_REPORT.md for god nodes and community structure |
| 79 | - If graphify-out/wiki/index.md exists, navigate it instead of reading raw files |
| 80 | - For cross-module "how does X relate to Y" questions, prefer `graphify query "<question>"`, `graphify path "<A>" "<B>"`, or `graphify explain "<concept>"` over grep — these traverse the graph's EXTRACTED + INFERRED edges instead of scanning files |
| 81 | - After modifying code files in this session, run `graphify update .` to keep the graph current (AST-only, no API cost) |
| 82 |