write-unit-tests
Skill by michaeldcanady
Writes or extends Go unit tests for the servicenow-sdk-go repository using a six-step, audit-first process. It is for developers who want table-driven testify tests that cover non-happy paths and edge-case inputs.
Install write-unit-tests
Built from the published package, never by AI.
git clone --depth 1 https://github.com/michaeldcanady/servicenow-sdk-go /tmp/servicenow-sdk-go && mkdir -p ~/.claude/skills && cp -r /tmp/servicenow-sdk-go/.agents/skills/write-unit-tests ~/.claude/skills/write-unit-testsRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/michaeldcanady/servicenow-sdk-go /tmp/servicenow-sdk-go && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/servicenow-sdk-go/.agents/skills/write-unit-tests ~/.gemini/antigravity-cli/skills/write-unit-testsAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
write-unit-tests is an agent skill that writes or extends Go unit tests for the servicenow-sdk-go repository. It follows a six-step process: audit the target code, map happy and non-happy paths, check and reconcile existing tests, write table-driven testify tests, then try to break the code with curveball inputs.
The skill works on one source file or one group of related functions at a time. It asks for sentinel-based error assertions with assert.ErrorIs, uses httpmock and internal/mocking, and reports any curveball that actually breaks the code instead of changing production logic. After writing, it runs go test and golangci-lint. It is aimed at contributors to this repository.
Written from the project's SKILL.md and checked against it.
What it can do
- Audit the code under testReads the source to find guards, branches, error returns and state the function depends on.
- Map happy and non-happy pathsLists each real path through a function, including nil, zero, adapter and deserialization failures.
- Check existing testsMaps existing test cases to paths and rewrites them into the repo's table-driven shape.
- Write table-driven testify testsAdds co-located _test.go tables using assert and require, with sentinel error checks.
- Try curveball inputsProbes boundary values, malformed input and cancelled contexts to find inputs that break the code.
- Report breaking behaviorDocuments known-bad cases in tests and reports failures rather than patching production code.
What you need
- Go
- golangci-lint
Try asking
- Write unit tests for the parser functions in this Go file
- Add table-driven tests to cover the error paths in this function
- Improve test coverage for the request builder in this package
Good to know
- Covers unit tests only, with co-located _test.go files and no build tags
- Integration and e2e suites are out of scope
- Designed for the servicenow-sdk-go repository and its conventions
- Does not silently fix production code it finds broken
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: .agents/skills/write-unit-tests/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Alternatives to write-unit-tests
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
write-unit-tests: common questions
Does this skill write integration tests?
No. The source says integration (tests/integration/) and e2e (tests/e2e/) suites are out of scope for this skill.
Will it fix bugs it finds while testing?
No. The source says that if a curveball breaks the code, the skill records the case and reports the failure so the user can decide on a fix.
How does it check error values in tests?
It asserts on sentinel identity with assert.ErrorIs rather than on error message text, following the repo's convention.
How do I install write-unit-tests?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is write-unit-tests free?
The code is published under the MIT licence. The service it connects to may have its own pricing.
Is write-unit-tests safe to use?
It scores 52 of 100. Grades: maintenance A, licence A, quality C. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to write-unit-tests?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
