Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 89 additions & 1 deletion .claude/commands/own/init.md
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,95 @@ To install (takes 30 seconds each):
📖 Full setup guide: ownyourcode/guides/context7-setup.md
```

3. **If available:** Continue silently to Phase 1.
3. **If available:** Continue silently to Phase 0.5.

---

### Phase 0.5: HTML Theme Setup (v2.4.0+)

Set up the visual theme that all generated HTML files will use. This phase
runs ONCE per project (idempotent: detects existing `.theme/` and skips).

**Design note:** This phase deliberately does NOT check for or attempt to
install the `frontend-design` plugin. Runtime testing during PR 1 demonstrated
that programmatic plugin detection inside a slash-command flow is unreliable
(stale cache directories from previous uninstalls, agent assumptions, no
in-flow Skill invocation). Instead, this phase always seeds the bundled
fallback CSS — which the PR reviewer praised as production-quality — and
surfaces an optional upgrade path in the user-facing summary. Users who
want premium styling install the plugin themselves and run `/own:theme`
to regenerate.
Comment thread
DanielPodolsky marked this conversation as resolved.

#### Step 1: Detect existing theme

**Execute this bash command via the Bash tool. Decide based on the literal stdout:**

```bash
test -d ownyourcode/.theme && echo "exists" || echo "missing"
```

- Output is `exists` → Skip the entire Phase 0.5. Continue to Phase 1.
- Output is `missing` → Continue to Step 2.

#### Step 2: Create `.theme/` directory and seed files from the bundle

Execute these bash commands via the Bash tool:

```bash
mkdir -p ownyourcode/.theme/.history
cp ownyourcode/templates/html/theme-prompt.md.template ownyourcode/.theme/theme-prompt.md
cp ownyourcode/templates/html/theme-fallback.css ownyourcode/.theme/theme.css
```

(The HTML templates were copied into the user's project during install — see `scripts/project-install.sh` STEP 7.5. They live at `ownyourcode/templates/html/` relative to the project root.)

#### Step 3: Update manifest

Add this block to `.claude/ownyourcode-manifest.json`:

```json
{
"theme": {
"fallback_mode": true,
"last_updated": "[ISO timestamp]",
"prompt_source": "default"
}
}
```

- `fallback_mode` is `true` until the user regenerates `theme.css` via `/own:theme` with the `frontend-design` plugin installed.
- `prompt_source` is `"default"` for the bundled prompt; it becomes `"custom"` if the user supplies their own prompt through `/own:theme`.

#### Step 4: Inform the user with the optional upgrade hint

Show this message exactly:

```
🎨 Theme set up: ownyourcode/.theme/
├── theme-prompt.md (default Apple Documentation aesthetic)
└── theme.css (bundled fallback CSS — production-quality default)

All HTML files generated by /own:feature will reference this theme.

────────────────────────────────────────────────────────────────────
✨ Make it even better (optional, recommended for portfolio work)
────────────────────────────────────────────────────────────────────

OwnYourCode ships with a hand-authored fallback CSS that already looks
great. For *fully custom* styling generated from your theme prompt — with
Anthropic's official design framework — install the `frontend-design`
plugin yourself in a separate message:

/plugin install frontend-design@claude-plugins-official

Then run `/own:theme` to regenerate `theme.css` based on your prompt.
You can change the prompt and re-roll the design anytime.

Skip this for now if you're just trying things out — the bundled fallback
is ready to use.
```

Continue silently to Phase 1.

---

Expand Down
Loading