| name | fortify-ai-code |
|---|---|
| description | Runs the "Fortifying AI-Generated Code" Confluence cheat sheet as an ordered hardening pass over a small AI-built tool, dashboard, or script, for a non-engineer owner. Phase 1 audits all ten items and writes a plain-language hardening report to HARDENING.md next to the code; Phase 2 applies fixes one item at a time on request, re-running tests after each change. Use when the user says "fortify this code", "harden my AI-generated tool", "run the fortifying cheat sheet", "is this vibe-coded script solid", "will this tool still work tomorrow", "audit my AI-built dashboard", "make this script production-ready for a non-engineer", or asks how to make a small standalone tool an AI assistant wrote for them stronger, safer, or easier to hand over. |
| version | 1.1.0 |
| author | Vlad Alexa |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
π
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ContentView.swift | |
| // sandbox | |
| // | |
| // Created by vlad on 21/11/2023. | |
| // | |
| import SwiftUI | |
| enum Route { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Enum.swift | |
| // | |
| // Copyright (c) 2014-present FontAwesome.swift contributors | |
| // | |
| // Permission is hereby granted, free of charge, to any person obtaining a copy | |
| // of this software and associated documentation files (the "Software"), to deal | |
| // in the Software without restriction, including without limitation the rights | |
| // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| // copies of the Software, and to permit persons to whom the Software is | |
| // furnished to do so, subject to the following conditions: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // SimpleClient.swift | |
| // | |
| // Created by Sarp Solakoglu on 18/09/2017. | |
| // Copyright Β© 2017 Sarp Solakoglu. All rights reserved. | |
| // | |
| import Foundation | |
| enum RestMethod: String { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //1 , cant be right as assigning instance variable does not make a copy | |
| var fooBar = self.fooBar | |
| fooBar.forEach({ foo in | |
| if foo.id == bar.id { | |
| fooBar.remove(at: fooBar.index(of: foo)!) | |
| } | |
| }) | |
| self.fooBar = fooBar | |
| //2, seems right as enumerated makes a copy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public func RegexValidationWithMessage(_ message:String, regex:String, allowingNull:Bool = true) -> Validation<String>? { | |
| if let regex = try? NSRegularExpression(pattern: regex, options: .CaseInsensitive) { | |
| return Validation<String>(message: message, validation: { (value) -> Bool in | |
| let nullValidation = NonEmptyStringValidation("") | |
| guard let stringValue = value else { | |
| return false | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)mouseDown:(NSEvent*)event | |
| { | |
| //create a NSPasteboardItem | |
| NSPasteboardItem *pbItem = [NSPasteboardItem new]; | |
| [pbItem setDataProvider:self forTypes:[NSArray arrayWithObjects:NSPasteboardTypeTIFF, nil]]; | |
| //create a new NSDraggingItem with our pasteboard item. | |
| NSDraggingItem *dragItem = [[NSDraggingItem alloc] initWithPasteboardWriter:pbItem]; | |
| NSPoint dragPosition = [self convertPoint:[event locationInWindow] fromView:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation LaunchButton | |
| - (id)initWithFrame:(NSRect)frame { | |
| self = [super initWithFrame:frame]; | |
| if (self) { | |
| // Initialization code here. | |
| NSTrackingArea *area = [[NSTrackingArea alloc] initWithRect:NSZeroRect options:NSTrackingMouseEnteredAndExited | NSTrackingActiveAlways | NSTrackingInVisibleRect owner:self userInfo:nil]; | |
| [self addTrackingArea:area]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float lastTick = 0.0; | |
| for (int i = 0; i <= 900; i++) { | |
| float t = [self tickX:9 timesOfTotal:900 current:i lastTick:lastTick]; | |
| if (t > 0) { | |
| NSLog(@"%f %i",t,i); | |
| lastTick = t; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NSView *parent = [[NSView alloc] initWithFrame:NSZeroRect]; | |
| NSView *child = [[NSView alloc] initWithFrame:NSZeroRect]; | |
| [parent addSubview:child]; | |
| [child setWantsLayer:YES]; | |
| CALayer *childLayer = [child layer]; | |
| CATransformLayer *transformLayer = [CATransformLayer layer]; | |
| [transformLayer addSublayer:childLayer]; | |
| [parent setWantsLayer:YES]; | |
| NSLog(@"%@",childLayer); | |
| NSLog(@"%@",transformLayer.sublayers); |
NewerOlder