Skip to content

Instantly share code, notes, and snippets.

@ali-aka-ahmed
Created November 10, 2025 22:42
Show Gist options
  • Select an option

  • Save ali-aka-ahmed/81383a284b02b53d29765371c4b68110 to your computer and use it in GitHub Desktop.

Select an option

Save ali-aka-ahmed/81383a284b02b53d29765371c4b68110 to your computer and use it in GitHub Desktop.
WORKFLOW.md

WORKFLOW - READ BEFORE EVERY CODE CHANGE

πŸ›‘ STOP: Before Modifying ANY Code

Two-tier documentation system - Read BOTH types:

  1. Read folder-level docs (detailed architecture)
  2. Read function-level docs (concise: 1-3 sentences)

Examples:

  • Modifying internal/api/router.go?

    1. Read docs/internal/api-docs.md (folder-level: detailed)
    2. Read docs/internal/api/router.md (function-level: concise)
  • Adding internal/api/handlers/user.go?

    1. Read docs/internal/api-docs.md + docs/internal/api/handlers-docs.md (folder-level)
    2. Read existing handler docs in docs/internal/api/handlers/ (function-level)

πŸ›‘ STOP: After Writing ANY Code

Run this ONE command (all must pass):

go build ./... && go test ./... && go test -race ./... && golangci-lint run ./...

If ANY command fails: FIX BEFORE PROCEEDING. NO EXCEPTIONS.

πŸ›‘ STOP: Before Committing

  1. All commands above passed? βœ…
  2. Updated function-level docs in docs/**/*.md? (concise: 1-3 sentences) βœ…
  3. Updated folder-level docs if architecture changed? (detailed) βœ…
  4. All code files under 250 lines? βœ…

Quick Reference

Two-Tier Documentation:

Folder-Level (Detailed):

  • docs/internal/api-docs.md β†’ Architecture for internal/api/
  • docs/internal/api/handlers-docs.md β†’ Architecture for internal/api/handlers/

Function-Level (Concise: 1-3 sentences):

  • cmd/api/main.go β†’ docs/cmd/api/main.md
  • internal/api/router.go β†’ docs/internal/api/router.md
  • internal/api/handlers/health.go β†’ docs/internal/api/handlers/health.md

250 Line Limit:

  • If file exceeds 250 lines, split immediately
  • Update both doc types to reflect new structure

No Exceptions. No Shortcuts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment