Skip to content

Enhance Junie integration - #4795

Open
dch-actaport wants to merge 1 commit into
github:mainfrom
dokSAFE:fix/4794-junie-arguments
Open

dch-actaport wants to merge 1 commit into
github:mainfrom
dokSAFE:fix/4794-junie-arguments

Conversation

@dch-actaport

@dch-actaport dch-actaport commented Sep 30, 2026 •

Copy link
Copy Markdown

Enhance Junie integration
Modify the Junie integration to dynamically inject the allowPromptArgument frontmatter key based on the presence of the $ARGUMENTS variable. This ensures that the Junie agent is correctly configured to accept user input only when the command template supports it.
The transformation logic now also converts $ARGUMENTS to $prompt while escaping other template variables (e.g., $$variable) to prevent accidental expansion by the Junie agent.
Changes:

  • Inject allowPromptArgument: true in Junie frontmatter if $ARGUMENTS is detected; set to false otherwise.
  • Map $ARGUMENTS to $prompt and double-escape other $ variables.
  • Update template script and memory paths to use .specify/ prefix.
  • Refine clarification questioning hierarchy and state management.
  • Add comprehensive tests for Junie frontmatter and variable transforms.

Description

It fix problems with the prompt arguments for Junie

Testing

  • [ x] Tested locally with uv run specify --help
  • [ x] Ran existing tests with uv sync && uv run pytest
  • [ x ] Tested with a sample project (if applicable)

Required tests

• T1: specify init --integration junie — Required to initialize the project and verify Junie scaffolding.
• T2: /speckit.specify — (Requires T1) Required to create the feature specification; affected by Junie integration changes.
• T3: /speckit.analyze — (Requires T2) Verifies direct changes to analyze.md and hook note injection.
• T4: /speckit.clarify — (Requires T2) Verifies direct changes to clarify.md and hook note injection.
• T5: /speckit.plan — (Requires T2) Prerequisite for implementation and convergence; verifies hook note injection.
• T6: /speckit.implement — (Requires T5) Verifies direct changes to implement.md and hook note injection.
• T7: /speckit.converge — (Requires T6) Verifies direct changes to converge.md and hook note injection.
• T8: /speckit.taskstoissues — (Requires T5) Verifies direct changes to taskstoissues.md and hook note injection.
• T9: specify check — Verifies the CLI check command remains functional with Junie integration changes.
• T10: specify extension * — Verifies CLI extension management commands.
• T11: specify preset * — Verifies CLI preset management commands.
• T12: pytest tests/integrations/test_integration_junie.py — Runs the updated test suite for the Junie integration.

Manual test results

Agent: [e.g., GitHub Copilot in VS Code] | OS/Shell: [e.g., macOS/zsh]

Command tested Notes
T1: specify init --integration junie OK
T2: '/speckit.specify' Create spec.md and ´checklists/requirements.md as expected
T4: /speckit.clarify changes direct to spec.md
T5: /speckit.plan work as expecte but junie doesnt support optional agruments
T6: /speckit.implement OK
T7: /speckit.converge OK
T9: specify check OK
T10: specify extension * OK
T11: specify preset * OK
T12: pytest tests/integrations/test_integration_junie.py 100% Passed

AI Disclosure

  • [ x ] I did use AI assistance (fill in the disclosure below)

AI disclosure: Written with the help of Junie v26.9.22 and Gemini 3 Flash

fix #4794

Enhance Junie integration
Modify the Junie integration to dynamically inject the
`allowPromptArgument` frontmatter key based on the presence of the
`$ARGUMENTS` variable. This ensures that the Junie agent is correctly
configured to accept user input only when the command template supports
it.
The transformation logic now also converts `$ARGUMENTS` to `$prompt`
while escaping other template variables (e.g., `$$variable`) to prevent
accidental expansion by the Junie agent.
Changes:
- Inject `allowPromptArgument: true` in Junie frontmatter if
  `$ARGUMENTS` is detected; set to `false` otherwise.
- Map `$ARGUMENTS` to `$prompt` and double-escape other `$` variables.
- Update template script and memory paths to use `.specify/` prefix.
- Refine clarification questioning hierarchy and state management.
- Add comprehensive tests for Junie frontmatter and variable transforms.
@dch-actaport

Copy link
Copy Markdown
Author

fix #4794

@mnriem mnriem added the triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate label Sep 30, 2026
@mnriem
mnriem requested a balanced review from Copilot September 30, 2026 13:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Frontmatter handling can corrupt valid YAML or omit the required top-level option, and the changelog entries are misplaced.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

Open (4)
What changed in this PR

Fixes Junie command generation so prompt arguments and dollar-prefixed variables follow Junie syntax.

Changes:

  • Adds Junie frontmatter and variable transformations.
  • Adds transformation tests.
  • Updates the changelog.
File Description
src/​specify_cli/​integrations/​junie/​__init__.py Implements Junie prompt handling.
tests/​integrations/​test_integration_junie.py Tests the new transformations.
CHANGELOG.md Records the integration update.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +148 to +154
parts = content.split("---", 2)
if len(parts) < 3:
# Malformed frontmatter?
return content

frontmatter = parts[1]
body = parts[2]
Comment on lines +156 to +160
if "allowPromptArgument:" in frontmatter:
# Overwrite existing key
frontmatter = re.sub(
r"(?m)^(\s*allowPromptArgument:\s*).*",
fr"\1{value}",
Comment thread CHANGELOG.md
- Remove a dead case pattern in common.sh (SC2221/SC2222) (#4605)
- fix: support SKILL.md rendering for the generic integration (#4562)
- chore: release 1.0.8, begin 1.0.9.dev0 development (#4619)
- chore: release 1.0.8, begin 1.0.9.dev0 development (#4619)
Comment thread CHANGELOG.md
Comment on lines +129 to +131
- feat(integrations): enhance Junie integration with prompt arguments and variable escaping (#4600)
- fix(junie): ensure `allowPromptArgument` is unique and correctly set in command frontmatter
- feat(junie): map `$ARGUMENTS` to `$prompt` and generically escape other variables with `$$`
@mnriem

mnriem commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback and revert changes toCHANGELOG.md (it is auto-generated)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Junie integration: generated commands are unusable because of $ARGUMENTS/$speckit-... auto-detected as required arguments

3 participants