OpenParable
Skip to content
← Back to skills

Customize System Prompt

Agent Building
customize-system-prompt

Customize System Prompt is an Agent Skill for agent building published in the AlphaLab-USTC/OhMyCode repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Guide for customizing OhMyCode's AI personality and behavior via system prompt. Use when user wants to change how the AI behaves, its tone, or its instructions.

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/AlphaLab-USTC/OhMyCode/blob/HEAD/.claude/skills/customize-system-prompt/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/customize-system-prompt, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Customize OhMyCode's System Prompt

Change the AI assistant's personality, behavior rules, or domain expertise without writing code.

When to Use

  • User says "make it more formal", "act like a senior engineer", "focus on Python"
  • User wants to add custom instructions or constraints
  • User wants the AI to have domain-specific knowledge

Three Ways to Customize

Method 1: OHMYCODE.md (Per-Project, Recommended)

Create a OHMYCODE.md (or CLAUDE.md) file in your project root:

# Project Instructions

You are working on a Django REST API project.

## Rules
- Always use type hints
- Prefer class-based views over function-based
- Write docstrings for all public functions
- Use Black formatting style

## Tech Stack
- Python 3.12, Django 5.0, PostgreSQL
- pytest for testing, factory_boy for fixtures

OhMyCode auto-detects this file and injects it into the system prompt.

Scope: Only applies when running ohmycode in this directory.

Method 2: system_prompt_append (Global Config)

Add to ~/.ohmycode/config.json:

{
  "system_prompt_append": "Always respond in Chinese. Prefer simple solutions over clever ones. Never use global variables."
}

Scope: Applies to ALL conversations.

Method 3: Modify system_prompt.py (Advanced)

Edit ohmycode/core/system_prompt.py → build_system_prompt() to change the base role description or add new sections.

Scope: Permanent change to the codebase.

Examples

Friendly Tutor

# OHMYCODE.md
You are a patient coding tutor. Explain concepts step by step.
When the user makes a mistake, explain why it's wrong before showing the fix.
Use analogies to explain complex concepts.

Strict Code Reviewer

# OHMYCODE.md
You are a strict senior engineer doing code review.
Point out every issue: bugs, performance, readability, security.
Don't write code for the user — give them guidance to fix it themselves.
Rate code quality on a 1-10 scale.

Domain Expert

# OHMYCODE.md
You are an expert in machine learning with PyTorch.
When suggesting solutions, prefer PyTorch over TensorFlow.
Always consider GPU memory usage and training efficiency.
Reference relevant papers when explaining algorithms.

How It Works

ohmycode/core/system_prompt.py → build_system_prompt() assembles the prompt in this order:

  1. Base role — hardcoded AI assistant description
  2. Project instructions — from OHMYCODE.md / CLAUDE.md (found via find_project_instructions())
  3. Memory — from ~/.ohmycode/memory/MEMORY.md
  4. Environment — working directory, OS, shell, Python version
  5. Mode — permission mode description
  6. Tools — available tool list
  7. Append — from config.system_prompt_append

Tips

  • Keep OHMYCODE.md focused — don't repeat what's already in the base prompt
  • Use Markdown headers to organize sections
  • Test changes: ohmycode -p "Describe yourself" --mode auto
  • OHMYCODE.md is searched upward from current directory — put it at the repo root