| name | add-cash-position-feature |
| description | Adds the cash position feature to an existing banking application. Creates the backend query script, API endpoint, and updates the frontend to display formatted treasury reports. |
| triggers | ["add the skill to get our current cash position","add cash position feature","implement cash position","enable cash position button"] |
add-cash-position-feature
This skill adds a working cash position feature to an existing banking application created by the scaffold-banking-app skill.
Prerequisites
Before running this skill, ensure:
- The
banking_app/ directory exists
- The SQLite database is initialized with demo data
- The
server.py file is present
What This Skill Creates
-
Backend Query Module (banking_app/api/cash_position.py)
- SQL queries to aggregate bank account balances
- Credit facility utilization calculations
- Liquidity ratio and health status determination
-
Updated Server Routes (banking_app/server.py)
- Real
/api/cash-position endpoint replacing the placeholder
-
Updated Frontend (banking_app/static/js/app.js)
- Async fetch to real API endpoint
- Formatted report with summary tables
- Health status indicators
Execution Order
Execute the following scripts in order:
-
check_prerequisites.py - Validates that the banking application exists and has required files/data before proceeding.
-
create_cash_position.py - Creates the banking_app/api/cash_position.py module with SQL queries for account balances, credit facilities, and liquidity calculations.
-
update_server.py - Updates banking_app/server.py to import the cash position module and route /api/cash-position to the real handler.
-
update_frontend.py - Updates banking_app/static/js/app.js to call the real API and format the response as HTML tables.
-
update_styles.py - Updates banking_app/static/css/styles.css with status indicator classes for health status display.
Usage
After execution:
-
Restart the server if running:
cd banking_app
python server.py
-
Open http://localhost:8080
-
Click "Cash Position" button to see the formatted treasury report
Expected Output
The Cash Position report displays:
- Summary: Total cash, available credit, liquidity ratio, health status
- Account Breakdown: All 5 bank accounts with balances
- Credit Facilities: Revolving credit limit and utilization
- Recommendations: Based on current liquidity status