Skip to content

dfk1352/LibreOffice-skills / skills/libreoffice-writer

libreoffice-writer

Verified

Use when creating, editing, formatting, exporting, or extracting LibreOffice Writer (.odt) documents via UNO, including session-based edits, structured text targets, tables, images, lists, patch workflows, and snapshots.

scripts/writer/exceptions.py

View on GitHub
"""Custom exceptions for Writer skill."""

from exceptions import (
    DocumentNotFoundError as _BaseDocumentNotFoundError,
    PatchOperationError as _BasePatchOperationError,
    PatchSyntaxError as _BasePatchSyntaxError,
    SessionClosedError,
    SkillError,
    SnapshotError as _BaseSnapshotError,
)


class WriterSkillError(SkillError):
    """Base error for Writer skill."""


class WriterSessionError(WriterSkillError, SessionClosedError):
    """Error for Writer session lifecycle misuse."""


class DocumentNotFoundError(WriterSkillError, _BaseDocumentNotFoundError):
    """Error when document file is not found."""


class InvalidMetadataError(WriterSkillError):
    """Error for invalid metadata parameters."""


class PatchSyntaxError(WriterSkillError, _BasePatchSyntaxError):
    """Error for malformed Writer patch input."""


class PatchOperationError(WriterSkillError, _BasePatchOperationError):
    """Base error for parsed Writer patch operations."""


class InvalidTargetError(PatchOperationError):
    """Error for malformed or unsupported targets."""


class TargetNoMatchError(PatchOperationError):
    """Error when a target matches no document content."""


class TargetAmbiguousError(PatchOperationError):
    """Error when a target matches more than one element."""


class InvalidFormattingError(PatchOperationError):
    """Error for invalid formatting parameters."""


class InvalidListError(PatchOperationError):
    """Error for invalid list parameters."""


class InvalidTableError(PatchOperationError):
    """Error for invalid table parameters."""


class ImageNotFoundError(PatchOperationError):
    """Error when image file is not found."""


class InvalidPayloadError(PatchOperationError):
    """Error when patch payload data is invalid for the target."""


class SnapshotError(WriterSkillError, _BaseSnapshotError):
    """Base error for snapshot operations."""


class InvalidPageError(SnapshotError):
    """Error when page number is out of bounds."""


class FilterError(SnapshotError):
    """Error when PNG export filter fails."""


__all__ = [
    "WriterSkillError",
    "WriterSessionError",
    "SessionClosedError",
    "DocumentNotFoundError",
    "InvalidMetadataError",
    "PatchSyntaxError",
    "PatchOperationError",
    "InvalidTargetError",
    "TargetNoMatchError",
    "TargetAmbiguousError",
    "InvalidFormattingError",
    "InvalidListError",
    "InvalidTableError",
    "ImageNotFoundError",
    "InvalidPayloadError",
    "SnapshotError",
    "InvalidPageError",
    "FilterError",
]
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 196kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 196kUpdated Claude CodeCodexVerifiedInstall