Skip to content
Back to skills

Speclink Config

ASecurity

Use when the workflow config's project context or per-artifact rules need composing or refreshing from the codebase — lands them through an approved diff.

  • 27 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 23, 2026
developmentgobashrailsawstestinggitsecuritydocumentation

Works with

  • cli

Security analysis

A100/100

Scanned November 23, 2026

npx -y skills add MomoChenisMe/speclink --skill speclink-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Speclink Config?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Speclink Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/momochenisme-speclink-config/badge)](https://www.skillsdirectory.com/skills/momochenisme-speclink-config)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: speclink-config
description: "Use when the workflow config's project context or per-artifact rules need composing or refreshing from the codebase — lands them through an approved diff."
license: MIT
compatibility: Requires speclink CLI.
metadata:
  author: speclink
  version: "v1.59.0"
  generatedBy: "Speclink"
---

**Conversation language**: write to the user in the language they use with you — progress updates, questions, and summaries. This skill is written in English, and its example messages show structure, not language: translate their prose, and keep commands, file paths, code, and fixed tokens (severity labels, status words) as they are. When a step sets the language of its own output — a document, a report, or the way it presents results and asks about them (for example through `locale`) — that step decides for that output. When you edit a document that already exists and no step sets its language, keep the language it is written in. When you run in a forked context that cannot see the conversation, use the language of the request you were given.

Compose the workflow config's `context` and `rules` from what the codebase structurally declares, take its `review` rules from the user alone, then land everything through a diff the user approves.

**Input**: Optionally a scope hint after `$speclink-config` (e.g. "rules only", "refresh the context"). If omitted, work the whole document.

**Prerequisites**: This skill requires the `speclink` CLI. If any `speclink` command fails with "command not found" or similar, report the error and STOP.

**What this document is.** `context` is the shared briefing every artifact prompt carries; `rules` are per-artifact constraints; `review` holds the review station's project rules — a `baseline` mode and three severity lists (`critical`, `warning`, `suggestion`) that its Standards axis checks. All three exist to add what the engine and the quality stations do not already know. The policy fields (`locale`, `spec_locale`, `tdd`, `audit`, `worktree`) and the review rules mode are answers, not findings — never infer them.

**This skill never writes without approval.** Every change reaches the file through `speclink workflow-config ... --dry-run`, shown as a diff, and is only applied after the user says so.

---

## Step 1: Read the fixed input set

Scan only the sources below. **Do not scan the source tree.** The goal is what the project structurally declares about itself; prose derived from implementation files ages out within a sprint and produces the churn this skill exists to prevent.

1. **Dependency manifests** — the workspace manifest (member list, shared dependency table) and each package's own dependency list. These name the components, their boundaries, and which runtimes each component is allowed to touch.
2. **README** — the project's own statement of what it is and who it serves.
3. **Documentation index** — the docs directory's entry points (index, architecture, status). Titles and one-line summaries only; do not mine the bodies.
4. **The current document** — `speclink workflow-config show --json`. What is already written is the starting point, not a blank page.
5. **Shared vocabulary** — `speclink language show`, when the project keeps one.

State which of the five you actually found. A missing source is a fact to report, not a gap to fill by guessing.

## Step 2: Draft against the four criteria

Every candidate line — for `context` and for `rules` alike — must survive all four. A line that fails any one of them is dropped, not softened.

### Criterion 1 — Never restate what the engine injects or a quality station already carries

Policy toggles and the schema's built-in artifact instructions are injected automatically; the quality stations carry their own standards inside their skills. Anything either of them already says is noise in this document.

**Injected content: disprove by payload, never from memory.** For each artifact of the active schema:

```bash
speclink instructions <artifact> --json
```

Read the returned instruction text and check your candidate line against it, one line at a time. If the payload already carries the requirement, drop the candidate. Do this for every artifact you intend to write rules for — an untested claim of "the engine doesn't say this" is exactly how duplicates got in before.

**Quality-station canon: disprove against the generated station skill, never from memory.** A station's standards live in its own generated skill file, in the same skills directory as this one — the review station's code-smell baseline sits in `speclink-review`, and no instructions payload carries it, so the payload check above cannot see it. Open whichever station skills are present in that directory and could overlap with a candidate line (which stations generate varies by tool), and read the passage each would duplicate. If a station already carries the standard, drop the candidate: the station skill is its single home, and a copy here is a second canon that drifts away from it.

### Criterion 2 — Artifact-specific content belongs in rules

If a line only bites on one artifact, it is a rule for that artifact, not context. `context` is for what every artifact prompt needs: what the system is, how it is partitioned, which constraints cut across all of them. When in doubt, demote to rules — an over-broad context line is paid for on every single prompt.

### Criterion 3 — Nothing that goes stale

No version numbers, no counts, no percentages, no "currently N crates", no test totals, no dates. These are wrong within weeks and nobody notices. Name the structure, not its measurements.

### Criterion 4 — Every reference must exist

`context` and `rules` may name commands, test names, file paths, and documents as the means of verification. **Verify each one exists, every run** — a rule pointing at a deleted test is worse than no rule, because it reads as satisfied.

**Check existence statically.** Each kind of reference has a cheap way to resolve it:

- a file path → look it up on the filesystem;
- a test name → text-search the source tree for it;
- an npm script → read its declaration in `package.json`;
- a CLI subcommand → check it against the command's `--help` output.

**Do NOT execute the referenced test or build commands.** A referenced suite can run for minutes; that cost belongs to CI and to apply's own verification steps, not to a document review that re-checks every line on every run. Criterion 1's `speclink instructions <artifact> --json` probe is exempt — that is this skill's own probe, cheap and required. More broadly, the ban binds only the commands the document references: the skill's own verbs — Step 1's reads, Step 5's `--dry-run` previews — were never in it.

Anything that no longer resolves is removed in this pass, even if you did not add it.

The `review` rules do not come from this step — Step 4 takes them from the user — but they face the same judgement there: criteria 3 and 4 as written, and criterion 1's station-canon check while the smell baseline applies.

### The only reason to delete a line

An existing line is dropped ONLY when it fails one of the four criteria, or when the user's own answer in Step 3 or Step 4 withdraws it — the authority that lands a ruling is the same one that can take it back. **"It cannot be derived from the fixed input set" is NOT a reason to delete.** A rule that came from a user's ruling — a discussion conclusion landed into this document — is invisible in manifests and READMEs by nature, and nothing in the file marks it as such, because a rewrite drops comments. So outside an explicit withdrawal, judge every existing line against the four criteria alone: if it survives all four, it stays, whatever produced it.

### What a scope hint narrows

With a scope hint, criteria 1–3 are re-judged only over the artifacts in scope — a hint of "rules for specs" re-judges the specs rules and leaves the tasks rules alone. **Criterion 4's reference check always covers the whole document**, in scope or out: it is static and cheap, and a dangling reference anywhere is a rule that reads as satisfied. Without a hint, everything is re-judged over the whole document.

## Step 3: Confirm the policy fields in one table — do not infer them

The policy fields are the user's decision, and so are the test scope and the review rules mode. Show them together, then ask one question.

| Item | What it decides | Not set |
| --- | --- | --- |
| `locale` | the language for generated prose | English |
| `spec_locale` | the language for spec files (`auto` = follow `locale`) | English |
| `tdd` | whether apply enforces test-first discipline | `false` |
| `audit` | whether apply enforces sharp-edges discipline | `false` |
| `worktree` | whether apply works each change in its own git worktree | `false` |
| test scope | how much testing a task's verification runs — the fifth question below | the full suite |
| review rules mode | whether the review station takes project rules — the sixth question below | not set (the built-in code-smell baseline only) |

Show the user one table with every item and its current value from Step 1, in the user's language. An item with no value reads "not set — defaults to" its entry in the last column.

Then ask one question with the **AskUserQuestion tool**: keep everything, or change some of them?

- **Keep everything** — ask nothing more and change no policy field. Keeping is an answer the user gave, not a gap to fill.
- **Change some** — ask which items. When the items do not fit the tool's option limit for one question, ask which ones as plain text. Then ask only the items the user names, one question each, showing that item's current value. Every other item keeps its current value.

A first run — a document with no policy field set yet — shows the same table and asks the same one question. When the AskUserQuestion tool is unavailable, run the whole confirmation as plain text and wait for each answer.

Never infer any of these values from the repo, the test scope and the review rules mode included — a test directory does not mean `tdd: true`.

**Locale fields take locale CODES, never display names.** `locale` accepts exactly `tw`, `ja`, `en`; `spec_locale` accepts `tw`, `ja`, `en`, `auto`. Map the user's natural-language answer to its code before writing — 「繁體中文」 → `tw`, 「日本語」 → `ja`, "English" → `en` — the write verb rejects any value outside the code set, including display names.

**`worktree` also syncs the skill files, in local mode.** It lands like the other fields, through `speclink workflow-config set worktree <true|false>` and its `--dry-run` preview in Step 5. In local mode that write syncs the skill files: turning it on generates the worktree skills, and turning it off removes them. The CLI refuses to turn it off while a linked worktree is still active, and lists each one; relay the refusal to the user as it stands. The config stays as it was, and the refusal already says how to wrap those worktrees up — do not close or remove any worktree yourself. In remote mode the write changes only the server's config: it neither syncs the skill files nor checks for active worktrees, so tell the user that.

### The fifth question — how much testing a task's verification runs

Same nature as the policy fields: an answer, not a finding. When the current document already carries a test-scope rule, quote that rule as this row's current value; with none, the row reads not set. When the user keeps everything, the answer itself leaves the test-scope rule as it is; like any other line, it still faces the four criteria — criterion 4 removes it when a reference in it no longer resolves.

When the user names this item, ask:

> Should a task's verification step run the full test suite, or only the tests for the surfaces the task touched?

- **"Only the affected surfaces"** — build the project's own mapping from the dependency manifests you already read in Step 1 (which component is verified by which test command), write it as a rule under the `tasks` rules, and land it through the same `--dry-run` approval as everything else.
- **"The full suite"** — write no test-scope rule at all. When the current document already carries a test-scope rule, this answer is the user's ruling to withdraw it: remove that rule through the same `--dry-run` approval. Otherwise leave the current document as it is.

### The sixth question — the review rules mode

Same nature as the policy fields: an answer, not a finding. Review rules are optional. With no `review` block, `speclink workflow-config show --json` still reports baseline `extend` and three empty lists; show that row as not set, the default. With a `review` block, show its mode and how many rules each of the three lists holds. Keeping everything keeps the current mode: not set without a block, the block's own mode with one.

When the user names this item, ask one question with three choices:

- **not set** (the default) — this skill adds nothing to the `review` block: no `baseline` write and no new rule. Without a block, the review station keeps its built-in code-smell baseline alone. With a block, its mode and rules stay as they are — choosing not set is not a withdrawal — and Step 4 still checks those rules, so a rule that fails a check there is proposed for removal like any other line.
- `extend` — the review station checks its built-in code-smell baseline plus the project's review rules.
- `replace` — it checks the project's review rules only. With all three lists empty, its Standards axis judges against repo documents only, which is a legitimate choice.

## Step 4: Route the user's reminders

A reminder is a rule the user wants the project to keep. Reminders come from the user only: stated in the conversation, pasted as a list, or given as a file path that you then read. A reminder list is the user's input, not part of Step 1's fixed input set. Do not search any tool's conversation history for reminders — the formats differ from tool to tool, the logs are large, and they are private.

Ask whether the user has reminders to add. With the review rules mode `extend` or `replace`, also ask whether they want to add or change any review rules.

### Three questions, four destinations

Judge each reminder with three questions:

1. Does the evidence of a violation live in the code, or in a document?
2. Can a reviewer who reads only the patch tell that it is violated?
3. How costly is it to find the violation late?

The answers decide the destination:

- the evidence is in the code, and the patch alone shows it → **a review rule**.
- the evidence is in a document — what a proposal, design, spec or task list has to state → **a rule for one artifact** (`rules`).
- finding the violation late is costly, the plan can state what to do, and the patch still shows a violation → **both**, but only when each stage gets its own use from it. The two sentences then describe different things: the artifact rule asks the plan to state something, and the review rule checks the code itself. Otherwise pick one side by the first two answers — an artifact rule is injected every time that artifact is produced, so a copy that adds nothing is paid for on every prompt.
- the reminder fails the checks of its destination → **not taken**.

A review rule never says that the code follows an artifact: that is the verify station's work.

**The review rule exit opens only with a mode.** With the review rules mode `extend` or `replace`, all four destinations are open. With it not set, a reminder routed to a review rule is not written — list it in the report as "review rule — not written" — and a reminder routed to both lands only its artifact-rule sentence.

**Splitting an artifact rule.** With the mode `extend` or `replace`, an existing artifact rule can hold a sentence that really checks the code itself. Suggest splitting that part out into a review rule. The split lands only after the user confirms it; when the user declines, the sentence stays where it is, because the deletion limit still holds. Do not record a declined suggestion — the document has no place for it, so the next run suggests it again, and that is expected: a suggestion is not a diff, so convergence is unaffected. With the mode not set, suggest no split.

**Timing.** When a reminder depends on behavior that is not in the code yet — a discussion concluded it, but the change that implements it has not landed — do not write it. Tell the user, and list it in the report. To check a discussion's or a change's state, use `speclink discuss list --json` or `speclink list --json`; do not read the spec directory's files for it.

**Each destination keeps its own checks.** A reminder routed to an artifact rule faces the four criteria of Step 2. A reminder routed to a review rule faces the checks below.

### Review rules — from the user, never from the repo

The `critical`, `warning` and `suggestion` lists hold rules the review station's Standards axis enforces; the list a rule sits in sets the severity of its violation. **Do not compose review rules from the fixed input set or from repo documents** (CLAUDE.md, AGENTS.md, CONTRIBUTING, lint configs and the like): the Standards axis already reads those documents, and a copy here becomes a second canon. Review rules come only from what the user states or from the reminder list the user gives, routed as above.

**Severity: is there a legitimate exception?** For each rule bound for a review list, suggest a list by whether a violation can have a legitimate exception, and let the user confirm it or move it before anything lands:

- a violation is always wrong, with no legitimate exception → `critical`
- a violation is usually to be fixed, with an occasional legitimate exception → `warning`
- the rule states a preference → `suggestion`

The wording is a hint only, and never decides the list on its own: 「不得」「一律」「要」「宜」「偏好」, "never", "always", "must", "prefer". "Components always use design-token colors" reads as an absolute, but a chart palette legitimately needs raw color codes, so it is a `warning`.

**Checks for every review rule**, each existing one and each new one:

- **While the mode is `extend`, drop a rule that restates the smell baseline.** A `review` block with no `baseline` key reads as `extend`. Read the baseline in the generated `speclink-review` skill (criterion 1's station-canon check): "variable names say what they hold" restates Mysterious Name. Tell the user why the rule is dropped. With `replace` the baseline does not apply, so skip this check — the same rule can land.
- **Do not take a rule that a test or a lint already guards.** Check it with the same kind of targeted static lookup as criterion 4: search the lint configuration for that rule, and text-search for a test that pins the behavior. Do not read through the source code for it. When a guard turns up, name that test or lint rule in the report as the reason; when none turns up, judge the rule as usual.
- **Do not take a rule that belongs to another station.** With `audit` on, a security rule belongs to the audit station. Whatever `audit` says, a rule that the code must follow an artifact belongs to the verify station. Judge `audit` by the value confirmed in this run's table. When this run turns `audit` from off to on, propose removing the existing security review rules alongside the `audit` change, in the same set of `--dry-run` previews.
- Criteria 3 and 4 apply as written: nothing that goes stale, and every path, test name or command a rule references is checked statically.

With the mode not set, only two of these run, over the rules already in the block: the removal of security rules when this run turns `audit` on, and criteria 3 and 4.

An existing review rule is dropped only for the reasons any other line is: it fails these checks, or the user withdraws it.

## Step 5: Show the diff, then write

**Draft language**: the lines you drafted or rewrote are in the language of `locale` as Step 3 confirmed it (`tw` Traditional Chinese, `ja` Japanese, `en` or not set English) — when Step 3 changed it, rewrite those lines before you produce the diff. Lines you leave unchanged keep their wording, and review rules keep the user's own words. Commands, file paths, test names, config keys and code identifiers stay as they are.

Produce the diff for each change with the write verb's own `--dry-run`, so the preview is byte-identical to what would land:

```bash
speclink workflow-config set <key> <value> --dry-run
speclink workflow-config set worktree <true|false> --dry-run
speclink workflow-config context --stdin --dry-run
speclink workflow-config rules <artifact> --stdin --dry-run
speclink workflow-config review <critical|warning|suggestion> --stdin --dry-run
speclink workflow-config review baseline <extend|replace> --dry-run
```

A list write replaces the whole list: feed every rule that list should keep on stdin, one per line. In local mode the `worktree` write also syncs the skill files; Step 3 says what to relay when it is refused, and what remote mode leaves out.

Never compute a diff yourself — a hand-made preview and the real serialization can disagree, and a preview that lies is worse than none.

Present the diffs and WAIT — NEVER write before the user approves. Only after the user approves, re-run the same commands without `--dry-run`. Note for the user that a rewrite drops template comments from the file (the read-modify-write trade-off) — that is expected, not damage.

The same commands work in both local and remote mode, apart from the `worktree` side effects above; in remote mode the write is guarded against concurrent edits, and a refusal means someone else changed the document — re-run the command and it applies on top.

## Step 6: Verify convergence

Run this skill a second time against the same, unchanged codebase. **The second run's diffs must be empty** — the `review` block included.

A non-empty second diff is not a reason to write again — it means a criterion was applied loosely (usually 3, restating something measurable, or 2, moving a line between `context` and `rules`). Go back to Step 2, find which line moved, and fix the judgment. Do not land the second diff.

Report at the end:

- which of the five sources were read;
- what was added, and what was dropped under which criterion (review rules included);
- every reminder and its destination, with the reason for each one not taken or not written: it fails a criterion, it restates the smell baseline, a test or lint already guards it, it belongs to another station, it is not in the code yet, or it is a review rule while the mode is not set ("review rule — not written");
- the convergence result.

## Guardrails

Check these before you report:

- [ ] **Don't scan the source tree** — the fixed input set is the whole input.
- [ ] **Don't restate injected instructions** — disprove with `speclink instructions <artifact> --json`, per line.
- [ ] **Don't restate quality-station canon** — read the generated station skill; a copy here is a second canon that drifts.
- [ ] **Don't write anything that can go stale** — no versions, counts, or dates.
- [ ] **Don't reference what doesn't exist** — verify every command, test, and path statically, every run; the referenced test and build commands themselves are never executed.
- [ ] **Don't delete for the wrong reason** — a line falls only to the four criteria or to the user's own withdrawal; "cannot be derived from the fixed input set" is never a reason.
- [ ] **Don't infer the policy fields** — confirm them in one table, test scope and review rules mode included, with one question; then ask only the items the user names.
- [ ] **Don't derive review rules from the repo** — review rules are optional; take them only from the user, suggest a list by whether a violation has a legitimate exception, and let the user confirm it.
- [ ] **Don't leave a reminder unaccounted for** — the report gives every reminder its destination, and the reason when it was not taken or not written.
- [ ] **Don't write without approval** — `--dry-run` first, always.
- [ ] **Don't draft in the wrong language** — new and rewritten lines follow **Draft language**, in `locale` as Step 3 confirmed it (Step 5).
- [ ] **Don't land a non-empty second run** — that is a signal to re-judge, not to write.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.