@justin_666/square-couplets-master-skills 1.0.6 β†’ 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.
Files changed (2) hide show
  1. package/bin/doufang-init.js +83 -38
  2. package/package.json +1 -1
@@ -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,23 +161,31 @@ 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
 
156
- ## Execution Guidelines
164
+ ## Step-by-Step Execution Guide
157
165
 
158
- - **CRITICAL: Direct CLI Execution Only**:
159
- - When user requests Doufang functionality, you MUST directly execute the CLI command in the terminal
160
- - **NEVER create temporary .js, .ts, or any script files**
161
- - **NEVER write code to files** - just execute the command directly
162
- - Use the terminal/command execution tool to run: \`doufang-prompt\`, \`doufang-image\`, or \`doufang-optimize\`
163
-
164
- - **Command Execution Examples**:
165
- - User: "η”Ÿζˆθ²‘ε―ŒδΈ»ι‘Œηš„ prompt" β†’ Execute: \`doufang-prompt "貑富"\`
166
- - User: "η”¨δΈŠθΏ° prompt η”Ÿζˆ 2K εœ–η‰‡" β†’ Execute: \`doufang-image "<prompt>" gemini-3-pro-image-preview 2K\`
167
- - User: "ε„ͺεŒ–ι€™ε€‹ prompt" β†’ Execute: \`doufang-optimize "<prompt>"\`
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
+
182
+ ## Execution Guidelines
168
183
 
169
- - **Read API Key**: Automatically read GEMINI_API_KEY from .env or .env.local file (CLI commands handle this automatically)
170
- - **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
171
187
  - **Error Handling**: If API key is missing, guide user to set GEMINI_API_KEY in .env file
172
- - **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
173
189
 
174
190
  ## Common Workflows
175
191
 
@@ -188,13 +204,39 @@ You are a Doufang assistant. When the user uses the \`/doufang\` command or asks
188
204
  2. Execute: \`doufang-optimize "<imagePrompt>"\` (directly in terminal)
189
205
  3. Execute: \`doufang-image "<optimizedPrompt>" gemini-3-pro-image-preview 2K\` (directly in terminal)
190
206
 
191
- ## IMPORTANT REMINDERS
207
+ ## Example: Complete Workflow
192
208
 
193
- - **DO NOT** create any .js, .ts, .mjs, or script files
194
- - **DO NOT** write code to files
195
- - **DO** execute CLI commands directly using terminal/command execution
196
- - The CLI commands (\`doufang-prompt\`, \`doufang-image\`, \`doufang-optimize\`) are already installed and ready to use
197
- - Just run the commands - they handle everything automatically
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!
198
240
 
199
241
  ## Skills Location
200
242
 
@@ -210,16 +252,19 @@ The \`generate-doufang-image\` command requires GEMINI_API_KEY. Check for it in:
210
252
  Get API key from: https://aistudio.google.com/
211
253
  `;
212
254
 
213
- writeFileSync(doufangRulePath, doufangRule);
214
- console.log(` βœ… Created ${doufangRulePath}`);
215
- 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`);
216
258
 
217
259
  console.log('\n✨ Cursor setup complete!');
218
260
  console.log('\nπŸ“ Usage:');
219
- console.log(' 1. Type "/" in Cursor chat to see available commands');
220
- console.log(' 2. Select "/doufang" from the dropdown');
221
- console.log(' 3. Enter your request, e.g.: "Generate a prompt for wealth theme"');
222
- 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.');
223
268
 
224
269
  return true;
225
270
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justin_666/square-couplets-master-skills",
3
- "version": "1.0.6",
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",