Prompt file imported from Antonio-Redondo/staywise-ai (
.github/prompts/new-skill.prompt.md). Fill in{{skillName}},{{purpose}},{{inputType}},{{outputType}},{{edgeCases}}before use. Copyright stays with the author.
/new-skill
Create a new pure-function skill following the "skills versus nodes" rule in .github/instructions/langgraph.instructions.md.
Before generating, verify all three conditions hold for this skill:
- It is a pure function (no I/O, no LLM, no env vars, no Date.now or Math.random unless seeded).
- It is unit-testable with fixture inputs and deterministic outputs.
- It would still make sense if the agent layer did not exist.
If any condition fails, stop and tell me this should be a node or a client, not a skill.
Generate two files:
-
src/skills/{{skillName}}.ts- Export a named function. No default export.
- Explicit type signature on the public surface.
- Early returns over nested conditionals.
- JSDoc comment above the function explaining the why, not the what.
-
tests/skills/{{skillName}}.test.ts- Vitest tests covering at least one happy path, one boundary case, and one rejection case.
- Inline fixtures, no shared test setup.
- One assertion per test where reasonable.
Purpose: {{purpose}}
Input type: {{inputType}}
Output type: {{outputType}}
Edge cases to cover in tests: {{edgeCases}}
Success criteria: pnpm test passes, pnpm typecheck passes, the skill is pure, and tests cover happy path plus edge cases.