{"_id":"@apoorvgarg31/test-architect","name":"@apoorvgarg31/test-architect","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@apoorvgarg31/test-architect","version":"1.0.0","description":"Claude Code skill for generating comprehensive tests via interactive Q&A","keywords":["claude-code","skill","testing","test-generation","jest","pytest","vitest","unit-tests","tdd"],"author":{"name":"Apoorv Garg"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/apoorvgarg31/claude-code-skills.git"},"scripts":{"build":"tsc","generate":"npx ts-node scripts/generate.ts"},"devDependencies":{"typescript":"^5.0.0","ts-node":"^10.9.0","@types/node":"^20.0.0"},"claude-skill":{"name":"test-architect","invocation":"/test-architect","tools":["Read","Glob","Grep","AskUserQuestion","Write","Edit"]},"_id":"@apoorvgarg31/test-architect@1.0.0","gitHead":"228a464c9af55292d1c1050e132b6e93a0e7f90f","bugs":{"url":"https://github.com/apoorvgarg31/claude-code-skills/issues"},"homepage":"https://github.com/apoorvgarg31/claude-code-skills#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-0Zp6upWa/OVb2uieV8KoQ1LJMX1zT8WTeAT4RpVR65VKW8q/Cg6rimC9NGiv/m3gFFQqLtiYij475/hbiZuXXA==","shasum":"add3524d6825d4e96c40857971ac98f2a47b769b","tarball":"https://registry.npmjs.org/@apoorvgarg31/test-architect/-/test-architect-1.0.0.tgz","fileCount":4,"unpackedSize":25283,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDYSkz+Xz34a874JWHmfpUy/YpoEcUbOEDxtkhxlQ8mkQIhAPekwyRwSLVWGavzkEBDmeZSzxQXMpbwh/VZkS8G67jZ"}]},"_npmUser":{"name":"apoorvgarg31","email":"apoorvgarg31@gmail.com"},"directories":{},"maintainers":[{"name":"apoorvgarg31","email":"apoorvgarg31@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/test-architect_1.0.0_1769985856961_0.04624309726181064"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-01T22:44:16.880Z","1.0.0":"2026-02-01T22:44:17.119Z","modified":"2026-02-01T22:44:17.346Z"},"maintainers":[{"name":"apoorvgarg31","email":"apoorvgarg31@gmail.com"}],"description":"Claude Code skill for generating comprehensive tests via interactive Q&A","homepage":"https://github.com/apoorvgarg31/claude-code-skills#readme","keywords":["claude-code","skill","testing","test-generation","jest","pytest","vitest","unit-tests","tdd"],"repository":{"type":"git","url":"git+https://github.com/apoorvgarg31/claude-code-skills.git"},"author":{"name":"Apoorv Garg"},"bugs":{"url":"https://github.com/apoorvgarg31/claude-code-skills/issues"},"license":"MIT","readme":"# test-architect\n\nA Claude Code skill for generating comprehensive tests via interactive Q&A conversation.\n\n## Features\n\n- **Code Analysis**: Automatically analyzes source files to identify functions, classes, and exports\n- **Interactive Q&A**: Asks clarifying questions about edge cases, error handling, and priorities\n- **Multi-Framework Support**: Generates tests for Jest, Vitest, or Pytest\n- **Smart Detection**: Auto-detects language and test framework from project configuration\n\n## Installation\n\n### As a Claude Code Skill\n\n```bash\nnpm install @apoorvgarp-31/test-architect\n```\n\nOr copy to your Claude skills directory:\n\n```bash\ncp -r test-architect ~/.claude/skills/\n```\n\n## Usage\n\nIn Claude Code, use the `/test-architect` command:\n\n```\n/test-architect src/utils/parser.ts\n/test-architect lib/auth.py --framework pytest\n/test-architect components/Button.tsx --framework vitest\n```\n\n### Options\n\n| Option | Description |\n|--------|-------------|\n| `--framework` | Test framework: `jest`, `vitest`, or `pytest` |\n| `--output` | Output test file path |\n\n### Direct Script Usage\n\n```bash\nnpx ts-node scripts/generate.ts src/utils/parser.ts\nnpx ts-node scripts/generate.ts lib/auth.py --framework pytest\nnpx ts-node scripts/generate.ts components/Button.tsx --output __tests__/Button.test.tsx\n```\n\n## How It Works\n\n### Phase 1: Code Analysis\n\nThe skill reads and analyzes the provided source file to identify:\n- All exported functions/classes/methods\n- Function signatures and return types\n- Dependencies and imports\n- Existing error handling patterns\n\n### Phase 2: Interactive Q&A\n\nThe skill asks clarifying questions to understand:\n- **Edge Cases**: Empty inputs, null values, boundary conditions\n- **Error Handling**: Expected exceptions, error messages\n- **Priorities**: Critical functions, known bug-prone areas\n- **Dependencies**: What to mock, environment-specific behavior\n\n### Phase 3: Test Generation\n\nGenerates comprehensive test suites organized by:\n- Happy path tests\n- Edge case tests\n- Error handling tests\n- Integration tests (with mocks)\n\n### Phase 4: Review & Refinement\n\nAfter generating tests, offers to:\n- Add more test cases\n- Adjust mocking strategies\n- Cover additional scenarios\n\n## Framework Detection\n\nIf `--framework` is not specified:\n- `.ts` / `.tsx` / `.js` / `.jsx` files → Checks for vitest.config or jest.config → Defaults to Jest\n- `.py` files → Pytest\n\n## Test File Naming Conventions\n\nDefault output locations:\n- **Jest/Vitest**: `[filename].test.ts` or `[filename].test.tsx`\n- **Pytest**: `test_[filename].py`\n\n## Example Output\n\n### Jest/Vitest (TypeScript)\n\n```typescript\nimport { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';\nimport { validateEmail, validatePassword } from './validator';\n\ndescribe('validateEmail', () => {\n  describe('happy path', () => {\n    it('should return true for valid email', () => {\n      expect(validateEmail('user@example.com')).toBe(true);\n    });\n  });\n\n  describe('edge cases', () => {\n    it('should handle empty string', () => {\n      expect(validateEmail('')).toBe(false);\n    });\n  });\n\n  describe('error handling', () => {\n    it('should throw on null input', () => {\n      expect(() => validateEmail(null)).toThrow();\n    });\n  });\n});\n```\n\n### Pytest (Python)\n\n```python\nimport pytest\nfrom validator import validate_email, validate_password\n\nclass TestValidateEmail:\n    def test_happy_path(self):\n        assert validate_email('user@example.com') is True\n\n    class TestEdgeCases:\n        def test_empty_string(self):\n            assert validate_email('') is False\n\n    class TestErrorHandling:\n        def test_none_input_raises(self):\n            with pytest.raises(TypeError):\n                validate_email(None)\n```\n\n## Requirements\n\n- Node.js 18+\n- TypeScript 5.0+\n\nFor the generated tests:\n- Jest, Vitest, or Pytest (depending on framework)\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-55d84f44b9516d4bbe7d3a365bbf9092"}