This repository is a small, file-backed markdown knowledge base web app. Optimize for: simplicity, hackability, minimal dependencies, and long-term maintainability.
- README.md
- docs/Resources/INVARIANTS.md
- docs/Resources/ARCHITECTURE.md
- docs/Resources/STYLE.md
- docs/Resources/Adrs/*
- docs/Projects/TODO.md (current task only)
-
NO FEATURE CREEP
- Implement only the explicitly requested task from
docs/Projects/TODO.md. docs/Resources/*defines constraints, not a feature backlog.
- Implement only the explicitly requested task from
-
KEEP INVARIANTS TRUE
- Do not violate docs/Resources/INVARIANTS.md.
- If you believe an invariant must change, propose an ADR instead of changing code.
-
DECISIONS REQUIRE ADRs
- If a change affects architecture, security model, data model, or introduces a significant dependency,
create/update an ADR in
docs/Resources/Adrs/.
- If a change affects architecture, security model, data model, or introduces a significant dependency,
create/update an ADR in
-
FILES ARE THE SOURCE OF TRUTH
- No database, no background jobs unless explicitly approved via ADR.
-
DOCUMENT ID = RELATIVE PATH
- The canonical identifier is the normalized relative path from root.
- No UUIDs/slugs/hashes as primary identifiers.
-
DEPENDENCY DISCIPLINE
- Avoid adding dependencies. If needed, justify why (and why stdlib isn’t enough).
-
SECURITY IS NOT OPTIONAL
- Prevent path traversal.
- Never read/write outside configured root.
- Be explicit about symlink policy (per invariants).
-
Projects:
- Active tasks live in
docs/Projects/. - Completed work should be checked off or moved to Archive if it’s no longer relevant.
- Active tasks live in
-
Resources:
- Stable knowledge and constraints live in
docs/Resources/. - Changes here should be rare and deliberate.
- Stable knowledge and constraints live in
-
Archive:
- Historical documents only.
- Never treat Archive as current requirements.
Use when discussing the system more open-ended.
- Provide helpful responses.
Use when the task is exploratory/architectural or too large for a single PR.
- Default output is a single document:
docs/Projects/<project>.md - Do not modify code unless explicitly requested (design mode is typically docs-only)
- Consider max 2–3 options, recommend one
- End with a task breakdown of small PR-sized items, each with acceptance criteria
- If the design changes architecture/security/data model or adds a significant dependency:
- draft/update an ADR in
docs/Resources/Adrs/ - call out the invariant changes explicitly
- draft/update an ADR in
- Smallest change that satisfies acceptance criteria.
- Avoid refactors unless required to implement the feature safely.
- Instead, propose appropriate refactors as follow-ups to maintain a high bar for code quality while keeping implementation changes focused and minimal.
- Make sure the code is easy to test and add relevant tests to ensure the feature works correctly.
- Must include:
- clear motivation (what pain/risk it reduces)
- a safety net (tests/snapshots/golden files)
- a bounded scope (what is NOT being refactored)
- Assume the code already compiles, passes all tests and clippy passes.
- Focus first on correctness.
- Is there any logic error?
- Does the change satisfy the acceptance criteria?
- Do we introduce any new potential bugs?
- Are there tests covering any new or changed logic?
- Is the documentation in sync with the current changes?
- If the code is correct, proceed with reviewing readability.
- Are functions lean and focused so that they can be easily tested?
- Are names accurate and convey their intention clearly?
- Is the code well-organized with the most significant functions and types defined first and any helpers declared after?
- Are all functions and types defined in appropriate places, or should they be moved to other (potentially new) modules for a cleaner separation of concerns?
- Can all functions be reasoned about locally or is there a high degree of context required to understand their correctness?
- First respond with a plan:
- approach, files to touch, non-goals, risks
- Wait for confirmation/feedback, adjust the plan accordingly.
- Implement exactly the plan.
- Run:
cargo fmtcargo clippy --all-targets --all-featurescargo nextest runnode --test 'assets/**/*.test.mjs'(only when changing browser JS modules)
- Update docs if behavior/usage changed (README/docs/*).
- Update docs/Projects/TODO.md: check off the item, add follow-ups if needed.
- If working on a sub-task in a project, check off the sub-task in the project document.
- Provide:
- Summary of changes
- Tests added/updated
- Risks/limitations
- No drive-by refactors.
- No new architecture without ADR.
- No adding “nice UX” unless requested.
- No “future-proofing” unless part of the task.