Skip to main content

Diagnose, generate, and maintain the AI agent setup of your projects — CLAUDE.md, skills, subagents, rules, and supporting docs.

Project description

opsward

Diagnose, generate, and maintain the AI agent setup of your projects — CLAUDE.md, skills, subagents, rules, and supporting docs.

Opsward works in two modes:

  • CLI mode — deterministic, pure-code analysis you run directly. No AI involved.
  • Claude Code mode — install opsward as Claude Code skills so that Claude runs the CLI tools, interprets results intelligently, and acts on suggestions. No API keys needed — Claude Code is the AI engine.

Install

pip install opsward

CLI Mode (no AI)

These commands are deterministic Python code — regex scoring, filesystem checks, template substitution. Same input always gives the same output.

Diagnose

Score your project's AI setup health:

opsward diagnose-cmd .
Diagnosis Report: myproject
Project type: python
Overall score: 72/100  (Grade: C)

Components:
  CLAUDE.md quality         [################....] 81/100
  Documentation             [##############......] 70/100
  Skills                    [############........] 60/100
  Setup (rules/agents/hooks) [##########..........] 50/100
  Cross-references          [####################] 100/100

Missing:
  [ ] docs_guide.md
  [ ] docs/known_issues.md

Suggestions:
  1. Create a docs_guide.md to index your documentation
  2. Consider adding hooks in .claude/hooks.json

Generate

Create missing artifacts (dry run by default):

opsward generate-cmd .
opsward generate-cmd . --write   # actually create files

Generates CLAUDE.md, docs (architecture, conventions, known_issues, etc.), skill templates, and agents — only what's missing, never overwrites existing files.

Maintain

Find stale references and drift:

opsward maintain-cmd .
myproject: 3 issue(s)

  [stale_path] CLAUDE.md references `src/old_module.py` but it does not exist
  [sync_issue] `new_doc.md` exists in docs/ but is not listed in docs_guide.md
  [empty_doc] `conventions.md` appears to be an empty stub (12 bytes)

Output Formats

All CLI commands support --format json for machine-parseable output:

opsward diagnose-cmd . --format json
opsward generate-cmd . --format json
opsward maintain-cmd . --format json

Claude Code Mode (AI-enhanced)

Install opsward's skills into Claude Code, and Claude becomes an intelligent layer on top of the deterministic tools. It doesn't just run opsward — it goes beyond the heuristic scores by reading actual source code, reasoning about accuracy, and making intelligent edits.

Install Skills

opsward install-skills-cmd --write                    # into ./.claude/ (project-level)
opsward install-skills-cmd --global-install --write   # into ~/.claude/ (all projects)

What the Skills Do

Once installed, these skills activate automatically in Claude Code when you ask the right thing:

Skill Trigger What it does
opsward "check my setup", "opsward" Diagnose → decide next step → generate or maintain → re-diagnose
opsward-diagnose "audit my AI config" Run opsward diagnose, then read code to assess semantic quality, offer fixes
opsward-generate "scaffold AI setup" Run opsward generate, then read the codebase and replace templates with real content
opsward-maintain "check for staleness" Run opsward maintain, then check for semantic drift (docs that no longer match code)

How It Works

  1. Opsward CLI runs deterministic checks (regex scoring, path validation, template substitution) — fast, reproducible, no AI
  2. Claude reads the output and adds deeper analysis: reads actual source code, checks if docs match reality, verifies commands are correct
  3. Claude proposes fixes — not just what opsward suggests, but what it discovers by understanding the code
  4. Claude applies fixes with user approval, then re-runs opsward to show improvement

The CLI provides the structural analysis. Claude provides the semantic understanding and action.

Permissions

The skills use Claude Code's standard permission model — no special permissions are assumed or required:

  • Read-only operations (reading files, searching code, running opsward diagnose): always safe, used freely
  • Write operations (creating docs, editing CLAUDE.md): Claude Code prompts the user for each action per their permission settings
  • Destructive operations (deleting files, removing content): always ask for explicit confirmation

If you want faster workflows (e.g., auto-approve file creation during generation), you can configure that in your Claude Code permission settings — but opsward skills never assume it.


What It Checks

CLAUDE.md quality (6 dimensions):

  • Commands & workflows — are build/test/lint commands documented?
  • Architecture clarity — is there a module map with role descriptions?
  • Conventions — are project-specific style rules present?
  • Conciseness — is the file scannable, not bloated?
  • Currency — do referenced paths actually exist?
  • Actionability — are instructions specific enough to act on?

Documentation completeness: docs_guide.md, architecture.md, conventions.md, known_issues.md, and content quality.

Skills & agents: SKILL.md presence, descriptions, setup-auditor agent.

Cross-references: paths in CLAUDE.md validated against the filesystem.

Overall health: weighted score (A–F grade) combining all components.

Python API

from pathlib import Path
from opsward import scan, diagnose, generate, generate_skills, maintain

sr = scan('.')
report = diagnose(sr)
print(report)              # human-readable report card
print(report.grade)        # 'A', 'B', 'C', 'D', or 'F'

files = generate(sr)       # list[GeneratedFile]
issues = maintain(sr)      # list[MaintenanceSuggestion]

# Install skills programmatically
skill_files = generate_skills(Path.home() / '.claude')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opsward-0.0.5.tar.gz (50.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opsward-0.0.5-py3-none-any.whl (36.8 kB view details)

Uploaded Python 3

File details

Details for the file opsward-0.0.5.tar.gz.

File metadata

  • Download URL: opsward-0.0.5.tar.gz
  • Upload date:
  • Size: 50.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for opsward-0.0.5.tar.gz
Algorithm Hash digest
SHA256 7abc70806b3bc2ff3870e48a66a9f7371fc44ac9d9df898bacc39b30a1d27024
MD5 929011605045649c12cc818733d838c6
BLAKE2b-256 5c63c7e5a4c8b46b95c02c7c175677fb20839de99b0e36bb7ae544c3de1a6ba0

See more details on using hashes here.

File details

Details for the file opsward-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: opsward-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 36.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.19

File hashes

Hashes for opsward-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ae165a73ce2a9f557f3584781f966b31f520a8bc1c219073744f9153f0ad68db
MD5 d8296c64ccd712aa5fcfac2f643be225
BLAKE2b-256 a8c3616ba797dc92266c884a0786d8f68cffa199ecf2c4f4a42c772988bc0cbe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page