home / skills / pluginagentmarketplace / custom-plugin-android / production

production skill

/skills/production

This skill helps you implement production quality practices for Android apps, covering testing, security, and deployment to Play Store.

npx playbooks add skill pluginagentmarketplace/custom-plugin-android --skill production

Review the files below or copy the command above to add this skill to your agents.

Files (8)
SKILL.md
2.3 KB
---
name: production
description: Unit testing, performance optimization, security implementation, Play Store deployment.
version: "2.0.0"
sasmp_version: "1.3.0"

# Agent Binding
bonded_agent: 07-production
bond_type: PRIMARY_BOND

# Skill Configuration
atomic: true
single_responsibility: Production quality & deployment

# Parameter Validation
parameters:
  concern:
    type: string
    enum: [testing, performance, security, deployment]
    required: false
  urgency:
    type: string
    enum: [low, medium, high, critical]
    default: medium

# Retry Configuration
retry:
  max_attempts: 3
  backoff: exponential
  on_failure: escalate_to_human

# Observability
logging:
  level: warn
  include: [concern_type, security_level, test_coverage]
---

# Production Quality Skill

## Quick Start

### Unit Testing
```kotlin
@Test
fun loadUser_updates_state() = runTest {
    val user = User(1, "John")
    val mockRepo = mockk<UserRepository>()
    coEvery { mockRepo.getUser(1) } returns user
    
    val viewModel = UserViewModel(mockRepo)
    viewModel.loadUser(1)
    
    assertEquals(user, viewModel.state.value)
}
```

### Security
```kotlin
// Encrypted storage
val prefs = EncryptedSharedPreferences.create(context, "secret",
    MasterKey.Builder(context).build(), AES256_SIV, AES256_GCM)

// SSL pinning
CertificatePinner.Builder()
    .add("api.example.com", "sha256/...").build()
```

### Play Store Deployment
```bash
./gradlew bundleRelease
# Upload to Google Play Console
# Monitor crashes and ratings
```

## Key Concepts

### Testing
- Unit tests (70-80% coverage)
- Integration tests
- UI tests with Espresso
- Mock external dependencies

### Performance
- ANR prevention
- Memory leak detection
- 60 FPS target
- Battery optimization

### Security
- Data encryption
- HTTPS/SSL pinning
- Permission handling
- OWASP Top 10

### Deployment
- Internal → Closed → Open → Production
- Staged rollout strategy
- Crash analytics monitoring
- User rating management

## Best Practices

✅ Write comprehensive tests
✅ Profile regularly
✅ Implement security features
✅ Monitor production apps
✅ Use staged rollouts

## Resources

- [Testing Guide](https://developer.android.com/training/testing)
- [Security & Privacy](https://developer.android.com/privacy-and-security)
- [Play Console Help](https://support.google.com/googleplay)

Overview

This skill helps Android developers prepare apps for production by focusing on unit testing, performance optimization, security hardening, and Play Store deployment. It packages practical checks and recommended workflows to raise app reliability, protect user data, and streamline releases. Use it to move from development builds to a monitored, staged production rollout with confidence.

How this skill works

The skill inspects and guides four core areas: test coverage and test types, runtime performance and resource usage, security controls like encrypted storage and SSL pinning, and release procedures for Google Play. It provides concrete code patterns, profiling checkpoints, and a recommended deployment flow (internal → closed → open → production) plus monitoring steps to respond to crashes and ratings. Outputs are actionable steps and sample commands to run during CI and release cycles.

When to use it

  • Before merging major features or releasing an app build to testers
  • When you need to raise test coverage and prevent regressions
  • To identify and fix memory leaks, ANRs, and frame drops
  • When implementing encryption, SSL pinning, and permission checks
  • During Play Store rollout planning and crash/ratings monitoring

Best practices

  • Aim for 70–80% unit test coverage and add integration/UI tests for critical flows
  • Mock external dependencies in tests and use runTest for coroutine-based code
  • Profile regularly for CPU, memory, and render time; fix leaks and long-running tasks
  • Encrypt sensitive data with EncryptedSharedPreferences and enforce HTTPS with certificate pinning
  • Use staged rollouts and monitor crash analytics and user feedback before wide release

Example use cases

  • Adding unit and UI tests for a user profile flow before a major release
  • Detecting and fixing a memory leak causing background crashes
  • Implementing EncryptedSharedPreferences and CertificatePinner for secure data transport
  • Automating bundleRelease in CI and performing a staged rollout via Play Console
  • Setting up monitoring to track crash rate and user ratings after deployment

FAQ

What tests should I prioritize?

Start with unit tests for business logic and repository layers, add integration tests for service interactions, and UI tests for critical user journeys.

How do I minimize rollout risk?

Use internal and closed tracks first, run a staged rollout, monitor crash analytics and ratings, and halt or roll back if issues exceed thresholds.