|
| 1 | +# Add Book to CV |
| 2 | + |
| 3 | +Add a book to your CV's reading list with intelligent categorization and validation. |
| 4 | + |
| 5 | +## Usage |
| 6 | + |
| 7 | +``` |
| 8 | +/add-book <book identifier> |
| 9 | +``` |
| 10 | + |
| 11 | +Where `<book identifier>` can be: |
| 12 | +- Book title (e.g., "Clean Code") |
| 13 | +- URL to book page (Amazon, Goodreads, etc.) |
| 14 | +- Path to screenshot containing book information |
| 15 | +- ISBN number |
| 16 | + |
| 17 | +## Behavior |
| 18 | + |
| 19 | +When invoked, this skill will: |
| 20 | + |
| 21 | +1. **Extract Book Information** |
| 22 | + - If a URL is provided: Fetch and parse the page for title, author, and description |
| 23 | + - If a screenshot is provided: Parse the image using vision capabilities to extract book details |
| 24 | + - If a title is provided: Search the web for the book to get accurate author name and full title |
| 25 | + - If an ISBN is provided: Look up the book details |
| 26 | + |
| 27 | +2. **Validate the Book** |
| 28 | + - Confirm the book exists and information is accurate |
| 29 | + - Check for duplicates in the existing CV book lists |
| 30 | + - Alert if the book is already present |
| 31 | + |
| 32 | +3. **Intelligent Categorization** |
| 33 | + - Analyze the book's subject matter based on title, description, and genre |
| 34 | + - Suggest whether it belongs in: |
| 35 | + - `software` - Technical books (programming, engineering, tools) |
| 36 | + - `softSkills` - Leadership, management, soft skills, personal development |
| 37 | + - Ask for user confirmation on categorization |
| 38 | + |
| 39 | +4. **Format the Entry** |
| 40 | + - Properly format the book entry following existing conventions: |
| 41 | + - Detect if there's a subtitle and format accordingly |
| 42 | + - Handle multiple authors appropriately |
| 43 | + - Ensure consistent formatting with existing entries |
| 44 | + - Example formats: |
| 45 | + ```typescript |
| 46 | + { title: 'Clean Code', author: 'Robert C. Martin' } |
| 47 | + |
| 48 | + { |
| 49 | + title: 'Shape Up: ', |
| 50 | + subtitle: 'Stop Running in Circles and Ship Work that Matters', |
| 51 | + author: 'Ryan Singer' |
| 52 | + } |
| 53 | + |
| 54 | + { |
| 55 | + title: 'Head First: Design Patterns', |
| 56 | + author: 'E. Freeman, E. Robson, B. Bates, K. Sierra' |
| 57 | + } |
| 58 | + ``` |
| 59 | + |
| 60 | +5. **Show Proposed Changes** |
| 61 | + - Display the complete diff showing: |
| 62 | + - Which category the book will be added to |
| 63 | + - The formatted book entry |
| 64 | + - Where it will be inserted in the list (at the end of the category by default) |
| 65 | + - Show the line numbers for context |
| 66 | + |
| 67 | +6. **Request User Approval** |
| 68 | + - Present the changes and ask for explicit confirmation |
| 69 | + - Options: "approve", "edit", "cancel" |
| 70 | + - If "edit" is selected, allow user to modify category, title, subtitle, or author |
| 71 | + |
| 72 | +7. **Commit Changes** |
| 73 | + - If approved, use the Edit tool to add the book to `src/components/cv/cvData.ts` |
| 74 | + - Create a descriptive commit message: |
| 75 | + ``` |
| 76 | + Add book to CV: [Title] by [Author] |
| 77 | + |
| 78 | + Category: [software|softSkills] |
| 79 | + |
| 80 | + https://claude.ai/code/session_[SESSION_ID] |
| 81 | + ``` |
| 82 | + - Run `npm run lint` to ensure code formatting is correct |
| 83 | + |
| 84 | +8. **Offer to Push** |
| 85 | + - After successful commit, ask if the user wants to push to the remote branch |
| 86 | + - If yes, execute: `git push -u origin <branch-name>` |
| 87 | + |
| 88 | +## Important Notes |
| 89 | + |
| 90 | +- **File Location**: Books are stored in `src/components/cv/cvData.ts` |
| 91 | +- **Structure**: |
| 92 | + - Software books: `cvData.books.software[]` (lines ~966-1027) |
| 93 | + - Soft skills books: `cvData.books.softSkills[]` (lines ~1028-1189) |
| 94 | +- **Formatting Rules**: |
| 95 | + - Titles with subtitles should have the main title end with `: ` (colon + space) |
| 96 | + - Multiple authors should be comma-separated: `'Author1, Author2, Author3'` |
| 97 | + - Maintain alphabetical or chronological order if specified |
| 98 | +- **Linting**: Always run `npm run lint` before committing to maintain code quality |
| 99 | +- **PDF Generation**: Remind user they may want to rebuild the CV PDF with `npm run build` |
| 100 | + |
| 101 | +## Error Handling |
| 102 | + |
| 103 | +- If book information cannot be found or validated, ask user to provide details manually |
| 104 | +- If duplicate is detected, inform user and ask if they want to continue anyway |
| 105 | +- If categorization is ambiguous, default to asking the user |
| 106 | +- If web search/URL fetch fails, fall back to manual entry |
| 107 | + |
| 108 | +## Examples |
| 109 | + |
| 110 | +```bash |
| 111 | +# Add by title |
| 112 | +/add-book Atomic Habits |
| 113 | +
|
| 114 | +# Add by URL |
| 115 | +/add-book https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 |
| 116 | +
|
| 117 | +# Add by screenshot |
| 118 | +/add-book /path/to/screenshot.png |
| 119 | +
|
| 120 | +# Add by ISBN |
| 121 | +/add-book 9780132350884 |
| 122 | +``` |
| 123 | + |
| 124 | +## Configuration |
| 125 | + |
| 126 | +Default behavior can be customized: |
| 127 | +- **Auto-push**: Set to `true` to automatically push after commit (default: `false`) |
| 128 | +- **Auto-approve**: Set to `true` to skip approval step (default: `false`, not recommended) |
| 129 | +- **Default category**: Set default category when ambiguous (default: `null`, always ask) |
| 130 | +- **Sort order**: Keep insertion at end or sort alphabetically (default: `end`) |
0 commit comments