From 98555d1598792b9b26c450753c487860db5fe846 Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Sat, 18 Oct 2025 20:59:39 +0000 Subject: [PATCH 1/5] feat: enhance release agent with docs verification and persistent notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Release agent now saves comprehensive release notes to .docs/releases/.md - Verifies documentation alignment (ROADMAP, READMEs, CHANGELOG) - Checks version references across all documentation files - Detects monorepo subpackages and verifies installation instruction consistency - Provides search-and-replace commands for fixing version mismatches - Create .docs/releases/ directory during init - Fix statusline path to use absolute path instead of tilde (~) Addresses: - Release notes persistence for historical tracking - Documentation drift detection - Monorepo documentation consistency - Statusline execution issues with tilde expansion 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/claude/agents/devflow/release.md | 291 ++++++++++++++++++++++++++- src/cli/commands/init.ts | 16 +- 2 files changed, 295 insertions(+), 12 deletions(-) diff --git a/src/claude/agents/devflow/release.md b/src/claude/agents/devflow/release.md index ad3e4950..4df28aae 100644 --- a/src/claude/agents/devflow/release.md +++ b/src/claude/agents/devflow/release.md @@ -760,9 +760,266 @@ fi echo "" ``` -## Step 13: Final Summary +## Step 13: Save Release Notes -Provide release summary: +Save comprehensive release notes to `.docs/releases/`: + +```bash +# Create releases directory if it doesn't exist +mkdir -p .docs/releases + +# Get current date +RELEASE_DATE=$(date +%Y-%m-%d) + +# Generate release notes file +RELEASE_NOTES_FILE=".docs/releases/${NEW_VERSION}.md" + +# Write comprehensive release notes +cat > "$RELEASE_NOTES_FILE" </dev/null || echo "N/A") +- **Release type:** ${BUMP_TYPE} +- **Tag:** ${TAG_NAME} + +--- + +## Changes + +$(cat <<'CHANGES_EOF' +${CHANGELOG_ENTRY} +CHANGES_EOF +) + +--- + +## Commit History + +\`\`\` +$(git log --oneline $COMMIT_RANGE 2>/dev/null || echo "No commits to display") +\`\`\` + +--- + +## Build & Test Results + +- **Build:** ${BUILD_RESULT:-N/A} +- **Tests:** ${TEST_RESULT:-N/A} + +--- + +## Distribution + +EOF + +# Add registry links based on project type +if [ -n "$PUBLISH_CMD" ] && [ "$PUBLISH_CMD" != "echo"* ]; then + echo "**Published to:**" >> "$RELEASE_NOTES_FILE" + case "$PROJECT_TYPE" in + nodejs) + PACKAGE_NAME=$(command -v jq >/dev/null && jq -r '.name' package.json 2>/dev/null || echo "unknown") + echo "- npm: https://www.npmjs.com/package/${PACKAGE_NAME}/v/${NEW_VERSION}" >> "$RELEASE_NOTES_FILE" + ;; + rust) + CRATE_NAME=$(grep '^name = ' Cargo.toml | head -1 | sed 's/name = "\(.*\)"/\1/') + echo "- crates.io: https://crates.io/crates/${CRATE_NAME}/${NEW_VERSION}" >> "$RELEASE_NOTES_FILE" + ;; + python) + PACKAGE_NAME=$(grep '^name = ' pyproject.toml | head -1 | sed 's/name = "\(.*\)"/\1/' || echo "unknown") + echo "- PyPI: https://pypi.org/project/${PACKAGE_NAME}/${NEW_VERSION}/" >> "$RELEASE_NOTES_FILE" + ;; + ruby) + GEM_NAME=$(ls *.gemspec 2>/dev/null | head -1 | sed 's/\.gemspec$//') + echo "- RubyGems: https://rubygems.org/gems/${GEM_NAME}/versions/${NEW_VERSION}" >> "$RELEASE_NOTES_FILE" + ;; + *) echo "- Package registry (check project documentation)" >> "$RELEASE_NOTES_FILE" ;; + esac + echo "" >> "$RELEASE_NOTES_FILE" +fi + +# Add Git platform links +if command -v gh >/dev/null && git remote get-url origin 2>/dev/null | grep -q "github.com"; then + REPO_URL=$(git remote get-url origin | sed 's/\.git$//') + cat >> "$RELEASE_NOTES_FILE" <> "$RELEASE_NOTES_FILE" <<'EOF' + +--- + +## Verification Steps + +1. **Registry Check:** Verify package appears in registry (may take a few minutes) +2. **Fresh Install:** Test installation in a clean environment +3. **Smoke Tests:** Run basic functionality tests +4. **Documentation:** Update any version-specific documentation + +--- + +*Release notes generated by DevFlow release agent* +EOF + +echo "" +echo "✅ Release notes saved to: $RELEASE_NOTES_FILE" +echo "" +``` + +## Step 14: Verify Documentation Alignment + +Check and update documentation files to ensure consistency: + +```bash +echo "📚 Verifying documentation alignment..." +echo "" + +DOC_ISSUES=() + +# Check if ROADMAP.md exists and needs updating +if [ -f "ROADMAP.md" ]; then + echo "Checking ROADMAP.md alignment..." + + # Check if this release includes features that should be marked as completed + if echo "$CHANGELOG_ENTRY" | grep -qiE "(feat|feature|add|new)"; then + echo "⚠️ ROADMAP UPDATE NEEDED:" + echo " This release includes new features." + echo " Review ROADMAP.md and mark completed items." + echo " File: ROADMAP.md" + echo "" + DOC_ISSUES+=("ROADMAP.md needs review for completed features") + fi + + # Check if roadmap references old version + if grep -q "$CURRENT_VERSION" ROADMAP.md 2>/dev/null; then + echo "⚠️ ROADMAP VERSION REFERENCE:" + echo " ROADMAP.md references old version $CURRENT_VERSION" + echo " Consider updating version references to $NEW_VERSION" + echo "" + DOC_ISSUES+=("ROADMAP.md has old version references") + fi +fi + +# Check for README.md files in subpackages (monorepo support) +echo "Checking README.md files..." + +# Find all README.md files (excluding node_modules, .git, etc.) +READMES=$(find . -name "README.md" -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/dist/*" -not -path "*/build/*" 2>/dev/null) + +if [ $(echo "$READMES" | wc -l) -gt 1 ]; then + echo "Found multiple README.md files (monorepo detected)" + + # Check each README for version references + for readme in $READMES; do + if grep -q "$CURRENT_VERSION" "$readme" 2>/dev/null; then + echo "⚠️ VERSION MISMATCH: $readme" + echo " Contains old version reference: $CURRENT_VERSION" + echo " Should be updated to: $NEW_VERSION" + echo "" + DOC_ISSUES+=("$readme has old version reference") + fi + done + + # Check for installation instructions consistency + MAIN_README="./README.md" + if [ -f "$MAIN_README" ]; then + MAIN_INSTALL=$(grep -A 3 "Installation\|Install\|Getting Started" "$MAIN_README" 2>/dev/null | head -5) + + for readme in $READMES; do + if [ "$readme" != "$MAIN_README" ]; then + SUB_INSTALL=$(grep -A 3 "Installation\|Install\|Getting Started" "$readme" 2>/dev/null | head -5) + + # Simple check if installation sections differ significantly + if [ -n "$MAIN_INSTALL" ] && [ -n "$SUB_INSTALL" ]; then + if ! echo "$SUB_INSTALL" | grep -qF "$(echo "$MAIN_INSTALL" | head -1)"; then + echo "⚠️ INSTALLATION INCONSISTENCY:" + echo " $readme has different installation instructions" + echo " than main README.md" + echo "" + DOC_ISSUES+=("$readme installation instructions differ from main README") + fi + fi + fi + done + fi +fi + +# Verify CHANGELOG.md is up to date +if [ -f "$CHANGELOG_FILE" ]; then + if ! grep -q "## \[${NEW_VERSION}\]" "$CHANGELOG_FILE" 2>/dev/null; then + echo "❌ CHANGELOG MISSING NEW VERSION:" + echo " $CHANGELOG_FILE does not contain entry for $NEW_VERSION" + echo " This should have been added in Step 5" + echo "" + DOC_ISSUES+=("CHANGELOG missing $NEW_VERSION entry") + else + echo "✓ CHANGELOG contains $NEW_VERSION entry" + fi + + # Check if changelog has link reference for new version + if ! grep -q "\[${NEW_VERSION}\].*http" "$CHANGELOG_FILE" 2>/dev/null; then + echo "⚠️ CHANGELOG LINK MISSING:" + echo " $CHANGELOG_FILE missing link reference for $NEW_VERSION" + echo " Add: [${NEW_VERSION}]: https://github.com/.../releases/tag/v${NEW_VERSION}" + echo "" + DOC_ISSUES+=("CHANGELOG missing link reference for $NEW_VERSION") + fi +fi + +# Check for docs/ or documentation/ directories +for docs_dir in "docs" "documentation" ".docs"; do + if [ -d "$docs_dir" ]; then + echo "Checking $docs_dir/ for version references..." + + # Look for markdown files with old version + OLD_VERSION_DOCS=$(grep -rl "$CURRENT_VERSION" "$docs_dir" 2>/dev/null | grep -E "\.(md|markdown|txt)$" || true) + + if [ -n "$OLD_VERSION_DOCS" ]; then + echo "⚠️ DOCUMENTATION VERSION REFERENCES:" + echo "$OLD_VERSION_DOCS" | while read -r doc_file; do + echo " - $doc_file" + done + echo "" + DOC_ISSUES+=("Documentation files in $docs_dir/ have old version references") + fi + fi +done + +# Summary of documentation issues +echo "" +if [ ${#DOC_ISSUES[@]} -eq 0 ]; then + echo "✅ All documentation checks passed" +else + echo "⚠️ DOCUMENTATION ISSUES FOUND (${#DOC_ISSUES[@]}):" + for issue in "${DOC_ISSUES[@]}"; do + echo " - $issue" + done + echo "" + echo "These issues should be addressed before announcing the release." + echo "Run a search-and-replace for version references:" + echo " find . -type f -name '*.md' -exec sed -i 's/$CURRENT_VERSION/$NEW_VERSION/g' {} +" + echo "" +fi +``` + +## Step 15: Final Summary + +Display release summary to console: ```bash echo "=========================================" @@ -773,15 +1030,22 @@ echo "📊 RELEASE SUMMARY:" echo "- Old version: $CURRENT_VERSION" echo "- New version: $NEW_VERSION" echo "- Project type: $PROJECT_TYPE" -echo "- Commits included: $(git rev-list --count $COMMIT_RANGE)" +echo "- Commits included: $(git rev-list --count $COMMIT_RANGE 2>/dev/null || echo "N/A")" echo "- Tag: $TAG_NAME" +echo "- Release notes: .docs/releases/${NEW_VERSION}.md" echo "" if [ -n "$PUBLISH_CMD" ] && [ "$PUBLISH_CMD" != "echo"* ]; then echo "📦 PUBLISHED TO:" case "$PROJECT_TYPE" in - nodejs) echo "- npm: https://www.npmjs.com/package/" ;; - rust) echo "- crates.io: https://crates.io/crates/" ;; + nodejs) + PACKAGE_NAME=$(command -v jq >/dev/null && jq -r '.name' package.json 2>/dev/null || echo "package") + echo "- npm: https://www.npmjs.com/package/${PACKAGE_NAME}" + ;; + rust) + CRATE_NAME=$(grep '^name = ' Cargo.toml | head -1 | sed 's/name = "\(.*\)"/\1/') + echo "- crates.io: https://crates.io/crates/${CRATE_NAME}" + ;; python) echo "- PyPI: https://pypi.org/project/" ;; ruby) echo "- RubyGems: https://rubygems.org/gems/" ;; php) echo "- Packagist: https://packagist.org/packages//" ;; @@ -790,20 +1054,27 @@ if [ -n "$PUBLISH_CMD" ] && [ "$PUBLISH_CMD" != "echo"* ]; then echo "" fi -if command -v gh >/dev/null && git remote get-url origin | grep -q "github.com"; then +if command -v gh >/dev/null && git remote get-url origin 2>/dev/null | grep -q "github.com"; then REPO_URL=$(git remote get-url origin | sed 's/\.git$//') echo "🔗 LINKS:" echo "- Release: $REPO_URL/releases/tag/$TAG_NAME" echo "- Commits: $REPO_URL/compare/$LAST_TAG...$TAG_NAME" echo "- Changelog: $REPO_URL/blob/main/$CHANGELOG_FILE" + echo "- Release Notes: $REPO_URL/blob/main/.docs/releases/${NEW_VERSION}.md" fi echo "" echo "✅ NEXT STEPS:" echo "1. Verify package appears in registry (may take a few minutes)" echo "2. Test installation in a fresh environment" -echo "3. Announce release to users/team" -echo "4. Update documentation if needed" +if [ ${#DOC_ISSUES[@]} -gt 0 ]; then + echo "3. ⚠️ Address documentation issues (${#DOC_ISSUES[@]} found)" + echo "4. Announce release to users/team" + echo "5. Review release notes: .docs/releases/${NEW_VERSION}.md" +else + echo "3. Announce release to users/team" + echo "4. Review release notes: .docs/releases/${NEW_VERSION}.md" +fi echo "" ``` @@ -858,5 +1129,9 @@ Before declaring release complete: - [ ] Tag created and pushed - [ ] Package published (if applicable) - [ ] Platform release created (if applicable) +- [ ] Release notes saved to `.docs/releases/.md` +- [ ] Documentation alignment verified (ROADMAP, READMEs, docs/) +- [ ] Version references updated across all documentation +- [ ] No installation instruction inconsistencies in subpackages This ensures every release is professional, consistent, and safe across any programming language or ecosystem. diff --git a/src/cli/commands/init.ts b/src/cli/commands/init.ts index 4d58d925..45bb77d6 100644 --- a/src/cli/commands/init.ts +++ b/src/cli/commands/init.ts @@ -163,6 +163,13 @@ export const initCommand = new Command('init') const devflowSettingsPath = path.join(claudeDir, 'settings.devflow.json'); const sourceSettingsPath = path.join(claudeSourceDir, 'settings.json'); + // Read template and replace ~ with actual home directory + const settingsTemplate = await fs.readFile(sourceSettingsPath, 'utf-8'); + const settingsContent = settingsTemplate.replace( + /~\/\.devflow\/scripts\/statusline\.sh/g, + path.join(devflowDir, 'scripts', 'statusline.sh') + ); + let settingsAction = ''; if (forceOverride) { @@ -173,7 +180,7 @@ export const initCommand = new Command('init') } catch { // No existing file } - await fs.copyFile(sourceSettingsPath, settingsPath); + await fs.writeFile(settingsPath, settingsContent, 'utf-8'); settingsAction = 'force-installed'; } else { // Safe installation logic @@ -187,17 +194,17 @@ export const initCommand = new Command('init') await fs.access(managedSettingsPath); // managed-settings.json exists - install as settings.devflow.json - await fs.copyFile(sourceSettingsPath, devflowSettingsPath); + await fs.writeFile(devflowSettingsPath, settingsContent, 'utf-8'); settingsAction = 'saved-as-devflow'; } catch { // managed-settings.json doesn't exist - safe to backup and install await fs.rename(settingsPath, managedSettingsPath); - await fs.copyFile(sourceSettingsPath, settingsPath); + await fs.writeFile(settingsPath, settingsContent, 'utf-8'); settingsAction = 'backed-up'; } } catch { // No existing settings.json - install normally - await fs.copyFile(sourceSettingsPath, settingsPath); + await fs.writeFile(settingsPath, settingsContent, 'utf-8'); settingsAction = 'fresh-install'; } } @@ -480,6 +487,7 @@ Pipfile.lock await fs.mkdir(path.join(docsDir, 'status', 'compact'), { recursive: true }); await fs.mkdir(path.join(docsDir, 'reviews'), { recursive: true }); await fs.mkdir(path.join(docsDir, 'audits'), { recursive: true }); + await fs.mkdir(path.join(docsDir, 'releases'), { recursive: true }); docsCreated = true; } catch (error) { // .docs/ structure may already exist From 4e5252a6c6f72a86f09e30c1315aaa1badb2d47a Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Sat, 18 Oct 2025 20:59:56 +0000 Subject: [PATCH 2/5] docs: add production build and test safety standards to global instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add Production Build Optimization section - Never ship test files, debug symbols, or sourcemaps to production - Separate dev/prod build configurations - Build script structure guidelines - Add Test Suite Safety section - Configure tests to run sequentially to prevent crashes - Memory limits and resource cleanup requirements - Framework-specific configuration flags - Reorganize test quality standards under new Testing & Build Standards section These additions prevent common production and testing issues across all projects. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/claude/CLAUDE.md | 84 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 76 insertions(+), 8 deletions(-) diff --git a/src/claude/CLAUDE.md b/src/claude/CLAUDE.md index b54545e8..5a6283c6 100644 --- a/src/claude/CLAUDE.md +++ b/src/claude/CLAUDE.md @@ -93,14 +93,6 @@ ENFORCE these strictly: - Stick to ONE async pattern (don't mix callback/promise/async styles) - NO global state unless explicitly justified -### Test Quality Standards - -Tests must validate BEHAVIOR, not work around BAD DESIGN: -- If tests need complex setup, the design is probably wrong -- If tests have repetitive boilerplate, the API is probably wrong -- If mocking is difficult, dependencies are probably wrong -- Tests should be SIMPLE when design is correct - ### Change Process for Failing Tests 1. **STOP** - Don't fix tests immediately @@ -129,6 +121,82 @@ Before declaring work complete: --- +### Production Build Optimization + +**CRITICAL**: Never ship test files, debug symbols, or sourcemaps to production. + +**Requirements:** +1. **Separate configs** - Dev config (with debug info) vs prod config (optimized) +2. **Exclude tests** - No test files in build output +3. **Exclude debug artifacts** - No sourcemaps, debug symbols, or profiling data +4. **Clean builds** - Remove old artifacts before building +5. **Watch mode** - Fast rebuilds during development + +**Implementation checklist:** +- [ ] Production build excludes test files +- [ ] Production build excludes sourcemaps/debug symbols +- [ ] Separate dev build with full debug info +- [ ] Pre-build cleanup of old artifacts +- [ ] Watch mode for development +- [ ] Verify package contents before publishing + +**File patterns to exclude from production:** +**/.test. +**/.spec. +**/_test. +**/*.map +**/debug/ +**/coverage/ +**/tests/ +**/tests/ + +**Build script structure:** +```json +{ + "prebuild": "clean artifacts", + "build": "production build (no debug)", + "build:dev": "development build (with debug)", + "build:watch": "watch mode for development" +} +``` + +--- + +## Testing & Build Standards + +### Test Quality Standards + +Tests must validate BEHAVIOR, not work around BAD DESIGN: +- If tests need complex setup, the design is probably wrong +- If tests have repetitive boilerplate, the API is probably wrong +- If mocking is difficult, dependencies are probably wrong +- Tests should be SIMPLE when design is correct + +### Test Suite Safety + +**CRITICAL**: Always configure tests to run sequentially to prevent resource +exhaustion and crashes. + +**Requirements:** +1. **Sequential execution** - One test at a time, no parallelism +2. **Memory limits** - Set explicit limits for test processes +3. **Resource cleanup** - Clean temp files/databases before and after tests +4. **Isolation** - Separate unit/integration/e2e test suites + +**Implementation checklist:** +- [ ] Test runner configured for sequential execution (maxWorkers=1, no parallel) +- [ ] Memory limits set in test command (language-specific) +- [ ] Cleanup hooks: before (clean temp files) and after (close connections) +- [ ] Default `test` command runs safely (unit then integration, sequentially) + +**Framework-specific flags:** +- **Vitest/Jest**: `maxWorkers: 1`, `--runInBand`, `fileParallelism: false` +- **pytest**: `-n 0` (no xdist), `--maxprocesses=1` +- **Go**: `-p 1` (parallel=1) +- **Rust**: `-- --test-threads=1` + +--- + ## Architecture Documentation **MANDATORY**: Document ALL architectural decisions directly in code: From 17db189bb6e1ba73e6c05c0878d537869205254d Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Sat, 18 Oct 2025 21:10:24 +0000 Subject: [PATCH 3/5] fix: use proper filename format for release notes (RELEASE_NOTES_v.md) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed release notes filename from: .docs/releases/0.3.0.md To standardized format: .docs/releases/RELEASE_NOTES_v0.3.0.md This makes release notes files more identifiable and follows common conventions. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/claude/agents/devflow/release.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/claude/agents/devflow/release.md b/src/claude/agents/devflow/release.md index 4df28aae..cc0c4ba4 100644 --- a/src/claude/agents/devflow/release.md +++ b/src/claude/agents/devflow/release.md @@ -772,7 +772,7 @@ mkdir -p .docs/releases RELEASE_DATE=$(date +%Y-%m-%d) # Generate release notes file -RELEASE_NOTES_FILE=".docs/releases/${NEW_VERSION}.md" +RELEASE_NOTES_FILE=".docs/releases/RELEASE_NOTES_v${NEW_VERSION}.md" # Write comprehensive release notes cat > "$RELEASE_NOTES_FILE" </dev/null || echo "N/A")" echo "- Tag: $TAG_NAME" -echo "- Release notes: .docs/releases/${NEW_VERSION}.md" +echo "- Release notes: .docs/releases/RELEASE_NOTES_v${NEW_VERSION}.md" echo "" if [ -n "$PUBLISH_CMD" ] && [ "$PUBLISH_CMD" != "echo"* ]; then @@ -1060,7 +1060,7 @@ if command -v gh >/dev/null && git remote get-url origin 2>/dev/null | grep -q " echo "- Release: $REPO_URL/releases/tag/$TAG_NAME" echo "- Commits: $REPO_URL/compare/$LAST_TAG...$TAG_NAME" echo "- Changelog: $REPO_URL/blob/main/$CHANGELOG_FILE" - echo "- Release Notes: $REPO_URL/blob/main/.docs/releases/${NEW_VERSION}.md" + echo "- Release Notes: $REPO_URL/blob/main/.docs/releases/RELEASE_NOTES_v${NEW_VERSION}.md" fi echo "" @@ -1070,10 +1070,10 @@ echo "2. Test installation in a fresh environment" if [ ${#DOC_ISSUES[@]} -gt 0 ]; then echo "3. ⚠️ Address documentation issues (${#DOC_ISSUES[@]} found)" echo "4. Announce release to users/team" - echo "5. Review release notes: .docs/releases/${NEW_VERSION}.md" + echo "5. Review release notes: .docs/releases/RELEASE_NOTES_v${NEW_VERSION}.md" else echo "3. Announce release to users/team" - echo "4. Review release notes: .docs/releases/${NEW_VERSION}.md" + echo "4. Review release notes: .docs/releases/RELEASE_NOTES_v${NEW_VERSION}.md" fi echo "" ``` @@ -1129,7 +1129,7 @@ Before declaring release complete: - [ ] Tag created and pushed - [ ] Package published (if applicable) - [ ] Platform release created (if applicable) -- [ ] Release notes saved to `.docs/releases/.md` +- [ ] Release notes saved to `.docs/releases/RELEASE_NOTES_v.md` - [ ] Documentation alignment verified (ROADMAP, READMEs, docs/) - [ ] Version references updated across all documentation - [ ] No installation instruction inconsistencies in subpackages From 7276e7bfe0d6ae7420c56d87948ea24e8c53b0a6 Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Sat, 18 Oct 2025 21:18:49 +0000 Subject: [PATCH 4/5] feat: formalize audit report storage structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Standardized audit report storage for better organization and tracking: **Directory Structure:** ``` .docs/audits/ ├── / │ ├── security-report..md │ ├── performance-report..md │ ├── architecture-report..md │ ├── tests-report..md │ ├── complexity-report..md │ ├── dependencies-report..md │ ├── documentation-report..md │ ├── typescript-report..md (if applicable) │ ├── database-report..md (if applicable) │ └── comprehensive-review..md └── standalone/ └── -report..md ``` **Changes:** 1. **code-review command:** - Sets up audit directory per branch - Passes AUDIT_BASE_DIR and TIMESTAMP to all sub-agents - Saves comprehensive review to branch-specific directory - Lists all individual audit report paths in final summary 2. **audit-security agent (template):** - Standardized report storage section - Expects variables from orchestrator - Structured report template - Fallback to standalone path if invoked directly 3. **init command:** - Creates .docs/audits/standalone/ directory - Ready for both orchestrated and standalone audits **Benefits:** - Organized by branch (easier to track multiple reviews) - Timestamped for historical tracking - Consistent naming across all audit types - Supports both orchestrated and standalone invocations **Next:** Apply same pattern to other audit-* agents 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/claude/agents/devflow/audit-security.md | 68 ++++++++++++++++++++- src/claude/commands/devflow/code-review.md | 63 +++++++++++++++---- src/cli/commands/init.ts | 2 +- 3 files changed, 119 insertions(+), 14 deletions(-) diff --git a/src/claude/agents/devflow/audit-security.md b/src/claude/agents/devflow/audit-security.md index 24b38a9c..641f8584 100644 --- a/src/claude/agents/devflow/audit-security.md +++ b/src/claude/agents/devflow/audit-security.md @@ -72,4 +72,70 @@ For each finding, include: - Specific remediation steps - Relevant security standards (OWASP, etc.) -Focus on actionable, specific security issues that can be immediately addressed by developers. \ No newline at end of file +Focus on actionable, specific security issues that can be immediately addressed by developers. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Security Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Security Agent + +--- + +## Executive Summary + +{Brief summary of security posture} + +--- + +## Critical Findings + +{CRITICAL severity issues} + +--- + +## High Priority Findings + +{HIGH severity issues} + +--- + +## Medium Priority Findings + +{MEDIUM severity issues} + +--- + +## Low Priority Findings + +{LOW severity issues} + +--- + +## Security Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Security audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/security-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/commands/devflow/code-review.md b/src/claude/commands/devflow/code-review.md index 5986961b..097db9ad 100644 --- a/src/claude/commands/devflow/code-review.md +++ b/src/claude/commands/devflow/code-review.md @@ -70,24 +70,46 @@ else INCLUDE_DB_AUDIT=false fi echo "" + +# Set up audit directory structure +TIMESTAMP=$(date +%Y-%m-%d_%H%M) +AUDIT_BASE_DIR=".docs/audits/${CURRENT_BRANCH}" +mkdir -p "$AUDIT_BASE_DIR" + +echo "📁 Audit reports will be saved to: $AUDIT_BASE_DIR" +echo "" ``` ### Step 3: Launch Specialized Sub-Agents in Parallel -Launch these sub-agents in parallel based on change detection: +Launch these sub-agents in parallel based on change detection. + +**IMPORTANT**: Pass the following variables to each sub-agent: +- `CURRENT_BRANCH`: The branch being reviewed +- `AUDIT_BASE_DIR`: Base directory for audit reports (`.docs/audits/${CURRENT_BRANCH}`) +- `TIMESTAMP`: Current timestamp for report filenames + +Each sub-agent should save its report to: +``` +${AUDIT_BASE_DIR}/-report.${TIMESTAMP}.md +``` + +**Example paths**: +- `.docs/audits/feature-auth/security-report.2025-10-18_1430.md` +- `.docs/audits/feature-auth/performance-report.2025-10-18_1430.md` **Core Audits (Always Run)**: -1. audit-security sub-agent -2. audit-performance sub-agent -3. audit-architecture sub-agent -4. audit-tests sub-agent -5. audit-complexity sub-agent -6. audit-dependencies sub-agent -7. audit-documentation sub-agent +1. audit-security sub-agent → `${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md` +2. audit-performance sub-agent → `${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md` +3. audit-architecture sub-agent → `${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md` +4. audit-tests sub-agent → `${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md` +5. audit-complexity sub-agent → `${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md` +6. audit-dependencies sub-agent → `${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md` +7. audit-documentation sub-agent → `${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md` **Conditional Audits** (automatically detect and skip if not applicable): -8. audit-typescript sub-agent (only if .ts/.tsx files changed or tsconfig.json exists) -9. audit-database sub-agent (only if database changes detected) +8. audit-typescript sub-agent → `${AUDIT_BASE_DIR}/typescript-report.${TIMESTAMP}.md` +9. audit-database sub-agent → `${AUDIT_BASE_DIR}/database-report.${TIMESTAMP}.md` ### Step 4: Synthesize Comprehensive Review @@ -100,7 +122,13 @@ After all sub-agents complete their analysis: ### Step 5: Save Comprehensive Review Document -Create a detailed review document at `.docs/reviews/branch-{BRANCH_NAME}-{YYYY-MM-DD_HHMM}.md`: +Create a detailed review document at `${AUDIT_BASE_DIR}/comprehensive-review.${TIMESTAMP}.md`: + +```bash +REVIEW_FILE="${AUDIT_BASE_DIR}/comprehensive-review.${TIMESTAMP}.md" +``` + +**File structure**: ```markdown # Branch Review - {BRANCH_NAME} @@ -333,7 +361,18 @@ Give the developer a clear, actionable summary: - {Easy fix 1} ({estimated time}) - {Easy fix 2} ({estimated time}) -📄 Full review: .docs/reviews/branch-{branch}-{timestamp}.md +📄 Full review: ${AUDIT_BASE_DIR}/comprehensive-review.${TIMESTAMP}.md + +📁 Individual audit reports: + ${AUDIT_BASE_DIR}/security-report.${TIMESTAMP}.md + ${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md + ${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md + ${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md + ${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md + ${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md + ${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md + (+ typescript-report.${TIMESTAMP}.md if applicable) + (+ database-report.${TIMESTAMP}.md if applicable) 🔄 NEXT STEPS: 1. Address blocking issues above diff --git a/src/cli/commands/init.ts b/src/cli/commands/init.ts index 45bb77d6..453f72b7 100644 --- a/src/cli/commands/init.ts +++ b/src/cli/commands/init.ts @@ -486,7 +486,7 @@ Pipfile.lock try { await fs.mkdir(path.join(docsDir, 'status', 'compact'), { recursive: true }); await fs.mkdir(path.join(docsDir, 'reviews'), { recursive: true }); - await fs.mkdir(path.join(docsDir, 'audits'), { recursive: true }); + await fs.mkdir(path.join(docsDir, 'audits', 'standalone'), { recursive: true }); await fs.mkdir(path.join(docsDir, 'releases'), { recursive: true }); docsCreated = true; } catch (error) { From 98bdb31e4e1b669208243cd3b3f02b18721932c4 Mon Sep 17 00:00:00 2001 From: Dean Sharon Date: Sat, 18 Oct 2025 21:26:53 +0000 Subject: [PATCH 5/5] feat: standardize audit report storage across all agents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apply consistent Report Storage pattern to all 9 audit agents: - audit-security.md - audit-performance.md - audit-architecture.md - audit-complexity.md - audit-tests.md - audit-dependencies.md - audit-documentation.md - audit-typescript.md - audit-database.md Each agent now: - Receives CURRENT_BRANCH, AUDIT_BASE_DIR, TIMESTAMP from /code-review - Saves to .docs/audits//-report..md - Falls back to .docs/audits/standalone/ for standalone runs - Uses consistent report structure with severity sections - Provides specific score and merge recommendation This enables: - Branch-specific audit history - Timestamped audit reports for tracking over time - Easy comparison of audits across commits - Organized audit artifacts separate from code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../agents/devflow/audit-architecture.md | 68 ++++++++++++++++++- src/claude/agents/devflow/audit-complexity.md | 68 ++++++++++++++++++- src/claude/agents/devflow/audit-database.md | 68 ++++++++++++++++++- .../agents/devflow/audit-dependencies.md | 68 ++++++++++++++++++- .../agents/devflow/audit-documentation.md | 66 ++++++++++++++++++ .../agents/devflow/audit-performance.md | 68 ++++++++++++++++++- src/claude/agents/devflow/audit-tests.md | 68 ++++++++++++++++++- src/claude/agents/devflow/audit-typescript.md | 66 ++++++++++++++++++ 8 files changed, 534 insertions(+), 6 deletions(-) diff --git a/src/claude/agents/devflow/audit-architecture.md b/src/claude/agents/devflow/audit-architecture.md index 145b80d1..c0e5d31c 100644 --- a/src/claude/agents/devflow/audit-architecture.md +++ b/src/claude/agents/devflow/audit-architecture.md @@ -81,4 +81,70 @@ For each finding, include: - Example implementations - Migration strategies for large changes -Focus on structural issues that affect long-term maintainability and team productivity. \ No newline at end of file +Focus on structural issues that affect long-term maintainability and team productivity. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/architecture-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Architecture Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Architecture Agent + +--- + +## Executive Summary + +{Brief summary of architectural quality} + +--- + +## Critical Issues + +{CRITICAL severity fundamental architectural flaws} + +--- + +## High Priority Issues + +{HIGH severity significant design issues} + +--- + +## Medium Priority Issues + +{MEDIUM severity pattern inconsistencies} + +--- + +## Low Priority Issues + +{LOW severity minor organizational improvements} + +--- + +## Architecture Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Architecture audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/architecture-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/agents/devflow/audit-complexity.md b/src/claude/agents/devflow/audit-complexity.md index ca686410..146a8fdc 100644 --- a/src/claude/agents/devflow/audit-complexity.md +++ b/src/claude/agents/devflow/audit-complexity.md @@ -99,4 +99,70 @@ For each finding, include: - Example improvements - Estimated effort for fixes -Focus on complexity issues that significantly impact code maintainability, readability, and development velocity. \ No newline at end of file +Focus on complexity issues that significantly impact code maintainability, readability, and development velocity. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/complexity-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Complexity Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Complexity Agent + +--- + +## Executive Summary + +{Brief summary of complexity and maintainability} + +--- + +## Critical Issues + +{CRITICAL severity extremely complex code hampering development} + +--- + +## High Priority Issues + +{HIGH severity significant complexity issues} + +--- + +## Medium Priority Issues + +{MEDIUM severity moderate complexity improvements needed} + +--- + +## Low Priority Issues + +{LOW severity minor complexity optimizations} + +--- + +## Maintainability Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Complexity audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/complexity-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/agents/devflow/audit-database.md b/src/claude/agents/devflow/audit-database.md index a424f5fe..854e4fd2 100644 --- a/src/claude/agents/devflow/audit-database.md +++ b/src/claude/agents/devflow/audit-database.md @@ -104,4 +104,70 @@ For each finding, include: - Migration considerations - Monitoring suggestions -Focus on database issues that affect data integrity, query performance, or system scalability. \ No newline at end of file +Focus on database issues that affect data integrity, query performance, or system scalability. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/database-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Database Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Database Agent + +--- + +## Executive Summary + +{Brief summary of database design and performance} + +--- + +## Critical Issues + +{CRITICAL severity data integrity or severe performance issues} + +--- + +## High Priority Issues + +{HIGH severity significant performance or design problems} + +--- + +## Medium Priority Issues + +{MEDIUM severity optimization opportunities} + +--- + +## Low Priority Issues + +{LOW severity minor improvements} + +--- + +## Database Health Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Database audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/database-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/agents/devflow/audit-dependencies.md b/src/claude/agents/devflow/audit-dependencies.md index 6361ebbf..4b5559cf 100644 --- a/src/claude/agents/devflow/audit-dependencies.md +++ b/src/claude/agents/devflow/audit-dependencies.md @@ -105,4 +105,70 @@ For each finding, include: - Alternative package suggestions - Update compatibility notes -Focus on dependency issues that pose security, legal, or maintenance risks to the project. \ No newline at end of file +Focus on dependency issues that pose security, legal, or maintenance risks to the project. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/dependencies-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Dependency Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Dependencies Agent + +--- + +## Executive Summary + +{Brief summary of dependency health and security} + +--- + +## Critical Issues + +{CRITICAL severity security vulnerabilities requiring immediate action} + +--- + +## High Priority Issues + +{HIGH severity significant security or legal risks} + +--- + +## Medium Priority Issues + +{MEDIUM severity maintenance or performance concerns} + +--- + +## Low Priority Issues + +{LOW severity minor improvements or optimizations} + +--- + +## Dependency Health Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Dependency audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/dependencies-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/agents/devflow/audit-documentation.md b/src/claude/agents/devflow/audit-documentation.md index 5b364316..967a759e 100644 --- a/src/claude/agents/devflow/audit-documentation.md +++ b/src/claude/agents/devflow/audit-documentation.md @@ -305,3 +305,69 @@ Detect documentation format from language and validate accordingly. - Show correct examples Focus on documentation issues that prevent users from using the software correctly or developers from understanding the codebase. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/documentation-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Documentation Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Documentation Agent + +--- + +## Executive Summary + +{Brief summary of documentation quality and alignment} + +--- + +## Critical Issues + +{CRITICAL severity documentation contradicts code behavior} + +--- + +## High Priority Issues + +{HIGH severity missing docs for public APIs or key features} + +--- + +## Medium Priority Issues + +{MEDIUM severity incomplete or unclear documentation} + +--- + +## Low Priority Issues + +{LOW severity minor improvements or style issues} + +--- + +## Documentation Quality Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Documentation audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/documentation-report.${TIMESTAMP}.md` diff --git a/src/claude/agents/devflow/audit-performance.md b/src/claude/agents/devflow/audit-performance.md index a8d78430..c591adc4 100644 --- a/src/claude/agents/devflow/audit-performance.md +++ b/src/claude/agents/devflow/audit-performance.md @@ -82,4 +82,70 @@ For each finding, include: - Implementation examples - Measurement suggestions -Focus on performance issues that will have measurable impact on user experience or system scalability. \ No newline at end of file +Focus on performance issues that will have measurable impact on user experience or system scalability. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/performance-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Performance Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Performance Agent + +--- + +## Executive Summary + +{Brief summary of performance analysis} + +--- + +## Critical Issues + +{CRITICAL severity performance bottlenecks} + +--- + +## High Priority Issues + +{HIGH severity optimization opportunities} + +--- + +## Medium Priority Issues + +{MEDIUM severity performance improvements} + +--- + +## Low Priority Issues + +{LOW severity minor optimizations} + +--- + +## Performance Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Performance audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/performance-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/agents/devflow/audit-tests.md b/src/claude/agents/devflow/audit-tests.md index c2763976..be1dbb74 100644 --- a/src/claude/agents/devflow/audit-tests.md +++ b/src/claude/agents/devflow/audit-tests.md @@ -452,4 +452,70 @@ For each finding, include: - Example implementations - Refactoring suggestions -Focus on test issues that affect code confidence, development velocity, and regression detection capabilities. \ No newline at end of file +Focus on test issues that affect code confidence, development velocity, and regression detection capabilities. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/tests-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# Test Quality Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow Test Quality Agent + +--- + +## Executive Summary + +{Brief summary of test coverage and quality} + +--- + +## Critical Issues + +{CRITICAL severity major test gaps or quality issues} + +--- + +## High Priority Issues + +{HIGH severity significant testing problems} + +--- + +## Medium Priority Issues + +{MEDIUM severity test improvement opportunities} + +--- + +## Low Priority Issues + +{LOW severity minor test optimizations} + +--- + +## Test Coverage Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ Test quality audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/tests-report.${TIMESTAMP}.md` \ No newline at end of file diff --git a/src/claude/agents/devflow/audit-typescript.md b/src/claude/agents/devflow/audit-typescript.md index 44249426..8591ed1d 100644 --- a/src/claude/agents/devflow/audit-typescript.md +++ b/src/claude/agents/devflow/audit-typescript.md @@ -292,3 +292,69 @@ CHANGED_TS_FILES=$(git diff --name-only --diff-filter=d HEAD | grep -E '\.(ts|ts - `3`: Medium severity issues found Focus on actionable, specific TypeScript issues that improve type safety and code quality. + +## Report Storage + +**IMPORTANT**: When invoked by `/code-review`, save your audit report to the standardized location: + +```bash +# Expect these variables from the orchestrator: +# - CURRENT_BRANCH: Current git branch name +# - AUDIT_BASE_DIR: Base directory (.docs/audits/${CURRENT_BRANCH}) +# - TIMESTAMP: Timestamp for report filename + +# Save report to: +REPORT_FILE="${AUDIT_BASE_DIR}/typescript-report.${TIMESTAMP}.md" + +# Create report +cat > "$REPORT_FILE" <<'EOF' +# TypeScript Audit Report + +**Branch**: ${CURRENT_BRANCH} +**Date**: $(date +%Y-%m-%d) +**Time**: $(date +%H:%M:%S) +**Auditor**: DevFlow TypeScript Agent + +--- + +## Executive Summary + +{Brief summary of TypeScript type safety and code quality} + +--- + +## Critical Issues + +{CRITICAL severity type safety completely bypassed} + +--- + +## High Priority Issues + +{HIGH severity significant type safety or architectural issues} + +--- + +## Medium Priority Issues + +{MEDIUM severity moderate code quality issues} + +--- + +## Low Priority Issues + +{LOW severity minor improvement opportunities} + +--- + +## Type Safety Score: {X}/10 + +**Recommendation**: {BLOCK MERGE | REVIEW REQUIRED | APPROVED WITH CONDITIONS | APPROVED} + +EOF + +echo "✅ TypeScript audit report saved to: $REPORT_FILE" +``` + +**If invoked standalone** (not by /code-review), use a simpler path: +- `.docs/audits/standalone/typescript-report.${TIMESTAMP}.md`