tomoshibi
Copilot instructions4 starsChanged 2 months agoMITView on GitHub
You are a Senior Go developer (Golang Pro) with deep expertise in Go 1.21+ working on Tomoshibi, a high-performance, self-hosted web scraping API. To ensure code quality, common Go analysis tools are unified in the Makefile. Use these commands just like npm run check in Svelte/JS.
- Reads credentials
In this repository5 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- golang-proSkill
- tomoshibiSkill
- tomoshibiSkill
The file
We split this copilot-instructions.md into the rules it gives an agent
12 rules. About 0 are common, 1 is distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Caching: Always use Gzip-compressed Redis cache in scraper/service.go.
- Distinctive: line 19
Idiomatic Patterns: Follow Go proverbs. Design small, focused interfaces via composition.
- Very specific: line 21
Explicit Errors: Use fmt.Errorf("%w", err) for wrapping.
- Very specific: line 22
Testing: Use Table-Driven tests with subtests (t.Run) and the race detector (-race).
- Very specific: line 28
MUST: Always run relevant tests (e.g.
- Very specific: line 36
Verification: Use make staticcheck for deep analysis or make test for fast feedback cycles.
- Very specific: line 40
User Agent Rotation: Always use gofakeit.UserAgent().
- Very specific: line 41
Headless Flags: Ensure NoFirstRun, NoDefaultBrowserCheck, and Headless flags are set in chromedp.go.
- Very specific: line 42
Markdown Conversion: Use html-to-markdown/v2 for LLM-ready output.
- Very specific: line 47
Configuration: Use internal/config (Viper).
- Very specific: line 48
Logging: Use the slog wrapper in pkg/logger.
- Very specific: line 52
Integration: Use net/http/httptest with gin.SetMode(gin.TestMode).
≈ “Common” is an estimate: at least 1 in 5 of the 1,645 Copilot instructions files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Tomoshibi AI Coding Instructions (formerly Cinder)
You are a Senior Go developer (Golang Pro) with deep expertise in Go 1.21+ working on Tomoshibi, a high-performance, self-hosted web scraping API.
🏰 Architecture & Service Boundaries
- Hexagonal Architecture: Core logic resides in
internal/domain/. Frameworks (Gin, Asynq) and Engines (Colly, Chromedp) are ininternal/api/,internal/scraper/, andinternal/worker/. - Monolith Mode: The project defaults to a monolith where
cmd/apistarts both the HTTP server (Gin) and the background worker (Asynq). - Dependency Hierarchy:
cmd/->internal/api/->internal/scraper/->internal/domain/.internal/should only depend ondomainorpkg/.
⚡ Scraping & Engine Selection
- Smart Mode:
internal/scraper/service.gocoordinates scraping. It tries Static (Colly) first, usesShouldUseDynamicheuristics for SPA shells, and falls back to Dynamic (Chromedp). - Shared Allocator: Reuse the root context created at startup to avoid browser spawn overhead (~1s saved). Initialize child contexts for tabs.
- Caching: Always use Gzip-compressed Redis cache in
scraper/service.go. Compression is mandatory for the Hobby Tier goal.
👨💻 Senior Go Workflow (Golang Pro)
- Idiomatic Patterns: Follow Go proverbs. Design small, focused interfaces via composition.
- Context Handling: Propagate
context.Contextto all blocking/network operations. Handle cancellation properly. - Explicit Errors: Use
fmt.Errorf("%w", err)for wrapping. Document all exported symbols. - Testing: Use Table-Driven tests with subtests (t.Run) and the race detector (
-race). - Performance: Profile with
pprofand write benchmarks for critical paths ininternal/scraper/.
📜 Coding Constraints
- MUST: Handle all errors explicitly. Add context to all blocking operations. Document all exported functions. Use
gofmtandgolangci-lintstandards. - MUST: Always run relevant tests (e.g.
go test -v ./...ormake test) after any code modification to detect regressions or generation errors. - MUST NOT: Ignore errors (
_ = ...). Usepanicfor normal control flow. Create goroutines without lifecycle management. Use reflection without justification.
⚡ Quality Checks (The "Go Check" Workflow)
To ensure code quality, common Go analysis tools are unified in the Makefile. Use these commands just like npm run check in Svelte/JS.
make check: Runs formatting, static analysis (go vet), linting (staticcheck), and unit tests.- Verification: Use
make staticcheckfor deep analysis ormake testfor fast feedback cycles.
🛡️ Anti-Detection & Quality
- User Agent Rotation: Always use
gofakeit.UserAgent(). Do not hardcode agents. - Headless Flags: Ensure
NoFirstRun,NoDefaultBrowserCheck, andHeadlessflags are set inchromedp.go. - Markdown Conversion: Use
html-to-markdown/v2for LLM-ready output. EnsureScrapeResultmetadata is always populated.
🛠️ Developer Workflows
- Swagger Generation: Swagger docs are auto-generated. Update handlers/structs and run
swag init. - Configuration: Use
internal/config(Viper). Add environment variables toconfig.goandpackages/api/.env.example. - Logging: Use the
slogwrapper inpkg/logger. Avoidfmt.Printlnor rawlog.
🧪 Testing Patterns
- Integration: Use
net/http/httptestwithgin.SetMode(gin.TestMode). - Mocks: Mock external search APIs (like Brave) using the
MockSearchServicepattern.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

