Skip to content

kazukinagata/shinkoku / skills/e-tax

This skill should be used when the user wants to file their tax return electronically via the 確定申告書等作成コーナー (NTA Tax Return Preparation Corner) using Claude in Chrome, Antigravity Browser Sub-Agent, or Playwright CLI (fallback). It guides the browser-based input of calculated tax data. Trigger phrases include: "e-Tax提出", "電子申告", "e-Taxで申告", "作成コーナーに入力", "確定申告書等作成コーナー", "作成コーナー", "申告書を提出".

FileKindSize
SKILL.mdskill md64.2 KB
research/00-screen-flow-summary.mdmarkdown6.4 KB
research/01-CC-AA-010-提出方法の選択.mdmarkdown2.4 KB
research/02-CC-AE-090-作成する申告書等の選択.mdmarkdown1.9 KB
research/03-CC-AE-600-マイナポータル連携の選択.mdmarkdown1.2 KB
research/04-CC-AA-024-e-Tax事前確認.mdmarkdown842 B
research/05-CC-AA-440-QRコード認証.mdmarkdown1.5 KB
research/06-kessan-aa0200-決算書一般用の入力.mdmarkdown6.9 KB
research/07-kessan-aa0201-売上仕入金額の入力.mdmarkdown3.4 KB
research/08-kessan-aa0100-青色申告特別控除の入力.mdmarkdown3.9 KB
research/09-kessan-taisyaku-貸借対照表の入力.mdmarkdown4.9 KB
research/10-kessan-所得金額の確認.mdmarkdown1.4 KB
research/11-kessan-ac0500-住所氏名等の入力.mdmarkdown4.3 KB
research/12-kessan-print-印刷.mdmarkdown2.0 KB
research/13-kessan-ac0600-データ保存等.mdmarkdown2.9 KB
research/14-kessan-expense-detail-pages.mdmarkdown8.8 KB
research/30-shotoku-SS-AA-010a-申告する所得の選択等.mdmarkdown3.2 KB
research/31-shotoku-SS-CA-010-給与所得の源泉徴収票の入力.mdmarkdown6.9 KB
research/32-shotoku-SS-AA-050-収入所得の入力.mdmarkdown1.1 KB
research/33-shotoku-SS-AA-070a-控除の入力1.mdmarkdown1.5 KB
research/34-shotoku-SS-AA-080-控除の入力2.mdmarkdown2.2 KB
research/35-shotoku-SS-AA-090-計算結果の確認.mdmarkdown2.9 KB
research/36-shotoku-SS-AC-010a-納付方法等の入力.mdmarkdown1.6 KB
research/37-shotoku-SS-AC-020a-財産債務住民税.mdmarkdown1.9 KB
research/38-shotoku-SS-AC-030-基本情報の入力.mdmarkdown3.5 KB
research/39-shotoku-SS-AC-040-マイナンバーの入力.mdmarkdown1.1 KB
research/40-shotoku-SS-AE-010-申告書等の印刷.mdmarkdown793 B
research/41-shotoku-SS-AE-110c-印刷後の作業案内.mdmarkdown1.9 KB
research/50-shouhi-ac0100-条件判定等.mdmarkdown2.4 KB
research/51-shouhi-ac0250-所得区分の選択.mdmarkdown1.0 KB
research/52-shouhi-2wari-売上入力.mdmarkdown2.8 KB
research/53-shouhi-2wari-計算結果.mdmarkdown1.5 KB
research/54-shouhi-kani-route-summary.mdmarkdown1.3 KB
research/55-shouhi-ippan-route-summary.mdmarkdown8.2 KB
scripts/etax-stealth.jsscript7.3 KB

scripts/etax-stealth.js

View on GitHub
// etax-stealth.js
// @playwright/mcp の --init-script オプションで読み込むステルススクリプト。
// ページ読み込み前に実行され、確定申告書等作成コーナーの OS 検出・bot 検出を回避する。
//
// 使用方法:
//   npx @playwright/mcp@latest --init-script skills/e-tax/scripts/etax-stealth.js
//
// 回避対象:
//   1. termnalInfomationCheckOS_myNumberLinkage() による OS 検出
//      - navigator.platform / navigator.userAgent で Linux を非対応 OS として弾く
//   2. Playwright の自動操作検出(navigator.webdriver, グローバル変数)
//   3. HeadlessChrome 判定(chrome.runtime の有無)

(() => {
  "use strict";

  // ── 1. navigator.platform の偽装 ──
  // 確定申告書等作成コーナーの termnalInfomationCheckOS_myNumberLinkage() は
  // navigator.platform を検査し、'Win32' / 'MacIntel' 等でなければ isTransition=false にする
  Object.defineProperty(navigator, "platform", {
    get: () => "Win32",
    configurable: true,
  });

  // ── 2. navigator.userAgent の偽装 ──
  // Windows 11 + Chrome 131 の UA 文字列に偽装
  const WINDOWS_CHROME_UA =
    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 " +
    "(KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";

  Object.defineProperty(navigator, "userAgent", {
    get: () => WINDOWS_CHROME_UA,
    configurable: true,
  });

  // ── 3. navigator.userAgentData の偽装(Chrome 90+ Client Hints) ──
  // 一部のサイトは userAgentData.platform も検査する
  if (navigator.userAgentData) {
    Object.defineProperty(navigator, "userAgentData", {
      get: () => ({
        brands: [
          { brand: "Google Chrome", version: "131" },
          { brand: "Chromium", version: "131" },
          { brand: "Not_A Brand", version: "24" },
        ],
        mobile: false,
        platform: "Windows",
        getHighEntropyValues: () =>
          Promise.resolve({
            architecture: "x86",
            bitness: "64",
            brands: [
              { brand: "Google Chrome", version: "131.0.0.0" },
              { brand: "Chromium", version: "131.0.0.0" },
              { brand: "Not_A Brand", version: "24.0.0.0" },
            ],
            fullVersionList: [
              { brand: "Google Chrome", version: "131.0.0.0" },
              { brand: "Chromium", version: "131.0.0.0" },
              { brand: "Not_A Brand", version: "24.0.0.0" },
            ],
            mobile: false,
            model: "",
            platform: "Windows",
            platformVersion: "15.0.0",
            uaFullVersion: "131.0.0.0",
          }),
        toJSON: () => ({
          brands: [
            { brand: "Google Chrome", version: "131" },
            { brand: "Chromium", version: "131" },
            { brand: "Not_A Brand", version: "24" },
          ],
          mobile: false,
          platform: "Windows",
        }),
      }),
      configurable: true,
    });
  }

  // ── 4. navigator.webdriver の偽装 ──
  // Playwright は navigator.webdriver = true を設定する。
  // 確定申告書等作成コーナーが直接検査するかは不明だが、安全のため false に偽装する。
  Object.defineProperty(navigator, "webdriver", {
    get: () => false,
    configurable: true,
  });

  // ── 5. Playwright グローバル変数の削除 ──
  // Playwright が注入するグローバル変数を削除して検出を回避する
  const playwrightGlobals = [
    "__playwright",
    "__pw_manual",
    "__PW_inspect",
    "__playwright__binding__",
  ];
  for (const key of playwrightGlobals) {
    try {
      delete window[key];
    } catch {
      // configurable でない場合は無視
    }
  }

  // ── 6. chrome.runtime のスタブ化 ──
  // HeadlessChrome では chrome.runtime が存在しない場合がある。
  // 通常の Chrome 拡張環境をシミュレートする。
  if (!window.chrome) {
    window.chrome = {};
  }
  if (!window.chrome.runtime) {
    window.chrome.runtime = {
      connect: () => {},
      sendMessage: () => {},
      id: undefined,
    };
  }

  // ── 7. navigator.plugins の偽装 ──
  // Headless Chrome は plugins が空になる場合がある
  Object.defineProperty(navigator, "plugins", {
    get: () => {
      const plugins = [
        { name: "PDF Viewer", filename: "internal-pdf-viewer" },
        {
          name: "Chrome PDF Viewer",
          filename: "internal-pdf-viewer",
        },
        {
          name: "Chromium PDF Viewer",
          filename: "internal-pdf-viewer",
        },
        {
          name: "Microsoft Edge PDF Viewer",
          filename: "internal-pdf-viewer",
        },
        {
          name: "WebKit built-in PDF",
          filename: "internal-pdf-viewer",
        },
      ];
      plugins.length = plugins.length;
      return plugins;
    },
    configurable: true,
  });

  // ── 8. navigator.languages の偽装 ──
  // 日本語環境の Chrome に合わせる
  Object.defineProperty(navigator, "languages", {
    get: () => ["ja", "en-US", "en"],
    configurable: true,
  });

  // ── 9. サーバーベイク関数のパッチ ──
  // 確定申告書等作成コーナーのサーバーは HTTP リクエストの User-Agent / sec-ch-ua-platform
  // ヘッダから OS を判定し、レスポンス内の getClientOS() 関数に
  // const os = "Linux" のようにハードコードする(サーバーサイドレンダリング)。
  // addInitScript による navigator プロパティ偽装ではこのベイク値は変わらないため、
  // ページスクリプト読み込み後に関数そのものを上書きする。
  //
  // パッチ対象:
  //   getClientOS()               — OS 文字列を返す("Linux" → "Windows" に変更)
  //   getClientOSVersionAsync()   — OS バージョンを返す(→ "Windows 11")
  //   isRecommendedOsAsEtaxAsync() — 推奨 OS 判定(→ true)
  //   isRecommendedBrowserAsEtaxAsync() — 推奨ブラウザ判定(→ "OK")
  //
  // 影響箇所:
  //   CC-AA-010: doSubmitCSW0100() → getClientOSVersionAsync() → termnalInfomationCheckOS_myNumberLinkage()
  //   CC-AA-440: displayQrcode() → getClientOS() で oStUseType を決定(Win='3', Mac='4')

  const _patchServerFunctions = () => {
    if (typeof window.getClientOS === "function") {
      window.getClientOS = function () {
        return "Windows";
      };
    }
    if (typeof window.getClientOSVersionAsync === "function") {
      window.getClientOSVersionAsync = async function () {
        return "Windows 11";
      };
    }
    if (typeof window.isRecommendedOsAsEtaxAsync === "function") {
      window.isRecommendedOsAsEtaxAsync = async function () {
        return true;
      };
    }
    if (typeof window.isRecommendedBrowserAsEtaxAsync === "function") {
      window.isRecommendedBrowserAsEtaxAsync = async function () {
        return "OK";
      };
    }
  };

  // DOMContentLoaded: インラインスクリプトが実行された後、ユーザー操作の前
  if (document.readyState === "loading") {
    document.addEventListener("DOMContentLoaded", _patchServerFunctions);
  } else {
    // すでに DOM 構築済みの場合(reload 等)
    _patchServerFunctions();
  }

  // load イベントでの再パッチ(安全策)
  window.addEventListener("load", _patchServerFunctions);
})();
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 323kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 323kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 323kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall