prehistoriq Docs

The Three Pillars

View as Markdown

Prehistoriq splits agentic engineering into three parts: Shapes before anyone writes code, Pulls while the team reviews the change, and Berries running underneath both.

Shapes Before code

Problem, interactive prototypes, numbered must-haves, and formal approvals until locked as Agreed.

Pulls During review

Six structured answers, Strata multi-level diffs (coming soon), anchored threads, Ask my agent, and GitHub reviews.

Berries Coming soon

Prompts, agent responses, tool calls, subagent handoffs, and skill invocations recorded across both Shapes and Pulls.

1. Shapes

Agents build fast, so the hard part is agreeing on what to build before anyone builds the wrong thing. GitHub issues cannot hold interactive prototypes or an agent's before-and-after checks, and meeting decisions fade before a pull request opens.

A Shape is a shared space where people and their agents turn a problem into an agreed spec with interactive prototypes and numbered must-haves.

Shape 12 Shaping
Email alerts when someone asks for my review

Review requests sit in the menu inbox until someone opens the tab. Teammates miss approval requests on Shapes and Pulls for hours.

Must-haves
  1. 1Send one email within two minutes of a review or shape approval request
  2. 2Never email about a thread the person already read in the app
  3. 3One-click unsubscribe link works without signing in
Interactive prototype Mira's agent · Claude Code
Try toggling email delivery or digest timing
Review and approval requests
Immediate email (2 min grace window)
mira · approved ondrej · approved · 2 changes since
Locks as Agreed once all asked approve current words

Problem and must-haves

A shape starts with a title and a few lines describing the problem. Anyone with read access to the repository can add numbered must-haves describing what must be true and what must not break. Each must-have keeps its number forever (^12#point-3), even if an earlier item is removed, so links and comments never drift.

Conversation and interactive prototypes

People and their agents post in one timeline. A post can include findings, screenshots, before-and-after wipes, videos, diagrams, code, tables, and sandboxed clickable HTML prototypes. Each prototype sits in a dark tray with a one-line prompt telling reviewers what to try.

Click Bring my agent on the shape, a post, an item, or a thread to hand the context to your local agent. p9q shape <n> pulls the shape, saves its prototypes and media under .p9q/shape-<n>/, and lets the agent reply with p9q shape <n> post. Your local agent can also read a meeting transcript and turn its decisions directly into new shapes and attributed must-haves.

Approvals and landing

Teammates approve the shape the same way they review a pull request. If the problem or must-haves change after someone approves, Prehistoriq marks their approval stale (approved · 2 changes since), because only approvals of the current words count. Every edit stays in History and can be restored.

When everyone asked approves the current revision and no change requests remain, the shape locks as Agreed. Its card switches to Land (p9q land <n>), which tells your agent to build the agreed shape, open a linked pull request, and run all six review categories. Merging the linked pull request moves the shape to Built.

Shapes move through Idea, Discussing, Shaping, Signing, Agreed, and close as Built or Closed. Any post, item, or comment can branch into a linked shape of its own.

2. Pulls

Pull requests written by agents grow quickly, and a raw diff cannot tell you whether the code ran, what the UI looks like, or how hard the change is to roll back.

Pulls lays out every pull request as six structured answers, multi-level code diffs with Strata on Changes (coming soon), and threads anchored directly to findings or code blocks.

Click any tile to inspect its drawer
1 major finding to check before merge
Take a look

Multi-model review checked 14 files and flagged one edge case when a timeout happens after the gateway commits.

  • Major: reuse the same idempotency key when the worker restarts mid-retry (impact: a crash after charge commit could bill twice)
  • Nit: log attempt_number alongside gateway_request_id

The six answers

Every pull request displays the same six tiles under its title, always in the same order:

TileQuestionWhat the tile shows
WhatWhat does this change do?Plain-English headline, summary, and diagrams or schema changes
Show meWhat does it look like?Screenshots, before/after comparisons, flows, videos, or diagrams
ReviewIs it built right?Findings grouped by severity (blocker, major, minor, nit) or clean check count
ProofDoes it actually work?Passing and failing checks, terminal output, or metrics
UndoHow hard is it to take back?Each side effect classified as a door: revert, work (and whether the way back is written), or one-way
SecurityDoes it open a door?Security findings by severity or checklist items

Every tile uses the same traffic lights: pass (clear), warn (merge after a look or small fix), fail (do not merge as is, or on Undo, a one-way door or unwritten rollback that needs an explicit yes), and info (neutral context on What).

Three zoom levels

1CompactDefault on pass
Proof4 of 4 passed
2SummaryDefault on warn / fail
Review1 major
Major: reuse idempotency key on restart
Impact: crash mid-retry could bill twice
3FullClick to expand
retry.ts:48 · full body & fix
- key = randomUUID()
+ key = invoice.attemptKey

Each category section opens only as far as needed:

  1. Compact shows one line with the category icon, verdict light, headline, and avatars of anyone discussing it. Passing checks default here, except Show me, which still previews its first visual.
  2. Summary shows the summary plus every block's face: finding titles, one-sentence impact lines on blockers and majors, checklist labels, and visuals with captions. Warnings, failures, and What open here by default.
  3. Full shows the full body, suggested fix, code snippets, and checklist notes. You open items one at a time or click Expand all.

Strata across four diff levels Coming soon

Even with six answers, you still want to inspect the code itself when a change spans hundreds or thousands of lines. Reading a raw diff top to bottom forces you to reconstruct the structure in your head.

On the Changes tab beside Overview, Strata stacks three readable, syntax-highlighted pseudocode layers directly above the real code diff: Outline, Detail, Fine detail, and Code. You start at the outline of what each function does, drop into finer levels only where something looks risky, and read the exact lines of code underneath.

Four stacked layers of modeling clay Changes payments/retry.ts chargeWithRetry
44–45 Validate invoice amount and load existing attempt record
46–52 for each retry up to 3: send charge with stable attemptKey and exponential backoff
53 Surface the final gateway error
Click Outline → Detail → Fine detail → Code to step through the same change. Comments stay pinned to lines 46–47 at every level.
  • Whole-row change visibility colors every row that covers changed lines, and every changed line maps to a colored row (or an explicit note when it has none)
  • Line-anchored threads across every level keep comments pinned to the underlying code lines no matter which level you wrote them on. A thread appears in full on its own level and finer ones, collapses to a count badge on wider levels above, and stays put even if Strata is rebuilt
  • Graceful fallback shows Code immediately before Strata is built (with a Build Strata button beside the level picker), and shows plain code when a PR has no functions to summarize

Strata is agreed in Shape 117 and is currently being built.

Threads and GitHub reviews

Any run, block, or individual finding can hold a thread. Each thread saves a quote of what it pointed to, stays visible when its section is folded, and stays readable even after a newer run replaces the old one.

Click Ask my agent on any item to post your question and copy a p9q discuss <thread> prompt. Your agent checks your local checkout and posts its reply (markdown, code, screenshots, or diagrams) directly into that thread.

Because URLs mirror GitHub, replacing github.com with prehistoriq.com opens the matching Pulls page. Submitting Approve or Request changes posts straight to GitHub as your review so branch protection counts it, and the GitHub bot keeps one edited comment updated with the six lights and open threads.

3. Berries Coming soon

A pull request diff shows what changed, not how it was made. Reviewers cannot see which prompts led to which lines, what the agent asked and what the author answered, which models and skills did the work, or what was tried and dropped. Decisions made while coding never reach the shape, so the shape and the pull request drift apart unseen.

Raw transcripts on a developer's laptop do not solve that. They are long, private, can contain secrets, and miss code written through shell commands like python3 or sed instead of direct edit tools.

Berries capture prompts, agent responses, tool calls, skill invocations, and working-tree diffs locally through p9q, link them to the lines, commits, pull requests, and shapes they produced, and show them where people already look.

How it was made · PR #267 (from Shape 98) 44 min · 5 lanes · 4 phases · 2 models · 4 skills
Coming soon
Shaping Building In review Shipping
Shape
Shape 98 agreed
You
Prompt Answer Approve
Agent
Claude Fix + /proof Codex review
GitHub
PR #267 Merged
Production
Deployed
  • AskRetry failed payments without charging twiceShape 98 → PR #267
  • DecisionKey idempotency on (org_id, invoice_id); keep webhook signature checks untouchedAnswered agent in turn 2
  • Outcome38 payment tests passing · 2 models (Claude Code + Codex) · 4 skillsDeployed 5m after merge

Where Berries appear

  • On Pulls ("How it was made") with four reading depths (Glance, Your words, Conversation, and Every step) and a five-lane timeline (Shape, You, Agent, GitHub, Production) across Shaping, Building, In review, and Shipping, so reviewers understand how a PR was built without reading a raw transcript
  • On Shapes where every session that worked on a shape links back to it, including planning sessions before any pull request existed, joining shaping work to implementation and surfacing decisions made along the way
  • In line blame where working-tree diffs captured after tool calls attribute each line as ai, human, or unknown (falling back to unknown whenever a later overlapping edit obscures who wrote it)

Privacy and local capture

Separate from Git
Git repository Code & commits only No prompts or transcripts
EU storage (Berries) Prompts, diffs & index apart Hide = deletes text
Honest line blame
aiconst key = orgId + ":" + invoiceId
aireturn chargeWithRetry(key, amount)
humanif (amount <= 0) return null
unknownlog.info("retry", { attempt })

Berries keep private work out of Git and require nothing extra to install:

  • Nothing goes into Git because prompts can hold secrets and Git cannot forget, so session text stays outside Git, stored in the EU and kept separate from the index
  • Hide and erase anytime before or after a session is shared, deleting its text from storage
  • Installed with p9q using a local spool under ~/.p9q/berries/ and agent hooks that work across clones and worktrees without slowing down or breaking sessions
  • Opt-in local preparation where generating titles, extracting decisions, or redacting sensitive spans runs through a model harness (Claude Code, Codex, or Ollama) only after you enable it in p9q setup

Ready to try it on a repository? Follow the Quick Start to install p9q and post your first six-answer pull request.