Skip to content

feat(v2.4.0): PR 4/5 — /own:done + /own:status implement Option D HTML mutation/parsing #13

@DanielPodolsky

Description

@DanielPodolsky

Scope

The senior-engineering centerpiece of v2.4.0. Change /own:done to mutate tasks.html via data-attribute exact-string Edit (the Option D contract), and change /own:status to count progress via text scan with no HTML parser.

This is the LinkedIn / interview-story PR for the whole migration.

Dependencies

Before you scope further — read these

  1. #9 — locked architecture decisions. Decision 1 (Option D) is the most important one for this PR.
  2. #10 core/templates/html/tasks.html.template — read the SEMANTIC CONTRACT block in the inline HTML comments at the top of the file. It documents the exact-string transforms required:
    /own:done mutation pair (Edit tool, exact-string, replace_all=false):
      Before: data-task-id=\"X.Y\" data-status=\"pending\"
      After:  data-task-id=\"X.Y\" data-status=\"completed\"
      Also:   <input type=\"checkbox\" aria-label=\"$LABEL\" />
              → <input type=\"checkbox\" checked aria-label=\"$LABEL\" />
    
    /own:status counting (text scan, no parser):
      Total     = count of   data-task-id=\"
      Completed = count of   data-status=\"completed\"
      Progress  = (completed / total) * 100
    
  3. Memory: feedback_pr1_runtime_lessons.md — the no-assumptions design principle. PR 4's flow has zero ambiguity: text scan → Edit tool → done. No "detect available, invoke skill" complexity anywhere.
  4. Current .claude/commands/own/done.md and status.md — replace their tasks.md regex/checkbox logic with HTML versions.

Hard constraints (do not violate)

  • No external HTML parser. Cheerio, BeautifulSoup, jsdom — all OFF the table. Claude's Edit tool is the only mutation mechanism.
  • Validate before mutate. Every mutation must first confirm <body data-document-type=\"tasks\">. If not, refuse — could be wrong file.
  • Edit tool with replace_all=false. The data-task-id values are unique per task block, so single replacements work. Bulk replace would be wrong if two tasks had the same description.
  • Phase completion side effect. When the last task in a phase completes (all data-task-id=\"N.*\" for that N have data-status=\"completed\"), update roadmap.html: change that phase's <section> data-status=\"incomplete\" to \"complete\". Same Edit-tool exact-string pattern.
  • /own:status text-count must not rely on parsing. Just grep -c semantics. The contract guarantees it works on malformed HTML too.
  • DO NOT modify the data- contract.* The Option D attributes are now part of OwnYourCode's public ABI for v2.4.0 — projects in the wild depend on them.
  • Update [Unreleased] block in CHANGELOG.

Suggested implementation flow

  1. Spin up /tmp/owntest-pr4/ with PR 3's main: install → /own:init/own:feature → producing tasks.html.
  2. Read tasks.html structure and the inline contract comments.
  3. Implement /own:done task completion: find by description match → identify data-task-id → Edit-tool replace the data-status + checkbox.
  4. Implement /own:status progress: grep counts → percentage.
  5. Test the phase-completion side effect: complete all tasks in a phase, verify roadmap.html phase data-status flips to \"complete\".
  6. Edge case: what if user has 2 tasks with identical descriptions? data-task-id saves you — use it for the user prompt ("which task?").
  7. Update CHANGELOG. Run /own:done (meta — you're using the feature you just built to mark this PR's tasks complete).

LinkedIn post material

After this PR ships, this is the headline:

"How I built spec-mutation into a Markdown-replaced workflow without adding a parser dependency. Data attributes + Claude's existing Edit tool = the entire engine. Zero external dependencies, scales with model capability instead of compensating for current weakness."

Open this issue's PR with title

feat(v2.4.0): /own:done + /own:status mutate/parse tasks.html via Option D (PR 4/5)

Refs #9 · Centerpiece of #10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions