@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.
- package/bin/doufang-init.js +83 -38
- package/package.json +1 -1
package/bin/doufang-init.js
CHANGED
|
@@ -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/
|
|
123
|
-
const
|
|
124
|
-
if (!existsSync(
|
|
125
|
-
mkdirSync(
|
|
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.
|
|
129
|
-
const
|
|
130
|
-
const
|
|
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
|
-
|
|
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
|
|
164
|
+
## Step-by-Step Execution Guide
|
|
157
165
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
- **
|
|
170
|
-
- **
|
|
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
|
|
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
|
-
##
|
|
207
|
+
## Example: Complete Workflow
|
|
192
208
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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(
|
|
214
|
-
console.log(` β
Created ${
|
|
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.
|
|
220
|
-
console.log(' 2.
|
|
221
|
-
console.log(' 3.
|
|
222
|
-
console.log(' 4.
|
|
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.
|
|
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",
|