-
Notifications
You must be signed in to change notification settings - Fork 0
Home
山间野人 edited this page Feb 26, 2026
·
2 revisions
AI-friendly Node.js project architecture standards for OpenClaw/Codex agents.
A skill that teaches AI agents how to structure Node.js projects so that:
- Files stay small enough to read without blowing the context window
- Config is externalized for hot-reload via admin dashboards
- Code is modular and easy to navigate
When AI agents work with large single-file codebases:
- A 3000-line
server.jsconsumes ~40K tokens per read (20% of 200K context) - 3-5 rounds of conversation triggers context compression
- Agent loses track of previous discussion
Split files by function, each under 400 lines:
- A 200-line module consumes ~2.7K tokens (1.3% of context)
- 10-15 productive rounds before compression
- 70-93% token savings per file read
| Type | Examples |
|---|---|
| H5 Games | Canvas games, Phaser, Matter.js physics |
| Data Tools | Web scrapers, data analyzers, sync tools |
| Content Platforms | CMS, generators, publishers |
| Dashboards | Monitoring, analytics, admin panels |
| API Services | REST APIs, microservices |
| SDK Libraries | Shared modules consumed by multiple projects |