agentleFS
daangndaangn/stackflow/AGENTS.md

stackflow

AGENTS.md1k starsChanged 8 months agoMITView on GitHub

Stackflow is a JavaScript library that implements Stack Navigation UX commonly used in mobile applications (iOS/Android). It provides a framework-agnostic core with React integration for building hybrid apps and webviews with native-like navigation experiences. Key Features: - Stack-based navigation with state preservation - Native-like transition effects and iOS-style swipe back - Plugin system for extensibility - Framework agnostic core (currently React integration available) - Server-Side Rendering support - TypeScript support with strict typing Plugins can hook into various lifecycle events:…

Trending

Quiet since December.thin dataabout the whole repository

Dec 2025: 1 mentionJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the daangn/stackflow repository that our weekly crawl found: only 2 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about daangn/stackflow

The biggest 2 of 2 mentions linking to the repository that our crawl found. Each line is their own headline.

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repositoryOne other file it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Test files: *.spec.ts pattern

    line 99
  2. Distinctive:

    Event Sourcing: All state changes are driven by events

    line 125
  3. Very specific:

    Always use yarn commands (not npm)

    line 232

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Stackflow Project Memory

Project Overview

Stackflow is a JavaScript library that implements Stack Navigation UX commonly used in mobile applications (iOS/Android). It provides a framework-agnostic core with React integration for building hybrid apps and webviews with native-like navigation experiences.

Key Features:

  • Stack-based navigation with state preservation
  • Native-like transition effects and iOS-style swipe back
  • Plugin system for extensibility
  • Framework agnostic core (currently React integration available)
  • Server-Side Rendering support
  • TypeScript support with strict typing

Architecture

Core Components

  1. @stackflow/core (/core)
    • Event-driven architecture using domain events
    • Stack state management
    • Plugin system interface
    • Effect system for side effects
    • Transition state management
  2. @stackflow/react (/integrations/react)
    • React integration layer
    • Provides stackflow() factory function
    • <Stack /> component and useFlow() hooks
    • Activity component management
  3. @stackflow/plugin-basic-ui (/extensions/plugin-basic-ui)
    • Pre-built UI components for navigation
    • AppScreen component with app bar
    • Native-like themes (iOS Cupertino, Android Material)
    • Back button and close button components
    • Activity transition animations

Key Concepts

  • Activity: A screen/page in the navigation stack
  • Stack: Collection of activities with transition states
  • Event: Domain events that drive state changes (Pushed, Popped, Replaced, etc.)
  • Plugin: Extensions that can hook into lifecycle events
  • Effect: Side effects produced by state changes
  • Step: Sub-navigation within an activity

Project Structure

/
├── core/                    # Core library
├── integrations/           # Framework integrations
│   └── react/             # React integration
├── extensions/            # Official plugins and extensions
│   ├── link/             # Link component
│   ├── plugin-basic-ui/  # Basic UI components
│   ├── plugin-devtools/  # Development tools
│   ├── plugin-history-sync/ # Browser history sync
│   └── ...
├── demo/                  # Demo application
├── docs/                  # Documentation site (Next.js)
└── config/               # Configuration package

Development Commands

# Install dependencies
yarn install

# Development mode (watch and build all packages)
yarn dev

# Build all packages
yarn build

# Run tests
yarn test

# Type checking
yarn typecheck

# Format code
yarn format

# Lint code
yarn lint

# Release process
yarn release

# Canary release
yarn release:canary

Testing

  • Test files: *.spec.ts pattern
  • Run tests: yarn test
  • Tests are located alongside source files

Key Dependencies

  • React: >=16.8.0 (peer dependency)
  • TypeScript: ^5.5.3
  • Biome: Code formatting and linting
  • Ultra Runner: Monorepo task runner
  • Changesets: Version management and publishing

Plugin System

Plugins can hook into various lifecycle events:

  • onInit
  • onBeforePush/onPushed
  • onBeforePop/onPopped
  • onBeforeReplace/onReplaced
  • onBeforeStepPush/onStepPushed
  • onBeforeStepPop/onStepPopped
  • onBeforeStepReplace/onStepReplaced
  • onChanged (catch-all)

Important Patterns

  1. Event Sourcing: All state changes are driven by events
  2. Immutable State: Stack state is immutable and updated via reducers
  3. Effect System: Side effects are separated from state updates
  4. Plugin Architecture: Extensible through plugin hooks
  5. Type Safety: Extensive TypeScript types for activities and parameters

Common Tasks

Setting Up Navigation

import { stackflow } from "@stackflow/react";

export const { Stack, actions } = stackflow({
  config,
  components: {
    Main,
    Article,
  },
  plugins: [
    basicRendererPlugin(),
    basicUIPlugin({
      theme: "cupertino",
    }),
    historySyncPlugin({
      config,
      fallbackActivity: () => "Main",
    }),
  ],
});

Defining an Activity

import type { ActivityComponentType } from "@stackflow/react";
import { useFlow } from "@stackflow/react";

declare module "@stackflow/config" {
  interface Register {
    MyActivity: {
      title: string;
    };
  }
}

const MyActivity: ActivityComponentType<"MyActivity"> = () => {
  const { push } = useFlow();

  const onClick = () => {
    push("Article", {
      title: "Hello",
    });
  };

  return (
    <AppScreen appBar={{ title: "My Activity" }}>
      <div>
        My Activity
        <button onClick={onClick}>Go to article page</button>
      </div>
    </AppScreen>
  );
};

Creating a Plugin

stackflow({
  // ...
  plugins: [
    () => {
      return {
        key: "my-plugin",
        onPushed(actions, effect) {
          // actions.getStack()
          // actions.dispatchEvent(...)
          console.log("Pushed!");
          console.log("Effect:", effect);
        },
      };
    },
  ],
});

API Design

@stackflow/react uses a config-first approach for optimal loading performance:

  • Config-first approach: Activities and routes defined in @stackflow/config using defineConfig(), with React components injected separately via stackflow()
  • Direct imports: Hooks (useFlow, useStepFlow) and <Link> component imported directly from @stackflow/react
  • Loader API: Built-in data loading via useLoaderData without React dependencies for better performance
  • Lazy loading: Code splitting via lazy() for activity components
  • Enhanced type safety: Types inferred from config via declare module "@stackflow/config" register pattern

Build System

  • Uses esbuild for JavaScript/TypeScript compilation
  • Separate builds for CommonJS and ESM
  • TypeScript declarations generated separately
  • Monorepo managed with Yarn workspaces and ultra runner

Skills

  • React code review guidelines: .agents/skills/review-react/

Important Notes

  • Always use yarn commands (not npm)
  • The project uses Yarn Berry (v4)
  • Changesets are used for versioning
  • Biome is used for formatting/linting (not ESLint/Prettier)
  • Documentation site is built with Next.js and deployed to Cloudflare

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.