Skip to content

Starting a session

Opleet v2 is built by Claude sessions, each in one role, under zuki's review. This page is all a session needs to start, from any Claude account or surface: the repository holds everything else. It replaces the session-roles note that lived in a Claude project, and it follows how we work, which outranks it.

A session takes one role, named in its first message. With no role named, it is a CTO session.

Role What the session does Its issues
CTO Audits; drafts decisions and spec changes; keeps the decisions, the working rules and the timeline (its run order and its TL steps), the architecture page, the module plan and the cutover guide; owns the rule format and the rule check. Writes no production code. role: cto
Backend Engineer (BE) The v2 database (supabase/) and the v1 to v2 migration (tools/db, tools/migration). role: backend
Frontend Engineer (FE) apps/web and its integration with the v2 database. role: frontend
Docs Engineer (DOC) The written pages under System, where every rule gets an ID before any test or code exists (D27). Never writes tests, code or decisions. role: docs

What each role owns and must never do is the roles table in how we work. A new role gets a row there before its first session.

The role is recorded from the first message, such as "BE: check #374", or set with /start <role> [issue], which also reads what the role needs and finds its next issue (D106). A session keeps its role: hooks refuse a write outside its paths in .claude/team/roles.json. With no role named, it is a CTO session until /start sets one. A session whose record is lost after its first turn has no role, and writes nothing in the repository until /start sets one; no agent may write or name the records. After /clear the session is new: name the role again.

  1. AGENTS.md at the repository root. CLAUDE.md imports it, so Claude Code loads it on its own.
  2. How we work, then the other pages under Contributing.
  3. Decisions: the index, and every decision newer than the last one you worked to. The index lists them all, newest last.
  4. The open issues labelled with your role.

Then, for the order of all work, the timeline; for what each phase and module covers, the plan; for the stack and the repository layout, the architecture.

A session needs no handover. Three places hold the state, and the first message can be just the role and the task ("CTO: check #324"):

  1. The timeline's State block and Targets table for the phase in progress: what is done, what waits for what, and the dates. A CTO session rewrites them in each timeline pull request.
  2. Your role's queue: the open issue titled Queue · <role>, labelled with that role: CTO, DOC, BE and FE. Its body lists your open issues in the order to take them, each with what it waits for and its target. A CTO session rewrites the body whenever the order changes. Work and runs are still reported on each work issue, not on the queue.
  3. What waits for zuki: the open issues labelled role: zuki.

The last comments on an issue are its current state. Read them before acting on it, because another session may have moved it since the queue was written.

The repository Opleettop/monorepo, and apps/docs in it, is the source of truth for v2 (D27, D28). The decisions and the working rules outrank every other doc, this page and any Claude project's instructions included. A Google doc stays in force only until its page merges here, and where it disagrees with a decision, the decision wins. Product and process docs that team leads comment on stay in Drive.

A Claude project, a chat's memory or a note in a session is background (level 5 in the order of authority): useful, never binding. If one disagrees with this site, this site wins.

  • Rules, then tests, then code. Each feature is written in that order (D27).
  • Through GitHub only. In the cloud, agents reach the repository through the Claude GitHub app, which is installed on it and no other repository; a team session uses its own scoped token instead (D77). They work on branches and open pull requests with their checks run. They never merge, and they never hold credentials for staging or production. zuki reviews and squash-merges every pull request, and the ruleset on main enforces it (D28).
  • Into integration, not main (D81). Branch from origin/integration, and open the pull request into integration. No CI runs there, so run pnpm check before opening it and paste its summary in the body. zuki squash-merges into integration, and merges integration into main with a merge commit when he chooses; CI runs on that pull request. A pull request that changes D81's own machinery, or that zuki asks for, may still go to main.
  • Issues carry the work. Tasks, open questions, change requests and decision proposals are issues on the Opleet v2 board, with type and role labels. A run is logged as a comment on its issue. Docs carry outcomes; discussion stays in issues and pull requests.
  • Steps are run by zuki. In M0, DOC packs and CTO pull requests arrive in the repository as pull requests, while the TL, BE and FE steps of M0 are runbook steps that zuki runs. From the data phase on, every pack arrives as a pull request.
  • The timeline. BE, FE and DOC change only the step IDs and status of their own rows, and may add a row marked Proposed. Only a CTO session or zuki reorders rows or changes a TL step.
  • Secrets. Never ask for, print or commit one. Steps show placeholders such as <STAGING_DB_PASSWORD>.

These hold in every session, beside AGENTS.md and how we work:

  • Tell zuki before you close an issue, with what closes it. A pull request that says "Closes #n" counts as telling him. When he merges it into integration, the workflow integration-close.yml closes the issues it names, and with a slice, the open task issues attached to it as sub-issues; GitHub itself closes them only on a merge into main (D81).
  • From v1's data, post counts, statuses, codes and ids only, never a value tied to a person: a name, a phone, a NIK, a plate tied to a driver, an account number (D15). If a comment or file carries one, ask its author to delete it, and never copy it into the repository.
  • A decision takes the next free number when its pull request opens. How we work names it. A number promised earlier in an issue moves if another decision opens first, so correct that note.
  • Targets, not gates (D20). A row that slips moves the rows that wait for it, and the next timeline pull request moves the dates.
  • Recommend, then ask once. A question to zuki carries options and a recommendation, and a decide-by date when a row waits for it. A reply such as "(a)" or "accepted" is his answer: record it on the issue, with the date, where the rules and the work will cite it.

From M1 on, and before it for a data-phase slice that needs no run against v1, staging or production (D80) or a step whose runs zuki does at L0 (D89), a slice can run as one Claude Code agent team on zuki's Mac: a CTO lead with doc, be and fe as teammates who talk to each other directly (D77). zuki starts it with .claude/team.sh and /team <issue>; the teammates take their role from .claude/agents/. Team sessions is the protocol. Everything above still applies.

A session that isn't a team is a solo session, on zuki's Mac or in the cloud (D106). The guards a team runs under hold here too: .claude/settings.json loads the read and Bash guards, the role paths and the deny list.

  • Only role agents write. A built-in or plugin subagent (Explore, general-purpose, Plan) may read and write scratch folders, never the repository; opleet-review only reads.
  • Another role's work goes to its agent. When the issue needs a rule, a test or a page outside your paths, spawn opleet-doc, opleet-be or opleet-fe as a subagent, in the order rules, tests, code. Pick its model as D105 does. Its prompt is the brief: the issue, the scope, the decisions and rule IDs, and what to change. It reports what changed and every question for zuki in its final message, and it reads git and gh only. You commit its files under its role's Role: trailer.
  • A page change has a Design phase. FE sketches a wireframe, zuki designs the mockup from it in Claude Design and approves a version, and FE builds to its rendered frames, as the design phase describes (D107, D112).
  • Skills for the repeated steps: new-decision (CTO), rule-page (DOC), and runbook-step for a step zuki runs.
  • An independent review before every pull request. /end-session <issue> runs pnpm check, spawns opleet-review with a fresh context, has you act on its findings, then commits by role, opens the pull request into integration and writes the report below.

A solo session may also run on Kimi Code CLI, under the same lanes and the same rules (the Kimi adapter decision, drafted as D111). Everything in "Solo sessions" above applies; what changes is the plumbing:

  • Start with pnpm kimi:start <role> (.kimi/kimi.sh), which repeats the team launcher's preflight and binds the role twice: for the hooks (OPLEET_ROLE) and for the model (kimi --agent opleet-<role>). Neither can change mid-session, so /start only confirms the launched role.
  • The guards load from a plugin. One-time per machine: /plugins install <repo>/.kimi, and record the checked CLI version in .team/kimi-version. Reinstall the plugin after a change under .kimi/hooks/. The lane policy stays in .claude/team/roles.json, read by both harnesses.
  • The agents and skills are the same files. opleet-doc, opleet-be, opleet-fe, opleet-review, and the skills start, end-session, new-decision, rule-page and runbook-step live once in .agents/, which Kimi reads; .claude/agents/ and .claude/skills/ link to them. Edit them in .agents/, and keep each harness-neutral: where Claude and Kimi differ (the role binding, model choice, the Artifact tool), the file says what each does. They are invoked as in Claude (/start, /end-session).
  • Known gaps, recorded in the decision: Kimi hooks fail open on a crash (the token scopes, Lefthook and CI are the backstop); subagent writes are attributed through a hook-kept stack, approximate under parallel subagents; there is no task gate, no context-nudge and no team mode — /team and /team-close stay Claude-only until the planned Tower milestone.
  • Reaching the repository. If the repository isn't attached to the session, ask for it to be added; access comes through the Claude GitHub app. Clone it shallow, and fetch integration (and main) before branching or pushing: git fetch origin +refs/heads/integration:refs/remotes/origin/integration.
  • GitHub's GraphQL API is blocked, so gh issue list, gh pr list and the board (a GitHub Project) don't work. Use the REST API: gh api repos/Opleettop/monorepo/issues?state=open&per_page=100, adding &page=2 and on by hand, because --paginate follows links the proxy refuses. Board changes are zuki's: hand him a gh script to run.
  • Node and pnpm. The repository pins Node 24 (.node-version) and pnpm 12 (packageManager). A workspace with an older Node can install both from npm into a scratch folder and put its node_modules/.bin first on PATH, so the Lefthook hooks run with the pinned versions. pnpm is the first choice in every command.
  • Containers. Some cloud workspaces can't pull container images, so pnpm supabase start and pnpm db:types can't run there. Say so on the pull request and leave that step to zuki; the types are never written by hand (D22, D33).
  • Checks before a pull request. pnpm check runs what CI would on your change, against origin/integration: Biome, pnpm docs:rules, the role-paths check, the commit messages, typecheck and build, and, when you touch the database side or apps/web, pgTAP, the generated files and Playwright, which need the local stack (D81). Its summary goes in the pull request body. Run single checks as you work: pnpm docs:rules and pnpm --filter docs build for docs; pnpm lint and pnpm typecheck for code; the commit message and the pull request title follow Conventional Commits (D6), with a header of at most 100 characters.
  • Your paths. Write only to your role's paths in .claude/team/roles.json. Lefthook and CI refuse a commit whose Role: trailer doesn't match the files it touches.
  • A shallow clone's false alarm. A shallow clone has no remote-tracking branch for a branch you pushed, so a stop hook may report "unpushed commits" or "no remote branch". Check with git ls-remote origin <branch>. If the remote tip matches your HEAD, set branch.<branch>.remote and branch.<branch>.merge and add a remote.origin.fetch refspec for that branch. Remove the refspec of a deleted branch, or git fetch fails.
  • A merge order with no conflicts. Before listing several pull requests for zuki to merge, squash-merge them in that order onto a scratch branch from origin/integration. A stacked pull request retargets to main when the one under it merges.

A solo session runs /end-session <issue>, and a team lead /team-close <issue>. Both run the independent review before the pull request opens (D106), and both end with these steps:

  1. Report on each issue you worked on: what changed, what it waits for now, and who acts next.
  2. A CTO session updates the state when it moved: the Queue · <role> bodies whose order changed, and the timeline's State block and Targets in a pull request when dates or status changed.
  3. The last message to zuki:
    • what was opened, merged-ready and closed;
    • what he can run now, in order;
    • the pull requests to merge, in an order checked for conflicts;
    • his answers outstanding, each with its decide-by date;
    • a gh script that adds the new issues and pull requests to the Opleet v2 board, and sets the board's Start and Target fields on each new or moved slice. Those two fields are the only place a slice's dates are kept: the board's roadmap view draws from them, the milestones carry each module's date, and the timeline keeps the order and the state.