guillemroca/agent-skills-android/constraint-driven-development
Claude Code and agent skill by guillemroca/agent-skills-android
- community
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-developmentSKILL.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 autoor any autonomous loop, where the only thing between the agent andmainis a test suite the agent also wrote
Skip when:
CONSTRAINTS.mdalready 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:
| What | Where to look | |
|---|---|---|
| Modules and build | settings.gradle.kts, each build.gradle.kts, gradle/libs.versions.toml, convention plugins in build-logic/ | |
| Platform levels | minSdk, targetSdk, compileSdk in the app module or convention plugin | |
| Test stack | JUnit4 vs JUnit5, MockK, Turbine, Robolectric, Compose UI test, existing src/test and src/androidTest | |
| Static analysis | lint.xml, lint { } block, lint-baseline.xml, detekt.yml, detekt baseline, .editorconfig (ktlint), Spotless | |
| Coverage | Kover 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.
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.
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.
| Dimension | Tool | Run | Gate on | |
|---|---|---|---|---|
| Lint | Android Lint (abortOnError = true, warningsAsErrors = true) | ./gradlew lintDebug | any error | |
| Static analysis | detekt (maxIssues: 0, baseline for legacy) | ./gradlew detekt | any new issue | |
| Formatting | ktlint via Spotless | ./gradlew spotlessCheck | any violation | |
| Coverage | Kover (or JaCoCo with jacocoTestCoverageVerification) | ./gradlew koverVerify | bound per module | |
| Module boundaries | Konsist tests, or dependency-analysis-gradle-plugin | ./gradlew test / ./gradlew buildHealth | any violation | |
| Secrets | gitleaks | gitleaks detect --redact --no-banner | any finding | |
| Dependencies | Gradle dependency verification + osv-scanner (or OWASP dependency-check) | osv-scanner scan source -r . (reads gradle.lockfile or verification-metadata.xml) / ./gradlew dependencyCheckAnalyze | high or above | |
| Performance | Macrobenchmark + Baseline Profiles; Compose compiler stability reports | ./gradlew :benchmark:connectedBenchmarkAndroidTest | startup / frame-time budget | |
| APK size | diffuse, or a size-check task on assembleRelease output | diffuse diff old.apk new.apk | bytes per PR | |
| Accessibility | Espresso AccessibilityChecks.enable(), Compose semantics tests, Lint a11y checks | ./gradlew connectedDebugAndroidTest | any error-level result | |
| Assertion quality | Pitest (gradle-pitest-plugin), JVM modules only | ./gradlew :<module>:pitest | mutation score |
Coverage rules live in the module's build file, so the number and the check are the same artifact:
Five things that bite if skipped:
- `--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.
- 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. - Scope expensive ones to the change. Pitest on the whole repo takes hours and gets switched off; on the touched module with
targetClassesnarrowed it takes minutes. - Coverage needs no second test run.
koverVerifyreads the same execution datatestproduced; wire it after the test task, don't run the suite twice. - Baselines are debt ledgers, not escape hatches.
lint-baseline.xmland 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:
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.
| Phase | Command | What runs | Budget | |
|---|---|---|---|---|
| BUILD | /build | Compile of the changed module, ktlint/detekt on changed files, the floor | seconds | |
| VERIFY | /test | Changed module's unit tests + koverVerify for that module, gitleaks | under 90s | |
| REVIEW | /review | Full lintDebug, all unit tests, the guard (Step 6) | minutes | |
| SHIP | /ship | Instrumented tests, Macrobenchmark, APK size diff, dependency scans | CI |
Two rules:
- Scope to the diff. Gate coverage of the module a change touched, not the project — that's a number the agent can move.
- Cost decides placement. Anything needing a device or a full
assembleReleaseleaves 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
- SKILL.md in the repositoryCheckingskills/constraint-driven-development/SKILL.md
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
[](https://verified-skill.com/skills/guillemroca/agent-skills-android/constraint-driven-development)