Spaces:
Sleeping
Sleeping
File size: 6,080 Bytes
1878a50 c2771d8 1878a50 c2771d8 1878a50 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | # CLAUDE.md
## Session-start: ensure required plugins are installed
At the start of any new session in this repo, run `/plugin marketplace list`. If `claude-plugins-official` is not listed, install the four required plugins:
```
/plugin marketplace add anthropics/claude-plugins-official
/plugin install feature-dev@claude-plugins-official
/plugin install code-simplifier@claude-plugins-official
/plugin install claude-md-management@claude-plugins-official
/plugin install superpowers@claude-plugins-official
```
One-time per user per machine. `feature-dev` provides the `code-reviewer` subagent referenced by the reviewer procedure (and `code-architect` for plan review). Without `feature-dev` installed, every commit touching source code will be blocked by the commit-msg gate.
Subsequent sessions refresh plugins automatically.
## Reviewer procedure
Triggered by the Stop hook when the session modified substantive files and no fresh `.decode-reviewer-clean` marker exists. The Stop hook blocks session end and points the model back to this procedure. Steps, in order:
1. Run `git diff HEAD` via Bash.
2. Dispatch `feature-dev:code-reviewer` via the Agent tool. Pass the diff as context. Instruct: review only the changes, target latency under 90 seconds, report only blocking issues (confidence ≥ 80).
3. When the reviewer returns:
- **No blocking issues** → compute `HEAD_SHA=$(git rev-parse HEAD)` and `DIFF_HASH=$(bash scripts/reviewer-hash.sh)`, then Write `.decode-reviewer-clean` with exactly one line: `<HEAD-SHA> <DIFF-HASH> <ISO-8601-UTC-timestamp>`. The hash helper covers tracked-file diffs AND untracked file contents; do not substitute a plain `git diff | git hash-object` pipe — it misses untracked files and lets create-file → pass-review → silent-edit bypass the marker.
- **Blocking issues** → Write `.decode-reviewer-findings.md` with the list. Do NOT write `.decode-reviewer-clean`.
4. Return.
If the `feature-dev` plugin is not installed, stop and ask the user to run `/plugin install feature-dev@claude-plugins-official`.
The `commit-msg` git hook blocks commits unless the marker's HEAD and DIFF hashes both match the current repo state, or the commit message contains `[override-reviewer: <reason>]`. Binding to the diff content means any edit made after review invalidates the marker. Overrides are visible forever in `git log --grep="override-reviewer"`.
## DECODE base rules
This repo enforces DECODE's Claude Code standards. The full rule catalog lives at https://github.com/implicitdiagnosticsandsolutions/decode-claude-wiki/tree/main/docs/rules — rules are loaded by reference.
**The short version — what you must follow:**
1. **Reviewer subagent required before commit.** For any change that touches source code, generator scripts, or data outputs, dispatch the `feature-dev:code-reviewer` subagent before committing. The Stop hook blocks session end until this procedure is handled. Committing without a fresh `.decode-reviewer-clean` marker is blocked by `.githooks/commit-msg` unless the commit message contains `[override-reviewer: <reason>]`. Overrides are visible forever in `git log --grep="override-reviewer"`.
2. **Verify before claiming.** Before saying "X works", "it's documented", or "it's in memory", run a concrete check. Paste the output. "Should" is a red flag — replace it with a check.
3. **Patch the source, not the generated artifact.** If a file under `output/` or `dist/` was produced by a script, edit the script and regenerate. Never edit the artifact directly.
4. **Stage files explicitly.** Never `git add -A` or `git add .`. Name each file.
5. **No AI attribution in commits.** Conventional format, human author.
## Optional final cleanup
This template also ships a repo-local `deslop` skill under `.claude/skills/deslop/`.
Use it after a change already works and before commit when you want a final pass focused on:
- removing unnecessary wrappers or indirection
- preserving source-of-truth files and types
- catching debug leftovers and placeholder comments
- reducing AI slop without widening scope
`deslop` is advisory, not a hard gate.
## First-time setup in this repo
Setup runs automatically on Claude Code session start via the `ensure-setup.sh` SessionStart hook — it wires `.githooks` into git (`core.hooksPath`) so the commit-msg and pre-commit gates fire. Idempotent; no-ops once wired.
If you commit from a plain terminal in a fresh clone without ever opening a Claude Code session, the hooks will not fire until you run setup manually:
```bash
bash scripts/setup.sh
```
## Destructive operations
Destructive git operations (`push --force`, `reset --hard`, `clean -f`, `branch -D`, etc.) are blocked by the `block-dangerous-git.sh` PreToolUse hook. If you genuinely need one, ask the user to run it manually after explicit chat confirmation.
Writes to `.env*`, `credentials*`, `*.pem`, `*.key`, and other secret files are blocked by `block-env-writes.sh`.
---
<!-- Per-repo section below. Fill in repo-specific conventions. -->
## This repo
`icat_app` ist eine Streamlit-Webanwendung mit 8 Tools für Brand Asset Management bei DECODE. Sie läuft auf Hugging Face Spaces (Python 3.12, Streamlit 1.32.2).
**Lokal starten:**
```bash
pip install -r requirements.txt
streamlit run app.py
# öffnet http://localhost:8501
```
**Source-Layout:**
- `app.py` — Entry Point, konfiguriert die Seite und bindet alle Tabs ein
- `tab1.py` – `tab8.py` — je ein Tool (ein Tab = eine Datei)
- `helper.py` — geteilte Hilfsfunktionen
- `requirements.txt` — Python-Abhängigkeiten (Quelle der Wahrheit für Dependencies)
**Die 8 Tools:**
1. Extract Images from Excel
2. Name Assets by Brand
3. Canvas White to Transparent
4. Asset Overview (PDF)
5. Name Stims by Block
6. Re-run Matrix
7. Resize
8. Place on Canvas
**Repo-spezifische Regeln:**
- Jeder Tab hat seine eigene Datei (`tab1.py`–`tab8.py`) — neue Tools als neue Tab-Datei anlegen, nicht in `app.py` einbauen.
- Die App deployed automatisch auf Hugging Face Spaces bei Push auf `main`.
|