@elvis1513/auto-coding-skill 0.2.0 → 1.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.
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env python3
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import json
6
+ import urllib.error
7
+ import urllib.request
8
+
9
+
10
+ class CheckError(RuntimeError):
11
+ pass
12
+
13
+
14
+ def fetch(method: str, url: str, headers: dict[str, str] | None = None) -> tuple[int, str]:
15
+ req = urllib.request.Request(url, headers=headers or {}, method=method)
16
+ try:
17
+ with urllib.request.urlopen(req, timeout=10) as response:
18
+ return response.status, response.read().decode("utf-8", errors="replace")
19
+ except urllib.error.HTTPError as exc:
20
+ return exc.code, exc.read().decode("utf-8", errors="replace")
21
+
22
+
23
+ def cmd_status(args: argparse.Namespace) -> None:
24
+ status, body = fetch("GET", args.url)
25
+ if status != args.expect:
26
+ raise CheckError(f"GET {args.url} expected {args.expect}, got {status}: {body[:400]}")
27
+ print(f"[status] OK: {args.url} -> {status}")
28
+
29
+
30
+ def cmd_text_contains(args: argparse.Namespace) -> None:
31
+ status, body = fetch("GET", args.url)
32
+ if status != args.expect:
33
+ raise CheckError(f"GET {args.url} expected {args.expect}, got {status}: {body[:400]}")
34
+ if args.contains not in body:
35
+ raise CheckError(f"Response from {args.url} does not contain expected text: {args.contains}")
36
+ print(f"[text-contains] OK: {args.url}")
37
+
38
+
39
+ def cmd_json_field(args: argparse.Namespace) -> None:
40
+ status, body = fetch("GET", args.url, headers={"Accept": "application/json"})
41
+ if status != args.expect:
42
+ raise CheckError(f"GET {args.url} expected {args.expect}, got {status}: {body[:400]}")
43
+ try:
44
+ payload = json.loads(body)
45
+ except json.JSONDecodeError as exc:
46
+ raise CheckError(f"Response from {args.url} is not valid JSON: {exc}") from exc
47
+
48
+ current = payload
49
+ for part in args.path.split("."):
50
+ if isinstance(current, dict) and part in current:
51
+ current = current[part]
52
+ continue
53
+ raise CheckError(f"JSON path not found: {args.path}")
54
+
55
+ if str(current) != args.equals:
56
+ raise CheckError(f"JSON field {args.path} expected {args.equals}, got {current}")
57
+ print(f"[json-field] OK: {args.url} {args.path}={current}")
58
+
59
+
60
+ def main() -> int:
61
+ parser = argparse.ArgumentParser(prog="http_checks")
62
+ sub = parser.add_subparsers(dest="cmd", required=True)
63
+
64
+ s = sub.add_parser("status")
65
+ s.add_argument("url")
66
+ s.add_argument("--expect", type=int, default=200)
67
+ s.set_defaults(func=cmd_status)
68
+
69
+ s = sub.add_parser("text-contains")
70
+ s.add_argument("url")
71
+ s.add_argument("--contains", required=True)
72
+ s.add_argument("--expect", type=int, default=200)
73
+ s.set_defaults(func=cmd_text_contains)
74
+
75
+ s = sub.add_parser("json-field")
76
+ s.add_argument("url")
77
+ s.add_argument("--path", required=True)
78
+ s.add_argument("--equals", required=True)
79
+ s.add_argument("--expect", type=int, default=200)
80
+ s.set_defaults(func=cmd_json_field)
81
+
82
+ try:
83
+ args = parser.parse_args()
84
+ args.func(args)
85
+ return 0
86
+ except CheckError as exc:
87
+ print(f"[ERROR] {exc}")
88
+ return 2
89
+
90
+
91
+ if __name__ == "__main__":
92
+ raise SystemExit(main())
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@elvis1513/auto-coding-skill",
3
- "version": "0.2.0",
4
- "description": "CLI installer for auto-coding-skill (Claude Code + Codex CLI).",
3
+ "version": "1.0.0",
4
+ "description": "CLI installer for auto-coding-skill (Claude Code + Codex CLI) with Go fullstack + Jenkins workflow support.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "autocoding": "cli/src/index.js"
@@ -29,6 +29,9 @@
29
29
  "engineering",
30
30
  "workflow",
31
31
  "ci",
32
+ "jenkins",
33
+ "go",
34
+ "monorepo",
32
35
  "docker",
33
36
  "local-testing"
34
37
  ],