|
| 1 | +# Agent Instructions (AGENTS.md) |
| 2 | + |
| 3 | +This file provides project-specific conventions for AI coding agents working in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +**tsb** is a TypeScript port of [pandas](https://pandas.pydata.org/), built from first principles. |
| 8 | +- Package name: `tsb` — all imports use `tsb` |
| 9 | +- Runtime: Bun |
| 10 | +- Language: TypeScript (strictest mode) |
| 11 | + |
| 12 | +## Key Rules |
| 13 | + |
| 14 | +1. **Never modify `README.md`** — it is read-only, the source of truth for project parameters. |
| 15 | +2. **Never modify `.autoloop/programs/**`** or autoloop workflow files. |
| 16 | +3. **Strict TypeScript only** — no `any`, no `as` casts, no `@ts-ignore`, no escape hatches. |
| 17 | +4. **Zero core dependencies** — implement everything from scratch. |
| 18 | +5. **100% test coverage** required — unit + property-based (fast-check) + fuzz where applicable. |
| 19 | +6. **Every feature gets a playground page** in `playground/`. |
| 20 | +7. **One feature per commit** — keep changes small and targeted. |
| 21 | + |
| 22 | +## Project Structure |
| 23 | + |
| 24 | +``` |
| 25 | +src/ |
| 26 | + index.ts — package entry point, re-exports all features |
| 27 | + types.ts — shared type definitions |
| 28 | + core/ — core data structures (Series, DataFrame, Index, Dtype) |
| 29 | + io/ — I/O utilities (read_csv, read_json, etc.) |
| 30 | + groupby/ — groupby and aggregation |
| 31 | + reshape/ — pivot, melt, stack, unstack |
| 32 | + merge/ — merge, join, concat |
| 33 | + window/ — rolling, expanding, ewm |
| 34 | + stats/ — statistical functions |
| 35 | +tests/ |
| 36 | + setup.ts — global test setup (loaded via bunfig.toml) |
| 37 | + *.test.ts — mirrors src/ structure |
| 38 | +playground/ |
| 39 | + index.html — landing page |
| 40 | + *.html — one page per feature |
| 41 | +``` |
| 42 | + |
| 43 | +## Adding a New Feature |
| 44 | + |
| 45 | +1. Create `src/{module}/{feature}.ts` with the implementation. |
| 46 | +2. Export from `src/index.ts`. |
| 47 | +3. Create `tests/{module}/{feature}.test.ts` with full coverage. |
| 48 | +4. Create `playground/{feature}.html` with an interactive tutorial. |
| 49 | +5. Update `playground/index.html` to mark the feature as complete. |
| 50 | + |
| 51 | +## Running Locally |
| 52 | + |
| 53 | +```bash |
| 54 | +bun install # install devDependencies |
| 55 | +bun test # run all tests |
| 56 | +bun run lint # check linting |
| 57 | +bun run typecheck # TypeScript strict check |
| 58 | +``` |
| 59 | + |
| 60 | +## Autoloop Coordination |
| 61 | + |
| 62 | +This project is built by [Autoloop](https://github.com/githubnext/autoloop), an iterative optimization agent. |
| 63 | +- Long-running branch: `autoloop/build-tsb-pandas-typescript-migration` |
| 64 | +- State file: `build-tsb-pandas-typescript-migration.md` on `memory/autoloop` branch |
| 65 | +- Issue #1 is the program definition — do not modify it. |
0 commit comments