@simplysm/sd-claude 13.0.83 → 13.0.85
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.
- package/claude/rules/sd-claude-rules.md +12 -6
- package/claude/rules/sd-library-issue.md +7 -0
- package/claude/rules/sd-simplysm-usage.md +5 -5
- package/claude/sd-statusline.py +5 -2
- package/claude/skills/sd-api-review/SKILL.md +49 -53
- package/claude/skills/sd-check/SKILL.md +45 -41
- package/claude/skills/sd-commit/SKILL.md +31 -31
- package/claude/skills/sd-debug/SKILL.md +77 -68
- package/claude/skills/sd-document/SKILL.md +56 -56
- package/claude/skills/sd-document/__pycache__/_common.cpython-313.pyc +0 -0
- package/claude/skills/sd-email-analyze/SKILL.md +22 -22
- package/claude/skills/sd-init/SKILL.md +63 -63
- package/claude/skills/sd-plan/SKILL.md +127 -66
- package/claude/skills/sd-readme/SKILL.md +59 -59
- package/claude/skills/sd-review/SKILL.md +42 -35
- package/claude/skills/sd-simplify/SKILL.md +37 -30
- package/package.json +4 -1
- package/scripts/cli.mjs +12 -0
- package/scripts/postinstall.mjs +20 -4
|
@@ -1,113 +1,122 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sd-debug
|
|
3
|
-
description:
|
|
3
|
+
description: Used when requesting "debug", "sd-debug", "error analysis", "error cause", "find bug", etc.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# SD Debug —
|
|
6
|
+
# SD Debug — Root Cause Analysis and Resolution Planning
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Receives error messages, stack traces, or problem descriptions, performs in-depth codebase analysis to diagnose the root cause, and formulates a resolution plan via the `/sd-plan` process.
|
|
9
9
|
|
|
10
|
-
ARGUMENTS:
|
|
10
|
+
ARGUMENTS: Error message, stack trace, or problem description (optional). If not provided, the skill infers from the conversation context or asks the user.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
## Step 1:
|
|
14
|
+
## Step 1: Gather Problem Information
|
|
15
15
|
|
|
16
|
-
-
|
|
17
|
-
1. **ARGUMENTS**:
|
|
18
|
-
2.
|
|
19
|
-
3. **AskUserQuestion**:
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
16
|
+
- Gather problem information in the following priority order:
|
|
17
|
+
1. **ARGUMENTS**: Error message, stack trace, or problem description passed along with the skill invocation
|
|
18
|
+
2. **Current conversation**: If no ARGUMENTS are provided, identify error messages, logs, or problem context from the current conversation
|
|
19
|
+
3. **AskUserQuestion**: If neither of the above yields sufficient information, ask: "What problem would you like to debug? Please provide an error message, stack trace, or describe the issue."
|
|
20
|
+
- Extract the following from the gathered problem information:
|
|
21
|
+
- **Error type**: Compilation error / runtime error / type error / logic error / build error / unexpected behavior, etc.
|
|
22
|
+
- **Related clues**: Keywords useful for codebase exploration, such as file paths, function names, line numbers, package names, error codes, etc.
|
|
23
23
|
|
|
24
|
-
## Step 2:
|
|
24
|
+
## Step 2: In-Depth Codebase Analysis
|
|
25
25
|
|
|
26
|
-
Step 1
|
|
26
|
+
Based on the problem information and clues gathered in Step 1, autonomously determine and perform the investigation needed to identify the root cause of the problem. Use the Agent tool (subagent_type: Explore) to explore the codebase, deciding the scope and method of investigation freely based on the nature of the problem.
|
|
27
27
|
|
|
28
|
-
###
|
|
28
|
+
### Analysis Principles
|
|
29
29
|
|
|
30
|
-
>
|
|
30
|
+
> **Key rule**: Do not propose solutions until you fully understand the root cause. Always follow the order: "Analyze -> Understand -> Solve."
|
|
31
31
|
|
|
32
|
-
1.
|
|
33
|
-
2.
|
|
34
|
-
3.
|
|
35
|
-
4.
|
|
32
|
+
1. **Understand intended behavior first**: Before analyzing the bug, first understand what the problematic code is *supposed* to do. Read the surrounding context, callers, and tests to grasp the original intent. Document this intended behavior explicitly — it becomes the baseline that any fix must preserve.
|
|
33
|
+
2. **No speculative fixes**: Do not attempt to find the cause through trial-and-error by modifying code and checking results. Read the code and trace the logic to identify the cause.
|
|
34
|
+
3. **No workarounds**: Do not propose solutions that mask symptoms, such as `as` type assertions, `any`, `// @ts-ignore`, hardcoding, or swallowing exceptions (ignoring after `catch`).
|
|
35
|
+
4. **Test failure triage**: When tests fail, first compare the intended behavior the test validates against the code's actual behavior. If the behavior change was intentional, update the test; if unintentional, fix the code. If intent cannot be determined, ask the user.
|
|
36
|
+
5. **Distinguish symptoms from causes**: The point where the error message appears may not be the actual cause. Trace back from the error location to find the real cause.
|
|
36
37
|
|
|
37
|
-
###
|
|
38
|
+
### Organize Analysis Results
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
40
|
+
Once the analysis is complete, organize the following items:
|
|
41
|
+
- **Intended behavior**: What the problematic code is supposed to do (the baseline that must be preserved)
|
|
42
|
+
- **Error location**: The specific code location where the problem occurs (file_path:line)
|
|
43
|
+
- **Root cause**: Analysis of why this problem occurs
|
|
44
|
+
- **Impact scope**: List of files/functions affected by this problem
|
|
45
|
+
- **Resolution options**: Possible solutions (including target files for each)
|
|
44
46
|
|
|
45
|
-
## Step 3:
|
|
47
|
+
## Step 3: Consolidate Diagnosis and User Confirmation
|
|
46
48
|
|
|
47
|
-
Step 2
|
|
49
|
+
Consolidate the analysis results from Step 2 into a diagnostic report in the format below and present it to the user:
|
|
48
50
|
|
|
49
51
|
```
|
|
50
|
-
##
|
|
52
|
+
## Diagnosis Results
|
|
51
53
|
|
|
52
|
-
###
|
|
53
|
-
|
|
54
|
+
### Problem Summary
|
|
55
|
+
<Summarize the error/problem in one sentence>
|
|
54
56
|
|
|
55
|
-
###
|
|
56
|
-
|
|
57
|
+
### Intended Behavior
|
|
58
|
+
<Describe what the problematic code is supposed to do. This is the baseline — any fix must preserve this behavior.>
|
|
57
59
|
|
|
58
|
-
###
|
|
59
|
-
|
|
60
|
-
- <영향받는 파일/함수 2>
|
|
60
|
+
### Root Cause
|
|
61
|
+
<Explain the root cause clearly and specifically. Include file paths and line numbers.>
|
|
61
62
|
|
|
62
|
-
###
|
|
63
|
+
### Impact Scope
|
|
64
|
+
- <Affected file/function 1>
|
|
65
|
+
- <Affected file/function 2>
|
|
63
66
|
|
|
64
|
-
|
|
65
|
-
- 수정 대상: <파일 경로 목록>
|
|
66
|
-
- 장점: ...
|
|
67
|
-
- 단점: ...
|
|
67
|
+
### Resolution Options
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
69
|
+
1. **<Option 1 title>**: <Description>
|
|
70
|
+
- Target files: <List of file paths>
|
|
71
|
+
- Behavioral change: <Does this change any existing behavior? "None — preserves intended behavior" or describe what changes>
|
|
72
|
+
- Pros: ...
|
|
73
|
+
- Cons: ...
|
|
73
74
|
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
2. **<Option 2 title>**: <Description> (if applicable)
|
|
76
|
+
- Target files: <List of file paths>
|
|
77
|
+
- Behavioral change: <Does this change any existing behavior? "None — preserves intended behavior" or describe what changes>
|
|
78
|
+
- Pros: ...
|
|
79
|
+
- Cons: ...
|
|
80
|
+
|
|
81
|
+
### Recommended Option
|
|
82
|
+
<The most appropriate option and the reasoning>
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
|
|
85
|
+
After outputting the diagnostic report, ask the following via AskUserQuestion:
|
|
79
86
|
|
|
80
87
|
```
|
|
81
|
-
|
|
82
|
-
1.
|
|
83
|
-
2.
|
|
84
|
-
3.
|
|
88
|
+
Please review the diagnosis results.
|
|
89
|
+
1. The diagnosis is accurate — proceed with the recommended option
|
|
90
|
+
2. The diagnosis is accurate, but proceed with a different option (specify number)
|
|
91
|
+
3. The diagnosis is inaccurate — I will provide additional information
|
|
85
92
|
```
|
|
86
93
|
|
|
87
|
-
- **1
|
|
88
|
-
- **2
|
|
89
|
-
- **3
|
|
94
|
+
- **Option 1 selected**: Proceed to Step 4 based on the recommended option.
|
|
95
|
+
- **Option 2 selected**: Proceed to Step 4 based on the option specified by the user.
|
|
96
|
+
- **Option 3 selected**: Return to Step 2 incorporating the additional information provided by the user.
|
|
90
97
|
|
|
91
|
-
## Step 4: sd-plan
|
|
98
|
+
## Step 4: Formulate Resolution Plan via sd-plan
|
|
92
99
|
|
|
93
|
-
|
|
100
|
+
Using the user-confirmed diagnosis and the selected resolution option as the task description, invoke `sd-plan` via the Skill tool. Pass the following in args:
|
|
94
101
|
|
|
95
102
|
```
|
|
96
|
-
|
|
103
|
+
Formulate a plan to implement the resolution based on the following debugging diagnosis:
|
|
97
104
|
|
|
98
|
-
##
|
|
99
|
-
<Step 3
|
|
105
|
+
## Problem
|
|
106
|
+
<Problem summary from Step 3>
|
|
100
107
|
|
|
101
|
-
##
|
|
102
|
-
<Step 3
|
|
108
|
+
## Root Cause
|
|
109
|
+
<Root cause from Step 3>
|
|
103
110
|
|
|
104
|
-
##
|
|
105
|
-
|
|
111
|
+
## Resolution
|
|
112
|
+
<Detailed content of the resolution option selected by the user>
|
|
106
113
|
|
|
107
|
-
##
|
|
108
|
-
|
|
114
|
+
## Target Files
|
|
115
|
+
<List of target file paths from the resolution option>
|
|
109
116
|
```
|
|
110
117
|
|
|
111
|
-
## Step 5:
|
|
118
|
+
## Step 5: Execute the Plan
|
|
119
|
+
|
|
120
|
+
Once sd-plan completes and produces a finalized plan, modify the code according to that plan.
|
|
112
121
|
|
|
113
|
-
|
|
122
|
+
After applying the fix, verify that the intended behavior documented in Step 2 is preserved. Review the changes and confirm they correct the defect without altering what the code is supposed to do.
|
|
@@ -1,109 +1,109 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sd-document
|
|
3
|
-
description:
|
|
3
|
+
description: Used when requesting "read/analyze documents", "extract file content", "create DOCX/XLSX", "review customer documents", or "export data" related to .docx, .xlsx, .pptx, .pdf files.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# SD Document —
|
|
6
|
+
# SD Document — Read/Write Document Files
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Reads or writes document files (.docx/.xlsx/.pptx/.pdf) using Python scripts. When reading, extracts text and images along with positional information, saves images to files, and analyzes them with Claude Read.
|
|
9
9
|
|
|
10
|
-
ARGUMENTS:
|
|
10
|
+
ARGUMENTS: Document file path (required). Specify a `.docx`, `.xlsx`, `.pptx`, or `.pdf` file path.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
## Step 1:
|
|
14
|
+
## Step 1: Determine Task Direction
|
|
15
15
|
|
|
16
|
-
ARGUMENTS
|
|
16
|
+
Extract the file path from ARGUMENTS and determine whether the user's request is **read** (analyze/extract) or **write** (create/edit).
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
18
|
+
- **Read** → Go to Step 2
|
|
19
|
+
- **Write** → Go to Step 4
|
|
20
20
|
|
|
21
|
-
###
|
|
21
|
+
### Format Support Matrix
|
|
22
22
|
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
| DOCX |
|
|
26
|
-
| XLSX |
|
|
27
|
-
| PPTX |
|
|
28
|
-
| PDF |
|
|
23
|
+
| Format | Read | Write | Library |
|
|
24
|
+
|--------|------|-------|---------|
|
|
25
|
+
| DOCX | Supported | Supported | `python-docx` |
|
|
26
|
+
| XLSX | Supported | Supported | `openpyxl`, `pandas` |
|
|
27
|
+
| PPTX | Supported | Not supported | `python-pptx` |
|
|
28
|
+
| PDF | Supported | Not supported | `pdfplumber`, `pypdf` |
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
Missing packages are automatically installed on first script execution.
|
|
31
31
|
|
|
32
|
-
## Step 2:
|
|
32
|
+
## Step 2: Read Document (Run Extraction Script)
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Run the extraction script matching the file extension:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
python .claude/skills/sd-document/extract_docx.py
|
|
38
|
-
python .claude/skills/sd-document/extract_xlsx.py
|
|
39
|
-
python .claude/skills/sd-document/extract_pptx.py
|
|
40
|
-
python .claude/skills/sd-document/extract_pdf.py
|
|
37
|
+
python .claude/skills/sd-document/extract_docx.py <file_path>
|
|
38
|
+
python .claude/skills/sd-document/extract_xlsx.py <file_path>
|
|
39
|
+
python .claude/skills/sd-document/extract_pptx.py <file_path>
|
|
40
|
+
python .claude/skills/sd-document/extract_pdf.py <file_path>
|
|
41
41
|
```
|
|
42
42
|
|
|
43
|
-
###
|
|
44
|
-
- **stdout**:
|
|
45
|
-
-
|
|
43
|
+
### Output
|
|
44
|
+
- **stdout**: Text and positional information (Markdown format)
|
|
45
|
+
- **Image files**: Saved to `<filename>_files/` directory
|
|
46
46
|
|
|
47
|
-
###
|
|
47
|
+
### Positional Information
|
|
48
48
|
|
|
49
|
-
|
|
|
50
|
-
|
|
51
|
-
| DOCX |
|
|
52
|
-
| XLSX |
|
|
53
|
-
| PPTX |
|
|
54
|
-
| PDF |
|
|
49
|
+
| Format | Position Representation |
|
|
50
|
+
|--------|----------------------|
|
|
51
|
+
| DOCX | Paragraph flow order (text-image inline) |
|
|
52
|
+
| XLSX | Cell position (A1, B2, etc.) |
|
|
53
|
+
| PPTX | Shape left/top coordinates (inches) + slide number |
|
|
54
|
+
| PDF | Page number |
|
|
55
55
|
|
|
56
|
-
## Step 3:
|
|
56
|
+
## Step 3: Analyze Extraction Results
|
|
57
57
|
|
|
58
|
-
Step 2
|
|
58
|
+
Check the extracted file paths from Step 2 output and perform the following:
|
|
59
59
|
|
|
60
|
-
1.
|
|
61
|
-
2.
|
|
60
|
+
1. **Images**: Open each image saved in the `_files/` directory with the **Read** tool for visual analysis
|
|
61
|
+
2. **Text**: Analyze/summarize the text output to stdout according to the user's request
|
|
62
62
|
|
|
63
|
-
## Step 4:
|
|
63
|
+
## Step 4: Write Document
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Write a Python script to create or edit documents according to the user's request.
|
|
66
66
|
|
|
67
67
|
### DOCX (`python-docx`)
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
For email templates and simple reports.
|
|
70
70
|
|
|
71
71
|
```python
|
|
72
72
|
from docx import Document
|
|
73
73
|
|
|
74
|
-
doc = Document() #
|
|
75
|
-
# doc = Document("existing.docx") #
|
|
76
|
-
doc.add_heading("
|
|
77
|
-
doc.add_paragraph("
|
|
74
|
+
doc = Document() # New document
|
|
75
|
+
# doc = Document("existing.docx") # Edit existing document
|
|
76
|
+
doc.add_heading("Title", level=1)
|
|
77
|
+
doc.add_paragraph("Body content")
|
|
78
78
|
table = doc.add_table(rows=2, cols=3)
|
|
79
|
-
table.cell(0, 0).text = "
|
|
79
|
+
table.cell(0, 0).text = "Item"
|
|
80
80
|
doc.save("output.docx")
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
Edit existing document: Open with `Document("existing.docx")` and replace `paragraph.text`, modify `table.cell().text`.
|
|
84
84
|
|
|
85
85
|
### XLSX (`openpyxl`)
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
Data and formula focused. Formatting (colors, borders) is not required.
|
|
88
88
|
|
|
89
89
|
```python
|
|
90
90
|
from openpyxl import Workbook
|
|
91
91
|
|
|
92
92
|
wb = Workbook()
|
|
93
93
|
ws = wb.active
|
|
94
|
-
ws["A1"] = "
|
|
95
|
-
ws["B1"] = "
|
|
96
|
-
ws.append(["
|
|
97
|
-
ws.append(["
|
|
94
|
+
ws["A1"] = "Item"
|
|
95
|
+
ws["B1"] = "Quantity"
|
|
96
|
+
ws.append(["Apple", 10])
|
|
97
|
+
ws.append(["Pear", 20])
|
|
98
98
|
ws["B4"] = "=SUM(B2:B3)"
|
|
99
99
|
wb.save("output.xlsx")
|
|
100
100
|
```
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
pandas DataFrame
|
|
102
|
+
Edit existing file: Open with `load_workbook("existing.xlsx")` and modify.
|
|
103
|
+
Export pandas DataFrame: `df.to_excel("output.xlsx", index=False)`
|
|
104
104
|
|
|
105
|
-
##
|
|
105
|
+
## Common Mistakes
|
|
106
106
|
|
|
107
|
-
-
|
|
108
|
-
-
|
|
109
|
-
- **XLSX data_only**: `load_workbook(data_only=True)
|
|
107
|
+
- **Character encoding**: Scripts have built-in UTF-8 handling, so always extract through scripts
|
|
108
|
+
- **Missing images**: After extraction, always read images in the `_files/` directory
|
|
109
|
+
- **XLSX data_only**: `load_workbook(data_only=True)` removes formulas — use `data_only=False` to preserve formulas
|
|
Binary file
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sd-email-analyze
|
|
3
|
-
description:
|
|
3
|
+
description: Used when requesting "email file analysis", "email content extraction", "attachment extraction", or "email summary" for .eml or .msg files.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# SD Email Analyze —
|
|
6
|
+
# SD Email Analyze — Email File Analysis and Content Extraction
|
|
7
7
|
|
|
8
|
-
`.eml`
|
|
8
|
+
Parses `.eml` and `.msg` (Outlook) email files to extract and analyze mail headers, body text, inline images, and attachments.
|
|
9
9
|
|
|
10
|
-
ARGUMENTS:
|
|
10
|
+
ARGUMENTS: Email file path (required). Specify a `.eml` or `.msg` file path.
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
## Step 1:
|
|
14
|
+
## Step 1: Parse the Email File
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
Extract the email file path from ARGUMENTS and run the following command:
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
python .claude/skills/sd-email-analyze/email-analyzer.py
|
|
19
|
+
python .claude/skills/sd-email-analyze/email-analyzer.py <email_file_path>
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
-
|
|
23
|
-
-
|
|
22
|
+
- On first run, `extract-msg` is automatically installed.
|
|
23
|
+
- The output is a markdown report printed to stdout, and extracted files are saved to the `<email_file_name>_files/` directory.
|
|
24
24
|
|
|
25
|
-
###
|
|
25
|
+
### Output Structure
|
|
26
26
|
|
|
27
|
-
1.
|
|
28
|
-
2.
|
|
29
|
-
3.
|
|
30
|
-
4.
|
|
27
|
+
1. **Mail Info Table**: Subject, From, To, CC, Date, Count
|
|
28
|
+
2. **Body Text**: Plain text (if plain text is unavailable, HTML tags are stripped)
|
|
29
|
+
3. **Inline Images**: Table of saved file paths
|
|
30
|
+
4. **Attachments**: Table of saved file paths
|
|
31
31
|
|
|
32
|
-
## Step 2:
|
|
32
|
+
## Step 2: Analyze Extracted Files
|
|
33
33
|
|
|
34
|
-
Step 1
|
|
34
|
+
Check the extracted file paths from the Step 1 output and perform the following:
|
|
35
35
|
|
|
36
|
-
1.
|
|
37
|
-
2.
|
|
36
|
+
1. **Inline Images**: Use the **Read** tool to view each saved path
|
|
37
|
+
2. **Attachments**: Use the **Read** tool (for images) or the **sd-document** skill script (for DOCX, XLSX, PPTX, PDF)
|
|
38
38
|
|
|
39
|
-
###
|
|
39
|
+
### Inline Image Processing
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Images are extracted from two sources:
|
|
42
42
|
|
|
43
|
-
1. **CID
|
|
44
|
-
2. **Data URI
|
|
43
|
+
1. **CID Images**: MIME parts with a Content-ID (referenced via `cid:` in HTML)
|
|
44
|
+
2. **Data URI Images**: Base64-encoded images within HTML (`data:image/...;base64,...`)
|