myaidev-method 0.2.17 → 0.2.19

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/CHANGELOG.md CHANGED
@@ -5,6 +5,50 @@ All notable changes to the MyAIDev Method package will be documented in this fil
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.19] - 2025-11-19
9
+
10
+ ### Fixed
11
+ - **PayloadCMS Lexical Format**: Critical fixes for proper PayloadCMS Lexical editor compatibility
12
+ - **List Type Bug**: Changed list `type` from `'bullet'/'number'` to `'list'` (spec-compliant)
13
+ - **Inline Formatters**: Implemented markdown formatting support for bold (**text**), italic (*text*), and code (`text`)
14
+ - **Link Support**: Added proper link node generation for markdown links [text](url)
15
+ - **Space Token Filter**: Filter out space tokens to prevent incorrect paragraph generation between lists
16
+ - Format codes follow Lexical specification: Bold=1, Italic=2, Code=16, combinations via bitwise addition
17
+
18
+ ### Changed
19
+ - **Health Check Endpoint**: Updated from `/api` to `/api/posts?limit=1` for better connectivity verification
20
+ - Now verifies both API accessibility AND database connectivity
21
+ - More meaningful health indicator for PayloadCMS instances
22
+
23
+ ### Testing
24
+ - All existing tests pass (Gutenberg converter, installation)
25
+ - Added PayloadCMS Lexical format validation tests
26
+ - Verified list type, inline formatting, and link node generation
27
+
28
+ ### Benefits
29
+ - ✅ Content published to PayloadCMS now displays correctly with proper formatting
30
+ - ✅ Lists render as actual ordered/unordered lists (not as numbered text)
31
+ - ✅ Bold, italic, and code markdown formatters work as expected
32
+ - ✅ Links are properly rendered as clickable hyperlinks
33
+ - ✅ Health checks provide more accurate connectivity status
34
+
35
+ ## [0.2.18] - 2025-11-19
36
+
37
+ ### Changed
38
+ - **Init Command**: Automatic content-rules.md creation and streamlined documentation
39
+ - Creates `content-rules.md` in project root automatically if it doesn't exist
40
+ - Copies from `content-rules.example.md` template during `init --claude`
41
+ - Streamlined documentation: Only copies USER_GUIDE.md, DEV_WORKFLOW_GUIDE.md, PUBLISHING_GUIDE.md
42
+ - Removed redundant docs (MCP_INTEGRATION, COOLIFY_DEPLOYMENT, WORDPRESS_ADMIN_SCRIPTS, TECHNICAL_ARCHITECTURE)
43
+ - Updated CLAUDE.md to document content-rules.md customization
44
+ - Shows helpful message when content-rules.md is created or already exists
45
+
46
+ ### Benefits
47
+ - ✅ Users get content-rules.md automatically without manual copying
48
+ - ✅ Cleaner project directory with only essential documentation
49
+ - ✅ content-rules.md ready to customize immediately after init
50
+ - ✅ Respects existing content-rules.md files (won't overwrite)
51
+
8
52
  ## [0.2.17] - 2025-11-19
9
53
 
10
54
  ### Added
package/bin/cli.js CHANGED
@@ -321,10 +321,16 @@ COOLIFY_API_KEY=your-api-key
321
321
  ## Documentation
322
322
 
323
323
  - **USER_GUIDE.md** - Getting started and customization
324
+ - **DEV_WORKFLOW_GUIDE.md** - SPARC development workflow and best practices
324
325
  - **PUBLISHING_GUIDE.md** - Comprehensive multi-platform publishing guide
325
- - **COOLIFY_DEPLOYMENT.md** - Application deployment guide
326
- - **WORDPRESS_ADMIN_SCRIPTS.md** - WordPress admin utilities
327
- - **TECHNICAL_ARCHITECTURE.md** - Developer and architecture guide
326
+
327
+ ## Content Customization
328
+
329
+ - **content-rules.md** - Customize content generation rules for the content-writer agent
330
+ - Define brand voice, tone, and style preferences
331
+ - Set formatting guidelines and SEO requirements
332
+ - Specify required/optional content elements
333
+ - See the file for comprehensive customization options
328
334
 
329
335
  ## Project Conventions
330
336
 
@@ -476,15 +482,11 @@ This configuration follows Claude Code's official standards for custom commands
476
482
 
477
483
  // Note: MCP integration disabled for now - using native tools for WordPress REST API
478
484
 
479
- // Copy documentation files to project root
485
+ // Copy documentation files to project root (limited to essential guides)
480
486
  const docsToMerge = [
481
487
  'USER_GUIDE.md',
482
488
  'DEV_WORKFLOW_GUIDE.md',
483
- 'MCP_INTEGRATION.md',
484
- 'PUBLISHING_GUIDE.md',
485
- 'COOLIFY_DEPLOYMENT.md',
486
- 'WORDPRESS_ADMIN_SCRIPTS.md',
487
- 'TECHNICAL_ARCHITECTURE.md'
489
+ 'PUBLISHING_GUIDE.md'
488
490
  ];
489
491
 
490
492
  for (const docFile of docsToMerge) {
@@ -494,6 +496,18 @@ This configuration follows Claude Code's official standards for custom commands
494
496
  }
495
497
  }
496
498
 
499
+ // Create content-rules.md if it doesn't already exist
500
+ const contentRulesPath = path.join(projectDir, 'content-rules.md');
501
+ if (!await fs.pathExists(contentRulesPath)) {
502
+ const contentRulesTemplate = path.join(__dirname, '..', 'content-rules.example.md');
503
+ if (await fs.pathExists(contentRulesTemplate)) {
504
+ await fs.copy(contentRulesTemplate, contentRulesPath);
505
+ console.log(chalk.green(' ✓ Created content-rules.md for customizable content generation'));
506
+ }
507
+ } else {
508
+ console.log(chalk.gray(' ℹ content-rules.md already exists, skipping creation'));
509
+ }
510
+
497
511
  // Save installation version for update tracking
498
512
  const pkgJson = await fs.readJson(path.join(__dirname, '..', 'package.json'));
499
513
  const versionFile = path.join(claudeDir, '.myaidev-version');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myaidev-method",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "description": "Comprehensive development framework with SPARC methodology for AI-assisted software development, AI visual content generation (Gemini, Imagen, DALL-E, Veo, FLUX), multi-platform publishing (WordPress, PayloadCMS, Astro, Docusaurus, Mintlify), and Coolify deployment",
5
5
  "mcpName": "io.github.myaione/myaidev-method",
6
6
  "main": "src/index.js",
@@ -144,7 +144,7 @@ export class PayloadCMSUtils {
144
144
 
145
145
  case 'list':
146
146
  return {
147
- type: token.ordered ? 'number' : 'bullet',
147
+ type: 'list',
148
148
  listType: token.ordered ? 'number' : 'bullet',
149
149
  start: token.start || 1,
150
150
  tag: token.ordered ? 'ol' : 'ul',
@@ -213,7 +213,10 @@ export class PayloadCMSUtils {
213
213
  }
214
214
  };
215
215
 
216
- const children = tokens.map(convertToken);
216
+ // Filter out space tokens and convert remaining tokens
217
+ const children = tokens
218
+ .filter(token => token.type !== 'space')
219
+ .map(convertToken);
217
220
 
218
221
  return {
219
222
  root: {
@@ -229,24 +232,147 @@ export class PayloadCMSUtils {
229
232
 
230
233
  /**
231
234
  * Parse inline text with formatting (bold, italic, code, links)
235
+ * Supports markdown formatters and converts to Lexical format codes:
236
+ * - **bold** → format: 1
237
+ * - *italic* → format: 2
238
+ * - `code` → format: 16
239
+ * - ***bold+italic*** → format: 3
232
240
  */
233
241
  parseInlineText(text) {
234
- // Simple inline parser for bold, italic, code, links
235
242
  const children = [];
236
243
 
237
- // For now, return simple text node
238
- // TODO: Enhance with full inline formatting support
239
- children.push({
244
+ // Strip HTML tags first
245
+ text = text.replace(/<[^>]+>/g, '');
246
+
247
+ // Parse markdown inline formatting using marked's inline lexer
248
+ try {
249
+ const tokens = marked.lexer(text);
250
+
251
+ // Extract inline tokens from paragraph if present
252
+ let inlineTokens = [];
253
+ if (tokens[0]?.type === 'paragraph' && tokens[0].tokens) {
254
+ inlineTokens = tokens[0].tokens;
255
+ } else if (tokens[0]?.tokens) {
256
+ inlineTokens = tokens[0].tokens;
257
+ } else {
258
+ // No inline tokens, return plain text
259
+ return [{
260
+ type: 'text',
261
+ text: text,
262
+ format: 0,
263
+ mode: 'normal',
264
+ style: '',
265
+ detail: 0,
266
+ version: 1
267
+ }];
268
+ }
269
+
270
+ // Convert each inline token to Lexical format
271
+ for (const token of inlineTokens) {
272
+ switch (token.type) {
273
+ case 'text':
274
+ children.push({
275
+ type: 'text',
276
+ text: token.text,
277
+ format: 0,
278
+ mode: 'normal',
279
+ style: '',
280
+ detail: 0,
281
+ version: 1
282
+ });
283
+ break;
284
+
285
+ case 'strong':
286
+ children.push({
287
+ type: 'text',
288
+ text: token.text,
289
+ format: 1, // IS_BOLD
290
+ mode: 'normal',
291
+ style: '',
292
+ detail: 0,
293
+ version: 1
294
+ });
295
+ break;
296
+
297
+ case 'em':
298
+ children.push({
299
+ type: 'text',
300
+ text: token.text,
301
+ format: 2, // IS_ITALIC
302
+ mode: 'normal',
303
+ style: '',
304
+ detail: 0,
305
+ version: 1
306
+ });
307
+ break;
308
+
309
+ case 'codespan':
310
+ children.push({
311
+ type: 'text',
312
+ text: token.text,
313
+ format: 16, // IS_CODE
314
+ mode: 'normal',
315
+ style: '',
316
+ detail: 0,
317
+ version: 1
318
+ });
319
+ break;
320
+
321
+ case 'link':
322
+ children.push({
323
+ type: 'link',
324
+ url: token.href,
325
+ children: [{
326
+ type: 'text',
327
+ text: token.text,
328
+ format: 0,
329
+ mode: 'normal',
330
+ style: '',
331
+ detail: 0,
332
+ version: 1
333
+ }],
334
+ direction: 'ltr',
335
+ format: '',
336
+ indent: 0,
337
+ version: 3
338
+ });
339
+ break;
340
+
341
+ default:
342
+ // Fallback for any unhandled token types
343
+ children.push({
344
+ type: 'text',
345
+ text: token.raw || token.text || '',
346
+ format: 0,
347
+ mode: 'normal',
348
+ style: '',
349
+ detail: 0,
350
+ version: 1
351
+ });
352
+ }
353
+ }
354
+ } catch (error) {
355
+ // If parsing fails, return plain text
356
+ children.push({
357
+ type: 'text',
358
+ text: text,
359
+ format: 0,
360
+ mode: 'normal',
361
+ style: '',
362
+ detail: 0,
363
+ version: 1
364
+ });
365
+ }
366
+
367
+ return children.length > 0 ? children : [{
240
368
  type: 'text',
241
- text: text.replace(/<[^>]+>/g, ''), // Strip HTML tags
369
+ text: text,
242
370
  format: 0,
243
371
  mode: 'normal',
244
372
  style: '',
245
373
  detail: 0,
246
374
  version: 1
247
- });
248
-
249
- return children;
375
+ }];
250
376
  }
251
377
 
252
378
  /**
@@ -372,11 +498,12 @@ export class PayloadCMSUtils {
372
498
  }
373
499
 
374
500
  /**
375
- * Health check
501
+ * Health check - verifies PayloadCMS connectivity and database access
502
+ * Uses /api/posts endpoint to verify both API and database are accessible
376
503
  */
377
504
  async healthCheck() {
378
505
  try {
379
- const response = await fetch(`${this.url}/api`);
506
+ const response = await fetch(`${this.url}/api/posts?limit=1`);
380
507
  return response.ok;
381
508
  } catch (error) {
382
509
  return false;