project_human
AGENTS.md5 starsChanged 9 months agoMITView on GitHub
NEVER run compilation, testing, builds, linting, or installs on the local machine. These operations are blocked in opencode.json and must run in a GitHub Codespace. Sync files to your codespace after making edits, then run verification there. pnpm monorepo. Two packages: @humanity4ai/mcp-servers (publishable) and @humanity4ai/evals (private). Single test / single package: Pre-commit (run in codespace): pnpm check && pnpm evals && pnpm test. CI order: check → build → EVAL_REPORT=1 pnpm evals → test:coverage (both packages). Excluded from coverage (vitest.config.ts):…
- Reads credentials
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 31,700 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 repository12 other files it gives its agents.
- .github/copilot-instructions.mdCopilot instructions
- llms-full.txtllms.txt
- llms.txtllms.txt
- accessibilitySkill
- age-inclusive-designSkill
- cognitive-accessibilitySkill
- conflict-de-escalationSkill
- cultural-sensitivitySkill
- depression-sensitive-contentSkill
- empathetic-communicationSkill
- neurodiversity-aware-designSkill
- supportive-conversationSkill
The file
We split this AGENTS.md into the rules it gives an agent
4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 125
All PRs target main. CI on push/PR.
- Very specific: line 136
Import from crisis-resources.ts.
- Very specific: line 160
NOT in .gitignore. Built dist/ directory must be committed (needed for npm pack and npx entry point).
- Very specific: line 167
If a PR's head branch doesn't match feature/*, CI might not auto-trigger.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
AGENTS.md — Agentic Coding Guidelines
CRITICAL: All compute in GitHub Codespaces
NEVER run compilation, testing, builds, linting, or installs on the local machine. These operations are blocked in opencode.json and must run in a GitHub Codespace.
gh cs ssh <name> -- "cd /workspaces/project_human && pnpm check"
gh cs cp <changed-file> remote:/workspaces/project_human/<path>Sync files to your codespace after making edits, then run verification there.
Commands (Codespace only)
pnpm monorepo. Two packages: @humanity4ai/mcp-servers (publishable) and @humanity4ai/evals (private).
pnpm check # tsc --noEmit across all packages
pnpm start # MCP server via tsx (stdio transport)
pnpm test # vitest run (both packages)
pnpm test:coverage # vitest --coverage
pnpm evals # skill eval harness (10 checks: 9 skills + contract-consistency)
pnpm build # compile mcp-servers → dist/Single test / single package:
pnpm --filter @humanity4ai/mcp-servers test -- --test-name-pattern "H-1"
pnpm --filter @humanity4ai/mcp-servers test -- src/__tests__/handlers.test.ts
pnpm --filter @humanity4ai/mcp-servers check
pnpm --filter @humanity4ai/evals testPre-commit (run in codespace): pnpm check && pnpm evals && pnpm test.
CI order: check → build → EVAL_REPORT=1 pnpm evals → test:coverage (both packages).
Coverage Thresholds
| Package | Stmts | Branch | Funcs | Lines |
| mcp-servers | 90% | 83% | 90% | 90% |
| evals | 78% | 65% | 80% | 78% |
Excluded from coverage (vitest.config.ts): bin.ts, accessibility-engine.ts, server-factory.ts.
wcag-criteria.ts included (96% covered by modules.test.ts).
New conditionals → new tests in __tests__/modules.test.ts.
Architecture
Package layout
mcp-servers/src/server-factory.ts— sharedcreateServer()→ registers all 9 tools on anMcpServer. Used by both stdio (mcp-server.ts) and HTTP (api/mcp.ts) transports.mcp-servers/src/mcp-server.ts— thin stdio wrapper: imports factory, connectsStdioServerTransport. Re-exports handlers +VERSIONfor test compatibility.mcp-servers/api/mcp.ts— Vercel serverless function usingStreamableHTTPServerTransportin stateless mode. Imports factory + handlers from npm package.mcp-servers/src/schemas-data.ts— auto-generated at build time: all 18 JSON schemas as inline JS objects.validate.tsimports this instead ofreadFileSync— zero file I/O, works in all bundler environments (Vercel, Cloudflare).mcp-servers/src/validate.ts— input validation against inlineSCHEMA_REGISTRY. Nonode:fsdependency. Called byinvokeActionat handler dispatch time.mcp-servers/src/handlers.ts— 9 private handler functions +invokeAction(action, input)dispatcher.knowledge-core/taxonomy.ts— canonicalCATEGORY_SLUGS+ESCALATION_REQUIRED_SKILLS(typedconstarrays).taxonomy.mdis the human-readable reference.evals/src/run-evals.ts— parsesVALID_CATEGORIESfromknowledge-core/taxonomy.mdat runtime (no hardcoded duplicate). 10 checks: 9 skills +contract-consistency.
Key facts
- MCP server is rule-based — no LLM calls, no external APIs.
- Contracts in
index.ts(TypeScript array ofActionContract). - Schemas:
schemas/<skill>.input|output.json— 18 files (9 skills × 2). Bundled at build time intoschemas-data.ts. - Shared modules (import from these, don't duplicate):
patterns.ts— 16 pattern categories (shame, urgency, crisis, grief, emotion, etc.)crisis-resources.ts— crisis phone numbers/URLs (988, 741741, 116 123, IASP, findahelpline.com)crisis-detection.ts—detectCrisisSignals(),detectSafetySignals()emotion-detection.ts—detectEmotion()(6 categories)accessibility-engine.ts— 13 scoring functions (86 WCAG 2.2 criteria), optional axe-core integrationwcag-criteria.ts—WCAG_CRITERIAarray (86 entries),getChecklist(level),criteriaByLevel(level)i18n.ts— 9 languages,normalizeLocale(),getLocalizedCrisisResources()
invokeActionis async — returnsPromise<HandlerResult>. All callers mustawait.validateContracts()called at startup —createServer()inserver-factory.tscalls it before registering tools. Fail-fast on malformed contracts.- Server startup guard:
mcp-server.tsskips auto-start whenNODE_ENV === "test". mcpNameinmcp-servers/package.json:io.github.humanity4ai/project-human— for MCP Registry publishing.- engines.node:
>=22across all packages. Node 20 is EOL. CI tests Node 22 exclusively.
npm package: @humanity4ai/mcp-servers
- Subpath exports:
.,./handlers,./types,./validate,./schemas/* - Bin:
mcp-servers→./dist/bin.js(importsmcp-server.js; auto-run guard prevents double-start) prepack→pnpm build(rebuilds dist before publish)- Publish: build dist in Codespace →
pnpm pack→ copy tarball locally →npm publish <tarball> --access public(local Node 20 can't run prepack; publish tarball directly)
Vercel deployment
- Domain:
https://humanity4ai.ascent.partners/api/mcp - Project:
humanity4ai-mcponsimon-maks-projectsteam - Deploy:
vercel_deploy_to_vercelMCP tool withapi/mcp.ts+package.json - SSO protection disabled via
PATCH /v9/projects/:idwith{"ssoProtection": null}
Code Conventions
Handler pattern (all 9 handlers return this):
type HandlerResult =
| { ok: true; data: InvokeResponse }
| { ok: false; error: string };InvokeResponse: { action, output, assumptions, uncertainty, boundaryNotice }
- Error messages include hints (e.g., "Use tools/list to see available actions")
- ESM with
.jsextension in relative imports (NodeNext) - Zod for contract validation;
validate.tsfor MCP input validation (uses inlineSCHEMA_REGISTRY) validate.ts: rejects empty strings for required fields, validates array item types, enforces minLength/maxLength
Git Workflow
feature/* → main (default branch)All PRs target main. CI on push/PR. Merged branches auto-deleted. development branch deleted — do not recreate.
Branch protection (ruleset main-protection): PR required + validate (22)/CodeQL checks must pass. Direct pushes to main are rejected (409). If CI doesn't auto-trigger on a PR, manually dispatch via gh workflow run ci.yml --ref <branch>.
Auth (repo-local only): pushes to https://github.com/humanity4ai/ authenticate as humanity4ai via fine-grained PAT in $HUMANITY4AI_PAT (~/.env.opencode), wired through a URL-scoped credential helper in .git/config. For gh CLI admin calls: GH_TOKEN="$HUMANITY4AI_PAT" gh api ....
Pitfalls
Never hardcode crisis phone numbers
Import from crisis-resources.ts. All crisis numbers live there. Adding one edits exactly one file.
Coverage threshold is 83% branches
New if/else/ternary/switch = new tests. server-factory.ts, accessibility-engine.ts, and bin.ts are excluded. Run pnpm --filter @humanity4ai/mcp-servers test:coverage before push.
supportive-conversation category
Category is emotional-safety. Now includes grief support modes (presence, practical, reflection). Enforced in knowledge-core/taxonomy.md and skills/index.yaml.
Nine skills, not ten or eleven
WCAG AAA + AA consolidated into accessibility (1 skill). Grief-loss-support removed. No reproduction. skills/index.yaml count must be 9.
Python scripts are in legacy/
The 112 Python scripts were moved to legacy/python-scripts/ — the MCP server never called them. All patterns are in patterns.ts.
specs/ is gitignored
SDD artifacts are local-only. Don't reference them in committed code.
docs/ is where documentation lives
ROADMAP, INSTALL, GOVERNANCE, SYSTEM_PROMPT, etc. are in docs/ (not root).
Site deploys automatically
Push to main with site/** changes triggers GitHub Pages deploy.
dist/ is committed
NOT in .gitignore. Built dist/ directory must be committed (needed for npm pack and npx entry point). Run pnpm build before release commits.
Design decision (F-005 — maintained): Retained for npx compatibility, reviewable diffs, and fresh checkout guarantees.
schemas are bundled at build time
schemas-data.ts contains all 18 JSON schemas as inline JS objects. validate.ts imports from it — no readFileSync, no node:fs, no import.meta.url path resolution. This means the package works in all bundler environments (Vercel, Cloudflare Workers, etc.) without additional config. When adding a new skill schema, regenerate schemas-data.ts.
CI may not trigger on non-feature/* branches
If a PR's head branch doesn't match feature/*, CI might not auto-trigger. Manually dispatch: gh workflow run ci.yml --ref <branch>. Both validate (22) and CodeQL must pass before merge.
No grief-loss-support
Grief support is handled by supportive_reply (supportive-conversation skill). Grief-loss-support skill dir, schemas, and contract were removed — do not recreate them.
Vercel deploy requires inline schemas
The Vercel function at api/mcp.ts calls invokeAction from the npm package. Since v1.0.6, schemas are inline — no need to copy schema files to deployment root. Deploy with bare npm install (no postinstall tricks, no buildCommand).
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.

