Skip to content

Contribution Studio — POC Architecture & Developer Guide

Every river needs a voice. This document outlines the Proof of Concept (POC) for Contribution Studio — an AI-assisted article creation platform that empowers anyone working toward river conservation to generate rich, beautifully structured articles and share them with thousands on Nadikosh


Contribution Studio is an AI-assisted article creation tool built inside the Nadikosh Astro + Starlight wiki at the route /contribute. It allows any contributor — regardless of technical background — to write structured, component-rich MDX articles for the Nadikosh river knowledge base.

It is a platform where field workers, researchers, historians, students, activists, and community leaders can have a structured conversation with AI about problems they’re witnessing or researching related to rivers — then generate a complete, publication-ready article series.

Check out the demo

The target contributor is NOT a developer. They could be:

  • A ground worker who has seen illegal sand mining damage a riverbed
  • A researcher who wants to document the lack of testing equipment in India
  • A professor wanting to educate people about river water quality
  • A historian or saint writing about the sacred history of a river
  • A local activist documenting river-related policies and violations
  • A fisherman or boat worker recording how river changes affect their livelihood
  • An Ayurveda practitioner connecting river health to human health
  • A photographer or videographer documenting visual evidence of pollution
  • A student working on an environmental dissertation
  • A panchayat member or government official reporting governance issues
  • A diaspora Indian documenting their ancestral river’s history

The Studio removes all technical friction. A contributor types an idea, the AI drafts a full article with components and image prompts, the contributor edits it in a friendly editor, and downloads a ready-to-publish .mdx file.

Imagine a ground worker in the Yamuna basin discovers illegal sand mining damaging river beds. They come to Nadikosh, describe the problem in plain language, and within minutes get:

  • ✅ A 5–10 article series on sand mining impacts
  • ✅ Inline suggestions for interactive charts showing mining trends
  • ✅ Image prompts ready for visualization
  • ✅ Component recommendations (data comparison, before/after sliders, educational quizzes)
  • ✅ A clean, publication-ready MDX file they can share

All without having great writng skill, writing code or understanding components.

View sample AI generated article

Current State: High Barriers to Knowledge Sharing

Section titled “Current State: High Barriers to Knowledge Sharing”

Who wants to write about rivers but faces friction?

AudienceTheir ChallengeImpact
🏗️ Ground WorkersLack writing skills, time to structure contentRiver issues stay local, undocumented
🔬 ResearchersUnsure how to translate technical findings into accessible storiesResearch impact limited to academic circles
👨‍🏫 ProfessorsWant to teach river science but materials are scattered or outdatedStudents use fragmented sources
📜 Historians & SaintsSacred knowledge about rivers isn’t digitized or organizedCultural knowledge at risk of loss
👨‍💼 Policy AdvocatesWant to publish policy analysis but lack visual/interactive toolsArguments stay text-heavy, harder to engage readers
👨‍🎓 StudentsWorking on environmental projects but need platforms to publish findingsWork disappears after semester ends
📸 Photographers & VideographersHave powerful visual evidence of pollution but no narrative structureImages lack context, message doesn’t stick
🎯 Diaspora IndiansEmotionally connected to ancestral rivers but don’t know where to startGlobal perspective on Indian rivers stays untapped

LayerTechnologyNotes
FrameworkAstro SSR (existing Nadikosh)Needs SSR adapter: @astrojs/node or @astrojs/vercel
IslandReact client:loadContribution Studio is one large React island
Rich Text EditorTipTapWriter-friendly, supports custom nodes for components
AI APIAnthropic Claude APIVia Astro API route /api/generate-article
Component Props UICustom form builderLabeled fields — no raw JSON exposed to user
AnimationsMotion for React (motion)npm install motion, import from motion/react
StylingExisting Nadikosh theme (Flexoki)Starlight + starlight-theme-flexoki
Publishing (POC)Download .mdx fileUser manually adds to Git repo
Publishing (Stretch)GitHub PR botAuto-creates PR with MDX file
CMS Eval (Parallel POC)KeyStatic / DecapCMS / PageCMSSeparate investigation track

Design of landing page of Contribution Studio

  • Process 1 (Auto Generate) → Claude AI writes article from idea
  • Process 2 (Manual) → User writes manually in editor

Think of the Contribution Studio landing page like the Google homepage: deliberately minimal, but hiding enormous power behind that simplicity.


Process 1 — “AI-Guided Writing” (The Main Path)

Section titled “Process 1 — “AI-Guided Writing” (The Main Path)”

Who it’s for: Anyone with a raw thought — a ground worker who saw illegal sand mining, a saint who wants to document sacred river texts, a student with a pollution report idea.

Flow:

  1. User lands on the page and sees the prompt: “What do we want to write about today?”
  2. They type their raw idea in natural language — no structure needed
  3. They hit “Generate My Article”
  4. Claude API receives the idea bundled with your full instruction context (component list, article guide, Nadikosh sections)
  5. The MDX editor opens with a fully drafted article — headings, paragraphs, inline image prompt callouts, and component suggestion cards already placed inside the text
  6. User reviews, edits text, swaps components via the form panel, refines image prompts
  7. Hits “Download MDX” → gets a ready .mdx file or Publish -> Auto publishes the article on our NadiKosh

The key experience: The writer never sees raw MDX code. They see a living document with friendly callout blocks where images and components will go.


Process 2 — “Write It Yourself” (The Manual Path)

Section titled “Process 2 — “Write It Yourself” (The Manual Path)”

Who it’s for: An expert researcher, professor, or historian who already knows exactly what they want to say and just needs a structured, power-assisted editor to write it in.

Flow:

  1. User clicks “I’ll Write It Myself →” (see button text below)
  2. A section selector appears — “Which part of Nadikosh are you writing for?” (River Science / Sacred Rivers / Field Reports / Policies / Tech & Tools)
  3. The MDX editor opens empty but section-aware — the toolbar and component suggestions are pre-filtered for the chosen section
  4. Writer types freely, inserts components from the panel when needed, adds image prompt callouts manually
  5. Hits “Download MDX” → same output as Process 1

The key experience: Full creative control, but with smart guardrails — the right components are already surfaced, the right Nadikosh frontmatter is pre-filled, nothing is locked.


This is the most important component of the entire POC. Both processes converge here.

Design of landing page of Contribution Studio

Component Insertion

  • Clicking “Insert Component” opens a slide-in panel
  • Contributor picks from the Nadikosh component library (20 components: Quiz, Charts, Maps, Sliders, etc.)
  • A form-based prop editor (labeled fields, NO raw JSON) appears for the selected component
  • On confirm, a visual component card is inserted into the editor at cursor position
  • Raw MDX spec block is hidden from the writer but included in the exported MDX

Image Prompt Callouts

  • Displayed as styled orange/yellow callout blocks in the editor
  • NOT shown as raw text — they look like a hint card
  • One-click copy button on each prompt
  • Tooltip: “Paste this into Gemini or DALL-E to generate your image. Full version will have built-in image editor.”

MDX Export

  • “Download MDX” button generates a complete .mdx file with:
    • Correct Astro + Starlight frontmatter
    • Prose content
    • Component spec blocks (as per article_generation_guide.md format)
    • Image prompt comments
    • Series metadata (if linked)

  • Left pane: TipTap writer-friendly editor (no raw code visible)
  • Right pane: Live MDX preview
  • Image prompts displayed as styled callouts (copy-to-Gemini buttons)
  • Component panel: Form-based interface to insert and edit components
  • Master system prompt (3 layers, ~7000–9000 chars)
  • API route: /api/generate-article
  • Input: User idea + selected article type
  • Output: Complete MDX string with component slots + metadata
  • Dropdown to select component type (Quiz, BarChart, ZoneMap, etc.)
  • Form fields for each prop (labeled, no raw JSON)
  • Preview of component before insertion
  • Edit existing components inline
  • Bare minimum: Download .mdx file button
  • Stretch: GitHub PR bot OR KeyStatic/DecapCMS integration

What must work for MVP success:

  • /contribute page in Nadikosh (Astro SSR, client:load island)
  • Landing UI: textbox + “Manual Writing” button
  • Process 1: Idea submission → Claude API → MDX in editor
  • Process 2: Manual mode opens empty editor with section selector
  • Hybrid Editor: TipTap left, plain text preview right
  • Image prompts render as styled callouts
  • Component picker with 3 sample components (Quiz, BarChart, ZoneMap)
  • Form-based prop editors (no raw JSON visible)
  • Component insertion creates visual cards in editor
  • Download .mdx file with valid frontmatter and component specs
  • All 5 persona types tested with Claude

Elevates MVP into a demo-ready product:

  • Master system prompt fully optimized (all files condensed + tested)
  • All 20 components have form-based editors
  • Live preview actually renders Astro components (iframe sandbox)
  • Image prompts copyable with one-click (Gemini, Midjourney tooltips)
  • Contributor persona selector (adjusts Claude tone/structure)
  • Article section selector (feeds context to Claude)
  • Series linking UI (connect articles to existing series in Nadikosh)
  • GitHub PR bot (submit MDX directly)
  • CMS POC evaluation (KeyStatic vs. DecapCMS vs. DecapCMS)
  • Mobile-friendly editor layout
  • User accounts + saved drafts (optional)

Endpoint: POST /api/generate-article

// Request
{
userIdea: string; // "Sand mining damaging Yamuna beds"
articleType: string; // "investigative" | "educational" | "policy" | "sacred"
personaType: string; // "ground_worker" | "researcher" | "historian"
sectionId?: string; // "pollution" | "conservation" | "culture"
}
// Response
{
mdxContent: string; // Full MDX with component slots
imagePrompts: string[]; // ["Satellite view of sand mining...", ...]
suggestedComponents: { // [{ id: "quiz", title: "Quiz", props: {...} }, ...]
id: string;
title: string;
props: Record<string, unknown>;
}[];
metadata: {
wordCount: number;
estimatedReadTime: number;
articleStructure: string[];
};
}

Claude API call strategy:

  • Send master system prompt (always)
  • Send only relevant file sections based on articleType
  • Limit context to ~9000 chars total
  • Stream response for real-time UI updates

Claude API — Context Optimization Strategy

Section titled “Claude API — Context Optimization Strategy”

A sample on how to use claude API:

~2000 chars — core identity + output format rules

You are an AI article generation assistant for Nadikosh, a collaborative river knowledge base.
Your role: Convert user ideas about river problems into rich, publication-ready MDX articles.
Output format:
- Markdown with embedded component slots
- Format: [Insert React Component Here]
- Followed by component spec block with JSON props
- Image prompts as callout blocks: #Image prompt: "..."
Never hardcode data. Always generate flexible, reusable components.

~3000 chars — condensed checklist + specs

## Available Components
[interactive-1] Quiz: Multiple choice knowledge checks
[interactive-2] ProgressiveReveal: Step-by-step story revealing
[infographic-1] LineChart: Trend visualization
[infographic-2] BarChart: Category breakdown
[multimedia-1] ZoneMap: Geographic data
[multimedia-2] ImageSlider: Before/after comparison
[Component specs available on request — provide exact JSON schema]

~2000–4000 chars — only if article type requires it

  • If data-heavy → send nivo-infographic.md (condensed)
  • If geography → send multimedia.md (condensed)
  • If interactive → send interactive-components.md (condensed)
  • If river pollution → send article_generation_guide.md (condensed)

Total per call: ~7000–9000 chars


Possible Additional POCs (Parallel Tracks)

Section titled “Possible Additional POCs (Parallel Tracks)”

As you build Contribution Studio, consider these related POCs:

Problem: How do we publish user-generated MDX to Nadikosh without manual merges?

Options:

  • GitHub PR Bot — User clicks “Publish” → bot creates PR with MDX file
  • KeyStatic — Headless CMS integrated with Astro + Git
  • DecapCMS — Open-source CMS with Git backend

Deliverable: Test one option end-to-end with a real article.

User writes article → Clicks "Publish" → PR auto-created → Maintainer reviews → Merged to main → Live on Nadikosh

Problem: Storing component JSON in Git bloats the repo; harder to query/reuse components.

Solution: Decouple component data from articles.

// Store in MongoDB
db.articles.insertOne({
slug: "sand-mining-yamuna",
title: "...",
content: "MDX with [component-ref: quiz-yamuna-v1]",
componentRefs: ["quiz-yamuna-v1"], // Links to external data
});
db.components.insertOne({
_id: "quiz-yamuna-v1",
type: "interactive-1",
props: {
/* large JSON */
},
});
// Articles stay lightweight; components fetched on-demand

Deliverable: Schema design + one working example.

Problem: We suggest image prompts, but users copy-paste to Gemini manually.

Solution: Integrate Gemini API directly into editor.

User clicks "Generate Image"
→ Sends prompt to Gemini API
→ Returns 4 options
→ User selects one
→ Inserts image reference into MDX

Deliverable: Gemini API integration in editor (if free tier available) OR mock UI showing what it would look like.

Problem: MVP generates single articles; user wants 5–10 article series.

Solution: Recursive AI workflow — generate outline → generate each article → link articles.

User: "I want to write about how climate change impacts monsoon patterns"
Claude generates: 5-article series outline
For each article:
- Generate MDX
- Suggest components
- Generate image prompts
Link all articles with prev/next navigation

Deliverable: Outline generation + proof that recursion doesn’t explode Claude costs.

Problem: How do we know if Contribution Studio is working? Who’s using it?

Solution: Simple analytics dashboard.

- Total articles generated
- By persona type (researcher, activist, etc.)
- Topics covered
- Component usage stats
- Time to publish (draft → published)

Deliverable: Basic analytics UI + database schema.


Sprint 1:

  1. Create /contribute route in Nadikosh
  2. Build landing UI (textbox + button)
  3. TipTap editor integration (left pane)

Sprint 2: 4. Right pane preview (live MDX render) 5. Component picker panel UI 6. Form-based prop editors

Sprint 3: 7. Mobile-responsive layout 8. Editor state management (Redux/Zustand)

Sprint 1:

  1. Set up Astro SSR adapter (if not done)
  2. Create /api/generate-article route
  3. Anthropic API integration (basic call)

Sprint 2: 4. Master system prompt design + testing 5. Error handling & rate limiting 6. Streaming responses for real-time UI

Sprint 3: 7. GitHub PR bot integration (optional) 8. CMS evaluation + integration

Sprint 1:

  1. Condense all 11 instruction files into 3-layer master prompt
  2. Test with 5 persona types
  3. Tune output format for clean MDX

Sprint 2: 4. Build component suggestion logic (when to recommend which components) 5. Image prompt generation quality refinement 6. Error recovery (if Claude response is malformed)

Sprint 3: 7. Test across 8+ user types 8. Optimize for different article types (investigative vs. educational)

Sprint 2–3:

  1. Design MongoDB schema (component templates vs. user components)
  2. Build API layer for component queries
  3. Migration strategy (Git → MongoDB for existing articles)

Ongoing:

  1. Write POC setup guide
  2. Test with real contributors (ground workers, researchers, students)
  3. Gather feedback
  4. Document what works / what doesn’t

This is an open, collaborative POC. You don’t need permission to start. Here’s how:

Choose from:

  • Full features — Build an entire component (2–4 weeks)
  • Partial features — Build one aspect (1–2 weeks)
  • Documentation — Write guides, share learnings (3–5 days)
  • Bug fixes — Find and fix issues (1–3 days)
  • Optimization — Improve existing code (1–2 weeks)

Write a short post / comment about:

  • Challenges you faced
  • Solutions you found
  • Architectural decisions
  • What you’d do differently

  • ❌ Not a multi-user platform (no auth in bare minimum POC)
  • ❌ Not a full CMS (file download only in bare minimum)
  • ❌ Not integrated with Nadikosh article series recursively (single article only)
  • ❌ No built-in image generation (image prompts only, user uses Gemini externally)
  • ❌ No real-time collaboration

  • Framework: Astro (SSR) + React (client:load island)
  • Editor: TipTap (rich text, extensible)
  • Preview: Plain text or iframe-sandboxed Astro component
  • State: Zustand or Redux (your choice)
  • Styling: Tailwind CSS (match Nadikosh theme)
  • Build: Vite (Astro default)

Q: Do I need to know Claude API?
A: No. If you’re frontend-focused, do UI. If you’re backend-focused, we have an AI engineer guiding the prompt strategy.

Q: Can I work on just one component?
A: Absolutely. Pick one component type (e.g., “Form-based editor for the Quiz component”) and own it.

Q: What if I can only contribute few hours?
A: Perfect. Write documentation, create example components, or fix one bug. Every contribution counts.

Q: Can I work on the Git CMS or MongoDB POC instead?
A: Yes! Those are equally valuable. Pick whichever interests you.