abczsl520

Node.js Project Architecture

開発v1.1.0
作者:abczsl520更新日 2026-05-18全 2 バージョン · 最新版の公開日 2026-03-06nodejs-project-arch@clawhub_abczsl520/nodejs-project-arch
コード生成スクリプトツール#Sdk

AlphaMoatによると、2026-09時点でNode.js Project Architectureのダウンロード数は1,729、スター数は0で、AIスキル全体5,078件中4,627位、開発では577件中546位です。

インストール数
304
ダウンロード数
1729
スター数
-
総合順位
#4,627
全体の上位 92% · 開発の上位 95%
プラットフォームインストール数ダウンロード数スター数コメント
ClawHub ↗401729--
SkillHub ↗3041692-—

プラットフォームごとに集計方法と集計時点が異なります。

このスキルでできること

ルート、共通処理、DB、画面資産を分け、実行時設定と管理編集の例を示します。ゲーム、ツール、ライブラリーを扱います。共有設定に秘密を入れず、公開項目を限定し、管理変更を認証・検証してから本番へ適応します。

資料公開日 2026-10-27

できること

  • Node.js プロジェクトを整理する

使う場面

  • モジュールと設定を分けたいとき

プロンプト例

スキルのドキュメントをもとに生成した例であり、実際の実行結果ではありません。

構成と公開設定・秘密の分離案を確認用に示して。

月次の推移

ダウンロード数1729
559118818162026-03 · ダウンロード数 6462026-05 · ダウンロード数 8862026-06 · ダウンロード数 10572026-07 · ダウンロード数 12942026-08 · ダウンロード数 15422026-09 · ダウンロード数 172926-0326-09
スター数-
0112026-03 · スター数 -2026-05 · スター数 -2026-06 · スター数 -2026-07 · スター数 -2026-08 · スター数 -2026-09 · スター数 -26-0326-09

2026-09 から集計方法を変更し、同名スキルを作者ごとに分けて集計し、全スキルを対象にしました。破線は変更前の月で、変更後のデータとは直接比較せず、変更をまたぐ増減も計算していません。

月ダウンロード数前月比スター数
2026-091729—-
2026-081542+19.2%-
2026-071294+22.4%-
2026-061057+19.3%-
2026-05886—-
2026-03646—-

SKILL.md 原文

作者が公開した元のファイルをテキストのまま表示しています。AlphaMoat による編集や審査はしていません。リンクはクリックできません。コマンドは内容を確認してから実行してください。取得日 2026-10-23。

3.4 KB・ClawHub v1.1.0
---
name: nodejs-project-arch
description: 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.
---

# Node.js Project Architecture for AI-Friendly Development

Architecture standards that keep files small enough for AI agents to read/edit without blowing the context window.

## Core Rules
すべて表示(全 76 行)

- Single file max **400 lines**, `index.html` max **200 lines**, `server.js` entry max **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
- Frontend: HTML skeleton only, JS/CSS in separate files
- Every project gets `admin.html` + `routes/admin.js` for config hot-reload

## Project Type Selection

Determine project type, then read the corresponding reference:

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

## Quick Start (All Types)

1. Identify project type from table above
2. Read the corresponding reference file
3. Create directory structure per the reference
4. Extract hardcoded values → `config.json`
5. Split large files by function (each <400 lines)
6. Add `routes/admin.js` + `admin.html`
7. Frontend: `config.js` fetches `/api/config` at startup, code reads `GAME_CONFIG.xxx` or `APP_CONFIG.xxx`
8. Test locally → backup → deploy

## config.json Pattern (Universal)

```javascript
// Server: 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; // strip secrets
  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 });
});
```

## Admin Dashboard Pattern (Universal)

`admin.html` auto-generates form from config structure:
- Password login (`x-admin-password` header)
- Visual config editor with save + hot-reload
- Stats overview (users/data/uptime)
- Config backup history + restore

## Why This Matters

Large single files consume massive context tokens when AI reads them:
- 3000-line file → ~40K tokens per read (20% of 200K window)
- 200-line module → ~2.7K tokens per read (1.3% of window)
- **Result: 10-15 productive rounds vs 3-5 before context compression**

開発の人気スキル

データ月:2026-09 · ダウンロード数、スター数、インストール数は公開スキルレジストリ(ClawHub、SkillHub)から月単位で集計しています。詳しくはデータの方法論をご覧ください。