@ngockhoale/ukit 1.6.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/manifests/platform.full.yaml +24 -0
  3. package/package.json +2 -1
  4. package/scripts/skill/audit-skill.mjs +39 -0
  5. package/src/cli/commands/doctor.js +22 -2
  6. package/src/cli/commands/memory.js +76 -1
  7. package/src/core/memory/store.js +125 -1
  8. package/src/core/skillProfile.js +45 -0
  9. package/src/skill/auditSkill.js +99 -0
  10. package/templates/.claude/agents/code-reviewer.md +51 -7
  11. package/templates/.claude/agents/handoff-planner.md +18 -2
  12. package/templates/.claude/skills/canvas-design/SKILL.md +2 -20
  13. package/templates/.claude/skills/canvas-design/philosophy-examples.md +23 -0
  14. package/templates/.claude/skills/debugging-toolkit/SKILL.md +2 -30
  15. package/templates/.claude/skills/debugging-toolkit/reference-tables.md +33 -0
  16. package/templates/.claude/skills/docs-manager/SKILL.md +7 -249
  17. package/templates/.claude/skills/docs-manager/conventions-and-examples.md +221 -0
  18. package/templates/.claude/skills/docx/SKILL.md +3 -34
  19. package/templates/.claude/skills/docx/redlining-reference.md +34 -0
  20. package/templates/.claude/skills/duraone/SKILL.md +12 -16
  21. package/templates/.claude/skills/executing-plans/SKILL.md +31 -19
  22. package/templates/.claude/skills/file-organizer/SKILL.md +2 -170
  23. package/templates/.claude/skills/file-organizer/examples-and-practices.md +173 -0
  24. package/templates/.claude/skills/pdf/SKILL.md +1 -62
  25. package/templates/.claude/skills/pdf/reference.md +65 -0
  26. package/templates/.claude/skills/pdf-processing-pro/SKILL.md +2 -73
  27. package/templates/.claude/skills/pdf-processing-pro/workflows-and-troubleshooting.md +80 -0
  28. package/templates/.claude/skills/pptx/SKILL.md +14 -286
  29. package/templates/.claude/skills/pptx/design-references.md +81 -0
  30. package/templates/.claude/skills/pptx/template-replacement-reference.md +150 -0
  31. package/templates/.claude/skills/pptx/utilities.md +62 -0
  32. package/templates/.claude/skills/project-learning/SKILL.md +32 -0
  33. package/templates/.claude/skills/root-cause-tracing/SKILL.md +2 -35
  34. package/templates/.claude/skills/root-cause-tracing/diagrams.md +44 -0
  35. package/templates/.claude/skills/sharing-skills/SKILL.md +1 -41
  36. package/templates/.claude/skills/sharing-skills/complete-example.md +41 -0
  37. package/templates/.claude/skills/skill-quality/SKILL.md +37 -0
  38. package/templates/.claude/skills/skill-quality/pressure-scenario-template.md +20 -0
  39. package/templates/.claude/skills/skill-quality/rationalization-table-template.md +15 -0
  40. package/templates/.claude/skills/skill-quality/trigger-accuracy-template.md +32 -0
  41. package/templates/.claude/skills/sql-optimization-patterns/SKILL.md +13 -440
  42. package/templates/.claude/skills/sql-optimization-patterns/references/advanced-techniques.md +128 -0
  43. package/templates/.claude/skills/sql-optimization-patterns/references/core-concepts.md +112 -0
  44. package/templates/.claude/skills/sql-optimization-patterns/references/query-patterns.md +204 -0
  45. package/templates/.claude/skills/subagent-driven-development/SKILL.md +4 -51
  46. package/templates/.claude/skills/subagent-driven-development/example-workflow.md +40 -0
  47. package/templates/.claude/skills/systematic-debugging/SKILL.md +2 -28
  48. package/templates/.claude/skills/systematic-debugging/reference-tables.md +33 -0
  49. package/templates/.claude/skills/test-driven-development/SKILL.md +2 -51
  50. package/templates/.claude/skills/test-driven-development/reference-tables.md +56 -0
  51. package/templates/.claude/skills/testing-anti-patterns/SKILL.md +1 -10
  52. package/templates/.claude/skills/testing-anti-patterns/reference-tables.md +14 -0
  53. package/templates/.claude/skills/verification-before-completion/SKILL.md +1 -31
  54. package/templates/.claude/skills/verification-before-completion/key-patterns.md +33 -0
  55. package/templates/CLAUDE.md +4 -0
  56. package/src/core/memory/index.js +0 -2
  57. package/src/core/router/index.js +0 -2
  58. package/src/core/validation/index.js +0 -2
@@ -0,0 +1,173 @@
1
+ # File Organizer — Examples and Practices
2
+
3
+ ## Examples
4
+
5
+ ### Example 1: Organizing Downloads (From Justin Dielmann)
6
+
7
+ **User**: "My Downloads folder is a mess with 500+ files. Help me organize it."
8
+
9
+ **Process**:
10
+ 1. Analyzes Downloads folder
11
+ 2. Finds patterns: work docs, personal photos, installers, random PDFs
12
+ 3. Proposes structure:
13
+ - Downloads/
14
+ - Work/
15
+ - Personal/
16
+ - Installers/ (DMG, PKG files)
17
+ - Archive/
18
+ - ToSort/ (things needing decisions)
19
+ 4. Asks for confirmation
20
+ 5. Moves files intelligently based on content and names
21
+ 6. Results: 500 files → 5 organized folders
22
+
23
+ ### Example 2: Finding and Removing Duplicates
24
+
25
+ **User**: "Find duplicate files in my Documents and help me decide which to keep."
26
+
27
+ **Output**:
28
+ ```markdown
29
+ # Found 23 Sets of Duplicates (156 MB total)
30
+
31
+ ## Duplicate Set 1: "proposal.pdf"
32
+ - `/Documents/proposal.pdf` (2.3 MB, modified: 2024-03-15)
33
+ - `/Documents/old/proposal.pdf` (2.3 MB, modified: 2024-03-15)
34
+ - `/Desktop/proposal.pdf` (2.3 MB, modified: 2024-03-10)
35
+
36
+ **Recommendation**: Keep `/Documents/proposal.pdf` (most recent in correct location)
37
+ Delete the other 2 copies?
38
+
39
+ [Continue for all duplicates...]
40
+ ```
41
+
42
+ ### Example 3: Restructuring Projects Folder
43
+
44
+ **User**: "Review my ~/Projects directory and suggest improvements."
45
+
46
+ **Output**:
47
+ ```markdown
48
+ # Analysis of ~/Projects
49
+
50
+ ## Current Structure Issues
51
+ - Mix of active and archived projects (3+ years old)
52
+ - No consistent naming convention
53
+ - Some projects at root, others in random subfolders
54
+ - Duplicate folders (project-name, project-name-old, project-name-v2)
55
+
56
+ ## Proposed Structure
57
+
58
+ ```
59
+ Projects/
60
+ ├── Active/
61
+ │ ├── client-work/
62
+ │ ├── side-projects/
63
+ │ └── learning/
64
+ ├── Archive/
65
+ │ ├── 2022/
66
+ │ ├── 2023/
67
+ │ └── 2024/
68
+ └── Templates/
69
+ ```
70
+
71
+ ## Specific Changes
72
+ 1. Move 12 projects not touched since 2022 → Archive/
73
+ 2. Consolidate 4 duplicate project folders
74
+ 3. Rename projects to consistent format: "client-name-project-name"
75
+ 4. Create Archive for old work
76
+
77
+ Want me to implement this?
78
+ ```
79
+
80
+ ### Example 4: Organizing Photos by Date
81
+
82
+ **User**: "Organize my photo folders by year and month."
83
+
84
+ **Output**: Creates structure like:
85
+ ```
86
+ Photos/
87
+ ├── 2023/
88
+ │ ├── 01-January/
89
+ │ ├── 02-February/
90
+ │ └── ...
91
+ ├── 2024/
92
+ │ ├── 01-January/
93
+ │ └── ...
94
+ └── Unsorted/
95
+ ```
96
+
97
+ Then moves photos based on EXIF data or file modification dates.
98
+
99
+ ## Common Organization Tasks
100
+
101
+ ### Downloads Cleanup
102
+ ```
103
+ Organize my Downloads folder - move documents to Documents,
104
+ images to Pictures, keep installers separate, and archive files
105
+ older than 3 months.
106
+ ```
107
+
108
+ ### Project Organization
109
+ ```
110
+ Review my Projects folder structure and help me separate active
111
+ projects from old ones I should archive.
112
+ ```
113
+
114
+ ### Duplicate Removal
115
+ ```
116
+ Find all duplicate files in my Documents folder and help me
117
+ decide which ones to keep.
118
+ ```
119
+
120
+ ### Desktop Cleanup
121
+ ```
122
+ My Desktop is covered in files. Help me organize everything into
123
+ my Documents folder properly.
124
+ ```
125
+
126
+ ### Photo Organization
127
+ ```
128
+ Organize all photos in this folder by date (year/month) based
129
+ on when they were taken.
130
+ ```
131
+
132
+ ### Work/Personal Separation
133
+ ```
134
+ Help me separate my work files from personal files across my
135
+ Documents folder.
136
+ ```
137
+
138
+ ## Pro Tips
139
+
140
+ 1. **Start Small**: Begin with one messy folder (like Downloads) to build trust
141
+ 2. **Regular Maintenance**: Run weekly cleanup on Downloads
142
+ 3. **Consistent Naming**: Use "YYYY-MM-DD - Description" format for important files
143
+ 4. **Archive Aggressively**: Move old projects to Archive instead of deleting
144
+ 5. **Keep Active Separate**: Maintain clear boundaries between active and archived work
145
+ 6. **Trust the Process**: Let Claude handle the cognitive load of where things go
146
+
147
+ ## Best Practices
148
+
149
+ ### Folder Naming
150
+ - Use clear, descriptive names
151
+ - Avoid spaces (use hyphens or underscores)
152
+ - Be specific: "client-proposals" not "docs"
153
+ - Use prefixes for ordering: "01-current", "02-archive"
154
+
155
+ ### File Naming
156
+ - Include dates: "2024-10-17-meeting-notes.md"
157
+ - Be descriptive: "q3-financial-report.xlsx"
158
+ - Avoid version numbers in names (use version control instead)
159
+ - Remove download artifacts: "document-final-v2 (1).pdf" → "document.pdf"
160
+
161
+ ### When to Archive
162
+ - Projects not touched in 6+ months
163
+ - Completed work that might be referenced later
164
+ - Old versions after migration to new systems
165
+ - Files you're hesitant to delete (archive first)
166
+
167
+ ## Related Use Cases
168
+
169
+ - Setting up organization for a new computer
170
+ - Preparing files for backup/archiving
171
+ - Cleaning up before storage cleanup
172
+ - Organizing shared team folders
173
+ - Structuring new project directories
@@ -210,68 +210,7 @@ pdftk input.pdf rotate 1east output rotated.pdf
210
210
 
211
211
  ## Common Tasks
212
212
 
213
- ### Extract Text from Scanned PDFs
214
- ```python
215
- # Requires: pip install pytesseract pdf2image
216
- import pytesseract
217
- from pdf2image import convert_from_path
218
-
219
- # Convert PDF to images
220
- images = convert_from_path('scanned.pdf')
221
-
222
- # OCR each page
223
- text = ""
224
- for i, image in enumerate(images):
225
- text += f"Page {i+1}:\n"
226
- text += pytesseract.image_to_string(image)
227
- text += "\n\n"
228
-
229
- print(text)
230
- ```
231
-
232
- ### Add Watermark
233
- ```python
234
- from pypdf import PdfReader, PdfWriter
235
-
236
- # Create watermark (or load existing)
237
- watermark = PdfReader("watermark.pdf").pages[0]
238
-
239
- # Apply to all pages
240
- reader = PdfReader("document.pdf")
241
- writer = PdfWriter()
242
-
243
- for page in reader.pages:
244
- page.merge_page(watermark)
245
- writer.add_page(page)
246
-
247
- with open("watermarked.pdf", "wb") as output:
248
- writer.write(output)
249
- ```
250
-
251
- ### Extract Images
252
- ```bash
253
- # Using pdfimages (poppler-utils)
254
- pdfimages -j input.pdf output_prefix
255
-
256
- # This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.
257
- ```
258
-
259
- ### Password Protection
260
- ```python
261
- from pypdf import PdfReader, PdfWriter
262
-
263
- reader = PdfReader("input.pdf")
264
- writer = PdfWriter()
265
-
266
- for page in reader.pages:
267
- writer.add_page(page)
268
-
269
- # Add password
270
- writer.encrypt("userpassword", "ownerpassword")
271
-
272
- with open("encrypted.pdf", "wb") as output:
273
- writer.write(output)
274
- ```
213
+ OCR on scanned PDFs, adding a watermark, extracting embedded images, and basic password protection: [`reference.md`](reference.md#common-quick-tasks).
275
214
 
276
215
  ## Quick Reference
277
216
 
@@ -2,6 +2,71 @@
2
2
 
3
3
  This document contains advanced PDF processing features, detailed examples, and additional libraries not covered in the main skill instructions.
4
4
 
5
+ ## Common Quick Tasks
6
+
7
+ ### Extract Text from Scanned PDFs
8
+ ```python
9
+ # Requires: pip install pytesseract pdf2image
10
+ import pytesseract
11
+ from pdf2image import convert_from_path
12
+
13
+ # Convert PDF to images
14
+ images = convert_from_path('scanned.pdf')
15
+
16
+ # OCR each page
17
+ text = ""
18
+ for i, image in enumerate(images):
19
+ text += f"Page {i+1}:\n"
20
+ text += pytesseract.image_to_string(image)
21
+ text += "\n\n"
22
+
23
+ print(text)
24
+ ```
25
+
26
+ ### Add Watermark
27
+ ```python
28
+ from pypdf import PdfReader, PdfWriter
29
+
30
+ # Create watermark (or load existing)
31
+ watermark = PdfReader("watermark.pdf").pages[0]
32
+
33
+ # Apply to all pages
34
+ reader = PdfReader("document.pdf")
35
+ writer = PdfWriter()
36
+
37
+ for page in reader.pages:
38
+ page.merge_page(watermark)
39
+ writer.add_page(page)
40
+
41
+ with open("watermarked.pdf", "wb") as output:
42
+ writer.write(output)
43
+ ```
44
+
45
+ ### Extract Images
46
+ ```bash
47
+ # Using pdfimages (poppler-utils)
48
+ pdfimages -j input.pdf output_prefix
49
+
50
+ # This extracts all images as output_prefix-000.jpg, output_prefix-001.jpg, etc.
51
+ ```
52
+
53
+ ### Password Protection
54
+ ```python
55
+ from pypdf import PdfReader, PdfWriter
56
+
57
+ reader = PdfReader("input.pdf")
58
+ writer = PdfWriter()
59
+
60
+ for page in reader.pages:
61
+ writer.add_page(page)
62
+
63
+ # Add password
64
+ writer.encrypt("userpassword", "ownerpassword")
65
+
66
+ with open("encrypted.pdf", "wb") as output:
67
+ writer.write(output)
68
+ ```
69
+
5
70
  ## pypdfium2 Library (Apache/BSD License)
6
71
 
7
72
  ### Overview
@@ -147,54 +147,7 @@ python scripts/validate_pdf.py input.pdf
147
147
 
148
148
  ## Common workflows
149
149
 
150
- ### Workflow 1: Process form submissions
151
-
152
- ```bash
153
- # 1. Analyze form structure
154
- python scripts/analyze_form.py template.pdf --output schema.json
155
-
156
- # 2. Validate submission data
157
- python scripts/validate_form.py submission.json schema.json
158
-
159
- # 3. Fill form
160
- python scripts/fill_form.py template.pdf submission.json completed.pdf
161
-
162
- # 4. Validate output
163
- python scripts/validate_pdf.py completed.pdf
164
- ```
165
-
166
- ### Workflow 2: Extract data from reports
167
-
168
- ```bash
169
- # 1. Extract tables
170
- python scripts/extract_tables.py monthly_report.pdf --output data.csv
171
-
172
- # 2. Extract text for analysis
173
- python scripts/extract_text.py monthly_report.pdf --output report.txt
174
- ```
175
-
176
- ### Workflow 3: Batch processing
177
-
178
- ```python
179
- import glob
180
- from pathlib import Path
181
- import subprocess
182
-
183
- # Process all PDFs in directory
184
- for pdf_file in glob.glob("invoices/*.pdf"):
185
- output_file = Path("processed") / Path(pdf_file).name
186
-
187
- result = subprocess.run([
188
- "python", "scripts/extract_text.py",
189
- pdf_file,
190
- "--output", str(output_file)
191
- ], capture_output=True)
192
-
193
- if result.returncode == 0:
194
- print(f"✓ Processed: {pdf_file}")
195
- else:
196
- print(f"✗ Failed: {pdf_file} - {result.stderr}")
197
- ```
150
+ Three worked workflows (form submissions, report data extraction, batch processing): [`workflows-and-troubleshooting.md`](workflows-and-troubleshooting.md#common-workflows).
198
151
 
199
152
  ## Error handling
200
153
 
@@ -255,31 +208,7 @@ Optional for OCR:
255
208
 
256
209
  ## Troubleshooting
257
210
 
258
- ### Common issues
259
-
260
- **"Module not found" errors**:
261
- ```bash
262
- pip install -r requirements.txt
263
- ```
264
-
265
- **Tesseract not found**:
266
- ```bash
267
- # Install tesseract system package (see Dependencies)
268
- ```
269
-
270
- **Memory errors with large PDFs**:
271
- ```python
272
- # Process page by page instead of loading entire PDF
273
- with pdfplumber.open("large.pdf") as pdf:
274
- for page in pdf.pages:
275
- text = page.extract_text()
276
- # Process page immediately
277
- ```
278
-
279
- **Permission errors**:
280
- ```bash
281
- chmod +x scripts/*.py
282
- ```
211
+ Common issues (missing modules, tesseract not found, memory errors on large PDFs, permission errors) and fixes: [`workflows-and-troubleshooting.md`](workflows-and-troubleshooting.md#troubleshooting).
283
212
 
284
213
  ## Getting help
285
214
 
@@ -0,0 +1,80 @@
1
+ # PDF Processing Pro — Common Workflows and Troubleshooting
2
+
3
+ ## Common workflows
4
+
5
+ ### Workflow 1: Process form submissions
6
+
7
+ ```bash
8
+ # 1. Analyze form structure
9
+ python scripts/analyze_form.py template.pdf --output schema.json
10
+
11
+ # 2. Validate submission data
12
+ python scripts/validate_form.py submission.json schema.json
13
+
14
+ # 3. Fill form
15
+ python scripts/fill_form.py template.pdf submission.json completed.pdf
16
+
17
+ # 4. Validate output
18
+ python scripts/validate_pdf.py completed.pdf
19
+ ```
20
+
21
+ ### Workflow 2: Extract data from reports
22
+
23
+ ```bash
24
+ # 1. Extract tables
25
+ python scripts/extract_tables.py monthly_report.pdf --output data.csv
26
+
27
+ # 2. Extract text for analysis
28
+ python scripts/extract_text.py monthly_report.pdf --output report.txt
29
+ ```
30
+
31
+ ### Workflow 3: Batch processing
32
+
33
+ ```python
34
+ import glob
35
+ from pathlib import Path
36
+ import subprocess
37
+
38
+ # Process all PDFs in directory
39
+ for pdf_file in glob.glob("invoices/*.pdf"):
40
+ output_file = Path("processed") / Path(pdf_file).name
41
+
42
+ result = subprocess.run([
43
+ "python", "scripts/extract_text.py",
44
+ pdf_file,
45
+ "--output", str(output_file)
46
+ ], capture_output=True)
47
+
48
+ if result.returncode == 0:
49
+ print(f"✓ Processed: {pdf_file}")
50
+ else:
51
+ print(f"✗ Failed: {pdf_file} - {result.stderr}")
52
+ ```
53
+
54
+ ## Troubleshooting
55
+
56
+ ### Common issues
57
+
58
+ **"Module not found" errors**:
59
+ ```bash
60
+ pip install -r requirements.txt
61
+ ```
62
+
63
+ **Tesseract not found**:
64
+ ```bash
65
+ # Install tesseract system package (see Dependencies)
66
+ ```
67
+
68
+ **Memory errors with large PDFs**:
69
+ ```python
70
+ # Process page by page instead of loading entire PDF
71
+ with pdfplumber.open("large.pdf") as pdf:
72
+ for page in pdf.pages:
73
+ text = page.extract_text()
74
+ # Process page immediately
75
+ ```
76
+
77
+ **Permission errors**:
78
+ ```bash
79
+ chmod +x scripts/*.py
80
+ ```