agcel 1.0.1

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.
Files changed (100) hide show
  1. package/.agent/workflows/api-gen.md +59 -0
  2. package/.agent/workflows/architect.md +44 -0
  3. package/.agent/workflows/brainstorm.md +223 -0
  4. package/.agent/workflows/build.md +38 -0
  5. package/.agent/workflows/changelog.md +51 -0
  6. package/.agent/workflows/checkpoint.md +138 -0
  7. package/.agent/workflows/commit.md +223 -0
  8. package/.agent/workflows/debug.md +57 -0
  9. package/.agent/workflows/deploy.md +76 -0
  10. package/.agent/workflows/doc.md +247 -0
  11. package/.agent/workflows/execute-plan.md +225 -0
  12. package/.agent/workflows/feature.md +255 -0
  13. package/.agent/workflows/fix.md +323 -0
  14. package/.agent/workflows/help.md +63 -0
  15. package/.agent/workflows/index.md +148 -0
  16. package/.agent/workflows/load.md +112 -0
  17. package/.agent/workflows/mode.md +170 -0
  18. package/.agent/workflows/optimize.md +53 -0
  19. package/.agent/workflows/plan.md +337 -0
  20. package/.agent/workflows/pr.md +74 -0
  21. package/.agent/workflows/product-plan.md +36 -0
  22. package/.agent/workflows/production-deploy.md +39 -0
  23. package/.agent/workflows/refactor.md +63 -0
  24. package/.agent/workflows/research.md +116 -0
  25. package/.agent/workflows/review.md +344 -0
  26. package/.agent/workflows/security-scan.md +56 -0
  27. package/.agent/workflows/ship.md +221 -0
  28. package/.agent/workflows/spawn.md +177 -0
  29. package/.agent/workflows/status.md +59 -0
  30. package/.agent/workflows/tdd.md +139 -0
  31. package/.agent/workflows/test.md +340 -0
  32. package/.agent/workflows/verify.md +35 -0
  33. package/LICENSE +21 -0
  34. package/README.md +67 -0
  35. package/dist/commands/init.js +142 -0
  36. package/dist/commands/install.js +98 -0
  37. package/dist/commands/list.js +49 -0
  38. package/dist/commands/restart.js +17 -0
  39. package/dist/commands/start.js +41 -0
  40. package/dist/commands/status.js +24 -0
  41. package/dist/commands/stop.js +29 -0
  42. package/dist/commands/uninstall.js +78 -0
  43. package/dist/index.js +58 -0
  44. package/dist/server/index.js +174 -0
  45. package/dist/utils/index.js +63 -0
  46. package/package.json +54 -0
  47. package/skills/api-security-best-practices/SKILL.md +291 -0
  48. package/skills/api-security-best-practices/references/examples.md +617 -0
  49. package/skills/architecture/SKILL.md +59 -0
  50. package/skills/architecture/context-discovery.md +43 -0
  51. package/skills/architecture/examples.md +94 -0
  52. package/skills/architecture/pattern-selection.md +68 -0
  53. package/skills/architecture/patterns-reference.md +50 -0
  54. package/skills/architecture/trade-off-analysis.md +77 -0
  55. package/skills/aws-serverless/SKILL.md +327 -0
  56. package/skills/brainstorming/SKILL.md +234 -0
  57. package/skills/c4-context/SKILL.md +154 -0
  58. package/skills/ci-cd-engineer/SKILL.md +50 -0
  59. package/skills/code-auditing/SKILL.md +55 -0
  60. package/skills/copywriting/SKILL.md +248 -0
  61. package/skills/database-engineer/SKILL.md +47 -0
  62. package/skills/doc-coauthoring/SKILL.md +379 -0
  63. package/skills/docker-expert/SKILL.md +412 -0
  64. package/skills/langgraph/SKILL.md +291 -0
  65. package/skills/postgresql/SKILL.md +73 -0
  66. package/skills/pricing-strategy/SKILL.md +360 -0
  67. package/skills/product-manager/SKILL.md +57 -0
  68. package/skills/prompt-engineer/README.md +659 -0
  69. package/skills/prompt-engineer/SKILL.md +256 -0
  70. package/skills/python-patterns/SKILL.md +445 -0
  71. package/skills/qa-engineer/SKILL.md +42 -0
  72. package/skills/rag-engineer/SKILL.md +94 -0
  73. package/skills/react-patterns/SKILL.md +202 -0
  74. package/skills/secure-refactoring/SKILL.md +54 -0
  75. package/skills/security-documentation/SKILL.md +53 -0
  76. package/skills/senior-architect/SKILL.md +213 -0
  77. package/skills/senior-architect/references/architecture_patterns.md +103 -0
  78. package/skills/senior-architect/references/system_design_workflows.md +103 -0
  79. package/skills/senior-architect/references/tech_decision_guide.md +103 -0
  80. package/skills/senior-architect/scripts/architecture_diagram_generator.py +114 -0
  81. package/skills/senior-architect/scripts/dependency_analyzer.py +114 -0
  82. package/skills/senior-architect/scripts/project_architect.py +114 -0
  83. package/skills/seo-audit/SKILL.md +491 -0
  84. package/skills/sql-injection-testing/SKILL.md +452 -0
  85. package/skills/test-driven-development/SKILL.md +375 -0
  86. package/skills/test-driven-development/testing-anti-patterns.md +299 -0
  87. package/skills/test-fixing/SKILL.md +123 -0
  88. package/skills/testing-patterns/SKILL.md +263 -0
  89. package/skills/typescript-expert/SKILL.md +202 -0
  90. package/skills/typescript-expert/references/advanced-topics.md +252 -0
  91. package/skills/typescript-expert/references/tsconfig-strict.json +92 -0
  92. package/skills/typescript-expert/references/typescript-cheatsheet.md +383 -0
  93. package/skills/typescript-expert/references/utility-types.ts +335 -0
  94. package/skills/typescript-expert/scripts/ts_diagnostic.py +203 -0
  95. package/skills/ui-ux-designer/SKILL.md +46 -0
  96. package/skills/vercel-deployment/SKILL.md +83 -0
  97. package/skills/vulnerability-scanner/SKILL.md +280 -0
  98. package/skills/vulnerability-scanner/checklists.md +121 -0
  99. package/skills/vulnerability-scanner/scripts/security_scan.py +458 -0
  100. package/skills/writing-plans/SKILL.md +120 -0
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "agcel",
3
+ "version": "1.0.1",
4
+ "description": "Antigravity Context Engineering Library is a local MCP (Model Context Protocol) Server containing multiple skills, rules and workflows for end to end software development",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "agc": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist",
11
+ "skills",
12
+ ".agent",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsc",
18
+ "start": "node dist/server/index.js",
19
+ "test": "echo \"Error: no test specified\" && exit 1"
20
+ },
21
+ "keywords": [
22
+ "mcp",
23
+ "cli",
24
+ "agent",
25
+ "skills"
26
+ ],
27
+ "author": "Bennie Ng <bennie.ng@agcel.io>",
28
+ "license": "MIT",
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "https://github.com/bennie-ng/AgCel.git"
32
+ },
33
+ "homepage": "https://bennie-ng.github.io/AgCel",
34
+ "bugs": {
35
+ "url": "https://github.com/bennie-ng/AgCel/issues"
36
+ },
37
+ "dependencies": {
38
+ "@modelcontextprotocol/sdk": "^0.6.0",
39
+ "chalk": "^4.1.2",
40
+ "commander": "^11.1.0",
41
+ "cors": "^2.8.5",
42
+ "express": "^4.18.2",
43
+ "inquirer": "^8.2.6",
44
+ "zod": "^3.22.4"
45
+ },
46
+ "devDependencies": {
47
+ "@types/chalk": "^2.2.0",
48
+ "@types/cors": "^2.8.17",
49
+ "@types/express": "^4.17.21",
50
+ "@types/inquirer": "^9.0.7",
51
+ "@types/node": "^20.11.19",
52
+ "typescript": "^5.3.3"
53
+ }
54
+ }
@@ -0,0 +1,291 @@
1
+ ---
2
+ name: api-security-best-practices
3
+ description: "Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and protection against common API vulnerabilities"
4
+ ---
5
+
6
+ # API Security Best Practices
7
+
8
+ ## Overview
9
+
10
+ Guide developers in building secure APIs by implementing authentication, authorization, input validation, rate limiting, and protection against common vulnerabilities. This skill covers security patterns for REST, GraphQL, and WebSocket APIs.
11
+
12
+ ## When to Use This Skill
13
+
14
+ - Use when designing new API endpoints
15
+ - Use when securing existing APIs
16
+ - Use when implementing authentication and authorization
17
+ - Use when protecting against API attacks (injection, DDoS, etc.)
18
+ - Use when conducting API security reviews
19
+ - Use when preparing for security audits
20
+ - Use when implementing rate limiting and throttling
21
+ - Use when handling sensitive data in APIs
22
+
23
+ ## How It Works
24
+
25
+ ### Step 1: Authentication & Authorization
26
+
27
+ I'll help you implement secure authentication:
28
+ - Choose authentication method (JWT, OAuth 2.0, API keys)
29
+ - Implement token-based authentication
30
+ - Set up role-based access control (RBAC)
31
+ - Secure session management
32
+ - Implement multi-factor authentication (MFA)
33
+
34
+ ### Step 2: Input Validation & Sanitization
35
+
36
+ Protect against injection attacks:
37
+ - Validate all input data
38
+ - Sanitize user inputs
39
+ - Use parameterized queries
40
+ - Implement request schema validation
41
+ - Prevent SQL injection, XSS, and command injection
42
+
43
+ ### Step 3: Rate Limiting & Throttling
44
+
45
+ Prevent abuse and DDoS attacks:
46
+ - Implement rate limiting per user/IP
47
+ - Set up API throttling
48
+ - Configure request quotas
49
+ - Handle rate limit errors gracefully
50
+ - Monitor for suspicious activity
51
+
52
+ ### Step 4: Data Protection
53
+
54
+ Secure sensitive data:
55
+ - Encrypt data in transit (HTTPS/TLS)
56
+ - Encrypt sensitive data at rest
57
+ - Implement proper error handling (no data leaks)
58
+ - Sanitize error messages
59
+ - Use secure headers
60
+
61
+ ### Step 5: API Security Testing
62
+
63
+ Verify security implementation:
64
+ - Test authentication and authorization
65
+ - Perform penetration testing
66
+ - Check for common vulnerabilities (OWASP API Top 10)
67
+ - Validate input handling
68
+ - Test rate limiting
69
+
70
+
71
+
72
+ ## Examples
73
+
74
+ detailed code examples for **JWT Authentication**, **SQL Injection Prevention**, and **Rate Limiting** are available in the references:
75
+
76
+ [View Code Examples](references/examples.md)
77
+
78
+ ## Best Practices
79
+
80
+ ### ✅ Do This
81
+
82
+ - **Use HTTPS Everywhere** - Never send sensitive data over HTTP
83
+ - **Implement Authentication** - Require authentication for protected endpoints
84
+ - **Validate All Inputs** - Never trust user input
85
+ - **Use Parameterized Queries** - Prevent SQL injection
86
+ - **Implement Rate Limiting** - Protect against brute force and DDoS
87
+ - **Hash Passwords** - Use bcrypt with salt rounds >= 10
88
+ - **Use Short-Lived Tokens** - JWT access tokens should expire quickly
89
+ - **Implement CORS Properly** - Only allow trusted origins
90
+ - **Log Security Events** - Monitor for suspicious activity
91
+ - **Keep Dependencies Updated** - Regularly update packages
92
+ - **Use Security Headers** - Implement Helmet.js
93
+ - **Sanitize Error Messages** - Don't leak sensitive information
94
+
95
+ ### ❌ Don't Do This
96
+
97
+ - **Don't Store Passwords in Plain Text** - Always hash passwords
98
+ - **Don't Use Weak Secrets** - Use strong, random JWT secrets
99
+ - **Don't Trust User Input** - Always validate and sanitize
100
+ - **Don't Expose Stack Traces** - Hide error details in production
101
+ - **Don't Use String Concatenation for SQL** - Use parameterized queries
102
+ - **Don't Store Sensitive Data in JWT** - JWTs are not encrypted
103
+ - **Don't Ignore Security Updates** - Update dependencies regularly
104
+ - **Don't Use Default Credentials** - Change all default passwords
105
+ - **Don't Disable CORS Completely** - Configure it properly instead
106
+ - **Don't Log Sensitive Data** - Sanitize logs
107
+
108
+ ## Anti-Patterns
109
+
110
+ ### Problem: JWT Secret Exposed in Code
111
+ **Symptoms:** JWT secret hardcoded or committed to Git
112
+ **Solution:**
113
+ \`\`\`javascript
114
+ // ❌ Bad
115
+ const JWT_SECRET = 'my-secret-key';
116
+
117
+ // ✅ Good
118
+ const JWT_SECRET = process.env.JWT_SECRET;
119
+ if (!JWT_SECRET) {
120
+ throw new Error('JWT_SECRET environment variable is required');
121
+ }
122
+
123
+ // Generate strong secret
124
+ // node -e "console.log(require('crypto').randomBytes(64).toString('hex'))"
125
+ \`\`\`
126
+
127
+ ### Problem: Weak Password Requirements
128
+ **Symptoms:** Users can set weak passwords like "password123"
129
+ **Solution:**
130
+ \`\`\`javascript
131
+ const passwordSchema = z.string()
132
+ .min(12, 'Password must be at least 12 characters')
133
+ .regex(/[A-Z]/, 'Must contain uppercase letter')
134
+ .regex(/[a-z]/, 'Must contain lowercase letter')
135
+ .regex(/[0-9]/, 'Must contain number')
136
+ .regex(/[^A-Za-z0-9]/, 'Must contain special character');
137
+
138
+ // Or use a password strength library
139
+ const zxcvbn = require('zxcvbn');
140
+ const result = zxcvbn(password);
141
+ if (result.score < 3) {
142
+ return res.status(400).json({
143
+ error: 'Password too weak',
144
+ suggestions: result.feedback.suggestions
145
+ });
146
+ }
147
+ \`\`\`
148
+
149
+ ### Problem: Missing Authorization Checks
150
+ **Symptoms:** Users can access resources they shouldn't
151
+ **Solution:**
152
+ \`\`\`javascript
153
+ // ❌ Bad: Only checks authentication
154
+ app.delete('/api/posts/:id', authenticateToken, async (req, res) => {
155
+ await prisma.post.delete({ where: { id: req.params.id } });
156
+ res.json({ success: true });
157
+ });
158
+
159
+ // ✅ Good: Checks both authentication and authorization
160
+ app.delete('/api/posts/:id', authenticateToken, async (req, res) => {
161
+ const post = await prisma.post.findUnique({
162
+ where: { id: req.params.id }
163
+ });
164
+
165
+ if (!post) {
166
+ return res.status(404).json({ error: 'Post not found' });
167
+ }
168
+
169
+ // Check if user owns the post or is admin
170
+ if (post.userId !== req.user.userId && req.user.role !== 'admin') {
171
+ return res.status(403).json({
172
+ error: 'Not authorized to delete this post'
173
+ });
174
+ }
175
+
176
+ await prisma.post.delete({ where: { id: req.params.id } });
177
+ res.json({ success: true });
178
+ });
179
+ \`\`\`
180
+
181
+ ### Problem: Verbose Error Messages
182
+ **Symptoms:** Error messages reveal system details
183
+ **Solution:**
184
+ \`\`\`javascript
185
+ // ❌ Bad: Exposes database details
186
+ app.post('/api/users', async (req, res) => {
187
+ try {
188
+ const user = await prisma.user.create({ data: req.body });
189
+ res.json(user);
190
+ } catch (error) {
191
+ res.status(500).json({ error: error.message });
192
+ // Error: "Unique constraint failed on the fields: (`email`)"
193
+ }
194
+ });
195
+
196
+ // ✅ Good: Generic error message
197
+ app.post('/api/users', async (req, res) => {
198
+ try {
199
+ const user = await prisma.user.create({ data: req.body });
200
+ res.json(user);
201
+ } catch (error) {
202
+ console.error('User creation error:', error); // Log full error
203
+
204
+ if (error.code === 'P2002') {
205
+ return res.status(400).json({
206
+ error: 'Email already exists'
207
+ });
208
+ }
209
+
210
+ res.status(500).json({
211
+ error: 'An error occurred while creating user'
212
+ });
213
+ }
214
+ });
215
+ \`\`\`
216
+
217
+ ## Security Checklist
218
+
219
+ ### Authentication & Authorization
220
+ - [ ] Implement strong authentication (JWT, OAuth 2.0)
221
+ - [ ] Use HTTPS for all endpoints
222
+ - [ ] Hash passwords with bcrypt (salt rounds >= 10)
223
+ - [ ] Implement token expiration
224
+ - [ ] Add refresh token mechanism
225
+ - [ ] Verify user authorization for each request
226
+ - [ ] Implement role-based access control (RBAC)
227
+
228
+ ### Input Validation
229
+ - [ ] Validate all user inputs
230
+ - [ ] Use parameterized queries or ORM
231
+ - [ ] Sanitize HTML content
232
+ - [ ] Validate file uploads
233
+ - [ ] Implement request schema validation
234
+ - [ ] Use allowlists, not blocklists
235
+
236
+ ### Rate Limiting & DDoS Protection
237
+ - [ ] Implement rate limiting per user/IP
238
+ - [ ] Add stricter limits for auth endpoints
239
+ - [ ] Use Redis for distributed rate limiting
240
+ - [ ] Return proper rate limit headers
241
+ - [ ] Implement request throttling
242
+
243
+ ### Data Protection
244
+ - [ ] Use HTTPS/TLS for all traffic
245
+ - [ ] Encrypt sensitive data at rest
246
+ - [ ] Don't store sensitive data in JWT
247
+ - [ ] Sanitize error messages
248
+ - [ ] Implement proper CORS configuration
249
+ - [ ] Use security headers (Helmet.js)
250
+
251
+ ### Monitoring & Logging
252
+ - [ ] Log security events
253
+ - [ ] Monitor for suspicious activity
254
+ - [ ] Set up alerts for failed auth attempts
255
+ - [ ] Track API usage patterns
256
+ - [ ] Don't log sensitive data
257
+
258
+ ## OWASP API Security Top 10
259
+
260
+ 1. **Broken Object Level Authorization** - Always verify user can access resource
261
+ 2. **Broken Authentication** - Implement strong authentication mechanisms
262
+ 3. **Broken Object Property Level Authorization** - Validate which properties user can access
263
+ 4. **Unrestricted Resource Consumption** - Implement rate limiting and quotas
264
+ 5. **Broken Function Level Authorization** - Verify user role for each function
265
+ 6. **Unrestricted Access to Sensitive Business Flows** - Protect critical workflows
266
+ 7. **Server Side Request Forgery (SSRF)** - Validate and sanitize URLs
267
+ 8. **Security Misconfiguration** - Use security best practices and headers
268
+ 9. **Improper Inventory Management** - Document and secure all API endpoints
269
+ 10. **Unsafe Consumption of APIs** - Validate data from third-party APIs
270
+
271
+ ## Related Skills
272
+
273
+ - [vulnerability-scanner](../vulnerability-scanner/SKILL.md) - Security testing perspective
274
+ - [sql-injection-testing](../sql-injection-testing/SKILL.md) - Testing for SQL injection
275
+ - [secure-refactoring](../secure-refactoring/SKILL.md) - Fixing security issues
276
+
277
+ ## Additional Resources
278
+
279
+ - [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
280
+ - [JWT Best Practices](https://tools.ietf.org/html/rfc8725)
281
+ - [Express Security Best Practices](https://expressjs.com/en/advanced/best-practice-security.html)
282
+ - [Node.js Security Checklist](https://blog.risingstack.com/node-js-security-checklist/)
283
+ - [API Security Checklist](https://github.com/shieldfy/API-Security-Checklist)
284
+
285
+ ---
286
+
287
+ **Pro Tip:** Security is not a one-time task - regularly audit your APIs, keep dependencies updated, and stay informed about new vulnerabilities!
288
+
289
+
290
+ ## Gap Analysis Rule
291
+ Always identify gaps and suggest next steps to users. In case there is no gaps anymore, then AI should clearly state that there is no gap left.