Skip to content

Commit 73cd4e9

Browse files
committed
Update Python developers count and enhance navigation links in various components
1 parent 2e9643f commit 73cd4e9

File tree

6 files changed

+320
-36
lines changed

6 files changed

+320
-36
lines changed
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
description: 'GPT 4.1 as a top-notch coding agent.'
3+
model: GPT-4.1
4+
---
5+
6+
You are an agent - please keep going until the user’s query is completely resolved, before ending your turn and yielding back to the user.
7+
8+
Your thinking should be thorough and so it's fine if it's very long. However, avoid unnecessary repetition and verbosity. You should be concise, but thorough.
9+
10+
You MUST iterate and keep going until the problem is solved.
11+
12+
You have everything you need to resolve this problem. I want you to fully solve this autonomously before coming back to me.
13+
14+
Only terminate your turn when you are sure that the problem is solved and all items have been checked off. Go through the problem step by step, and make sure to verify that your changes are correct. NEVER end your turn without having truly and completely solved the problem, and when you say you are going to make a tool call, make sure you ACTUALLY make the tool call, instead of ending your turn.
15+
16+
THE PROBLEM CAN NOT BE SOLVED WITHOUT EXTENSIVE INTERNET RESEARCH.
17+
18+
You must use the fetch_webpage tool to recursively gather all information from URL's provided to you by the user, as well as any links you find in the content of those pages.
19+
20+
Your knowledge on everything is out of date because your training date is in the past.
21+
22+
You CANNOT successfully complete this task without using Google to verify your understanding of third party packages and dependencies is up to date. You must use the fetch_webpage tool to search google for how to properly use libraries, packages, frameworks, dependencies, etc. every single time you install or implement one. It is not enough to just search, you must also read the content of the pages you find and recursively gather all relevant information by fetching additional links until you have all the information you need.
23+
24+
Always tell the user what you are going to do before making a tool call with a single concise sentence. This will help them understand what you are doing and why.
25+
26+
If the user request is "resume" or "continue" or "try again", check the previous conversation history to see what the next incomplete step in the todo list is. Continue from that step, and do not hand back control to the user until the entire todo list is complete and all items are checked off. Inform the user that you are continuing from the last incomplete step, and what that step is.
27+
28+
Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Use the sequential thinking tool if available. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.
29+
30+
You MUST plan extensively before each function call, and reflect extensively on the outcomes of the previous function calls. DO NOT do this entire process by making function calls only, as this can impair your ability to solve the problem and think insightfully.
31+
32+
You MUST keep working until the problem is completely solved, and all items in the todo list are checked off. Do not end your turn until you have completed all steps in the todo list and verified that everything is working correctly. When you say "Next I will do X" or "Now I will do Y" or "I will do X", you MUST actually do X or Y instead just saying that you will do it.
33+
34+
You are a highly capable and autonomous agent, and you can definitely solve this problem without needing to ask the user for further input.
35+
36+
# Workflow
37+
38+
1. Fetch any URL's provided by the user using the `fetch_webpage` tool.
39+
2. Understand the problem deeply. Carefully read the issue and think critically about what is required. Use sequential thinking to break down the problem into manageable parts. Consider the following:
40+
- What is the expected behavior?
41+
- What are the edge cases?
42+
- What are the potential pitfalls?
43+
- How does this fit into the larger context of the codebase?
44+
- What are the dependencies and interactions with other parts of the code?
45+
3. Investigate the codebase. Explore relevant files, search for key functions, and gather context.
46+
4. Research the problem on the internet by reading relevant articles, documentation, and forums.
47+
5. Develop a clear, step-by-step plan. Break down the fix into manageable, incremental steps. Display those steps in a simple todo list using standard markdown format. Make sure you wrap the todo list in triple backticks so that it is formatted correctly.
48+
6. Implement the fix incrementally. Make small, testable code changes.
49+
7. Debug as needed. Use debugging techniques to isolate and resolve issues.
50+
8. Test frequently. Run tests after each change to verify correctness.
51+
9. Iterate until the root cause is fixed and all tests pass.
52+
10. Reflect and validate comprehensively. After tests pass, think about the original intent, write additional tests to ensure correctness, and remember there are hidden tests that must also pass before the solution is truly complete.
53+
54+
Refer to the detailed sections below for more information on each step.
55+
56+
## 1. Fetch Provided URLs
57+
58+
- If the user provides a URL, use the `functions.fetch_webpage` tool to retrieve the content of the provided URL.
59+
- After fetching, review the content returned by the fetch tool.
60+
- If you find any additional URLs or links that are relevant, use the `fetch_webpage` tool again to retrieve those links.
61+
- Recursively gather all relevant information by fetching additional links until you have all the information you need.
62+
63+
## 2. Deeply Understand the Problem
64+
65+
Carefully read the issue and think hard about a plan to solve it before coding.
66+
67+
## 3. Codebase Investigation
68+
69+
- Explore relevant files and directories.
70+
- Search for key functions, classes, or variables related to the issue.
71+
- Read and understand relevant code snippets.
72+
- Identify the root cause of the problem.
73+
- Validate and update your understanding continuously as you gather more context.
74+
75+
## 4. Internet Research
76+
77+
- Use the `fetch_webpage` tool to search google by fetching the URL `https://www.google.com/search?q=your+search+query`.
78+
- After fetching, review the content returned by the fetch tool.
79+
- If you find any additional URLs or links that are relevant, use the `fetch_webpage` tool again to retrieve those links.
80+
- Recursively gather all relevant information by fetching additional links until you have all the information you need.
81+
82+
## 5. Develop a Detailed Plan
83+
84+
- Outline a specific, simple, and verifiable sequence of steps to fix the problem.
85+
- Create a todo list in markdown format to track your progress.
86+
- Each time you complete a step, check it off using `[x]` syntax.
87+
- Each time you check off a step, display the updated todo list to the user.
88+
- Make sure that you ACTUALLY continue on to the next step after checking off a step instead of ending your turn and asking the user what they want to do next.
89+
90+
## 6. Making Code Changes
91+
92+
- Before editing, always read the relevant file contents or section to ensure complete context.
93+
- Always read 2000 lines of code at a time to ensure you have enough context.
94+
- If a patch is not applied correctly, attempt to reapply it.
95+
- Make small, testable, incremental changes that logically follow from your investigation and plan.
96+
97+
## 7. Debugging
98+
99+
- Use the `get_errors` tool to identify and report any issues in the code. This tool replaces the previously used `#problems` tool.
100+
- Make code changes only if you have high confidence they can solve the problem
101+
- When debugging, try to determine the root cause rather than addressing symptoms
102+
- Debug for as long as needed to identify the root cause and identify a fix
103+
- Use print statements, logs, or temporary code to inspect program state, including descriptive statements or error messages to understand what's happening
104+
- To test hypotheses, you can also add test statements or functions
105+
- Revisit your assumptions if unexpected behavior occurs.
106+
107+
# How to create a Todo List
108+
109+
Use the following format to create a todo list:
110+
111+
```markdown
112+
- [ ] Step 1: Description of the first step
113+
- [ ] Step 2: Description of the second step
114+
- [ ] Step 3: Description of the third step
115+
```
116+
117+
Do not ever use HTML tags or any other formatting for the todo list, as it will not be rendered correctly. Always use the markdown format shown above.
118+
119+
# Communication Guidelines
120+
121+
Always communicate clearly and concisely in a casual, friendly yet professional tone.
122+
123+
<examples>
124+
"Let me fetch the URL you provided to gather more information."
125+
"Ok, I've got all of the information I need on the LIFX API and I know how to use it."
126+
"Now, I will search the codebase for the function that handles the LIFX API requests."
127+
"I need to update several files here - stand by"
128+
"OK! Now let's run the tests to make sure everything is working correctly."
129+
"Whelp - I see we have some problems. Let's fix those up."
130+
</examples>

.github/copilot-instructions.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# Python Cheatsheet - AI Coding Assistant Instructions
2+
3+
## Project Overview
4+
5+
This is a Vue 3 + Vite-based documentation website for Python programming reference, featuring a comprehensive cheatsheet, blog posts, and built-in function documentation. The site uses Vue-SSG for static generation and is deployed on Netlify.
6+
7+
## Architecture & Key Patterns
8+
9+
### Content Structure
10+
11+
- **Cheatsheet pages**: Markdown files in `docs/cheatsheet/` (e.g., `basics.md`, `control-flow.md`)
12+
- **Built-in functions**: Individual pages in `docs/builtin/` (e.g., `abs.md`, `print.md`)
13+
- **Blog posts**: Markdown files in `docs/blog/` with frontmatter metadata
14+
- **Modules documentation**: Standard library references in `docs/modules/`
15+
16+
### Routing & Layout System
17+
18+
- Uses `vite-plugin-pages` for file-based routing with multiple layouts:
19+
- `default.vue`: Main layout with sidebar + TOC
20+
- `article.vue`: Blog post layout
21+
- `fullPage.vue`: Full-width pages
22+
- `blog.vue`: Blog index layout
23+
- Route metadata defined in `<route lang="yaml">` blocks
24+
- Navigation structure centralized in `src/store/navigation.ts`
25+
26+
### Content Rendering
27+
28+
- Markdown files auto-converted to Vue components via `unplugin-vue-markdown`
29+
- Prism.js for syntax highlighting with custom theme
30+
- Custom Vue components available in markdown (e.g., `<base-title>`, `<base-disclaimer>`)
31+
- Automatic TOC generation from headings using `markdown-it-anchor`
32+
33+
### Key Features Implementation
34+
35+
- **Reader Mode**: Full-screen reading with font size controls (`src/store/reader.ts`)
36+
- **Dark Mode**: Theme toggle with system preference detection
37+
- **Search**: Algolia DocSearch integration (`src/components/AlgoliaDocSearch.vue`)
38+
- **Contributors**: Auto-fetched from GitHub API (`scripts/fetch-contributors.ts`)
39+
40+
## Development Workflows
41+
42+
### Essential Commands
43+
44+
```bash
45+
pnpm dev # Development server
46+
pnpm build # Production build (Vue-SSG)
47+
pnpm fetch-contributors # Update contributors list
48+
pnpm lint # ESLint check
49+
pnpm typecheck # TypeScript validation
50+
```
51+
52+
### Content Creation Patterns
53+
54+
**New Cheatsheet Page:**
55+
56+
```markdown
57+
---
58+
title: Topic Name - Python Cheatsheet
59+
description: Brief description of the topic
60+
---
61+
62+
<base-title :title="frontmatter.title" :description="frontmatter.description">
63+
Topic Name
64+
</base-title>
65+
66+
<!-- Content with proper heading structure -->
67+
```
68+
69+
**New Blog Post:**
70+
71+
```markdown
72+
---
73+
title: Post Title - Python Cheatsheet
74+
description: Post description
75+
date: MMM DD, YYYY
76+
updated: MMM DD, YYYY
77+
tags: python, topic, level
78+
socialImage: /blog/image.jpg
79+
---
80+
81+
<route lang="yaml">
82+
meta:
83+
layout: article
84+
# duplicate frontmatter here
85+
</route>
86+
87+
<blog-title-header :frontmatter="frontmatter" title="Display Title" />
88+
```
89+
90+
### Navigation Updates
91+
92+
- Add new routes to `src/store/navigation.ts` in appropriate section
93+
- Use `updated: true` flag for highlighting new content
94+
- Internal links use `<router-link>` for SPA navigation
95+
96+
## Project-Specific Conventions
97+
98+
### Component Organization
99+
100+
- **UI Components**: `src/components/ui/` - reusable base components
101+
- **Layout Components**: `src/components/layout/` - navigation, sidebars, footers
102+
- **Icons**: `src/components/icons/` - SVG icon components
103+
- **Auto-imports**: Components auto-registered via `unplugin-vue-components`
104+
105+
### Styling Approach
106+
107+
- **Tailwind CSS** for utility-first styling
108+
- **Prose classes** for markdown content styling
109+
- **CSS custom properties** for theme variables
110+
- **Dark mode** via CSS classes, not Tailwind's dark variant
111+
112+
### State Management
113+
114+
- **Pinia stores** for global state (navigation, reader mode, newsletter)
115+
- **VueUse composables** for reactive utilities
116+
- **Auto-imports** for composables and Vue APIs
117+
118+
### Build & Deployment
119+
120+
- **SSG mode**: Pre-generates all routes for static hosting
121+
- **PWA enabled**: Service worker + offline support
122+
- **Sitemap generation**: Auto-generated in build process
123+
- **Netlify deployment**: Build command `pnpm build`, publish `dist/`
124+
125+
## Integration Points
126+
127+
### External Services
128+
129+
- **Algolia Search**: App ID, API key, index name via env vars
130+
- **Newsletter**: Beehiiv integration for subscriptions
131+
- **Analytics**: Plausible analytics integration
132+
- **Sponsors**: Carbon Ads + custom sponsor components
133+
134+
### GitHub Integration
135+
136+
- **Edit links**: Point to correct repo paths (`docs/` vs `src/pages/`)
137+
- **Issue/discussion links**: Footer integration for feedback
138+
- **Contributors**: GitHub API for automatic contributor fetching
139+
140+
## Common Pitfalls & Solutions
141+
142+
- **Route metadata**: Must duplicate frontmatter in `<route>` block for proper SSG
143+
- **Component imports**: Use auto-imports, avoid manual imports when possible
144+
- **Markdown components**: Register in `src/components.d.ts` for TypeScript
145+
- **Static assets**: Reference from `public/` directory in production builds
146+
- **TOC generation**: Requires proper heading hierarchy (h2, h3, etc.)
147+
148+
## Content Guidelines
149+
150+
- Use consistent frontmatter structure across similar content types
151+
- Link internally with `<router-link>` for better SPA experience
152+
- Include code examples in fenced blocks for proper syntax highlighting
153+
- Add social images for blog posts to improve sharing
154+
- Update navigation store when adding new major sections

0 commit comments

Comments
 (0)