# awaisshakir/skills-secure-code-game architecture

> Architecture diagram of the GitHub repository awaisshakir/skills-secure-code-game, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/awaisshakir/skills-secure-code-game
- Repository: https://github.com/awaisshakir/skills-secure-code-game

## Overview

#### Purpose and Operating Model
Secure Code Game is a GitHub Security Lab, repository-native security training course. Learners clone/template the repository, work through independent levels containing intentionally vulnerable code, implement a fix, and validate it with level-specific checks. It is not a unified application or service; each level is an isolated exercise.

Paths: `README.md`, `Season-1/README.md`, `Season-2/README.md`, `Season-3/README.md`.

#### Primary Entry Points
The root README directs learners to select a season and read its season README. Each level’s editable `code.*` file is the principal learner entry point; `solution.*` is the reference implementation, while `hack.*` supplies attack/exploit scenarios or adversarial inputs.

Paths: `Season-1/Level-1/code.py`, `Season-2/Level-2/code.go`, `Season-3/Level-1/code.spec.js`.

#### Season 1: Multi-language Secure-Code Exercises
Season 1 consists of five mostly Python exercises plus a C exercise. A level typically couples vulnerable source, exploit code, hints, a solution, and executable tests. One exercise includes a PDF asset; the course documentation also identifies SQLite usage in Level 4.

Paths: `Season-1/Level-2/code.h`, `Season-1/Level-3/assets/tax_form.pdf`, `Season-1/Level-4/code.py`.

#### Season 2: Platform and Application Security Exercises
Season 2 broadens the runtime and attack surface across GitHub Actions YAML, Go, Node.js, Python/templates, and browser JavaScript. Level-local dependencies and modules make exercises self-contained rather than shared through a root application package.

Paths: `Season-2/Level-1/code.yml`, `Season-2/Level-2/go.mod`, `Season-2/Level-3/package.json`, `Season-2/Level-4/templates/index.html`, `Season-2/Level-5/index.html`.

#### Season 3: AI-focused Specification Challenges
Season 3 uses Node/Vitest as a common runner. Each level is represented primarily by a JavaScript specification (`code.spec.js`), a textual target solution, and hints. Shared utility code provides common checking/support behavior, forming the only clear shared implementation layer among these levels.

Paths: `Season-3/package.json`, `Season-3/vitest.config.js`, `Season-3/.utils/check.js`, `Season-3/Level-6/code.spec.js`.

#### Validation and Control Flow
Per-level flow is: inspect vulnerable code/specification → apply a security fix → run the matching test/spec runner or adversarial hack → compare against expected secure behavior. Tests and hacks are deliberately boundary artifacts: they exercise learner code but are not production runtime components. Reference solutions preserve intended completion criteria.

Paths: `Season-1/Level-5/tests.py`, `Season-2/Level-3/tests.js`, `Season-2/Level-2/hack_test.go`, `Season-3/Level-2/solution.txt`.

#### Runtimes, Infrastructure, and External Dependencies
Execution requires Python, C tooling, Go, Node.js/npm, and YAML support according to level. Python dependencies are centrally declared; Node dependencies are scoped to applicable season/levels; Go Level 2 has its own modules. GitHub Codespaces/devcontainers provide a ready-to-run environment. GitHub Actions automate repository checks and CodeQL security analysis; GitHub Discussions and Slack are support channels.

Paths: `requirements.txt`, `.devcontainer/devcontainer.json`, `.github/workflows/codeql-analysis.yml`, `.github/workflows/jarvis-code.yml`.

Main entry points: [`Season-2/README.md`](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/README.md) (Season 2 guide), [`Season-3/vitest.config.js`](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/vitest.config.js) (Vitest runner), [`Season-1/Level-1/code.py`](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-1/code.py) (Editable vulnerable code), [`Season-1/Level-5/tests.py`](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-5/tests.py) (Level tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guidance["Course navigation"]
  node_root_readme["Root course guide<br/>documentation<br/>[README.md]"]
end

subgraph group_s1["Season 1"]
  node_s1_readme["Season 1 guide<br/>season guide<br/>[README.md]"]
  node_s1_learner_code["Editable vulnerable code<br/>learner exercise<br/>[code.py]"]
  node_s1_c_exercise["C exercise<br/>learner exercise<br/>[code.h]"]
  node_s1_sqlite_exercise["SQLite exercise<br/>learner exercise<br/>[code.py]"]
  node_s1_asset["Level asset<br/>exercise input<br/>[tax_form.pdf]"]
  node_s1_tests["Level tests<br/>validation<br/>[tests.py]"]
end

subgraph group_s2["Season 2"]
  node_s2_readme["Season 2 guide<br/>season guide<br/>[README.md]"]
  node_s2_actions_exercise["Actions YAML exercise<br/>learner exercise<br/>[code.yml]"]
  node_s2_go_exercise["Go module exercise<br/>learner exercise<br/>[go.mod]"]
  node_s2_node_exercise["Node exercise<br/>learner exercise<br/>[package.json]"]
  node_s2_template_exercise["Template exercise<br/>learner exercise<br/>[index.html]"]
  node_s2_browser_exercise["Browser exercise<br/>learner exercise<br/>[index.html]"]
end

subgraph group_s3["Season 3"]
  node_s3_readme["Season 3 guide<br/>season guide<br/>[README.md]"]
  node_s3_specs["Level specifications<br/>learner specification<br/>[code.spec.js]"]
  node_s3_later_spec["Later level spec<br/>learner specification<br/>[code.spec.js]"]
  node_s3_solution["Text target solution<br/>reference solution<br/>[solution.txt]"]
  node_s3_runner["Vitest runner<br/>[vitest.config.js]"]
  node_s3_utils["Shared check utility<br/>shared support<br/>[check.js]"]
end

subgraph group_automation["Execution and automation"]
  node_runtime_deps["Runtime dependencies<br/>environment dependencies<br/>[requirements.txt]"]
  node_devcontainer["Codespaces environment<br/>dev environment<br/>[devcontainer.json]"]
  node_github_automation["GitHub checks and CodeQL<br/>CI security automation"]
end

node_root_readme -->|"choose season"| node_s1_readme
node_root_readme -->|"choose season"| node_s2_readme
node_root_readme -->|"choose season"| node_s3_readme
node_s1_readme -->|"introduces levels"| node_s1_learner_code
node_s1_learner_code -->|"validate fix"| node_s1_tests
node_s1_c_exercise -.->|"level checks"| node_s1_tests
node_s1_sqlite_exercise -.->|"level checks"| node_s1_tests
node_s1_asset -.->|"exercise input"| node_s1_learner_code
node_s2_readme -->|"introduces levels"| node_s2_actions_exercise
node_s2_readme -->|"introduces levels"| node_s2_go_exercise
node_s2_readme -->|"introduces levels"| node_s2_node_exercise
node_s2_readme -->|"introduces levels"| node_s2_template_exercise
node_s2_readme -->|"introduces levels"| node_s2_browser_exercise
node_s3_readme -->|"introduces levels"| node_s3_specs
node_s3_readme -->|"introduces levels"| node_s3_later_spec
node_s3_specs -->|"run specs"| node_s3_runner
node_s3_later_spec -->|"run specs"| node_s3_runner
node_s3_runner -->|"uses shared checks"| node_s3_utils
node_s3_solution -.->|"expected behavior"| node_s3_specs
node_runtime_deps -.->|"Python runtime"| node_s1_learner_code
node_devcontainer -->|"provisions tooling"| node_runtime_deps
node_devcontainer -.->|"provisions Node"| node_s3_runner
node_github_automation -.->|"automates checks"| node_s1_tests
node_github_automation -.->|"automates checks"| node_s3_runner

click node_root_readme "https://github.com/awaisshakir/skills-secure-code-game/blob/main/README.md"
click node_s1_readme "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/README.md"
click node_s2_readme "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/README.md"
click node_s3_readme "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/README.md"
click node_s1_learner_code "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-1/code.py"
click node_s1_c_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-2/code.h"
click node_s1_sqlite_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-4/code.py"
click node_s1_asset "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-3/assets/tax_form.pdf"
click node_s1_tests "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-5/tests.py"
click node_s2_actions_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-1/code.yml"
click node_s2_go_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-2/go.mod"
click node_s2_node_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-3/package.json"
click node_s2_template_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-4/templates/index.html"
click node_s2_browser_exercise "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-5/index.html"
click node_s3_specs "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/Level-1/code.spec.js"
click node_s3_later_spec "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/Level-6/code.spec.js"
click node_s3_solution "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/Level-2/solution.txt"
click node_s3_runner "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/vitest.config.js"
click node_s3_utils "https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/.utils/check.js"
click node_runtime_deps "https://github.com/awaisshakir/skills-secure-code-game/blob/main/requirements.txt"
click node_devcontainer "https://github.com/awaisshakir/skills-secure-code-game/blob/main/.devcontainer/devcontainer.json"
click node_github_automation "https://github.com/awaisshakir/skills-secure-code-game/blob/main/.github/workflows/codeql-analysis.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_root_readme toneBlue
class node_s1_readme,node_s1_learner_code,node_s1_c_exercise,node_s1_sqlite_exercise,node_s1_asset,node_s1_tests toneAmber
class node_s2_readme,node_s2_actions_exercise,node_s2_go_exercise,node_s2_node_exercise,node_s2_template_exercise,node_s2_browser_exercise toneMint
class node_s3_readme,node_s3_specs,node_s3_later_spec,node_s3_solution,node_s3_runner,node_s3_utils toneRose
class node_runtime_deps,node_devcontainer,node_github_automation toneIndigo
```

## Components

### Course navigation

- [Root course guide](https://github.com/awaisshakir/skills-secure-code-game/blob/main/README.md): documentation · Directs learners to a season. · `README.md`

### Season 1

Multi-language secure-code exercises.

- [Season 1 guide](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/README.md): season guide · `Season-1/README.md`
- [Editable vulnerable code](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-1/code.py): learner exercise · Representative Python level entry point. · `Season-1/Level-1/code.py`
- [C exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-2/code.h): learner exercise · `Season-1/Level-2/code.h`
- [SQLite exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-4/code.py): learner exercise · `Season-1/Level-4/code.py`
- [Level asset](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-3/assets/tax_form.pdf): exercise input · `Season-1/Level-3/assets/tax_form.pdf`
- [Level tests](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-1/Level-5/tests.py): validation · `Season-1/Level-5/tests.py`

### Season 2

Platform and application security exercises.

- [Season 2 guide](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/README.md): season guide · `Season-2/README.md`
- [Actions YAML exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-1/code.yml): learner exercise · `Season-2/Level-1/code.yml`
- [Go module exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-2/go.mod): learner exercise · Level-local Go dependencies and adversarial tests. · `Season-2/Level-2/go.mod`
- [Node exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-3/package.json): learner exercise · Level-local Node dependencies and tests. · `Season-2/Level-3/package.json`
- [Template exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-4/templates/index.html): learner exercise · `Season-2/Level-4/templates/index.html`
- [Browser exercise](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-2/Level-5/index.html): learner exercise · `Season-2/Level-5/index.html`

### Season 3

AI specification challenges.

- [Season 3 guide](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/README.md): season guide · `Season-3/README.md`
- [Level specifications](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/Level-1/code.spec.js): learner specification · Learners implement behavior specified by JavaScript tests. · `Season-3/Level-1/code.spec.js`
- [Later level spec](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/Level-6/code.spec.js): learner specification · `Season-3/Level-6/code.spec.js`
- [Text target solution](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/Level-2/solution.txt): reference solution · Preserves completion criteria. · `Season-3/Level-2/solution.txt`
- [Vitest runner](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/vitest.config.js): test runner · `Season-3/vitest.config.js`
- [Shared check utility](https://github.com/awaisshakir/skills-secure-code-game/blob/main/Season-3/.utils/check.js): shared support · Only clear shared implementation layer across Season 3 levels. · `Season-3/.utils/check.js`

### Execution and automation

- [Runtime dependencies](https://github.com/awaisshakir/skills-secure-code-game/blob/main/requirements.txt): environment dependencies · Python dependencies are centrally declared; other runtimes are level-scoped. · `requirements.txt`
- [Codespaces environment](https://github.com/awaisshakir/skills-secure-code-game/blob/main/.devcontainer/devcontainer.json): dev environment · `.devcontainer/devcontainer.json`
- [GitHub checks and CodeQL](https://github.com/awaisshakir/skills-secure-code-game/blob/main/.github/workflows/codeql-analysis.yml): CI security automation · `.github/workflows/codeql-analysis.yml`

## Connections

- Root course guide → Season 1 guide: choose season
- Root course guide → Season 2 guide: choose season
- Root course guide → Season 3 guide: choose season
- Season 1 guide → Editable vulnerable code: introduces levels
- Editable vulnerable code → Level tests: validate fix
- C exercise → Level tests: level checks
- SQLite exercise → Level tests: level checks
- Level asset → Editable vulnerable code: exercise input
- Season 2 guide → Actions YAML exercise: introduces levels
- Season 2 guide → Go module exercise: introduces levels
- Season 2 guide → Node exercise: introduces levels
- Season 2 guide → Template exercise: introduces levels
- Season 2 guide → Browser exercise: introduces levels
- Season 3 guide → Level specifications: introduces levels
- Season 3 guide → Later level spec: introduces levels
- Level specifications → Vitest runner: run specs
- Later level spec → Vitest runner: run specs
- Vitest runner → Shared check utility: uses shared checks
- Text target solution → Level specifications: expected behavior
- Runtime dependencies → Editable vulnerable code: Python runtime
- Codespaces environment → Runtime dependencies: provisions tooling
- Codespaces environment → Vitest runner: provisions Node
- GitHub checks and CodeQL → Level tests: automates checks
- GitHub checks and CodeQL → Vitest runner: automates checks
