# powerpratik/ste-mode architecture

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

- Interactive diagram: https://gitdiagram.com/powerpratik/ste-mode
- Repository: https://github.com/powerpratik/ste-mode

## Overview

ste-mode is a Claude Code writing-style plugin. Its main workflow is: a new session runs the SessionStart hook, which checks the opt-out file and adds the STE rules when the file is absent. The `/ste` command changes that file and can apply the rules immediately. The README documents these behaviors; no source excerpts were provided, so implementation details and the registration-to-handler link are not inferred.

Main entry points: [`hooks-handlers/session-start.sh`](https://github.com/powerpratik/ste-mode/blob/main/hooks-handlers/session-start.sh) (SessionStart hook), [`commands/ste.md`](https://github.com/powerpratik/ste-mode/blob/main/commands/ste.md) (STE command), [`rules/ste.md`](https://github.com/powerpratik/ste-mode/blob/main/rules/ste.md) (STE rules), [`hooks/hooks.json`](https://github.com/powerpratik/ste-mode/blob/main/hooks/hooks.json) (Hook registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_activation["Session activation"]
  node_hook["SessionStart hook<br/>[session-start.sh]"]
  node_registration["Hook registration<br/>[hooks.json]"]
end

subgraph group_controls["Mode controls"]
  node_command["STE command<br/>[ste.md]"]
  node_state[("Opt-out file")]
end

subgraph group_style["Writing rules"]
  node_rules["STE rules<br/>[ste.md]"]
end

node_claude(("Claude Code session"))

node_claude -->|"starts session"| node_hook
node_hook -->|"checks state"| node_state
node_hook -->|"adds rules"| node_rules
node_command -->|"creates or removes"| node_state
node_command -->|"applies now"| node_rules
node_registration -.->|"registers"| node_hook

click node_hook "https://github.com/powerpratik/ste-mode/blob/main/hooks-handlers/session-start.sh"
click node_registration "https://github.com/powerpratik/ste-mode/blob/main/hooks/hooks.json"
click node_command "https://github.com/powerpratik/ste-mode/blob/main/commands/ste.md"
click node_rules "https://github.com/powerpratik/ste-mode/blob/main/rules/ste.md"

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_hook,node_registration toneBlue
class node_command,node_state toneAmber
class node_rules toneMint
class node_claude toneIndigo
```

## Components

### Session activation

- [SessionStart hook](https://github.com/powerpratik/ste-mode/blob/main/hooks-handlers/session-start.sh): `hooks-handlers/session-start.sh`
- [Hook registration](https://github.com/powerpratik/ste-mode/blob/main/hooks/hooks.json): `hooks/hooks.json`

### Mode controls

- [STE command](https://github.com/powerpratik/ste-mode/blob/main/commands/ste.md): `commands/ste.md`
- **Opt-out file**

### Writing rules

- [STE rules](https://github.com/powerpratik/ste-mode/blob/main/rules/ste.md): `rules/ste.md`

### Other components

- **Claude Code session**

## Connections

- Claude Code session → SessionStart hook: starts session (evidence: `README.md`)
- SessionStart hook → Opt-out file: checks state (evidence: `README.md`)
- SessionStart hook → STE rules: adds rules (evidence: `README.md`)
- STE command → Opt-out file: creates or removes (evidence: `README.md`)
- STE command → STE rules: applies now (evidence: `README.md`)
- Hook registration → SessionStart hook: registers
