Skip to content

feat: Add project-agnostic release automation workflow - #1

Merged
dean0x merged 1 commit into
mainfrom
feature/release-agent
Oct 16, 2025
Merged

dean0x merged 1 commit into
mainfrom
feature/release-agent

Conversation

@dean0x

@dean0x dean0x commented Oct 16, 2025

Copy link
Copy Markdown
Owner

Summary

Introduces /release command and release sub-agent for automated, safe, and professional release management across any programming language or ecosystem.

Key Features

Universal Project Detection

  • Auto-detects Node.js, Rust, Python, Go, Ruby, PHP, Java (Maven/Gradle), Swift projects
  • Falls back to generic VERSION file + git tags for unknown projects
  • Adapts build, test, and publish commands to detected ecosystem

Intelligent Version Management

  • Analyzes commits since last release using conventional commit patterns
  • Suggests patch/minor/major bump based on detected changes
  • Supports custom version strings (e.g., 2.0.0-beta.1)
  • Updates version files appropriate to project type

Auto-Generated Changelogs

  • Extracts changes from git commit history
  • Categorizes as Added/Fixed/Changed based on commit type
  • Prepends to existing CHANGELOG.md or creates new one
  • Maintains Keep a Changelog format

Built-In Safety Checks

  • ✅ Verifies clean working directory before starting
  • ✅ Runs build command (if configured)
  • ✅ Runs tests before allowing release
  • ✅ Provides rollback instructions if anything fails
  • ✅ Multi-step user confirmations before permanent actions

Multi-Step Workflow

  1. User runs /release and specifies bump type
  2. Agent detects project type and current version
  3. Analyzes commits since last release
  4. Generates changelog entry
  5. Updates version files
  6. Runs build and tests
  7. STOP - Shows preview and waits for confirmation
  8. Commits version bump
  9. Pushes to remote
  10. STOP - Asks before publishing to public registry
  11. Publishes package
  12. Creates git tag
  13. Creates GitHub/GitLab release
  14. Shows final summary with links

Supported Ecosystems

Ecosystem Version File Build Test Publish
Node.js package.json npm run build npm test npm publish
Rust Cargo.toml cargo build --release cargo test cargo publish
Python pyproject.toml/setup.py python -m build pytest twine upload
Go git tags go build go test git tags only
Ruby *.gemspec gem build rake test gem push
PHP composer.json - phpunit composer publish
Java/Maven pom.xml mvn package mvn test mvn deploy
Java/Gradle build.gradle gradle build gradle test gradle publish
Swift git tags swift build swift test git tags only
Generic VERSION file - - manual

Platform Integration

  • Creates GitHub releases via gh CLI (if available)
  • Creates GitLab releases via glab CLI (if available)
  • Includes changelog in release notes
  • Links to commits, tags, and package registry

Documentation Changes

  • Added /release command to commands table
  • Added release sub-agent to sub-agents table
  • Created "Creating a Release" workflow section
  • Added to integration examples

Files Changed

  • src/claude/agents/devflow/release.md - New sub-agent (26KB, comprehensive)
  • src/claude/commands/devflow/release.md - New command (7KB, orchestration)
  • README.md - Documentation updates

Testing

  • ✅ Built successfully with npm run build
  • ✅ Installed locally with node dist/cli.js init
  • ✅ Verified files installed correctly
  • ✅ Verified file contents and frontmatter

Next Steps

After merging:

  • Test release workflow on a sample project
  • Consider dogfooding by using /release for next DevFlow release
  • Gather feedback on supported ecosystems
  • Add more project types if needed (Elixir, Clojure, etc.)

Notes

This is a workflow agent (like research and commit) that coordinates a complex multi-step process. The agent is designed to be extremely cautious with multiple confirmation points before any permanent/public actions.

🤖 Generated with Claude Code

Introduces /release command and release sub-agent for automated,
safe, and professional release management across any programming
language or ecosystem.

Features:
- **Universal project detection** - Auto-detects Node.js, Rust,
  Python, Go, Ruby, PHP, Java/Maven, Java/Gradle, Swift projects
- **Intelligent version bumping** - Analyzes commits to suggest
  patch/minor/major based on conventional commits
- **Auto-generated changelogs** - Extracts changes from git history
- **Built-in safety checks** - Verifies clean directory, builds,
  tests before releasing
- **Multi-step confirmations** - User approval before commit, push,
  and publish operations
- **Platform integration** - Creates GitHub/GitLab releases with gh/glab
- **Rollback instructions** - Clear recovery steps if anything fails

Workflow:
1. User runs /release and specifies bump type (patch/minor/major/custom)
2. Release agent detects project type and current version
3. Analyzes commits since last release
4. Generates changelog entry from git history
5. Updates version files (package.json, Cargo.toml, etc.)
6. Runs build and tests
7. Shows preview and waits for user confirmation
8. Commits version bump
9. Pushes to remote
10. Publishes to registry (npm, crates.io, PyPI, etc.)
11. Creates git tag
12. Creates platform release (GitHub/GitLab)

Supported ecosystems:
- Node.js (package.json + npm)
- Rust (Cargo.toml + cargo)
- Python (pyproject.toml/setup.py + pip/twine)
- Go (go.mod + git tags)
- Ruby (gemspec + gem)
- PHP (composer.json + composer)
- Java/Maven (pom.xml + mvn)
- Java/Gradle (build.gradle + gradle)
- Swift (Package.swift + git tags)
- Generic (VERSION file + git tags)

Documentation:
- Added /release to commands table in README
- Added release to sub-agents table in README
- Created "Creating a Release" workflow section
- Included in integration examples

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@dean0x
dean0x merged commit 5774f5b into main Oct 16, 2025
@dean0x
dean0x deleted the feature/release-agent branch October 16, 2025 21:09
dean0x pushed a commit that referenced this pull request Mar 25, 2026
- Replace per-line subprocess spawning in extract_batch_messages with
  single-pass jq/node processing (issue #1)
- Decompose process_observations into validate_observation,
  calculate_confidence, and check_temporal_spread helpers (issue #2)
- Fix duplicate temporal spread calculation by computing epoch once
  in check_temporal_spread (issue #3)
- Escape double quotes in ART_DESC for YAML frontmatter safety (issue #4)
- Strengthen ART_NAME sanitization with strict kebab-case allowlist (issue #5)
- Replace per-line subprocess in apply_temporal_decay with single-pass
  jq operation and node fallback (issue #6)
- Replace per-line subprocess in create_artifacts status update with
  single-pass jq/node operation (issue #7)
- Remove dead increment_daily_counter function (issue #8)
- Extract write_command_artifact and write_skill_artifact helpers
  from create_artifacts (issue #9)
- Change flat 30k char truncation to per-session 8k char cap for
  proportional session contribution (issue #10)
- Add section comment markers to build_sonnet_prompt heredoc for
  navigability (issue #11)
dean0x pushed a commit that referenced this pull request Apr 13, 2026
Addresses 9 issues found in the r1-init-migrations review batch:

- #1: Move runMigrations block before installViaFileCopy so V1→V2 shadow
  renames complete before the installer looks for V2-named directories
- #2: Extend Migration.run to return MigrationRunResult { infos, warnings };
  both registry entries now surface migrated counts and conflict warnings to
  init.ts, which logs them via p.log.info / p.log.warn after the migration loop
- #3 (ISP): Split MigrationContext into GlobalMigrationContext | PerProjectMigrationContext
  discriminated union; drop unused claudeDir field; empty-string sentinels removed
- #4: Cap per-project Promise.allSettled concurrency at 16 via pooled() helper to
  avoid EMFILE on machines with 50-200 projects
- #5: Accumulate newlyApplied in memory and write state once at end of
  runMigrations — eliminates O(N²) writeAppliedMigrations calls per run
- #6: Use { flag: 'wx' } exclusive-create on .tmp file with unlink+retry on
  EEXIST to prevent TOCTOU symlink writes
- #7: Add exhaustiveness assertion (never) on migration.scope dispatch so future
  union extensions cause a runtime throw instead of silent no-op
- #8 (D37): Document vacuous-truth edge case in runMigrations comment block where
  discoveredProjects=[] marks per-project migration applied without sweeping any project
- #9: Convert applied array to Set<string> before the migration loop for O(1)
  .has() lookups instead of O(N) .includes() per migration

Co-Authored-By: Claude <noreply@anthropic.com>
dean0x pushed a commit that referenced this pull request Apr 16, 2026
Review walkthrough across 4 sessions resolved all 31 issues from the
2026-04-15_1022 code review (19 fixed, 5 rejected, 1 deferred, 6
pre-resolved).

Blocking fixes (sessions 1-2):
- CHANGELOG contradiction rewritten (#1)
- Worktree placeholder unified on "{worktree}" across 11 sites (#3)
- /debug migrated to index pattern (#4)
- KNOWLEDGE_CONTEXT quoting standardized, no inline fallback (#6)
- apply-knowledge skill defers to footer for paths (#7)
- Simplifier dropped from knowledge consumers; 4 agents canonicalized (#8)
- lstat+isFile guard on legacy-knowledge-purge unlink (#9)

Architecture + consistency fixes (session 2):
- Bare-form CLI removed, dispatch simplified to index-only (#10)
- code-review-teams template+table extraction (#12)
- Designer Apply Knowledge H2 added (#13)
- Teams phase numbering aligned (#14)
- loadKnowledgeContext + full subcommand removed entirely (#16)

Complexity + performance + testing + docs fixes (sessions 3-4):
- D-A filter extracted to isDeprecatedOrSuperseded predicate (#18)
- formatAdrLine/formatPfLine merged into formatEntryLine (#19)
- Shared test fixtures extracted to tests/knowledge/fixtures.ts (#21)
- Token claim "~250 tokens" dropped from 12 sites (#22)
- tmpdir cleanup added to test fixtures (#25)
- self-learning.md example and footer paths corrected (#28, #29)

28 files changed, 333 insertions, 524 deletions. 1021/1021 tests passing.
dean0x added a commit that referenced this pull request Jun 21, 2026
#246)

## Context

Real `/devflow:dynamic-*` runs in the sibling `skim` / `skim-search`
projects underperformed: **~50% of workflow runs failed** and driver
sessions sprawled across 1–5 days. Root-cause analysis (memory
`dynamic-workflow-skim-postmortem`) found the time sinks were
structural. This PR fixes the five highest-leverage causes plus one
bundled core bug (stray nested `.devflow/`).

Source of truth is `shared/recipes/*.mds` (→
`plugins/devflow-dynamic/commands/` at build) and `shared/agents/*.md`.
Compiled recipes + distributed agents are gitignored.

## Fix 1 — Long-build stall guard (the dominant failure) ⚠️ load-bearing

The Workflow runtime kills any sub-agent silent for 180s; cold `cargo
build`/`cargo test` blew past it (`agent stalled on all 6 attempts`).

**Spike first (load-bearing assumption).** Ran a minimal workflow whose
agent runs a >200s background command + a `Monitor` heartbeat poll.
**Result: `survived: true`, `elapsedSeconds: 253`, read final output, 8
heartbeats.** The doctrine (the plan's primary path) is settled — no
fallback needed.

- New `_engine.mds` `build_execution_doctrine()` (exported, rendered in
`dynamic-build`): build/test that may run silent >~120s MUST run via
`Bash(run_in_background)` + a `Monitor` emitting sub-watchdog heartbeats
(~25s) with `timeout_ms` above the job; prefer crate/package-scoped
commands, full-workspace regression left to the human.
- `validator.md`, `tester.md`, `coder.md` gain a mechanical
"Long-running commands" subsection (also fixes the plain-Bash 120s
default-timeout that bites `/implement`).

## Fix 2 — Gate-1 cadence: full V-S-S exactly twice per ticket

Gate 1 (Validator→Simplifier→Scrutinizer) previously fired after
**every** mutation (≈6 passes/ticket). Now it runs **twice**:
post-implementation (#1) and one final post-fix gate (#2). Between
review cycles and Gate-2 fixes the Coder **self-verifies its own
build**; nothing else runs. Verified via compiled-output grep:
Simplifier/Scrutinizer appear exactly **2×** each.

## Fix 3 — Generated-script robustness

`_preamble.mds` `authoring_preamble()` gains a **mandatory pre-flight
self-check** targeting the two observed crash classes (`pipeline()`
non-array first arg; `undefined is not an object (SEAL.num)`), plus a
cheap `node --check` syntax gate (noted: catches syntax only, the
checklist is the real lever) and a default-dry-run recommendation for
large scripts.

## Fix 4 — Decisions: batch + auto-resolve transparency

- `dynamic-plan` writes **Auto-Resolved Decisions** as `decision →
resolution → source` (auditable/reversible) and surfaces them at the
command boundary.
- `dynamic-build` gains a command-boundary section: after the workflow
returns, batch the wave report's escalations + any `DECISIONS-NEEDED`
into **one** `AskUserQuestion`.
- Preference-profile-absent note in the report.

## Fix 5 — Wave deadlock report clarity

`_wave.mds`: each blocked/quarantined ticket now states **why** (the
specific failed dependency / unresolved decision, never a bare
"blocked") and cites the resume `runId`/journal. Pure reporting clarity
— no control-flow change.

## Fix 6 — Stray nested `.devflow/` (anchor hooks to git root)

Every shell hook computed `"$CWD/.devflow"` with no git-root anchoring;
a worker spawned with a CWD inside `.devflow/docs/.../tickets/`
scaffolded a stray nested `.devflow/`.

- New `scripts/hooks/resolve-project-root` defining `df_resolve_root`
(git top-level, with a `.devflow/`-strip fallback for non-git dirs),
mirroring the TS CLI's `getGitRoot()`.
- Anchored the `.devflow/` derivation in 8 hooks + `ensure-devflow-init`
(session-cwd-dependent things like the transcript lookup deliberately
stay on `$CWD`).
- **Anchor-only** per the plan — no auto-clean / migration for existing
strays.

## Verification

- **Spike** ✓ (`survived: true`, 253s).
- **`npm run build`** clean (CLI + agent distribution + recipes, 0
errors).
- **`npm test`** → **1880 passed** (64 files). +10 new tests:
`df_resolve_root` cases (a/b/c/c2), a nested-`.devflow/` integration
test (Stop hook with CWD inside `.devflow/` writes the queue at the repo
root, no stray), and compiled-`dynamic-build.md` assertions (build
doctrine present, final Gate 1 present, per-cycle Gate-1 absent,
Simplifier/Scrutinizer 2× each).

## Deferred (flagged, not blocked)

- **`json-helper.cjs` git-root alignment** (plan's optional secondary):
the 4 `process.cwd()` sites (`assign-anchor`/`retire-anchor`/`render`)
would need a new `child_process`/git dependency in a pure-JSON utility,
and those ops only ever run from the Dream agent at the repo root. Left
as-is per "flag, don't block."

## Notes

- During the Fix-1 spike, the spike agent flagged a **skim rewrite-hook
artifact**: a cleanup command containing `wc` returned `wc 1\n 0`
instead of `0` (a stray `wc 1` token prepended). Surfacing per the
skim-reporting instruction.

## Out of scope

No wave-size cap; no auto-deletion of existing strays; no change to the
180s watchdog itself (Fix 1 works *with* it); no Gate-2 placement
change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant