Skip to content

feat(assets): scaffold the six knowledge-base skills and their commands - #3

Merged
protonspy merged 1 commit into
mainfrom
feat/knowledge-base-skills
Jul 30, 2026
Merged

protonspy merged 1 commit into
mainfrom
feat/knowledge-base-skills

Conversation

@protonspy

@protonspy protonspy commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

The gap

scc init scaffolded eight validators and no skill teaching the formats they enforce. A fresh workspace demanded conformance to docs/wiki/, docs/codewiki/, docs/glossary.md, docs/stack.md and docs/adr/ while offering nothing that says how to write any of them.

This was a known, recorded deviation rather than a regression — design/plan.md:

Deviation: no skills ship, so 3.3 and 6.3 are hollow. The design lists skills among what the binary scaffolds but never says which. Nothing was invented to fill the gap. […] One line in the design saying which skills ship, if any, closes this.

This PR writes that line and the skills behind it.

What ships

The selection rule is mechanical: one skill per docs/ artifact a validator checks, plus one entry point.

Skill Command Authors Validator
wiki /scc-wiki docs/wiki/ — ingest from raw/, query, repair wiki
codewiki /scc-codewiki docs/codewiki/ — narrated code, cited by line range codewiki
glossary /scc-glossary docs/glossary.md glossary
stack /scc-stack docs/stack.md stack
adr /scc-adr docs/adr/ adr
prd /scc-prd plans/<name>.md plan

Five pair 1:1 with a validator of the same name. prd is the exception and earns its place for the opposite reason: it is the on-ramp for work too large for one spec, the one place §1's routing question gets asked out loud.

Decisions

  • The methodology is deliberately not a skill. csdd shipped tdd-cycle, unit-cycle, verify-change and pr-review; here those are already rules under .claude/rules/. A skill restating a rule is a second copy of one fact, and the copy is the one that goes stale.
  • Skills carry procedure and judgment; the format stays in knowledge-base.md, stated once. Skills link to it rather than restating it.
  • Commands are prefixed scc-, skills are not. Slash commands share a flat namespace across every source Claude Code loads them from, and a bare /adr collides on contact. A skill is reached through its description, where a prefix only spends name budget.
  • One list, two outputs. assets.KnowledgeSkills derives both the skill directory and its command, so they cannot drift apart.

Verification

  • gofmt -l clean, go vet ./... clean, full suite green.
  • Against a real scaffolded workspace: init writes 24 files, scc skill validate → 0 findings, scc validate → 0 across all eight, re-running init is a no-op.
  • TestScaffoldedSkillsPassTheSkillValidator asserts the scaffolded count before it asserts the clean run — that is what was missing while 6.3 was hollow, since the old assertion passed on a workspace with zero skills.
  • TestEverySkillShipsWithItsCommand holds the derivation honest in both directions.

design/orchestration.md §6 now names the six and why; plan.md 3.3 and 6.3 are checked and no longer vacuous. assets.Version bumped 1 → 2.

Notes for the reviewer

  • golangci-lint and govulncheck were not run locally (not installed on this machine) — CI covers them. The Go change is confined to assets.go and tests.
  • scc update still does not exist, so existing workspaces get these by re-running init, which is additive and never overwrites an edited file. Side effect worth noting: this is the first time a second template version exists, which was the stated blocker on phase 11.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K2uD2SD6syaoXnhtqHbzhM

Summary by CodeRabbit

  • New Features

    • init now scaffolds six knowledge-base skills: wiki, codewiki, glossary, stack, ADR, and PRD.
    • Added matching scc- slash commands for each skill.
    • Skills provide guidance for documentation, architecture decisions, technology adoption, terminology, and product planning.
  • Documentation

    • Updated workspace layout and usage documentation to describe the new skills and commands.
  • Tests

    • Added validation ensuring all shipped skills and commands are complete and properly configured.

`scc init` shipped eight validators and no skill teaching the formats they
enforce, so a fresh workspace demanded conformance to documents nobody was
told how to write. design/plan.md recorded this as an open deviation: the
design listed skills among what the binary scaffolds and never said which,
which left 3.3 and 6.3 satisfiable by a workspace containing no skills.

Which skills ship is now picked mechanically — one per docs/ artifact a
validator checks (wiki, codewiki, glossary, stack, adr), plus prd as the
entry point for work too large for one spec. Each ships with a namespaced
slash command derived from the same list, so the two cannot drift.

The methodology stays in .claude/rules/. csdd shipped tdd-cycle, unit-cycle
and verify-change as skills; here that would be a second copy of a rule, and
the copy is the one that goes stale. Skills carry the procedure and the
judgment, the format stays in knowledge-base.md, stated once.

Commands are prefixed scc- because slash commands share a flat namespace
across every source Claude Code loads them from, and a bare /adr collides on
contact. Skills are not prefixed: a skill is reached through its description.

TestScaffoldedSkillsPassTheSkillValidator asserts the scaffolded count before
it asserts the clean run, which is the part that was missing while 6.3 was
hollow. Template version bumped to 2.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K2uD2SD6syaoXnhtqHbzhM
@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

init now scaffolds six knowledge-base skills and matching scc- commands. Embedded templates, documentation, CLI text, versioning, and tests were updated to define and validate the new workspace assets.

Changes

Knowledge skill scaffolding

Layer / File(s) Summary
Scaffold contract and asset wiring
design/*, internal/assets/assets.go, internal/assets/templates/CLAUDE.md, CLAUDE.md
Defines six shipped skills, bumps the template version to 2, and generates matching skill and command files in Claude directories.
Knowledge skill procedures
internal/assets/templates/claude/skills/*
Adds procedures for ADR, codewiki, glossary, PRD, stack, and wiki authoring and validation.
Namespaced command workflows
internal/assets/templates/claude/commands/*, internal/cli/*
Adds six scc- command templates and updates init documentation to describe their scaffolding.
Scaffold and validator coverage
internal/assets/assets_test.go, internal/cli/validate_test.go
Verifies generated assets, required frontmatter, skill names, configured counts, and successful skill validation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Init as init
  participant Assets as assets.Workspace
  participant Validator as skill validator
  Developer->>Init: initialize workspace
  Init->>Assets: scaffold configured skills and commands
  Assets-->>Init: write embedded templates
  Developer->>Validator: validate scaffolded skills
  Validator-->>Developer: return validation result
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: scaffolding six knowledge-base skills and their corresponding commands.
Docstring Coverage ✅ Passed Docstring coverage is 90.91% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/knowledge-base-skills

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/assets/templates/claude/commands/scc-codewiki.md`:
- Line 3: Update the command instructions around the argument handling to
recognize the exact “repair” argument explicitly and route it through the
existing codewiki.* repair workflow, instead of treating it as an area and
skipping repair. Keep normal area/path narration behavior unchanged;
alternatively remove “repair” from the argument hint if repair mode is not
intended to be supported.

In `@internal/assets/templates/claude/skills/prd/SKILL.md`:
- Around line 49-51: Update the fenced command block containing “scc plan new
<name>” in the PRD skill template to declare the shell language, preserving the
command content and formatting while satisfying markdownlint MD040.

In `@internal/assets/templates/claude/skills/wiki/SKILL.md`:
- Around line 30-37: Update the raw-source handling procedure in the wiki skill
so deleting files from docs/raw/ requires explicit user confirmation before the
irreversible deletion; otherwise archive the source instead. Preserve the
requirement to record the outcome in changelog.md and run scc validate,
including for sources rejected as not worth a page.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 736cbbd0-bbe7-46d2-8849-078f616ef0cd

📥 Commits

Reviewing files that changed from the base of the PR and between 32bdd30 and a4a5a91.

📒 Files selected for processing (21)
  • CLAUDE.md
  • design/orchestration.md
  • design/plan.md
  • internal/assets/assets.go
  • internal/assets/assets_test.go
  • internal/assets/templates/CLAUDE.md
  • internal/assets/templates/claude/commands/scc-adr.md
  • internal/assets/templates/claude/commands/scc-codewiki.md
  • internal/assets/templates/claude/commands/scc-glossary.md
  • internal/assets/templates/claude/commands/scc-prd.md
  • internal/assets/templates/claude/commands/scc-stack.md
  • internal/assets/templates/claude/commands/scc-wiki.md
  • internal/assets/templates/claude/skills/adr/SKILL.md
  • internal/assets/templates/claude/skills/codewiki/SKILL.md
  • internal/assets/templates/claude/skills/glossary/SKILL.md
  • internal/assets/templates/claude/skills/prd/SKILL.md
  • internal/assets/templates/claude/skills/stack/SKILL.md
  • internal/assets/templates/claude/skills/wiki/SKILL.md
  • internal/cli/cli.go
  • internal/cli/init.go
  • internal/cli/validate_test.go

@@ -0,0 +1,13 @@
---
description: Narrate an area of the codebase into docs/codewiki/, every section citing the exact lines it explains
argument-hint: [area or path to narrate | repair]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Handle the documented repair mode explicitly.

The argument hint advertises repair, but the instructions only run validation when $ARGUMENTS is empty. /scc-codewiki repair therefore sets Area: repair and skips the codewiki.* repair workflow. Branch on the exact repair argument, or remove it from the argument hint.

Also applies to: 10-13

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assets/templates/claude/commands/scc-codewiki.md` at line 3, Update
the command instructions around the argument handling to recognize the exact
“repair” argument explicitly and route it through the existing codewiki.* repair
workflow, instead of treating it as an area and skipping repair. Keep normal
area/path narration behavior unchanged; alternatively remove “repair” from the
argument hint if repair mode is not intended to be supported.

Comment on lines +49 to +51
```
scc plan new <name>
```

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add a language to the fenced command block.

markdownlint reports MD040 here. Mark the block as shell so the template remains lint-clean.

Proposed fix
-```
+```shell
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
```
scc plan new <name>
```
🧰 Tools
🪛 markdownlint-cli2 (0.23.1)

[warning] 49-49: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assets/templates/claude/skills/prd/SKILL.md` around lines 49 - 51,
Update the fenced command block containing “scc plan new <name>” in the PRD
skill template to declare the shell language, preserving the command content and
formatting while satisfying markdownlint MD040.

Source: Linters/SAST tools

Comment on lines +30 to +37
6. **Record it in `changelog.md`** — what changed, naming the pages with wikilinks.
7. **Delete the source from `docs/raw/`.** This is the step that gets skipped. The
finding exists because of it.
8. `scc validate` before you call it done.

A source that turns out not to be worth a page still gets deleted. "Read and
rejected" is a complete outcome; leaving the file behind pretends the work is
pending.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Require confirmation before deleting raw sources.

This procedure authorizes irreversible deletion of docs/raw/ input—and does so before scc validate. Require explicit user confirmation, or archive the source, before deleting it.

Proposed ordering
 6. **Record it in `changelog.md`** — what changed, naming the pages with wikilinks.
-7. **Delete the source from `docs/raw/`.** This is the step that gets skipped. The
-   finding exists because of it.
-8. `scc validate` before you call it done.
+7. `scc validate` before you call it done.
+8. Ask the user to confirm deletion, then remove the source from `docs/raw/`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
6. **Record it in `changelog.md`** — what changed, naming the pages with wikilinks.
7. **Delete the source from `docs/raw/`.** This is the step that gets skipped. The
finding exists because of it.
8. `scc validate` before you call it done.
A source that turns out not to be worth a page still gets deleted. "Read and
rejected" is a complete outcome; leaving the file behind pretends the work is
pending.
6. **Record it in `changelog.md`** — what changed, naming the pages with wikilinks.
7. `scc validate` before you call it done.
8. Ask the user to confirm deletion, then remove the source from `docs/raw/`.
A source that turns out not to be worth a page still gets deleted. "Read and
rejected" is a complete outcome; leaving the file behind pretends the work is
pending.
🧰 Tools
🪛 SkillSpector (2.4.4)

[warning] 71: [EA2] Autonomous Decision Making: Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Remediation: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.

(Excessive Agency (EA2))

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@internal/assets/templates/claude/skills/wiki/SKILL.md` around lines 30 - 37,
Update the raw-source handling procedure in the wiki skill so deleting files
from docs/raw/ requires explicit user confirmation before the irreversible
deletion; otherwise archive the source instead. Preserve the requirement to
record the outcome in changelog.md and run scc validate, including for sources
rejected as not worth a page.

Source: Linters/SAST tools

@protonspy
protonspy merged commit 754ab2c into main Jul 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant