Skip to content

Commit 816d071

Browse files
claudelfilho
authored andcommitted
Add /add-book skill for managing CV reading list
Created a comprehensive Claude skill for adding books to the CV with: - Web search for accurate book information - Screenshot parsing for book details - URL fetching from book websites (Amazon, Goodreads, etc.) - ISBN lookup support - Duplicate detection - Intelligent categorization (software vs soft skills) - Proper formatting with subtitle handling - User approval workflow - Automatic commit generation - Optional push to remote https://claude.ai/code/session_01SvgTPTtMj9Utsibo7brPCq
1 parent d10a3ef commit 816d071

File tree

2 files changed

+181
-0
lines changed

2 files changed

+181
-0
lines changed

.claude/skills/README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Claude Skills for CV Project
2+
3+
This directory contains custom skills for managing the CV project.
4+
5+
## Available Skills
6+
7+
### `/add-book` - Add Book to CV Reading List
8+
9+
Intelligently add books to your CV with automatic validation, categorization, and formatting.
10+
11+
**Features:**
12+
- Web search for accurate book information
13+
- Screenshot parsing for book details
14+
- URL fetching from book websites
15+
- Duplicate detection
16+
- Intelligent categorization (software vs soft skills)
17+
- Proper formatting with subtitle handling
18+
- User approval workflow
19+
- Automatic commit generation
20+
- Optional push to remote
21+
22+
**Usage:**
23+
```bash
24+
/add-book <book title | URL | screenshot path | ISBN>
25+
```
26+
27+
**Examples:**
28+
```bash
29+
/add-book Atomic Habits
30+
/add-book https://www.amazon.com/dp/0132350882
31+
/add-book ~/Downloads/book-screenshot.png
32+
/add-book 9780132350884
33+
```
34+
35+
See `add-book.md` for detailed documentation.
36+
37+
## Creating New Skills
38+
39+
To create a new skill:
40+
41+
1. Create a new `.md` file in this directory
42+
2. Name it with kebab-case (e.g., `my-skill.md`)
43+
3. Document the skill's purpose, usage, and behavior
44+
4. The skill can be invoked with `/my-skill`
45+
46+
## Notes
47+
48+
- Skills are invoked using the `/skill-name` syntax
49+
- Skills have access to all tools and context
50+
- Keep skills focused on specific, repeatable tasks
51+
- Document all expected inputs and outputs

.claude/skills/add-book.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
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

Comments
 (0)