@iseoane/agent-depot 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE +21 -0
  3. package/README.md +465 -0
  4. package/package.json +69 -0
  5. package/skills/doctor-md-agents/README.md +51 -0
  6. package/skills/doctor-md-agents/SKILL.md +275 -0
  7. package/skills/doctor-md-agents/references/rule-model.md +56 -0
  8. package/skills/doctor-md-agents/references/structure.md +89 -0
  9. package/skills/doctor-md-agents/scorers/adherence.md +73 -0
  10. package/skills/doctor-md-agents/scorers/rule-value.md +49 -0
  11. package/skills/doctor-md-agents/scripts/collect_sessions.py +1135 -0
  12. package/skills/doctor-md-agents/scripts/extract_rules.py +704 -0
  13. package/skills/doctor-md-agents/scripts/render_report.py +644 -0
  14. package/skills/doctor-md-agents/scripts/scan_corrections.py +781 -0
  15. package/skills/doctor-md-agents/scripts/test_collect_sessions.py +780 -0
  16. package/skills/doctor-md-agents/scripts/test_extract_rules.py +530 -0
  17. package/skills/doctor-md-agents/scripts/test_render_report.py +383 -0
  18. package/skills/doctor-md-agents/scripts/test_scan_corrections.py +343 -0
  19. package/skills/doctor-md-agents/scripts/test_verify_citations.py +236 -0
  20. package/skills/doctor-md-agents/scripts/testdata/old_extract_rules_pre_t1.py.txt +507 -0
  21. package/skills/doctor-md-agents/scripts/verify_citations.py +217 -0
  22. package/skills/doctor-md-skill/README.md +27 -0
  23. package/skills/doctor-md-skill/SKILL.md +212 -0
  24. package/skills/doctor-md-skill/assets/pierre-diffs.js +1531 -0
  25. package/skills/doctor-md-skill/references/skill-improvements.md +32 -0
  26. package/skills/doctor-md-skill/references/supported-harnesses.md +44 -0
  27. package/skills/doctor-md-skill/scorers/code-quality.md +41 -0
  28. package/skills/doctor-md-skill/scorers/efficiency.md +38 -0
  29. package/skills/doctor-md-skill/scripts/collect_sessions.py +1112 -0
  30. package/skills/doctor-md-skill/scripts/detect_machine_sessions.py +315 -0
  31. package/skills/doctor-md-skill/scripts/render_report.py +545 -0
  32. package/skills/doctor-md-skill/scripts/test_collect_sessions.py +593 -0
  33. package/skills/doctor-md-skill/scripts/test_detect_machine_sessions.py +181 -0
  34. package/skills/doctor-md-skill/scripts/test_render_report.py +241 -0
  35. package/skills/doctor-md-skill/scripts/test_verify_citations.py +196 -0
  36. package/skills/doctor-md-skill/scripts/verify_citations.py +221 -0
@@ -0,0 +1,32 @@
1
+ # Skill improvement guidelines
2
+
3
+ ## Method
4
+
5
+ 1. Cluster the findings by root cause, across scorers and classifications, after attribution.
6
+ 2. Prioritize clusters by frequency times severity.
7
+ 3. Verify each finding against the current repository and the agent's configuration before proposing any improvements. Drop what does not verify.
8
+ 4. You are editing another agent's instructions. Keep those edits small and general. Before editing, state the intended behavioral rule and owning surface in one sentence, then make the smallest change that expresses it.
9
+ 5. Prefer **replacing** existing guidance over **appending** another paragraph.
10
+
11
+ ## When to propose changes
12
+
13
+ Do not propose changes by default. Proceed only when a concrete instruction is missing or wrong and amending it would have prevented the scored failure. Ask: would a competent agent with the current instructions still be expected to fail this way? If yes, there is a gap. If no, defer.
14
+
15
+ File only when all of these are true:
16
+
17
+ - The failure is caused by a missing, wrong, or underspecified instruction on a concrete surface: the owning actor's configuration, a skill, or in-repo guidance.
18
+ - You can name that owning surface and the one reusable rule it should have stated.
19
+ - If that rule had been present and followed, the scored failure would not have happened.
20
+ - The same gap appears in more than one source run, or is severe enough that a single occurrence still proves a missing contract.
21
+
22
+ Do not file when:
23
+
24
+ - The existing instruction already required the correct behavior and the model ignored it
25
+ - The failure is model variance: same prompt, same tools, different choice
26
+ - The only available edit is restating, hedging, or adding examples from these runs
27
+ - The real fix is product, infra, scorer, or code outside instruction surfaces
28
+
29
+ When nothing clears this bar, open no change and say, per finding, why not — that is a success. A speculative change is worse than none.
30
+
31
+
32
+
@@ -0,0 +1,44 @@
1
+ # Supported harnesses
2
+
3
+ This file is the single source of truth for harness support in `doctor-md-skill`. Reference it instead of repeating harness lists in `SKILL.md`.
4
+
5
+ ## Startup gate
6
+
7
+ | Harness | Collector ID | Local conversation source |
8
+ | --- | --- | --- |
9
+ | Claude Code | `claude` | Project-history JSONL |
10
+ | Codex | `codex` | Rollout JSONL |
11
+ | Pi | `pi` | Pi agent JSONL (`~/.pi/agent/sessions`) |
12
+ | Grok Build | `grok` | Grok Build chat_history JSONL (`~/.grok/sessions`) |
13
+ | ZCode | `zcode` | ZCode model-io rollout (`~/.zcode/cli/rollout`) |
14
+
15
+ At startup, identify the harness executing the skill from the runtime context. Do not infer it from conversation files found on disk.
16
+
17
+ If the executing harness is not listed above, or cannot be identified confidently, stop before creating a report directory or reading conversation history. Tell the user:
18
+
19
+ > doctor-md-skill currently supports Claude Code, Codex, Pi, Grok Build, and ZCode. This run appears to be using an unsupported harness, so no conversations were read.
20
+
21
+ ## Collector source selection
22
+
23
+ - `--harness auto` scans every locally available supported source and is the default.
24
+ - `--harness all` also requests every supported source.
25
+ - `--harness <collector-id>` restricts collection to one source from the table.
26
+ - A report containing one source uses its collector ID in `inventory.json`; a report containing multiple sources uses `mixed`.
27
+
28
+ Harness-specific source overrides:
29
+
30
+ - `--claude-home PATH` — nonstandard Claude Code configuration directory.
31
+ - `--codex-home PATH` — nonstandard Codex home.
32
+ - `--pi-home PATH` — nonstandard Pi agent home (default `~/.pi/agent`).
33
+ - `--grok-home PATH` — nonstandard Grok Build home (default `~/.grok`).
34
+ - `--zcode-home PATH` — nonstandard ZCode home (default `~/.zcode`).
35
+
36
+ ## Skill locations
37
+
38
+ Project skills are discovered from:
39
+
40
+ - `.agents/skills`
41
+ - `.claude/skills`
42
+ - `.codex/skills`
43
+
44
+ Global skills are discovered from the corresponding directories under the user's home and configured harness homes when `--include-global-skills` is set: `~/.claude/skills`, `~/.agents/skills`, `~/.codex/skills`, Pi's skill directory under its agent home (default `~/.pi/agent/skills`), Grok Build's `~/.grok/skills`, and ZCode's `~/.zcode/skills`.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: Code Quality
3
+ description: "Whether the code, tests, and comments the agent produced are well-designed and consistent with the target repo's conventions."
4
+ labels:
5
+ - value: "approve"
6
+ description: "The agent produced well-designed, correct code that is consistent with repo conventions, adequately tested, and clean of smells; a senior reviewer would approve it outright, with at most trivial nits."
7
+ score: 1
8
+ - value: "block"
9
+ description: "The agent produced code with at least one defect a reviewer would insist on fixing before merge: a correctness or concurrency bug, a missed edge case, an inconsistent pattern, weak or missing tests, or mixed-in artifacts that do not belong."
10
+ score: 0.2
11
+ - value: "insufficient_evidence"
12
+ description: "The transcript shows no code diff, or too little of one to judge."
13
+ score: 0.5
14
+ ---
15
+ **Rubric**
16
+
17
+ This scorer applies to conversations where the agent produced code changes. Evaluate the actual code artifact — the edits themselves, not the process used to produce them. Judge it the way a careful senior reviewer would review the same pull request, using the target repo's own established conventions as the standard. The verdict is binary: `approve` means that reviewer would merge the change as-is, with at most trivial nits; if they would insist on a fix before merging — one real defect is enough — the verdict is `block`. If the condensed transcript doesn't show enough of the change to judge, the verdict is `insufficient_evidence` and the session is excluded from aggregation. The bullets below are common quality dimensions, not an exhaustive checklist — judge any other way the artifact falls short of what a careful senior engineer would ship.
18
+
19
+ Assess:
20
+
21
+ - **Design.** The shape of the change fits the codebase; it isn't premature abstraction, scope creep, or a change that belongs somewhere else (a library, a config value, a separate service).
22
+ - **Correctness.** The change does what it claims, including edge cases (nil/empty inputs, boundaries) and concurrency safety (races, unsafe shared state, spawned work that outlives request-scoped values).
23
+ - **Complexity.** No function, type, or expression is doing more than it needs to; no speculative genericity or indirection added for a need that doesn't exist yet.
24
+ - **Repo conventions.** Follows the same idioms as similar code in the same package or module — error handling, type placement, naming schemes, and any other established pattern visible in the surrounding code. An unexplained deviation from a clear local pattern is a defect even if the new code works.
25
+ - **Code smells.** Magic numbers or strings without a named constant, copy-paste that should be a shared function, commented-out code, vague or stale TODOs, workarounds that patch a symptom instead of the root cause, silently swallowed errors, deep nesting that early returns would flatten.
26
+ - **Tests.** Present for the change, and actually verify the behavior they claim to (a broken implementation would fail them) rather than asserting trivia or mocking away the logic under test; cover the error and edge paths, not just the happy path; not so tightly coupled to internals that unrelated changes would break them.
27
+ - **Naming.** Every new identifier communicates what it represents, at a length that's unambiguous without being noisy.
28
+ - **Comments.** Explain why, not what; a doc comment on an exported symbol describes its purpose and constraints without narrating its implementation; no comment describes an edit, a refactor, or a prior state of the code rather than its current behavior.
29
+ - **Diff hygiene.** The change contains only the edits that are intended to be committed — no temporary or transient text, scratch scripts, debug prints, or other verification scaffolding left alongside it.
30
+ - **Documentation.** READMEs, guides, or API docs are updated in the same change when the change affects how the software is built, tested, or used.
31
+ - **Corrections.** A defect the user pointed out mid-conversation counts against the artifact regardless of whether it was ultimately fixed; needing an external correction at all is a negative signal, not just a defect left unresolved.
32
+
33
+ Out of scope: how directly the agent worked (scored under Efficiency), and whether it followed instructions or skills. Judge the artifact on its own merits.
34
+
35
+ **Reason**
36
+
37
+ One to three sentences citing the specific file, pattern, or defect that drove the grade. Name what would have caught it: a lint rule, a repo convention the agent should have searched for, a test case, or a skill. For `insufficient_evidence`, say what you couldn't see — for example, no diff was produced, or the diff wasn't in the transcript.
38
+
39
+ **Quote**
40
+
41
+ Alongside the reason, record a `quote`: a verbatim excerpt copied character-for-character from the transcript you were shown, proving the defect (or the clean pattern, for `approve`) is actually there. Copy it, do not paraphrase it, do not tidy its punctuation or whitespace, do not translate it, and do not stitch together two separate passages into one string. The quote is checked mechanically against the transcript text after this step — an unverifiable quote gets the whole finding discarded from aggregation, however accurate the reason sounds. For `insufficient_evidence`, leave `quote` empty; there is nothing in the transcript to cite.
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: Efficiency
3
+ description: "Whether the agent worked directly toward its result, or wasted effort on redundant steps, avoidable rework, or unnecessary back-and-forth."
4
+ labels:
5
+ - value: "highly_efficient"
6
+ description: "The agent took a direct path: nothing re-read or re-run, independent steps batched, no work redone."
7
+ score: 1
8
+ - value: "mostly_efficient"
9
+ description: "The agent slipped once or twice: a duplicated read, an early retry, or a small correction — with no knock-on cost."
10
+ score: 0.8
11
+ - value: "mostly_inefficient"
12
+ description: "The agent wasted effort repeatedly, or caused a round of rework an earlier check would have prevented."
13
+ score: 0.4
14
+ - value: "highly_inefficient"
15
+ description: "The agent's waste dominated the run: the same defect reworked across cycles, repeated user correction, or extended flailing / looping."
16
+ score: 0.2
17
+ ---
18
+ **Rubric**
19
+
20
+ You are scoring one condensed transcript of a local coding-agent conversation. Evaluate the full cost of reaching the result: the steps the agent took, rework it caused, and human attention it consumed. Score against what a competent engineer with the same tools would have needed, not against what was achievable with only what the agent happened to have. A mistake that looks unavoidable in context still counts if better tooling, a skill, or a check would have prevented it — name that cause in the reason. The bullets below are common sources of waste, not an exhaustive checklist — judge any other way the run cost more than it should have.
21
+
22
+ Assess:
23
+
24
+ - **Rework from mistakes.** Work redone because the agent got it wrong the first time: a test or build failure a local check would have caught, edits to the wrong file, a misread requirement later reverted.
25
+ - **Cost to the human.** Repeated correction or steering from the user is the most expensive waste. A question asked up front is cheap; the same question asked after building the wrong thing is not.
26
+ - **Information gathering.** Re-reading, re-running, or re-searching for something already found; reading a large file end to end when a targeted search would answer it.
27
+ - **Routine-step overhead.** A roundabout way of doing something that's a standard, repeated part of this agent's job — more steps, more calls, or a broader operation than the step needs — when a more direct path was available. Weight this beyond its one-run cost: the same avoidable overhead recurs on every future conversation until a skill or rule fixes the pattern.
28
+ - **Batching.** Independent reads, searches, or workstreams run serially across turns instead of together.
29
+ - **Flailing.** Retrying a failing approach unchanged, or guessing when reading the code or docs would have settled it. An abandoned path only counts against the agent when the information to avoid it was already available.
30
+ - **Verification timing.** Checks run once, early enough to catch a defect before declaring done, not deferred until after or re-run redundantly.
31
+
32
+ **Reason**
33
+
34
+ One to three sentences naming the dominant source of waste with a rough count (three fix-test cycles, four redundant reads, two repeated user corrections), and the likely fixable cause — a missing or weak skill, an ambiguous instruction, a late check. When a skill exists that should have prevented the waste, name the skill.
35
+
36
+ **Quote**
37
+
38
+ Alongside the reason, record a `quote`: a verbatim excerpt copied character-for-character from the transcript you were shown, proving the waste (or the clean, direct path, for `highly_efficient`) actually happened — a repeated tool call, the user's own correction, a re-read of something already read. Copy it, do not paraphrase it, do not tidy its punctuation or whitespace, do not translate it, and do not stitch together two separate passages into one string. The quote is checked mechanically against the transcript text after this step — an unverifiable quote gets the whole finding discarded from aggregation, however accurate the reason sounds.