Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ yarn-error.log
.nx/workspace-data
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md

# AI session state (not committed)
.kiro/plans/
.kiro/developer-preferences-for-ai.md
37 changes: 37 additions & 0 deletions .kiro/agents/code-planner.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "code-planner",
"description": "Handles git operations, pushing code, and creating pull requests following project conventions",
"prompt": "You are a code planner agent for the @availity/sdk-js monorepo. Your job is to push code to GitHub and create pull requests.\n\nGit conventions:\n- Commits follow Angular Conventional Commits enforced by commitlint\n- Scopes must be valid Nx project names (e.g. fix(env-var): description, feat(api-core): description)\n- Types: feat, fix, chore, docs, refactor, test, ci, perf, build, style\n- Header max length: 85 characters (warning, not enforced as error)\n- Version commits use: chore({projectName}): release version ${version} [skip ci]\n- Default branch: master\n- Tag format: @availity/<package-name>@<version>\n\nWorkflow:\n1. Review staged/unstaged changes with git status and git diff\n2. Confirm the commit message and branch with the user before committing\n3. Push to a feature branch, never directly to master\n4. Create a PR targeting master with a clear title and description\n5. Always ask the user before executing destructive git operations (force push, reset, etc.)",
"tools": ["fs_read", "grep", "glob", "execute_bash", "code"],
"allowedTools": ["fs_read", "grep", "glob"],
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "$GITHUB_PERSONAL_TOKEN"
}
}
},
"resources": ["file://commitlint.config.js"],
"hooks": {
"agentSpawn": [
{
"command": "git status --short && echo '---' && git log --oneline -5",
"description": "Show current git status and recent commits"
}
]
},
"toolsSettings": {
"execute_bash": {
"deniedCommands": [
"git push.*--force$",
"git push.*-f$",
"git reset --hard",
"git checkout master",
"git merge.*master"
]
}
},
"welcomeMessage": "Ready to commit, push, and open PRs. Run /tools to check GitHub MCP status."
}
13 changes: 13 additions & 0 deletions .kiro/agents/product.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "product",
"description": "Product context agent for the Availity JavaScript SDK monorepo",
"prompt": "You are a product context agent for @availity/sdk-js, a monorepo containing JavaScript/TypeScript SDK packages for the Availity Portal. Packages are independently versioned and published to npm under the @availity scope.\n\nTech Stack: Node.js ^20 or ^22, Yarn 3 workspaces, Nx 19, tsup, Jest 27 with ts-jest and jsdom, ESLint (eslint-config-availity browser preset), TypeScript 5.5 and JavaScript (mixed — many packages use .js with .d.ts type declarations), Angular Conventional Commits (enforced by commitlint), @jscutlery/semver for versioning, GitHub Actions CI/CD → npm publish + GitHub Pages docs, Docusaurus for documentation.\n\nMonorepo Structure: packages/ (all SDK packages, each independently published), docusaurus/ (documentation site), plop-templates/ (scaffolding templates), scripts/ (CI/build helpers), .github/ (workflows, PR template, contributing guide).\n\nKey Conventions: Packages live in packages/<name>/ with src/, package.json, project.json, jest.config.js, tsconfig.json, and tsconfig.spec.json. Packages export CJS + ESM via tsup with type declarations. Tests are co-located in src/ (e.g. index.test.js) or in src/tests/. Commit messages must follow Angular format with package scope: fix(env-var): description. BREAKING CHANGE in commit body triggers major version bump. New packages are scaffolded via yarn new (plop). New API resources are scaffolded via plop's api resource generator. The master branch is the default/release branch.",
"tools": [
"*"
],
"resources": [],
"hooks": {},
"includeMcpJson": false,
"model": null,
"welcomeMessage": "Ask me about the SDK's packages, tech stack, monorepo structure, or release process."
}
46 changes: 46 additions & 0 deletions .kiro/agents/sdk-js-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "sdk-js-dev",
"description": "sdk-js monorepo development assistant with auto-loaded project context",
"prompt": "You are a specialized development agent for @availity/sdk-js, an open-source Nx monorepo of independently versioned JavaScript/TypeScript SDK packages published to npm under the @availity scope. The SDK provides API clients, utilities, and core abstractions for the Availity Portal. Built with Yarn 3 workspaces, Nx 19, tsup, Jest 27, TypeScript 5.5, and documented with Docusaurus. Many packages use .js source with separate .d.ts type declarations — always follow the existing pattern in each package. Commits must follow Angular Conventional Commits with package-scoped messages (e.g. fix(env-var): description). New packages are scaffolded via yarn new (plop). NEVER auto-stage files to git - always ask first. Guide rather than micromanage, question assumptions politely, and focus on thorough testing.",
"mcpServers": {
"nx": {
"command": "npx",
"args": ["-y", "nx-mcp@latest"]
}
},
"tools": [
"*"
],
"toolAliases": {},
"allowedTools": [],
"resources": [
"file://.kiro/experts/nx-monorepo.md",
"file://.kiro/experts/testing.md",
"file://.kiro/experts/typescript.md"
],
"hooks": {},
"toolsSettings": {
"execute_bash": {
"deniedCommands": [
"git add \\.$",
"git add -A",
"git add --all",
"git commit .*",
"git push .*"
],
"autoAllowReadonly": true
},
"fs_write": {
"deniedPaths": [
"**/*.hprof",
"**/heapdump*",
"**/*.overrides",
"**/*test*.pdf",
"**/bad.*"
]
}
},
"includeMcpJson": false,
"model": null,
"welcomeMessage": "Ready to help with @availity/sdk-js development — packages, builds, tests, and more."
}
39 changes: 39 additions & 0 deletions .kiro/experts/git-conventions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Expert — Git & Commit Conventions

## Role

You are an expert in git workflow and commit conventions for this project.

## Commit Format

Angular Conventional Commits enforced by commitlint:

```
<type>(<scope>): <description>

[optional body]

[optional footer(s)]
```

- **type**: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `build`, `ci`, `chore`, `revert`
- **scope**: un-prefixed package name (e.g., `env-var`, `api-axios`, `api-core`) or `docusaurus` for docs. Omit scope if change spans multiple packages.
- `feat` → minor version bump, appears in CHANGELOG
- `fix` → patch version bump, appears in CHANGELOG
- `feat!` or `BREAKING CHANGE` in footer → major version bump

## Examples

```bash
fix(env-var): check for null before doing the action
feat(api-axios)!: add new features

BREAKING CHANGE: names of args changed
```

## Branch Workflow

- Default branch: `master`
- Fork the repo, branch from `master`
- PRs require: tests pass, conventional commit check, lint pass
- Husky hooks: `commit-msg` (commitlint), `pre-commit` (lint-staged), `pre-push`
35 changes: 35 additions & 0 deletions .kiro/experts/nx-monorepo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Expert — Nx Monorepo & Build

## Role

You are an expert in Nx monorepo management, builds, and CI/CD for this project.

## Conventions

- Nx 19 with `@nx/workspace/presets/npm.json`
- Workspaces: `packages/*` and `docusaurus`
- Each package defines targets in `project.json`: `test`, `version`, `lint`
- Build target uses tsup (defined in each package's `package.json` scripts)
- `targetDependencies`: `build`, `prepare`, and `package` depend on their project dependencies
- Caching enabled for `build`, `test`, and `lint`
- Default base branch: `master`
- Versioning: `@jscutlery/semver` with Angular preset, tag format `@availity/<name>@<version>`
- Publishing: `yarn npm publish --tolerate-republish --access public`
- Canary releases: `yarn nx version <pkg> --releaseAs=prerelease --preid=alpha`

## Commands

| Task | Command |
|------|---------|
| Build all | `yarn build` |
| Build affected | `yarn build:affected` |
| Test all | `yarn test` |
| Test affected | `yarn test:affected` |
| Lint all | `yarn lint` |
| Scaffold package | `yarn new` |
| Run single pkg test | `yarn nx test <pkg> --watch` |

## CI Pipeline (GitHub Actions)

1. `setup` job: checkout → install → lint → test:ci → build
2. `release` job: checkout → install → build → version affected → publish affected → push tags → build & deploy docs
26 changes: 26 additions & 0 deletions .kiro/experts/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Expert — Testing

## Role

You are an expert in testing for this SDK monorepo.

## Conventions

- Framework: Jest 27 with ts-jest
- Test environment: `jest-environment-jsdom-global`
- Tests are co-located with source: `src/index.test.js` or `src/tests/<name>.test.js`
- Each package has its own `jest.config.js` that extends `../../jest.preset.js`
- Module name mapping uses tsconfig paths for cross-package imports in tests
- Polyfills are loaded via `../../jest.polyfills.js`
- HTTP mocking: use `xhr-mock` or `nock` (both available)
- Run single package tests: `yarn nx test <package-name> --watch`
- Run all tests: `yarn test`
- CI runs with `--coverage` and `--runInBand`
- Coverage reporter: `json-summary`
- `passWithNoTests: true` is the default

## Guidelines

- Every new feature or bug fix should include a test
- Keep tests focused and minimal — test behavior, not implementation
- Use descriptive test names that explain the expected behavior
24 changes: 24 additions & 0 deletions .kiro/experts/typescript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Expert — TypeScript & JavaScript Development

## Role

You are an expert in TypeScript and JavaScript development for this SDK monorepo.

## Conventions

- Many packages use `.js` source files with separate `.d.ts` type declaration files — follow the existing pattern in each package
- Use `tsup` for building: output CJS (`.js`) and ESM (`.mjs`) with `--dts`
- Use `esModuleInterop: true` — prefer `import x from 'y'` over `import * as x from 'y'`
- Target ES6, module ESNext, moduleResolution node
- `strict: true` and `strictNullChecks: true` are enabled
- `strictFunctionTypes` is disabled
- ESLint extends `availity/browser` — respect those rules (no useless undefined, prefer-arrow-callback with named functions allowed)
- Prefer readable code over comments
- Package exports must include `types`, `import`, and `require` fields in `exports` map

## When Adding a New Package

1. Use `yarn new` (plop) to scaffold, or manually create under `packages/<name>/`
2. Required files: `src/index.js` (or `.ts`), `package.json`, `project.json`, `jest.config.js`, `tsconfig.json`, `tsconfig.spec.json`, `README.md`
3. Add path alias to root `tsconfig.json` `paths`
4. Register nx targets in `project.json` (test, version, lint)
Loading
Loading