Feature dev

From sequenzia/agent-alchemy · View interactive version

Feature dev is an AI agent skill from the GitHub repository sequenzia/agent-alchemy. Feature development workflow with exploration, architecture, implementation, and review phases. Use for implementing new features or significant changes.

How to use this skill

Skill file

Feature Development Workflow

Execute a structured 7-phase feature development workflow. This workflow guides you through understanding, exploring, designing, implementing, and reviewing a feature.

Phase Overview

Execute these phases in order, completing ALL of them:

  1. Discovery - Understand the feature requirements
  2. Codebase Exploration - Map relevant code areas
  3. Clarifying Questions - Resolve ambiguities
  4. Architecture Design - Design the implementation approach
  5. Implementation - Build the feature
  6. Quality Review - Review for issues
  7. Summary - Document accomplishments

Phase 1: Discovery

Goal: Understand what the user wants to build.

Accept the following inputs:

  1. Analyze the feature description:
  1. Summarize your understanding to the user. Prompt the user to confirm if your understanding is correct before proceeding.

Phase 2: Codebase Exploration

Goal: Understand the relevant parts of the codebase.

  1. Run deep analysis workflow:
  1. Present the synthesized analysis to the user.

Phase 3: Clarifying Questions

Goal: Resolve any ambiguities before designing.

  1. Review the feature requirements and exploration findings.
  1. Identify underspecified aspects:
  1. Ask clarifying questions:

Prompt the user for answers to critical unknowns. Only ask questions that would significantly impact the implementation.

If no clarifying questions are needed, inform the user and proceed.


Phase 4: Architecture Design

Goal: Design the implementation approach.

  1. Load skills for this phase:
  1. Develop 2-3 architecture approaches:

Design 2-3 approaches with different trade-offs:

```

Approach 1: Design a minimal, focused approach prioritizing simplicity

Approach 2: Design a flexible, extensible approach prioritizing future changes

Approach 3: Design an approach optimized for the project's existing patterns (if applicable)

```

For each approach, delegate to an architecture design task (from the core-tools package):

```

Feature: [feature description]

Design approach: [specific approach]

Based on the codebase exploration:

[Summary of relevant files and patterns]

Design an implementation that:

Return a detailed implementation blueprint.

```

  1. Present approaches:
  1. User chooses approach:

Prompt the user to select an approach or request modifications.

  1. Generate ADR artifact:

Phase 5: Implementation

Goal: Build the feature.

  1. Require explicit approval:

Ask the user: "Ready to begin implementation of [feature] using [chosen approach]?"

Wait for confirmation before proceeding.

  1. Read all relevant files:

Before making any changes, read the complete content of every file you'll modify.

  1. Implement the feature:
  1. Test if applicable:
  1. Proceed immediately to Phase 6.

Phase 6: Quality Review

Goal: Review the implementation for issues.

  1. Refer to the code-quality skill and apply its guidance.
  1. Launch 3 code review tasks with different focuses:

```

Review 1: Review for correctness and edge cases

Review 2: Review for security and error handling

Review 3: Review for maintainability and code quality

```

For each review task:

```

Review focus: [specific focus]

Files to review:

[List of files modified/created]

Review the implementation and report:

Only report issues with confidence >= 80.

```

  1. Aggregate findings:
  1. Present findings:

Show the user:

  1. User decides:

Prompt the user to choose:

  1. If fixing: make the changes and re-review if needed.
  1. Proceed immediately to Phase 7.

Phase 7: Summary

Goal: Document and celebrate accomplishments.

  1. Summarize accomplishments:

Present to the user:

  1. Update CHANGELOG.md:
  1. Final message:

Congratulate the user and offer next steps:


Error Handling

If any phase fails:

  1. Explain what went wrong
  2. Prompt the user to choose:

ADR Template

Use this template when generating Architecture Decision Records in Phase 4.

Template

# ADR-NNNN: [Title]

**Date:** YYYY-MM-DD
**Status:** Accepted
**Feature:** [Feature name/description]

## Context

[Describe the situation that led to this decision. Include:]
- What problem are we solving?
- What constraints do we have?
- What are the driving forces?

## Decision

[State the decision clearly and concisely. Include:]
- What approach are we taking?
- Key architectural choices made
- Technologies/patterns selected

## Consequences

### Positive
- [Benefit 1]
- [Benefit 2]
- [Benefit 3]

### Negative
- [Tradeoff 1]
- [Tradeoff 2]

### Risks
- [Risk 1 and mitigation]
- [Risk 2 and mitigation]

## Alternatives Considered

### Alternative 1: [Name]
[Brief description]
- **Pros:** [List]
- **Cons:** [List]
- **Why rejected:** [Reason]

### Alternative 2: [Name]
[Brief description]
- **Pros:** [List]
- **Cons:** [List]
- **Why rejected:** [Reason]

## Implementation Notes

[Any specific implementation guidance:]
- Key files to create/modify
- Important patterns to follow
- Integration points

## References

- [Link to related docs]
- [Link to similar implementations]

Usage Instructions

  1. Determine ADR number:
  1. Create filename:
  1. Fill in the template:
  1. Save location:

Example ADR

# ADR-0003: User Authentication with JWT

**Date:** 2024-01-15
**Status:** Accepted
**Feature:** User login and session management

## Context

The application needs user authentication. Users should be able to log in and maintain sessions across page refreshes. The API is stateless and serves both web and mobile clients.

Key constraints:
- Must work with stateless API
- Must support multiple clients
- Session should persist across browser refreshes
- Need to handle token refresh gracefully

## Decision

We will use JWT (JSON Web Tokens) for authentication with the following approach:
- Access tokens with 15-minute expiry
- Refresh tokens with 7-day expiry stored in httpOnly cookies
- Token refresh handled automatically by API client interceptor

## Consequences

### Positive
- Stateless authentication scales horizontally
- Works seamlessly with mobile clients
- Standard approach with good library support

### Negative
- Cannot immediately invalidate tokens (must wait for expiry)
- More complex than session-based auth
- Requires careful handling of token storage

### Risks
- Token theft: Mitigated by short access token expiry and httpOnly cookies
- XSS attacks: Mitigated by not storing tokens in localStorage

## Alternatives Considered

### Alternative 1: Session-based authentication
Using server-side sessions with cookies.
- **Pros:** Simple, immediate revocation
- **Cons:** Requires session storage, harder to scale
- **Why rejected:** Doesn't fit our stateless API architecture

### Alternative 2: OAuth 2.0 with external provider
Using Google/GitHub for authentication.
- **Pros:** No password management, trusted providers
- **Cons:** Dependency on external services, some users prefer local accounts
- **Why rejected:** Users need local account option

## Implementation Notes

- Create `src/auth/` module for authentication logic
- Use `jsonwebtoken` library for JWT operations
- Add middleware to verify tokens on protected routes
- Store refresh token in `users.refresh_token` column

## References

- JWT Best Practices: https://tools.ietf.org/html/rfc8725
- OWASP Auth Cheatsheet: https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html

Changelog Entry Template

Use this template when adding feature changelog entries in Phase 7.

Entry Format

Entries should be concise, user-focused lines under the appropriate category:

### Added
- Add [feature name] with [key capability]

### Changed
- Update [component] to [new behavior]

### Fixed
- Fix [issue description]

Usage Instructions

  1. Locate CHANGELOG.md:
  1. Find the [Unreleased] section:
  1. Choose the appropriate category:
  1. Write concise entries:

CHANGELOG.md Structure

If creating a new CHANGELOG.md:

# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/),
and this project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

### Added
- Your new feature entry here

Example Entries

Simple Feature
### Added
- Add user profile editing with avatar upload support
Feature with Multiple Changes
### Added
- Add profile edit form with real-time validation
- Add avatar upload with image cropping

### Changed
- Update navigation to display user avatar
Referencing ADRs
### Added
- Add JWT-based user authentication (see ADR-0003)

Categories Reference

Use these categories from Keep a Changelog (in this order):

| Category | Use For |

|----------|---------|

| Added | New features |

| Changed | Changes to existing functionality |

| Deprecated | Features that will be removed in future |

| Removed | Features that were removed |

| Fixed | Bug fixes |

| Security | Security improvements |

For feature development, Added and Changed are most common.

Tips

Integration Notes

What this component does: Orchestrates a complete feature development lifecycle from requirements through implementation and review, with architecture decision records and changelog updates.

Capabilities needed:

Adaptation guidance:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.