⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

nodejs-project-arch

@abczsl520⭐ 20 stars

Node.js project architecture standards for AI-assisted development. Enforces file splitting (<400 lines), config externalization, route modularization, and admin dashboards. Use when creating new Node.js projects, refactoring large single-file codebases, or when AI context window is being consumed by oversized files. Covers H5 games (Canvas/Phaser/Matter.js), data tools (crawlers/scrapers), content platforms, monitoring dashboards, API services, and SDK libraries.

—/10

// RATINGS

⭐GitHub Stars
⭐⭐ 20GitHub ↗

Growing

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

nodejs-project-arch

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

An OpenClaw / 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:

ScenarioTokens per readContext usage (200K)
3000-line server.js~40K20%
200-line module~2.7K1.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

TypeSignalsReference
H5 GameCanvas, Phaser, Matter.js, game loop, spritesreferences/game.md
Data ToolCrawler, scraper, scheduler, data sync, analyticsreferences/tool.md
Content/UtilityGenerator, library, publisher, file processingreferences/tool.md
Dashboard/MonitorCharts, real-time, alerts, metricsreferences/tool.md
API ServiceREST endpoints, middleware, microservicereferences/tool.md
SDK/LibraryShared module, build step, multi-consumerreferences/sdk.md

📁 Typical Structure

project-name/
  server.js          ← Entry point, only mounts routes (<100 lines)
  config.json        ← All tunable values (admin dashboard can edit)
  db.js              ← Database init + helpers
  routes/
    auth.js          ← Authentication routes
    game.js          ← Core game/business routes
    admin.js         ← Admin API (config CRUD, stats)
  services/          ← Shared business logic
  public/
    index.html       ← Pure HTML skeleton (<200 lines)
    admin.html       ← Admin dashboard
    css/style.css
    js/              ← Split by responsibility, each <400 lines
    assets/

🚀 Installation

For OpenClaw users

Copy the skill to your agents skill directory:

# Clone and copy
git clone https://github.com/abczsl520/nodejs-project-arch.git
cp -r nodejs-project-arch ~/.agents/skills/

# Or if you have clawhub:
# clawhub install nodejs-project-arch

The skill auto-activates when you ask your AI agent to:

  • Create a new Node.js project
  • Refactor a large single-file codebase
  • Split oversized files

For manual reference

Browse the reference docs directly:

📖 Documentation

Full documentation is available on the Wiki:

🔧 Quick Example: config.json Pattern

// server.js — load and serve config
const config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));

app.get('/api/config', (req, res) => {
  const safe = { ...config };
  delete safe.admin;
  res.json(safe);
});

// Admin hot-reload
app.post('/admin/config', requireAdmin, (req, res) => {
  fs.writeFileSync('./config.json.bak', fs.readFileSync('./config.json'));
  fs.writeFileSync('./config.json', JSON.stringify(req.body, null, 2));
  Object.assign(config, req.body);
  res.json({ ok: true });
});

📊 Real-World Token Savings

ScenarioBeforeAfterSavings
Read game feature code~40K tokens~2.7K tokens93%
One dev round (read→edit→verify)~52K tokens~4K tokens92%
4-round SDK session~196K tokens~69K tokens65%
Large data tool module~84K tokens~8K tokens90%

🧬 Part of the project-arch Family

This skill implements the Node.js-specific patterns from project-arch-core — the language-agnostic architecture principles for AI-assisted development.

SkillLanguageStatus
project-arch-coreUniversal principles✅ Foundation
nodejs-project-arch (this)Node.js / Express✅ Available
react-project-archReact / Vite✅ Available
python-project-archPython🔲 Community welcome
go-project-archGo🔲 Community welcome

License

MIT

// HOW IT'S BUILT

KEY FILES

SKILL.mdREADME.md

// REPO STATS

20 stars

// ACTIONS

Rate this skill

login to rate

// SCORE

Pending review

// DETAILS

Categoryother
Versionversion unknown
PriceFree