We present a model for Monte Carlo simulation of the fragmentation of a polarized quark. The model is based on string dynamics and the P30 mechanism of quark pair creation at string breaking. The fragmentation is treated as a recursive process, where the splitting function of the subprocess q→h+q′ depends on the spin density matrix of the quark q. The P30 mechanism is parametrized by a complex mass parameter μ, the imaginary part of which is responsible for single spin asymmetries. The model has been implemented in a Monte Carlo program to simulate jets made of pseudoscalar mesons. Results for single hadron and hadron pair transverse-spin asymmetries are found to be in agreement with experimental data from SIDIS and e+e- annihilation. The model predictions on the jet-handedness are also discussed.