Prohlížeč zdrojového kódu
docs/specs/source-browser-claude.md
# Spec: Source Browser — Claude Workflow Files
- **Status:** active
- **Created:** 2026-03-05
- **Related code:** `config/initializers/source_browser.rb`, `app/services/source_browser.rb`
## Overview
The source browser exposes the project's Claude workflow files — living specs, slash-command definitions, and the `CLAUDE.md` project guide — so visitors can see not just the application code but also how the project is developed with AI assistance.
## Behaviour
- The source tree includes all files under `docs/specs/` and `.claude/commands/`, alongside the already-visible `CLAUDE.md` and `README.md`.
- Spec files and command definitions render with the standard Markdown view toggle (formatted/source).
- Navigating to any of these files works identically to any other whitelisted file.
- Sensitive files (credentials, database config, `.env`) remain inaccessible regardless of directory proximity.
## Implementation Notes
Two glob patterns added to `config/initializers/source_browser.rb`:
- `docs/**/*.md` — covers all living spec files under `docs/specs/`
- `.claude/**/*.md` — covers slash-command definitions under `.claude/commands/`
No changes to `SourceBrowser` service logic were needed — the whitelist expansion is the entire implementation. Markdown rendering and the formatted/source toggle work automatically because `language_for` already maps `.md` to `"markdown"`.
## Tests
- `spec/services/source_browser_spec.rb` — coverage for docs/specs and .claude/commands visibility
## See Also
- [Source Browser](source-browser.md) — the core browser this spec extends with additional whitelisted paths.
- [Source Browser — Markdown Links](source-browser-md-links.md) — links in the exposed spec files are rewritten to Source Browser URLs.
## Change Log
- 2026-03-05: Spec created, prospective workflow.