Skip to content

docs: add tutorial writing style resource #539

Closed

Description

@Jammy2211

Overview

Make /docs the go-to callable resource for editing scientific Python scripts, notebooks, examples and tutorials. Add a canonical tutorial-writing guide derived from the approved COSMOS-Web Ring tone while keeping the existing README/setup-page guide separate, and enforce the distinction at authoring and review time.

This remains a skill-based capability: the task adds no Brain conductor or faculty because it introduces no independent decision surface, state or side effects. The existing Workspace Agent continues to plan example placement and structure.

Plan

  • Add one canonical tutorial-writing guide for scientific scripts, notebooks, examples and HowTo material.
  • Keep /docs as the callable entry point and make it select the tutorial guide, the existing people-facing guide, or both according to the document surface.
  • Standardise notebook follow-up prompts as **🤖 Ask AI:** and include the established __Contents__ plus """__Section__""" source format by canonical reference.
  • Preserve the iterative propose → explain significant changes → wait → apply editing boundary.
  • Extend the review faculty so tutorial prose is checked against the canonical guide.
  • Add a focused contract test and run Brain discovery/surface drift checks.

Tier: judge — merge mode: human /prm.

Detailed implementation plan

Affected Repositories

  • PyAutoBrain (primary)

Work Classification

  • Library-style development workflow for an organ repository.

Worktree root

  • ~/Code/PyAutoLabs-wt/tutorial-documentation-style/

Branch Survey

Repository Current Branch Dirty?
PyAutoBrain main clean

No active Mind task claims PyAutoBrain. An older unregistered worktree exists at .worktrees/pyautodna-stack-management/PyAutoBrain on feature/pyautodna-stack-management; the human acknowledged it and this task will not touch it.

Suggested branch: feature/tutorial-documentation-style

Implementation Steps

  1. Add skills/TUTORIAL_WRITING_STYLE.md with the approved voice, section arc, code narrative, audience adaptation, scientific distinctions, provenance safeguards, **🤖 Ask AI:** callouts, iterative editing contract and final checklist.
  2. Include the established notebook-source conventions—opening __Contents__ and top-level """__Section__""" narrative docstrings—by pointing to the existing canonical format rather than creating a competing template.
  3. Update skills/docs/docs.md so /docs loads WRITING_STYLE.md for READMEs/setup/web documentation, the tutorial guide for scientific scripts/notebooks/tutorials, and both for mixed work.
  4. Update agents/faculties/review/AGENTS.md so tutorial-documentation diffs are checked against the new guide.
  5. Add a focused test under tests/ that guards the /docs and review-faculty links to the canonical resource.
  6. Run the targeted tests plus bin/install.sh --check-project-discovery PyAutoBrain and bin/install.sh --check-agents-surface.

Key Files

  • skills/TUTORIAL_WRITING_STYLE.md — canonical scientific tutorial prose and editing guide.
  • skills/docs/docs.md — callable /docs routing and application contract.
  • agents/faculties/review/AGENTS.md — review-time enforcement.
  • tests/test_docs_style_contract.py — single-source wiring contract.

Out of scope

  • Editing the COSMOS-Web Ring notebook or assistant files themselves.
  • Adding a new Brain conductor or faculty.
  • Changing scientific claims, numerical values, code behaviour, links or citations in downstream tutorials.

Original Prompt

Click to expand starting prompt

This prompt describes the tone and style we hit when we made a good update to a python script / notebook documentation, in particular the first-AI-COSMOS-Ring example, can you turn this into a go to callable resource? Maybe use a skill but I think it could be part of PyAutoBrain as an agent or as part of its docs agent or something, which I think recently also got a github README.md style update:
Aim for the tone of a knowledgeable person guiding someone through a picture or experiment: direct, patient and precise, without sounding formal, promotional or childish.

Writing principles:

  • Use plain language and short, connected paragraphs.
  • Start with what the reader can see or do, then explain what it means.
  • Introduce each technical term only when it becomes useful. Explain it in everyday language at first use.
  • Prefer concrete descriptions: “50 smooth ellipses”, “the light left after subtracting the foreground galaxy”, “small differences consistent with noise”.
  • Keep the science accurate. Simplify the explanation, not the underlying meaning.
  • Avoid jargon about implementation when it does not help the reader understand the science.
  • Avoid vague or distracting words such as “blob”, “speckles”, “payoff” and “headline number”.
  • Avoid hype, rhetorical questions, forced analogies and repeated reassurance.
  • Use British English.

For each section:

  1. Orient the reader to the image, question or task.
  2. Explain the relevant idea and why it matters.
  3. Say what running the next code cell will do.
  4. Explain what to look for in the output and how to interpret it.

For code:

  • Keep the narrative focused on the scientific purpose.
  • Put incidental implementation details in concise Python comments.
  • When appropriate, tell readers which settings they can change and which they can leave alone.
  • For experiments, explain the starting values, suggest specific changes, describe the expected effect and provide a clear way to reset.
  • Distinguish loading or evaluating an existing model from fitting a new one.

Preserve important distinctions:

  • Subtracting a foreground galaxy’s light is different from undoing the gravitational bending of the source’s light.
  • A reconstruction is inferred from a model; it is not a direct photograph.
  • A plausible measurement does not establish that a model fits well.
  • A single best model does not by itself describe uncertainty.
  • Attribute figures, data and models to their actual sources.

Adapt to the audience:

  • For introductory tutorials, introduce fewer concepts and keep numerical methods out of the main narrative.
  • For advanced tutorials, retain the necessary technical detail but explain its purpose before its mechanics.
  • Do not remove useful detail merely to make the prose shorter.

Editing boundaries:

  • Preserve scientific claims, numerical values, code behaviour, links, citations and required formatting unless I explicitly authorise changes.
  • Flag scientific inaccuracies or misleading wording rather than silently preserving or replacing them.
  • Do not invent provenance, results, performance claims or certainty.
  • Respect any protected text blocks byte-for-byte.

Work iteratively:

  • Review one coherent block at a time.
  • Show proposed wording and briefly explain only the significant changes.
  • Wait for my feedback before applying it.
  • Carry agreed terminology and tone forward consistently.
  • Edit canonical source files rather than generated notebooks or documentation, then run the project’s required regeneration and validation steps.

Ask AI / Gemini:

  • At opportune moments in the example or tutorial, put an "Ask AI / Gemini:" thing in bold font with a suggested follow up
    question the reader can ask the AI.

Follow-up decisions

  • All notebooks are AI material, so use **🤖 Ask AI:** everywhere and do not use a Gemini-specific label.
  • Include the established opening __Contents__ and top-level """__Section__""" Python docstring format in the guidance by canonical reference.
  • The skill-based /docs architecture and branch feature/tutorial-documentation-style are approved.

Activity

  1. Jammy2211 commented on Oct 24, 2026

    @Jammy2211
    ContributorAuthor

    Human-authorized Heart RED override (development only) — 2026-10-24

    The live human replied “I authorize” after the ship gate surfaced the exact current RED reason:

    • PyAutoLens: 2 commit(s) behind origin

    Branch evidence:

    • Tests: 4 targeted style/surface tests passed; 1,263 broader PyAutoBrain tests passed with the pre-existing scoped-discovery test file excluded; the unfiltered run reached 1,268 passes and 17 unrelated environment/discovery failures.
    • Discovery: the PyAutoBrain project-discovery check and generated agent-surface check passed.
    • Diff: git diff --check passed.
    • Smoke: not applicable — this changes Brain documentation/skill wiring and no library API or workspace script.
    • Review: in-session full-diff, link-resolution and single-source review is CLEAN; the committed ReviewSurface will be re-read before push/PR.

    Scope: commit, push and open this task’s judge-tier development PR only. This authorization does not permit merge, release, rehearsal, check bypass or any claim that this branch repairs Heart. Heart remains RED for release purposes.

  2. Jammy2211 commented on Oct 24, 2026

    @Jammy2211
    ContributorAuthor

    Committed ReviewSurface re-read at e72ff50: CLEAN — one commit, four intended files, no risk flags, no claims to falsify, and no link-resolution or single-source findings. Proceeding under the recorded development-only Heart RED override; merge and release remain unauthorized.

  3. Jammy2211 commented on Oct 24, 2026

    @Jammy2211
    ContributorAuthor

    Development PR opened

    • PR: docs(skills): add tutorial writing guide #540
    • Commit: e72ff50
    • API changes: none
    • Workspace impact: none; no library API or workspace script changed, so downstream smoke is not applicable
    • Validation: 4 targeted tests and 1,263 broader Brain tests passed; PyAutoBrain discovery, agent-surface and diff checks passed; committed ReviewSurface CLEAN
    • Heart: shipped under the recorded development-only RED override for exact reason PyAutoLens: 2 commit(s) behind origin

    Judge tier: awaiting a separate human /prm. No merge or release has been authorised.

  4. Jammy2211 commented on Oct 24, 2026

    @Jammy2211
    ContributorAuthor

    Shipped

    Merged #540 at 168e84ccb8dc29819699c6f8c51f1126f7f1d9df after both required Brain Tests legs passed on Python 3.12 and 3.13.

    /docs now keeps the existing README/setup/Read the Docs guide and adds a separate canonical guide for scientific Python scripts, notebooks, worked examples and HowTo lessons. The review faculty and focused contract tests enforce the split. No public API or workspace script changed.

    The task was development-shipped under the recorded Heart RED override; this merge was separately authorised by the human /prm. No release was performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions