Contract Maturity Issue Writer
Overview
Use this skill for Solidity or protocol repositories when the goal is to turn a code maturity assessment into concrete, file-backed GitHub issues.
This skill does not replace the assessment. It first uses the Trail of Bits-based code-maturity-assessor, then converts concrete findings into issue drafts or approved GitHub issues.
When to Use
Use when:
- a smart contract repo needs a backlog derived from a maturity assessment
- the user wants actionable issues instead of a long assessment report
- findings need exact file paths, code locations, and test scope
Do not use when:
- the repository is not a smart contract or protocol repo
- the user wants a pure security audit without backlog generation
- there is not enough evidence to tie a finding to specific files or code locations
Workflow
Confirm repository fit
- Verify the repo is Solidity or protocol focused.
- If it is not, explain that
code-maturity-assessor is contract-centric and stop or switch approaches.
Verify the prerequisite skill exists and matches the expected source
- Check whether
code-maturity-assessor is available in the current skill set.
- Confirm the installed skill is the one based on Trail of Bits' "Building Secure Contracts - Code Maturity Evaluation" framework.
- If it is missing, invoke
skill-installer and install the correct code-maturity-assessor before continuing.
- If a different local skill with the same name exists but does not clearly match the Trail of Bits framework, stop and tell the user the prerequisite is ambiguous.
Run maturity assessment
- Invoke the Trail of Bits-based
code-maturity-assessor.
- Reuse its evidence instead of re-scoring the repo from scratch.
Extract concrete gaps
- Keep only findings that can be tied to specific files, functions, branches, or test gaps.
- Separate current behavior from proposed behavior.
Cluster into issue-sized themes
- Group findings by coherent implementation area such as:
- state-machine boundaries
- access control
- bond or accounting logic
- query or read APIs
- governance or decentralization gaps
- documentation or monitoring gaps
- Do not combine unrelated categories into one issue just to reduce count.
Write issue drafts
- Default to drafts first.
- Use the issue template below.
- For timing or threshold logic, specify
boundary - 1, boundary, and boundary + 1.
- For auth logic, name exact revert or custom errors when the code exposes them.
- For accounting logic, state the balance, reserve, or allowance effect that tests should assert.
Publish only after approval
- Present the issue drafts to the user.
- Only after approval, use
gh issue create or gh issue edit.
Issue Template
## Summary
[One short paragraph describing the gap and why it matters.]
## File Path
- `path/to/primary/file.ext`
- `path/to/existing/test_file.ext`
- `path/to/related/helper_or_mock.ext`
## Code Locations
- `functionOrModuleA(...)` at `path/to/file.ext:LINE`
- `branch/check/event` at `path/to/file.ext:LINE`
- `related getter/helper` at `path/to/file.ext:LINE`
## Current Coverage
- Existing tests already cover [what is already tested].
- Missing coverage is mainly around [boundary/default/error-path/state-transition/etc.].
## Detailed Scope
- Add tests for [specific function or path]:
- [exact input/state]
- [expected success or revert]
- [expected state change / emitted event / returned value]
- Add tests for [another path]:
- [boundary - 1]
- [boundary]
- [boundary + 1]
- Add tests for [negative case]:
- [unauthorized caller]
- [invalid state]
- [missing dependency / zero address / insufficient balance]
- If current behavior is surprising but intentional, say so explicitly:
- [document current behavior rather than changing semantics in this issue]
## Why
[2-4 sentences on risk: security, accounting, state machine, API contract, regression risk, etc.]
## Acceptance Criteria
- Every listed path has direct test coverage.
- Tests assert exact errors, return values, and state fields, not only "call succeeds".
- Boundary behavior is covered explicitly where timing, math, or threshold logic is involved.
- Uninitialized or default-state behavior is covered where relevant.
- Tests are readable enough that expected behavior can be inferred from test names alone.
Writing Rules
- Always include
File Path.
- Always include
Code Locations with exact lines if available.
- Describe current behavior, not guessed behavior.
- Distinguish existing coverage from missing coverage.
- Prefer one issue per coherent theme.
- Do not write vague TODO issues that lack a concrete implementation surface.
Common Mistakes
- Assuming any
code-maturity-assessor is acceptable without checking that it is the Trail of Bits-based framework.
- Skipping the maturity assessment and jumping straight to issues.
- Writing issues from category names alone without file-backed evidence.
- Confusing current behavior with desired behavior.
- Writing "add more tests" without naming specific functions, branches, or revert paths.
- Using broad issue scopes that mix testing, governance, and accounting changes together.
Output Modes
- Draft mode:
- Produce issue markdown only.
- Publish mode:
- After user approval, create or edit GitHub issues with
gh.
Default to draft mode unless the user explicitly asks to post or update issues.
1---2name: contract-maturity-issue-writer3description: Use when assessing a smart contract repository with code maturity criteria and converting concrete gaps into structured GitHub issues.4---56# Contract Maturity Issue Writer78## Overview910Use this skill for Solidity or protocol repositories when the goal is to turn a code maturity assessment into concrete, file-backed GitHub issues.1112This skill does not replace the assessment. It first uses the Trail of Bits-based `code-maturity-assessor`, then converts concrete findings into issue drafts or approved GitHub issues.1314## When to Use1516Use when:17- a smart contract repo needs a backlog derived from a maturity assessment18- the user wants actionable issues instead of a long assessment report19- findings need exact file paths, code locations, and test scope2021Do not use when:22- the repository is not a smart contract or protocol repo23- the user wants a pure security audit without backlog generation24- there is not enough evidence to tie a finding to specific files or code locations2526## Workflow27281. Confirm repository fit29 - Verify the repo is Solidity or protocol focused.30 - If it is not, explain that `code-maturity-assessor` is contract-centric and stop or switch approaches.31322. Verify the prerequisite skill exists and matches the expected source33 - Check whether `code-maturity-assessor` is available in the current skill set.34 - Confirm the installed skill is the one based on Trail of Bits' "Building Secure Contracts - Code Maturity Evaluation" framework.35 - If it is missing, invoke `skill-installer` and install the correct `code-maturity-assessor` before continuing.36 - If a different local skill with the same name exists but does not clearly match the Trail of Bits framework, stop and tell the user the prerequisite is ambiguous.37383. Run maturity assessment39 - Invoke the Trail of Bits-based `code-maturity-assessor`.40 - Reuse its evidence instead of re-scoring the repo from scratch.41424. Extract concrete gaps43 - Keep only findings that can be tied to specific files, functions, branches, or test gaps.44 - Separate current behavior from proposed behavior.45465. Cluster into issue-sized themes47 - Group findings by coherent implementation area such as:48 - state-machine boundaries49 - access control50 - bond or accounting logic51 - query or read APIs52 - governance or decentralization gaps53 - documentation or monitoring gaps54 - Do not combine unrelated categories into one issue just to reduce count.55566. Write issue drafts57 - Default to drafts first.58 - Use the issue template below.59 - For timing or threshold logic, specify `boundary - 1`, `boundary`, and `boundary + 1`.60 - For auth logic, name exact revert or custom errors when the code exposes them.61 - For accounting logic, state the balance, reserve, or allowance effect that tests should assert.62637. Publish only after approval64 - Present the issue drafts to the user.65 - Only after approval, use `gh issue create` or `gh issue edit`.6667## Issue Template6869```md70## Summary71[One short paragraph describing the gap and why it matters.]7273## File Path74- `path/to/primary/file.ext`75- `path/to/existing/test_file.ext`76- `path/to/related/helper_or_mock.ext`7778## Code Locations79- `functionOrModuleA(...)` at `path/to/file.ext:LINE`80- `branch/check/event` at `path/to/file.ext:LINE`81- `related getter/helper` at `path/to/file.ext:LINE`8283## Current Coverage84- Existing tests already cover [what is already tested].85- Missing coverage is mainly around [boundary/default/error-path/state-transition/etc.].8687## Detailed Scope88- Add tests for [specific function or path]:89 - [exact input/state]90 - [expected success or revert]91 - [expected state change / emitted event / returned value]92- Add tests for [another path]:93 - [boundary - 1]94 - [boundary]95 - [boundary + 1]96- Add tests for [negative case]:97 - [unauthorized caller]98 - [invalid state]99 - [missing dependency / zero address / insufficient balance]100- If current behavior is surprising but intentional, say so explicitly:101 - [document current behavior rather than changing semantics in this issue]102103## Why104[2-4 sentences on risk: security, accounting, state machine, API contract, regression risk, etc.]105106## Acceptance Criteria107- Every listed path has direct test coverage.108- Tests assert exact errors, return values, and state fields, not only "call succeeds".109- Boundary behavior is covered explicitly where timing, math, or threshold logic is involved.110- Uninitialized or default-state behavior is covered where relevant.111- Tests are readable enough that expected behavior can be inferred from test names alone.112```113114## Writing Rules115116- Always include `File Path`.117- Always include `Code Locations` with exact lines if available.118- Describe current behavior, not guessed behavior.119- Distinguish existing coverage from missing coverage.120- Prefer one issue per coherent theme.121- Do not write vague TODO issues that lack a concrete implementation surface.122123## Common Mistakes124125- Assuming any `code-maturity-assessor` is acceptable without checking that it is the Trail of Bits-based framework.126- Skipping the maturity assessment and jumping straight to issues.127- Writing issues from category names alone without file-backed evidence.128- Confusing current behavior with desired behavior.129- Writing "add more tests" without naming specific functions, branches, or revert paths.130- Using broad issue scopes that mix testing, governance, and accounting changes together.131132## Output Modes133134- Draft mode:135 - Produce issue markdown only.136- Publish mode:137 - After user approval, create or edit GitHub issues with `gh`.138139Default to draft mode unless the user explicitly asks to post or update issues.