myaidev-method 0.2.8 → 0.2.10
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/.claude/agents/wordpress-admin.md +271 -0
- package/.env.example +0 -1
- package/PACKAGE_FIXES_SUMMARY.md +319 -0
- package/PAYLOADCMS_AUTH_UPDATE.md +248 -0
- package/USER_GUIDE.md +260 -0
- package/bin/cli.js +70 -0
- package/dist/server/.tsbuildinfo +1 -0
- package/dist/server/auth/controllers/AuthController.d.ts +34 -0
- package/dist/server/auth/controllers/AuthController.d.ts.map +1 -0
- package/dist/server/auth/controllers/AuthController.js +43 -0
- package/dist/server/auth/controllers/AuthController.js.map +1 -0
- package/dist/server/auth/example-usage.d.ts +53 -0
- package/dist/server/auth/example-usage.d.ts.map +1 -0
- package/dist/server/auth/example-usage.js +129 -0
- package/dist/server/auth/example-usage.js.map +1 -0
- package/dist/server/auth/index.d.ts +11 -0
- package/dist/server/auth/index.d.ts.map +1 -0
- package/dist/server/auth/index.js +15 -0
- package/dist/server/auth/index.js.map +1 -0
- package/dist/server/auth/layers.d.ts +19 -0
- package/dist/server/auth/layers.d.ts.map +1 -0
- package/dist/server/auth/layers.js +33 -0
- package/dist/server/auth/layers.js.map +1 -0
- package/dist/server/auth/middleware/authMiddleware.d.ts +24 -0
- package/dist/server/auth/middleware/authMiddleware.d.ts.map +1 -0
- package/dist/server/auth/middleware/authMiddleware.js +65 -0
- package/dist/server/auth/middleware/authMiddleware.js.map +1 -0
- package/dist/server/auth/routes/authRoutes.d.ts +11 -0
- package/dist/server/auth/routes/authRoutes.d.ts.map +1 -0
- package/dist/server/auth/routes/authRoutes.js +213 -0
- package/dist/server/auth/routes/authRoutes.js.map +1 -0
- package/dist/server/auth/services/AuditLogService.d.ts +21 -0
- package/dist/server/auth/services/AuditLogService.d.ts.map +1 -0
- package/dist/server/auth/services/AuditLogService.js +28 -0
- package/dist/server/auth/services/AuditLogService.js.map +1 -0
- package/dist/server/auth/services/AuthService.d.ts +27 -0
- package/dist/server/auth/services/AuthService.d.ts.map +1 -0
- package/dist/server/auth/services/AuthService.js +246 -0
- package/dist/server/auth/services/AuthService.js.map +1 -0
- package/dist/server/auth/services/PasswordService.d.ts +12 -0
- package/dist/server/auth/services/PasswordService.d.ts.map +1 -0
- package/dist/server/auth/services/PasswordService.js +31 -0
- package/dist/server/auth/services/PasswordService.js.map +1 -0
- package/dist/server/auth/services/SessionRepository.d.ts +24 -0
- package/dist/server/auth/services/SessionRepository.d.ts.map +1 -0
- package/dist/server/auth/services/SessionRepository.js +101 -0
- package/dist/server/auth/services/SessionRepository.js.map +1 -0
- package/dist/server/auth/services/TokenService.d.ts +12 -0
- package/dist/server/auth/services/TokenService.d.ts.map +1 -0
- package/dist/server/auth/services/TokenService.js +86 -0
- package/dist/server/auth/services/TokenService.js.map +1 -0
- package/dist/server/auth/services/UserRepository.d.ts +23 -0
- package/dist/server/auth/services/UserRepository.d.ts.map +1 -0
- package/dist/server/auth/services/UserRepository.js +168 -0
- package/dist/server/auth/services/UserRepository.js.map +1 -0
- package/dist/server/auth/services/example.d.ts +26 -0
- package/dist/server/auth/services/example.d.ts.map +1 -0
- package/dist/server/auth/services/example.js +221 -0
- package/dist/server/auth/services/example.js.map +1 -0
- package/dist/server/auth/services/index.d.ts +6 -0
- package/dist/server/auth/services/index.d.ts.map +1 -0
- package/dist/server/auth/services/index.js +7 -0
- package/dist/server/auth/services/index.js.map +1 -0
- package/dist/server/database/db.d.ts +28 -0
- package/dist/server/database/db.d.ts.map +1 -0
- package/dist/server/database/db.js +91 -0
- package/dist/server/database/db.js.map +1 -0
- package/dist/server/database/schema.sql +95 -0
- package/dist/server/hono/app.d.ts +10 -0
- package/dist/server/hono/app.d.ts.map +1 -0
- package/dist/server/hono/app.js +26 -0
- package/dist/server/hono/app.js.map +1 -0
- package/dist/server/hono/routes.d.ts +12 -0
- package/dist/server/hono/routes.d.ts.map +1 -0
- package/dist/server/hono/routes.js +40 -0
- package/dist/server/hono/routes.js.map +1 -0
- package/dist/server/main.d.ts +2 -0
- package/dist/server/main.d.ts.map +1 -0
- package/dist/server/main.js +94 -0
- package/dist/server/main.js.map +1 -0
- package/dist/server/user-management/DirectoryService.d.ts +62 -0
- package/dist/server/user-management/DirectoryService.d.ts.map +1 -0
- package/dist/server/user-management/DirectoryService.js +201 -0
- package/dist/server/user-management/DirectoryService.js.map +1 -0
- package/dist/server/user-management/LinuxUserService.d.ts +71 -0
- package/dist/server/user-management/LinuxUserService.d.ts.map +1 -0
- package/dist/server/user-management/LinuxUserService.js +192 -0
- package/dist/server/user-management/LinuxUserService.js.map +1 -0
- package/dist/server/user-management/QuotaService.d.ts +59 -0
- package/dist/server/user-management/QuotaService.d.ts.map +1 -0
- package/dist/server/user-management/QuotaService.js +148 -0
- package/dist/server/user-management/QuotaService.js.map +1 -0
- package/dist/server/user-management/UserManagementService.d.ts +74 -0
- package/dist/server/user-management/UserManagementService.d.ts.map +1 -0
- package/dist/server/user-management/UserManagementService.js +122 -0
- package/dist/server/user-management/UserManagementService.js.map +1 -0
- package/dist/server/user-management/index.d.ts +26 -0
- package/dist/server/user-management/index.d.ts.map +1 -0
- package/dist/server/user-management/index.js +26 -0
- package/dist/server/user-management/index.js.map +1 -0
- package/dist/server/user-management/layers.d.ts +27 -0
- package/dist/server/user-management/layers.d.ts.map +1 -0
- package/dist/server/user-management/layers.js +37 -0
- package/dist/server/user-management/layers.js.map +1 -0
- package/dist/shared/types.d.ts +94 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +32 -0
- package/dist/shared/types.js.map +1 -0
- package/package.json +25 -5
- package/src/lib/payloadcms-utils.js +5 -12
- package/src/server/auth/ARCHITECTURE.md +575 -0
- package/src/server/auth/IMPLEMENTATION_SUMMARY.md +287 -0
- package/src/server/auth/QUICK_START.md +283 -0
- package/src/server/auth/README.md +290 -0
- package/src/server/auth/controllers/AuthController.ts +129 -0
- package/src/server/auth/example-usage.ts +159 -0
- package/src/server/auth/index.ts +19 -0
- package/src/server/auth/layers.ts +57 -0
- package/src/server/auth/middleware/authMiddleware.ts +118 -0
- package/src/server/auth/routes/authRoutes.ts +319 -0
- package/src/server/auth/services/AuditLogService.ts +81 -0
- package/src/server/auth/services/AuthService.ts +408 -0
- package/src/server/auth/services/IMPLEMENTATION_SUMMARY.md +404 -0
- package/src/server/auth/services/PasswordService.ts +85 -0
- package/src/server/auth/services/README.md +361 -0
- package/src/server/auth/services/SessionRepository.ts +227 -0
- package/src/server/auth/services/TokenService.ts +174 -0
- package/src/server/auth/services/UserRepository.ts +318 -0
- package/src/server/auth/services/example.ts +346 -0
- package/src/server/auth/services/index.ts +6 -0
- package/src/server/database/db.ts +161 -0
- package/src/server/database/schema.sql +95 -0
- package/src/server/hono/app.ts +41 -0
- package/src/server/main.ts +115 -0
- package/src/server/user-management/DirectoryService.ts +348 -0
- package/src/server/user-management/LinuxUserService.ts +338 -0
- package/src/server/user-management/QuotaService.ts +256 -0
- package/src/server/user-management/README.md +333 -0
- package/src/server/user-management/UserManagementService.ts +335 -0
- package/src/server/user-management/index.ts +26 -0
- package/src/server/user-management/layers.ts +51 -0
- package/src/shared/types.ts +111 -0
- package/src/templates/claude/agents/coolify-deploy.md +50 -50
- package/src/templates/claude/agents/payloadcms-publish.md +46 -18
- package/src/templates/codex/commands/myai-astro-publish.md +8 -2
- package/src/templates/codex/commands/myai-content-writer.md +8 -2
- package/src/templates/codex/commands/myai-coolify-deploy.md +8 -2
- package/src/templates/codex/commands/myai-dev-architect.md +8 -2
- package/src/templates/codex/commands/myai-dev-code.md +8 -2
- package/src/templates/codex/commands/myai-dev-docs.md +8 -2
- package/src/templates/codex/commands/myai-dev-review.md +8 -2
- package/src/templates/codex/commands/myai-dev-test.md +8 -2
- package/src/templates/codex/commands/myai-docusaurus-publish.md +8 -2
- package/src/templates/codex/commands/myai-mintlify-publish.md +8 -2
- package/src/templates/codex/commands/myai-payloadcms-publish.md +17 -3
- package/src/templates/codex/commands/myai-sparc-workflow.md +8 -2
- package/src/templates/codex/commands/myai-wordpress-admin.md +8 -2
- package/src/templates/codex/commands/myai-wordpress-publish.md +8 -2
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Layer } from "effect";
|
|
2
|
+
import { LinuxUserService } from "./LinuxUserService";
|
|
3
|
+
import { DirectoryService } from "./DirectoryService";
|
|
4
|
+
import { QuotaService } from "./QuotaService";
|
|
5
|
+
import { UserManagementService } from "./UserManagementService";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* User Management Layer Composition
|
|
9
|
+
*
|
|
10
|
+
* Provides Effect-TS layers for dependency injection of user management services.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// Independent services (no dependencies)
|
|
14
|
+
const IndependentServices = Layer.mergeAll(
|
|
15
|
+
LinuxUserService.Live,
|
|
16
|
+
DirectoryService.Live,
|
|
17
|
+
QuotaService.Live
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
// User management service depends on all base services
|
|
21
|
+
const UserManagementWithDeps = Layer.provide(
|
|
22
|
+
UserManagementService.Live,
|
|
23
|
+
IndependentServices
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Complete layer with all services
|
|
27
|
+
export const UserManagementLayer = Layer.mergeAll(
|
|
28
|
+
IndependentServices,
|
|
29
|
+
UserManagementWithDeps
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create a complete user management layer
|
|
34
|
+
*
|
|
35
|
+
* Usage:
|
|
36
|
+
* ```typescript
|
|
37
|
+
* const layer = createUserManagementLayer();
|
|
38
|
+
* const runtime = ManagedRuntime.make(layer);
|
|
39
|
+
*
|
|
40
|
+
* const result = await runtime.runPromise(
|
|
41
|
+
* Effect.gen(function* () {
|
|
42
|
+
* const userMgmt = yield* UserManagementService;
|
|
43
|
+
* return yield* userMgmt.createUser({
|
|
44
|
+
* username: "john",
|
|
45
|
+
* email: "john@example.com",
|
|
46
|
+
* });
|
|
47
|
+
* })
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export const createUserManagementLayer = () => UserManagementLayer;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
// Shared types for MyAIDev Method Web Server
|
|
2
|
+
|
|
3
|
+
export interface User {
|
|
4
|
+
id: string;
|
|
5
|
+
username: string;
|
|
6
|
+
email: string;
|
|
7
|
+
passwordHash: string | null;
|
|
8
|
+
linuxUsername: string;
|
|
9
|
+
createdAt: number;
|
|
10
|
+
updatedAt: number;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
emailVerified: boolean;
|
|
13
|
+
failedLoginAttempts: number;
|
|
14
|
+
lastLoginAt: number | null;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface Session {
|
|
18
|
+
id: string;
|
|
19
|
+
userId: string;
|
|
20
|
+
tokenHash: string;
|
|
21
|
+
ipAddress: string | null;
|
|
22
|
+
userAgent: string | null;
|
|
23
|
+
createdAt: number;
|
|
24
|
+
expiresAt: number;
|
|
25
|
+
isRevoked: boolean;
|
|
26
|
+
revokedAt: number | null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface OAuth2Provider {
|
|
30
|
+
id: string;
|
|
31
|
+
userId: string;
|
|
32
|
+
provider: "google" | "github" | "microsoft";
|
|
33
|
+
providerUserId: string;
|
|
34
|
+
providerEmail: string | null;
|
|
35
|
+
accessToken: string | null;
|
|
36
|
+
refreshToken: string | null;
|
|
37
|
+
tokenExpiresAt: number | null;
|
|
38
|
+
createdAt: number;
|
|
39
|
+
updatedAt: number;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface AuditLog {
|
|
43
|
+
id: string;
|
|
44
|
+
userId: string | null;
|
|
45
|
+
action: string;
|
|
46
|
+
resourceType: string | null;
|
|
47
|
+
resourceId: string | null;
|
|
48
|
+
ipAddress: string | null;
|
|
49
|
+
userAgent: string | null;
|
|
50
|
+
details: string | null;
|
|
51
|
+
createdAt: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// JWT Payload - compatible with jose library
|
|
55
|
+
export interface JWTPayload {
|
|
56
|
+
sub: string; // user id
|
|
57
|
+
username: string;
|
|
58
|
+
email: string;
|
|
59
|
+
iat: number;
|
|
60
|
+
exp: number;
|
|
61
|
+
jti: string; // session id
|
|
62
|
+
[key: string]: unknown; // Index signature for jose compatibility
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// API Request/Response types
|
|
66
|
+
export interface RegisterRequest {
|
|
67
|
+
username: string;
|
|
68
|
+
email: string;
|
|
69
|
+
password: string;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface LoginRequest {
|
|
73
|
+
email: string;
|
|
74
|
+
password: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface AuthResponse {
|
|
78
|
+
user: {
|
|
79
|
+
id: string;
|
|
80
|
+
username: string;
|
|
81
|
+
email: string;
|
|
82
|
+
emailVerified: boolean;
|
|
83
|
+
};
|
|
84
|
+
token: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Error types
|
|
88
|
+
export class AuthError {
|
|
89
|
+
readonly _tag = "AuthError";
|
|
90
|
+
constructor(
|
|
91
|
+
readonly code: string,
|
|
92
|
+
readonly message: string,
|
|
93
|
+
readonly cause?: unknown
|
|
94
|
+
) {}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export class ValidationError {
|
|
98
|
+
readonly _tag = "ValidationError";
|
|
99
|
+
constructor(
|
|
100
|
+
readonly field: string,
|
|
101
|
+
readonly message: string
|
|
102
|
+
) {}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export class DatabaseError {
|
|
106
|
+
readonly _tag = "DatabaseError";
|
|
107
|
+
constructor(
|
|
108
|
+
readonly message: string,
|
|
109
|
+
readonly cause?: unknown
|
|
110
|
+
) {}
|
|
111
|
+
}
|
|
@@ -25,7 +25,7 @@ COOLIFY_API_KEY=your_api_key_here
|
|
|
25
25
|
|
|
26
26
|
Verify configuration:
|
|
27
27
|
```bash
|
|
28
|
-
node src/scripts/coolify-status.js
|
|
28
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
## Operational Patterns (Claude Code 2.0)
|
|
@@ -37,10 +37,10 @@ node src/scripts/coolify-status.js
|
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
39
|
# Deploy application
|
|
40
|
-
node src/scripts/coolify-deploy-app.js --name myapp --repo https://github.com/user/repo
|
|
40
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js --name myapp --repo https://github.com/user/repo
|
|
41
41
|
|
|
42
42
|
# Check status
|
|
43
|
-
node src/scripts/coolify-list-resources.js --type applications
|
|
43
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type applications
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
### Pattern 2: Extended Thinking
|
|
@@ -69,13 +69,13 @@ Main agent → Deploy subagent (App A) → Verify subagent
|
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
71
|
# Step 1: Verify Coolify connectivity
|
|
72
|
-
node src/scripts/coolify-status.js
|
|
72
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js
|
|
73
73
|
|
|
74
74
|
# Step 2: List available servers
|
|
75
|
-
node src/scripts/coolify-list-resources.js --type servers
|
|
75
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type servers
|
|
76
76
|
|
|
77
77
|
# Step 3: Deploy application
|
|
78
|
-
node src/scripts/coolify-deploy-app.js \
|
|
78
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
79
79
|
--name "myapp" \
|
|
80
80
|
--repo "https://github.com/user/myapp" \
|
|
81
81
|
--branch "main" \
|
|
@@ -86,7 +86,7 @@ node src/scripts/coolify-deploy-app.js \
|
|
|
86
86
|
--domain "myapp.example.com"
|
|
87
87
|
|
|
88
88
|
# Step 4: Monitor deployment
|
|
89
|
-
node src/scripts/coolify-watch-deployment.js --uuid "app-uuid"
|
|
89
|
+
node node_modules/myaidev-method/src/scripts/coolify-watch-deployment.js --uuid "app-uuid"
|
|
90
90
|
|
|
91
91
|
# Step 5: Verify deployment
|
|
92
92
|
curl https://myapp.example.com
|
|
@@ -118,14 +118,14 @@ curl https://myapp.example.com
|
|
|
118
118
|
|
|
119
119
|
```bash
|
|
120
120
|
# Deploy to staging
|
|
121
|
-
node src/scripts/coolify-deploy-app.js \
|
|
121
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
122
122
|
--name "myapp-staging" \
|
|
123
123
|
--branch "develop" \
|
|
124
124
|
--env-file ".env.staging"
|
|
125
125
|
|
|
126
126
|
# Deploy to production (with approval gate)
|
|
127
127
|
# Agent prompts: "Ready to deploy to production? (y/n)"
|
|
128
|
-
node src/scripts/coolify-deploy-app.js \
|
|
128
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
129
129
|
--name "myapp-prod" \
|
|
130
130
|
--branch "main" \
|
|
131
131
|
--env-file ".env.production"
|
|
@@ -139,23 +139,23 @@ All scripts use credentials from `.env` automatically:
|
|
|
139
139
|
|
|
140
140
|
```bash
|
|
141
141
|
# Resource Management
|
|
142
|
-
node src/scripts/coolify-list-resources.js [--type servers|projects|applications|databases]
|
|
143
|
-
node src/scripts/coolify-status.js
|
|
144
|
-
node src/scripts/coolify-server-info.js --uuid <server-uuid>
|
|
142
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js [--type servers|projects|applications|databases]
|
|
143
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js
|
|
144
|
+
node node_modules/myaidev-method/src/scripts/coolify-server-info.js --uuid <server-uuid>
|
|
145
145
|
|
|
146
146
|
# Application Deployment
|
|
147
|
-
node src/scripts/coolify-deploy-app.js [options]
|
|
148
|
-
node src/scripts/coolify-watch-deployment.js --uuid <app-uuid>
|
|
149
|
-
node src/scripts/coolify-restart-app.js --uuid <app-uuid>
|
|
150
|
-
node src/scripts/coolify-stop-app.js --uuid <app-uuid>
|
|
147
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js [options]
|
|
148
|
+
node node_modules/myaidev-method/src/scripts/coolify-watch-deployment.js --uuid <app-uuid>
|
|
149
|
+
node node_modules/myaidev-method/src/scripts/coolify-restart-app.js --uuid <app-uuid>
|
|
150
|
+
node node_modules/myaidev-method/src/scripts/coolify-stop-app.js --uuid <app-uuid>
|
|
151
151
|
|
|
152
152
|
# Environment Variables
|
|
153
|
-
node src/scripts/coolify-set-env.js --uuid <app-uuid> --file .env.production
|
|
154
|
-
node src/scripts/coolify-get-env.js --uuid <app-uuid>
|
|
153
|
+
node node_modules/myaidev-method/src/scripts/coolify-set-env.js --uuid <app-uuid> --file .env.production
|
|
154
|
+
node node_modules/myaidev-method/src/scripts/coolify-get-env.js --uuid <app-uuid>
|
|
155
155
|
|
|
156
156
|
# Logs & Debugging
|
|
157
|
-
node src/scripts/coolify-logs.js --uuid <app-uuid> [--follow]
|
|
158
|
-
node src/scripts/coolify-deployment-report.js --uuid <app-uuid>
|
|
157
|
+
node node_modules/myaidev-method/src/scripts/coolify-logs.js --uuid <app-uuid> [--follow]
|
|
158
|
+
node node_modules/myaidev-method/src/scripts/coolify-deployment-report.js --uuid <app-uuid>
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
### Using Coolify Utils Library
|
|
@@ -249,7 +249,7 @@ const result = await coolify.waitForDeployment(uuid, {
|
|
|
249
249
|
**Issue: API Authentication Failed**
|
|
250
250
|
```bash
|
|
251
251
|
# Verify API key
|
|
252
|
-
node src/scripts/coolify-status.js
|
|
252
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js
|
|
253
253
|
|
|
254
254
|
# Check .env file
|
|
255
255
|
cat .env | grep COOLIFY
|
|
@@ -261,47 +261,47 @@ curl -H "Authorization: Bearer $COOLIFY_API_KEY" https://coolify.myai1.ai/api/v1
|
|
|
261
261
|
**Issue: Deployment Stuck or Failed**
|
|
262
262
|
```bash
|
|
263
263
|
# Check deployment logs
|
|
264
|
-
node src/scripts/coolify-logs.js --uuid <app-uuid>
|
|
264
|
+
node node_modules/myaidev-method/src/scripts/coolify-logs.js --uuid <app-uuid>
|
|
265
265
|
|
|
266
266
|
# Get deployment status
|
|
267
|
-
node src/scripts/coolify-deployment-report.js --uuid <app-uuid>
|
|
267
|
+
node node_modules/myaidev-method/src/scripts/coolify-deployment-report.js --uuid <app-uuid>
|
|
268
268
|
|
|
269
269
|
# Restart application
|
|
270
|
-
node src/scripts/coolify-restart-app.js --uuid <app-uuid>
|
|
270
|
+
node node_modules/myaidev-method/src/scripts/coolify-restart-app.js --uuid <app-uuid>
|
|
271
271
|
```
|
|
272
272
|
|
|
273
273
|
**Issue: Application Not Accessible**
|
|
274
274
|
```bash
|
|
275
275
|
# Verify domains configured
|
|
276
|
-
node src/scripts/coolify-list-resources.js --type applications | grep -A 5 "myapp"
|
|
276
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type applications | grep -A 5 "myapp"
|
|
277
277
|
|
|
278
278
|
# Check server status
|
|
279
|
-
node src/scripts/coolify-server-info.js --uuid <server-uuid>
|
|
279
|
+
node node_modules/myaidev-method/src/scripts/coolify-server-info.js --uuid <server-uuid>
|
|
280
280
|
|
|
281
281
|
# Verify application running
|
|
282
|
-
node src/scripts/coolify-logs.js --uuid <app-uuid> --tail 50
|
|
282
|
+
node node_modules/myaidev-method/src/scripts/coolify-logs.js --uuid <app-uuid> --tail 50
|
|
283
283
|
```
|
|
284
284
|
|
|
285
285
|
### Diagnostic Workflow
|
|
286
286
|
|
|
287
287
|
1. **Check System Status**
|
|
288
288
|
```bash
|
|
289
|
-
node src/scripts/coolify-status.js
|
|
289
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js
|
|
290
290
|
```
|
|
291
291
|
|
|
292
292
|
2. **Verify Application State**
|
|
293
293
|
```bash
|
|
294
|
-
node src/scripts/coolify-list-resources.js --type applications
|
|
294
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type applications
|
|
295
295
|
```
|
|
296
296
|
|
|
297
297
|
3. **Analyze Logs**
|
|
298
298
|
```bash
|
|
299
|
-
node src/scripts/coolify-logs.js --uuid <uuid> --follow
|
|
299
|
+
node node_modules/myaidev-method/src/scripts/coolify-logs.js --uuid <uuid> --follow
|
|
300
300
|
```
|
|
301
301
|
|
|
302
302
|
4. **Generate Deployment Report**
|
|
303
303
|
```bash
|
|
304
|
-
node src/scripts/coolify-deployment-report.js --uuid <uuid> --output report.json
|
|
304
|
+
node node_modules/myaidev-method/src/scripts/coolify-deployment-report.js --uuid <uuid> --output report.json
|
|
305
305
|
```
|
|
306
306
|
|
|
307
307
|
## Security Best Practices
|
|
@@ -349,7 +349,7 @@ fi
|
|
|
349
349
|
/myai-content-writer "10 Tips for Productivity"
|
|
350
350
|
|
|
351
351
|
# Coolify-deploy agent deploys WordPress if needed
|
|
352
|
-
node src/scripts/coolify-deploy-app.js --name wordpress --template wordpress
|
|
352
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js --name wordpress --template wordpress
|
|
353
353
|
|
|
354
354
|
# WordPress-admin agent publishes content
|
|
355
355
|
/myai-wordpress-publish content.md
|
|
@@ -370,7 +370,7 @@ node src/scripts/coolify-deploy-app.js --name wordpress --template wordpress
|
|
|
370
370
|
|
|
371
371
|
```bash
|
|
372
372
|
# List servers with metrics
|
|
373
|
-
node src/scripts/coolify-list-resources.js --type servers --detailed
|
|
373
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type servers --detailed
|
|
374
374
|
|
|
375
375
|
# Agent analyzes:
|
|
376
376
|
# - Server load
|
|
@@ -397,7 +397,7 @@ node src/scripts/coolify-list-resources.js --type servers --detailed
|
|
|
397
397
|
|
|
398
398
|
```bash
|
|
399
399
|
# Real-time deployment monitoring
|
|
400
|
-
node src/scripts/coolify-watch-deployment.js --uuid <uuid>
|
|
400
|
+
node node_modules/myaidev-method/src/scripts/coolify-watch-deployment.js --uuid <uuid>
|
|
401
401
|
|
|
402
402
|
# Output:
|
|
403
403
|
# [12:00:00] 🚀 Deployment started
|
|
@@ -411,7 +411,7 @@ node src/scripts/coolify-watch-deployment.js --uuid <uuid>
|
|
|
411
411
|
|
|
412
412
|
```bash
|
|
413
413
|
# System-wide health check
|
|
414
|
-
node src/scripts/coolify-status.js --comprehensive
|
|
414
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js --comprehensive
|
|
415
415
|
|
|
416
416
|
# Per-application health check
|
|
417
417
|
curl -I https://myapp.example.com/health
|
|
@@ -426,13 +426,13 @@ curl -I https://myapp.example.com/health
|
|
|
426
426
|
**Agent workflow**:
|
|
427
427
|
```bash
|
|
428
428
|
# 1. Verify connectivity
|
|
429
|
-
node src/scripts/coolify-status.js
|
|
429
|
+
node node_modules/myaidev-method/src/scripts/coolify-status.js
|
|
430
430
|
|
|
431
431
|
# 2. List available servers
|
|
432
|
-
node src/scripts/coolify-list-resources.js --type servers
|
|
432
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type servers
|
|
433
433
|
|
|
434
434
|
# 3. Deploy application
|
|
435
|
-
node src/scripts/coolify-deploy-app.js \
|
|
435
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
436
436
|
--name "nextjs-app" \
|
|
437
437
|
--repo "https://github.com/user/nextjs-app" \
|
|
438
438
|
--branch "main" \
|
|
@@ -442,7 +442,7 @@ node src/scripts/coolify-deploy-app.js \
|
|
|
442
442
|
--server-uuid "ho4k04okko0wks8g0gsccww4"
|
|
443
443
|
|
|
444
444
|
# 4. Watch deployment
|
|
445
|
-
node src/scripts/coolify-watch-deployment.js --uuid "<new-app-uuid>"
|
|
445
|
+
node node_modules/myaidev-method/src/scripts/coolify-watch-deployment.js --uuid "<new-app-uuid>"
|
|
446
446
|
```
|
|
447
447
|
|
|
448
448
|
### Example 2: Update Environment Variables
|
|
@@ -452,16 +452,16 @@ node src/scripts/coolify-watch-deployment.js --uuid "<new-app-uuid>"
|
|
|
452
452
|
**Agent workflow**:
|
|
453
453
|
```bash
|
|
454
454
|
# 1. Find application
|
|
455
|
-
node src/scripts/coolify-list-resources.js --type applications | grep myapp
|
|
455
|
+
node node_modules/myaidev-method/src/scripts/coolify-list-resources.js --type applications | grep myapp
|
|
456
456
|
|
|
457
457
|
# 2. Update environment variable
|
|
458
|
-
node src/scripts/coolify-set-env.js \
|
|
458
|
+
node node_modules/myaidev-method/src/scripts/coolify-set-env.js \
|
|
459
459
|
--uuid "<app-uuid>" \
|
|
460
460
|
--key "API_KEY" \
|
|
461
461
|
--value "<new-api-key>"
|
|
462
462
|
|
|
463
463
|
# 3. Restart application to apply changes
|
|
464
|
-
node src/scripts/coolify-restart-app.js --uuid "<app-uuid>"
|
|
464
|
+
node node_modules/myaidev-method/src/scripts/coolify-restart-app.js --uuid "<app-uuid>"
|
|
465
465
|
```
|
|
466
466
|
|
|
467
467
|
### Example 3: Deploy Database
|
|
@@ -471,7 +471,7 @@ node src/scripts/coolify-restart-app.js --uuid "<app-uuid>"
|
|
|
471
471
|
**Agent workflow**:
|
|
472
472
|
```bash
|
|
473
473
|
# 1. Create database
|
|
474
|
-
node src/scripts/coolify-create-database.js \
|
|
474
|
+
node node_modules/myaidev-method/src/scripts/coolify-create-database.js \
|
|
475
475
|
--name "myapp-db" \
|
|
476
476
|
--type "postgresql" \
|
|
477
477
|
--version "16" \
|
|
@@ -479,10 +479,10 @@ node src/scripts/coolify-create-database.js \
|
|
|
479
479
|
--project-uuid "<project-uuid>"
|
|
480
480
|
|
|
481
481
|
# 2. Get connection string
|
|
482
|
-
node src/scripts/coolify-get-database-connection.js --uuid "<db-uuid>"
|
|
482
|
+
node node_modules/myaidev-method/src/scripts/coolify-get-database-connection.js --uuid "<db-uuid>"
|
|
483
483
|
|
|
484
484
|
# 3. Update application with DB connection
|
|
485
|
-
node src/scripts/coolify-set-env.js \
|
|
485
|
+
node node_modules/myaidev-method/src/scripts/coolify-set-env.js \
|
|
486
486
|
--uuid "<app-uuid>" \
|
|
487
487
|
--key "DATABASE_URL" \
|
|
488
488
|
--value "<connection-string>"
|
|
@@ -494,21 +494,21 @@ node src/scripts/coolify-set-env.js \
|
|
|
494
494
|
|
|
495
495
|
```bash
|
|
496
496
|
# Deploy to blue environment
|
|
497
|
-
node src/scripts/coolify-deploy-app.js --name "myapp-blue" --branch "release"
|
|
497
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js --name "myapp-blue" --branch "release"
|
|
498
498
|
|
|
499
499
|
# Test blue environment
|
|
500
500
|
curl https://blue.myapp.com/health
|
|
501
501
|
|
|
502
502
|
# Switch traffic (update DNS or proxy)
|
|
503
503
|
# Stop green environment
|
|
504
|
-
node src/scripts/coolify-stop-app.js --uuid "<green-uuid>"
|
|
504
|
+
node node_modules/myaidev-method/src/scripts/coolify-stop-app.js --uuid "<green-uuid>"
|
|
505
505
|
```
|
|
506
506
|
|
|
507
507
|
### Pattern: Canary Deployment
|
|
508
508
|
|
|
509
509
|
```bash
|
|
510
510
|
# Deploy canary version
|
|
511
|
-
node src/scripts/coolify-deploy-app.js \
|
|
511
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
512
512
|
--name "myapp-canary" \
|
|
513
513
|
--branch "canary" \
|
|
514
514
|
--domain "canary.myapp.com"
|
|
@@ -522,12 +522,12 @@ node src/scripts/coolify-deploy-app.js \
|
|
|
522
522
|
|
|
523
523
|
```bash
|
|
524
524
|
# Deploy to US server
|
|
525
|
-
node src/scripts/coolify-deploy-app.js \
|
|
525
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
526
526
|
--name "myapp-us" \
|
|
527
527
|
--server-uuid "<us-server-uuid>"
|
|
528
528
|
|
|
529
529
|
# Deploy to EU server
|
|
530
|
-
node src/scripts/coolify-deploy-app.js \
|
|
530
|
+
node node_modules/myaidev-method/src/scripts/coolify-deploy-app.js \
|
|
531
531
|
--name "myapp-eu" \
|
|
532
532
|
--server-uuid "<eu-server-uuid>"
|
|
533
533
|
|
|
@@ -29,23 +29,24 @@ token_target: 2800
|
|
|
29
29
|
|
|
30
30
|
### Step 1: Configuration Validation
|
|
31
31
|
```
|
|
32
|
-
1. Check PayloadCMS credentials in environment
|
|
32
|
+
1. Check PayloadCMS credentials in environment (.env file)
|
|
33
33
|
2. Verify required fields:
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
- PAYLOADCMS_URL: PayloadCMS API endpoint
|
|
35
|
+
- PAYLOADCMS_EMAIL: User email for authentication
|
|
36
|
+
- PAYLOADCMS_PASSWORD: User password for authentication
|
|
37
|
+
3. If missing → prompt user to configure .env file
|
|
38
|
+
(See .env.example for template)
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
### Step 2: Authentication
|
|
42
42
|
```
|
|
43
|
-
1.
|
|
44
|
-
2.
|
|
45
|
-
3.
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
43
|
+
1. Authenticate using email/password to obtain JWT token
|
|
44
|
+
2. POST to {PAYLOADCMS_URL}/api/users/login with credentials
|
|
45
|
+
3. Extract JWT token from response (used for all subsequent API calls)
|
|
46
|
+
4. Handle auth errors:
|
|
47
|
+
- Invalid credentials → verify PAYLOADCMS_EMAIL and PAYLOADCMS_PASSWORD
|
|
48
|
+
- Network errors → check PAYLOADCMS_URL accessibility
|
|
49
|
+
- Server errors → verify PayloadCMS instance is running
|
|
49
50
|
```
|
|
50
51
|
|
|
51
52
|
### Step 3: Content Processing
|
|
@@ -123,12 +124,39 @@ Agent:
|
|
|
123
124
|
|
|
124
125
|
```
|
|
125
126
|
1. Read(markdown_file) → Extract content
|
|
126
|
-
2.
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
127
|
+
2. Use Bash tool to execute publishing script:
|
|
128
|
+
node node_modules/myaidev-method/src/scripts/payloadcms-publish.js [file] [options]
|
|
129
|
+
3. The script handles:
|
|
130
|
+
- Authentication (JWT token from .env credentials)
|
|
131
|
+
- Markdown to Lexical conversion
|
|
132
|
+
- Document creation/update via API
|
|
133
|
+
4. Report success with URLs from script output
|
|
130
134
|
```
|
|
131
135
|
|
|
132
|
-
|
|
136
|
+
**Alternative**: Use PayloadCMSUtils library directly if you prefer programmatic control:
|
|
137
|
+
```
|
|
138
|
+
import { PayloadCMSUtils } from 'node_modules/myaidev-method/src/lib/payloadcms-utils.js'
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Configuration Setup
|
|
142
|
+
|
|
143
|
+
### Required Environment Variables
|
|
144
|
+
|
|
145
|
+
Add to your `.env` file:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
PAYLOADCMS_URL=https://your-payloadcms-site.com
|
|
149
|
+
PAYLOADCMS_EMAIL=your-email@example.com
|
|
150
|
+
PAYLOADCMS_PASSWORD=your-password
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Authentication Flow
|
|
154
|
+
|
|
155
|
+
1. **Email/Password Login**: Agent authenticates using credentials from .env
|
|
156
|
+
2. **JWT Token**: Receives JWT token from PayloadCMS `/api/users/login` endpoint
|
|
157
|
+
3. **API Requests**: Uses JWT token in `Authorization: JWT {token}` header for all API calls
|
|
158
|
+
4. **Token Expiry**: Automatically re-authenticates if token expires
|
|
159
|
+
|
|
160
|
+
### No API Keys Required
|
|
133
161
|
|
|
134
|
-
|
|
162
|
+
PayloadCMS integration uses standard user authentication (email/password) to obtain JWT tokens. No separate API keys or application passwords needed.
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Astro Content Publisher
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the Task tool with subagent_type="astro-publish" to publish the markdown file provided in the arguments to Astro.
|
|
4
|
+
|
|
5
|
+
Pass all command arguments to the agent, including the file path and any flags (--collection, --pages, --project, --branch, --no-push, --dry-run).
|
|
6
|
+
|
|
7
|
+
The agent will handle frontmatter transformation, content collection validation, and git workflow automation for Astro static sites.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Publish markdown content to Astro static site with content collections support and git workflow: $ARGUMENTS
|
|
6
12
|
|
|
7
13
|
## Usage Examples
|
|
8
14
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Professional Content Writer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the Task tool with subagent_type="content-writer" to create SEO-optimized content based on the provided topic.
|
|
4
|
+
|
|
5
|
+
Pass all command arguments to the agent, including the topic, word count, tone, audience, SEO keywords, and publish_to_wordpress flag.
|
|
6
|
+
|
|
7
|
+
The agent will handle research, planning, writing, optimization, and formatting with professional content creation expertise.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Create comprehensive, well-researched content based on the provided topic: $ARGUMENTS
|
|
6
12
|
|
|
7
13
|
## Core Competencies
|
|
8
14
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Coolify Deployment Manager
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the Task tool with subagent_type="coolify-deploy" to execute Coolify deployment operations provided in the arguments.
|
|
4
|
+
|
|
5
|
+
Pass all command arguments to the agent, including the operation type (deploy, status, list, logs, restart, env) and any configuration flags.
|
|
6
|
+
|
|
7
|
+
The agent will handle Coolify API communication, deployment orchestration, and infrastructure management operations.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Execute Coolify deployment operations: $ARGUMENTS
|
|
6
12
|
|
|
7
13
|
## Available Operations
|
|
8
14
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# System Architecture Design
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the Task tool with subagent_type="MyAIDev Architect" to design scalable system architecture based on the provided requirements.
|
|
4
|
+
|
|
5
|
+
Pass all command arguments to the agent, including the task description and any flags (--existing-code, --tech-stack, --output-dir).
|
|
6
|
+
|
|
7
|
+
The agent will handle requirements analysis, architecture design, diagram creation, API specifications, and technology recommendations using MyAIDev Method's SPARC workflow.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Design scalable system architecture using MyAIDev Method's systematic approach: $ARGUMENTS
|
|
6
12
|
|
|
7
13
|
## What It Does
|
|
8
14
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Feature Implementation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the Task tool with subagent_type="MyAIDev Coder" to implement features based on the provided requirements.
|
|
4
|
+
|
|
5
|
+
Pass all command arguments to the agent, including the task description and any flags (--architecture, --test-driven, --output-dir).
|
|
6
|
+
|
|
7
|
+
The agent will handle implementation planning, clean code generation, SOLID principles application, error handling, and test creation using MyAIDev Method's SPARC workflow.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Implement features and write production-ready code using MyAIDev Method's systematic approach: $ARGUMENTS
|
|
6
12
|
|
|
7
13
|
## What It Does
|
|
8
14
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# Comprehensive Documentation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Use the Task tool with subagent_type="MyAIDev Documenter" to generate comprehensive documentation based on the provided requirements.
|
|
4
|
+
|
|
5
|
+
Pass all command arguments to the agent, including the task description and any flags (--type, --format, --output-dir).
|
|
6
|
+
|
|
7
|
+
The agent will handle documentation generation including API references, user guides, architecture docs, code examples, and visual diagrams using MyAIDev Method's SPARC workflow.
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
Generate comprehensive documentation using MyAIDev Method's systematic approach: $ARGUMENTS
|
|
6
12
|
|
|
7
13
|
## What It Does
|
|
8
14
|
|