Nodejs Project Arch banner
abczsl520 abczsl520

Nodejs Project Arch

Data community

Description

🏗️ AI-friendly Node.js project architecture standards. Keep files <400 lines for AI agents. Covers H5 games, data tools, APIs, SDKs. 70-93% token savings. OpenClaw skill.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

nodejs-project-arch

**Node.js project architecture standards for AI-assisted development.**

An [OpenClaw](https://openclaw.ai) / AI agent skill that enforces modular file structures, keeping every file small enough for AI to read and edit without blowing the context window.

✨ Why?

When AI agents work with large single-file codebases, things go wrong fast:

Scenario Tokens per read Context usage (200K)
3000-line server.js ~40K 20%
200-line module ~2.7K 1.3%

**Result:** Splitting files means **10-15 productive rounds** before context compression, vs 3-5 with monolithic files. That's **70-93% token savings** per file read.

📐 Core Rules

  • Single file ≤ 400 lines / index.html ≤ 200 lines / server.js entry ≤ 100 lines
  • All tunable values in config.json — loaded at runtime, editable via admin dashboard
  • Backend: routes/ by domain, services/ for shared logic, db.js for database init
  • Frontend: HTML skeleton only, JS/CSS in separate files under public/
  • Every project gets admin.html + routes/admin.js for config hot-reload + stats

🎮 Supported Project Types

Type Signals Reference
H5 Game Canvas, Phaser, Matter.js, game loop, sprites references/game.md
Data Tool Crawler, scraper, scheduler, data sync, analytics references/tool.md
Content/Utility Generator, library, publisher, file processing references/tool.md
Dashboard/Monitor Charts, real-time, alerts, metrics references/tool.md
API Service REST endpoints, middleware, microservice references/tool.md
SDK/Library Shared module, build step, multi-consumer references/sdk.md

📁 Typical Structure

project-name/
  server.js          ← Entry point,