Skip to content

Modular refactor: split kraken.sh into lib/ with shellcheck-clean modules#1

Merged
WhiteMuush merged 9 commits into
mainfrom
refactor/modular-v1.1
May 26, 2026
Merged

Modular refactor: split kraken.sh into lib/ with shellcheck-clean modules#1
WhiteMuush merged 9 commits into
mainfrom
refactor/modular-v1.1

Conversation

@WhiteMuush

Copy link
Copy Markdown
Owner

Summary

  • Split monolithic kraken.sh into lib/ helpers and lib/modules/ tentacles (entry point now ~130 lines)
  • Drop unsafe set -e from the interactive menu (a single non-zero exit code from any wrapped tool was tearing down the loop)
  • Add ensure_command / ensure_repo / prompt_value / prompt_yesno helpers - new tools integrate in ~5 lines
  • Unified logger: log_step / log_info / log_warn / log_error / log_success
  • TTY-aware color palette: clean output when piped to tee or files
  • All globals prefixed KRAKEN_*
  • Fix shellcheck SC2155 / SC2207 patterns across the codebase

What is new

  • .github/workflows/ci.yml: shellcheck (warning) + bash -n on all *.sh + smoke test verifying 24 exposed functions
  • .github/ISSUE_TEMPLATE/: bug report and module request templates (YAML)
  • .github/PULL_REQUEST_TEMPLATE.md
  • CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md
  • docs/ARCHITECTURE.md: boot sequence, module contract, color model, session layout
  • docs/ADDING_A_MODULE.md: step-by-step recipe with Don't / Do table
  • LICENSE (MIT), .gitignore, .editorconfig

Project layout

kraken.sh                # thin entry point
lib/
  core.sh                # version, globals, TTY-aware colors
  logger.sh
  installer.sh
  ui.sh
  session.sh
  modules/
    recon.sh  scan.sh  web.sh  vuln.sh  report.sh
docs/
  ARCHITECTURE.md
  ADDING_A_MODULE.md

Test plan

  • bash -n passes on all 11 *.sh files
  • Smoke test: source chain + 24 expected functions present
  • ./kraken.sh --help and ./kraken.sh --version work
  • CI green on this PR

Notes

This branch rebuilds the repository from a clean git init. The pre-refactor history is merged in via the final Merge unrelated pre-refactor history commit, so the v1.0.0 history remains reachable from main after this PR lands.

@WhiteMuush WhiteMuush merged commit 59783db into main May 26, 2026
3 checks passed
@WhiteMuush WhiteMuush deleted the refactor/modular-v1.1 branch May 26, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant