Q31Junie Workflows
How should Junie be used to plan a multi-step feature?
Start by asking for a plan and affected files, then review assumptions and scope before implementation. Break the feature into coherent slices and ver...
Answer
Start by asking for a plan and affected files, then review assumptions and scope before implementation. Break the feature into coherent slices and verify each result. Avoid authorizing a broad task if the acceptance criteria or data boundaries are unclear.
Syntax
Requirements → plan → file map → implementation slices → verify
Example
Ask Junie to plan pagination across controller, service, repository, and tests before editing.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q32Junie Workflows
When is an agent workflow preferable to chat?
Use an agent workflow when the task requires coordinated steps such as inspecting files, editing multiple modules, and running checks. Use chat for an...
Answer
Use an agent workflow when the task requires coordinated steps such as inspecting files, editing multiple modules, and running checks. Use chat for analysis, explanation, and alternatives. Keep agent tasks bounded, observable, and reversible, and confirm the exact capabilities of the installed version.
Syntax
Question → chat
Multi-file implementation → agent + review
Example
Ask chat to compare designs, then let Junie implement the selected design in a feature branch.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q33Junie Workflows
Why review an agent's plan before execution?
A plan reveals which files, tools, and operations the agent expects to use. Reviewing it can catch scope expansion, unnecessary dependencies, destruct...
Answer
A plan reveals which files, tools, and operations the agent expects to use. Reviewing it can catch scope expansion, unnecessary dependencies, destructive commands, or missing tests before they occur. A plan is still a proposal and does not replace review of the final diff.
Syntax
Goal → proposed steps → scope check → execute
Example
Reject a plan that proposes changing unrelated configuration for a small validation fix.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q34Junie Workflows
How should multi-file agent changes be managed?
Ask the agent to identify affected files and dependencies first. Make changes in coherent slices, inspect the full diff, and run unit and integration ...
Answer
Ask the agent to identify affected files and dependencies first. Make changes in coherent slices, inspect the full diff, and run unit and integration tests. Pay special attention to public interfaces, configuration, migrations, and generated files.
Syntax
File map → edits → diff review → tests
Example
For a new field, inspect the DTO, validation, persistence, mapping, API contract, and tests.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q35Junie Workflows
What risks come with agent-run terminal commands?
Commands may change files, install packages, access networks, or affect data. Inspect the command, arguments, target paths, and side effects; use a de...
Answer
Commands may change files, install packages, access networks, or affect data. Inspect the command, arguments, target paths, and side effects; use a development environment and least privilege. Require explicit approval for destructive or production operations.
Syntax
Inspect command → validate scope → approve/deny → audit
Example
Review `./gradlew test` differently from a command that deletes files or deploys infrastructure.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q36Safety
How should permission prompts for an agent be handled?
Treat permission prompts as a security boundary. Verify command intent, arguments, file paths, network effects, and credentials before approving. Deny...
Answer
Treat permission prompts as a security boundary. Verify command intent, arguments, file paths, network effects, and credentials before approving. Deny or narrow actions that exceed task scope, and use the least privilege available.
Syntax
Action + arguments + side effects → decision
Example
Do not approve a network upload simply because it appears in an agent-generated plan.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q37Code Understanding
How can an agent investigate a large codebase?
Ask it to identify likely entry points, symbols, callers, and relevant tests, then inspect those paths directly. Indexing and context availability may...
Answer
Ask it to identify likely entry points, symbols, callers, and relevant tests, then inspect those paths directly. Indexing and context availability may vary, so verify file references and do not assume the agent has understood every dependency.
Syntax
Search symbol → inspect callers → inspect tests
Example
Trace uses of a legacy interface before changing its signature.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q38Debugging
How should an AI tool be given a stack trace?
Provide a sanitized stack trace, reproduction steps, expected and actual behavior, and recent changes. Ask for plausible root causes and the evidence ...
Answer
Provide a sanitized stack trace, reproduction steps, expected and actual behavior, and recent changes. Ask for plausible root causes and the evidence that would distinguish them. Never include tokens, passwords, or customer data in diagnostic prompts.
Syntax
Trace + reproduction + expected/actual + environment
Example
Ask it to map the first application frame to source code and propose a reproducing test.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q39Testing
How should an agent help fix a failing test?
First reproduce and classify the failure as a regression, flaky test, environment issue, or stale assertion. Ask the agent to inspect both test and pr...
Answer
First reproduce and classify the failure as a regression, flaky test, environment issue, or stale assertion. Ask the agent to inspect both test and production code before changing either. Avoid weakening a test merely to make it pass.
Syntax
Reproduce → classify → root cause → fix → rerun
Example
Compare the failing test against the base branch before changing its expected result.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q40Testing
Can an agent generate integration tests?
It can draft tests for interactions among services, databases, and HTTP endpoints. Specify fixtures, isolation, cleanup, and expected side effects. Ve...
Answer
It can draft tests for interactions among services, databases, and HTTP endpoints. Specify fixtures, isolation, cleanup, and expected side effects. Verify tests do not depend on production services or real credentials and that failures are diagnosable.
Syntax
Arrange dependencies → invoke boundary → assert outcomes
Example
Use a disposable test database and test server for API integration tests.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q41Testing
How should generated mocks be reviewed?
Mocks should represent relevant collaborator behavior without making tests brittle or hiding integration defects. Follow the project's framework and c...
Answer
Mocks should represent relevant collaborator behavior without making tests brittle or hiding integration defects. Follow the project's framework and conventions, verify setups and verifications, and prefer real implementations for simple value objects where practical.
Syntax
Arrange mock → act → assert behavior
Example
Mock an external payment gateway while testing the business rule directly.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q42Testing
Does more generated test code always mean better coverage?
No. Coverage measures executed code, not whether assertions catch meaningful defects. Review boundary cases, negative paths, invariants, and regressio...
Answer
No. Coverage measures executed code, not whether assertions catch meaningful defects. Review boundary cases, negative paths, invariants, and regression sensitivity. A few strong tests can be more valuable than many repetitive ones.
Syntax
Coverage + meaningful assertions + mutation sensitivity
Example
Check that a test fails if the validation condition is removed.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q43Code Review
What should an AI code-review finding include?
A useful finding identifies the location, severity, evidence, impact, and concrete remediation. Ask for actionable defects rather than speculative sty...
Answer
A useful finding identifies the location, severity, evidence, impact, and concrete remediation. Ask for actionable defects rather than speculative style comments, and reproduce high-impact issues before modifying code.
Syntax
Finding = location + evidence + impact + remediation
Example
Prioritize an authorization bypass over a minor naming preference.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q44Git Workflow
How can AI help prepare a pull request description?
It can draft a summary, test notes, and explanation from a diff and task context. Confirm that the description matches actual changes and clearly stat...
Answer
It can draft a summary, test notes, and explanation from a diff and task context. Confirm that the description matches actual changes and clearly state tests that were not run. Never claim validation or performance improvements without evidence.
Syntax
Diff → summary + test evidence + limitations
Example
List changed API behavior and the exact test commands executed.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q45Git Workflow
Can AI draft useful commit messages?
It can summarize a diff into a commit message, but the developer must ensure the message describes actual intent. Follow the repository's format and t...
Answer
It can summarize a diff into a commit message, but the developer must ensure the message describes actual intent. Follow the repository's format and ticket conventions, and avoid claiming a fix if the diff only adds diagnostics.
Syntax
type(scope): concise intent
Example
Use `fix(auth): reject expired tokens` only if the patch actually enforces that behavior.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q46Git Workflow
How can AI help resolve merge conflicts?
Ask it to explain the intent of each side and propose a resolution that preserves required behavior. Inspect the final semantics and run tests for bot...
Answer
Ask it to explain the intent of each side and propose a resolution that preserves required behavior. Inspect the final semantics and run tests for both branches' functionality. Never accept one side wholesale without understanding what would be lost.
Syntax
Conflict markers → compare intent → resolve → test
Example
Resolve a conflict in validation logic and test both previously supported cases.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q47Modernization
How can AI help modernize legacy code safely?
It can explain legacy patterns and propose incremental migrations, but broad rewrites carry compatibility and regression risks. Establish baseline tes...
Answer
It can explain legacy patterns and propose incremental migrations, but broad rewrites carry compatibility and regression risks. Establish baseline tests, migrate one boundary at a time, and verify behavior and performance. Prefer adapters and small changes when possible.
Syntax
Baseline → incremental migration → tests → expand
Example
Migrate one service from a legacy API before rewriting the entire application.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q48Dependencies
How should AI-suggested dependency updates be evaluated?
Check package identity, release notes, breaking changes, license, vulnerabilities, transitive dependencies, and lockfile changes. Use approved package...
Answer
Check package identity, release notes, breaking changes, license, vulnerabilities, transitive dependencies, and lockfile changes. Use approved package sources and automated scanning. Do not install a dependency solely because a generated snippet references it.
Syntax
Verify package → release notes → lockfile → tests
Example
Confirm a suggested method exists in the installed library version before adopting it.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q49Database
How should AI-generated ORM queries be reviewed?
Check generated SQL, parameterization, tracking behavior, query count, pagination, and transaction semantics. Use realistic test data and query plans ...
Answer
Check generated SQL, parameterization, tracking behavior, query count, pagination, and transaction semantics. Use realistic test data and query plans for performance-sensitive operations. Watch for N+1 queries and unintended eager loading.
Syntax
ORM expression → SQL → execution plan
Example
Check whether a generated loop triggers one database query per item.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q50Security
How should agent-generated API code be reviewed for security?
Review authentication, authorization, input validation, output encoding, rate limits, error handling, and sensitive-data logging. Confirm authorizatio...
Answer
Review authentication, authorization, input validation, output encoding, rate limits, error handling, and sensitive-data logging. Confirm authorization is enforced server-side for each resource and not inferred from UI visibility. Add tests for unauthorized access.
Syntax
Authenticate → authorize → validate → execute → safe response
Example
Test that changing a resource ID cannot let one user access another user's record.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q51Security
What is prompt injection in an IDE coding workflow?
Prompt injection is untrusted content that attempts to manipulate an AI tool into ignoring intended instructions or taking unrelated actions. It can a...
Answer
Prompt injection is untrusted content that attempts to manipulate an AI tool into ignoring intended instructions or taking unrelated actions. It can appear in issues, comments, documentation, or retrieved content. Treat it as data, and never follow it to reveal secrets or bypass access controls.
Syntax
Untrusted text ≠ trusted instruction
Example
Ignore a source comment that asks the agent to print environment secrets.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q52Privacy
How should secrets be handled during AI-assisted development?
Keep credentials in approved secret stores and environment configuration, not prompts, source files, or logs. Use placeholders in examples, enable sec...
Answer
Keep credentials in approved secret stores and environment configuration, not prompts, source files, or logs. Use placeholders in examples, enable secret scanning, and rotate any exposed credential. Follow organizational policy for AI tools and sensitive repositories.
Syntax
Secret manager → environment → redacted logs
Example
Use `API_TOKEN=<placeholder>` in a sample configuration.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q53Security
Can AI-generated code introduce supply-chain risks?
A suggestion may reference a nonexistent or malicious package, a vulnerable version, or an untrusted integration. Verify publisher, package identity, ...
Answer
A suggestion may reference a nonexistent or malicious package, a vulnerable version, or an untrusted integration. Verify publisher, package identity, maintenance, license, advisories, and transitive dependencies before adoption.
Syntax
Package identity → provenance → advisories → lockfile
Example
Check the package registry and lockfile before installing a suggested library.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q54Performance
How should AI-assisted performance optimization be validated?
Use the assistant to form hypotheses and propose changes, then measure with a profiler or benchmark. Optimize demonstrated bottlenecks, preserve corre...
Answer
Use the assistant to form hypotheses and propose changes, then measure with a profiler or benchmark. Optimize demonstrated bottlenecks, preserve correctness tests, and avoid caching or concurrency changes without a clear invalidation and safety model.
Syntax
Baseline → profile → change → benchmark → compare
Example
Measure a slow database query before introducing caching.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q55Frontend
How can AI assist with accessibility reviews?
Ask for semantic markup, accessible names, keyboard operation, focus management, contrast, and clear error announcements. Validate with automated chec...
Answer
Ask for semantic markup, accessible names, keyboard operation, focus management, contrast, and clear error announcements. Validate with automated checks and manual keyboard or assistive-technology testing. Generated code alone does not establish conformance.
Syntax
Automated scan + keyboard test + manual review
Example
Check that a dialog returns focus to its trigger when closed.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q56Architecture
How should AI tools be used in a monorepo?
Identify workspace boundaries, shared libraries, scripts, and dependent applications before editing. Scope the change to relevant packages and consume...
Answer
Identify workspace boundaries, shared libraries, scripts, and dependent applications before editing. Scope the change to relevant packages and consumers, then run targeted and integration tests. Do not assume a repository summary includes every dependency.
Syntax
Workspace → package → dependents → tests
Example
For a shared type change, test each package that imports it.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q57Safety
How should an agent treat tool output and generated commands?
Treat tool output and commands as proposals requiring validation. Confirm paths, arguments, side effects, and provenance. Use deterministic controls f...
Answer
Treat tool output and commands as proposals requiring validation. Confirm paths, arguments, side effects, and provenance. Use deterministic controls for permissions and CI rather than relying on the model to self-police risky actions.
Syntax
Proposal → policy check → scoped execution → audit
Example
Verify a cleanup command targets only a temporary workspace.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q58Evaluation
How should a team measure AI coding productivity?
Measure time-to-accepted-change, review effort, defect rate, rework, developer satisfaction, and task completion across representative work. Code volu...
Answer
Measure time-to-accepted-change, review effort, defect rate, rework, developer satisfaction, and task completion across representative work. Code volume and suggestion acceptance alone can be misleading. Compare similar tasks and account for learning effects and risk.
Syntax
Quality + cycle time + review effort + developer experience
Example
Run a pilot with bug fixes, tests, documentation, and features before and after adoption.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q59Governance
What should an organization define before adopting JetBrains AI tools?
Define approved data classes, eligible repositories, access and retention expectations, code review requirements, security controls, and incident hand...
Answer
Define approved data classes, eligible repositories, access and retention expectations, code review requirements, security controls, and incident handling. Verify current plan capabilities and organization settings instead of assuming all accounts have identical controls.
Syntax
Policy → configuration → training → monitoring
Example
Document which repositories may use AI assistance and which require additional approval.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q60Architecture
How would you design a safe coding-agent workflow?
Use an orchestrator, scoped tools, policy checks, isolated execution, deterministic tests, audit logs, and human approval for high-impact actions. Kee...
Answer
Use an orchestrator, scoped tools, policy checks, isolated execution, deterministic tests, audit logs, and human approval for high-impact actions. Keep authorization outside the model and make state resumable. Product features may implement parts of this workflow differently.
Syntax
Task → plan → policy → tools → tests → human review
Example
Allow an agent to draft a patch while protected CI and a reviewer control merging.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q61Security
How does least privilege apply to Junie or other coding agents?
Give the agent only the files, commands, credentials, and network access needed for the task. Separate read and write capabilities, use short-lived cr...
Answer
Give the agent only the files, commands, credentials, and network access needed for the task. Separate read and write capabilities, use short-lived credentials, and require approval for privileged operations. Avoid exposing production secrets to coding sessions.
Syntax
Capabilities = minimum required permissions
Example
A test-fixing agent may edit a feature branch but cannot deploy to production.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q62Security
What should an agent execution sandbox isolate?
A sandbox should restrict filesystem access, process execution, network egress, credentials, and resource use. Containers alone may not be a complete ...
Answer
A sandbox should restrict filesystem access, process execution, network egress, credentials, and resource use. Containers alone may not be a complete boundary if privileged host resources are shared. Select controls based on the threat model and verify isolation.
Syntax
Task → isolated workspace → restricted tools/network → audit
Example
Run untrusted build scripts in an ephemeral environment without production credentials.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q63Security
How can command injection occur in agent workflows?
Injection can occur when untrusted file paths, issue text, or generated arguments are interpolated into shell commands. Prefer structured process APIs...
Answer
Injection can occur when untrusted file paths, issue text, or generated arguments are interpolated into shell commands. Prefer structured process APIs, argument arrays, strict allowlists, and validation. Avoid building shell commands by concatenating untrusted strings.
Syntax
spawn("grep", ["-R", validatedPattern, validatedPath])
Example
Do not concatenate a user-controlled branch name into a shell command without validation.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q64Security
How should agent file access prevent path traversal?
Resolve paths against an approved workspace root, normalize them, and reject paths that escape the root, including symlink escapes where relevant. Rev...
Answer
Resolve paths against an approved workspace root, normalize them, and reject paths that escape the root, including symlink escapes where relevant. Revalidate at execution time to reduce time-of-check/time-of-use risks.
Syntax
resolved = realpath(join(root, inputPath))
assert isWithin(root, resolved)
Example
Reject `../../.ssh/id_rsa` when a tool may read only project files.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q65Architecture
Why put a deterministic policy engine between an agent and tools?
A policy engine enforces allowed paths, commands, data classes, and approval requirements independently of model intent. Validate each action at the e...
Answer
A policy engine enforces allowed paths, commands, data classes, and approval requirements independently of model intent. Validate each action at the execution boundary and record decisions. This is stronger than relying on prompt instructions alone.
Syntax
Model action → policy check → tool executor → audit event
Example
Block infrastructure apply commands unless environment and approval requirements are satisfied.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q66Architecture
How should tools exposed to an agent be designed?
Tools should have narrow purposes, typed schemas, explicit side effects, predictable errors, and minimal outputs. Separate read and write operations, ...
Answer
Tools should have narrow purposes, typed schemas, explicit side effects, predictable errors, and minimal outputs. Separate read and write operations, validate arguments server-side, and avoid a single unrestricted tool that can do everything.
Syntax
Tool = name + schema + permission + effect + error contract
Example
Prefer `read_file` and `apply_patch` over unrestricted shell access where practical.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q93Customization
How should reusable prompts be designed for repeatable work?
Reusable prompts should define the task, required inputs, constraints, output format, and verification steps. Keep organization-wide instructions sepa...
Answer
Reusable prompts should define the task, required inputs, constraints, output format, and verification steps. Keep organization-wide instructions separate from task-specific prompts, and confirm which reusable-prompt features are supported by the current IDE and product version.
Syntax
Task template + inputs + constraints + output contract
Example
Create a reusable prompt to review a REST endpoint for validation, authorization, and tests.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q94IDE Integration
How should AI suggestions work alongside IDE inspections?
IDE inspections, compiler diagnostics, and static analysis provide deterministic signals that complement AI suggestions. Use them to catch type errors...
Answer
IDE inspections, compiler diagnostics, and static analysis provide deterministic signals that complement AI suggestions. Use them to catch type errors, style violations, and known risky patterns, then review warnings rather than assuming a generated change is correct because the editor accepts it.
Syntax
AI draft → IDE inspections → compiler → tests
Example
Run the project's inspections after an agent edits Kotlin or Java code.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q95Git Workflow
Why use version-control checkpoints before agent tasks?
Start from a clean or understood working tree and create a branch or checkpoint before broad changes. This makes the agent's contribution easier to is...
Answer
Start from a clean or understood working tree and create a branch or checkpoint before broad changes. This makes the agent's contribution easier to isolate and revert, while protecting unrelated developer work. Never overwrite uncommitted user changes without explicit consent.
Syntax
git status → branch/checkpoint → agent task → diff review
Example
Create a feature branch before asking Junie to refactor several files.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.
Q96Build Systems
How should AI tools be instructed to run project builds?
Provide the correct build and test commands for the repository and the modules affected. Agents may guess a command or run a costly full build unneces...
Answer
Provide the correct build and test commands for the repository and the modules affected. Agents may guess a command or run a costly full build unnecessarily, so define the smallest meaningful checks and escalate to broader validation before merging.
Syntax
changed module → targeted tests → full CI checks
Example
Tell the agent to run `./gradlew :service:test` for a Gradle multi-module service.
Key Points
- Use focused, observable workflows.
- Validate tool results and proposed changes.
- Keep risky actions behind explicit review.