ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 bsamiee

function-hooks

一個 Claude Code 外掛,依照政策拒絕或重寫工具呼叫;啟用觀測時,會把 hook 事件依血緣記錄成資料庫資料列。

bsamiee@bsamiee

bsamiee/Rasm/tree/main/plugins/function-hooks

已翻譯

關於這個 mod

它是 plugins/ 下 Rasm agent harness marketplace 的一部分。外掛會註冊攔截工具呼叫(tool.call)的 hook 模組,並可依政策拒絕或重寫呼叫。啟用觀測後,hook 事件會持久化為資料庫資料列,發現結果依血緣交付。Hook 實作會讀取檔案、寫入檔案、執行子行程、產生子代理,並讀取 HOME 等環境變數。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add bsamiee/Rasm
claude plugin install function-hooks
原文 / README

[RASM]

Rasm is a polyglot monorepo with macOS-first development and portable code and tooling for Linux and Windows.

[01]-[LAYOUT]

Rasm/
├── apps/                     # One directory per app or group of related apps
├── libs/                     # Packages, one directory per language
│   ├── dotnet/
│   ├── python/
│   └── typescript/
├── tests/                    # Shared test support per language and suites outside libs/
├── eng/                      # Repository engineering projects, one directory per language
│   └── dotnet/
├── infra/                    # Pulumi program declaring repository resources
├── tools/
│   ├── ast-grep/             # Outlines, rules, and utilities per language
│   ├── interface/            # Desktop application interfaces, one directory per application
│   ├── nx/                   # Nx plugin inferring a project from each project file
│   └── yak/                  # Script installing a published Rhino plug-in's yak package
├── plugins/                  # Agent harness marketplace, one directory per plugin
├── mise.toml                 # Tool binaries and process environment
├── global.json               # .NET SDK versions
├── nx.json                   # Task graph
├── package.json              # Catalog rows except tool plugins, root Nx targets
├── pnpm-workspace.yaml       # TypeScript workspace globs and dependency catalog
├── pyproject.toml            # Python dependency groups and tool tables
├── Directory.Packages.props  # .NET central package versions
├── Directory.Build.props     # .NET build defaults and project classification by tree position
├── Directory.Build.targets   # .NET items, host package references, and policy targets
├── NuGet.config              # NuGet source and package folder
├── Workspace.slnx            # .NET solution
├── Xcode.xcconfig            # Build settings every Xcode project inherits at project level
├── tsconfig.base.json        # Compiler options every TypeScript project extends
├── tsconfig.json             # Root TypeScript project over files outside every package
├── vitest.config.ts          # Test and coverage options every project config imports
├── vite.config.ts            # Bundling options every UXP build target runs from its project directory
├── biome.json                # TypeScript and JSON formatting and lint
├── pmd.xml                   # Java lint rules
├── sgconfig.yml              # ast-grep rule directories and language parsing
├── .editorconfig             # Editor settings and .NET analyzer severity
├── .swift-format             # Swift lint and format rules
├── .swiftlint.yml            # Swift lint rules swift-format lacks
├── .lldbinit                 # LLDB MCP server start every Xcode scheme's Run loads
├── .yamllint.yaml, .yamlfmt  # YAML lint and format
├── .github/                  # Continuous integration and repository workflows
├── .claude/                  # Agent harness knowledge and settings
├── .mcp.json                 # Agent harness MCP servers
├── .codex/                   # Codex harness settings
├── CLAUDE.md                 # Agent standards, AGENTS.md is its symlink
└── README.md

[02]-[FLOW]

flowchart LR
    subgraph toolchain ["Toolchain"]
        direction TB
        mise_tools["mise.toml [tools], global.json"] --> binaries["Tool binaries"]
        mise_env["mise.toml [env]"] --> processes["Every process"]
        xcode["xcode-select"] --> apple_tools["Xcode toolchain and macOS SDK"]
        brew["Homebrew formula ghidra"] --> ghidra_tool["Ghidra install"]
    end

    subgraph dependencies ["Dependencies"]
        direction TB
        catalog_ts["pnpm-workspace.yaml catalog"] --> lock_ts["pnpm-lock.yaml"]
        catalog_py["pyproject.toml groups"] --> lock_py["uv.lock, .venv/bin on PATH"]
        catalog_net["Directory.Packages.props"] --> restore["rasm:restore"]
        catalog_net --> eng_net["eng/dotnet"] --> upgrade["rasm:upgrade"]
        packages["packages.toml rows"] --> upgrade
        catalog_swift[".xcodeproj package requirements"] --> lock_swift["Package.resolved"]
    end

    subgraph taskgraph ["Task graph"]
        direction TB
        plugins["nx.json plugins"] --> projects["Project per project file: language and host tags, empty targets"]
        target_defaults["nx.json targetDefaults by tag:language:*"] --> bodies["Target body per language"]
        root_nx["package.json nx"] --> root_targets["Root targets rasm:*"]
    end

    subgraph commands ["Commands"]
        direction TB
        lint["nx run rasm:lint"] --> checkers["Every portable checker, one process each over the tree"]
        format_tree["nx run rasm:format"] --> writers["Every portable writer, then dotnet format"]
        check_all["nx run-many -t check"] --> project_check["Build, typecheck, or test per project"]
        check_affected["nx affected -t check"] --> project_check
        ci["ci.yml"] --> setup["setup action"] --> ci_steps["rasm:check, affected check per host runner"]
    end

    toolchain --> dependencies --> taskgraph --> commands

[03]-[TASKS]

  • Targets call one tool, arguments on the command, configuration in the tool's own file
  • nx run rasm:check runs lint and typecheck of root TypeScript files and every Python file
  • nx run <project>:<target> runs one target of one project
  • nx run <project>:install installs a project's Release product into its host
  • nx run <project>:pack builds a Rhino plug-in's yak package under .artifacts/rhino/ with a manifest yak spec derives from its build
  • nx run rasm:upgrade moves catalogs, Swift package locks, tool binaries, and application packages to their newest builds
  • nx run rasm:clean clears .NET build outputs and all tool cache folders
  • nx run rasm:rewrite -- --filter='^<id>$' <path> applies one rule's fix across a path
  • nx run rasm:outline -- <path> lists a path's declarations, --items selects local, exported, imported, or all items, --view the depth
  • nx run rasm:interface applies each tools/interface/<app>/apply.py, -- <app> one, and prints every outcome as one JSON document
  • Workspace plugin names each project's tags and empty targets by project file, @nx/dotnet and @nx/vitest infer theirs
  • Tools one host supplies join a project's target, root targets hold commands no project owns
  • Inputs name the files a tool reads and its version as runtime, outputs name the files it writes
  • Caches and outputs sit under root .cache/ and .artifacts/, each tool relocated through one setting every run reads, or its skill states why not

[04]-[OWNERS]

| [INDEX] | [CONCERN] | [OWNER] | | :-----: | :----------------------------- | :------------------------------------------------------------------------------------ | | [01] | Tool binary | mise.toml [tools] at latest, prereleases included | | [02] | Process variable | mise.toml [env] | | [03] | SDK version | global.json for .NET, xcode-select for Swift | | [04] | Package version | pnpm-workspace.yaml catalog, pyproject.toml group, Directory.Packages.props row | | [05] | .NET tool package | dotnet dnx <id> on the command | | [06] | Task graph | nx.json, root package.json nx | | [07] | Checker configuration | Tool's own file, pyproject.toml [tool.*] for every Python tool | | [08] | Secret | Doppler, read through doppler run around the command | | [09] | Resource or repository setting | Typed row of the program under infra/, applied by nx run rasm:infra:up | | [10] | Tool with no consumer | Machine setup | | [11] | Application package | packages.toml row beside the script installing it | | [12] | Ghidra install | Homebrew formula ghidra, path named in mise.toml [env] | | [13] | Xcode build setting | Xcode.xcconfig, per-product rows in the .xcodeproj target | | [14] | Swift package version | .xcodeproj package requirement | | [15] | Agent harness plugin | plugins/<name> |

  • Package rows and .editorconfig analyzer rows hold a one-line purpose comment, every other configuration file holds section dividers alone
  • Tool rows name a release where latest resolves a development build
  • Tool consumers are targets, MCP rows, skills, .gitattributes filters, and CLAUDE.md [CLI_TOOLING] rows
  • Facts sit once in their owning file, other files name the owner
  • Mini configs, wrappers, and aliases beside an owner are corrected at the owner

[05]-[QUALITY]

  • .NET: Roslyn analyzers at latest-all, warnings as errors, code style enforced in build
  • Python: ruff, ty, and mypy at zero findings
  • TypeScript: biome check at zero findings, tsc --build under strict options
  • Swift: warnings as errors, strict memory safety, Swift 7 upcoming features, swift-format lint --strict and swiftlint lint at zero findings
  • Java: google-java-format --aosp and pmd check at zero findings
  • Tree: yamllint, yamlfmt -lint, actionlint with shellcheck over workflow run steps, and ast-grep rule families
  • Writers: dotnet format, ruff format, Biome, yamlfmt, google-java-format, swiftlint lint --fix then swift-format per Xcode project
  • Failing checks are fixed in the code or the rule, severity stays as configured

[06]-[STRUCTURE]

  • Apps group by product under apps/<product>/, with a <host>/ folder per host application
  • Libraries group by language under libs/<language>/, with host-bound packages under a <host>/ folder
  • Build and task graph read a project's host from the <host>/ folder on its path
  • Every libs/ package is independently consumable, references siblings through declared dependencies, and points down an acyclic graph
  • Projects under a rhino folder compile against RhinoCommon, RhinoHost token grasshopper adds Grasshopper2
  • Installed Rhino supplies host assemblies at runtime, build output holds none
  • Project files define projects, never project.json
  • Project files are .csproj, package.json with tsconfig.json, pyproject.toml, and .xcodeproj
  • Workspace.slnx lists every project .csproj
  • .xcodeproj basenames name the Nx project, its scheme, and its product
  • Projects hold no src/ directory and no folder with one file, folders group by domain per language
  • Changes replace structure in place, one commit holds change and removal, new structure keeps its predecessor's name
  • Packages, namespaces, routes, contracts, and directories carry no version suffix or v1 folder
  • Schema libraries apply the delta from owning types to the live database, with no migration file or history table
  • Displays, documents, and defaults show imperial units, domain values hold SI quantities converted at the boundary

更多類似作品