Skip to content

New GitHub Copilot Instruction: extensive object oriented programming design patterns based on literature review#1011

Closed
Jugger23 wants to merge 3 commits intogithub:stagedfrom
Jugger23:add-instruction-oop-design-patterns
Closed

New GitHub Copilot Instruction: extensive object oriented programming design patterns based on literature review#1011
Jugger23 wants to merge 3 commits intogithub:stagedfrom
Jugger23:add-instruction-oop-design-patterns

Conversation

@Jugger23
Copy link

Pull Request Checklist

  • I have read and followed the CONTRIBUTING.md guidelines.
  • I have read and followed the Guidance for submissions involving paid services.
  • My contribution adds a new instruction, prompt, agent, skill, or workflow file in the correct directory.
  • The file follows the required naming convention.
  • The content is clearly structured and follows the example format.
  • I have tested my instructions, prompt, agent, skill, or workflow with GitHub Copilot.
  • I have run npm start and verified that README.md is up to date.

Description

Contribution

Added oop-design-patterns.instructions.md in .github/copilot-instructions.md file tailored for Object-Oriented Programming (OOP) and Gang of Four (GoF) Design Patterns and SOLID instructions.

Purpose

The purpose of this instruction set is to guide GitHub Copilot to generate, refactor, and suggest code that adheres to clean object-oriented design principles. Instead of defaulting to quick, potentially messy solutions, Copilot is instructed to prioritize maintainability, loose coupling, and established design patterns in each prompt without mentioning it again and documenting with standardized docstings used by the developer in his current project and extensively logs the code. Also, functions are prioritized instead of small classes, creating a more easily readable and reusable code. Splitting files into its concerns like type definitions and repository dataclasses create an "easy to maintain" code.

Context

This file is heavily based on the architectural philosophy and the 23 design patterns outlined in the classic software engineering book "Design Patterns: Elements of Reusable Object-Oriented Software" by Gamma, Helm, Johnson, and Vlissides. It enforces core principles such as:

  • Programming to an interface rather than an implementation.
  • Favoring object composition over class inheritance.
  • Encapsulating varying behaviors.

Usage Notes

Installation: Simply place the copilot-instructions.md file into the .github/ directory of your repository. GitHub Copilot will automatically detect and apply these instructions within that workspace.

Best Results: To get the most out of these instructions, developers should mention specific patterns in their prompt comments (e.g., "// implement a Strategy pattern for tax calculation"). Copilot will use the guidelines to generate the interface first and structure the classes correctly.

Scope: These instructions are best suited for heavily object-oriented codebases (like Java, C#, C++, or OOP-style TypeScript/Python) where architectural rigor is a priority.


Type of Contribution

  • New instruction file.
  • New prompt file.
  • New agent file.
  • New plugin.
  • New skill file.
  • New agentic workflow.
  • Update to existing instruction, prompt, agent, plugin, skill, or workflow.
  • Other (please specify):

Additional Notes

Many thanks to the GitHub team for collecting those extensive and helpful GitHub Copilot helpers and for investigating my request for an oop design pattern instruction. I also added a script, which was completely written by the GitHub Copilot for a task he was able to choose using my new instructions. And I told him to show me which instructions he used from my new instructions. This is his summary:

  • Core Philosophy: Program to an Interface (all patterns use ABCs/Protocols), Favor Composition over Inheritance (Decorator chain, Strategy injection), Encapsulate What Varies (Compression strategies)
  • Creational Patterns: Builder (Message construction), Factory Method (ProcessorFactory hierarchy)
  • Structural Patterns: Decorator (LoggingDecorator, MetadataDecorator)
  • Behavioral Patterns: Strategy, Observer, Command, State, Chain of Responsibility, Memento
  • Code Generation Rules: Interface-first, private fields, pattern names in class names, docstrings, logging in every layer (Rule 21), testability via DI instead of singletons

I added the mentioned code of GitHub Copilot script to the appendix of this PR to show the test and influence of my instruction: test_oop_design_patterns.py


By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.

Copilot AI review requested due to automatic review settings March 15, 2026 12:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR significantly expands the repo’s Copilot “plugins” content (new agents, skills, and reference docs) and updates many plugin manifests, while also adding a new OOP design-patterns instruction entry to the instructions catalog.

Changes:

  • Added multiple new custom agents under several plugins (e.g., MCP language experts, “gem-team” workflow agents, CAST Imaging agents).
  • Added multiple new skill folders (Java, .NET, Dataverse, DevOps, Playwright, PostgreSQL, etc.) and reference documentation for some skills.
  • Normalized many plugin.json entries (notably switching agents to "./agents" and removing trailing slashes from skill paths) and updated docs/README.instructions.md to list the OOP instruction.

Reviewed changes

Copilot reviewed 126 out of 297 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
docs/README.instructions.md Adds catalog entry + install links for oop-design-patterns.instructions.md.
plugins/awesome-copilot/.github/plugin/plugin.json Changes agents/skills paths to directory + non-trailing-slash style.
plugins/awesome-copilot/agents/meta-agentic-project-scaffold.md Adds a meta agent for pulling assets from awesome-copilot.
plugins/awesome-copilot/skills/suggest-awesome-github-copilot-agents/SKILL.md Adds skill for suggesting/installing agents from awesome-copilot.
plugins/awesome-copilot/skills/suggest-awesome-github-copilot-instructions/SKILL.md Adds skill for suggesting/installing instructions from awesome-copilot.
plugins/awesome-copilot/skills/suggest-awesome-github-copilot-skills/SKILL.md Adds skill for suggesting/installing skills from awesome-copilot.
plugins/automate-this/.github/plugin/plugin.json Removes trailing slash from skill path.
plugins/azure-cloud-development/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/azure-cloud-development/agents/azure-avm-bicep.md Adds Azure AVM Bicep agent.
plugins/azure-cloud-development/agents/azure-avm-terraform.md Adds Azure AVM Terraform agent.
plugins/azure-cloud-development/agents/azure-logic-apps-expert.md Adds Logic Apps expert agent.
plugins/azure-cloud-development/agents/azure-principal-architect.md Adds Azure principal architect agent.
plugins/azure-cloud-development/agents/azure-saas-architect.md Adds Azure SaaS architect agent.
plugins/azure-cloud-development/agents/terraform-azure-implement.md Adds Terraform implementation specialist agent.
plugins/azure-cloud-development/agents/terraform-azure-planning.md Adds Terraform planning agent.
plugins/azure-cloud-development/skills/azure-pricing/references/COPILOT-STUDIO-RATES.md Adds Copilot Studio billing quick reference (dated snapshot).
plugins/azure-cloud-development/skills/azure-pricing/references/COST-ESTIMATOR.md Adds Azure cost estimator formulas reference.
plugins/azure-cloud-development/skills/azure-pricing/references/REGIONS.md Adds Azure Retail Prices armRegionName region mapping reference.
plugins/azure-cloud-development/skills/azure-pricing/references/SERVICE-NAMES.md Adds Azure Retail Prices serviceName reference list.
plugins/cast-imaging/.github/plugin/plugin.json Switches agents list to "./agents".
plugins/cast-imaging/agents/cast-imaging-impact-analysis.md Adds CAST Imaging impact analysis agent.
plugins/cast-imaging/agents/cast-imaging-software-discovery.md Adds CAST Imaging discovery agent.
plugins/cast-imaging/agents/cast-imaging-structural-quality-advisor.md Adds CAST Imaging structural quality advisor agent.
plugins/clojure-interactive-programming/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slash from skills.
plugins/clojure-interactive-programming/agents/clojure-interactive-programming.md Adds REPL-first Clojure interactive programming agent.
plugins/clojure-interactive-programming/skills/remember-interactive-programming/SKILL.md Adds micro-skill reminding REPL-first workflow.
plugins/context-engineering/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/context-engineering/agents/context-architect.md Adds “Context Architect” agent (model/tools specified).
plugins/context-engineering/skills/context-map/SKILL.md Adds skill for building a context map before changes.
plugins/context-engineering/skills/refactor-plan/SKILL.md Adds skill for planning multi-file refactors.
plugins/context-engineering/skills/what-context-needed/SKILL.md Adds skill to ask what files are needed before answering.
plugins/copilot-sdk/.github/plugin/plugin.json Removes trailing slash from skill path.
plugins/csharp-dotnet-development/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/csharp-dotnet-development/agents/expert-dotnet-software-engineer.md Adds .NET expert guidance agent.
plugins/csharp-dotnet-development/skills/aspnet-minimal-api-openapi/SKILL.md Adds skill for Minimal APIs + OpenAPI patterns.
plugins/csharp-dotnet-development/skills/csharp-async/SKILL.md Adds skill for C# async best practices.
plugins/csharp-dotnet-development/skills/csharp-nunit/SKILL.md Adds NUnit testing best practices skill.
plugins/csharp-dotnet-development/skills/csharp-tunit/SKILL.md Adds TUnit testing best practices skill.
plugins/csharp-dotnet-development/skills/csharp-xunit/SKILL.md Adds xUnit testing best practices skill.
plugins/csharp-dotnet-development/skills/dotnet-best-practices/SKILL.md Adds project-oriented .NET best practices skill.
plugins/csharp-dotnet-development/skills/dotnet-upgrade/SKILL.md Adds .NET upgrade analysis/execution prompts skill.
plugins/csharp-mcp-development/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slash from skills.
plugins/csharp-mcp-development/agents/csharp-mcp-expert.md Adds C# MCP server expert agent.
plugins/csharp-mcp-development/skills/csharp-mcp-server-generator/SKILL.md Adds skill to generate a C# MCP server project.
plugins/database-data-management/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/database-data-management/agents/ms-sql-dba.md Adds MS SQL DBA agent.
plugins/database-data-management/agents/postgresql-dba.md Adds PostgreSQL DBA agent.
plugins/database-data-management/skills/postgresql-code-review/SKILL.md Adds PostgreSQL-specific code review skill.
plugins/dataverse/.github/plugin/plugin.json Removes trailing slash from skill path.
plugins/dataverse-sdk-for-python/.github/plugin/plugin.json Removes trailing slashes from all skills paths.
plugins/dataverse-sdk-for-python/skills/dataverse-python-advanced-patterns/SKILL.md Adds advanced Dataverse Python patterns skill.
plugins/dataverse-sdk-for-python/skills/dataverse-python-production-code/SKILL.md Adds production Dataverse Python patterns skill.
plugins/dataverse-sdk-for-python/skills/dataverse-python-quickstart/SKILL.md Adds Dataverse Python quickstart skill.
plugins/dataverse-sdk-for-python/skills/dataverse-python-usecase-builder/SKILL.md Adds Dataverse Python use-case solution builder skill.
plugins/devops-oncall/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/devops-oncall/agents/azure-principal-architect.md Adds Azure principal architect agent (DevOps-oncall plugin).
plugins/devops-oncall/skills/multi-stage-dockerfile/SKILL.md Adds multi-stage Dockerfile best practices skill.
plugins/doublecheck/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slash from skills.
plugins/doublecheck/agents/doublecheck.md Adds Doublecheck verification agent (web tools).
plugins/doublecheck/skills/doublecheck/assets/verification-report-template.md Adds verification report template asset.
plugins/edge-ai-tasks/.github/plugin/plugin.json Switches agents list to "./agents".
plugins/flowstudio-power-automate/.github/plugin/plugin.json Removes trailing slashes from skills paths.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-build/references/build-patterns.md Adds Power Automate build patterns reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-build/references/flow-schema.md Adds Power Automate flow schema reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-build/references/trigger-types.md Adds trigger templates reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-debug/references/common-errors.md Adds common errors reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-debug/references/debug-workflow.md Adds debugging workflow reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-mcp/references/MCP-BOOTSTRAP.md Adds MCP bootstrap reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-mcp/references/action-types.md Adds action types reference.
plugins/flowstudio-power-automate/skills/flowstudio-power-automate-mcp/references/connection-references.md Adds connection references guide.
plugins/frontend-web-dev/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/frontend-web-dev/skills/playwright-explore-website/SKILL.md Adds Playwright exploration skill.
plugins/frontend-web-dev/skills/playwright-generate-test/SKILL.md Adds Playwright test generation skill.
plugins/gem-team/.github/plugin/plugin.json Switches agents list to "./agents".
plugins/gem-team/agents/gem-browser-tester.md Adds browser test subagent instructions.
plugins/gem-team/agents/gem-devops.md Adds DevOps subagent instructions.
plugins/gem-team/agents/gem-documentation-writer.md Adds documentation writer subagent instructions.
plugins/gem-team/agents/gem-implementer.md Adds implementer subagent instructions.
plugins/gem-team/agents/gem-orchestrator.md Adds orchestrator subagent instructions.
plugins/gem-team/agents/gem-reviewer.md Adds reviewer subagent instructions.
plugins/go-mcp-development/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slash from skills.
plugins/go-mcp-development/agents/go-mcp-expert.md Adds Go MCP server expert agent.
plugins/java-development/.github/plugin/plugin.json Removes trailing slashes from skills paths.
plugins/java-development/skills/create-spring-boot-java-project/SKILL.md Adds Spring Boot project skeleton skill.
plugins/java-development/skills/java-docs/SKILL.md Adds Java Javadoc best practices skill.
plugins/java-development/skills/java-junit/SKILL.md Adds JUnit 5 testing best practices skill.
plugins/java-development/skills/java-springboot/SKILL.md Adds Spring Boot best practices skill.
plugins/java-mcp-development/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slash from skills.
plugins/kotlin-mcp-development/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slash from skills.
plugins/kotlin-mcp-development/agents/kotlin-mcp-expert.md Adds Kotlin MCP server expert agent.
plugins/mcp-m365-copilot/.github/plugin/plugin.json Switches agents to "./agents" and removes trailing slashes from skills.
plugins/mcp-m365-copilot/agents/mcp-m365-agent-expert.md Adds Microsoft 365 Copilot + MCP expert agent.

Comment on lines +19 to +24
"./agents"
],
"skills": [
"./skills/mcp-create-declarative-agent/",
"./skills/mcp-create-adaptive-cards/",
"./skills/mcp-deploy-manage-agents/"
"./skills/mcp-create-declarative-agent",
"./skills/mcp-create-adaptive-cards",
"./skills/mcp-deploy-manage-agents"
- Docker
- Docker Compose

- If you need to custom the project name, please change the `artifactId` and the `packageName` in [download-spring-boot-project-template](./create-spring-boot-java-project.prompt.md#download-spring-boot-project-template)
Comment on lines +98 to +101
# Redis configurations
spring.data.redis.host=localhost
spring.data.redis.port=6379
spring.data.redis.password=rootroot
Comment on lines +107 to +111
# JPA configurations
spring.datasource.driver-class-name=org.postgresql.Driver
spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=rootroot
Comment on lines +120 to +125
# MongoDB configurations
spring.data.mongodb.host=localhost
spring.data.mongodb.port=27017
spring.data.mongodb.authentication-database=admin
spring.data.mongodb.username=root
spring.data.mongodb.password=rootroot
- Use try/catch blocks around await expressions
- Avoid swallowing exceptions in async methods
- Use `ConfigureAwait(false)` when appropriate to prevent deadlocks in library code
- Propagate exceptions with `Task.FromException()` instead of throwing in async Task returning methods
}
```
</input_format_guide>

@@ -0,0 +1,60 @@
---
description: 'An agent that helps plan and execute multi-file changes by identifying relevant context and dependencies'
model: 'GPT-5'
@Jugger23 Jugger23 closed this Mar 15, 2026
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