Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Aug 27, 2025

Mastra: Add System Prompt example wrapped with Agentuity

Summary

Adds a new Mastra framework example at frameworks/mastra/system-prompt/ that wraps the Mastra "Changing the System Prompt" pattern with Agentuity's interface. The implementation preserves Mastra framework imports (@mastra/core/agent, @ai-sdk/openai) and provides the standard Agentuity wrapper with welcome() function and Agent(req, resp, ctx) handler.

Key files added:

  • Complete project structure following existing Mastra examples
  • Agent implementation in src/agents/mastra-system-prompt/index.ts
  • Standard Agentuity configuration files (agentuity.yaml, package.json, etc.)

Review & Testing Checklist for Human

Risk Level: Yellow - 2 items to verify

  • Verify original Mastra behavior: Check that this actually implements the "changing system prompt" pattern from https://mastra.ai/en/examples/agents/system-prompt. The current implementation has hardcoded empty systemMessage and may not demonstrate dynamic system prompt changes as intended.
  • Test agent functionality end-to-end: Deploy locally with agentuity dev and test the character-based prompts ("Speak like Harry Potter") to ensure the Mastra Agent API calls work correctly and produce expected character responses.

Recommended Test Plan

  1. Run agentuity dev in the new directory
  2. Test the welcome prompts in the Agentuity console
  3. Verify character-based responses work (Harry Potter/Hermione examples)
  4. Compare behavior with the original Mastra system prompt example

Notes

Summary by CodeRabbit

  • New Features

    • Adds a Mastra-based System Prompt agent integrated into Agentuity with runtime system-prompt support and a welcome experience.
  • Documentation

    • New README describing usage and examples for changing the system prompt.
  • Chores

    • Project config for development, build, and deployment (runtime, bundling, resources), TypeScript setup, package metadata, and .gitignore added.

Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 27, 2025

Walkthrough

Adds a new Mastra System Prompt example under frameworks/mastra/system-prompt: project config, package and tsconfig, runner entrypoint, README, .gitignore, and an agent exposing welcome() plus a default Agentuity handler that integrates Mastra Agent with OpenAI and supports runtime system prompts.

Changes

Cohort / File(s) Summary
Docs
frameworks/mastra/system-prompt/README.md
New README documenting the Mastra System Prompt wrapper, usage, and exposed exports (welcome and default Agent).
Project config & metadata
frameworks/mastra/system-prompt/agentuity.yaml, frameworks/mastra/system-prompt/package.json, frameworks/mastra/system-prompt/tsconfig.json, frameworks/mastra/system-prompt/.gitignore
Adds Agentuity project YAML, package.json with dependencies/scripts, strict tsconfig for ESNext/Bun, and a .gitignore for the new project.
Entrypoint / runner
frameworks/mastra/system-prompt/index.ts
New startup wrapper that validates AGENTUITY env vars, warns about AGENTUITY_URL absence, runs runner(true, import.meta.dirname), and handles startup errors.
Agent implementation
frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
Adds welcome() and default AgentuityAgent(req, resp, ctx). Builds a Mastra Agent (gpt-4o-mini), parses optional leading system: ...\n runtime prompt, calls agent.generate(...), returns generated text, and logs/responds on error.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Client
  participant Runner as Agentuity Runner
  participant Agent as Mastra Agent Handler
  participant Mastra
  participant OpenAI

  Client->>Runner: HTTP request (body text)
  Runner->>Agent: Invoke default Agent(req, resp, ctx)
  Note over Agent: read req.data.text()<br/>detect "system: ...\n" prefix
  Agent->>Mastra: instantiate Mastra Agent (gpt-4o-mini, instructions)
  Agent->>Mastra: generate(userMessage, optionalSystem)
  Mastra->>OpenAI: model completion request
  OpenAI-->>Mastra: completion
  Mastra-->>Agent: result.text
  Agent-->>Runner: resp.text(generatedText)
  Runner-->>Client: HTTP response (text)

  rect rgba(255,235,205,0.35)
  note right of Agent: on error → ctx.logger.error() and return generic error text
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Example #28 — Adds near-identical Agentuity runner entrypoints and agent scaffolds (welcome + default handler).
  • Add sales engineer AGENT-143 #31 — Adds project startup scripts performing the same environment checks and runner invocation.
  • Deep Research Agent #10 — Similar index.ts startup wrapper that validates AGENTUITY env vars and calls runner(true, import.meta.dirname).

Suggested reviewers

  • rblalock
  • nnance

Poem

A hop, a nibble, configs tight and trim,
I polish prompts until they brightly brim.
Mastra hums, Agentuity sings,
I tap the keys—response it brings.
Thump! A carrot-coded cheer from me, the rabbit, free. 🐰✨

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch devin/1756320562-mastra-system-prompt

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai bot requested review from nnance and rblalock August 27, 2025 18:53
…gn dependency versions

Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (4)
frameworks/mastra/system-prompt/package.json (1)

1-11: Confirm Mastra version compatibility; other examples use a newer range.

PR notes mention other examples use @mastra/core ^0.9.4. Aligning reduces API drift.

If compatible, bump:

   "dependencies": {
     "@agentuity/sdk": "workspace:*",
     "@ai-sdk/openai": "^1.0.0",
-    "@mastra/core": "^0.6.0"
+    "@mastra/core": "^0.9.4"
   }

Optionally add engines to document the Node requirement:

   "type": "module",
+  "engines": { "node": ">=18.17" },
frameworks/mastra/system-prompt/README.md (1)

1-7: Add quickstart and env var note.

Include minimal steps (agentuity dev path, OPENAI_API_KEY requirement, sample prompts) so users can run it immediately.

frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (2)

16-20: Add explicit return type to the handler.

Clarifies intent and avoids implicit any/inference drift across SDK upgrades.

-export default async function Agent(
+export default async function Agent(
   req: AgentRequest,
   resp: AgentResponse,
   ctx: AgentContext
-) {
+): Promise<void> {

40-46: Log the error object for stack/context.

Structured logging preserves stack traces in most loggers.

-    ctx.logger.error(
-      'Mastra system-prompt agent error: %s',
-      error instanceof Error ? error.message : String(error)
-    );
+    ctx.logger.error(
+      { err: error },
+      'Mastra system-prompt agent error'
+    );
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 61337c0 and 1e8b98a.

📒 Files selected for processing (6)
  • frameworks/mastra/system-prompt/README.md (1 hunks)
  • frameworks/mastra/system-prompt/agentuity.yaml (1 hunks)
  • frameworks/mastra/system-prompt/index.ts (1 hunks)
  • frameworks/mastra/system-prompt/package.json (1 hunks)
  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (1 hunks)
  • frameworks/mastra/system-prompt/tsconfig.json (1 hunks)
🧰 Additional context used
🧠 Learnings (23)
📚 Learning: 2025-07-17T13:40:37.445Z
Learnt from: CR
PR: agentuity/examples#0
File: agentuity/sdk-js/streaming/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:40:37.445Z
Learning: Applies to agentuity/sdk-js/streaming/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/package.json
📚 Learning: 2025-07-17T13:39:37.133Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:37.133Z
Learning: Applies to agents/composio/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/package.json
📚 Learning: 2025-07-17T13:39:18.709Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/agent-riza/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:18.709Z
Learning: Applies to agents/agent-riza/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/package.json
📚 Learning: 2025-06-23T17:14:39.393Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langgraph/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:14:39.393Z
Learning: In Agentuity AI Agent files (`**/src/agents/**/index.ts`), the default export should be an async function that handles the agent logic, typically accepting parameters `(req: AgentRequest, resp: AgentResponse, ctx: AgentContext)`.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:55.775Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/deep-research-js/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:55.775Z
Learning: Applies to agents/deep-research-js/**/src/agents/**/index.ts : The file should export a default function

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:40:37.445Z
Learnt from: CR
PR: agentuity/examples#0
File: agentuity/sdk-js/streaming/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:40:37.445Z
Learning: Applies to agentuity/sdk-js/streaming/**/src/agents/**/index.ts : The file should export a default function

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:37.133Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:37.133Z
Learning: Applies to agents/composio/**/src/agents/**/index.ts : The file should export a default function

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:15:12.561Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/mastra/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:15:12.561Z
Learning: In Agentuity AI Agent files (`**/src/agents/**/index.ts`), import types such as `AgentRequest`, `AgentResponse`, and `AgentContext` from the `agentuity/sdk` package to ensure type safety and consistency.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:40:37.445Z
Learnt from: CR
PR: agentuity/examples#0
File: agentuity/sdk-js/streaming/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:40:37.445Z
Learning: Applies to agentuity/sdk-js/streaming/**/src/agents/**/index.ts : Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:16:49.315Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/vercel/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:16:49.315Z
Learning: When writing an Agent in TypeScript for Agentuity, always use the types provided by the `agentuity/sdk` package for AgentRequest, AgentResponse, and AgentContext to ensure type safety and compatibility.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:14:46.802Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langgraph/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:14:46.802Z
Learning: The Agentuity JavaScript SDK provides core interfaces such as AgentHandler, AgentRequest, AgentResponse, and AgentContext for building AI agents in TypeScript or JavaScript.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:16:08.480Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai-typescript/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:16:08.480Z
Learning: In the Agentuity JavaScript SDK, the main handler for an agent should implement the AgentHandler type: (request: AgentRequest, response: AgentResponse, context: AgentContext) => Promise<AgentResponseType>.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:15:21.314Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/mastra/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:15:21.314Z
Learning: In the Agentuity JavaScript SDK, the main handler for an agent should implement the AgentHandler type: a function that takes (request: AgentRequest, response: AgentResponse, context: AgentContext) and returns a Promise of AgentResponseType.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:16:33.550Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/pydantic/basic/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:16:33.550Z
Learning: The agentuity.yaml file is a configuration file used by Agentuity to configure the AI Agent project and should not be edited or suggested for edits during code review.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:16:16.519Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:16:16.519Z
Learning: The Agentuity configuration file (agentuity.yaml) is reserved for configuring the AI Agent project and should not be edited or suggested for edits during code review.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:13:52.368Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/crewai/socialagent/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:13:52.368Z
Learning: The 'agentuity.yaml' file is a configuration file used by Agentuity to configure the AI Agent project and should not be edited or suggested for edits.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:14:18.092Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langchain/basic/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:14:18.092Z
Learning: The file 'agentuity.yaml' is used to configure the Agentuity AI Agent project and should not be edited or suggested for edits.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:15:46.735Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/miscellaneous/mem0/mem0demo/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:15:46.735Z
Learning: The Agentuity configuration file (agentuity.yaml) is used to configure the AI Agent project and should not be edited or suggested for edits.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:15:30.804Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/miscellaneous/grokLiveSearch/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:15:30.804Z
Learning: In the context of Agentuity AI projects, the 'agentuity.yaml' file is a configuration file that should not be edited or suggested for edits during code review.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:16:02.063Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai-typescript/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:16:02.063Z
Learning: The Agentuity AI Configuration file (agentuity.yaml) is used to configure the AI Agent project and should not be edited or suggested for edits.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-06-23T17:17:12.992Z
Learnt from: CR
PR: agentuity/examples#0
File: patterns/llmAsJury/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-06-23T17:17:12.992Z
Learning: In the context of Agentuity AI projects, the agentuity.yaml file is a configuration file that should not be edited or suggested for edits during code review.

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-07-17T13:41:01.314Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/agno/from_agno/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-07-17T13:41:01.314Z
Learning: Applies to frameworks/agno/from_agno/**/agentuity.yaml : Do not suggest edits to the Agentuity AI Configuration file (agentuity.yaml)

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
📚 Learning: 2025-07-17T13:41:25.437Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/crewai/basic/.cursor/rules/agentuity.mdc:0-0
Timestamp: 2025-07-17T13:41:25.437Z
Learning: Applies to frameworks/crewai/basic/**/agentuity.yaml : Do not suggest edits to the agentuity.yaml configuration file

Applied to files:

  • frameworks/mastra/system-prompt/agentuity.yaml
🪛 Biome (2.1.2)
frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts

[error] 16-16: Shouldn't redeclare 'Agent'. Consider to delete it or rename it.

'Agent' is defined here:

(lint/suspicious/noRedeclare)

🔇 Additional comments (3)
frameworks/mastra/system-prompt/agentuity.yaml (1)

1-49: Verify bundler.ignore vs. agents.dir interaction

I searched all agentuity.yaml files in the repo and didn’t find any other instances of
bundler.enabled: true combined with agents.dir: src/agents and ignore: src/**.

Please confirm that your bundler’s ignore rules won’t prevent discovery and bundling of the agent files under src/agents. In particular, an ignore pattern of src/** typically excludes everything in src/, which could inadvertently skip the agents directory.

– No edits are being suggested for agentuity.yaml itself per team guidance; just double-check that in your environment the bundler will still include src/agents despite the src/** ignore.

frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (2)

5-14: Welcome copy and prompts look good.

Good UX for quickly exercising style changes.


34-37: Ignore the object-form suggestion for generate — the current core API always uses positional arguments

The Agent.generate method in all @mastra/core releases (including 0.6.x and 0.9.x) has the signature

generate(
  messages: string | string[] | Message[],
  options?: GenerateOptions
): Promise<GenerateResponse>

There was never a generate({ input, system }) overload. Your existing call

await agent.generate(
  userText,
  systemMessage ? { system: systemMessage } : undefined
);

correctly uses the two positional parameters (though note that options.system is not a recognized setting in GenerateOptions). If you meant to send a system prompt, include it as the first message in the messages argument:

- await agent.generate(userText, { /* … */ });
+ await agent.generate([
+   { role: "system",  content: systemMessage },
+   { role: "user",    content: userText }
+]);

No signature change or object-form refactor is needed here.

Likely an incorrect or invalid review comment.

Comment on lines 1 to 6
import { runner } from '@agentuity/sdk';

runner(true, import.meta.dirname).catch((err) => {
console.error(err);
process.exit(1);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid relying on import.meta.dirname; use a portable ESM dirname.

Node doesn’t guarantee import.meta.dirname; using fileURLToPath works everywhere.

Apply:

-import { runner } from '@agentuity/sdk';
-
-runner(true, import.meta.dirname).catch((err) => {
+import { runner } from '@agentuity/sdk';
+import { fileURLToPath } from 'node:url';
+import { dirname } from 'node:path';
+const cwd = dirname(fileURLToPath(import.meta.url));
+runner(true, cwd).catch((err) => {
   console.error(err);
   process.exit(1);
 });
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import { runner } from '@agentuity/sdk';
runner(true, import.meta.dirname).catch((err) => {
console.error(err);
process.exit(1);
});
import { runner } from '@agentuity/sdk';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
const cwd = dirname(fileURLToPath(import.meta.url));
runner(true, cwd).catch((err) => {
console.error(err);
process.exit(1);
});
🤖 Prompt for AI Agents
In frameworks/mastra/system-prompt/index.ts lines 1-6, the code uses
import.meta.dirname which is not portable; replace it with a standard ESM
dirname computed via fileURLToPath. Import fileURLToPath from 'url' and path (or
path.dirname) from 'path', compute const __dirname =
path.dirname(fileURLToPath(import.meta.url)), then pass __dirname (or the
computed dirname) to runner instead of import.meta.dirname and keep the existing
.catch handler.

Comment on lines 22 to 29
const defaultInstructions =
'You are a friendly assistant. Respond clearly and helpfully.';

const agent = new Agent({
name: 'MastraSystemPrompt',
model: openai('gpt-4o-mini'),
instructions: defaultInstructions
});
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Confirm Mastra Agent option key (instructions vs system) for your pinned version.

Mastra changed naming across versions; mixing @mastra/core@^0.6.0 vs ^0.9.x can silently ignore the system text.


🌐 Web query:

For @mastra/core/agent, what are the constructor option keys for versions 0.6.x and 0.9.x (is it `instructions` or `system`), and what is the current recommended way to set default system prompt?

Error during web search


🏁 Script executed:

#!/bin/bash
set -e
# Display the Mastra System Prompt agent implementation
cat frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts | sed -n '1,200p'

Length of output: 1589


🏁 Script executed:

#!/bin/bash
set -e
# Determine the installed version of @mastra/core in this repo
echo "package.json dependencies (@mastra/core):"
grep -R '"@mastra/core"' -n package.json || true

echo -e "\nframeworks/mastra/system-prompt/package.json dependencies (@mastra/core):"
grep -R '"@mastra/core"' -n frameworks/mastra/system-prompt/package.json || true

echo -e "\nlockfiles (@mastra/core entries):"
grep -R '@mastra/core@' -n yarn.lock package-lock.json || true

Length of output: 705


🏁 Script executed:

#!/bin/bash
set -e
# Inspect Agent constructor and generate method signatures for @mastra/core@0.6.0 and @mastra/core@0.9.0
for version in 0.6.0 0.9.0; do
  echo "### Version $version ###"
  # Get the types entry point path from package.json
  types_path=$(curl -s https://unpkg.com/@mastra/core@${version}/package.json | grep -Po '"types"\s*:\s*"\K[^"]+')
  echo "types path: ${types_path}"
  echo "Agent constructor signature:"
  curl -s https://unpkg.com/@mastra/core@${version}/${types_path} | grep -nP 'constructor\s*\(' -C2
  echo
  echo "generate method signature:"
  curl -s https://unpkg.com/@mastra/core@${version}/${types_path} | grep -nP '\bgenerate\(' -C2
  echo
done

Length of output: 4581


🏁 Script executed:

#!/bin/bash
set -e
for version in 0.6.0 0.9.0; do
  echo "=== @mastra/core@$version ==="
  echo -n "Types entry: "
  curl -s https://unpkg.com/@mastra/core@${version}/package.json \
    | grep -Po '"types"\s*:\s*"\K[^"]+' || echo "not specified"
  echo
  echo "AgentConfig definition:"
  curl -s https://unpkg.com/@mastra/core@${version}/dist/index.d.ts \
    | sed -n '/\bAgentConfig\b/,/};/p'
  echo
  echo "Config fields “instructions” vs “system”:"
  curl -s https://unpkg.com/@mastra/core@${version}/dist/index.d.ts \
    | grep -nE '\b(instructions|system)\b' -C2 || echo "— none found —"
  echo -e "\n----------------------------------------\n"
done

Length of output: 15320


🏁 Script executed:

#!/bin/bash
set -e
for version in 0.6.0 0.9.0; do
  echo "=== @mastra/core@$version ==="
  echo "AgentConfig type definition:"
  curl -s "https://unpkg.com/@mastra/core@${version}/dist/base.d.ts" \
    | sed -n '/\bAgentConfig\b/,/};/p'
  echo -e "\n----------------------------------------\n"
done

Length of output: 720


🏁 Script executed:

#!/bin/bash
set -e
for version in 0.6.0 0.9.0; do
  echo "=== @mastra/core@$version ==="
  INDEX_URL="https://unpkg.com/@mastra/core@${version}/dist/index.d.ts"
  BASE_IMPORT=$(curl -s "${INDEX_URL}" | grep -oP "from './base-[^']+\\.js'" | head -1)
  BASE_FILE=$(echo "${BASE_IMPORT}" | sed -n "s/from '\\.\\/\\(base-[^']*\\)\\.js'/\\1/p")
  echo "Base file: ${BASE_FILE}"
  BASE_D_TS_URL="https://unpkg.com/@mastra/core@${version}/dist/${BASE_FILE}.d.ts"
  echo "Fetching: ${BASE_D_TS_URL}"
  curl -s "${BASE_D_TS_URL}" | sed -n '/AgentConfig/,/};/p'
  echo "Fields (instructions or system):"
  curl -s "${BASE_D_TS_URL}" | sed -n '/AgentConfig/,/};/p' | grep -E 'instructions|system' || echo "— none found —"
  echo -e "\n----------------------------------------\n"
done

Length of output: 16987


Update agent.generate to use instructions (not system)

Both @mastra/core 0.6.x and 0.9.x expect the initial prompt via the instructions key on AgentConfig, and per‐call overrides are likewise named instructions in v0.9.x (v0.6.x does not support per‐call overrides). Passing { system: … } will be ignored.

• In both versions, AgentConfig’s constructor signature is:
new Agent({ name: string; instructions: string; model: MastraLanguageModel; … }) — there is no system field .
• In v0.9.x, AgentGenerateOptions defines an optional instructions?: string override (again, no system) .
• In v0.6.x, per‐call overrides aren’t supported; only the constructor’s instructions is used .

Please update the snippet as follows:

- const result = await agent.generate(
-   userText,
-   systemMessage ? { system: systemMessage } : undefined
- );
+ const result = await agent.generate(
+   userText,
+   systemMessage ? { instructions: systemMessage } : undefined
+ );

If you need per-call prompt overrides with v0.6.x, you’ll need to upgrade to ≥0.9.x (which supports the instructions option in generate).

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const defaultInstructions =
'You are a friendly assistant. Respond clearly and helpfully.';
const agent = new Agent({
name: 'MastraSystemPrompt',
model: openai('gpt-4o-mini'),
instructions: defaultInstructions
});
const result = await agent.generate(
userText,
systemMessage ? { instructions: systemMessage } : undefined
);
🤖 Prompt for AI Agents
In frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
around lines 22–29, the agent configuration and any per-call overrides must use
the key instructions (not system); change any Agent.generate calls that pass {
system: ... } to { instructions: ... } so the prompt is respected by both
@mastra/core v0.6.x and v0.9.x (note v0.6.x only supports constructor-level
instructions, while per-call instructions require upgrading to ≥0.9.x).

systemMessage ? { system: systemMessage } : undefined
);

return resp.text(result.text || '');
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

❓ Verification inconclusive

Confirm shape of result (may not be result.text).

Mastra often returns different shapes (e.g., { text: string }, { output: string }, or a string). Ensure correct extraction to avoid empty responses.


🌐 Web query:

For @mastra/core Agent.generate return value (versions 0.6.x and 0.9.x), what property contains the final text? Is it `text`, `output`, or a direct string?

Error during web search


Ensure correct extraction of generated text from result
The .generate() method in @mastra/core returns an object with a text property (no output field and not a bare string) for text‐only calls. Earlier v0.6.x of the API returned a raw string directly, so to cover both shapes you should update the code at line 39:

• File: frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts, line 39
Replace

return resp.text(result.text || '');

With

const textOutput = typeof result === 'string'
  ? result
  : result.text ?? '';  
return resp.text(textOutput);

References:
– Generated text lives in result.text (no output) (mastra.ai)
– Example usage: response.text holds the string (mastra.ai)

🤖 Prompt for AI Agents
In frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
around line 39, the handler currently assumes result.text exists but older API
versions may return a bare string; update the return to normalize both shapes by
checking if result is a string and using it directly, otherwise use result.text
with a fallback empty string, then pass that normalized text to resp.text.

Comment on lines 1 to 8
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "./dist",
"rootDir": "."
},
"include": ["./index.ts", "./src/**/*.ts"]
}
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

TS config looks fine; verify base tsconfig resolution.

Extends path and include patterns look correct for this package layout.

Run to confirm the base file exists and sources are picked up:


🏁 Script executed:

#!/bin/bash
fd -a 'tsconfig.json' | sed -n '1,200p'
test -f frameworks/tsconfig.json && echo "OK: frameworks/tsconfig.json present" || echo "MISSING: frameworks/tsconfig.json"
test -f frameworks/mastra/system-prompt/index.ts && echo "OK: entry present"
fd -a 'src/agents/mastra-system-prompt/index.ts' frameworks/mastra/system-prompt

Length of output: 1674


🏁 Script executed:

#!/bin/bash

echo "Basic tsconfig content:"
sed -n '1,200p' frameworks/mastra/basic/tsconfig.json

echo ""
echo "System-prompt directory files:"
find frameworks/mastra/system-prompt -maxdepth 2 -type f

Length of output: 1090


🏁 Script executed:

#!/bin/bash
echo "Bird-checker tsconfig:"
sed -n '1,20p' frameworks/mastra/bird-checker/tsconfig.json || echo "File missing"

echo ""
echo "Multi-step-workflow tsconfig:"
sed -n '1,20p' frameworks/mastra/multi-step-workflow/tsconfig.json || echo "File missing"

Length of output: 1293


Fix base tsconfig path in system-prompt tsconfig
The extends field in frameworks/mastra/system-prompt/tsconfig.json
currently points to ../../tsconfig.json (which would resolve to frameworks/tsconfig.json – a non-existent file). It needs to reference the Mastra “basic” config instead:

• File: frameworks/mastra/system-prompt/tsconfig.json
– Change
"extends": "../../tsconfig.json"
to
"extends": "../basic/tsconfig.json"

🤖 Prompt for AI Agents
In frameworks/mastra/system-prompt/tsconfig.json lines 1 to 8 the "extends" path
is wrong: it currently points to "../../tsconfig.json" (non-existent) — update
the extends field to point to the Mastra basic config by changing it to
"../basic/tsconfig.json"; save the file ensuring the rest of the JSON remains
unchanged.

devin-ai-integration bot and others added 6 commits August 27, 2025 19:04
Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
…d index.ts env checks with mastra/basic

Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
…and module resolution

Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
…tch access

Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
… for consistency

Co-Authored-By: Dhilan Fye <dfye@agentuity.com>
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (3)
frameworks/mastra/system-prompt/tsconfig.json (1)

1-4: Extend the Mastra base tsconfig to stay consistent with other examples

Prevents config drift and keeps compiler options aligned.

 {
+  "extends": "../basic/tsconfig.json",
   "compilerOptions": {
frameworks/mastra/system-prompt/index.ts (1)

1-1: Portable dirname: import.meta.dirname is Bun-only; crashes under Node
Use standard ESM pattern so agentuity dev (Node) works.

-import { runner } from '@agentuity/sdk';
+import { runner } from '@agentuity/sdk';
+import { fileURLToPath } from 'node:url';
+import { dirname } from 'node:path';
+const cwd = dirname(fileURLToPath(import.meta.url));
@@
-runner(true, import.meta.dirname).catch((err) => {
+runner(true, cwd).catch((err) => {

Also applies to: 31-39

frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (1)

22-26: Dynamic system prompt currently ignored (wrong option key) and may be incompatible with v0.6.x — set instructions at construction and call generate(message).

Mastra expects instructions, not system. Per-call overrides using { instructions } may not exist in v0.6.x, so safest is to inject the dynamic prompt via the constructor and keep generate single-arg. This both fixes behavior and maximizes version compatibility.

Apply:

-    const agent = new Agent({
-      name: 'MastraSystemPrompt',
-      model: openai('gpt-4o-mini'),
-      instructions: 'You are a helpful assistant.'
-    });
+    // create with dynamic instructions (works on both 0.6.x and 0.9.x)
+    const baseInstructions = 'You are a helpful assistant.';
+    const agent = new Agent({
+      name: 'MastraSystemPrompt',
+      model: openai('gpt-4o-mini'),
+      instructions: system ?? baseInstructions
+    });
@@
-    const result = await agent.generate(message, system ? { system } : undefined);
+    const result = await agent.generate(message);

Also applies to: 39-39

🧹 Nitpick comments (8)
frameworks/mastra/system-prompt/README.md (1)

5-12: Minor copy polish for clarity/grammar

Tighten phrasing and punctuation; add “handler”; pluralize “Usage tips”.

- - Exposes Agentuity `welcome()` and default `Agent(req, resp, ctx)`
- - Demonstrates passing a runtime system prompt
- 
- Usage tip:
+ - Exposes Agentuity `welcome()` and default `Agent(req, resp, ctx)` handler
+ - Demonstrates passing a runtime system prompt.
+
+ Usage tips:
frameworks/mastra/system-prompt/package.json (1)

23-31: Drop the umbrella “mastra” dependency to avoid version skew

Since there are no direct imports of the top-level mastra package in frameworks/mastra/system-prompt (confirmed by your search), you can safely remove it and rely solely on the scoped @mastra/core dependency.

• File to update:

  • frameworks/mastra/system-prompt/package.json (lines 23–31)

Suggested change:

  "dependencies": {
    "@agentuity/sdk": "^0.0.116",
    "@ai-sdk/openai": "^1.2.11",
    "@mastra/core": "^0.9.4",
-   "ai": "^4.3.16",
-   "mastra": "^0.6.3"
+   "ai": "^4.3.16"
  },
  "module": "index.ts"
}
frameworks/mastra/system-prompt/index.ts (2)

9-12: Fix guidance: Node can’t run .ts directly with --env-file
Point users to agentuity dev (or Bun) instead of suggesting node index.ts.

-      '\x1b[31m[ERROR] Re-run the command with `node --env-file .env index.ts`\x1b[0m'
+      '\x1b[31m[ERROR] Re-run with `agentuity dev` (reads .env automatically), or set AGENTUITY_* keys in your environment.\x1b[0m'

16-29: Use yellow for warnings (not red)
ANSI 33m better conveys warning vs error.

-    '\x1b[31m[WARN] You are running this agent outside of the Agentuity environment. Any automatic Agentuity features will be disabled.\x1b[0m'
+    '\x1b[33m[WARN] You are running this agent outside of the Agentuity environment. Any automatic Agentuity features will be disabled.\x1b[0m'
@@
-      '\x1b[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of bun run start.\x1b[0m'
+      '\x1b[33m[WARN] Recommend running `agentuity dev` to run your project locally instead of bun run start.\x1b[0m'
@@
-      '\x1b[31m[WARN] Recommend running `agentuity dev` to run your project locally instead of npm start.\x1b[0m'
+      '\x1b[33m[WARN] Recommend running `agentuity dev` to run your project locally instead of npm start.\x1b[0m'
frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (4)

39-40: Normalize generate() return shape (string vs { text }).

Covers both older and newer Mastra return types.

-    const result = await agent.generate(message);
-    return resp.text(result.text || '');
+    const result = await agent.generate(message);
+    const textOutput = typeof result === 'string' ? result : (result?.text ?? '');
+    return resp.text(textOutput);

28-37: Make runtime prompt parsing more forgiving (JSON envelope and “system:” without newline).

Optional but improves DX for callers.

-    const input = (await req.data.text()) || 'Hello there!';
-    let system: string | undefined;
-    let message = input;
-
-    const m = input.match(/^system:\s*(.+)\n([\s\S]*)$/i);
-    if (m) {
-      const [, sys, rest] = m;
-      system = (sys || '').trim();
-      message = (rest || '').trim() || 'Continue.';
-    }
+    const raw = ((await req.data.text()) ?? '').trim();
+    let system: string | undefined;
+    let message = raw || 'Hello there!';
+
+    // JSON envelope: { "user": "...", "system": "..." }
+    if (raw.startsWith('{')) {
+      try {
+        const parsed = JSON.parse(raw);
+        if (typeof parsed.user === 'string') message = parsed.user;
+        if (typeof parsed.system === 'string') system = parsed.system;
+      } catch { /* ignore malformed JSON */ }
+    }
+    // "system: ..." line, message optional
+    const m = raw.match(/^system:\s*([^\n]+)(?:\n([\s\S]*))?$/i);
+    if (m) {
+      system = m[1].trim();
+      message = (m[2]?.trim() || 'Continue.');
+    }

41-47: Include error object in logs to preserve stack.

If logger supports it, pass error as an object/second arg for better diagnostics.


1-3: Optional: Alias Mastra’s Agent class for clarity

No change is needed for the SDK import path—it’s consistently @agentuity/sdk everywhere in the repo.

If you’d like to make it extra clear which Agent you’re using, you can optionally alias the Mastra class:

-import type { AgentContext, AgentRequest, AgentResponse } from '@agentuity/sdk';
+import type { AgentContext, AgentRequest, AgentResponse } from '@agentuity/sdk';

-import { Agent } from '@mastra/core/agent';
+import { Agent as MastraAgent } from '@mastra/core/agent';  // optional alias

// …and, if you alias, update any `new Agent(...)` calls to `new MastraAgent(...)`
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1e8b98a and a76f884.

⛔ Files ignored due to path filters (1)
  • frameworks/mastra/system-prompt/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (7)
  • frameworks/mastra/system-prompt/.gitignore (1 hunks)
  • frameworks/mastra/system-prompt/README.md (1 hunks)
  • frameworks/mastra/system-prompt/agentuity.yaml (1 hunks)
  • frameworks/mastra/system-prompt/index.ts (1 hunks)
  • frameworks/mastra/system-prompt/package.json (1 hunks)
  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (1 hunks)
  • frameworks/mastra/system-prompt/tsconfig.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frameworks/mastra/system-prompt/agentuity.yaml
🧰 Additional context used
🧠 Learnings (26)
📚 Learning: 2025-07-17T13:39:44.988Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-07-17T13:39:44.988Z
Learning: Applies to agents/composio/src/agents/**/*.ts : Use TypeScript for better type safety and IDE support

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
📚 Learning: 2025-07-17T13:39:55.775Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/deep-research-js/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:55.775Z
Learning: Applies to agents/deep-research-js/**/src/agents/**/index.ts : All code should be in Typescript format

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
📚 Learning: 2025-07-17T13:39:37.133Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:37.133Z
Learning: Applies to agents/composio/**/src/agents/**/index.ts : All code should be in Typescript format

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
📚 Learning: 2025-07-17T13:40:05.817Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/deep-research-js/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-07-17T13:40:05.817Z
Learning: Applies to agents/deep-research-js/src/agents/**/*.ts : Consider agent communication for complex workflows

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:18.709Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/agent-riza/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:18.709Z
Learning: Applies to agents/agent-riza/**/src/agents/**/index.ts : All code should be in Typescript format

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
📚 Learning: 2025-06-23T17:17:19.027Z
Learnt from: CR
PR: agentuity/examples#0
File: patterns/llmAsJury/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:17:19.027Z
Learning: Use TypeScript for better type safety and IDE support when developing with the Agentuity SDK.

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
📚 Learning: 2025-07-17T13:39:44.988Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-07-17T13:39:44.988Z
Learning: Applies to agents/composio/src/agents/**/*.ts : Import types from `agentuity/sdk`

Applied to files:

  • frameworks/mastra/system-prompt/tsconfig.json
📚 Learning: 2025-07-17T13:38:58.657Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/Startup_News_Scraper/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:38:58.657Z
Learning: Applies to agents/Startup_News_Scraper/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/index.ts
📚 Learning: 2025-06-23T17:15:21.314Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/mastra/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:15:21.314Z
Learning: For best practices in Agentuity SDK projects, use TypeScript for type safety, import types from agentuity/sdk, use structured error handling with try/catch, leverage the provided logger, use storage APIs for data persistence, and consider agent communication for complex workflows.

Applied to files:

  • frameworks/mastra/system-prompt/index.ts
📚 Learning: 2025-06-23T17:14:39.393Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langgraph/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:14:39.393Z
Learning: In Agentuity AI Agent files (`**/src/agents/**/index.ts`), import types such as `AgentRequest`, `AgentResponse`, and `AgentContext` from the `agentuity/sdk` package to ensure type safety and consistency.

Applied to files:

  • frameworks/mastra/system-prompt/package.json
  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:40:37.445Z
Learnt from: CR
PR: agentuity/examples#0
File: agentuity/sdk-js/streaming/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:40:37.445Z
Learning: Applies to agentuity/sdk-js/streaming/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/package.json
📚 Learning: 2025-07-17T13:39:37.133Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:37.133Z
Learning: Applies to agents/composio/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/package.json
📚 Learning: 2025-07-17T13:39:18.709Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/agent-riza/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:18.709Z
Learning: Applies to agents/agent-riza/**/src/agents/**/index.ts : Prefer loading types from the node modules package `agentuity/sdk` in the node_modules folder

Applied to files:

  • frameworks/mastra/system-prompt/package.json
📚 Learning: 2025-06-23T17:14:39.393Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langgraph/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:14:39.393Z
Learning: In Agentuity AI Agent files (`**/src/agents/**/index.ts`), the default export should be an async function that handles the agent logic, typically accepting parameters `(req: AgentRequest, resp: AgentResponse, ctx: AgentContext)`.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:55.775Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/deep-research-js/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:55.775Z
Learning: Applies to agents/deep-research-js/**/src/agents/**/index.ts : Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:37.133Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/composio/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:37.133Z
Learning: Applies to agents/composio/**/src/agents/**/index.ts : Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:40:37.445Z
Learnt from: CR
PR: agentuity/examples#0
File: agentuity/sdk-js/streaming/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:40:37.445Z
Learning: Applies to agentuity/sdk-js/streaming/**/src/agents/**/index.ts : Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:18.709Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/agent-riza/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:39:18.709Z
Learning: Applies to agents/agent-riza/**/src/agents/**/index.ts : Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:38:58.657Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/Startup_News_Scraper/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-07-17T13:38:58.657Z
Learning: Applies to agents/Startup_News_Scraper/**/src/agents/**/index.ts : Prefer naming the default function Agent or the name of the Agent based on the context of the Agent description

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:15:59.829Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai-typescript/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:15:59.829Z
Learning: In Agent files for Agentuity, always export a default function, preferably named 'Agent' or contextually after the Agent, to ensure consistency and clarity.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-07-17T13:39:31.143Z
Learnt from: CR
PR: agentuity/examples#0
File: agents/agent-riza/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-07-17T13:39:31.143Z
Learning: Applies to agents/agent-riza/src/agents/**/*.ts : Consider agent communication (e.g., `response.handoff`, `context.getAgent`) for complex workflows

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:16:49.315Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/vercel/basic/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:16:49.315Z
Learning: When writing an Agent in TypeScript for Agentuity, always use the types provided by the `agentuity/sdk` package for AgentRequest, AgentResponse, and AgentContext to ensure type safety and compatibility.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:15:59.829Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai-typescript/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:15:59.829Z
Learning: When developing Agentuity AI Agents, import types such as `AgentRequest`, `AgentResponse`, and `AgentContext` from the `agentuity/sdk` package to maintain type safety and leverage SDK-provided interfaces.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:14:46.802Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/langgraph/basic/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:14:46.802Z
Learning: The Agentuity JavaScript SDK provides core interfaces such as AgentHandler, AgentRequest, AgentResponse, and AgentContext for building AI agents in TypeScript or JavaScript.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:17:10.338Z
Learnt from: CR
PR: agentuity/examples#0
File: patterns/llmAsJury/.cursor/rules/agent.mdc:0-0
Timestamp: 2025-06-23T17:17:10.338Z
Learning: In Agent files for Agentuity, prefer importing types such as AgentRequest, AgentResponse, and AgentContext from the `agentuity/sdk` package to ensure type consistency and compatibility.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
📚 Learning: 2025-06-23T17:16:08.480Z
Learnt from: CR
PR: agentuity/examples#0
File: frameworks/openai/from-oai-typescript/.cursor/rules/sdk.mdc:0-0
Timestamp: 2025-06-23T17:16:08.480Z
Learning: In the Agentuity JavaScript SDK, the main handler for an agent should implement the AgentHandler type: (request: AgentRequest, response: AgentResponse, context: AgentContext) => Promise<AgentResponseType>.

Applied to files:

  • frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts
🪛 LanguageTool
frameworks/mastra/system-prompt/README.md

[grammar] ~5-~5: There might be a mistake here.
Context: ...(@mastra/core/agent, @ai-sdk/openai) - Exposes Agentuity welcome() and defaul...

(QB_NEW_EN)


[grammar] ~9-~9: There might be a mistake here.
Context: ...sing a runtime system prompt Usage tip: - Prefix your input with a system line to ...

(QB_NEW_EN)

🔇 Additional comments (2)
frameworks/mastra/system-prompt/.gitignore (1)

1-37: LGTM — sensible ignores for this package

Covers node_modules, build artifacts, env files, and .agentuity. Nothing to change.

frameworks/mastra/system-prompt/src/agents/mastra-system-prompt/index.ts (1)

5-14: Welcome payload looks good.

Samples clearly demonstrate the runtime system-prompt pattern.

@devin-ai-integration
Copy link
Contributor Author

Closing due to inactivity for more than 30 days. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant