Skip to content

netresearch/jira-skill / skills/jira-communication

jira-communication

Flagged

Use when handling Jira issues, sprints, boards, links, fields, worklogs, attachments, or users, or on any Jira intent without a key ("create/find a ticket", "pick a project"). Auto-triggers on Jira URLs and issue keys (PROJ-123). Also use when MCP Atlassian tools fail or are unavailable for Jira Server/DC.

FileKindSize
AGENTS.mdmarkdown2.5 KB
CLAUDE.mdmarkdown9 B
SKILL.mdskill md10.4 KB
evals/evals.jsonconfig7.6 KB
references/agile.mdmarkdown1.9 KB
references/attachments.mdmarkdown4.7 KB
references/comments.mdmarkdown14.4 KB
references/creation.mdmarkdown4.0 KB
references/fields-and-users.mdmarkdown7.7 KB
references/intent-verbs.mdmarkdown13.5 KB
references/issue-editing.mdmarkdown11.6 KB
references/jql-cookbook.mdmarkdown8.0 KB
references/jql-quick-reference.mdmarkdown6.3 KB
references/links.mdmarkdown7.8 KB
references/multi-profile.mdmarkdown3.9 KB
references/no-editorializing.mdmarkdown2.3 KB
references/qa-gather.mdmarkdown12.1 KB
references/troubleshooting.mdmarkdown12.0 KB
references/versions.mdmarkdown7.7 KB
references/watchers.mdmarkdown3.9 KB
references/worklog.mdmarkdown8.6 KB
scripts/core/jira-attachment.pyexecutablescript21.2 KB
scripts/core/jira-issue.pyexecutablescript50.6 KB
scripts/core/jira-search.pyexecutablescript9.6 KB
scripts/core/jira-setup.pyexecutablescript20.0 KB
scripts/core/jira-validate.pyexecutablescript14.2 KB
scripts/core/jira-worklog.pyexecutablescript15.5 KB
scripts/lib/__init__.pyscript742 B
scripts/lib/changelog.pyscript8.0 KB
scripts/lib/client.pyscript26.4 KB
scripts/lib/config.pyscript15.9 KB
scripts/lib/errors.pyscript1.8 KB
scripts/lib/input.pyscript3.5 KB
scripts/lib/jql.pyscript375 B
scripts/lib/markup.pyscript33.2 KB
scripts/lib/markup_cli.pyscript11.3 KB
scripts/lib/output.pyscript6.9 KB
scripts/lib/preview.pyscript10.0 KB
scripts/lib/render.pyscript1.8 KB
scripts/lib/ticket_state.pyscript13.3 KB
scripts/lib/users.pyscript7.5 KB
scripts/utility/jira-fields.pyexecutablescript11.7 KB
scripts/utility/jira-link.pyexecutablescript42.9 KB
scripts/utility/jira-qa-gather.pyexecutablescript26.3 KB
scripts/utility/jira-user.pyexecutablescript9.3 KB
scripts/utility/jira-watchers.pyexecutablescript9.1 KB
scripts/utility/jira-weblink.pyexecutablescript11.2 KB
scripts/utility/jira-worklog-query.pyexecutablescript27.4 KB
scripts/workflow/jira-board.pyexecutablescript7.0 KB
scripts/workflow/jira-comment.pyexecutablescript19.2 KB
scripts/workflow/jira-create.pyexecutablescript24.3 KB
scripts/workflow/jira-move.pyexecutablescript23.5 KB
scripts/workflow/jira-sprint.pyexecutablescript8.1 KB
scripts/workflow/jira-transition.pyexecutablescript33.7 KB
scripts/workflow/jira-version.pyexecutablescript29.4 KB
scripts/workflow/tempo-account.pyexecutablescript9.1 KB

scripts/lib/input.py

View on GitHub
# SPDX-License-Identifier: MIT
# SPDX-FileCopyrightText: Netresearch DTT GmbH

"""Stdin helpers for Jira CLI scripts that accept piped input.

This module is the input-side companion to :mod:`lib.output`, which
reconfigures ``stdout`` / ``stderr`` to UTF-8 on Windows at import time
(see PR #61). On the input side we cannot rely on auto-reconfiguration —
``sys.stdin``'s text-mode decoder is set up at interpreter startup and
honoured by every ``sys.stdin.read()`` call, so the only reliable fix is
to read through our own UTF-8 decoder wrapped around ``sys.stdin.buffer``.
"""

import sys

# === INLINE_START: input ===


def read_stdin_utf8(max_chars: int | None = None) -> str:
    """Read piped stdin as text, forcing UTF-8 regardless of host locale.

    Args:
        max_chars: Optional cap on the number of *characters* to read from
            stdin. ``None`` reads until EOF. The cap counts decoded
            characters (not bytes), matching the semantics of the
            ``sys.stdin.read(n)`` this helper replaces.

    Returns:
        The decoded text, with universal newline translation applied
        (``\\r\\n`` / ``\\r`` → ``\\n``).

    Raises:
        UnicodeDecodeError: if the stdin bytes are not valid UTF-8 (e.g.
            binary data accidentally piped in, or a file in a non-UTF-8
            encoding such as UTF-16 / Windows-1252).

    Why this exists
    ---------------
    ``sys.stdin.read()`` is a *text-mode* read — it decodes the underlying
    bytes with whatever encoding Python picked for stdin at interpreter
    startup. On Linux / macOS that is almost always UTF-8. On Windows it
    defaults to the system codepage (cp1252, cp850, …) unless the user
    has explicitly set ``PYTHONIOENCODING=utf-8`` or ``PYTHONUTF8=1`` in
    the environment.

    When a Windows shell user pipes a UTF-8 file in
    (``cat file.txt | jira-comment add PROJ-123 -``), every UTF-8 byte
    happens to also be a valid cp1252 character. The text-mode decode
    *succeeds* with garbage characters (e.g. ``ü`` ``\\xc3\\xbc`` →
    ``ü``), the script re-encodes the garbage as UTF-8 to POST to the
    Jira REST API, and Jira faithfully stores the mojibake.

    We rebuild the text wrapper ourselves: ``io.TextIOWrapper`` around the
    raw ``sys.stdin.buffer`` with ``encoding="utf-8"`` pinned. This forces
    UTF-8 no matter the host codepage, while keeping the two text-mode
    properties callers rely on:

    * **Character-based capping.** ``read(max_chars)`` returns whole
      characters, so it never splits a multi-byte UTF-8 sequence at the
      cap boundary (which would raise a spurious ``UnicodeDecodeError`` and
      mask the real "input too large" condition). The cap also stays a
      character count, matching the ``len(text) > max_size`` checks at the
      call sites.
    * **Universal newlines.** ``\\r\\n`` is translated to ``\\n`` exactly as
      the original text-mode read did, so Windows line endings don't leak
      into Jira content.

    ``detach()`` releases ``sys.stdin.buffer`` without closing it, so the
    wrapper's garbage collection can't tear down the process's stdin.

    See also: PR #61 (April 2026) which fixed the sibling problem on
    ``stdout`` / ``stderr`` and motivated the duplicate-Jira-comment
    incident.
    """
    import io

    wrapper = io.TextIOWrapper(sys.stdin.buffer, encoding="utf-8")
    try:
        if max_chars is None:
            return wrapper.read()
        return wrapper.read(max_chars)
    finally:
        wrapper.detach()


# === INLINE_END: input ===
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall