Skip to content

itdove/devaiflow#383: Enhance daf link to support session rename and in-agent usage#398

Draft
itdove wants to merge 1 commit into
mainfrom
383
Draft

itdove/devaiflow#383: Enhance daf link to support session rename and in-agent usage#398
itdove wants to merge 1 commit into
mainfrom
383

Conversation

@itdove
Copy link
Copy Markdown
Owner

@itdove itdove commented May 31, 2026

Now I have enough context to fill in the template.

Jira Issue: #383

Description

Enhances the daf link command to support session renaming via a new --rename-prefix option and enables it to be called from inside Claude sessions.

Motivation: As part of the effort to remove thin daf git command wrappers and leverage gh/glab CLI tools directly via skills (#383-#386), daf link needs to absorb the session-rename functionality currently embedded in daf git create. This is a prerequisite for removing daf git create (#384).

Changes:

  • Added --rename-prefix option to daf link that renames the session to {prefix}-{issue_key_slug} (e.g., creation-itdove-devaiflow-456)
  • Removed/conditionalized @require_outside_claude decorator so daf link can be called from inside Claude sessions
  • Reuses existing issue_key_to_session_name() from sync_command.py for consistent slug generation
  • Updated CLI option registration in main.py
  • Added tests for the new rename functionality

Assisted-by: Claude

Testing

Steps to test

  1. Pull down the PR
  2. Create a test session: daf new my-test-session
  3. Create a GitHub issue: gh issue create --title "Test issue" --body "test" --label enhancement
  4. Link and rename: daf link my-test-session --jira "#<issue_number>" --rename-prefix creation
  5. Verify the session was renamed to creation-<owner>-<repo>-<issue_number>
  6. Verify issue_key and issue_metadata are set on the renamed session
  7. Test calling daf link from inside a Claude session to confirm the @require_outside_claude restriction is lifted
  8. Run the test suite: pytest tests/test_link_command.py

Scenarios tested

  • daf link with --rename-prefix renames session correctly using issue_key_to_session_name() slug format
  • daf link without --rename-prefix continues to work as before (no rename, just links metadata)
  • daf link callable from inside Claude sessions (in-agent usage)
  • Unit tests pass for the new rename functionality

Deployment considerations

  • This code change is ready for deployment on its own
  • This code change requires the following considerations before being deployed:

- Add --rename-prefix CLI option that renames the session to
  {prefix}-{issue_key_slug} after linking
- Include renamed_from field in JSON output when rename occurs
- Update display output to use the new session name after rename
- Remove @require_outside_claude decorator from link_jira function
- Add tests for rename-prefix functionality including edge cases

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

Co-Authored-By: Claude <noreply@anthropic.com>
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