Communitygithub.com

AppFolio 除錯套件

收集 AppFolio API 除錯證據以支援工單。

AppFolio 除錯套件 是什麼?

此技能(觸發詞:appfolio debug)會從 AppFolio 物業管理 API 整合中收集診斷證據,用於支援升級與根本原因分析。它能擷取對 properties、tenants 及 work_orders 端點的 API 連線狀態、使用客戶端憑證對進行驗證、來自整合管道的近期錯誤日誌,以及 SDK 版本資訊。最終產出的壓縮套件能讓支援工程師無需直接存取您的環境,即可診斷連線失敗、驗證拒絕與資料同步問題。此技能主要設計用於 Claude Code、Cursor 或 Codex 等 AI 代理平台,並透過 bash 腳本安全地收集唯讀中繼資料(狀態碼、延遲、速率限制標頭、日誌檔案清單),絕不擷取回應主體或原始日誌內容。

相容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/HEAD/plugins/saas-packs/appfolio-pack/skills/appfolio-debug-bundle

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

AppFolio 除錯套件 是做什麼的?

概述

此除錯套件從 AppFolio 物業管理 API 整合收集診斷證據,用於支援升級與根本原因分析。它會擷取針對 properties、tenants 及 work_orders 端點的 API 連線狀態、使用客戶端憑證對進行驗證、來自整合管道的近期錯誤日誌,以及 SDK 版本資訊。最終的壓縮套件能讓支援工程師無需即時存取您的環境,即可診斷連線失敗、驗證拒絕與資料同步問題。

前置條件

  • 已安裝 curl、jq、tar
  • 已設定 APPFOLIO_CLIENT_ID 與 APPFOLIO_CLIENT_SECRET(基本驗證憑證對)
  • 已將 APPFOLIO_BASE_URL 設定為您的 Stack API 基礎網址(例如 https://yourcompany.appfolio.com/api/v1)

指示

  1. 取得事件核准,並定義受影響的時間範圍、投資組合與安全唯讀探測;切勿僅因資料可用就收集租戶、租約、付款或原始日誌內容。
  2. 建立僅包含經過編輯的設定狀態、提供者狀態/延遲、速率限制標頭與套件版本的套件;確保憑證不出現在命令列參數中。
  3. 在分享前檢閱每個檔案,使用加密或經核可的支援管道傳送封存檔,並依據事件政策刪除本機副本。
  4. 若證據需要機敏記錄,請停止並取得另行核准的最小匯出,而非擴充此通用除錯套件。

除錯收集腳本

#!/bin/bash
set -euo pipefail
BUNDLE="debug-appfolio-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE"

NETRC_FILE="$(mktemp)"
trap 'rm -f "$NETRC_FILE"' EXIT
chmod 600 "$NETRC_FILE"
APPFOLIO_HOST="${APPFOLIO_BASE_URL#https://}"
APPFOLIO_HOST="${APPFOLIO_HOST%%/*}"
printf 'machine %s login %s password %s\n' "$APPFOLIO_HOST" \
  "$APPFOLIO_CLIENT_ID" "$APPFOLIO_CLIENT_SECRET" > "$NETRC_FILE"

probe() {
  endpoint="$1"
  curl -s -o /dev/null -w 'HTTP %{http_code} in %{time_total}s\n' \
    --netrc-file "$NETRC_FILE" "${APPFOLIO_BASE_URL}/${endpoint}?per_page=1" \
    || printf 'UNREACHABLE\n'
}

# 環境檢查
echo "=== Environment ===" > "$BUNDLE/environment.txt"
echo "Base URL: ${APPFOLIO_BASE_URL:-NOT SET}" >> "$BUNDLE/environment.txt"
echo "Client ID: ${APPFOLIO_CLIENT_ID:+SET (redacted)}" >> "$BUNDLE/environment.txt"
echo "Client Secret: ${APPFOLIO_CLIENT_SECRET:+SET (redacted)}" >> "$BUNDLE/environment.txt"
echo "Node: $(node -v 2>/dev/null || echo 'not installed')" >> "$BUNDLE/environment.txt"
echo "Timestamp: $(date -u)" >> "$BUNDLE/environment.txt"

# 僅 API 連線中繼資料 — 絕不將 API 回應主體寫入此套件。
echo "=== API Health ===" > "$BUNDLE/api-health.txt"
probe properties >> "$BUNDLE/api-health.txt"

# Work orders 端點探測
echo "=== Work Orders ===" > "$BUNDLE/work-orders.txt"
probe work_orders >> "$BUNDLE/work-orders.txt"

# Tenant 端點探測
echo "=== Tenants ===" > "$BUNDLE/tenants.txt"
probe tenants >> "$BUNDLE/tenants.txt"

# 僅記錄日誌清單;原始日誌可能包含租戶與財務資料。
echo "=== Log Inventory ===" > "$BUNDLE/app-logs.txt"
find /var/log/appfolio-sync -maxdepth 1 -type f -printf '%f %s bytes\n' 2>/dev/null \
  || echo "No sync logs found" >> "$BUNDLE/app-logs.txt"

# 速率限制標頭
echo "=== Rate Limits ===" > "$BUNDLE/rate-limits.txt"
curl -sI --netrc-file "$NETRC_FILE" \
  "${APPFOLIO_BASE_URL}/properties?per_page=1" 2>/dev/null | grep -i "x-rate\|retry-after\|x-ratelimit" >> "$BUNDLE/rate-limits.txt" || echo "No rate limit headers" >> "$BUNDLE/rate-limits.txt"

# 套件版本
echo "=== Dependencies ===" > "$BUNDLE/deps.txt"
npm ls 2>/dev/null | grep -i appfolio >> "$BUNDLE/deps.txt" || echo "No AppFolio npm packages found" >> "$BUNDLE/deps.txt"

tar -czf "$BUNDLE.tar.gz" "$BUNDLE" && rm -rf "$BUNDLE"
echo "Bundle: $BUNDLE.tar.gz"

分析套件

tar -xzf debug-appfolio-*.tar.gz
cat debug-appfolio-*/environment.txt     # 確認憑證已設定
cat debug-appfolio-*/api-health.txt      # 檢查 HTTP 狀態與延遲
cat debug-appfolio-*/rate-limits.txt     # 確認未被限流
jq '.errors' debug-appfolio-*/work-orders.txt 2>/dev/null  # 解析錯誤負載

常見問題

症狀在套件中檢查修正
所有端點回傳 401environment.txt 顯示用戶端 ID/密碼未設定在環境變數中設定 APPFOLIO_CLIENT_ID 與 APPFOLIO_CLIENT_SECRET
tenants 回傳 403 禁止tenants.txt HTTP 403Stack API 範圍遺漏;在 AppFolio 合作夥伴入口網站請求租戶讀取權限
429 請求過多rate-limits.txt 顯示 retry-after 標頭減速並實作指數退避;AppFolio 允許每分鐘 120 次請求
work orders 逾時api-health.txt 顯示時間 > 30 秒減少 per_page 參數;按 updated_since 篩選以縮小結果集
空置產清單api-health.txt 回傳 []確認 APPFOLIO_BASE_URL 指向正確的投資組合;檢查物業群組篩選器
SSL 憑證錯誤api-health.txt 顯示 curl SSL 錯誤更新 CA 套件:sudo update-ca-certificates;檢查代理設定

輸出

  • 一份可檢閱、經過編輯的套件,包含設定存在性、端點狀態與延遲、速率限制標頭、日誌清單與相依性中繼資料
  • 一份支援交接收據,說明事件範圍與機敏資料排除項目,而非封裝租戶、付款或原始應用程式記錄
  • 當無法安全收集所需證據時,執行失敗關閉決策

錯誤處理

將探測失敗視為探測失敗的證據,而非允許擷取更大的回應或繞過憑證控制。對於 401/403,與憑證擁有者確認受管用戶端設定;對於 429,保留速率標頭並暫停進一步探測;對於 5xx 或逾時,僅收集經過編輯的時序/狀態證據,並檢查提供者狀態頁面。若支援人員需要特定租戶或付款記錄,請使用另行核准的最小匯出,並附帶其自己的保留與存取控制。

範例

針對生產同步逾時,建立涵蓋受影響時間範圍與一個 properties 安全唯讀探測的套件。確認其中包含狀態/延遲、速率標頭、相依性版本與日誌檔案中繼資料—但不包含任何回應主體、憑證、租戶或財務資料。在上傳至核可的加密支援管道前,檢閱封存檔。若檢閱發現原始負載或機密,請刪除封存檔,視需要輪換憑證,並在升級前重新產生最小化的套件。

自動化健康檢查

async function checkAppFolioHealth(): Promise<{
  status: string;
  latencyMs: number;
  endpoints: Record<string, number>;
}> {
  const baseUrl = process.env.APPFOLIO_BASE_URL;
  const creds = Buffer.from(
    `${process.env.APPFOLIO_CLIENT_ID}:${process.env.APPFOLIO_CLIENT_SECRET}`
  ).toString("base64");
  const headers = { Authorization: `Basic ${creds}` };
  const endpoints = ["properties", "tenants", "work_orders"];
  const results: Record<string, number> = {};
  const start = Date.now();
  for (const ep of endpoints) {
    const res = await fetch(`${baseUrl}/${ep}?per_page=1`, { headers });
    results[ep] = res.status;
  }
  return {
    status: Object.values(results).every((s) => s === 200) ? "healthy" : "degraded",
    latencyMs: Date.now() - start,
    endpoints: results,
  };
}

資源

後續步驟

請參閱 appfolio-rate-limits。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page for positioning, plan a conversion-optimized page layout, or design a launch page. Examples: "landing page for product launch", "conversion-optimized layout for SaaS

jeremylongshore/tons-of-skills-marketplace

Use when asked to design growth-optimized landing pages, activation funnel layouts, or experiment-friendly page structures. Examples: "growth-optimized landing", "activation funnel layout", "A/B testable page

jeremylongshore/tons-of-skills-marketplace

Use when asked to structure a landing page, design page layout for conversion, or plan landing page information architecture. Examples: "landing page structure for SaaS", "conversion-optimized layout

jeremylongshore/tons-of-skills-marketplace

Generate polished demo videos from a single prompt. Use when the user asks to create a demo video, product walkthrough, feature showcase, or animated presentation. Trigger with "make a demo video", "create a product video", "demo walkthrough", or "feature showcase video".

jeremylongshore/tons-of-skills-marketplace

Track cryptocurrency portfolio with real-time valuations, allocation analysis, and P&L tracking. Use when checking portfolio value, viewing holdings breakdown, analyzing allocations, or exporting portfolio data. Trigger with phrases like "show my portfolio", "check crypto holdings", "portfolio allocation", "track my crypto", or "export portfolio".

jeremylongshore/tons-of-skills-marketplace

Runs the full release workflow for the current project. Commits any uncommitted changes, pushes to remote, creates and merges a PR if on a feature branch, determines the next semver version from conventional commits, creates an annotated git tag and GitHub release with generated notes, cleans up merged branches, and returns to a clean main. Use when the user says promote, ship, release, commit and push, tag and release, or get back to main.

jeremylongshore/tons-of-skills-marketplace

Agent skill at plugins/productivity/content-multiplier/skills/channel-formats/SKILL.md

jeremylongshore/tons-of-skills-marketplace

Operate an evidence-backed editorial queue, balance topic and format coverage, schedule approved drafts, and reconcile backlog state with the publishing system. Use when choosing or scheduling the next blog work. Trigger with "show the editorial calendar" or "pick the next topic".

jeremylongshore/tons-of-skills-marketplace

Configure CI/CD pipeline for AppFolio property management integrations. Trigger: "appfolio CI".

jeremylongshore/tons-of-skills-marketplace

Diagnose and fix common AppFolio API integration errors. Trigger: "appfolio error".

jeremylongshore/tons-of-skills-marketplace

Build property management dashboard with AppFolio API data. Trigger: "appfolio property dashboard".

jeremylongshore/tons-of-skills-marketplace

Automate tenant management and lease operations with AppFolio. Trigger: "appfolio tenant management".

jeremylongshore/tons-of-skills-marketplace

Deploy AppFolio integration service to cloud infrastructure. Trigger: "deploy appfolio".

jeremylongshore/tons-of-skills-marketplace

Query AppFolio properties, units, and tenants via REST API. Trigger: "appfolio hello world".

jeremylongshore/tons-of-skills-marketplace

Configure AppFolio Stack API authentication with OAuth 2.0. Use when setting up property management API access, registering as an AppFolio Stack partner, or configuring client credentials for API calls. Trigger: "install appfolio", "setup appfolio", "appfolio auth", "appfolio API key".

jeremylongshore/tons-of-skills-marketplace

Set up local development for AppFolio property management API integration. Trigger: "appfolio local dev".

jeremylongshore/tons-of-skills-marketplace

Production readiness checklist for AppFolio integrations. Trigger: "appfolio production checklist".

jeremylongshore/tons-of-skills-marketplace

Handle AppFolio API rate limits with throttling and backoff. Trigger: "appfolio rate limit".

jeremylongshore/tons-of-skills-marketplace

Reference architecture for AppFolio property management integration. Trigger: "appfolio architecture".

jeremylongshore/tons-of-skills-marketplace

Apply production-ready patterns for AppFolio REST API integration. Trigger: "appfolio patterns".

相關技能