{"id":386,"date":"2026-07-22T15:26:44","date_gmt":"2026-07-22T15:26:44","guid":{"rendered":"https:\/\/staging.platformdev.org\/?p=386"},"modified":"2026-07-22T20:03:43","modified_gmt":"2026-07-22T20:03:43","slug":"github-copilot-custom-agents","status":"publish","type":"post","link":"https:\/\/platformdev.org\/index.php\/2026\/07\/22\/github-copilot-custom-agents\/","title":{"rendered":"GitHub Copilot: Custom Agents"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">There is immense value in customizing the GitHub Copilot Coding agent for GitHub Enterprise Organizations.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Recently, I wanted to build a custom agent to evaluate source code against our standards\u2014specifically around linting, unit tests, code quality, and style requirements for all of our Python AWS Lambda functions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the customer&#8217;s environment, each Lambda function lives in its own dedicated Git repository with its own distinct workflows for CI, CD, and Infrastructure as Code (IaC). The goal was straightforward: ensure that every single Lambda repository adhered to the following standards:<\/p>\n\n\n\n<div class=\"wp-block-kenta-blocks-cover kb-cover-6d244c28 kb-cover kb-cover-has-overlay\"><div class=\"kb-cover-inner-container\">\n<ul class=\"wp-block-list\">\n<li><strong>Dependency &amp; Project Management:<\/strong> Standardized <code>pyproject.toml<\/code> using <code>uv<\/code>.<\/li>\n\n\n\n<li><strong>Testing:<\/strong> Minimum 80% unit test coverage requirement.<\/li>\n\n\n\n<li><strong>Code Quality:<\/strong> <code>pylint<\/code> score of 8.0 or higher.<\/li>\n\n\n\n<li><strong>Directory Structure:<\/strong> A consistent, enforced folder layout across every repo.<\/li>\n<\/ul>\n<\/div><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">With multiple developers on a team working on different Lambda functions, it&#8217;s natural for everyone to want to bring their own personal style. However, when you&#8217;re evaluating or maintaining several Lambdas that comprise a larger serverless application, maintaining identical layout and quality standards is crucial.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s a lesson I learned back in my early sysadmin days managing hundreds of physical servers. Back then, every server was jumpstarted \/ kickstarted with a specific, baseline configuration. When something broke at 2 AM, troubleshooting was significantly easier simply because you always knew where to look for logs, configs, and scripts. The same principle applies to modern serverless codebases.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After multiple iterative prompts with GitHub Copilot to draft the custom agent&#8217;s instructions and supply concrete examples of the expected repository structure, the results were better than expected. When the agent is executed against out-of-standard repositories, it immediately finds the gaps and provides tailored code suggestions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The agent was shared across the GitHub organization by placing the <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-kenta-primary-active-color\">.agent.md<\/mark> <\/code>file in a central <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-kenta-primary-active-color\">.github-private <\/mark><\/code>repository under<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-kenta-primary-active-color\"> .github-private\/agents\/.<\/mark> This allows other Python developers across teams to use the agent to evaluate their source code locally as well.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While our CI workflows still perform the definitive quality gates for linting, coverage, and static analysis, allowing developers to execute a targeted agent <em>before<\/em> pushing code saves valuable developer time\u2014and reduces unnecessary compute costs on our GitHub runners.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>There is immense value in customizing the GitHub Copilot Coding agent for GitHub Enterprise Organizations. Recently, I wanted to build a custom agent to evaluate source code against our standards\u2014specifically around linting, unit tests, code quality, and style requirements for all of our Python AWS Lambda functions. In the customer&#8217;s environment, each Lambda function lives [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":389,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","site-transparent-header":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[1],"tags":[16],"class_list":["post-386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-featured"],"_links":{"self":[{"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/comments?post=386"}],"version-history":[{"count":6,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"predecessor-version":[{"id":393,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/posts\/386\/revisions\/393"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/media\/389"}],"wp:attachment":[{"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/platformdev.org\/index.php\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}