agent-loop-ext
Crash-resilient external agent loop with state persistence and CI/CD integration
Audit and maintain harness memory through reviewed aiwg memory plans, with owner receipts, verification and recovery.
$ npx -y skills add jmagly/aiwg --skill harness-memory-maintenance --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/harness-memory-maintenanceContext preview
The summary Claude sees to decide when to auto-load this skill.
Audit and maintain harness memory through reviewed aiwg memory plans, with owner receipts, verification and recovery.
namespace: aiwg name: harness-memory-maintenance platforms: [all] description: Audit and maintain harness memory through reviewed aiwg memory plans, with owner receipts, verification and recovery. triggers: - harness memory audit - harness memory cleanup - harness memory recategorize - harness memory promote - harness memory demote - harness memory retire
Use `aiwg memory` for harness memory maintenance on every provider. Fetch only the needed section with `aiwg show skill harness-memory-maintenance --section <section>`: Audit, Cleanup, Recategorize, Promote, Demote, Retire, Verify or Restore. Before mutations also fetch Review and Apply. This skill stays out of startup context; the generic CLI works without it (`aiwg memory --help`).
Run the requested read-only inventory:
aiwg memory audit --scope project --json aiwg memory audit --scope global --json aiwg memory audit --scope provider --provider codex --json
Explain ownership, scope, loading chains, inaccessible or opaque surfaces and uncertainty. Static eligibility does not prove live session loading. Use `aiwg memory cost --scope project --json` for cost attribution, or `aiwg memory recommend --scope project --json` for advisory candidates.
Audit the requested scope, then run `aiwg memory recommend --scope project --json` (or `--scope global`). Review each candidate's uncertainty, protection, retrieval impact and owner. Cleanup selects explicit operations; it never bulk-deletes memory. Fetch the matching operation section and Review and Apply. Blocked candidates need owner resolution. Global recommendations are advisory; the executable lifecycle currently supports project-owned records only.
Resolve the exact owner handle from the inventory and owner records. Executable owners are `line-memory`, `compound-memory` and `semantic-memory`. Show global versus project targeting, the before/after diff, owner review requirements and native/next-session limitations before mutation. Never reinterpret a global request as permission to change a project or provider-native source.
Create a reviewed plan, selecting the operation's flags from its section:
aiwg memory plan --owner <owner> --target <handle> --op <operation> --rationale <reason> --reviewer <reviewer> --out <new-plan.json> --json aiwg memory apply --plan <new-plan.json> --preview --json
Plan creation writes only the named new file; `--preview` writes nothing. Preserve the exact plan and its digest. Review the owner snapshot, target revision, affected links and required approvals. Session-derived knowledge retains the existing exact-candidate-version owner review contract. Unsupported owners, scope changes, stale revisions or missing retrieval proof must stop. After authorization of this concrete plan, apply the exact digest:
aiwg memory apply --plan <new-plan.json> --confirm <plan-digest> --json aiwg memory verify --plan <new-plan.json> --json
Changes affect the next session. Native provider caches and current loaded context remain unverified; adapter regeneration belongs to its existing owner. Report owner receipts and partial failures. Re-audit and replan stale input; never edit a reviewed plan to force confirmation.
Fetch Review and Apply. Select `--op recategorize --category <category>` in the plan command. Preserve placement and lifecycle; a taxonomy correction does not grant promotion or retirement authority. The category must be accepted by the target's owner. Review the category diff and retained identity/history, then apply and verify through the shared reviewed workflow.
Fetch Review and Apply. Select `--op promote --placement <placement>` in the plan command. Placement order is archived, indexed, task-context, resident; promotion must move upward. Prefer indexed storage and bounded task context before residency. Explain the measured need and cost of residency; protected or session-derived sources retain their owner review requirements. Verify the owner state after apply; residency does not prove current-session activation.
Fetch Review and Apply. Inspect low-use evidence with `aiwg memory cost --scope project --usage <usage.json> --demote <id-or-path> --json`; this is a read-only estimate. Select `--op demote --placement indexed` (or another lower placement) and repeatable `--link <indexed-path>` in the plan command. Resident removal requires the owner's indexed retrievability proof, not just an unrelated copy or smaller file. The current line-memory and compound-memory owners cannot prove that projection and refuse resident removal. Preserve the source and report that limitation rather than bypassing it. Retain history and retrieval anchors for supported owner transitions, then apply and verify.
Fetch Review and Apply. Select `--op retire --retirement-basis review` in the plan command after reviewing use history, rare obligations and owner protection. Unknown history cannot justify age-based retirement. Retirement changes only lifecycle, keeps the tombstone and owner history, and excludes retired content from active retrieval. It never purges the source. Record the reason and exact revision, apply and verify, and retain the plan for recovery.
Run `aiwg memory verify --plan <applied-plan.json> --json` after apply or recovery. This read-only check uses existing owner receipts and retrieval checks to confirm recorded end states, retained history/tombstones and required indexed retrievability. Report findings and failed or stale checks with the CLI exit code. A local pass does not establish live provider loading or flush native caches; no new verification store is needed.
Fetch Review and Apply. Inspect the owner's retained tombstone/history and current revision. Create a fresh `--op restore` plan for the retired or superseded handle, with the curren
Reusable project context and specialist workflows for the AI tools you already use. Plan software, coordinate specialist reviews, prepare campaigns, investigate incidents, organize research, curate media, and maintain operational knowledge.
Crash-resilient external agent loop with state persistence and CI/CD integration
Detect requests for iterative autonomous agent loops and route to the appropriate loop executor
Automatically execute tests when code-generating agents modify source files, enforcing the execute-before-return pattern
Enable agent loops to learn from similar past tasks and share patterns across loops
Query and manage the executable feedback debug memory
Execute tests on generated code and iterate until passing