Skill: Dependency and Decompilation Analysis
Purpose: Authoritative rules for discovering and classifying dependencies during TIBCO flow analysis. Follow exactly.
1. Dependency Discovery
Call migration_listArtifacts with category="custom-code" to find all .jar, .java, .dwl, .xml, .raml, .properties, .yaml files.
Also examine:
pom.xml for Maven dependencies — especially those with classifier=TIBCO-plugin (TIBCO connectors).
TIBCO-artifact.json for exported resources and class loader settings.
src/main/java/ for custom Java classes.
src/main/resources/ for Mapper/XSLT modules (.dwl), property files, and API specs.
1.1 Mandatory Coverage Guardrails [NO FALSE NEGATIVES]
- Build the dependency candidate list from artifact inventory and source references, not from a root-folder file loop.
- Do NOT assume "all root
.jar files were decompiled" means dependency analysis is complete.
- Treat any class/library referenced by flow-used code as a dependency candidate until explicitly resolved.
- If a referenced library cannot be located in scanned source artifacts or
pom.xml, mark it missing (fail-closed).
Anti-pattern to avoid:
- Scanning only the workspace root for
.jar files and concluding dependency closure from that result.
2. Java Class / JAR Analysis Procedure
2.1 When to Decompile
Do NOT blindly decompile every .jar in the source folder. Instead, decompile on demand when a JAR/class reference is encountered during analysis:
- A TIBCO flow references a custom Java component (transformer, message processor, interceptor)
- A Mapper/XSLT expression calls a Java function
- A
pom.xml dependency with classifier=TIBCO-plugin has no standard Logic Apps equivalent
- A class is imported but its
.java source is not in src/main/java/
2.2 How to Decompile
When you decide a JAR needs decompilation:
- If
.java source files exist under src/main/java/, read them directly — no decompilation needed.
- For JAR files without source, attempt decompilation:
- Run
cfr <JarPath> --outputdir out/__decompiled__/<JarName>/ in the terminal.
- Alternatively, use
jar xf <JarPath> to extract and then decompile .class files.
- ALWAYS write decompilation output to
out/__decompiled__/ in the current migration workspace directory. NEVER write to the source folder or any other external location.
- Read the decompiled
.java files to understand classes, methods, and business rules.
- If decompilation fails (obfuscated, native), mark it as a critical missing dependency.
2.3 Recursive Dependency Tree Resolution [IMPORTANT]
After decompiling a JAR, inspect what IT depends on and walk the full tree:
- Read the decompiled code — look for
import statements, type references, and method calls that reference other libraries.
- For each referenced library, check if it exists in the source folder (as
.jar, .java, or in pom.xml).
- If it is a
.jar in the source folder but not yet decompiled — decompile it too (repeat from §2.2).
- If that child JAR itself references more JARs — continue recursively.
- Stop recursion when a dependency is:
- Already decompiled, OR
- A standard TIBCO/Java runtime library (
org.TIBCO.*, java.*, javax.*), OR
- Not found in the source folder → mark as missing dependency.
2.4 Decompilation Checklist
Before moving to dependency classification, confirm:
2.5 Verification Gates Before "No Missing Dependencies"
You MUST pass all gates below before storing an empty missingDependencies array:
- Reference-to-artifact gate: every non-runtime import/type referenced by flow-used classes maps to one of:
- source code present, OR
- decompiled JAR present, OR
- explicit missing dependency entry.
- Instantiation/call-site gate: if code contains constructor calls or casts to external types (e.g.,
new CustomService(), (ICustomService)factory.create()), the implementing library is mandatory.
- Import/type gate: an
import of a custom package with no resolvable artifact is NOT ignored; it must be justified as unused by symbol-level evidence or marked missing.
- Flow relevance gate: unresolved dependencies in code paths executed by the analyzed flow are
migrationRelevant=true; if they block non-stub implementation, set severity=critical and blocksMigration=true.
If any gate fails, do NOT return zero missing dependencies.
3. Source vs Decompiled Precedence
- If the source code (
.java, .dwl files) for a referenced class/module is PRESENT in the scanned source folder (listed as dependency artifacts), do NOT mark it as a missing dependency — the conversion agent can use the source code directly.
- Only mark a dependency as missing when NEITHER source code NOR understandable decompiled code is available.
- Presence of a package/import reference alone does not resolve dependency status; resolution requires source/decompiled implementation availability.
4. What Counts as Missing
- JAR files whose source code is NOT found in the source folder.
- Custom TIBCO connectors (non-standard
TIBCO-plugin dependencies) without source.
- Custom Java components (transformers, message processors, interceptors) without source.
- External RAML/OAS API specifications not present in the project.
- Mapper/XSLT modules imported from external libraries not present locally.
- Third-party connector dependencies without a Logic Apps equivalent and no source code.
- TIBCO Enterprise connectors that require specific licensing (SAP, Salesforce, etc.) — flag as needing equivalent Azure connectors.
- Configuration/certificates/connection strings needed for target environment.
- TIBCO Platform dependencies (API Manager policies, Object Store V2, CloudHub properties).
5. Classification
Each missing dependency MUST have:
| Field |
Type |
Description |
id |
string |
Unique identifier |
name |
string |
Dependency name |
type |
string |
jar/java-class/dwl-module/connector/raml/schema/api-spec/property-file/custom-code/other |
origin |
string |
standard-TIBCO-runtime/standard-TIBCO-connector/TIBCO-enterprise/third-party/custom/unknown |
severity |
string |
critical/warning/info |
referencedBy |
array |
Artifact names that reference this dependency |
reason |
string |
Why it is needed |
blocksMigration |
boolean |
True if prevents complete non-stub implementation |
migrationRelevant |
boolean |
False for build-only or design-time-only dependencies (e.g. MUnit test dependencies) |
resolution |
string |
MUST follow format: "Add the source code or binary for {name} to the migration source folder and re-run discovery." Do NOT suggest code changes or workarounds — the user must provide the missing artifact. |
Also provide: summary (string), allCriticalResolved (boolean), counts ({ critical, warning, info }).
5.1 Fail-Closed Decision Rule
When evidence is incomplete or ambiguous, default to marking the dependency as missing with appropriate severity rather than reporting full resolution.
A "no missing dependencies" conclusion is valid only when all verification gates in §2.5 pass with explicit evidence.
1---2name: dependency-and-decompilation-analysis3description: Rules for discovering, analysing, and classifying missing dependencies during TIBCO flow analysis. Covers JAR/Java decompilation, Maven dependency analysis, custom module classification, and what blocks migration.4---56# Skill: Dependency and Decompilation Analysis78> **Purpose**: Authoritative rules for discovering and classifying dependencies during TIBCO flow analysis. Follow exactly.910---1112## 1. Dependency Discovery1314Call `migration_listArtifacts` with `category="custom-code"` to find all `.jar`, `.java`, `.dwl`, `.xml`, `.raml`, `.properties`, `.yaml` files.1516Also examine:1718- `pom.xml` for Maven dependencies — especially those with `classifier=TIBCO-plugin` (TIBCO connectors).19- `TIBCO-artifact.json` for exported resources and class loader settings.20- `src/main/java/` for custom Java classes.21- `src/main/resources/` for Mapper/XSLT modules (`.dwl`), property files, and API specs.2223### 1.1 Mandatory Coverage Guardrails [**NO FALSE NEGATIVES**]24251. Build the dependency candidate list from **artifact inventory and source references**, not from a root-folder file loop.262. Do NOT assume "all root `.jar` files were decompiled" means dependency analysis is complete.273. Treat any class/library referenced by flow-used code as a dependency candidate until explicitly resolved.284. If a referenced library cannot be located in scanned source artifacts or `pom.xml`, mark it missing (fail-closed).2930Anti-pattern to avoid:3132- Scanning only the workspace root for `.jar` files and concluding dependency closure from that result.3334---3536## 2. Java Class / JAR Analysis Procedure3738### 2.1 When to Decompile3940Do NOT blindly decompile every `.jar` in the source folder. Instead, decompile **on demand** when a JAR/class reference is encountered during analysis:4142- A TIBCO flow references a custom Java component (transformer, message processor, interceptor)43- A Mapper/XSLT expression calls a Java function44- A `pom.xml` dependency with `classifier=TIBCO-plugin` has no standard Logic Apps equivalent45- A class is imported but its `.java` source is not in `src/main/java/`4647### 2.2 How to Decompile4849When you decide a JAR needs decompilation:50511. If `.java` source files exist under `src/main/java/`, read them directly — no decompilation needed.522. For JAR files without source, attempt decompilation:53 - Run `cfr <JarPath> --outputdir out/__decompiled__/<JarName>/` in the terminal.54 - Alternatively, use `jar xf <JarPath>` to extract and then decompile `.class` files.553. ALWAYS write decompilation output to `out/__decompiled__/` in the **current migration workspace directory**. NEVER write to the source folder or any other external location.564. Read the decompiled `.java` files to understand classes, methods, and business rules.575. If decompilation fails (obfuscated, native), mark it as a critical missing dependency.5859### 2.3 Recursive Dependency Tree Resolution [**IMPORTANT**]6061After decompiling a JAR, inspect what IT depends on and **walk the full tree**:62631. **Read the decompiled code** — look for `import` statements, type references, and method calls that reference other libraries.642. **For each referenced library**, check if it exists in the source folder (as `.jar`, `.java`, or in `pom.xml`).653. **If it is a `.jar` in the source folder but not yet decompiled** — decompile it too (repeat from §2.2).664. **If that child JAR itself references more JARs** — continue recursively.675. **Stop recursion** when a dependency is:68 - Already decompiled, OR69 - A standard TIBCO/Java runtime library (`org.TIBCO.*`, `java.*`, `javax.*`), OR70 - Not found in the source folder → mark as missing dependency.7172### 2.4 Decompilation Checklist7374Before moving to dependency classification, confirm:75- [ ] Every JAR **referenced by flow artifacts** has been decompiled (or its source code is available)76- [ ] Every child JAR discovered inside decompiled code has also been traced recursively77- [ ] Custom transformers, message processors, and interceptors are fully understood78- [ ] Shared utility classes referenced by multiple flows are catalogued7980### 2.5 Verification Gates Before "No Missing Dependencies"8182You MUST pass all gates below before storing an empty `missingDependencies` array:83841. **Reference-to-artifact gate**: every non-runtime import/type referenced by flow-used classes maps to one of:85 - source code present, OR86 - decompiled JAR present, OR87 - explicit missing dependency entry.882. **Instantiation/call-site gate**: if code contains constructor calls or casts to external types (e.g., `new CustomService()`, `(ICustomService)factory.create()`), the implementing library is mandatory.893. **Import/type gate**: an `import` of a custom package with no resolvable artifact is NOT ignored; it must be justified as unused by symbol-level evidence or marked missing.904. **Flow relevance gate**: unresolved dependencies in code paths executed by the analyzed flow are `migrationRelevant=true`; if they block non-stub implementation, set `severity=critical` and `blocksMigration=true`.9192If any gate fails, do NOT return zero missing dependencies.9394---9596## 3. Source vs Decompiled Precedence9798- If the source code (`.java`, `.dwl` files) for a referenced class/module is PRESENT in the scanned source folder (listed as dependency artifacts), do NOT mark it as a missing dependency — the conversion agent can use the source code directly.99- Only mark a dependency as missing when NEITHER source code NOR understandable decompiled code is available.100- Presence of a package/import reference alone does not resolve dependency status; resolution requires source/decompiled implementation availability.101102---103104## 4. What Counts as Missing105106- JAR files whose source code is NOT found in the source folder.107- Custom TIBCO connectors (non-standard `TIBCO-plugin` dependencies) without source.108- Custom Java components (transformers, message processors, interceptors) without source.109- External RAML/OAS API specifications not present in the project.110- Mapper/XSLT modules imported from external libraries not present locally.111- Third-party connector dependencies without a Logic Apps equivalent and no source code.112- TIBCO Enterprise connectors that require specific licensing (SAP, Salesforce, etc.) — flag as needing equivalent Azure connectors.113- Configuration/certificates/connection strings needed for target environment.114- TIBCO Platform dependencies (API Manager policies, Object Store V2, CloudHub properties).115116---117118## 5. Classification119120Each missing dependency MUST have:121122| Field | Type | Description |123| ------------------- | ------- | -------------------------------------------------------------------------------------------- |124| `id` | string | Unique identifier |125| `name` | string | Dependency name |126| `type` | string | jar/java-class/dwl-module/connector/raml/schema/api-spec/property-file/custom-code/other |127| `origin` | string | standard-TIBCO-runtime/standard-TIBCO-connector/TIBCO-enterprise/third-party/custom/unknown |128| `severity` | string | critical/warning/info |129| `referencedBy` | array | Artifact names that reference this dependency |130| `reason` | string | Why it is needed |131| `blocksMigration` | boolean | True if prevents complete non-stub implementation |132| `migrationRelevant` | boolean | False for build-only or design-time-only dependencies (e.g. MUnit test dependencies) |133| `resolution` | string | MUST follow format: "Add the source code or binary for {name} to the migration source folder and re-run discovery." Do NOT suggest code changes or workarounds — the user must provide the missing artifact. |134135Also provide: `summary` (string), `allCriticalResolved` (boolean), `counts` ({ critical, warning, info }).136137### 5.1 Fail-Closed Decision Rule138139When evidence is incomplete or ambiguous, default to marking the dependency as missing with appropriate severity rather than reporting full resolution.140141A "no missing dependencies" conclusion is valid only when all verification gates in §2.5 pass with explicit evidence.142143