express-skill 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +85 -0
- package/package.json +33 -0
- package/skills/express-skill/SKILL.md +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ac-aman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# express-skill
|
|
2
|
+
|
|
3
|
+
> An open, production-ready AI Agent Skill for Express.js development. Compatible with `npx skills`, Antigravity, Claude Desktop, Cursor, and custom agentic AI systems.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
`express-skill` equips AI agents with standard patterns, clean 4-layer architecture workflows, production security defaults, and modular reference blueprints for Express.js applications.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **Layered Architecture**: Enforces clear separation between Routes, Controllers, Services, and Repositories.
|
|
16
|
+
- **Strict Request Validation**: Integrated `zod` schemas for incoming payloads.
|
|
17
|
+
- **Production Middleware**: Reusable error handler, JWT auth middleware, async wrapper, and logger setup.
|
|
18
|
+
- **Security Defaults**: OWASP-aligned standards with `helmet`, `cors`, and `express-rate-limit`.
|
|
19
|
+
- **TypeScript & JavaScript Blueprints**: Pre-scaffolded starter code templates.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Skill Directory Structure
|
|
24
|
+
|
|
25
|
+
```text
|
|
26
|
+
express-skill/
|
|
27
|
+
├── package.json # NPM package manifest
|
|
28
|
+
├── README.md # Skill documentation & publishing guide
|
|
29
|
+
├── LICENSE # MIT License
|
|
30
|
+
├── .gitignore # Git & NPM ignore rules
|
|
31
|
+
└── skills/
|
|
32
|
+
└── express-skill/
|
|
33
|
+
├── SKILL.md # Core agent instructions & metadata (YAML frontmatter)
|
|
34
|
+
├── references/ # Detailed modular guides loaded on demand
|
|
35
|
+
│ ├── architecture.md
|
|
36
|
+
│ ├── middleware.md
|
|
37
|
+
│ └── security.md
|
|
38
|
+
└── templates/ # Boilerplate starters
|
|
39
|
+
├── express-ts-starter.md
|
|
40
|
+
└── express-js-starter.md
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## Installation & Usage
|
|
46
|
+
|
|
47
|
+
### Option 1: Via `npx skills` (GitHub Repository)
|
|
48
|
+
Push this repository to GitHub and install it into any workspace:
|
|
49
|
+
```bash
|
|
50
|
+
npx skills add ac-aman/express-skill
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Option 2: Via NPM (`npm install`)
|
|
54
|
+
Publish to NPM registry so agents or tools can discover it:
|
|
55
|
+
```bash
|
|
56
|
+
npm install express-skill
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Publishing Guide
|
|
62
|
+
|
|
63
|
+
### Step 1: Login to NPM
|
|
64
|
+
Ensure you have an account on [npmjs.com](https://www.npmjs.com/) and log in via CLI:
|
|
65
|
+
```bash
|
|
66
|
+
npm login
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 2: Validate Package Files
|
|
70
|
+
Test which files will be included in your npm tarball:
|
|
71
|
+
```bash
|
|
72
|
+
npm pack --dry-run
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 3: Publish to NPM
|
|
76
|
+
Publish the skill publicly:
|
|
77
|
+
```bash
|
|
78
|
+
npm publish --access public
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
[MIT](./LICENSE)
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "express-skill",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "An open AI Agent Skill for building robust, secure, and production-ready Express.js applications.",
|
|
5
|
+
"main": "skills/express-skill/SKILL.md",
|
|
6
|
+
"files": [
|
|
7
|
+
"skills",
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE"
|
|
10
|
+
],
|
|
11
|
+
"keywords": [
|
|
12
|
+
"express",
|
|
13
|
+
"expressjs",
|
|
14
|
+
"agent-skill",
|
|
15
|
+
"skills",
|
|
16
|
+
"npx-skills",
|
|
17
|
+
"antigravity",
|
|
18
|
+
"ai-agent",
|
|
19
|
+
"claude",
|
|
20
|
+
"cursor",
|
|
21
|
+
"copilot"
|
|
22
|
+
],
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/ac-aman/express-skill.git"
|
|
26
|
+
},
|
|
27
|
+
"author": "ac-aman",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/ac-aman/express-skill/issues"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/ac-aman/express-skill#readme"
|
|
33
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: express-skill
|
|
3
|
+
description: Comprehensive workflow, standards, and architecture guide for building production-ready Express.js web applications and REST APIs.
|
|
4
|
+
license: MIT
|
|
5
|
+
metadata:
|
|
6
|
+
author: "ac-aman"
|
|
7
|
+
version: "1.0.0"
|
|
8
|
+
tags: ["express", "node", "typescript", "rest-api", "backend","MVC", "Features"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Express.js Skill Guide
|
|
12
|
+
|
|
13
|
+
This skill provides AI agents with standard patterns, architecture rules, security standards, and workflow procedures for designing, building, debugging, and maintaining Express.js backend services.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Core Architectural Principles
|
|
18
|
+
|
|
19
|
+
When building or refactoring Express.js applications, always enforce the following architectural rules:
|
|
20
|
+
|
|
21
|
+
1. **Layered Architecture (Separation of Concerns)**
|
|
22
|
+
- **Routes**: Define HTTP endpoints, map request methods, attach middleware, and pass control to controllers.
|
|
23
|
+
- **Controllers**: Parse input, call service methods, handle response status codes and format JSON output. Keep controllers thin; do not embed business logic or raw database queries here.
|
|
24
|
+
- **Services**: Encapsulate core business logic, domain rules, third-party integrations, and transactions.
|
|
25
|
+
- **Repositories / Models**: Manage database access, schema definitions, and ORM/Query Builder calls.
|
|
26
|
+
|
|
27
|
+
2. **Strict Request Validation**
|
|
28
|
+
- Use `zod` schema validation on incoming request bodies, query params, and URL path parameters before touching service layers.
|
|
29
|
+
|
|
30
|
+
3. **Centralized Error Handling**
|
|
31
|
+
- Never handle errors with ad-hoc `try/catch` blocks inside controllers without passing exceptions to Express's global error handler.
|
|
32
|
+
- Express 4: Wrap async route handlers with an `asyncHandler` wrapper or return promises cleanly.
|
|
33
|
+
- Express 5: Async errors automatically pass to `next(err)`.
|
|
34
|
+
|
|
35
|
+
4. **Security Defaults**
|
|
36
|
+
- Apply `helmet` middleware early in the app lifecycle.
|
|
37
|
+
- Enable CORS with explicit origin constraints (`cors()`).
|
|
38
|
+
- Standardize request rate limiting using `express-rate-limit`.
|
|
39
|
+
- Never expose raw database errors, stack traces, or internal server details in production responses.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Directory Structure Standard
|
|
44
|
+
|
|
45
|
+
Follow this canonical directory structure for Express projects:
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
src/
|
|
49
|
+
├── config/ # Environment variables (dotenv/zod) & server settings
|
|
50
|
+
├── controllers/ # Request handlers (thin controller layer)
|
|
51
|
+
├── middleware/ # Custom & third-party middleware (auth, error, logger, validation)
|
|
52
|
+
├── models/ # Database schemas / ORM models (Prisma, Mongoose, Kysely, TypeORM)
|
|
53
|
+
├── routes/ # Express router definitions & mounting
|
|
54
|
+
├── services/ # Business logic & domain services
|
|
55
|
+
├── utils/ # Helper functions, logger instance, custom error classes
|
|
56
|
+
├── app.ts # Express application configuration & middleware setup
|
|
57
|
+
└── server.ts # HTTP server initialization & graceful shutdown setup
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Recommended Packages
|
|
63
|
+
|
|
64
|
+
| Concern | Package | Usage |
|
|
65
|
+
| :--- | :--- | :--- |
|
|
66
|
+
| **Framework** | `express` | Main Web Framework |
|
|
67
|
+
| **Validation** | `zod` | Input Schema Validation |
|
|
68
|
+
| **Security** | `helmet`, `cors`, `express-rate-limit` | HTTP Security & Rate Limiting |
|
|
69
|
+
| **Logging** | `pino` or `winston`, `morgan` | Structured Logging |
|
|
70
|
+
| **Auth** | `jsonwebtoken`, `argon2` or `bcrypt` | Auth & Password Hashing |
|
|
71
|
+
| **Testing** | `supertest`, `vitest` / `jest` | API Integration Testing |
|
|
72
|
+
| **Dev Tools** | `tsx` or `nodemon`, `typescript` | Dev Server Execution |
|