suparank 1.2.2 → 1.2.3

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 (2) hide show
  1. package/mcp-client.js +63 -11
  2. package/package.json +1 -1
package/mcp-client.js CHANGED
@@ -1368,6 +1368,21 @@ function buildWorkflowPlan(request, count, publishTo, withImages, project) {
1368
1368
 
1369
1369
  // Extract all settings from project.config (database schema)
1370
1370
  const targetWordCount = config.content?.default_word_count
1371
+
1372
+ // LOG ALL CONFIG VALUES FOR DEBUGGING
1373
+ log('=== PROJECT CONFIG VALUES ===')
1374
+ log(`Word Count Target: ${targetWordCount}`)
1375
+ log(`Reading Level: ${config.content?.reading_level}`)
1376
+ log(`Brand Voice: ${config.brand?.voice}`)
1377
+ log(`Target Audience: ${config.brand?.target_audience}`)
1378
+ log(`Primary Keywords: ${config.seo?.primary_keywords?.join(', ')}`)
1379
+ log(`Include Images: ${config.content?.include_images}`)
1380
+ log('=============================')
1381
+
1382
+ // CRITICAL: Validate word count is set
1383
+ if (!targetWordCount || targetWordCount < 100) {
1384
+ log(`WARNING: Word count not properly set! Got: ${targetWordCount}`)
1385
+ }
1371
1386
  const readingLevel = config.content?.reading_level
1372
1387
  const includeImages = config.content?.include_images
1373
1388
  const brandVoice = config.brand?.voice
@@ -1573,27 +1588,40 @@ Use format: [IMAGE: description of what image should show]` : '**Note:** Images
1573
1588
  action: 'content_write',
1574
1589
  instruction: `Write the COMPLETE article following your outline.
1575
1590
 
1576
- **⚠️ CRITICAL REQUIREMENTS (from project database):**
1577
- - Word count: **${targetWordCount} words MINIMUM** - Count your words!
1578
- - Reading level: **${readingLevelDisplay}** - Simple sentences, short paragraphs, no jargon
1591
+ ╔══════════════════════════════════════════════════════════════════╗
1592
+ ║ 🚨 MANDATORY WORD COUNT: ${targetWordCount} WORDS MINIMUM 🚨 ║
1593
+ ║ This is a strict requirement from the project settings. ║
1594
+ ║ The article will be REJECTED if under ${targetWordCount} words. ║
1595
+ ╚══════════════════════════════════════════════════════════════════╝
1596
+
1597
+ **Project Requirements (from Supabase database - DO NOT IGNORE):**
1598
+ - Word count: **${targetWordCount} words** (MINIMUM - not a suggestion!)
1599
+ - Reading level: **${readingLevelDisplay}** - Simple sentences, short paragraphs
1579
1600
  - Brand voice: ${brandVoice}
1580
1601
  - Target audience: ${targetAudience || 'General readers'}
1581
1602
 
1603
+ **To reach ${targetWordCount} words, you MUST:**
1604
+ - Write 8-10 substantial H2 sections (each 200-400 words)
1605
+ - Include detailed examples, statistics, and actionable advice
1606
+ - Add comprehensive FAQ section (5-8 questions)
1607
+ - Expand each point with thorough explanations
1608
+
1582
1609
  **Content Structure:**
1583
1610
  - Engaging hook in first 2 sentences
1584
- - All H2/H3 sections from your outline
1585
- - Statistics, examples, and actionable tips in each section
1611
+ - All H2/H3 sections from your outline (expand each thoroughly!)
1612
+ - Statistics, examples, and actionable tips in EVERY section
1586
1613
  ${shouldGenerateImages ? '- Image placeholders: [IMAGE: description] where images should go' : ''}
1587
- - FAQ section with 4-5 Q&As
1614
+ - FAQ section with 5-8 Q&As (detailed answers, not one-liners)
1588
1615
  - Strong conclusion with clear CTA
1589
1616
 
1590
- **After writing, call 'save_content' with:**
1617
+ **After writing ${targetWordCount}+ words, call 'save_content' with:**
1591
1618
  - title: Your SEO-optimized title
1592
1619
  - content: The full article (markdown)
1593
1620
  - keywords: Array of target keywords
1594
1621
  - meta_description: Your 150-160 char meta description
1595
1622
 
1596
- ⚠️ DO NOT proceed until you've written ${targetWordCount}+ words!`,
1623
+ STOP! Before calling save_content, verify you have ${targetWordCount}+ words.
1624
+ Count the words. If under ${targetWordCount}, ADD MORE CONTENT.`,
1597
1625
  store: 'article'
1598
1626
  })
1599
1627
 
@@ -1804,6 +1832,13 @@ async function executeOrchestratorTool(toolName, args, project) {
1804
1832
 
1805
1833
  let response = `# 🚀 Content Creation Workflow Started
1806
1834
 
1835
+ ╔══════════════════════════════════════════════════════════════════════════════╗
1836
+ ║ 📊 PROJECT REQUIREMENTS (from Supabase database) ║
1837
+ ║ Word Count: ${String(plan.settings.target_word_count).padEnd(6)} words (MINIMUM - strictly enforced!) ║
1838
+ ║ Brand Voice: ${String(plan.settings.brand_voice || 'Not set').substring(0, 50).padEnd(50)} ║
1839
+ ║ Target Audience: ${String(plan.settings.target_audience || 'Not set').substring(0, 45).padEnd(45)} ║
1840
+ ╚══════════════════════════════════════════════════════════════════════════════╝
1841
+
1807
1842
  ## Your Request
1808
1843
  "${plan.request}"
1809
1844
 
@@ -1811,7 +1846,7 @@ async function executeOrchestratorTool(toolName, args, project) {
1811
1846
  - **URL:** ${plan.project_info.url}
1812
1847
  - **Niche:** ${plan.project_info.niche}
1813
1848
 
1814
- ## Content Settings (from database)
1849
+ ## Content Settings (from database - DO NOT USE DEFAULTS)
1815
1850
  | Setting | Value |
1816
1851
  |---------|-------|
1817
1852
  | **Word Count** | ${plan.settings.target_word_count} words |
@@ -1907,7 +1942,12 @@ ${plan.steps[0].instruction}
1907
1942
 
1908
1943
  const workflow = sessionState.currentWorkflow
1909
1944
  const targetWordCount = workflow?.settings?.target_word_count
1910
- const wordCountOk = targetWordCount ? wordCount >= targetWordCount * 0.9 : true // Allow 10% tolerance
1945
+ // Only 5% tolerance - 2500 word target means minimum 2375 words
1946
+ const wordCountOk = targetWordCount ? wordCount >= targetWordCount * 0.95 : true
1947
+ const shortfall = targetWordCount ? targetWordCount - wordCount : 0
1948
+
1949
+ // Log word count check
1950
+ log(`Word count check: ${wordCount} words (target: ${targetWordCount}, ok: ${wordCountOk})`)
1911
1951
 
1912
1952
  // Find next step
1913
1953
  const imageStep = workflow?.steps?.find(s => s.action === 'generate_images')
@@ -1954,7 +1994,19 @@ Use \`publish_content\` to publish all unpublished articles, or \`get_session\`
1954
1994
  **Keywords:** ${keywords.join(', ') || 'none specified'}
1955
1995
  **Images:** ${newArticle.imageUrl ? '1 cover' : 'no cover'}${newArticle.inlineImages.length > 0 ? ` + ${newArticle.inlineImages.length} inline` : ''}
1956
1996
 
1957
- ${targetWordCount && !wordCountOk ? `⚠️ **Warning:** Article is ${targetWordCount - wordCount} words short of the ${targetWordCount} word target.\n` : ''}
1997
+ ${targetWordCount && !wordCountOk ? `
1998
+ ╔══════════════════════════════════════════════════════════════════════════╗
1999
+ ║ ⛔ WORD COUNT NOT MET - ${shortfall} WORDS SHORT! ║
2000
+ ║ Target: ${targetWordCount} words | Actual: ${wordCount} words ║
2001
+ ║ ║
2002
+ ║ The article does not meet the project's word count requirement. ║
2003
+ ║ Please EXPAND the content before publishing: ║
2004
+ ║ - Add more detailed explanations to each section ║
2005
+ ║ - Include additional examples and statistics ║
2006
+ ║ - Expand the FAQ section with more questions ║
2007
+ ║ - Add more H2 sections if needed ║
2008
+ ╚══════════════════════════════════════════════════════════════════════════╝
2009
+ ` : ''}
1958
2010
  ${!meta_description ? '⚠️ **Warning:** Meta description is missing. Add it for better SEO.\n' : ''}
1959
2011
  ${articlesListSection}${categoriesSection}
1960
2012
  ## Next Step${includeImages && imageStep ? ': Generate Images' : ': Ready to Publish or Continue'}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "suparank",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "AI-powered SEO content creation MCP - generate and publish optimized blog posts with Claude, ChatGPT, or Cursor",
5
5
  "main": "mcp-client.js",
6
6
  "type": "module",