OpenCRE
AGENTS.md199 starsChanged 5 months agoCC0-1.0View on GitHub
Cursor agents working in this repo must follow the rules in .cursor/rules/. Prefer existing Makefile targets and scripts/ helpers over ad-hoc Docker, GA, import, or prod-DB setup. Read script headers or --help for env vars and flags; do not reimplement their logic. Use Makefile targets — do not hand-roll docker run: Reset volumes: make docker-neo4j-rm / make docker-redis-rm / make docker-postgres-rm. Local Postgres is pgvector/pgvector:pg16 by default (POSTGRESIMAGE override). Plain postgres images are not supported for app DB use —…
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Prefer existing Makefile targets and scripts/ helpers over ad-hoc Docker, GA, import, or prod-DB setup.
- Very specific: line 23
Use Makefile targets — do not hand-roll docker run:
- Very specific: line 69
Use scripts/db/* — never raw destructive psql against prod without these wrappers.
- Very specific: line 80
After prod GA cache changes, verify with make verify-ga-complete-prod / make monitor-ga-health-prod.
- Distinctive: line 105
Create via Cursor → Automations → New (Agents Window).
- Very specific: line 113
Before deploy or flask db upgrade: make alembic-guardrail (or python scripts/check_alembic_revision_guardrail.py).
≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OpenCRE Agent Instructions
Cursor agents working in this repo must follow the rules in .cursor/rules/.
Quick start
- Requirements gate — If goal, success criteria,
@file refs, or constraints are missing, stop and ask (requirements-gate.mdc). - Plan first — Non-trivial or multi-file work requires a plan and user approval before coding (
plan-first-workflow.mdc,multi-agent-workflow.mdc). - Verify — After code changes, run checks and iterate until green (
verifiable-goals.mdc):make lintmake mypymake testmake frontend(if frontend touched)
- Review — Substantive work needs independent judge/subagent review (
multi-agent-workflow.mdc). - Production gap analysis — On Heroku/opencreorg, gap analysis is cache-only: serve precomputed rows from Postgres; do not compute GA on production (cache miss → 404).
Operational scripts
Prefer existing Makefile targets and scripts/ helpers over ad-hoc Docker, GA, import, or prod-DB setup. Read script headers or --help for env vars and flags; do not reimplement their logic.
Local Docker services
Use Makefile targets — do not hand-roll docker run:
make docker-neo4j # Neo4j (7474/7687)
make docker-redis # Redis Stack (6379/8001)
make docker-postgres # local Postgres+pgvector (5432, cre/password)
make start-containers # neo4j + redis only
make migrate-upgrade # after postgres is upReset volumes: make docker-neo4j-rm / make docker-redis-rm / make docker-postgres-rm.
Local Postgres is pgvector/pgvector:pg16 by default (POSTGRES_IMAGE override). Plain postgres images are not supported for app DB use — embedding_vec / chat / Librarian need the vector extension.
Imports and Neo4j populate
make import-all # full standards import via scripts/import-all.sh
make import-projects # skip core CRE import (CRE_SKIP_IMPORT_CORE=1)
make import-neo4j # populate Neo4j from cachescripts/import-all.sh handles parallel importers, SQLite export, and verification. For embeddings-only SQLite → Postgres push, use scripts/sync_embeddings_table.py (see its docstring).
Gap analysis (local compute, prod verify)
Local backfill (starts containers, workers, migrations — see scripts/backfill_gap_analysis.sh):
make backfill-gap-analysis # parallel workers + --ga_backfill_missing
make backfill-gap-analysis-sync # Neo4j populate + backfill without queue
make sync-gap-analysis-table-local # upsert material rows sqlite → local PostgresProd / staging checks (HTTP only — never compute GA on opencreorg):
make verify-ga-complete-prod # scripts/verify_ga_completeness.py
make monitor-ga-health-prod # scripts/monitor_ga_health.py (503 / empty result alerts)
make monitor-chatbot-health-prod # scripts/monitor_chatbot_health.py (SPA + /completion 401)
make verify-ga-parity-local # scripts/verify_ga_postgres_neo_parity.pyTable sync between databases: scripts/sync_gap_analysis_table.py, scripts/sync_embeddings_table.py.
Production DB (Heroku opencreorg)
Use scripts/db/* — never raw destructive psql against prod without these wrappers. All flows capture and wait for a fresh Heroku backup first (scripts/db/common.sh).
scripts/db/backup-opencreorg.sh # backup only
scripts/db/surgery-opencreorg.sh --sql-file path/to/change.sql # targeted SQL
scripts/db/surgery-opencreorg.sh --sql-file … --destructive # DELETE/DROP/TRUNCATE
scripts/db/sync-local-to-opencreorg.sh [--table node]… # local → prod syncDestructive surgery requires CONFIRM_DESTRUCTIVE=I_UNDERSTAND_OPENCREORG_PROD_DB_DESTRUCTIVE_ACTION (exact phrase). Override app: APP_NAME=opencreorg. See production-db-ops-safety.mdc.
After prod GA cache changes, verify with make verify-ga-complete-prod / make monitor-ga-health-prod.
Weekly prod GA & data completeness (Cursor Automation)
Schedule a Cursor Automation (not GitHub Actions) to run weekly — prod is cache-only; checks are HTTP + repo scripts only.
| Setting | Value |
| Trigger | Cron: 0 9 * * 1 (Mondays 09:00) |
| Repo | OWASP/OpenCRE, branch main |
| Tools | None required (cloud agent uses repo checkout) |
Agent prompt (paste into Automations editor):
Weekly OpenCRE prod GA, chatbot, and data completeness for opencreorg.
1. python3 scripts/monitor_ga_health.py --base-url https://opencre.org --output-json tmp/prod-ga-health.json
2. python3 scripts/verify_ga_completeness.py --base-url https://opencre.org --output-json tmp/prod-ga-completeness.json
3. python3 scripts/monitor_chatbot_health.py --base-url https://opencre.org --output-json tmp/prod-chatbot-health.json
4. Confirm /rest/v1/standards and /rest/v1/ga_standards return non-empty lists.
5. If incomplete_pairs > 0, chatbot checks fail, or non-zero exit: list failing pairs/buckets/checks; recommend AGENTS.md Operational scripts (local backfill + scripts/sync_gap_analysis_table.py). Do not compute GA on Heroku, do not send authenticated chatbot prompts, and do not run destructive prod DB ops without explicit approval.
6. If all pass: report complete/total pairs, standards counts, and chatbot check results.Create via Cursor → Automations → New (Agents Window). Do not hand-roll docker/GA setup in the automation prompt.
Staging bootstrap
scripts/setup-heroku-staging.sh — provisions staging from prod + local SQLite; supports --embeddings, --gap_analysis, or full sync. Requires PROD_APP, STAGING_APP, LOCAL_SQLITE_DB.
Deploy / migrations
Before deploy or flask db upgrade: make alembic-guardrail (or python scripts/check_alembic_revision_guardrail.py).
Rule index
| Rule | Purpose |
requirements-gate.mdc | Clarifying questions + requirements template |
complete-ticket.mdc | Ticket gate for .md/.txt files; uses requirements-gate template + coding standards |
plan-first-workflow.mdc | Plan Mode before non-trivial edits |
multi-agent-workflow.mdc | Big changes, approval gates, builder ≠ judge |
verifiable-goals.mdc | Lint, mypy, test, CI — show evidence |
never-assume.mdc | No guessing; complete code; minimal scope |
tdd-workflow.mdc | Test-first for new behavior and importers |
autonomous-workflow.mdc | Execute after approval; no unsolicited commits |
context-management.mdc | /clear, @ refs, stale context recovery |
production-db-ops-safety.mdc | Destructive prod DB confirmation |
alembic-deploy-guardrail.mdc | Pre-deploy migration guardrail |
OpenCRE commands
make lint # black + frontend prettier
make mypy # Python typecheck
make test # Python unittest suite
make frontend # yarn build (when TS/TSX changed)
make alembic-guardrail # before deploy/migration ops
make install-python # includes `playwright install` for Python embeddings (prompt_client) — not frontend e2e; do not remove when adding Cypress
make e2e-db # seed ./standards_cache.sqlite for e2e (create_all from models + fixture seed)
make e2e # frontend Cypress e2e (build, serve Flask on 127.0.0.1:5000, cypress run)Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository11 other files it gives its agents.
- .cursor/rules/alembic-deploy-guardrail.mdcCursor rule
- .cursor/rules/autonomous-workflow.mdcCursor rule
- .cursor/rules/complete-ticket.mdcCursor rule
- .cursor/rules/context-management.mdcCursor rule
- .cursor/rules/multi-agent-workflow.mdcCursor rule
- .cursor/rules/never-assume.mdcCursor rule
- .cursor/rules/plan-first-workflow.mdcCursor rule
- .cursor/rules/production-db-ops-safety.mdcCursor rule
- .cursor/rules/requirements-gate.mdcCursor rule
- .cursor/rules/tdd-workflow.mdcCursor rule
- .cursor/rules/verifiable-goals.mdcCursor rule
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

