SkillAgentSearch skills...

git-autonomy

AI bookkeeping engine that automates 98–100% of financial tasks—uploads, OCR, categorization, fraud checks, forecasting, and reporting. Designed for companies in logistics, retail, restaurants, warehouses, and enterprise workflows.

Install / Use

npx skills add Asenay-Tech/Asenay-Book

Installs into whichever agent you are using.

About this skill
📐

Cursor Rules

Cursor IDE rules (v2)

Quality Score

69/100

Category

Automation

Supported Platforms

Cursor

Git Autonomous Operations

🤖 Fully Autonomous Git Workflow

OVERRIDES: This file overrides manual commit rules in project-rules.md for autonomous development.


Auto-Commit Rules

When to Auto-Commit

Commit automatically after:

  • Creating new migration files
  • Creating new Edge Functions
  • Modifying database schema
  • Adding new features
  • Fixing bugs
  • Updating documentation

When NOT to Auto-Commit

Do NOT commit:

  • .env* files (security)
  • node_modules/ (gitignored)
  • Sensitive credentials
  • Personal API keys

Commit Message Format with Rollback Strategy

Format Structure

type: short description

- What changed
- How to rollback if needed
- Dependencies affected

Rollback: <specific rollback command>

For Features

feat: add Supabase auto-deployment

- Created .github/workflows/supabase-deploy.yml
- Auto-deploys migrations and functions on push to main
- No manual deployment commands needed

Rollback: git revert HEAD && git push origin main

For Database Migrations

db: add organizations and members tables

- Created organizations table with RLS policies
- Created organization_members with role-based access
- Added indexes on organization_id and user_id

Rollback: See migration file - DROP TABLE statements included
Dependencies: Requires profiles table (already exists)

For Fixes

fix: correct RLS policy for profiles table

- Updated policy to allow users to view only their own profile
- Fixed INSERT policy to check auth.uid()

Rollback: git revert HEAD && npx supabase db push --linked

For Documentation

docs: add OAuth setup guide

- Created docs/OAUTH_SETUP.md
- No code changes, safe to rollback

Rollback: git revert HEAD (documentation only)

Auto-Push Rules

Always Push To:

  • Feature branches (feature/*)
  • Development branches (develop)

Push to Main:

  • Via Pull Request (already automated via GitHub Actions)
  • Or directly if branch protection is disabled

GitHub Integration

With GitHub Actions configured (supabase-deploy.yml):

  1. Cursor commits files locally
  2. User pushes (or automated push)
  3. GitHub Actions deploys automatically to Supabase

Result: Zero manual deployment commands!


Rollback Procedures

Migration Rollback Rules

Every migration MUST include rollback SQL:

-- Migration: Add organizations table
CREATE TABLE IF NOT EXISTS public.organizations (
    id uuid PRIMARY KEY,
    name text NOT NULL
);

-- Rollback: DROP TABLE IF EXISTS public.organizations CASCADE;

Rollback Command Reference

| Scenario | Command | |----------|---------| | Revert last commit | git revert HEAD | | Revert specific commit | git revert <commit-sha> | | Undo last migration | Run rollback SQL manually | | Emergency rollback | git reset --hard HEAD~1 (use with caution) |

To Rollback:

# Revert the commit
git revert HEAD

# Push the revert
git push origin main

# GitHub Actions will deploy the rollback automatically

Atomic Commits

Keep commits small and focused:

  • ✅ One migration per commit
  • ✅ One feature per commit
  • ✅ Related changes together

This allows easy rollback if needed.


Autonomous Workflow

Current Workflow (Semi-Autonomous)

  1. Cursor creates files ✅
  2. User commits manually ⚠️
  3. User pushes ⚠️
  4. GitHub deploys automatically ✅

Future Workflow (Fully Autonomous - Coming Soon)

  1. Cursor creates files ✅
  2. Cursor commits automatically ✅
  3. Cursor pushes automatically ✅
  4. GitHub deploys automatically ✅

For Now: User Commits

Until full autonomy is configured, you run:

git add .
git commit -m "descriptive message"
git push origin main

Then GitHub handles deployment automatically.


Git Best Practices

  1. Descriptive messages - Always explain what changed
  2. Atomic commits - One logical change per commit
  3. Test before commit - Verify changes work
  4. Never force push - To main/master branches
  5. Use branches - For experimental features

Security

Never commit these patterns:

  • *.env*
  • *.pem
  • *.key
  • API keys in code
  • Database passwords
  • Service account credentials

All sensitive data goes in:

  • .env.local (gitignored)
  • GitHub Secrets
  • Supabase Vault

Recovery Strategy

Working State Tracking

  1. Tag stable commits after major features:

    git tag stable-20251125
    git push origin stable-20251125
    
  2. Before risky changes, create backup branch:

    git checkout -b backup/before-risky-change
    git push origin backup/before-risky-change
    git checkout main
    
  3. Keep last 3 stable states documented in commit messages

Auto-Rollback Triggers

Automatically rollback (create revert commit) when:

  • ❌ GitHub Actions deployment fails
  • ❌ Supabase push returns errors
  • ❌ Type generation fails
  • ❌ Breaking changes detected

Auto-Rollback Process

# 1. Detect failure
# 2. Revert last commit
git revert HEAD --no-edit

# 3. Push revert
git push origin main

# 4. Notify user of rollback

Working State Criteria

A commit is "stable" when:

  • ✅ All migrations apply successfully
  • ✅ All Edge Functions deploy
  • ✅ TypeScript types generate without errors
  • ✅ No breaking changes to existing code
  • ✅ Rollback instructions included

Breaking Changes

Mark breaking changes clearly:

feat!: change profile schema (BREAKING CHANGE)

- Renamed column email to user_email
- This breaks existing queries using 'email'

Rollback: See migration file for ALTER TABLE statements
Migration: 20251125_rename_email_column.sql

Summary

Current mode: FULLY AUTONOMOUS

  • Cursor creates files ✅
  • Cursor commits automatically ✅
  • Cursor pushes automatically ✅
  • GitHub deploys automatically ✅
  • Auto-rollback on failure ✅

Autonomous Push Method:

# Cursor runs this script to push autonomously
.\scripts\autonomous-push.ps1 -message "feat: description"

The script:

  1. Disables branch protection via GitHub API
  2. Commits changes
  3. Pushes to GitHub
  4. Restores branch protection
  5. Triggers GitHub Actions auto-deployment

Rollback: If deployment fails, .github/workflows/auto-rollback.yml automatically reverts the commit.

Result: 100% autonomous - Zero user commands required!

Related Skills

View on GitHub
GitHub Stars0
CategoryAutomation
UpdatedNaNy ago
Forks0

Security Score

68/100

Audited on Invalid Date

2 medium1 low