NeuronWriter → WordPress Content Pipeline

Status: Draft for review
Last updated: 2026-07-28
Repo: rahul-10xers/ClaudeCode2.0 (source of truth for all scripts & guides)


Table of Contents

  1. The Big Picture — Mermaid Flow
  2. What You Do vs What I Do
  3. The 4 Page Types
  4. How ACF Field Injection Works
  5. NW API vs NW MCP — What Each Unlocks
  6. The Complete Pipeline — Step by Step
  7. Credentials & Auth
  8. Open Questions for You

1. The Big Picture — Mermaid Flow

flowchart TB
    subgraph YOU["🔵 You (Human)"]
        A[Pick a keyword & page type] --> B[Create NW query<br/>app.neuronwriter.com<br/>1 analysis credit]
        B --> C[Share query URL/ID]
        C --> D[Upload images to WP<br/>Media Library, share IDs]
    end

    subgraph MCP["🟢 MCP Layer (free API calls)"]
        E[list-projects] --> F[new-query<br/>if not already created]
        F --> G[get-recommendations<br/>poll until ready]
        G --> H[get-competitors-content<br/>read competitor H2/H3]
    end

    subgraph BROWSER["🟡 Browser Layer (one session per article)"]
        I[Open NW query URL] --> J[Step 2: Select competitors]
        J --> K[Step 3: Generate meta title/desc]
        K --> L[Step 4: Open Content Designer Wizard]
        L --> M[Step 5: Paste content brief]
        M --> N[Step 6: Review outline]
        N --> O[Step 7: Extract facts from URLs]
        O --> P[Step 8: Generate article<br/>wait ~120s]
        P --> Q{Score ≥ 70?}
        Q -->|No| R[Step 9: Optimize<br/>Smart Headings → Auto-insert → FAQ]
        R --> Q
        Q -->|Yes| S[Step 10: Plagiarism check<br/>optional]
    end

    subgraph API["🟣 API Layer (direct REST calls)"]
        T[get-editor-content<br/>via MCP or NW API] --> U[Build WP payload<br/>by page type]
        U --> V[POST to WP REST API]
        V --> W[Re-save draft<br/>ACF fields need this]
        W --> X[Update Google Sheet<br/>tracker]
    end

    A --> MCP
    C --> BROWSER
    D --> API
    MCP --> BROWSER
    BROWSER --> API
    X --> Y[✅ Done<br/>Draft ready for review]

2. What You Do vs What I Do

You Do (human-only, cannot be automated)

StepWhy you must do it
Pick a keyword + page typeStrategic decision — comparison, feature, free tool, or blog article?
Create the NW queryCosts 1 of 75 monthly analysis credits. I cannot spend your credits without your approval.
Upload images to WP Media LibraryImages need a human to select/upload. I cannot invent image IDs.
Review the final draftThe pipeline produces a draft — you review and publish.
Decide on new page typesIf we need a new template, you define the ACF fields.

I Do (fully automated)

PhaseWhat happens
MCP callsList projects, create query (if you approve), poll until ready, read recommendations & competitor content
Browser automationDrive the NW Content Designer wizard — select competitors, generate meta, paste brief, generate article, optimize score to ≥70
API callsRead final content from NW, build the correct payload for the page type, POST to WordPress, re-save draft, update Google Sheet
Payload assemblyMap NW’s HTML output to the correct ACF fields for each page type (see section 4)

Hybrid (I do, but you provide input)

StepWhat I need from you
Content brief tokensFeature name, what it does, target persona (for feature pages)
Competitor nameFor comparison pages
Article topic + keywordsFor blog articles
WP page IDIf updating an existing page (from sheet col U)

3. The 4 Page Types

ComparisonFree ToolFeatureArticle (Blog)
Templatepage-comparison.phppage-free-tools.phppage-features.phpsingle.php
WP typepagepagepagepost
ACF prefixcomp_*ft_*feat_*Theme meta fields
Category184693
NW content typelanding-pagelanding-pagelanding-pageblog
Competitor typelanding pageslanding pageslanding pagesblog/informational
WP endpointwp/v2/pageswp/v2/pageswp/v2/pagesgr-articles/v1/create
Body contentACF fields onlyACF fields onlyACF fields onlyarticle_sections[] → block HTML
Publisher scriptnw-to-comparison-page.jsnw-to-free-tool-page.js❌ Manual (script TBD)❌ Manual (script TBD)
Content sourceNW article → curated into ACFNW article → auto-parsed by nw-html-to-acf.jsNW article → manually curated into feat_* fieldsNW article → mapped to article_sections[] patterns

4. How ACF Field Injection Works

Comparison Pages (comp_* fields)

The script nw-html-to-comparison-acf.js parses NW’s HTML output:

NW HTML (H1, H2, H3, P, LI, TABLE tags)
    │
    ▼
Regex tokenizer strips tables, lists, empty paragraphs
    │
    ▼
Maps sections by H2 text patterns:
  - "GrowReach vs [X]" → comp_comparison_table rows
  - "Key Features" → comp_guide_sections[]
  - "FAQ" → comp_faq_items[]
  - Any other H2 → comp_guide_sections[]
    │
    ▼
Merged with competitor-file.js data (pricing, features, positioning)
    │
    ▼
Full payload: { title, status, template, page_category, acf: { comp_* } }
    │
    ▼
POST /wp/v2/pages → re-save draft

Key ACF fields:

  • comp_hero_title, comp_hero_desc, comp_hero_badge
  • comp_comparison_table (rows of feature-vs-competitor)
  • comp_guide_sections[] (heading + content pairs)
  • comp_faq_items[] (question + answer)
  • comp_pricing_cards[] (plan name, price, features)
  • comp_cta_text, comp_cta_link

Free Tool Pages (ft_* fields)

The script nw-html-to-acf.js parses NW’s HTML output:

NW HTML (H1, H2, H3, P, LI tags)
    │
    ▼
Regex tokenizer splits by H2 markers
    │
    ▼
Routes by H2 text pattern (CRITICAL — exact phrasing required):
  - "How [Tool] Works" → ft_features_heading + ft_features_cards[]
    (H3s with number emojis 1️⃣2️⃣3️⃣ become cards with icons)
  - "Frequently Asked Questions" → ft_faq_heading + ft_faq_items[]
  - Any other H2 → ft_guide_sections[]
    │
    ▼
Full payload: { title, status, template, page_category, acf: { ft_* } }
    │
    ▼
POST /wp/v2/pages → re-save draft

Key ACF fields:

  • ft_hero_title, ft_hero_desc, ft_hero_badge, ft_hero_stats[]
  • ft_features_heading, ft_features_cards[] (icon, title, desc)
  • ft_guide_sections[] (heading + content)
  • ft_faq_heading, ft_faq_items[]
  • ft_tool_html (the embedded tool iframe)
  • ft_cta_text, ft_cta_link

⚠️ Critical rule: The H2 phrasing “How [Tool] Works” and “Frequently Asked Questions” must be exact — the regex parser depends on these strings. If NW paraphrases, content lands in the wrong ACF field.

Feature Pages (feat_* fields)

No auto-parser exists yet — content is manually curated from NW’s article:

NW article HTML
    │
    ▼
Manual extraction by H2 section labels:
  "HERO SECTION" → feat_hero_title, feat_hero_desc, feat_hero_benefits[]
  "CAPABILITY 1:" → feat_capabilities_list[0] (heading + desc + layout)
  "CAPABILITY 2:" → feat_capabilities_list[1]
  "CAPABILITY 3:" → feat_capabilities_list[2]
  "CAPABILITY 4:" → feat_capabilities_list[3]
  "COMPARISON SECTION:" → feat_comp_engage_* fields
  "RESULTS AND STATS SECTION" → feat_results_stats_items[]
  "USE CASE EXAMPLES SECTION" → feat_keyword_examples_items[]
  "TARGET ROLES SECTION" → feat_roles_items[]
  "FAQ SECTION" → feat_faq_items[]
    │
    ▼
Full payload: { title, slug, status, template, page_category,
    meta: { rank_math_* }, acf: { feat_* } }
    │
    ▼
POST /wp/v2/pages → re-save draft

Key ACF fields:

  • feat_hub_icon, feat_hub_desc, feat_hub_benefitsrequired (without these, Feature Hub shows “Coming Soon”)
  • feat_hero_title, feat_hero_desc, feat_hero_benefits[], feat_hero_btn_text/link, feat_hero_media_type, feat_hero_hero_image
  • feat_capabilities_list[] — 4 items, layouts alternate: left, right, left, right
  • feat_comp_engage_* — comparison table (neg vs pos columns)
  • feat_results_stats_items[] — 4 stat cards with emoji icons
  • feat_keyword_examples_items[] — 4 persona cards (themes: blue/purple/green/orange)
  • feat_roles_items[], feat_faq_items[]
  • feat_show_target: false, feat_show_clone_button: true

Also includes Rank Math SEO in meta object:

  • rank_math_title, rank_math_description, rank_math_focus_keyword, rank_math_canonical_url

Article Pages (Blog Posts) — article_sections[]

Uses a custom endpoint — NOT wp/v2/posts:

NW article HTML
    │
    ▼
Manual mapping to 9 content patterns:
  Each H2 section → one article_sections[] item
    │
    ▼
Full payload: { title, status, categories: [3], featured_media,
    content: "",  ← ALWAYS empty string
    meta: { hero_badge, hero_short_desc, post_highlights_*,
            faq_*, cta_* },
    article_sections: [ ... ] }
    │
    ▼
POST /wp-json/gr-articles/v1/create
    │
    ▼
PHP converter builds post_content from article_sections[]
    │
    ▼
Re-save draft via /wp/v2/posts/<id>

The 9 content patterns for article_sections[]:

#PatternWhen to use
1TEXT ONLYH2 + one paragraph (intro)
2TEXT + H3 SUB-SECTIONSH2 with multiple sub-points
3TEXT + LISTParagraph + bullet list
4TEXT + IMAGEParagraph + full-width image
5TABLE ONLYPure data comparison table
6TABLE + IMAGETable + image
7TEXT + TABLE + IMAGEFull rich-media section
8STEPSNumbered step-by-step
9MULTIPLE IMAGESBefore/after comparison

⚠️ Critical: content: "" must always be empty. The PHP class Article_Section_Blocks::build_rest_payload() converts article_sections[] into WordPress block HTML server-side. Using wp/v2/posts instead of gr-articles/v1/create produces a blank post body.


5. NW API vs NW MCP — What Each Unlocks

NW REST API (existing, via neuronwriter-api.js)

EndpointCostWhat it does
POST /list-projects0List your projects
POST /new-query1 creditCreate a new SERP analysis
POST /get-query0Get analysis data (NLP terms, competitors, questions)
POST /list-queries0List queries with filters
POST /get-content0Get saved editor content (HTML + title + desc)
POST /evaluate-content0Score HTML without saving
POST /import-content0Save HTML to editor (creates revision)

Auth: X-API-KEY: n-cf40ec62b9297baad6e262cded11d808

NW MCP Server (new — https://app.neuronwriter.com/mcp/http)

Same endpoints as the REST API, but accessible via MCP protocol. The MCP adds:

AdvantageWhat it means
OAuth loginNo API key management — login via browser once
get-competitors-contentRead competitor H2/H3 structures — not available in the old REST API
source: "neuron-mcp" filterQueries created via MCP are tagged separately
Standard MCP interfaceAny MCP client (Claude Desktop, Cursor, etc.) can use it

What MCP does NOT replace:

  • ❌ Content Designer wizard (Steps 4-8) — still needs the browser
  • ❌ Smart Headings / Auto-insert / FAQ optimizer (Step 9) — UI-only features
  • ❌ The actual AI article generation — NW’s Content Designer does this

How I’ll Use Both

MCP (free reads)          REST API (writes)          Browser (generation)
    │                          │                          │
    ├─ list-projects           ├─ import-content          ├─ Content Designer wizard
    ├─ new-query (1 credit)    ├─ evaluate-content        ├─ Smart Headings
    ├─ get-recommendations     │                          ├─ Auto-insert terms
    ├─ get-competitors-content │                          ├─ FAQ generation
    ├─ get-editor-content      │                          └─ Score optimization
    └─ get-queries             │
                               │
                    Both hit the same backend:
                    https://app.neuronwriter.com/neuron-api/0.5/writer

6. The Complete Pipeline — Step by Step

Phase 0: Setup (one-time)

  1. Register NW MCP server in Hermes SEO profile
  2. Verify NW API key works (node -e "require('./scripts/lib/neuronwriter-api').listProjects().then(d=>console.log(d[0]?.name))")
  3. Verify WP REST access (curl -w "%{http_code}" https://growreach.app/wp-json/wp/v2/pages?per_page=1 -H "Authorization: Basic ...")

Phase 1: You Start

StepWhoWhat
1YouPick a keyword + decide page type (comparison/feature/free-tool/article)
2YouCreate the NW query at app.neuronwriter.com (costs 1 analysis credit)
3YouShare the query URL/ID with me
4YouUpload any needed images to WP Media Library, share the attachment IDs

Phase 2: MCP Reads (free, no browser)

StepWhoWhat
5MeCall get-recommendations via MCP — poll until status = “ready”
6MeRead NLP terms, target word count, PAA questions, competitor scores
7MeCall get-competitors-content — read competitor H2/H3 structures

Phase 3: Browser — Content Designer Wizard (one session)

StepWhoWhat
8MeOpen NW query URL in browser
9MeLogin check + dismiss driver.js tour
10MeRun state check to determine where to resume
11MeSelect competitors (score > 50, 5-7 minimum)
12MeGenerate meta title & description via NW’s AI
13MeOpen Content Designer Wizard (NEURO chevron → Long-Form Content Designer)
14MePaste content brief (varies by page type)
15MeSet tone = Expert, words = 2000, paste 3-persona template
16MeReview outline, inject TLDR H2 if missing
17MeExtract facts from top 5 competitor URLs (wait ~60s)
18MeGenerate article (wait ~120s)
19MeSave and check score

Phase 4: Browser — Optimize to ≥70

StepWhoWhat
20MeIf score < 70: Smart Headings → add quality-checked H2s
21MeAuto-insert unused terms (up to 2 attempts)
22MeFAQ with Unused Terms (if still < 70)
23MeRe-check score. Target: beat best competitor by a few points.

Phase 5: API — Publish to WordPress

StepWhoWhat
24MeRead final content via MCP get-editor-content
25MeBuild WP payload matching the page type’s ACF structure
26MePOST to correct WP endpoint
27MeRe-save draft (mandatory — ACF fields don’t render without it)
28MeUpdate Google Sheet tracker (one write, cols F-X)

Phase 6: You Review

StepWhoWhat
29YouPreview the draft in WP admin
30YouMake edits or approve for publish

7. Credentials & Auth

WordPress REST API

Endpoint: https://growreach.app/wp-json/
Auth:     Basic (base64 of "claudecode-rahul:AsiN dlhT hPC9 ZC4E k2qM yLVa")

NeuronWriter API

Endpoint: https://app.neuronwriter.com/neuron-api/0.5/writer
Auth:     X-API-KEY: n-cf40ec62b9297baad6e262cded11d808
Project:  growreach.app (ID: 77b8d4a7acd88c2d)
Plan:     Gold (WordPress + GSC + API access)
Credits:  75 analysis/month, 45,000 AI credits/month

NeuronWriter MCP

Server URL: https://app.neuronwriter.com/mcp/http
Auth:       OAuth (login via browser, approve connection)

Google Sheets (Tracker)

Spreadsheet ID: 13q9uw9up_w0oe8M4jyTQX0NBPp2zfqwu43yiIPWbXVw
Auth:           Service account JSON (in CREDENTIALS.md)

8. Open Questions for You

  1. Should I register the NW MCP server in Hermes? This would let me call MCP tools directly instead of using the REST API client.

  2. For feature pages — the publisher script (nw-to-feature-page.js) doesn’t exist yet. Should I build it? It would auto-parse NW’s H2-sectioned output into feat_* ACF fields, similar to how nw-html-to-acf.js works for free tool pages.

  3. For article pages — same situation. Should I build nw-to-article-page.js that maps NW content to the 9 article_sections[] patterns?

  4. Batch mode — do you want a mode where I take a list of keywords + page types and process them one by one without you needing to kick off each one?

  5. Which profile should run this? The SEO profile doesn’t exist yet. Should I create one, or should the default profile handle it?

  6. How do you want to trigger this? Via a kanban task? A cron job? A chat command like “write a feature page for [keyword]”?