View, update, and sync your agent's personality
DevDuck can view and modify its own system prompt at runtime. Learn from conversations and persist improvements across sessions via GitHub sync.
| Action | Description | Parameters |
|---|---|---|
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 | — |
# See what the current system prompt contains
system_prompt(action="view")
# Update system prompt (saves to env var + .prompt file)
system_prompt(
action="update",
prompt="You are a specialized Python developer..."
)
# 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."
)
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"
)
SYSTEM_PROMPT).prompt fileWhen 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!
DevDuck can read and understand its own system prompt at any time.
Modify personality and behavior without restarting.
Persist changes to repository variables for team sharing.
Changes saved to .prompt file for local persistence.
Add context without replacing existing prompt.
Use custom env var names for different agent personalities.
| Variable | Description |
|---|---|
SYSTEM_PROMPT |
Default system prompt (loaded on startup) |
GITHUB_TOKEN |
Required for GitHub repository sync |
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