AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Spec Before Code

skill-m2laborg-agent-skills-spec-before-code · by M2LabOrg

Michel's lightweight design-doc workflow — write a markdown spec under `specs/` before implementing any non-trivial feature, including a threat model. Use whenever the user proposes a new feature, a non-trivial refactor, a new service / endpoint / data flow, an integration with an external system, or anything touching auth, secrets, PII, or multi-tenant data. Triggers on phrases like "let's add",…

No reviews yet
0 installs
26 views
0.0% view→install

Install

$ agentstack add skill-m2laborg-agent-skills-spec-before-code

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-m2laborg-agent-skills-spec-before-code)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
5mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Spec Before Code? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Spec Before Code

For non-trivial work, draft a short markdown spec before writing code. Specs prevent over-engineering, surface unknowns, and create a record of why a design was chosen.

When to Write a Spec

Write one when any of these is true:

  • Estimated effort > 1 day of work
  • Touches authentication, authorization, secrets, PII, or multi-tenant boundaries
  • Adds a new service, queue, table, bucket, endpoint, or external integration
  • Changes a public API contract (request/response shape, status codes)
  • Affects more than one container / service / repo
  • The user explicitly asks for a "design doc", "RFC", or "spec"

For everything else (bug fixes, small features, refactors), skip the spec and go straight to implementation — but capture the decision in the PR description.

Folder Layout

specs/
├── README.md                    # Index of specs (one-line summary each)
├── 0001-feature-name.md         # Numbered, kebab-case
├── 0002-another-feature.md
└── archive/                     # Specs whose features have shipped (optional)

Number specs sequentially. Don't reuse numbers.

Spec Template (Use Exactly)

#  — 

**Status:** Draft | In review | Accepted | Implemented | Superseded by #NNNN | Rejected
**Author:** Michel  **Date:**   **Reviewers:** 
**Related:** PBI #, Issue #, Spec #

## Problem

## Goals
- 
- ...

## Non-Goals
- 
- ...

## Constraints
- 

## Proposed Design

### Architecture
```mermaid

Data Model

API / Interface

Failure Modes

Threat Model

Alternatives Considered

  1. **** — . Rejected because .
  2. **** — ... Rejected because ...

Migration / Rollout

Open Questions

  • [ ]
  • ...

Test Plan

Success Metrics


## Threat Model — Always Include

Every spec includes a threat model section, even for "boring" features. Use the **STRIDE** framework, or the lighter "assets / actors / threats / mitigations" form below.

```markdown
## Threat Model

### Assets
- 

### Actors / Trust Boundaries
- 
- 

### Threats (STRIDE)
| Category | Threat | Likelihood | Impact | Mitigation |
|---|---|---|---|---|
| Spoofing |  | Low/Med/High | Low/Med/High |  |
| Tampering |  | ... | ... | ... |
| Repudiation |  | ... | ... | ... |
| Information disclosure |  | ... | ... | ... |
| Denial of service |  | ... | ... | ... |
| Elevation of privilege |  | ... | ... | ... |

### Residual Risks

### Secrets & PII
- 
- 

For features with no realistic security surface, you can shorten this to one paragraph — but always include it. The act of writing it forces the question.

Discipline

  • Specs are short. Aim for 1–3 pages of markdown. If it's longer, the design probably isn't crisp yet.
  • Spec the problem, not just the solution. A spec that skips "Problem" is a recipe for solving the wrong thing.
  • Diagram with Mermaid, not ASCII. See the mermaid-diagrams skill.
  • Reviewable in a PR. Open the spec as its own small PR before the implementation PR, so the design conversation happens on the spec, not on 800 lines of code.
  • Status field is real. Update it as the spec moves through review and implementation.
  • Archive after shipping. Move implemented specs to specs/archive/ (or just leave them in place with Status: Implemented) so the history stays.

Anti-Patterns

  • Skipping the spec because "it's faster" — and rebuilding twice.
  • "Goals" that are just a feature description; missing measurable outcomes.
  • Empty "Alternatives Considered" — at least one alternative was real, document it.
  • Threat model = "no security implications". Almost never true; force yourself to think about it.
  • Spec that becomes stale because nobody updates Status after implementation drifts.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.