Engineering Team Metrics and Insights Guide
Rabetbase CLI turns all of your team's SQL, BFF, and datasets into queryable, structured data assets. It's not just a developer productivity tool -- it's infrastructure for AI-driven business processes. When all development activity is captured on the platform, AI can answer questions that previously required manual judgment: Who has the highest code reuse rate? Who is reinventing the wheel? Where is the architectural debt hiding? How do you quantify team contributions?
Fundamentally, this is about using AI to continuously monitor team health, ensure architectural consistency, and discover collaboration blind spots -- rather than relying on subjective assessments or post-mortem reviews. This handbook is an execution guide for AI Agents. When users make requests of the following types, the AI follows the corresponding execution paths.
Case 1: Analyze SQL Reuse
User prompt examples:
"Analyze the team's SQL reuse situation" "Which SQL queries are referenced by multiple BFF scripts" "Are there any orphaned SQL queries"
AI execution path:
# Step 1: Get the SQL list
rabetbase sql list --format json > /tmp/sql_list.json
# Step 2: Get the BFF list, iterate over each BFF's code, search for SQL references
rabetbase bff list --format json | jq -r '.[].id' | while read id; do
CODE=$(rabetbase bff detail "$id" --format json | jq -r '.code // ""')
echo "=== BFF: $id ==="
for sql in $(cat /tmp/sql_list.json | jq -r '.[].sqlCode'); do
echo "$CODE" | grep -q "$sql" && echo " -> $sql"
done
done
Output format:
SQL Reuse Rate:
+--------------------+----------+------------------------+
| SQL | Refs | Level |
+--------------------+----------+------------------------+
| get_user_profile | 8 | Core Asset |
| get_order_list | 5 | High Reuse |
| debug_v3 | 1 | Orphan |
+--------------------+----------+------------------------+
Case 2: Detect Duplicate BFF Code (DRY Violations)
User prompt examples:
"Are there any duplicate BFF scripts" "Which BFF scripts look similar" "What DRY violations exist"
AI execution path:
# Collect all BFF code into files
rabetbase bff list --format json | jq -r '.[].id' | while read id; do
NAME=$(rabetbase bff detail "$id" --format json | jq -r '.name')
CODE=$(rabetbase bff detail "$id" --format json | jq -r '.code // ""')
echo "=== $NAME ===" >> /tmp/bff_all.txt
echo "$CODE" >> /tmp/bff_all.txt
echo "" >> /tmp/bff_all.txt
done
Then use Python in Claude Code for similarity comparison:
import subprocess, json, difflib
bff_list = json.loads(subprocess.run(
['rabetbase', 'bff', 'list', '--format', 'json'], capture_output=True, text=True
).stdout)
bffs = {}
for b in bff_list:
detail = json.loads(subprocess.run(
['rabetbase', 'bff', 'detail', b['id'], '--format', 'json'],
capture_output=True, text=True
).stdout)
bffs[b['name']] = detail.get('code', '')
for name_a, code_a in bffs.items():
for name_b, code_b in bffs.items():
if name_a >= name_b: continue
ratio = difflib.SequenceMatcher(None, code_a, code_b).ratio()
if ratio > 0.7:
print(f"Warning - DRY violation: {name_a} {name_b} (similarity {ratio:.0%})")
Output format:
DRY Violations:
- user/listHandler.ts user/listV2.ts (82%)
- order/priceCalc.ts order/priceCalcLegacy.ts (91%)
Case 3: View the Full Team Data Model
User prompt examples:
"What datasets does the team have" "What are the relationships between datasets" "Are there any orphaned datasets"
AI execution path:
# Dataset list
rabetbase dataset list --format json | jq '.'
# Dataset relationship graph (PK/FK/JOIN)
rabetbase dataset links --format json | jq '.'
Find orphaned datasets (no relationships):
rabetbase dataset links --format json | jq '
[.datasets[] |
select(. as $ds |
[.links[] |
select(.fromDataset == $ds.name or .toDataset == $ds.name)] |
length == 0
) |
.name
]
'
Case 4: Team Contribution Statistics (Aggregated by Person)
User prompt examples:
"Who wrote the most SQL on the team" "How many new BFF scripts were added this week" "How much code did each person contribute"
AI execution path:
# SQL aggregated by creator
rabetbase sql list --format json | jq '
group_by(.createdBy // "Unknown") |
map({author: .[0].createdBy, count: length, sqlCodes: [.[]|.sqlCode]})
'
# BFF aggregated by creator
rabetbase bff list --format json | jq '
group_by(.createdBy // "Unknown") |
map({author: .[0].createdBy, count: length, bffIds: [.[]|.id]})
'
Output format:
Contribution Heatmap:
+----------+--------+--------+
| Developer| SQL # | BFF # |
+----------+--------+--------+
| zhangsan | 12 | 8 |
| lisi | 9 | 5 |
| Unknown | 20 | 7 |
+----------+--------+--------+
Case 5: Search for Existing Solutions
User prompt examples:
"Is there an existing order SQL query" "Are there any user-related BFF scripts" "Search all datasets containing xxx"
AI execution path:
# Search SQL
rabetbase sql list --format json | jq '
[.[] | select(.sqlCode | test("order"; "i"))]
'
# Search BFF
rabetbase bff list --format json | jq '
[.[] | select(.name | test("user"; "i"))]
'
# Search datasets
rabetbase dataset list --format json | jq '
[.[] | select(.name | test("campaign"; "i"))]
'
Case 6: Quick Team Asset Overview (New Member Onboarding)
User prompt examples:
"Quick overview of the team's development activity" "What assets does the team have" "Give me a global overview"
AI execution path:
# Pull all data at once
rabetbase sql list --format json > /tmp/sql.json
rabetbase bff list --format json > /tmp/bff.json
rabetbase dataset list --format json > /tmp/dataset.json
rabetbase dataset links --format json > /tmp/links.json
# Statistics
echo "=== Team Asset Overview ==="
echo "SQL total: $(jq 'length' /tmp/sql.json)"
echo "BFF total: $(jq 'length' /tmp/bff.json)"
echo "Dataset total: $(jq 'length' /tmp/dataset.json)"
echo "Dataset links: $(jq '[.links] | flatten | length' /tmp/links.json)"
Case 7: Which Datasets Does a BFF Depend On
User prompt examples:
"Which datasets does a specific BFF use" "What data does the getUserProfile BFF depend on"
AI execution path:
# First find the BFF ID
rabetbase bff list --format json | jq '.[] | {name, id}'
# View a single BFF's details (including code content)
rabetbase bff detail <id> --format json | jq '{name, code}'
Search the code for dataset_ prefixes or dataset name references to identify dependencies.
Prerequisites: Confirm Environment and Login
For all of the above cases, confirm the following before executing:
# Check login
rabetbase auth login 2>&1 | head -3
# Confirm current application
rabetbase app list
rabetbase app use --appcode <code>
This document is for AI Agents performing engineering insights | Based on rabetbase-cli existing commands