Skip to content

System prompt with repo context (README, conventions, issue history) #4

@nev-offload

Description

@nev-offload

Problem

The agent currently runs with minimal context about the repository it's working on. It needs a proper system prompt that gives it repo-specific knowledge.

Expected behavior

  • Agent receives a rich system prompt including:
    • Repository README (or summary)
    • Recent commit history / changelog
    • Open issues and their status
    • PR context (if responding to a PR)
    • Repo conventions (language, framework, testing approach)
    • Custom instructions from .openclaw.yml config file

Implementation notes

  • Fetch README.md content via GitHub API
  • Fetch recent commits (git log --oneline -20)
  • Fetch open issues list (titles + labels)
  • Support a .openclaw.yml or .github/openclaw.yml config file for custom instructions:
    system_prompt: "You are a helpful code reviewer focused on TypeScript best practices"
    context:
      include_readme: true
      recent_commits: 20
      open_issues: true
  • Be mindful of context window limits — summarize large READMEs
  • Cache context between runs (use Actions Cache)

Priority

P1 — Agent quality depends heavily on context. Without this, responses will be generic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions