Agent skill

Code Completion Semantic Constraints

by ArabelaTso in ArabelaTso/Skills-4-SE

Automatically complete partial code snippets while satisfying semantic constraints including variable types, invariants, pre/post-conditions, interface contracts, and expected input/output behavior.

Apache-2.0Auto-check passed

Install Code Completion Semantic Constraints

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill code-completion-semantic-constraints -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE code-completion-semantic-constraints --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-completion-semantic-constraints .claude/skills/code-completion-semantic-constraints && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
code-completion-semantic-constraints
GitHub stars
253
Token cost
~1.2k tokens
SKILL.md length
452 words
Files
1
Skills in repo
151
Repo updated
First seen
Licence
Apache-2.0

At a glance

Automatically complete partial code snippets while satisfying semantic constraints including variable types, invariants, pre/post-conditions, interface contracts, and expected input/output behavior.

  • Works in 5 steps: Parse Input → Analyze Constraints → Complete the Code → …
  • Users provide incomplete code with specific requirements like complete this function that takes a list and returns sorted unique elements
  • SKILL.md covers Overview, Workflow, Examples and Output Format, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Code Completion Semantic Constraints is an agent skill from ArabelaTso/Skills-4-SE. Automatically complete partial code snippets while satisfying semantic constraints including variable types, invariants, pre/post-conditions, interface contracts, and expected input/output behavior. Use when users provide incomplete code with specific requirements like "complete this function that takes a list and returns sorted unique elements" or "fill in this method body that must maintain the invariant that x stays positive" or "implement this interface method with these type constraints." Produces…

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Users provide incomplete code with specific requirements like complete this function that takes a list and returns sorted unique elements
  • Fill in this method body that must maintain the invariant that x stays positive
  • Implement this interface method with these type constraints. Produces compilable
  • Executable code with tests and a constraint satisfaction report

Example prompts

  • “implement this interface method with these type constraints.”
  • “/code-completion-semantic-constraints”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Parse Input
  2. Analyze Constraints
  3. Complete the Code
  4. Generate Verification Tests
  5. Produce Constraint Satisfaction Report

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python, java and c).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Code Completion Semantic Constraints loads about 1.2k tokens when it runs. Until then it costs about 155 tokens; SKILL.md has 452 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~155
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 452 words, ~1,179 tokens.

Download SKILL.mdSave it as .claude/skills/code-completion-semantic-constraints/SKILL.md (or your agent's skills folder).
name
code-completion-semantic-constraints
description
Automatically complete partial code snippets while satisfying semantic constraints including variable types, invariants, pre/post-conditions, interface contracts, and expected input/output behavior. Use when users provide incomplete code with specific requirements like "complete this function that takes a list and returns sorted unique elements" or "fill in this method body that must maintain the invariant that x stays positive" or "implement this interface method with these type constraints." Produces compilable, executable code with tests and a constraint satisfaction report.

Code Completion with Semantic Constraints

Overview

Complete partial code snippets while satisfying specified semantic constraints. Produces compilable code, verification tests, and a detailed report explaining how each constraint was satisfied.

Workflow

1. Parse Input

Extract and categorize the provided information:

Partial Code: Identify the incomplete code structure (function signature, class skeleton, method stub, etc.)

Semantic Constraints: Categorize constraints by type:

  • Type constraints: Variable types, return types, generic bounds
  • Invariants: Pre-conditions, post-conditions, loop invariants
  • Behavioral constraints: Expected input/output pairs, edge case handling
  • Interface contracts: Method signatures, protocol conformance
  • Performance constraints: Time/space complexity requirements
2. Analyze Constraints

For each constraint:

  • Determine if it's satisfiable
  • Identify dependencies between constraints
  • Note any conflicts or ambiguities
  • If constraints are unclear or conflicting, ask for clarification before proceeding
3. Complete the Code

Generate code that:

  • Compiles without errors in the target language
  • Satisfies all specified constraints
  • Follows language idioms and best practices
  • Includes necessary imports, type annotations, and error handling
  • Uses minimal complexity (avoid over-engineering)
4. Generate Verification Tests

Create minimal test cases that verify:

  • Type constraints are respected
  • Pre-conditions and post-conditions hold
  • Expected input/output behavior is correct
  • Edge cases are handled properly
  • Performance constraints are met (if specified)
5. Produce Constraint Satisfaction Report

Document how each constraint was satisfied:

  • Map each constraint to the code that satisfies it
  • Explain the reasoning for implementation choices
  • Note any assumptions made
  • Highlight any constraints that required trade-offs

Examples

Example 1: Type and Behavioral Constraints

Input:

python
def process_items(items):
    # TODO: complete this function
    pass

Constraints:

  • items is a list of integers
  • Return a list of unique integers in ascending order
  • Handle empty list (return empty list)
  • Time complexity: O(n log n)

Output: Completed function with sorting logic, tests for empty/normal/duplicate cases, and report explaining constraint satisfaction.

Show full SKILL.md (173 more words)Show less
Example 2: Interface Contract

Input:

java
public class DataCache implements Cache {
    // TODO: implement required methods
}

Constraints:

  • Implement Cache interface (get, put, remove methods)
  • Thread-safe operations
  • LRU eviction policy with max size 100
  • Return null for missing keys

Output: Complete class implementation, concurrency tests, and report mapping each interface method to implementation.

Example 3: Invariant Preservation

Input:

c
void update_balance(Account* acc, int amount) {
    // TODO: complete
}

Constraints:

  • Pre-condition: acc != NULL && acc->balance >= 0
  • Post-condition: acc->balance >= 0 (balance never negative)
  • If amount would make balance negative, set to 0 instead

Output: Implementation with bounds checking, tests for edge cases, and report showing invariant preservation.

Output Format

Provide three components:

1. Completed Code

  • Fully compilable and executable
  • Includes necessary imports, type annotations, error handling
  • Follows language conventions

2. Verification Tests

  • Minimal test suite covering constraint verification
  • Include edge cases and boundary conditions
  • Use appropriate testing framework for the language

3. Constraint Satisfaction Report

  • Table or list mapping each constraint to implementation details
  • Explanation of design choices
  • Any assumptions or trade-offs made

Language Support

This skill works with any programming language. Adapt constraint types and verification approaches to language-specific features (e.g., type systems, contract programming, assertion libraries).

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/code-completion-semantic-constraints of ArabelaTso/Skills-4-SE.

Open the folder on GitHubat commit 4f38503

Compare with similar skills

Code Completion Semantic Constraints next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Code Completion Semantic Constraints compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Code Completion Semantic Constraints this skillArabelaTso/Skills-4-SE253—~1.2kAutomated safety check: PassApache-2.0
Complete Partial PRpydantic/pydantic-ai20k—~2.4kAutomated safety check: PassMIT
Semantic Liststhedaviddias/Front-End-Checklist74k—~504Automated safety check: PassMIT
Semantic Versioningsickn33/agentic-awesome-skills47k1 repos~2.6kAutomated safety check: PassMIT
Semantic Kernelgithub/awesome-copilot40k2 repos~756Automated safety check: PassMIT
Verification Before Completionforyourhealth111-pixel/Vibe-Skills3.6k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Complete Partial PR

    pydantic/pydantic-ai

    Official

    Evaluate and complete an issue or PR where the submitted patch fixes only a narrow symptom of the reported pain point.

    20k GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Semantic Lists

    thedaviddias/Front-End-Checklist

    A skill your agent uses when reviewing rendered HTML, interactive components, or design-system patterns related to Use semantic list elements.

    74k GitHub stars~504 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Semantic Versioning

    sickn33/agentic-awesome-skills

    Automate versioning and changelog generation using semantic versioning principles.

    47k GitHub starsUsed in 1 repo~2.6k tokens
    DevelopmentAuto-check passed
  • Semantic Kernel

    github/awesome-copilot

    Official

    Create, update, refactor, explain, or review Semantic Kernel solutions using shared guidance plus language-specific references for .NET and Python.

    40k GitHub starsUsed in 2 repos~756 tokens
    DevelopmentAuto-check passed
  • Verification Before Completion

    foryourhealth111-pixel/Vibe-Skills

    Completion-evidence route used before claiming work is complete, fixed, passing, committed, or PR-ready.

    3.6k GitHub stars~1.1k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Constraint-Driven Development

    addyosmani/agent-skills

    Records a project's quality bar in CONSTRAINTS.md and watches diffs for signs an agent quietly weakened it, such as suppressions, skipped tests or lowered thresholds.

    102k GitHub starsUsed in 2 repos~5.2k tokens
    DevelopmentAuto-check passed

More from ArabelaTso/Skills-4-SE

All 151 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Code Completion Semantic Constraints

What does Code Completion Semantic Constraints do?

Automatically complete partial code snippets while satisfying semantic constraints including variable types, invariants, pre/post-conditions, interface contracts, and expected input/output behavior. Code Completion Semantic Constraints is an agent skill from ArabelaTso/Skills-4-SE. Automatically complete partial code snippets while satisfying semantic constraints including variable types, invariants, pre/post-conditions, interface contracts, and expected input/output behavior.

When should I use Code Completion Semantic Constraints?

Code Completion Semantic Constraints fits situations like: users provide incomplete code with specific requirements like complete this function that takes a list and returns sorted unique elements; fill in this method body that must maintain the invariant that x stays positive; implement this interface method with these type constraints. Produces compilable; executable code with tests and a constraint satisfaction report.

How do I install Code Completion Semantic Constraints in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill code-completion-semantic-constraints -a claude-code`. Or copy the skill folder (skills/code-completion-semantic-constraints in ArabelaTso/Skills-4-SE) into .claude/skills/code-completion-semantic-constraints in your project. Claude Code loads it when a task matches its description.

How do I install Code Completion Semantic Constraints in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill code-completion-semantic-constraints -a codex`. Or copy the skill folder (skills/code-completion-semantic-constraints in ArabelaTso/Skills-4-SE) into .agents/skills/code-completion-semantic-constraints in your project. Codex loads it when a task matches its description.

Can I use Code Completion Semantic Constraints in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill code-completion-semantic-constraints -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-completion-semantic-constraints, .gemini/skills/code-completion-semantic-constraints, .github/skills/code-completion-semantic-constraints and .opencode/skills/code-completion-semantic-constraints in your project.

What does Code Completion Semantic Constraints need to run?

SKILL.md names no scripts, command-line tools or credentials: Code Completion Semantic Constraints is instructions for the agent only. Our summary lists: Python 3.

Does Code Completion Semantic Constraints access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Code Completion Semantic Constraints safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Code Completion Semantic Constraints use?

Code Completion Semantic Constraints is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Code Completion Semantic Constraints use?

About 1.2k tokens (SKILL.md is roughly 4.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Code Completion Semantic Constraints?

Skills that share tags, products or a category with Code Completion Semantic Constraints: Complete Partial PR (pydantic/pydantic-ai, 20k stars), Semantic Lists (thedaviddias/Front-End-Checklist, 74k stars), Semantic Versioning (sickn33/agentic-awesome-skills, 47k stars) and Semantic Kernel (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Code Completion Semantic Constraints?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 151 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.