plumb-dev 0.2.0__tar.gz

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 (65) hide show
  1. plumb_dev-0.2.0/.claude/settings.local.json +5 -0
  2. plumb_dev-0.2.0/.claude/skills/plumb/SKILL.md +130 -0
  3. plumb_dev-0.2.0/.gitignore +5 -0
  4. plumb_dev-0.2.0/.plumb/code_coverage_map.json +1584 -0
  5. plumb_dev-0.2.0/.plumb/config.json +23 -0
  6. plumb_dev-0.2.0/.plumb/coverage.json +1 -0
  7. plumb_dev-0.2.0/.plumb/decisions/feat-init-qol-improvements.jsonl +13 -0
  8. plumb_dev-0.2.0/.plumb/decisions/main.jsonl +602 -0
  9. plumb_dev-0.2.0/.plumb/requirements.json +2801 -0
  10. plumb_dev-0.2.0/.plumbignore +12 -0
  11. plumb_dev-0.2.0/CLAUDE.md +27 -0
  12. plumb_dev-0.2.0/PKG-INFO +15 -0
  13. plumb_dev-0.2.0/README.md +118 -0
  14. plumb_dev-0.2.0/docs/plans/2026-03-02-decisions-sharding-design.md +103 -0
  15. plumb_dev-0.2.0/docs/plans/2026-03-02-decisions-sharding-plan.md +1342 -0
  16. plumb_dev-0.2.0/docs/plans/2026-03-02-sync-spec-update-optimization-design.md +119 -0
  17. plumb_dev-0.2.0/docs/plans/2026-03-02-sync-spec-update-optimization-plan.md +775 -0
  18. plumb_dev-0.2.0/docs/plans/2026-03-03-fan-out-chunking-design.md +62 -0
  19. plumb_dev-0.2.0/docs/plans/2026-03-03-fan-out-chunking-plan.md +694 -0
  20. plumb_dev-0.2.0/docs/plans/2026-03-03-init-qol-improvements-design.md +74 -0
  21. plumb_dev-0.2.0/docs/plans/2026-03-03-init-qol-improvements-plan.md +569 -0
  22. plumb_dev-0.2.0/plumb/__init__.py +13 -0
  23. plumb_dev-0.2.0/plumb/claude_session.py +191 -0
  24. plumb_dev-0.2.0/plumb/cli.py +978 -0
  25. plumb_dev-0.2.0/plumb/config.py +69 -0
  26. plumb_dev-0.2.0/plumb/conversation.py +220 -0
  27. plumb_dev-0.2.0/plumb/coverage_reporter.py +445 -0
  28. plumb_dev-0.2.0/plumb/decision_log.py +478 -0
  29. plumb_dev-0.2.0/plumb/git_hook.py +418 -0
  30. plumb_dev-0.2.0/plumb/ignore.py +64 -0
  31. plumb_dev-0.2.0/plumb/programs/__init__.py +167 -0
  32. plumb_dev-0.2.0/plumb/programs/code_coverage_mapper.py +45 -0
  33. plumb_dev-0.2.0/plumb/programs/code_modifier.py +72 -0
  34. plumb_dev-0.2.0/plumb/programs/decision_deduplicator.py +40 -0
  35. plumb_dev-0.2.0/plumb/programs/decision_extractor.py +63 -0
  36. plumb_dev-0.2.0/plumb/programs/diff_analyzer.py +35 -0
  37. plumb_dev-0.2.0/plumb/programs/question_synthesizer.py +22 -0
  38. plumb_dev-0.2.0/plumb/programs/requirement_parser.py +30 -0
  39. plumb_dev-0.2.0/plumb/programs/spec_updater.py +83 -0
  40. plumb_dev-0.2.0/plumb/programs/test_generator.py +50 -0
  41. plumb_dev-0.2.0/plumb/programs/test_mapper.py +44 -0
  42. plumb_dev-0.2.0/plumb/skill/SKILL.md +130 -0
  43. plumb_dev-0.2.0/plumb/sync.py +404 -0
  44. plumb_dev-0.2.0/plumb_spec.md +722 -0
  45. plumb_dev-0.2.0/pyproject.toml +30 -0
  46. plumb_dev-0.2.0/tests/__init__.py +0 -0
  47. plumb_dev-0.2.0/tests/conftest.py +81 -0
  48. plumb_dev-0.2.0/tests/test_chunking.py +187 -0
  49. plumb_dev-0.2.0/tests/test_claude_session.py +328 -0
  50. plumb_dev-0.2.0/tests/test_cli.py +431 -0
  51. plumb_dev-0.2.0/tests/test_cli_extended.py +243 -0
  52. plumb_dev-0.2.0/tests/test_config.py +105 -0
  53. plumb_dev-0.2.0/tests/test_conversation.py +179 -0
  54. plumb_dev-0.2.0/tests/test_coverage_extended.py +83 -0
  55. plumb_dev-0.2.0/tests/test_coverage_reporter.py +553 -0
  56. plumb_dev-0.2.0/tests/test_decision_log.py +428 -0
  57. plumb_dev-0.2.0/tests/test_generated.py +4175 -0
  58. plumb_dev-0.2.0/tests/test_git_hook.py +422 -0
  59. plumb_dev-0.2.0/tests/test_git_hook_extended.py +229 -0
  60. plumb_dev-0.2.0/tests/test_ignore.py +111 -0
  61. plumb_dev-0.2.0/tests/test_integration.py +302 -0
  62. plumb_dev-0.2.0/tests/test_programs.py +340 -0
  63. plumb_dev-0.2.0/tests/test_spec_updater.py +67 -0
  64. plumb_dev-0.2.0/tests/test_sync.py +270 -0
  65. plumb_dev-0.2.0/tests/test_sync_helpers.py +102 -0
@@ -0,0 +1,5 @@
1
+ {
2
+ "enabledPlugins": {
3
+ "superpowers@claude-plugins-official": true
4
+ }
5
+ }
@@ -0,0 +1,130 @@
1
+ # Plumb Skill
2
+
3
+ Plumb keeps the spec, tests, and code in sync. It intercepts every `git commit`
4
+ via a pre-commit hook, analyzes staged changes and conversation history, and
5
+ surfaces decisions for review before the commit lands.
6
+
7
+ ## Your responsibilities when Plumb is active
8
+
9
+ ### Before starting work
10
+ Run `plumb status` to understand the current state of spec/test/code alignment.
11
+ Note any pending decisions and any broken git references. Report a brief summary
12
+ to the user before proceeding.
13
+
14
+ ### Before committing
15
+ Run `plumb diff` to preview what Plumb will capture from staged changes. Report
16
+ the estimated decisions to the user so they are not surprised during review.
17
+
18
+ ### When git commit is intercepted
19
+ When you run `git commit` and it exits non-zero with Plumb output, do the
20
+ following:
21
+
22
+ 1. Parse the JSON from stdout. It will have this shape:
23
+ ```json
24
+ {
25
+ "pending_decisions": 2,
26
+ "decisions": [
27
+ {
28
+ "id": "dec-abc123",
29
+ "question": "...",
30
+ "decision": "...",
31
+ "made_by": "llm",
32
+ "confidence": 0.87
33
+ }
34
+ ]
35
+ }
36
+ ```
37
+
38
+ 2. **You MUST use `AskUserQuestion` to present decisions.** Do NOT print decision
39
+ details as plain text and ask the user to respond. You MUST use the
40
+ `AskUserQuestion` tool so the user sees the native multiple-choice UI.
41
+ Present each decision with these options:
42
+ - **Approve** (Recommended) — accept it and update the spec
43
+ - **Approve with edits** — modify what the decision says before approving
44
+ - **Ignore** — not spec-relevant; discard permanently
45
+ - **Reject** — undo this change in the staged code
46
+
47
+ Include the decision details in the question text:
48
+ ```
49
+ Plumb found [N] decision(s). Decision [X of N]:
50
+ Question: [question]
51
+ Decision: [decision]
52
+ Made by: [made_by] (confidence: [confidence])
53
+ ```
54
+
55
+ This is non-negotiable. Presenting decisions as plain text defeats the
56
+ purpose of structured review. Always use `AskUserQuestion`.
57
+
58
+ 3. Based on the user's selection, call the appropriate command:
59
+ - Approve: `plumb approve <id>`
60
+ - Approve with edits: `plumb edit <id> "<new decision text from user>"`
61
+ - Ignore: `plumb ignore <id>`
62
+ - Reject: `plumb reject <id> --reason "..."`
63
+ (modify runs automatically — no separate call needed)
64
+
65
+ If the user approved ALL decisions with no edits, use `plumb approve --all`
66
+ instead of approving each one individually.
67
+
68
+ 4. **After all decisions are resolved, run `plumb sync`.** This updates the spec
69
+ files and generates tests for approved decisions. You MUST run sync
70
+ before re-committing — approved decisions that are not synced will leave the
71
+ spec out of date.
72
+
73
+ 5. Stage any files changed by sync (spec files, generated tests), then re-run
74
+ `git commit`. Draft the commit message **after** decision review is complete
75
+ and include a summary of approved decisions (e.g. "Approved: dec-abc123
76
+ (added caching), dec-def456 (fixed retry logic)"). The hook will fire again.
77
+ If there are no pending decisions it will exit 0 and the commit will land.
78
+ If new decisions are found (rare), repeat the review process.
79
+
80
+ ### After committing
81
+ Run `plumb coverage` and briefly report the three coverage dimensions to the
82
+ user: code coverage, spec-to-test coverage, and spec-to-code coverage. Flag any
83
+ gaps that should be addressed before the next commit.
84
+
85
+ ### Using coverage to guide work
86
+ When the user asks what to work on next, run `plumb coverage` to identify:
87
+ - Requirements with no corresponding tests (run `plumb parse-spec` first if the
88
+ spec has changed)
89
+ - Requirements with no corresponding implementation
90
+ - Code with no test coverage
91
+
92
+ Present these gaps clearly so the user can prioritize.
93
+
94
+ ## Rules
95
+
96
+ - **NEVER approve, reject, or edit decisions without explicit user instruction.**
97
+ Every decision must be presented to the user via `AskUserQuestion`, and the user
98
+ must tell you how to handle each one. Do not batch-approve, auto-approve, or
99
+ assume the user's intent. This is the core purpose of Plumb — human review of
100
+ decisions.
101
+ - **ALWAYS use `AskUserQuestion` to present decisions. NEVER print them as plain
102
+ text.** The native multiple-choice UI is the only acceptable way to present
103
+ decisions. If you present decisions as plain text you are doing it wrong.
104
+ - Never edit `.plumb/decisions.jsonl` directly.
105
+ - Never edit `.plumb/config.json` directly. Use `plumb init` or `plumb status`.
106
+ - Never install the Plumb skill globally (`~/.claude/`). It is project-local only.
107
+ - The spec markdown files are the source of truth for intended behavior. Plumb
108
+ keeps them updated as decisions are approved. Do not edit spec files to resolve
109
+ decisions — let Plumb do it via `plumb sync`.
110
+ - Do not attempt to commit if there are decisions with `status: rejected_manual`.
111
+ The user must resolve these manually first.
112
+
113
+ ## Command reference
114
+
115
+ | Command | When to use |
116
+ |---|---|
117
+ | `plumb status` | Start of session, before beginning work |
118
+ | `plumb diff` | Before committing, to preview decisions |
119
+ | `plumb hook` | Called automatically by pre-commit hook |
120
+ | `plumb check` | Manually scan staged changes for decisions (alias for hook) |
121
+ | `plumb approve <id>` | User approves a decision during review |
122
+ | `plumb approve --all` | User approves all pending decisions at once |
123
+ | `plumb reject <id> --reason "<text>"` | User rejects a decision (auto-modifies code) |
124
+ | `plumb ignore <id>` | User marks a decision as not spec-relevant |
125
+ | `plumb modify <id>` | Called automatically by reject — do not call directly |
126
+ | `plumb edit <id> "<text>"` | User amends decision text before approving |
127
+ | `plumb review` | Interactive terminal review (not needed in Claude Code) |
128
+ | `plumb sync` | **Run after approving decisions** — updates spec and generates tests |
129
+ | `plumb coverage` | Report coverage across all three dimensions |
130
+ | `plumb parse-spec` | Re-parse spec after manual edits |
@@ -0,0 +1,5 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .coverage
4
+ .pytest_cache/
5
+ .env