config/ai/claude/skills/js-writer/SKILL.md
Use when writing or modifying JavaScript code. Apply when adding functions, fixing bugs, or implementing features.
npx skillsauth add pixelastic/oroshi js-writerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Write JavaScript code consistent with my conventions. Projects use firost for file I/O, golgoth for data utilities, and aberlaas for linting/testing/releasing.
Goal: Correct path and name.
Exit criterion: File exists at correct path with correct name.
lib/main.js as main entrypointlib/myFunction.js, exported by main.jshelpers folder can be used to group related internal methods__tests__ folder, sibling of the file it's testing.lib/
__tests__/
myFunction.js
myOtherFunction.js
helpers/
__tests__/
filesystem.js
git.js
filesystem.js
git.js
main.js
myFunction.js
myOtherFunction.js
Goal: Ensure the bug/feature has a failing test first
Exit criterion: Test fails.
Write a failing test for the bug or missing feature you want to implement.
yarn run test <filepath> to run the testsit.each when testing similar behavior with different inputstry/catch and let actual to test errorsit.each([
{
title: "Default path",
filepath: '/tmp/a',
options: {},
expected: 'a'
},
{
title: "Forced path",
filepath: '/tmp/b',
options: {
force: true
},
expected: 'b'
},
])('$title', async ({ filepath, options, expected }) => {
const actual = await myFn(filepath, options);
expect(actual).toEqual(expected);
});
Goal: Working code, following coding style.
Exit criterion: Test passes.
Write code that follows the following patterns:
| Pattern | Rule |
|---|---|
| Modules | ES6 import/export; named exports; .js extension; __ for private methods |
| Style | async/await; camelCase; minimal try/catch; lodash chains for 2+ ops; JSDoc on all fns |
| firost | File I/O and system operations |
| golgoth | Data transformation, dates, async utilities |
| aberlaas | Lint, test, release, etc |
import { formatEntry } from './formatEntry.js';
import { read, glob } from 'firost';
import { _ } from 'golgoth';
export let __;
/**
* List all entries in a directory, formatted
* @param {string} dirPath - Directory to scan
* @returns {string[]} Formatted entry names
*/
export async function listEntries(dirPath) {
const files = await __.findFiles(dirPath);
return _.chain(files)
.map((f) => formatEntry(f))
.compact()
.value();
}
__ = {
/**
* @param {string} dir
* @returns {string[]} Matching file paths
*/
findFiles(dir) {
return glob(`${dir}/**/*.js`);
},
};
Goal: Ensure code follows best practices.
Exit criterion: Lint passes.
Write code that passes automated lint.
yarn run lint:fix to automatically fix common issues and see remaining ones| Rationalization | Reality |
|---|---|
| "These comments are clutter, I'll clean them up" | Never remove existing comments |
| "mockResolvedValue is more idiomatic Vitest" | Always mockReturnValue(value) — abstract away sync/async |
| "expect().rejects.toThrow() is cleaner" | Use let actual = null + try/catch pattern |
lib/main.jsfor loop; _.each/_.map/pMap used instead.js extension on local imports__)yarn run lint:fix run after changestools
Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
tools
Break a plan, spec, or PRD into independently-grabbable issues using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.
documentation
Use when user says "sidequest" or "handoff" — compact conversation context into a document for a fresh agent to pick up.
development
Use when the user wants to nail down domain terms, resolve terminology ambiguities, or build a shared language for a module or repo. Drills vocabulary one question at a time and writes to the project GLOSSARY.md.