oak-add-config Skill
You are an expert in the Apache Jackrabbit Oak oak-store-document module. When this skill is invoked, you will add a new OSGi configuration property.
Supporting files
- Detailed production code patterns (steps 2–6): osgi-config-patterns.md
- Detailed test patterns (steps 7–10): test-patterns.md
- Wiring into usage class + compile/test (steps 11–12): wiring-and-verification.md
REQUIRED INPUT
The user must provide these values when invoking the skill. If any are missing, stop and ask:
| Parameter |
Description |
Example |
configName |
camelCase OSGi attribute method name |
avoidExclusiveMergeLock |
type |
Java type: boolean, int, long, String |
boolean |
defaultValue is optional — if not provided, use the Java default for the given type:
boolean → false
int / long → 0
String → ""
The following are optional — derive or infer them if not provided:
| Parameter |
Description |
How to derive if missing |
jiraId |
JIRA ticket ID |
Deduce from current branch name (see below) |
attrName |
Human-readable OSGi display name |
Convert configName from camelCase to Title Case |
description |
Full OSGi description text |
Ask the user for a brief description, then expand it |
scope |
both, mongo-only, or rdb-only |
Ask the user explicitly. Default is mongo-only. |
featureToggle |
Whether to add a feature toggle (true / false) |
Ask the user explicitly. Default is false. |
Deducing jiraId from the branch:
Run git branch --show-current and extract the JIRA ID
(e.g. OAK-12139 → jiraId=OAK-12139; issue/OAK-12139 → jiraId=OAK-12139).
If it differs from a user-supplied value, warn. If none can be deduced, ask.
Before proceeding, ask both optional questions in a single prompt:
- "Which backends does this config apply to? (mongo-only / rdb-only / both, default: mongo-only)"
- "Do you want a feature toggle for this config? (yes/no, default: no)"
DERIVED IDENTIFIERS
From the inputs, derive:
DEFAULT_CONST → DEFAULT_ + UPPER_SNAKE_CASE of configName
e.g. avoidExclusiveMergeLock → DEFAULT_AVOID_EXCLUSIVE_MERGE_LOCK
setterName → set + PascalCase(configName)
getterName → same as configName
utilsMethod → is + PascalCase(configName stripped of avoid/enable/use) + Enabled
e.g. isAvoidMergeLockEnabled
featureToggle=true only:
FT_NAME_CONST → FT_NAME_ + UPPER_SNAKE_CASE of configName
FT_VALUE → "FT_" + UPPER_SNAKE + "_" + jiraId
featureField → docStore + PascalCase(configName stripped of trailing Enabled) + Feature
EXECUTION STEPS
Work through every step in order. Do NOT skip any step.
Read the supporting files as you reach each group of steps.
- Read key files — locate insertion points in all 9 files (listed below)
- Configuration.java — add
@AttributeDefinition + import → see osgi-config-patterns.md
- DocumentNodeStoreService.java — DEFAULT constant, FT_NAME, Feature field, activate/deactivate, configureBuilder → see osgi-config-patterns.md
- DocumentNodeStoreBuilder.java — value field, getter/setter, Feature getter/setter → see osgi-config-patterns.md
- RDBDocumentNodeStoreBuilder.java — override to disable (scope=mongo-only) → see osgi-config-patterns.md
- Utils.java — add
isXxxEnabled() method → see osgi-config-patterns.md
- DocumentNodeStoreServiceConfigurationTest.java → see test-patterns.md
- MongoDocumentNodeStoreBuilderTest.java → see test-patterns.md
- RDBDocumentNodeStoreBuilderTest.java → see test-patterns.md
- UtilsTest.java → see test-patterns.md
- Wire into usage class → see wiring-and-verification.md
- Compile and run tests → see wiring-and-verification.md
Files to read in STEP 1
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/Configuration.java
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentNodeStoreBuilder.java
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/Utils.java
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreServiceConfigurationTest.java
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentNodeStoreBuilderTest.java
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UtilsTest.java
QUALITY CHECKLIST
Before finishing, verify:
IMPORTANT CONSTRAINTS
- Assertion style: match the existing imports in each file — do NOT add new imports. If the file uses
assertFalse(...) (static), use that; if it uses Assert.assertFalse(...), use that.
- No static imports in new production code
- JUnit 4 only (
@Test from org.junit.Test)
- Apply standards only to new code — never reformat or rename existing code
- Follow the exact naming and placement patterns shown in the supporting files
Source: apache/jackrabbit-oak — distributed by TomeVault.
1---2name: oak-store-document-add-config3description: Add a new OSGi configuration property to the oak-store-document module. Modifies Configuration.java, DocumentNodeStoreService.java, DocumentNodeStoreBuilder.java, RDBDocumentNodeStoreBuilder.java, Utils.java, and all relevant test files with 90%+ coverage. Use when this capability is needed.4---56# oak-add-config Skill78You are an expert in the Apache Jackrabbit Oak `oak-store-document` module. When this skill is invoked, you will add a new OSGi configuration property.910## Supporting files1112- Detailed production code patterns (steps 2–6): [osgi-config-patterns.md](osgi-config-patterns.md)13- Detailed test patterns (steps 7–10): [test-patterns.md](test-patterns.md)14- Wiring into usage class + compile/test (steps 11–12): [wiring-and-verification.md](wiring-and-verification.md)1516---1718## REQUIRED INPUT1920The user **must** provide these values when invoking the skill. If any are missing, stop and ask:2122| Parameter | Description | Example |23|-----------|-------------|---------|24| `configName` | camelCase OSGi attribute method name | `avoidExclusiveMergeLock` |25| `type` | Java type: `boolean`, `int`, `long`, `String` | `boolean` |2627`defaultValue` is **optional** — if not provided, use the Java default for the given type:28- `boolean` → `false`29- `int` / `long` → `0`30- `String` → `""`3132The following are **optional** — derive or infer them if not provided:3334| Parameter | Description | How to derive if missing |35|-----------|-------------|--------------------------|36| `jiraId` | JIRA ticket ID | **Deduce from current branch name** (see below) |37| `attrName` | Human-readable OSGi display name | Convert `configName` from camelCase to Title Case |38| `description` | Full OSGi description text | Ask the user for a brief description, then expand it |39| `scope` | `both`, `mongo-only`, or `rdb-only` | **Ask the user explicitly. Default is `mongo-only`.** |40| `featureToggle` | Whether to add a feature toggle (`true` / `false`) | **Ask the user explicitly. Default is `false`.** |4142> **Deducing `jiraId` from the branch:**43> Run `git branch --show-current` and extract the JIRA ID44> (e.g. `OAK-12139` → `jiraId=OAK-12139`; `issue/OAK-12139` → `jiraId=OAK-12139`).45> If it differs from a user-supplied value, warn. If none can be deduced, ask.4647> **Before proceeding, ask both optional questions in a single prompt:**48> 1. *"Which backends does this config apply to? (mongo-only / rdb-only / both, default: mongo-only)"*49> 2. *"Do you want a feature toggle for this config? (yes/no, default: no)"*5051---5253## DERIVED IDENTIFIERS5455From the inputs, derive:5657- `DEFAULT_CONST` → `DEFAULT_` + UPPER_SNAKE_CASE of `configName`58 e.g. `avoidExclusiveMergeLock` → `DEFAULT_AVOID_EXCLUSIVE_MERGE_LOCK`59- `setterName` → `set` + PascalCase(configName)60- `getterName` → same as `configName`61- `utilsMethod` → `is` + PascalCase(configName stripped of `avoid`/`enable`/`use`) + `Enabled`62 e.g. `isAvoidMergeLockEnabled`6364**featureToggle=true only:**65- `FT_NAME_CONST` → `FT_NAME_` + UPPER_SNAKE_CASE of configName66- `FT_VALUE` → `"FT_"` + UPPER_SNAKE + `"_"` + jiraId67- `featureField` → `docStore` + PascalCase(configName stripped of trailing `Enabled`) + `Feature`6869---7071## EXECUTION STEPS7273Work through every step in order. Do NOT skip any step.7475Read the supporting files as you reach each group of steps.76771. **Read key files** — locate insertion points in all 9 files (listed below)782. **Configuration.java** — add `@AttributeDefinition` + import → see [osgi-config-patterns.md](osgi-config-patterns.md)793. **DocumentNodeStoreService.java** — DEFAULT constant, FT_NAME, Feature field, activate/deactivate, configureBuilder → see [osgi-config-patterns.md](osgi-config-patterns.md)804. **DocumentNodeStoreBuilder.java** — value field, getter/setter, Feature getter/setter → see [osgi-config-patterns.md](osgi-config-patterns.md)815. **RDBDocumentNodeStoreBuilder.java** — override to disable (scope=mongo-only) → see [osgi-config-patterns.md](osgi-config-patterns.md)826. **Utils.java** — add `isXxxEnabled()` method → see [osgi-config-patterns.md](osgi-config-patterns.md)837. **DocumentNodeStoreServiceConfigurationTest.java** → see [test-patterns.md](test-patterns.md)848. **MongoDocumentNodeStoreBuilderTest.java** → see [test-patterns.md](test-patterns.md)859. **RDBDocumentNodeStoreBuilderTest.java** → see [test-patterns.md](test-patterns.md)8610. **UtilsTest.java** → see [test-patterns.md](test-patterns.md)8711. **Wire into usage class** → see [wiring-and-verification.md](wiring-and-verification.md)8812. **Compile and run tests** → see [wiring-and-verification.md](wiring-and-verification.md)8990### Files to read in STEP 19192```93oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/Configuration.java94oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreService.java95oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java96oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentNodeStoreBuilder.java97oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/util/Utils.java98oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreServiceConfigurationTest.java99oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentNodeStoreBuilderTest.java100oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentNodeStoreBuilderTest.java101oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/util/UtilsTest.java102```103104---105106## QUALITY CHECKLIST107108Before finishing, verify:109110- [ ] `Configuration.java` has a new `@AttributeDefinition` entry with correct default import111- [ ] `DocumentNodeStoreService.java` has DEFAULT constant and configureBuilder value setter112- [ ] _(featureToggle=true)_ `DocumentNodeStoreService.java` has FT_NAME constant, Feature field, activate registration, deactivate cleanup, and feature setter in configureBuilder113- [ ] `DocumentNodeStoreBuilder.java` has value field + getter/setter pair114- [ ] _(featureToggle=true)_ `DocumentNodeStoreBuilder.java` has Feature field + Feature getter/setter pair115- [ ] `RDBDocumentNodeStoreBuilder.java` overrides value getter/setter to disable (scope=mongo-only)116- [ ] _(featureToggle=true)_ `RDBDocumentNodeStoreBuilder.java` also overrides Feature getter/setter (scope=mongo-only)117- [ ] `Utils.java` has `isXxxEnabled()` with proper javadoc118- [ ] `DocumentNodeStoreServiceConfigurationTest.java` tests default value + override119- [ ] `MongoDocumentNodeStoreBuilderTest.java` tests default getter (+ null feature if featureToggle=true)120- [ ] `RDBDocumentNodeStoreBuilderTest.java` has symmetrical default-value tests (scope=both) or override-disabled tests (scope=mongo-only)121- [ ] `UtilsTest.java` has correct number of tests for featureToggle + scope combination122- [ ] `DocumentNodeStore.java` reads the config via `{utilsMethod}(builder)` and stores it as a field123- [ ] Target class receives and uses the field correctly124- [ ] All tests pass125- [ ] No new static imports added to any test file126127---128129## IMPORTANT CONSTRAINTS130131- **Assertion style**: match the existing imports in each file — do NOT add new imports. If the file uses `assertFalse(...)` (static), use that; if it uses `Assert.assertFalse(...)`, use that.132- **No static imports in new production code**133- **JUnit 4** only (`@Test` from `org.junit.Test`)134- **Apply standards only to new code** — never reformat or rename existing code135- Follow the exact naming and placement patterns shown in the supporting files136137---138> Source: [apache/jackrabbit-oak](https://github.com/apache/jackrabbit-oak) — distributed by [TomeVault](https://tomevault.io).139<!-- tomevault:4.0:skill_md:2026-06-29 -->