Skip to content

docs: restructure documentation and optimize README#560

Merged
wysaid merged 7 commits intomasterfrom
better_workflow
Feb 13, 2026
Merged

docs: restructure documentation and optimize README#560
wysaid merged 7 commits intomasterfrom
better_workflow

Conversation

@wysaid
Copy link
Owner

@wysaid wysaid commented Feb 13, 2026

Objective

Restructure project documentation by separating AI-facing instructions from user-facing content, and consolidate scattered information into organized, maintainable documentation.

Changes

📄 Documentation Structure

New files:

  • .copylotignore (23 lines) — Reduces AI context noise by excluding build artifacts, prebuilt libs, IDE config
  • .github/CONTRIBUTING.md (64 lines) — Consolidated code standards, API stability rules, and dual-build system requirements
  • .github/RELEASE.md (56 lines) — Release process (moved from README)
  • .github/skills/pr-submit/SKILL.md (60 lines) — AI skill for PR submission workflow
  • .github/skills/pr-review/SKILL.md (67 lines) — AI skill for PR review checklist
  • docs/build.md (102 lines) — Full build guide extracted from README
  • docs/filter-rules.md (437 lines) — Comprehensive filter syntax reference (synthesized from English + Chinese wikis, now ~100% complete)

Enhanced files:

  • .github/copilot-instructions.md — Streamlined from 59→52 lines, now indexes all other resources
  • README.md — Reduced from 254→193 lines (-24%)
    • Added C++ custom filter code examples
    • Added Key Classes reference table
    • Added GL threading requirements
    • Preserved all essential user-facing content

Removed files:

  • docs/usage.md — Content merged into README Manual section

🎯 Key Improvements

For Users:

  • ✅ Quick-start examples (Java + C++) directly in README
  • ✅ Complete filter rule reference in docs/ (all 14 filter methods documented)
  • ✅ Clearer structure: Quick Start → Build Details → Advanced Topics

For Contributors & AI:

  • .github/CONTRIBUTING.md as single source of truth for code standards
  • ✅ Skills system for procedural workflows (pr-submit, pr-review)
  • ✅ Dual-build system requirements clearly documented
  • ✅ API stability rules front-and-center

Documentation Quality:

  • ✅ Eliminated redundancies (150+ lines of duplication removed)
  • ✅ Completed filter-rules reference (English wiki was 40% empty)
  • ✅ Version control friendly (local Markdown files replace Wiki links)

📊 Statistics

12 files changed, 1418 insertions(+), 261 deletions(-)

Documentation hierarchy:
├─ README.md (193 lines) — Project homepage + Quick Manual
├─ docs/
│  ├─ build.md (102 lines) — Build configuration & methods
│  └─ filter-rules.md (437 lines) — Complete filter API reference
├─ .github/
│  ├─ copilot-instructions.md (52 lines) — AI coordination
│  ├─ CONTRIBUTING.md (64 lines) — Code standards
│  ├─ RELEASE.md (56 lines) — Release workflow
│  └─ skills/ — Procedural AI workflows

🔄 Comparison with origin/master

Component Before After Change
README.md 254 lines 193 lines -24%
Total docs Scattered Organized
Filter rules Wiki (40% empty) Local (100%)
Code examples Java only Java + C++
Threading docs New

Design Decisions

  1. Kept README as main entry point — Quick start + essential examples stay visible
  2. Local Markdown over Wiki links — Version-controlled, easier to maintain, includes PDFs/exports
  3. No duplication — Code standards referenced not repeated; build details in dedicated file
  4. Skills system for AI — Procedural guides separate from reference material
  5. Complete filter documentation — Merged English + Chinese wiki content to fill gaps

Testing

  • All cross-references verified (docs/build.md, docs/filter-rules.md, etc.)
  • README renders correctly in GitHub
  • Filter rules doc is comprehensive (all 14 methods + 38 blend modes)
  • No broken links

Breaking Changes

  • docs/usage.md removed (content consolidated into README Manual)
  • Wiki links in README replaced with local docs

Related Issues

Resolves documentation organization and completeness issues.


Type of Change: 📚 Documentation

Summary by CodeRabbit

  • Documentation

    • Streamlined README; added detailed build and filter-rule guides
    • Added contributor & release process docs and PR review/submit skill guides
    • New contributing and release guidelines describing tagging, version validation, and artifact publishing
  • Chores

    • Overhauled CI/release workflows and refined workflow triggers/matrix behavior, packaging, and artifact checks
    • Added ignore configuration to exclude build outputs, IDE/OS artifacts, prebuilt native libs, and release artifacts from tooling

- Consolidate usage.md into README Manual section
- Add C++ custom filter examples and threading guidelines
- Extract filter rules to docs/filter-rules.md (437 lines)
- Reduce README from 254 to 193 lines (-24%)
- Add Key Classes table and GL threading warnings
- Move contributing/release docs to .github/
- Create AI instruction files (.github/skills/, copilot-instructions.md)
- Add .copilotignore to exclude build artifacts

BREAKING: docs/usage.md removed (content merged into README)
Copilot AI review requested due to automatic review settings February 13, 2026 16:32
@coderabbitai
Copy link

coderabbitai bot commented Feb 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

Adds documentation, contributor guides, CI workflow overhauls, GitHub/Copilot workspace instructions, PR workflow skills, build and filter docs, and a new .copilotignore. Changes are documentation and CI/configuration only; no runtime code or public API modifications.

Changes

Cohort / File(s) Summary
Copilot & Workspace
/.copilotignore, .github/copilot-instructions.md
Adds .copilotignore patterns (build outputs, prebuilt native libs, IDE/OS artifacts, release artifacts) and rewrites Copilot/workspace guidance with explicit stability rules and project layout.
Contributing & Release Guides
.github/CONTRIBUTING.md, .github/RELEASE.md
Adds contributor guide and a detailed release process (version extraction/validation, tag formats, automated multi-variant AAR/APK builds, artifact packaging and checksums, conditional GitHub Release creation).
GitHub Instruction Patterns
.github/instructions/cpp.instructions.md, .github/instructions/java.instructions.md
Simplifies applyTo glob patterns into single-line/compressed patterns for targeting source trees; no behavior changes.
PR Skills
.github/skills/pr-review/SKILL.md, .github/skills/pr-submit/SKILL.md
Adds procedural SKILL docs for PR review and PR submission with step-by-step workflows and output templates.
CI/CD Workflows
.github/workflows/release.yml, .github/workflows/ubuntu-build.yml, .github/workflows/macos-build.yml, .github/workflows/windows-build.yml
Major release workflow rewrite (tag/manual extraction, validation vs build.gradle, NDK/JDK setup, build variants, artifact checksums, artifact-repo sync with PR, conditional release creation); ubuntu-build matrix generation made dynamic; macOS/Windows triggers narrowed.
Docs & README
README.md, docs/build.md, docs/filter-rules.md
Streamlines README quick start, adds detailed build.md (flags, dual-build notes, publishing), and adds extensive filter-rules.md documenting filter syntax, methods, and examples.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (push / tag / dispatch)
  participant GH as GitHub
  participant Runner as Actions Runner
  participant Builder as Build System (Gradle / NDK / CMake)
  participant ArtifRepo as Artifact Repo
  participant ReleaseAPI as GitHub Release API

  Dev->>GH: push tag or dispatch workflow
  GH->>Runner: trigger .github/workflows/release.yml
  Runner->>Runner: extract tag/version, validate vs build.gradle
  Runner->>Builder: build demo APK and AAR variants
  Builder-->>Runner: produced artifacts + checksums
  Runner->>ArtifRepo: clone artifact repo, rsync artifacts, commit & open PR
  Runner->>ReleaseAPI: create GitHub Release (conditional)
  ReleaseAPI-->>GH: Release created / assets uploaded
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐇
I hopped through docs and CI with glee,
Ignored the builds that cluttered me,
Tags hum, runners build and send,
Artifacts travel to their end,
A carrot for the reviewer — hop, agree!

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: restructuring documentation and optimizing the README file, which is the central focus of this 1,418-line changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into master

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch better_workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Fix all issues with AI agents
In @.github/copilot-instructions.md:
- Around line 34-39: Update the Documentation list to remove the stale reference
to docs/usage.md and point consumers to the merged location (README.md) instead;
specifically edit the section that currently lists `docs/usage.md` and either
replace that entry with `README.md — Usage, custom filters, and code samples` or
remove the entry entirely so the docs list only includes existing files
(`docs/build.md`, `.github/RELEASE.md`, `.github/CONTRIBUTING.md`).

In @.github/instructions/java.instructions.md:
- Around line 2-3: The applyTo pattern uses pipe separators which GitHub Copilot
expects as comma-separated values; update the applyTo value (the applyTo field
in this file) to replace the pipe character with a comma so it reads as two
comma-separated glob patterns:
library/src/main/java/**/*.java,cgeDemo/src/main/java/**/*.java.

In @.github/RELEASE.md:
- Around line 49-56: Update the wording that currently says "All version parts
must be pure numbers" to clarify that only the core semantic version segments
(X.Y.Z) must be numeric while prerelease suffixes like -beta, -alpha, -rc and
their numeric identifiers are allowed; make it explicit that the tag must match
the versionName in build.gradle exactly (including any prerelease suffix), and
replace the sentence with something like: "The core version segments (X.Y.Z)
must be numeric; prerelease suffixes (for example -beta1, -alpha1, -rc1) are
permitted and the full tag (including any suffix) must exactly match versionName
in build.gradle."

In @.github/workflows/release.yml:
- Around line 309-316: The PR body string uses "\n" inside double quotes so
newlines will be literal; update how PR_BODY is constructed so it contains real
newlines before passing to jq (e.g., build PR_BODY with a C-style expansion or
use printf to inject actual newlines) and ensure the jq --arg body "$PR_BODY"
receives the multiline string; check the symbols PR_BODY and the jq API_JSON
invocation and replace the current double-quoted "\n" usage with a method that
produces real newline characters.
- Around line 241-259: The release flow generates SHA256SUMS.txt and individual
.sha256 files in the "Generate artifact checksums" step but the release upload
only includes *.apk and *.aar; update the release upload step (the job/step that
currently uploads artifacts with patterns '*.apk' and '*.aar') to also include
SHA256SUMS.txt and '*.sha256' so checksum files are published, and ensure the
upload uses the same /tmp/release-artifacts directory or the action's
working-directory so the new files are present when uploading.
- Around line 67-115: The workflow step with id "tag_version" currently injects
the untrusted expression `${{ github.event.inputs.version }}` directly into the
script; instead export that input via an env var (e.g., set env: VERSION: ${{
github.event.inputs.version }}) and reference the shell variable $VERSION inside
the script (use quoting when testing/assigning) so the input is not parsed by
the shell; adjust the block that handles `workflow_dispatch` to read from
$VERSION (and still set TAG_NAME="v$VERSION", BASE_VERSION, IS_MANUAL,
IS_PRERELEASE) and add a strict validation/sanitization check on $VERSION before
use to reject suspicious characters.
🧹 Nitpick comments (2)
docs/filter-rules.md (1)

9-418: Add fenced code block languages to satisfy markdownlint (MD040).

If markdownlint is enforced in CI, these fences will fail without a language. Consider adding text (or java/cpp/bash where appropriate) to each fenced block.

Example (apply consistently)
-```
+```text
 `@method1` <args1> `@method2` <args2> `@method3` <args3>
</details>

</blockquote></details>
<details>
<summary>README.md (1)</summary><blockquote>

`160-166`: **Optional: align strong emphasis style with markdownlint (MD050).**

If MD050 is enforced, switch to underscores for strong emphasis to avoid lint noise.  


<details>
<summary>Example</summary>

```diff
-**Important**: GL operations must run on the GL thread:
+__Important__: GL operations must run on the GL thread:

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restructures and consolidates project documentation into dedicated docs/ and .github/ resources, while simplifying the README and improving the release workflow for artifact publishing.

Changes:

  • Added comprehensive docs (docs/build.md, docs/filter-rules.md) and contributor/release guides under .github/.
  • Simplified README.md to focus on quick start + essential usage, linking out to detailed docs.
  • Reworked .github/workflows/release.yml to validate versions, build multiple variants, and publish artifacts/releases.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
docs/filter-rules.md Adds a full local reference for filter rule strings and syntax.
docs/build.md Adds a dedicated build guide (config flags + build methods).
README.md Replaces long build instructions with a quick-start and links to docs.
.github/workflows/release.yml Overhauls release pipeline (version validation, build variants, publish artifacts).
.github/skills/pr-submit/SKILL.md Adds procedural PR submission workflow documentation.
.github/skills/pr-review/SKILL.md Adds procedural PR review checklist documentation.
.github/instructions/java.instructions.md Updates Copilot instruction targeting patterns for Java files.
.github/instructions/cpp.instructions.md Updates Copilot instruction targeting patterns for C++ files.
.github/copilot-instructions.md Streamlines Copilot guidance and links to repo documentation.
.github/RELEASE.md Adds a local release process guide referencing the workflow.
.github/CONTRIBUTING.md Adds consolidated contributor standards and compatibility rules.
.copilotignore Adds exclusions to reduce Copilot context noise.

- For `GLSurfaceView`-based classes, do GL operations on the GL thread via `queueEvent(...)`.
- `NativeLibraryLoader` controls native library loading order; don’t unconditionally load FFmpeg when video module is disabled.
- `docs/build.md` — Full build guide and configuration options
- `docs/usage.md` — API usage, custom filters, and code samples
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/usage.md is referenced here, but the PR description states it was removed and merged into the README. This link will be broken/outdated—update it to point to README.md (Manual section) or to the new dedicated docs that replaced it.

Suggested change
- `docs/usage.md` — API usage, custom filters, and code samples
- `README.md` (Manual section) — API usage, custom filters, and code samples

Copilot uses AI. Check for mistakes.
applyTo:
- "library/src/main/java/**/*.java"
- "cgeDemo/src/main/java/**/*.java"
applyTo: "library/src/main/java/**/*.java|cgeDemo/src/main/java/**/*.java"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applyTo value uses | as an OR separator, but glob matchers typically treat | as a literal character, so the instruction may never apply. Use a YAML list (the previous form) or a single glob that matches both roots (e.g., brace expansion only if confirmed supported by the instruction loader).

Suggested change
applyTo: "library/src/main/java/**/*.java|cgeDemo/src/main/java/**/*.java"
applyTo:
- "library/src/main/java/**/*.java"
- "cgeDemo/src/main/java/**/*.java"

Copilot uses AI. Check for mistakes.
- "library/src/main/jni/cge/**/*.{cpp,h,c}"
- "library/src/main/jni/custom/**/*.{cpp,h,c}"
- "library/src/main/jni/interface/**/*.{cpp,h,c}"
applyTo: "library/src/main/jni/{cge,custom,interface}/**/*.{cpp,h,c}"
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brace expansion ({...}) and multi-extension globs (*.{cpp,h,c}) are not universally supported by instruction file glob evaluators. To avoid the instructions silently not applying, prefer the previous YAML list of explicit patterns (one per directory/extension), unless the toolchain is confirmed to support this syntax.

Suggested change
applyTo: "library/src/main/jni/{cge,custom,interface}/**/*.{cpp,h,c}"
applyTo:
- "library/src/main/jni/cge/**/*.cpp"
- "library/src/main/jni/cge/**/*.h"
- "library/src/main/jni/cge/**/*.c"
- "library/src/main/jni/custom/**/*.cpp"
- "library/src/main/jni/custom/**/*.h"
- "library/src/main/jni/custom/**/*.c"
- "library/src/main/jni/interface/**/*.cpp"
- "library/src/main/jni/interface/**/*.h"
- "library/src/main/jni/interface/**/*.c"

Copilot uses AI. Check for mistakes.
Comment on lines 11 to 15
inputs:
version:
description: 'Version tag (e.g. v1.0.0-test)'
description: 'Version number (e.g., 3.1.1) - Manual trigger will NOT publish to Release page'
required: true
default: 'v0.1.0-test'
create_release:
description: 'Whether to create GitHub Release'
type: boolean
default: false
type: string
Copy link

Copilot AI Feb 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manual input is described as a version number (no leading v), but later the workflow unconditionally prefixes v to form TAG_NAME. If a user enters v3.1.1, the workflow will produce vv3.1.1 and fail tag-format validation downstream. Add input validation/sanitization (strip a leading v, or explicitly reject values starting with v).

Copilot uses AI. Check for mistakes.
- PR: only run 2 critical configs (down from 16)
  - NDK-r27c + cmake + ffmpeg + 16kb (latest recommended)
  - NDK-r26d + ndk-build + no-ffmpeg + 4kb (legacy coverage)
- master push: keep all 16 configs for full coverage
- Total PR jobs: 35+ → 5 (Windows:1 + macOS:1 + Ubuntu:2 + Lint:1)
…orkflow*

- Update macOS build workflow trigger
- Update Ubuntu build workflow trigger
- Update Windows build workflow trigger

This prevents accidental full-matrix builds on branches containing 'workflow' in the name. Only branches starting with 'test_workflow' will trigger the full test matrix.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In @.github/workflows/release.yml:
- Around line 304-306: The rsync call using the --delete flag ("rsync -av
--delete \"${SOURCE_REPO}/org/wysaid/gpuimage-plus/\"
\"$WORKDIR/org/wysaid/gpuimage-plus/\"") will remove all previously published
versions in WORKDIR/org/wysaid/gpuimage-plus because SOURCE_REPO only contains
this run's artifacts; remove the --delete option to make the sync additive (or,
if the intention is to fully replace the directory, add a clear
comment/documentation above the rsync line stating that publish.sh performs a
full republish and --delete is intentional), ensuring the change references the
rsync invocation, SOURCE_REPO, and the destination path.
- Around line 546-562: The failure notification uses step outputs from
steps.tag_version (steps.tag_version.outputs.version and
steps.tag_version.outputs.tag_name) which may be unset if the tag_version step
failed; update the workflow to guard or default these values: either check that
steps.tag_version.conclusion == 'success' (or use if: steps.tag_version.outcome
== 'success') before emitting the outputs, or substitute a safe fallback like
"unknown" when referencing steps.tag_version.outputs.version and
steps.tag_version.outputs.tag_name in the echo lines so the summary never shows
blank values; adjust the Build failure notification step to implement one of
these approaches referencing the step name tag_version.
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)

138-154: Version validation step uses ${{ }} expression interpolation directly in shell.

Line 141 interpolates steps.tag_version.outputs.version directly into the script. This value originates from user input (the workflow_dispatch version field) and, while it has been regex-validated in the previous step, the pattern is inconsistent with the careful env-var approach established in lines 69-71 for the initial input. The same pattern recurs at lines 235, 288-289, 357-358, and throughout the summary/notification steps.

Since the values are regex-constrained to [0-9a-zA-Z.-], there's no exploitable injection today. However, for defense-in-depth and consistency, consider passing step outputs through env: blocks in security-sensitive steps (build commands, git operations).

@wysaid wysaid merged commit 19572f7 into master Feb 13, 2026
6 checks passed
@wysaid wysaid deleted the better_workflow branch February 13, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant