Skip to content

Prompts and Patterns

This document captures reusable prompt patterns that work well for ConnectSoft-style work. It is written for ConnectSoft team members using AI assistants in their daily work.

Effective prompts are structured, contextual, and aligned with ConnectSoft patterns. This guide provides reusable prompt templates for common tasks.

Tip

Prompt Best Practices: 1. Always specify role (e.g., "You are a .NET architect...") 2. Provide context (project, repo, file, existing patterns) 3. Ask for structured outputs (tables, headings, sections) 4. Reference ConnectSoft patterns and principles 5. Request specific formats (Markdown, code, diagrams)

General Prompting Guidelines

Structure Your Prompts

Good Prompt Structure: 1. Role - Define AI's role and expertise 2. Context - Provide relevant context (project, files, patterns) 3. Goal - Clearly state what you want 4. Constraints - Specify constraints and requirements 5. Output Format - Request specific output format

Provide Context

  • Project Context - What project are you working on?
  • File Context - What files are relevant?
  • Pattern Context - What ConnectSoft patterns apply?
  • Existing Code - What existing code should be considered?

Request Structured Outputs

  • Tables - For comparisons, lists, matrices
  • Headings - For documentation structure
  • Code Blocks - For code examples
  • Checklists - For tasks and requirements
  • Diagrams - For Mermaid diagrams

Architecture and Design Prompts

Prompt Template: Bounded Context Design

You are an expert .NET architect working on the ConnectSoft AI Factory.

Goal: Design a new bounded context for [context name] in [project name].

Context:
- Project: [project description]
- Existing bounded contexts: [list existing contexts]
- Domain: [domain description]
- Key entities: [list entities]

Constraints:
- Must follow Clean Architecture and DDD principles
- Must use ConnectSoft microservice template
- Must integrate with [platforms: Identity, Audit, Config]
- Must be event-driven

Output:
- Bounded context boundaries
- Key aggregates and entities
- Domain events
- Integration points with other contexts
- API contracts (REST/gRPC)

Prompt Template: API Design

You are an expert API designer working on ConnectSoft projects.

Goal: Design REST API for [service name] bounded context.

Context:
- Bounded context: [context description]
- Key aggregates: [list aggregates]
- Use cases: [list use cases]

Constraints:
- Follow RESTful principles
- Use standard HTTP methods and status codes
- Include OpenAPI/Swagger documentation
- Support multi-tenancy

Output:
- Resource endpoints (GET, POST, PUT, DELETE)
- Request/response models
- Error responses
- OpenAPI specification structure

Prompt Template: Event Modeling

You are an expert event-driven architect working on ConnectSoft projects.

Goal: Design domain and integration events for [bounded context].

Context:
- Bounded context: [context description]
- Key aggregates: [list aggregates]
- Use cases: [list use cases]
- Downstream consumers: [list consumers]

Constraints:
- Follow event-driven architecture principles
- Use MassTransit event patterns
- Include event versioning
- Support event sourcing where applicable

Output:
- Domain events (within context)
- Integration events (cross-context)
- Event schemas (JSON)
- Event versioning strategy

Documentation Prompts

Prompt Template: Documentation Structure

You are the ConnectSoft Documentation Editor.

Goal: Create documentation structure for [topic] following ConnectSoft style.

Context:
- Topic: [topic description]
- Audience: [target audience]
- Related docs: [list related docs]

Constraints:
- Follow ConnectSoft documentation style guide
- Use single # title
- Include 1-3 sentence intro
- Use logical ## and ### headings
- Include appropriate callouts (note, tip, important, warning)
- Cross-link to related docs

Output:
- Documentation structure with headings
- Brief description of each section
- Suggested callouts
- Cross-links to related docs

Prompt Template: Documentation Review

You are the ConnectSoft Documentation Editor reviewing documentation.

Goal: Review [document] for style, consistency, and completeness.

Context:
- Document: [document path/content]
- Style guide: ConnectSoft documentation style guide
- Related docs: [list related docs]

Check for:
- Single # title
- 1-3 sentence intro
- Logical heading structure
- Appropriate callouts
- Cross-links to related docs
- Consistent terminology
- Missing sections

Output:
- Style issues found
- Missing elements
- Suggested improvements
- Cross-link suggestions

Code and Refactoring Prompts

Prompt Template: Code Generation

You are an expert .NET engineer working on ConnectSoft projects.

Goal: Generate [component type] following ConnectSoft patterns.

Context:
- Project: [project name]
- Bounded context: [context name]
- Template: ConnectSoft microservice template
- Libraries: ConnectSoft.Extensions.* [list libraries]

Constraints:
- Follow Clean Architecture (Domain → Application → Infrastructure)
- Use DDD patterns (aggregates, entities, domain events)
- Include observability (logging, tracing, metrics)
- Include tests (unit, integration)
- Use ConnectSoft libraries

Output:
- Code structure
- Implementation following ConnectSoft patterns
- Tests
- Documentation

Prompt Template: Refactoring

You are an expert .NET architect reviewing code for refactoring.

Goal: Refactor [component] to follow ConnectSoft patterns.

Context:
- Current code: [code snippet]
- Target pattern: [ConnectSoft pattern]
- Related code: [related files]

Constraints:
- Maintain backward compatibility
- Follow Clean Architecture
- Use ConnectSoft libraries
- Include tests
- Preserve functionality

Output:
- Refactored code
- Explanation of changes
- Migration notes
- Test updates

"Factory-Aware" Prompts

Prompt Template: Factory Run Planning

You are a ConnectSoft Factory architect planning a Factory run.

Goal: Plan Factory run for [bounded context/service].

Context:
- Bounded context: [context description]
- Requirements: [requirements]
- Existing services: [list existing services]
- Platforms: [Identity, Audit, Config, Bot]

Factory Components:
- Templates: Microservice template
- Libraries: ConnectSoft.Extensions.*
- Agents: Vision, Architect, Engineering, QA
- Platforms: [list platforms]

Output:
- Factory run plan
- Template parameters
- Library dependencies
- Platform integrations
- Expected outputs

Prompt Template: ADR/BDR Drafting

You are documenting a ConnectSoft architecture/business decision.

Goal: Draft ADR/BDR for [decision topic].

Context:
- Decision: [decision description]
- Alternatives considered: [list alternatives]
- Context: [decision context]
- Stakeholders: [list stakeholders]

Format:
- Title: ADR/BDR-XXXX: [title]
- Status: [Proposed, Accepted, Deprecated]
- Context: [background]
- Decision: [decision]
- Consequences: [consequences]

Output:
- ADR/BDR following ConnectSoft format
- Structured sections
- Clear decision and rationale