home / skills / hoangnguyen0403 / agent-skills-standard / resources
This skill helps enforce Android resource and localization best practices by guiding string usage in XML, vector drawables, and dark mode theming.
npx playbooks add skill hoangnguyen0403/agent-skills-standard --skill resourcesReview the files below or copy the command above to add this skill to your agents.
---
name: Android Resources & Localization
description: Standards for Strings, Drawables, and Localization
metadata:
labels: [android, resources, localization, xml]
triggers:
files: ['strings.xml', '**/*Screen.kt']
keywords: ['stringResource', 'plurals', 'R.string']
---
# Android Resources Standards
## **Priority: P2**
## Implementation Guidelines
### Strings
- **No Hardcoding**: UI text MUST be in `strings.xml`.
- **Formatting**: Use format args (`%s`, `%d`) instead of concatenation.
- **Plurals**: Use `<plurals>` for quantities.
### Assets / Drawables
- **Vectors**: Prefer VectorDrawables (`.xml`) over RASTER images.
- **Dark Mode**: Use `values-night` or Theme attributes (`MaterialTheme.colorScheme.primary`) instead of hardcoded colors.
## Anti-Patterns
- **Concatenation in UI**: `**No String Concat**: Use resource templates.`
- **Hardcoded Strings**: `**No hardcoded text**: Extract to XML.`
## References
- [XML Structure](references/implementation.md)
This skill documents standards for Android resources and localization to ensure consistent, maintainable UI text and assets. It focuses on string management, formatting, pluralization, drawable choices, and dark mode handling. The goal is to reduce bugs, improve translation workflows, and enforce reusable resource patterns.
The skill inspects code and resource files to verify that UI text is defined in strings.xml, that format arguments and plurals are used where appropriate, and that no hardcoded strings appear in layouts or code. It checks drawable usage to prefer VectorDrawables over raster images and enforces night-mode resource or theme-based color usage instead of hardcoded colors. The skill flags common anti-patterns like string concatenation in UI and missing plural resources.
What if a string contains both dynamic data and fixed text?
Use a string resource with format args (e.g., "Welcome, %1$s") and supply values from code to avoid concatenation and enable translations.
When should I use a raster image instead of a VectorDrawable?
Use raster images for complex artwork or photos where vectors are impractical; prefer vectors for icons and simple UI graphics to save size and ensure sharp scaling.