Implements deterministic feature lifecycle management for agent-driven
development. Agents use the CLI in pods; operators control via REST API.
Library (internal/sdlc/):
- Feature lifecycle with 10 phases (draft → released)
- Classifier engine with priority-ordered rules
- Artifact tracking with approval workflow
- Task management within features
- YAML-based state persistence
CLI (cmd/sdlc/):
- init, state, next, feature, artifact, task, query commands
- --json flag for machine-readable output
- Runs inside project pods
API (21 endpoints under /projects/{id}/sdlc/):
- State: GET /state, GET /next
- Features: CRUD + transition/block/unblock
- Artifacts: approve/reject per type
- Tasks: add/start/complete/block
- Queries: blocked/ready/needs-approval
Architecture:
- Port: SDLCExecutor interface (internal/port/)
- Adapter: kubectl exec into pods (internal/adapter/kubernetes/)
- Service: pod resolution + logging (internal/service/)
- Handlers: 5 files under 500-line limit (internal/handlers/)
Also includes template upgrades (chassis framework, UI components,
OpenAPI helpers, backend/frontend guides) and component improvements.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.1 KiB
Go
55 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"path/filepath"
|
|
|
|
"github.com/orchard9/rdev/internal/sdlc"
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var initProjectName string
|
|
|
|
var initCmd = &cobra.Command{
|
|
Use: "init",
|
|
Short: "Initialize .sdlc/ directory structure",
|
|
RunE: func(_ *cobra.Command, _ []string) error {
|
|
root := mustResolveRoot()
|
|
|
|
name := initProjectName
|
|
if name == "" {
|
|
name = filepath.Base(root)
|
|
}
|
|
|
|
if err := sdlc.Init(root, name); err != nil {
|
|
return err
|
|
}
|
|
|
|
if jsonOutput {
|
|
printJSON(map[string]string{
|
|
"status": "initialized",
|
|
"root": root,
|
|
"project": name,
|
|
})
|
|
return nil
|
|
}
|
|
|
|
fmt.Println("Initialized .sdlc/ structure")
|
|
fmt.Printf(" Root: %s\n", root)
|
|
fmt.Printf(" Project: %s\n", name)
|
|
fmt.Println()
|
|
fmt.Println("Created directories:")
|
|
for _, dir := range sdlc.SubDirs() {
|
|
fmt.Printf(" .sdlc/%s/\n", dir)
|
|
}
|
|
fmt.Println()
|
|
fmt.Println("Next: sdlc feature create <slug> --title \"Feature Name\"")
|
|
return nil
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
initCmd.Flags().StringVar(&initProjectName, "name", "", "project name (default: directory name)")
|
|
rootCmd.AddCommand(initCmd)
|
|
}
|