将多个流水线脚本链接成单个顺序或并行工作流。充当 PrecisionLedger 流水线脚本的“播放列表”。适用于任务需...
Chain multiple PrecisionLedger pipeline scripts into a single coordinated workflow. Think of it as a "playlist" for pipeline scripts — run them in sequence or parallel, with data flowing between steps.
Use this skill when:
Do NOT use for:
All available pipelines live in scripts/pipelines/ with a manifest at scripts/pipelines/manifest.json.
Current production pipelines (19 scripts, all have argparse):
PipelineScriptTypical Orderpl-quick-comparepl-quick-compare.py1 (income statement first)pl-deep-analysispl-deep-analysis.py2 (after quick compare flags)bs-quick-comparebs-quick-compare.py3 (balance sheet)bs-deep-analysisbs-deep-analysis.py4 (after BS flags)scf-quick-comparescf-quick-compare.py5 (cash flow)scf-deep-analysisscf-deep-analysis.py6 (after SCF flags)financial-ratiosfinancial-ratios.py7 (cross-statement ratios)bank-reconciliationbank-reconciliation.pyparallel with abovepayroll-reconciliationpayroll-reconciliation.pyparallel with abovear-collectionsar-collections.pyparallel (if client has AR)budget-builderbudget-builder.pyad-hoccash-flow-forecastcash-flow-forecast.pyafter closeclient-dashboardclient-dashboard.pyfinal (needs all data)doc-ingestiondoc-ingestion.pypre-closedocument-ingestiondocument-ingestion.pypre-closefinancial-packagefinancial-package.pystandalone TTM packagemonth-end-closemonth-end-close.pyorchestrates close checklisttax-package-preptax-package-prep.pyyear-end onlyvendor-compliance-1099vendor-compliance-1099.pyyear-end only
text
--slug <client-slug> QBO company identifier (required)
--start YYYY-MM-DD Period start
--end YYYY-MM-DD Period end
--out <directory> Output directory (default: ~/Desktop)
--sandbox Use QBO sandbox
Parse the user's request to determine:
clients/*/sop.mdRead the client's SOP to determine which pipelines apply:
Pipelines have natural dependencies:
text
Layer 0 (Pre-Close — parallel):
doc-ingestion
bank-reconciliation
payroll-reconciliation
Layer 1 (Close):
month-end-close (reads outputs from Layer 0)
Layer 2 (Analysis — parallel):
pl-quick-compare
bs-quick-compare
scf-quick-compare
Layer 3 (Deep Analysis — parallel, depends on Layer 2 flags):
pl-deep-analysis (only if PL flags > 0)
bs-deep-analysis (only if BS flags > 0)
scf-deep-analysis (only if SCF flags > 0)
Layer 4 (Cross-Statement):
financial-ratios
cash-flow-forecast
Layer 5 (Delivery):
client-dashboard
financial-package
For each layer:
After all layers complete, produce a summary:
text
Layers: 0 → 1 → 2 → 3 → 4 → 5
Pipelines: bank-rec → close → PL/BS/SCF quick → deep (if flagged) → ratios → dashboard
Trigger: "full close for [client]", "complete close [month]"
text
Layers: 2 → 4 → 5
Pipelines: PL/BS/SCF quick compare → ratios → dashboard
Trigger: "quick analysis for [client]", "variance package [month]"
text
Layers: 0 → 1 → 2 → tax-specific
Pipelines: bank-rec → close → PL → tax-package-prep → vendor-1099
Trigger: "tax package for [client]", "year-end prep [year]"
text
Layers: quick → deep
Pipelines: [statement]-quick-compare → [statement]-deep-analysis
Trigger: "deep dive P&L", "analyze balance sheet in detail"
text
Layers: single
Pipelines: financial-package.py (self-contained TTM generator)
Trigger: "financial package", "TTM statements"
bash
# Common pattern for all pipelines
SCRIPTS=~/.openclaw/workspace/scripts/pipelines
SLUG="my-client"
MONTH_START="2026-03-01"
MONTH_END="2026-03-31"
OUT=~/Desktop/close-$SLUG-$(date +%Y%m)
# Layer 0 (parallel)
python3 $SCRIPTS/bank-reconciliation.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT &
python3 $SCRIPTS/payroll-reconciliation.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT &
wait
# Layer 1
python3 $SCRIPTS/month-end-close.py --slug $SLUG --month ${MONTH_START:0:7} --out $OUT
# Layer 2 (parallel)
python3 $SCRIPTS/pl-quick-compare.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT &
python3 $SCRIPTS/bs-quick-compare.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT &
python3 $SCRIPTS/scf-quick-compare.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT &
wait
# Layer 3 (conditional)
# Only run deep analysis if quick compare flagged material items
python3 $SCRIPTS/pl-deep-analysis.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT
python3 $SCRIPTS/bs-deep-analysis.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT
python3 $SCRIPTS/scf-deep-analysis.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT
# Layer 4
python3 $SCRIPTS/financial-ratios.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT
python3 $SCRIPTS/cash-flow-forecast.py --slug $SLUG --out $OUT
# Layer 5
python3 $SCRIPTS/client-dashboard.py --slug $SLUG --start $MONTH_START --end $MONTH_END --out $OUT
Before running any chain, read clients/{slug}/sop.md to check:
The SOP is the authority. If the SOP says "no AR aging" (like SB Paulson — POS collection), skip ar-collections even in a full close chain.
node integrations/qbo-client/bin/qbo connect <slug> to refresh. Auto-detected by 401 response.All chain outputs go to a single directory:
text
~/Desktop/close-{slug}-{YYYYMM}/
├── PLCompare_{slug}_*.xlsx
├── BSCompare_{slug}_*.xlsx
├── SCFCompare_{slug}_*.xlsx
├── PLDeep_{slug}_*.xlsx
├── BSDeep_{slug}_*.xlsx
├── SCFDeep_{slug}_*.xlsx
├── FinancialRatios_{slug}_*.xlsx
├── BankRec_{slug}_*.xlsx
├── PayrollRec_{slug}_*.xlsx
├── ClientDashboard_{slug}_*.xlsx
├── CashFlow_{slug}_*.xlsx
├── chain-summary.json ← workflow metadata
└── chain-log.txt ← execution log