Skip to content

Commit 8558876

Browse files
authored
Merge pull request #4 from carmigno/copilot/fix-3
Create comprehensive GitHub Copilot instructions for oh-my-chill theme repository
2 parents f5486b6 + e880196 commit 8558876

2 files changed

Lines changed: 224 additions & 70 deletions

File tree

.github/copilot-instructions.md

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# oh-my-chill Theme Repository
2+
3+
oh-my-chill is a pastel-themed configuration for oh-my-posh, a cross-platform prompt theme engine for shells (bash, zsh, PowerShell, etc.).
4+
5+
**ALWAYS reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.**
6+
7+
## Working Effectively
8+
9+
### Bootstrap and Setup
10+
- Install oh-my-posh binary:
11+
- `curl -s -L -o /tmp/oh-my-posh https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64`
12+
- `chmod +x /tmp/oh-my-posh`
13+
- Download takes ~5 seconds, binary is ~19MB
14+
- Validate JSON configuration:
15+
- `python3 -m json.tool oh-my-chill.omp.json > /dev/null` -- takes <1 second
16+
- `jq '.' oh-my-chill.omp.json > /dev/null` -- alternative validation method
17+
18+
### Testing and Validation
19+
- Test theme rendering:
20+
- `/tmp/oh-my-posh print primary --config oh-my-chill.omp.json` -- takes <1 second
21+
- Should display: `╭─username@hostname─[/current/path]` and `╰─[git-branch-info]- ⚡`
22+
- Debug theme configuration:
23+
- `/tmp/oh-my-posh debug --config oh-my-chill.omp.json` -- takes <1 second
24+
- Shows all segments, timing, and cache information
25+
- Validate theme schema:
26+
- Theme uses official schema: `https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json`
27+
- All segments should load without errors
28+
29+
### Making Changes
30+
- ALWAYS validate JSON syntax after editing: `python3 -m json.tool oh-my-chill.omp.json > /dev/null`
31+
- ALWAYS test theme rendering after changes: `/tmp/oh-my-posh print primary --config oh-my-chill.omp.json`
32+
- ALWAYS run debug mode to verify segments work: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json`
33+
34+
## Validation Scenarios
35+
36+
**CRITICAL**: After making any changes to the theme configuration, ALWAYS run through these complete validation scenarios:
37+
38+
### Basic Theme Functionality
39+
1. Validate JSON: `python3 -m json.tool oh-my-chill.omp.json > /dev/null`
40+
2. Test primary prompt: `/tmp/oh-my-posh print primary --config oh-my-chill.omp.json`
41+
3. Verify segments load: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json | grep -E "Session|Path|Git|Status"`
42+
4. Check for errors: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json | grep -i error`
43+
44+
### Git Integration Testing
45+
1. Ensure you're in a git repository with changes: `git status`
46+
2. Test git segment rendering: `/tmp/oh-my-posh print primary --config oh-my-chill.omp.json`
47+
3. Verify git branch and status indicators appear in prompt output
48+
4. Check git segment debug info: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json | grep "Git("`
49+
50+
### Multi-Environment Testing
51+
1. Test in directory with package.json (Node.js detection)
52+
2. Test in directory with pyproject.toml or requirements.txt (Python detection)
53+
3. Verify language-specific segments activate correctly
54+
4. Check segment timing in debug output
55+
56+
## Repository Structure
57+
58+
### Key Files
59+
```
60+
.
61+
├── README.md # Basic theme description
62+
├── oh-my-chill.omp.json # Main theme configuration file
63+
└── .github/
64+
└── copilot-instructions.md # This file
65+
```
66+
67+
### Theme Configuration Details
68+
- **Schema**: Uses official oh-my-posh v1 schema
69+
- **Segments**: Session, Path, Git, Language detection (Node, Python, Java, etc.), Status
70+
- **Style**: Pastel colors with Unicode box-drawing characters
71+
- **Layout**: Two-line prompt with right-aligned language indicators
72+
73+
## Common Tasks
74+
75+
### Adding New Segments
76+
1. Reference official documentation: https://ohmyposh.dev/docs/segments
77+
2. Add segment to appropriate `blocks` array in `oh-my-chill.omp.json`
78+
3. Validate JSON syntax: `python3 -m json.tool oh-my-chill.omp.json > /dev/null`
79+
4. Test rendering: `/tmp/oh-my-posh print primary --config oh-my-chill.omp.json`
80+
5. Run debug mode to verify segment loads: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json`
81+
82+
### Color Customization
83+
1. Colors use hex format (`#ffffff`) or named colors (`red`, `blue`, etc.)
84+
2. Template colors use `<#color>text</>` format
85+
3. Always test color changes visually: `/tmp/oh-my-posh print primary --config oh-my-chill.omp.json`
86+
87+
### Performance Optimization
88+
1. Check segment timing: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json | grep " - .*ms"`
89+
2. Segments should typically take <5ms each
90+
3. Total run duration should be <50ms
91+
92+
## Timing and Expectations
93+
94+
- **JSON validation**: <1 second
95+
- **Theme rendering**: <1 second
96+
- **Debug mode**: <1 second
97+
- **oh-my-posh download**: ~5 seconds (19MB binary)
98+
- **Theme installation**: Immediate (copy file)
99+
100+
**NEVER CANCEL** these operations - they all complete in seconds, not minutes.
101+
102+
## Dependencies and Installation
103+
104+
### Required Tools
105+
- `python3` - for JSON validation (always available)
106+
- `jq` - alternative JSON validation tool (usually available)
107+
- `curl` - for downloading oh-my-posh binary (always available)
108+
- `git` - for testing git segment functionality (always available)
109+
110+
### oh-my-posh Installation
111+
- Download URL: `https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64`
112+
- Size: ~19MB
113+
- Installation: Download to `/tmp/oh-my-posh` and `chmod +x`
114+
- No system dependencies required
115+
116+
## Error Handling
117+
118+
### Common Issues
119+
1. **JSON syntax errors**: Use `python3 -m json.tool` to identify line numbers and exact error location
120+
2. **Segment not loading**: Check debug output for segment name and timing
121+
3. **Colors not showing**: Verify terminal supports ANSI colors
122+
4. **Git segment empty**: Ensure you're in a git repository with status
123+
5. **Cache errors**: ERROR messages about cache files are normal and can be ignored
124+
6. **wslpath errors**: ERROR about wslpath not found is normal on Linux and can be ignored
125+
126+
### Debugging Steps
127+
1. Always run debug mode first: `/tmp/oh-my-posh debug --config oh-my-chill.omp.json`
128+
2. Check for ERROR/TRACE messages in debug output
129+
3. Verify JSON syntax is valid
130+
4. Test in known working directory (git repo with changes)
131+
132+
## Frequently Used Commands
133+
134+
### Repository Root Structure
135+
```bash
136+
ls -la
137+
# Output:
138+
# drwxr-xr-x 3 runner docker 4096 .
139+
# drwxr-xr-x 3 runner docker 4096 ..
140+
# drwxr-xr-x 7 runner docker 4096 .git
141+
# -rw-r--r-- 1 runner docker 51 README.md
142+
# -rw-r--r-- 1 runner docker 5344 oh-my-chill.omp.json
143+
```
144+
145+
### Theme Configuration Content
146+
The theme includes segments for:
147+
- User session (username@hostname)
148+
- Current path with full directory structure
149+
- Git status with branch and change indicators
150+
- Language environment detection (Node.js, Python, Java, .NET, Go, Rust, etc.)
151+
- Command execution status
152+
153+
All segments use pastel color scheme with Unicode box-drawing characters for visual appeal.

oh-my-chill.omp.json

Lines changed: 71 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -2,166 +2,167 @@
22
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
33
"blocks": [
44
{
5+
"type": "prompt",
56
"alignment": "left",
67
"segments": [
78
{
8-
"style": "plain",
99
"template": "\u256d\u2500<#ffdd86>{{ .UserName }}@{{ .HostName }}</>\u2500",
10-
"type": "session"
10+
"type": "session",
11+
"style": "plain"
1112
},
1213
{
13-
"foreground": "#42a9ff",
14-
"style": "plain",
1514
"properties": {
1615
"style": "full"
1716
},
1817
"template": "<#42a9ff>[{{ .Path }}]</>",
19-
"type": "path"
18+
"foreground": "#42a9ff",
19+
"type": "path",
20+
"style": "plain"
2021
},
2122
{
22-
"foreground": "#FF9248",
23-
"style": "plain",
2423
"template": "<#FF9248>\u2500(</>#<#ffffff>)</>",
25-
"type": "root"
24+
"foreground": "#FF9248",
25+
"type": "root",
26+
"style": "plain"
2627
}
27-
],
28-
"type": "prompt"
28+
]
2929
},
3030
{
31+
"type": "prompt",
3132
"alignment": "right",
3233
"segments": [
3334
{
34-
"foreground": "#3C873A",
3535
"properties": {
3636
"fetch_package_manager": true,
3737
"npm_icon": " <#cc3a3a>\ue5fa</> ",
3838
"yarn_icon": " <#348cba>\ue6a7</>"
3939
},
40-
"style": "plain",
4140
"template": "<#ffffff>(</>{{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }}<#ffffff>)</>",
42-
"type": "node"
41+
"foreground": "#3C873A",
42+
"type": "node",
43+
"style": "plain"
4344
},
4445
{
45-
"foreground": "#ffdd86",
46-
"style": "plain",
4746
"template": "{{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}",
48-
"type": "python"
47+
"foreground": "#ffdd86",
48+
"type": "python",
49+
"style": "plain"
4950
},
5051
{
51-
"foreground": "#ec2729",
52-
"style": "plain",
5352
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
54-
"type": "java"
53+
"foreground": "#ec2729",
54+
"type": "java",
55+
"style": "plain"
5556
},
5657
{
57-
"foreground": "#0d6da8",
58-
"style": "plain",
5958
"template": "<#ffffff>(</>{{ if .Unsupported }}\uf071{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
60-
"type": "dotnet"
59+
"foreground": "#0d6da8",
60+
"type": "dotnet",
61+
"style": "plain"
6162
},
6263
{
63-
"foreground": "#06aad5",
64-
"style": "plain",
6564
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
66-
"type": "go"
65+
"foreground": "#06aad5",
66+
"type": "go",
67+
"style": "plain"
6768
},
6869
{
69-
"foreground": "#925837",
70-
"style": "plain",
7170
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
72-
"type": "rust"
71+
"foreground": "#925837",
72+
"type": "rust",
73+
"style": "plain"
7374
},
7475
{
75-
"foreground": "#055b9c",
76-
"style": "plain",
7776
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
78-
"type": "dart"
77+
"foreground": "#055b9c",
78+
"type": "dart",
79+
"style": "plain"
7980
},
8081
{
81-
"foreground": "#ce092f",
82-
"style": "plain",
8382
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
84-
"type": "angular"
83+
"foreground": "#ce092f",
84+
"type": "angular",
85+
"style": "plain"
8586
},
8687
{
87-
"foreground": "#de1f84",
88-
"style": "plain",
8988
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
90-
"type": "aurelia"
89+
"foreground": "#de1f84",
90+
"type": "aurelia",
91+
"style": "plain"
9192
},
9293
{
93-
"foreground": "#ffffff",
94-
"style": "plain",
9594
"template": "<#1e293b>(</>{{ if .Error }}{{ .Error }}{{ else }}Nx {{ .Full }}{{ end }}<#1e293b>)</>",
96-
"type": "nx"
95+
"foreground": "#ffffff",
96+
"type": "nx",
97+
"style": "plain"
9798
},
9899
{
99-
"foreground": "#359a25",
100-
"style": "plain",
101100
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
102-
"type": "julia"
101+
"foreground": "#359a25",
102+
"type": "julia",
103+
"style": "plain"
103104
},
104105
{
105-
"foreground": "#9c1006",
106-
"style": "plain",
107106
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
108-
"type": "ruby"
107+
"foreground": "#9c1006",
108+
"type": "ruby",
109+
"style": "plain"
109110
},
110111
{
111-
"foreground": "#5398c2",
112-
"style": "plain",
113112
"template": "<#ffffff>(</>{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }}<#ffffff>)</>",
114-
"type": "azfunc"
113+
"foreground": "#5398c2",
114+
"type": "azfunc",
115+
"style": "plain"
115116
},
116117
{
117-
"foreground": "#faa029",
118-
"style": "plain",
119118
"template": "<#ffffff>(</>{{.Profile}}{{if .Region}}@{{.Region}}{{end}}<#ffffff>)</>",
120-
"type": "aws"
119+
"foreground": "#faa029",
120+
"type": "aws",
121+
"style": "plain"
121122
},
122123
{
123-
"foreground": "#316ce4",
124-
"style": "plain",
125124
"template": "<#ffffff>(</>{{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}}<#ffffff>)</>",
126-
"type": "kubectl"
125+
"foreground": "#316ce4",
126+
"type": "kubectl",
127+
"style": "plain"
127128
}
128-
],
129-
"type": "prompt"
129+
]
130130
},
131131
{
132+
"type": "prompt",
132133
"alignment": "left",
133-
"newline": true,
134134
"segments": [
135135
{
136-
"style": "plain",
137136
"template": "\u2570\u2500",
138-
"type": "text"
137+
"type": "text",
138+
"style": "plain"
139139
},
140140
{
141-
"foreground": "#e0f8ff",
142141
"properties": {
143142
"branch_icon": "\ue725 ",
144143
"fetch_status": true,
145144
"fetch_upstream_icon": true
146145
},
147-
"style": "plain",
148146
"template": "<#ffffff>[</>{{ .HEAD }}{{ if .Staging.Changed }}<#00AA00> \u25cf {{ .Staging.String }}</>{{ end }}{{ if .Working.Changed }}<#D75F00> \u25cf {{ .Working.String }}</>{{ end }}<#ffffff>]-</>",
149-
"type": "git"
147+
"foreground": "#e0f8ff",
148+
"type": "git",
149+
"style": "plain"
150150
},
151151
{
152-
"foreground": "#ecf7fa",
153-
"foreground_templates": ["{{ if gt .Code 0 }}#ef5350{{ end }}"],
154152
"properties": {
155153
"always_enabled": true
156154
},
157-
"style": "plain",
158155
"template": "\ue285 ",
159-
"type": "status"
156+
"foreground": "#ecf7fa",
157+
"type": "status",
158+
"style": "plain",
159+
"foreground_templates": [
160+
"{{ if gt .Code 0 }}#ef5350{{ end }}"
161+
]
160162
}
161163
],
162-
"type": "prompt"
164+
"newline": true
163165
}
164166
],
165-
"version": 1
167+
"version": 3
166168
}
167-

0 commit comments

Comments
 (0)