From cafe89be6a1f24f90257daf7e1c360024e9304df Mon Sep 17 00:00:00 2001 From: Amit Rajput Date: Mon, 6 Apr 2026 11:06:04 +0530 Subject: [PATCH] init fab --- .envrc | 3 +++ .gitignore | 15 ++++++++++- docs/memory/index.md | 7 +++++ docs/specs/index.md | 15 +++++++++++ fab/.kit-migration-version | 1 + fab/changes/.gitkeep | 0 fab/changes/archive/.gitkeep | 0 fab/project/code-quality.md | 28 +++++++++++++++++++ fab/project/code-review.md | 52 ++++++++++++++++++++++++++++++++++++ fab/project/config.yaml | 1 + fab/project/constitution.md | 18 +++++++++++++ fab/project/context.md | 18 +++++++++++++ fab/sync/README.md | 9 +++++++ 13 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 .envrc create mode 100644 docs/memory/index.md create mode 100644 docs/specs/index.md create mode 100644 fab/.kit-migration-version create mode 100644 fab/changes/.gitkeep create mode 100644 fab/changes/archive/.gitkeep create mode 100644 fab/project/code-quality.md create mode 100644 fab/project/code-review.md create mode 100644 fab/project/config.yaml create mode 100644 fab/project/constitution.md create mode 100644 fab/project/context.md create mode 100644 fab/sync/README.md diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..7d34f73 --- /dev/null +++ b/.envrc @@ -0,0 +1,3 @@ +export IDEAS_FILE=fab/backlog.md + +export WORKTREE_INIT_SCRIPT="fab sync" diff --git a/.gitignore b/.gitignore index d4aff2a..aebc752 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,17 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* -.idea/ \ No newline at end of file +.idea/ +.fab-* + +/.agents + +/.claude + +/.cursor + +/.opencode + +/.codex + +/.gemini diff --git a/docs/memory/index.md b/docs/memory/index.md new file mode 100644 index 0000000..21a1e85 --- /dev/null +++ b/docs/memory/index.md @@ -0,0 +1,7 @@ +# Memory Index + + + + +| Domain | Description | Memory Files | +|--------|-------------|------| diff --git a/docs/specs/index.md b/docs/specs/index.md new file mode 100644 index 0000000..162ce8e --- /dev/null +++ b/docs/specs/index.md @@ -0,0 +1,15 @@ +# Specifications Index + +> **Specs are pre-implementation artifacts** — what you *planned*. They capture conceptual design +> intent, high-level decisions, and the "why" behind features. Specs are human-curated, +> flat in structure, and deliberately size-controlled for quick reading. +> +> Contrast with [`docs/memory/index.md`](../memory/index.md): memory files are *post-implementation* — +> what actually happened. Memory files are the authoritative source of truth for system behavior, +> maintained by `/fab-continue` (hydrate). +> +> **Ownership**: Specs are written and maintained by humans. No automated tooling creates or +> enforces structure here — organize files however makes sense for your project. + +| Spec | Description | +|------|-------------| diff --git a/fab/.kit-migration-version b/fab/.kit-migration-version new file mode 100644 index 0000000..6e8bf73 --- /dev/null +++ b/fab/.kit-migration-version @@ -0,0 +1 @@ +0.1.0 diff --git a/fab/changes/.gitkeep b/fab/changes/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/fab/changes/archive/.gitkeep b/fab/changes/archive/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/fab/project/code-quality.md b/fab/project/code-quality.md new file mode 100644 index 0000000..5cedef5 --- /dev/null +++ b/fab/project/code-quality.md @@ -0,0 +1,28 @@ +# Code Quality + + + +## Principles + + + +- Readability and maintainability over cleverness +- Follow existing project patterns unless there's compelling reason to deviate +- Prefer composition over inheritance + +## Anti-Patterns + + + +- God functions (>50 lines without clear reason) +- Duplicating existing utilities instead of reusing them +- Magic strings or numbers without named constants + +## Test Strategy + + + +test-alongside diff --git a/fab/project/code-review.md b/fab/project/code-review.md new file mode 100644 index 0000000..451156e --- /dev/null +++ b/fab/project/code-review.md @@ -0,0 +1,52 @@ +# Code Review + + + +## Severity Definitions + + + +- **Must-fix**: Spec mismatches, failing tests, checklist violations — always addressed during rework +- **Should-fix**: Code quality issues, pattern inconsistencies — addressed when clear and low-effort +- **Nice-to-have**: Style suggestions, minor improvements — may be skipped + +## Review Scope + + + +- Changed files only (files touched during apply) +- Skip generated code and vendor directories +- Skip binary files and assets + +## False Positive Policy + + + +- Inline `` in markdown files +- Inline `// review-ignore: {reason}` or `# review-ignore: {reason}` in code files +- Suppressed findings are noted in the review report but not counted as failures + +## Rework Budget + + + +- Max cycles: 3 +- After 2 consecutive "fix code" attempts on the same issue, escalate to "revise tasks" or "revise spec" + +## Project-Specific Review Rules + + diff --git a/fab/project/config.yaml b/fab/project/config.yaml new file mode 100644 index 0000000..33c4830 --- /dev/null +++ b/fab/project/config.yaml @@ -0,0 +1 @@ +fab_version: 1.3.1 diff --git a/fab/project/constitution.md b/fab/project/constitution.md new file mode 100644 index 0000000..f7dd941 --- /dev/null +++ b/fab/project/constitution.md @@ -0,0 +1,18 @@ +# {Project Name} Constitution + +## Core Principles + +### I. {Principle Name} +{Description using MUST/SHALL/SHOULD keywords. Include rationale.} + + + +## Additional Constraints + + +### Test Integrity +Tests MUST conform to the implementation spec — never the other way around. When tests fail, the fix SHALL either (a) update the tests to match the spec, or (b) update the implementation to match the spec. Modifying implementation code solely to accommodate test fixtures or test infrastructure is prohibited. Specs are the source of truth; tests verify conformance to specs. + +## Governance + +**Version**: 1.0.0 | **Ratified**: {DATE} | **Last Amended**: {DATE} diff --git a/fab/project/context.md b/fab/project/context.md new file mode 100644 index 0000000..b510930 --- /dev/null +++ b/fab/project/context.md @@ -0,0 +1,18 @@ +# Project Context + + + +{TECH_STACK_AND_CONVENTIONS} diff --git a/fab/sync/README.md b/fab/sync/README.md new file mode 100644 index 0000000..b83ef82 --- /dev/null +++ b/fab/sync/README.md @@ -0,0 +1,9 @@ +# Project-Specific Sync Scripts + +Scripts in this directory run during `fab sync` after the kit-level sync operations. + +## Naming Convention + +- Use numbered `*.sh` files: `1-first.sh`, `2-second.sh`, etc. +- Scripts execute in sorted order. +- Each script should be idempotent (safe to re-run).