diff --git a/web/myfiles/Obsidian_perso_not_share/2025-02-14-CREATE PATTERNS.md b/web/myfiles/Obsidian_perso_not_share/2025-02-14-CREATE PATTERNS.md deleted file mode 100644 index 51771657..00000000 --- a/web/myfiles/Obsidian_perso_not_share/2025-02-14-CREATE PATTERNS.md +++ /dev/null @@ -1,23 +0,0 @@ -```markdown -[Language: ] -ONE SENTENCE SUMMARY: This video explains how to create and use custom patterns within the Fabric AI project by storing them locally. - -MAIN POINTS: -1. Fabric patterns are prompts for solving problems using the Fabric AI project. -2. Existing Fabric patterns can be used directly from the command line. -3. Custom patterns are stored locally, not in the main Fabric repository. -4. The local directory for Fabric patterns is `config/Fabric/patterns`. -5. Create a custom directory and copy patterns into the Fabric patterns directory. -6. An alias can automate copying custom patterns to the correct directory. -7. Custom patterns are used by calling Fabric with the pattern name. -8. Local patterns are not shared unless submitted to the Fabric project. -9. Custom patterns can be used for personal, business, or journal review tasks. -10. AI processes the data, so it is not completely private, even with local patterns. - -TAKEAWAYS: -1. Custom patterns extend Fabric's functionality for specific use cases. -2. Local storage of patterns allows for private and personalized AI interactions. -3. Automating pattern deployment simplifies the creation process. -4. Understanding the file structure is key to managing custom patterns. -5. Fabric's flexibility supports both shared and private AI pattern usage. -``` diff --git a/web/myfiles/Obsidian_perso_not_share/ChatService copy.ts.md b/web/myfiles/Obsidian_perso_not_share/ChatService copy.ts.md deleted file mode 100644 index e6c88edf..00000000 --- a/web/myfiles/Obsidian_perso_not_share/ChatService copy.ts.md +++ /dev/null @@ -1,220 +0,0 @@ -import type { -ChatRequest, -StreamResponse, -ChatError as IChatError, -ChatPrompt -} from '$lib/interfaces/chat-interface'; -import { get } from 'svelte/store'; -import { modelConfig } from '$lib/store/model-store'; -import { systemPrompt, selectedPatternName } from '$lib/store/pattern-store'; -import { chatConfig } from '$lib/store/chat-config'; -import { messageStore } from '$lib/store/chat-store'; -import { languageStore } from '$lib/store/language-store'; - -class LanguageValidator { - constructor(private targetLanguage: string) {} - - enforceLanguage(content: string): string { - if (this.targetLanguage === 'en') return content; - return `[Language: ${this.targetLanguage}]\n${content}`; - } -} - -export class ChatError extends Error implements IChatError { - constructor( - message: string, - public readonly code: string = 'CHAT_ERROR', - public readonly details?: unknown - ) { - super(message); - this.name = 'ChatError'; - } -} - -export class ChatService { - private validator: LanguageValidator; - - constructor() { - this.validator = new LanguageValidator(get(languageStore)); - } - - private async fetchStream(request: ChatRequest): Promise> { - try { - console.log('\n=== ChatService Request Start ==='); - console.log('1. Request details:', { - language: get(languageStore), - pattern: get(selectedPatternName), - promptCount: request.prompts?.length, - messageCount: request.messages?.length - }); - - const response = await fetch('/api/chat', { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify(request), - }); - - if (!response.ok) { - throw new ChatError(`HTTP error! status: ${response.status}`, 'HTTP_ERROR', { status: response.status }); - } - - const reader = response.body?.getReader(); - if (!reader) { - throw new ChatError('Response body is null', 'NULL_RESPONSE'); - } - - return this.createMessageStream(reader); - } catch (error) { - if (error instanceof ChatError) throw error; - throw new ChatError('Failed to fetch chat stream', 'FETCH_ERROR', error); - } - } - - private cleanPatternOutput(content: string): string { - content = content.replace(/^# OUTPUT\s*\n/, ''); - content = content.replace(/^\s*\n/, ''); - content = content.replace(/\n\s*$/, ''); - content = content.replace(/^#\s+([A-Z]+):/gm, '$1:'); - content = content.replace(/^#\s+([A-Z]+)\s*$/gm, '$1'); - content = content.trim(); - content = content.replace(/\n{3,}/g, '\n\n'); - return content; - } - - private createMessageStream(reader: ReadableStreamDefaultReader): ReadableStream { - let buffer = ''; - const cleanPatternOutput = this.cleanPatternOutput.bind(this); - const language = get(languageStore); - const validator = new LanguageValidator(language); - - const processResponse = (response: StreamResponse) => { - const pattern = get(selectedPatternName); - if (pattern) { - response.content = cleanPatternOutput(response.content); - response.format = 'markdown'; // Set format for pattern responses - } - if (response.type === 'content') { - response.content = validator.enforceLanguage(response.content); - } - return response; - }; - - return new ReadableStream({ - async start(controller) { - try { - while (true) { - const { done, value } = await reader.read(); - if (done) break; - - buffer += new TextDecoder().decode(value); - const messages = buffer.split('\n\n').filter(msg => msg.startsWith('data: ')); - - if (messages.length > 1) { - buffer = messages.pop() || ''; - for (const msg of messages) { - try { - let response = JSON.parse(msg.slice(6)) as StreamResponse; - response = processResponse(response); - controller.enqueue(response); - } catch (parseError) { - console.error('Error parsing stream message:', parseError); - } - } - } - } - - if (buffer.startsWith('data: ')) { - try { - let response = JSON.parse(buffer.slice(6)) as StreamResponse; - response = processResponse(response); - controller.enqueue(response); - } catch (parseError) { - console.error('Error parsing final message:', parseError); - } - } - } catch (error) { - controller.error(new ChatError('Stream processing error', 'STREAM_ERROR', error)); - } finally { - reader.releaseLock(); - controller.close(); - } - }, - cancel() { - reader.cancel(); - } - }); - } - - private createChatPrompt(userInput: string, systemPromptText?: string): ChatPrompt { - const config = get(modelConfig); - const language = get(languageStore); - - const languageInstruction = language !== 'en' - ? `You MUST respond in ${language} language. All output must be in ${language}. ` - : ''; - - const finalSystemPrompt = languageInstruction + (systemPromptText ?? get(systemPrompt)); - - const finalUserInput = language !== 'en' - ? `${userInput}\n\nIMPORTANT: Respond in ${language} language only.` - : userInput; - - return { - userInput: finalUserInput, - systemPrompt: finalSystemPrompt, - model: config.model, - patternName: get(selectedPatternName) - }; - } - - public async createChatRequest(userInput: string, systemPromptText?: string): Promise { - const prompt = this.createChatPrompt(userInput, systemPromptText); - const config = get(chatConfig); - - return { - prompts: [prompt], - messages: [], - ...config - }; - } - - public async streamPattern(userInput: string, systemPromptText?: string): Promise> { - const request = await this.createChatRequest(userInput, systemPromptText); - return this.fetchStream(request); - } - - public async streamChat(userInput: string, systemPromptText?: string): Promise> { - const request = await this.createChatRequest(userInput, systemPromptText); - return this.fetchStream(request); - } - - public async processStream( - stream: ReadableStream, - onContent: (content: string, response?: StreamResponse) => void, - onError: (error: Error) => void - ): Promise { - const reader = stream.getReader(); - let accumulatedContent = ''; - let lastResponse: StreamResponse | undefined; - - try { - while (true) { - const { done, value } = await reader.read(); - if (done) { - if (lastResponse) onContent(accumulatedContent, lastResponse); - break; - } - if (value.type === 'error') { - throw new ChatError(value.content, 'STREAM_CONTENT_ERROR'); - } - accumulatedContent += value.content; - lastResponse = value; - onContent(accumulatedContent, value); - } - } catch (error) { - onError(error instanceof ChatError ? error : new ChatError('Stream processing error', 'STREAM_ERROR', error)); - } finally { - reader.releaseLock(); - } - } -} diff --git a/web/myfiles/Obsidian_perso_not_share/Markdown_Formatting_Fix.md b/web/myfiles/Obsidian_perso_not_share/Markdown_Formatting_Fix.md deleted file mode 100644 index fc7a4d79..00000000 --- a/web/myfiles/Obsidian_perso_not_share/Markdown_Formatting_Fix.md +++ /dev/null @@ -1,99 +0,0 @@ -# Markdown Formatting Issue and Fix - -## Issue Description - -The pattern output in the chat history window stopped displaying in markdown format. This occurred after changes were made to improve pattern descriptions and language support. - -## Root Cause Analysis - -The issue stemmed from changes in three key areas: - -1. **Pattern Selection Flow** - - Added verification steps in pattern selection that interrupted the normal flow - - Changed how pattern content was loaded and processed - -2. **Message Format Handling** - - Changed how message formats were set and preserved in the chat store - - Lost the default markdown formatting for pattern responses - -3. **Format Preservation** - - Lost the format preservation logic when updating existing messages - - Removed fallback to markdown format for new messages - -## The Fix - -### 1. ChatService.ts - -Restored the original pattern response formatting: -```typescript -const processResponse = (response: StreamResponse) => { - const pattern = get(selectedPatternName); - if (pattern) { - response.content = cleanPatternOutput(response.content); - response.format = 'markdown'; // Set format for pattern responses - } - if (response.type === 'content') { - response.content = validator.enforceLanguage(response.content); - } - return response; -}; -``` - -### 2. chat-store.ts - -Restored format preservation logic: -```typescript -messageStore.update(messages => { - const newMessages = [...messages]; - const lastMessage = newMessages[newMessages.length - 1]; - - if (lastMessage?.role === 'assistant') { - lastMessage.content = content; - // Always preserve format from response - lastMessage.format = response?.format || lastMessage.format; - } else { - // Ensure new messages have format from response - newMessages.push({ - role: 'assistant', - content, - format: response?.format || 'markdown' // Default to markdown - }); - } - - return newMessages; -}); -``` - -## Key Learnings - -1. **Format Chain** - - Pattern responses are marked as markdown in ChatService - - This format is preserved through the chat store - - Messages default to markdown when format is missing - -2. **Minimal Changes** - - Fixed markdown formatting without disrupting other features - - Kept language support and pattern descriptions working - - Only restored specific code related to markdown handling - -3. **Verification** - - Pattern output now properly renders in markdown - - Language support continues to work - - Pattern descriptions display correctly in the modal - -## Future Considerations - -1. **Code Organization** - - Keep format handling logic separate from other features - - Document format-related code clearly - - Consider creating dedicated format handling utilities - -2. **Testing** - - Add tests for format preservation - - Verify markdown rendering in different scenarios - - Test interaction with other features - -3. **Documentation** - - Document format handling in the codebase - - Note dependencies between components - - Explain the format chain from service to display diff --git a/web/myfiles/Obsidian_perso_not_share/github-workflow-guide.md b/web/myfiles/Obsidian_perso_not_share/github-workflow-guide.md deleted file mode 100644 index 43b3473e..00000000 --- a/web/myfiles/Obsidian_perso_not_share/github-workflow-guide.md +++ /dev/null @@ -1,267 +0,0 @@ -# FABRIC GitHub Workflow Guide - -## Repository Setup - -### Remote Repositories -- `origin` → jmd1010/FABRIC2 (your customized version) -- `upstream` → danielmiessler/fabric (original project) -- `fabricdm` → jmd1010/fabricDM (for your contributions) - -### Branches -- `main` - Your working branch with all customizations -- `upstream-updates` - Tracks danielmiessler/fabric main branch - -### Verify Setup -```bash -# Check remotes -git remote -v - -# Should show: -origin https://github.com/jmd1010/FABRIC2.git (fetch) -origin https://github.com/jmd1010/FABRIC2.git (push) -upstream https://github.com/danielmiessler/fabric.git (fetch) -upstream https://github.com/danielmiessler/fabric.git (push) -fabricdm https://github.com/jmd1010/fabricDM.git (fetch) -fabricdm https://github.com/jmd1010/fabricDM.git (push) -``` - -## Daily Workflows - -### 1. Trivial Changes -For small fixes or minor updates: -```bash -# Work directly on main branch -git add -git commit -m "Description of changes" -git push origin main # Backup to your repo -``` - -### 2. New Features/Risky Changes -For significant changes or experimental features: -```bash -# Create feature branch -git checkout -b feature/new-component main -# Work on changes... - -# Regular commits -git add -git commit -m "Feature progress" - -# Backup branch to origin (optional) -git push origin feature/new-component - -# When feature is stable: -git checkout main -git merge feature/new-component -git push origin main - -# Clean up -git branch -d feature/new-component -git push origin --delete feature/new-component # if you pushed it -``` - -### 3. Surgical Updates from Upstream - -#### Get Specific File from Upstream -```bash -# Fetch latest from upstream -git fetch upstream - -# Check what changed in specific file -git diff upstream/main -- path/to/file - -# Option 1: Cherry-pick specific file -git checkout upstream/main -- path/to/file -# Then commit if you like the changes - -# Option 2: Checkout file then cherry-pick specific changes -git checkout upstream/main -- path/to/file -git restore --staged path/to/file # Unstage -# Edit file to keep only wanted changes -git add path/to/file -git commit -m "Cherry-picked specific changes from upstream" -``` - -#### Resolve Merge Conflicts -```bash -# If you get conflicts during merge -git status # See conflicted files - -# For each conflict, you have options: -# 1. Keep your version: -git checkout --ours path/to/file -git add path/to/file - -# 2. Take their version: -git checkout --theirs path/to/file -git add path/to/file - -# 3. Manually edit file to combine changes: -# Edit file, resolve markers, then: -git add path/to/file - -# After resolving all conflicts: -git commit -m "Merged with conflict resolutions" -``` - -## Emergency Recovery - -### Rebuild from Remote -If local repository becomes corrupted: - -1. Backup your ENV file: -```bash -cp /Users/jmdb/.config/fabric/.env ~/env-backup -``` - -2. Remove corrupted local repo: -```bash -cd .. -mv FABRIC2 FABRIC2-corrupted -``` - -3. Clone fresh copy: -```bash -git clone https://github.com/jmd1010/FABRIC2.git -cd FABRIC2 -``` - -4. Set up remotes: -```bash -git remote add upstream https://github.com/danielmiessler/fabric.git -git remote add fabricdm https://github.com/jmd1010/fabricDM.git -``` - -5. Create tracking branch: -```bash -git branch upstream-updates upstream/main -``` - -6. Restore ENV file: -```bash -mkdir -p /Users/jmdb/.config/fabric/ -cp ~/env-backup /Users/jmdb/.config/fabric/.env -``` - -### Quick Recovery Steps -If you need to undo recent changes: - -```bash -# Undo last commit but keep changes staged -git reset --soft HEAD^ - -# Undo last commit and remove changes -git reset --hard HEAD^ - -# Revert to specific commit -git reset --hard - -# Reset to remote state -git fetch origin -git reset --hard origin/main -``` - -## Contributing Back to danielmiessler/fabric - -1. Create feature branch from upstream: -```bash -git fetch upstream -git checkout -b feature-name upstream/main -``` - -2. Make changes and commit: -```bash -git add -git commit -m "Descriptive message" -``` - -3. Push to your fork: -```bash -git push fabricdm feature-name -``` - -4. Create PR: -- Go to https://github.com/danielmiessler/fabric -- Click "New Pull Request" -- Choose "compare across forks" -- Select your fork and branch -- Fill in PR description -- Submit - -## Updating Existing PRs - -### Sync fabricDM with Latest Changes -When you have new changes in FABRIC2 that you want to add to an existing PR: - -1. Backup fabricDM's .gitignore: -```bash -# In fabricDM repo -cp fabric/.gitignore fabric/.gitignore.backup -``` - -2. Update fabricDM with your changes (one of two methods): - -Method A - Complete sync: -```bash -git checkout feature/improvements # or whatever your PR branch is -git fetch origin # get latest from FABRIC2 -git reset --hard origin/main # sync with your latest FABRIC2 state -cp fabric/.gitignore.backup fabric/.gitignore # restore fabricDM's .gitignore -git add fabric/.gitignore -git commit -m "Restore fabricDM gitignore" -git push -f fabricdm feature/improvements -``` - -Method B - Merge approach: -```bash -git checkout feature/improvements -git pull origin main # merge your latest FABRIC2 changes -git checkout --ours fabric/.gitignore # keep fabricDM's version -git add fabric/.gitignore -git commit -m "Merge main while preserving fabricDM gitignore" -git push fabricdm feature/improvements -``` - -### Important Notes: -- Always protect fabricDM's .gitignore as it's specifically configured for contributions -- The backup step ensures you don't accidentally lose ENV file protection -- When in doubt, verify .gitignore content after any sync operation -- Consider Method B if you want to preserve PR commit history -- Use Method A for a clean slate that matches your FABRIC2 state exactly - -## Best Practices - -1. Always work in feature branches for significant changes -2. Regularly push to origin/main to backup your work -3. Keep commits atomic and well-described -4. Before starting new work: - ```bash - git status # Ensure clean working directory - git pull origin main # Get latest changes - ``` -5. When in doubt, create a branch: - ```bash - git checkout -b backup/before-risky-change - ``` - -## Additional Tips - -1. Before major changes: - - Create a backup branch - - Push to origin - - Document what you're about to do - -2. When updating from upstream: - - Always work in a branch first - - Test thoroughly before merging to main - - Keep notes of any manual conflict resolutions - -3. Maintaining clean history: - - Use meaningful commit messages - - Group related changes in single commits - - Push to origin main regularly - -4. Emergency Situations: - - Don't panic - your code is safe in origin/main - - Create backup branches liberally - - When in doubt, clone fresh and rebuild diff --git a/web/myfiles/Obsidian_perso_not_share/githut note fabric reset.md b/web/myfiles/Obsidian_perso_not_share/githut note fabric reset.md deleted file mode 100644 index 869086f8..00000000 --- a/web/myfiles/Obsidian_perso_not_share/githut note fabric reset.md +++ /dev/null @@ -1,134 +0,0 @@ -## Repository Structure -- Fork: jmd1010/fabric-contrib -- Original: danielmiessler/fabric -- Branch: feature/web-ui-enhancements - -## Remote Configuration -- origin: git@github.com:jmd1010/fabricDM.git -- upstream: https://github.com/danielmiessler/fabric.git - -## Development Environment -### Shell Configurations -- Updated .zshrc and .bashrc -- Corrected paths for new repository structure -- Go environment variables -- Pattern directory mappings - -### Web Development Setup -- Backend: fabric --serve -- Frontend: npm run dev in web directory -- Development URLs and ports - -## Pull Request Workflow -1. Sync with upstream -2. Feature branch development -3. Code review preparation -4. PR submission guidelines - -## Backup Management -### Repository Setup -- Backup: git@github.com:jmd1010/fabric-backup.git -- Contains complete development environment -- Excludes only sensitive files (.env) -- Private repository for safety - -### Backup Workflow -1. Regular backup pushes: -```bash -git push backup feature/web-ui-enhancements - -2. After significant changes: - -git add . -git commit -m "Development checkpoint - [description]" -git push backup feature/web-ui-enhancements - -3. Before major refactoring: - -git tag backup-pre-refactor-[date] -git push backup --tags - - -Development vs Backup - -Backup repo: Complete environment preservation - -Feature branch: Clean commits for PR - -Separate commit messages for backup vs PR - -Tag significant development points - -Regular synchronization with both repos - -Recovery Procedures - -1. From backup: - -git clone git@github.com:jmd1010/fabric-backup.git -git checkout feature/web-ui-enhancements - -2. Environment restoration: - -Copy .env.example to .env -Configure local paths -Install dependencies -Verify development setup - - -This structure provides: - -1. Clear separation of concerns -2. Detailed workflow procedures -3. Recovery instructions -4. Best practices for both backup and development -5. Easy reference for ongoing work - - -Current Position - Remote Configuration -You're at the remote configuration step, which sets up the foundation for both development and backup workflows. Here's how it connects to the broader strategy: -Development Track -The remotes we're configuring: -git remote add upstream git@github.com:danielmiessler/fabric.git - -Copy - -Execute - -terminal -git remote add origin git@github.com:jmd1010/fabricDM.git - -Copy - -Execute - -terminal -These commands establish: -1. Direct link to upstream for pulling latest changes -2. Connection to your fork for PR preparation -Backup Track -Your backup workflow documentation adds an additional remote: -git remote add backup git@github.com:jmd1010/fabric-backup.git - -Copy - -Execute - -terminal -This creates a three-remote structure: -* upstream - Source of truth (danielmiessler/fabric) -* origin - Your public fork for PRs -* backup - Your private backup repository -Integration with Pull Request Workflow -The remote setup enables: -1. Clean feature branch development (git checkout -b feature/web-ui-enhancements) -2. Regular syncs with upstream (git fetch upstream) -3. Isolated commits for PR (origin) -4. Full environment preservation (backup) -Backup Strategy Integration -Your backup workflow documentation enhances this by: -1. Providing checkpoints via tags -2. Maintaining complete development history -3. Preserving the full environment state -4. Enabling safe experimentation -The steps are consistent and complementary, creating a robust development environment with multiple safety nets while maintaining clean PR preparation paths. diff --git a/web/myfiles/Obsidian_perso_not_share/language-config-fix.md b/web/myfiles/Obsidian_perso_not_share/language-config-fix.md deleted file mode 100644 index 77ec94ab..00000000 --- a/web/myfiles/Obsidian_perso_not_share/language-config-fix.md +++ /dev/null @@ -1,111 +0,0 @@ -# Language Configuration Fix for YouTube vs Text Processing - -## Working Configuration - -### ChatService.ts -- Simple language handling that works: -```typescript -// Add language instruction at end of input -userInput: userInput + languageInstruction -``` - -### ChatInput.svelte -- Store and restore language state: -```typescript -// Store original language -const originalLanguage = get(languageStore); - -// Restore before processing -languageStore.set(originalLanguage); - -// Pass isYouTubeTranscript flag -await sendMessage(transcript, $systemPrompt, false, true); -``` - -### chat/+server.ts -- Pass language through transcript service: -```typescript -const response = { - transcript, - title: videoId, - language: body.language -}; -``` - -## Issue to Fix: Transcript Display - -The transcript is showing in browser before pattern output because it's being added to the message store. The fix needs to: - -1. Keep the "Processing YouTube transcript..." message -2. Skip adding the raw transcript to message store -3. Only show the pattern output when it comes back - -### Location of Fix -In chat-store.ts: -```typescript -// Add isYouTubeTranscript parameter to skip adding transcript -export async function sendMessage(content: string, systemPromptText?: string, isSystem: boolean = false, isYouTubeTranscript: boolean = false) - -// Skip only the transcript, not system messages -if (isYouTubeTranscript && !isSystem) { - // Skip only transcript - return; -} -messageStore.update(messages => [...messages, { - role: isSystem ? 'system' : 'user', - content -}]); -``` - -## Testing -1. Regular text with --fr: - - Should show message in chat - - Should process in French - -2. YouTube with --fr: - - Should show "Processing..." message (isSystem=true) - - Should NOT show transcript (isYouTubeTranscript=true) - - Should show pattern output in French (language preserved) -The language-config-fix.md contains valuable insights directly relevant to our current investigation. - -Key findings from language-config-fix.md: - -Previous fix involved handling language state across YouTube transcript processing: -// Store original language -const originalLanguage = get(languageStore); - -// Restore before processing -languageStore.set(originalLanguage); - -Copy - -Apply - -YouTube transcript handling had special flags: -await sendMessage(transcript, $systemPrompt, false, true); -// The last parameter isYouTubeTranscript was added - -Copy - -Apply - -Chat store modifications: -// Skip only the transcript, not system messages -if (isYouTubeTranscript && !isSystem) { - return; -} - -Copy - -Apply - -This reveals: - -YouTube transcripts have special processing requirements -Language state needs preservation during transcript handling -The chat store treats YouTube transcripts differently -Next steps to explore: - -Check if our current implementation maintains these language state safeguards -Verify if YouTube transcript flags are properly handled -Examine how these changes might interact with markdown formatting \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/language-flow-analysis.md b/web/myfiles/Obsidian_perso_not_share/language-flow-analysis.md deleted file mode 100644 index d2a82b85..00000000 --- a/web/myfiles/Obsidian_perso_not_share/language-flow-analysis.md +++ /dev/null @@ -1,40 +0,0 @@ -# Language Flow Analysis - -## News Article Flow (Working) -1. Input: "Here's a news article --fr" -2. Language Detection: - - Detects --fr - - Sets languageStore to 'fr' - - Removes --fr flag -3. Pattern Execution: - - Article text goes directly to ChatService - - ChatService adds language instruction - - Pattern executes with language flag -4. Reset: - - Language resets to 'en' after response - -## YouTube Flow (Current) -1. Input: "https://youtube.com/... --fr" -2. Language Detection: - - Detects --fr - - Sets languageStore to 'fr' - - Removes --fr flag -3. Transcript: - - Gets raw transcript first - - Then sends to ChatService - - ChatService adds language instruction - - Pattern executes with language flag -4. Reset: - - Language resets to 'en' after response - -## Key Insight -The transcript should be treated exactly like a news article - it's just text that needs to be processed by the pattern with a language flag. The fact that it comes from YouTube doesn't change how the language flag should be handled. - -## Solution Direction -1. Keep the language flag handling identical for both cases -2. Let the pattern execution handle the language for both: - - News articles: text + language flag - - YouTube: transcript + language flag -3. Reset language only after pattern execution completes - -This way, whether the text comes from direct input or a YouTube transcript, the pattern execution sees the same thing: text content plus a language flag. \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/markdown_and_language_investigation.md b/web/myfiles/Obsidian_perso_not_share/markdown_and_language_investigation.md deleted file mode 100644 index a26b71ba..00000000 --- a/web/myfiles/Obsidian_perso_not_share/markdown_and_language_investigation.md +++ /dev/null @@ -1,146 +0,0 @@ -# Markdown Formatting and Language Header Investigation feb 19 - -## Problem Statement -1. Large pattern outputs from YouTube transcripts don't render as markdown -2. Pattern section headers remain in English when output language is changed - -## Symptoms -### Markdown Rendering -- Short pattern outputs (e.g., Summary): Render correctly in markdown -- Long pattern outputs (e.g., Extract Wisdom): Don't render markdown formatting -- Both receive 'complete' message with plain format but only affects large outputs - -### Language Headers -- Pattern content translates to requested language -- Section headers (SUMMARY, IDEAS, etc.) remain in English -- Affects all pattern outputs regardless of size - -## Key Insights -1. YouTube transcript endpoint (/api/youtube/transcript/+server.ts) confirmed as irrelevant to markdown issues - it only provides raw text input -2. Special YouTube processing flags discovered in language-config-fix.md are significant: - - isYouTubeTranscript flag - - Language state preservation - - Special message store handling - -## Current Understanding -1. Markdown issue occurs after pattern processing, not during transcript fetching -2. Two distinct flows: - - Regular pattern input -> direct processing -> markdown preserved - - YouTube input -> transcript flags -> pattern processing -> markdown lost for large outputs - -## Next Investigation Steps -1. Trace how isYouTubeTranscript flag affects: - - Pattern output processing - - Message store handling - - Markdown preservation -2. Examine language state preservation impact on markdown rendering -3. Review complete pipeline from YouTube input to final rendering - -## Files to Focus On -1. ChatService.ts - Pattern processing and format determination -2. chat-store.ts - Message handling with YouTube flags -3. Previous fixes from language-config-fix.md - - - -## Investigation Findings -### ChatService.ts Analysis -1. Format Detection -```typescript -processResponse() { - // Format set to markdown but not consistently maintained - // Logs show format changes between content and complete messages -} - -2. Language Processing - -createChatPrompt() { - // Language instruction doesn't explicitly mention header translation - // Mixed language content might affect markdown parsing -} - - -Code Areas Explored -ChatService.ts -processStream: Content accumulation vs streaming -createMessageStream: Chunk processing -processResponse: Format determination -createChatPrompt: Language instructions -Remaining Areas to Investigate -ChatService.ts - -LanguageValidator class -streamPattern vs streamChat methods -Pattern output cleaning -Other Files - -chat-interface.ts: Type definitions -chat-store.ts: Message handling -Markdown rendering component -Next Steps -Complete ChatService.ts investigation -Test LanguageValidator impact -Compare streamPattern vs streamChat behavior -Examine message store handling -Review markdown rendering implementation - - -## Code Changes Attempted - -### ChatService.ts -1. Format Determination -```typescript -// Attempted to simplify format logic to just markdown/mermaid -if (pattern) { - response.format = response.content.startsWith('graph TD') ? 'mermaid' : 'markdown'; -} - - -2. Stream Processing - -// Tried to eliminate content accumulation since server sends complete content -if (value.type === 'content') { - onContent(value.content, value); -} - -3. Language Instructions -// Enhanced language instruction for headers -const languageInstruction = language !== 'en' - ? `You MUST respond in ${language} language. All output including section headers...` - : ''; - -Results -Format changes didn't resolve large output markdown issue -Language instruction modification didn't affect header translation -Logs revealed consistent pattern in how format changes between content and complete messages - - -FINAL FIX FOR YOUTUBE MARKDOWN - -Pattern Output Markdown Rendering Fix - Feb 19 -Problem Identified -Large pattern outputs weren't rendering as markdown while small ones did. Investigation revealed different content structures based on output size. - -Root Cause -LLM adds ```markdown fences around large outputs -Small outputs use direct markdown headers -Marked library processed these structures differently -Content size wasn't the issue - content structure was -Solution Implementation -Added fence stripping in ChatService.cleanPatternOutput: - -content = content.replace(/^```markdown\n/, ''); -content = content.replace(/\n```$/, ''); - -Why It Worked -Normalized all pattern outputs to consistent markdown structure -Removed LLM's explicit formatting markers -Allowed marked library to process all outputs uniformly -Maintained pattern output cleaning while adding fence handling -Technical Flow -LLM generates response (with/without fences) -ChatService strips fences and cleans output -Message store receives clean markdown -ChatMessages renders consistent markdown -Key Insight -The solution focused on content structure normalization rather than size-based handling, resulting in consistent markdown rendering across all pattern outputs. \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/migrate_tags.py b/web/myfiles/Obsidian_perso_not_share/migrate_tags.py deleted file mode 100644 index 280db783..00000000 --- a/web/myfiles/Obsidian_perso_not_share/migrate_tags.py +++ /dev/null @@ -1,121 +0,0 @@ -import os -import json -from typing import Dict, Any - -def load_pattern_tags() -> Dict[str, Any]: - """ - Load tags and descriptions from pattern_tags_review.md - Returns a dictionary with pattern names as keys for exact matching - """ - script_dir = os.path.dirname(os.path.abspath(__file__)) - tags_path = os.path.join(script_dir, "pattern_tags_review.md") - tags_dict = {} - - with open(tags_path, 'r', encoding='utf-8') as f: - current_pattern = None - for line in f: - line = line.strip() - if line.startswith("## Pattern:"): - current_pattern = line.split("Pattern:")[1].strip() - tags_dict[current_pattern] = {"description": "", "tags": []} - elif line.startswith("Description:") and current_pattern: - tags_dict[current_pattern]["description"] = line.split("Description:")[1].strip() - elif line.startswith("Tags:") and current_pattern: - # Clean and normalize tag parsing - tags_part = line.split("Tags:")[1].strip() - tags = [tag.strip() for tag in tags_part.split(",")] - tags = [tag for tag in tags if tag] # Remove empty tags - tags_dict[current_pattern]["tags"] = tags - - return tags_dict - -def migrate_tags(dry_run: bool = False) -> None: - """ - Migrate tags to pattern_descriptions.json with detailed verification - dry_run: If True, only prints changes without writing files - """ - script_dir = os.path.dirname(os.path.abspath(__file__)) - descriptions_path = os.path.join(script_dir, "pattern_descriptions.json") - - # Load existing descriptions - with open(descriptions_path, 'r', encoding='utf-8') as f: - descriptions = json.load(f) - - # Load and verify tags - pattern_tags = load_pattern_tags() - - # Track changes for reporting - patterns_updated = [] - patterns_not_found = [] - patterns_no_tags = [] - - # Update descriptions with tags - for pattern in descriptions["patterns"]: - pattern_name = pattern["patternName"] - if pattern_name in pattern_tags: - new_tags = pattern_tags[pattern_name]["tags"] - if new_tags: - old_tags = pattern.get("tags", []) - pattern["tags"] = new_tags - patterns_updated.append({ - "name": pattern_name, - "old_tags": old_tags, - "new_tags": new_tags - }) - else: - patterns_no_tags.append(pattern_name) - else: - patterns_not_found.append(pattern_name) - - # Print detailed migration report - print("\nMigration Report:") - print("-----------------") - print(f"Total patterns in descriptions: {len(descriptions['patterns'])}") - print(f"Total patterns with tag data: {len(pattern_tags)}") - print(f"Patterns updated: {len(patterns_updated)}") - - print("\nDetailed Updates:") - for p in patterns_updated: - print(f"\nPattern: {p['name']}") - print(f" Old tags: {p['old_tags']}") - print(f" New tags: {p['new_tags']}") - - if patterns_not_found: - print("\nPatterns without tag data:") - for p in patterns_not_found: - print(f" - {p}") - - if patterns_no_tags: - print("\nPatterns with empty tags:") - for p in patterns_no_tags: - print(f" - {p}") - - if not dry_run: - # Save updated descriptions - with open(descriptions_path, 'w', encoding='utf-8') as f: - json.dump(descriptions, f, indent=2, ensure_ascii=False) - - # Update web static copy - web_static_path = os.path.join(script_dir, "..", "web", "static", "data", "pattern_descriptions.json") - with open(web_static_path, 'w', encoding='utf-8') as f: - json.dump(descriptions, f, indent=2, ensure_ascii=False) - - print("\nFiles updated:") - print(f" - {descriptions_path}") - print(f" - {web_static_path}") - else: - print("\nDRY RUN - No files were modified") - -if __name__ == "__main__": - # First run in dry-run mode to verify changes - print("Performing dry run to verify changes...") - migrate_tags(dry_run=True) - - # Prompt for actual migration - response = input("\nProceed with actual migration? (yes/no): ") - if response.lower() == 'yes': - migrate_tags(dry_run=False) - print("\nMigration completed successfully") - else: - print("\nMigration cancelled") - diff --git a/web/myfiles/Obsidian_perso_not_share/pattern_tags_review.md b/web/myfiles/Obsidian_perso_not_share/pattern_tags_review.md deleted file mode 100644 index 8ad7e4e2..00000000 --- a/web/myfiles/Obsidian_perso_not_share/pattern_tags_review.md +++ /dev/null @@ -1,822 +0,0 @@ -# Pattern Tags Review - -## Pattern: agility_story -Description: Generate user stories and acceptance criteria for agile development tasks following standard agile methodology formats. -Tags: DEVELOPMENT - -## Pattern: ai -Description: Interpret questions deeply and provide concise, insightful answers in brief markdown bullets focused on core concepts. -Tags: AI, ANALYSIS - -## Pattern: analyze_answers -Description: Evaluate student responses against expert knowledge, providing detailed assessment and feedback adapted to specified academic levels. -Tags: ANALYSIS, LEARNING - -## Pattern: analyze_candidates -Description: Compare political candidates' positions, highlighting key differences in policies, backgrounds, and potential implications of their platforms. -Tags: ANALYSIS, RESEARCH - -## Pattern: analyze_cfp_submission -Description: Evaluate conference presentation submissions for content quality, speaker qualifications, and potential audience engagement and educational value. -Tags: ANALYSIS, REVIEW - -## Pattern: analyze_comments -Description: Analyze user comments to determine sentiment patterns, extract key praise and criticism points, and summarize overall reception. -Tags: ANALYSIS, EXTRACTION - -## Pattern: analyze_email_headers -Description: Analyze email authentication headers (SPF, DKIM, DMARC, ARC) to assess email security and provide actionable recommendations. -Tags: SECURITY - -## Pattern: analyze_prose_json -Description: Evaluate writing quality and provide structured JSON output rating novelty, clarity, and overall messaging effectiveness. -Tags: ANALYSIS, WRITING, DEVELOPMENT - -## Pattern: analyze_prose_pinker -Description: Analyze writing style using Steven Pinker's principles from 'The Sense of Style' to improve clarity and effectiveness. -Tags: ANALYSIS, WRITING - -## Pattern: ask_uncle_duke -Description: Provide expert software development guidance focusing on Java, Spring Framework, and frontend technologies with best practices. -Tags: DEVELOPMENT, LEARNING - -## Pattern: capture_thinkers_work -Description: Extract and summarize key philosophical concepts, background, and impactful ideas from notable thinkers and their work. -Tags: EXTRACTION, SUMMARIZATION, RESEARCH, CRITICAL THINKING - -## Pattern: check_agreement -Description: Review contracts and agreements to identify important stipulations, potential issues, and recommended changes for negotiation. -Tags: ANALYSIS, BUSINESS - -## Pattern: clean_text -Description: Format and clean text by fixing line breaks, capitalization, and punctuation while preserving original content and meaning. -Tags: WRITING, CONVERSION - -## Pattern: coding_master -Description: Explain coding concepts and languages clearly for beginners using examples from reputable sources and proper syntax formatting. -Tags: DEVELOPMENT, LEARNING - -## Pattern: compare_and_contrast -Description: Create structured comparisons of items in table format, highlighting key differences and similarities across relevant topics. -Tags: ANALYSIS, WRITING - -## Pattern: convert_to_markdown -Description: Convert content to clean markdown format while preserving complete original content, formatting, and structure. -Tags: CONVERSION, WRITING - -## Pattern: create_5_sentence_summary -Description: Generate increasingly concise summaries of content in five levels, from five words down to one word. -Tags: SUMMARIZATION, WRITING - -## Pattern: create_ai_jobs_analysis -Description: Analyze AI's impact on job categories, identifying automation risks and providing strategies for career resilience. -Tags: ANALYSIS, AI, BUSINESS - -## Pattern: create_aphorisms -Description: Compile relevant, attributed aphorisms from historical figures related to specific topics or themes. -Tags: EXTRACTION, WRITING - -## Pattern: create_better_frame -Description: Develop positive mental frameworks for viewing challenging situations, emphasizing constructive perspectives and opportunities. -Tags: ANALYSIS, STRATEGY, SELF - - -## Pattern: create_coding_project -Description: Design structured coding projects with clear architecture, implementation steps, and best practices using modern technologies. -Tags: DEVELOPMENT - -## Pattern: create_command -Description: Generate precise CLI commands for penetration testing tools based on documentation and specific requirements. -Tags: SECURITY, DEVELOPMENT - -## Pattern: create_cyber_summary -Description: Summarize cybersecurity incidents, vulnerabilities, and threats into concise, actionable intelligence briefings. -Tags: SECURITY - -## Pattern: create_diy -Description: Create detailed, step-by-step DIY tutorials with clear instructions, required materials, and expected outcomes. -Tags: WRITING, LEARNING, SELF - -## Pattern: create_formal_email -Description: Compose professional email correspondence following business etiquette and maintaining appropriate tone and structure. -Tags: WRITING, BUSINESS - -## Pattern: create_git_diff_commit -Description: Generate clear git commit messages and commands that effectively communicate code changes and updates. -Tags: DEVELOPMENT - -## Pattern: create_graph_from_input -Description: Transform security program metrics into CSV data format for visualizing progress and improvements over time. -Tags: VISUALIZATION, SECURITY, CONVERSION - -## Pattern: create_hormozi_offer -Description: Create compelling business offers using Alex Hormozi's '$100M Offers' methodology and principles. -Tags: BUSINESS, WRITING - -## Pattern: create_idea_compass -Description: Organize thoughts and concepts using a structured framework analyzing definitions, evidence, relationships, and implications. -Tags: ANALYSIS, VISUALIZATION, CRITICAL THINKING - -## Pattern: create_investigation_visualization -Description: Create detailed Graphviz visualizations of investigation data showing relationships, activities, and key findings. -Tags: VISUALIZATION, SECURITY, ANALYSIS - -## Pattern: create_logo -Description: Generate minimalist logo design prompts that capture brand essence through simple, elegant vector graphics. -Tags: VISUALIZATION, BUSINESS - -## Pattern: create_markmap_visualization -Description: Transform complex ideas into hierarchical mind maps using Markmap syntax for visual concept representation. -Tags: VISUALIZATION, CONVERSION, CRITICAL THINKING - -## Pattern: create_mermaid_visualization_for_github -Description: Create GitHub-compatible Mermaid diagrams to visualize workflows, architectures, and processes in documentation. -Tags: VISUALIZATION, DEVELOPMENT - -## Pattern: create_newsletter_entry -Description: Write concise, engaging newsletter content in Frontend Weekly style, focusing on key developments and insights. -Tags: WRITING, SUMMARIZATION, BUSINESS - -## Pattern: create_npc -Description: Generate detailed D&D 5E NPC characters with comprehensive backgrounds, personalities, and game statistics. -Tags: GAMING - -## Pattern: create_pattern -Description: Design structured patterns for AI prompts with clear identity, purpose, steps, and output instructions. -Tags: AI, DEVELOPMENT - -## Pattern: create_prediction_block -Description: Format and structure predictions from content for tracking and verification in markdown-based prediction logs. -Tags: AI, ANALYSIS, WRITING - -## Pattern: create_recursive_outline -Description: Break down complex tasks or ideas into hierarchical, actionable components through recursive decomposition. -Tags: ANALYSIS, VISUALIZATION - -## Pattern: create_report_finding -Description: Document security assessment findings with clear descriptions, risks, recommendations, and supporting evidence. -Tags: SECURITY - - -## Pattern: create_rpg_summary -Description: Summarize RPG gaming sessions capturing key events, combat encounters, and narrative developments in structured format. -Tags: GAMING - -## Pattern: create_security_update -Description: Compile concise security newsletters covering current threats, advisories, vulnerabilities, and critical cybersecurity developments with relevant links. -Tags: SECURITY - -## Pattern: create_show_intro -Description: Craft compelling podcast or show introductions that effectively preview content and engage audience interest. -Tags: WRITING - -## Pattern: create_story_explanation -Description: Transform complex concepts into clear, engaging narratives that effectively communicate ideas and implications. -Tags: WRITING, LEARNING - -## Pattern: create_tags -Description: Generate relevant, single-word tags for content categorization and mind mapping organization. -Tags: ANALYSIS, EXTRACTION, WRITING - -## Pattern: create_threat_scenarios -Description: Develop realistic security threat scenarios based on risk analysis and attacker motivation assessment. -Tags: SECURITY - -## Pattern: create_ttrc_graph -Description: Generate time-series data for visualizing critical vulnerability remediation metrics and progress. -Tags: SECURITY, VISUALIZATION - -## Pattern: create_ttrc_narrative -Description: Create compelling narratives demonstrating security program improvements in vulnerability remediation efficiency. -Tags: SECURITY - -## Pattern: create_upgrade_pack -Description: Extract world model updates and task algorithms from content to improve decision-making and processes. -Tags: EXTRACTION, ANALYSIS, BUSINESS, CRITICAL THINKING - -## Pattern: create_video_chapters -Description: Extract and organize video content into timestamped chapters highlighting key topics and moments. -Tags: EXTRACTION, VISUALIZATION - -## Pattern: create_visualization -Description: Transform complex concepts into ASCII art visualizations with detailed explanations of represented relationships. -Tags: VISUALIZATION - -## Pattern: dialog_with_socrates -Description: Engage in Socratic dialogue to explore ideas through questioning and critical examination of assumptions. -Tags: ANALYSIS, LEARNING, SELF, CRITICAL THINKING - -## Pattern: analyze_paper -Description: Analyze a scientific paper to identify its primary findings and assess the quality and rigor of its conclusions. -Tags: ANALYSIS, RESEARCH, LEARNING - -## Pattern: create_summary -Description: Generate concise summaries of content by extracting key points, main ideas, and important takeaways into a structured format. -Tags: SUMMARIZATION, WRITING - -## Pattern: extract_wisdom -Description: Extract insightful ideas, practical habits, and meaningful recommendations from content, focusing on life wisdom and human flourishing. -Tags: EXTRACTION, ANALYSIS, SUMMARIZATION, SELF - -## Pattern: create_design_document -Description: Create comprehensive software architecture documentation using the C4 model, including business context, security posture, and detailed system design. -Tags: DEVELOPMENT, WRITING, VISUALIZATION - -## Pattern: create_stride_threat_model -Description: Generate detailed threat models using STRIDE methodology to identify, analyze, and prioritize security threats for system components. -Tags: SECURITY - -## Pattern: extract_main_idea -Description: Identify and distill the single most important or insightful idea from content, providing both the core concept and actionable recommendation. -Tags: ANALYSIS, EXTRACTION, SUMMARIZATION - -## Pattern: create_mermaid_visualization -Description: Transform complex concepts and relationships into clear visual diagrams using Mermaid syntax, creating standalone visualizations that effectively convey ideas. -Tags: VISUALIZATION, DEVELOPMENT - -## Pattern: create_prd -Description: Create precise and structured Product Requirements Documents (PRDs) from input requirements and specifications. -Tags: DEVELOPMENT, WRITING, BUSINESS - -## Pattern: explain_code -Description: Analyze and explain code, security tool outputs, and configuration files, providing clear explanations of their functionality and implications. -Tags: DEVELOPMENT, LEARNING - -## Pattern: create_sigma_rules -Description: Extract Tactics, Techniques, and Procedures from security publications and translate them into YAML-based Sigma detection rules. -Tags: SECURITY, DEVELOPMENT - -## Pattern: extract_predictions -Description: Identify and analyze predictions from content, extracting specific claims, timeframes, confidence levels, and verification criteria. -Tags: ANALYSIS, EXTRACTION, CRITICAL THINKING - -## Pattern: create_user_story -Description: Write clear, concise technical user stories with descriptions and acceptance criteria for software features and improvements. -Tags: DEVELOPMENT, WRITING - -## Pattern: analyze_threat_report -Description: Extract and analyze key insights, trends, statistics, and recommendations from cybersecurity threat reports in a structured format. -Tags: SECURITY - -## Pattern: analyze_malware -Description: Analyze malware behavior, extract indicators of compromise, identify MITRE ATT&CK techniques, and provide detection recommendations across multiple platforms. -Tags: SECURITY - -## Pattern: extract_book_recommendations -Description: Extract and prioritize practical recommendations and actionable advice from books, presenting them in a clear, instructive format. -Tags: EXTRACTION, SUMMARIZATION, SELF - -[...continuing with remaining patterns...] - -## Pattern: create_art_prompt -Description: Transform concepts into detailed AI art prompts, incorporating style references and emotional elements to guide visual creation. -Tags: AI, VISUALIZATION - -## Pattern: create_network_threat_landscape -Description: Analyze network ports and services to create comprehensive threat reports with risks, trends, and security recommendations. -Tags: SECURITY - -## Pattern: create_academic_paper -Description: Transform content into high-quality academic papers using LaTeX formatting with professional layout and authoritative presentation. -Tags: WRITING, RESEARCH, LEARNING - -## Pattern: create_keynote -Description: Design TED-style presentations with narrative flow, concise slide content, speaker notes, and image descriptions for maximum impact. -Tags: WRITING, VISUALIZATION - -## Pattern: extract_core_message -Description: Distill the fundamental message from presentations, essays, or bodies of work into a single, clear, impactful sentence. -Tags: ANALYSIS, SUMMARIZATION - -## Pattern: create_reading_plan -Description: Design structured, three-phase reading plans with core, extended, and exploratory materials to build comprehensive knowledge of topics. -Tags: LEARNING, SELF - -## Pattern: extract_extraordinary_claims -Description: Identify and extract claims that contradict scientific consensus, are difficult to verify, or conflict with expert understanding. -Tags: ANALYSIS, RESEARCH, CRITICAL THINKING - -## Pattern: create_quiz -Description: Generate targeted review questions based on learning objectives, adapting difficulty to specified student levels and subject matter. -Tags: LEARNING - -## Pattern: extract_skills -Description: Extract and classify hard and soft skills from job descriptions, organizing them into a structured skill inventory. -Tags: EXTRACTION, ANALYSIS, BUSINESS - -## Pattern: create_micro_summary -Description: Generate ultra-concise content summaries with one-sentence overview, key points, and essential takeaways in minimal words. -Tags: SUMMARIZATION, WRITING - -## Pattern: extract_insights -Description: Extract powerful insights about life, technology, and human flourishing from content, presenting them as concise, actionable bullet points. -Tags: EXTRACTION, SELF - -## Pattern: analyze_claims -Description: Evaluate truth claims by analyzing supporting evidence, counter-arguments, and logical fallacies to provide balanced, objective assessments. -Tags: ANALYSIS, RESEARCH, CRRITICAL THINKING - -## Pattern: analyze_debate -Description: Analyze debate transcripts to identify key arguments, agreements, misunderstandings, and insights while measuring emotional intensity and participant interaction. -Tags: ANALYSIS, SUMMARIZATION, CRITICAL THINKING - -## Pattern: analyze_incident -Description: Extract and organize critical information from cybersecurity breach articles, including attack details, impact analysis, and actionable recommendations. -Tags: SECURITY - -## Pattern: analyze_interviewer_techniques -Description: Study interviewer questions and methods to identify effective techniques, patterns, and strategies that lead to exceptional interviews. -Tags: ANALYSIS, BUSINESS - -## Pattern: analyze_military_strategy -Description: Examine historical battles by analyzing strategic decisions, tactical approaches, and pivotal moments to extract key military lessons. -Tags: ANALYSIS, STRATEGY - -## Pattern: analyze_logs -Description: Examine server logs to identify patterns, anomalies, and potential issues, providing insights into system reliability and performance improvements. -Tags: DEVELOPMENT, SECURITY - -## Pattern: analyze_mistakes -Description: Analyze past thinking errors and mistaken beliefs to identify patterns and prevent similar mistakes in current predictions and decisions. -Tags: ANALYSIS, STRATEGY, BUISNESS, SELF, CRITICAL THINKING - -## Pattern: analyze_personality -Description: Perform psychological analysis of individuals by examining their language, responses, and behaviors to reveal underlying personality traits and patterns. -Tags: ANALYSIS, RESEARCH, SELF - -## Pattern: analyze_presentation -Description: Evaluate presentations by scoring content novelty, speaker selflessness, and entertainment value to provide actionable feedback for improvement. -Tags: ANALYSIS, REVIEW, BUSINESS - -## Pattern: analyze_product_feedback -Description: Process and categorize user feedback to identify key themes, consolidate similar inputs, and prioritize actionable insights for product improvements. -Tags: ANALYSIS, BUSINESS - -## Pattern: analyze_proposition -Description: Examine ballot propositions to assess their purpose, potential impact, supporting arguments, and implications for stakeholders and regulations. -Tags: ANALYSIS, RESEARCH - -## Pattern: analyze_prose -Description: Evaluate writing quality by rating novelty of ideas, clarity of presentation, and prose style to provide targeted improvement recommendations. -Tags: ANALYSIS, WRITING, REVIEW - -## Pattern: analyze_risk -Description: Assess third-party vendor security compliance and privacy standards to determine risk levels and recommend appropriate security controls. -Tags: SECURITY - -## Pattern: analyze_sales_call -Description: Evaluate sales call performance by analyzing pitch alignment, sales fundamentals, and customer interaction to provide actionable improvement recommendations. -Tags: ANALYSIS, BUSINESS - -## Pattern: analyze_spiritual_text -Description: Compare and contrast religious texts with the King James Bible, identifying unique claims, differences in tenets, and doctrinal variations. -Tags: ANALYSIS, RESEARCH, SELF - -## Pattern: analyze_tech_impact -Description: Evaluate technology projects' societal impact by analyzing outcomes, ethical considerations, and sustainability across environmental, economic, and social dimensions. -Tags: ANALYSIS, RESEARCH, BUSINESS - -## Pattern: analyze_threat_report_trends -Description: Extract and analyze surprising, insightful, and significant trends from cybersecurity threat reports to identify emerging patterns and developments. -Tags: SECURITY - -## Pattern: answer_interview_question -Description: Generate natural, experience-based responses to technical interview questions that demonstrate expertise while maintaining conversational tone and conciseness. -Tags: DEVELOPMENT, LEARNING - -## Pattern: ask_secure_by_design_questions -Description: Generate comprehensive security-focused questions to guide secure system design and implementation across different architectural components. -Tags: SECURITY, DEVELOPMENT - -## Pattern: analyze_patent -Description: Analyze patent documents to evaluate novelty, inventive steps, and technical advantages while providing detailed explanations of problems solved and implementation approaches. -Tags: ANALYSIS, BUISNESS - -## Pattern: analyze_threat_report_cmds -Description: Extract and interpret cybersecurity commands from threat reports, providing detailed command-line arguments and implementation guidance from diverse expert perspectives. -Tags: SECURITY - -## Pattern: enrich_blog_post -Description: Enhance markdown blog posts by improving structure, visuals, and formatting to optimize readability and engagement for static site generation. -Tags: WRITING, VISUALIZATION - -## Pattern: explain_docs -Description: Transform technical documentation and instructions into clearer, more accessible explanations with improved structure and practical usage examples. -Tags: WRITING, DEVELOPMENT - -## Pattern: explain_math -Description: Explain mathematical concepts and equations clearly for students using step-by-step instructions, visual aids, and practical examples. -Tags: LEARNING - -## Pattern: explain_project -Description: Create comprehensive project overviews with installation instructions, usage examples, and practical applications while maintaining clear documentation structure. -Tags: DEVELOPMENT, BUSINESS - -## Pattern: explain_terms -Description: Create comprehensive glossaries of advanced terms from content, providing clear definitions, explanations, and helpful analogies for better understanding. -Tags: WRITING, LEARNING - -## Pattern: export_data_as_csv -Description: Extract structured data from content and convert it into properly formatted CSV files while preserving relationships and data integrity. -Tags: CONVERSION, DEVELOPMENT - -## Pattern: extract_algorithm_update_recommendations -Description: Extract concise, practical recommendations for improving algorithms and processes from content, focusing on actionable implementation steps. -Tags: EXTRACTION, DEVELOPMENT, ANALYSIS, WISDOM - -## Pattern: extract_article_wisdom -Description: Extract key insights, practical advice, and timeless wisdom from articles, organizing them into clear, actionable takeaways. -Tags: EXTRACTION, SELF, WISDOM - -## Pattern: extract_book_ideas -Description: Identify and extract novel concepts, unique perspectives, and innovative ideas from books that could inspire new projects or creative works. -Tags: EXTRACTION, SELF, WISDOM - -## Pattern: extract_business_ideas -Description: Identify potential business opportunities, market gaps, and entrepreneurial insights from content, presenting them as actionable venture concepts. -Tags: BUSINESS - -## Pattern: extract_controversial_ideas -Description: Identify and analyze contentious viewpoints, challenging assumptions, and debatable claims from content while maintaining objective analysis. -Tags: EXTRACTION, ANALYSIS, RESEARCH, CRITICAL THINKING - -## Pattern: extract_ctf_writeup -Description: Extract key techniques, tools, and methodologies from CTF challenge writeups to create structured, educational security learning resources. -Tags: SECURITY - -## Pattern: extract_ideas -Description: Extract and organize key concepts, innovative thoughts, and potential applications from content into structured, actionable idea collections. -Tags: EXTRACTION, ANALYSIS, WISDOM, SELF - -## Pattern: extract_insights_dm -Description: Extract and organize key insights from direct messages or conversations, focusing on valuable learnings and actionable takeaways. -Tags: EXTRACTION, ANALYSIS, SUMMARIZATION, SELF, WISDOM - -## Pattern: extract_instructions -Description: Extract and organize step-by-step procedures and guidelines from content into clear, sequential instructions for practical implementation. -Tags: EXTRACTION, LEARNING, BUSINESS - -## Pattern: extract_jokes -Description: Extract and categorize humorous content from text, organizing jokes, puns, and witty remarks while preserving their comedic timing and context. -Tags: OTHER - -## Pattern: extract_latest_video -Description: Extract and summarize key information from the most recent video in a channel or playlist, including title, timestamp, and main content points. -Tags: EXTRACTION, SUMMARIZATION - -## Pattern: extract_most_redeeming_thing -Description: Identify and analyze the most positive or valuable aspect from content, even in challenging or critical contexts, to highlight constructive elements. -Tags: ANALYSIS, SELF, WISDOM - -## Pattern: extract_patterns -Description: Identify and extract recurring patterns, themes, and methodologies from content to create reusable templates and systematic approaches. -Tags: EXTRACTION, ANALYSIS, BUSINESS - -## Pattern: extract_poc -Description: Extract and document proof-of-concept demonstrations from technical content, including implementation steps, code samples, and validation methods. -Tags: DEVELOPMENT, BUSINESS - -## Pattern: extract_primary_problem -Description: Identify and analyze the core problem or challenge from content, focusing on root causes and fundamental issues rather than symptoms. -Tags: ANALYSIS, EXTRACTION, CRITICAL THINKING - -## Pattern: extract_primary_solution -Description: Identify and analyze the main solution or approach proposed in content, focusing on key implementation steps and expected outcomes. -Tags: ANALYSIS, EXTRACTION - -## Pattern: extract_product_features -Description: Extract and categorize key product features, capabilities, and specifications from content into a structured, comprehensive feature list. -Tags: EXTRACTION, BUSINESS, DEVELOPMENT - -## Pattern: extract_questions -Description: Extract and categorize key questions, inquiries, and discussion points from content to create comprehensive Q&A resources. -Tags: EXTRACTION, LEARNING, BUSINESS - -## Pattern: extract_recipe -Description: Extract and format cooking recipes from content into structured instructions with ingredients, steps, and preparation details. -Tags: EXTRACTION, WRITING, CONVERSION, SELF - -## Pattern: extract_recommendations -Description: Extract and prioritize suggested actions, advice, and recommendations from content, organizing them into clear, actionable guidance. -Tags: EXTRACTION, ANALYSIS, SUMMARIZATION, SELF, WISDOM - -## Pattern: extract_references -Description: Extract and format citations, sources, and bibliographic references from content into a structured, properly formatted reference list. -Tags: EXTRACTION, RESEARCH, WRITING, LEARNING - -## Pattern: extract_song_meaning -Description: Analyze and interpret song lyrics to uncover deeper meanings, themes, metaphors, and cultural or historical references within musical compositions. -Tags: ANALYSIS, SELF - -## Pattern: extract_sponsors -Description: Extract and organize sponsorship information from content, including sponsor names, promotional messages, and partnership details. -Tags: EXTRACTION, BUSINESS - -## Pattern: extract_videoid -Description: Extract and parse video identifiers and URLs from content to create structured lists of video references and links. -Tags: EXTRACTION, CONVERSION - -## Pattern: extract_wisdom_agents -Description: Extract and synthesize insights from AI agent interactions, focusing on emergent behaviors, learning patterns, and decision-making processes. -Tags: AI, ANALYSIS, EXTRACTION - -## Pattern: extract_wisdom_dm -Description: Extract and analyze key insights and learnings from direct message conversations, focusing on personal growth and practical wisdom. -Tags: EXTRACTION, ANALYSIS, SUMMARIZATION, SELF, WISDOM - -## Pattern: extract_wisdom_nometa -Description: Extract pure insights and wisdom from content without metadata or contextual annotations, focusing on core principles and essential truths. -Tags: EXTRACTION, ANALYSIS, CRITICAL THINKING, WISDOM - -## Pattern: find_hidden_message -Description: Analyze content to uncover concealed meanings, subtle implications, and embedded messages that may not be immediately apparent. -Tags: ANALYSIS, RESEARCH, CRITICAL THINKING - -## Pattern: find_logical_fallacies -Description: Identify and analyze logical errors, reasoning flaws, and argumentative fallacies in content to evaluate argument validity and soundness. -Tags: ANALYSIS, RESEARCH, CRITICAL THINKING - -## Pattern: get_wow_per_minute -Description: Calculate and analyze the frequency of impressive or surprising moments in content to measure engagement and impact density. -Tags: ANALYSIS, REVIEW - -## Pattern: get_youtube_rss -Description: Generate and format RSS feed URLs for YouTube channels and playlists to enable automated content tracking and updates. -Tags: CONVERSION, DEVELOPMENT - -## Pattern: humanize -Description: Transform technical or complex content into more approachable, relatable language while maintaining accuracy and key information. -Tags: WRITING, CONVERSION - -## Pattern: identify_dsrp_distinctions -Description: Analyze content using DSRP framework to identify key distinctions, differences, and unique characteristics between concepts and ideas. -Tags: ANALYSIS, RESEARCH - -## Pattern: identify_dsrp_perspectives -Description: Analyze content using DSRP framework to identify different viewpoints, stakeholder perspectives, and alternative ways of understanding concepts. -Tags: ANALYSIS, RESEARCH - -## Pattern: identify_dsrp_relationships -Description: Analyze content using DSRP framework to identify connections, correlations, and causal relationships between different concepts and elements. -Tags: ANALYSIS, RESEARCH - -## Pattern: identify_dsrp_systems -Description: Analyze content using DSRP framework to identify systems, hierarchies, and organizational structures that connect different components and ideas. -Tags: ANALYSIS, RESEARCH - -## Pattern: identify_job_stories -Description: Extract and analyze user job stories from content to understand core motivations, situational contexts, and desired outcomes in product usage. -Tags: ANALYSIS, BUSINESS, DEVELOPMENT - -## Pattern: improve_academic_writing -Description: Enhance academic writing by improving clarity, structure, argumentation, and scholarly tone while maintaining rigorous academic standards. -Tags: WRITING, RESEARCH - -## Pattern: improve_prompt -Description: Enhance AI prompts by refining clarity, specificity, and structure to generate more accurate, relevant, and useful responses. -Tags: AI, WRITING, DEVELOPMENT - -## Pattern: improve_report_finding -Description: Enhance security report findings by improving clarity, technical accuracy, risk assessment, and remediation recommendations. -Tags: SECURITY - -## Pattern: improve_writing -Description: Enhance written content by improving clarity, flow, structure, and style while maintaining the original message and intent. -Tags: WRITING - -## Pattern: judge_output -Description: Evaluate AI-generated outputs for quality, accuracy, relevance, and adherence to specified requirements and standards. -Tags: AI, ANALYSIS, REVIEW - -## Pattern: label_and_rate -Description: Categorize and evaluate content by assigning descriptive labels and numerical ratings based on defined criteria and quality metrics. -Tags: ANALYSIS, REVIEW, WRITING - -## Pattern: md_callout -Description: Generate markdown callout blocks to highlight important information, warnings, notes, and tips with appropriate styling and formatting. -Tags: WRITING, CONVERSION - -## Pattern: official_pattern_template -Description: Define standardized pattern templates with structured sections for identity, purpose, steps, and output specifications to ensure consistent pattern creation. -Tags: DEVELOPMENT, WRITING - -## Pattern: prepare_7s_strategy -Description: Apply McKinsey's 7S framework to analyze organizational alignment across strategy, structure, systems, shared values, style, staff, and skills. -Tags: ANALYSIS, BUSINESS, STRATEGY - -## Pattern: provide_guidance -Description: Offer expert advice and recommendations tailored to specific situations, providing clear, actionable steps and best practices for implementation. -Tags: ANALYSIS, LEARNING, SELF - -## Pattern: rate_ai_response -Description: Evaluate AI responses for quality, coherence, relevance, and effectiveness, providing detailed scoring and improvement suggestions. -Tags: AI, ANALYSIS, REVIEW - -## Pattern: rate_ai_result -Description: Assess AI-generated outputs against predefined success criteria, providing quantitative scores and qualitative feedback for improvement. -Tags: AI, ANALYSIS, REVIEW - -## Pattern: rate_content -Description: Evaluate content quality across multiple dimensions including accuracy, clarity, engagement, and value, providing comprehensive scoring with detailed justification. -Tags: ANALYSIS, REVIEW, WRITING - - -## Pattern: rate_value -Description: Assess the practical value and impact potential of content by evaluating its utility, applicability, and potential return on investment. -Tags: ANALYSIS, BUSINESS, REVIEW - -## Pattern: raw_query -Description: Process direct, unstructured queries by interpreting intent and providing focused, relevant responses without additional formatting or templates. -Tags: AI, ANALYSIS - -## Pattern: recommend_artists -Description: Suggest relevant artists and creators based on user preferences, style similarities, and thematic connections across various artistic mediums. -Tags: ANALYSIS, RESEARCH, SELF - -## Pattern: recommend_pipeline_upgrades -Description: Analyze CI/CD pipelines and suggest improvements for efficiency, reliability, and security based on industry best practices and modern tooling. -Tags: DEVELOPMENT, SECURITY - -## Pattern: recommend_talkpanel_topics -Description: Generate engaging discussion topics and questions for panel talks based on audience interests, current trends, and speaker expertise. -Tags: ANALYSIS, WRITING - -## Pattern: refine_design_document -Description: Enhance software design documentation by improving clarity, completeness, technical accuracy, and alignment with architectural best practices. -Tags: DEVELOPMENT, WRITING - -## Pattern: review_design -Description: Evaluate software design proposals and architectures for scalability, maintainability, security, and adherence to design principles and patterns. -Tags: DEVELOPMENT, ANALYSIS, REVIEW - -## Pattern: sanitize_broken_html_to_markdown -Description: Clean and convert malformed HTML content into well-structured markdown format while preserving content hierarchy and semantic meaning. -Tags: CONVERSION, DEVELOPMENT - -## Pattern: show_fabric_options_markmap -Description: Generate hierarchical mind maps visualizing Fabric framework capabilities, patterns, and configuration options using Markmap syntax. -Tags: VISUALIZATION, DEVELOPMENT - -## Pattern: solve_with_cot -Description: Solve complex problems using chain-of-thought reasoning, breaking down solutions into clear, logical steps with explicit intermediate reasoning. -Tags: AI, ANALYSIS, LEARNING - -## Pattern: suggest_pattern -Description: Recommend appropriate Fabric patterns based on user requirements, task characteristics, and desired outcomes to optimize pattern selection. -Tags: AI, ANALYSIS, DEVELOPMENT - -## Pattern: summarize -Description: Generate comprehensive content summaries that capture key points, main arguments, and essential details while maintaining context and clarity. -Tags: SUMMARIZATION, WRITING - -## Pattern: summarize_debate -Description: Create structured summaries of debates highlighting key arguments, points of agreement, areas of contention, and notable exchanges between participants. -Tags: SUMMARIZATION, ANALYSIS, CRITICAL THINKING - -## Pattern: summarize_git_changes -Description: Generate clear, concise summaries of git repository changes, highlighting key modifications, additions, and deletions across commits. -Tags: DEVELOPMENT, SUMMARIZATION - -## Pattern: summarize_git_diff -Description: Analyze git diff output to provide clear, structured summaries of code changes, highlighting functional modifications and their potential impact. -Tags: DEVELOPMENT, ANALYSIS - -## Pattern: summarize_lecture -Description: Create structured summaries of academic lectures capturing key concepts, examples, methodologies, and important takeaways in an organized format. -Tags: SUMMARIZATION, LEARNING, WRITING - -## Pattern: summarize_legislation -Description: Create comprehensive summaries of legislative documents highlighting key provisions, amendments, implications, and affected stakeholders. -Tags: SUMMARIZATION, ANALYSIS, WRITING - -## Pattern: summarize_meeting -Description: Create structured meeting summaries capturing key discussions, decisions, action items, and assigned responsibilities in a clear, organized format. -Tags: SUMMARIZATION, WRITING, BUSINESS - -## Pattern: summarize_micro -Description: Generate ultra-concise content summaries with one-sentence overview, key points, and essential takeaways in minimal words. -Tags: SUMMARIZATION, WRITING - -## Pattern: summarize_newsletter -Description: Create concise summaries of newsletter content highlighting key updates, announcements, trends, and notable developments in a structured format. -Tags: SUMMARIZATION, WRITING - -## Pattern: summarize_paper -Description: Create structured summaries of academic papers highlighting research objectives, methodology, key findings, and significant conclusions in a clear format. -Tags: SUMMARIZATION, RESEARCH, WRITING, LEARNING - -## Pattern: summarize_prompt -Description: Analyze and summarize AI prompts to identify key instructions, requirements, constraints, and expected outputs in a clear, structured format. -Tags: ANALYSIS, AI - -## Pattern: summarize_pull-requests -Description: Create concise summaries of pull requests highlighting key code changes, implementation details, and potential impacts in a clear, developer-friendly format. -Tags: SUMMARIZATION, DEVELOPMENT - -## Pattern: summarize_rpg_session -Description: Create detailed summaries of roleplaying game sessions capturing key story events, character developments, combat encounters, and important decisions in a narrative format. -Tags: SUMMARIZATION, GAMING, WRITING - -## Pattern: t_analyze_challenge_handling -Description: Evaluate approaches to handling challenges by analyzing response strategies, coping mechanisms, and problem-solving methods to identify effective patterns. -Tags: ANALYSIS, STRATEGY, CRITICAL THINKING - -## Pattern: t_check_metrics -Description: Analyze and evaluate performance metrics, tracking progress against goals while identifying trends, patterns, and areas for improvement. -Tags: ANALYSIS, BUSINESS - -## Pattern: t_create_h3_career -Description: Generate structured career development plans using the Head, Heart, Hands (H3) framework to align skills, passions, and practical actions. -Tags: STRATEGY, BUSINESS, WRITING, SELF - -## Pattern: t_create_opening_sentences -Description: Generate compelling opening sentences for content that capture attention, establish context, and effectively introduce key themes or concepts. -Tags: WRITING - -## Pattern: t_describe_life_outlook -Description: Analyze and articulate personal life philosophies, values, and worldviews to understand core beliefs and their influence on decision-making and behavior. -Tags: ANALYSIS, WRITING, SELF - -## Pattern: t_extract_intro_sentences -Description: Extract and analyze introductory sentences from content to identify effective hooks, context-setting techniques, and engagement strategies. -Tags: EXTRACTION, ANALYSIS, WRITING - -## Pattern: t_extract_panel_topics -Description: Extract and organize potential discussion topics from content to create engaging panel discussions, identifying key themes, controversies, and audience-relevant points. -Tags: EXTRACTION, ANALYSIS, WRITING - -## Pattern: t_find_blindspots -Description: Identify and analyze potential blind spots in thinking, planning, or decision-making processes to uncover overlooked factors and improve strategic awareness. -Tags: ANALYSIS, STRATEGY, CRITICAL THINKING - -## Pattern: t_find_negative_thinking -Description: Identify and analyze patterns of negative thinking in content to recognize cognitive distortions, self-limiting beliefs, and opportunities for reframing. -Tags: ANALYSIS, STRATEGY, CRITICAL THINKING - -## Pattern: t_find_neglected_goals -Description: Identify and analyze goals, aspirations, or objectives that have been overlooked or deprioritized to surface opportunities for renewed focus and action. -Tags: ANALYSIS, STRATEGY, CRITICAL THINKING, SELF - -## Pattern: t_give_encouragement -Description: Generate personalized, context-aware messages of encouragement that acknowledge challenges while reinforcing strengths and promoting resilience. -Tags: WRITING, SELF - -## Pattern: t_red_team_thinking -Description: Apply adversarial thinking to analyze plans, systems, or ideas by identifying potential weaknesses, attack vectors, and failure modes to improve resilience. -Tags: ANALYSIS, SECURITY, STRATEGY, CRITICAL THINKING - -## Pattern: t_threat_model_plans -Description: Analyze plans and strategies through a security lens to identify potential threats, vulnerabilities, and risks while providing mitigation recommendations. -Tags: SECURITY, ANALYSIS, STRATEGY - -## Pattern: t_visualize_mission_goals_projects -Description: Create visual representations of organizational missions, strategic goals, and project hierarchies to clarify relationships and track progress toward objectives. -Tags: VISUALIZATION, BUSINESS, STRATEGY - -## Pattern: t_year_in_review -Description: Generate comprehensive annual reviews by analyzing achievements, challenges, learnings, and growth opportunities while identifying patterns and setting future directions. -Tags: ANALYSIS, WRITING, BUSINESS - -## Pattern: to_flashcards -Description: Convert educational content into structured flashcard format with clear questions and answers, optimized for spaced repetition learning. -Tags: LEARNING, CONVERSION - -## Pattern: transcribe_minutes -Description: Convert meeting recordings or notes into structured, well-organized minutes capturing key discussions, decisions, action items, and attendee contributions. -Tags: WRITING, BUSINESS, CONVERSION - -## Pattern: translate -Description: Convert content between languages while preserving meaning, context, and cultural nuances, ensuring accurate and natural-sounding translations. -Tags: CONVERSION - -## Pattern: tweet -Description: Transform content into concise, engaging tweets that capture key messages while adhering to platform constraints and social media best practices. -Tags: WRITING, CONVERSION - -## Pattern: write_essay -Description: Create well-structured essays with clear thesis statements, supporting arguments, evidence, and conclusions while maintaining academic writing standards. -Tags: WRITING, RESEARCH, LEARNING - -## Pattern: write_hackerone_report -Description: Create detailed vulnerability reports following HackerOne's format, including clear reproduction steps, impact analysis, and remediation recommendations. -Tags: SECURITY, WRITING, ANALYSIS - -## Pattern: write_latex -Description: Generate professional LaTeX documents with proper formatting, mathematical notation, citations, and cross-references following academic publishing standards. -Tags: WRITING, RESEARCH, CONVERSION - -## Pattern: write_micro_essay -Description: Create concise, focused essays that present a single key idea with supporting evidence and analysis in a highly condensed format. -Tags: WRITING, RESEARCH - -## Pattern: write_nuclei_template_rule -Description: Generate Nuclei vulnerability scanning templates with detection logic, payload patterns, and validation rules following the template syntax specification. -Tags: SECURITY, DEVELOPMENT - -## Pattern: write_pull-request -Description: Create comprehensive pull request descriptions with clear summaries of changes, implementation details, testing procedures, and related issue references. -Tags: DEVELOPMENT - -## Pattern: write_semgrep_rule -Description: Create Semgrep pattern matching rules for static code analysis, including detection patterns, metadata, and fix suggestions following the rule syntax specification. -Tags: SECURITY, DEVELOPMENT diff --git a/web/myfiles/Obsidian_perso_not_share/qualifier-implementation-plan.md b/web/myfiles/Obsidian_perso_not_share/qualifier-implementation-plan.md deleted file mode 100644 index 0a90491e..00000000 --- a/web/myfiles/Obsidian_perso_not_share/qualifier-implementation-plan.md +++ /dev/null @@ -1,140 +0,0 @@ -# Plan for Implementing Qualifier Support in Web Interface - -## Current Issue -The web interface currently treats qualifiers (like -g=fr) as part of the message text instead of processing them as command flags. - -## Implementation Plan - -### 1. Add Qualifier Interface -```typescript -// Add to chat-interface.ts -export interface ChatQualifiers { - language?: string; // -g flag - temperature?: number; // -t flag - topP?: number; // -T flag - presencePenalty?: number; // -P flag - frequencyPenalty?: number; // -F flag - raw?: boolean; // -r flag - model?: string; // -m flag -} - -// Update ChatRequest to include qualifiers -export interface ChatRequest { - prompts: ChatPrompt[]; - messages: Message[]; - qualifiers?: ChatQualifiers; - // ... existing fields -} -``` - -### 2. Add Qualifier Parser -```typescript -// New file: src/lib/utils/qualifier-parser.ts -export function parseQualifiers(input: string): { - text: string; - qualifiers: ChatQualifiers; -} { - const qualifierRegex = /-([a-zA-Z]+)(?:=([^\s]+))?/g; - const qualifiers: ChatQualifiers = {}; - - // Remove qualifiers and get clean text - const text = input.replace(qualifierRegex, (match, flag, value) => { - switch (flag) { - case 'g': - qualifiers.language = value; - break; - case 't': - qualifiers.temperature = parseFloat(value); - break; - // ... handle other qualifiers - } - return ''; - }).trim(); - - return { text, qualifiers }; -} -``` - -### 3. Modify ChatInput Component -```typescript -// In ChatInput.svelte -import { parseQualifiers } from '$lib/utils/qualifier-parser'; - -async function handleSubmit() { - if (!userInput.trim()) return; - - try { - const { text, qualifiers } = parseQualifiers(userInput); - - // Add qualifiers to request - const request = await chatService.createChatRequest(text); - request.qualifiers = qualifiers; - - // Send to backend - const stream = await chatService.streamChat(request); - // ... rest of the code - } catch (error) { - // ... error handling - } -} -``` - -### 4. Update ChatService -```typescript -// In ChatService.ts -public async createChatRequest(userInput: string): Promise { - const config = get(chatConfig); - return { - prompts: [{ - userInput, - systemPrompt: get(systemPrompt), - model: config.model, - patternName: get(selectedPatternName) - }], - messages: get(messageStore), - ...config - }; -} -``` - -### 5. Update Backend API -The backend API at localhost:8080/api/chat already supports these qualifiers, so we just need to ensure they're properly included in the request body. - -## Testing Plan - -1. Test Basic Qualifier Parsing: -```typescript -const input = "hello -g=fr -t=0.8"; -const { text, qualifiers } = parseQualifiers(input); -// Should return: -// text: "hello" -// qualifiers: { language: "fr", temperature: 0.8 } -``` - -2. Test Multiple Qualifiers: -```typescript -const input = "-g=fr -t=0.8 -P=0.2 hello world"; -// Should parse all qualifiers and extract clean text -``` - -3. Test Invalid Qualifiers: -```typescript -const input = "hello -g=fr -invalid=123"; -// Should ignore invalid qualifiers -``` - -## Next Steps - -1. Implement the qualifier parser -2. Update the chat interfaces -3. Modify ChatInput to use the parser -4. Add error handling for invalid qualifiers -5. Add validation for qualifier values -6. Update documentation - -## Future Enhancements - -1. Add UI controls for common qualifiers -2. Add autocomplete for qualifier flags -3. Add validation feedback for invalid qualifiers -4. Add help text showing available qualifiers \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/rebased_fabric-contrib.md b/web/myfiles/Obsidian_perso_not_share/rebased_fabric-contrib.md deleted file mode 100644 index 884b0166..00000000 --- a/web/myfiles/Obsidian_perso_not_share/rebased_fabric-contrib.md +++ /dev/null @@ -1,131 +0,0 @@ -# Fabric Web UI Enhancement Contribution Setup - -### One-Time Setup in VSCode - -Before adding web UI enhancements: - -1. Verify working branch: -```bash -git status - -Ensures active branch is feature/web-ui-enhancements for isolated development - -Check repository connections: -git fetch upstream -git status - -Validates: - -Clean working tree -Latest upstream code -Branch synchronization status -Pending changes if any - -Verify remote configurations: -git remote -v - -Shows all configured remotes: - -origin: Your fork (jmd1010/fabricDM) -upstream: Original repo (danielmiessler/fabric) -backup: Full environment (jmd1010/fabric-backup) - -This verification process: - -Establishes clean development foundation -Confirms proper repository relationships -Enables isolated feature development -Maintains clear upgrade path -Preserves complete backup access - - -This documentation provides clear steps for initial VSCode setup while maintaining proper Git workflow and repository relationships. - - - -## Repository Structure -- Fork: jmd1010/fabric-contrib -- Original: danielmiessler/fabric -- Branch: feature/web-ui-enhancements - -## Remote Configuration -- origin: git@github.com:jmd1010/fabricDM.git -- upstream: https://github.com/danielmiessler/fabric.git - -## Development Environment -### Shell Configurations -- Updated .zshrc and .bashrc -- Corrected paths for new repository structure -- Go environment variables -- Pattern directory mappings - -### Web Development Setup -- Backend: fabric --serve -- Frontend: npm run dev in web directory -- Development URLs and ports - -## Pull Request Workflow -1. Sync with upstream -2. Feature branch development -3. Code review preparation -4. PR submission guidelines - -## Backup Management -### Repository Setup -- Backup: git@github.com:jmd1010/fabric-backup.git -- Contains complete development environment -- Excludes only sensitive files (.env) -- Private repository for safety - -### Backup Workflow -1. Regular backup pushes: -```bash -git push backup feature/web-ui-enhancements - -2. After significant changes: - -git add . -git commit -m "Development checkpoint - [description]" -git push backup feature/web-ui-enhancements - -3. Before major refactoring: - -git tag backup-pre-refactor-[date] -git push backup --tags - - -Development vs Backup - -Backup repo: Complete environment preservation - -Feature branch: Clean commits for PR - -Separate commit messages for backup vs PR - -Tag significant development points - -Regular synchronization with both repos - -Recovery Procedures - -1. From backup: - -git clone git@github.com:jmd1010/fabric-backup.git -git checkout feature/web-ui-enhancements - -2. Environment restoration: - -Copy .env.example to .env -Configure local paths -Install dependencies -Verify development setup - - -This structure provides: - -1. Clear separation of concerns -2. Detailed workflow procedures -3. Recovery instructions -4. Best practices for both backup and development -5. Easy reference for ongoing work - diff --git a/web/myfiles/Obsidian_perso_not_share/restoration-complete.md b/web/myfiles/Obsidian_perso_not_share/restoration-complete.md deleted file mode 100644 index 7649b36a..00000000 --- a/web/myfiles/Obsidian_perso_not_share/restoration-complete.md +++ /dev/null @@ -1,56 +0,0 @@ -# Restoration to Pre-1:33 PM State Complete - -## Files Restored -1. Core Files: - - chat-interface.ts (1:31:45 PM) - - ChatService.ts (1:32:10 PM) - - chat-store.ts (1:31:55 PM) - - ChatInput.svelte (1:32:15 PM) - - ChatMessages.svelte (1:32:05 PM) - - +server.ts (1:32:24 PM) - -2. Language Support: - - language-store.ts (1:32:20 PM) - - language-options.md (documentation) - -3. Session Management: - - base.ts (removed streaming) - - file-utils.ts (basic file operations) - - session-store.ts (basic session management) - - SessionManager.svelte (basic UI without copy) - -4. UI Components: - - ModelConfig.svelte (no changes needed) - - select.svelte (UI library) - - Tooltip.svelte (UI library) - -## Files Kept -- raw-store.ts (existed before 1:33) - -## Files Deleted -- stream-store.ts -- clipboard.ts -- copy-store.ts -- qualifier-store.ts -- QualifierInput.svelte - -## Documentation Files -- stream-lessons.md -- changes-since-133pm.md -- files-after-133pm.md - -## Working Features -1. Language Support - - --fr/--en qualifiers in ChatInput - - Language instruction added in ChatService - - Language state managed in language-store - -2. Session Management - - Save/Load sessions - - Clear chat - - Revert last message - -3. Core Chat - - Message sending/receiving - - Markdown rendering - - Basic UI layout \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/stream-lessons.md b/web/myfiles/Obsidian_perso_not_share/stream-lessons.md deleted file mode 100644 index 8d8022f6..00000000 --- a/web/myfiles/Obsidian_perso_not_share/stream-lessons.md +++ /dev/null @@ -1,98 +0,0 @@ -# Streaming Implementation Lessons - -## What We Tried - -1. Direct Event Stream Handling: - - Added StreamResponse type to interfaces - - Modified server to parse event stream data - - Added streaming state to stores - - Created dedicated stream-store.ts - - Modified UI components for streaming display - -2. Implementation Issues: - - Mixed concerns between streaming and response handling - - Added complexity to multiple components - - Created tight coupling between components - - Made error handling more complex - - Lost the simplicity of the working language implementation - -## What We Learned - -1. Architecture Issues: - - Streaming should be handled at a lower level - - Response format should be consistent regardless of streaming - - UI should be agnostic to streaming mode - - State management became too complex - - Too many components were modified - -2. Better Approach Would Be: - - a. Server Layer: - - Handle streaming at the transport level - - Abstract streaming details from response format - - Keep consistent response structure - - Handle errors at the boundary - - b. Service Layer: - - Use a streaming adapter pattern - - Keep core service logic unchanged - - Handle streaming as a separate concern - - Maintain backward compatibility - - c. Store Layer: - - Keep stores focused on data, not transport - - Use message queue pattern for updates - - Maintain simple state management - - Avoid streaming-specific stores - - d. UI Layer: - - Keep components transport-agnostic - - Use progressive enhancement for streaming - - Maintain simple update mechanism - - Focus on display, not data handling - -## Recommendations for Future Implementation - -1. Architecture: - - Create a streaming adapter layer - - Keep core components unchanged - - Use message queue for updates - - Maintain separation of concerns - -2. Response Format: - - Use consistent format for streaming/non-streaming - - Handle chunking at transport level - - Keep message structure simple - - Maintain type safety - -3. Error Handling: - - Handle streaming errors separately - - Keep core error handling unchanged - - Provide clear error boundaries - - Maintain good user experience - -4. Testing: - - Test streaming in isolation - - Maintain existing test coverage - - Add streaming-specific tests - - Ensure backward compatibility - -## Key Takeaways - -1. Keep It Simple: - - Don't mix streaming with core logic - - Maintain clear boundaries - - Use proven patterns - - Think about maintainability - -2. Separation of Concerns: - - Transport layer handles streaming - - Service layer stays clean - - UI remains simple - - Stores focus on data - -3. Progressive Enhancement: - - Start with working non-streaming version - - Add streaming as enhancement - - Keep fallback mechanism - - Maintain compatibility \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/update-pr-steps.md b/web/myfiles/Obsidian_perso_not_share/update-pr-steps.md deleted file mode 100644 index c776e8d4..00000000 --- a/web/myfiles/Obsidian_perso_not_share/update-pr-steps.md +++ /dev/null @@ -1,59 +0,0 @@ -# Steps to Update Existing Pull Request with New Enhancements - -## 1. Update Your FabricDM Repository -```bash -# Navigate to your FabricDM directory -cd /path/to/FabricDM - -# Make sure you're on your feature branch -git checkout feature/your-improvements - -# Pull any updates from upstream if needed -git remote add upstream https://github.com/danielmiessler/fabric.git -git fetch upstream -git rebase upstream/main -``` - -## 2. Copy New Changes -Copy the following modified/new files from your Fabric2 repository to FabricDM: - -### Pattern Search Feature: -- `fabric/web/src/lib/components/patterns/PatternList.svelte` -- `fabric/web/src/lib/components/ui/input/Input.svelte` - -### Obsidian Integration: -- Any modified files related to Obsidian integration - -## 3. Update Documentation -- Copy the enhanced PR description from `enhanced-pattern-selection-update.md` to document the new features - -## 4. Commit and Push Changes -```bash -# Stage your changes -git add . - -# Commit with a descriptive message -git commit -m "feat: add pattern search and Obsidian integration enhancements - -- Added search functionality to pattern selection modal -- Added Obsidian integration for pattern execution output -- Updated documentation" - -# Push to your feature branch -git push origin feature/your-improvements -``` - -## 5. Update Pull Request -The push will automatically update your existing pull request. You should: -1. Update the PR description with the new content from enhanced-pattern-selection-update.md -2. Add a comment mentioning the new enhancements you've added -3. Request a new review - -## Benefits of This Approach -1. Keeps all related improvements in one PR -2. Maintains the context of your changes -3. Makes it easier for reviewers to understand the full scope -4. Avoids fragmenting the review process - -## Note -Make sure to test all functionality after copying files to ensure everything works correctly in the FabricDM repository. \ No newline at end of file diff --git a/web/myfiles/Obsidian_perso_not_share/youtube-language-fix.md b/web/myfiles/Obsidian_perso_not_share/youtube-language-fix.md deleted file mode 100644 index 5c007a8e..00000000 --- a/web/myfiles/Obsidian_perso_not_share/youtube-language-fix.md +++ /dev/null @@ -1,48 +0,0 @@ -# YouTube Language Processing Fix - Analysis - -## Current Working Implementation -```typescript -// In processYouTubeURL: - -// Get language -const currentLanguage = get(languageStore); - -// Process stream with language instruction per chunk -await chatService.processStream( - stream, - (content: string, response?: StreamResponse) => { - // Add language instruction to each chunk - if (currentLanguage !== 'en') { - content = `${content}. Please use the language '${currentLanguage}' for the output.`; - } - // Update messages... - } -); -``` - -## Why This Works -1. YouTube transcripts are long and processed in chunks -2. Each chunk gets its own language instruction -3. Model maintains language context throughout -4. No chance of language being "forgotten" mid-stream - -## Key Points -1. Adding language at start would only affect first chunk -2. Long transcripts need language reinforcement -3. Current implementation ensures consistent language -4. Works with streaming nature of processing - -## Verification -1. Language instruction added to each chunk -2. Pattern output stays in correct language -3. No language switching mid-stream -4. Consistent output throughout - -## Conclusion -The current implementation should be kept as is because: -1. It's proven to work in practice -2. Handles chunked processing correctly -3. Maintains language context -4. Produces consistent translations - -No changes needed since the current approach successfully handles YouTube language processing. \ No newline at end of file