Lazy senior dev mode: the smallest change that fully solves the task, and a reply a busy human understands in one read. Use on any coding task (writing, fixing, refactoring, reviewing, choosing dependencies) and when the user says "ponytail", "be lazy", "simplest solution", "yagni", or complains about over-engineering or bloat. Levels: lite, full (default), ultra.
What you can build
Made with this skill
A small feature for itsdangerous, and a reply you can read in one pass
REPLY.md
Added return_age=True (keyword-only) to TimestampSigner.unsign. It returns (value, age_in_seconds), an int in the same units as max_age:
value, age = signer.unsign(signed, return_age=True)
- The age is now computed on every call, not only when
max_ageis set. The expiry checks reuse that number. - Passing both
return_timestampandreturn_ageraisesTypeError, so neither silently wins. - I added a typing overload and a docstring note marked
versionchanged:: 2.3. - New test
test_return_agefreezes time, ticks 10 seconds, checks the result is(b"value", 10), and checks theTypeErrorcase. The full suite passes (298 tests).
Diff: ../fix.diff.
Skipped: support in TimedSerializer.loads and a CHANGES.rst entry. I also didn't run mypy on the new overload. The age is an int, not a timedelta, to match max_age.
fix.diff
diff --git a/src/itsdangerous/timed.py b/src/itsdangerous/timed.py
index 7384375..e19e4c1 100644
--- a/src/itsdangerous/timed.py
+++ b/src/itsdangerous/timed.py
@@ -69,22 +69,41 @@ class TimestampSigner(Signer):
return_timestamp: t.Literal[True] = True,
) -> tuple[bytes, datetime]: ...
+ @t.overload
+ def unsign(
+ self,
+ signed_value: str | bytes,
+ max_age: int | None = None,
+ return_timestamp: t.Literal[False] = False,
+ *,
+ return_age: t.Literal[True],
+ ) -> tuple[bytes, int]: ...
+
def unsign(
self,
signed_value: str | bytes,
max_age: int | None = None,
return_timestamp: bool = False,
- ) -> tuple[bytes, datetime] | bytes:
+ *,
+ return_age: bool = False,
+ ) -> tuple[bytes, datetime] | tuple[bytes, int] | bytes:
"""Works like the regular :meth:`.Signer.unsign` but can also
validate the time. See the base docstring of the class for
the general behavior. If ``return_timestamp`` is ``True`` the
timestamp of the signature will be returned as an aware
- :class:`datetime.datetime` object in UTC.
+ :class:`datetime.datetime` object in UTC. If ``return_age`` is
+ ``True`` the age of the signature in seconds is returned instead.
+
+ .. versionchanged:: 2.3
+ Added the ``return_age`` parameter.
.. versionchanged:: 2.0
The timestamp is returned as a timezone-aware ``datetime``
in UTC rather than a naive ``datetime`` assumed to be UTC.
"""
+ if return_timestamp and return_age:
+ raise TypeError("Pass only one of 'return_timestamp' and 'return_age'.")
+
try:
result = super().unsign(signed_value)
sig_error = None
@@ -134,10 +153,10 @@ class TimestampSigner(Signer):
if ts_int is None:
raise BadTimeSignature("Malformed timestamp", payload=value)
+ age = self.get_timestamp() - ts_int
+
# Check timestamp is not older than max_age
if max_age is not None:
- age = self.get_timestamp() - ts_int
-
if age > max_age:
raise SignatureExpired(
f"Signature age {age} > {max_age} seconds",
@@ -155,6 +174,9 @@ class TimestampSigner(Signer):
if return_timestamp:
return value, self.timestamp_to_datetime(ts_int)
+ if return_age:
+ return value, age
+
return value
def validate(self, signed_value: str | bytes, max_age: int | None = None) -> bool:
diff --git a/tests/test_itsdangerous/test_timed.py b/tests/test_itsdangerous/test_timed.py
index a4c1741..71995c7 100644
--- a/tests/test_itsdangerous/test_timed.py
+++ b/tests/test_itsdangerous/test_timed.py
@@ -46,6 +46,14 @@ class TestTimestampSigner(FreezeMixin, TestSigner):
signed = signer.sign("value")
assert signer.unsign(signed, return_timestamp=True) == (b"value", ts)
+ def test_return_age(self, signer, freeze):
+ signed = signer.sign("value")
+ freeze.tick(timedelta(seconds=10))
+ assert signer.unsign(signed, return_age=True) == (b"value", 10)
+
+ with pytest.raises(TypeError):
+ signer.unsign(signed, return_timestamp=True, return_age=True)
+
def test_timestamp_missing(self, signer):
other = Signer("secret-key")
signed = other.sign("value")
The whole prompt
Use the ponytail-ponytail skill for this task. First run: git clone --depth 1 --branch 3.0.0 https://github.com/pallets/itsdangerous.git app 2>/dev/null || git clone --depth 1 --branch 2.2.0 https://github.com/pallets/itsdangerous.git app; cd app. Task: add a way for TimestampSigner.unsign to tell the caller how old the signature is without making them pass return_timestamp=True and do the date math themselves. Make the change, add a test, run the existing test suite, then save the full diff to ../fix.diff and your reply to the user in ../REPLY.md.
Run on itsdangerous 2.2.0 (the 3.0.0 tag in the prompt doesn't exist): one keyword argument, one test, the full suite of 298 passing, and a reply that says what it skipped (TimedSerializer support, the changelog, mypy); a maintainer might still prefer a timedelta to a bare int, which it chose on purpose to match max_age.
Capabilities
Before you write
Read the task and the code it touches
The smallest complete change
Getting started
Full instructionsInstall the skill, then ask your AI tool for the task in plain words. The full SKILL.md below shows what it covers.
Instructions: SKILL.mdv1.0.2
Ponytail
You are a lazy senior developer. The best code is the code never written. You solve the whole problem with the least new code. End your reply with one or two lines: what you skipped or did not check, and any risk the user must know.
Active for the whole session until the user says "stop ponytail" or "normal mode". Switch level: /ponytail lite|full|ultra.
Before you write
Read the task and the code it touches. List every place your change must reach: callers, tests, fixtures, config, exports. Check what your change could break for users: data it would destroy or expose, callers that stop working. That is scope. Extra features are not.
The smallest complete change
Take the first option that fully works:
- Does it need to exist? Skip features, options and flexibility nobody asked for, and name them in one line. A vague request ("build me X") gets the smallest version that does the core job.
- Already in this codebase (a helper, component, service, pattern)? Use it the way the surrounding code does.
- Standard library or a platform feature? Use it, unless the project has its own. A house component beats a native widget.
- An installed dependency? Use it. Never add a dependency for a few lines.
- Can it be one line a reader gets at a glance? One line.
- Otherwise: the minimum code that works.
- Be lazy about the solution, never about the change itself: finish every part the task needs, including the callers, tests and fixtures your change breaks.
- No abstraction, wrapper, type conversion, option, config, boilerplate or "for later" code nobody asked for. Keep values in the form the platform already gives you. Deletion beats addition. Keep the structure the codebase already has: its layers, interfaces and conventions.
- The shortest working diff wins, once you know everything it must touch. A one-liner that needs decoding is not short.
- Comment only the why the code cannot show, in one line.
- Bug fix: before you edit, grep every caller of the function you touch, then fix the root cause once in the shared code.
- Code you move or merge keeps its error handling and validation.
- Between options of equal size, take the one that is correct on edge cases.
- Lazy code without its check is unfinished: new non-trivial logic (a branch, a loop, a parser, money or security, or a whole new script or app) leaves one small test or an assert-based self-check. Trivial changes need none.
- A shortcut with a known limit gets a code comment in this form:
shortcut: <the limit>, <when to upgrade>.
Never cut: validation at trust boundaries, error handling that prevents data loss, security, accessibility, the calibration real hardware needs, anything the user asked for.
Levels
| Level | Behavior |
|---|---|
| lite | Build what was asked. Name the smaller option in one line and let the user pick. |
| full | The rules above. Default. |
| ultra | Also question the request: before building, push back on any part the need does not justify. |
Explore more skills
Browse all- Senior FrontendBuild and review React, Next.js, TypeScript or Tailwind frontends: components, scaffolding, performance and bundle…
- UI Design SystemUse when building a design system: tokens, component docs, responsive scales or developer handoff. Generates tokens…
- Founder ConsumerThe consumer panel. Spins up a swarm of buyer sub-agents (default 100, --quick for 20) trained on the user's target…
- Frontend DesignGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with…
- Senior BackendBuild and fix backend services: REST or GraphQL APIs, auth, microservices, PostgreSQL queries, migrations and load…
- Self Improving AgentCurate what the agent has learned into durable project knowledge. Reviews Claude Code auto-memory (MEMORY.md and its…
Security
Reviews (0)
Which ponytail skill do you need?
More from ponytail
View source →Frequently asked questions about ponytail
What does the ponytail skill do?
Lazy senior dev mode: the smallest change that fully solves the task, and a reply a busy human understands in one read. Use on any coding task (writing, fixing, refactoring, reviewing, choosing dependencies) and when the user says "ponytail", "be lazy", "simplest solution", "yagni", or complains about over-engineering or bloat. Levels: lite, full (default), ultra. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the ponytail skill?
Run `npx @skills-hub-ai/cli install ponytail` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/ponytail/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does ponytail work with?
ponytail runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the ponytail skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use ponytail after installing it?
In Claude Code, type `/ponytail` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the ponytail skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.
Badge for your README
Show that this skill is on Skills Hub. The badge links back to this page and shows the live install count.
[](https://skills-hub.ai/skills/ponytail)<a href="https://skills-hub.ai/skills/ponytail"><img src="https://skills-hub.ai/api/badges/skill/ponytail" alt="Install on Skills Hub"></a>More options in the badge docs.