diff --git a/_bridges/README.md b/_bridges/README.md new file mode 100644 index 0000000..7470877 --- /dev/null +++ b/_bridges/README.md @@ -0,0 +1,21 @@ +# `_bridges/` — Cross-tool bridge templates + +Tool-agnostic coding-rules templates, rendered into any project via `_bridges/emit.sh`. Placeholders: `{{PROJECT_NAME}}`, `{{PROJECT_DESCRIPTION}}`, `{{YEAR}}`, `{{MONTH}}`, `{{DATE}}`. + +| Template | Output path | +|---|---| +| `cursorrules.tmpl` | `.cursorrules` | +| `agents-md.tmpl` | `AGENTS.md` | +| `copilot.tmpl` | `.github/copilot-instructions.md` | +| `cursor-mdc.tmpl` | `.cursor/rules/main.mdc` | +| `windsurf.tmpl` | `.windsurf/rules/main.md` | +| `junie.tmpl` | `.junie/guidelines.md` | +| `continue.tmpl` | `.continue/rules/main.md` | +| `gemini.tmpl` | `GEMINI.md` | +| `aider-conventions.tmpl` | `CONVENTIONS.md` | +| `aider-conf.tmpl` | `.aider.conf.yml` | +| `replit.tmpl` | `replit.md` | + +Render: `_bridges/emit.sh [project-name] [project-description]`. Idempotent — existing files are skipped. + +Cross-ref: KeiAgent is the personal-CLI predecessor that also ships these templates (verified against vendor docs 2026-04). diff --git a/_bridges/agents-md.tmpl b/_bridges/agents-md.tmpl new file mode 100644 index 0000000..b506a4a --- /dev/null +++ b/_bridges/agents-md.tmpl @@ -0,0 +1,24 @@ +# AGENTS.md + +> Read by Codex CLI (OpenAI spec), Copilot, Aider (when referenced), Windsurf, Warp, Zed, Antigravity (since v1.20.3, 2026-03-05), JetBrains Junie. See also: CLAUDE.md / .cursor/rules/ / GEMINI.md / .junie/guidelines.md / replit.md. + +## {{PROJECT_NAME}} + +{{PROJECT_DESCRIPTION}} + +## Before You Start +1. Read `DECISIONS.md` — architectural choices already made +2. Read `TODO.md` (if exists) — current priorities +3. Read `CLAUDE.md` (if exists) — project-specific rules + +## Rules +- **Constructor Pattern**: 1 file = 1 class. File <200 lines. Function <30 lines. +- **Root cause**: fix causes, not symptoms +- **SSOT**: types, routes, enums defined in ONE place +- **Tests**: write WITH code, never defer + +## Do NOT +- Rewrite working code without reason +- Add abstractions for one-time operations +- Skip reading DECISIONS.md before architectural changes +- Commit .env, credentials, API keys diff --git a/_bridges/aider-conf.tmpl b/_bridges/aider-conf.tmpl new file mode 100644 index 0000000..bb0b60b --- /dev/null +++ b/_bridges/aider-conf.tmpl @@ -0,0 +1,5 @@ +# Aider config — auto-reads project rules on every session +# See: https://aider.chat/docs/config/aider_conf.html +read: + - CONVENTIONS.md + - AGENTS.md diff --git a/_bridges/aider-conventions.tmpl b/_bridges/aider-conventions.tmpl new file mode 100644 index 0000000..55070c5 --- /dev/null +++ b/_bridges/aider-conventions.tmpl @@ -0,0 +1,27 @@ +# {{PROJECT_NAME}} — Aider Conventions + +> Auto-loaded by Aider via `.aider.conf.yml` (`read: CONVENTIONS.md`). + +{{PROJECT_DESCRIPTION}} + +## Before You Start +1. Read `DECISIONS.md` — architectural choices already made +2. Read `TODO.md` (if exists) — current priorities +3. Read `CLAUDE.md` (if exists) — project-specific rules + +## Constructor Pattern +- 1 file = 1 class = 1 responsibility +- File <200 lines, function <30 lines +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations diff --git a/_bridges/continue.tmpl b/_bridges/continue.tmpl new file mode 100644 index 0000000..18b2a0d --- /dev/null +++ b/_bridges/continue.tmpl @@ -0,0 +1,29 @@ +--- +name: {{PROJECT_NAME}} +alwaysApply: true +--- + +# {{PROJECT_NAME}} — Continue.dev Rules + +{{PROJECT_DESCRIPTION}} + +## Constructor Pattern +1 file = 1 class = 1 responsibility. Function >30 lines = split. File >200 lines = decompose. + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Project Context +- Architecture decisions: see `DECISIONS.md` +- Project rules: see `CLAUDE.md` +- Current priorities: see `TODO.md` + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations diff --git a/_bridges/copilot.tmpl b/_bridges/copilot.tmpl new file mode 100644 index 0000000..835d973 --- /dev/null +++ b/_bridges/copilot.tmpl @@ -0,0 +1,16 @@ +# {{PROJECT_NAME}} — Copilot Instructions + +## Architecture +Read DECISIONS.md before making architectural choices. Document new decisions there. + +## Code Style +- Constructor Pattern: 1 file = 1 class = 1 responsibility +- File <200 lines, function <30 lines +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations diff --git a/_bridges/cursor-mdc.tmpl b/_bridges/cursor-mdc.tmpl new file mode 100644 index 0000000..f370891 --- /dev/null +++ b/_bridges/cursor-mdc.tmpl @@ -0,0 +1,34 @@ +--- +description: {{PROJECT_NAME}} constructor-pattern coding rules +globs: **/* +alwaysApply: true +--- + +# {{PROJECT_NAME}} — Cursor Rules (MDC) + +{{PROJECT_DESCRIPTION}} + +## Constructor Pattern +1 file = 1 class = 1 responsibility. Function >30 lines = split. File >200 lines = decompose. + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Project Context +- Architecture decisions: see `DECISIONS.md` +- Project rules: see `CLAUDE.md` +- Current priorities: see `TODO.md` + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations + +## Session Protocol +- Read `DECISIONS.md` before making architectural choices +- Document new decisions in `DECISIONS.md` diff --git a/_bridges/cursorrules.tmpl b/_bridges/cursorrules.tmpl new file mode 100644 index 0000000..d7e198a --- /dev/null +++ b/_bridges/cursorrules.tmpl @@ -0,0 +1,23 @@ +# {{PROJECT_NAME}} — Cursor Rules + +## Constructor Pattern +1 file = 1 class = 1 responsibility. Function >30 lines = split. File >200 lines = decompose. + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place +- Root cause first — never fix symptoms + +## Project Context +- Architecture decisions: see DECISIONS.md +- Known issues: see TODO.md (if exists) + +## Code Style +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" +- No mixins, no abstract factories, no DI containers + +## Session Protocol +- Read DECISIONS.md before making architectural choices +- Document new decisions in DECISIONS.md diff --git a/_bridges/gemini.tmpl b/_bridges/gemini.tmpl new file mode 100644 index 0000000..a295b26 --- /dev/null +++ b/_bridges/gemini.tmpl @@ -0,0 +1,27 @@ +# {{PROJECT_NAME}} — Gemini / Antigravity Instructions + +> Primary memory file for Google Antigravity (also reads `AGENTS.md` since v1.20.3, 2026-03-05). + +{{PROJECT_DESCRIPTION}} + +## Before You Start +1. Read `DECISIONS.md` — architectural choices already made +2. Read `TODO.md` (if exists) — current priorities +3. Read `CLAUDE.md` (if exists) — project-specific rules + +## Constructor Pattern +- 1 file = 1 class = 1 responsibility +- File <200 lines, function <30 lines +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations diff --git a/_bridges/junie.tmpl b/_bridges/junie.tmpl new file mode 100644 index 0000000..fc3269c --- /dev/null +++ b/_bridges/junie.tmpl @@ -0,0 +1,27 @@ +# {{PROJECT_NAME}} — Junie Guidelines + +> Read by JetBrains Junie. Supplementary to `AGENTS.md` (Junie precedence: `.junie/AGENTS.md` > `AGENTS.md` > `.junie/guidelines.md`). + +{{PROJECT_DESCRIPTION}} + +## Before You Start +1. Read `DECISIONS.md` — architectural choices already made +2. Read `TODO.md` (if exists) — current priorities +3. Read `CLAUDE.md` (if exists) — project-specific rules + +## Constructor Pattern +- 1 file = 1 class = 1 responsibility +- File <200 lines, function <30 lines +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations diff --git a/_bridges/replit.tmpl b/_bridges/replit.tmpl new file mode 100644 index 0000000..ac04924 --- /dev/null +++ b/_bridges/replit.tmpl @@ -0,0 +1,27 @@ +# {{PROJECT_NAME}} — Replit Agent Instructions + +> Read by Replit Agent (does NOT read `AGENTS.md`). + +{{PROJECT_DESCRIPTION}} + +## Before You Start +1. Read `DECISIONS.md` — architectural choices already made +2. Read `TODO.md` (if exists) — current priorities +3. Read `CLAUDE.md` (if exists) — project-specific rules + +## Constructor Pattern +- 1 file = 1 class = 1 responsibility +- File <200 lines, function <30 lines +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations diff --git a/_bridges/windsurf.tmpl b/_bridges/windsurf.tmpl new file mode 100644 index 0000000..518357b --- /dev/null +++ b/_bridges/windsurf.tmpl @@ -0,0 +1,32 @@ +--- +trigger: always_on +--- + +# {{PROJECT_NAME}} — Windsurf Rules + +{{PROJECT_DESCRIPTION}} + +## Constructor Pattern +1 file = 1 class = 1 responsibility. Function >30 lines = split. File >200 lines = decompose. + +## Core Rules +- No patching — fix root cause, not symptoms +- Don't rewrite working code without reason +- Single Source of Truth — types, routes, enums in ONE place +- Types/interfaces BEFORE implementation +- Tests WITH code, never "later" + +## Project Context +- Architecture decisions: see `DECISIONS.md` +- Project rules: see `CLAUDE.md` +- Current priorities: see `TODO.md` + +## Forbidden +- Mixins, abstract factories, DI containers +- Rewriting working code without reason +- Committing .env, credentials, API keys +- Adding abstractions for one-time operations + +## Session Protocol +- Read `DECISIONS.md` before making architectural choices +- Document new decisions in `DECISIONS.md`