One unique way to overcome a difficult soil condition is to use "spent blocks" or Spent Mushroom Substrate (SMS) from your local culinary mushroom farm. SMS can be used in multiple ways; as mulch, as an addition to compost and as soil enrichment. The crumbled up blocks of substrate contribute organic matter and nutrients to the soil as well as increasing the soils water holding capacity.
The best way to determine your soil type is have a soil analysis done, it will tell you the makeup of your soil and the fertility or lack of. The analysis will give you recommendations, if the PH is off either lime or sulfur depending on high acidity or alkaline can be adjusted to make the soil able to sustain plant growth. A clay soil will not be well drained, adding a good quality compost and course masonry sand worked into the clay will produce larger cavities between the clay particles allowing more air spaces and improve drainage, the compost will add fertility and assisted the plants to root deeply ,do not use fine beach sand . This can be repeated each spring before planting. , Eventually the clay will be broken down, tiling may be useful to remove excess water that cannot penetrate clay deeper down.
A simple technique I've used on many projects is to simply create a raised garden bed. Using natural stone to frame lawn areas, landscape beds can be raised 12" to 18" from existing soil which allows for the opportunity to clean up the base soil, add in health top soil and mulch. Not only is this a way to overcome a difficult soil condition, but it also aesthetically improves the appearance of a garden.
To overcome acidic, compacted, depleted soil conditions on a rooftop vegetable garden, we supplied cover crops like fava beans, annual ryegrass and buckwheat to regenerate the soil. The deep roots of the ryegrass helped to aerate the compacted soil, fava beans helped infuse the soil with nitrogen, and the buckwheat helped supply much-needed organic matter to revitalize the soil. This allowed for tomatoes and vegetables to grow successfully in the space once more.