-
Notifications
You must be signed in to change notification settings - Fork 0
0.5.6 Beta #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
namos2502
wants to merge
8
commits into
main
Choose a base branch
from
dev
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
0.5.6 Beta #7
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ad02feb
fix: correct Copilot CLI invocation patterns and sandbox handling
namos2502 2ec87f0
feat: apply plugin-dev eval improvements (v0.5.7)
namos2502 a9256d2
fix: correct claude-cli SKILL.md invocation example and comparison table
namos2502 d4de4a2
feat: add SessionStart hook and agent context injection
namos2502 bc5ec72
fix: enforce one-agent-per-subtask and peer direction constraints
namos2502 c903edb
fix: remove -s regression, add --append-system-prompt to REPORT captu…
namos2502 7301e2c
fix: use Skill tool in quick reference and fix Copilot CLI platform d…
namos2502 4ca4313
fix: clarify -p flag applies to target CLI, not bash
namos2502 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "hooks": { | ||
| "SessionStart": [ | ||
| { | ||
| "matcher": "startup|clear|compact", | ||
| "hooks": [ | ||
| { | ||
| "type": "command", | ||
| "command": "\"${CLAUDE_PLUGIN_ROOT}/hooks/run-hook.cmd\" session-start", | ||
| "async": false | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| : << 'CMDBLOCK' | ||
| @echo off | ||
| REM Cross-platform polyglot wrapper for hook scripts. | ||
| REM On Windows: cmd.exe runs the batch portion, which finds and calls bash. | ||
| REM On Unix: the shell interprets this as a script (: is a no-op in bash). | ||
| REM | ||
| REM Hook scripts use extensionless filenames (e.g. "session-start" not | ||
| REM "session-start.sh") so Claude Code's Windows auto-detection -- which | ||
| REM prepends "bash" to any command containing .sh -- doesn't interfere. | ||
| REM | ||
| REM Usage: run-hook.cmd <script-name> [args...] | ||
|
|
||
| if "%~1"=="" ( | ||
| echo run-hook.cmd: missing script name >&2 | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| set "HOOK_DIR=%~dp0" | ||
|
|
||
| REM Try Git for Windows bash in standard locations | ||
| if exist "C:\Program Files\Git\bin\bash.exe" ( | ||
| "C:\Program Files\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9 | ||
| exit /b %ERRORLEVEL% | ||
| ) | ||
| if exist "C:\Program Files (x86)\Git\bin\bash.exe" ( | ||
| "C:\Program Files (x86)\Git\bin\bash.exe" "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9 | ||
| exit /b %ERRORLEVEL% | ||
| ) | ||
|
|
||
| REM Try bash on PATH (e.g. user-installed Git Bash, MSYS2, Cygwin) | ||
| where bash >nul 2>nul | ||
| if %ERRORLEVEL% equ 0 ( | ||
| bash "%HOOK_DIR%%~1" %2 %3 %4 %5 %6 %7 %8 %9 | ||
| exit /b %ERRORLEVEL% | ||
| ) | ||
|
|
||
| REM No bash found - exit silently rather than error | ||
| REM (plugin still works, just without SessionStart context injection) | ||
| exit /b 0 | ||
| CMDBLOCK | ||
|
|
||
| # Unix: run the named script directly | ||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| SCRIPT_NAME="$1" | ||
| shift | ||
| exec bash "${SCRIPT_DIR}/${SCRIPT_NAME}" "$@" | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #!/usr/bin/env bash | ||
| # SessionStart hook for CortexLink plugin | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| PLUGIN_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" | ||
|
|
||
| # Read orchestration skill — the CortexLink meta skill | ||
| orchestration_content=$(cat "${PLUGIN_ROOT}/skills/orchestration/SKILL.md" 2>&1 || echo "Error reading orchestration skill") | ||
|
|
||
| # Escape string for JSON embedding. | ||
| # Each ${s//old/new} is a single C-level pass — fast and heredoc-safe. | ||
| escape_for_json() { | ||
| local s="$1" | ||
| s="${s//\\/\\\\}" | ||
| s="${s//\"/\\\"}" | ||
| s="${s//$'\n'/\\n}" | ||
| s="${s//$'\r'/\\r}" | ||
| s="${s//$'\t'/\\t}" | ||
| printf '%s' "$s" | ||
| } | ||
|
|
||
| orchestration_escaped=$(escape_for_json "$orchestration_content") | ||
|
|
||
| peer_direction="PEER DIRECTION RULES (apply these every time you delegate):\n- If you are Claude Code (Claude): GitHub tasks → Copilot CLI. Isolated code/analysis tasks → Claude CLI (last resort only — prefer native tools first).\n- If you are Copilot CLI: code tasks, analysis, and refactors → Claude CLI.\n- ONE agent per subtask. Never route the same subtask to more than one agent.\n- Always use bash with -p flag (programmatic mode). Never open an interactive terminal session.\n- Violating any of these rules violates the spirit of CortexLink." | ||
|
|
||
| session_context="<EXTREMELY_IMPORTANT>\nYou have CortexLink — a cross-agent workflow plugin.\n\nBelow is your orchestration skill. It defines when and how to delegate tasks across CLI agents (Copilot CLI, Claude CLI). Follow it whenever multi-agent delegation could apply.\n\n${orchestration_escaped}\n\n${peer_direction}\n</EXTREMELY_IMPORTANT>" | ||
|
|
||
|
namos2502 marked this conversation as resolved.
|
||
| # Platform detection: emit the field consumed by the current platform only. | ||
| # Cursor sets CURSOR_PLUGIN_ROOT. Claude Code sets CLAUDE_PLUGIN_ROOT without COPILOT_CLI. | ||
| # Copilot CLI sets CLAUDE_PLUGIN_ROOT *and* COPILOT_CLI=1 — it uses the SDK-standard | ||
| # top-level "additionalContext" field, not Claude Code's nested hookSpecificOutput. | ||
| # Emitting both fields would cause double injection in Claude Code. | ||
| # | ||
| # Uses printf instead of heredoc to avoid a bash 5.3+ bug where heredoc | ||
| # variable expansion hangs when content exceeds ~512 bytes. | ||
| if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then | ||
| printf '{\n "additional_context": "%s"\n}\n' "$session_context" | ||
| elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then | ||
| printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context" | ||
| else | ||
| printf '{\n "additionalContext": "%s"\n}\n' "$session_context" | ||
| fi | ||
|
|
||
| exit 0 | ||
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.