MR
Mayur Rathi
@github
⭐ 34.1k GitHub stars

Bicep-Code-Best-Practices

Bicep-Code-Best-Practices是一款code方向的AI技能,核心价值是Infrastructure as Code with Bicep,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。

Infrastructure as Code with Bicep

Last verified on: 2026-05-30
mkdir -p ./skills/bicep-code-best-practices && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/bicep-code-best-practices/SKILL.md -o ./skills/bicep-code-best-practices/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

Naming Conventions


- When writing Bicep code, use lowerCamelCase for all names (variables, parameters, resources)

- Use resource type descriptive symbolic names (e.g., 'storageAccount' not 'storageAccountName')

- Avoid using 'name' in a symbolic name as it represents the resource, not the resource's name

- Avoid distinguishing variables and parameters by the use of suffixes


Structure and Declaration


- Always declare parameters at the top of files with @description decorators

- Use latest stable API versions for all resources

- Use descriptive @description decorators for all parameters

- Specify minimum and maximum character length for naming parameters


Parameters


- Set default values that are safe for test environments (use low-cost pricing tiers)

- Use @allowed decorator sparingly to avoid blocking valid deployments

- Use parameters for settings that change between deployments


Variables


- Variables automatically infer type from the resolved value

- Use variables to contain complex expressions instead of embedding them directly in resource properties


Resource References


- Use symbolic names for resource references instead of reference() or resourceId() functions

- Create resource dependencies through symbolic names (resourceA.id) not explicit dependsOn

- For accessing properties from other resources, use the 'existing' keyword instead of passing values through outputs


Resource Names


- Use template expressions with uniqueString() to create meaningful and unique resource names

- Add prefixes to uniqueString() results since some resources don't allow names starting with numbers


Child Resources


- Avoid excessive nesting of child resources

- Use parent property or nesting instead of constructing resource names for child resources


Security


- Never include secrets or keys in outputs

- Use resource properties directly in outputs (e.g., storageAccount.properties.primaryEndpoints)


Documentation


- Include helpful // comments within your Bicep files to improve readability

🎯 Best For

  • Claude users
  • GitHub Copilot users
  • Software engineers
  • Development teams
  • Tech leads

💡 Use Cases

  • Code quality improvement
  • Best practice enforcement

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Bicep-Code-Best-Practices to Your Work

    Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.

  4. 4

    Review and Refine

    Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.

❓ Frequently Asked Questions

Is Bicep-Code-Best-Practices compatible with Cursor and VS Code?

Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.

Do I need specific dependencies for Bicep-Code-Best-Practices?

Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.

How do I install Bicep-Code-Best-Practices?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/bicep-code-best-practices/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Skipping validation

Always test AI-generated code changes, even for simple refactors.

Missing dependency updates

Check if the skill requires updated dependencies or new packages.

🔗 Related Skills