@pieerry/harness-kit 3.1.2 → 3.3.1

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 (64) hide show
  1. package/.claude/.hk-version +1 -0
  2. package/.claude/agents/product-manager.md +2 -2
  3. package/.claude/agents/staff-software-engineer.md +2 -2
  4. package/.claude/commands/pipeline/continue.md +8 -8
  5. package/.claude/commands/pipeline/reset.md +4 -4
  6. package/.claude/commands/product-manager/prd.md +4 -4
  7. package/.claude/commands/product-manager/prp.md +7 -7
  8. package/.claude/commands/product-manager/run.md +9 -5
  9. package/.claude/commands/sse/dev.md +18 -13
  10. package/.claude/commands/sse/plan.md +8 -8
  11. package/.claude/commands/sse/pr-monitor.md +56 -0
  12. package/.claude/commands/sse/pr.md +22 -12
  13. package/.claude/commands/sse/run.md +15 -8
  14. package/.claude/commands/sse/test.md +16 -10
  15. package/.claude/conventions/README.md +12 -0
  16. package/.claude/hooks/activity-pre-read.sh +18 -0
  17. package/.claude/hooks/pipeline-session-start.sh +26 -2
  18. package/.claude/hooks/status-line.sh +17 -1
  19. package/.claude/plugins/product-manager/evals/prd-quality.md +3 -3
  20. package/.claude/plugins/product-manager/evals/prd-readiness.md +1 -1
  21. package/.claude/plugins/product-manager/evals/prp-context-readiness.md +5 -5
  22. package/.claude/plugins/product-manager/evals/prp-quality.md +1 -1
  23. package/.claude/plugins/product-manager/guides/pipeline.md +14 -14
  24. package/.claude/plugins/product-manager/guides/prd-guidelines.md +4 -4
  25. package/.claude/plugins/product-manager/guides/product-guidelines.md +16 -16
  26. package/.claude/plugins/product-manager/guides/prp-guidelines.md +16 -16
  27. package/.claude/plugins/product-manager/guides/writing-style.md +9 -9
  28. package/.claude/plugins/product-manager/sensors/prd-acceptance-criteria.md +6 -6
  29. package/.claude/plugins/product-manager/sensors/prd-structure.md +2 -2
  30. package/.claude/plugins/product-manager/sensors/prp-context-quality.md +6 -6
  31. package/.claude/plugins/product-manager/sensors/prp-links.md +2 -2
  32. package/.claude/plugins/product-manager/sensors/prp-structure.md +1 -1
  33. package/.claude/plugins/staff-software-engineer/evals/dev-quality.md +48 -0
  34. package/.claude/plugins/staff-software-engineer/evals/plan-quality.md +6 -6
  35. package/.claude/plugins/staff-software-engineer/evals/pr-quality.md +48 -0
  36. package/.claude/plugins/staff-software-engineer/evals/test-quality.md +48 -0
  37. package/.claude/plugins/staff-software-engineer/guides/coding-style.md +7 -7
  38. package/.claude/plugins/staff-software-engineer/guides/commit-style.md +3 -3
  39. package/.claude/plugins/staff-software-engineer/guides/conventions-override.md +13 -13
  40. package/.claude/plugins/staff-software-engineer/guides/pipeline.md +19 -15
  41. package/.claude/plugins/staff-software-engineer/hooks/post-eval-sse.sh +65 -0
  42. package/.claude/plugins/staff-software-engineer/hooks/post-write-sse.sh +60 -0
  43. package/.claude/plugins/staff-software-engineer/sensors/code-conventions.md +4 -4
  44. package/.claude/plugins/staff-software-engineer/sensors/dev-structure.md +46 -0
  45. package/.claude/plugins/staff-software-engineer/sensors/pr-structure.md +49 -0
  46. package/.claude/plugins/staff-software-engineer/sensors/test-coverage.md +6 -6
  47. package/.claude/plugins/staff-software-engineer/sensors/test-structure.md +46 -0
  48. package/.claude/plugins/staff-software-engineer/skills/backend/SKILL.md +8 -8
  49. package/.claude/plugins/staff-software-engineer/skills/devops/SKILL.md +3 -3
  50. package/.claude/plugins/staff-software-engineer/skills/mobile/SKILL.md +3 -3
  51. package/.claude/plugins/staff-software-engineer/skills/web/SKILL.md +2 -2
  52. package/.claude/scripts/activity.py +68 -0
  53. package/.claude/scripts/pr-monitor.py +113 -0
  54. package/.claude/scripts/stage-card.md +37 -34
  55. package/.claude/settings.json +74 -0
  56. package/.claude/settings.local.json +13 -1
  57. package/CLAUDE.md +6 -0
  58. package/README.md +161 -61
  59. package/VERSION +1 -1
  60. package/bin/hk.js +6 -1
  61. package/package.json +1 -1
  62. package/setup/install.sh +16 -8
  63. package/.claude/plugins/staff-software-engineer/hooks/post-eval-plan.sh +0 -43
  64. package/.claude/plugins/staff-software-engineer/hooks/post-write-plan.sh +0 -49
@@ -0,0 +1,48 @@
1
+ # Eval: Test Quality
2
+
3
+ Type: LLM-judge
4
+ Mode: quality gate
5
+ Threshold: weighted total >= 8.0
6
+
7
+ Score each dimension 0-10. Cite test names or output lines when below 7. Weighted total = sum(score x weight%) / 100.
8
+
9
+ ## Rubric
10
+
11
+ ### Result accuracy (weight 25%)
12
+ Does Result field (pass | fail) match exit code and counts? No misreporting.
13
+
14
+ ### Failure detail (weight 25%)
15
+ If failures occurred, failing test names listed with enough context (file:line, assertion message)? If pass, Failures explicitly `none`?
16
+
17
+ ### Coverage of changes (weight 20%)
18
+ Tests run cover files changed in dev phase? Gaps called out?
19
+
20
+ ### Command reproducibility (weight 15%)
21
+ Command field real shell command another engineer could run as-is? Includes filters or args if used.
22
+
23
+ ### Duration sanity (weight 10%)
24
+ Duration reported with unit? Plausible for suite size?
25
+
26
+ ### Regression risk callouts (weight 5%)
27
+ Flakes or slow tests flagged for follow-up?
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
+ "result_accuracy": 0,
39
+ "failure_detail": 0,
40
+ "coverage_of_changes": 0,
41
+ "command_reproducibility": 0,
42
+ "duration_sanity": 0,
43
+ "regression_risk": 0
44
+ },
45
+ "weighted_total": 0.0,
46
+ "feedback": ["dimension: specific issue with test name or output ref"]
47
+ }
48
+ ```
@@ -1,14 +1,14 @@
1
1
  # Coding Style
2
2
 
3
- How code reads . Applies to all areas unless a `{repo}/.claude/conventions/{area}.md` says otherwise.
3
+ How code reads. Applies to all areas unless `{repo}/.claude/conventions/{area}.md` says otherwise.
4
4
 
5
5
  ## Principles
6
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).
7
+ - Read before write. At least 3 similar files in repo before producing new code.
8
+ - Match repo conventions. No mixing stacks (no JPA in repos using AbstractRepository, no Composition API in Vue 2 repos).
9
9
  - Pragmatic over perfect. Small PRs, 1-4 files, under 100 lines ideal.
10
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.
11
+ - Clean dead code when touching related files. No commented-out blocks.
12
12
  - Temp code marked: `// please remove me` so reviewers catch it.
13
13
  - Revert if issues, investigate second.
14
14
  - Defensive: null-safe, guards, edge cases.
@@ -16,7 +16,7 @@ How code reads . Applies to all areas unless a `{repo}/.claude/conventions/{area
16
16
 
17
17
  ## Never invent
18
18
 
19
- If a class, helper, or pattern is not in the repo, do not fabricate it.
19
+ If class, helper, or pattern not in repo, do not fabricate.
20
20
 
21
21
  Java/Kotlin:
22
22
  ```java
@@ -28,7 +28,7 @@ Vue:
28
28
  <!-- TBD - verify with tech lead: {what is missing} -->
29
29
  ```
30
30
 
31
- A TODO with context beats fabricated code.
31
+ TODO with context beats fabricated code.
32
32
 
33
33
  ## Backend defaults (Java/Kotlin/team)
34
34
 
@@ -48,4 +48,4 @@ See skills/devops/SKILL.md.
48
48
 
49
49
  ## Project overrides
50
50
 
51
- A repo can override any rule via `.claude/conventions/{area}.md`. See guides/conventions-override.md.
51
+ Repo can override any rule via `.claude/conventions/{area}.md`. See guides/conventions-override.md.
@@ -24,7 +24,7 @@ Examples:
24
24
 
25
25
  ## Body (optional)
26
26
 
27
- - Why, not what. Diff already shows what.
27
+ - Why, not what. Diff shows what.
28
28
  - Reference linked tickets or related PRs.
29
29
  - Mention breaking changes explicitly with `BREAKING CHANGE:` footer.
30
30
 
@@ -32,12 +32,12 @@ Examples:
32
32
 
33
33
  - "WIP", "fixes", "more changes", "asdf"
34
34
  - Ticket missing
35
- - Description that just repeats the type ("fix(...): fix the bug")
35
+ - Description repeats type ("fix(...): fix the bug")
36
36
  - Multi-line title
37
37
 
38
38
  ## Co-author
39
39
 
40
- When pairing or AI-assisted:
40
+ Pairing or AI-assisted:
41
41
 
42
42
  ```
43
43
  Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@@ -1,10 +1,10 @@
1
1
  # Conventions Override
2
2
 
3
- How project-specific conventions override the plugin defaults.
3
+ How project-specific conventions override plugin defaults.
4
4
 
5
5
  ## Path
6
6
 
7
- Each repo can have its own conventions file per area:
7
+ Each repo can have own conventions file per area:
8
8
 
9
9
  ```
10
10
  {repo-root}/
@@ -16,21 +16,21 @@ Each repo can have its own conventions file per area:
16
16
  └── devops.md
17
17
  ```
18
18
 
19
- Only the files you need. If you do not have web work in this repo, do not create web.md.
19
+ Only files you need. No web work in repo, no web.md.
20
20
 
21
21
  ## How it works
22
22
 
23
- When a skill or command generates code:
23
+ When skill or command generates code:
24
24
 
25
- 1. Read the plugin's default conventions from `skills/{area}/SKILL.md`.
25
+ 1. Read plugin default conventions from `skills/{area}/SKILL.md`.
26
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.
27
+ 3. If yes, read it. Rules override or add to defaults.
28
+ 4. On conflict, project wins.
29
+ 5. No project file, use plugin defaults only.
30
30
 
31
- ## What goes in a project conventions file
31
+ ## What goes in project conventions file
32
32
 
33
- The DIFFERENCES from defaults, not the full rule set. Examples:
33
+ DIFFERENCES from defaults, not full rule set. Examples:
34
34
 
35
35
  ```markdown
36
36
  # Backend conventions for recon-service
@@ -54,15 +54,15 @@ Forbidden in this repo:
54
54
  - @Component annotation on classes (always @Service, @Repository, @Configuration)
55
55
  ```
56
56
 
57
- Keep it short. Document what is DIFFERENT, not what is shared with defaults.
57
+ Keep short. Document what is DIFFERENT, not what is shared with defaults.
58
58
 
59
59
  ## Avoiding drift
60
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.
61
+ If convention you wrote for repo applies to others, consider promoting to plugin defaults (skills/{area}/SKILL.md). Per-repo files hold genuine repo-specific decisions.
62
62
 
63
63
  ## Versioning
64
64
 
65
- Track conventions changes in git. When a rule changes, the commit message and PR description explain why.
65
+ Track conventions changes in git. When rule changes, commit message and PR description explain why.
66
66
 
67
67
  ## Example structure for recon-service
68
68
 
@@ -1,13 +1,13 @@
1
1
  # Pipeline
2
2
 
3
- Shared rules for plan, dev, test, pr stages. Edit retry, approval, publish, and token accounting here.
3
+ Shared rules for plan, dev, test, pr stages. Edit retry, approval, publish, token accounting here.
4
4
 
5
5
  ## Stages
6
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.
7
+ 1. plan: generate technical plan from source PRP. Apply sensors, eval, retry up to 3.
8
+ 2. dev: implement plan in code. Run lint and convention gates after each step. Retry until clean.
9
+ 3. test: run project test suite. Capture results.
10
+ 4. pr: open draft PR with standard template.
11
11
 
12
12
  ## Retry policy
13
13
 
@@ -19,8 +19,8 @@ Trigger on:
19
19
  - test command exit code != 0 (dev/test only)
20
20
 
21
21
  Strategy:
22
- 1. Read the feedback.
23
- 2. Regenerate or fix only the failed parts.
22
+ 1. Read feedback.
23
+ 2. Regenerate or fix only failed parts.
24
24
  3. Re-run gates.
25
25
 
26
26
  Hard stop after 3 attempts: return blocker, do not proceed.
@@ -38,17 +38,21 @@ Triggers hooks/post-eval-{stage}.sh.
38
38
 
39
39
  ## Token accounting
40
40
 
41
- Phases tracked per feature_id (matches PRD/PRP feature_id from the PM plugin):
41
+ Phases tracked per feature_id (matches PRD/PRP feature_id from PM plugin):
42
42
  - plan-generate, plan-validate
43
- - dev
44
- - test
45
- - pr
43
+ - dev-generate, dev-validate
44
+ - test-generate, test-validate
45
+ - pr-generate, pr-validate
46
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.
47
+ Markers in outputs/.markers/{feature_id}.{phase}.{start|end}, each `{"timestamp": ISO, "session_id": ""}`.
48
+ Flow per stage:
49
+ 1. Skill writes `{stage}-generate.start` before drafting artifact.
50
+ 2. Write tool fires post-write-sse.sh → writes `{stage}-generate.end` + `{stage}-validate.start`.
51
+ 3. Skill appends approval marker via Edit → fires post-eval-sse.sh → writes `{stage}-validate.end` + runs scripts/token-phase.py for both phases.
48
52
 
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.
53
+ Tokens land in shared file with PM plugin: `outputs/tokens/{feature_id}.json`. Same file collects PM phases (prd-generate, prd-validate, prp-generate, prp-validate) and SSE phases (plan-generate, plan-validate, dev, test, pr). Totals cover full feature lifecycle.
50
54
 
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.
55
+ To merge with PM tokens file, SSE token-phase.py writes to same path under this plugin's outputs/tokens/, then small step in commands/run.md syncs (or symlinks) with PM tokens dir. v1: SSE keeps own outputs/tokens/{feature_id}.json. v2: merge.
52
56
 
53
57
  ## Orchestrator order
54
58
 
@@ -59,7 +63,7 @@ To merge with the PM tokens file, the SSE token-phase.py writes to the same path
59
63
 
60
64
  ## Stop conditions
61
65
 
62
- - 3 failed attempts on the same stage
66
+ - 3 failed attempts on same stage
63
67
  - tests fail after dev
64
68
  - gh CLI not available for pr stage
65
69
  - missing required input after one clarification
@@ -0,0 +1,65 @@
1
+ #!/bin/bash
2
+ # Generic SSE post-eval hook. Handles plan/dev/test/pr phases:
3
+ # - detects approved marker
4
+ # - closes validate.end marker
5
+ # - runs token-phase.py for both generate and validate phases
6
+ # - appends published marker + inline tokens reference
7
+ #
8
+ # Registered in .claude/settings.json under PostToolUse > Edit.
9
+
10
+ set -euo pipefail
11
+
12
+ FILE_PATH="${CLAUDE_TOOL_FILE_PATH:-}"
13
+ PLUGIN_DIR="$(cd "$(dirname "$0")/.." && pwd)"
14
+
15
+ PHASE=""
16
+ case "$FILE_PATH" in
17
+ *.claude/plugins/staff-software-engineer/outputs/plan/*.md) PHASE=plan ;;
18
+ *.claude/plugins/staff-software-engineer/outputs/dev/*.md) PHASE=dev ;;
19
+ *.claude/plugins/staff-software-engineer/outputs/test/*.md) PHASE=test ;;
20
+ *.claude/plugins/staff-software-engineer/outputs/pr/*.md) PHASE=pr ;;
21
+ *) exit 0 ;;
22
+ esac
23
+
24
+ if ! grep -q "<!-- approved:" "$FILE_PATH"; then
25
+ exit 0
26
+ fi
27
+
28
+ if grep -q "<!-- published:" "$FILE_PATH"; then
29
+ exit 0
30
+ fi
31
+
32
+ FEATURE_ID="$(basename "$FILE_PATH" .md)"
33
+ MARKERS_DIR="$PLUGIN_DIR/outputs/.markers"
34
+ mkdir -p "$MARKERS_DIR"
35
+ NOW="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
36
+
37
+ if [ -f "$MARKERS_DIR/${FEATURE_ID}.${PHASE}-validate.start" ]; then
38
+ printf '{"timestamp":"%s"}\n' "$NOW" > "$MARKERS_DIR/${FEATURE_ID}.${PHASE}-validate.end"
39
+ fi
40
+
41
+ python3 "$PLUGIN_DIR/scripts/token-phase.py" \
42
+ --feature-id "$FEATURE_ID" \
43
+ --phase "${PHASE}-generate" \
44
+ --plugin-dir "$PLUGIN_DIR" >&2 || true
45
+
46
+ python3 "$PLUGIN_DIR/scripts/token-phase.py" \
47
+ --feature-id "$FEATURE_ID" \
48
+ --phase "${PHASE}-validate" \
49
+ --plugin-dir "$PLUGIN_DIR" >&2 || true
50
+
51
+ TOKENS_FILE="$PLUGIN_DIR/outputs/tokens/${FEATURE_ID}.json"
52
+ if [ -f "$TOKENS_FILE" ]; then
53
+ TOKENS_LINE=$(python3 -c "
54
+ import json
55
+ with open('$TOKENS_FILE') as f:
56
+ d=json.load(f)
57
+ t=d.get('totals',{})
58
+ print(f'<!-- tokens: outputs/tokens/${FEATURE_ID}.json in={t.get(\"input\",0)} out={t.get(\"output\",0)} cache_r={t.get(\"cache_read\",0)} -->')
59
+ ")
60
+ printf '\n%s\n' "$TOKENS_LINE" >> "$FILE_PATH"
61
+ fi
62
+
63
+ printf '\n<!-- published: %s -->\n' "$NOW" >> "$FILE_PATH"
64
+ echo "[hook] ${PHASE} approved + token accounting done" >&2
65
+ exit 0
@@ -0,0 +1,60 @@
1
+ #!/bin/bash
2
+ # Generic SSE post-write hook. Handles plan/dev/test/pr phases:
3
+ # - runs sensors matching sensors/{phase}-*.md (if any)
4
+ # - writes phase generate.end + validate.start markers
5
+ #
6
+ # Registered in .claude/settings.json under PostToolUse > Write.
7
+
8
+ set -euo pipefail
9
+
10
+ FILE_PATH="${CLAUDE_TOOL_FILE_PATH:-}"
11
+ PLUGIN_DIR="$(cd "$(dirname "$0")/.." && pwd)"
12
+
13
+ PHASE=""
14
+ case "$FILE_PATH" in
15
+ *.claude/plugins/staff-software-engineer/outputs/plan/*.md) PHASE=plan ;;
16
+ *.claude/plugins/staff-software-engineer/outputs/dev/*.md) PHASE=dev ;;
17
+ *.claude/plugins/staff-software-engineer/outputs/test/*.md) PHASE=test ;;
18
+ *.claude/plugins/staff-software-engineer/outputs/pr/*.md) PHASE=pr ;;
19
+ *) exit 0 ;;
20
+ esac
21
+
22
+ if grep -q "<!-- approved:" "$FILE_PATH" 2>/dev/null; then
23
+ exit 0
24
+ fi
25
+
26
+ ACTIVITY="$(cd "$PLUGIN_DIR/../../.." && pwd)/.claude/scripts/activity.py"
27
+ set_activity() { [ -x "$ACTIVITY" ] && python3 "$ACTIVITY" set "$1" "$2" 2>/dev/null || true; }
28
+ clear_activity() { [ -x "$ACTIVITY" ] && python3 "$ACTIVITY" clear 2>/dev/null || true; }
29
+
30
+ FAILURES=()
31
+ for sensor in "$PLUGIN_DIR"/sensors/${PHASE}-*.md; do
32
+ [ -f "$sensor" ] || continue
33
+ sname="$(basename "$sensor" .md)"
34
+ set_activity sensor "$sname"
35
+ if ! python3 "$PLUGIN_DIR/scripts/sensor-runner.py" \
36
+ --sensor "$sensor" \
37
+ --artifact "$FILE_PATH" >&2; then
38
+ FAILURES+=("$sname")
39
+ fi
40
+ clear_activity
41
+ done
42
+
43
+ if [ ${#FAILURES[@]} -gt 0 ]; then
44
+ echo "[hook] ${PHASE} sensor failures: ${FAILURES[*]}" >&2
45
+ exit 2
46
+ fi
47
+
48
+ FEATURE_ID="$(basename "$FILE_PATH" .md)"
49
+ MARKERS_DIR="$PLUGIN_DIR/outputs/.markers"
50
+ mkdir -p "$MARKERS_DIR"
51
+ NOW="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
52
+
53
+ if [ ! -f "$MARKERS_DIR/${FEATURE_ID}.${PHASE}-validate.start" ]; then
54
+ if [ -f "$MARKERS_DIR/${FEATURE_ID}.${PHASE}-generate.start" ]; then
55
+ printf '{"timestamp":"%s"}\n' "$NOW" > "$MARKERS_DIR/${FEATURE_ID}.${PHASE}-generate.end"
56
+ printf '{"timestamp":"%s","session_id":"%s"}\n' "$NOW" "${CLAUDE_SESSION_ID:-}" > "$MARKERS_DIR/${FEATURE_ID}.${PHASE}-validate.start"
57
+ fi
58
+ fi
59
+
60
+ exit 0
@@ -3,7 +3,7 @@
3
3
  Type: deterministic (via project-specific tooling)
4
4
  Mode: hard gate
5
5
 
6
- Run lint and format checks for the area being touched.
6
+ Run lint and format checks for area being touched.
7
7
 
8
8
  ## Backend (Java/Kotlin)
9
9
 
@@ -11,7 +11,7 @@ Detect via build file:
11
11
  - Maven: `mvn -q checkstyle:check` or `mvn -q spotless:check` if configured
12
12
  - Gradle: `./gradlew detekt` or `./gradlew checkstyleMain`
13
13
 
14
- If no linter is configured, skip and emit a warning.
14
+ If no linter configured, skip and emit warning.
15
15
 
16
16
  ## Web (Vue/JS)
17
17
 
@@ -30,8 +30,8 @@ If no linter is configured, skip and emit a warning.
30
30
 
31
31
  ## On failure
32
32
 
33
- Block. Surface the linter output. Agent fixes and re-runs.
33
+ Block. Surface linter output. Agent fixes and re-runs.
34
34
 
35
35
  ## On warning (no linter configured)
36
36
 
37
- Note in the output, do not block. Suggest adding the linter to the repo.
37
+ Note in output, do not block. Suggest adding linter to repo.
@@ -0,0 +1,46 @@
1
+ # Sensor: Dev Structure
2
+
3
+ Type: deterministic
4
+ Mode: hard gate
5
+
6
+ Validates dev summary doc at `outputs/dev/{feature_id}.md`.
7
+
8
+ ## Required sections
9
+
10
+ - Summary
11
+ - Files changed
12
+ - Commits
13
+ - Sensors
14
+ - Blockers
15
+
16
+ ## Forbidden tokens
17
+
18
+ - lorem
19
+ - TODO without ticket reference
20
+ - placeholder
21
+ - XXX
22
+ - FIXME without ticket reference
23
+
24
+ ## Markdown rules
25
+
26
+ - exactly 1 H1 heading
27
+ - no em-dash
28
+ - no ASCII box-drawing
29
+
30
+ ## Required metadata
31
+
32
+ Header must declare:
33
+ - Source plan (path to `outputs/plan/{feature_id}.md`)
34
+ - Branch
35
+ - Area (backend | web | mobile | devops)
36
+ - Date
37
+
38
+ ## Content rules
39
+
40
+ - Files changed must list at least 1 real file path (not placeholder).
41
+ - Commits section must list at least 1 short SHA (7+ hex chars).
42
+ - Sensors section must report `code-conventions` and `test-coverage` outcomes (ok | failed).
43
+
44
+ ## On failure
45
+
46
+ Block publish. Return missing sections and rule violations. Agent regenerates failed parts only.
@@ -0,0 +1,49 @@
1
+ # Sensor: PR Structure
2
+
3
+ Type: deterministic
4
+ Mode: hard gate
5
+
6
+ Validates PR record at `outputs/pr/{feature_id}.md`.
7
+
8
+ ## Required sections
9
+
10
+ - URL
11
+ - Title
12
+ - Draft
13
+ - Summary
14
+ - Test plan
15
+ - Refs
16
+
17
+ ## Forbidden tokens
18
+
19
+ - lorem
20
+ - placeholder
21
+ - TBD
22
+
23
+ ## Markdown rules
24
+
25
+ - exactly 1 H1 heading
26
+ - no em-dash
27
+ - no ASCII box-drawing
28
+
29
+ ## Required metadata
30
+
31
+ Header must declare:
32
+ - Source plan (path to `outputs/plan/{feature_id}.md`)
33
+ - Source dev (path to `outputs/dev/{feature_id}.md`)
34
+ - Branch
35
+ - Date
36
+
37
+ ## Content rules
38
+
39
+ - URL must match `https://github.com/{owner}/{repo}/pull/{number}` shape.
40
+ - Title must start with Conventional Commits prefix (`feat`, `fix`, `chore`, `refactor`, `docs`, `test`, `perf`, `build`, `ci`, `style`, `revert`) followed by optional scope and `:`.
41
+ - Title length <= 70 chars.
42
+ - Draft must be `yes` or `no`.
43
+ - Summary must have at least 1 bullet.
44
+ - Test plan must be markdown checklist with at least 1 item.
45
+ - Refs section must reference both source plan and source dev paths.
46
+
47
+ ## On failure
48
+
49
+ Block publish. Return missing sections and rule violations.
@@ -3,13 +3,13 @@
3
3
  Type: heuristic
4
4
  Mode: hard gate
5
5
 
6
- Every feature or bugfix must include tests for the changed code.
6
+ Every feature or bugfix must include tests for changed code.
7
7
 
8
8
  ## Check
9
9
 
10
- For each changed source file in the dev commit set, look for:
11
- - a corresponding test file (e.g., `Foo.java` -> `FooTest.java`, `bar.ts` -> `bar.test.ts`)
12
- - OR a test file modified in the same commit that exercises the change
10
+ For each changed source file in dev commit set, look for:
11
+ - corresponding test file (e.g., `Foo.java` -> `FooTest.java`, `bar.ts` -> `bar.test.ts`)
12
+ - OR test file modified in same commit exercising the change
13
13
 
14
14
  Patterns recognized:
15
15
  - `**/test/**`, `**/tests/**`, `**/__tests__/**`, `**/spec/**`, `**/specs/**`
@@ -17,7 +17,7 @@ Patterns recognized:
17
17
 
18
18
  ## Exclusions
19
19
 
20
- The following do not need a test in the same commit:
20
+ Following do not need test in same commit:
21
21
  - README and docs
22
22
  - migration files (V*.sql)
23
23
  - pure config (yaml, json)
@@ -25,4 +25,4 @@ The following do not need a test in the same commit:
25
25
 
26
26
  ## On failure
27
27
 
28
- Block. List the source files without tests. Agent adds the missing tests.
28
+ Block. List source files without tests. Agent adds missing tests.
@@ -0,0 +1,46 @@
1
+ # Sensor: Test Structure
2
+
3
+ Type: deterministic
4
+ Mode: hard gate
5
+
6
+ Validates test report at `outputs/test/{feature_id}.md`.
7
+
8
+ ## Required sections
9
+
10
+ - Command
11
+ - Result
12
+ - Counts
13
+ - Failures
14
+ - Duration
15
+
16
+ ## Forbidden tokens
17
+
18
+ - lorem
19
+ - placeholder
20
+ - TBD
21
+
22
+ ## Markdown rules
23
+
24
+ - exactly 1 H1 heading
25
+ - no em-dash
26
+ - no ASCII box-drawing
27
+
28
+ ## Required metadata
29
+
30
+ Header must declare:
31
+ - Source dev (path to `outputs/dev/{feature_id}.md`)
32
+ - Framework (maven | gradle | npm | pytest | other)
33
+ - Date
34
+
35
+ ## Content rules
36
+
37
+ - Command must be real shell command (not placeholder).
38
+ - Result must be `pass` or `fail`.
39
+ - Counts must include numeric `passed` and `failed` values.
40
+ - If Result is `fail`, Failures section must list at least 1 failing test name.
41
+ - If Result is `pass`, Failures section must be `none`.
42
+ - Duration must include unit (s | ms | m).
43
+
44
+ ## On failure
45
+
46
+ Block publish. Return missing sections and rule violations.
@@ -6,11 +6,11 @@ user_invocable: false
6
6
 
7
7
  Backend conventions, team default.
8
8
 
9
- Project override: if `{repo}/.claude/conventions/backend.md` exists, it overrides any rule here. See guides/conventions-override.md.
9
+ Project override: if `{repo}/.claude/conventions/backend.md` exists, overrides any rule here. See guides/conventions-override.md.
10
10
 
11
11
  ## Defaults
12
12
 
13
- These are illustrative defaults for a JVM-leaning backend. Override per repo via `.claude/conventions/backend.md`.
13
+ Illustrative defaults for JVM-leaning backend. Override per repo via `.claude/conventions/backend.md`.
14
14
 
15
15
  Stack:
16
16
  - Java or Kotlin (check pom.xml or build.gradle.kts)
@@ -20,7 +20,7 @@ Stack:
20
20
  - Package prefix: match repo convention
21
21
 
22
22
  Persistence:
23
- - Custom JDBC AbstractRepository + SQL templates. Avoid JPA except where the repo already uses it.
23
+ - Custom JDBC AbstractRepository + SQL templates. Avoid JPA except where repo already uses it.
24
24
  - Migrations via Flyway, naming `V{YYYYMMDD}__{description}.sql`.
25
25
 
26
26
  Mapping:
@@ -37,7 +37,7 @@ Null handling:
37
37
 
38
38
  Streams:
39
39
  - Fluent: `.stream().filter(...).findAny().orElseThrow(...)`.
40
- - Avoid stream-of-stream when a guard would do.
40
+ - Avoid stream-of-stream when guard would do.
41
41
 
42
42
  Transactions:
43
43
  - `@Transactional` on service methods, not repositories.
@@ -46,12 +46,12 @@ Tests:
46
46
  - JUnit 4 + Mockito legacy; JUnit 5 + Mockito for newer.
47
47
  - `@RunWith(MockitoJUnitRunner.class)` (JUnit 4) or `@ExtendWith(MockitoExtension.class)` (JUnit 5).
48
48
  - Naming: `givenX_WhenY_ShouldZ` or `shouldDoSomethingWhenCondition`.
49
- - Cover positive, negative, and edge cases.
49
+ - Cover positive, negative, edge cases.
50
50
  - `verify()` with `never()`, `times()`, arg matchers.
51
51
 
52
52
  ## Before writing code
53
53
 
54
- Read at least 3 similar files in the target repo to confirm:
54
+ Read at least 3 similar files in target repo to confirm:
55
55
  - framework version
56
56
  - build tool
57
57
  - package layout
@@ -71,10 +71,10 @@ Never assume. Stack varies per repo.
71
71
 
72
72
  ## Mark gaps
73
73
 
74
- If you cannot find a pattern in the repo, do not invent it:
74
+ If you cannot find pattern in repo, do not invent:
75
75
 
76
76
  ```java
77
77
  // TBD - verify with tech lead: {what you searched, what is missing}
78
78
  ```
79
79
 
80
- Read actual code first. A TODO with context beats fabricated code.
80
+ Read actual code first. TODO with context beats fabricated code.
@@ -6,7 +6,7 @@ user_invocable: false
6
6
 
7
7
  DevOps conventions, team default.
8
8
 
9
- Project override: if `{repo}/.claude/conventions/devops.md` exists, it overrides any rule here. See guides/conventions-override.md.
9
+ Project override: if `{repo}/.claude/conventions/devops.md` exists, overrides any rule here. See guides/conventions-override.md.
10
10
 
11
11
  ## Defaults
12
12
 
@@ -32,12 +32,12 @@ Observability:
32
32
  - Log structure: JSON, with `trace_id`, `service`, `level`, `msg`.
33
33
 
34
34
  Secrets:
35
- - Never commit secrets. Use a secret manager.
35
+ - Never commit secrets. Use secret manager.
36
36
  - Pre-commit hook to scan for accidental secrets.
37
37
 
38
38
  ## Before writing code
39
39
 
40
- Read at least 3 similar workflows or terraform modules in the repo. Confirm:
40
+ Read at least 3 similar workflows or terraform modules in repo. Confirm:
41
41
  - runner type (ubuntu-latest, self-hosted)
42
42
  - secret naming convention
43
43
  - environments (dev, staging, prod)