home / skills / ladderchaos / tora-skills / repo-maintenance

repo-maintenance skill

/repo-maintenance

This skill guides version bumps, changelog updates, deployments, and status tracking to streamline release management for monorepos.

npx playbooks add skill ladderchaos/tora-skills --skill repo-maintenance

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
12.0 KB
---
name: repo-maintenance
description: Manage repository versioning, releases, deployments, and documentation. Use this skill for version bumps, changelog updates, deployment syncs, status tracking, and release management.
---

# Repo Maintenance

This skill guides repository maintenance tasks including version control, release management, deployment synchronization, and documentation updates for the Sooth Protocol monorepo.

## When to Use This Skill

Invoke this skill when:
- Updating CHANGELOG.md after features, fixes, or deployments
- Bumping version numbers in package.json or config files
- Syncing deployment addresses after contract deploys
- Updating STATUS.md with current project state
- Preparing releases or deployments
- Managing branch workflows and conventional commits

## Core Files

| File | Purpose | Update Frequency |
|------|---------|------------------|
| `CHANGELOG.md` | Release history with breaking changes, fixes, deployments | Per release |
| `STATUS.md` | Live project status, current deployments, pending work | Per session |
| `DECISIONS.md` | Architectural Decision Records (ADRs) | Per major decision |
| `apps/web/src/config/deployments.json` | Canonical contract addresses (source of truth) | Per deployment |
| `apps/web/src/config/markets.json` | Active markets per chain | Per market creation |
| `packages/contracts-evm/package.json` | Contract version (semantic) | Per contract release |

## Version Bump Workflow

### 1. Identify Version Type

| Change Type | Version Bump | Example |
|-------------|--------------|---------|
| Breaking API change | Major (X.0.0) | Interface signature change |
| New feature | Minor (0.X.0) | New contract function |
| Bug fix | Patch (0.0.X) | Logic correction |

### 2. Update Version Files

```bash
# Contract version (packages/contracts-evm/package.json)
# Update "version" field

# Frontend cache invalidation (apps/web/src/config/deployments.json)
# Bump "version" field to force browser refresh
```

### 3. Update CHANGELOG.md

Follow this format:

```markdown
## [X.Y.Z] - YYYY-MM-DD

### āš ļø BREAKING CHANGE
- **Description**: What changed and migration steps

### Fixed
- **Bug Name** (date): Root cause and solution

### Added
- **Feature Name**: Description with test count

### Deployed
- **Network Name VX.Y.Z**:
  - **Contract**: `0xAddress`

### Coverage
- X tests passing (Y new)
- ContractName: XX.XX% lines, XX.XX% functions
```

## Deployment Sync Workflow

After any contract deployment:

### 1. Verify On-Chain State (MANDATORY)

```bash
cd packages/contracts-evm
source .env

# Verify core contracts are live
cast call $LAUNCHPAD_ENGINE "owner()" --rpc-url $BASE_SEPOLIA_RPC_URL
cast call $COLLATERALIZER "usdc()" --rpc-url $BASE_SEPOLIA_RPC_URL
cast call $AMM_ENGINE "usdc()" --rpc-url $BASE_SEPOLIA_RPC_URL

# Verify market initialization
cast call $LAUNCHPAD_ENGINE "isInitialized(address)" $MARKET --rpc-url $BASE_SEPOLIA_RPC_URL
```

**STOP if any check fails.**

### 2. Update deployments.json (Canonical Source)

```json
{
  "version": "9.1.0",  // BUMP THIS to invalidate browser cache
  "lastUpdated": "2025-12-29T00:00:00Z",
  "networks": {
    "84532": {
      "name": "Base Sepolia",
      "contracts": {
        "LaunchpadEngine": "0x...",
        "AMMEngine": "0x...",
        "TickBookPoolManager": "0x..."
      }
    }
  }
}
```

### 3. Run Sync Script

```bash
./sync-deployments.sh
```

This copies from `apps/web/src/config/deployments.json` to `packages/contracts-evm/deployments.json`.

### 4. Verify Frontend Build

```bash
cd apps/web
npm run build  # Runs validate-config.js automatically
```

### 5. Update STATUS.md

Add new deployment addresses to the Active Deployment tables.

### 6. Commit with Conventional Format

```bash
git add apps/web/src/config/deployments.json apps/web/src/config/markets.json STATUS.md CHANGELOG.md
git commit -m "feat(deploy): V9.1.0 to Base Sepolia

- AMMEngine: 0x...
- LaunchpadEngine: 0x...

šŸ¤– Generated with Claude Code"
```

## STATUS.md Update Pattern

Update STATUS.md during each work session:

### Session Start
- Check "Pending Work" section for context
- Review "Active Deployment" tables for current state

### During Session
- Move completed items from "Pending Work" to "Completed This Session"
- Add new pending items as discovered

### Session End
- Update version badges at top if deployment occurred
- Update deployment address tables if contracts changed
- Add session summary at bottom

### Format

```markdown
# Project Status

> Last Updated: YYYY-MM-DD (VX.Y.Z Description)

- **āœ… FEATURE DEPLOYED** — Brief description
- **āš ļø KNOWN ISSUE** — Brief description with workaround

## šŸ†• VX.Y.Z Feature Name (YYYY-MM-DD)
**Summary**: What this version adds/fixes

### Contract Changes
| Contract | Change |
|----------|--------|
| **ContractName** | Description of change |

### New Tests (N)
| Test | Priority | Status |
|------|----------|--------|
| `test_Name` | P0 | āœ… |

### VX.Y.Z Deployed Addresses (Network)
| Contract | Address |
|----------|---------|
| **ContractName** | `0x...` |

## Pending Work (Next Session)
- [ ] **Task** — Description with effort estimate (S/M/L)

## Completed This Session (YYYY-MM-DD)
- āœ… **Task** — What was done
```

## Conventional Commits

Use this format for all commits:

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

[optional body]

šŸ¤– Generated with Claude Code
```

### Types
| Type | Use For |
|------|---------|
| `feat` | New feature |
| `fix` | Bug fix |
| `docs` | Documentation only |
| `refactor` | Code change that neither fixes bug nor adds feature |
| `test` | Adding or updating tests |
| `chore` | Maintenance tasks |
| `deploy` | Deployment-related changes (often `feat(deploy):`) |

### Scopes
| Scope | Package/Area |
|-------|--------------|
| `contracts` | packages/contracts-evm |
| `web` | apps/web |
| `deploy` | Deployment configuration |
| `config` | Configuration files |

## Pre-Commit Hook Behavior

The `.husky/pre-commit` hook runs when staging deployment configs:

1. **Deployment Verification**: Runs `./script/verify-deployment.sh` when `deployments.json` or `markets.json` are staged
2. **Version Bump Warning**: Alerts if `deployments.json` changed but version not bumped

If hook fails, fix the issue before committing.

## ADR (Architectural Decision Record) Format

For major decisions, add to DECISIONS.md:

```markdown
## ADR-XXX: Decision Title

**Date**: YYYY-MM-DD
**Status**: Proposed | Accepted | Deprecated | Superseded

### Context
What is the issue that we're seeing that motivates this decision?

### Decision
What is the change that we're proposing and/or doing?

### Consequences
What becomes easier or more difficult because of this change?
```

## Quick Reference Commands

```bash
# Check current versions
cat packages/contracts-evm/package.json | grep version
cat apps/web/src/config/deployments.json | grep version

# Verify deployment
cd packages/contracts-evm && source .env
cast call $LAUNCHPAD_ENGINE "owner()" --rpc-url $BASE_SEPOLIA_RPC_URL

# Sync after deployment
./sync-deployments.sh

# Build to verify config
cd apps/web && npm run build

# View recent commits for message style
git log --oneline -10
```

## Browser Cache Invalidation

After deployment sync, users need to hard refresh:
- **Chrome/Edge**: `Ctrl+Shift+R` (Windows) or `Cmd+Shift+R` (Mac)
- **Firefox**: `Ctrl+F5` (Windows) or `Cmd+Shift+R` (Mac)

The `version` field in `deployments.json` triggers automatic cache invalidation when bumped.

## Multi-Network Deployment

When deploying to multiple networks:

1. Deploy to each network separately
2. Update `deployments.json` with all network addresses
3. Update `markets.json` with markets per chain
4. Bump version once (covers all networks)
5. Document all deployments in CHANGELOG.md

## Effort Estimates

Use these labels for pending work:
- **S (Small)**: < 2 hours
- **M (Medium)**: 2-6 hours
- **L (Large)**: > 6 hours

## Version File Organization

When upgrading to a new major version, archive previous version files to maintain history while keeping the working directory clean.

### Directory Structure

```
copan/
ā”œā”€ā”€ packages/contracts-evm/
│   ā”œā”€ā”€ deployments/
│   │   ā”œā”€ā”€ v9-latest.json           # Current version
│   │   ā”œā”€ā”€ v9-baseSepolia.json      # Per-network current
│   │   ā”œā”€ā”€ v9-monadTestnet.json
│   │   └── v8-archive/              # Previous version archive
│   │       ā”œā”€ā”€ v8-latest.json
│   │       ā”œā”€ā”€ v8-baseSepolia.json
│   │       └── README.md
│   │
│   ā”œā”€ā”€ docs/
│   │   ā”œā”€ā”€ v9/                      # Active version docs
│   │   └── _archive/                # Archived docs
│   │       ā”œā”€ā”€ v8/
│   │       ā”œā”€ā”€ v7/
│   │       └── v6/
│   │
│   ā”œā”€ā”€ test/v9/                     # Active version tests
│   ā”œā”€ā”€ archive_tests/               # Archived tests
│   │   └── v8/
│   │
│   ā”œā”€ā”€ abi/v9/                      # Active ABIs
│   └── archive_scripts/             # Deprecated scripts
│
ā”œā”€ā”€ apps/web/
│   ā”œā”€ā”€ src/config/
│   │   ā”œā”€ā”€ deployments.json         # Canonical (current)
│   │   └── markets.json             # Current markets
│   ā”œā”€ā”€ archive/                     # Frontend archives
│   │   └── v8/
│   └── docs/_archive/
│       └── v8-implementation/
```

### Archive Locations by Artifact Type

| Artifact | Active Location | Archive Pattern |
|----------|-----------------|-----------------|
| **Deployments** | `deployments/v{N}-*.json` | `deployments/v{N-1}-archive/` |
| **Docs** | `docs/v{N}/` | `docs/_archive/v{N-1}/` |
| **Tests** | `test/v{N}/` | `archive_tests/v{N-1}/` |
| **Scripts** | `script/` | `archive_scripts/` |
| **Frontend** | `apps/web/src/` | `apps/web/archive/v{N-1}/` |
| **ABIs** | `abi/v{N}/` | Keep in place (small files) |

### Major Version Upgrade Checklist

When releasing a new major version (e.g., V9 → V10):

1. **Archive Deployments**
   ```bash
   cd packages/contracts-evm/deployments
   mkdir v9-archive
   mv v9-*.json v9-archive/
   echo "# V9 Archive\nArchived: $(date)\nReason: V10 release" > v9-archive/README.md
   ```

2. **Archive Version-Specific Docs**
   ```bash
   mv docs/v9 docs/_archive/v9
   mkdir docs/v10
   ```

3. **Archive Version-Specific Tests** (if superseded)
   ```bash
   mkdir -p archive_tests/v9
   mv test/v9/* archive_tests/v9/  # Only if tests no longer apply
   ```

4. **Create New Version Files**
   ```bash
   touch deployments/v10-latest.json
   mkdir docs/v10
   mkdir test/v10
   ```

5. **Update package.json**
   ```json
   {
     "version": "10.0.0",
     "description": "Sooth Protocol V10 EVM Contracts"
   }
   ```

6. **Document in CHANGELOG.md**
   ```markdown
   ## [10.0.0] - YYYY-MM-DD

   ### āš ļø BREAKING CHANGE
   - Major architecture change (see docs/v10/)
   - V9 contracts archived to deployments/v9-archive/
   ```

### What NOT to Archive

- **CHANGELOG.md** — Always append, never archive
- **STATUS.md** — Rolling document, clear old sessions periodically
- **DECISIONS.md** — Append ADRs, mark old ones as "Superseded"
- **Core contracts** — Keep all versions in `contracts/` (git tracks history)
- **Root configs** — `package.json`, `foundry.toml`, etc. are versioned in git

### Archive README Template

Create a `README.md` in each archive folder:

```markdown
# V{N} Archive

**Archived**: YYYY-MM-DD
**Superseded By**: V{N+1}
**Reason**: [Brief explanation]

## Contents
- `v{N}-latest.json` — Final deployment addresses
- `v{N}-baseSepolia.json` — Base Sepolia deployment
- `v{N}-monadTestnet.json` — Monad deployment

## Historical Context
[Brief summary of what this version implemented]

## Migration Notes
[Any notes for understanding changes to next version]
```

### Quick Archive Commands

```bash
# Archive a version's deployments
VERSION=9
cd packages/contracts-evm/deployments
mkdir v${VERSION}-archive
mv v${VERSION}-*.json v${VERSION}-archive/

# Archive version docs
cd ../docs
mv v${VERSION} _archive/v${VERSION}

# Archive version tests (if applicable)
cd ../
mkdir -p archive_tests/v${VERSION}
mv test/v${VERSION}/* archive_tests/v${VERSION}/
```

Overview

This skill automates and documents routine repository maintenance: version bumps, changelog updates, deployment syncs, status tracking, and release management. It codifies workflows for contract releases, frontend cache invalidation, and session-based STATUS updates to keep the monorepo consistent and auditable.

How this skill works

The skill inspects core files such as deployments.json, package.json, CHANGELOG.md, and STATUS.md to determine what needs updating after code or contract changes. It guides verification of on-chain state, enforces a canonical deployment source, runs sync and build steps, and generates conventional commit messages for CI hooks. It also provides archiving and major-version upgrade checklists to minimize manual errors.

When to use it

  • After deploying contracts to update canonical addresses and bump frontend cache version
  • When releasing a new patch, minor, or major contract version
  • Before committing deployment/config changes to ensure pre-commit hooks pass
  • When preparing release notes and updating CHANGELOG.md
  • At session start/end to refresh STATUS.md and track pending/completed work

Best practices

  • Always verify on-chain state before updating deployments.json; stop if checks fail
  • Bump the deployments.json "version" field to force browser cache invalidation
  • Follow the provided CHANGELOG and STATUS.md templates for consistent history
  • Use conventional commit format and include scope (contracts, web, deploy, config)
  • Run the sync-deployments script and build the frontend to validate config changes

Example use cases

  • Deploy contracts to Base Sepolia, verify addresses, update deployments.json, run sync and build, then commit with feat(deploy): V9.1.0
  • Fix a contract bug, bump patch version in package.json, append a Fix section to CHANGELOG.md, and commit with fix(contracts): ...
  • Start a work session by reviewing Pending Work in STATUS.md, move completed items to the session summary, and update active deployment tables
  • Prepare a major release: archive v9 artifacts, create v10 docs/tests/deployments, update package.json to 10.0.0, and document breaking changes in CHANGELOG.md

FAQ

What triggers a browser cache invalidation?

Bumping the "version" field in apps/web/src/config/deployments.json triggers cache invalidation; instruct users to hard-refresh their browsers after release.

What if a pre-commit hook fails when staging deployments?

Fix the flagged verification or version mismatch, re-run verification steps (on-chain checks and sync), then stage and commit again.