agentleFS
Microsoft AzureKnown publisherAzure/live-voice-practice/.github/copilot-instructions.md

live-voice-practice

Copilot instructions3 starsChanged 8 months agoMITView on GitHub

Repository coding conventions and contribution guidance for the voice practice app

  • In this repositoryOne other file it gives its agents.

The file

Show its rules and text

We split this copilot-instructions.md into the rules it gives an agent

43 rules. About 0 are common, 29 are distinctive, and 14 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈29

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 14

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When generating or modifying code, keep changes focused, minimal, and aligned with existing patterns in the target folder.

    line 13
  2. Distinctive:

    Prefer small, scoped changes over large refactors.

    line 17
  3. Distinctive:

    Follow existing naming and module boundaries.

    line 18
  4. Distinctive:

    Keep public behavior and API shapes stable unless explicitly asked to change them.

    line 19
  5. Distinctive:

    Do not introduce new dependencies unless they are clearly required.

    line 20
  6. Distinctive:

    All implementations in this repository should follow clean code best practices.

    line 25
  7. Distinctive:

    Keep files focused on a single responsibility.

    line 28
  8. Distinctive:

    Prefer small, cohesive functions and components over long procedures with many branches or mixed concerns.

    line 30
  9. Distinctive:

    Use clear names for modules, functions, variables, props, and types so the intent is obvious without excessive comments.

    line 31
  10. Distinctive:

    Avoid duplication. Search for existing services, hooks, helpers, constants, and types before adding new logic.

    line 32
  11. Distinctive:

    Avoid speculative abstractions, but extract code when a file or function is growing because it is handling multiple responsibilities.

    line 40
  12. Distinctive:

    Prefer typed, explicit data shapes over loosely structured dictionaries/objects where practical.

    line 42
  13. Distinctive:

    When modifying a large file, consider whether the change should include a small extraction that improves cohesion while keeping the …

    line 44
  14. Distinctive:

    Add or update tests for behavior changes and for extracted logic that becomes independently testable.

    line 46
  15. Distinctive:

    When an agent is asked to update the solution and run tests in Azure, it should prefer this environment and avoid creating or switching to …

    line 58
  16. Very specific:

    If using AZD, use/select the live-voice environment before provisioning/deploying/testing (for example: azd env select live-voice).

    line 60
  17. Very specific:

    After changing backend, frontend, container configuration, deployment hooks, or app runtime settings that affect the deployed app, prefer …

    line 66
  18. Very specific:

    Treat azd deploy as the expected happy path for incremental application delivery.

    line 67
  19. Very specific:

    Before any AZD deploy/provision operation, select the live-voice environment and keep the deploy scoped to the default subscription and …

    line 68
  20. Very specific:

    If azd deploy fails, treat that as a blocker to resolve rather than something to work around.

    line 69
  21. Very specific:

    When making changes that are meant to be exercised in Azure, prefer validating them with azd deploy before finishing whenever credentials …

    line 71
  22. Distinctive:

    Follow PEP 8 style with project-specific line length of 120.

    line 77
  23. Distinctive:

    Use type hints on function signatures, especially for new or changed functions.

    line 78
  24. Distinctive:

    Add clear docstrings for new public functions/classes and tests where useful.

    line 79
  25. Very specific:

    Keep route handlers thin; move non-trivial logic into backend/src/services/.

    line 80
  26. Very specific:

    Use structured logging via logging (avoid ad-hoc print).

    line 82
  27. Distinctive:

    Prefer async-friendly patterns already used by services and handlers.

    line 84
  28. Distinctive:

    Before finishing backend changes, run (from repository root when possible):

    line 93
  29. Very specific:

    Keep TypeScript strict compatibility.

    line 102
  30. Distinctive:

    Prefer functional React components and hooks.

    line 103
  31. Very specific:

    Place reusable UI in frontend/src/components/ and shared behavior in frontend/src/hooks/.

    line 104
  32. Very specific:

    Keep API/network logic in frontend/src/services/.

    line 105
  33. Distinctive:

    Use Fluent UI tokens/components for styling consistency.

    line 106
  34. Very specific:

    Avoid any; if unavoidable, isolate and narrow quickly.

    line 107
  35. Very specific:

    Follow existing state patterns (useState, useCallback) and avoid unnecessary abstractions.

    line 108
  36. Distinctive:

    Before finishing frontend changes:

    line 116
  37. Very specific:

    Add or update tests for behavior changes, especially in backend/tests/unit/.

    line 123
  38. Distinctive:

    Keep tests deterministic and mock external services/network calls.

    line 125
  39. Distinctive:

    If changing request/response payloads, update both backend and frontend call sites.

    line 129
  40. Distinctive:

    Avoid mixing infrastructure refactors with feature work unless required.

    line 136
  41. Distinctive:

    Do not add unrelated refactors in the same change.

    line 140
  42. Distinctive:

    Do not introduce new architecture patterns unless current ones are insufficient.

    line 141
  43. Distinctive:

    Do not hardcode secrets, keys, or environment-specific values.

    line 142

≈ “Common” is an estimate: at least 1 in 5 of the 1,644 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
copilot-instructions.md

Live Voice Practice - Copilot Instructions

This repository contains:

  • backend/: Python Flask API + WebSocket voice proxy + scenario/analysis services
  • frontend/: React + TypeScript + Fluent UI client
  • infra/: Azure Bicep infrastructure

When generating or modifying code, keep changes focused, minimal, and aligned with existing patterns in the target folder.

General Guidelines

  • Prefer small, scoped changes over large refactors.
  • Follow existing naming and module boundaries.
  • Keep public behavior and API shapes stable unless explicitly asked to change them.
  • Do not introduce new dependencies unless they are clearly required.
  • Reuse existing services/hooks/components before creating new ones.

Clean Code and Modularity Expectations

All implementations in this repository should follow clean code best practices. Optimize for code that is easy to read, easy to review, and safe to change later.

  • Keep files focused on a single responsibility. Avoid adding more code to already-large files when the behavior can be extracted into a service, hook, component, helper, or module that matches the existing project structure.
  • Prefer small, cohesive functions and components over long procedures with many branches or mixed concerns.
  • Use clear names for modules, functions, variables, props, and types so the intent is obvious without excessive comments.
  • Avoid duplication. Search for existing services, hooks, helpers, constants, and types before adding new logic.
  • Separate orchestration from business logic: route handlers, React screen components, and deployment scripts should stay thin and delegate non-trivial work to focused modules.
  • Keep boundaries explicit:
    • backend API routes in backend/src/app.py should delegate domain logic to backend/src/services/.
    • frontend screens should delegate reusable UI to frontend/src/components/, behavior to frontend/src/hooks/, and network calls to frontend/src/services/.
    • infrastructure changes should preserve the module/parameter pattern under infra/.
  • Avoid speculative abstractions, but extract code when a file or function is growing because it is handling multiple responsibilities.
  • Prefer typed, explicit data shapes over loosely structured dictionaries/objects where practical.
  • Surface errors clearly and consistently; do not hide failures with silent fallbacks or broad catch-all handling.
  • When modifying a large file, consider whether the change should include a small extraction that improves cohesion while keeping the behavior stable.
  • Add or update tests for behavior changes and for extracted logic that becomes independently testable.

Azure Dev Environment Targeting

For any Azure-related build, deploy, validation, or test operation in this repository, target this development environment by default:

  • Subscription: 9788a92c-2f71-4629-8173-7ad449cb50e1
  • Resource group: rg-live-voice
  • Full scope: /subscriptions/9788a92c-2f71-4629-8173-7ad449cb50e1/resourceGroups/rg-live-voice
  • AZD environment name: live-voice
  • JSON setting: "azd-env-name": "live-voice"

When an agent is asked to update the solution and run tests in Azure, it should prefer this environment and avoid creating or switching to a different subscription/resource group unless explicitly requested.

If using AZD, use/select the live-voice environment before provisioning/deploying/testing (for example: azd env select live-voice).

AZD Deployment Workflow

For Azure-related application changes in this repository, prefer azd deploy as the default deployment path.

  • After changing backend, frontend, container configuration, deployment hooks, or app runtime settings that affect the deployed app, prefer running azd deploy from the repository root instead of ad-hoc Azure CLI, portal, or one-off container deployment commands.
  • Treat azd deploy as the expected happy path for incremental application delivery. Use azd provision only when infrastructure changes require it, then follow with azd deploy. Use azd up only when the task explicitly needs the full provision-and-deploy flow.
  • Before any AZD deploy/provision operation, select the live-voice environment and keep the deploy scoped to the default subscription and resource group unless the user explicitly asks otherwise.
  • If azd deploy fails, treat that as a blocker to resolve rather than something to work around. Investigate the root cause, fix the relevant code, configuration, script, or environment issue, and rerun azd deploy.
  • Do not claim Azure work is complete if the intended deployment path is azd deploy and it is still broken, unless an external blocker remains that cannot be resolved from the repository or current environment. In that case, report the exact blocker and the next required action.
  • When making changes that are meant to be exercised in Azure, prefer validating them with azd deploy before finishing whenever credentials and environment access are available.

Backend (Python) Conventions

Applies to files under backend/**/*.py.

  • Follow PEP 8 style with project-specific line length of 120.
  • Use type hints on function signatures, especially for new or changed functions.
  • Add clear docstrings for new public functions/classes and tests where useful.
  • Keep route handlers thin; move non-trivial logic into backend/src/services/.
  • Reuse constants for endpoint paths, status codes, and repeated messages (as in backend/src/app.py).
  • Use structured logging via logging (avoid ad-hoc print).
  • Handle exceptions explicitly and return meaningful API error payloads.
  • Prefer async-friendly patterns already used by services and handlers.

Backend Tooling Expectations

  • Formatting: black (configured in backend/pyproject.toml, line length 120)
  • Linting: flake8, pylint, ruff
  • Type checking: mypy (non-strict, use pragmatic typing)
  • Testing: pytest with tests under backend/tests/

Before finishing backend changes, run (from repository root when possible):

  • ./scripts/format.sh (or cd backend && black . --config pyproject.toml)
  • ./scripts/lint.sh (or cd backend && flake8 . --config=.flake8)
  • cd backend && pytest

Frontend (TypeScript/React) Conventions

Applies to files under frontend/src/**/*.{ts,tsx}.

  • Keep TypeScript strict compatibility; avoid weakening compiler settings.
  • Prefer functional React components and hooks.
  • Place reusable UI in frontend/src/components/ and shared behavior in frontend/src/hooks/.
  • Keep API/network logic in frontend/src/services/.
  • Use Fluent UI tokens/components for styling consistency.
  • Avoid any; if unavoidable, isolate and narrow quickly.
  • Follow existing state patterns (useState, useCallback) and avoid unnecessary abstractions.

Frontend Tooling Expectations

  • Linting: ESLint (frontend/eslint.config.js)
  • Formatting: Prettier
  • Build/type check: npm run build

Before finishing frontend changes:

  • cd frontend && npm run format
  • cd frontend && npm run lint
  • cd frontend && npm run build

Testing Guidance

  • Add or update tests for behavior changes, especially in backend/tests/unit/.
  • Cover critical paths and common edge cases (invalid payloads, missing fields, error flows).
  • Keep tests deterministic and mock external services/network calls.

API and Contract Safety

  • If changing request/response payloads, update both backend and frontend call sites.
  • Preserve existing endpoint routes unless explicitly requested.
  • Validate user input at API boundaries and return consistent JSON errors.

Infrastructure Notes

  • Infra is Bicep-based under infra/; keep infra changes separate from app logic when possible.
  • Avoid mixing infrastructure refactors with feature work unless required.

What to Avoid

  • Do not add unrelated refactors in the same change.
  • Do not introduce new architecture patterns unless current ones are insufficient.
  • Do not hardcode secrets, keys, or environment-specific values.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.