Skip to content
This repository was archived by the owner on Jun 26, 2026. It is now read-only.

docs(agents): make Build your first Agent a complete, minimal-setup tutorial - #1133

Merged
jainpawan21 merged 5 commits into
mainfrom
cursor/improve-build-your-first-agent-tutorial-15ae
Jun 23, 2026
Merged

docs(agents): make Build your first Agent a complete, minimal-setup tutorial#1133
jainpawan21 merged 5 commits into
mainfrom
cursor/improve-build-your-first-agent-tutorial-15ae

Conversation

@merrcury

@merrcury merrcury commented Jun 22, 2026

Copy link
Copy Markdown
Member

What & why

The Build your first Agent tutorial (/agents/custom-code-agent/build-your-first-agent) had two issues that hurt the docs experience:

  1. It sat after Set up your Agent in the sidebar, even though it's the natural starting tutorial.
  2. It felt half-finished — it jumped straight into "Define the agent shell" while assuming the reader had already created the agent, connected a provider, scaffolded the project, and started the dev server (all of which lived on later pages).

This PR makes it a self-contained, end-to-end tutorial with the minimum setup needed to get going, and links out to the detailed pages for anyone who wants the full walkthrough.

Changes

  • Reordered nav in content/docs/agents/custom-code-agent/meta.json: Build your first Agent now comes before Set up your Agent (Quickstart → Concepts → Build your first Agent → Set up your Agent → Going to Production).
  • Rewrote the intro to be self-contained (no longer assumes a scaffold already exists).
  • Added Before you start prerequisites (Novu account, Node.js, a Slack provider).
  • Added a condensed Set up the project section with three minimal steps — create the agent + connect a provider, scaffold the bridge app, run it locally — each linking to its detailed page rather than duplicating it.
  • Added a Try it out section so the tutorial ends with verifying the bot in Slack and viewing the conversation in the dashboard.
  • Normalized build-step headings (dropped redundant Step N: prefixes; the Steps component auto-numbers).

Testing

  • pnpm lint passes.
  • Dev server renders the page (HTTP 200) and all new sections appear.
  • Verified the sidebar order in the browser: Build your first Agent now sits above Set up your Agent.

Top of page with updated sidebar order, intro, Before you start, and Set up the project
Condensed Set up the project steps
New Try it out section

Note

No Linear ticket reference is included: this environment has no Linear MCP or API access available to create one. Please add a fixes NV-XXX reference if a ticket is required.

Open in Web Open in Cursor 

Summary by CodeRabbit

  • Documentation
    • Restructured agent tutorial with clearer prerequisites and setup instructions
    • Reorganized build steps with more descriptive titles for improved clarity
    • Added "Try it out" section demonstrating the full interaction workflow
    • Improved documentation navigation and page ordering

Greptile Summary

This PR renames build-your-first-agent.mdx to connect-your-first-agent.mdx, rewrites it into a self-contained end-to-end tutorial, reorders the sidebar so it appears before "Set up your Agent", and adds a 308 redirect from the old URL. All cross-references across the docs are updated to the new slug.

  • Content additions: New "Before you start" prerequisites, a condensed three-step "Set up the project" section, and a "Try it out" walkthrough were added to make the tutorial stand alone without assuming prior setup.
  • Nav reorder: meta.json moves connect-your-first-agent above setup-your-agent, placing the tutorial earlier in the learning path.
  • Redirect + link cleanup: src/middleware.ts adds a permanent redirect for the old URL; all card and inline hrefs across 7 other MDX files are updated to the new slug.

Confidence Score: 4/5

Safe to merge after fixing the variable name mismatch in the Step 5 code snippet.

The incremental Step 5 snippet uses const text to capture the lowercased message, but Step 4 already destructures const { text } from generateText in the same function scope. A reader following the tutorial step by step will produce a duplicate const text declaration and hit a SyntaxError. The complete-agent listing at the bottom of the page avoids this with userText, but the intermediate snippet does not, leaving the step-by-step path broken. All other changes — the redirect, nav reordering, and link updates — are straightforward and correct.

content/docs/agents/custom-code-agent/connect-your-first-agent.mdx — Step 5 code snippet uses a conflicting variable name.

Important Files Changed

Filename Overview
content/docs/agents/custom-code-agent/connect-your-first-agent.mdx Main tutorial page renamed from build-your-first-agent; extensive new content added (prerequisites, setup steps, Try it out). One variable naming inconsistency between Step 5 snippet and the complete-agent listing causes a SyntaxError for readers following incrementally.
content/docs/agents/custom-code-agent/meta.json Navigation order updated: connect-your-first-agent moved before setup-your-agent and build-your-first-agent entry removed.
src/middleware.ts 308 redirect added from old build-your-first-agent URL to new connect-your-first-agent URL; consistent with existing redirect pattern.
content/docs/agents/custom-code-agent/setup-your-agent/reply.mdx Inline text reference and card href updated from build-your-first-agent to connect-your-first-agent.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["/agents/custom-code-agent/build-your-first-agent"] -->|308 redirect| B["/agents/custom-code-agent/connect-your-first-agent"]
    B --> C[Before you start]
    C --> D[Set up the project]
    D --> D1[Create agent + connect Slack]
    D --> D2[Scaffold bridge app]
    D --> D3[Run locally with dev:novu]
    B --> E[Build the agent]
    E --> E1[Define agent shell]
    E --> E2[Handle first message]
    E --> E3[Use metadata for context]
    E --> E4[Answer follow-ups with LLM]
    E --> E5[Resolve the conversation]
    B --> F[Try it out]
    F --> G[View conversation in dashboard]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["/agents/custom-code-agent/build-your-first-agent"] -->|308 redirect| B["/agents/custom-code-agent/connect-your-first-agent"]
    B --> C[Before you start]
    C --> D[Set up the project]
    D --> D1[Create agent + connect Slack]
    D --> D2[Scaffold bridge app]
    D --> D3[Run locally with dev:novu]
    B --> E[Build the agent]
    E --> E1[Define agent shell]
    E --> E2[Handle first message]
    E --> E3[Use metadata for context]
    E --> E4[Answer follow-ups with LLM]
    E --> E5[Resolve the conversation]
    B --> F[Try it out]
    F --> G[View conversation in dashboard]
Loading

Comments Outside Diff (1)

  1. content/docs/agents/custom-code-agent/build-your-first-agent.mdx, line 199-205 (link)

    P2 Env var snippet missing file context

    The OPENAI_API_KEY=sk-... block is rendered as a bare bash snippet with no label. In a Next.js project the reader must put this in .env.local — running it as a shell command (export or inline assignment) will work only for the current terminal session and won't be picked up by next dev. Labelling the block title=".env.local" makes the intent unambiguous for beginners who are unfamiliar with how Next.js loads environment variables.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: content/docs/agents/custom-code-agent/build-your-first-agent.mdx
    Line: 199-205
    
    Comment:
    **Env var snippet missing file context**
    
    The `OPENAI_API_KEY=sk-...` block is rendered as a bare `bash` snippet with no label. In a Next.js project the reader must put this in `.env.local` — running it as a shell command (export or inline assignment) will work only for the current terminal session and won't be picked up by `next dev`. Labelling the block `title=".env.local"` makes the intent unambiguous for beginners who are unfamiliar with how Next.js loads environment variables.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    Fix in Cursor

Reviews (2): Last reviewed commit: "Update middleware redirects to include n..." | Re-trigger Greptile

…e it before setup

Co-authored-by: Himanshu Garg <garg_himanshu@outlook.com>
@netlify

netlify Bot commented Jun 22, 2026

Copy link
Copy Markdown

Deploy Preview for docs-novu ready!

Name Link
🔨 Latest commit 942f094
🔍 Latest deploy log https://app.netlify.com/projects/docs-novu/deploys/6a3a8cd87f187900089906ea
😎 Deploy Preview https://deploy-preview-1133--docs-novu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The pull request rewrites the "Build your first Agent" tutorial in build-your-first-agent.mdx. It adds a "Before you start" prerequisites block and a "Set up the project" section with bridge app scaffolding commands and local run instructions. The four agent-building steps are renamed to descriptive titles ("Handle the first message", "Use metadata for context", "Answer follow-ups with an LLM", "Resolve the conversation") with refined code examples covering ctx.conversation.messageCount, onAction/ctx.metadata, Vercel AI SDK generateText with ctx.history, and ctx.resolve(). A "Try it out" end-to-end checklist section is appended. In meta.json, build-your-first-agent is reordered to appear before setup-your-agent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and specifically describes the main change: restructuring the 'Build your first Agent' tutorial into a complete, minimal-setup guide that can stand alone.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@merrcury
merrcury marked this pull request as ready for review June 22, 2026 08:40
@merrcury
merrcury requested a review from jainpawan21 as a code owner June 22, 2026 08:40

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@content/docs/agents/custom-code-agent/build-your-first-agent.mdx`:
- Around line 31-33: The prerequisites list uses hyphen (-) bullet markers, but
the repository's Vale rule requires asterisk (*) for bullet points. Replace all
three hyphen markers in the prerequisites section (the entries about Novu
account, Node.js 18+, and chat provider) with asterisk markers to comply with
the configured style rule.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74cc9d3b-6a6a-443c-b527-eb693279abe2

📥 Commits

Reviewing files that changed from the base of the PR and between bf99f4a and e2bba4e.

📒 Files selected for processing (2)
  • content/docs/agents/custom-code-agent/build-your-first-agent.mdx
  • content/docs/agents/custom-code-agent/meta.json

Comment thread content/docs/agents/custom-code-agent/connect-your-first-agent.mdx
Comment thread content/docs/agents/custom-code-agent/connect-your-first-agent.mdx
@jainpawan21

Copy link
Copy Markdown
Member

@merrcury

Looks good to me, you can update the name "Pipelinr" also

@merrcury

Copy link
Copy Markdown
Member Author

@merrcury

Looks good to me, you can update the name "Pipelinr" also

Sure Pawan, I will change that also

@jainpawan21
jainpawan21 merged commit 2a4a0d0 into main Jun 23, 2026
3 of 4 checks passed
@jainpawan21
jainpawan21 deleted the cursor/improve-build-your-first-agent-tutorial-15ae branch June 23, 2026 13:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants