From arn-code
Optional customization and upgrade tool. This skill should be used when the user says "initialize arness code", "arness code init", "arn-code-init", "init arness code", "setup arness code", "arness code setup", "set up arness code", "start arness code", "upgrade arness code", "update arness code", "configure arness code for this project", "add arness code to this project", "reconfigure arness code", "review arness config", "customize arness config", "arness settings", or wants to customize Arness configuration, review current settings, or upgrade after a plugin update. Handles both existing codebases (analyzes patterns) and greenfield projects (recommends patterns based on technology choices). Also handles upgrades after plugin updates.
npx claudepluginhub appsvortex/arness --plugin arn-codeThis skill uses the workspace's default tool permissions.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Set up Arness for a project by analyzing or defining code patterns, choosing configuration options, and persisting everything to CLAUDE.md. This is optional — Arness auto-configures with sensible defaults on first skill invocation. Use this to customize directories, add integrations, update templates, or review your current settings.
Read the project's CLAUDE.md and look for a ## Arness section. If no CLAUDE.md exists, create one at the project root before proceeding.
If the section does not exist:
If the section exists:
## Arness block${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.jsonAskUserQuestion:
## Arness fields, then exit the skillDetermine whether this is an existing codebase or a greenfield project.
Look for indicators of an existing codebase:
package.json, pyproject.toml, Cargo.toml, go.mod, pom.xml, build.gradle, Gemfile, composer.jsonsrc/, app/, lib/, cmd/, pkg/manage.py, next.config.*, angular.json, vite.config.*, main.go, main.rsIf existing codebase detected → proceed to Flow A (Step 3A)
If empty or minimal project → proceed to Flow B (Step 3B)
Tell the user which flow was detected and why: "I detected an existing [language/framework] project" or "This looks like a new project with no existing code."
Note: Step 3 runs for ALL projects (both Flow A and Flow B). Steps 3A and 3B are flow-specific and run after Step 3.
Shared field preservation: If ## Arness already exists and the shared fields (Git, Platform, Issue tracker, Jira site, Jira project) are already present from a prior init (this plugin or another — e.g., arn-spark-init, arn-infra-init, or ensure-config auto-detection), skip detection and preserve the existing values — unless the user chose Reconfigure in Step 1. If these fields were set by ensure-config auto-detection, preserve them unless the user chose Reconfigure. This prevents overwriting values set by another plugin or by ensure-config in a monorepo.
Check if the project uses Git, determine the code hosting platform, and identify the issue tracker.
3.1. Git check:
git rev-parse --is-inside-work-tree to check for a git repository/arn-code-ship, /arn-code-review-pr, /arn-code-create-issue, /arn-code-pick-issue) will be unavailable." Record Git: no, Platform: none, Issue tracker: none and proceed to Step 3A/3B.3.2. Remote classification:
git remote -v and classify the remote URL:
github.com → candidate: githubbitbucket.org → candidate: bitbucket3.3a. If candidate is github:
gh auth status to check for GitHub CLI authenticationgh auth login, and STOP init (do not continue until resolved)gh label create for each label (the command is idempotent — it will skip labels that already exist):| Label | Color | Description |
|---|---|---|
arness-backlog | d4c5f9 | Deferred items from PRs or postponed features |
arness-feature-issue | 0e8a16 | Feature requests tracked via Arness |
arness-bug-issue | d93f0b | Bug reports tracked via Arness |
arness-priority-high | b60205 | High priority |
arness-priority-medium | fbca04 | Medium priority |
arness-priority-low | c5def5 | Low priority |
arness-rejected | e4e669 | Issue reviewed and rejected as invalid or out of scope |
Read
${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/platform-labels.mdfor label details and which skills use each label.
3.3b. If candidate is bitbucket:
bkt --version to check if the Bitbucket CLI is installed
${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/bkt-setup.md, then STOP initbkt auth status to check authentication
${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/bkt-setup.md, then STOP init${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/jira-mcp-setup.md, then STOP init${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/platform-labels.md)/arn-code-create-issue, /arn-code-pick-issue) will be unavailable. PR and code workflow skills still work via bkt."3.4. Record results:
Invoke the arn-code-codebase-analyzer agent with:
The agent returns structured pattern documentation covering code patterns, testing patterns, and architecture — with real file paths and code snippets.
Review the output. If it seems incomplete (e.g., missed a major area of the codebase), re-invoke with more specific guidance.
Proceed to Step 4.
Walk the user through the questions defined in ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/greenfield-questions.md.
Required questions (always ask):
Contextual questions (ask based on earlier answers): 5. Database — if backend or fullstack 6. API style — if backend or fullstack 7. Package manager — suggest default, confirm 8. Project layout — src layout, flat, monorepo 9. Authentication — if backend or fullstack 10. Additional tooling — linting, formatting, CI 11. UI component library — if frontend or fullstack 12. Styling approach — if frontend or fullstack 13. Accessibility requirements — if frontend or fullstack
Be conversational, not rigid. Skip questions where the answer is obvious from prior answers. Summarize the choices before proceeding.
Invoke the arn-code-pattern-architect agent with all the technology choices gathered above.
The agent returns recommended code patterns, testing patterns, and architecture — with concrete best-practice examples marked as "Recommended" rather than real file references.
Present the recommendations to the user for review:
Ask the user: "Where should Arness store the code pattern documentation for this project?"
.arness/code-patterns at the project root as the defaultCreate the directory if it does not exist.
Ask the user: "Where should Arness store feature and bug specifications?"
.arness/specs as the defaultCreate the directory if it does not exist: mkdir -p <chosen-path>
These specifications are created by arn-code-feature-spec and arn-code-bug-spec and drive the planning workflow via /arn-code-plan.
Read the pattern documentation schema at ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/pattern-schema.md. This defines the exact structure each file must follow.
Greenfield Architecture Bridge:
Before generating pattern documentation, check if an architecture-vision.md exists. Read ## Arness config for greenfield fields (Vision directory — set by the arn-spark plugin during greenfield exploration). If Vision directory is configured, check <vision-dir>/architecture-vision.md.
If architecture-vision.md is found:
If architecture-vision.md is NOT found: proceed normally (Flow A: analyze codebase, Flow B: ask for technology choices).
Split the agent output (from Step 3A or Step 3B-2) into three to five files based on the top-level headings: # Code Patterns, # Testing Patterns, # Architecture, and optionally # UI Patterns and # Security Patterns.
Before writing each file, validate the content against the schema:
If the agent output is missing required fields or uses the wrong structure, reformat it to match the schema before writing.
Write the files to the chosen pattern docs location:
code-patterns.md — Project stack info + code patterns (naming, structure, API/routing, data layer, error handling, configuration)testing-patterns.md — Test framework info + testing patterns (organization, fixtures, markers, setup/teardown)architecture.md — Technology stack table, architectural decisions, dependencies, project layout, codebase referencesui-patterns.md (frontend and fullstack projects only) — UI stack info + UI patterns (component patterns, layout/styling, state management, accessibility, form handling, navigation, animation). Write this file if the project type is "frontend" or "fullstack" (from question 1 for greenfield, or detected type for existing codebases), OR if the codebase analyzer detected a frontend framework during analysis.security-patterns.md (projects with security surface) — Security stack info +
security patterns (authentication, authorization, input validation, data protection,
API security, dependency security). Write this file if the codebase analyzer or pattern
architect detected security-relevant patterns (auth middleware, API endpoints, user input
handling, sensitive data). Do not write it for projects with no security surface (pure
utility libraries, CLI tools with no auth/API/user input).Ask the user:
1. Plans directory
"Where should Arness save structured project plans?"
.arness/plans as the defaultCreate the directory if it does not exist: mkdir -p <chosen-path>
2. Report templates
"Arness includes default report templates (implementation, testing, progress tracking). Would you like to use the defaults, or design custom ones?"
For default templates, copy all JSON templates from the plugin to .arness/templates/, generate SHA-256 checksums, and write a .checksums.json file for version tracking. For custom templates, show the defaults as a starting point and iterate with the user. After setup, ask the user's preference for handling future template updates (ask, auto, or manual).
Read
${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/template-setup.mdfor the full template setup procedure.
Ask the user: "Where should Arness save project documentation?"
.arness/docs/ at the project root as the defaultCreate the directory if it does not exist: mkdir -p <chosen-path>
Documentation generated by /arn-code-document-project will be saved here.
Write (or update) the ## Arness section in the project's CLAUDE.md:
## Arness
- **Plans directory:** [chosen-path]
- **Specs directory:** [chosen-specs-path]
- **Report templates:** default | custom
- **Template path:** [relative-path, e.g., .arness/templates]
- **Template version:** [version from plugin.json]
- **Template updates:** ask | auto | manual
- **Code patterns:** [chosen-pattern-docs-path]
- **Docs directory:** [chosen-docs-path]
- **Git:** yes | no
- **Platform:** github | bitbucket | none
- **Issue tracker:** github | jira | none
- **Jira site:** <site>.atlassian.net
- **Jira project:** <KEY>
- **Task list ID:** <task-list-id>
The template path MUST be relative to the project root, never absolute. This ensures portability across machines and plugin updates.
The Task list ID field is conditional — only written if the user opts in during Step 9b. Omit it if the user chose not to enable persistent task lists.
The Git, Platform, and Issue tracker fields are auto-detected in Step 3 and are not user-configurable.
The Jira site and Jira project fields are only written when Issue tracker is jira. Omit them entirely for other issue trackers.
If updating an existing config, replace the existing ## Arness section in place. Do not duplicate it. Preserve all fields not managed by this skill — this includes greenfield fields (Vision directory, Use cases directory, Prototypes directory, Spikes directory, Visual grounding directory, Figma, Canva) and infra fields (Deferred, Experience level, Project topology, Application path, Providers, Providers config, Default IaC tool, Environments, Environments config, Tooling manifest, Resource manifest, Cost threshold, Validation ceiling, Infra plans directory, Infra specs directory, Infra docs directory, Infra report templates, Infra template path, Infra template version, CI/CD platform, Reference overrides, Reference version, Reference updates). For shared fields (Git, Platform, Issue tracker, Jira site, Jira project): if already present, preserve them — do not re-detect unless the user chose Reconfigure in Step 1.
Ask the user:
"Would you like to enable persistent task lists? (Recommended)
This sets CLAUDE_CODE_TASK_LIST_ID in your project's .claude/settings.json so that tasks created by /arn-code-taskify survive across sessions. Without this, tasks are lost when a session ends and must be recreated.
Benefits:
/arn-code-execute-plan after a session restartOptions:
If Yes:
/home/user/my-project → my-project).claude/settings.json in the project root (create the file and .claude/ directory if they don't exist)env object, preserving any existing env vars (e.g., CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS):
{
"env": {
"CLAUDE_CODE_TASK_LIST_ID": "<task-list-id>"
}
}
- **Task list ID:** <task-list-id> to the ## Arness config block written in Step 9~/.claude/tasks/<task-list-id>/."If No:
.claude/settings.jsonTask list ID from the ## Arness config block/arn-code-init."Confirm with the user:
[pattern-dir]/code-patterns.md[pattern-dir]/testing-patterns.md[pattern-dir]/architecture.md[pattern-dir]/ui-patterns.md (if frontend/fullstack)[pattern-dir]/security-patterns.md (if security surface detected).arness/templates/.checksums.json)## Arness section written to CLAUDE.mdList all created/modified files with their paths.
Next steps:
/arn-code-feature-spec (or /arn-code-feature-spec-teams for team debate)/arn-code-bug-spec/arn-code-create-issue (requires Issue tracker: github or jira)/arn-code-pick-issue (requires Issue tracker: github or jira)Entered from Step 1 when the user chooses Upgrade. Diagnoses gaps using the arn-code-doctor agent and surgically fixes only what's missing — preserving all existing user choices.
Invoke the arn-code-doctor agent via the Task tool with:
## Arness config content${CLAUDE_PLUGIN_ROOT}/.claude-plugin/plugin.json${CLAUDE_PLUGIN_ROOT}/skills/arn-code-report/references/arness-knowledge-base.mdThe agent should check for:
GitHub: field presence (indicates migration is needed)#### Layer N: subsections under ### Visual Testing in the project's CLAUDE.md where **Status:** deferred is present. If found, report the layer names.Wait for the agent to complete and collect the diagnostic report.
Categorize each [ISSUE] from the doctor's report:
| Category | Examples |
|---|---|
missing_config_auto | Git, Platform, Issue tracker fields absent from config |
legacy_config | Old GitHub: yes|no field present (needs migration to Platform + Issue tracker) |
missing_config_user | Docs directory, Plans dir, Specs dir, Code patterns, template prefs absent |
missing_config_jira | Jira site or Jira project absent when Issue tracker is jira |
missing_directory | Directory referenced in config but path doesn't exist |
outdated_templates | Template version in config < current plugin version |
missing_labels | GitHub labels not present in repository (Platform: github only) |
pattern_schema | Pattern docs missing required sections or files absent |
visual_deferred_layers | Deferred visual testing layers detected in ### Visual Testing config |
If all findings are [OK], inform the user: "Arness is fully up to date. No changes needed." and exit.
Otherwise, present a summary: "Found N items to address:" followed by a brief list of the categories.
Process these categories silently, then report what was done:
Platform detection (if Platform/Issue tracker fields absent, or legacy GitHub: field present):
Run the same detection logic as Step 3:
git rev-parse --is-inside-work-treegit remote -v (classify: github.com, bitbucket.org, or other)gh auth status or bkt --version + bkt auth status)Migration from legacy config:
GitHub: yes is found → set Platform: github, Issue tracker: github. Remove the GitHub field.GitHub: no is found → re-run full detection (the remote may now be Bitbucket). Remove the GitHub field.GitHub field and no Platform field → full detection runs as described above.Missing directories (for config fields that already have a value but the directory doesn't exist): mkdir -p <path> for each.
Missing platform labels (if Platform is github): Run gh label create --force for each missing label per ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/platform-labels.md. These commands are idempotent. Skip label creation for Bitbucket and Jira (Jira labels are implicit).
Report to the user what was auto-fixed:
Auto-fixed:
- Detected Git: yes, Platform: github, Issue tracker: github
- Migrated legacy GitHub: yes → Platform: github + Issue tracker: github
- Created missing directory: .arness/docs/
- Created 3 missing GitHub labels: arness-backlog, arness-priority-high, arness-priority-low
For each missing config field that needs a user-provided value, ask one focused question using the same prompt and default as the corresponding full-flow step:
| Missing Field | Prompt | Default | Source Step |
|---|---|---|---|
| Code patterns | "Where should Arness store the code pattern documentation?" | .arness/code-patterns | Step 4 |
| Specs directory | "Where should Arness store feature and bug specifications?" | .arness/specs | Step 5 |
| Plans directory | "Where should Arness save structured project plans?" | .arness/plans | Step 7 |
| Report templates | "Use default or custom report templates?" | default | Step 7 |
| Template updates | "How should Arness handle template updates?" | ask | Step 7 |
| Docs directory | "Where should Arness save project documentation?" | .arness/docs/ | Step 8 |
| Jira site | "What is your Atlassian site URL? (e.g., mycompany.atlassian.net)" | none | Step 3 |
| Jira project | "Which Jira project should Arness use?" | list via MCP and pick | Step 3 |
Rules:
.arness/docs/), still ask so it gets persisted explicitly. Mention the current default: "This field wasn't set in your config. The default is .arness/docs/. Would you like to use this, or choose a different path?"mkdir -p <path>${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/template-setup.md.This step only runs if Template version in the config is older than the current plugin version.
Template updates preference from the config.checksums.json from the user's template directoryThen follow the preference:
ask: Show the user which templates have changed between versions. Ask: "The plugin has updated templates. Would you like to update? Files you've customized will be preserved." If yes → copy new defaults for unmodified templates (checksum matches stored value), skip modified ones and warn. Regenerate .checksums.json.auto: For each template: if checksum matches stored value (unmodified), overwrite with new default. If checksum differs (user customized), skip and warn. Regenerate .checksums.json.manual: Inform the user: "New template versions are available in the plugin. Your templates were not changed." Do not touch files.In all cases, update Template version in the config to the current plugin version.
This step only runs if the doctor flagged pattern_schema issues.
arn-code-codebase-analyzer (existing project) or arn-code-pattern-architect (greenfield), validate output against the schema at ${CLAUDE_PLUGIN_ROOT}/skills/arn-code-init/references/pattern-schema.md, and write the updated files.Write (or update) the ## Arness section in CLAUDE.md, merging:
The config includes up to 14 fields (11 core + 3 conditional: 2 Jira fields + 1 Task list ID). The old GitHub: field is removed if present (replaced by Platform + Issue tracker). Jira site and Jira project fields are only written when Issue tracker is jira. Task list ID is only written when the user opts in during Step 9b.
Replace the existing ## Arness section in place. Format matches Step 9 exactly. Preserve all fields not managed by this skill (greenfield fields, infra fields) as documented in Step 9.
If deferred visual testing layers were detected (visual_deferred_layers category):
Present: "Deferred visual testing layers found: [layer names]. Run /arn-spark-visual-readiness (requires arn-spark plugin) to check if they can be activated now."
This is informational only — do not auto-fix or block the upgrade flow.
Check if Task list ID is present in the existing ## Arness config.
If NOT present:
"Persistent task lists are not configured for this project. Would you like to enable them? (Recommended — ensures tasks survive across sessions)"
Options:
If Yes: follow the same logic as Step 9b (derive ID, write to .claude/settings.json, add to ## Arness config).
If No: skip silently.
If already present:
.claude/settings.json and check if CLAUDE_CODE_TASK_LIST_ID matches the configured Task list ID.claude/settings.json is missing or the env var is absent/mismatched: update it to match. Note: "Updated .claude/settings.json to match Task list ID: <id>."Present a change summary:
Upgrade Complete (Plugin version: X.Y.Z)
Changes made:
- Migrated legacy config: GitHub: yes → Platform: github + Issue tracker: github
- Added config field: Docs directory → .arness/docs/
- Added config field: Git → yes
- Added config field: Platform → github
- Added config field: Issue tracker → github
- Removed legacy field: GitHub
- Created directory: .arness/docs/
- Updated 4 templates to vX.Y.Z
- Created 7 GitHub labels
- Updated ## Arness config in CLAUDE.md
No changes to:
- Plans directory: plans/ (unchanged)
- Specs directory: specs/ (unchanged)
- Code patterns: .arness/code-patterns (unchanged)
- Pattern documentation (up to date)
List all created/modified files with their paths (same style as Step 10).
arn-code-codebase-analyzer or arn-code-pattern-architect) fails or returns empty output, report the issue to the user and suggest providing pattern information manually.## Arness config block so they can insert it manually.arn-code-doctor agent fails during upgrade, fall back to offering Reconfigure or Keep.This skill is safe to re-run. When re-running:
## Arness section and offers three options: Upgrade, Reconfigure, or KeepBackward compatibility: Missing Docs directory defaults to .arness/docs/. Missing Git/Platform/Issue tracker fields default to runtime detection (checks are run on demand by skills that need them). Legacy GitHub: yes|no configs are auto-migrated to Platform + Issue tracker during upgrade. After a plugin update, the Upgrade flow handles migration of these fields automatically.