This document provides instructions for GPT 4.1, Claude Sonnet 4, or another large language model (LLM) when working on the Quarto-based website project for www.prosegrammers.com through agent platforms like OpenCode (https://opencode.ai/).
- Adhere to standard Markdown and Quarto conventions in all
.qmdfiles. - Maintain the existing style and structure of the website.
- Ensure that all new content is appropriately linked from existing pages if necessary.
- Use the
TodoWritetool to plan and track complex tasks throughout the conversation. - Follow the concise communication style: be direct and minimize unnecessary explanations.
- Work efficiently within the OpenCode environment, leveraging its integrated tools and capabilities.
-
This is a course about Document Engineering. These are the course's goals:
- Teach students how to program in the Python programming language.
- Teach students how to use Python to create, manipulate, and analyze documents.
- Teach students how to document their work in a way that is clear, concise, and professional. This includes documenting a project's source code itself and then also writing documentation for their software projects.
- Teach students how to read and critique the documentation for popular open-source projects like Quarto or Ruff or Uv or other open-source tools that are primarily in the Python ecosystem.
- Teach students how to use tools like Jupyter Notebooks and Quarto to create and share documents that include code, text, and visualizations.
- Teach students how to use generative artificial intelligence (AI) techniques as provided by tools like that use large language models, such as GitHub Copilot, Google Gemini CLI, and OpenCode. They will learn how to use these tools to generate, revise, and review both source code and documentation. The focus of this objective is on ensuring that students can use these tools effectively and responsibly.
- Teach students how to use version control systems like Git and GitHub to manage their project's source code and its documentation. Students should be able to use GitHub is both an individual and team-based fashion.
- The course is designed to be accessible to students with varying levels of Python programming experience and knowledge of document engineering.
-
The official title of this course is "Document Engineering". The official title of this course's website is "Prosegrammers". The term "Prosegrammers" is a "play on words" that combines the word "prose" with the word "programmers":
- Prose: This is the written word, like an article or a blog post.
- Programmers: This is a term that refers to people who write software.
- Prosegrammers: This is a term that refers to people who write software and documentation and use software to create, manipulate, and analyze documents.
- The domain name for the website is www.prosegrammers.com.
- The domain name for the course is intentionally plural to indicate that it is a hub for multiple learners coming together to work in a team, in a collaborative fashion, to explore the field of document engineering.
- A prosegrammer should be adept at attaining all the course objectives that are listed above in the prior list of bullet points.
- Use the Read tool to examine the relevant
.qmdfile for the page that requires editing (e.g.,syllabus/index.qmdfor the syllabus). - Use the Edit tool to make the necessary changes to the text, code, or other content within the file.
- After making changes, use the Bash tool to preview the site with
quarto previeworquarto renderto ensure changes are rendered correctly.
- Use the Write tool to create a new
.qmdfile in the appropriate directory (e.g., a new subdirectory inschedule/). - Add the content to the new file using Markdown.
- If the new page should appear in the site navigation, use the Edit tool to
add a link to it in the
navbarsection of the_quarto.ymlfile. - Use the Bash tool to preview the site to verify that the new page is accessible and renders correctly.
Slides for this project are created using Quarto and reveal.js.
- Use the Write tool to create a new
index.qmdfile for the slide deck (e.g., in theslides/directory). When you add a new slide deck, always make sure that it is in its own sub-directory inside of theslides/directory. - Add the following YAML header to the top of the file to specify the
revealjsformat:
---
title: "Introduction to Document Engineering"
description: "Exploring tools for document engineering with Python"
date: "2025-08-18"
date-format: long
author: Gregory M. Kapfhammer
execute:
echo: true
format:
live-revealjs:
completion: true
theme: default
css: ../css/styles.css
history: false
scrollable: true
transition: slide
highlight-style: github
footer: "Prosegrammers"
---- Use Markdown headings to create slides. A level 2 heading (
##) creates a new slide. - Add content (text, images, code blocks) to each slide.
- Use the Bash tool with
quarto previewon the specific.qmdfile to see the rendered slides. - Slides should always contain suitable icons that help to illustrate a key
point. Here is an example of the approach to creating the icons:
{{< iconify fa6-solid lightbulb >}}. - Make all the points in the slides short and clear, and easy to read.
- Do not write points in the slides are long sentences.
- Always provide evidence to support the points that you make in the slides.
- Use
fragmentand `incremental inside of the slides to ensure that content displays appropriately through the use of Quarto and the reveal.js framework. - Add source code segments using fenced code blocks. Here is an example of what a fenced code block would look like for Python code:
from typing import List
def duplicates(input_list: List[int]) -> bool:
"""Determine whether or not the input list contains a duplicate value."""
n = len(input_list)
for i in range(n):
for j in range(n):
if i != j and input_list[i] == input_list[j]:
return True
return False
assert(duplicates([1,2,6,3,4,5,6,7,8]))
assert(not duplicates([1,2,3,4]))
print(duplicates([1,2,6,3,4,5,6,7,8]))
print(not duplicates([1,2,3,4]))
- When it is appropriate for a learner to actually run the source code segment,
then use
pyodideto provide an editable environment and run the code. Here is an example of what a fenced code block would look like for Python code that usespyodidein the content of Quarto and slides created with reveal.js:
#| autorun: true
#| max-lines: 15
from typing import List
def duplicates(input_list: List[int]) -> bool:
"""Determine whether or not the input list contains a duplicate value."""
n = len(input_list)
for i in range(n):
for j in range(n):
if i != j and input_list[i] == input_list[j]:
return True
return False
assert(duplicates([1,2,6,3,4,5,6,7,8]))
assert(not duplicates([1,2,3,4]))
print(duplicates([1,2,6,3,4,5,6,7,8]))
print(not duplicates([1,2,3,4]))
- After a source code segment, always have a key take-home message or a question that can prompt discussion or reflection about the code.
- Use bold and italics to draw out labels or key take-home messages.
- The title for a slide should normally fit into a single line. When it is not possible for it to fit on a single line, then it should always fill at most two lines and fill those two lines (nearly) completely. In the context of "filling the line" this requirement comes from the perspective of the display of the slide inside of the web browser.
- All source code words should be displayed using single backticks
as in a variable name like
display_nameorinput_list. - The slides should have an appropriate balance of text and code segments and a layout that is both predictable and consistent but also varied enough to be interesting and engaging.
- Sometimes the text at the bottom of a slide should use:
{.fragment .fade .boxed-content style="font-size: 1.0em;"}to create some "boxed content" that highlights a key point that learners should understand and remember after the presentation of the slide. - If the code segment is too long and it will require scrolling across a lengthy code block, then break up the code block into multiple slides.
- Make sure that any slide with a code block includes enough space to see most, if not all of, the output produced by the source code block.
Before completing any changes, verify that the site builds correctly and that there are no issues with the content.
Use the Bash tool to run the following command to check the project for common issues:
quarto checkThis command will check for broken links, missing resources, and other potential problems.
Before completing slide creation, verify that slides meet presentation standards and layout guidelines. Slides must be visually verified to ensure proper formatting and readability in presentation mode.
Important: Do not stop working on a feature to improve the slides
until you have verified that the slides meet presentation standards and layout.
You can use each of the following steps to verify that layout of slides. Please
note that these instructions are customized for the slides/weekone/index.qmd
file but you should follow them for whatever slide you are working on.
-
Render slides to HTML format:
quarto render slides/weekone/index.qmd
-
Start local preview server:
quarto preview slides/weekone/index.qmd --port 8081
-
Visual verification checklist:
- Navigate through each slide using arrow keys or slide controls
- Verify titles fit on one line (or maximum two lines if necessary)
- Check that content does not overflow slide boundaries
- Ensure font sizes are readable and appropriate
- Confirm fragments and incremental content display correctly
- Verify icons and formatting render properly
- Confirm that there is not too much blank space at the bottom of the slide
-
Title length verification:
- Titles should fit on a single line at 1920x1080 resolution
- If title spans two lines, it must fill those lines nearly completely
- Use concise, descriptive titles (prefer "Essential tools" over "Four essential document engineering tools")
-
Content overflow check:
- Ensure bullet points, code blocks, and text fit within slide boundaries
- Check that boxed content and fragments are properly positioned
- Verify code examples display without horizontal scrolling
-
Cross-browser compatibility (optional but recommended):
chromium-browser --headless --disable-gpu --window-size=1920,1080 \ --screenshot=slide-verify.png http://localhost:8081/slides/weekone/index.html
Important: Always complete this verification process before finalizing slides. The visual presentation quality directly affects the effectiveness of course delivery and student engagement. If you make any temporary files, like the slide-verify.png file, please make sure to "clean up" after yourself by deleting that file --- and only that file --- after you have verified that the layout is correct and that you have followed all of these standards.
These are the high-level rules about modifying the files in this repository:
- Line width: All text files, including Markdown and source code, should have a line width of 80 characters.
- Tool usage: Use available tools (Read, Write, Edit, Bash, etc.) effectively to complete tasks. Prefer using the Task tool for complex searches or multi-step operations.
- Incremental changes: Make small, incremental changes. This makes it easier to review your work and catch errors early.
- Communication style: Follow the concise communication guidelines. Be direct, minimize explanations unless requested, and focus on completing the task.
- Correct tone: This repository often contains examples of existing content that Gregory M. Kapfhammer already wrote about the topic of document engineering. Use the Read tool to review this content so as to make sure that you write with the correct tone. Ultimately, you need to make sure that the content is funny and engaging while also being informative and accurate. It also needs to come across as being written by a human and not an AI. It is also important that all the content is professional in nature and not overly casual.
- Support your work: Once you are finished writing the content, you need to
make sure that you provide evidence to support the sentences and/or bullet
points that you wrote. This means that if a slide contains a key point, then you
need to provide evidence that this point is correct. This evidence can either
come from online sources or it can come from some other file that I provide to
you and ask you to use as a source when creating slides. You can write the
support for your work to the subsection called
Support for Contentin the file calledCOMPLETED.mdthat is in the root of this repository. If you are creating new content forslides/weekone/index.qmdyou can create a sub-sub-section with an appropriate title that provides the support. - Indicate You Completed Your Work: Once you are done with the task in the
PLAN.mdfile, make sure that you copy all the tasks you completed from thePLAN.mdfile to theCOMPLETED.mdfile. Indicate that you have finished working on all the tasks by placing theXsymbol inside of the square brackets. Make sure that you only place this symbol for tasks you completed. Then, when finished, delete all the completed tasks from thePLAN.mdfile so that I can see what work still remains to be done.
As Claude Sonnet 4 (or another large language model like GPT4.1) working through OpenCode, you must also follow these behavior guidelines:
- OpenCode Integration: Leverage OpenCode's capabilities for seamless file editing, command execution, and project management within the web-based environment.
- Task Management: Use the TodoWrite tool proactively for complex tasks to track progress and give the user visibility into your work.
- Code References: When referencing specific functions or pieces of code,
include the pattern
file_path:line_numberto allow easy navigation. - Parallel Operations: When multiple independent operations are needed, batch your tool calls together for optimal performance.
- File Exploration: Use Read, Glob, and Grep tools effectively. Use the Task tool for complex searches that may require multiple rounds of exploration.
- Version Control: OpenCode provides integrated Git functionality. Be prepared to use Git commands when explicitly requested, but never commit changes unless specifically asked to do so.
- Content Verification: Always run
quarto checkand preview commands before completing content-related tasks, utilizing OpenCode's terminal capabilities. - No Assumptions: Never assume libraries or frameworks are available. Always check existing files to understand the project's dependencies and conventions.
- Security: Follow security best practices. Never introduce code that exposes or logs secrets and keys.
- OpenCode Workflow: Take advantage of OpenCode's real-time collaboration and editing features when working with multiple files simultaneously.
Key commands for working with this Quarto project:
quarto check- Check for broken links and other issuesquarto preview- Start local development serverquarto render- Render specific filesquarto preview <file.qmd>- Preview specific slide deck
Always use the Bash tool to execute these commands and verify successful completion. OpenCode provides an integrated terminal environment for seamless command execution.
All the Python code should follow these standards:
- Function bodies: No blank lines within function bodies - keep code contiguous.
- Docstrings: Single-line docstrings starting with a capital letter, ending with a period.
- Comments: Other comments start with a lowercase letter; preserve existing comments during refactoring.
- Imports: Unless specified otherwise, do not use any imports that are not a part of the standard library. Specifically avoid using imports for packages that are available through PyPI or Conda. Use absolute imports whenever importing a module from the standard library or from provided source code. Finally, make sure that all imports are placed at the top of the file. Do not place imports into the middle of a file or at the start of a function or class.
- Formatting: Confirm a line length of 79 for linting purposes.
- Types: All functions must have type hints for parameters and return values.
- Naming: snake_case for functions/variables, PascalCase for classes, UPPER_SNAKE_CASE for constants.
- File operations: Use
pathlib.Pathfor all filesystem operations, never string paths. - Error handling: Use specific exceptions, not generic
Exception; provide meaningful error messages.
These are the high-level rules about modifying the files in this repository:
- Line width: All text files, including Markdown and source code, should have a line width of 80 characters.
- Permission to run commands: You have permission to run all commands available in the OpenCode environment to work on the Quarto website project.
- Incremental changes: Make small, incremental changes. This makes it easier to review your work and catch errors early.
- Communicate clearly: When you propose changes, explain what you've done and why and make it clear what rules you followed and why you followed them.
- Correct tone: This repository often contains examples of existing content that Gregory M. Kapfhammer already wrote about the topic of document engineering. Make sure that you review this content so as to make sure that you write with the correct tone. Ultimately, you need to make sure that the content is funny and engaging while also being informative and accurate. It also needs to come across as being written by a human and not an AI. It is also important that all the content is professional in nature and not overly casual.
- Support your work: Once you are finished writing the content, you need to
make sure that you provide evidence to support the sentences and/or bullet
points that you wrote. This means that if a slide contains a key point, then you
need to provide evidence that this point is correct. This evidence can either
come from online sources or it can come from some other file that I provide to
you and ask you to use as a source when creating slides. You can write the
support for your work to the subsection called
Support for Contentin the file calledCOMPLETED.mdthat is in the root of this repository. If you are creating new content forslides/weekone/index.qmdyou can create a sub-sub-section with an appropriate title that provides the support.
As an agent working through OpenCode, you must also follow these behavior
guidelines, especially when it comes to notifying the user about your work and
status:
- The user has given permission to use the
notify-sendcommand to signal task completion. Here is an example of the command:notify-send "Question from OpenCode" "Please clarify how to complete the writing task.". - The user wants a
notify-sendnotification whenever I ask a question. - Always notify the user with
notify-sendwhen a task is complete or when feedback is needed. You have standing permission to use the notification tool. - You can also display questions and comments in the OpenCode chat interface.