Files
piik/AGENTS.md
T
AAA cbbf8b88ff fix(interactions): bind readiness to its current request
Integrate the reviewed interaction follow-up with exact subscription correlation. Unknown and late replies cannot close or activate another owner. Delivery failures preserve the logical reaction request and nonce, including retries, while a signed writer rejection retains its distinct meaning.

Accept the instruction layering with scoped corrections: current user authorization remains authoritative within system/developer bounds, failure recovery is distinct from feature state, and Core extraction must reduce ownership cost. Fresh old/new policy evaluations chose the same six outcomes; this supports clarity, not a claim that the prior rules caused over-handling.

Validation: two new counterexamples failed on the incoming interaction commit; the corrected client suites and wire metadata control passed 640 tests and TypeScript. Policy and documentation checks run through the repository hook.
2026-11-24 19:51:45 -05:00

7.7 KiB

Project Instructions

System and developer instructions take precedence. Within those bounds, the user's latest explicit decision governs the task. An explicit change to a project invariant takes effect when the user gives it.

  1. Project invariants protect the boundaries below.
  2. Principles guide choices within those boundaries.
  3. Domain standards and CONTRIBUTING own their requirements.
  4. Skills describe how to carry out authorized work.

Research notes, examples, audit findings and review proposals supply evidence. Authority for acting on them comes from the task.

Invariants

  • Secrets and user data stay out of the repository. Never commit credentials, TLS private keys, raw access tokens or real user data. Commit placeholders and document local injection. A leaked secret cannot be recalled.
  • Private media paths stay private. Do not log, persist or upload private media-path identifiers beyond their accepted owner, and keep media credentials short-lived and narrowly authorized.
  • A task carries only its own authority. Review, research, implementation, deployment and cleanup each permit what that kind of task needs. A skill, an example or an audit cannot widen it.
  • Publication is the owner's. Follow the applicable merge and release authorization in CONTRIBUTING.
  • Shared history is not rewritten. No force-push and no rewrite of pushed history without the owner's approval, and no commit to a branch another agent owns.
  • Published promises hold. Preserve the compatibility published for 2.x. Private 3.0 experiments carry none: replace them without aliases, dual readers or writers, or migrations for stale private clients.
  • Durable state is not rolled back silently. No automatic downgrade or database rollback. Define recovery before touching persistent or irreversible state. Recreating a resource never renews expired authority.
  • Phase blockers. Block the current phase on P0 security, privacy, authorization, irreversible-data, generation, bounded-resource or rollback failures, and on P1 failure of that phase's core path.

Product

Piik is free, P2P-first screen sharing for a host and their friends. This worktree develops isolated 3.0, whose architecture ADR-0016 records. The network model and room-data model describe the current prototype. The forwarding design and hosting and moderation design own the target boundaries, and status indexes the implementation. Published 2.x promises remain with the maintenance line's standards and status.

The standard is a polished experience and clear engineering, across interface, interaction, functional boundaries, lifecycle and code. Working behaviour alone does not meet it. Media stays automatic and P2P-first, and adaptation belongs to Browser WebRTC, the Native RTC SDK and accepted encoder policies. Changing that, for example with a custom quality score, a ladder, an all-pairs probe, periodic rebalancing or a hand-built SFU representation, takes a new accepted decision backed by primary evidence.

Principles

  • One owner. Every fact has one writer, and every lifetime has one owner that retires it. A meaning repeated across code, interface, copy, configuration and lifecycle follows one contextual contract.
  • Fail at the owner. Report an operation's failure to its waiting owner and reuse existing recovery where it gives the required outcome. Apply the failure boundary when proposing additional recovery.
  • Reuse before adding. Find the existing owner, helper or mature approach first, then choose the simplest coherent design that meets the need. Simplicity does not remove requested function, visual quality or safety.
  • Nothing is protected by its age or its author. When a defect, a repeated repair or an awkward boundary traces to the shape of a design, question it, propose the one that would be chosen today, and supersede the record that accepted it. Path dependence and sunk cost are not reasons.
  • Evidence first. Use primary sources for non-trivial design and bugs, and verify in proportion to the change through the standard entry points.
  • One place per rule. Each durable fact has one owner in the documentation map. TODO is the only work ledger, and Git and pull requests own completed history. A disputed meaning is recorded there as a hold on the work that depends on it. It is not written down as settled.

Where Rules Live

Topic Owner
Module boundaries, lifecycle, failure handling, review Engineering
Interface, colour, motion and the shared cast Visual language
Build identity, wire, storage and compatibility Versioning
Branches, checks, pull requests, releases, work between two agents CONTRIBUTING
Everything else Standards index

Start substantial work by reading project memory, status, TODO and only the standard, ADR or research document the task needs. Then inspect the branch, HEAD, status and worktrees, and fetch the review queue when a second agent is working. Before finishing material work, inspect status, report untracked artifacts and stage the requested files.

Skills

Read an applicable skill completely before using it, and reuse that understanding until the task or the instructions change. Use the repository's version when a global skill has the same name. A skill is a method. It adds no authority and overrides none of the layers above.

When Skill and responsibility
Coding, code review, or implementation design Ponytail: smallest coherent implementation and reuse
Implementation, debugging, or review Stop That Shit: proportionate investigation, verification and complete delivery
Cross-surface consistency, recurring sibling-path defects, or standardization audits Context consistency: trace shared meanings and ownership; ordinary changes check only their affected family
Writing or reviewing requirement levels in specifications, API contracts or project rules RFC 2119: precise obligations, recommendations and options; preserve the rule owner's intent
Material UI visual design, redesign or polish Unslop: product-specific hierarchy, semantic grouping, shared visual consistency and rendered review
Browser APIs, accessibility, responsive interaction or Web performance Modern Web Guidance: current platform patterns, supported-browser behavior and focused verification; complements Unslop
The review queue or a mailbox changed, or you want the other agent's review Cross review: sync, judge each item on the code, answer in your own mailbox