Skip to content

Commit be4d114

Browse files
authored
Merge pull request #962 from cipherstash/docs/agent-workflow-conventions
docs(agents): define repository workflow conventions
2 parents 4602dd4 + ec590a0 commit be4d114

8 files changed

Lines changed: 195 additions & 0 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ If these variables are missing, tests that require live encryption will fail or
8484
- `packages/bench`: Performance / index-engagement benchmarks (private, not published)
8585
- `packages/protect-ffi`: Native FFI bindings to the CipherStash Client SDK (`@cipherstash/protect-ffi`) — the Rust core that `packages/stack` encrypts and decrypts through, absorbed from `cipherstash/protectjs-ffi`. Contains a **nested Cargo workspace** (`crates/`) and six per-platform binary packages under `platforms/*`, each published as `@cipherstash/protect-ffi-<platform>` and linked here via `workspace:*`. Also holds the repo's live FFI integration suite at `integration-tests/` — a private workspace member (`@cipherstash/ffi-integration-tests`) enrolled by its own literal entry in `pnpm-workspace.yaml`, needing Docker and credentials, and deliberately carrying **no `test` script** so `pnpm test` cannot reach it. See the "Working on protect-ffi" notes below before touching it — its default `test` and `build` are deliberately Rust-free.
8686
- `packages/eql`: The Encrypt Query Language subtree — the SQL bundle that stores and queries encrypted payloads — absorbed from `cipherstash/encrypt-query-language`. **The directory is the subtree root, not the package.** It was imported at a *verbatim prefix* so its repo-root-relative paths (mise tasks, `Doxyfile`, `sync-generated.mjs`) keep resolving, which puts the npm package `@cipherstash/eql` two levels down at `packages/eql/packages/eql` — the same shape as `packages/protect-ffi/platforms/*`, and enrolled the same way, by an explicit `packages/eql/packages/*` glob in `pnpm-workspace.yaml`. The subtree root deliberately carries no `package.json`. Also contains a **nested Cargo workspace** at `packages/eql/crates/` (`eql-bindings`, published in lockstep with the npm package, plus `eql-domains` / `eql-codegen` / `eql-tests-macros`, which are not), a SQLx test crate at `packages/eql/tests/sqlx`, an ~900-line `mise.toml` task surface, its own `AGENTS.md`, and `docs/`. See the "Working on EQL" notes below before touching it.
87+
**Repository ownership:** EQL now lives in `cipherstash/stack`. File and update
88+
EQL issues in this repository, never in the historical
89+
`cipherstash/encrypt-query-language` repository. Old upstream issue and PR
90+
links are provenance only.
8791
- `e2e/*`: Cross-package end-to-end tests (package managers, supply chain, Prisma example README)
8892
- `examples/*`: Working apps (basic, prisma, supabase-worker)
8993
- `docs/plans/*`: Internal design plans. User-facing documentation lives at https://cipherstash.com/docs (not in this repo).

CLAUDE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,22 @@ one source of truth.
66

77
@AGENTS.md
88

9+
## Agent skills
10+
11+
### Issue tracker
12+
13+
Issues are tracked in GitHub Issues for `cipherstash/stack`. See
14+
`docs/agents/issue-tracker.md`.
15+
16+
### Triage labels
17+
18+
Use the five default triage labels. See `docs/agents/triage-labels.md`.
19+
20+
### Domain docs
21+
22+
Use a multi-context layout rooted at `CONTEXT-MAP.md`, with package-specific
23+
`CONTEXT.md` files added as needed. See `docs/agents/domain.md`.
24+
925
## Before you finish
1026

1127
Two rules from `AGENTS.md` are the ones most often missed. They are repeated here

CONTEXT-MAP.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Context Map
2+
3+
## Contexts
4+
5+
- [EQL](./packages/eql/CONTEXT.md) — defines the PostgreSQL objects that store
6+
and query encrypted values.
7+
8+
## Relationships
9+
10+
- **EQL → Stack CLI**: EQL ships install and uninstall artifacts; the Stack CLI
11+
applies them and preserves reconstructable database objects across reinstall.
12+
- **EQL → ORM adapters**: EQL defines durable encrypted column domains and
13+
disposable query machinery; adapters create application columns and derived
14+
search indexes against that surface.

docs/agents/domain.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Domain docs
2+
3+
How engineering skills should consume this repository's domain documentation.
4+
5+
## Before exploring
6+
7+
- Read `CONTEXT-MAP.md` at the repository root when it exists. It points to the
8+
`CONTEXT.md` files relevant to each context.
9+
- Read the context documents relevant to the task.
10+
- Read system-wide ADRs under `docs/adr/` and context-specific ADRs under the
11+
relevant package's `docs/adr/` directory.
12+
13+
If these files do not exist, proceed silently. Do not propose empty placeholder
14+
documents. The domain-modeling workflow creates them lazily when terminology or
15+
decisions are actually resolved.
16+
17+
## Multi-context layout
18+
19+
```text
20+
/
21+
├── CONTEXT-MAP.md
22+
├── docs/adr/ system-wide decisions
23+
└── packages/
24+
├── stack/
25+
│ ├── CONTEXT.md
26+
│ └── docs/adr/ stack-specific decisions
27+
├── cli/
28+
│ ├── CONTEXT.md
29+
│ └── docs/adr/ CLI-specific decisions
30+
└── <context>/
31+
├── CONTEXT.md
32+
└── docs/adr/
33+
```
34+
35+
Nested subtrees with their own architecture, such as `packages/eql`, may define
36+
further contexts. `CONTEXT-MAP.md` is the authority for locating them.
37+
38+
## Use the glossary's vocabulary
39+
40+
When output names a domain concept—in an issue title, proposal, hypothesis, or
41+
test name—use the term defined in the relevant `CONTEXT.md`. Do not drift to a
42+
synonym that the glossary explicitly avoids.
43+
44+
If a needed concept is absent, reconsider whether the project already has a
45+
different term. If the gap is real, record it for domain modeling.
46+
47+
## Flag ADR conflicts
48+
49+
If proposed work contradicts an existing ADR, identify the conflict explicitly
50+
rather than silently overriding the decision.

docs/agents/issue-tracker.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Issue tracker: GitHub
2+
3+
Issues and specs for this repo live as GitHub issues. Use the `gh` CLI for all
4+
operations.
5+
6+
## Repository ownership
7+
8+
All work present in this monorepo is tracked in `cipherstash/stack`, including
9+
the absorbed EQL source under `packages/eql` and protect-ffi under
10+
`packages/protect-ffi`. Their former upstream repositories are historical
11+
sources, not active issue trackers. Never create, move, or update an issue in
12+
`cipherstash/encrypt-query-language` or `cipherstash/protectjs-ffi` for work in
13+
this tree. Create it in `cipherstash/stack` and link historical upstream issues
14+
only as provenance.
15+
16+
## Conventions
17+
18+
- **Create an issue**: `gh issue create --title "..." --body "..."`. Use a
19+
heredoc for multi-line bodies.
20+
- **Read an issue**: `gh issue view <number> --comments`, filtering comments by
21+
`jq` and also fetching labels.
22+
- **List issues**: `gh issue list --state open --json number,title,body,labels,comments --jq '[.[] | {number, title, body, labels: [.labels[].name], comments: [.comments[].body]}]'`
23+
with appropriate `--label` and `--state` filters.
24+
- **Comment on an issue**: `gh issue comment <number> --body "..."`.
25+
- **Apply/remove labels**: `gh issue edit <number> --add-label "..."` or
26+
`--remove-label "..."`.
27+
- **Close**: `gh issue close <number> --comment "..."`.
28+
29+
Use `--repo cipherstash/stack` explicitly. Do not infer ownership from subtree
30+
history, package names, old issue links, or additional git remotes.
31+
32+
## Pull requests as a triage surface
33+
34+
**PRs as a request surface: no.** Set this to `yes` if this repository starts
35+
treating external pull requests as feature requests.
36+
37+
When enabled, use the corresponding `gh pr` commands. GitHub shares one number
38+
space across issues and pull requests, so resolve an ambiguous `#42` with
39+
`gh pr view 42` and fall back to `gh issue view 42`.
40+
41+
## Skill operations
42+
43+
- When a skill says **publish to the issue tracker**, create a GitHub issue.
44+
- When a skill says **fetch the relevant ticket**, run
45+
`gh issue view <number> --comments`.
46+
47+
## Wayfinding operations
48+
49+
The map is one issue labelled `wayfinder:map`; its tickets are child issues.
50+
51+
- Create child tickets as GitHub sub-issues through `gh api`. If sub-issues are
52+
unavailable, use a task list in the map and add `Part of #<map>` to each
53+
child.
54+
- Label children `wayfinder:<type>` where type is `research`, `prototype`,
55+
`grilling`, or `task`.
56+
- Represent blocking with GitHub's native issue dependencies. Fall back to a
57+
`Blocked by: #<n>` line only when dependencies are unavailable.
58+
- Claim work with `gh issue edit <n> --add-assignee @me`.
59+
- Resolve work by commenting with the result, closing the child, and adding its
60+
context pointer to the map's Decisions-so-far section.

docs/agents/triage-labels.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Triage labels
2+
3+
The engineering skills use five canonical triage roles. This table maps those
4+
roles to this repository's GitHub labels.
5+
6+
| Canonical role | GitHub label | Meaning |
7+
| --- | --- | --- |
8+
| `needs-triage` | `needs-triage` | Maintainer needs to evaluate the issue |
9+
| `needs-info` | `needs-info` | Waiting on the reporter for more information |
10+
| `ready-for-agent` | `ready-for-agent` | Fully specified and ready for an AFK agent |
11+
| `ready-for-human` | `ready-for-human` | Requires human implementation |
12+
| `wontfix` | `wontfix` | Will not be actioned |
13+
14+
When a skill names a triage role, use the corresponding GitHub label from this
15+
table.

packages/eql/AGENTS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CLAUDE.md
22

3+
> **Repository ownership:** EQL is maintained in the `cipherstash/stack`
4+
> monorepo. Track all EQL work in `cipherstash/stack` GitHub Issues. The former
5+
> `cipherstash/encrypt-query-language` repository and its issues are historical
6+
> provenance only; do not create or update active work there.
7+
38
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
49

510
## Development Commands

packages/eql/CONTEXT.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Encrypt Query Language
2+
3+
EQL defines the PostgreSQL representation and query surface for searchable
4+
encrypted values.
5+
6+
## Language
7+
8+
**Encrypted data**:
9+
Ciphertext and search terms stored in an application table column. Its continued
10+
existence is the primary persistence guarantee.
11+
_Avoid_: EQL machinery, index state
12+
13+
**Data-bearing domain**:
14+
A durable `public.eql_v3_*` PostgreSQL domain used as an application column type.
15+
It must survive EQL install, uninstall, and reinstall.
16+
_Avoid_: Query domain, EQL schema type
17+
18+
**EQL machinery**:
19+
Disposable functions, query-operand types, operators, aggregates, and internal
20+
types owned by the `eql_v3` and `eql_v3_internal` schemas.
21+
_Avoid_: Encrypted data
22+
23+
**Derived search index**:
24+
A reconstructable functional index over EQL machinery. It accelerates encrypted
25+
queries but is not the authoritative copy of encrypted data.
26+
_Avoid_: Encrypted data, durable data
27+
28+
**Non-reconstructable dependency**:
29+
A customer-owned constraint, policy, view, or other database object whose
30+
meaning cannot be safely inferred and recreated by the EQL installer.
31+
_Avoid_: Derived search index

0 commit comments

Comments
 (0)