npm package: @hewnventures/levrops-tenant-kit
Description: Tenant-safe Cursor slash commands for consuming LevrOps capabilities
Author: LevrOps Team
Latest version: 1.0.0

# @hewnventures/levrops-tenant-kit

Tenant-safe Cursor slash commands for consuming LevrOps capabilities.

## Purpose

This package distributes tenant-safe Cursor slash commands that enable tenant developers to consume LevrOps capabilities without needing access to the private LevrOps repository.

## Installation

```bash
npx @hewnventures/levrops-tenant-kit init
```

This installs:
- Cursor slash commands to `.cursor/commands/`
- Command runner script to `scripts/levrops_cmd.mjs`

## Configuration

Create a `.env` file in your repo root:

```env
LEVROPS_BASE_URL=https://api.levrops.com
LEVROPS_TENANT=your-tenant-slug
LEVROPS_PROPERTY=your-property-slug
LEVROPS_API_KEY=your-api-key-here
```

⚠️ **Do NOT commit `.env` to version control!**

## Usage

After installation, use these Cursor slash commands:

### `/capability_list`

List all available LevrOps capabilities.

### `/capability_enable <slug>`

Enable a capability for the current property.

```bash
/capability_enable editorial
```

### `/capability_scaffold <slug>`

Scaffold thin UI adapters for a capability.

```bash
/capability_scaffold editorial
```

### `/capability_verify`

Verify tenant/property wiring is correct.

### `/capability_build <slug> ["mini-prompt"]`

Feature concierge that automatically:
- Enables existing capabilities
- Creates local-only features
- Proposes upstream capabilities

## Example Workflow

```bash
# 1. Install commands
npx @hewnventures/levrops-tenant-kit init

# 2. Configure .env file (see above)

# 3. In Cursor, verify setup
/capability_verify

# 4. List available capabilities
/capability_list

# 5. Enable a capability
/capability_enable editorial

# 6. Scaffold UI adapters
/capability_scaffold editorial
```

## Safety Guarantees

This package:
- ✅ Never modifies LevrOps backend schemas
- ✅ Never creates LevrOps migrations
- ✅ Never runs platform guardrails
- ✅ Only calls LevrOps APIs
- ✅ Only scaffolds UI adapters

## What This Package Does NOT Do

- ❌ Does NOT expose platform-level commands
- ❌ Does NOT modify deploy scripts
- ❌ Does NOT assume internal DB schemas
- ❌ Does NOT import or reference levrops.v2 code

## Documentation

See `assets/docs/tenant-dev.md` for complete documentation.

## License

MIT

## Release Process

This package uses [Changesets](https://github.com/changesets/changesets) for version management and automated publishing.

### Making Changes

1. Make your changes to the package
2. Run `npx changeset` in the package root
3. Select the type of change:
   - **patch**: Bug fixes, minor updates
   - **minor**: New features (backward compatible)
   - **major**: Breaking changes
4. Describe your changes
5. Commit the changeset file along with your changes

### Release Flow

1. **Developer creates changeset**: After making changes, run `npx changeset` and commit the changeset file
2. **CI creates version PR**: When changesets are present, CI automatically creates a PR titled "chore(release): version packages"
3. **Review and merge**: Review the version PR, then merge it
4. **Automatic publish**: Merging the version PR triggers automatic publishing to npm

### Example

```bash
# 1. Make changes
# ... edit files ...

# 2. Create changeset
npx changeset
# Select: patch, minor, or major
# Describe changes

# 3. Commit
git add .
git commit -m "feat: add new capability command"

# 4. Push and wait for CI
git push origin feature-branch
# CI will create version PR automatically

# 5. Merge version PR to trigger publish
```

### Safety Guarantees

- ✅ No surprise releases: Requires explicit changeset
- ✅ No manual npm publish: Fully automated via CI
- ✅ Idempotent: Safe to rerun workflows
- ✅ Auditable: All releases tracked via changesets and PRs

### Required Secrets

The publish workflow requires:

- **NPM_TOKEN**: npm Automation token with publish permissions
  - Create at: https://www.npmjs.com/settings/[org]/tokens
  - Type: Automation token
  - Add to GitHub repository secrets

### Troubleshooting

**Version PR not created?**
- Ensure changeset files exist in `.changeset/` directory
- Check that changesets were committed to the branch

**Publish not triggered?**
- Verify version changed (check workflow logs)
- Ensure NPM_TOKEN secret is configured
- Check npm registry permissions

**Publish fails?**
- Verify package.json includes `publishConfig.access: "public"`
- Check npm token has publish permissions
- Review workflow logs for specific errors

## Support

For issues or questions, contact the LevrOps team.