Enable any team to share ownership and governance equitably through earned contribution, not capital ownership.
- Overview
- Features
- Tech Stack
- Getting Started
- Development
- Environment Variables
- Architecture
- Deployment
- Documentation
- Contributing
The Cooperation Toolkit provides composable infrastructure for task tracking, peer review, attestation, and equity/governance updates. It enables teams to share ownership and governance equitably through earned contribution (COOK), preserving team purpose and preventing capture.
-
Earned Governance: Authority accrues through valuable work
-
Transparency over Permission: Visibility replaces constant voting
-
Work-Weighted Influence: Influence is proportional to earned contribution units (COOK)
-
Opportunity to Object: Structured objection windows are built-in
-
Anti-Capture by Design: Governance power cannot be purchased or transferred, only earned
-
Portability: Contributors own their work history and attestations
Traditional organizational structures:
- Concentrate power via capital rather than contribution
- Fail to fairly reward early or underfunded contributors
- Are vulnerable to mission drift, hostile takeover, or silent capture
- Provide little portable proof of real work for contributors
The Cooperation Toolkit solves this by providing a contribution-to-governance pipeline where work is tracked, valued, reviewed, and automatically updates governance weight and equity.
- ✅ User Management & Authentication - Firebase Auth with email/password
- ✅ Team Management - Create teams, assign roles (Contributor, Reviewer, Steward, Admin)
- ✅ Task Management - Full task lifecycle with states (Backlog → Ready → In Progress → Review → Done)
- ✅ COOK Valuation System - Assign COOK values to tasks, track through workflow
- ✅ Peer Review Workflow - Multi-reviewer system with COOK-based reviewer requirements
- ✅ Project Boards - Customizable boards with visibility levels (Public, Team-Visible, Restricted)
- ✅ Security Rules - Role-based access control with Firestore security rules
- ✅ GitHub Integration - First-class GitHub Projects integration with bidirectional sync
- ✅ COOK Ledger & Attestations - Immutable ledger, verifiable attestations with Merkle tree hashing
- ✅ Governance System - COOK-weighted voting, objection windows, committee selection via weighted lottery
- ✅ AI Assistance - Natural language task creation, review summaries, checklists, retrospectives
- ✅ Slack Integration - Primary interface via Slack commands and real-time notifications
Task Management:
- Create, update, and track tasks with COOK values
- Sequential state transitions with validation
- Task archiving and restoration
- GitHub Projects synchronization
COOK System:
- COOK states: Draft → Provisional → Locked → Final
- COOK caps to prevent dominance
- COOK decay functions for time-based weighting
- COOK velocity tracking
- Time-based aggregation (monthly/yearly)
Review System:
- Multi-reviewer requirements based on COOK value
- Review actions: Approve, Object, Comment, Escalate
- AI-generated review summaries and checklists
- Review progress tracking
Governance:
- Governance weight derived from cumulative COOK
- COOK-weighted voting and objections
- Objection windows with automatic voting triggers
- Committee selection via weighted lottery
- Policy and constitutional change tracking
- Comprehensive audit logs
Attestations:
- Verifiable attestations on task completion
- Merkle tree hashing for cryptographic verification
- Portable across teams
- Immutable and auditable
AI Features:
- Natural language task creation
- Playbook-aware task suggestions
- AI-generated review summaries
- AI-generated review checklists
- AI-generated team retrospectives
Slack Integration:
/cookslash commands for all operations- Real-time notifications for events
- Task management via Slack
- COOK tracking via Slack
- Review workflow via Slack
- Governance actions via Slack
- Next.js 16.1 - React framework with App Router
- React 19.2 - UI library
- TypeScript 5.0 - Type safety
- Material UI 7.3 - Component library
- Zustand 5.0 - State management
- Zod 4.2 - Schema validation
- Firebase Firestore - NoSQL database
- Firebase Auth - Authentication
- Firebase Cloud Functions - Serverless functions
- Firestore Security Rules - Database-level security
- GitHub API - GitHub Projects integration
- Slack API - Slack bot and notifications
- OpenAI/Anthropic - AI services
- ESLint - Code linting
- Prettier - Code formatting
- TypeScript - Type checking
- Node.js 18+ and npm/yarn/pnpm
- Firebase account and project
- (Optional) OpenAI or Anthropic API key for AI features
- (Optional) Slack app for Slack integration
- (Optional) GitHub app for GitHub integration
-
Clone the repository
git clone <repository-url> cd Nebula
-
Install dependencies
npm install cd functions && npm install && cd ..
-
Set up Firebase
- Create a Firebase project at Firebase Console
- Enable Firestore, Authentication (Email/Password)
- Get your Firebase config from Project Settings > General > Your apps
-
Configure environment variables
cp .env.example .env.local
Edit
.env.localwith your Firebase configuration. See Environment Variables for details. -
Set up Firestore security rules
firebase deploy --only firestore:rules
-
Run development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
- Register an account at
/register - Complete onboarding - Interactive tutorial covering key features
- Create or join a team - Start using the Cooperation Toolkit
Nebula/
├── app/ # Next.js App Router pages
│ ├── (auth)/ # Authentication pages
│ ├── (dashboard)/ # Dashboard pages
│ │ ├── onboarding/ # User onboarding flow
│ │ ├── profile/ # User profile
│ │ └── teams/ # Team management
│ ├── api/ # API routes
│ └── page.tsx # Landing page
├── components/ # React components
├── lib/ # Shared libraries
│ ├── firebase/ # Firebase helpers
│ ├── schemas/ # Zod schemas
│ ├── types/ # TypeScript types
│ ├── utils/ # Utility functions
│ └── permissions/ # Permission system
├── functions/ # Firebase Cloud Functions
│ └── src/
│ ├── http/ # HTTP functions (Slack, GitHub)
│ ├── triggers/ # Firestore triggers
│ └── shared/ # Shared utilities
├── features/ # Feature-specific code
│ └── ai/ # AI-related features
└── firestore.rules # Firestore security rules
Next.js (Root):
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run format # Format code with PrettierFirebase Functions:
cd functions
npm run build # Build TypeScript
npm run serve # Start emulator
npm run deploy # Deploy functions-
Start Firebase Emulators (optional)
firebase emulators:start
-
Start Next.js dev server
npm run dev
-
Make changes - Files auto-reload on save
-
Run linter
npm run lint
-
Format code
npm run format
- TypeScript - Strict mode enabled
- ESLint - Next.js recommended config
- Prettier - Automatic code formatting
- Zod - Schema validation for all data
- Material UI - Component library standards
Currently, the project uses manual testing. Test coverage includes:
- User authentication and registration
- Task creation and state transitions
- COOK assignment and ledger
- Review workflow
- Governance actions
- Slack commands
- GitHub integration
See ENV_VARIABLES.md for complete documentation.
Firebase (Next.js):
NEXT_PUBLIC_FIREBASE_API_KEY=...
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=...
NEXT_PUBLIC_FIREBASE_PROJECT_ID=...
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=...
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=...
NEXT_PUBLIC_FIREBASE_APP_ID=...AI Service (Next.js):
AI_PROVIDER=openai # or 'anthropic' or 'gemini'
OPENAI_API_KEY=sk-... # if using OpenAI
ANTHROPIC_API_KEY=sk-ant-... # if using Anthropic
GEMINI_API_KEY=your-gemini-api-key # if using Gemini
# Optional: Model selection
# OPENAI_MODEL=gpt-4o-mini
# ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
# GEMINI_MODEL=gemini-1.5-proApplication URL:
NEXT_PUBLIC_APP_URL=http://localhost:3000 # or production URLFirebase Functions:
Set via firebase functions:config:set:
slack.signing_secret=...
slack.bot_token=xoxb-...
github.webhook_secret=...- Copy
.env.exampleto.env.local - Fill in Firebase configuration
- Add AI API keys (optional)
- Set
NEXT_PUBLIC_APP_URL - Configure Firebase Functions variables
┌─────────────────┐
│ Next.js App │ (Frontend - Vercel)
│ (React/TS) │
└────────┬────────┘
│
├──► Firebase Auth
├──► Firestore (Database)
└──► Cloud Functions
│
├──► Slack Bot
├──► GitHub Webhooks
└──► Firestore Triggers
Root Collections:
users- User profilesteams- Team informationgovernanceProposals- Governance proposalsvoting- Voting instancesattestations- Verifiable attestations
Team Subcollections:
teams/{teamId}/tasks- Tasksteams/{teamId}/cookLedger- COOK ledger entriesteams/{teamId}/reviews- Reviewsteams/{teamId}/boards- Project boardsteams/{teamId}/governanceWeights- Governance weightsteams/{teamId}/equity- Equity calculationsteams/{teamId}/committees- Committee selectionsteams/{teamId}/serviceTerms- Service term trackingteams/{teamId}/auditLogs- Audit logs
-
Canonical System of Record - Toolkit state is source of truth
-
Governance-by-Workflow - Implicit consent through workflow
-
Immutable Ledgers - COOK ledger and attestations are append-only
-
Role-Based Access Control - Contributor, Reviewer, Steward, Admin
-
Mobile-First Design - Responsive UI with Material UI
The project uses GitHub Actions for automated deployment. See .github/workflows/README.md.
Workflow:
- Lint and type-check on PR
- Build Next.js app
- Build Cloud Functions
- Deploy to Vercel (Next.js)
- Deploy to Firebase (Functions + Rules)
Deploy Next.js to Vercel:
vercel deployDeploy Firebase Functions:
cd functions
npm run build
firebase deploy --only functionsDeploy Firestore Rules:
firebase deploy --only firestore:rules- Set all environment variables in Vercel
- Configure Firebase Functions environment variables
- Deploy Firestore security rules
- Set up Slack app webhook URL
- Set up GitHub webhook URL
- Configure domain (if custom)
- Set up monitoring and logging
- Test all integrations
- PRD.md - Product Requirements Document
- Architecture.md - Technical architecture
- Epics.md - Feature breakdown
- ENV_VARIABLES.md - Environment variables reference
- Firebase README - Firebase setup and usage
- Functions README - Cloud Functions documentation
- Slack Integration - Slack bot setup
- GitHub Integration - GitHub integration
- AI Setup - AI service configuration
- CI/CD Workflows - Deployment workflows
- Schemas - Zod schemas in
lib/schemas/ - Types - TypeScript types in
lib/types/ - Firebase Helpers - Functions in
lib/firebase/ - Utilities - Helper functions in
lib/utils/
- Fork the repository
- Create a feature branch
- Make your changes
- Run linter and formatter
- Test your changes
- Submit a pull request
- Follow TypeScript best practices
- Use Zod for all data validation
- Write clear, descriptive commit messages
- Add comments for complex logic
- Follow existing code style
- Ensure all tests pass
- Update documentation if needed
- Add changelog entry (if applicable)
- Request review from maintainers
[Add your license here]
- Built with Next.js
- UI components from Material UI
- Backend powered by Firebase
- AI services by OpenAI and Anthropic
For questions, issues, or contributions:
- Open an issue on GitHub
- Check the documentation
- Review the PRD and architecture docs
Built with ❤️ for equitable team governance