{"data":{"slug":"discovered-3a71b5911f3aa5ae86dc9de9e788f1c10564fbee414d448e","title":"Ticket Guard","summary":"Guard one workflow ticket with marker-scoped hooks that freeze its RED tests, re-run GREEN before a goal-mode stop, and restore the ticket's context after compaction. Use when `ticket:execute` starts or resumes a ticket, or when a session must pick a ticket back up after compaction.","url":"https:\/\/skillshunter.net\/skills\/discovered-3a71b5911f3aa5ae86dc9de9e788f1c10564fbee414d448e","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-3a71b5911f3aa5ae86dc9de9e788f1c10564fbee414d448e","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-3a71b5911f3aa5ae86dc9de9e788f1c10564fbee414d448e.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-3a71b5911f3aa5ae86dc9de9e788f1c10564fbee414d448e\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before running any commands, ensure the marker is in place and the ticket is active. Use `guard marker status` to verify the ticket's status and mode. Always use `guard run red` and `guard run green` to record evidence, and never clear the marker yourself; use `ticket:complete` to finalize the ticket and clear the marker.","instructions":"---\nname: ticket-guard\ndescription: Guards one workflow ticket with marker-scoped hooks that freeze its RED tests, re-run GREEN before a goal-mode stop, and restore the ticket's context after compaction. Use when ticket:execute starts or resumes a ticket, or when a session must pick a ticket back up after compaction.\nlicense: MIT\nmetadata:\n  author: https:\/\/github.com\/Jeffallan\n  company: https:\/\/synergetic.solutions\n  version: \"1.0.0\"\n  domain: workflow\n  triggers: ticket guard, ticket marker, RED evidence, GREEN evidence, test freeze, goal run, compaction recovery\n  role: engineer\n  scope: testing\n  output-format: report\n  related-skills: test-master, debugging-wizard\n---\n\n# Ticket Guard\n\n**Ticket rules, kept through compaction:**\n\n1. RED first: the failing test and its `guard run red` record come before any implementation edit. A collection or import error is not RED.\n2. After RED the test files are frozen. Never edit, delete, skip or weaken them to get a pass.\n3. Under unattended rules: never call `AskUserQuestion`, never write to the tracker, never push. A stuck ticket goes through `guard block <ticket> \"<reason>\"`; its dependents get `\"depends on <ticket>\"`.\n4. `BLOCKED:` ends a turn only for a spec-wide stop named in the goal prompt's `<stops>`.\n5. After a compaction, re-read the spec's `goal-prompt.md` (goal runs) and rebuild state from the Completion Status table and `git log`, then continue at the step the session-start hook names.\n\n## Role Definition\n\nYou are the guard for one ticket of a spec workflow. `ticket:execute` invokes this skill after `guard marker start` so the ticket rules above stay in context. The guard hooks ship in the plugin's `hooks\/hooks.json`: they run on every edit, every stop and every compaction in every session, a resumed one included, and do nothing without a marker or for another session's marker. The work itself stays in `ticket:execute` and `ticket:complete`.\n\n## When to Use This Skill\n\n- `ticket:execute` has started or resumed a ticket and needs the hooks registered.\n- A session resumed or compacted mid-ticket and must pick the ticket back up.\n- You need to know what a guard hook did, or why it denied an edit or blocked a stop.\n\n## Core Workflow\n\n1. **Check the marker.** Run `guard marker status`; `guard <command>` means `uv run -q --no-project --python \">=3.11\" \"${CLAUDE_PLUGIN_ROOT}\/runtime\/guard.pyz\" <command>` (typed out or as a shell function, never a variable, which zsh doesn't split), and spec files and goal prompts write it that way. No marker means no ticket is in progress: say so and stop.\n2. **Load the ticket.** Read the ticket's section of the spec's `implementation-plan.md` and the mode the marker records (`goal` or `attended`).\n3. **Follow the ticket rules above** for the rest of the ticket. The hooks enforce the freeze and the GREEN re-run; the rules cover what they can't see.\n4. **Record evidence through the runtime only:** `guard run red` and `guard run green`, never hand-written results.\n5. **Hand off to `ticket:complete`,** which runs the boundary checks, commits and clears the marker. Never clear the marker yourself.\n\n## Reference Guide\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Hooks and guard commands | `references\/hooks-and-commands.md` | A hook denied or blocked something, or you need a guard command's behavior |\n\n## Constraints\n\n### MUST DO\n- Keep every edit in the main session; subagents only read\n- Leave the marker in place until `ticket:complete` clears it\n- Report a hook denial in your next message, with the file and the rule\n- In goal mode, block a ticket the Stop hook keeps failing instead of looping\n- Update every doc `guard docs-affected` lists, or record it with `guard docs-checked` and the reason, before handing off\n\n### MUST NOT DO\n- Delete, move or edit `marker.json`, the evidence record or `decisions.jsonl`\n- Run `guard decide`, or pass `--reason` or `--accept-lost-marker` under unattended rules\n- Edit files under `text.ticketsDir` in goal mode\n- Treat the hooks as the only check: `ticket:complete` re-runs everything in a clean worktree\n\n## Output Templates\n\nAfter a compaction, before continuing:\n\n```markdown\nResuming <ticket> (<mode>) on <branch>, started at <start SHA>.\nEvidence so far: RED <yes\/no>, GREEN <yes\/no>.\nNext step: <the step the session-start hook named>.\n```\n\n## Knowledge Reference\n\nClaude Code hooks (PreToolUse and Stop in skill frontmatter, SessionStart with the `compact` source in the plugin's hooks.json), the bundled guard runtime, `uv run -q --no-project --python \">=3.11\" \"${CLAUDE_PLUGIN_ROOT}\/runtime\/guard.pyz\"` (marker, evidence JSONL, RED and GREEN records, test freeze, Stop-hook GREEN re-run, block, summary), goal runs and `\/goal` evaluator behavior.\n\nMaintained by [@jeffallan](https:\/\/github.com\/jeffallan), Principal Consultant at [Synergetic Solutions](https:\/\/synergetic.solutions)\n\n[Documentation](https:\/\/jeffallan.github.io\/claude-skills\/skills\/workflow\/ticket-guard\/)\n","use_cases":["Use when `ticket:execute` starts or resumes a ticket and needs the hooks registered.","Use when a session resumes or compacts mid-ticket and must pick the ticket back up.","Use to determine what a guard hook did or why it denied an edit or blocked a stop."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/Jeffallan\/claude-skills\/blob\/a8be463010e2ca23afe00ea00773aea7128e8971\/plugin\/skills\/ticket-guard\/SKILL.md","source_commit":"a8be463010e2ca23afe00ea00773aea7128e8971","license":null,"version":null,"listing_approved_at":"2026-11-29","created_at":"2026-11-28T18:48:15.000000Z","updated_at":"2026-11-29T10:53:27.000000Z","seo_title":"Ticket Guard - Workflow Ticket Protection with Marker-Scoped Hooks","seo_description":"Guard workflow tickets with marker-scoped hooks that freeze RED tests, re-run GREEN tests before a goal-mode stop, and restore context after compaction. Ideal for use in`","seo_keywords":["ticket guard","workflow ticket protection","marker-scoped hooks","RED test freeze","GREEN test re-run","compaction recovery","ticket execution","ticket completion"]}}