MCPcopy Create free account
hub / github.com/codeaashu/claude-code / getPromptForCommand

Function getPromptForCommand

src/skills/bundled/loremIpsum.ts:245–280  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

243 argumentHint: '[token_count]',
244 userInvocable: true,
245 async getPromptForCommand(args) {
246 const parsed = parseInt(args)
247
248 if (args && (isNaN(parsed) || parsed <= 0)) {
249 return [
250 {
251 type: 'text',
252 text: 'Invalid token count. Please provide a positive number (e.g., /lorem-ipsum 10000).',
253 },
254 ]
255 }
256
257 const targetTokens = parsed || 10000
258
259 // Cap at 500k tokens for safety
260 const cappedTokens = Math.min(targetTokens, 500_000)
261
262 if (cappedTokens < targetTokens) {
263 return [
264 {
265 type: 'text',
266 text: `Requested ${targetTokens} tokens, but capped at 500,000 for safety.\n\n${generateLoremIpsum(cappedTokens)}`,
267 },
268 ]
269 }
270
271 const loremText = generateLoremIpsum(cappedTokens)
272
273 // Just dump the lorem ipsum text into the conversation
274 return [
275 {
276 type: 'text',
277 text: loremText,
278 },
279 ]
280 },
281 })
282}
283

Callers

nothing calls this directly

Calls 1

generateLoremIpsumFunction · 0.85

Tested by

no test coverage detected