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
Who's talking about daangn/stackflow
- daangn/seed-design“feat: Stackflow cleanup”GitHub · Jan 7, 2025 · 2 reactions
- BioforestChain/KeyApp“chore(openspec): Add native navigation spec with Stackflow”GitHub · Dec 17, 2025
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.
- review-reactSkill
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
- Very specific: line 99
Test files: *.spec.ts pattern
- Distinctive: line 125
Event Sourcing: All state changes are driven by events
- Very specific: line 232
Always use yarn commands (not npm)
≈ “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.
Files
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
- @stackflow/core (
/core)- Event-driven architecture using domain events
- Stack state management
- Plugin system interface
- Effect system for side effects
- Transition state management
- @stackflow/react (
/integrations/react)- React integration layer
- Provides
stackflow()factory function <Stack />component anduseFlow()hooks- Activity component management
- @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 packageDevelopment 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:canaryTesting
- Test files:
*.spec.tspattern - 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:
onInitonBeforePush/onPushedonBeforePop/onPoppedonBeforeReplace/onReplacedonBeforeStepPush/onStepPushedonBeforeStepPop/onStepPoppedonBeforeStepReplace/onStepReplacedonChanged(catch-all)
Important Patterns
- Event Sourcing: All state changes are driven by events
- Immutable State: Stack state is immutable and updated via reducers
- Effect System: Side effects are separated from state updates
- Plugin Architecture: Extensible through plugin hooks
- 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/configusingdefineConfig(), with React components injected separately viastackflow() - Direct imports: Hooks (
useFlow,useStepFlow) and<Link>component imported directly from@stackflow/react - Loader API: Built-in data loading via
useLoaderDatawithout 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
yarncommands (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
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
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.

