| name | oak-store-document-add-config |
| description | 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. |
| allowed-tools | Read, Edit, Grep, Glob, Bash |
| disable-model-invocation | true |
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
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