myaidev-method 0.1.0 → 0.2.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.
- package/.env.example +20 -0
- package/PUBLISHING_GUIDE.md +521 -0
- package/README.md +123 -25
- package/bin/cli.js +89 -49
- package/package.json +25 -3
- package/src/lib/payloadcms-utils.js +394 -0
- package/src/lib/static-site-utils.js +377 -0
- package/src/scripts/astro-publish.js +209 -0
- package/src/scripts/docusaurus-publish.js +209 -0
- package/src/scripts/init-project.js +91 -0
- package/src/scripts/mintlify-publish.js +205 -0
- package/src/scripts/payloadcms-publish.js +202 -0
- package/src/templates/claude/agents/astro-publish.md +43 -0
- package/src/templates/claude/agents/docusaurus-publish.md +42 -0
- package/src/templates/claude/agents/mintlify-publish.md +42 -0
- package/src/templates/claude/agents/payloadcms-publish.md +134 -0
- package/src/templates/claude/commands/myai-astro-publish.md +54 -0
- package/src/templates/claude/commands/myai-docusaurus-publish.md +45 -0
- package/src/templates/claude/commands/myai-mintlify-publish.md +45 -0
- package/src/templates/claude/commands/myai-payloadcms-publish.md +45 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: astro-publish
|
|
3
|
+
description: Publish markdown content to Astro sites with content collections
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
capabilities:
|
|
6
|
+
- Astro project detection
|
|
7
|
+
- Content collections publishing
|
|
8
|
+
- Frontmatter transformation
|
|
9
|
+
- Git workflow automation
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Astro Publishing Agent
|
|
13
|
+
|
|
14
|
+
Professional publishing for Astro static sites with content collections support.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. **Validate Project**: Detect astro.config.mjs and content collections
|
|
19
|
+
2. **Transform Frontmatter**: Convert to Astro schema (pubDate, draft, etc.)
|
|
20
|
+
3. **Publish Content**: Write to src/content/{collection}/ or src/pages/
|
|
21
|
+
4. **Git Operations**: Commit and push changes
|
|
22
|
+
|
|
23
|
+
## Usage Examples
|
|
24
|
+
|
|
25
|
+
### Publish to Content Collection
|
|
26
|
+
```
|
|
27
|
+
/astro-publish "article.md" --collection blog
|
|
28
|
+
```
|
|
29
|
+
Publishes to src/content/blog/ with proper schema.
|
|
30
|
+
|
|
31
|
+
### Publish to Pages
|
|
32
|
+
```
|
|
33
|
+
/astro-publish "about.md" --pages
|
|
34
|
+
```
|
|
35
|
+
Publishes to src/pages/ directory.
|
|
36
|
+
|
|
37
|
+
### Full Metadata
|
|
38
|
+
Transforms:
|
|
39
|
+
- `date` → `pubDate` (ISO 8601)
|
|
40
|
+
- `status` → `draft` (boolean)
|
|
41
|
+
- `excerpt` → `description`
|
|
42
|
+
|
|
43
|
+
Use StaticSiteUtils for all operations.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Docusaurus Publishing Agent
|
|
3
|
+
description: Git-based publishing agent for Docusaurus static site generator
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
capabilities:
|
|
6
|
+
- Docusaurus project detection
|
|
7
|
+
- Content transformation for docs/blog/pages
|
|
8
|
+
- Frontmatter conversion
|
|
9
|
+
- Git workflow automation
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Docusaurus Publishing Agent
|
|
13
|
+
|
|
14
|
+
Automated publishing for Docusaurus documentation sites with git-based deployment.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. **Validate Project**: Detect docusaurus.config.js and project structure
|
|
19
|
+
2. **Transform Content**: Add Docusaurus frontmatter (sidebar, position, etc.)
|
|
20
|
+
3. **Place Content**: Write to docs/, blog/, or pages/
|
|
21
|
+
4. **Git Operations**: Commit and push changes
|
|
22
|
+
|
|
23
|
+
## Usage Examples
|
|
24
|
+
|
|
25
|
+
### Publish Documentation
|
|
26
|
+
```
|
|
27
|
+
/docusaurus-publish "getting-started.md"
|
|
28
|
+
```
|
|
29
|
+
Places in docs/ directory with sidebar configuration.
|
|
30
|
+
|
|
31
|
+
### Publish Blog Post
|
|
32
|
+
```
|
|
33
|
+
/docusaurus-publish "my-article.md" --type blog
|
|
34
|
+
```
|
|
35
|
+
Adds date prefix and places in blog/ directory.
|
|
36
|
+
|
|
37
|
+
### Custom Path
|
|
38
|
+
```
|
|
39
|
+
/docusaurus-publish "api-docs.md" --project ./my-docs --branch develop
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use StaticSiteUtils for all operations.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mintlify-publish
|
|
3
|
+
description: Git-based documentation publishing for Mintlify with automatic navigation
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
capabilities:
|
|
6
|
+
- Mintlify project detection
|
|
7
|
+
- MDX transformation
|
|
8
|
+
- mint.json navigation update
|
|
9
|
+
- Git workflow automation
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Mintlify Publishing Agent
|
|
13
|
+
|
|
14
|
+
Professional documentation publishing for Mintlify sites with automatic navigation management.
|
|
15
|
+
|
|
16
|
+
## Workflow
|
|
17
|
+
|
|
18
|
+
1. **Detect Project**: Validate mint.json presence
|
|
19
|
+
2. **Transform to MDX**: Ensure MDX compatibility
|
|
20
|
+
3. **Update Navigation**: Add entry to mint.json navigation array
|
|
21
|
+
4. **Git Workflow**: Commit and push changes
|
|
22
|
+
|
|
23
|
+
## Usage Examples
|
|
24
|
+
|
|
25
|
+
### Basic Publishing
|
|
26
|
+
```
|
|
27
|
+
/mintlify-publish "guides/authentication.md"
|
|
28
|
+
```
|
|
29
|
+
Adds to default navigation section.
|
|
30
|
+
|
|
31
|
+
### Navigation Section
|
|
32
|
+
```
|
|
33
|
+
/mintlify-publish "api/users.md" --section "API Reference"
|
|
34
|
+
```
|
|
35
|
+
Adds to specific navigation group.
|
|
36
|
+
|
|
37
|
+
### Custom Metadata
|
|
38
|
+
```
|
|
39
|
+
/mintlify-publish "tutorial.md" --icon "rocket" --title "Quick Tutorial"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use StaticSiteUtils for all operations.
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: PayloadCMS Publisher
|
|
3
|
+
description: Professional PayloadCMS publishing agent for automated content deployment
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
capabilities:
|
|
6
|
+
- Convert markdown to Lexical rich text
|
|
7
|
+
- Publish to PayloadCMS collections
|
|
8
|
+
- Handle draft and published statuses
|
|
9
|
+
- JWT authentication management
|
|
10
|
+
- Update existing documents
|
|
11
|
+
- Media upload coordination
|
|
12
|
+
agent_type: publishing
|
|
13
|
+
token_target: 2800
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
# PayloadCMS Publishing Agent
|
|
17
|
+
|
|
18
|
+
**Purpose**: Convert markdown content to Lexical format and publish to PayloadCMS collections with full authentication and status management.
|
|
19
|
+
|
|
20
|
+
## Core Responsibilities
|
|
21
|
+
|
|
22
|
+
1. **Authentication**: Manage JWT tokens for PayloadCMS API access
|
|
23
|
+
2. **Content Conversion**: Transform markdown to Lexical rich text format
|
|
24
|
+
3. **Publishing**: Create or update documents in PayloadCMS collections
|
|
25
|
+
4. **Status Management**: Handle draft/published workflow states
|
|
26
|
+
5. **Error Recovery**: Provide actionable feedback for publishing issues
|
|
27
|
+
|
|
28
|
+
## Workflow
|
|
29
|
+
|
|
30
|
+
### Step 1: Configuration Validation
|
|
31
|
+
```
|
|
32
|
+
1. Check PayloadCMS credentials in environment or config
|
|
33
|
+
2. Verify required fields:
|
|
34
|
+
- PAYLOAD_URL: API endpoint
|
|
35
|
+
- PAYLOAD_EMAIL: user email
|
|
36
|
+
- PAYLOAD_PASSWORD: user password
|
|
37
|
+
- PAYLOAD_COLLECTION: default collection name (optional)
|
|
38
|
+
3. If missing → prompt user to run /myai-configure payloadcms
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Step 2: Authentication
|
|
42
|
+
```
|
|
43
|
+
1. Call authenticatePayload(url, email, password)
|
|
44
|
+
2. Receive JWT token for API requests
|
|
45
|
+
3. Handle auth errors:
|
|
46
|
+
- Invalid credentials → verify config
|
|
47
|
+
- Network errors → check URL accessibility
|
|
48
|
+
- Server errors → verify PayloadCMS instance health
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 3: Content Processing
|
|
52
|
+
```
|
|
53
|
+
1. Read markdown file with Read tool
|
|
54
|
+
2. Parse frontmatter for metadata:
|
|
55
|
+
- title, description, status, collection, slug
|
|
56
|
+
3. Convert markdown body to Lexical rich text:
|
|
57
|
+
- markdownToLexical(content)
|
|
58
|
+
4. Prepare document payload with metadata + rich text
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Step 4: Publishing
|
|
62
|
+
```
|
|
63
|
+
For NEW documents:
|
|
64
|
+
1. POST to /api/{collection}
|
|
65
|
+
2. Include rich text content + metadata
|
|
66
|
+
3. Set status: 'draft' or 'published'
|
|
67
|
+
4. Return document ID and URL
|
|
68
|
+
|
|
69
|
+
For UPDATES (with --id flag):
|
|
70
|
+
1. PATCH to /api/{collection}/{id}
|
|
71
|
+
2. Update content and metadata
|
|
72
|
+
3. Maintain or change status
|
|
73
|
+
4. Return updated document URL
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 5: Verification
|
|
77
|
+
```
|
|
78
|
+
1. Confirm successful API response (200/201)
|
|
79
|
+
2. Extract document ID and slug
|
|
80
|
+
3. Construct preview/admin URL
|
|
81
|
+
4. Report success with access links
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Usage Examples
|
|
85
|
+
|
|
86
|
+
### Publish as Draft (Default Collection)
|
|
87
|
+
```
|
|
88
|
+
User: "Publish article.md to PayloadCMS as draft"
|
|
89
|
+
|
|
90
|
+
Agent:
|
|
91
|
+
1. Read article.md
|
|
92
|
+
2. Authenticate with PayloadCMS
|
|
93
|
+
3. Convert to Lexical format
|
|
94
|
+
4. POST to /api/posts with status: 'draft'
|
|
95
|
+
5. Report: "Published as draft: {admin_url}"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Publish to Production
|
|
99
|
+
```
|
|
100
|
+
User: "Publish article.md to PayloadCMS collection 'articles' as published"
|
|
101
|
+
|
|
102
|
+
Agent:
|
|
103
|
+
1. Process article.md
|
|
104
|
+
2. Authenticate
|
|
105
|
+
3. Convert markdown to Lexical
|
|
106
|
+
4. POST to /api/articles with status: 'published'
|
|
107
|
+
5. Report: "Published live: {public_url}"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Update Existing Document
|
|
111
|
+
```
|
|
112
|
+
User: "Update PayloadCMS document 67890 with updated-article.md"
|
|
113
|
+
|
|
114
|
+
Agent:
|
|
115
|
+
1. Read updated-article.md
|
|
116
|
+
2. Authenticate
|
|
117
|
+
3. Convert to Lexical
|
|
118
|
+
4. PATCH to /api/{collection}/67890
|
|
119
|
+
5. Report: "Updated document: {admin_url}"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Tool Usage Pattern
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
1. Read(markdown_file) → Extract content
|
|
126
|
+
2. authenticatePayload() → Get JWT token
|
|
127
|
+
3. markdownToLexical() → Convert format
|
|
128
|
+
4. publishToPayload() → Create/update document
|
|
129
|
+
5. Report success with URLs
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Configuration Integration
|
|
133
|
+
|
|
134
|
+
Use `/myai-configure` to set up PayloadCMS credentials before publishing.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: myai-astro-publish
|
|
3
|
+
description: Publish markdown content to Astro site
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Publish markdown content to Astro static site with content collections support and git workflow.
|
|
7
|
+
|
|
8
|
+
Invoke the Astro publishing agent to transform frontmatter, validate schemas, and deploy via git.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/myai-astro-publish "article.md"
|
|
14
|
+
/myai-astro-publish "post.md" --collection blog
|
|
15
|
+
/myai-astro-publish "page.md" --pages
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
- `--collection <name>` - Target content collection (default: blog)
|
|
21
|
+
- `--pages` - Publish to pages directory instead
|
|
22
|
+
- `--project <path>` - Astro project path
|
|
23
|
+
- `--branch <name>` - Git branch (default: main)
|
|
24
|
+
- `--no-push` - Commit but don't push
|
|
25
|
+
- `--dry-run` - Validate without publishing
|
|
26
|
+
|
|
27
|
+
## Prerequisites
|
|
28
|
+
|
|
29
|
+
Astro project with astro.config.mjs and git repository.
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
Publish to content collection:
|
|
34
|
+
```
|
|
35
|
+
/myai-astro-publish "my-article.md" --collection blog
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Publish to pages:
|
|
39
|
+
```
|
|
40
|
+
/myai-astro-publish "about.md" --pages
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Custom project:
|
|
44
|
+
```
|
|
45
|
+
/myai-astro-publish "post.md" --project ~/my-site --branch staging
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Frontmatter Transformation
|
|
49
|
+
|
|
50
|
+
Automatically converts:
|
|
51
|
+
- `date` → `pubDate` (ISO 8601 format)
|
|
52
|
+
- `status: published` → `draft: false`
|
|
53
|
+
- `excerpt` → `description`
|
|
54
|
+
- `image` → `heroImage`
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: myai-docusaurus-publish
|
|
3
|
+
description: Publish markdown content to Docusaurus site
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Publish markdown content to Docusaurus static site generator with automatic git workflow.
|
|
7
|
+
|
|
8
|
+
Invoke the Docusaurus publishing agent to transform content and deploy via git.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/myai-docusaurus-publish "guide.md"
|
|
14
|
+
/myai-docusaurus-publish "post.md" --type blog
|
|
15
|
+
/myai-docusaurus-publish "api.md" --project ./docs-site --branch develop
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
- `--type docs|blog|pages` - Content type (default: docs)
|
|
21
|
+
- `--project <path>` - Docusaurus project path
|
|
22
|
+
- `--branch <name>` - Git branch (default: main)
|
|
23
|
+
- `--no-push` - Commit but don't push
|
|
24
|
+
- `--dry-run` - Validate without publishing
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
Docusaurus project with docusaurus.config.js and git repository.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Publish documentation:
|
|
33
|
+
```
|
|
34
|
+
/myai-docusaurus-publish "getting-started.md"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Publish blog post:
|
|
38
|
+
```
|
|
39
|
+
/myai-docusaurus-publish "my-story.md" --type blog
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Custom project:
|
|
43
|
+
```
|
|
44
|
+
/myai-docusaurus-publish "guide.md" --project ~/my-docs --branch staging
|
|
45
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: myai-mintlify-publish
|
|
3
|
+
description: Publish markdown content to Mintlify documentation
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Publish markdown/MDX content to Mintlify documentation site with automatic navigation updates.
|
|
7
|
+
|
|
8
|
+
Invoke the Mintlify publishing agent to transform content, update mint.json, and deploy via git.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/myai-mintlify-publish "guide.mdx"
|
|
14
|
+
/myai-mintlify-publish "api-ref.md" --nav-section "API Reference"
|
|
15
|
+
/myai-mintlify-publish "tutorial.md" --project ./docs --branch main
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
- `--nav-section <name>` - Add to navigation section
|
|
21
|
+
- `--project <path>` - Mintlify project path
|
|
22
|
+
- `--branch <name>` - Git branch (default: main)
|
|
23
|
+
- `--no-push` - Commit but don't push
|
|
24
|
+
- `--dry-run` - Validate without publishing
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
Mintlify project with mint.json and git repository.
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Basic publish:
|
|
33
|
+
```
|
|
34
|
+
/myai-mintlify-publish "getting-started.mdx"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
With navigation:
|
|
38
|
+
```
|
|
39
|
+
/myai-mintlify-publish "api-users.md" --nav-section "API Reference"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Custom project:
|
|
43
|
+
```
|
|
44
|
+
/myai-mintlify-publish "guide.md" --project ~/docs --branch develop
|
|
45
|
+
```
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: myai-payloadcms-publish
|
|
3
|
+
description: Publish markdown content to PayloadCMS
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Publish markdown content to PayloadCMS headless CMS.
|
|
7
|
+
|
|
8
|
+
Invoke the PayloadCMS publishing agent to convert markdown to Lexical format and publish to your PayloadCMS instance.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
/myai-payloadcms-publish "article.md"
|
|
14
|
+
/myai-payloadcms-publish "article.md" --status published
|
|
15
|
+
/myai-payloadcms-publish "article.md" --collection articles --id 12345
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
- `--status draft|published` - Set publish status (default: draft)
|
|
21
|
+
- `--collection <name>` - Target collection (default: posts)
|
|
22
|
+
- `--id <doc-id>` - Update existing document
|
|
23
|
+
- `--dry-run` - Validate without publishing
|
|
24
|
+
- `--verbose` - Show detailed progress
|
|
25
|
+
|
|
26
|
+
## Prerequisites
|
|
27
|
+
|
|
28
|
+
Configure PayloadCMS credentials: `/myai-configure`
|
|
29
|
+
|
|
30
|
+
## Examples
|
|
31
|
+
|
|
32
|
+
Publish as draft:
|
|
33
|
+
```
|
|
34
|
+
/myai-payloadcms-publish "my-article.md"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Publish to production:
|
|
38
|
+
```
|
|
39
|
+
/myai-payloadcms-publish "article.md" --status published --collection blog-posts
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Update existing:
|
|
43
|
+
```
|
|
44
|
+
/myai-payloadcms-publish "updated.md" --id 67890
|
|
45
|
+
```
|