Guidelines for AI agents working on this project.
This project uses a .agents/ folder to organize AI-generated documentation, tasks, bugs, and reports.
.agents/
├── INDEX.md # Auto-generated index of all documentation
├── AGENTS.md # This file - agent guidelines
├── docs/ # Feature documentation
│ ├── features/ # Feature-specific docs
│ └── .archive/ # Archived documentation
├── issues/ # Bugs AND tasks being worked on right now
│ ├── .open/ # Not started, or unfixed bugs nobody is on
│ ├── .secret/ # NEVER TRACKED - exploitable security detail (see below)
│ ├── .deferred/ # Consciously postponed
│ ├── .done/ # Completed tasks and fixed bugs
│ └── .archived/ # Obsolete, cancelled, invalid, won't-fix
└── reports/ # Audits, research, analyses
├── .done/ # Completed reports
└── .archived/ # Outdated reports
Bugs and tasks share .agents/issues/. Which one an item is lives in its
type: bug / type: task frontmatter, never in its folder path. Setting type:
is mandatory.
The bug-vs-task call gets made when an item is created, which is when you know least about it, and items often turn out to be the other one. Sharing a folder makes correcting that a one-line edit instead of a file move nobody performs.
Choosing: is something observably wrong right now? Yes -> bug. It just does
not exist yet -> task. Type reflects origin and shape, not size: a bug that
takes a week is still a bug.
Evolving: when a bug turns out to need a build-out, change type: in place,
add the task sections, keep the Symptoms and Root Cause, keep the filename. Never
open a second file for the same item.
Epics: a big issue with many sub-issues gets its own named folder under
issues/, which behaves as a miniature issues tree with its own .open/,
.done/ and .archived/. It sits at the root while in progress and moves into
.done/ when the whole epic is finished.
issues/.secret/ is gitignored and must stay that way. It holds issue files whose
contents would help someone attack users of the shipped app.
The test, applied when you create the file, not later:
Does this document describe an attack that works against code users are running today, or materially help someone build one?
If yes, it is created in .secret/ from the start. This includes the mechanism,
the file:line pointers, the vulnerable code excerpt, and the reproduction steps.
Severity is not the test and neither is status: - a done write-up still belongs
in .secret/ if the fix has not actually reached users, because release lag is
exactly the window an attacker wants.
If no, file it normally. Reliability bugs, data-loss bugs, crashes and correctness defects are ordinary engineering work even when serious. A bug is not security-sensitive just because it sounds alarming.
Why the folder rather than a judgement call each time. Both app repos are
public. Anything committed is permanent: deleting a file later does not remove it
from git history, and by then it has been cloned and indexed. So the safe default
has to be structural. When unsure, put it in .secret/ - a file held back costs
nothing and can be released in one move, a file published cannot be recalled.
Rules:
- Never add a
.secret/file toINDEX.md. The index is tracked, so a row there republishes the title and the path. - Never paste
.secret/detail into a tracked file, a commit message, a PR description or a GitHub issue on a public repo. - A tracked file may reference the existence of the work in neutral language ("space-auth hardening, detail held privately") but must not restate the mechanism.
- The authoritative cross-repo tracker for this class is the private repo
QuilibriumNetwork/quorum-app-prod(issue #1 for the control-message-auth cluster). Link there, not to.secret/paths. - Releasing a file once its fix has shipped to users: move it out of
.secret/into.done/, add itsINDEX.mdrow, and say in the commit that the fix is live. That is a deliberate act, never a side effect of tidying.
- General: Use kebab-case:
feature-name.md - Reports: Include date:
security-audit_2025-01-15.md - Numbered ordering: Prefix with numbers:
01-setup.md,02-config.md
All documents use YAML frontmatter with these statuses:
open: not started, or an unfixed bug nobody is on -- lives in.open/in-progress: Currently being implementedon-hold: Blocked or pauseddone: Completedarchived: No longer relevant
Use the docs-manager skill for consistent templates:
- Bugs and tasks →
.agents/issues/ - Documentation →
.agents/docs/features/ - Reports/Audits →
.agents/reports/
Security review gate (this repo). An issue touching authentication,
encryption, user data, network communication or permissions must be analysed by
the security-analyst agent (.claude/agents/security-analyst.md) before
implementation, and its findings recorded in the issue. This is a project rule,
not part of the shared docs-manager skill.
After creating, moving, or deleting files, run the index update script to regenerate INDEX.md:
python .agents/update-index.py- Check
INDEX.mdfor existing documentation - Review open and in-progress work in
.agents/issues/ - Check for related bugs in
.agents/issues/and.agents/issues/.done/ - Look for relevant reports in
.agents/reports/
- Update task/bug status to
done - Move completed items to
.agents/issues/.done/(never move atype: bugissue there without verified testing) - Run the index update script
- Create documentation for significant changes
Never widen where a private key, keyset or ratchet state can be observed — no unencrypted
persistence, no logging, no notification payloads, no telemetry or crash payloads. This
applies to features, not just debug helpers; the check is "does this line make a secret
observable somewhere new?". Dev-only diagnostics must be build-gated (if (__DEV__))
and verified against a release build rather than the source. A // debug only comment is
not a gate.
MMKV in this app is unencrypted (encryptionKey is used nowhere) and
android:allowBackup="true" sends it to cloud backups — key material belongs in
SecureStore, never MMKV.
DM/transport instrumentation is not on master and must never be merged
there. It lives on the local, never-pushed branch diag/dm-frame-trace.
git debug # alias → .agents/scripts/git-debug.shRun it before any DM capture round. It rebases the rig onto master, re-applies
the node_modules transport patch (wiped by every yarn install), and prints a
BUILD CHECK proving which probes and shipped fixes are compiled in. Never check
out the rig by SHA — it rebases, so SHAs in docs are stale on sight.
quorum-desktop has the equivalent git debug for diag/dm-frame-join.
The alias lives in .git/config (machine-local, lost on a fresh clone). If
git debug is not found, reinstall it:
git config --local alias.debug '!bash .agents/scripts/git-debug.sh'Details: scripts/README.md and §D of the DM master report.