展示HN:AI SDLC脚手架,用于AI辅助软件开发的仓库模板
Show HN: AI SDLC Scaffold, repo template for AI-assisted software development

原始链接: https://github.com/pangon/ai-sdlc-scaffold/

## AI-SDLC 框架:AI优先软件开发模板 这个仓库模板提供了一个结构化的框架,用于构建带有AI代理(特别是Claude Code)的软件,同时保持人工监督。它本身不是一个工具,而是一个起点——一个“脚手架”,用于克隆和定制以适应您的项目。 该框架将软件开发生命周期(SDLC)组织成四个阶段:**目标、设计、代码和部署**,每个阶段都有定义的文件夹、工件和代理指令。一个核心原则是**“一切都在仓库中”**——所有项目知识(需求、架构、决策、代码)都受到版本控制,*位于*仓库内部,供AI代理访问。 主要特性包括**AI优先开发**,优先执行代理任务并由人工引导;通过分层指令和决策跟踪实现**上下文窗口效率**;以及**决策捕获**,记录所有代理决策以供审查。 该框架利用预构建的Claude Code技能(通过`/skill-name`激活)来自动化诸如需求收集、设计文档、任务生成和代码实现等任务。它强调通过工件ID和双文件系统(活动记录和历史记录)实现可追溯性。 要开始使用,请克隆仓库,使用`/SDLC-init`初始化它,然后通过各个阶段,利用提供的技能或自定义提示。

## AI SDLC 框架总结 一个新的开源仓库模板旨在构建辅助人工智能的软件开发流程,而不仅仅是代码生成。该模板由一位拥有25年软件工程经验的专家创建,名为“AI SDLC 框架”(可在GitHub上找到),专注于编码前的阶段——目标、用户故事、需求和架构——为人工智能代理提供关键上下文。 该框架设计为可与Claude Code等工具配合使用,但与工具无关。它将人工智能指导组织成三个层次:简洁的指令文件、按需加载的详细“技能”,以及不断演化的项目成果(记录决策、需求等的文件)。这种分层方法最大限度地提高了上下文窗口的效率。 该工作流程强调结构化的顺序流程——类似于瀑布模型——虽然对于人类团队来说可能有些繁琐,但非常适合人工智能代理,并防止无目的的代码编写。创建者使用简短、集中的会话,利用框架的组织来维护跨交互的上下文。 目前,一个限制是集成现有的UI/UX设计(如Figma)。创建者欢迎反馈和贡献,并承认需要基准测试来证明该模板的有效性。
相关文章

原文

A repository template for AI-first software development with Claude Code that organizes the entire software development lifecycle (SDLC) into four phases — Objectives, Design, Code, Deploy — each with folder structure, artifacts, and agent instructions that encode what to check, when to check it, and what to do, so that all project knowledge lives inside the repository and a human can supervise at a high level.

It is not a tool, a library, or an application. It is a starting scaffold — you clone or copy it, then fill it in as your real project takes shape.

The scaffold is built on four core principles:

  1. AI-first development model — designed for AI agents doing the work while a human supervises, defines objectives, and steers direction.
  2. Everything-in-repo — objectives, requirements, architecture, decisions, and task tracking all live alongside the source code, versioned and always accessible to agents without external tools.
  3. Context-window efficiency — hierarchical instructions, two-file decision records, and phase-level indexes minimize how many tokens an agent must load.
  4. Decision capture, not suppression — agents decide autonomously within established patterns; all decisions are recorded in the repository for human review and consistency.

For a deeper discussion of the rationale, core principles, and design choices see RATIONALE.md.

Option A — Use degit (recommended)

npx degit pangon/ai-sdlc-scaffold my-project
cd my-project
rm -f CONTRIBUTING.md CONTRIBUTORS.md LICENSE NOTICE RATIONALE.md README.md
git init && git add -A && git commit -m "Initial scaffold"

degit copies the repository contents without carrying over git history, giving you a clean starting point. It requires Node.js but does not install any dependency in your project. The rm step removes repo-specific files that are not part of the scaffold.

  1. Download or clone this repository.
  2. Copy all files and directories (including hidden ones like .claude/) into your new project folder.
  3. Remove the .git/ directory to start with a fresh history.
  4. Remove repo-specific files: rm -f CONTRIBUTING.md CONTRIBUTORS.md LICENSE NOTICE RATIONALE.md README.md.
  5. Initialize a new repository: git init && git add -A && git commit -m "Initial scaffold".
  1. Run /SDLC-init in Claude Code: the initialization skill sets up the project description in CLAUDE.md so agents have the right context from the start.
  2. Work through the phases (Objectives → Design → Code → Deploy) using the built-in skills — type / followed by a skill name to automate each step, from requirements gathering to deployment. Alternatively, you can use custom prompts: the CLAUDE.<phase>.md hierarchy provides all the context the agent needs to operate correctly in each phase.

Manual edits are strongly discouraged. All changes to artifacts and code should go through an AI agent whose behavior is governed by the instruction files, existing artifacts, and ideally a skill. This ensures that procedures are followed, decisions are recorded, and the system stays consistent.

├── CLAUDE.md                         # Root AI instructions (start here)
├── RATIONALE.md                      # Core principles and design rationale
│
├── 1-objectives/                     # WHAT and WHY
│   ├── CLAUDE.objectives.md          # Phase instructions and artifact indexes
│   ├── stakeholders.md               # Stakeholder definitions
│   ├── goals/                        # GOAL-kebab-name.md + _template.md
│   ├── user-stories/                 # US-kebab-name.md + _template.md
│   ├── requirements/                 # REQ-CLASS-kebab-name.md + _template.md
│   ├── assumptions/                  # ASM-kebab-name.md + _template.md
│   └── constraints/                  # CON-kebab-name.md + _template.md
│
├── 2-design/                         # HOW
│   ├── CLAUDE.design.md              # Phase instructions and decisions index
│   ├── architecture.md               # System architecture overview
│   ├── data-model.md                 # Data structures and schemas
│   ├── api-design.md                 # API specifications
│   └── decisions/                    # DEC-kebab-name.md + DEC-kebab-name.history.md
│
├── 3-code/                           # BUILD
│   ├── CLAUDE.code.md                # Phase instructions, decisions index, component guidelines
│   ├── tasks.md                      # Development task tracker
│   └── <component>/                  # Per-component directories (created by /SDLC-decompose)
│       └── CLAUDE.<component>.md     # Component description, decisions index, addressed requirements
│
├── 4-deploy/                         # SHIP
│   ├── CLAUDE.deploy.md              # Phase instructions
│   └── runbooks/                     # Operational procedures + _template.md
│
└── .claude/skills/                   # Claude Code skills (automation layer)
    ├── SDLC-init/SKILL.md            # guided project initialization
    ├── SDLC-elicit/SKILL.md          # requirements elicitation
    ├── SDLC-design/SKILL.md          # design documents
    ├── SDLC-decompose/SKILL.md       # component identification
    ├── SDLC-implementation-plan/SKILL.md  # task generation
    ├── SDLC-execute-next-task/SKILL.md    # task execution
    └── SDLC-status/SKILL.md          # /SDLC-status — project dashboard
  • Phase-based development: each phase has a directory and a CLAUDE.<phase>.md file that extends the root CLAUDE.md. Phase gates define minimum preconditions before advancing.
  • Traceability: every artifact references others by descriptive ID (GOAL-reduce-latency, REQ-F-search-by-name, DEC-use-postgres), creating a chain from business need to running code. Index tables link directly to artifact files for easy navigation.
  • Two-file decisions: active record (DEC-kebab-name.md) for enforcement, history file (DEC-kebab-name.history.md) for audit trail. Indexed per phase with trigger conditions.
  • Context-window efficiency: hierarchical instructions, phase-level indexes, and the active/history split minimize how many tokens an agent needs to load.

How the Scaffold Gets Populated

The scaffold starts empty. Project-specific artifacts are created progressively as you work through each phase — not all at once.

  • At project start (/SDLC-init): set the project description in CLAUDE.md so agents have the right context from the start.
  • During the Objectives phase (/SDLC-elicit): define stakeholders, goals, constraints, assumptions, user stories, and requirements.
  • During the Design phase (/SDLC-design): draft architecture, data model, API design. Decisions are recorded as they emerge during design work.
  • At the start of the Code phase (/SDLC-decompose, /SDLC-implementation-plan): identify components (creating per-component directories under 3-code/), then generate the task backlog.
  • During the Code phase (/SDLC-execute-next-task): implement tasks one at a time — each call picks the next pending task, writes code and tests, and updates the task status.

Claude skills automate each phase of the lifecycle. Type /skill-name in Claude Code to invoke them. Each skill reads the root CLAUDE.md and the relevant phase instructions before acting.

Skill Purpose
/SDLC-init Guided project initialization — sets the project description in CLAUDE.md so agents have the right context from the start.
Skill Purpose
/SDLC-elicit Interactive requirements elicitation — guides you through stakeholders, goals, assumptions, constraints, user stories, and requirements in the prescribed order. Creates artifacts from templates, updates indexes. Also performs gap analysis on existing artifacts.
Skill Purpose
/SDLC-design Draft or update architecture, data model, or API design documents based on approved requirements. Covers design completeness assessment. References requirements by ID for traceability.
/SDLC-decompose Identify distinct software components from design artifacts and create per-component directories under 3-code/. Use when transitioning from Design to Code phase.
Skill Purpose
/SDLC-implementation-plan Create a phased implementation plan from design artifacts. Populates tasks.md with short tasks grouped into incremental development phases, each ending with a deployable/testable system.
/SDLC-execute-next-task Execute the next pending task from the implementation plan. Finds the first actionable task, implements with tests, handles design gaps, and updates task status.
Skill Purpose
/SDLC-status Project-wide dashboard: artifact counts per phase, task progress, phase-gate readiness, traceability health, and assessment freshness.
/SDLC-init                  ← set up project
/SDLC-elicit                ← define stakeholders, goals, requirements
                            ← human approves artifacts (Draft → Approved)
/SDLC-design                ← draft architecture, data model, API design
/SDLC-decompose             ← identify components, create directories
/SDLC-implementation-plan   ← generate task backlog
/SDLC-execute-next-task     ← execute tasks one by one
/SDLC-status                ← anytime: full project overview

Licensed under the Apache License, Version 2.0. See LICENSE.

Contributions are accepted under the same license (inbound = outbound). See CONTRIBUTING.md.

联系我们 contact @ memedata.com