pseudocode-to-java-code
Pseudocode → Java
Pseudocode is under-specified on purpose. The Java you produce has to commit to everything pseudocode leaves open: types, nullability, error handling, mutability, collection implementations.
Decisions pseudocode doesn't make (but Java requires)
| Pseudocode says | Java must decide |
|---|---|
let S be a set |
HashSet? TreeSet? LinkedHashSet? (Does order matter?) |
x ← lookup(k) |
Returns null on miss? Optional<V>? Throws? |
list of numbers |
int[]? List<Integer>? IntStream? (Boxed vs primitive matters.) |
error: ... |
Checked Exception? RuntimeException? Return sentinel? |
for each x in S |
Enhanced for? Stream? (Mutation during iteration → ConcurrentModificationException.) |
procedure f(x) |
Static method? Instance method? What class does it live on? |
Default choices (absent a reason to deviate):
- Sets/maps →
HashSet/HashMapunless order is mentioned;LinkedHash*if insertion order matters;Tree*if sorted iteration is used. - Missing lookup →
Optionalfor new code,nullif matching an existing API.
More from santosomar/general-secure-coding-agent-skills
code-review-assistant
Performs structured code review on a diff or file set, producing inline comments with severity levels and a summary. Checks correctness, error handling, security, and maintainability — in that priority order. Use when reviewing a pull request, when the user asks for a code review, when preparing code for merge, or when a second opinion is needed on a change.
15dependency-resolver
Diagnoses and resolves package dependency conflicts — version mismatches, diamond dependencies, cycles — across npm, pip, Maven, Cargo, and similar ecosystems. Use when install fails with a resolution error, when two packages require incompatible versions of a third, or when upgrading one dependency breaks another.
4configuration-generator
Generates configuration files for services and tools (app config, logging config, linter config, database config) from a brief description of desired behavior, matching the target format's idioms. Use when bootstrapping a new service, when the user asks for a config file for a specific tool, or when translating config intent between formats.
3ci-pipeline-synthesizer
Generates CI pipeline configs by analyzing a repo's structure, language, and build needs — GitHub Actions, GitLab CI, or other platforms. Use when bootstrapping CI for a new repo, when porting from one CI to another, when the user asks for a pipeline that builds and tests their project, or when wiring in security gates.
3api-design-assistant
Reviews and designs API contracts — function signatures, REST endpoints, library interfaces — for usability, evolvability, and the principle of least surprise. Use when designing a new public interface, when reviewing an API PR, when the user asks whether a signature is well-designed, or when planning a breaking change.
2code-refactoring-assistant
Executes refactorings — extract method, inline, rename, move — in small, behavior-preserving steps with a test between each. Use when the user wants to restructure working code, when cleaning up after a feature lands, or when a smell has been identified and needs fixing.
2