Agent Native

tuning-oak-query-indexes

This skill analyzes JCR/Oak queries in AEM Cloud Service to determine whether they are served by indexes or require in-memory filtering.

by Adobe, Inc.Official publisherNot reviewed

Identity proven by GitHub's verified organisation badge (adobe)

Agents
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode, claude.ai and API
License
Apache-2.0 (permissive)
Pin
940b879pinned Oct 9, 2026
Context cost
about 1,300 tokenswhen the skill loads
GitHub stars
197on adobe/skills
Scripts
None found

What it does

“AEM Cloud Service expert skill — check a JCR/Oak query is actually served by an index and, when it is not, propose the property/Lucene index-definition change so the query is answered by the index instead of in-memory filtering or sorting. Use for "query is slow", "traversal warning", "is my query indexed", "tune oak index", or a scan that flags a JCR/QueryBuilder query. The analyzer locates every query-construction site (createQuery, getQueryManager, Sling findResources / queryResources, PredicateGroup.create / new PredicateGroup); the recipe assesses each flagged query against the supplied index definition(s). Resolution is user-supplied: the index definition(s) are required input — if none is provided the whole pattern is deferred, never guessed. Guided fix — the developer reviews and applies the proposed index change; never auto-apply.”
The author's description, from SKILL.md

Generated summary from the skill's own text

This skill analyzes JCR/Oak queries in AEM Cloud Service to determine whether they are served by indexes or require in-memory filtering. It identifies query construction sites, compares them against supplied index definitions, and proposes specific index definition changes to improve query performance and eliminate traversal warnings.

When to use it

  • Query is slow or logs a traversal warning in AEM
  • Assessing whether a new or existing query uses an index
  • Developer asks why a query performs poorly
  • Scan flags a query-construction site in code

When not to

  • Index definitions are not available or provided
  • Query has an explicitly unbounded result set (use unbounded-query skill instead)
  • Query is written in non-Java contexts like JSP, HTL, or config files

Install

These commands install from the publisher's repository and need no account.

skills CLI

npx skills add adobe/skills --skill tuning-oak-query-indexes

Installs from the repository's default branch, which may have changed since the commit we checked.

GitHub CLI 2.90 or later

gh skill install adobe/skills tuning-oak-query-indexes@940b8795c0df3e25de68ce3881dc90855129b215

Installs the commit we checked (940b879).

Copy by hand

Download the folder at 940b879 and put it in .claude/skills/tuning-oak-query-indexes for Claude Code and in .agents/skills/tuning-oak-query-indexes for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode.

Skill folder on GitHub at 940b879

Claude Code plugin

/plugin install adobe-for-creativity@claude-plugins-official

The publisher's plugin in Claude's official marketplace. It may hold more than this skill, and we have not pinned it.

Copy for your agent

A prompt for any coding agent. It installs this skill from GitHub at the pinned commit, copies the files as they are, and runs nothing unless you ask.

Prompt

Install the agent skill "tuning-oak-query-indexes" by Adobe, Inc..

Source, pinned to commit 940b8795c0df3e25de68ce3881dc90855129b215:
https://github.com/adobe/skills/tree/940b8795c0df3e25de68ce3881dc90855129b215/plugins/aem/cloud-service/skills/code-assessment/tuning-oak-query-indexes

1. Download that folder at exactly this commit. Do not use the default branch.
2. Copy every file unchanged, keeping the folder structure, into .claude/skills/tuning-oak-query-indexes/ for Claude Code and .agents/skills/tuning-oak-query-indexes/ for Codex, Cursor, Gemini CLI, GitHub Copilot and OpenCode. Create the folders if they do not exist.
3. Do not edit the files, and do not run any script in the folder unless I ask you to.
4. When you are done, list the files you copied and where you put them.

Listing and checks: https://www.agentnative.dev/skills/adobe-inc/tuning-oak-query-indexes-skills

SKILL.md at the pin

---
name: tuning-oak-query-indexes
description: "AEM Cloud Service expert skill — check a JCR/Oak query is actually served by an index and, when it is not, propose the property/Lucene index-definition change so the query is answered by the index instead of in-memory filtering or sorting. Use for \"query is slow\", \"traversal warning\", \"is my query indexed\", \"tune oak index\", or a scan that flags a JCR/QueryBuilder query. The analyzer locates every query-construction site (createQuery, getQueryManager, Sling findResources / queryResources, PredicateGroup.create / new PredicateGroup); the recipe assesses each flagged query against the supplied index definition(s). Resolution is user-supplied: the index definition(s) are required input — if none is provided the whole pattern is deferred, never guessed. Guided fix — the developer reviews and applies the proposed index change; never auto-apply."
license: Apache-2.0
---

# Tuning Oak query indexes — AEM as a Cloud Service

> This pattern is executed by the code-assessment runbook — follow [`../references/runbook.md`](../references/runbook.md) for the full flow. This skill supplies the detection + recipe the runbook applies.

## Overview

An Oak query only uses an index for the parts the index actually covers. Any `WHERE`/`ORDER BY`/fulltext
field without a matching, correctly-flagged property definition gets evaluated node-by-node in memory —
same for a wrong nodetype or path scope, **even if every field is indexed**. An uncovered query traverses
the repository: slow, `traversal`-warning-logged, and a load risk at scale. This pattern finds exactly
which fields/conditions aren't covered and what index-definition change fixes each one.

## Classification — confirm this pattern applies

- A JCR/QueryBuilder query is slow, logs a `traversal`/`TraversingIndex` warning, or you're adding/changing
  a query and need to confirm it's served by an index rather than in-memory filtering or sorting.
- The user asks "is my query indexed", "tune the oak index", "why is this query slow", or a scan flagged a
  query-construction site (`createQuery` / `PredicateGroup.create`).
- **Not** this pattern: an explicitly *unbounded* query (`p.limit=-1` / `setLimit(-1)`) — that's
  [`unbounded-query`](../unbounded-query/SKILL.md); this pattern is about index *coverage*, not result-set
  size. (A query can be both — assess index coverage here, bound it there.)

## Discovery

Detection is performed by the analyzer ([`../scripts/analyze.sh`](../scripts/README.md)), run by the runbook:

```bash
bash ../scripts/analyze.sh <workspace-root> --pattern tuning-oak-query-indexes
```

**Match criteria (what the detector flags)** — query-*construction* sites, matched on written names
(parse-level, no type resolution). These mirror the Java-API anchors the folded
[extracting JCR queries guide](references/extracting-jcr-queries.md) used, so moving detection from grep to
code keeps the same capture:

- any invocation named `createQuery` — JCR `QueryManager.createQuery(...)` and AEM QueryBuilder
  `builder.createQuery(...)`.
- any invocation named `getQueryManager` — the JCR query entry point (`Workspace.getQueryManager()`).
- any invocation named `findResources` or `queryResources` — the Sling `ResourceResolver` query APIs, which
  run a real indexed repository query.
- `PredicateGroup.create(...)` (a `create` invocation whose receiver's trailing simple name is
  `PredicateGroup`) and `new PredicateGroup(...)` — QueryBuilder predicate-group construction.

One finding per distinct source line, with the call as the snippet. The detector locates where queries are
built; it does **not** judge coverage — that requires the query text (read the surrounding code) and the
index definition(s) (see Resolution contract).

**Known limits (out of a parse-level Java detector's reach — use the extracting guide's manual fallback):**
non-Java queries (XPath/SQL2 in JSP/HTL/config, stored `dam:query` / Smart-Collection predicate strings,
query-string form) and queries hidden behind a non-JCR wrapper method whose body has no direct query call.

## Resolution contract

**user-supplied** — the required input is the Oak/Lucene **index definition(s)** the query could use. The
whole assessment is a comparison of the query against its candidate index definition(s), so:

- **Required input — the index definition(s). This skill does not run without them.** Accept any of: a
  FileVault `.content.xml` under an `/apps/.../install` package, a JSON export, or the live dump at
  `GET /system/console/status-oak-index-defn.json` (admin auth).
- **If no index definition is available, DEFER THE WHOLE PATTERN** with a single line — e.g.
  `tuning-oak-query-indexes: deferred — index definition not provided`. Do **not** emit a per-query skip
  for every finding, and do **not** emit a coverage assessment from the query alone (a guess reads as a
  finding and gets acted on as one).
- **When index definitions ARE supplied**, assess each flagged query's coverage and propose the
  index-definition change where a field is uncovered. **`fix: guided`** — never auto-apply: write the
  corrected definition out for the developer to review and apply.

## Recipe

Read [`recipe.md`](recipe.md) in full before assessing or proposing any change: the input contract, the
Section A/B segregation, the field-construct → required-flag table, the two scoping gotchas, the
index-size/storage pitfalls, the common mistakes, the target-index selection, `explain` verification, and
the two-section report shape. Ground truth for every claim is the bundled
[AI agent indexing guide](references/ai-agent-indexing-guide.md); build a query inventory from scratch with
the bundled [extracting JCR queries guide](references/extracting-jcr-queries.md).

## Handoff

The skill never commits and never applies an index change to a live instance. See
[`../references/runbook.md`](../references/runbook.md) for the full flow and handoff.

From adobe/skills at 940b879, shown as plain text under its license: Apache-2.0 (permissive). The license text is in plugins/aem/cloud-service/skills/code-assessment/tuning-oak-query-indexes/SKILL.md.

View SKILL.md on GitHub at 940b879

Files

4 files, 158 KB in total. Each file has a sha256 in the pin's manifest; the first 12 characters are shown.

Skill folder on GitHub at 940b879
All 50 skills from Adobe, Inc.

More from Adobe, Inc.

  • adobe

    This skill provides an onboarding tour of the Adobe for creativity connector, displaying available capabilities, example workflows, and which Adobe product…

    Claude Code, Codex, Cursor +4 · about 2.2K tokens · pinned 6 days ago

  • adobe-anydocx

    This skill routes DOCX conversion tasks that have a PDF source to Adobe's pdf_export tool with the appropriate format setting.

    Claude Code, Codex, Cursor +4 · about 680 tokens · pinned 6 days ago

  • adobe-anyexcel

    This skill routes PDF-to-Excel conversion tasks to the Adobe pdf_export tool with xlsx target format.

    Claude Code, Codex, Cursor +4 · about 690 tokens · pinned 6 days ago

  • adobe-anypdf

    This skill routes PDF tasks to Adobe Acrobat tools for higher fidelity than local Python libraries.

    Claude Code, Codex, Cursor +4 · about 2.1K tokens · pinned 6 days ago

  • adobe-anypptx

    This skill routes PowerPoint conversion tasks that have a PDF source to Adobe's pdf_export tool with PPTX output format.

    Claude Code, Codex, Cursor +4 · about 670 tokens · pinned 6 days ago

  • adobe-batch-edit-photos

    This skill applies consistent visual adjustments to a set of photos so they appear edited together as a cohesive collection.

    Claude Code · about 9.9K tokens · pinned 6 days ago

All Backend and APIs skills
  • nvflare-orient

    Routes NVFLARE requests to appropriate downstream skills based on user intent and preliminary source inspection findings.

    by NVIDIAOfficial publisher

    Claude Code, Codex, Cursor +4 · about 600 tokens · pinned 6 days ago

  • cloudflare-email-service

    This skill enables agents to send transactional emails and route incoming emails using Cloudflare's Email Service platform.

    by CloudflareOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.6K tokens · pinned 6 days ago

  • durable-objects

    Build and debug Cloudflare Durable Objects applications for stateful coordination and persistent storage on the edge.

    by CloudflareOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.5K tokens · pinned 6 days ago

  • workers-best-practices

    This skill guides code review and development of Cloudflare Workers by applying best practices for production readiness.

    by CloudflareOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.3K tokens · pinned 6 days ago

  • supabase

    This skill enables the agent to work with Supabase products including Database, Auth, Edge Functions, Realtime, Storage, and Vectors.

    by SupabaseOfficial publisher

    Claude Code, Codex, Cursor +4 · about 3.3K tokens · pinned 6 days ago

  • apple

    This skill emulates Apple's OAuth and OIDC services for local development and testing.

    by VercelOfficial publisher

    Claude Code, Codex, Cursor +4 · about 1.9K tokens · pinned 6 days ago

The skills listed here are third-party software, collected from public GitHub repositories as a catalog of recent skills and provided as is. Agent Native does not write or control them and is not responsible for any harm, loss or damage caused by installing or using them. Labels and checks describe what we saw at one commit and are not a guarantee. Read a skill's files before you run it. Terms of use