|
| 1 | +# Add Quote |
| 2 | + |
| 3 | +You are helping the user add one or more tech quotes to this repository. Follow these steps carefully: |
| 4 | + |
| 5 | +## Step 1: Get Quote Information |
| 6 | + |
| 7 | +Ask the user to provide quote information. They can provide: |
| 8 | +- **Single quote**: Just the quote text and author's name |
| 9 | +- **Multiple quotes**: A list of quotes, each with quote text and author's name |
| 10 | + |
| 11 | +Format examples: |
| 12 | +- Single: "Quote text" - Author Name |
| 13 | +- Multiple: Numbered list or multiple quote/author pairs |
| 14 | + |
| 15 | +## Step 2: Verify Quote Authenticity (For Each Quote) |
| 16 | + |
| 17 | +CRITICAL: For EACH quote, verify it is legitimate and correctly attributed: |
| 18 | +1. Use WebSearch to search for the quote text along with the author's name |
| 19 | +2. Look for reliable sources that confirm: |
| 20 | + - The quote is real (not fabricated or misattributed) |
| 21 | + - The author attribution is correct |
| 22 | + - The exact wording matches reputable sources |
| 23 | +3. If you find discrepancies: |
| 24 | + - Inform the user about the issue (e.g., quote is commonly misattributed, slightly different wording exists, etc.) |
| 25 | + - Show them what you found and ask if they want to proceed with corrections |
| 26 | + - If the quote appears to be fabricated or cannot be verified, recommend NOT adding it |
| 27 | +4. If the quote is verified as authentic and correctly attributed, proceed to Step 3 |
| 28 | +5. **For multiple quotes**: Verify all quotes before proceeding to add any of them |
| 29 | + |
| 30 | +## Step 3: Check if Quotes Already Exist |
| 31 | + |
| 32 | +CRITICAL: Before adding any quotes, verify none of them already exist: |
| 33 | +1. Read the `src/quotes.ts` file ONCE |
| 34 | +2. For EACH quote, search for the quote text (check for exact matches or very similar wording) |
| 35 | +3. If any quote already exists: |
| 36 | + - Inform the user that this quote is already in the database |
| 37 | + - Show them the existing quote details (ID, author, etc.) |
| 38 | + - Ask if they want to skip it or add a different quote instead |
| 39 | + - Do NOT add duplicates |
| 40 | +4. Only proceed with quotes that are new |
| 41 | + |
| 42 | +## Step 4: Check for Existing Authors |
| 43 | + |
| 44 | +IMPORTANT: For EACH quote, check if the author already exists in `src/quotes.ts`: |
| 45 | +1. Search for the author name (check for slight variations in naming, e.g., "E.W. Dijkstra" vs "Edsger Dijkstra") |
| 46 | +2. If the author exists: |
| 47 | + - Use the EXACT same `authorName` spelling |
| 48 | + - Use the EXACT same `authorDescription` classification |
| 49 | + - Use the EXACT same `authorWiki` URL (if present) |
| 50 | + - This ensures consistency across all quotes by the same author |
| 51 | +3. Build a list of authors that need to be researched (those not in the database) |
| 52 | +4. If all authors exist, proceed to Step 6 |
| 53 | +5. If any authors are new, proceed to Step 5 |
| 54 | + |
| 55 | +## Step 5: Research New Authors (For Each New Author) |
| 56 | + |
| 57 | +For EACH author that doesn't exist in the database, use WebSearch to find information: |
| 58 | +- Search for "{author name} Wikipedia" or "{author name} profession" |
| 59 | +- Determine the most appropriate classification from the allowed `AuthorDescription` types in `src/quotes.ts`: |
| 60 | + - 'Artist', 'Author', 'Composer', 'Computer Scientist', 'Designer', 'Director', 'Engineer', 'Entrepreneur', 'Hacker', 'Historian', 'Inventor', 'Linguist', 'Journalist', 'Martial Artist', 'Mathematician', 'Military Officer', 'Philosopher', 'Physicist', 'Scientist', 'Software Developer', 'Ethnographer' |
| 61 | +- Find the Wikipedia URL (format: `https://en.wikipedia.org/wiki/{Article_Name}`) |
| 62 | +- If the author doesn't have a Wikipedia page, the `authorWiki` field should be omitted |
| 63 | +- **For multiple quotes with the same new author**: Only research the author once and reuse the information |
| 64 | + |
| 65 | +## Step 6: Add the Quotes |
| 66 | + |
| 67 | +1. Prepare all quote objects to be added, following this format: |
| 68 | + ```typescript |
| 69 | + { |
| 70 | + text: 'Quote text here', |
| 71 | + authorName: 'Author Name', |
| 72 | + authorDescription: 'Appropriate Classification', |
| 73 | + authorWiki: 'https://en.wikipedia.org/wiki/Article_Name' // omit if no Wikipedia page |
| 74 | + } |
| 75 | + ``` |
| 76 | +2. **For single quote**: Use the Edit tool to add the quote at the end of the quotes array (before the closing `]`) |
| 77 | +3. **For multiple quotes**: Use the Edit tool to add ALL quotes at once, appending them all at the end of the quotes array (before the closing `]`), with proper comma separation |
| 78 | +4. Ensure proper TypeScript formatting and escaping (especially for single quotes in text: use `\'`) |
| 79 | + |
| 80 | +## Step 7: Validate and Build |
| 81 | + |
| 82 | +1. Run `npm test` to ensure linting and type checking pass |
| 83 | +2. If tests fail, fix any issues and re-run |
| 84 | +3. Run `npm run build` to generate the static API files |
| 85 | +4. Verify the build completed successfully |
| 86 | + |
| 87 | +## Step 8: Confirm Success |
| 88 | + |
| 89 | +**For single quote:** |
| 90 | +1. Read the newly generated quote file from `dist/quotes/{id}.json` to verify it was created correctly |
| 91 | +2. Read the author file from `dist/authors/{author-slug}.json` to verify it was created/updated correctly |
| 92 | +3. Show the user: |
| 93 | + - The quote ID assigned |
| 94 | + - The quote JSON |
| 95 | + - A confirmation that the quote was successfully added |
| 96 | + |
| 97 | +**For multiple quotes:** |
| 98 | +1. Read ALL newly generated quote files from `dist/quotes/{id}.json` to verify they were created correctly |
| 99 | +2. Read relevant author files from `dist/authors/{author-slug}.json` to verify they were created/updated correctly |
| 100 | +3. Show the user a summary table with: |
| 101 | + - Number of quotes added |
| 102 | + - Quote IDs assigned |
| 103 | + - Authors (new and existing) |
| 104 | + - Brief preview of each quote |
| 105 | +4. Provide a confirmation that all quotes were successfully added |
| 106 | + |
| 107 | +## Important Notes |
| 108 | + |
| 109 | +- **ALWAYS verify quote authenticity** using web search before adding it (for EACH quote when adding multiple) |
| 110 | +- **ALWAYS check if the quote already exists** to prevent duplicates (for EACH quote when adding multiple) |
| 111 | +- **ALWAYS check for existing authors** to maintain consistency across all quotes |
| 112 | +- If a quote cannot be verified or appears misattributed, DO NOT add it without user confirmation |
| 113 | +- The quote text should be added exactly as verified from reliable sources |
| 114 | +- Pay attention to proper escaping of single quotes in the text (use `\'`) |
| 115 | +- The `authorDescription` must exactly match one of the allowed types in the TypeScript enum |
| 116 | +- Author information (name, classification, wiki URL) must be identical across all quotes by the same author |
| 117 | +- **When adding multiple quotes**: Process verification in parallel when possible (multiple WebSearch calls), but add all quotes in a single Edit operation |
| 118 | +- **Batch operations**: Only run `npm test` and `npm run build` ONCE after all quotes are added |
0 commit comments