name: bfc-run-prod-user-locally description: | Run BFC (cost basis computation) locally using production user data dumped from BigQuery. Use when: (1) profiling BFC memory/performance for a specific user, (2) debugging a production BFC failure offline, (3) testing in-memory lot processing changes against real data. Covers the full pipeline: BQ dump, local import, BFC enqueue, monitoring, and cleanup. author: Di Wen version: 1.0.0 date: 2026-04-13
| name | bfc-knowledge-base |
|---|---|
| description | Knowledge base for BFC (Batched Financial Calculator) for cost basis runs in accounting. Use when working with cost basis runs, BFC workflows, queue routing, job scheduling, concurrency control, or debugging stuck jobs. |
| allowed-tools | Read, Grep, Glob, Bash, Task |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript: Promise.all([ | |
| import("https://unpkg.com/turndown@6.0.0?module"), | |
| import("https://unpkg.com/@tehshrike/readability@0.2.0"), | |
| ]).then(async ([{ default: Turndown }, { default: Readability }]) => { | |
| /* Optional vault name */ | |
| const vault = ""; | |
| /* Optional folder name such as "Clippings/" */ | |
| const folder = "/2 Cards"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare function sayHello(): void; | |
| sayHello(); | |
| class Foo { | |
| constructor( | |
| public num: i32 | |
| ) {} | |
| } | |
| export function add(x: i32, y: i32): i32 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # sudo gem install bson | |
| # sudo gem install bson_ext | |
| # sudo gem install yajl-ruby | |
| # sudo gem install json | |
| # sudo gem install msgpack | |
| require 'rubygems' | |
| require 'benchmark' | |
| require 'yaml' | |
| require 'bson' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::collections::HashMap; | |
| macro_rules! impl_attrs { | |
| () => { | |
| pub fn get_attr(&self, key: &str) -> Option<&str> { | |
| self.attrs.get(key).map(|s| s.as_str()) | |
| } | |
| pub fn with_attrs(mut self, attrs: &[(&str, &str)]) -> Self { | |
| self.attrs = attrs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn find_largest_1<T: PartialOrd + Copy>(list: &[T]) -> T { | |
| let mut largest = list[0]; | |
| for number in list { | |
| if *number > largest { | |
| largest = *number; | |
| } | |
| } | |
| largest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "bundler/setup" | |
| require "kafka" | |
| def foo(msg) | |
| puts "=="*50 | |
| kafka = Kafka.new( | |
| seed_brokers: ["shopify.railgun:9092"], | |
| client_id: "flow_rails_whatever", | |
| logger: Logger.new(STDOUT) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "bundler/setup" | |
| require "kafka" | |
| def foo(msg) | |
| puts "=="*50 | |
| kafka = Kafka.new( | |
| seed_brokers: ["shopify.railgun:9092"], | |
| client_id: "flow_rails_whatever", | |
| logger: Logger.new(STDOUT) | |
| ) |
NewerOlder