원클릭으로
write-tests
Check SonarCloud coverage and write missing tests for uncovered lines. Use when user wants to improve test coverage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Check SonarCloud coverage and write missing tests for uncovered lines. Use when user wants to improve test coverage.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Run analyzer + tests sequentially via make check. Full pre-commit validation.
Create a git commit following project conventions. Checks docs. Pre-commit hook handles analyzer + tests. Use when user says "commit" or "commit and push".
Check test coverage via SonarCloud API. Shows overall, new code, and per-file coverage.
Look up a section of docs/ARCHITECTURE.md without reading the whole file. Given a task description OR a § identifier (numeric like "3.6", "§11" or header fragment like "Security", "Tags", "Transfer Queue"), returns the relevant ARCHITECTURE.md section(s) verbatim. Executes Grep + Read itself in a single invocation — does not ask the user to run anything. Trigger phrases: "/doc <anything>", "docs on X", "architecture of X", "find the ARCHITECTURE § about X". Use when you need to consult docs/ARCHITECTURE.md for a specific topic instead of reading the full 3000-line file.
Map the blast radius of changing a Dart file — find importers (call sites) and the paired test file. Use when user says "what uses X", "who imports X", "impact of X", "find callers of X", or invokes /find-impact with a path.
Fetch GitHub security alerts (Dependabot, code scanning, secret scanning) and fix them. Use when user wants to resolve security issues.
| name | write-tests |
| description | Check SonarCloud coverage and write missing tests for uncovered lines. Use when user wants to improve test coverage. |
Per-file coverage (worst files first):
curl -s "https://sonarcloud.io/api/measures/component_tree?component=Llloooggg_LetsFLUTssh&metricKeys=uncovered_lines,lines_to_cover,coverage&strategy=leaves&ps=50&s=metric&metricSort=uncovered_lines&asc=false" | python3 -c "
import json, sys
d = json.load(sys.stdin)
print(f\"{'File':<60} {'Coverage':>8} {'Uncovered':>9} {'Total':>5}\")
print('-' * 85)
for c in d.get('components', []):
m = {x['metric']: x.get('value','?') for x in c.get('measures',[])}
name = c['path']
print(f\"{name:<60} {m.get('coverage','?'):>7}% {m.get('uncovered_lines','?'):>9} {m.get('lines_to_cover','?'):>5}\")
"
New code coverage:
curl -s "https://sonarcloud.io/api/measures/component?component=Llloooggg_LetsFLUTssh&metricKeys=new_coverage,new_uncovered_lines,new_lines_to_cover"
If $ARGUMENTS contains a file path, focus on that file only.
For each target file, fetch exact uncovered lines:
curl -s "https://sonarcloud.io/api/sources/show?component=Llloooggg_LetsFLUTssh:FILEPATH&from=1&to=9999" | python3 -c "
import json, sys
d = json.load(sys.stdin)
for line in d.get('sources', []):
if line.get('lineHits', None) == 0:
print(f\" L{line['line']}: {line['code'][:100]}\")
"
For each file to cover:
test/ mirror of lib/ path (e.g., lib/core/ssh.dart → test/core/ssh_test.dart)Follow AGENTS.md "Testing Methodology" — it covers the three hard-to-remember invariants:
expect that reaches itWhen in doubt re-read those sections in AGENTS.md verbatim; they are not paraphrased here on purpose.
Skill-specific additions:
/find-impact <source_path> to see what else the behavior surfaces in, so the new test covers the real contract, not just the single call site_extra_test.dart'should reject empty host with InvalidHostError', not 'test1' or 'covers line 42')group() blocks matching the class/function being testedRun tests and check coverage:
make test
Then compare with SonarCloud numbers. Note: local lcov.info may lag behind SonarCloud — for authoritative numbers, push and wait for CI, or use the API after CI completes.