Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "arn-code",
"source": "./plugins/arn-code",
"description": "Artifact-driven pipeline — spec, plan, implement, review, ship, plus batch CVE scan & fix. Three ceremony tiers scale process to scope, from a one-file fix to a large refactor. 37 skills, 18 agents.",
"version": "3.8.0",
"version": "3.9.0",
"author": {
"name": "Fryderyk Benigni",
"url": "https://github.com/fredcallagan"
Expand Down
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
# `chmod +x` semantics. Required for the ensure-config cache-check.sh
# scripts that run on user machines.
plugins/*/skills/*-ensure-config/scripts/*.sh text eol=lf
plugins/*/hooks/*.sh text eol=lf
plugins/*/skills/*/scripts/*.sh text eol=lf
tests/**/*.sh text eol=lf
48 changes: 48 additions & 0 deletions .github/workflows/arn-code-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: arn-code CI

on:
pull_request:
paths:
- "plugins/arn-code/**"
- ".claude-plugin/marketplace.json"
- "scripts/ci/**"
- "tests/arn-code/**"
- ".github/workflows/arn-code-ci.yml"
push:
branches: [main]

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Static checks (frontmatter, references, presets, hooks)
run: python3 scripts/ci/validate-arn-code.py

scripts:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Shell syntax
run: |
for f in plugins/arn-code/hooks/*.sh plugins/arn-code/skills/*/scripts/*.sh tests/arn-code/*.sh; do
bash -n "$f" || exit 1
done
- name: Tool versions
run: |
bash --version | head -1
command -v python3 && python3 --version || echo 'no working python3'
command -v python && python --version || echo 'no python'
command -v jq || echo 'no jq'
- name: Script and hook tests (system bash; 3.2 on macOS; Git Bash on Windows)
run: bash tests/arn-code/run-tests.sh
12 changes: 12 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,18 @@ When the field is missing, `arn-code-ensure-config` (Layer 2c) prompts the user

The analyzer is technology-agnostic: it does not pattern-match against a fixed list of tool names. Instead it scans evidence categories (dependency manifests, tool config files, script entry points, pre-commit-style runners) and recognizes whatever tooling the project actually uses. Linters and formatters are listed separately in `linting.md` because they have different semantics — formatters typically have both a check mode and a write mode, and the gate must invoke the check mode (`Discovered check command`) so files are never silently rewritten.

The analyzer also returns `<code-patterns-dir>/tooling.json`: the same commands in machine-readable form (per service: `path`, `extensions`, `lintFiles`, `formatCheckFiles`, `check`, `testFiles`, `test`, `owner`). The plugin hooks read it. Hooks run its commands only after the user approves them (`hooks/tooling-approve.sh` stores a hash in `.arness/tooling.local.sha`); any edit to the file needs a new approval. Entries with `owner: project` are skipped because the project already runs those checks itself.

## Plugin Hooks (arn-code)

`plugins/arn-code/hooks/hooks.json` registers hooks that are off by default (on with `- **Hooks:** on` in `## Arness` or `ARNESS_HOOKS=on`; `ARNESS_HOOKS=off` always wins), act only in projects with a `## Arness` section, and fail open when a tool is missing:

- `SessionStart` → `session-start.sh`: config cache status line; after compaction, a pointer to the most recent plan's `PROGRESS_TRACKER.json`.
- `PreToolUse` (Bash) → `pre-bash.sh`: blocks force-push; scans what a `git commit` will include for private keys, access tokens, key files and `.env`.
- `PostToolUse` (Edit/Write/MultiEdit) → `post-edit-lint.sh`: advisory file-level lint from an approved `tooling.json`, when `Linting: enabled`.

Hooks must stay language-agnostic: they never name a language or tool; every project-specific command comes from `tooling.json`. Switches: `ARNESS_HOOKS=off`, `ARNESS_HOOKS_DISABLE=session,force-push,secrets,lint`. Tests: `bash tests/arn-code/run-tests.sh`; static checks: `python3 scripts/ci/validate-arn-code.py` (both run in `.github/workflows/arn-code-ci.yml`).

## Security Scanning Configuration

Each project's `## Arness` block carries two fields that together configure CVE discovery, triage, and resolution:
Expand Down
40 changes: 40 additions & 0 deletions plugins/arn-code/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,46 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)

Release tags follow Anthropic's official plugin tag convention: `arn-code--v{version}` (double-hyphen `--v`), produced by `claude plugin tag --push` from inside `plugins/arn-code/`.

## [3.9.0] — 2026-10-25

### Fixed
- **ensure-config cache never hit.** The checker and the writer hashed the `## Arness` section differently (trailing newline), so every run was a cache miss and the 3.7.0 fast path never worked. Both now share one library (`scripts/lib.sh`); Layer 4 writes the cache with `scripts/cache-write.sh` instead of hand-computed hashes. Cache schema bumped to 2 (one silent miss after upgrade).
- **Plugin version was read from `plugin.json`,** which has no `version` field. New `scripts/plugin-version.sh` resolves it from the marketplace entry or the installed cache path. Used by init, ensure-config, report, doctor and template versioning.
- **Version check skipped for marketplace installs.** The cache looked for `marketplace.json` in the wrong place; it now also reads the version from the install path, so upgrades invalidate the cache.
- **GitHub label check** listed only 30 labels, broke when a repo had extra `arness-*` labels, and printed a garbled count on zero matches. It now checks each expected label by name (`scripts/labels-missing.sh`) and does not fail the cache when `gh` is offline.
- **Cache check portability:** works from a subdirectory, with Windows line endings, and without `jq`.
- **Simplify revert could discard uncommitted work.** A failed finding was reverted with `git apply -R` of the whole working-tree diff. The applier now snapshots only the files it touches (`arn-code-simplify/scripts/snapshot.sh`) and restores only those. Applies to `arn-code-simplify` and `arn-code-batch-simplify`.
- **`save_plan.sh`:** no longer picks the newest plan from other projects in `~/.claude/plans/`; rejects project names with path characters; refuses to guess between several `PLAN_PREVIEW` files; will not overwrite a different `SOURCE_PLAN.md` without `--force`.
- 38 references used repo-relative `plugins/arn-code/...` paths that broke in user projects; they now use `${CLAUDE_PLUGIN_ROOT}`.
- `arn-code-batch-cve-scan` description exceeded the 1,024-character limit; both CVE skills gained a `version`.
- Simplify skills pointed to a "Dispatch convention" section in the wrong file.
- The no-tracker CVE fallback told users to pass `--resolution-plan`, which `arn-code-batch-cve-fix` does not accept; it now says `--proposal-path`.
- **`arn-code-help` could not see any files** in recent Claude Code versions: it allowed only Read, Glob and Grep, and the main session no longer has Glob or Grep. It now falls back to read-only shell commands; `arn-code-review-plan` names the same fallback.
- `arn-code-codebase-analyzer` is read-only, but its text told it to write files. It now returns `linting.md`, `tooling.json` and `security-scanning.md` content and the caller writes them.

### Added
- **Plugin hooks** (`hooks/hooks.json`), **off by default**, active only in Arness projects and failing open. Turn them on per project with `- **Hooks:** on` in `## Arness` (`arn-code-init` asks), or per user with `ARNESS_HOOKS=on`; `ARNESS_HOOKS=off` always wins:
- `SessionStart`: config status line; after compaction, a pointer to the plan in progress.
- `PreToolUse` on Bash: blocks force-push (`--force-with-lease` allowed); blocks commits containing private keys, access tokens, key files or `.env` (`arness:allow-secret` marks a false positive).
- `PostToolUse` on edits: advisory file-level lint and format checks from the project's own commands, when `Linting: enabled`.
- Switches: `ARNESS_HOOKS=off`, `ARNESS_HOOKS_DISABLE=session,force-push,secrets,lint`.
- **`tooling.json`:** machine-readable lint, format and test commands returned by the codebase analyzer next to `linting.md`. Hooks run its commands only after the user approves them (`hooks/tooling-approve.sh`); an edited file needs new approval. Language-agnostic: every command comes from the project.
- `.arness/.*-tmp/` is added to the project `.gitignore` for scratch directories.
- CI (`.github/workflows/arn-code-ci.yml`): static checks (`scripts/ci/validate-arn-code.py`) and script and hook tests (`tests/arn-code/run-tests.sh`) on Linux, macOS and Windows (Git Bash).
- **Windows:** hooks and scripts accept `C:\` paths from Claude Code, drop carriage returns from tool output, and use `python` when `python3` is missing or is the Microsoft Store stub. Without `jq` or Python, hooks read their input with `awk`, so the force-push and secrets checks still work (lint needs Python and is skipped). Hooks also compare physical paths, so a symlinked project folder (such as the macOS temp folder) works.

### Changed
- Inner skills no longer repeat the trigger phrases of the entry points (`arn-shipping`, `arn-assessing`, `arn-reviewing-pr`, `arn-implementing`, `arn-planning`), so natural requests route through the entry points. Inner skills still trigger by name.
- `arn-code-ensure-config` is hidden from the `/` menu (`user-invocable: false`). `arn-code-batch-cve-fix` runs only when typed (`disable-model-invocation: true`). Skills that take arguments show an `argument-hint`.
- Long agent descriptions trimmed to under 800 characters; they are loaded into every session.
- Docs say "Agent tool" instead of "Task tool" for subagent dispatch.

### Compatibility
No breaking changes. After upgrading: one silent ensure-config cache miss (schema 2), then real cache hits. Hooks are off until you turn them on, so nothing changes unless you opt in. The lint hook does nothing until `tooling.json` exists and is approved (next `arn-code-init`, or when `Linting` is set to `enabled`).

### Known issues
- arn-spark and arn-infra ship their own copies of the old `cache-check.sh` with the same hashing bug; fixed in their next releases.

## [3.8.0] — 2026-07-06

### Added
Expand Down
11 changes: 11 additions & 0 deletions plugins/arn-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ Structured, artifact-driven development pipeline for Claude Code. Every feature
/plugin install arn-code@arn-marketplace
```

## Hooks

Since 3.9.0 the plugin ships hooks. They are **off until you turn them on**, and they act only in projects with a `## Arness` section in `CLAUDE.md`. Turn them on for a project with `- **Hooks:** on` in the `## Arness` section (`/arn-code-init` asks), or for yourself with `ARNESS_HOOKS=on` (for example in `.claude/settings.local.json` under `env`).

- **Session start:** one status line about the Arness config; after a compaction, a pointer to the plan in progress.
- **Before `git push`:** blocks `--force`, `-f` and `+refspec` (`--force-with-lease` is allowed).
- **Before `git commit`:** blocks commits that contain private keys, access tokens, key files or `.env`. Add `arness:allow-secret` on a line to mark a false positive.
- **After an edit:** when `Linting: enabled`, runs the project's own file-level lint and format checks from `.arness/tooling.json` and reports issues to Claude. Advisory only. The commands run only after you approve them during setup.

`ARNESS_HOOKS=off` turns all hooks off, whatever the project says. Turn some off with `ARNESS_HOOKS_DISABLE=session,force-push,secrets,lint` (for example in `.claude/settings.local.json` under `env`).

## Documentation

Full guide: [docs/plugins/arn-code.md](../../docs/plugins/arn-code.md) · [arness.appsvortex.com](https://arness.appsvortex.com/)
Expand Down
32 changes: 0 additions & 32 deletions plugins/arn-code/agents/arn-code-batch-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,45 +11,13 @@ description: >-
Context: Invoked by arn-code-batch-planning during parallel pre-analysis for a greenfield feature
user: "batch planning"
assistant: (invokes arn-code-batch-analyzer with greenfield feature F-003 context)
<commentary>
Batch planning spawns one batch-analyzer per selected feature in parallel.
Each analyzer reads the feature file, UC documents, and codebase patterns,
then writes a DRAFT_FEATURE_*.md to the specs directory.
</commentary>
</example>

<example>
Context: Invoked by arn-code-batch-planning for a GitHub issue
user: "batch planning"
assistant: (invokes arn-code-batch-analyzer with GitHub issue #42 reference)
<commentary>
For GitHub issues, the analyzer fetches the issue via gh CLI, extracts
title/body/labels/comments, and produces a draft spec with moderate detail.
</commentary>
</example>

<example>
Context: Invoked by arn-code-batch-planning for a Jira issue
user: "batch planning"
assistant: (invokes arn-code-batch-analyzer with Jira issue PROJ-42 reference)
<commentary>
For Jira issues, the analyzer fetches the issue via MCP, extracts
summary/description/acceptance-criteria, and produces a draft spec.
</commentary>
</example>

<example>
Context: Invoked by arn-code-batch-planning for a plain description
user: "batch planning"
assistant: (invokes arn-code-batch-analyzer with a text description)
<commentary>
For plain descriptions, the analyzer produces a basic draft with architect
analysis and placeholder sections that the user will refine during exploration.
</commentary>
</example>

This is a background agent with no user interaction — it runs autonomously
and returns a structured file artifact.
tools: [Read, Glob, Grep, Write, Bash]
model: opus
color: green
Expand Down
9 changes: 0 additions & 9 deletions plugins/arn-code/agents/arn-code-batch-pr-analyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,12 @@ description: >-
Context: Invoked by arn-code-batch-merge after discovering 5 open batch PRs
user: "batch merge"
assistant: (invokes arn-code-batch-pr-analyzer with PR list and CHANGE_RECORD paths)
<commentary>
Batch merge delegates the heavy analysis to this agent to keep the main
session context clean. The agent reads all PR diffs internally and returns
only a distilled summary.
</commentary>
</example>

<example>
Context: Re-invoked after a PR is merged to refresh remaining PR status
user: "batch merge"
assistant: (re-invokes arn-code-batch-pr-analyzer with fewer PRs after one was merged)
<commentary>
After each merge, the agent is re-run with the remaining PRs to refresh
conflict and CI status. Fewer PRs = faster analysis.
</commentary>
</example>
tools: [Read, Glob, Grep, Bash]
model: opus
Expand Down
Loading
Loading