sdd-riper-one
Original:🇨🇳 Chinese
Translated
1 scripts
A skill that implements the SDD-RIPER methodology into strictly executable processes. It is applied in code/architecture tasks for "function-level and project-level CodeMap generation, full-modal requirement context bundling, Spec-driven R&D, and RIPER phase gate advancement", and is suitable for multi-round collaborative development with Claude/Codex/other CLI Agents.
9installs
Sourcehuisezhiyin/sdd-riper
Added on
NPX Install
npx skill4agent add huisezhiyin/sdd-riper sdd-riper-oneTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →SDD-RIPER-ONE Skill
Global Behaviors and Security Bottom Lines (Global Safeguards)
- High-risk Operation Blocking: Never silently execute or propose executing (with any parameters, especially
git clean) to prevent irreversible loss of users' uncommitted workspace data.-fdx - R&D Discipline:
- : Do not enter code implementation before the Spec is formed and persisted.
No Spec, No Code - : Environment modifications or high-risk changes are prohibited before execution permission is obtained.
No Approval, No Execute - : Any chat resolution or latest change must be synced back to the Spec, which serves as the only single source of truth.
Spec is Truth
Core Positioning
- Read once first:
references/sdd-riper-one-protocol.md - General framework: , follow SDD throughout the process and maintain the Spec continuously
Pre-Research -> RIPER - Three bottom lines: ,
No Spec, No Code,Spec is TruthReverse Sync - /
create_codemapare input preparations for Pre-Research;build_context_bundleis the RIPER startup command (the first step to enter Research, while completing the Pre-Research closure)sdd_bootstrap - RIPER main process:
Research -> (Innovate, optional) -> Plan -> Execute -> Review - Do not reload the entire Skill/Spec in each round of dialogue; by default, only read the sections required for the current phase
- Spec audience stratification and context protection: The primary audience of Spec is humans (persisted task context and organizational memory), and the secondary audience is models. The core value of the protocol for models lies in four aspects: Attention Focusing (let the model only focus on what it should pay attention to in the current phase), Information Indexing (read back according to the path when needed, instead of keeping all content resident), Prevent Context Rot (fight against forgetting and drift in long conversations with the persisted Spec), Auxiliary Review (provide a cross-validation benchmark for Spec vs code). The protocol should never cause the context to be overfilled - RIPER manages the process, Spec manages records, and the model accesses them on demand.
Recommended Process (Direct Execution)
- Standard flow (medium and large tasks):
create_codemap -> build_context_bundle -> sdd_bootstrap -> Research -> (Innovate, optional) -> Plan -> Execute -> Review
- Fast flow (small tasks/ambiguous requirements):
sdd_bootstrap -> (supplement on demand) create_codemap/build_context_bundle -> Research -> Plan -> Execute -> Review
- Phase Gates:
- Do not enter implementation before the first version of the spec is persisted to disk
- It is prohibited to enter before receiving the exact text
ExecutePlan Approved - If fails, go back to
Reviewfor correctionResearch/Plan
Context Assembly Rules
- is the complete persisted context and memory layer: it must be fully persisted to disk and maintained continuously, but it is not required to be fully resident in the input for each round
SDD - is an approval-driven state machine: the current
RIPER, current approval status and next action must be clearly visible in each roundphase - The goal of tailoring is to reduce repeated replay, not to reduce constraints or weaken phase gates
Hot Context (Required for Each Round)
- Current
phase - Current
approval status - Current
spec path - Current
Goal - Current
In Scope / Out of Scope - Current active
Checklist - Current
Open Questions - Current risks and
Next Action - Hot context is only used for focusing in the current round, and does not replace the complete spec; in case of conflict with the spec, the spec shall always prevail
Warm Context (Loaded Before Phase Switch or High-risk Actions)
- :
Research -> Plan, key facts, scheme conclusionsResearch Findings - :
Plan -> Execute,File Changes, atomicSignaturesChecklist - :
Execute -> Review, actual change summary, deviation descriptionValidation - When executing /
review_spec, read back the corresponding review sectionreview_execute
Cold Context (Not Included by Default, Loaded Only When Hit)
- Full
Change Log - Historical details
Research - Complete
codemap - Complete
context bundle - Complete extension rules for /
MULTI/DEBUGARCHIVE - Long examples, long templates, long quick references
Hard Phase Gates (Cannot Be Weakened Due to Tailoring)
- Do not enter code implementation without a spec
- and
phasemust be explicit states, and inference based on tone, tendency or incomplete statements is not allowedapproval status - Do not enter without the exact text
ExecutePlan Approved - Before phase switching, the corresponding spec section must be read back; phase advancement cannot be carried out only by relying on hot context across phases
- must be based on plan and validation, not just chat summaries
Review - When conflicts, missing fields, expired summaries or uncertain memory are found, immediately read back the complete spec or relevant original sections
Read-back Trigger Rules
- Required for each round: ,
phase,approval status,spec path, current activeGoal,ChecklistNext Action - When switching phases: Read back the spec section corresponding to the target phase (Research Findings / File Changes / Validation, etc.)
- When performing review: reads back the Plan section,
review_specreads back the Plan + Validation + Review sectionsreview_execute - Trigger full read-back: Disputes in phase switching, conflict between summary and spec, signs of forgetting in long conversations, high-risk changes
- Prohibited: Hot context cannot be used to replace the original spec for cross-phase advancement, and cannot be inferred based on vague tone
Plan Approved
Multi-project Collaboration (Auto-discovery + Scope Isolation)
- Goal: Maintain "local understanding + local execution + explicit boundaries" in multi-project scenarios, zero additional configuration for users
- Detailed protocol: →
references/sdd-riper-one-protocol.mdsectionMULTI-PROJECT PROTOCOL - Spec template: → multi-project template
references/spec-template.md
Auto-Discovery
- Trigger: or trigger words
sdd_bootstrap: mode=multi_projectMULTI / 多项目 - Agent automatically scans subdirectories under and identifies subprojects through flag files:
workdir- JS/TS: | Java/Kotlin:
package.json,pom.xml| Go:build.gradle| Python:go.mod,pyproject.toml| Rust:setup.py| General:Cargo.toml.git - Monorepo: Additional check for ,
workspaces,settings.gradlepnpm-workspace.yaml
- JS/TS:
- Generate (
Project Registry), report to the user for confirmation before proceeding§0.1 - Users can also explicitly provide to skip auto-discovery
projects=[...] - Intelligent downgrade: Only 1 subproject → automatically downgrade to single-project mode; 0 subprojects → treat workdir itself as a single project
Automatic Codemap
- After discovering projects, automatically check/generate for each subproject
create_codemap(project) - Output path:
mydocs/codemap/YYYY-MM-DD_hh-mm_<project_id>项目总图.md
Scope Isolation Rules (Mandatory)
- Declare and
active_projectfirst in each roundactive_workdir - Default , only allow modification of files under
change_scope=localactive_project - Cross-project changes are allowed only when explicitly setting (or trigger words
change_scope=cross)CROSS / 跨项目 - Always follow : Before switching to any project, the codemap/context of the project must be loaded first
codemap-first - After cross-project execution, record the changed projects, files and reasons in spec
§6.1 Touched Projects
Cross-project Dependencies and Contracts
- When making cross-project changes, must record in spec : Provider → Interface → Consumer → Whether it is a Breaking Change → Migration scheme
§4.4 Contract Interfaces - The checklist of cross-project Plan is grouped by project, and Provider is executed prior to Consumer
- Check whether the target project has an active Spec before modification, STOP and wait for user decision if there is a conflict
Multi-project Review (Extension)
- Verify the consistency of cross-project contracts (matching of Provider and Consumer interfaces)
- Verify the integrity of Touched Projects
- Verify that there are no isolated changes (all changed files are within registered projects)
- Evaluate regression risk by project respectively
Trigger Words
- → Enter multi-project mode, run auto-discovery
MULTI / 多项目 - → Current round
CROSS / 跨项目change_scope=cross - → Switch
SWITCH <project_id> / 切换 <project_id>, automatically load codemapactive_project - → Display current Project Registry
REGISTRY / 项目列表 - → Reset to
SCOPE LOCAL / 回到本地change_scope=local
Minimum Startup Example
text
sdd_bootstrap: mode=multi_project, task=<task name>, goal=<goal>, requirement=<requirement document or description>- No need to list projects manually, Agent automatically discovers and confirms.
- You can also explicitly specify:
projects=[{id:web-console,path:./web-console},{id:api-service,path:./api-service}]
Native Command Actions (Can Be Entered Directly)
1) create_codemap
create_codemap- Purpose: Generate code index map, support /
feature(defaultproject)feature - Essence: CodeMap is a code context index for subsequent on-demand loading, instead of full repository scanning in each round.
- Input: (recommended to be clear);
scopeoptional;modeoptionalgoal - Output:
- :
featuremydocs/codemap/YYYY-MM-DD_hh-mm_<feature>功能.md - :
projectmydocs/codemap/YYYY-MM-DD_hh-mm_<project>项目总图.md
- Key points:
- focuses on entry, core link, dependency, risk
feature - focuses on architecture layer, core modules, cross-module processes, external dependencies; Mermaid is preferred for diagrams (can be downgraded to structured text diagrams if limited)
project
2) build_context_bundle
build_context_bundle- Purpose: Organize requirement context, read materials for users and extract details
- Input: Directory path
- Parsing strategy: best effort, support text/document/image; unparseable files enter and do not block output
Unparsed Sources - Output:
mydocs/context/YYYY-MM-DD_hh-mm_<task>_context_bundle.md - Output levels:
- :
Lite,Source Index,Requirement Snapshot,Open QuestionsNext Actions - :
Standard,Requirement Facts,Business Rules,Acceptance Criteria,Constraints, etc.Conflicts & Ambiguities
3) sdd_bootstrap
sdd_bootstrap- Purpose: RIPER startup command (the first step to enter Research, and generate the first version of spec)
- Input: Any "meaningful and real requirement" is acceptable (oral/document/chat record/context bundle are all allowed)
- Execution actions:
- Summarize user input + code facts + historical assets (codemap/context/spec)
- Conflict handling: First persist the first version of spec to mark conflicts, then provide and recommended decision
Option A/B - Form the first version of research conclusions and next actions
- Output:
mydocs/specs/YYYY-MM-DD_hh-mm_<TaskName>.md - Minimum content of the first version: ,
Context Sources,Codemap Used,Research Findings,Open QuestionsNext Actions
4) review_spec
review_spec- Purpose: Conduct spec quality review after is completed and before
Plan(advisory, does not block execution)Execute - Input:
- : spec file path (optional, default current active spec)
spec - :
scope(default) orplan_onlyfull
- Review focus:
- Whether the goal/scope/acceptance criteria are clear and verifiable
- Whether is executable (whether files, signatures, checklist are atomic)
Plan - Whether risks, rollback, cross-project contracts (if any) are sufficient
- Phased principle:
- Only review the chapters that "should be available in the current phase", do not require full spec coverage at one time
- Only give for chapters that have not reached the phase, and do not count as
ReminderNO-GO
- Output:
- (item by item
Spec Review Matrix+ evidence)PASS/FAIL/PARTIAL - :
Readiness Verdict(advisory conclusion)GO/NO-GO - (items to note if you continue execution)
Risks & Suggestions - (items to be completed by phase)
Phase Reminders
- Constraints:
- does not constitute a hard block; if the user insists on execution, it is allowed to continue
NO-GO - When the user chooses to continue, must record in the spec
User Decision: Proceed despite NO-GO
5) review_execute
review_execute- Purpose: Perform structured review after , output review conclusions that can be written back to the spec
Execute - Input:
- : spec file path (optional, default current active spec)
spec - :
scope(default) orchanged_only(full review)full
- Three review axes (must all be output):
- Spec quality and goal achievement: Whether the spec clearly states the goal, scope, acceptance criteria; whether the requirement is completed
- Spec-code consistency: Whether the code faithfully executes the (files, signatures, checklist, behavior)
Plan - Code quality itself: The quality of the code in terms of correctness, robustness, maintainability, testing, and risk after脱离 the spec
- Output:
- (item by item
Review Matrixfor three axes + evidence)PASS/FAIL/PARTIAL - (
Overall Verdict) andPASS/FAILBlocking Issues - (deviations and reasons)
Plan-Execution Diff
- Phase Gates:
- Any in axis 1 or axis 2 ->
FAIL, go back toReview FAILResearch/Plan - High-risk problems exist in axis 3 -> , go back to
Review FAILPlan
- Any
6) archive
archive- Purpose: Archive and precipitate specified spec/codemap (or directory), refine "intermediate products" into reusable knowledge
- Input:
- : file or directory paths (support multiple)
targets - :
kind/spec/codemapmixed - :
audience/human/llm(defaultboth)both - :
mode(single task archive, default) /snapshot(cross-task thematic archive)thematic - : archive topic name (optional, default inferred from targets)
topic
- Output:
- :
human(report perspective)mydocs/archive/YYYY-MM-DD_hh-mm_<topic>_human.md - :
llm(subsequent development reference perspective)mydocs/archive/YYYY-MM-DD_hh-mm_<topic>_llm.md - Each archived document must include (conclusion -> source file) to avoid distortion
Trace to Sources
- Phase Gates:
- When there is an actively executing spec (Review not completed), archiving this spec is prohibited
- By default, only archive without deleting original files; deletion/movement requires explicit user authorization
- Automation script (recommended):
python3 scripts/archive_builder.py --targets mydocs/specs mydocs/codemap --kind mixed --audience both --mode thematic --topic <topic>- If you need to force archive active spec: append (only used after explicit user confirmation)
--allow-active-spec
Phase Constraints (Minimum Set)
- Sync the spec first before advancing the phase in each round
- Do not reload the entire spec in each round of dialogue by default; prioritize reading back the current phase section, active checklist, , latest
Open QuestionsChange Log / Validation - Only read back the full spec when switching phases, executing , finding conflicts or obvious forgetting
review_spec/review_execute - /
codemapare read on demand, not as fixed input for each roundcontext bundle - is optional: 2-3 schemes are recommended for complex tasks; small tasks can be skipped but the reason should be written
Innovate - must be executable: file path + signature + atomic checklist
Plan - It is recommended to execute after
review_spec; itsPlanis an advisory item, not a mandatory phase gateNO-GO - must be carried out according to the three axes and the conclusions should be written back:
Review,Review Matrix,Overall VerdictPlan-Execution Diff - It is recommended to execute after the task is closed to precipitate dual-perspective knowledge for human/llm
archive
Debug Mode (Log-driven Troubleshooting and Function Verification)
- Purpose: Locate bugs based on the triangulation of log + Spec + code, or verify whether the function is normal with full-link logs
- Trigger words:
DEBUG / 排查 / 日志分析 / 验证功能 - Input:
- : log file or log directory path (mandatory)
log_path - : discovered problem description / error message (optional, recommended when in troubleshooting mode)
issue - : associated Spec file path (optional, recommended when in verification mode)
spec
- Two sub-modes:
- Troubleshooting mode (default): The user provides logs + problem description, and the Agent combines Spec and code to locate possible root causes of bugs
- Verification mode: The user provides full-link logs + Spec, and the Agent compares the expected behavior in the Spec with the actual behavior in the logs one by one to confirm whether the function is normal
- Workflow:
- Read log files/directories, extract key errors, exceptions, call chain information
- Load associated Spec and CodeMap (if any), establish a comparison of "expected behavior vs actual behavior"
- Locate suspicious logic in the code (precise jump combined with CodeMap index)
- Output conclusion: Bug root cause analysis / function verification report
- If repair is needed, automatically enter the RIPER process (Research → Plan → Execute → Review)
- Constraints:
- Debug mode itself does not directly modify code, only does analysis and positioning
- When code modification is required, must follow the RIPER process (or FAST channel for small fixes)
- Analysis conclusions are written back to the section of the Spec (if there is an active Spec)
§ Debug Log
Trigger Words
- ->
MAP / Code Map / 链路梳理 / 只看代码create_codemap(feature) - ->
PROJECT MAP / 全局地图 / 项目总图 / MAP ALLcreate_codemap(project) - -> Multi-project lightweight mode (parent directory workdir + local execution)
MULTI / 多项目 - -> Allow cross-project changes (mandatory recording of
CROSS / 跨项目)Touched Projects - -> Small change fast channel (sync spec after modification)
FAST / 快速 / >> - -> Execute
REVIEW SPEC / 评审规格 / 计划评审(advisory pre-review)review_spec - -> Execute
REVIEW EXECUTE / 代码评审 / 实现复盘(three-axis review)review_execute - -> Execute
ARCHIVE / 归档 / 沉淀(summary, merge, refine)archive - -> Debug mode (log-driven troubleshooting and function verification)
DEBUG / 排查 / 日志分析 / 验证功能 - -> Exit the state machine
EXIT SDD / 退出协议
Naming Rules (Unified Time Prefix)
- Time prefix:
YYYY-MM-DD_hh-mm_ - :
create_codemap(feature)mydocs/codemap/YYYY-MM-DD_hh-mm_<feature>功能.md - :
create_codemap(project)mydocs/codemap/YYYY-MM-DD_hh-mm_<project>项目总图.md - :
build_context_bundlemydocs/context/YYYY-MM-DD_hh-mm_<task>_context_bundle.md - :
sdd_bootstrapmydocs/specs/YYYY-MM-DD_hh-mm_<TaskName>.md - :
archive(human)mydocs/archive/YYYY-MM-DD_hh-mm_<topic>_human.md - :
archive(llm)mydocs/archive/YYYY-MM-DD_hh-mm_<topic>_llm.md
References
references/sdd-riper-one-protocol.mdreferences/spec-template.mdreferences/workflow-quickref.mdreferences/usage-examples.mdreferences/archive-template.md- (detailed rules for multi-project collaboration)
references/multi-project.md - (detailed parameters of native command actions)
references/commands.md