🧠 System Prompt

View, update, and sync your agent's personality

Self-Improvement GitHub Sync Persistent Learning
🧠

Evolving Intelligence

DevDuck can view and modify its own system prompt at runtime. Learn from conversations and persist improvements across sessions via GitHub sync.

📋 Actions Reference

ActionDescriptionParameters
view View current system prompt
update Replace the system prompt prompt, repository (optional)
add_context Append without replacing context
reset Reset to default
get_github_context Get GitHub event context

⚡ Basic Usage

View Current Prompt

# See what the current system prompt contains
system_prompt(action="view")

Update Locally

# Update system prompt (saves to env var + .prompt file)
system_prompt(
    action="update",
    prompt="You are a specialized Python developer..."
)

Add Context (Append)

# Add new learnings without replacing existing prompt
system_prompt(
    action="add_context",
    context="When working with async code, always use asyncio.gather for parallel execution."
)

🔄 GitHub Repository Sync

Persist system prompt changes across deployments by syncing to GitHub repository variables.

# Update and sync to GitHub repository
system_prompt(
    action="update",
    prompt="You are DevDuck, an expert AI developer...",
    repository="cagataycali/devduck"
)

# Use custom variable name
system_prompt(
    action="update",
    prompt="Specialized for data analysis...",
    repository="owner/repo",
    variable_name="DATA_AGENT_PROMPT"
)

What Gets Updated

🚀 Self-Improvement Pattern

🧠 Learning Loop

When DevDuck discovers valuable patterns during conversations, it can persist them:

# Step 1: Identify new insight during conversation
insight = "Always validate JSON before parsing to avoid crashes"

# Step 2: Add to system prompt
system_prompt(action="add_context", context=insight)

# Step 3: Sync to GitHub for persistence
current = system_prompt(action="view")
system_prompt(
    action="update",
    prompt=current["content"][0]["text"] + f"\n\n## Learned:\n- {insight}",
    repository="cagataycali/devduck"
)

# Now this learning persists across all sessions!

✨ Features

👁️

Self-Aware

DevDuck can read and understand its own system prompt at any time.

✏️

Runtime Updates

Modify personality and behavior without restarting.

🔄

GitHub Sync

Persist changes to repository variables for team sharing.

📝

File Persistence

Changes saved to .prompt file for local persistence.

Additive Learning

Add context without replacing existing prompt.

🔧

Custom Variables

Use custom env var names for different agent personalities.

⚙️ Environment Variables

VariableDescription
SYSTEM_PROMPT Default system prompt (loaded on startup)
GITHUB_TOKEN Required for GitHub repository sync

📄 Prompt File

System prompts are saved to .prompt files for persistence:

# Search order for .prompt file:
1. Current working directory (./.prompt)
2. /tmp/devduck/.prompt
3. System temp directory

# The file contains the raw prompt text
cat .prompt