These are both complete sentences. The と that follows just quotes these sentences.
These negative and positive conjugations of the base verbs are rough, very direct commands that you’d normally only give to an inferior (like a child or pet that you’re disciplining). They can sound very rude, so be careful using them in conversation! It’s safest to use these forms when you’re discussion what someone else said to you (as in this example).
This reminds me: I remember diagramming sentences in elementary school. I’ve forgotten how to do it, but it occurs to me that doing something similar with these might be fun and useful.
Something like this:
会社へは 来るなと上司 行けと妻
会社へ to the office
は as for / regarding
来るな don't come! [imperative command]
と quotation -> "Don't come!"
上司 my boss [speaker of prior quote]
行け go! [imperative command]
と quotation -> "Go!"
妻 wife [speaker of prior quote]
Regarding going to the office: / “Don’t come!” commands my boss / “Go!” commands my wife
I think it means that you end up learning the names of weeds you spend a lot of time trying to remove (researching various strategies, asking friends and neighbors, etc.). If they are easy to pull out and go away, you don’t even bother.
Oh! I have to admit that I love the fact that the Japanese word for “weed” is “random grass”!