Cline rules
.clinerules/project-rules.mdCline rules
Quality
96/100
Scores the file, not the repository.Length
866 words
23 headings · 4 code blocksRepository
0
— · pushed 31 days agoLast changed
3 days ago
First indexed 3 days ago.1# Humanlog Project Rules23## Shared Guidelines Reference45**This project follows the shared LLM assistant guidelines in [`llm-shared/`](../llm-shared/):**67- **[`llm-shared/project_tech_stack.md`](../llm-shared/project_tech_stack.md)**: Project management, validation, build/test/lint workflows, and universal conventions for all projects.8- **[`llm-shared/languages/go.md`](../llm-shared/languages/go.md)**: Go-specific best practices, library choices, and code formatting/testing standards.9- **[`llm-shared/utils/`](../llm-shared/utils/)**: Tools for code analysis and validation (e.g., `gofuncs`, `validate-docs`).10- **[`llm-shared/templates/`](../llm-shared/templates/)**: Example `.gitignore`, `Taskfile.yml`, and CI workflow templates.1112> **Always consult the above files for baseline rules. This file documents project-specific conventions and architectural notes for `humanlog`.**1314---1516## Project Management & Build Requirements1718### Task Completion Criteria1920- Task is not complete until `task build` succeeds, which includes:21 - Running tests (`task test`)22 - Linting the code (`task lint`)23 - Building the project (if applicable)24- Task is not complete until it has even basic unit tests, even if they are not comprehensive25 - No need to mock external dependencies, just test the logic of the code26- When working from a markdown checklist of tasks, check off the tasks as you complete them2728### Build System Requirements2930- Use `task build` over `go build` to ensure all tasks are run31- All build artifacts should be placed in the `build/` directory32- Build tasks must depend on test and lint tasks33- Reference `llm-shared/templates/Taskfile.yml` for comprehensive task structure3435### Project Validation3637- Use the `validate-docs` tool to check if projects follow standard structure conventions:38```bash39 go run llm-shared/utils/validate-docs/validate-docs.go40```4142---4344## Go-Specific Guidelines4546### Code Formatting & Quality4748- Always run `gofmt -w .` on Go code files after making changes49- Use `go fmt ./...` and `go vet ./...` for linting50- Functions that are easily unit-testable should have tests51- Don't go for 100% test coverage, test the critical parts of the code5253### Library Preferences5455- Prefer using standard library packages when possible56- Provide justification when adding new third-party dependencies57- Keep dependencies updated58- If SQLite is used, use "modernc.org/sqlite" as the library (no dependency on cgo)59- Logging in applications run from cron: "log/slog" (standard library)60- Logging in applications run from CLI: "fmt.Println" (standard library, use emojis for better UX)61- Configuration management: "github.com/spf13/viper"62- Command-line arguments: "github.com/alecthomas/kong" (only if the project requires complex CLI)6364### Function Analysis6566- When looking for functions, use the `gofuncs` tool to list all functions in a Go project:67```bash68 go run llm-shared/utils/gofuncs/gofuncs.go -dir /path/to/project69```7071---7273## Project-Specific Rules for `humanlog`7475### Overview & Architecture7677- This package provides a human-readable formatter for Go's `log/slog` output.78- Main components:79 - `Handler` (`handler.go`): Implements `slog.Handler` with custom formatting.80 - `Options` (`options.go`): Configures handler behavior.81 - `NewHandler` (`humanlog.go`): Entry point for handler creation.82- Example usage: `example/main.go`. Tests: `handler_test.go`.8384### Developer Workflows8586- **Build**: Use `task build` (or standard Go tools `go build`, `go install` if no Taskfile exists yet).87- **Test**: `go test ./...` (see `handler_test.go`).88- **Example**: `go run example/main.go` to see formatted log output.8990### Project-Specific Conventions9192- No global state; all config via `Options` or method params.93- `NewHandler` panics if given a nil writer (enforced contract).94- All exported types/functions must have doc comments.95- Formatting helpers are unexported and colocated with usage.96- Log messages are padded/truncated to a fixed width (see `messageWidth` in `handler.go`).97- Color output for log levels unless `DisableColor` is set.9899### Integration & Dependencies100101- Only standard library and `log/slog` are used (following the minimal dependency principle).102- Go module path: `github.com/lepinkainen/humanlog` (see `go.mod`).103- When doing HTTP requests, use a custom user agent that includes the project name and version, e.g. `humanlog/1.0.0`104105### Patterns & Examples106107- See `example/main.go` for idiomatic usage patterns.108- See `handler_test.go` for test structure and coverage.109110---111112## Development Workflow113114### Code Analysis115116- When analyzing large codebases that might exceed context limits, use the Gemini CLI:117```bash118 gemini -p "@src/main.go Explain this file's purpose and functionality"119 gemini -p "@src/ Summarise the architecture of this codebase"120 gemini -p "@src/ Is the project test coverage on par with industry standards?"121```122123### CI/CD Requirements124125- Projects should have a basic GitHub Actions setup that uses the build-ci task126- Use `llm-shared/templates/github/workflows/go-ci.yml` as a template127- CI should run tests and linting on push and pull requests128- Use `go test -tags=ci -cover -v ./...` for CI tests129- Allow skipping tests with `//go:build !ci`130131### Git Management132133- Keep `.gitignore` up to date with Go-specific ignores134- Use `llm-shared/templates/gitignore-go` as a reference135- Ensure build artifacts and temporary files are not committed136137---138139## Templates & References140141### Available Templates142143- **Taskfile**: `llm-shared/templates/Taskfile.yml` - Comprehensive task management144- **CI Workflow**: `llm-shared/templates/github/workflows/go-ci.yml` - GitHub Actions for Go145- **Gitignore**: `llm-shared/templates/gitignore-go` - Go-specific ignore patterns146- **Documentation**: `llm-shared/templates/README.md` and `llm-shared/templates/CHANGELOG.md`147148### Project Structure149150This project follows a simple Go library structure:151152```153humanlog/154├── go.mod # Go module definition155├── *.go # Main library files (handler.go, options.go, humanlog.go)156├── *_test.go # Test files157├── example/ # Usage examples158├── llm-shared/ # Shared development guidelines (submodule)159├── docs/ # Project documentation (if needed)160└── build/ # Build artifacts (when using Taskfile)161```162163---164165_If any section is unclear or missing important project-specific details, please provide feedback or point to additional documentation to improve these rules._166
Also in lepinkainen/humanlog
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| lepinkainen/humanlogGEMINI.md · 0 | GEMINI.md | buildteststylearch+2 | 79/100 | 3 days ago | |
| lepinkainen/humanlogCLAUDE.md · 0 | CLAUDE.md | buildtestlint-formatstyle+2 | 89/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| JCodesMore/ai-website-cloner-template.clinerules · 31k | Cline rules | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| BryaanF/LiantPortfolio.clinerules/project-guidelines.md · 0 | Cline rules | buildstylearchgit+2 | 96/100 | 3 days ago | |
| u9401066/zotero-keepervscode-extension/resources/repo-assets/pubmed-search-mcp/.clinerules/50-pubmed-project.md · 7 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| u9401066/zotero-keeper.clinerules/50-pubmed-project.md · 7 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| u9401066/pubmed-search-mcp.clinerules/50-pubmed-project.md · 23 | Cline rules | testlint-formatstylearch+1 | 94/100 | 3 days ago | |
| VaillerTeeter/HoshimiNest.clinerules/project-identity.md · 1 | Cline rules | setuparchtypesdo-not | 93/100 | yesterday | |
| blendsdk/codeops-mcp.clinerules/project.md · 0 | Cline rules | buildteststylearch+7 | 91/100 | 3 days ago | |
| u9401066/zotero-keeper.clinerules/60-pubmed-python.md · 7 | Cline rules | setuptestlint-formatstyle+2 | 86/100 | 3 days ago |
