@pieerry/harness-kit 3.0.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 (77) hide show
  1. package/.claude/agents/product-manager.md +20 -0
  2. package/.claude/agents/staff-software-engineer.md +25 -0
  3. package/.claude/commands/product-manager/prd.md +31 -0
  4. package/.claude/commands/product-manager/prp.md +35 -0
  5. package/.claude/commands/product-manager/run.md +31 -0
  6. package/.claude/commands/sse/dev.md +47 -0
  7. package/.claude/commands/sse/plan.md +33 -0
  8. package/.claude/commands/sse/pr.md +43 -0
  9. package/.claude/commands/sse/run.md +39 -0
  10. package/.claude/commands/sse/test.md +38 -0
  11. package/.claude/hooks/status-line.sh +103 -0
  12. package/.claude/plugins/product-manager/README.md +120 -0
  13. package/.claude/plugins/product-manager/evals/prd-quality.md +88 -0
  14. package/.claude/plugins/product-manager/evals/prd-readiness.md +66 -0
  15. package/.claude/plugins/product-manager/evals/prp-context-readiness.md +51 -0
  16. package/.claude/plugins/product-manager/evals/prp-quality.md +88 -0
  17. package/.claude/plugins/product-manager/guides/examples/good-prd-example.md +121 -0
  18. package/.claude/plugins/product-manager/guides/examples/good-prp-example.md +128 -0
  19. package/.claude/plugins/product-manager/guides/pipeline.md +84 -0
  20. package/.claude/plugins/product-manager/guides/prd-guidelines.md +27 -0
  21. package/.claude/plugins/product-manager/guides/product-guidelines.md +75 -0
  22. package/.claude/plugins/product-manager/guides/prp-guidelines.md +64 -0
  23. package/.claude/plugins/product-manager/guides/templates/prd.md +89 -0
  24. package/.claude/plugins/product-manager/guides/templates/prp.md +98 -0
  25. package/.claude/plugins/product-manager/guides/writing-style.md +71 -0
  26. package/.claude/plugins/product-manager/hooks/post-eval-prd.sh +77 -0
  27. package/.claude/plugins/product-manager/hooks/post-eval-prp.sh +70 -0
  28. package/.claude/plugins/product-manager/hooks/post-write-prd.sh +56 -0
  29. package/.claude/plugins/product-manager/hooks/post-write-prp.sh +61 -0
  30. package/.claude/plugins/product-manager/hooks/pre-prp-check.sh +48 -0
  31. package/.claude/plugins/product-manager/outputs/.markers/.gitkeep +0 -0
  32. package/.claude/plugins/product-manager/scripts/confluence-publish.py +205 -0
  33. package/.claude/plugins/product-manager/scripts/link-validator.py +87 -0
  34. package/.claude/plugins/product-manager/scripts/sensor-runner.py +140 -0
  35. package/.claude/plugins/product-manager/scripts/token-phase.py +208 -0
  36. package/.claude/plugins/product-manager/sensors/prd-acceptance-criteria.md +39 -0
  37. package/.claude/plugins/product-manager/sensors/prd-structure.md +39 -0
  38. package/.claude/plugins/product-manager/sensors/prp-context-quality.md +42 -0
  39. package/.claude/plugins/product-manager/sensors/prp-links.md +24 -0
  40. package/.claude/plugins/product-manager/sensors/prp-structure.md +52 -0
  41. package/.claude/plugins/product-manager/skills/prd/SKILL.md +33 -0
  42. package/.claude/plugins/product-manager/skills/prp/SKILL.md +37 -0
  43. package/.claude/plugins/staff-software-engineer/README.md +90 -0
  44. package/.claude/plugins/staff-software-engineer/evals/plan-quality.md +48 -0
  45. package/.claude/plugins/staff-software-engineer/guides/coding-style.md +51 -0
  46. package/.claude/plugins/staff-software-engineer/guides/commit-style.md +44 -0
  47. package/.claude/plugins/staff-software-engineer/guides/conventions-override.md +79 -0
  48. package/.claude/plugins/staff-software-engineer/guides/pipeline.md +69 -0
  49. package/.claude/plugins/staff-software-engineer/hooks/post-eval-plan.sh +43 -0
  50. package/.claude/plugins/staff-software-engineer/hooks/post-write-plan.sh +49 -0
  51. package/.claude/plugins/staff-software-engineer/outputs/.markers/.gitkeep +0 -0
  52. package/.claude/plugins/staff-software-engineer/sensors/code-conventions.md +37 -0
  53. package/.claude/plugins/staff-software-engineer/sensors/plan-structure.md +37 -0
  54. package/.claude/plugins/staff-software-engineer/sensors/test-coverage.md +28 -0
  55. package/.claude/plugins/staff-software-engineer/skills/backend/SKILL.md +80 -0
  56. package/.claude/plugins/staff-software-engineer/skills/devops/SKILL.md +58 -0
  57. package/.claude/plugins/staff-software-engineer/skills/mobile/SKILL.md +52 -0
  58. package/.claude/plugins/staff-software-engineer/skills/web/SKILL.md +64 -0
  59. package/.claude/settings.local.json +61 -0
  60. package/CLAUDE.md +90 -0
  61. package/LICENSE +21 -0
  62. package/README.md +192 -0
  63. package/VERSION +1 -0
  64. package/bin/hk.js +141 -0
  65. package/context-library/README.md +38 -0
  66. package/context-library/business-info-template.md +39 -0
  67. package/context-library/decisions/README.md +3 -0
  68. package/context-library/example-prds/README.md +3 -0
  69. package/context-library/meetings/.gitkeep +0 -0
  70. package/context-library/metrics/.gitkeep +0 -0
  71. package/context-library/personal-context-template.md +31 -0
  72. package/context-library/research/.gitkeep +0 -0
  73. package/context-library/squads/README.md +32 -0
  74. package/context-library/strategy/README.md +3 -0
  75. package/package.json +43 -0
  76. package/setup/install.sh +154 -0
  77. package/setup/update.sh +17 -0
@@ -0,0 +1,39 @@
1
+ # Sensor: PRD Structure
2
+
3
+ Type: deterministic
4
+ Mode: hard gate
5
+
6
+ ## Required sections (all must be present, in order)
7
+
8
+ - Problem and Hypothesis
9
+ - Customers
10
+ - Scope and Non-Goals
11
+ - Solution Overview
12
+ - Success Metrics
13
+ - Rollout
14
+ - Risks
15
+ - Owners and Open Questions
16
+
17
+ ## Forbidden sections
18
+
19
+ - Implementation Details
20
+ - Code
21
+ - API Schema
22
+
23
+ ## Forbidden tokens
24
+
25
+ - lorem
26
+ - TODO
27
+ - FIXME
28
+ - xxx
29
+ - placeholder
30
+
31
+ ## Markdown rules
32
+
33
+ - exactly 1 H1 heading
34
+ - no em-dash
35
+ - no ASCII box-drawing
36
+
37
+ ## On failure
38
+
39
+ Block publish. Return list of missing sections, forbidden tokens, rule violations. Agent regenerates only failed parts.
@@ -0,0 +1,42 @@
1
+ # Sensor: PRP Context Quality
2
+
3
+ Type: deterministic plus heuristic
4
+ Mode: hard gate
5
+
6
+ A PRP must give an executor enough context to ship without coming back to ask.
7
+
8
+ ## Required sections
9
+
10
+ - Context
11
+ - Implementation blueprint
12
+ - What
13
+
14
+ ## Checks within Context
15
+
16
+ File paths referenced. Repos and files touched table must reference at least 2 real file paths. A file path has `/` and a known extension (java, kt, ts, tsx, js, jsx, vue, py, sql, yaml, yml, md, sh, gradle).
17
+
18
+ Patterns with concrete examples. Patterns to follow must have at least 1 pattern. Each pattern must include an `Example in codebase:` line pointing to a concrete path.
19
+
20
+ Known gotchas. Subsection `### Known gotchas` must exist with at least 1 bullet.
21
+
22
+ External documentation. Subsection `### External documentation` must exist. Either URLs or explicit "none".
23
+
24
+ ## Checks within Implementation blueprint
25
+
26
+ Numbered steps in a fenced code block.
27
+
28
+ At least 1 numbered step references a class, file, or command (uppercase or path-shaped token).
29
+
30
+ ## Checks within What
31
+
32
+ Success criteria must include at least 1 line matching:
33
+ - Given / When / Then pattern, or
34
+ - measurable comparison (less than, greater than, <, >, =, drops to, stays below)
35
+
36
+ ## Open gaps budget
37
+
38
+ Count of `NEEDS REVIEW`, `NOT FOUND`, or `TBD` markers must be 5 or fewer.
39
+
40
+ ## On failure
41
+
42
+ Block publish. Return specific feedback (missing paths, missing examples, etc). Agent regenerates failed parts only.
@@ -0,0 +1,24 @@
1
+ # Sensor: PRP Links
2
+
3
+ Type: deterministic
4
+ Mode: warn-then-gate
5
+
6
+ Implemented in scripts/link-validator.py. Same rules when agent self-checks.
7
+
8
+ ## Hard checks (block)
9
+
10
+ Source PRD resolvable. The "Source PRD:" line must point to a path that exists under outputs/prd/, relative to the PRP file, or relative to the repo root.
11
+
12
+ No localhost URLs. `http://localhost` or `http://127.0.0.1` not allowed as pinned references.
13
+
14
+ GitHub permalinks. Links like `github.com/.../blob/{main|master|develop}/...` not allowed. Use commit SHA or tag.
15
+
16
+ ## Soft checks (warn)
17
+
18
+ Path format. Inline code spans that look like file paths (have `/` and end with extension) should end in a recognized extension.
19
+
20
+ URL syntax. http/https URLs must be syntactically valid.
21
+
22
+ ## On failure
23
+
24
+ Hard-check failures block publish. Soft-check warnings surface for review but do not block.
@@ -0,0 +1,52 @@
1
+ # Sensor: PRP Structure
2
+
3
+ Type: deterministic
4
+ Mode: hard gate
5
+
6
+ ## Required sections (all must be present, in order)
7
+
8
+ - Goal
9
+ - Why
10
+ - What
11
+ - Context
12
+ - Implementation blueprint
13
+ - Validation gates
14
+ - Rollout
15
+ - Open items
16
+ - References
17
+
18
+ ## Forbidden tokens
19
+
20
+ - lorem
21
+ - FIXME
22
+ - xxx
23
+ - placeholder
24
+
25
+ ## Markdown rules
26
+
27
+ - exactly 1 H1 heading
28
+ - no em-dash
29
+ - no ASCII box-drawing
30
+
31
+ ## Required metadata
32
+
33
+ Document header must declare:
34
+ - Source PRD
35
+ - Target executor
36
+ - Squad
37
+ - Tech lead
38
+ - Date
39
+
40
+ ## Validation gates block
41
+
42
+ Validation gates section must include at least one fenced bash or sh code block.
43
+
44
+ ## Sub-sections in Context
45
+
46
+ Context must contain:
47
+ - `### Repos and files touched`
48
+ - `### Patterns to follow`
49
+
50
+ ## On failure
51
+
52
+ Block publish. Return missing sections, missing metadata, missing fenced code blocks. Agent regenerates failed parts only.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: prd
3
+ description: Generate a Product Requirements Document for an team squad. Business-facing artifact. Sensors and evals gate.
4
+ user_invocable: true
5
+ ---
6
+
7
+ Generate a PRD. Follow guides/pipeline.md for retry, approval, and publish.
8
+
9
+ Ask once if missing: squad, problem in 1-2 sentences, customers, hypothesis, bet link, stage.
10
+
11
+ Compute feature_id = {YYYY-MM-DD}-{squad}-{slug}. Before generating, write the phase start marker:
12
+
13
+ ```
14
+ outputs/.markers/{feature_id}.prd-generate.start
15
+ ```
16
+
17
+ Content: `{"timestamp": "<ISO-8601 UTC now>", "session_id": ""}`
18
+
19
+ Read:
20
+ - guides/product-guidelines.md
21
+ - guides/prd-guidelines.md
22
+ - guides/writing-style.md
23
+ - guides/templates/prd.md
24
+ - guides/pipeline.md
25
+ - guides/examples/good-prd-example.md
26
+
27
+ Save to outputs/prd/{feature_id}.md.
28
+
29
+ Sensors: sensors/prd-structure.md, sensors/prd-acceptance-criteria.md.
30
+
31
+ Evals: evals/prd-quality.md, evals/prd-readiness.md.
32
+
33
+ After save reply: PRD saved at {path}. Score: {N}/10.
@@ -0,0 +1,37 @@
1
+ ---
2
+ name: prp
3
+ description: Generate a Product Requirements Prompt for engineering handoff. Needs an approved PRD. Sensors, link validation, and eval gates.
4
+ user_invocable: true
5
+ ---
6
+
7
+ Generate a PRP. Follow guides/pipeline.md for retry, approval, and publish.
8
+
9
+ Source PRD: if user passes a path, use it. Else pick the most recent in outputs/prd/. None found, abort. Tell user to run /product-manager:prd first. hooks/pre-prp-check.sh blocks if the PRD lacks the approved marker.
10
+
11
+ Compute feature_id from the source PRD filename (basename without .md). Save the PRP to outputs/prp/{feature_id}.md so it matches.
12
+
13
+ Before generating, write the phase start marker:
14
+
15
+ ```
16
+ outputs/.markers/{feature_id}.prp-generate.start
17
+ ```
18
+
19
+ Content: `{"timestamp": "<ISO-8601 UTC now>", "session_id": ""}`
20
+
21
+ Read:
22
+ - the source PRD
23
+ - guides/prp-guidelines.md
24
+ - guides/writing-style.md
25
+ - guides/templates/prp.md
26
+ - guides/pipeline.md
27
+ - guides/examples/good-prp-example.md
28
+
29
+ Explore target repos. Ask user for repo paths if not provided. Use Grep and Read to map files. Capture file:line. Never invent paths.
30
+
31
+ Save to outputs/prp/{feature_id}.md.
32
+
33
+ Sensors: sensors/prp-structure.md, sensors/prp-context-quality.md, sensors/prp-links.md.
34
+
35
+ Evals: evals/prp-quality.md, evals/prp-context-readiness.md.
36
+
37
+ After save reply: PRP saved at {path}. Score: {N}/10. Ready for handoff.
@@ -0,0 +1,90 @@
1
+ # Staff Software Engineer Plugin
2
+
3
+ Native Claude Code plugin for the engineering team. Drives plan, dev, test, and pr stages across backend, web, mobile, and devops. Per-project conventions in each repo's `.claude/conventions/` override plugin defaults.
4
+
5
+ ## Slash commands
6
+
7
+ - `/sse:plan`: generate an implementation plan from an approved PRP
8
+ - `/sse:dev`: implement the plan in code, run convention gates
9
+ - `/sse:test`: run the project test suite
10
+ - `/sse:pr`: open the draft PR
11
+ - `/sse:run`: full pipeline, plan to pr
12
+
13
+ Also invokable as sub-agent via Task tool with `subagent_type: "staff-software-engineer"`.
14
+
15
+ ## Tree
16
+
17
+ ```
18
+ .claude/plugins/staff-software-engineer/
19
+ ├── .claude-plugin/plugin.json
20
+ ├── agents/staff-software-engineer.md sub-agent
21
+ ├── commands/
22
+ │ ├── plan.md /sse:plan
23
+ │ ├── dev.md /sse:dev
24
+ │ ├── test.md /sse:test
25
+ │ ├── pr.md /sse:pr
26
+ │ └── run.md /sse:run
27
+ ├── skills/
28
+ │ ├── backend/SKILL.md Java/Spring defaults
29
+ │ ├── web/SKILL.md Vue defaults
30
+ │ ├── mobile/SKILL.md iOS/Android defaults
31
+ │ └── devops/SKILL.md CI/IaC defaults
32
+ ├── hooks/ phase markers, sensor gates
33
+ ├── scripts/ symlinks to product-manager scripts
34
+ ├── guides/
35
+ │ ├── pipeline.md retry, approval, token accounting
36
+ │ ├── coding-style.md team code style
37
+ │ ├── commit-style.md Conventional Commits with TICKET
38
+ │ └── conventions-override.md how project overrides work
39
+ ├── sensors/ plan structure, code conventions, test coverage
40
+ ├── evals/ plan quality rubric
41
+ └── outputs/
42
+ ├── plan/ generated plans
43
+ ├── dev/ dev summaries
44
+ ├── test/ test results
45
+ ├── pr/ opened PR records
46
+ ├── tokens/ per-feature phase tokens JSON
47
+ └── .markers/ phase start/end markers (transient)
48
+ ```
49
+
50
+ ## How conventions work
51
+
52
+ The plugin holds team defaults per area. Each project repo can override by adding:
53
+
54
+ ```
55
+ {repo-root}/.claude/conventions/{area}.md
56
+ ```
57
+
58
+ Example for the `recon-service` repo:
59
+
60
+ ```
61
+ recon-service/.claude/conventions/backend.md
62
+ ```
63
+
64
+ Plugin skills read both. Project rules win. See `guides/conventions-override.md`.
65
+
66
+ ## Where to edit
67
+
68
+ | Change | File |
69
+ |--------|------|
70
+ | Pipeline order | guides/pipeline.md |
71
+ | Retry count | guides/pipeline.md (Max attempts) |
72
+ | Plan template/rules | skills/backend/SKILL.md (etc per area), commands/plan.md |
73
+ | Eval threshold | evals/plan-quality.md (Threshold) |
74
+ | Code style | guides/coding-style.md |
75
+ | Commit format | guides/commit-style.md |
76
+ | Test command detection | commands/test.md |
77
+ | PR template | commands/pr.md, hooks/post-eval-pr.sh |
78
+ | Sensors | sensors/*.md |
79
+
80
+ ## Connects to PM plugin
81
+
82
+ `/sse:run` reads the latest approved PRP from `.claude/plugins/product-manager/outputs/prp/`. The feature_id flows through: PM plugin creates `2026-05-12-billing-tz-fix`, SSE plugin reuses the same id and writes its phases to the same `outputs/tokens/{feature_id}.json` file (per `guides/pipeline.md`).
83
+
84
+ Full lifecycle in one JSON: PRD generate, PRD validate, PRP generate, PRP validate, plan generate, plan validate, dev, test, pr.
85
+
86
+ ## Setup
87
+
88
+ Hooks registered in `.claude/settings.json` under PostToolUse. Token script reused from the PM plugin via symlinks in `scripts/`.
89
+
90
+ PR opening requires the `gh` CLI authenticated. `pr.md` command details ticket detection and template.
@@ -0,0 +1,48 @@
1
+ # Eval: Plan Quality
2
+
3
+ Type: LLM-judge
4
+ Mode: quality gate
5
+ Threshold: weighted total >= 8.0
6
+
7
+ Score each dimension 0-10. Cite line numbers when below 7. Weighted total = sum(score x weight%) / 100.
8
+
9
+ ## Rubric
10
+
11
+ ### Scope clarity (weight 20%)
12
+ Is what is being built clear? Tied to the source PRP?
13
+
14
+ ### Files touched specificity (weight 20%)
15
+ Are the files and modules concrete? Real paths, not placeholders?
16
+
17
+ ### Execution flow (weight 20%)
18
+ Are the steps actionable in order? Could a fresh engineer follow them?
19
+
20
+ ### Risk awareness (weight 15%)
21
+ Are real risks called out with mitigations?
22
+
23
+ ### Rollout (weight 15%)
24
+ Is there a phased plan or feature flag strategy?
25
+
26
+ ### Tests (weight 10%)
27
+ Does the plan name the test cases to cover?
28
+
29
+ ## On failure (total below 8.0)
30
+
31
+ Retry. Regenerate weakest section only. Max 3 attempts.
32
+
33
+ ## Output
34
+
35
+ ```json
36
+ {
37
+ "scores": {
38
+ "scope_clarity": 0,
39
+ "files_touched": 0,
40
+ "execution_flow": 0,
41
+ "risk_awareness": 0,
42
+ "rollout": 0,
43
+ "tests": 0
44
+ },
45
+ "weighted_total": 0.0,
46
+ "feedback": ["dimension: specific issue with line ref"]
47
+ }
48
+ ```
@@ -0,0 +1,51 @@
1
+ # Coding Style
2
+
3
+ How code reads . Applies to all areas unless a `{repo}/.claude/conventions/{area}.md` says otherwise.
4
+
5
+ ## Principles
6
+
7
+ - Read before write. At least 3 similar files in the repo before producing new code.
8
+ - Match repo conventions. Do not mix stacks (no JPA in repos using AbstractRepository, no Composition API in Vue 2 repos).
9
+ - Pragmatic over perfect. Small PRs, 1-4 files, under 100 lines ideal.
10
+ - Test service logic always. Feature or bugfix without tests is incomplete.
11
+ - Clean dead code when touching related files. Do not leave commented-out blocks.
12
+ - Temp code marked: `// please remove me` so reviewers catch it.
13
+ - Revert if issues, investigate second.
14
+ - Defensive: null-safe, guards, edge cases.
15
+ - No speculative abstraction. Three similar lines beats premature DRY.
16
+
17
+ ## Never invent
18
+
19
+ If a class, helper, or pattern is not in the repo, do not fabricate it.
20
+
21
+ Java/Kotlin:
22
+ ```java
23
+ // TBD - verify with tech lead: {what you searched, where, what is missing}
24
+ ```
25
+
26
+ Vue:
27
+ ```vue
28
+ <!-- TBD - verify with tech lead: {what is missing} -->
29
+ ```
30
+
31
+ A TODO with context beats fabricated code.
32
+
33
+ ## Backend defaults (Java/Kotlin/team)
34
+
35
+ See skills/backend/SKILL.md.
36
+
37
+ ## Web defaults (Vue/team)
38
+
39
+ See skills/web/SKILL.md.
40
+
41
+ ## Mobile defaults
42
+
43
+ See skills/mobile/SKILL.md.
44
+
45
+ ## DevOps defaults
46
+
47
+ See skills/devops/SKILL.md.
48
+
49
+ ## Project overrides
50
+
51
+ A repo can override any rule via `.claude/conventions/{area}.md`. See guides/conventions-override.md.
@@ -0,0 +1,44 @@
1
+ # Commit Style
2
+
3
+ Conventional Commits with team ticket prefix.
4
+
5
+ ## Format
6
+
7
+ ```
8
+ {type}({TICKET}): {description} (#PR)
9
+ ```
10
+
11
+ Types: feat, fix, chore, refactor, build, docs, test.
12
+
13
+ Examples:
14
+ - `feat(PROJ-123): adding timezone-aware deadline check (#456)`
15
+ - `fix(PROJ-42): correcting late flag for region-1 customers`
16
+ - `chore(PROJ-7): updating Spring Boot to 2.7`
17
+ - `refactor(PROJ-91): extracting DeadlineEvaluator from OrderService`
18
+
19
+ ## Description
20
+
21
+ - Imperative/gerund mood. "Adding", "Removing", "Enhancing", "Fixing".
22
+ - Single line. Under 70 characters.
23
+ - PR number when available.
24
+
25
+ ## Body (optional)
26
+
27
+ - Why, not what. Diff already shows what.
28
+ - Reference linked tickets or related PRs.
29
+ - Mention breaking changes explicitly with `BREAKING CHANGE:` footer.
30
+
31
+ ## Bad
32
+
33
+ - "WIP", "fixes", "more changes", "asdf"
34
+ - Ticket missing
35
+ - Description that just repeats the type ("fix(...): fix the bug")
36
+ - Multi-line title
37
+
38
+ ## Co-author
39
+
40
+ When pairing or AI-assisted:
41
+
42
+ ```
43
+ Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
44
+ ```
@@ -0,0 +1,79 @@
1
+ # Conventions Override
2
+
3
+ How project-specific conventions override the plugin defaults.
4
+
5
+ ## Path
6
+
7
+ Each repo can have its own conventions file per area:
8
+
9
+ ```
10
+ {repo-root}/
11
+ └── .claude/
12
+ └── conventions/
13
+ ├── backend.md
14
+ ├── web.md
15
+ ├── mobile.md
16
+ └── devops.md
17
+ ```
18
+
19
+ Only the files you need. If you do not have web work in this repo, do not create web.md.
20
+
21
+ ## How it works
22
+
23
+ When a skill or command generates code:
24
+
25
+ 1. Read the plugin's default conventions from `skills/{area}/SKILL.md`.
26
+ 2. Check if `cwd/.claude/conventions/{area}.md` exists.
27
+ 3. If yes, read it. Rules in this file override or add to the defaults.
28
+ 4. If a rule conflicts, project wins.
29
+ 5. If no project file, use plugin defaults only.
30
+
31
+ ## What goes in a project conventions file
32
+
33
+ The DIFFERENCES from defaults, not the full rule set. Examples:
34
+
35
+ ```markdown
36
+ # Backend conventions for recon-service
37
+
38
+ Stack overrides:
39
+ - Java 17 (not 8 or 11)
40
+ - Spring Boot 3.x (not Spring 4.3 no-Boot)
41
+ - Spring Data JPA repositories (not AbstractRepository)
42
+ - MapStruct for mappers (not Orika)
43
+ - JUnit 5 + Mockito (not JUnit 4)
44
+ - Deploy as container, not WAR
45
+ - Package: br.com.team.recon
46
+
47
+ Project-specific patterns:
48
+ - All entities in br.com.team.recon.domain
49
+ - Service layer in .service, repositories in .repository
50
+ - Use Records for DTOs
51
+
52
+ Forbidden in this repo:
53
+ - Lombok (we use Records and explicit constructors)
54
+ - @Component annotation on classes (always @Service, @Repository, @Configuration)
55
+ ```
56
+
57
+ Keep it short. Document what is DIFFERENT, not what is shared with defaults.
58
+
59
+ ## Avoiding drift
60
+
61
+ If a convention you wrote for the repo also applies to others, consider promoting it to the plugin defaults (skills/{area}/SKILL.md). Per-repo files should hold genuine repo-specific decisions.
62
+
63
+ ## Versioning
64
+
65
+ Track conventions changes in git. When a rule changes, the commit message and PR description explain why.
66
+
67
+ ## Example structure for recon-service
68
+
69
+ ```
70
+ recon-service/
71
+ ├── .claude/
72
+ │ └── conventions/
73
+ │ ├── backend.md
74
+ │ └── devops.md
75
+ ├── src/...
76
+ └── pom.xml
77
+ ```
78
+
79
+ Web and mobile files absent because recon-service has no web or mobile work.
@@ -0,0 +1,69 @@
1
+ # Pipeline
2
+
3
+ Shared rules for plan, dev, test, pr stages. Edit retry, approval, publish, and token accounting here.
4
+
5
+ ## Stages
6
+
7
+ 1. plan: generate a technical plan from the source PRP. Apply sensors, eval, retry up to 3.
8
+ 2. dev: implement the plan in code. Run lint and convention gates after each step. Retry until clean.
9
+ 3. test: run the project test suite. Capture results.
10
+ 4. pr: open a draft PR with the standard template.
11
+
12
+ ## Retry policy
13
+
14
+ Max attempts per stage: 3.
15
+
16
+ Trigger on:
17
+ - any sensor returns non-zero
18
+ - eval weighted total below threshold (default 8.0 for plan)
19
+ - test command exit code != 0 (dev/test only)
20
+
21
+ Strategy:
22
+ 1. Read the feedback.
23
+ 2. Regenerate or fix only the failed parts.
24
+ 3. Re-run gates.
25
+
26
+ Hard stop after 3 attempts: return blocker, do not proceed.
27
+
28
+ ## Approval marker
29
+
30
+ Each artifact gets:
31
+ ```
32
+ <!-- approved: {YYYY-MM-DD} score={N} -->
33
+ ```
34
+
35
+ Plan and PR also accept variants with `ready-for-handoff: true`.
36
+
37
+ Triggers hooks/post-eval-{stage}.sh.
38
+
39
+ ## Token accounting
40
+
41
+ Phases tracked per feature_id (matches PRD/PRP feature_id from the PM plugin):
42
+ - plan-generate, plan-validate
43
+ - dev
44
+ - test
45
+ - pr
46
+
47
+ Markers in outputs/.markers/{feature_id}.{phase}.{start|end}, each `{"timestamp": ISO, "session_id": ""}`. Skills write .start; hooks write .end. After each phase ends, the publish hook calls scripts/token-phase.py.
48
+
49
+ Tokens land in a shared file with the PM plugin: `outputs/tokens/{feature_id}.json`. The same file collects both PM phases (prd-generate, prd-validate, prp-generate, prp-validate) and SSE phases (plan-generate, plan-validate, dev, test, pr). Totals cover the full feature lifecycle.
50
+
51
+ To merge with the PM tokens file, the SSE token-phase.py writes to the same path under this plugin's outputs/tokens/, then a small step in commands/run.md syncs (or symlinks) with the PM tokens dir. For simplicity v1, SSE keeps its own outputs/tokens/{feature_id}.json. v2: merge.
52
+
53
+ ## Orchestrator order
54
+
55
+ 1. plan: stages 1-4.
56
+ 2. dev: stages 1-4 (with code-conventions gate).
57
+ 3. test: runs repo test suite.
58
+ 4. pr: opens draft PR.
59
+
60
+ ## Stop conditions
61
+
62
+ - 3 failed attempts on the same stage
63
+ - tests fail after dev
64
+ - gh CLI not available for pr stage
65
+ - missing required input after one clarification
66
+
67
+ ## Conventions override
68
+
69
+ Before any code generation, read `guides/conventions-override.md` and check `cwd/.claude/conventions/{area}.md`. Project-specific rules win over plugin defaults.
@@ -0,0 +1,43 @@
1
+ #!/bin/bash
2
+ # After Edit appends approval marker to plan, close phases, run token accounting.
3
+
4
+ set -euo pipefail
5
+
6
+ FILE_PATH="${CLAUDE_TOOL_FILE_PATH:-}"
7
+ PLUGIN_DIR="$(cd "$(dirname "$0")/.." && pwd)"
8
+
9
+ case "$FILE_PATH" in
10
+ *.claude/plugins/staff-software-engineer/outputs/plan/*.md) ;;
11
+ *) exit 0 ;;
12
+ esac
13
+
14
+ if ! grep -q "<!-- approved:" "$FILE_PATH"; then
15
+ exit 0
16
+ fi
17
+
18
+ if grep -q "<!-- published:" "$FILE_PATH"; then
19
+ exit 0
20
+ fi
21
+
22
+ FEATURE_ID="$(basename "$FILE_PATH" .md)"
23
+ MARKERS_DIR="$PLUGIN_DIR/outputs/.markers"
24
+ mkdir -p "$MARKERS_DIR"
25
+ NOW="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
26
+
27
+ if [ -f "$MARKERS_DIR/${FEATURE_ID}.plan-validate.start" ]; then
28
+ printf '{"timestamp":"%s"}\n' "$NOW" > "$MARKERS_DIR/${FEATURE_ID}.plan-validate.end"
29
+ fi
30
+
31
+ python3 "$PLUGIN_DIR/scripts/token-phase.py" \
32
+ --feature-id "$FEATURE_ID" \
33
+ --phase "plan-generate" \
34
+ --plugin-dir "$PLUGIN_DIR" >&2 || true
35
+
36
+ python3 "$PLUGIN_DIR/scripts/token-phase.py" \
37
+ --feature-id "$FEATURE_ID" \
38
+ --phase "plan-validate" \
39
+ --plugin-dir "$PLUGIN_DIR" >&2 || true
40
+
41
+ printf '\n<!-- published: %s -->\n' "$NOW" >> "$FILE_PATH"
42
+ echo "[hook] Plan approved + token accounting done" >&2
43
+ exit 0