Skip to content
Back to skills

Build A Slice

ASecurity

Build one agreed change with small files, shared design rules and tests that fail without the new behavior.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
developmentrustgoexpressapi

Works with

  • api

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add BuffApe/BuffApe --skill build-a-slice --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Build A Slice?

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

Security grade badge for Build A Slice
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/buffape-build-a-slice/badge)](https://www.skillsdirectory.com/skills/buffape-build-a-slice)

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: build-a-slice
description: Build one agreed change with small files, shared design rules and tests that fail without the new behavior.
---

# Build a slice

Start from one change with a one-line goal and a **done when** list.
Read the relevant code, tests and repository rules before editing.
For screens or a changed look, find the person's approved prototype version.
If that approval is missing, prepare the prototype for review first.

## Keep the scope small

Find the existing action or component before adding another.
Build only what the goal and journeys need today.
List the files you expect to touch and any shared contract they consume.
Respect file ownership when others are working in the same repository.

Prefer a function over a framework and an existing store over a new service.
Add a dependency only for a present need that existing code cannot meet simply.
Do not add fields, options, logs or extension points for imagined future work.
If the slice cannot stand alone, return to the plan and split or reorder it.

## Prove the behavior

Write a test that expresses an acceptance result, then run it before the fix.
Confirm it fails for the missing behavior, rather than a broken test setup.
Implement the smallest change that makes that result pass.
Add the important failure and permission cases from the journey.

Use the nearest appropriate level:

- Unit tests for calculations and decisions.
- Integration tests for storage, boundaries and shared actions.
- View tests for states, labels and callbacks.
- A journey test when several screens or services must work together.

Keep tests repeatable: made-up records, isolated storage and fake services.
Do not use live AI, real payments or personal records in ordinary tests.
Assert what a caller or person can observe, rather than private implementation.
Leave existing tests intact unless the agreed change alters their behavior.
When one changes, say which old promise changed and why.

## Give each file one job

Keep files small enough to understand in one sitting.
As a guide, split production files near 300 lines and functions near 50.
Split by job: actions, storage queries, routes, views or formatting.
Avoid a general-purpose helper that hides a single straightforward operation.

If a file needs restructuring, separate that from the behavior change.
Run its tests before and after the refactor to show behavior stayed the same.
Use plain internal types and validate untrusted inputs at the boundary.
Keep one business action for all callers, such as UI, API and automation.
Check access and sensitive-data rules in that shared action.

## Keep screens faithful

Use the approved views and components; wire data and actions separately.
Keep loading, empty, error and recovery states from the prototype.
Do not quietly change the look to make implementation easier.
Send a necessary change back through prototype review.

Every displayed string uses the project's translation function or equivalent.
Keep each supported language complete, including errors and accessibility labels.
Format dates, numbers and amounts with locale-aware tools.
Use logical layout directions so supported right-to-left languages work.

Use shared components and semantic theme tokens for color, font and spacing.
A semantic token names a purpose, such as muted text or panel background.
Do not hard-code copy or colors in views.
Keep secrets out of code, test fixtures, screenshots and logs.
Record only information an operator or user needs; scrub sensitive fields.

## Close the slice

Run the changed tests and nearby tests, plus the affected type and lint checks.
Compare the finished journey and data with the approved prototype.
Update the example app or sample that demonstrates the changed capability.
Document changed behavior once; add upgrade steps for public contract changes.
Check the diff for unrelated edits, generated files and accidentally added secrets.

Report the files changed, actual check results and any unfinished acceptance item.
A passing test does not replace the project's final verification or review.
Follow the repository's commit and review rules; building is not release approval.

## With BuffCore

`ape change <id> --check` runs the slice's declared checks; `pnpm verify` checks
types, lint and tests with coverage floors. `ape prototype data --check --change <id>`
checks the approved data model before the slice is called complete.

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.