Enhance Junie integration - #4795
Open
dch-actaport wants to merge 1 commit into
Open
dch-actaport wants to merge 1 commit into
dch-actaport wants to merge 1 commit into
Conversation
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.
Author
|
fix #4794 |
Contributor
There was a problem hiding this comment.
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
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}", |
| - 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 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 `$$` |
Collaborator
|
Please address Copilot feedback and revert changes toCHANGELOG.md (it is auto-generated) |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Enhance Junie integration
Modify the Junie integration to dynamically inject the
allowPromptArgumentfrontmatter key based on the presence of the$ARGUMENTSvariable. 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
$ARGUMENTSto$promptwhile escaping other template variables (e.g.,$$variable) to prevent accidental expansion by the Junie agent.Changes:
allowPromptArgument: truein Junie frontmatter if$ARGUMENTSis detected; set tofalseotherwise.$ARGUMENTSto$promptand double-escape other$variables..specify/prefix.Description
It fix problems with the prompt arguments for Junie
Testing
uv run specify --helpuv sync && uv run pytestRequired 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]
AI Disclosure
AI disclosure: Written with the help of Junie v26.9.22 and Gemini 3 Flash
fix #4794