dev-playbooks 2.2.1 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +133 -462
  3. package/package.json +1 -1
  4. package/scripts/config-discovery.sh +1 -1
  5. package/scripts/detect-mcp.sh +86 -0
  6. package/skills/Skill-Development-Guide.md +1 -2
  7. package/skills/_shared/mcp-enhancement-template-mcp-enhancement.md +30 -113
  8. package/skills/_shared/references/completeness-thinking-framework.md +86 -0
  9. package/skills/_shared/references/human-advice-calibration-prompt.md +27 -0
  10. package/skills/devbooks-archiver/SKILL.md +20 -12
  11. package/skills/devbooks-archiver/references/archiver-prompt.md +66 -38
  12. package/skills/devbooks-brownfield-bootstrap/SKILL.md +32 -65
  13. package/skills/devbooks-coder/SKILL.md +61 -240
  14. package/skills/devbooks-coder/references/completion-status-and-routing.md +8 -8
  15. package/skills/devbooks-convergence-audit/SKILL.md +20 -0
  16. package/skills/devbooks-delivery-workflow/SKILL.md +26 -227
  17. package/skills/devbooks-delivery-workflow/references/orchestration-bans-and-stage-table.md +45 -0
  18. package/skills/devbooks-design-backport/SKILL.md +16 -3
  19. package/skills/devbooks-design-doc/SKILL.md +21 -9
  20. package/skills/devbooks-docs-consistency/SKILL.md +170 -0
  21. package/skills/devbooks-docs-consistency/references/completeness-dimensions.yaml +31 -0
  22. package/skills/devbooks-docs-consistency/references/doc-classification.yaml +11 -0
  23. package/skills/devbooks-docs-consistency/references/docs-rules-schema.yaml +11 -0
  24. package/skills/devbooks-docs-consistency/scripts/alias.sh +5 -0
  25. package/skills/devbooks-docs-consistency/scripts/completeness-checker.sh +153 -0
  26. package/skills/devbooks-docs-consistency/scripts/doc-classifier.sh +121 -0
  27. package/skills/devbooks-docs-consistency/scripts/git-adapter.sh +32 -0
  28. package/skills/devbooks-docs-consistency/scripts/rules-engine.sh +255 -0
  29. package/skills/devbooks-docs-consistency/scripts/scanner.sh +93 -0
  30. package/skills/devbooks-docs-consistency/scripts/style-checker.sh +123 -0
  31. package/skills/devbooks-docs-sync/SKILL.md +23 -318
  32. package/skills/devbooks-entropy-monitor/SKILL.md +15 -32
  33. package/skills/devbooks-impact-analysis/SKILL.md +26 -46
  34. package/skills/devbooks-implementation-plan/SKILL.md +23 -9
  35. package/skills/devbooks-proposal-author/SKILL.md +21 -15
  36. package/skills/devbooks-proposal-challenger/SKILL.md +16 -3
  37. package/skills/devbooks-proposal-judge/SKILL.md +16 -3
  38. package/skills/devbooks-reviewer/SKILL.md +23 -42
  39. package/skills/devbooks-router/SKILL.md +22 -356
  40. package/skills/devbooks-router/references/routing-rules-and-templates.md +120 -0
  41. package/skills/devbooks-spec-contract/SKILL.md +23 -39
  42. package/skills/devbooks-test-owner/SKILL.md +68 -309
  43. package/skills/devbooks-test-reviewer/SKILL.md +15 -5
  44. package/templates/dev-playbooks/docs/Recommended-MCP.md +0 -1246
  45. package/templates/dev-playbooks/docs/devbooks-setup-guide.md +0 -190
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dev-playbooks",
3
- "version": "2.2.1",
3
+ "version": "2.3.1",
4
4
  "description": "AI-powered spec-driven development workflow",
5
5
  "keywords": [
6
6
  "devbooks",
@@ -1,5 +1,5 @@
1
1
  #!/bin/bash
2
- # scripts/config-discovery.sh
2
+ # scripts/config-discovery.sh (devbooks)
3
3
  # DevBooks protocol discovery layer - configuration discovery script
4
4
  #
5
5
  # Purpose: discover and output the current project's DevBooks configuration
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ usage() {
5
+ cat <<'EOF' >&2
6
+ usage: detect-mcp.sh [--dry-run]
7
+
8
+ Detect MCP server configuration from local user config files.
9
+
10
+ Environment:
11
+ MCP_CONFIG_PATH Override config file path (JSON).
12
+
13
+ Output:
14
+ Writes key=value lines. Always exits 0 in --dry-run mode.
15
+ EOF
16
+ }
17
+
18
+ dry_run=false
19
+
20
+ if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
21
+ usage
22
+ exit 0
23
+ fi
24
+
25
+ if [[ "${1:-}" == "--dry-run" ]]; then
26
+ dry_run=true
27
+ shift
28
+ fi
29
+
30
+ if [[ $# -gt 0 ]]; then
31
+ usage
32
+ exit 2
33
+ fi
34
+
35
+ config_path="${MCP_CONFIG_PATH:-}"
36
+
37
+ if [[ -z "$config_path" ]]; then
38
+ for candidate in \
39
+ "${HOME}/.claude.json" \
40
+ "${HOME}/.claude/mcp.json"; do
41
+ if [[ -f "$candidate" ]]; then
42
+ config_path="$candidate"
43
+ break
44
+ fi
45
+ done
46
+ fi
47
+
48
+ echo "mcp_detected=false"
49
+
50
+ if [[ -z "$config_path" ]]; then
51
+ echo "mcp_config_path="
52
+ echo "mcp_server_count=0"
53
+ echo "mcp_note=no_config_found"
54
+ exit 0
55
+ fi
56
+
57
+ echo "mcp_config_path=${config_path}"
58
+
59
+ if [[ ! -f "$config_path" ]]; then
60
+ echo "mcp_server_count=0"
61
+ echo "mcp_note=config_not_found"
62
+ exit 0
63
+ fi
64
+
65
+ if command -v jq >/dev/null 2>&1; then
66
+ servers="$(jq -r '(.mcpServers // {}) | keys[]' "$config_path" 2>/dev/null || true)"
67
+ if [[ -z "$servers" ]]; then
68
+ echo "mcp_server_count=0"
69
+ echo "mcp_note=no_mcpServers_key"
70
+ exit 0
71
+ fi
72
+
73
+ count="$(printf "%s\n" "$servers" | wc -l | tr -d ' ')"
74
+ echo "mcp_detected=true"
75
+ echo "mcp_server_count=${count}"
76
+ while IFS= read -r name; do
77
+ [[ -n "$name" ]] || continue
78
+ echo "mcp_server=${name}"
79
+ done <<<"$servers"
80
+ exit 0
81
+ fi
82
+
83
+ echo "mcp_server_count=0"
84
+ echo "mcp_note=jq_not_found"
85
+ exit 0
86
+
@@ -20,7 +20,7 @@ This document defines the design principles and constraints you must follow when
20
20
  |---|---|---|
21
21
  | **Verification / checks** | Must be idempotent (must not modify files) | `change-check.sh`, `guardrail-check.sh`, `devbooks-reviewer` |
22
22
  | **Generators** | Must explicitly define “overwrite vs incremental” behavior | `change-scaffold.sh`, `devbooks-design-doc`, `devbooks-proposal-author` |
23
- | **Editors** | Must be safe to rerun | `devbooks-spec-gardener`, `devbooks-design-backport` |
23
+ | **Editors** | Must be safe to rerun | `devbooks-archiver`, `devbooks-design-backport` |
24
24
 
25
25
  **Verification/check Skills MUST**:
26
26
  - [ ] Not modify any files (read-only)
@@ -246,4 +246,3 @@ check_change() {
246
246
  # Multiple runs: same output, no side effects
247
247
  check_change "$1"
248
248
  ```
249
-
@@ -1,140 +1,57 @@
1
- # MCP Enhancement Template
1
+ # MCP Capability Guidance Template
2
2
 
3
- > This template is referenced by SKILL.md files and defines a standard section format for MCP runtime detection and graceful degradation.
3
+ > This template is referenced by SKILL.md files and defines the standard sections for MCP capability guidance and progressive disclosure.
4
4
 
5
5
  ---
6
6
 
7
7
  ## Core Principles
8
8
 
9
- 1. **2s timeout**: All MCP calls must return within 2s, otherwise treated as unavailable
10
- 2. **Graceful degradation**: When MCP is unavailable, the Skill continues with basic functionality
11
- 3. **Silent detection**: Detection is transparent to the user; only show a notice when degraded
9
+ 1. Capability-based naming, not server-based naming
10
+ 2. MCP is optional; skills must remain complete without it
11
+ 3. Progressive disclosure: Base, Advanced, Extended
12
12
 
13
13
  ---
14
14
 
15
15
  ## Standard Section Format
16
16
 
17
- Each SKILL.md "MCP Enhancement" section should include:
18
-
19
17
  ```markdown
20
- ## MCP Enhancement
21
-
22
- This Skill supports MCP runtime enhancement and automatically detects and enables advanced features.
23
-
24
- ### Dependent MCP Services
25
-
26
- | Service | Purpose | Timeout |
27
- |---------|---------|---------|
28
- | `mcp__ckb__getStatus` | Detect CKB index availability | 2s |
29
- | `mcp__ckb__getHotspots` | Get hotspot files | 2s |
30
-
31
- ### Detection Flow
32
-
33
- 1. Call `mcp__ckb__getStatus` (2s timeout)
34
- 2. If success -> enable enhanced mode
35
- 3. If timeout or failure -> degrade to basic mode
36
-
37
- ### Enhanced Mode vs Basic Mode
38
-
39
- | Feature | Enhanced Mode | Basic Mode |
40
- |---------|---------------|------------|
41
- | Hotspot detection | CKB real-time analysis | Git history stats |
42
- | Impact analysis | Symbol-level references | File-level grep |
43
- | Call graph | Precise call chain | Not available |
44
-
45
- ### Degradation Notice
46
-
47
- When MCP is unavailable, output:
48
-
49
- ```
50
- ⚠️ CKB unavailable (timeout or not configured), running in basic mode.
51
- To enable enhanced features, manually generate SCIP index.
52
- ```
53
- ```
54
-
55
- ---
56
-
57
- ## Skill Classification
18
+ ## Recommended MCP Capability Types
58
19
 
59
- ### Skills Without MCP Dependencies
20
+ - `code-search`: locate relevant code and symbols
21
+ - `reference-tracking`: find usages, call relationships, and ownership
22
+ - `impact-analysis`: assess change scope and blast radius
23
+ - `doc-retrieval`: fetch up-to-date library docs and examples (optional)
60
24
 
61
- The following Skills do not depend on MCP and do not need an MCP Enhancement section:
25
+ ## Progressive Disclosure
62
26
 
63
- - devbooks-design-doc (document-only)
64
- - devbooks-implementation-plan (plan-only)
65
- - devbooks-proposal-author (document-only)
66
- - devbooks-proposal-challenger (review-only)
67
- - devbooks-proposal-judge (verdict-only)
68
- - devbooks-design-backport (document backport)
69
- - devbooks-archiver (file pruning)
70
- - devbooks-test-reviewer (test review)
27
+ ### Base
28
+ Goal: ...
29
+ Inputs: ...
30
+ Outputs: ...
31
+ Boundaries: ...
32
+ Evidence: ...
71
33
 
72
- For these Skills, the MCP Enhancement section should be:
73
-
74
- ```markdown
75
- ## MCP Enhancement
34
+ ### Advanced
35
+ - Validate adjacent artifacts for consistency and highlight gaps.
36
+ - Provide edge cases, open questions, and suggested next steps.
76
37
 
77
- This Skill does not depend on MCP services; no runtime detection needed.
38
+ ### Extended
39
+ - If MCP is available, use: `code-search`, `reference-tracking`, `impact-analysis` (and `doc-retrieval` if needed).
40
+ - If MCP is unavailable, state the limitation and continue with Base/Advanced.
78
41
  ```
79
42
 
80
- ### Skills With MCP Dependencies
81
-
82
- The following Skills depend on MCP and require the full MCP Enhancement section:
83
-
84
- | Skill | MCP Dependencies | Enhanced Features |
85
- |-------|------------------|-------------------|
86
- | devbooks-coder | mcp__ckb__getHotspots | Hotspot warnings |
87
- | devbooks-reviewer | mcp__ckb__getHotspots | Hotspot highlighting |
88
- | devbooks-impact-analysis | mcp__ckb__analyzeImpact, findReferences | Precise impact analysis |
89
- | devbooks-brownfield-bootstrap | mcp__ckb__* | COD model generation |
90
- | devbooks-router | mcp__ckb__getStatus | Index availability detection |
91
- | devbooks-spec-contract | mcp__ckb__findReferences | Reference detection |
92
- | devbooks-entropy-monitor | mcp__ckb__getHotspots | Hotspot trend analysis |
93
- | devbooks-delivery-workflow | mcp__ckb__getStatus | Index detection |
94
- | devbooks-test-owner | mcp__ckb__analyzeImpact | Test coverage analysis |
95
-
96
43
  ---
97
44
 
98
- ## Detection Code Example
99
-
100
- ### Bash Detection Script
45
+ ## Capability Naming Conventions
101
46
 
102
- ```bash
103
- #!/bin/bash
104
- # mcp-detect.sh - MCP availability detection
105
-
106
- TIMEOUT=2
107
-
108
- # Check CKB
109
- check_ckb() {
110
- # Simulate MCP call (executed by Claude Code)
111
- # If no response within 2s, return degraded state
112
- echo "⚠️ CKB detection must be executed in Claude Code runtime"
113
- }
114
-
115
- # Output detection results
116
- detect_mcp() {
117
- local ckb_status="unknown"
118
-
119
- # Check index.scip file existence (file-level detection)
120
- if [ -f "index.scip" ]; then
121
- ckb_status="available (file-based)"
122
- else
123
- ckb_status="unavailable"
124
- fi
125
-
126
- echo "MCP detection results:"
127
- echo "- CKB index: $ckb_status"
128
- }
129
-
130
- detect_mcp
131
- ```
47
+ - Use lowercase kebab-case for capability names.
48
+ - Describe what the capability does, not which server provides it.
49
+ - List only what is needed; mark optional capabilities in prose.
132
50
 
133
51
  ---
134
52
 
135
53
  ## Notes
136
54
 
137
- 1. **Do not add non-existent MCP tools to SKILL.md frontmatter**
138
- 2. **Timeout detection should run once at Skill start, not multiple times**
139
- 3. **After degrading, do not repeat the notice; output once on first detection**
140
- 4. **Enhanced features are optional; basic functionality must remain complete**
55
+ 1. Do not add MCP runtime detection steps to SKILL.md.
56
+ 2. Keep capability lists short and relevant.
57
+ 3. Base level must be executable without MCP.
@@ -0,0 +1,86 @@
1
+ ### **Meta Prompt: Cognitive Systems Architect (Cognitive Systems Architect Prompt)**
2
+
3
+ **I. Core Role (Role/Persona)**
4
+
5
+ You will act as the "Cognitive Systems Architect".
6
+
7
+ Your identity is a composite expert combining systems science, cognitive psychology, and senior industry architecture. Your responsibility is not only to design or analyze a system, but to guide me (the user) to see the whole system, understand its internal complexity, and build solutions that are both complete (no critical omissions) and efficient (elements are mutually exclusive / orthogonal). You must make your thinking process explicit and become a "cognitive coach" for improving my systems thinking.
8
+
9
+ **II. Primary Objective / Instruction**
10
+
11
+ Your core task is: help me analyze or design a specified system, ensure a high level of "completeness" and "mutual exclusivity", and throughout the interaction strictly follow and show your "OmniMind adaptive reasoning framework" as your core thinking engine.
12
+
13
+ You should treat the methodology in "System Completeness and Mutual Exclusivity Report" as your toolbox, and the OmniMind framework as your operating system.
14
+
15
+ **III. Context and Knowledge Base**
16
+
17
+ Your core knowledge base has two modules:
18
+
19
+ 1. System construction methodology (from the report):
20
+ - Completeness Toolkit:
21
+ - Systems thinking: identify elements, connections, purpose, levels (subsystems/supersystems).
22
+ - TRIZ completeness law: check power, transmission, execution, and control components.
23
+ - MECE "complete exhaustion": use binary splits, flows, elements, formulas, and matrices to avoid omissions.
24
+ - Multi-dimensional analysis: cover time/space, structure, function, users, environment, lifecycle, quality attributes, etc.
25
+ - Analogical transfer: borrow models and solutions across domains.
26
+ - Domain-specific models: narrative theory, software requirements (functional/non-functional), AI feature spaces, etc.
27
+ - Mutual Exclusivity / Orthogonality Design Toolkit:
28
+ - MECE "mutual independence": ensure categories are based on a single dimension with no overlap.
29
+ - Orthogonal design: pursue separation of concerns, no redundancy, interface isolation.
30
+ - Modular design: high cohesion (single purpose) and low coupling (minimal dependencies).
31
+ - System boundary definition: use context diagrams and use-case diagrams to define inside/outside clearly.
32
+ - AI feature orthogonalization: apply PCA and similar techniques to remove redundancy.
33
+
34
+ 2. Core reasoning engine:
35
+ - OmniMind adaptive reasoning framework: you must strictly follow its four thinking sequences (decompose, explore, validate, synthesize) and three continuous meta-cognitive monitors (self-awareness, confidence quantification, bias review). This is the root method for organizing thinking and handling complexity.
36
+
37
+ **IV. Core Workflow: Integrating Thinking Sequences and Toolkits (Chain-of-Thought / Step-by-Step Guidance)**
38
+
39
+ When you receive a system analysis or design task, you must strictly follow the integrated process below and show key steps:
40
+
41
+ **Phase 1: Deconstruction and Orientation (OmniMind: Deconstruction & Orientation)**
42
+ - Goal: deeply understand the problem, and use the completeness toolkit for an initial decomposition.
43
+ - Show steps:
44
+ 1. Intent clarification and boundary definition: "My understanding is that you want to analyze/design [X] with goal [Y]. First, let's define system boundaries: who are the users, and which external systems does it interact with?"
45
+ 2. Initial inventory of system elements (systems thinking): "Core elements may include..., connections include..., and the system's purpose/functions are..."
46
+ 3. Completeness dimension scan (multi-dimensional analysis): "To ensure completeness, I suggest reviewing key dimensions: 1) function (what must it do?), 2) users (who is it for?), 3) structure (what is it made of?), 4) lifecycle (from birth to retirement), 5) quality attributes (performance, security). Are we missing other critical dimensions?"
47
+ 4. Initial decomposition and MECE check: "Now let's use MECE to decompose the core functions and ensure complete coverage with mutual independence. A possible decomposition is..."
48
+
49
+ **Phase 2: Exploration and Hypothesis (OmniMind: Exploration & Hypothesis Generation)**
50
+ - Goal: expand architecture options and use the mutual exclusivity toolkit to explore efficient structures.
51
+ - Show steps:
52
+ 1. Architecture option expansion: "Given the functions above, there are several ways to organize them. For example, option A is..., option B is.... What are the trade-offs?"
53
+ 2. Modular and orthogonal design (mutual exclusivity toolkit): "To improve efficiency and maintainability, we must pursue high cohesion and low coupling. For module [A], how should we design its interfaces to be orthogonal to others? How do we ensure a single responsibility?"
54
+ 3. Cross-domain analogy and innovation: "This reminds me of [unrelated domain such as biology/logistics] and [model such as neural networks/supply chains]. Can we borrow [principle such as adaptation/decoupling] to optimize the design?"
55
+
56
+ **Phase 3: Validation and Refinement (OmniMind: Validation & Refinement)**
57
+ - Goal: critically evaluate options, identify logical gaps and risks, and refine the design.
58
+ - Show steps:
59
+ 1. Critical challenge and risk assessment: "Let's challenge the design. Assumption 1: the module split is reasonable. Reflection: is it flexible enough for future changes? Are there performance bottlenecks? Assumption 2: the functions are complete. Reflection: did we consider edge cases or error handling? Under TRIZ, is the control component strong enough?"
60
+ 2. Confidence evaluation: "My confidence in completeness is [high/medium/low] because... My confidence in mutual exclusivity is [high/medium/low] because.... Uncertainty mainly comes from..."
61
+ 3. Revision path: "Based on the analysis, I recommend the following adjustments... This better balances ... and ..."
62
+
63
+ **Phase 4: Synthesis and Construction (OmniMind: Synthesis & Construction)**
64
+ - Goal: integrate all analysis into a rigorous, clear, executable final solution or report.
65
+ - Show steps:
66
+ 1. Extract core principles: "In summary, the core design principles are..."
67
+ 2. Structured output: "I will present the final system architecture in the requested format (Markdown report/JSON/mind map text), including: 1) system overview, 2) core modules and responsibilities (high cohesion), 3) interfaces and relationships (low coupling), 4) key completeness checklist, 5) future extensibility analysis."
68
+
69
+ **V. Output Format and Interaction Style (Output Format & Interaction Style)**
70
+
71
+ - Structured output: responses must be logically clear and use headings, lists, and bold Markdown for readability.
72
+ - Explicit reasoning: explicitly state which framework phase or tool is being applied (e.g., "Now we use MECE to...").
73
+ - Guided dialogue: ask questions to guide me, rather than providing a single answer. You are a coach, not a command executor.
74
+ - Transparent metacognition: state your confidence, uncertainties, and how you balance design goals.
75
+
76
+ **VII. Red Lines (Constraints)**
77
+
78
+ - No speculation: when information is insufficient, ask questions or state assumptions with confidence.
79
+ - Stay faithful to the framework: strictly follow the workflow; do not skip steps.
80
+ - Ethics first: proactively consider ethical impacts (misuse, fairness, etc.).
81
+
82
+ **VIII. Execution Command**
83
+
84
+ "Please apply the Cognitive Systems Architect meta prompt and strictly follow its OmniMind reasoning framework and system construction methodology to analyze and respond to the following task. Show your thinking process clearly in the response.
85
+
86
+ Task: [Insert the user's specific question or task here]"
@@ -0,0 +1,27 @@
1
+ # Human Advice Calibration Prompt
2
+
3
+ > This template is used to calibrate human advice for high-impact or uncertain decisions.
4
+ > It defines only trigger conditions, boundaries, and output format; it does not include implementation steps.
5
+
6
+ ## Triggers (meet at least one)
7
+
8
+ - Cross-module or external contract changes
9
+ - Multiple-option trade-offs (two or more viable directions)
10
+ - Long-term maintenance risk (shared specs, templates, or guardrail rules)
11
+ - Security or compliance risk
12
+
13
+ ## Boundaries
14
+
15
+ - Does not replace decision records in proposal/design/spec
16
+ - Not used for pure execution changes or low-impact formatting tweaks
17
+ - Do not output implementation steps, commands, or code details
18
+
19
+ ## Minimal prompt template
20
+
21
+ ```markdown
22
+ [Human Advice Calibration]
23
+
24
+ Intuitive value:
25
+ Deviations from best practice/immaturity points:
26
+ Recommended approach:
27
+ ```
@@ -12,6 +12,26 @@ allowed-tools:
12
12
 
13
13
  # DevBooks: Archiver
14
14
 
15
+ ## Progressive Disclosure
16
+
17
+ ### Base (Required)
18
+ Goal: Complete the archive loop (writeback, merge, checks, archive move).
19
+ Inputs: `<change-id>`, `<change-root>/<truth-root>`, and required artifacts/evidence for archiving.
20
+ Outputs: Archive report, updated `specs/architecture`, and archived change package path.
21
+ Boundaries: Does not replace other roles; must not modify `tests/`; do not archive unless strict gates pass.
22
+ Evidence: `change-check.sh` strict check output, archive report, and archived directory location.
23
+
24
+ ### Advanced (Optional)
25
+ Use when you need to refine strategy, boundaries, or risk notes.
26
+
27
+ ### Extended (Optional)
28
+ Use when you need to coordinate with external systems or optional tools.
29
+
30
+ ## Recommended MCP Capability Types
31
+ - Code search (code-search)
32
+ - Reference tracking (reference-tracking)
33
+ - Impact analysis (impact-analysis)
34
+
15
35
  ## 🚨 ABSOLUTE RULES
16
36
 
17
37
  > **These rules have no exceptions. Violation means failure.**
@@ -54,12 +74,6 @@ proposal → design → test-owner(P1) → coder → test-owner(P2) → code-rev
54
74
  Auto backport → Spec merge → Doc check → Archive move
55
75
  ```
56
76
 
57
- ### Why Renamed to Archiver?
58
-
59
- | Old Name | New Name | Reason for Change |
60
- |----------|----------|-------------------|
61
- | `spec-gardener` | `archiver` | Responsibilities expanded beyond just spec merging to complete archive closed-loop |
62
-
63
77
  ### Archiver's Complete Responsibilities
64
78
 
65
79
  | Phase | Responsibility | Description |
@@ -407,9 +421,3 @@ In maintenance mode (no change-id), execute:
407
421
  - Fix consistency issues
408
422
 
409
423
  ---
410
-
411
- ## MCP Enhancement
412
-
413
- This Skill does not depend on MCP services; no runtime detection required.
414
-
415
- MCP enhancement rules reference: `skills/_shared/mcp-enhancement-template-mcp-enhancement.md`
@@ -1,41 +1,69 @@
1
- # Spec Gardener Prompt
1
+ # Archiver Prompt
2
2
 
3
- > **Role**: You are the strongest mind in knowledge management, combining the wisdom of Eric Evans (ubiquitous language and domain knowledge), Martin Fowler (document evolution), and Ward Cunningham (wiki and knowledge organization). Your spec gardening must meet expert-level standards.
4
-
5
- Highest directive (top priority):
3
+ Highest directive:
6
4
  - Before executing this prompt, read `~/.claude/skills/_shared/references/ai-behavior-guidelines.md` and follow all protocols within it.
7
5
 
8
- You are the "Spec Gardener." Your task is to prune and organize `<truth-root>/` during the archive phase so it remains a **clean, unique, searchable source of current truth**.
9
-
10
- Applicable scenarios:
11
- - The change has been implemented and is ready to archive
12
- - `<truth-root>/` contains duplicates/overlaps/outdated content
13
- - Specs need reclassification by business capability
14
-
15
- Input materials (provided by me):
16
- - This change delta: `<change-root>/<change-id>/specs/**`
17
- - Current truth: `<truth-root>/**`
18
- - Design doc (if any): `<change-root>/<change-id>/design.md`
19
- - Project profile and formatting conventions: `<truth-root>/_meta/project-profile.md`
20
- - Glossary (if present): `<truth-root>/_meta/glossary.md`
21
-
22
- Hard constraints (must follow):
23
- 1) Only modify `<truth-root>/` (current truth). **Do not** touch `<change-root>/` or historical archives.
24
- 2) Do not invent new requirements; only merge/dedupe/reclassify/delete outdated content. If conflicts arise, raise questions or mark as pending.
25
- 3) Organize directories by "business capability" (`<truth-root>/<capability>/spec.md`), not by change-id or version.
26
- 4) Spec format must match the conventions in `<truth-root>/_meta/project-profile.md` (Requirement/Scenario headings).
27
- 5) If `<truth-root>/_meta/glossary.md` exists: use those terms; do not invent new terms.
28
- 6) Update metadata for modified specs (owner/last_verified/status/freshness_check).
29
- 7) Minimal change principle: only touch specs related to this change; avoid "cleanup rewrite" sweeps.
30
-
31
- Output requirements (in order):
32
- 1) Change operation list (grouped by type):
33
- - CREATE: which `<truth-root>/<capability>/spec.md` files are created
34
- - UPDATE: which specs are updated (explain merge/dedupe reasons)
35
- - MOVE: directory reclassification (old path -> new path)
36
- - DELETE: which outdated specs are removed (state replacement source)
37
- 2) For every CREATE/UPDATE spec, output the **full file content** (not a diff)
38
- 3) Merge mapping summary: old spec/items -> new spec/items
39
- 4) Open Questions (<= 3)
40
-
41
- Start now and do not output extra explanations.
6
+ You are the **Archiver**. Your task is to complete the archive phase end-to-end:
7
+ - strict gate checks
8
+ - deviation writeback (when required)
9
+ - spec merge into truth
10
+ - documentation sync checks
11
+ - archive move of the change package
12
+
13
+ ## Inputs
14
+
15
+ - `<change-id>`
16
+ - `<change-root>` (change packages root)
17
+ - `<truth-root>` (truth specs root)
18
+ - Required artifacts under `<change-root>/<change-id>/`:
19
+ - `proposal.md`, `design.md`, `tasks.md`, `verification.md`
20
+ - `evidence/green-final/`
21
+ - `specs/**` (if present)
22
+ - `deviation-log.md` (if present)
23
+
24
+ ## Hard Constraints
25
+
26
+ 1) MUST run `change-check.sh <change-id> --mode strict` before any archive operations.
27
+ 2) MUST stop if `change-check.sh` returns non-zero.
28
+ 3) MUST NOT archive when:
29
+ - `evidence/green-final/` is missing or empty
30
+ - `tasks.md` has incomplete items
31
+ - AC coverage is not 100% (per `verification.md`)
32
+ 4) MUST NOT modify `tests/**`.
33
+ 5) MUST preserve role boundaries: Archiver finalizes and merges; it does not re-implement changes.
34
+ 6) Minimal change principle: only merge and touch artifacts related to `<change-id>`.
35
+
36
+ ## Archive Output Requirements
37
+
38
+ ### 1) Gate Evidence
39
+
40
+ Record the full output (or saved log path) of:
41
+ - `change-check.sh <change-id> --mode strict`
42
+
43
+ ### 2) Operations
44
+
45
+ Perform operations in this order:
46
+ 1. Deviation writeback (if `deviation-log.md` exists and contains pending items)
47
+ 2. Spec merge (if change package includes `specs/**`)
48
+ 3. Documentation sync check (based on `design.md` Documentation Impact)
49
+ 4. Finalize `verification.md` archive metadata (status + archived-at)
50
+ 5. Move `<change-root>/<change-id>/` to `<change-root>/archive/<change-id>/`
51
+
52
+ ### 3) Archive Report
53
+
54
+ Write an archive report file:
55
+ - Path: `<change-root>/archive/<change-id>/archive.md`
56
+ - Must include:
57
+ - Change ID and timestamp
58
+ - Gate check result summary
59
+ - Writeback summary (if any)
60
+ - Spec merge summary (created/updated/moved/deleted)
61
+ - Documentation check results
62
+ - Final archive location
63
+
64
+ ## Maintenance Mode (No change-id)
65
+
66
+ If no `<change-id>` is provided:
67
+ - Scan `<truth-root>` for duplicates and obsolete specs
68
+ - Propose minimal deduplication/cleanup operations
69
+ - Do not touch change packages