rdev/cmd/sdlc/cmd_archive.go
jordan 56e3f83955 feat: add auth scopes, OpenAPI docs, SDLC guides, and code quality improvements
- Add auth.RequireScope() to all handler routes for proper authorization
- Add SDLC OpenAPI endpoint documentation (state, features, tasks, branches, merge, archive, orchestrator)
- Add SDLC documentation guides (getting-started, cli-reference, api-reference, command-catalog)
- Add artifact_test.go for SDLC artifact coverage
- Add CLAUDE.md rules: auth scopes requirement, error wrapping with %w
- Fix error wrapping to use %w instead of %v throughout codebase
- Improve CLI merge command with conflict detection and resolution
- Fix handler tests to include auth middleware for RequireScope
- Add cookbook tree runner scripts for automated testing

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:55:50 -07:00

48 lines
896 B
Go

package main
import (
"fmt"
"github.com/orchard9/rdev/internal/sdlc"
"github.com/spf13/cobra"
)
var archiveCmd = &cobra.Command{
Use: "archive <slug>",
Short: "Archive a released feature",
Args: cobra.ExactArgs(1),
RunE: func(_ *cobra.Command, args []string) error {
root := mustResolveRoot()
slug := args[0]
if err := sdlc.ArchiveFeature(root, slug); err != nil {
return err
}
// Remove from active work in state
state, err := sdlc.LoadState(root)
if err != nil {
return err
}
state.RemoveActiveFeature(slug)
state.RecordAction("ARCHIVE_FEATURE", slug, "cli", "success")
if err := state.Save(root); err != nil {
return err
}
if jsonOutput {
return printJSON(map[string]string{
"feature": slug,
"status": "archived",
})
}
fmt.Printf("Archived: %s\n", slug)
return nil
},
}
func init() {
rootCmd.AddCommand(archiveCmd)
}