From d3c9b87b96d1a43fc3c999bb192980f15965b37a Mon Sep 17 00:00:00 2001 From: gabrielmoro Date: Sun, 14 Jun 2026 20:21:59 -0300 Subject: [PATCH 1/2] Add SKILL.md files for documentation review, test generation, minimum requirements, release notes, and architecture validation; update AGENTS.md and opencode.json --- .../skills/documentation-review/SKILL.md | 58 +++++++++ .opencode/skills/generate-tests/SKILL.md | 47 +++++++ .../skills/minimum-requirements/SKILL.md | 58 +++++++++ .opencode/skills/release-notes/SKILL.md | 71 +++++++++++ .../skills/validate-architecture/SKILL.md | 63 +++++++++ AGENTS.md | 120 ++++++++++++++++++ opencode.json | 7 + 7 files changed, 424 insertions(+) create mode 100644 .opencode/skills/documentation-review/SKILL.md create mode 100644 .opencode/skills/generate-tests/SKILL.md create mode 100644 .opencode/skills/minimum-requirements/SKILL.md create mode 100644 .opencode/skills/release-notes/SKILL.md create mode 100644 .opencode/skills/validate-architecture/SKILL.md create mode 100644 AGENTS.md create mode 100644 opencode.json diff --git a/.opencode/skills/documentation-review/SKILL.md b/.opencode/skills/documentation-review/SKILL.md new file mode 100644 index 00000000..0b94bd8f --- /dev/null +++ b/.opencode/skills/documentation-review/SKILL.md @@ -0,0 +1,58 @@ +--- +name: documentation-review +description: Validate project documentation against actual implementation +--- + +# documentation-review + +## Goal + +Validate project documentation and ensure it matches the actual implementation. + +## Behavior + +When invoked: + +1. **Scan all documentation:** + - `docs/**/*.md` + - `README.md` + +2. **Validate links:** + + ### Internal + - Verify referenced files exist (e.g. `android/sampleApp`, `flutter/sample/`) + - Verify referenced paths in docs resolve correctly + + ### External + - Verify URLs are reachable (e.g. GitHub, Maven Central, pub.dev) + +3. **Verify configuration examples match actual project:** + + ### Kotlin / Gradle + - Version catalog snippets match `android/gradle/libs.versions.toml` + - `build.gradle.kts` examples match `android/jujubasvg/build.gradle.kts` + - Plugin coordinates match actual publishing config (`io.github.codandotv:jujubaSVG`) + + ### Flutter + - `pubspec.yaml` snippets match `flutter/jujuba_svg/pubspec.yaml` + - Package installation instructions match current version + - API usage examples match actual public API + +4. **Verify documented APIs exist:** + - Kotlin public APIs (e.g. `JujubaSVG`, `JujubaCommander`, `Command`) + - Flutter public APIs (e.g. `JujubaSVGWidget`, `JujubaCommander`) + +5. **Verify setup instructions are accurate** (cross-check against `README.md`, build files, `pubspec.yaml`). + +6. **Verify release instructions are still valid** (check `mkdocs.yml`, GitHub Actions workflows in `.github/`). + +7. **Report results:** + + ### Errors + Documentation is incorrect or broken (dead links, wrong API names). + + ### Warnings + Documentation is outdated or incomplete (missing sections, stale version references). + + ### Suggestions + Recommended improvements (clarify ambiguous steps, add missing examples). diff --git a/.opencode/skills/generate-tests/SKILL.md b/.opencode/skills/generate-tests/SKILL.md new file mode 100644 index 00000000..80c06763 --- /dev/null +++ b/.opencode/skills/generate-tests/SKILL.md @@ -0,0 +1,47 @@ +--- +name: generate-tests +description: Generate tests following the project's existing conventions +--- + +# generate-tests + +## Goal + +Generate tests that follow the project's existing conventions. + +## Behavior + +When invoked: + +1. **Detect testing framework:** + + ### Kotlin / Android + - Check for JUnit 5 (`kotlin("test")`) in `android/jujubasvg/build.gradle.kts` + - Check for additional libraries: `kotlinx-coroutines-test`, `turbine` + + ### Flutter + - Check for `flutter_test` in `flutter/jujuba_svg/pubspec.yaml` + +2. **Analyze existing tests:** + - Kotlin: `android/jujubasvg/src/test/` — examine file names, class structure, assertion style + - Flutter: `flutter/jujuba_svg/test/` — examine file names, widget test patterns, assertion style + +3. **Follow current naming conventions:** + - Kotlin: `Test.kt` with descriptive test function names + - Flutter: `_test.dart` with `test()` / `group()` / `expect()` + +4. **Generate appropriate test types:** + + ### Kotlin + - Unit tests for `JujubaCommander`, `Command` execution, SVG node manipulation + - Use `kotlin.test` assertions + `kotlinx.coroutines.test` for coroutine testing + - Use `Turbine` for `Flow`/`Channel` testing + + ### Flutter + - Unit tests for `JujubaCommander` logic + - Widget tests for `JujubaSVGWidget` rendering + - Use `flutter_test` with `WidgetTester`, `pumpWidget`, `find`, `expect` + +5. **Ensure generated tests use the project's assertion style and test architecture:** + - Kotlin: functional/behavioral style matching existing tests + - Flutter: `testWidgets`, group-based organization, `mockito` if used diff --git a/.opencode/skills/minimum-requirements/SKILL.md b/.opencode/skills/minimum-requirements/SKILL.md new file mode 100644 index 00000000..a305ad5a --- /dev/null +++ b/.opencode/skills/minimum-requirements/SKILL.md @@ -0,0 +1,58 @@ +--- +name: minimum-requirements +description: Automatically determine minimum requirements for consuming the library +--- + +# minimum-requirements + +## Goal + +Automatically determine the minimum requirements needed to consume the library. + +## Behavior + +When invoked: + +1. **Detect project type:** + - Check for `android/` directory with Gradle build files → Kotlin Library + - Check for `flutter/` directory with `pubspec.yaml` → Flutter Package + +2. **Inspect dependency declarations:** + - `android/gradle/libs.versions.toml` (version catalog) + - `android/gradle/wrapper/gradle-wrapper.properties` (Gradle version) + - `android/build-logic/src/main/kotlin/config/Config.kt` (minSdk, JDK target) + - `flutter/jujuba_svg/pubspec.yaml` (Dart SDK, Flutter version) + +3. **Determine minimum supported versions:** + + ### Kotlin / Android + - Kotlin version: from `libs.versions.toml` (`kotlin`) + - JDK version: from `Config.kt` (`javaCompatibilityVersion`) + - Gradle version: from `gradle-wrapper.properties` (`distributionUrl`) + - Android Gradle Plugin version: from `libs.versions.toml` (`gradle`) + - Min SDK: from `Config.kt` (`MIN_SDK`) + + ### Flutter + - Dart SDK constraint: from `pubspec.yaml` (`environment.sdk`) + - Flutter dependency: implicit via `sdk: flutter` + +4. **Create or update** a `## Minimum Requirements` section inside `README.md`. + +### Example output + +```md +## Minimum Requirements + +### Kotlin Library + +- Kotlin 2.1.0+ +- JDK 17+ +- Gradle 9.0+ +- Android Gradle Plugin 8.13.1+ +- Android API 22+ + +### Flutter Package + +- Dart ^3.5.0+ +- Flutter (latest stable) +``` diff --git a/.opencode/skills/release-notes/SKILL.md b/.opencode/skills/release-notes/SKILL.md new file mode 100644 index 00000000..6cbc7c6c --- /dev/null +++ b/.opencode/skills/release-notes/SKILL.md @@ -0,0 +1,71 @@ +--- +name: release-notes +description: Generate release notes and prepare the next release +--- + +# release-notes + +## Goal + +Generate release notes and prepare the next release. + +## Behavior + +When invoked: + +1. **Detect current version** from: + - `android/jujubasvg/version.properties` (property `VERSION`) + - `flutter/jujuba_svg/pubspec.yaml` (field `version`) + +2. **Get latest Git tag:** + ```bash + git tag --sort=-v:refname | head -1 + ``` + +3. **Analyze unreleased changes:** + ```bash + git log ..HEAD --oneline + ``` + +4. **Categorize commits:** + + | Bump | Patterns | + |---------|-------------------------------------| + | Major | `breaking`, `BREAKING CHANGE` | + | Minor | `feat` | + | Patch | `fix`, `docs`, `chore`, `refactor`, `test` | + +5. **Determine next semantic version** based on categorized commits. + +6. **Update version file** (increment in `version.properties` or `pubspec.yaml`). + +7. **Create or update `CHANGELOG.md`:** + + ```md + ## X.Y.Z + + ### Features + + - Added ... + + ### Fixes + + - Fixed ... + + ### Documentation + + - Updated ... + ``` + +8. **Generate a release summary** (version, date, highlights). + +9. **Prompt the user** to: + ```bash + git commit + git tag v + git push && git push --tags + ``` + +10. **Verify publishing metadata:** + - Maven Central: check `android/jujubasvg/build.gradle.kts` for `mavenPublishing` block + - pub.dev: check `flutter/jujuba_svg/pubspec.yaml` for publish configuration diff --git a/.opencode/skills/validate-architecture/SKILL.md b/.opencode/skills/validate-architecture/SKILL.md new file mode 100644 index 00000000..29004605 --- /dev/null +++ b/.opencode/skills/validate-architecture/SKILL.md @@ -0,0 +1,63 @@ +--- +name: validate-architecture +description: Verify architectural consistency and dependency rules +--- + +# validate-architecture + +## Goal + +Verify architectural consistency and dependency rules. + +## Behavior + +When invoked: + +1. **Detect project structure:** + - Kotlin/Android: modules defined in `android/settings.gradle.kts` (`:jujubasvg`, `:sampleApp`) + - Convention plugins: `android/build-logic/` + - Flutter: package at `flutter/jujuba_svg/`, sample at `flutter/sample/` + +2. **Analyze dependencies between modules/packages:** + + ### Kotlin / Android + - `:sampleApp` depends on `:jujubasvg` + - `:build-logic` provides convention plugins used by both + - No circular dependencies between `:jujubasvg` and `:sampleApp` + + ### Flutter + - `flutter/sample` depends on `flutter/jujuba_svg` (local path dependency) + - No circular dependencies + +3. **Verify architecture rules:** + + ### Kotlin + - `:jujubasvg` should not depend on `:sampleApp` + - Internal packages should not leak into public API surface + - `explicitApi()` should be enforced (set in convention plugin) + + ### Gradle Plugins + - Convention plugins should only expose necessary configuration + - Build-logic should not leak into library module classpath + + ### Flutter + - `lib/core/`, `lib/model/`, `lib/util/` should respect layer separation + - Core logic should not depend on UI widgets + +4. **Detect:** + + - **Cyclic dependencies** — any module depending on one that depends back on it + - **Forbidden dependencies** — e.g. sample app depending on internal build-logic + - **Unused modules** — modules declared in settings but never referenced + - **Architectural violations** — e.g. Compose UI leaking into pure Kotlin logic + +5. **Produce a report:** + + ### Violations + Critical issues (cyclic deps, forbidden deps). + + ### Warnings + Potential issues (unused modules, unclear boundaries). + + ### Recommendations + Suggested improvements (extract shared code, enforce layers). diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 00000000..638e9ca6 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,120 @@ +# AGENTS.md — JujubaSVG + +## Project Overview + +**JujubaSVG** is a dual-platform library for handling SVG files in Android (Kotlin/Jetpack Compose) and Flutter applications. It enables granular manipulation of SVG elements — access any element by ID to modify properties like background color, stroke, and other attributes. + +### Library Types + +- Kotlin Library (Android) +- Flutter Package + +### Primary Language and Version + +- Kotlin 2.1.0 +- Dart ^3.5.0 + +### Runtime / Platform + +- JVM (Android) +- Flutter (Android, iOS) + +### Supported Environments + +- Android API 22+ +- Flutter via Dart SDK ^3.5.0 + +--- + +## Build System + +### Kotlin / Gradle + +| Property | Value | +|-------------------|------------------------------| +| Gradle version | 9.0-milestone-1 (wrapper) | +| Kotlin version | 2.1.0 | +| AGP version | 8.13.1 | +| Version Catalog | `android/gradle/libs.versions.toml` | +| Convention plugins| `android/build-logic/` | +| Publishing plugin | `com.vanniktech.maven.publish` (0.28.0) | + +### Dart / Flutter + +| Property | Value | +|-------------------|------------------------------| +| Dart SDK | ^3.5.0 | +| Flutter | (latest stable) | +| Dependencies | See `flutter/jujuba_svg/pubspec.yaml` | + +--- + +## Project Structure + +``` +jujubaSVG/ +├── android/ +│ ├── build-logic/ # Convention plugins +│ ├── jujubasvg/ # Kotlin/Android library (public API) +│ ├── sampleApp/ # Android sample application +│ ├── config/ # Static analysis config +│ ├── gradle/ # Wrapper + version catalog +│ ├── build.gradle.kts +│ └── settings.gradle.kts +├── flutter/ +│ ├── jujuba_svg/ # Flutter/Dart package (public API) +│ │ ├── lib/ # Source +│ │ └── test/ # Tests +│ └── sample/ # Flutter sample application +├── docs/ # MkDocs documentation source +├── img/ # Images / assets +├── scripts/ # Helper scripts +├── mkdocs.yml # MkDocs configuration +└── README.md +``` + +--- + +## Version Management + +| Location | Format | Current Version | +|-----------------------------------|------------|-----------------| +| `android/jujubasvg/version.properties` | `VERSION=x.y.z` | 1.3.0 | +| `flutter/jujuba_svg/pubspec.yaml` | `version: x.y.z` | 1.1.1 | + +--- + +## Documentation + +- **Generator:** MkDocs with Material theme +- **Configuration:** `mkdocs.yml` +- **Source:** `docs/` +- **Published at:** https://codandotv.github.io/jujubaSVG/ + +--- + +## Distribution + +### Kotlin Library (Maven Central) + +| Field | Value | +|--------------|------------------------------------| +| Group ID | `io.github.codandotv` | +| Artifact ID | `jujubaSVG` | +| Sonatype | Central Portal (`CENTRAL_PORTAL`) | + +### Flutter Package (pub.dev) + +| Field | Value | +|--------------|------------------------------------| +| Package name | `jujuba_svg` | +| URL | https://pub.dev/packages/jujuba_svg | + +--- + +## Git Workflow + +- **Default branch:** `main` +- **Versioning:** Semantic Versioning (SemVer) +- **Tags:** `v..` (e.g. `v1.2.0`) +- **Release process:** Tag on `main` → CI publishes to Maven Central and/or pub.dev diff --git a/opencode.json b/opencode.json new file mode 100644 index 00000000..61966d80 --- /dev/null +++ b/opencode.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://opencode.ai/config.json", + "instructions": ["AGENTS.md"], + "skills": { + "paths": [".opencode/skills"] + } +} From 79ef54fe9c4e6255dca5e8ed80da2646334744f2 Mon Sep 17 00:00:00 2001 From: gabrielmoro Date: Sun, 14 Jun 2026 20:24:09 -0300 Subject: [PATCH 2/2] Add minimum requirements --- README.md | 15 +++++++++++++++ docs/index.md | 2 ++ docs/setup/android.md | 8 ++++++++ docs/setup/flutter.md | 5 +++++ 4 files changed, 30 insertions(+) diff --git a/README.md b/README.md index e5336e0e..6fb784aa 100644 --- a/README.md +++ b/README.md @@ -132,6 +132,21 @@ More details you can check at our [sample project](android/sampleApp) teaser showing the app working on Android with SVG image. +## Minimum Requirements + +### Kotlin Library + +- Kotlin 2.1.0+ +- JDK 17+ +- Gradle 9.0+ +- Android Gradle Plugin 8.13.1+ +- Android API 22+ + +### Flutter Package + +- Dart ^3.5.0+ +- Flutter (latest stable) + --- ### How to contribute? diff --git a/docs/index.md b/docs/index.md index 51631933..699970b3 100644 --- a/docs/index.md +++ b/docs/index.md @@ -7,6 +7,8 @@ jujubaSVG is a user-friendly library for handling SVG files in Android and Flutter applications. It enables granular manipulation of SVG elements - you can access any element by its ID to modify properties like background color, stroke, and other attributes. +**Minimum requirements:** Android API 22+ / Dart ^3.5.0+ + Take a look at our [repository](https://github.com/CodandoTV/jujubaSVG). ## Summary diff --git a/docs/setup/android.md b/docs/setup/android.md index e7ddbd09..44fd10ef 100644 --- a/docs/setup/android.md +++ b/docs/setup/android.md @@ -1,5 +1,13 @@ # Android +## Minimum Requirements + +- Kotlin 2.1.0+ +- JDK 17+ +- Gradle 9.0+ +- Android Gradle Plugin 8.13.1+ +- Android API 22+ + ## 1. Add the Dependency You need to add the following line in your desired module/build.gradle.kts: diff --git a/docs/setup/flutter.md b/docs/setup/flutter.md index 4810900f..913bac0e 100644 --- a/docs/setup/flutter.md +++ b/docs/setup/flutter.md @@ -1,5 +1,10 @@ # Flutter +## Minimum Requirements + +- Dart ^3.5.0+ +- Flutter (latest stable) + ## 1. Add the Dependency You need to add jujuba_svg library in your `pubspec.yaml`: