skills: generalize --tail to numeric line counts with k/w shorthand and remove time-window tails - #22
Merged
mouxinqq merged 1 commit intoApr 13, 2026
Conversation
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
--tailsemantics across skills so it only represents a line-count and avoid ambiguous minute/hour/day tail syntax.1k/1w) instead of special-casing particular values like2k.--start/--endto avoid implicit time-window tail behavior.Description
--tailparsing instat_cache_hitrate.pyto use a single regex^(\d+)([kw])?$and convertk→1000 andw→10000, returning an integer line count and removing minute/hour/day parsing paths.--tailparsing introubleshoot.py, added the missingimport re, and made the parser return{ "type": "lines", "value": <int> }for downstream use.read_lines,grep_and_parse, andgrep_countto always treat--tailas a line count when present.SKILL.mdfiles to document that--tailis line-count only (examples include5000,1k,1w) and that time filtering must use--start/--end.Testing
python3 -m py_compileon both scripts (stat_cache_hitrate.pyandtroubleshoot.py) and compilation succeeded.parse_tail_argwith inputs2000,1k, and1wfor both scripts, and they returned[2000, 1000, 10000](tests passed).Codex Task