Skip to content

[Java Skill Suggestion] Explicitly enforce rule to wrap Workflow/Activity parameters in an object/record for versioning #254

Description

@hunterhsieh

Is your feature request related to a problem? Please describe.

When developers use coding assistants loaded with this skill, the agent may generate Java code using raw primitive parameters (e.g., execute(String ID, int amount)).While raw primitives compile fine, they break backward compatibility, causing NonDeterministicWorkflowError exceptions during workflow history replays or broken execution contracts during rolling worker deployments. Because this skill is explicitly designed to guard against versioning issues, it should guide AI agents to standardize on single-argument wrapper objects for both Workflows and Activities.

Describe the solution you'd like

I suggest updating the Java-specific system reference files (such as versioning.md or the core Java pattern files) to include a rule for the AI agent to follow: Enforce Single-Argument Wrappers Universally: Instruct the agent that generated Java Workflow and Activity method signatures should accept a single wrapper record/class and return a single wrapper record/class rather than multiple parameters or raw primitives. This isolates the interface signature from data model updates and guarantees backward-compatible schema migration layers.

Additional context

An exact example of the Java generation block the skill should favor:

// WORKFLOW DEFINITION
public record OrderInput(String orderId, double price) {}
public record OrderOutput(String confirmationId, String status) {}

@WorkflowInterface
public interface OrderWorkflow {
    @WorkflowMethod
    OrderOutput processOrder(OrderInput input);
}

// ACTIVITY DEFINITION
public record PaymentInput(String orderId, double amount, String currency) {}
public record PaymentOutput(boolean success, String transactionId) {}

@ActivityInterface
public interface PaymentActivities {
    @ActivityMethod
    PaymentOutput debitAccount(PaymentInput input);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions