Skip to content

Conversation

Copy link

Copilot AI commented Sep 12, 2025

Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.

Original description:

Add a lightweight Copilot coding agent configuration and documentation to guide automated Copilot behavior in this repository. Files to add:

# Recommended Copilot Coding Agent configuration for this repository.
# The agent should read this file to follow repo conventions when opening PRs.
# Adjust values as you prefer; the agent will use these as sensible defaults.

enabled: true

agent:
  name: copilot
  # The default branch to target for PRs
  default_target_branch: develop
  # Branch prefix to use for automated branches
  pr_branch_prefix: feature/copilot/
  # PR title template (use {short-description} to inject a short summary)
  pr_title_template: "[copilot] {short-description}"
  # Author metadata for created PRs/commits
  author:
    name: "Copilot"
    email: "[email protected]"
  # Create PRs automatically when changes are proposed
  create_prs: true
  # Allow drafts when the change is incomplete
  allow_draft_prs: true
  # Default reviewers to request on PRs
  reviewers:
    - codeGlaze

checks:
  # Which checks the agent should run before opening/marking a PR ready
  run_tests: true         # run `lein test`
  run_linters: true       # run clj-kondo / lint profile
  run_cljs_build: true    # run cljsbuild (dev) once
  build_artifact: true    # run `lein uberjar`
  upload_artifact: true   # upload jar as CI artifact if supported

preferences:
  # If true the agent will refuse to open PRs when the linter fails.
  # Set false to allow draft PRs even with lint warnings.
  lint_fail_pr: false
  # When enabled the agent can open an issue on persistent CI failure
  create_issue_on_failure: true
  issue_labels:
    - ci
    - copilot
  # Prefix used for commit messages authored by the agent
  commit_message_prefix: "[copilot]"

hooks:
  # Commands the agent should run locally before creating a PR (helpful to ensure
  # the branch compiles and tests pass in the agent environment)
  before_pr:
    - "lein deps"
    - "lein with-profile +lint do deps, run -m clj-kondo.main --lint src test || true"
    - "lein test"
  # Commands the agent should run after creating a PR (for example, to annotate)
  after_pr:
    - "lein with-profile +dev cljsbuild once || true"

notes:
  # Guidance for repository maintainers / agent operators
  - "This file is a recommended config schema for the Copilot coding agent. Agents may
    adapt keys they understand. Keep secrets and credentials out of repo files."
  - "To disable automated PR creation by the agent set `enabled: false`."
```markdown
# Copilot Coding Agent — repository guidance

This document explains the repository-level configuration for the Copilot coding agent.

Files
- .github/copilot-coding-agent.yml — repo preferences that a Copilot coding agent can read to follow branch naming, PR templates, checks to run, and hooks.

Why this exists
- Provide a single source of truth for how automated agents should create branches and PRs.
- Ensure consistent behavior across contributions (branch prefixes, target branch, checks to run).
- Give safe defaults that keep the repository stable (run tests, run linters, but don't fail PR creation on lint by default).

Key settings explained
- default_target_branch: the branch the agent will target for PRs (set to `develop`).
- pr_branch_prefix: branch name prefix for automated branches (e.g. `feature/copilot/`).
- run_tests / run_linters / run_cljs_build: tells the agent which verification steps it should attempt locally before creating or marking a PR ready.
- lint_fail_pr: if true, the agent will not create a non-draft PR if linter checks fail. Set to false to be more permissive.

Recommended agent workflow
1. Agent creates a feature branch with the configured prefix (e.g. feature/copilot/add-ci).
2. Agent runs the `before_pr` hooks (lein deps, clj-kondo, lein test, cljsbuild).
3. If checks pass (or lint is allowed), the agent opens a draft PR with the configured title template.
4. The PR triggers CI (.github/workflows/ci.yml if present) which performs a full verification and uploads artifacts.
5. Agent updates the PR body with test/CI status and any follow-up instructions.

Security & best practices
- Never store credentials, tokens, or private keys in repo files. Use GitHub Secrets for CI.
- Keep the `before_pr` hooks lightweight — heavy tasks can be left to CI to avoid long-running agent jobs.
- If you want stricter enforcement, set `lint_fail_pr: true` and make the linter step non-continue-on-error in CI.

How to opt out
- To disable automatic PR creation by the agent, set `enabled: false` in .github/copilot-coding-agent.yml
- Alternatively, remove or adjust `create_prs` and `allow_draft_prs` settings.

Customizing
- Update reviewers to include any team members you want to auto-request.
- Add or remove hook commands depending on your CI environment.
- If the repo uses a different test/build command, replace the `lein` commands with the canonical equivalents.

If you want, I can:
- Open a PR adding .github/copilot-coding-agent.yml and this docs file to the repository.
- Tune the `before_pr` hooks to run a stricter or lighter set of checks.
- Integrate the agent config with the CI workflow so the agent can read CI results and comment on PRs.
```

Notes:

  • Target branch for the new branch containing these changes should be develop (as requested).
  • I recommend creating a feature branch named feature/copilot-config for this work.

Please create a pull request that adds the two files above, using branch feature/copilot-config and targeting develop. PR title: "Add Copilot coding agent config and documentation".

This pull request was created as a result of the following prompt from Copilot chat.

Add a lightweight Copilot coding agent configuration and documentation to guide automated Copilot behavior in this repository. Files to add:

# Recommended Copilot Coding Agent configuration for this repository.
# The agent should read this file to follow repo conventions when opening PRs.
# Adjust values as you prefer; the agent will use these as sensible defaults.

enabled: true

agent:
  name: copilot
  # The default branch to target for PRs
  default_target_branch: develop
  # Branch prefix to use for automated branches
  pr_branch_prefix: feature/copilot/
  # PR title template (use {short-description} to inject a short summary)
  pr_title_template: "[copilot] {short-description}"
  # Author metadata for created PRs/commits
  author:
    name: "Copilot"
    email: "[email protected]"
  # Create PRs automatically when changes are proposed
  create_prs: true
  # Allow drafts when the change is incomplete
  allow_draft_prs: true
  # Default reviewers to request on PRs
  reviewers:
    - codeGlaze

checks:
  # Which checks the agent should run before opening/marking a PR ready
  run_tests: true         # run `lein test`
  run_linters: true       # run clj-kondo / lint profile
  run_cljs_build: true    # run cljsbuild (dev) once
  build_artifact: true    # run `lein uberjar`
  upload_artifact: true   # upload jar as CI artifact if supported

preferences:
  # If true the agent will refuse to open PRs when the linter fails.
  # Set false to allow draft PRs even with lint warnings.
  lint_fail_pr: false
  # When enabled the agent can open an issue on persistent CI failure
  create_issue_on_failure: true
  issue_labels:
    - ci
    - copilot
  # Prefix used for commit messages authored by the agent
  commit_message_prefix: "[copilot]"

hooks:
  # Commands the agent should run locally before creating a PR (helpful to ensure
  # the branch compiles and tests pass in the agent environment)
  before_pr:
    - "lein deps"
    - "lein with-profile +lint do deps, run -m clj-kondo.main --lint src test || true"
    - "lein test"
  # Commands the agent should run after creating a PR (for example, to annotate)
  after_pr:
    - "lein with-profile +dev cljsbuild once || true"

notes:
  # Guidance for repository maintainers / agent operators
  - "This file is a recommended config schema for the Copilot coding agent. Agents may
    adapt keys they understand. Keep secrets and credentials out of repo files."
  - "To disable automated PR creation by the agent set `enabled: false`."
```markdown
# Copilot Coding Agent — repository guidance

This document explains the repository-level configuration for the Copilot coding agent.

Files
- .github/copilot-coding-agent.yml — repo preferences that a Copilot coding agent can read to follow branch naming, PR templates, checks to run, and hooks.

Why this exists
- Provide a single source of truth for how automated agents should create branches and PRs.
- Ensure consistent behavior across contributions (branch prefixes, target branch, checks to run).
- Give safe defaults that keep the repository stable (run tests, run linters, but don't fail PR creation on lint by default).

Key settings explained
- default_target_branch: the branch the agent will target for PRs (set to `develop`).
- pr_branch_prefix: branch name prefix for automated branches (e.g. `feature/copilot/`).
- run_tests / run_linters / run_cljs_build: tells the agent which verification steps it should attempt locally before creating or marking a PR ready.
- lint_fail_pr: if true, the agent will not create a non-draft PR if linter checks fail. Set to false to be more permissive.

Recommended agent workflow
1. Agent creates a feature branch with the configured prefix (e.g. feature/copilot/add-ci).
2. Agent runs the `before_pr` hooks (lein deps, clj-kondo, lein test, cljsbuild).
3. If checks pass (or lint is allowed), the agent opens a draft PR with the configured title template.
4. The PR triggers CI (.github/workflows/ci.yml if present) which performs a full verification and uploads artifacts.
5. Agent updates the PR body with test/CI status and any follow-up instructions.

Security & best practices
- Never store credentials, tokens, or private keys in repo files. Use GitHub Secrets for CI.
- Keep the `before_pr` hooks lightweight — heavy tasks can be left to CI to avoid long-running agent jobs.
- If you want stricter enforcement, set `lint_fail_pr: true` and make the linter step non-continue-on-error in CI.

How to opt out
- To disable automatic PR creation by the agent, set `enabled: false` in .github/copilot-coding-agent.yml
- Alternatively, remove or adjust `create_prs` and `allow_draft_prs` settings.

Customizing
- Update reviewers to include any team members you want to auto-request.
- Add or remove hook commands depending on your CI environment.
- If the repo uses a different test/build command, replace the `lein` commands with the canonical equivalents.

If you want, I can:
- Open a PR adding .github/copilot-coding-agent.yml and this docs file to the repository.
- Tune the `before_pr` hooks to run a stricter or lighter set of checks.
- Integrate the agent config with the CI workflow so the agent can read CI results and comment on PRs.
```

Notes:

  • Target branch for the new branch containing these changes should be develop (as requested).
  • I recommend creating a feature branch named feature/copilot-config for this work.

Please create a pull request that adds the two files above, using branch feature/copilot-config and targeting develop. PR title: "Add Copilot coding agent config and documentation".


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

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.

2 participants