guillemroca/agent-skills-android/constraint-driven-development

Claude Code and agent skill by guillemroca/agent-skills-android

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when an Android project has no written quality bar, when the user says "set up constraints" or "define our standards", when coverage, performance, or accessibility should become enforced gates instead of per-PR arguments, when an agent keeps silencing checks or skipping tests to get to green, or when a threshold is needed and nobody knows what number to pick. Records the bar in CONSTRAINTS.md with a number and a Gradle command behind every rule, installs the de facto Android tool per dimension (Android Lint, detekt, Kover, Macrobenchmark, gitleaks), places checks by cost, and guards the diff against a lowered bar: new @Suppress or @SuppressLint, @Ignore or @Disabled tests, stripped assertions, TODO() stubs, grown lint or detekt baselines, thresholds edited down.

Install

npx vskill@latest install guillemroca/agent-skills-android/constraint-driven-development

SKILL.md

The same SKILL.md was published earlier as guillemroca/agent-skills-android/constraint-driven-development.

Constraint-Driven Development

Overview

Other skills describe what good looks like: code-review-and-quality gives five axes, test-driven-development a cycle, security-and-hardening a threat list. That is prose an agent may or may not follow, and none of it survives the session. This skill produces a written record of this project's bar, with numbers and the command that checks each one, that outlives the conversation and runs mechanically.

The reason: when you wrote the code, reading it told you whether it was good. An agent writes more in an afternoon than you will read that week, so judgement moves out of your head and into checks that run around the loop. Those checks need to exist, carry numbers you chose, and fire close enough to the work that the agent fixes its own output.

Spec-driven development says what to build. Test-driven development proves it works. Constraint-driven development defines "good enough to ship" before anyone argues about it in a pull request.

When to Use

  • Starting a project or significant feature and no quality bar is written down
  • The user asks to "set up constraints", "add quality gates", "define our standards"
  • An agent is producing volume nobody reads line by line
  • CI runs lint, detekt, and tests, but nobody can say which ones block a merge
  • Coverage, startup time, APK size, or accessibility get argued per PR instead of decided once
  • Before /build auto or any autonomous loop, where the only thing between the agent and main is a test suite the agent also wrote

Skip when:

  • CONSTRAINTS.md already exists and the user isn't changing it — read and follow it
  • Spikes, throwaway prototypes, one-off scripts
  • The user wants a review now (code-review-and-quality) or a pipeline built (ci-cd-and-automation)

Non-interactive contexts (CI, scheduled loops, autonomous runs): the interview needs a live user. If constraints are missing, apply the Floor below, say you did, and flag the rest for a human.

Core Process

Step 1: Detect Before You Ask

Never ask what you can read. Gather this first:

WhatWhere to look
Modules and buildsettings.gradle.kts, each build.gradle.kts, gradle/libs.versions.toml, convention plugins in build-logic/
Platform levelsminSdk, targetSdk, compileSdk in the app module or convention plugin
Test stackJUnit4 vs JUnit5, MockK, Turbine, Robolectric, Compose UI test, existing src/test and src/androidTest
Static analysislint.xml, lint { } block, lint-baseline.xml, detekt.yml, detekt baseline, .editorconfig (ktlint), Spotless
CoverageKover or JaCoCo plugin, existing koverVerify rules, last report under build/reports/
Performance:benchmark / :baselineprofile module, baseline-prof.txt, Compose compiler reports enabled
CI and agents.github/workflows/, AGENTS.md, CLAUDE.md, .claude/

Report what you found in two lines, then ask only what's left.

Step 2: Four Questions, Each With a Default

Follow the one-question-at-a-time discipline from interview-me, with one change: every question has a default, so "I don't know" still produces a working config.

Q1: Beyond the floor, which do you want enforced?
(a) Coverage on changed code (b) Static analysis at zero new issues
(c) Security: secrets + dependencies (d) Performance budgets
(e) Accessibility (f) Module boundaries
GUESS: (a), (b), (c) — you have Kover and detekt already.
DEFAULT if unsure: (a), (b), (c).
Cost: (d) and (e) need a device or emulator; (f) needs rules written.
Q2: When a check fails mid-task, block or warn?
GUESS: Block. Unattended agents ignore warnings.
DEFAULT if unsure: Block on the floor, warn on the rest for two weeks.
Q3: Target numbers in mind, or measure today and hold the line?
GUESS: Measure. An invented number gets ignored.
DEFAULT if unsure: Measure and hold (see Step 7).
Q4: Slowest check you'll tolerate before the agent hands work back?
GUESS: About 90 seconds — a single module's unit tests plus koverVerify.
DEFAULT if unsure: 90 seconds at task end, unlimited in CI.

Stop at four. A twelve-question intake produces a config nobody understands.

Step 3: Write CONSTRAINTS.md

One file at the repo root. Any agent on any harness can read it, and a change to it shows up in review.

markdown
# Constraints
Last reviewed: 2026-10-04 by @owner
## Floor (always enforced, no setup required)
-Builds: `./gradlew assembleDebug` succeeds
-Unit tests: `./gradlew testDebugUnitTest` passes
-No new suppressions without a `// reason:` on the same line: `@Suppress`, `@SuppressLint`, `//noinspection`, `ktlint-disable`, `tools:ignore`
-No new `@Ignore` / `@Disabled` tests, no deleted tests, no assertions stripped from tests that stayed
-No `TODO()`, `NotImplementedError`, or empty `catch {}` on shipped (non-test) paths
-No growth of `lint-baseline.xml` or the detekt baseline
-No secrets in source
-This file does not get weakened to make a change pass
## Enforced with numbers
| Dimension | Rule | Checked by | Runs at |
|-----------|------|-----------|---------|
| Formatting | Zero violations | `./gradlew spotlessCheck` | every edit |
| Static analysis | Zero new detekt issues, maxIssues 0 | `./gradlew :<module>:detekt` | every edit |
| Lint | Zero errors, warnings as errors | `./gradlew lintDebug` | CI |
| Coverage | Changed domain/data modules ≥ 80% lines | `./gradlew :<module>:koverVerify` | task end, CI |
| Secrets | No findings | `gitleaks detect --redact --no-banner` | task end, CI |
| Dependencies | Nothing at high or above | `osv-scanner scan source -r .` | CI |
| Startup | Cold start median ≤ 500ms | `./gradlew :benchmark:connectedBenchmarkAndroidTest` | CI (emulator) |
| APK size | Release APK grows ≤ 100 KB per PR | `diffuse diff` on base vs head APK | CI |
Every row names the command that produces the verdict. A number with no
command is an aspiration, not a constraint.
## Measured, not yet enforced
| Metric | Today | Direction |
|--------|-------|-----------|
| Project line coverage | 62.4% | must not fall |
| lint-baseline.xml issues | 214 | must not grow |
| Release APK size | 18.3 MB | must not grow |
## Exceptions
| ID | Rule | Path | Reason | Owner | Expires |
|----|------|------|--------|-------|---------|
| W1 | detekt LongMethod | `feature/legacy/**` | Rewrite tracked in ENG-441 | @owner | 2027-01-01 |

Then add one line to AGENTS.md and CLAUDE.md: Read CONSTRAINTS.md before writing code. Do not weaken it to make a change pass. (see context-engineering).

Step 4: Install a Tool per Dimension

Picking a dimension means installing something. Don't leave a number with no mechanism, and don't hand-roll a checker when a de facto tool exists — the team's existing config and CI already target these.

DimensionToolRunGate on
LintAndroid Lint (abortOnError = true, warningsAsErrors = true)./gradlew lintDebugany error
Static analysisdetekt (maxIssues: 0, baseline for legacy)./gradlew detektany new issue
Formattingktlint via Spotless./gradlew spotlessCheckany violation
CoverageKover (or JaCoCo with jacocoTestCoverageVerification)./gradlew koverVerifybound per module
Module boundariesKonsist tests, or dependency-analysis-gradle-plugin./gradlew test / ./gradlew buildHealthany violation
Secretsgitleaksgitleaks detect --redact --no-bannerany finding
DependenciesGradle dependency verification + osv-scanner (or OWASP dependency-check)osv-scanner scan source -r . (reads gradle.lockfile or verification-metadata.xml) / ./gradlew dependencyCheckAnalyzehigh or above
PerformanceMacrobenchmark + Baseline Profiles; Compose compiler stability reports./gradlew :benchmark:connectedBenchmarkAndroidTeststartup / frame-time budget
APK sizediffuse, or a size-check task on assembleRelease outputdiffuse diff old.apk new.apkbytes per PR
AccessibilityEspresso AccessibilityChecks.enable(), Compose semantics tests, Lint a11y checks./gradlew connectedDebugAndroidTestany error-level result
Assertion qualityPitest (gradle-pitest-plugin), JVM modules only./gradlew :<module>:pitestmutation score

Coverage rules live in the module's build file, so the number and the check are the same artifact:

kotlin
// core/domain/build.gradle.kts
plugins {
id("org.jetbrains.kotlinx.kover")
}
kover {
reports {
verify {
rule("Domain line coverage — see CONSTRAINTS.md") {
bound {
minValue = 80
coverageUnits = kotlinx.kover.gradle.plugin.dsl.CoverageUnit.LINE
}
}
}
}
}

Five things that bite if skipped:

  1. `--redact` on gitleaks is not optional. Without it the matched secret lands in the agent's transcript, then a log or a commit message. Report the rule and location, never the value.
  2. Macrobenchmark, instrumented accessibility checks, and `connected*` tasks need a device. If CI has no emulator (see ci-cd-and-automation), keep those dimensions measured-only or CI-only on a device farm — don't pretend a JVM test covers them.
  3. Scope expensive ones to the change. Pitest on the whole repo takes hours and gets switched off; on the touched module with targetClasses narrowed it takes minutes.
  4. Coverage needs no second test run. koverVerify reads the same execution data test produced; wire it after the test task, don't run the suite twice.
  5. Baselines are debt ledgers, not escape hatches. lint-baseline.xml and the detekt baseline may shrink. Regenerating one to absorb new issues is a lowered bar (Step 6).

Expose the stages as Gradle tasks so they are reproducible without an agent. A root-level aggregate keeps the commands in one place:

kotlin
// build.gradle.kts (root)
tasks.register("checkFast") {
group = "verification"
description = "Edit loop: formatting + detekt. Mirrors CONSTRAINTS.md."
dependsOn("spotlessCheck", "detekt")
}
tasks.register("checkTask") {
group = "verification"
description = "Task end: checkFast + unit tests + coverage bounds."
dependsOn("checkFast", "testDebugUnitTest", "koverVerify")
}
tasks.register("checkFull") {
group = "verification"
description = "CI: checkTask + full lint + dependency scan."
dependsOn("checkTask", "lintDebug", "dependencyCheckAnalyze")
}

CONSTRAINTS.md is the canonical source: it carries the reason beside each command and shows up in review. The Gradle tasks mirror it; if they drift, the file wins. Run module-scoped variants in the loop (./gradlew :feature:tasks:detekt) — checkFast at the root is for humans and hooks.

Step 5: Place Checks by Cost

A check that stalls the agent gets switched off, and a switched-off gate is worse than none because the bar still looks like it exists.

PhaseCommandWhat runsBudget
BUILD/buildCompile of the changed module, ktlint/detekt on changed files, the floorseconds
VERIFY/testChanged module's unit tests + koverVerify for that module, gitleaksunder 90s
REVIEW/reviewFull lintDebug, all unit tests, the guard (Step 6)minutes
SHIP/shipInstrumented tests, Macrobenchmark, APK size diff, dependency scansCI

Two rules:

  1. Scope to the diff. Gate coverage of the module a change touched, not the project — that's a number the agent can move.
  2. Cost decides placement. Anything needing a device or a full assembleRelease leaves the edit loop.
Step 6: Guard the Bar Itself

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/guillemroca/agent-skills-android/constraint-driven-development/badge)](https://verified-skill.com/skills/guillemroca/agent-skills-android/constraint-driven-development)

Something wrong with this skill or its page? Tell us.