stripe-projects
stripe projects
dag-context-bridger
Manages context passing between DAG nodes and spawned agents. Handles context summarization, selective forwarding, and token budget optimization. Activate on 'bridge context', 'pass context', 'summarize context', 'context management', 'agent context'. NOT for execution (use dag-parallel-executor)...
Full skill instructions
You are a DAG Context Bridger, an expert at managing context flow between DAG nodes and spawned agents. You optimize context passing to minimize token usage while preserving essential information for downstream tasks.
interface NodeContext {
nodeId: NodeId;
// Inherited context from dependencies
inherited: ContextFragment[];
// Context generated by this node
generated: ContextFragment;
// Context to forward to dependents
forwarded: ContextFragment[];
// Token accounting
tokens: {
inherited: number;
generated: number;
forwarded: number;
budget: number;
};
}
interface ContextFragment {
id: string;
sourceNode: NodeId;
type: 'input' | 'output' | 'summary' | 'metadata';
content: unknown;
tokenCount: number;
relevanceScore?: number;
createdAt: Date;
}
Pass all context from dependencies.
function fullForward(
dependencies: NodeContext[]
): ContextFragment[] {
return dependencies.flatMap(dep => [
...dep.inherited,
dep.generated,
]);
}
Use when: Token budget is ample, context is small.
Forward only the outputs from dependencies.
function outputOnly(
dependencies: NodeContext[]
): ContextFragment[] {
return dependencies.map(dep => dep.generated);
}
Use when: Only final results are needed, not process details.
Summarize context to fit within budget.
async function summarizedForward(
dependencies: NodeContext[],
tokenBudget: number
): Promise<ContextFragment[]> {
const allContext = fullForward(dependencies);
const totalTokens = sumTokens(allContext);
if (totalTokens <= tokenBudget) {
return allContext;
}
// Need to summarize
return await summarizeContext(allContext, tokenBudget);
}
Use when: Context exceeds token budget.
Forward only context relevant to downstream task.
function selectiveForward(
dependencies: NodeContext[],
downstreamTask: DAGNode,
relevanceThreshold: number
): ContextFragment[] {
const allFragments = dependencies.flatMap(dep => [
...dep.inherited,
dep.generated,
]);
return allFragments
.map(fragment => ({
...fragment,
relevanceScore: calculateRelevance(fragment, downstreamTask),
}))
.filter(f => f.relevanceScore >= relevanceThreshold)
.sort((a, b) => b.relevanceScore - a.relevanceScore);
}
Use when: Downstream task has specific context needs.
interface SummaryHierarchy {
brief: string; // ~100 tokens
standard: string; // ~500 tokens
detailed: string; // ~2000 tokens
full: string; // Original content
}
async function createHierarchicalSummary(
context: ContextFragment[]
): Promise<SummaryHierarchy> {
const full = serializeContext(context);
return {
full,
detailed: await summarize(full, 2000),
standard: await summarize(full, 500),
brief: await summarize(full, 100),
};
}
function selectSummaryLevel(
hierarchy: SummaryHierarchy,
tokenBudget: number
): string {
if (tokenBudget >= countTokens(hierarchy.full)) {
return hierarchy.full;
}
if (tokenBudget >= countTokens(hierarchy.detailed)) {
return hierarchy.detailed;
}
if (tokenBudget >= countTokens(hierarchy.standard)) {
return hierarchy.standard;
}
return hierarchy.brief;
}
interface ProgressiveContext {
essential: ContextFragment[]; // Always included
important: ContextFragment[]; // Include if budget allows
optional: ContextFragment[]; // Include only if ample budget
}
function buildProgressiveContext(
fragments: ContextFragment[],
tokenBudget: number
): ContextFragment[] {
const categorized = categorizeByImportance(fragments);
const result: ContextFragment[] = [];
let usedTokens = 0;
// Always include essential
for (const fragment of categorized.essential) {
result.push(fragment);
usedTokens += fragment.tokenCount;
}
// Add important if room
for (const fragment of categorized.important) {
if (usedTokens + fragment.tokenCount <= tokenBudget) {
result.push(fragment);
usedTokens += fragment.tokenCount;
}
}
// Add optional if still room
for (const fragment of categorized.optional) {
if (usedTokens + fragment.tokenCount <= tokenBudget) {
result.push(fragment);
usedTokens += fragment.tokenCount;
}
}
return result;
}
contextBridging:
nodeId: process-data
inheritance:
strategy: selective
relevanceThreshold: 0.7
maxTokens: 4000
forwarding:
strategy: summarized
summaryLevel: standard
preserveFields:
- key_findings
- errors
- metadata
optimization:
enableCaching: true
compressionLevel: medium
deduplication: true
interface TokenBudget {
total: number; // Total budget for execution
perNode: number; // Default per-node budget
contextReserve: number; // Reserved for context passing
outputReserve: number; // Reserved for output
}
function allocateContextBudget(
dag: DAG,
totalBudget: number
): Map<NodeId, number> {
const budgets = new Map<NodeId, number>();
const nodeCount = dag.nodes.size;
// Reserve 30% for context passing
const contextBudget = totalBudget * 0.3;
const perNodeBudget = contextBudget / nodeCount;
for (const [nodeId, node] of dag.nodes) {
// Adjust based on dependency count
const depCount = node.dependencies.length;
const adjustment = 1 + (depCount * 0.1);
budgets.set(nodeId, Math.floor(perNodeBudget * adjustment));
}
return budgets;
}
contextReport:
dagId: research-pipeline
nodeContexts:
- nodeId: gather-sources
inherited: 0
generated: 1500
forwarded: 1500
- nodeId: analyze-sources
inherited: 1500
generated: 2000
forwarded: 800 # Summarized
- nodeId: generate-report
inherited: 800
generated: 3000
forwarded: 0
totals:
totalContextTokens: 8800
summarizationSavings: 2700
averageForwardRatio: 0.65
dag-parallel-executordag-performance-profilerContext flows. Information preserved. Tokens optimized.
stripe projects
Harvest every `ponytail:` comment in the codebase into a debt ledger, so the deliberate shortcuts and deferrals ponytail leaves behind get tracked instead of rotting into "later means never". One-shot report, changes nothing.
okx dex market
okx agentic wallet
gmgn portfolio
okx dapp discovery
okx agent payments protocol
Stripe payment processing with checkout sessions, subscriptions, webhooks, and customer management.
Build comprehensive 3-5 year financial models with revenue projections, cost structures, cash flow analysis, and scenario planning for early-stage startups. Use this skill when creating financial projections, calculating burn rate or runway, modeling fundraising scenarios, or preparing investor-r...
Stock and cryptocurrency analysis with portfolio management and multi-dimensional scoring.
Real-time crypto derivatives positioning, whale tracking, liquidations, and institutional ETF flows across 37 specialized tools.
Master dbt (data build tool) for analytics engineering with model organization, testing, documentation, and incremental strategies. Use when building data transformations, creating data models, or implementing analytics engineering best practices.
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Stay Ahead with Finalle.ai: The Ultimate Financial News and Tools Platform
AI-powered Pine Script code generator for TradingView
Research stocks at the speed of thought.
Empower your investment strategies with AI signals, option flow data, and advanced chart patterns.
Danelfin review covering its AI stock and ETF scores, rankings, portfolio tools, current pricing, strengths, risks, and alternatives for investors.
A software for comprehensive market sentiment analysis.
'Stock Correlations' App by Freshly.ai: Reveal Stock Patterns and Trends