Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 68 additions & 0 deletions .agents/skills/delete-comment/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
name: delete-comment
description: Classify the Swift comments still in the baseline, record what they were holding, and delete them.
disable-model-invocation: true
---

# Delete comments

Swift source in this repo carries no comments. `ci/check_comments.py` enforces it with a
ratchet: `ci/comment_baseline.txt` lists each file that still has comments and how many
lines, and that number only goes down. This skill walks it down.

Scope is the paths given after `/delete-comment`, otherwise every file in the baseline.

## Steps

1. **List.** `python3 ci/check_comments.py --list <paths>` prints each comment block as a
JSON line (`file`, `first`, `last`, `text`). Done when you hold the full list for the
scope.
2. **Classify** every block as exactly one category below, reading the code around it.
Done when every listed block has a category.
3. **Record** what deletion would lose. Each Decision Record goes into `docs/adr/`
(format in `docs/adr/README.md`): extend the ADR that already holds that decision,
otherwise add the next number. Each Excuse becomes one plain line for the maintainer:
the symbol, the shortcut it takes, the proper fix. Done when every Decision Record's
file is listed under an ADR section's `Lives in` and every Excuse has its line.
4. **Delete.** `python3 ci/check_comments.py --strip <files>` removes every comment in
those files, so strip only files whose blocks are all classified and recorded, and
leave out a file that holds a Keep. Then
`python3 ci/check_comments.py --update`. Done when `python3 ci/check_comments.py`
passes and `git diff` on Swift files shows comment lines removed and nothing else.
5. **Report** the count per category, the lines shed, and the Excuse list. The
maintainer picks which Excuses become issues (`docs/agents/issue-tracker.md` § Bulk
Findings); file those with the `improve` label.

For more than a few hundred blocks, split the list into shards of about 340 blocks and
give each to a read-only classifier that writes verdicts to a file outside the worktree.
Write the ADRs and run `--strip` yourself, so no two agents edit the same file.

## Categories

**Tautology.** Restates what the code says or does: a summary of the function or type
below it, a parameter description, a `// MARK:`, a file header, a test scenario in words,
a step label. Product-language summaries count when the names and body show the same
thing. This is the default.

**Stale.** A claim the code contradicts, or a name that no longer exists. `grep` names
the surrounding code does not show. Stale wins over Decision Record.

**Excuse.** Cover for an implementation this repo should fix: `TODO`, `FIXME`, "for
now", "until X lands"; an admission the behavior is wrong, approximate, or racy; a
justification for `@unchecked Sendable`, `nonisolated(unsafe)`, a force unwrap or cast
where a safe design exists; a fixed delay or retry papering over a race; two places
"kept in sync by hand"; a shim the comment says should go.

**Decision Record.** All three hold: it gives a reason the code cannot show (a server
contract quirk, an iOS or SwiftUI behavior, a past bug, a performance, privacy, or
security rule, an ordering dependency); an engineer reading only the code could
plausibly simplify it and bring back a user-visible bug; and this repo cannot fix the
cause (that would be an Excuse). A comment that says what happens and cites an issue
number is a Tautology. About one block in ten clears this bar.

**Keep.** A third-party license or attribution notice no file in
`HermesMobile/Resources/ThirdPartyNotices/` covers. It stays in the baseline until the
notice moves there; say so in the report.

A `// test-wait: <reason>` annotation is read by `ci/check_test_waits.py`. The checker
neither lists nor strips it.
2 changes: 2 additions & 0 deletions .agents/skills/delete-comment/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
policy:
allow_implicit_invocation: false
1 change: 1 addition & 0 deletions .claude/skills
4 changes: 4 additions & 0 deletions .github/workflows/pr-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ jobs:
python3 -m unittest discover -s scripts/tests
python3 -m unittest discover -s ci -p 'test_*.py'
python3 ci/check_test_waits.py
if [[ -n "${GITHUB_BASE_REF:-}" ]]; then
git fetch --no-tags --depth=1 origin "+refs/heads/${GITHUB_BASE_REF}:refs/remotes/origin/${GITHUB_BASE_REF}"
fi
python3 ci/check_comments.py
ruby ci/select_testflight_build_number_test.rb

gate:
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,15 @@ UPDATES.md
.obsidian/
docs/research/

# Local agent tooling (per-machine caches, skills, session state)
# Local agent tooling (per-machine caches, session state). Repo skills are
# tracked in .agents/skills; .claude/skills links to them.
node_modules/
.codex-tmp/
.agents/
.agents/*
!.agents/skills/
.sc/
.claude/
.claude/*
!.claude/skills
.codex/
.cursor/
# App Store Connect credentials, release metadata, checkpoints, and tester exports
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The most common defect in this repo is a change that works on the path you teste
- **Reverse states.** If you added a way in, add the way out and the way to see it. Archive needs restore. Pin needs unpin. Start needs stop. Optimistic mutation needs rollback. A one-way door is a bug.
- **Connection modes.** `localhost`, Tailscale, and tunnel behave differently; Cloudflare closes quiet streams. Backgrounding, reconnecting, and reattaching to a live stream instead of resending the message are real cases.
- **Native quality.** Dynamic Type, VoiceOver labels, Reduce Motion, light and dark appearance, keyboard focus, and localization. Read `docs/agents/i18n.md` before touching the String Catalog, plurals, casing, or RTL.
- **Docs.** Agent conventions live in `docs/agents/`; new vocabulary in `CONTEXT.md`; build and simulator mechanics in `DEVELOPMENT.md`; Hermes connection, reconnect, and feature detection in `docs/agents/hermes-server.md`; webui parity in `docs/agents/feature-gap-index.md`, and what a Hermes host still lacks against webui in #1668; Kanban contract and behavior rules in `docs/agents/kanban.md`. Push components, keys, and relay data in `docs/agents/push.md`; usage report contract, consent, and collector in `docs/agents/usage-reports.md`. Performance rules and their guards in `docs/agents/performance.md`. `CHANGELOG.md` is written at release time, not per PR.
- **Docs.** Agent conventions live in `docs/agents/`; decisions the code cannot show in `docs/adr/`; new vocabulary in `CONTEXT.md`; build and simulator mechanics in `DEVELOPMENT.md`; Hermes connection, reconnect, and feature detection in `docs/agents/hermes-server.md`; webui parity in `docs/agents/feature-gap-index.md`, and what a Hermes host still lacks against webui in #1668; Kanban contract and behavior rules in `docs/agents/kanban.md`. Push components, keys, and relay data in `docs/agents/push.md`; usage report contract, consent, and collector in `docs/agents/usage-reports.md`. Performance rules and their guards in `docs/agents/performance.md`. `CHANGELOG.md` is written at release time, not per PR.

## Working with the server

Expand Down Expand Up @@ -125,7 +125,7 @@ A live server is not a test fixture. Unit tests run against `URLProtocol` mocks,

- Do not commit implementation plans, research notes, or agent scratch files. Keep temporary working material outside the worktree.
- Track active maintainer work in the GitHub issue that owns it. Issue, label, and staged-versus-express conventions live in `docs/agents/issue-tracker.md` and `docs/agents/triage-labels.md`. External proposals follow `CONTRIBUTING.md`.
- Put durable architecture, constraints, and decisions in the checked-in docs (`docs/agents/`, `CONTEXT.md`, `DEVELOPMENT.md`). Update those docs when the product changes so agents find current facts instead of abandoned intentions.
- Put durable architecture, constraints, and decisions in the checked-in docs (`docs/agents/`, `docs/adr/`, `CONTEXT.md`, `DEVELOPMENT.md`). Update those docs when the product changes so agents find current facts instead of abandoned intentions.
- A merged PR is the implementation record. Close or update its issue when the work lands; do not preserve a second checklist in the repository.

## How it works
Expand Down Expand Up @@ -156,7 +156,7 @@ Canonical vocabulary: `CONTEXT.md`.
- Make async ownership explicit. Cancellation, stale results, reconnects, and duplicate events are normal mobile conditions; never mutate state after the owning view or task is gone.
- Optimistic UI only when failure has a clear rollback. Never show success before the server says the operation succeeded.
- Destructive and privacy-sensitive actions stay deliberate: file writes, Git operations, server administration, and credential changes get copy that states the real consequence.
- Comments describe how a thing is used, and move when the code moves. To be used mostly to describe functions, not to annotate every line of behavior.
- Swift source carries no comments; `ci/check_comments.py` fails a file that gains one. Names and types say what the code does. A decision the code cannot show (a server quirk, an iOS behavior, a past bug) goes in `docs/adr/`, and changes in the same PR as the code it covers.
- Our users drive agents from a phone all day and notice a dropped frame, a lying spinner, and a stale label. The intended feel is dense, calm, and operator-grade. No continuously repainting animations; every animation respects Reduce Motion.
- The look is compact and glass-forward: a Liquid-Glass composer with the runtime controls in its bottom row, dense native pickers rather than marketing pages, and no third-party UI packages to get there.
- The target builds in Swift 5 language mode with targeted concurrency. Fix what the build flags, not what strict Swift 6 would.
Expand Down
Loading