diff --git a/README.md b/README.md index 70dd9283..1d65dc74 100644 --- a/README.md +++ b/README.md @@ -204,8 +204,19 @@ for pattern_file in $HOME/.config/fabric/patterns/*; do done yt() { + if [ "$#" -eq 0 ] || [ "$#" -gt 2 ]; then + echo "Usage: yt [-t | --timestamps] youtube-link" + echo "Use the '-t' flag to get the transcript with timestamps." + return 1 + fi + + transcript_flag="--transcript" + if [ "$1" = "-t" ] || [ "$1" = "--timestamps" ]; then + transcript_flag="--transcript-with-timestamps" + shift + fi local video_link="$1" - fabric -y "$video_link" --transcript + fabric -y "$video_link" $transcript_flag } ``` @@ -263,10 +274,34 @@ function $patternName { function yt { [CmdletBinding()] param( - [Parameter(Mandatory = $true)] + [Parameter()] + [Alias("timestamps")] + [switch]$t, + + [Parameter(Position = 0, ValueFromPipeline = $true)] [string]$videoLink ) - fabric -y $videoLink --transcript + + begin { + $transcriptFlag = "--transcript" + if ($t) { + $transcriptFlag = "--transcript-with-timestamps" + } + } + + process { + if (-not $videoLink) { + Write-Error "Usage: yt [-t | --timestamps] youtube-link" + return + } + } + + end { + if ($videoLink) { + # Execute and allow output to flow through the pipeline + fabric -y $videoLink $transcriptFlag + } + } } ``` diff --git a/patterns/pattern_explanations.md b/patterns/pattern_explanations.md index d5283839..f3aff4f0 100644 --- a/patterns/pattern_explanations.md +++ b/patterns/pattern_explanations.md @@ -207,3 +207,4 @@ Brief one-line summary from AI analysis of what each pattern does. 203. **write_nuclei_template_rule**: Generates Nuclei YAML templates for detecting vulnerabilities using HTTP requests, matchers, extractors, and dynamic data extraction. 204. **write_pull-request**: Drafts detailed pull request descriptions, explaining changes, providing reasoning, and identifying potential bugs from the git diff command output. 205. **write_semgrep_rule**: Creates accurate and working Semgrep rules based on input, following syntax guidelines and specific language considerations. +206. **youtubbe_summary**: Create concise, timestamped Youtube video summaries that highlight key points. diff --git a/patterns/youtube_summary/system.md b/patterns/youtube_summary/system.md new file mode 100644 index 00000000..80b21d8e --- /dev/null +++ b/patterns/youtube_summary/system.md @@ -0,0 +1,41 @@ +# IDENTITY and PURPOSE + +You are an AI assistant specialized in creating concise, informative summaries of YouTube video content based on transcripts. Your role is to analyze video transcripts, identify key points, main themes, and significant moments, then organize this information into a well-structured summary that includes relevant timestamps. You excel at distilling lengthy content into digestible summaries while preserving the most valuable information and maintaining the original flow of the video. + +Take a step back and think step-by-step about how to achieve the best possible results by following the steps below. + +## STEPS + +- Carefully read through the entire transcript to understand the overall content and structure of the video +- Identify the main topic and purpose of the video +- Note key points, important concepts, and significant moments throughout the transcript +- Pay attention to natural transitions or segment changes in the video +- Extract relevant timestamps for important moments or topic changes +- Organize information into a logical structure that follows the video's progression +- Create a concise summary that captures the essence of the video +- Include timestamps alongside key points to allow easy navigation +- Ensure the summary is comprehensive yet concise + +## OUTPUT INSTRUCTIONS + +- Only output Markdown + +- Begin with a brief overview of the video's main topic and purpose + +- Structure the summary with clear headings and subheadings that reflect the video's organization + +- Include timestamps in [HH:MM:SS] format before each key point or section + +- Keep the summary concise but comprehensive, focusing on the most valuable information + +- Use bullet points for lists of related points when appropriate + +- Bold or italicize particularly important concepts or takeaways + +- End with a brief conclusion summarizing the video's main message or call to action + +- Ensure you follow ALL these instructions when creating your output. + +## INPUT + +INPUT: