linear-comment-issue
Add one comment to a Linear issue through the direct Linear GraphQL API using a local LINEAR_API_KEY. Use only as a narrow fallback when the normal Linear connector is unavailable or cannot create the
SKILL.mdlinear-comment-issue/SKILL.md
GitHubLinear Comment Issue
Use this skill when the normal Linear connector cannot create a comment and a narrow, audited GraphQL fallback is needed.
Prefer the official Linear connector for normal comments. This skill is a fallback comment creator, not a general Linear client.
Preconditions
LINEAR_API_KEYis available in the shell,LINEAR_ENV_FILE,--env-file, or a local.env.local.- The key belongs to a Linear user with permission to comment on the target issue.
- Network access to
https://api.linear.app/graphqlis allowed.
Non-Negotiable Rules
- Use
scripts/comment_issue.py. - Never print the API key.
- Do not store the API key in the skill directory.
- Create exactly one comment per invocation.
- Read and verify the target issue before sending the mutation.
- Prefer a stable issue key such as
LIN-123when available. A URL or UUID that points to a comment, project, relation, or another workspace is not a valid comment target. - Use
--dry-runfirst when a caller needs to verify the issue without creating a comment. - Read the issue again after commenting and report the verified result.
- If the helper returns
error_code=issue_not_found, do not retry as a missing API key problem. Verify the target withlinear-read-issueand the stable issue key.
Codex Permission Rule
When Codex sandboxing asks for approval because the script needs network access, request a persistent command prefix:
sandbox_permissions:require_escalatedprefix_rule:["python3", "linear-comment-issue/scripts/comment_issue.py"]
Keep the command prefix stable by running from the linear-skills repository root. Pass the API key only through the environment or --env-file; never pass the key as a command argument.
Recommended Commands
python3 scripts/comment_issue.py LIN-123 --body-file /path/to/comment.md --env-file /path/to/.env.local --dry-run
python3 scripts/comment_issue.py LIN-123 --body "Short comment" --env-file /path/to/.env.local --json
Output Shape
- Text output: target issue, then
commentedordry_run. --jsonoutput: structured fields for target issue, comment, verified issue, action, anderror_category.- Failure categories are
missing_api_key,not_found,validation,permission_denied, andnetwork. - Issue lookup failures use
error_category=not_foundanderror_code=issue_not_found, with safelookup,input_kind, andhintfields. No comment mutation is sent in this case.