Pdf_Tools
AGENTS.md625 starsChanged 43 days agoApache-2.0View on GitHub
This project is an Android app with multiple product flavors (Play Store / F-Droid / Open Source). Use this file as the source of truth for how to build, release, and keep F-Droid metadata working in CI. F-Droid’s checkupdates cannot extract version info if it is dynamic. This project keeps static version values in gradle.properties: app/build.gradle.kts reads those properties for versionCode/versionName to remain F-Droid friendly. The main F-Droid validation/build pipeline runs in the fdroiddata repo. If the upstream uses Gradle…
We split this AGENTS.md into the rules it gives an agent
13 rules. About 0 are common, 5 are distinctive, and 8 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 25
Must be fully FOSS-compatible (no Google Play Services).
- Very specific: line 62
If the upstream uses Gradle properties for versions, set UpdateCheckData to read them from gradle.properties:
- Very specific: line 70
GitHub is the single push target: All code and version tag updates are pushed strictly to GitHub …
- Distinctive: line 83
Highlighter tool: must be transparent and blend with content (not opaque marker).
- Very specific: line 84
Use BlendMode.MULTIPLY or PorterDuff.Mode.MULTIPLY.
- Distinctive: line 86
Avoid stacking: render highlights in a single layer.
- Distinctive: line 87
Zoom controls: keep zoom button container hidden.
- Very specific: line 92
Use view.post {} for UI changes that require the PDF to be loaded.
- Very specific: line 97
Prefer changes that keep the fdroid flavor 100% FOSS.
- Very specific: line 99
Update APP_VERSION_CODE / APP_VERSION_NAME in gradle.properties.
- Very specific: line 101
Update F-Droid metadata CurrentVersion / CurrentVersionCode accordingly.
- Distinctive: line 102
When touching F-Droid metadata:
- Very specific: line 103
Ensure fdroid rewritemeta produces no diff (canonical formatting).
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Guidelines (AI-ready) — PDF Toolkit
This project is an Android app with multiple product flavors (Play Store / F-Droid / Open Source). Use this file as the source of truth for how to build, release, and keep F-Droid metadata working in CI.
Repo overview
- Android app:
app/ - Flavors: defined in
app/build.gradle.ktsplaystorefdroidopensource
- Version source of truth (for releases):
gradle.propertiesAPP_VERSION_CODEAPP_VERSION_NAME
- F-Droid metadata (app repo copy):
metadata/com.yourname.pdftoolkit.yml - F-Droid data repo checkout:
fdroiddata/(usually gitignored in this app repo)- Real CI for F-Droid runs against the
fdroiddatarepository’s metadata.
- Real CI for F-Droid runs against the
Flavor intent and constraints
playstoreflavor- May include Play Services / proprietary SDKs (e.g., ML Kit).
- Used for Play Store releases.
fdroidflavor- Must be fully FOSS-compatible (no Google Play Services).
- Uses open OCR stack (Tesseract) instead of ML Kit.
- CI should avoid referencing Play-only APIs from this flavor.
opensourceflavor- FOSS-first build (no ads, no Firebase, no Play Services).
- Similar constraints to
fdroid, but can be distributed outside F-Droid as well.
Building locally (developer machine)
- Requirements: JDK 17+, Android SDK installed, Gradle wrapper available.
- Common commands:
./gradlew :app:assembleFdroidDebug./gradlew :app:assemblePlaystoreDebug./gradlew lintFdroidDebug --continue
Versioning rules (important for F-Droid)
F-Droid’s checkupdates cannot extract version info if it is dynamic. This project keeps static version values in gradle.properties:
APP_VERSION_CODE=<int>APP_VERSION_NAME=<string>
app/build.gradle.kts reads those properties for versionCode/versionName to remain F-Droid friendly.
F-Droid metadata + GitLab CI (fdroiddata)
The main F-Droid validation/build pipeline runs in the fdroiddata repo.
Required metadata fields for tag-based updates
RepoType: gitRepo: <git url>UpdateCheckMode: TagsAutoUpdateMode: Version
Fix for “Couldn't find any version information” in checkupdates
If the upstream uses Gradle properties for versions, set UpdateCheckData to read them from gradle.properties:
UpdateCheckData: gradle.properties|APP_VERSION_CODE=(\\d+)|.|APP_VERSION_NAME=(.+)
This tells fdroid checkupdates --auto how to extract version code/name for each tag.
How F-Droid Auto-Updates Work (No Manual GitLab MRs Needed)
- GitHub is the single push target: All code and version tag updates are pushed strictly to GitHub (
https://github.com/Karna14314/Pdf_Tools.git). No manual pushes or GitLab Merge Requests onfdroiddataare needed for future app releases. - Tag-based automatic update detection: F-Droid's scheduled server bot (
checkupdates --auto) periodically inspects release tags on GitHub (e.g.,v1.3.210,v1.4.0). - Static property parsing: F-Droid reads
APP_VERSION_CODEandAPP_VERSION_NAMEdirectly fromgradle.propertiesin that tag usingUpdateCheckData. - Automatic build & release: F-Droid automatically generates the build recipe, compiles the APK from your GitHub source, and delivers the update to F-Droid client app users.
CI hygiene: permissions + codequality.json
fdroidserverwarns ifconfig.ymlpermissions are not0600.- Some jobs upload
codequality.json; ensure it is created (write[]) when there are no findings.
PDF viewer / annotation rules (don’t regress)
UI/UX guidelines
- Highlighter tool must be transparent and blend with content (not opaque marker).
- Use
BlendMode.MULTIPLYorPorterDuff.Mode.MULTIPLY. - Use ~30% alpha.
- Avoid stacking: render highlights in a single layer.
- Use
- Zoom controls: keep zoom button container hidden; preserve menu access.
- Touch gestures: don’t break pinch-to-zoom; allow multi-touch to reach the PDF view.
Fragment lifecycle and overlays
- Set
documentUribefore attaching the viewer fragment. - Use
view.post {}for UI changes that require the PDF to be loaded. - Overlay views should not intercept touch unless actively annotating.
What an AI agent should do when editing
- Prefer changes that keep the
fdroidflavor 100% FOSS. - When updating versions:
- Update
APP_VERSION_CODE/APP_VERSION_NAMEingradle.properties. - Tag releases in git (e.g.,
vX.Y.Z). - Update F-Droid metadata
CurrentVersion/CurrentVersionCodeaccordingly.
- Update
- When touching F-Droid metadata:
- Ensure
fdroid rewritemetaproduces no diff (canonical formatting).
- Ensure
Last Updated: 2026-05-07
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

