stock-data-skill
OpenClaw Skill for stock data analysis
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.
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
SkillHub CLI
skillhub install abczsl520/nodejs-project-arch打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。
将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。
Architecture standards that keep files small enough for AI agents to read/edit without blowing the context window.
index.html max 200 lines, server.js entry max 100 lines
config.json, loaded at runtime, editable via admin dashboardroutes/ by domain, services/ for shared logic, db.js for databaseadmin.html + routes/admin.js for config hot-reloadDetermine project type, then read the corresponding reference:
| 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 |
config.json
routes/admin.js + admin.html
config.js fetches /api/config at startup, code reads GAME_CONFIG.xxx or APP_CONFIG.xxx
// Server: load and serve config
const config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
app.get(...
这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。
AI-friendly Node.js project architecture standards
Keep every file under 400 lines. Save 70-93% tokens. Get 3x more productive AI rounds.
Install · Game Arch · Tool Arch · SDK Arch · Wiki
AI agents working with large codebases hit the context window wall fast:
3000-line server.js → ~40K tokens per read → 20% of context gone
After 3-5 rounds → context compression → agent forgets everything
Split by function. Each file stays small. AI reads only what it needs:
200-line module → ~2.7K tokens per read → 1.3% of context
After 10-15 rounds → still going strong → no compression needed
| Scenario | Before | After | Savings |
|---|---|---|---|
| Read one game feature | 40K tokens | 2.7K tokens | 93% |
| Full dev round (read→edit→verify) | 52K tokens | 4K tokens | 92% |
| 4-round SDK session | 196K tokens | 69K tokens | 65% |
| Large data tool module | 84K tokens | 8K tokens | 90% |
✅ Single file ≤ 400 lines
✅ index.html ≤ 200 lines
✅ server.js (entry) ≤ 100 lines
✅ Tunable values → config.json (hot-reloadable)
✅ Backend → routes/ by domain + services/ for shared logic
✅ Frontend → HTML skeleton + separate JS/CSS files
✅ Every project → admin.html + rout...
# 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
- 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(...<div align="center"> # 🏗️ nodejs-project-arch **AI-friendly Node.js project architecture standards** *Keep every file under 400 lines. Save 70-93% tokens. Get 3x more productive AI rounds.* [](https://clawhub.com/skills/nodejs-project-arch) [](https://github.com/abczsl520/nodejs-project-arch/stargazers) [](LICENSE) [Install](#-installation) · [Game Arch](#-h5-game) · [Tool Arch](#-data-tool--api--dashboard) · [SDK Arch](#-sdklibrary) · [Wiki](https://github.com/abczsl520/nodejs-project-arch/wiki) </div> --- ## 🤯 The Problem AI agents working with large codebases hit the context window wall fast: ``` 3000-line server.js → ~40K tokens per read → 20% of context gone After 3-5 rounds → context compression → agent forgets everything ``` ## ✅ The Solution Split by function. Each file stays small. AI reads only what it needs: ``` 200-line module → ~2.7K tokens per read → 1.3% of context After 10-15 rounds → still going strong → no compression needed ``` ### Real-World Token Savings | Scenario | Before | After | Savings | |----------|--------|-------|---------| | Read one game feature | 40K tokens | 2.7K tokens | **93%** | | Full dev round (read→edit→verify) | 52K tokens | 4K tokens | **92%** | | 4-round SDK session | 196K tokens | 69K tokens | **65%** | | Large data tool module | 84K tokens | 8K tokens | **90%** | ## 📐 Core Rules ``` ✅ Single file ≤ 400 lines ✅ index.html ≤ 200 lines ✅ server.js (entry) ≤ 100 lines ✅ Tunable values → config.json (hot-reloadable) ✅ Backend → routes/ by domain + services/ for shared logic ✅ Frontend → HTML skeleton + separate JS/CSS files ✅ Every project → admin.html + rout...
OpenClaw Skill for stock data analysis
Search and hire real humans for tasks — photography, delivery, research, and more
Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...
Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.