@justin_666/square-couplets-master-skills 1.0.5 β†’ 1.0.8

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.
@@ -119,20 +119,28 @@ Skills are located in the \`skills/\` directory.
119
119
  writeFileSync(cursorRulesPath, cursorRules);
120
120
  console.log(` βœ… Created ${cursorRulesPath}`);
121
121
 
122
- // Create .cursor/rules directory for slash command
123
- const cursorRulesDir = join(projectPath, '.cursor', 'rules');
124
- if (!existsSync(cursorRulesDir)) {
125
- mkdirSync(cursorRulesDir, { recursive: true });
122
+ // Create .cursor/commands directory for Cursor Commands (preferred over rules)
123
+ const cursorCommandsDir = join(projectPath, '.cursor', 'commands');
124
+ if (!existsSync(cursorCommandsDir)) {
125
+ mkdirSync(cursorCommandsDir, { recursive: true });
126
126
  }
127
127
 
128
- // Create doufang.mdc rule file for slash command
129
- const doufangRulePath = join(cursorRulesDir, 'doufang.mdc');
130
- const doufangRule = `---
131
- description: Generate Chinese New Year Doufang artwork using Doufang Skills. Use /doufang command to generate prompts, images, or optimize prompts.
132
- globs:
133
- ---
128
+ // Create doufang.md command file for slash command
129
+ const doufangCommandPath = join(cursorCommandsDir, 'doufang.md');
130
+ const doufangCommand = `# Doufang Skills Command
134
131
 
135
- # Doufang Skills - Slash Command Handler
132
+ ## Description
133
+ Generate Chinese New Year Doufang artwork using Doufang Skills CLI commands.
134
+
135
+ ## CRITICAL RULES - READ FIRST
136
+
137
+ **🚨 NEVER CREATE SCRIPT FILES 🚨**
138
+ - **DO NOT** create any .js, .ts, .mjs, or any script files
139
+ - **DO NOT** write code to files
140
+ - **DO** execute CLI commands directly in the terminal
141
+ - The CLI commands are already installed and ready to use
142
+
143
+ ## How This Works
136
144
 
137
145
  You are a Doufang assistant. When the user uses the \`/doufang\` command or asks about Doufang functionality, follow these guidelines:
138
146
 
@@ -153,30 +161,82 @@ You are a Doufang assistant. When the user uses the \`/doufang\` command or asks
153
161
  - Optimizes prompts to reduce white margins and improve composition
154
162
  - Example: \`doufang-optimize "A prompt with wide margins..."\`
155
163
 
164
+ ## Step-by-Step Execution Guide
165
+
166
+ ### When User Says: "η”Ÿζˆθ²‘ε―ŒδΈ»ι‘Œηš„ prompt"
167
+ 1. Execute this command in terminal: \`doufang-prompt "貑富"\`
168
+ 2. Wait for JSON output
169
+ 3. Show the result to user
170
+
171
+ ### When User Says: "η”¨δΈŠθΏ° prompt η”Ÿζˆ 2K εœ–η‰‡"
172
+ 1. Extract the imagePrompt from previous output
173
+ 2. Execute this command in terminal: \`doufang-image "<imagePrompt>" gemini-3-pro-image-preview 2K\`
174
+ 3. Wait for image to be saved
175
+ 4. Show the file path to user
176
+
177
+ ### When User Says: "ε„ͺεŒ–ι€™ε€‹ prompt"
178
+ 1. Execute this command in terminal: \`doufang-optimize "<prompt>"\`
179
+ 2. Wait for optimized prompt
180
+ 3. Show the result to user
181
+
156
182
  ## Execution Guidelines
157
183
 
158
- - **Direct CLI Execution**: When user requests Doufang functionality, directly execute the appropriate CLI command using terminal, do NOT create .js files
159
- - **Read API Key**: Automatically read GEMINI_API_KEY from .env or .env.local file
160
- - **Ask for Details**: If user doesn't provide required parameters (like keyword or prompt), ask for clarification
184
+ - **Use Terminal Command Execution**: Use the run_terminal_cmd tool to execute commands
185
+ - **No Script Creation**: You must NOT create any files. Just execute the CLI commands.
186
+ - **API Key**: Commands automatically read GEMINI_API_KEY from .env or .env.local
161
187
  - **Error Handling**: If API key is missing, guide user to set GEMINI_API_KEY in .env file
162
- - **Output Format**: For prompt generation, output JSON format. For image generation, save to output/ directory and provide file path
188
+ - **Output**: Commands output JSON or save files to output/ directory
163
189
 
164
190
  ## Common Workflows
165
191
 
166
192
  ### Generate Image from Keyword
167
- 1. Generate prompt: \`doufang-prompt "貑富"\`
193
+ 1. Execute: \`doufang-prompt "貑富"\` (directly in terminal, no script creation)
168
194
  2. Extract imagePrompt from JSON output
169
- 3. Generate image: \`doufang-image "<imagePrompt>" gemini-3-pro-image-preview 2K\`
195
+ 3. Execute: \`doufang-image "<imagePrompt>" gemini-3-pro-image-preview 2K\` (directly in terminal, no script creation)
170
196
 
171
197
  ### Generate Image with Reference
172
- 1. Generate prompt with reference: \`doufang-prompt "ε₯εΊ·" images/reference.png\`
198
+ 1. Execute: \`doufang-prompt "ε₯εΊ·" images/reference.png\` (directly in terminal)
173
199
  2. Extract imagePrompt from JSON output
174
- 3. Generate image: \`doufang-image "<imagePrompt>" gemini-3-pro-image-preview 2K images/reference.png\`
200
+ 3. Execute: \`doufang-image "<imagePrompt>" gemini-3-pro-image-preview 2K images/reference.png\` (directly in terminal)
175
201
 
176
202
  ### Optimize and Generate
177
- 1. Generate prompt: \`doufang-prompt "貑富"\`
178
- 2. Optimize prompt: \`doufang-optimize "<imagePrompt>"\`
179
- 3. Generate image with optimized prompt: \`doufang-image "<optimizedPrompt>" gemini-3-pro-image-preview 2K\`
203
+ 1. Execute: \`doufang-prompt "貑富"\` (directly in terminal)
204
+ 2. Execute: \`doufang-optimize "<imagePrompt>"\` (directly in terminal)
205
+ 3. Execute: \`doufang-image "<optimizedPrompt>" gemini-3-pro-image-preview 2K\` (directly in terminal)
206
+
207
+ ## Example: Complete Workflow
208
+
209
+ \`\`\`
210
+ User: /doufang η”ŸζˆδΈ€ε€‹θ²‘ε―ŒδΈ»ι‘Œηš„ 2K εœ–η‰‡
211
+
212
+ Your Action:
213
+ Step 1: Execute in terminal
214
+ $ doufang-prompt "貑富"
215
+ [Wait for output]
216
+
217
+ Step 2: Extract imagePrompt from JSON output, then execute in terminal
218
+ $ doufang-image "<extracted-imagePrompt>" gemini-3-pro-image-preview 2K
219
+ [Wait for image to be saved]
220
+
221
+ Step 3: Tell user the image path
222
+ \`\`\`
223
+
224
+ ## FINAL REMINDERS
225
+
226
+ βœ… DO:
227
+ - Execute: \`doufang-prompt "keyword"\`
228
+ - Execute: \`doufang-image "prompt" model size\`
229
+ - Execute: \`doufang-optimize "prompt"\`
230
+ - Use run_terminal_cmd tool
231
+
232
+ ❌ DO NOT:
233
+ - Create .js files
234
+ - Create .ts files
235
+ - Create any script files
236
+ - Write code to files
237
+ - Use write tool or edit tool
238
+
239
+ The commands are already installed. Just run them!
180
240
 
181
241
  ## Skills Location
182
242
 
@@ -192,16 +252,19 @@ The \`generate-doufang-image\` command requires GEMINI_API_KEY. Check for it in:
192
252
  Get API key from: https://aistudio.google.com/
193
253
  `;
194
254
 
195
- writeFileSync(doufangRulePath, doufangRule);
196
- console.log(` βœ… Created ${doufangRulePath}`);
197
- console.log(` βœ… Slash command /doufang registered in Cursor`);
255
+ writeFileSync(doufangCommandPath, doufangCommand);
256
+ console.log(` βœ… Created ${doufangCommandPath}`);
257
+ console.log(` βœ… Slash command /doufang registered in Cursor Commands`);
198
258
 
199
259
  console.log('\n✨ Cursor setup complete!');
200
260
  console.log('\nπŸ“ Usage:');
201
- console.log(' 1. Type "/" in Cursor chat to see available commands');
202
- console.log(' 2. Select "/doufang" from the dropdown');
203
- console.log(' 3. Enter your request, e.g.: "Generate a prompt for wealth theme"');
204
- console.log(' 4. Or directly type: /doufang Generate a prompt for wealth theme');
261
+ console.log(' 1. Restart Cursor to load the new command');
262
+ console.log(' 2. Type "/" in Cursor chat to see available commands');
263
+ console.log(' 3. Select "/doufang" from the dropdown');
264
+ console.log(' 4. Enter your request, e.g.: "Generate a prompt for wealth theme"');
265
+ console.log(' 5. Or directly type: /doufang Generate a prompt for wealth theme');
266
+ console.log('\n⚠️ IMPORTANT: The /doufang command will execute CLI commands directly.');
267
+ console.log(' It will NOT create any script files. Just run terminal commands.');
205
268
 
206
269
  return true;
207
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justin_666/square-couplets-master-skills",
3
- "version": "1.0.5",
3
+ "version": "1.0.8",
4
4
  "description": "Claude Agent Skills for generating Chinese New Year Doufang (diamond-shaped couplet) artwork using Google Gemini AI",
5
5
  "type": "module",
6
6
  "main": "bin/doufang-skills.js",
@@ -151,6 +151,12 @@ Error: Network connection error. Please check your internet connection and try a
151
151
 
152
152
  ## Implementation Notes
153
153
 
154
+ - **CRITICAL: Use CLI Command Directly**
155
+ - Execute: `doufang-image <prompt> [model] [size] [reference-image] [output-path]`
156
+ - **DO NOT create temporary .js, .ts, or any script files**
157
+ - **DO NOT write code** - just execute the CLI command directly
158
+ - The CLI command handles all API calls, error handling, and file operations automatically
159
+
154
160
  - Use retry mechanism for transient errors (500, 503, network errors)
155
161
  - Compress reference images if they exceed 500KB
156
162
  - Validate image formats (JPEG, PNG supported)
@@ -106,3 +106,11 @@ When user provides a keyword or wish phrase, generate a professional Doufang art
106
106
  - User already has a complete prompt
107
107
  - User wants to modify an existing prompt (use `optimize-doufang-prompt` instead)
108
108
  - User wants to generate the actual image (use `generate-doufang-image` instead)
109
+
110
+ ## Implementation Notes
111
+
112
+ - **CRITICAL: Use CLI Command Directly**
113
+ - Execute: `doufang-prompt <keyword> [reference-image]`
114
+ - **DO NOT create temporary .js, .ts, or any script files**
115
+ - **DO NOT write code** - just execute the CLI command directly
116
+ - The CLI command handles all API calls and returns JSON output automatically
@@ -152,3 +152,11 @@ This skill works best when:
152
152
  ## Output Format
153
153
 
154
154
  Return the optimized prompt as a string, maintaining all other aspects of the original prompt while only modifying the composition and margin-related instructions.
155
+
156
+ ## Implementation Notes
157
+
158
+ - **CRITICAL: Use CLI Command Directly**
159
+ - Execute: `doufang-optimize <prompt>`
160
+ - **DO NOT create temporary .js, .ts, or any script files**
161
+ - **DO NOT write code** - just execute the CLI command directly
162
+ - The CLI command handles prompt optimization and returns the optimized prompt automatically