Constrained Code Generation

U

@

·

Generate code with strict language, length, complexity, dependency, and style constraints with verification reporting.

45 copies0 forks
Generate code that strictly adheres to these constraints.

## Function Specification
{{function_spec}}

## Constraints
- Language: {{language}}
- Max lines: {{max_lines}}
- Complexity: O({{complexity}})
- Dependencies: {{allowed_dependencies}}
- Style: {{style_guide}}

**Generation Process:**

1. **Requirement Analysis**
   - Parse function specification
   - Identify inputs, outputs, edge cases
   - Note constraint implications

2. **Algorithm Design**
   - Choose algorithm meeting complexity constraint
   - Plan implementation approach
   - Consider constraint trade-offs

3. **Code Generation**
   - Write code within line limit
   - Use only allowed dependencies
   - Follow style guide

4. **Constraint Verification**
   - Line count: [actual] vs [max]
   - Complexity: [analysis]
   - Dependencies: [used]
   - Style compliance: [check]

**Output:**
```{{language}}
// Generated code
```

**Constraint Compliance:** [report]

Details

Category

Coding

Use Cases

Constrained codingCompliant generationBounded implementation

Works Best With

claude-sonnet-4-20250514gpt-4o
Created Shared

Create your own prompt vault and start sharing

Constrained Code Generation | Promptsy