English · Español · 한국어 · 简体中文 · 日本語
Shorter answers than caveman and ponytail. No accuracy lost.
npx chisle
See both answers
The prompt: "Implement an order state machine covering created, paid, shipped, delivered, cancelled and refunded, with the legal transitions enforced and invalid ones rejected." Excerpts from the verbatim committed answers in raw-314-direct/large-s2:
| no ruleset: 132 lines, 1,307 answer tokens | Chisle: 60 lines, 577 answer tokens |
|---|---|
class StateTransition:
"""Defines valid state transitions"""
from_state: OrderState
to_states: Set[OrderState]
class OrderStateMachine:
# Define all valid transitions
TRANSITIONS = {
OrderState.CREATED: {OrderState.PAID, OrderState.CANCELLED},
…
}
def __init__(self, order_id: str):
…
self.state_history = [(OrderState.CREATED, datetime.now())]
def can_transition(self, target_state: OrderState) -> bool:
def transition(self, target_state: OrderState) -> bool:
"""
Attempt to transition to target_state.
Returns True if successful, False if invalid.
"""
def get_valid_transitions(self) -> Set[OrderState]:…plus a |
class OrderStateMachine:
VALID_TRANSITIONS: Dict[OrderState, Set[OrderState]] = {
OrderState.CREATED: {OrderState.PAID, OrderState.CANCELLED},
OrderState.PAID: {OrderState.SHIPPED, OrderState.REFUNDED, OrderState.CANCELLED},
…
}
def transition(self, target: OrderState) -> None:
if target not in self.VALID_TRANSITIONS[self.state]:
raise ValueError(
f"Invalid transition: {self.state.value} → {target.value}"
)
self.state = targetThen a short example and a five-line list of the transitions. |
Every raw transcript is committed, losses included. Method and data · why we publish the losses
Other ways to install
# Claude Code plugin marketplace
claude plugin marketplace add JayPokale/Chisle
claude plugin install chisle@chisle
# curl
curl -fsSL https://raw.githubusercontent.com/JayPokale/Chisle/main/install.sh | bash# Windows
irm https://raw.githubusercontent.com/JayPokale/Chisle/main/install.ps1 | iexPer-agent setup, upgrading and config: docs/usage.md.
⭐ Star the repo: it costs zero tokens. · Follow @JayPokale for more tools.
MIT · Contributing · Began as a merge of caveman and ponytail (notices) · Command filters follow RTK's design