This is a TypeScript port of subagent-py.
src/cli.ts: Main CLI entry point using Commander.js for argument parsingsrc/vscode/: VS Code agent provisioning, dispatch, and workspace managementsrc/utils/: Shared utility modules (file system operations, time utilities)dist/: Compiled JavaScript output (generated by TypeScript compiler)src/vscode/subagent_template/: Template files copied into each provisioned subagent workspace
bun install: Install all dependenciesbun run build: Compile TypeScript to JavaScript and copy template files to dist/bun run typecheck: Verify TypeScript type safetybun run dev -- <args>: Run CLI directly with hot reloadbun run start -- <args>: Run compiled JavaScript from dist/bun run lint: Check code style with Biomebun run format: Format code with Biomebun run fix: Auto-fix linting and formatting issuesbun test: Run test suitebun test --watch: Run tests in watch modebun test --coverage: Run tests with coverage reportbun link: Create global symlink for local testing
This project uses Changesets for automated versioning and changelog generation.
When making changes that should be included in the next release:
- Run
bun changesetto create a new changeset file - Select the semver bump type (patch, minor, or major)
- Write a summary of the changes for the changelog
- Commit the generated
.changeset/*.mdfile with your changes
- Run
bun versionto consume changesets and update package.json version - Review the updated CHANGELOG.md
- Commit the version bump and changelog updates
- Create a git tag and push to trigger release workflow
- Follow the TypeScript 5.x and ES2022 guidelines from
.github/instructions/typescript-5-es2022.instructions.md - Use 2-space indentation (standard for TypeScript projects)
- Prefer explicit types on public function signatures
- Use
async/awaitfor asynchronous operations - Prefer named exports over default exports
- Keep modules cohesive (
provision.tsfor provisioning,agentDispatch.tsfor dispatch logic, etc.) - When adding new CLI commands, register them in
cli.tswith appropriate options and handlers
- Use Bun's built-in test runner for testing
- Name test files
*.test.tsor*.spec.ts - Unit tests: Place in
tests/unit/directory - Integration tests: Place in
tests/integration/directory - Default
bun testruns only unit tests (excludes integration tests) - Run integration tests with
bun run test:integration - Run all tests with
bun run test:all - Ensure tests pass via
bun testbefore opening a PR
- Write commits in the imperative mood (e.g.,
Add Azure retry helper) - Reference related issues in commit bodies or PR descriptions when applicable
- PRs should summarize behavior changes, note testing performed, and include relevant context
- Keep commits focused and atomic when possible
- Use environment variables or VS Code settings for configuration (no secrets in code)
- API keys and credentials must never appear in config files or Git history
- Template files in
src/vscode/subagent_template/should remain generic and not contain user-specific data
- Use Bun for package management (Bun 1.3.3+)
- Keep dependencies minimal and well-justified
- Prefer stable, well-maintained packages
- Document any platform-specific dependencies or requirements
- Bun provides faster installs, better disk space efficiency, and built-in TypeScript support
- Target ES2022 for modern JavaScript features
- Enable strict mode for type safety
- Module resolution: Node with ESM imports
- Output directory:
dist/ - Include source maps for debugging
After making any significant changes (refactoring, new features, bug fixes), always run the following verification steps in order:
bun run build- Ensure code compiles without errorsbun run typecheck- Verify TypeScript type safetybun run lint- Check code style and catch potential issues with Biomebun test- Run all tests to verify functionality
Only consider the work complete when all four steps pass successfully. This ensures code quality, prevents regressions, and maintains the integrity of the codebase.
- Template files must be copied to
dist/vscode/subagent_template/during build - Use the
cpxpackage in the build script to ensure templates are bundled - The
DEFAULT_TEMPLATE_DIRconstant inconstants.tsmust resolve to the correct location
These instructions are for AI assistants working in this project.
Always open @/docs/openspec/AGENTS.md when the request:
- Mentions planning or proposals (words like proposal, spec, change, plan)
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
- Sounds ambiguous and you need the authoritative spec before coding
Use @/docs/openspec/AGENTS.md to learn:
- How to create and apply change proposals
- Spec format and conventions
- Project structure and guidelines
Keep this managed block so 'openspec update' can refresh the instructions.