     public var errorDescription: String? {
         switch self {
         case .unsupportedLayout(let reason): return "The layout of your Package.swift is unsupported. \(reason)"
+        case .packageAlreadyExists: return "The package to add already exists in your package manifest."
         }
     }
 }

    }

    public static func insert(package: Repository, requirement: Requirement, into manifest: String) throws -> String {
        let swiftVersion = SwiftVersion.guessVersion(fromPackageContents: manifest)
        let (line, indentation) = try findDependenciesInsertLocation(in: manifest)



    public enum Error: Swift.Error {
        case unsupportedLayout(reason: String)
        case packageAlreadyExists
    }

    public static func findDependenciesInsertLocation(in manifest: String) throws -> (line: Int, indentation: Int) {
